Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » No indication of error/warning with annotated element on annotation processing(No indication of error/warning with annotated element on annotation processing)
No indication of error/warning with annotated element on annotation processing [message #998017] Wed, 09 January 2013 07:45
Stoimen Gerenski is currently offline Stoimen GerenskiFriend
Messages: 1
Registered: January 2013
Junior Member
Hi,

I have configured Eclipse for annotation processing and implemented the corresponding logic. When I am running annotation processing with javac, I get the programmed diagnostic message (see below). However, I couldn't find the same diagnostic message anywhere in Eclipse (Markers, Problems, Error Log views) when I am compiling (and annotations are accordingly processed) with Eclipse.

Here is the message I get with javac:
-=snip
[javac] C:\Workspace\src\tests\java\my\company\my\product\tests\installation\Main.java:19: Note: Generating source file for class: 'my.company.my.product.tests.installation.InformationDialog' from template 'UIDialogWrapper.vm'
[javac] public class Main extends TestBase {
[javac] ^
[javac] C:\Workspace\src\tests\java\my\company\my\product\tests\installation\Main.java:19: warning: Error writing class source file, this is probably caused by the file already generated by conflicting or reused definition: javax.annotation.processing.FilerException: Attempt to recreate a file for type my.company.my.product.tests.installation.InformationDialog
[javac]
[javac] at com.sun.tools.javac.processing.JavacFiler.checkNameAndExistence(JavacFiler.java:478)
[javac]
[javac] at com.sun.tools.javac.processing.JavacFiler.createSourceOrClassFile(JavacFiler.java:372)
[javac]
[javac] at com.sun.tools.javac.processing.JavacFiler.createSourceFile(JavacFiler.java:363)
-=snip

And here is the specific annotation processor code I am using:
-=snip
   private void generateFile(String targetClass, String velocityConfigPath,
         String templateFilePath, Map<String, Object> templateParameters, Element element) {

...
         processingEnv.getMessager().printMessage(               
               Kind.WARNING,
               e,
               "Error writing class source file, this is probably caused by the file already generated by conflicting or reused definition: ",
               element);

-=snip

If I remove the "element" parameter (of type javax.lang.model.element.Element) I get a diagnostic message in Error Log view.

I tested this with Eclipse Indigo Service Release 2 and just upgraded to the last version of Juno.

Any ideas what could be the problem?


Thanks in advance,
Previous Topic:PlatformUI.createAndRunWorkbench(..) does not return in JUnit plug-in tests
Next Topic:Eclipse VM not terminating caused by child process
Goto Forum:
  


Current Time: Fri Apr 19 00:40:25 GMT 2024

Powered by FUDForum. Page generated in 0.03063 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top