Skip to content

Commit

Permalink
mark the first added value instead of the declaration for addAll
Browse files Browse the repository at this point in the history
  • Loading branch information
Luro02 committed Apr 4, 2024
1 parent 0a9c202 commit 690fc70
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static <T> boolean isOrderedCollection(CtTypeReference<T> ctTypeReferenc
.anyMatch(ctTypeReference::isSubtypeOf);
}

private void reportProblem(CtVariable<?> ctVariable, List<CtExpression<?>> addedValues) {
private void reportProblem(CtVariable<?> ctVariable, List<? extends CtExpression<?>> addedValues) {
String values = "List.of(%s)".formatted(addedValues.stream()
.map(CtElement::prettyprint)
.collect(Collectors.joining(", "))
Expand Down Expand Up @@ -102,7 +102,7 @@ private void reportProblem(CtVariable<?> ctVariable, List<CtExpression<?>> added

if (ctEnum != null && UseEnumValues.checkEnumValues(ctEnum, isOrderedCollection(ctVariable.getType()), fieldReads)) {
addLocalProblem(
ctVariable,
addedValues.get(0).getParent(CtStatement.class),
new LocalizedMessage(
"common-reimplementation",
Map.of(
Expand Down

0 comments on commit 690fc70

Please sign in to comment.