Skip to content

Commit d6e44e4

Browse files
committed
Remove Lombok - make it compile on Java 25
1 parent 2c68785 commit d6e44e4

File tree

3 files changed

+189
-29
lines changed

3 files changed

+189
-29
lines changed

spring-data-eclipse-store-migration/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@
7777
<groupId>org.openrewrite.recipe</groupId>
7878
<artifactId>rewrite-spring</artifactId>
7979
</dependency>
80-
<dependency>
81-
<groupId>org.projectlombok</groupId>
82-
<artifactId>lombok</artifactId>
83-
<version>1.18.38</version>
84-
<scope>provided</scope>
85-
</dependency>
86-
8780

8881
<dependency>
8982
<groupId>org.springframework.boot</groupId>

spring-data-eclipse-store-migration/src/main/java/software/xdev/spring/data/eclipse/store/AddAnnotationToOtherAnnotation.java

Lines changed: 88 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package software.xdev.spring.data.eclipse.store;
1717

1818
import java.util.Comparator;
19+
import java.util.Objects;
1920

2021
import org.jetbrains.annotations.NotNull;
2122
import org.openrewrite.ExecutionContext;
@@ -28,18 +29,7 @@
2829
import org.openrewrite.java.JavaTemplate;
2930
import org.openrewrite.java.tree.J;
3031

31-
import lombok.AllArgsConstructor;
32-
import lombok.EqualsAndHashCode;
33-
import lombok.Getter;
34-
import lombok.NoArgsConstructor;
35-
import lombok.Setter;
3632

37-
38-
@Getter
39-
@Setter
40-
@AllArgsConstructor
41-
@NoArgsConstructor
42-
@EqualsAndHashCode(callSuper = true)
4333
public class AddAnnotationToOtherAnnotation extends Recipe
4434
{
4535
@Option(displayName = "Existing annotation type",
@@ -64,6 +54,64 @@ public class AddAnnotationToOtherAnnotation extends Recipe
6454
example = "Test")
6555
String annotationTypeToAddSimpleName;
6656

57+
public AddAnnotationToOtherAnnotation()
58+
{
59+
}
60+
61+
public AddAnnotationToOtherAnnotation(
62+
final String existingAnnotationType,
63+
final String annotationTypeToAdd,
64+
final String classPath,
65+
final String annotationTypeToAddSimpleName)
66+
{
67+
this.existingAnnotationType = existingAnnotationType;
68+
this.annotationTypeToAdd = annotationTypeToAdd;
69+
this.classPath = classPath;
70+
this.annotationTypeToAddSimpleName = annotationTypeToAddSimpleName;
71+
}
72+
73+
// region Accessors
74+
public String getExistingAnnotationType()
75+
{
76+
return this.existingAnnotationType;
77+
}
78+
79+
public void setExistingAnnotationType(final String existingAnnotationType)
80+
{
81+
this.existingAnnotationType = existingAnnotationType;
82+
}
83+
84+
public String getAnnotationTypeToAdd()
85+
{
86+
return this.annotationTypeToAdd;
87+
}
88+
89+
public void setAnnotationTypeToAdd(final String annotationTypeToAdd)
90+
{
91+
this.annotationTypeToAdd = annotationTypeToAdd;
92+
}
93+
94+
public String getClassPath()
95+
{
96+
return this.classPath;
97+
}
98+
99+
public void setClassPath(final String classPath)
100+
{
101+
this.classPath = classPath;
102+
}
103+
104+
public String getAnnotationTypeToAddSimpleName()
105+
{
106+
return this.annotationTypeToAddSimpleName;
107+
}
108+
109+
public void setAnnotationTypeToAddSimpleName(final String annotationTypeToAddSimpleName)
110+
{
111+
this.annotationTypeToAddSimpleName = annotationTypeToAddSimpleName;
112+
}
113+
// endregion
114+
67115
@Override
68116
public @NotNull String getDisplayName()
69117
{
@@ -121,4 +169,33 @@ public class AddAnnotationToOtherAnnotation extends Recipe
121169
}
122170
};
123171
}
172+
173+
@Override
174+
public boolean equals(final Object o)
175+
{
176+
if(!(o instanceof final AddAnnotationToOtherAnnotation that))
177+
{
178+
return false;
179+
}
180+
if(!super.equals(o))
181+
{
182+
return false;
183+
}
184+
return Objects.equals(this.getExistingAnnotationType(), that.getExistingAnnotationType())
185+
&& Objects.equals(this.getAnnotationTypeToAdd(), that.getAnnotationTypeToAdd())
186+
&& Objects.equals(this.getClassPath(), that.getClassPath()) && Objects.equals(
187+
this.getAnnotationTypeToAddSimpleName(),
188+
that.getAnnotationTypeToAddSimpleName());
189+
}
190+
191+
@Override
192+
public int hashCode()
193+
{
194+
return Objects.hash(
195+
super.hashCode(),
196+
this.getExistingAnnotationType(),
197+
this.getAnnotationTypeToAdd(),
198+
this.getClassPath(),
199+
this.getAnnotationTypeToAddSimpleName());
200+
}
124201
}

