Merge branch '1.3.x'

This commit is contained in:
Phillip Webb 2016-03-08 09:51:57 -08:00
commit 644ae2c21a
4 changed files with 6 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2015 the original author or authors.
* Copyright 2012-2016 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.
@ -57,14 +57,11 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
public void visit(ASTNode[] nodes, SourceUnit source) {
this.sourceUnit = source;
List<AnnotationNode> annotationNodes = new ArrayList<AnnotationNode>();
ClassVisitor classVisitor = new ClassVisitor(source, annotationNodes);
for (ASTNode node : nodes) {
if (node instanceof ModuleNode) {
ModuleNode module = (ModuleNode) node;
visitAnnotatedNode(module.getPackage(), annotationNodes);
for (ImportNode importNode : module.getImports()) {
visitAnnotatedNode(importNode, annotationNodes);
}
@ -79,14 +76,12 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
.entrySet()) {
visitAnnotatedNode(entry.getValue(), annotationNodes);
}
for (ClassNode classNode : module.getClasses()) {
visitAnnotatedNode(classNode, annotationNodes);
classNode.visitContents(classVisitor);
}
}
}
processAnnotationNodes(annotationNodes);
}
@ -117,6 +112,7 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
private class ClassVisitor extends ClassCodeVisitorSupport {
private final SourceUnit source;
private List<AnnotationNode> annotationNodes;
ClassVisitor(SourceUnit source, List<AnnotationNode> annotationNodes) {

View File

@ -192,6 +192,7 @@ public class DevToolsDataSourceAutoConfigurationTests {
public EntityManagerFactory entityManagerFactory() {
return mock(EntityManagerFactory.class);
}
}
}

View File

@ -87,8 +87,8 @@ class RawConfigurationMetadata {
}
}
private static boolean hasLength(String s) {
return (s != null && s.length() > 0);
private static boolean hasLength(String string) {
return (string != null && string.length() > 0);
}
}

View File

@ -263,8 +263,7 @@ public class ConfigurationMetadataRepositoryJsonBuilderTests
ConfigurationMetadataSource source = group.getSources().get("org.acme.Foo");
contains(source.getProperties(), "name");
assertThat(source.getProperties()).hasSize(1);
ConfigurationMetadataSource source2 = group.getSources()
.get("org.acme.Bar");
ConfigurationMetadataSource source2 = group.getSources().get("org.acme.Bar");
contains(source2.getProperties(), "title");
assertThat(source2.getProperties()).hasSize(1);
validatePropertyHints(repo.getAllProperties().get("name"), 0, 0);