New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: RetentionPolicy.RUNTIME annotations are not always retained at runtime #8926
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8926?orig=1 |
@soc said: |
@soc said: |
@adriaanm said: Would compiling the java sources with javac and not with scalac be a feasible workaround for you? |
@adriaanm said: |
@lrytz said (edited on Oct 20, 2014 9:22:58 AM UTC): @soc: this is totally not your fault: right now the Java source parser skips over all annotations, Extending the Java parser is out of scope for 2.11.4, see here what it takes. My proposal: How about we change the default visibility (in case there is no The other option is to revert the change and put the complete change in 2.11.5. What do you think? |
@soc said: I have a hard time coming up with examples which "worked" before, but would be broken after this change, but the conservative choice of revert could be an option if we want to get 2.11.4 out of the door with the most minimal risk. |
@soc said: |
@lrytz said:
|
@lrytz said: |
@gkossakowski said: Did you guys agree whether to revert #4026 or change the default value for retention policy? |
@lrytz said: |
Moving from 2.11.2 => 2.11.3, I found a weird behavior relating to Java RetentionPolicy.RUNTIME annotations. Depending on some unknown compile time factors, some runtime annotations are either included or not included in resulting classfiles.
Example (also available on GitHub):
Running above directly with sbt clean run will result in "Annotation is NOT present". Removing SomeClass.class file from target directory and running sbt run prints "Annotation is present".
Probably caused by changes due to #4788 / #5948.
Tested on OSX/Java8 and Linux/Java7
The text was updated successfully, but these errors were encountered: