void () { PsiMethod[] methods = getFile("Annotation").getClasses()[0].getMethods(); assertNotNull(((PsiAnnotationMethod)methods[0]).getDefaultValue()); methods = getFile("Annotation2").getClasses()[0].getMethods(); for (PsiMethod method : methods) { assertTrue(String.valueOf(method), method instanceof PsiAnnotationMethod); try { PsiAnnotationMemberValue defaultValue = ((PsiAnnotationMethod)method).getDefaultValue(); assertTrue(String.valueOf(defaultValue), defaultValue instanceof PsiBinaryExpression); PsiPrimitiveType type = method.getName().startsWith("f") ? PsiTypes.floatType() : PsiTypes.doubleType(); assertEquals(type, ((PsiBinaryExpression)defaultValue).getType()); } catch (Exception e) { String valueText = ((ClsMethodImpl)method).getStub().getDefaultValueText(); fail("Unable to compute default value of method " + method + " from text '" + valueText + "': " + e.getMessage()); } } }