Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
Randgalt committed Mar 31, 2024
1 parent 45d5dd3 commit 9a42ee2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,18 @@ private void addVisibility(boolean builderIsInRecordPackage, Set<Modifier> modif
}

private List<RecordClassType> buildRecordComponents(TypeElement record) {
var accessorAnnotations = record.getRecordComponents().stream().map(e -> e.getAccessor().getAnnotationMirrors())
var accessorAnnotations = record.getRecordComponents().stream()
.filter(e -> e.getAccessor() != null)
.map(e -> e.getAccessor().getAnnotationMirrors())
.collect(Collectors.toList());
var canonicalConstructorAnnotations = ElementUtils.findCanonicalConstructor(record)
.map(constructor -> ((ExecutableElement) constructor).getParameters().stream()
.map(Element::getAnnotationMirrors).collect(Collectors.toList()))
.orElse(List.of());
var recordComponents = record.getRecordComponents();
return IntStream.range(0, recordComponents.size()).mapToObj(index -> {
return IntStream.range(0, recordComponents.size())
.filter(index -> record.getRecordComponents().get(index).getAccessor() != null)
.mapToObj(index -> {
var thisAccessorAnnotations = (accessorAnnotations.size() > index) ? accessorAnnotations.get(index)
: List.<AnnotationMirror> of();
var thisCanonicalConstructorAnnotations = (canonicalConstructorAnnotations.size() > index)
Expand Down

0 comments on commit 9a42ee2

Please sign in to comment.