Skip to content

Commit bd99e45

Browse files
authored
Remove dead stores (#797)
* Remove dead stores * Fix imports
1 parent cc90fe8 commit bd99e45

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

src/main/java/org/openrewrite/staticanalysis/RenameExceptionInEmptyCatch.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.time.Duration;
2727
import java.util.*;
2828

29-
import static java.util.Objects.requireNonNull;
3029
import static java.util.stream.Collectors.toList;
3130

3231
public class RenameExceptionInEmptyCatch extends Recipe {
@@ -53,7 +52,6 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
5352
@Override
5453
public J visit(@Nullable Tree tree, ExecutionContext ctx) {
5554
if (tree instanceof JavaSourceFile) {
56-
JavaSourceFile cu = (JavaSourceFile) requireNonNull(tree);
5755
Map<Cursor, Set<String>> variableScopes = new LinkedHashMap<>();
5856
getCursor().putMessage("VARIABLES_KEY", variableScopes);
5957
}

src/main/java/org/openrewrite/staticanalysis/ReplaceDuplicateStringLiterals.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ct
145145
variableNames.add(variableName);
146146
entry.getValue().forEach(v -> replacements.put(v, variableName));
147147
}
148-
duplicateLiteralInfo = null;
149-
duplicateLiteralsMap = null;
150148
return replacements.isEmpty() ? classDecl :
151149
new ReplaceStringLiterals(classDecl, replacements).visitNonNull(classDecl, ctx, requireNonNull(getCursor().getParent()));
152150
}

0 commit comments

Comments
 (0)