Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ public class TooManyParameters extends BugChecker implements MethodTreeMatcher {
"java.lang.Deprecated",
"java.lang.Override",
// dependency injection annotations
"jakarta.inject.Inject",
"javax.inject.Inject",
"com.google.inject.Inject",
"com.google.inject.Provides",
// JUnit @Test methods are never directly invoked (most of the time they don't even have
// parameters, unless it's a parameterized test --- which still are not directly
Expand Down Expand Up @@ -108,6 +105,10 @@ private static boolean shouldApplyApiChecks(MethodTree tree, VisitorState state)
if (isRecord(symbol)) {
return false;
}
if (tree.getModifiers().getAnnotations().stream()
.anyMatch(a -> getSymbol(a).getSimpleName().toString().contains("Inject"))) {
return false;
}
return METHOD_ANNOTATIONS_TO_IGNORE.stream().noneMatch(a -> hasAnnotation(tree, a, state))
&& methodIsPublicAndNotAnOverride(symbol, state);
}
Expand Down
Loading