spring-data-eclipse-store-migration/src/main/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExists.java

Lines changed: 101 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package software.xdev.spring.data.eclipse.store;
1717

1818
import java.util.List;
19+
import java.util.Objects;
1920

2021
import org.jetbrains.annotations.NotNull;
2122
import org.openrewrite.ExecutionContext;
@@ -25,18 +26,7 @@
2526
import org.openrewrite.internal.lang.Nullable;
2627
import org.openrewrite.java.spring.AddSpringProperty;
2728

28-
import lombok.AllArgsConstructor;
29-
import lombok.EqualsAndHashCode;
30-
import lombok.Getter;
31-
import lombok.NoArgsConstructor;
32-
import lombok.Setter;
3329

34-
35-
@Getter
36-
@Setter
37-
@AllArgsConstructor
38-
@NoArgsConstructor
39-
@EqualsAndHashCode(callSuper = true)
4030
public class AddSpringPropertyIfClassExists extends Recipe
4131
{
4232
@Option(displayName = "Class that must exist in the classpath to add the property",
@@ -74,6 +64,76 @@ public class AddSpringPropertyIfClassExists extends Recipe
7464
)
7565
private @Nullable List<String> pathExpressions;
7666

67+
public AddSpringPropertyIfClassExists()
68+
{
69+
}
70+
71+
public AddSpringPropertyIfClassExists(
72+
final String className,
73+
final String property,
74+
final String value,
75+
final String comment,
76+
final List<String> pathExpressions)
77+
{
78+
this.className = className;
79+
this.property = property;
80+
this.value = value;
81+
this.comment = comment;
82+
this.pathExpressions = pathExpressions;
83+
}
84+
85+
// region Accessors
86+
public String getClassName()
87+
{
88+
return this.className;
89+
}
90+
91+
public void setClassName(final String className)
92+
{
93+
this.className = className;
94+
}
95+
96+
public String getProperty()
97+
{
98+
return this.property;
99+
}
100+
101+
public void setProperty(final String property)
102+
{
103+
this.property = property;
104+
}
105+
106+
public String getValue()
107+
{
108+
return this.value;
109+
}
110+
111+
public void setValue(final String value)
112+
{
113+
this.value = value;
114+
}
115+
116+
public String getComment()
117+
{
118+
return this.comment;
119+
}
120+
121+
public void setComment(final String comment)
122+
{
123+
this.comment = comment;
124+
}
125+
126+
public List<String> getPathExpressions()
127+
{
128+
return this.pathExpressions;
129+
}
130+
131+
public void setPathExpressions(final List<String> pathExpressions)
132+
{
133+
this.pathExpressions = pathExpressions;
134+
}
135+
// endregion
136+
77137
@Override
78138
public @NotNull String getDisplayName()
79139
{
@@ -110,4 +170,34 @@ private boolean doesClasspathContainClass(final String classToCheck)
110170
return false;
111171
}
112172
}
173+
174+
@Override
175+
public boolean equals(final Object o)
176+
{
177+
if(!(o instanceof final AddSpringPropertyIfClassExists that))
178+
{
179+
return false;
180+
}
181+
if(!super.equals(o))
182+
{
183+
return false;
184+
}
185+
return Objects.equals(this.getClassName(), that.getClassName()) && Objects.equals(
186+
this.getProperty(),
187+
that.getProperty()) && Objects.equals(this.getValue(), that.getValue()) && Objects.equals(
188+
this.getComment(),
189+
that.getComment()) && Objects.equals(this.getPathExpressions(), that.getPathExpressions());
190+
}
191+
192+
@Override
193+
public int hashCode()
194+
{
195+
return Objects.hash(
196+
super.hashCode(),
197+
this.getClassName(),
198+
this.getProperty(),
199+
this.getValue(),
200+
this.getComment(),
201+
this.getPathExpressions());
202+
}
113203
}

0 commit comments

Comments
 (0)