Skip to content

Commit e1b1435

Browse files
committed
Stop referring to JDK 1.5 plus polishing
1 parent 8e2134c commit e1b1435

File tree

8 files changed

+44
-81
lines changed

8 files changed

+44
-81
lines changed

spring-beans/src/main/java/org/springframework/beans/TypeConverterDelegate.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -315,7 +315,7 @@ private Object attemptToConvertStringToEnum(Class<?> requiredType, String trimme
315315
}
316316

317317
if (convertedValue == currentConvertedValue) {
318-
// Try field lookup as fallback: for JDK 1.5 enum or custom enum
318+
// Try field lookup as fallback: for Java enum or custom enum
319319
// with values defined as static fields. Resulting value still needs
320320
// to be checked, hence we don't return it right away.
321321
try {

spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -439,7 +439,7 @@ protected Object doInvoke(MethodInvocation invocation) throws Throwable {
439439
throw ex.getTargetError();
440440
}
441441
catch (RuntimeOperationsException ex) {
442-
// This one is only thrown by the JMX 1.2 RI, not by the JDK 1.5 JMX code.
442+
// This one is only thrown by the JMX 1.2 RI, not by the JDK JMX code.
443443
RuntimeException rex = ex.getTargetException();
444444
if (rex instanceof RuntimeMBeanException runtimeMBeanException) {
445445
throw runtimeMBeanException.getTargetException();

spring-core/src/main/java/org/springframework/core/io/support/PropertiesLoaderSupport.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ public void setPropertiesArray(Properties... propertiesArray) {
8080
/**
8181
* Set a location of a properties file to be loaded.
8282
* <p>Can point to a classic properties file or to an XML file
83-
* that follows JDK 1.5's properties XML format.
83+
* that follows Java's properties XML format.
8484
*/
8585
public void setLocation(Resource location) {
8686
this.locations = new Resource[] {location};
@@ -89,7 +89,7 @@ public void setLocation(Resource location) {
8989
/**
9090
* Set locations of properties files to be loaded.
9191
* <p>Can point to classic properties files or to XML files
92-
* that follow JDK 1.5's properties XML format.
92+
* that follow Java's properties XML format.
9393
* <p>Note: Properties defined in later files will override
9494
* properties defined earlier files, in case of overlapping keys.
9595
* Hence, make sure that the most specific files are the last

spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -255,9 +255,8 @@ public interface JdbcOperations {
255255
* <p>The results will be mapped to an SqlRowSet which holds the data in a
256256
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
257257
* <p>Note that, for the default implementation, JDBC RowSet support needs to
258-
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
259-
* class is used, which is part of JDK 1.5+ and also available separately as part of
260-
* Sun's JDBC RowSet Implementations download (rowset.jar).
258+
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
259+
* is used.
261260
* @param sql the SQL query to execute
262261
* @return an SqlRowSet representation (possibly a wrapper around a
263262
* {@code javax.sql.rowset.CachedRowSet})
@@ -874,9 +873,8 @@ <T> List<T> queryForList(String sql, Object[] args, int[] argTypes, Class<T> ele
874873
* <p>The results will be mapped to an SqlRowSet which holds the data in a
875874
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
876875
* <p>Note that, for the default implementation, JDBC RowSet support needs to
877-
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
878-
* class is used, which is part of JDK 1.5+ and also available separately as part of
879-
* Sun's JDBC RowSet Implementations download (rowset.jar).
876+
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
877+
* is used.
880878
* @param sql the SQL query to execute
881879
* @param args arguments to bind to the query
882880
* @param argTypes the SQL types of the arguments
@@ -897,9 +895,8 @@ <T> List<T> queryForList(String sql, Object[] args, int[] argTypes, Class<T> ele
897895
* <p>The results will be mapped to an SqlRowSet which holds the data in a
898896
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
899897
* <p>Note that, for the default implementation, JDBC RowSet support needs to
900-
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
901-
* class is used, which is part of JDK 1.5+ and also available separately as part of
902-
* Sun's JDBC RowSet Implementations download (rowset.jar).
898+
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
899+
* is used.
903900
* @param sql the SQL query to execute
904901
* @param args arguments to bind to the query
905902
* (leaving it to the PreparedStatement to guess the corresponding SQL type);

spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -79,7 +79,7 @@ protected SqlRowSet createSqlRowSet(ResultSet rs) throws SQLException {
7979
/**
8080
* Create a new {@link CachedRowSet} instance, to be populated by
8181
* the {@code createSqlRowSet} implementation.
82-
* <p>The default implementation uses JDBC 4.1's {@link RowSetFactory}.
82+
* <p>The default implementation uses JDBC's {@link RowSetFactory}.
8383
* @return a new CachedRowSet instance
8484
* @throws SQLException if thrown by JDBC methods
8585
* @see #createSqlRowSet

spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcOperations.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -449,9 +449,8 @@ <T> List<T> queryForList(String sql, Map<String, ?> paramMap, Class<T> elementTy
449449
* <p>The results will be mapped to an SqlRowSet which holds the data in a
450450
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
451451
* <p>Note that, for the default implementation, JDBC RowSet support needs to
452-
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
453-
* class is used, which is part of JDK 1.5+ and also available separately as part of
454-
* Sun's JDBC RowSet Implementations download (rowset.jar).
452+
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
453+
* is used.
455454
* @param sql the SQL query to execute
456455
* @param paramSource container of arguments to bind to the query
457456
* @return an SqlRowSet representation (possibly a wrapper around a
@@ -469,9 +468,8 @@ <T> List<T> queryForList(String sql, Map<String, ?> paramMap, Class<T> elementTy
469468
* <p>The results will be mapped to an SqlRowSet which holds the data in a
470469
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
471470
* <p>Note that, for the default implementation, JDBC RowSet support needs to
472-
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
473-
* class is used, which is part of JDK 1.5+ and also available separately as part of
474-
* Sun's JDBC RowSet Implementations download (rowset.jar).
471+
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
472+
* is used.
475473
* @param sql the SQL query to execute
476474
* @param paramMap map of parameters to bind to the query
477475
* (leaving it to the PreparedStatement to guess the corresponding SQL type)

spring-tx/src/main/java/org/springframework/transaction/annotation/AnnotationTransactionAttributeSource.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@
3535
/**
3636
* Implementation of the
3737
* {@link org.springframework.transaction.interceptor.TransactionAttributeSource}
38-
* interface for working with transaction metadata in JDK 1.5+ annotation format.
38+
* interface for working with transaction metadata from annotations.
3939
*
40-
* <p>This class reads Spring's JDK 1.5+ {@link Transactional} annotation and
40+
* <p>This class reads Spring's {@link Transactional @Transactional} annotation and
4141
* exposes corresponding transaction attributes to Spring's transaction infrastructure.
42-
* Also supports JTA 1.2's {@link jakarta.transaction.Transactional} and EJB3's
42+
* Also supports JTA's {@link jakarta.transaction.Transactional} and EJB's
4343
* {@link jakarta.ejb.TransactionAttribute} annotation (if present).
44-
* This class may also serve as base class for a custom TransactionAttributeSource,
44+
*
45+
* <p>This class may also serve as base class for a custom TransactionAttributeSource,
4546
* or get customized through {@link TransactionAnnotationParser} strategies.
4647
*
4748
* @author Colin Sampaleanu

spring-webmvc/src/test/java/org/springframework/web/servlet/view/RedirectViewTests.java

+18-51
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.web.servlet.view;
1818

19-
import java.util.ArrayList;
20-
import java.util.Collections;
2119
import java.util.HashMap;
2220
import java.util.LinkedHashMap;
2321
import java.util.List;
@@ -49,8 +47,9 @@
4947
import static org.mockito.Mockito.verify;
5048

5149
/**
52-
* Tests for redirect view, and query string construction.
53-
* Doesn't test URL encoding, although it does check that it's called.
50+
* Tests for redirect view and query string construction.
51+
*
52+
* <p>Doesn't test URL encoding, although it does check that it's called.
5453
*
5554
* @author Rod Johnson
5655
* @author Juergen Hoeller
@@ -61,28 +60,24 @@
6160
*/
6261
class RedirectViewTests {
6362

64-
private MockHttpServletRequest request;
63+
private MockHttpServletRequest request = new MockHttpServletRequest();
6564

66-
private MockHttpServletResponse response;
65+
private MockHttpServletResponse response = new MockHttpServletResponse();
6766

6867

6968
@BeforeEach
7069
void setUp() {
71-
this.request = new MockHttpServletRequest();
7270
this.request.setContextPath("/context");
7371
this.request.setCharacterEncoding(WebUtils.DEFAULT_CHARACTER_ENCODING);
7472
this.request.setAttribute(DispatcherServlet.OUTPUT_FLASH_MAP_ATTRIBUTE, new FlashMap());
7573
this.request.setAttribute(DispatcherServlet.FLASH_MAP_MANAGER_ATTRIBUTE, new SessionFlashMapManager());
76-
this.response = new MockHttpServletResponse();
77-
7874
}
7975

8076

8177
@Test
8278
void noUrlSet() {
8379
RedirectView rv = new RedirectView();
84-
assertThatIllegalArgumentException().isThrownBy(
85-
rv::afterPropertiesSet);
80+
assertThatIllegalArgumentException().isThrownBy(rv::afterPropertiesSet);
8681
}
8782

8883
@Test
@@ -175,7 +170,6 @@ void updateTargetUrl() throws Exception {
175170
verify(mockProcessor).processUrl(request, "/path");
176171
}
177172

178-
179173
@Test
180174
void updateTargetUrlWithContextLoader() throws Exception {
181175
StaticWebApplicationContext wac = new StaticWebApplicationContext();
@@ -214,7 +208,6 @@ public void remoteHost() {
214208
assertThat(rv.isRemoteHost("https://url.somewhere.com")).isFalse();
215209
assertThat(rv.isRemoteHost("/path")).isFalse();
216210
assertThat(rv.isRemoteHost("http://somewhereelse.example")).isTrue();
217-
218211
}
219212

220213
@Test // SPR-16752
@@ -247,16 +240,15 @@ void singleParam() throws Exception {
247240
String url = "https://url.somewhere.com";
248241
String key = "foo";
249242
String val = "bar";
250-
Map<String, String> model = new HashMap<>();
251-
model.put(key, val);
243+
Map<String, String> model = Map.of(key, val);
252244
String expectedUrlForEncoding = url + "?" + key + "=" + val;
253245
doTest(model, url, false, expectedUrlForEncoding);
254246
}
255247

256248
@Test
257249
void singleParamWithoutExposingModelAttributes() throws Exception {
258250
String url = "https://url.somewhere.com";
259-
Map<String, String> model = Collections.singletonMap("foo", "bar");
251+
Map<String, String> model = Map.of("foo", "bar");
260252

261253
TestRedirectView rv = new TestRedirectView(url, false, model);
262254
rv.setExposeModelAttributes(false);
@@ -289,56 +281,31 @@ void twoParams() throws Exception {
289281
String val = "bar";
290282
String key2 = "thisIsKey2";
291283
String val2 = "andThisIsVal2";
292-
Map<String, String> model = new HashMap<>();
284+
Map<String, String> model = new LinkedHashMap<>();
293285
model.put(key, val);
294286
model.put(key2, val2);
295-
try {
296-
String expectedUrlForEncoding = url + "?" + key + "=" + val + "&" + key2 + "=" + val2;
297-
doTest(model, url, false, expectedUrlForEncoding);
298-
}
299-
catch (AssertionError err) {
300-
// OK, so it's the other order... probably on Sun JDK 1.6 or IBM JDK 1.5
301-
String expectedUrlForEncoding = url + "?" + key2 + "=" + val2 + "&" + key + "=" + val;
302-
doTest(model, url, false, expectedUrlForEncoding);
303-
}
287+
String expectedUrlForEncoding = url + "?" + key + "=" + val + "&" + key2 + "=" + val2;
288+
doTest(model, url, false, expectedUrlForEncoding);
304289
}
305290

306291
@Test
307292
void arrayParam() throws Exception {
308293
String url = "https://url.somewhere.com";
309294
String key = "foo";
310295
String[] val = new String[] {"bar", "baz"};
311-
Map<String, String[]> model = new HashMap<>();
312-
model.put(key, val);
313-
try {
314-
String expectedUrlForEncoding = url + "?" + key + "=" + val[0] + "&" + key + "=" + val[1];
315-
doTest(model, url, false, expectedUrlForEncoding);
316-
}
317-
catch (AssertionError err) {
318-
// OK, so it's the other order... probably on Sun JDK 1.6 or IBM JDK 1.5
319-
String expectedUrlForEncoding = url + "?" + key + "=" + val[1] + "&" + key + "=" + val[0];
320-
doTest(model, url, false, expectedUrlForEncoding);
321-
}
296+
Map<String, String[]> model = Map.of(key, val);
297+
String expectedUrlForEncoding = url + "?" + key + "=" + val[0] + "&" + key + "=" + val[1];
298+
doTest(model, url, false, expectedUrlForEncoding);
322299
}
323300

324301
@Test
325302
void collectionParam() throws Exception {
326303
String url = "https://url.somewhere.com";
327304
String key = "foo";
328-
List<String> val = new ArrayList<>();
329-
val.add("bar");
330-
val.add("baz");
331-
Map<String, List<String>> model = new HashMap<>();
332-
model.put(key, val);
333-
try {
334-
String expectedUrlForEncoding = url + "?" + key + "=" + val.get(0) + "&" + key + "=" + val.get(1);
335-
doTest(model, url, false, expectedUrlForEncoding);
336-
}
337-
catch (AssertionError err) {
338-
// OK, so it's the other order... probably on Sun JDK 1.6 or IBM JDK 1.5
339-
String expectedUrlForEncoding = url + "?" + key + "=" + val.get(1) + "&" + key + "=" + val.get(0);
340-
doTest(model, url, false, expectedUrlForEncoding);
341-
}
305+
List<String> val = List.of("bar", "baz");
306+
Map<String, List<String>> model = Map.of(key, val);
307+
String expectedUrlForEncoding = url + "?" + key + "=" + val.get(0) + "&" + key + "=" + val.get(1);
308+
doTest(model, url, false, expectedUrlForEncoding);
342309
}
343310

344311
@Test

0 commit comments

Comments
 (0)