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());
 }
Esempio n. 2
0
 public static Value createValue(VirtualMachineProxyImpl vm, String expectedType, boolean value) {
   if (PsiType.BOOLEAN.getPresentableText().equals(expectedType)) {
     return vm.mirrorOf(value);
   }
   return null;
 }
Esempio n. 3
0
 private static boolean isBoolean(@Nullable PsiType propertyType) {
   return PsiType.BOOLEAN.equals(propertyType)
       || propertyType != null
           && CommonClassNames.JAVA_LANG_BOOLEAN.equals(propertyType.getCanonicalText());
 }