當前位置: 首頁>>代碼示例>>Java>>正文


Java ClsUtil.isStatic方法代碼示例

本文整理匯總了Java中com.intellij.util.cls.ClsUtil.isStatic方法的典型用法代碼示例。如果您正苦於以下問題:Java ClsUtil.isStatic方法的具體用法?Java ClsUtil.isStatic怎麽用?Java ClsUtil.isStatic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.util.cls.ClsUtil的用法示例。


在下文中一共展示了ClsUtil.isStatic方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findModifiedConstants

import com.intellij.util.cls.ClsUtil; //導入方法依賴的package包/類
private void findModifiedConstants(
  final int qName,
  Collection<ChangedConstantsDependencyProcessor.FieldChangeInfo> changedConstants,
  Collection<ChangedConstantsDependencyProcessor.FieldChangeInfo> removedConstants) throws CacheCorruptedException {

  final Cache cache = getCache();
  for (final FieldInfo field : cache.getFields(qName)) {
    final int oldFlags = field.getFlags();
    if (ClsUtil.isStatic(oldFlags) && ClsUtil.isFinal(oldFlags)) {
      final Cache newClassesCache = getNewClassesCache();
      FieldInfo newField = newClassesCache.findFieldByName(qName, field.getName());
      if (newField == null) {
        if (!ConstantValue.EMPTY_CONSTANT_VALUE.equals(field.getConstantValue())) {
          // if the field was really compile time constant
          removedConstants.add(new ChangedConstantsDependencyProcessor.FieldChangeInfo(field));
        }
      }
      else {
        final boolean visibilityRestricted = MakeUtil.isMoreAccessible(oldFlags, newField.getFlags());
        if (!field.getConstantValue().equals(newField.getConstantValue()) || visibilityRestricted) {
          changedConstants.add(new ChangedConstantsDependencyProcessor.FieldChangeInfo(field, visibilityRestricted));
        }
      }
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:27,代碼來源:DependencyCache.java

示例2: findModifiedConstants

import com.intellij.util.cls.ClsUtil; //導入方法依賴的package包/類
private void findModifiedConstants(final int qName,
                                   Collection<ChangedConstantsDependencyProcessor.FieldChangeInfo> changedConstants,
                                   Collection<ChangedConstantsDependencyProcessor.FieldChangeInfo> removedConstants)
  throws CacheCorruptedException {

  final Cache cache = getCache();
  for (final FieldInfo field : cache.getFields(qName)) {
    final int oldFlags = field.getFlags();
    if (ClsUtil.isStatic(oldFlags) && ClsUtil.isFinal(oldFlags)) {
      final Cache newClassesCache = getNewClassesCache();
      FieldInfo newField = newClassesCache.findFieldByName(qName, field.getName());
      if (newField == null) {
        if (!ConstantValue.EMPTY_CONSTANT_VALUE.equals(field.getConstantValue())) {
          // if the field was really compile time constant
          removedConstants.add(new ChangedConstantsDependencyProcessor.FieldChangeInfo(field));
        }
      }
      else {
        final boolean visibilityRestricted = JavaMakeUtil.isMoreAccessible(oldFlags, newField.getFlags());
        if (!field.getConstantValue().equals(newField.getConstantValue()) || visibilityRestricted) {
          changedConstants.add(new ChangedConstantsDependencyProcessor.FieldChangeInfo(field, visibilityRestricted));
        }
      }
    }
  }
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:27,代碼來源:JavaDependencyCache.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: isStatic

import com.intellij.util.cls.ClsUtil; //導入方法依賴的package包/類
public boolean isStatic() {
  return ClsUtil.isStatic(myFlags);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:4,代碼來源:MemberInfo.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.isStatic方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。