No indication of error/warning with annotated element on annotation processing [message #998017] |
Wed, 09 January 2013 07:45 |
Stoimen Gerenski 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,
|
|
|
Powered by
FUDForum. Page generated in 0.02950 seconds