Browse Source

Polish

pull/5887/merge
Phillip Webb 10 years ago
parent
commit
7fb545d26c
  1. 5
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqExceptionTranslator.java
  2. 1
      spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqExceptionTranslatorTests.java
  3. 11
      spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeElementMembers.java
  4. 1
      spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/InvalidAccessorProperties.java

5
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqExceptionTranslator.java

@ -57,8 +57,9 @@ class JooqExceptionTranslator extends DefaultExecuteListener { @@ -57,8 +57,9 @@ class JooqExceptionTranslator extends DefaultExecuteListener {
private SQLExceptionTranslator getTranslator(ExecuteContext context) {
SQLDialect dialect = context.configuration().dialect();
if (dialect != null) {
return new SQLErrorCodeSQLExceptionTranslator(dialect.thirdParty().springDbName());
if (dialect != null && dialect.thirdParty() != null) {
return new SQLErrorCodeSQLExceptionTranslator(
dialect.thirdParty().springDbName());
}
return new SQLStateSQLExceptionTranslator();
}

1
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqExceptionTranslatorTests.java

@ -41,7 +41,6 @@ import static org.mockito.Mockito.verify; @@ -41,7 +41,6 @@ import static org.mockito.Mockito.verify;
*
* @author Andy Wilkinson
*/
@RunWith(Parameterized.class)
public class JooqExceptionTranslatorTests {

11
spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeElementMembers.java

@ -118,15 +118,14 @@ class TypeElementMembers { @@ -118,15 +118,14 @@ class TypeElementMembers {
private boolean isSetter(ExecutableElement method) {
final String name = method.getSimpleName().toString();
return (name.startsWith("set") && name.length() > 3)
&& method.getParameters().size() == 1
&& (isSetterReturnType(method));
return (name.startsWith("set") && name.length() > 3
&& method.getParameters().size() == 1 && isSetterReturnType(method));
}
private boolean isSetterReturnType(ExecutableElement method) {
return (TypeKind.VOID == method.getReturnType().getKind()
|| this.env.getTypeUtils().isSameType(
method.getEnclosingElement().asType(), method.getReturnType()));
TypeMirror returnType = method.getReturnType();
return (TypeKind.VOID == returnType.getKind() || this.env.getTypeUtils()
.isSameType(method.getEnclosingElement().asType(), returnType));
}
private String getAccessorName(String methodName) {

1
spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/InvalidAccessorProperties.java

@ -27,6 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties; @@ -27,6 +27,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
public class InvalidAccessorProperties {
private String name;
private boolean flag;
public void set(String name) {

Loading…
Cancel
Save