当前位置: 首页>>代码示例>>Java>>正文


Java ClsUtil.isAbstract方法代码示例

本文整理汇总了Java中com.intellij.util.cls.ClsUtil.isAbstract方法的典型用法代码示例。如果您正苦于以下问题:Java ClsUtil.isAbstract方法的具体用法?Java ClsUtil.isAbstract怎么用?Java ClsUtil.isAbstract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.cls.ClsUtil的用法示例。


在下文中一共展示了ClsUtil.isAbstract方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hasBaseAbstractMethods

import com.intellij.util.cls.ClsUtil; //导入方法依赖的package包/类
private boolean hasBaseAbstractMethods(int qName, Set methodsToCheck) throws CacheCorruptedException {
  final SymbolTable symbolTable = myDependencyCache.getSymbolTable();
  final Cache oldCache = myDependencyCache.getCache();
  final Cache newCache = myDependencyCache.getNewClassesCache();
  final Cache cache = newCache.containsClass(qName)? newCache : oldCache; // use recompiled version (if any) for searching methods
  for (Iterator it = methodsToCheck.iterator(); it.hasNext();) {
    final MethodInfo methodInfo = (MethodInfo)it.next();
    final MethodInfo superMethod = cache.findMethodsBySignature(qName, methodInfo.getDescriptor(symbolTable), symbolTable);
    if (superMethod != null) {
      if (ClsUtil.isAbstract(superMethod.getFlags())) {
        return true;
      }
      it.remove();
    }
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:JavaDependencyProcessor.java

示例2: hasBaseAbstractMethods

import com.intellij.util.cls.ClsUtil; //导入方法依赖的package包/类
private boolean hasBaseAbstractMethods(int qName, Set methodsToCheck) throws CacheCorruptedException {
  final SymbolTable symbolTable = myJavaDependencyCache.getSymbolTable();
  final Cache oldCache = myJavaDependencyCache.getCache();
  final Cache newCache = myJavaDependencyCache.getNewClassesCache();
  final Cache cache = newCache.containsClass(qName)? newCache : oldCache; // use recompiled version (if any) for searching methods
  for (Iterator it = methodsToCheck.iterator(); it.hasNext();) {
    final MethodInfo methodInfo = (MethodInfo)it.next();
    final MethodInfo superMethod = cache.findMethodsBySignature(qName, methodInfo.getDescriptor(symbolTable), symbolTable);
    if (superMethod != null) {
      if (ClsUtil.isAbstract(superMethod.getFlags())) {
        return true;
      }
      it.remove();
    }
  }
  return false;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:18,代码来源:JavaDependencyProcessor.java

示例3: MethodChangeDescription

import com.intellij.util.cls.ClsUtil; //导入方法依赖的package包/类
public MethodChangeDescription(final MethodInfo oldMethod, final MethodInfo newMethod, SymbolTable symbolTable) throws CacheCorruptedException {
  final String oldRtDescriptor = oldMethod.getReturnTypeDescriptor(symbolTable);
  final String newRtDescriptor = newMethod.getReturnTypeDescriptor(symbolTable);
  returnTypeDescriptorChanged = !oldRtDescriptor.equals(newRtDescriptor);

  final int oldGenericSignature = oldMethod.getGenericSignature();
  final int newGenericSignature = newMethod.getGenericSignature();
  if (oldGenericSignature == newGenericSignature) {
    returnTypeGenericSignatureChanged = false;
    paramsGenericSignatureChanged = false;
  }
  else {
    if (oldGenericSignature != -1 && newGenericSignature != -1) {
      try {
        final GenericMethodSignature _oldGenericMethodSignature = GenericMethodSignature.parse(symbolTable.getSymbol(oldGenericSignature));
        final GenericMethodSignature _newGenericMethodSignature = GenericMethodSignature.parse(symbolTable.getSymbol(newGenericSignature));
        returnTypeGenericSignatureChanged = !_oldGenericMethodSignature.getReturnTypeSignature().equals(_newGenericMethodSignature.getReturnTypeSignature());
        paramsGenericSignatureChanged = !_oldGenericMethodSignature.getFormalTypeParams().equals(_newGenericMethodSignature.getFormalTypeParams()) ||
                                        !Arrays.equals(_oldGenericMethodSignature.getParamSignatures(), _newGenericMethodSignature.getParamSignatures());
      }
      catch (SignatureParsingException e) {
        throw new CacheCorruptedException(e);
      }
    }
    else {
      returnTypeGenericSignatureChanged = true;
      paramsGenericSignatureChanged = true;
    }
  }

  throwsListChanged = !CacheUtils.areArraysContentsEqual(oldMethod.getThrownExceptions(), newMethod.getThrownExceptions());

  final int oldFlags = oldMethod.getFlags();
  final int newFlags = newMethod.getFlags();
  flagsChanged = oldFlags != newFlags;

  staticPropertyChanged = (ClsUtil.isStatic(oldFlags) && !ClsUtil.isStatic(newFlags)) ||  (!ClsUtil.isStatic(oldFlags) && ClsUtil.isStatic(newFlags)); // was not static and became static or was static and became not static
  accessRestricted = MakeUtil.isMoreAccessible(oldFlags, newFlags);
  becameAbstract = !ClsUtil.isAbstract(oldFlags) && ClsUtil.isAbstract(newFlags);

  final ConstantValue oldDefault = oldMethod.getAnnotationDefault();
  final ConstantValue newDefault = newMethod.getAnnotationDefault();
  removedAnnotationDefault = (oldDefault != null && !ConstantValue.EMPTY_CONSTANT_VALUE.equals(oldDefault)) && (newDefault == null || ConstantValue.EMPTY_CONSTANT_VALUE.equals(newDefault));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:45,代码来源:MethodChangeDescription.java

示例4: isAbstract

import com.intellij.util.cls.ClsUtil; //导入方法依赖的package包/类
public boolean isAbstract() {
  return ClsUtil.isAbstract(getFlags());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:MethodInfo.java

示例5: MethodChangeDescription

import com.intellij.util.cls.ClsUtil; //导入方法依赖的package包/类
public MethodChangeDescription(final MethodInfo oldMethod, final MethodInfo newMethod, SymbolTable symbolTable) throws
                                                                                                                CacheCorruptedException {
  final String oldRtDescriptor = oldMethod.getReturnTypeDescriptor(symbolTable);
  final String newRtDescriptor = newMethod.getReturnTypeDescriptor(symbolTable);
  returnTypeDescriptorChanged = !oldRtDescriptor.equals(newRtDescriptor);

  final int oldGenericSignature = oldMethod.getGenericSignature();
  final int newGenericSignature = newMethod.getGenericSignature();
  if (oldGenericSignature == newGenericSignature) {
    returnTypeGenericSignatureChanged = false;
    paramsGenericSignatureChanged = false;
  }
  else {
    if (oldGenericSignature != -1 && newGenericSignature != -1) {
      try {
        final GenericMethodSignature _oldGenericMethodSignature = GenericMethodSignature.parse(symbolTable.getSymbol(oldGenericSignature));
        final GenericMethodSignature _newGenericMethodSignature = GenericMethodSignature.parse(symbolTable.getSymbol(newGenericSignature));
        returnTypeGenericSignatureChanged = !_oldGenericMethodSignature.getReturnTypeSignature().equals(_newGenericMethodSignature.getReturnTypeSignature());
        paramsGenericSignatureChanged = !_oldGenericMethodSignature.getFormalTypeParams().equals(_newGenericMethodSignature.getFormalTypeParams()) ||
                                        !Arrays.equals(_oldGenericMethodSignature.getParamSignatures(), _newGenericMethodSignature.getParamSignatures());
      }
      catch (SignatureParsingException e) {
        throw new CacheCorruptedException(e);
      }
    }
    else {
      returnTypeGenericSignatureChanged = true;
      paramsGenericSignatureChanged = true;
    }
  }

  throwsListChanged = !CacheUtils.areArraysContentsEqual(oldMethod.getThrownExceptions(), newMethod.getThrownExceptions());

  final int oldFlags = oldMethod.getFlags();
  final int newFlags = newMethod.getFlags();
  flagsChanged = oldFlags != newFlags;

  staticPropertyChanged = (ClsUtil.isStatic(oldFlags) && !ClsUtil.isStatic(newFlags)) ||  (!ClsUtil.isStatic(oldFlags) && ClsUtil.isStatic(newFlags)); // was not static and became static or was static and became not static
  accessRestricted = JavaMakeUtil.isMoreAccessible(oldFlags, newFlags);
  becameAbstract = !ClsUtil.isAbstract(oldFlags) && ClsUtil.isAbstract(newFlags);

  final ConstantValue oldDefault = oldMethod.getAnnotationDefault();
  final ConstantValue newDefault = newMethod.getAnnotationDefault();
  removedAnnotationDefault = (oldDefault != null && !ConstantValue.EMPTY_CONSTANT_VALUE.equals(oldDefault)) && (newDefault == null || ConstantValue.EMPTY_CONSTANT_VALUE.equals(newDefault));
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:46,代码来源:MethodChangeDescription.java


注:本文中的com.intellij.util.cls.ClsUtil.isAbstract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。