private static boolean isCompileTimeFlagReference(PsiElement element) {
   PsiElement resolved =
       element instanceof PsiReferenceExpression
           ? ((PsiReferenceExpression) element).resolve()
           : null;
   if (!(resolved instanceof PsiField)) return false;
   PsiField field = (PsiField) resolved;
   return field.hasModifierProperty(PsiModifier.FINAL)
       && field.hasModifierProperty(PsiModifier.STATIC)
       && PsiType.BOOLEAN.equals(field.getType());
 }
示例#2
0
 public static Value createValue(VirtualMachineProxyImpl vm, String expectedType, boolean value) {
   if (PsiType.BOOLEAN.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf(value);
   }
   return null;
 }
示例#3
0
 private static boolean isBoolean(@Nullable PsiType propertyType) {
   return PsiType.BOOLEAN.equals(propertyType)
       || propertyType != null
           && CommonClassNames.JAVA_LANG_BOOLEAN.equals(propertyType.getCanonicalText());
 }