File tree Expand file tree Collapse file tree 4 files changed +19
-17
lines changed
spring-core/src/main/java/org/springframework/core/io
spring-jdbc/src/test/java/org/springframework/jdbc/core
spring-web/src/main/java/org/springframework Expand file tree Collapse file tree 4 files changed +19
-17
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2020 the original author or authors.
2+ * Copyright 2002-2022 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.
@@ -60,6 +60,18 @@ public class UrlResource extends AbstractFileResolvingResource {
6060 private volatile URL cleanedUrl ;
6161
6262
63+ /**
64+ * Create a new {@code UrlResource} based on the given URL object.
65+ * @param url a URL
66+ * @see #UrlResource(URI)
67+ * @see #UrlResource(String)
68+ */
69+ public UrlResource (URL url ) {
70+ Assert .notNull (url , "URL must not be null" );
71+ this .uri = null ;
72+ this .url = url ;
73+ }
74+
6375 /**
6476 * Create a new {@code UrlResource} based on the given URI object.
6577 * @param uri a URI
@@ -72,16 +84,6 @@ public UrlResource(URI uri) throws MalformedURLException {
7284 this .url = uri .toURL ();
7385 }
7486
75- /**
76- * Create a new {@code UrlResource} based on the given URL object.
77- * @param url a URL
78- */
79- public UrlResource (URL url ) {
80- Assert .notNull (url , "URL must not be null" );
81- this .uri = null ;
82- this .url = url ;
83- }
84-
8587 /**
8688 * Create a new {@code UrlResource} based on a URL path.
8789 * <p>Note: The given path needs to be pre-encoded if necessary.
Original file line number Diff line number Diff line change @@ -955,7 +955,7 @@ public void testSQLErrorCodeTranslation() throws Exception {
955955 }
956956
957957 @ Test
958- public void testSQLErrorCodeTranslationWithSpecifiedDbName () throws Exception {
958+ public void testSQLErrorCodeTranslationWithSpecifiedDatabaseName () throws Exception {
959959 final SQLException sqlException = new SQLException ("I have a known problem" , "99999" , 1054 );
960960 final String sql = "SELECT ID FROM CUSTOMER" ;
961961
@@ -983,7 +983,7 @@ public void testSQLErrorCodeTranslationWithSpecifiedDbName() throws Exception {
983983 * to get the metadata
984984 */
985985 @ Test
986- public void testUseCustomSQLErrorCodeTranslator () throws Exception {
986+ public void testUseCustomExceptionTranslator () throws Exception {
987987 // Bad SQL state
988988 final SQLException sqlException = new SQLException ("I have a known problem" , "07000" , 1054 );
989989 final String sql = "SELECT ID FROM CUSTOMER" ;
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2018 the original author or authors.
2+ * Copyright 2002-2022 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.
@@ -174,7 +174,7 @@ else if (elementClass.isAnnotationPresent(XmlType.class)) {
174174 }
175175 catch (UnmarshalException ex ) {
176176 throw new HttpMessageNotReadableException (
177- "Could not unmarshal to [" + elementClass + "]: " + ex . getMessage () , ex , inputMessage );
177+ "Could not unmarshal to [" + elementClass + "]: " + ex , ex , inputMessage );
178178 }
179179 catch (JAXBException ex ) {
180180 throw new HttpMessageConversionException ("Invalid JAXB setup: " + ex .getMessage (), ex );
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2018 the original author or authors.
2+ * Copyright 2002-2022 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.
@@ -229,7 +229,7 @@ public final void init(FilterConfig filterConfig) throws ServletException {
229229 }
230230 catch (BeansException ex ) {
231231 String msg = "Failed to set bean properties on filter '" +
232- filterConfig .getFilterName () + "': " + ex .getMessage ();
232+ filterConfig .getFilterName () + "': " + ex .getMessage ();
233233 logger .error (msg , ex );
234234 throw new NestedServletException (msg , ex );
235235 }
You can’t perform that action at this time.
0 commit comments