Stop referring to JDK 1.5 plus polishing
This commit is contained in:
parent
8e2134c6a7
commit
e1b1435a00
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -315,7 +315,7 @@ class TypeConverterDelegate {
|
|||
}
|
||||
|
||||
if (convertedValue == currentConvertedValue) {
|
||||
// Try field lookup as fallback: for JDK 1.5 enum or custom enum
|
||||
// Try field lookup as fallback: for Java enum or custom enum
|
||||
// with values defined as static fields. Resulting value still needs
|
||||
// to be checked, hence we don't return it right away.
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -439,7 +439,7 @@ public class MBeanClientInterceptor
|
|||
throw ex.getTargetError();
|
||||
}
|
||||
catch (RuntimeOperationsException ex) {
|
||||
// This one is only thrown by the JMX 1.2 RI, not by the JDK 1.5 JMX code.
|
||||
// This one is only thrown by the JMX 1.2 RI, not by the JDK JMX code.
|
||||
RuntimeException rex = ex.getTargetException();
|
||||
if (rex instanceof RuntimeMBeanException runtimeMBeanException) {
|
||||
throw runtimeMBeanException.getTargetException();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -80,7 +80,7 @@ public abstract class PropertiesLoaderSupport {
|
|||
/**
|
||||
* Set a location of a properties file to be loaded.
|
||||
* <p>Can point to a classic properties file or to an XML file
|
||||
* that follows JDK 1.5's properties XML format.
|
||||
* that follows Java's properties XML format.
|
||||
*/
|
||||
public void setLocation(Resource location) {
|
||||
this.locations = new Resource[] {location};
|
||||
|
|
@ -89,7 +89,7 @@ public abstract class PropertiesLoaderSupport {
|
|||
/**
|
||||
* Set locations of properties files to be loaded.
|
||||
* <p>Can point to classic properties files or to XML files
|
||||
* that follow JDK 1.5's properties XML format.
|
||||
* that follow Java's properties XML format.
|
||||
* <p>Note: Properties defined in later files will override
|
||||
* properties defined earlier files, in case of overlapping keys.
|
||||
* Hence, make sure that the most specific files are the last
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -255,9 +255,8 @@ public interface JdbcOperations {
|
|||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
|
||||
* class is used, which is part of JDK 1.5+ and also available separately as part of
|
||||
* Sun's JDBC RowSet Implementations download (rowset.jar).
|
||||
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
|
||||
* is used.
|
||||
* @param sql the SQL query to execute
|
||||
* @return an SqlRowSet representation (possibly a wrapper around a
|
||||
* {@code javax.sql.rowset.CachedRowSet})
|
||||
|
|
@ -874,9 +873,8 @@ public interface JdbcOperations {
|
|||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
|
||||
* class is used, which is part of JDK 1.5+ and also available separately as part of
|
||||
* Sun's JDBC RowSet Implementations download (rowset.jar).
|
||||
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
|
||||
* is used.
|
||||
* @param sql the SQL query to execute
|
||||
* @param args arguments to bind to the query
|
||||
* @param argTypes the SQL types of the arguments
|
||||
|
|
@ -897,9 +895,8 @@ public interface JdbcOperations {
|
|||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
|
||||
* class is used, which is part of JDK 1.5+ and also available separately as part of
|
||||
* Sun's JDBC RowSet Implementations download (rowset.jar).
|
||||
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
|
||||
* is used.
|
||||
* @param sql the SQL query to execute
|
||||
* @param args arguments to bind to the query
|
||||
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -79,7 +79,7 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractor<SqlRowSet
|
|||
/**
|
||||
* Create a new {@link CachedRowSet} instance, to be populated by
|
||||
* the {@code createSqlRowSet} implementation.
|
||||
* <p>The default implementation uses JDBC 4.1's {@link RowSetFactory}.
|
||||
* <p>The default implementation uses JDBC's {@link RowSetFactory}.
|
||||
* @return a new CachedRowSet instance
|
||||
* @throws SQLException if thrown by JDBC methods
|
||||
* @see #createSqlRowSet
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -449,9 +449,8 @@ public interface NamedParameterJdbcOperations {
|
|||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
|
||||
* class is used, which is part of JDK 1.5+ and also available separately as part of
|
||||
* Sun's JDBC RowSet Implementations download (rowset.jar).
|
||||
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
|
||||
* is used.
|
||||
* @param sql the SQL query to execute
|
||||
* @param paramSource container of arguments to bind to the query
|
||||
* @return an SqlRowSet representation (possibly a wrapper around a
|
||||
|
|
@ -469,9 +468,8 @@ public interface NamedParameterJdbcOperations {
|
|||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
|
||||
* class is used, which is part of JDK 1.5+ and also available separately as part of
|
||||
* Sun's JDBC RowSet Implementations download (rowset.jar).
|
||||
* be available at runtime: by default, a standard JDBC {@code CachedRowSet}
|
||||
* is used.
|
||||
* @param sql the SQL query to execute
|
||||
* @param paramMap map of parameters to bind to the query
|
||||
* (leaving it to the PreparedStatement to guess the corresponding SQL type)
|
||||
|
|
|
|||
|
|
@ -35,13 +35,14 @@ import org.springframework.util.CollectionUtils;
|
|||
/**
|
||||
* Implementation of the
|
||||
* {@link org.springframework.transaction.interceptor.TransactionAttributeSource}
|
||||
* interface for working with transaction metadata in JDK 1.5+ annotation format.
|
||||
* interface for working with transaction metadata from annotations.
|
||||
*
|
||||
* <p>This class reads Spring's JDK 1.5+ {@link Transactional} annotation and
|
||||
* <p>This class reads Spring's {@link Transactional @Transactional} annotation and
|
||||
* exposes corresponding transaction attributes to Spring's transaction infrastructure.
|
||||
* Also supports JTA 1.2's {@link jakarta.transaction.Transactional} and EJB3's
|
||||
* Also supports JTA's {@link jakarta.transaction.Transactional} and EJB's
|
||||
* {@link jakarta.ejb.TransactionAttribute} annotation (if present).
|
||||
* This class may also serve as base class for a custom TransactionAttributeSource,
|
||||
*
|
||||
* <p>This class may also serve as base class for a custom TransactionAttributeSource,
|
||||
* or get customized through {@link TransactionAnnotationParser} strategies.
|
||||
*
|
||||
* @author Colin Sampaleanu
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
package org.springframework.web.servlet.view;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -49,8 +47,9 @@ import static org.mockito.Mockito.mock;
|
|||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* Tests for redirect view, and query string construction.
|
||||
* Doesn't test URL encoding, although it does check that it's called.
|
||||
* Tests for redirect view and query string construction.
|
||||
*
|
||||
* <p>Doesn't test URL encoding, although it does check that it's called.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
|
|
@ -61,28 +60,24 @@ import static org.mockito.Mockito.verify;
|
|||
*/
|
||||
class RedirectViewTests {
|
||||
|
||||
private MockHttpServletRequest request;
|
||||
private MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
|
||||
private MockHttpServletResponse response;
|
||||
private MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
this.request = new MockHttpServletRequest();
|
||||
this.request.setContextPath("/context");
|
||||
this.request.setCharacterEncoding(WebUtils.DEFAULT_CHARACTER_ENCODING);
|
||||
this.request.setAttribute(DispatcherServlet.OUTPUT_FLASH_MAP_ATTRIBUTE, new FlashMap());
|
||||
this.request.setAttribute(DispatcherServlet.FLASH_MAP_MANAGER_ATTRIBUTE, new SessionFlashMapManager());
|
||||
this.response = new MockHttpServletResponse();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void noUrlSet() {
|
||||
RedirectView rv = new RedirectView();
|
||||
assertThatIllegalArgumentException().isThrownBy(
|
||||
rv::afterPropertiesSet);
|
||||
assertThatIllegalArgumentException().isThrownBy(rv::afterPropertiesSet);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -175,7 +170,6 @@ class RedirectViewTests {
|
|||
verify(mockProcessor).processUrl(request, "/path");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void updateTargetUrlWithContextLoader() throws Exception {
|
||||
StaticWebApplicationContext wac = new StaticWebApplicationContext();
|
||||
|
|
@ -214,7 +208,6 @@ class RedirectViewTests {
|
|||
assertThat(rv.isRemoteHost("https://url.somewhere.com")).isFalse();
|
||||
assertThat(rv.isRemoteHost("/path")).isFalse();
|
||||
assertThat(rv.isRemoteHost("http://somewhereelse.example")).isTrue();
|
||||
|
||||
}
|
||||
|
||||
@Test // SPR-16752
|
||||
|
|
@ -247,8 +240,7 @@ class RedirectViewTests {
|
|||
String url = "https://url.somewhere.com";
|
||||
String key = "foo";
|
||||
String val = "bar";
|
||||
Map<String, String> model = new HashMap<>();
|
||||
model.put(key, val);
|
||||
Map<String, String> model = Map.of(key, val);
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val;
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
|
|
@ -256,7 +248,7 @@ class RedirectViewTests {
|
|||
@Test
|
||||
void singleParamWithoutExposingModelAttributes() throws Exception {
|
||||
String url = "https://url.somewhere.com";
|
||||
Map<String, String> model = Collections.singletonMap("foo", "bar");
|
||||
Map<String, String> model = Map.of("foo", "bar");
|
||||
|
||||
TestRedirectView rv = new TestRedirectView(url, false, model);
|
||||
rv.setExposeModelAttributes(false);
|
||||
|
|
@ -289,18 +281,11 @@ class RedirectViewTests {
|
|||
String val = "bar";
|
||||
String key2 = "thisIsKey2";
|
||||
String val2 = "andThisIsVal2";
|
||||
Map<String, String> model = new HashMap<>();
|
||||
Map<String, String> model = new LinkedHashMap<>();
|
||||
model.put(key, val);
|
||||
model.put(key2, val2);
|
||||
try {
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val + "&" + key2 + "=" + val2;
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
catch (AssertionError err) {
|
||||
// OK, so it's the other order... probably on Sun JDK 1.6 or IBM JDK 1.5
|
||||
String expectedUrlForEncoding = url + "?" + key2 + "=" + val2 + "&" + key + "=" + val;
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val + "&" + key2 + "=" + val2;
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -308,37 +293,19 @@ class RedirectViewTests {
|
|||
String url = "https://url.somewhere.com";
|
||||
String key = "foo";
|
||||
String[] val = new String[] {"bar", "baz"};
|
||||
Map<String, String[]> model = new HashMap<>();
|
||||
model.put(key, val);
|
||||
try {
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val[0] + "&" + key + "=" + val[1];
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
catch (AssertionError err) {
|
||||
// OK, so it's the other order... probably on Sun JDK 1.6 or IBM JDK 1.5
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val[1] + "&" + key + "=" + val[0];
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
Map<String, String[]> model = Map.of(key, val);
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val[0] + "&" + key + "=" + val[1];
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
|
||||
@Test
|
||||
void collectionParam() throws Exception {
|
||||
String url = "https://url.somewhere.com";
|
||||
String key = "foo";
|
||||
List<String> val = new ArrayList<>();
|
||||
val.add("bar");
|
||||
val.add("baz");
|
||||
Map<String, List<String>> model = new HashMap<>();
|
||||
model.put(key, val);
|
||||
try {
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val.get(0) + "&" + key + "=" + val.get(1);
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
catch (AssertionError err) {
|
||||
// OK, so it's the other order... probably on Sun JDK 1.6 or IBM JDK 1.5
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val.get(1) + "&" + key + "=" + val.get(0);
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
List<String> val = List.of("bar", "baz");
|
||||
Map<String, List<String>> model = Map.of(key, val);
|
||||
String expectedUrlForEncoding = url + "?" + key + "=" + val.get(0) + "&" + key + "=" + val.get(1);
|
||||
doTest(model, url, false, expectedUrlForEncoding);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue