Strange compiler error with @NonNls and Enums
I have created this enum:
public enum ImageFormat {
JPEG( "jpg" );
@NotNull
@NonNls
private final String suffix;
ImageFormat( @NotNull @NonNls String suffix ) {
this.suffix = suffix;
}
@NotNull
@NonNls
public String getSuffix() {
return suffix;
}
}
When I recompile a class that uses this enum I get the following error:
Error:Error:line (10)cannot access
eu.cedarsoft.invoices.scan.ImageFormat
bad class file:
/home/johannes/projects/eu/cedarsoft/invoices/target/classes/eu/cedarsoft/invoices/scan/ImageFormat.class
bad RuntimeInvisibleParameterAnnotations attribute:
ImageFormat(java.lang.String)
Please remove or make sure it appears in the correct subdirectory of the
classpath.
Recompiling the hole projects resolves the issue.
Removing the "@NonNls" annotations solves the issue. I don't have an
idea what the problem might be. Any suggestions?
Regards,
Johannes Schneider
Please sign in to leave a comment.
Hello Johannes,
This should be fixed in 7118.
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Dmitry Jemerov wrote:
>> Removing the "@NonNls" annotations solves the issue. I don't have an
>> idea what the problem might be. Any suggestions?
Hmm, I am using 7118 here....
Johannes Schneider
Hello Johannes,
>>> Removing the "@NonNls" annotations solves the issue. I don't have an
>>> idea what the problem might be. Any suggestions?
>>>
>> This should be fixed in 7118.
>>
You're building with built-in compiler rather than the Ant javac2 task, right?
And you tried to rebuild the enum class with 7118 and it still fails?
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Dmitry Jemerov wrote:
Yes, that is true.
Recompiling the whole project solves the issue. But the incremental
compile (just starting a test using ctrl-F10) does not work.
Johannes Schneider
Hello Johannes,
>> You're building with built-in compiler rather than the Ant javac2
>> task, right? And you tried to rebuild the enum class with 7118 and it
>> still fails?
>>
Indeed, I could reproduce this with your
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hello Johannes,
>> task, right? And you tried to rebuild the enum class with 7118 and it
>> still fails?
>>
(sorry, incomplete post)
Indeed, I was able to reproduce the problem with your example. I'll investigate
this further. Thanks for reporting. :)
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"