RFR: JDK-8209865: Incorrect 'multiple elements' notes with Elements#getTypeElement and --release & JDK-8209058: Cannot find annotation method 'value()' in type 'Profile+Annotation'
Jonathan Gibbons
jonathan.gibbons at oracle.com
Thu Sep 20 00:28:15 UTC 2018
On 09/19/2018 08:54 AM, Jan Lahoda wrote:
> Hi,
>
> I'd like to ask for a review of two related --release related bugs:
<snip>
>
> The second bug is:
> https://bugs.openjdk.java.net/browse/JDK-8209058
>
> Cannot find annotation method 'value()' in type 'Profile+Annotation'
>
> The problem is that compiling code like:
> ---
> import javax.annotation.processing.ProcessingEnvironment;
>
> public class NoProfileAnnotationWarning {
> void t(ProcessingEnvironment pe) {
> pe.getElementUtils().getTypeElement("a");
> }
> }
> ---
> with --release 10 and -Xlint:all may lead to warnings like:
> ---
> /9A/java.compiler/javax/annotation/processing/ProcessingEnvironment.sig:
> warning: Cannot find annotation method 'value()' in type
> 'Profile+Annotation': class file for jdk.Profile+Annotation not found
> ---
>
> The reason is that ct.sym still uses the synthetic
> jdk/Profile+Annotation annotation to assign classes to profiles. While
> this is only relevant for --release 8, to maximize data/classfile
> reuse, the annotation is present also in classfiles for other
> versions, for both the 'make/data/symbols/*.sym.txt' files and in
> ct.sym. This causes problem for --release >= 9, as the synthetic
> annotation is not always properly removed from the symbols as it is
> read in ClassReader (as it is in a non-exported package). As, after
> the first patch above, there is no sharing between classfiles for <= 8
> and >= 9 in ct.sym, the proposal is to simply remove this annotation
> for classfiles in ct.sym that are not used for --release 8.
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8209058
> Webrev: http://cr.openjdk.java.net/~jlahoda/8209058/webrev.00/
>
> How does this look?
>
> Thanks,
> Jan
This is about the second review.
This looks OK, but is conditional on the first review, and whether it is
worth trying to share between 8 and >=9 or not, so lets sort that one out.
That being said, I realize this issue may help influence the first one.
-- jon
More information about the compiler-dev
mailing list