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

6 comments
Comment actions Permalink

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.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Dmitry Jemerov wrote:

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.


Hmm, I am using 7118 here....


Johannes Schneider

0
Comment actions Permalink

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.
>>

Hmm, I am using 7118 here....


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!"


0
Comment actions Permalink

Dmitry Jemerov wrote:


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?


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

0
Comment actions Permalink

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?
>>

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.


Indeed, I could reproduce this with your

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

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?
>>

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.


(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!"


0

Please sign in to leave a comment.