@@ -79,50 +79,50 @@ public static void main(String[] args) {
79
79
80
80
private static Map <String , List <String >> versionToRecipeMap = new HashMap <>();
81
81
static {
82
- Map < List < String >, List < String >> map = Map .of (
83
- List . of ( "2.3.0" , "2.3.1" , "2.3.2" , "2.3.4" , "2.3. 5.RELEASE") ,
82
+ versionToRecipeMap = Map .of (
83
+ "2.3.5.RELEASE" ,
84
84
List .of (
85
85
"org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_4"
86
86
),
87
87
88
- List . of ( "2.4.0" , "2.4. 13") ,
88
+ "2.4.13" ,
89
89
List .of (
90
90
"org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_5"
91
91
),
92
92
93
- List . of ( "2.5.0" , "2.5. 15") ,
93
+ "2.5.15" ,
94
94
List .of (
95
95
"org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6"
96
96
),
97
97
98
- List . of ( "2.6.0" , "2.6. 15") ,
98
+ "2.6.15" ,
99
99
List .of (
100
100
"org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7"
101
101
),
102
102
103
- List . of ( "2.7.0" , "2.7. 17") ,
103
+ "2.7.17" ,
104
104
List .of (
105
- "org.openrewrite.java.spring.boot2 .UpgradeSpringBoot_3_0"
105
+ "org.openrewrite.java.spring.boot3 .UpgradeSpringBoot_3_0"
106
106
),
107
107
108
- List . of ( "3.0.0" , "3.0. 12") ,
108
+ "3.0.12" ,
109
109
List .of (
110
- "org.openrewrite.java.spring.boot2 .UpgradeSpringBoot_3_1"
110
+ "org.openrewrite.java.spring.boot3 .UpgradeSpringBoot_3_1"
111
111
),
112
112
113
- List . of ( "3.1.0" , "3.1.5" ) ,
113
+ "3.1.5" ,
114
114
List .of (
115
- "org.openrewrite.java.spring.boot2 .UpgradeSpringBoot_3_2"
115
+ "org.openrewrite.java.spring.boot3 .UpgradeSpringBoot_3_2"
116
116
)
117
117
);
118
- map .keySet ()
119
- .stream ()
120
- .forEach (keys -> {
121
- keys .stream ()
122
- .forEach (k -> {
123
- versionToRecipeMap .put (k , map .get (keys ));
124
- });
125
- });
118
+ // map.keySet()
119
+ // .stream()
120
+ // .forEach(keys -> {
121
+ // keys.stream()
122
+ // .forEach(k -> {
123
+ // versionToRecipeMap.put(k, map.get(keys));
124
+ // });
125
+ // });
126
126
127
127
}
128
128
@@ -212,8 +212,12 @@ private String calculateBranchName(String newBootVersion) {
212
212
}
213
213
214
214
private String calculateNextBootVersion (String currentBootVersion ) {
215
- String [] split = currentBootVersion .split ("\\ ." );
216
- return split [0 ] + "." + (Integer .parseInt (split [1 ]) + 1 ) + ".x" ;
215
+ List <String > sortedVersions = versionToRecipeMap .keySet ().stream ().sorted (String ::compareTo ).toList ();
216
+ int i = sortedVersions .indexOf (currentBootVersion );
217
+ if (i >0 ) {
218
+ return sortedVersions .get (i +1 );
219
+ }
220
+ throw new IllegalArgumentException ("No higher version found than %s." .formatted (currentBootVersion ));
217
221
}
218
222
219
223
private String extractSpringBootVersion (String pomXml ) {
0 commit comments