NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Have annotations gone too far too fast?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Developers
View previous topic :: View next topic  
Author Message
pblemel



Joined: 31 Mar 2009
Posts: 156

PostPosted: Wed Jun 27, 2012 5:11 am    Post subject: Have annotations gone too far too fast? Reply with quote

Hello World,

More and more frequently in newer NetBeans versions compilations fail with exceptions such as :

An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract int org.netbeans.core.spi.multiview.MultiViewElement$Registration.persistenceType() (Found data of type int)
at com.sun.tools.javac.model.AnnotationProxyMaker$ValueVisitor$1AnnotationTypeMismatchExceptionProxy.generateException(AnnotationProxyMaker.java:264)
at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:75)
at $Proxy41.persistenceType(Unknown Source)
at org.netbeans.core.multiview.MultiViewProcessor.handleProcess(MultiViewProcessor.java:114)
at org.openide.filesystems.annotations.LayerGeneratingProcessor.process(LayerGeneratingProcessor.java:124)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1106)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)


I get similar dumps from other NetBeans annotation processors (Web services, for example). I see these types of stack traces during a build, usually after I've changed an annotation, sometimes intentionally but also sometimes with a stray keystroke. It always takes me a long time to figure out what went wrong.

The above call stack was generated after creating a brand new module and adding a new file type to it (nothing more). I haven't even touched any code. This is a completely useless diagnostic / traceback. It doesn't tell me anything about which file is being compiled, what annotation is not correct ... a line number ... anything. It is very frustrating and brings development of what was a very simple process (a new file type) to a complete dead stop.

In the case of tonight's brand new module the only auto-generated MultiView annotation is in the DataObject. Looking at the annotation there, I can't figure out what's wrong :

@MultiViewElement.Registration(displayName = "#LBL_Model_EDITOR",
iconBase = "SET/PATH/TO/ICON/HERE",
mimeType = "application/x-zip",
persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
preferredID = "Model",
position = 1000)
@Messages("LBL_Model_EDITOR=Source")

It seems to me that the annotation processors that are being pushed into new versions are not robust enough for general use. These tracebacks are not uncommon. It's getting to the point where every time I make a change I have to do a build just so that if a bad processor chokes, I'll have some idea of what I just changed (or fat-fingered). If I go too long without building, it is a tedious process to figure out where the problem is. It is slowing down development considerably.

Annotations are not code, and the quality assurance measures applied to the Java compiler are completely bypassed during their processing. They are being treated like code, however. It seems like the race to do everything with annotations without quality assurance has the side effect of complicating development and frustrating developers (at least me, anyway).

At this point I don't even care what the problem is with these annotations. I know how to add a file type "the old way" and can get past this, but it is frustrating.

Thank you
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Developers All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo