RFR: 8273408: java.lang.AssertionError: typeSig ERROR on generated class property of record [v2]

Vicente Romero vromero at openjdk.java.net
Wed Sep 15 14:30:52 UTC 2021

On Wed, 15 Sep 2021 06:10:27 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Hi all,
>> After processing annotation, if new source files are generated, the compiler should re-parse and re-enter the source files so that the type and symbol can keep right. The compiler always holds this convention in the past. But when the feature `record` is added, the convention is broken. In this bug, the compiler doesn't  catch or enter the new/good type for record component after processing annotation. So some issues may occur at the later phases.
>> This patch fixes the type of the record component so that the phases `Gen` and `ClassWriter` can get the right type. And a test case is added.
>> Thanks for taking the time to review.
>> Best Regards,
>> -- Guoxiong
> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision:
>   Treat source as comment mistakenly. Remove the comment symbol.

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1514:

> 1512:                 if (rc.name == var.name && var.pos == rc.pos) {
> 1513:                     if (rc.type.hasTag(TypeTag.ERROR) && !var.sym.type.hasTag(TypeTag.ERROR)) {
> 1514:                         // Found a wrong record component: save it so that we can remove it later.

suggestion for the comment:

Found a record component with an erroneous type, save it so that it can be removed later.
If the class type of the ...

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1526:

> 1524:             RecordComponent rc = null;
> 1525:             if (toRemove != null) {
> 1526:                 // Found a wrong record component: remove it and create a new one.


Found a record component with an erroneous type, remove it and create a new one


PR: https://git.openjdk.java.net/jdk/pull/5511

More information about the compiler-dev mailing list