This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Failing test case with this failure: expected same:<DECLARED> was not:<ERROR> If you add parenthesis after @Deprecated annotation, it works fine. public void testAnnotation() throws IOException { FileObject fileObject = TestUtilities.copyStringToFileObject(srcFO, "foo/Bar.java", "package foo;" + "@Deprecated" + "public class Bar {" + "}"); JavaSource javaSource = JavaSource.forFileObject(fileObject); javaSource.runUserActionTask(new CancellableTask<CompilationController>() { public void run(CompilationController controller) throws IOException { controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); TypeElement typeElement = controller.getElements().getTypeElement("foo.Bar"); AnnotationMirror annotationMirror = typeElement.getAnnotationMirrors().get(0); DeclaredType declaredType = annotationMirror.getAnnotationType(); assertSame(TypeKind.DECLARED, declaredType.getKind()); } public void cancel() {} }, true); }
I am able to reproduce it also on field annotation.
Please note that the code in the example is: package foo;@Deprecatedpublic class Bar {} so the annotation is "@Deprecatedpublic", which is correctly marked as an error. Please reopen if the problem is somewhere else.
Oops, sorry about that :-)
Reorganization of java component