Skip to content

Commit 34ddb1e

Browse files
committed
Merge branch '5.1.x'
2 parents 0b9522c + 9895e44 commit 34ddb1e

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 3 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-2019 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.
@@ -372,8 +372,9 @@ protected void addAllClassLoaderJarRoots(@Nullable ClassLoader classLoader, Set<
372372
try {
373373
for (URL url : ((URLClassLoader) classLoader).getURLs()) {
374374
try {
375-
UrlResource jarResource = new UrlResource(
376-
ResourceUtils.JAR_URL_PREFIX + url + ResourceUtils.JAR_URL_SEPARATOR);
375+
UrlResource jarResource = (ResourceUtils.URL_PROTOCOL_JAR.equals(url.getProtocol()) ?
376+
new UrlResource(url) :
377+
new UrlResource(ResourceUtils.JAR_URL_PREFIX + url + ResourceUtils.JAR_URL_SEPARATOR));
377378
if (jarResource.exists()) {
378379
result.add(jarResource);
379380
}

spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java

Lines changed: 4 additions & 1 deletion
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-2019 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.
@@ -418,6 +418,9 @@ public static String commonDatabaseName(@Nullable String source) {
418418
if (source != null && source.startsWith("DB2")) {
419419
name = "DB2";
420420
}
421+
else if ("MariaDB".equals(source)) {
422+
name = "MySQL";
423+
}
421424
else if ("Sybase SQL Server".equals(source) ||
422425
"Adaptive Server Enterprise".equals(source) ||
423426
"ASE".equals(source) ||

spring-jdbc/src/main/resources/org/springframework/jdbc/support/sql-error-codes.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@
186186
</bean>
187187

188188
<bean id="MySQL" class="org.springframework.jdbc.support.SQLErrorCodes">
189+
<property name="databaseProductNames">
190+
<list>
191+
<value>MySQL</value>
192+
<value>MariaDB</value>
193+
</list>
194+
</property>
189195
<property name="badSqlGrammarCodes">
190196
<value>1054,1064,1146</value>
191197
</property>

spring-orm/src/main/java/org/springframework/orm/hibernate5/SpringBeanContainer.java

Lines changed: 2 additions & 1 deletion
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-2019 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.
@@ -115,6 +115,7 @@ public <B> ContainedBean<B> getBean(
115115
@SuppressWarnings("unchecked")
116116
public <B> ContainedBean<B> getBean(
117117
String name, Class<B> beanType, LifecycleOptions lifecycleOptions, BeanInstanceProducer fallbackProducer) {
118+
118119
SpringContainedBean<?> bean;
119120
if (lifecycleOptions.canUseCachedReferences()) {
120121
bean = this.beanCache.get(name);

0 commit comments

Comments
 (0)