Skip to content

Commit 3e1736b

Browse files
SONARJAVA-5666 Delete code that is now unused (#5232)
1 parent b7553c5 commit 3e1736b

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

java-checks/src/main/java/org/sonar/java/checks/ClassNameInClassTransformCheck.java

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.sonar.java.checks;
1818

1919
import java.util.List;
20-
import java.util.function.Predicate;
2120

2221
import org.sonar.check.Rule;
2322
import org.sonar.java.matcher.TreeMatcher;
@@ -32,8 +31,6 @@
3231
import org.sonar.plugins.java.api.tree.MethodInvocationTree;
3332
import org.sonar.plugins.java.api.tree.Tree;
3433

35-
import javax.annotation.Nullable;
36-
3734
import static org.sonar.java.matcher.TreeMatcher.calls;
3835
import static org.sonar.java.matcher.TreeMatcher.invokedOn;
3936
import static org.sonar.java.matcher.TreeMatcher.isIdentifier;
@@ -107,55 +104,6 @@ public class ClassNameInClassTransformCheck extends IssuableSubscriptionVisitor
107104
.addWithoutParametersMatcher()
108105
.build();
109106

110-
static class ExpressionMatcher {
111-
@Nullable
112-
private final ExpressionTree expressionTree;
113-
114-
ExpressionMatcher(@Nullable ExpressionTree expressionTree) {
115-
this.expressionTree = expressionTree;
116-
}
117-
118-
CallMatcher calls(MethodMatchers methodMatchers) {
119-
if (expressionTree instanceof MethodInvocationTree mit && methodMatchers.matches(mit)) {
120-
return new CallMatcher(mit);
121-
}
122-
return new CallMatcher(null);
123-
}
124-
125-
boolean isIdentifier(IdentifierTree identifier) {
126-
if (expressionTree instanceof IdentifierTree id) {
127-
return id.symbol().equals(identifier.symbol());
128-
}
129-
return false;
130-
}
131-
132-
boolean matches(Predicate<ExpressionTree> predicate) {
133-
return expressionTree != null && predicate.test(expressionTree);
134-
}
135-
}
136-
137-
static class CallMatcher {
138-
139-
/** When {@link #methodInvocationTree} is null, the matcher doesn't match anything. */
140-
@Nullable
141-
private final MethodInvocationTree methodInvocationTree;
142-
143-
CallMatcher(@Nullable MethodInvocationTree methodInvocationTree) {
144-
this.methodInvocationTree = methodInvocationTree;
145-
}
146-
147-
ExpressionMatcher withArgument(int argumentIndex) {
148-
if (methodInvocationTree != null && methodInvocationTree.arguments().size() >= argumentIndex) {
149-
return new ExpressionMatcher(methodInvocationTree.arguments().get(argumentIndex));
150-
}
151-
return new ExpressionMatcher(null);
152-
}
153-
}
154-
155-
static ExpressionMatcher check(ExpressionTree expression) {
156-
return new ExpressionMatcher(expression);
157-
}
158-
159107
@Override
160108
public List<Tree.Kind> nodesToVisit() {
161109
return List.of(Tree.Kind.METHOD_INVOCATION);

0 commit comments

Comments
 (0)