Fwd: Mandated/implicit parameters

Hannes Greule hannesgreule at outlook.de
Tue Jun 7 15:00:06 UTC 2022


 > So, your approach would fix all these issues reported.

That's interesting, I didn't think  of other related issues before.

However, this would only fix the issue for newly compiled class files 
and only for compile targets >= Java 8 from my understanding.

How should we go forward from here? I think I got a working fix for it 
on this branch[1] and I already ran the langtools_javac tests.
There are two failing tests, one of them[2] was assuming a wrong 
constant pool index (as the MethodParameter attribute wasn't written 
before). I updated the test accordingly.

The other one[3] seems to be an issue with the ClassReader here[4].

[1] 
https://github.com/SirYwell/jdk/tree/fix/enforce-methodparam_attr-if-mandated
[2] 
https://github.com/openjdk/jdk/blob/master/test/langtools/tools/javac/annotations/typeAnnotations/classfile/AnnotatedExtendsTest.java#L62
[3] 
https://github.com/openjdk/jdk/blob/master/test/langtools/tools/javac/6889255/T6889255.java
[4] 
https://github.com/openjdk/jdk/blob/062db59eeb8ba6389aaa3c622dbc109a92d580ca/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L1069-L1071



More information about the compiler-dev mailing list