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 1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -60,6 +60,18 @@ public class UrlResource extends AbstractFileResolvingResource {
60
60
private volatile URL cleanedUrl ;
61
61
62
62
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
+
63
75
/**
64
76
* Create a new {@code UrlResource} based on the given URI object.
65
77
* @param uri a URI
@@ -72,16 +84,6 @@ public UrlResource(URI uri) throws MalformedURLException {
72
84
this .url = uri .toURL ();
73
85
}
74
86
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
-
85
87
/**
86
88
* Create a new {@code UrlResource} based on a URL path.
87
89
* <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 {
955
955
}
956
956
957
957
@ Test
958
- public void testSQLErrorCodeTranslationWithSpecifiedDbName () throws Exception {
958
+ public void testSQLErrorCodeTranslationWithSpecifiedDatabaseName () throws Exception {
959
959
final SQLException sqlException = new SQLException ("I have a known problem" , "99999" , 1054 );
960
960
final String sql = "SELECT ID FROM CUSTOMER" ;
961
961
@@ -983,7 +983,7 @@ public void testSQLErrorCodeTranslationWithSpecifiedDbName() throws Exception {
983
983
* to get the metadata
984
984
*/
985
985
@ Test
986
- public void testUseCustomSQLErrorCodeTranslator () throws Exception {
986
+ public void testUseCustomExceptionTranslator () throws Exception {
987
987
// Bad SQL state
988
988
final SQLException sqlException = new SQLException ("I have a known problem" , "07000" , 1054 );
989
989
final String sql = "SELECT ID FROM CUSTOMER" ;
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -174,7 +174,7 @@ else if (elementClass.isAnnotationPresent(XmlType.class)) {
174
174
}
175
175
catch (UnmarshalException ex ) {
176
176
throw new HttpMessageNotReadableException (
177
- "Could not unmarshal to [" + elementClass + "]: " + ex . getMessage () , ex , inputMessage );
177
+ "Could not unmarshal to [" + elementClass + "]: " + ex , ex , inputMessage );
178
178
}
179
179
catch (JAXBException ex ) {
180
180
throw new HttpMessageConversionException ("Invalid JAXB setup: " + ex .getMessage (), ex );
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -229,7 +229,7 @@ public final void init(FilterConfig filterConfig) throws ServletException {
229
229
}
230
230
catch (BeansException ex ) {
231
231
String msg = "Failed to set bean properties on filter '" +
232
- filterConfig .getFilterName () + "': " + ex .getMessage ();
232
+ filterConfig .getFilterName () + "': " + ex .getMessage ();
233
233
logger .error (msg , ex );
234
234
throw new NestedServletException (msg , ex );
235
235
}
You can’t perform that action at this time.
0 commit comments