Skip to content

Commit 96172ef

Browse files
Upgrade to SpringBoot 3.2
1 parent 0d8efca commit 96172ef

File tree

313 files changed

+3734
-3568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+3734
-3568
lines changed

.classpath

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" output="target/classes" path="src/main/java">
3+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
44
<attributes>
5-
<attribute name="optional" value="true"/>
65
<attribute name="maven.pomderived" value="true"/>
6+
<attribute name="optional" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
9+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
1010
<attributes>
1111
<attribute name="maven.pomderived" value="true"/>
12+
<attribute name="test" value="true"/>
1213
<attribute name="optional" value="true"/>
1314
</attributes>
1415
</classpathentry>
15-
<classpathentry excluding="**/org/wise/portal/domain/authentication/**/*.java|**/org/wise/portal/domain/newsitem/**/*.java|**/org/wise/portal/domain/run/**/*.java|**/org/wise/portal/domain/webservice/**/*.java|**/org/wise/portal/presentation/web/controllers/general/contactwise/*.java|**/org/wise/portal/presentation/web/controllers/teacher/management/BatchStudentChangePasswordControllerTest.java|**/org/wise/portal/presentation/web/controllers/teacher/management/StudentListControllerTest.java|**/org/wise/portal/presentation/web/controllers/teacher/management/UpdateMyAccountInfoControllerTest.java|**/org/wise/portal/presentation/web/controllers/teacher/project/**/*.java|**/org/wise/portal/presentation/web/controllers/teacher/run/ShareProjectRunControllerTest.java|**/org/wise/portal/presentation/web/controllers/teacher/RegisterTeacherControllerTest.java|**/org/wise/portal/presentation/web/controllers/IndexControllerTest.java|**/org/wise/portal/presentation/web/controllers/LoginControllerTest.java|**/org/wise/portal/presentation/web/controllers/RegisterStudentControllerTest.java|**/org/wise/portal/presentation/validators/teacher/*.java|**/org/wise/portal/dao/AbstractTransactionalDaoTests.java|**/org/wise/portal/dao/authentication/impl/AllTests.java|**/org/wise/portal/dao/authentication/impl/HibernateAclEntryDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateAclSidDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateAclTargetObjectDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateAclTargetObjectIdentityDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateGrantedAuthorityDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateStudentUserDetailsDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateTeacherUserDetailsDaoTest.java|**/org/wise/portal/dao/group/**/*.java|**/org/wise/portal/dao/premadecomment/**/*.java" kind="src" output="target/test-classes" path="src/test/java">
16+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
1617
<attributes>
17-
<attribute name="optional" value="true"/>
1818
<attribute name="maven.pomderived" value="true"/>
19-
<attribute name="test" value="true"/>
2019
</attributes>
2120
</classpathentry>
22-
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
2322
<attributes>
2423
<attribute name="maven.pomderived" value="true"/>
25-
<attribute name="test" value="true"/>
26-
<attribute name="optional" value="true"/>
2724
</attributes>
2825
</classpathentry>
29-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
26+
<classpathentry kind="src" output="target/classes" path="src/main/java">
3027
<attributes>
28+
<attribute name="optional" value="true"/>
3129
<attribute name="maven.pomderived" value="true"/>
3230
</attributes>
3331
</classpathentry>
34-
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
32+
<classpathentry excluding="**/org/wise/portal/domain/authentication/**/*.java|**/org/wise/portal/domain/newsitem/**/*.java|**/org/wise/portal/domain/run/**/*.java|**/org/wise/portal/domain/webservice/**/*.java|**/org/wise/portal/presentation/web/controllers/general/contactwise/*.java|**/org/wise/portal/presentation/web/controllers/teacher/management/BatchStudentChangePasswordControllerTest.java|**/org/wise/portal/presentation/web/controllers/teacher/management/StudentListControllerTest.java|**/org/wise/portal/presentation/web/controllers/teacher/management/UpdateMyAccountInfoControllerTest.java|**/org/wise/portal/presentation/web/controllers/teacher/project/**/*.java|**/org/wise/portal/presentation/web/controllers/teacher/run/ShareProjectRunControllerTest.java|**/org/wise/portal/presentation/web/controllers/teacher/RegisterTeacherControllerTest.java|**/org/wise/portal/presentation/web/controllers/IndexControllerTest.java|**/org/wise/portal/presentation/web/controllers/LoginControllerTest.java|**/org/wise/portal/presentation/web/controllers/RegisterStudentControllerTest.java|**/org/wise/portal/presentation/validators/teacher/*.java|**/org/wise/portal/dao/AbstractTransactionalDaoTests.java|**/org/wise/portal/dao/authentication/impl/AllTests.java|**/org/wise/portal/dao/authentication/impl/HibernateAclEntryDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateAclSidDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateAclTargetObjectDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateAclTargetObjectIdentityDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateGrantedAuthorityDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateStudentUserDetailsDaoTest.java|**/org/wise/portal/dao/authentication/impl/HibernateTeacherUserDetailsDaoTest.java|**/org/wise/portal/dao/group/**/*.java|**/org/wise/portal/dao/premadecomment/**/*.java" kind="src" output="target/test-classes" path="src/test/java">
3533
<attributes>
34+
<attribute name="optional" value="true"/>
3635
<attribute name="maven.pomderived" value="true"/>
36+
<attribute name="test" value="true"/>
3737
</attributes>
3838
</classpathentry>
3939
<classpathentry kind="output" path="target/classes"/>

