Skip to content

Commit 1105bed

Browse files
committed
Fix constructor search for Qute template records
Addresses an issue in which the build fails with a null pointer exception due to not being able to find the record constructor because the order of the types are not in the order specified in the constructor.
1 parent c3fe24a commit 1105bed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,10 @@ void validateCheckedFragments(List<CheckedFragmentValidationBuildItem> validatio
892892
String paramName = e.getKey();
893893
MethodInfo methodOrConstructor = null;
894894
if (validation.checkedTemplate.isRecord()) {
895-
Type[] componentTypes = validation.checkedTemplate.recordClass.recordComponents().stream()
896-
.map(RecordComponentInfo::type).toArray(Type[]::new);
895+
Type[] componentTypes = validation.checkedTemplate.recordClass.recordComponentsInDeclarationOrder()
896+
.stream()
897+
.map(RecordComponentInfo::type)
898+
.toArray(Type[]::new);
897899
methodOrConstructor = validation.checkedTemplate.recordClass
898900
.method(MethodDescriptor.INIT, componentTypes);
899901
} else {

0 commit comments

Comments
 (0)