Skip to content

Commit c7f8d21

Browse files
1 parent b22610d commit c7f8d21

12 files changed

+17
-48
lines changed

src/main/java/org/openrewrite/java/migrate/UpgradeJavaVersion.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ public List<Recipe> getRecipeList() {
6363
*
6464
* @return Zero estimated time.
6565
*/
66-
@Override
67-
public Duration getEstimatedEffortPerOccurrence() {
68-
return Duration.ofMinutes(0);
69-
}
66+
Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 0 );
7067

7168
@Override
7269
public TreeVisitor<?, ExecutionContext> getVisitor() {

src/main/java/org/openrewrite/java/migrate/guava/AbstractNoGuavaImmutableOf.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.openrewrite.java.migrate.guava;
1717

18+
import lombok.Getter;
1819
import org.jspecify.annotations.Nullable;
1920
import org.openrewrite.*;
2021
import org.openrewrite.internal.ListUtils;
@@ -70,10 +71,8 @@ public String getDescription() {
7071
return "Replaces `" + getShortType(guavaType) + ".of(..)` if the returned type is immediately down-cast.";
7172
}
7273

73-
@Override
74-
public Duration getEstimatedEffortPerOccurrence() {
75-
return Duration.ofMinutes(10);
76-
}
74+
@Getter
75+
final Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 10 );
7776

7877
@Override
7978
public TreeVisitor<?, ExecutionContext> getVisitor() {

src/main/java/org/openrewrite/java/migrate/javax/AddJaxbRuntime.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ public class AddJaxbRuntime extends ScanningRecipe<AtomicBoolean> {
6969
"dependency on the JAXB API. **The resulting dependencies still use the `javax` namespace, despite " +
7070
"the move to the Jakarta artifact**.";
7171

72-
@Override
73-
public Duration getEstimatedEffortPerOccurrence() {
74-
return Duration.ofMinutes(30);
75-
}
72+
Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 30 );
7673

7774
Set<String> tags = new HashSet<>( Arrays.asList( "javax", "jakarta", "javaee", "jaxb", "glassfish", "java11" ) );
7875

src/main/java/org/openrewrite/java/migrate/javax/AddJaxwsRuntime.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ public class AddJaxwsRuntime extends Recipe {
5555
"dependency on the JAX-WS API. **The resulting dependencies still use the `javax` namespace, despite " +
5656
"the move to the Jakarta artifact**.";
5757

58-
@Override
59-
public Duration getEstimatedEffortPerOccurrence() {
60-
return Duration.ofMinutes(30);
61-
}
58+
Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 30 );
6259

6360
Set<String> tags = new HashSet<>( Arrays.asList( "javax", "jakarta", "javaee", "jaxws", "java11" ) );
6461

src/main/java/org/openrewrite/java/migrate/lang/NullCheckAsSwitchCase.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ public class NullCheckAsSwitchCase extends Recipe {
5050
"This recipe will only add null checks to existing switch cases if there are no other statements in between them " +
5151
"or if the block in the if statement is not impacting the flow of the switch.";
5252

53-
@Override
54-
public Duration getEstimatedEffortPerOccurrence() {
55-
return Duration.ofMinutes(3);
56-
}
53+
Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 3 );
5754

5855
@Override
5956
public TreeVisitor<?, ExecutionContext> getVisitor() {

src/main/java/org/openrewrite/java/migrate/lang/StringFormatted.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ public class StringFormatted extends Recipe {
5252

5353
String description = "Prefer `String.formatted(Object...)` over `String.format(String, Object...)` in Java 17 or higher.";
5454

55-
@Override
56-
public Duration getEstimatedEffortPerOccurrence() {
57-
return Duration.ofMinutes(1);
58-
}
55+
Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 1 );
5956

6057
@Override
6158
public TreeVisitor<?, ExecutionContext> getVisitor() {

src/main/java/org/openrewrite/java/migrate/lang/UseTextBlocks.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ public UseTextBlocks(boolean convertStringsWithoutNewlines) {
6565

6666
String description = "Text blocks are easier to read than concatenated strings.";
6767

68-
@Override
69-
public @Nullable Duration getEstimatedEffortPerOccurrence() {
70-
return Duration.ofMinutes(3);
71-
}
68+
Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 3 );
7269

7370
@Override
7471
public TreeVisitor<?, ExecutionContext> getVisitor() {

src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ public class LombokValToFinalVar extends Recipe {
4646
@Getter
4747
final Set<String> tags = singleton( "lombok" );
4848

49-
@Override
50-
public Duration getEstimatedEffortPerOccurrence() {
51-
return Duration.ofMinutes(1);
52-
}
49+
@Getter
50+
final Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 1 );
5351

5452
@Override
5553
public TreeVisitor<?, ExecutionContext> getVisitor() {

src/main/java/org/openrewrite/java/migrate/util/OptionalNotEmptyToIsPresent.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ public class OptionalNotEmptyToIsPresent extends Recipe {
3838
@Getter
3939
final String description = "Prefer `Optional.isPresent()` instead of using `!Optional.isEmpty()` in Java 11 or higher.";
4040

41-
@Override
42-
public Duration getEstimatedEffortPerOccurrence() {
43-
return Duration.ofMinutes(1);
44-
}
41+
@Getter
42+
final Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 1 );
4543

4644
@Override
4745
public TreeVisitor<?, ExecutionContext> getVisitor() {

src/main/java/org/openrewrite/java/migrate/util/OptionalNotPresentToIsEmpty.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ public class OptionalNotPresentToIsEmpty extends Recipe {
3838
@Getter
3939
final String description = "Prefer `Optional.isEmpty()` instead of using `!Optional.isPresent()` in Java 11 or higher.";
4040

41-
@Override
42-
public Duration getEstimatedEffortPerOccurrence() {
43-
return Duration.ofMinutes(1);
44-
}
41+
@Getter
42+
final Duration estimatedEffortPerOccurrence = Duration.ofMinutes( 1 );
4543

4644
@Override
4745
public TreeVisitor<?, ExecutionContext> getVisitor() {

0 commit comments

Comments
 (0)