pom.xml

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
</execution>
183183
</executions>
184184
<configuration>
185-
<release>17</release>
185+
<release>${java.version}</release>
186186
</configuration>
187187
</plugin>
188188
<plugin>
@@ -278,6 +278,23 @@
278278
<classpathScope>compile</classpathScope>
279279
</configuration>
280280
</plugin>
281+
<plugin>
282+
<groupId>org.openrewrite.maven</groupId>
283+
<artifactId>rewrite-maven-plugin</artifactId>
284+
<version>5.23.1</version>
285+
<configuration>
286+
<activeRecipes>
287+
<recipe>org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0</recipe>
288+
</activeRecipes>
289+
</configuration>
290+
<dependencies>
291+
<dependency>
292+
<groupId>org.openrewrite.recipe</groupId>
293+
<artifactId>rewrite-spring</artifactId>
294+
<version>5.5.0</version>
295+
</dependency>
296+
</dependencies>
297+
</plugin>
281298
</plugins>
282299
</build>
283300
<reporting>
@@ -331,7 +348,7 @@
331348
<parent>
332349
<groupId>org.springframework.boot</groupId>
333350
<artifactId>spring-boot-starter-parent</artifactId>
334-
<version>2.7.18</version>
351+
<version>3.2.0</version>
335352
<relativePath/>
336353
</parent>
337354
<dependencies>
@@ -395,23 +412,32 @@
395412
<artifactId>spring-boot-devtools</artifactId>
396413
<optional>true</optional>
397414
</dependency>
415+
<dependency>
416+
<groupId>org.springframework.boot</groupId>
417+
<artifactId>spring-boot-properties-migrator</artifactId>
418+
<scope>runtime</scope>
419+
</dependency>
398420
<dependency>
399421
<groupId>org.apache.tomcat.embed</groupId>
400422
<artifactId>tomcat-embed-jasper</artifactId>
401423
</dependency>
402424
<dependency>
403-
<groupId>javax.servlet</groupId>
404-
<artifactId>jstl</artifactId>
405-
<version>1.2</version>
406-
</dependency>
425+
<groupId>jakarta.servlet.jsp.jstl</groupId>
426+
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
427+
<version>2.0.0</version>
428+
</dependency>
429+
<dependency>
430+
<groupId>org.glassfish.web</groupId>
431+
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
432+
<version>2.0.0</version>
433+
</dependency>
407434
<dependency>
408435
<groupId>org.springframework.security</groupId>
409436
<artifactId>spring-security-taglibs</artifactId>
410437
</dependency>
411438
<dependency>
412-
<groupId>org.springframework.security.oauth</groupId>
413-
<artifactId>spring-security-oauth2</artifactId>
414-
<version>${spring-security-oauth2.version}</version>
439+
<groupId>org.springframework.security</groupId>
440+
<artifactId>spring-security-oauth2-client</artifactId>
415441
</dependency>
416442
<dependency>
417443
<groupId>org.springframework.security</groupId>
@@ -424,9 +450,8 @@
424450
<version>${jwks-rsa.version}</version>
425451
</dependency>
426452
<dependency>
427-
<groupId>mysql</groupId>
428-
<artifactId>mysql-connector-java</artifactId>
429-
<version>8.0.30</version>
453+
<groupId>com.mysql</groupId>
454+
<artifactId>mysql-connector-j</artifactId>
430455
</dependency>
431456
<dependency>
432457
<groupId>com.zaxxer</groupId>
@@ -484,16 +509,16 @@
484509
<scope>test</scope>
485510
</dependency>
486511
<dependency>
487-
<groupId>org.testcontainers</groupId>
488-
<artifactId>testcontainers</artifactId>
489-
<version>1.20.6</version>
490-
<scope>test</scope>
512+
<groupId>org.testcontainers</groupId>
513+
<artifactId>testcontainers</artifactId>
514+
<version>1.20.6</version>
515+
<scope>test</scope>
491516
</dependency>
492517
<dependency>
493-
<groupId>org.testcontainers</groupId>
494-
<artifactId>junit-jupiter</artifactId>
495-
<version>1.20.6</version>
496-
<scope>test</scope>
518+
<groupId>org.testcontainers</groupId>
519+
<artifactId>junit-jupiter</artifactId>
520+
<version>1.20.6</version>
521+
<scope>test</scope>
497522
</dependency>
498523
<dependency>
499524
<groupId>org.easymock</groupId>
@@ -518,10 +543,14 @@
518543
<artifactId>lombok</artifactId>
519544
<scope>provided</scope>
520545
</dependency>
546+
<dependency>
547+
<groupId>org.glassfish.jaxb</groupId>
548+
<artifactId>jaxb-runtime</artifactId>
549+
<scope>runtime</scope>
550+
</dependency>
521551
<dependency>
522552
<groupId>redis.clients</groupId>
523553
<artifactId>jedis</artifactId>
524-
<version>3.7.0</version>
525554
</dependency>
526555
<dependency>
527556
<groupId>com.google.api-client</groupId>
@@ -538,6 +567,10 @@
538567
<artifactId>commons-io</artifactId>
539568
<version>2.11.0</version>
540569
</dependency>
570+
<dependency>
571+
<groupId>jakarta.mail</groupId>
572+
<artifactId>jakarta.mail-api</artifactId>
573+
</dependency>
541574
<dependency>
542575
<groupId>org.apache.tika</groupId>
543576
<artifactId>tika-core</artifactId>
@@ -556,14 +589,12 @@
556589
</dependencies>
557590
<properties>
558591
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
559-
<spring-security.version>5.8.16</spring-security.version>
560592
<spring-security-oauth2.version>2.2.5.RELEASE</spring-security-oauth2.version>
561593
<spring-security-jwt.version>1.0.9.RELEASE</spring-security-jwt.version>
562594
<jwks-rsa.version>0.3.0</jwks-rsa.version>
563595
<powermock.version>1.7.4</powermock.version>
564596
<startup.listeners>
565597
</startup.listeners>
566598
<m2e.apt.activation>disabled</m2e.apt.activation>
567-
<log4j2.version>2.17.0</log4j2.version>
568599
</properties>
569600
</project>

