Skip to content
Merged
Show file tree
Hide file tree
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 @@ -31,7 +31,7 @@ public String getMessage() {

@Override
public Object visit(ASTUserClass clazz, Object ctx) {
if (clazz.getSimpleName().equalsIgnoreCase("bar")) {
if ("bar".equalsIgnoreCase(clazz.getSimpleName())) {
asCtx(ctx).addViolation(clazz);
}
return super.visit(clazz, ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static Collection<NodeStream<?>> allNodeStreamVariants() {
stream.precedingSiblings(),
stream.descendantsOrSelf(),
stream.children(),
stream.children().filter(c -> c.getImage().equals("0")),
stream.children().filter(c -> "0".equals(c.getImage())),
stream.children(DummyNode.class)
)
).flatMap(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void testFilterOnChain() {
void testTransitiveSucc() {

LatticeRelation<String, String, Set<String>> lattice =
stringLattice(s -> s.equals("c") || s.equals("bc"));
stringLattice(s -> "c".equals(s) || "bc".equals(s));

lattice.put("abc", "val");
lattice.put("bc", "v2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void testFlatmapEmpty2() {
void testFlatmapIsLazy() {
Iterator<String> iter = iterOf("a", "b");
Function<String, Iterator<String>> fun = s -> {
if (s.equals("a")) {
if ("a".equals(s)) {
return iterOf("a");
} else {
throw new AssertionError("This statement shouldn't be reached");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void testRenderFilterAttributes() throws IOException {
XmlRenderingConfig strategy = new XmlRenderingConfig() {
@Override
public boolean takeAttribute(Node node, Attribute attribute) {
return attribute.getName().equals("ohio");
return "ohio".equals(attribute.getName());
}
}.lineSeparator("\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ public static <A extends Annotation> A createAnnotationInstance(Class<A> annotat
@SuppressWarnings("unchecked")
public static <A extends Annotation> A createAnnotationInstance(Class<A> annotationClass, Map<String, Object> attributes) {
return (A) Proxy.newProxyInstance(annotationClass.getClassLoader(), new Class[] { annotationClass }, (proxy, method, args) -> {
if (method.getName().equals("annotationType") && args == null) {
if ("annotationType".equals(method.getName()) && args == null) {
return annotationClass;
} else if (method.getName().equals("toString") && args == null) {
} else if ("toString".equals(method.getName()) && args == null) {
return AnnotationUtils.toString((Annotation) proxy);
} else if (method.getName().equals("hashCode") && args == null) {
} else if ("hashCode".equals(method.getName()) && args == null) {
return AnnotationUtils.hashCode((Annotation) proxy);
} else if (method.getName().equals("equals") && args.length == 1) {
} else if ("equals".equals(method.getName()) && args.length == 1) {
if (args[0] instanceof Annotation) {
return AnnotationUtils.equals((Annotation) proxy, (Annotation) args[0]);
}
Expand Down
41 changes: 8 additions & 33 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -483,38 +483,18 @@
<configuration>
<exclusions>
<exclusion>**Chars.java</exclusion> <!-- // @SuppressWarnings("PMD.MissingOverride") -->
<exclusion>**Jep441_PatternMatchingForSwitch.java</exclusion>
<exclusion>**Dummy**.java</exclusion>
<exclusion>**FooRule.java</exclusion>
<exclusion>**jdkversiontests**</exclusion>
<exclusion>**missingoverride**</exclusion>
<exclusion>**private_method_in_inner_class_interface*.java</exclusion>
<exclusion>**testdata**</exclusion>
<exclusion>**unnecessaryimport**</exclusion>
<exclusion>**uselessoverridingmethod**</exclusion>
</exclusions>
<activeRecipes>
<recipe>org.openrewrite.java.RemoveUnusedImports</recipe>
<recipe>org.openrewrite.staticanalysis.EqualsAvoidsNull</recipe>
<recipe>org.openrewrite.staticanalysis.ModifierOrder</recipe>
<recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods</recipe>
<recipe>org.openrewrite.text.EndOfLineAtEndOfFile</recipe>
<!-- <recipe>org.openrewrite.java.format.AutoFormat</recipe>-->
<!-- <recipe>org.openrewrite.java.format.BlankLines</recipe>-->
<!-- <recipe>org.openrewrite.java.format.NormalizeFormat</recipe>-->
<!-- <recipe>org.openrewrite.java.format.NormalizeLineBreaks</recipe>-->
<!-- <recipe>org.openrewrite.java.format.RemoveTrailingWhitespace</recipe>-->
<!-- <recipe>org.openrewrite.java.format.Spaces</recipe>-->
<!-- <recipe>org.openrewrite.java.format.TabsAndIndents</recipe>-->
<!-- <recipe>org.openrewrite.java.format.WrappingAndBraces</recipe>-->
<!-- <recipe>org.openrewrite.java.migrate.UpgradeToJava17</recipe>-->
<!-- <recipe>org.openrewrite.java.migrate.UpgradeToJava21</recipe>-->
<!-- <recipe>org.openrewrite.java.testing.assertj.Assertj</recipe>-->
<!-- <recipe>org.openrewrite.java.testing.cleanup.AssertTrueNullToAssertNull</recipe>-->
<!-- <recipe>org.openrewrite.java.testing.cleanup.TestsShouldNotBePublic</recipe>-->
<!-- <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe>-->
<!-- <recipe>org.openrewrite.maven.OrderPomElements</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.CodeCleanup</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.CommonStaticAnalysis</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.FinalizeLocalVariables</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.MissingOverrideAnnotation</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.RedundantFileCreation</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedLocalVariables</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateFields</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.StringLiteralEquality</recipe>-->
</activeRecipes>
<failOnDryRunResults>true</failOnDryRunResults>
<rewriteSkip>${rewrite.skip}</rewriteSkip>
Expand All @@ -531,12 +511,7 @@
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-static-analysis</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-testing-frameworks</artifactId>
<version>3.12.0</version>
<version>2.12.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Loading