Skip to content

Commit 75f394c

Browse files
committed
Merge branch '5.2.x'
2 parents 30d556b + e797398 commit 75f394c

File tree

4 files changed

+44
-18
lines changed

4 files changed

+44
-18
lines changed

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.io.FileNotFoundException;
2020
import java.io.IOException;
2121
import java.lang.annotation.Annotation;
22+
import java.net.SocketException;
2223
import java.net.UnknownHostException;
2324
import java.util.ArrayDeque;
2425
import java.util.ArrayList;
@@ -461,7 +462,7 @@ private void processPropertySource(AnnotationAttributes propertySource) throws I
461462
Resource resource = this.resourceLoader.getResource(resolvedLocation);
462463
addPropertySource(factory.createPropertySource(name, new EncodedResource(resource, encoding)));
463464
}
464-
catch (IllegalArgumentException | FileNotFoundException | UnknownHostException ex) {
465+
catch (IllegalArgumentException | FileNotFoundException | UnknownHostException | SocketException ex) {
465466
// Placeholders not resolvable or resource not found when trying to open it
466467
if (ignoreResourceNotFound) {
467468
if (logger.isInfoEnabled()) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.io.FileNotFoundException;
2020
import java.io.IOException;
21+
import java.net.SocketException;
2122
import java.net.UnknownHostException;
2223
import java.util.Properties;
2324

@@ -180,7 +181,7 @@ protected void loadProperties(Properties props) throws IOException {
180181
PropertiesLoaderUtils.fillProperties(
181182
props, new EncodedResource(location, this.fileEncoding), this.propertiesPersister);
182183
}
183-
catch (FileNotFoundException | UnknownHostException ex) {
184+
catch (FileNotFoundException | UnknownHostException | SocketException ex) {
184185
if (this.ignoreResourceNotFound) {
185186
if (logger.isDebugEnabled()) {
186187
logger.debug("Properties resource not found: " + ex.getMessage());

spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallParameterMetaData.java

Lines changed: 39 additions & 15 deletions
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-2020 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.
@@ -30,25 +30,39 @@
3030
*/
3131
public class CallParameterMetaData {
3232

33+
private final boolean function;
34+
3335
@Nullable
34-
private String parameterName;
36+
private final String parameterName;
3537

36-
private int parameterType;
38+
private final int parameterType;
3739

38-
private int sqlType;
40+
private final int sqlType;
3941

4042
@Nullable
41-
private String typeName;
43+
private final String typeName;
4244

43-
private boolean nullable;
45+
private final boolean nullable;
4446

4547

4648
/**
47-
* Constructor taking all the properties.
49+
* Constructor taking all the properties except the function marker.
4850
*/
51+
@Deprecated
4952
public CallParameterMetaData(
5053
@Nullable String columnName, int columnType, int sqlType, @Nullable String typeName, boolean nullable) {
5154

55+
this(false, columnName, columnType, sqlType, typeName, nullable);
56+
}
57+
58+
/**
59+
* Constructor taking all the properties including the function marker.
60+
* @since 5.2.9
61+
*/
62+
public CallParameterMetaData(boolean function, @Nullable String columnName, int columnType,
63+
int sqlType, @Nullable String typeName, boolean nullable) {
64+
65+
this.function = function;
5266
this.parameterName = columnName;
5367
this.parameterType = columnType;
5468
this.sqlType = sqlType;
@@ -58,15 +72,23 @@ public CallParameterMetaData(
5872

5973

6074
/**
61-
* Get the parameter name.
75+
* Return whether this parameter is declared in a function.
76+
* @since 5.2.9
77+
*/
78+
public boolean isFunction() {
79+
return this.function;
80+
}
81+
82+
/**
83+
* Return the parameter name.
6284
*/
6385
@Nullable
6486
public String getParameterName() {
6587
return this.parameterName;
6688
}
6789

6890
/**
69-
* Get the parameter type.
91+
* Return the parameter type.
7092
*/
7193
public int getParameterType() {
7294
return this.parameterType;
@@ -75,31 +97,33 @@ public int getParameterType() {
7597
/**
7698
* Determine whether the declared parameter qualifies as a 'return' parameter
7799
* for our purposes: type {@link DatabaseMetaData#procedureColumnReturn} or
78-
* {@link DatabaseMetaData#procedureColumnResult}.
100+
* {@link DatabaseMetaData#procedureColumnResult}, or in case of a function,
101+
* {@link DatabaseMetaData#functionReturn}.
79102
* @since 4.3.15
80103
*/
81104
public boolean isReturnParameter() {
82-
return (this.parameterType == DatabaseMetaData.procedureColumnReturn ||
83-
this.parameterType == DatabaseMetaData.procedureColumnResult);
105+
return (this.function ? this.parameterType == DatabaseMetaData.functionReturn :
106+
(this.parameterType == DatabaseMetaData.procedureColumnReturn ||
107+
this.parameterType == DatabaseMetaData.procedureColumnResult));
84108
}
85109

86110
/**
87-
* Get the parameter SQL type.
111+
* Return the parameter SQL type.
88112
*/
89113
public int getSqlType() {
90114
return this.sqlType;
91115
}
92116

93117
/**
94-
* Get the parameter type name.
118+
* Return the parameter type name.
95119
*/
96120
@Nullable
97121
public String getTypeName() {
98122
return this.typeName;
99123
}
100124

101125
/**
102-
* Get whether the parameter is nullable.
126+
* Return whether the parameter is nullable.
103127
*/
104128
public boolean isNullable() {
105129
return this.nullable;

spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ else if ("Oracle".equals(databaseMetaData.getDatabaseProductName())) {
399399
}
400400
else {
401401
int nullable = (function ? DatabaseMetaData.functionNullable : DatabaseMetaData.procedureNullable);
402-
CallParameterMetaData meta = new CallParameterMetaData(columnName, columnType,
402+
CallParameterMetaData meta = new CallParameterMetaData(function, columnName, columnType,
403403
columns.getInt("DATA_TYPE"), columns.getString("TYPE_NAME"),
404404
columns.getInt("NULLABLE") == nullable);
405405
this.callParameterMetaData.add(meta);

0 commit comments

Comments
 (0)