Skip to main content Link Search Menu Expand Document (external link)

SuggestedFixRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

Disable all rules by adding -XepOpt:Refaster:NamePattern=^(?!SuggestedFixRules\$).* as compiler argument.

Table of contents
  1. SuggestedFixDelete
  2. SuggestedFixReplaceTree
  3. SuggestedFixReplaceStartEnd
  4. SuggestedFixReplaceTreeStartEnd
  5. SuggestedFixSwap
  6. SuggestedFixPrefixWith
  7. SuggestedFixPostfixWith

SuggestedFixDelete

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("SuggestedFixDelete") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!SuggestedFixRules\$SuggestedFixDelete).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 SuggestedFix testSuggestedFixDelete() {
-    return SuggestedFix.builder().delete(null).build();
+    return SuggestedFix.delete(null);
   }

SuggestedFixReplaceTree

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("SuggestedFixReplaceTree") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!SuggestedFixRules\$SuggestedFixReplaceTree).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 SuggestedFix testSuggestedFixReplaceTree() {
-    return SuggestedFix.builder().replace(null, "foo").build();
+    return SuggestedFix.replace(null, "foo");
   }

SuggestedFixReplaceStartEnd

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("SuggestedFixReplaceStartEnd") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!SuggestedFixRules\$SuggestedFixReplaceStartEnd).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 SuggestedFix testSuggestedFixReplaceStartEnd() {
-    return SuggestedFix.builder().replace(1, 2, "foo").build();
+    return SuggestedFix.replace(1, 2, "foo");
   }

SuggestedFixReplaceTreeStartEnd

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("SuggestedFixReplaceTreeStartEnd") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!SuggestedFixRules\$SuggestedFixReplaceTreeStartEnd).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 SuggestedFix testSuggestedFixReplaceTreeStartEnd() {
-    return SuggestedFix.builder().replace(null, "foo", 1, 2).build();
+    return SuggestedFix.replace(null, "foo", 1, 2);
   }

SuggestedFixSwap

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("SuggestedFixSwap") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!SuggestedFixRules\$SuggestedFixSwap).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 SuggestedFix testSuggestedFixSwap() {
-    return SuggestedFix.builder().swap((Tree) null, (ExpressionTree) null).build();
+    return SuggestedFix.swap((Tree) null, (ExpressionTree) null);
   }

SuggestedFixPrefixWith

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("SuggestedFixPrefixWith") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!SuggestedFixRules\$SuggestedFixPrefixWith).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 SuggestedFix testSuggestedFixPrefixWith() {
-    return SuggestedFix.builder().prefixWith(null, "foo").build();
+    return SuggestedFix.prefixWith(null, "foo");
   }

SuggestedFixPostfixWith

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("SuggestedFixPostfixWith") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!SuggestedFixRules\$SuggestedFixPostfixWith).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 SuggestedFix testSuggestedFixPostfixWith() {
-    return SuggestedFix.builder().postfixWith(null, "foo").build();
+    return SuggestedFix.postfixWith(null, "foo");
   }

Copyright © 2017-2023 Picnic Technologies BV