-
Bug
-
Resolution: Fixed
-
P4
-
15, 16
-
b24
-
generic
-
generic
-
Verified
A DESCRIPTION OF THE PROBLEM :
During annotation processing TypeElement#getRecordComponents returns empty list for Records which are located in another jar.
In Java 16.ea.28 TypeElement#getRecordComponents works correctly. However, the returned RecordComponentModel returns null for RecordComponentElement#getAccessor
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
To reproduce on Java 15:
1. git clone https://github.com/filiphr/mapstruct-2294.git
2. Make sure that you have setup Java 15
3. Run: export MAVEN_OPTS="--enable-preview" && ./mvnw clean verify
To reproduce on Java 16.ea.28:
1. git clone https://github.com/filiphr/mapstruct-2294.git
2. Make sure that you have setup Java 15
3. Run: export MAVEN_OPTS="--enable-preview" && ./mvnw clean verify -Djava.version=16
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected a successful compilation
ACTUAL -
On Java 15 the result will be a compilation error coming from the TestProcessor (part of the project)
because TypeElement#getRecordComponents does not return any record components for records coming from another jar (not in the compilation round).
The error message will be: "Record element source.SourceInAnotherPackage has no record components"
On Java 16 the result will be a compilation error coming from the TestProcessor (part of the project)
because `RecordComponentElement#getAccessor` returns `null` for records coming from another jar (not in the compilation round).
The error message will be: "Record component data from record element source.SourceInAnotherPackage has no accessor"
---------- BEGIN SOURCE ----------
https://github.com/filiphr/mapstruct-2294
---------- END SOURCE ----------
FREQUENCY : always
During annotation processing TypeElement#getRecordComponents returns empty list for Records which are located in another jar.
In Java 16.ea.28 TypeElement#getRecordComponents works correctly. However, the returned RecordComponentModel returns null for RecordComponentElement#getAccessor
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
To reproduce on Java 15:
1. git clone https://github.com/filiphr/mapstruct-2294.git
2. Make sure that you have setup Java 15
3. Run: export MAVEN_OPTS="--enable-preview" && ./mvnw clean verify
To reproduce on Java 16.ea.28:
1. git clone https://github.com/filiphr/mapstruct-2294.git
2. Make sure that you have setup Java 15
3. Run: export MAVEN_OPTS="--enable-preview" && ./mvnw clean verify -Djava.version=16
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected a successful compilation
ACTUAL -
On Java 15 the result will be a compilation error coming from the TestProcessor (part of the project)
because TypeElement#getRecordComponents does not return any record components for records coming from another jar (not in the compilation round).
The error message will be: "Record element source.SourceInAnotherPackage has no record components"
On Java 16 the result will be a compilation error coming from the TestProcessor (part of the project)
because `RecordComponentElement#getAccessor` returns `null` for records coming from another jar (not in the compilation round).
The error message will be: "Record component data from record element source.SourceInAnotherPackage has no accessor"
---------- BEGIN SOURCE ----------
https://github.com/filiphr/mapstruct-2294
---------- END SOURCE ----------
FREQUENCY : always