src/main/java/org/json/JSONArray.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public JSONArray(JSONTokener x) throws JSONException {
136136
case ']':
137137
case ')':
138138
if (q != c) {
139-
throw x.syntaxError("Expected a '" + new Character(q) + "'");
139+
throw x.syntaxError("Expected a '" + Character.valueOf(q) + "'");
140140
}
141141
return;
142142
default:
@@ -181,8 +181,8 @@ public JSONArray(Collection collection, boolean includeSuperClass) {
181181
Iterator iter = collection.iterator();;
182182
while (iter.hasNext()) {
183183
Object o = iter.next();
184-
if (o instanceof Map) {
185-
this.myArrayList.add(new JSONObject((Map)o, includeSuperClass));
184+
if (o instanceof Map map) {
185+
this.myArrayList.add(new JSONObject(map, includeSuperClass));
186186
} else if (!JSONObject.isStandardProperty(o.getClass())) {
187187
this.myArrayList.add(new JSONObject(o, includeSuperClass));
188188
} else {
@@ -262,12 +262,12 @@ public Object get(int index) throws JSONException {
262262
public boolean getBoolean(int index) throws JSONException {
263263
Object o = get(index);
264264
if (o.equals(Boolean.FALSE) ||
265-
(o instanceof String &&
266-
((String)o).equalsIgnoreCase("false"))) {
265+
(o instanceof String string &&
266+
string.equalsIgnoreCase("false"))) {
267267
return false;
268268
} else if (o.equals(Boolean.TRUE) ||
269-
(o instanceof String &&
270-
((String)o).equalsIgnoreCase("true"))) {
269+
(o instanceof String string &&
270+
string.equalsIgnoreCase("true"))) {
271271
return true;
272272
}
273273
throw new JSONException("JSONArray[" + index + "] is not a Boolean.");
@@ -285,8 +285,8 @@ public boolean getBoolean(int index) throws JSONException {
285285
public double getDouble(int index) throws JSONException {
286286
Object o = get(index);
287287
try {
288-
return o instanceof Number ?
289-
((Number)o).doubleValue() :
288+
return o instanceof Number n ?
289+
n.doubleValue() :
290290
Double.valueOf((String)o).doubleValue();
291291
} catch (Exception e) {
292292
throw new JSONException("JSONArray[" + index +
@@ -306,8 +306,8 @@ public double getDouble(int index) throws JSONException {
306306
*/
307307
public int getInt(int index) throws JSONException {
308308
Object o = get(index);
309-
return o instanceof Number ?
310-
((Number)o).intValue() : (int)getDouble(index);
309+
return o instanceof Number n ?
310+
n.intValue() : (int)getDouble(index);
311311
}
312312

313313

@@ -320,8 +320,8 @@ public int getInt(int index) throws JSONException {
320320
*/
321321
public JSONArray getJSONArray(int index) throws JSONException {
322322
Object o = get(index);
323-
if (o instanceof JSONArray) {
324-
return (JSONArray)o;
323+
if (o instanceof JSONArray array) {
324+
return array;
325325
}
326326
throw new JSONException("JSONArray[" + index +
327327
"] is not a JSONArray.");
@@ -337,8 +337,8 @@ public JSONArray getJSONArray(int index) throws JSONException {
337337
*/
338338
public JSONObject getJSONObject(int index) throws JSONException {
339339
Object o = get(index);
340-
if (o instanceof JSONObject) {
341-
return (JSONObject)o;
340+
if (o instanceof JSONObject object) {
341+
return object;
342342
}
343343
throw new JSONException("JSONArray[" + index +
344344
"] is not a JSONObject.");
@@ -355,8 +355,8 @@ public JSONObject getJSONObject(int index) throws JSONException {
355355
*/
356356
public long getLong(int index) throws JSONException {
357357
Object o = get(index);
358-
return o instanceof Number ?
359-
((Number)o).longValue() : (long)getDouble(index);
358+
return o instanceof Number n ?
359+
n.longValue() : (long)getDouble(index);
360360
}
361361

362362

@@ -525,7 +525,7 @@ public int optInt(int index, int defaultValue) {
525525
*/
526526
public JSONArray optJSONArray(int index) {
527527
Object o = opt(index);
528-
return o instanceof JSONArray ? (JSONArray)o : null;
528+
return o instanceof JSONArray jsona ? jsona : null;
529529
}
530530

531531

@@ -539,7 +539,7 @@ public JSONArray optJSONArray(int index) {
539539
*/
540540
public JSONObject optJSONObject(int index) {
541541
Object o = opt(index);
542-
return o instanceof JSONObject ? (JSONObject)o : null;
542+
return o instanceof JSONObject jsono ? jsono : null;
543543
}
544544

545545

@@ -632,7 +632,7 @@ public JSONArray put(Collection value) {
632632
* @return this.
633633
*/
634634
public JSONArray put(double value) throws JSONException {
635-
Double d = new Double(value);
635+
Double d = Double.valueOf(value);
636636
JSONObject.testValidity(d);
637637
put(d);
638638
return this;
@@ -646,7 +646,7 @@ public JSONArray put(double value) throws JSONException {
646646
* @return this.
647647
*/
648648
public JSONArray put(int value) {
649-
put(new Integer(value));
649+
put(Integer.valueOf(value));
650650
return this;
651651
}
652652

@@ -658,7 +658,7 @@ public JSONArray put(int value) {
658658
* @return this.
659659
*/
660660
public JSONArray put(long value) {
661-
put(new Long(value));
661+
put(Long.valueOf(value));
662662
return this;
663663
}
664664

@@ -729,7 +729,7 @@ public JSONArray put(int index, Collection value) throws JSONException {
729729
* not finite.
730730
*/
731731
public JSONArray put(int index, double value) throws JSONException {
732-
put(index, new Double(value));
732+
put(index, Double.valueOf(value));
733733
return this;
734734
}
735735

@@ -744,7 +744,7 @@ public JSONArray put(int index, double value) throws JSONException {
744744
* @throws JSONException If the index is negative.
745745
*/
746746
public JSONArray put(int index, int value) throws JSONException {
747-
put(index, new Integer(value));
747+
put(index, Integer.valueOf(value));
748748
return this;
749749
}
750750

@@ -759,7 +759,7 @@ public JSONArray put(int index, int value) throws JSONException {
759759
* @throws JSONException If the index is negative.
760760
*/
761761
public JSONArray put(int index, long value) throws JSONException {
762-
put(index, new Long(value));
762+
put(index, Long.valueOf(value));
763763
return this;
764764
}
765765

@@ -942,10 +942,10 @@ public Writer write(Writer writer) throws JSONException {
942942
writer.write(',');
943943
}
944944
Object v = this.myArrayList.get(i);
945-
if (v instanceof JSONObject) {
946-
((JSONObject)v).write(writer);
947-
} else if (v instanceof JSONArray) {
948-
((JSONArray)v).write(writer);
945+
if (v instanceof JSONObject object) {
946+
object.write(writer);
947+
} else if (v instanceof JSONArray array) {
948+
array.write(writer);
949949
} else {
950950
writer.write(JSONObject.valueToString(v));
951951
}

0 commit comments

Comments
 (0)