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

Vicente Romero vromero at openjdk.java.net
Wed Sep 15 01:47:08 UTC 2021


On Tue, 14 Sep 2021 16:14:39 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

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

> 1515:                         // If the class type of the record component is generated by annotation processor, it should
> 1516:                         // use the new actual class type and symbol instead of the old dummy ErrorType.
> 1517:                         // toRemove = rc;

there is dead code here, `toRemove` doesn't seem to be assigned ever, probably you uploaded an intermediate patch?

-------------

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


More information about the compiler-dev mailing list