Polish
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2015 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.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2015 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.
|
||||
@@ -128,9 +128,8 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
|
||||
}
|
||||
|
||||
private boolean runningOnWebSphere() {
|
||||
return ClassUtils.isPresent(
|
||||
"com.ibm.websphere.jtaextensions.ExtendedJTATransaction", getClass()
|
||||
.getClassLoader());
|
||||
return ClassUtils.isPresent("com.ibm.websphere.jtaextensions."
|
||||
+ "ExtendedJTATransaction", getClass().getClassLoader());
|
||||
}
|
||||
|
||||
private void configureWebSphereTransactionPlatform(
|
||||
@@ -142,18 +141,6 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
|
||||
return getJtaPlatformManager(WEBSHERE_JTA_PLATFORM_CLASSES);
|
||||
}
|
||||
|
||||
private Object getJtaPlatformManager(String[] candidates) {
|
||||
for (String candidate : candidates) {
|
||||
try {
|
||||
return Class.forName(candidate).newInstance();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
// Continue searching
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException("Could not configure JTA platform");
|
||||
}
|
||||
|
||||
private void configureSpringJtaPlatform(Map<String, Object> vendorProperties,
|
||||
JtaTransactionManager jtaTransactionManager) {
|
||||
try {
|
||||
@@ -162,18 +149,15 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
|
||||
}
|
||||
catch (NoClassDefFoundError ex) {
|
||||
// Can happen if Hibernate 4.2 is used
|
||||
if (isUsingJndi()) {
|
||||
// Assume that Hibernate will use JNDI
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Unable to set Hibernate JTA platform : "
|
||||
+ ex.getMessage());
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!isUsingJndi()) {
|
||||
throw new IllegalStateException("Unable to set Hibernate JTA "
|
||||
+ "platform, are you using the correct "
|
||||
+ "version of Hibernate?", ex);
|
||||
}
|
||||
// Assume that Hibernate will use JNDI
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Unable to set Hibernate JTA platform : " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,6 +174,18 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
|
||||
return getJtaPlatformManager(NO_JTA_PLATFORM_CLASSES);
|
||||
}
|
||||
|
||||
private Object getJtaPlatformManager(String[] candidates) {
|
||||
for (String candidate : candidates) {
|
||||
try {
|
||||
return Class.forName(candidate).newInstance();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
// Continue searching
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException("Could not configure JTA platform");
|
||||
}
|
||||
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE + 20)
|
||||
static class HibernateEntityManagerCondition extends SpringBootCondition {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2015 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.
|
||||
@@ -144,7 +144,8 @@ public class HttpMessageConvertersAutoConfiguration {
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public StringHttpMessageConverter stringHttpMessageConverter() {
|
||||
StringHttpMessageConverter converter = new StringHttpMessageConverter(this.encodingProperties.getCharset());
|
||||
StringHttpMessageConverter converter = new StringHttpMessageConverter(
|
||||
this.encodingProperties.getCharset());
|
||||
converter.setWriteAcceptCharset(false);
|
||||
return converter;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user