Merge branch '1.3.x'
This commit is contained in:
commit
644ae2c21a
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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) {
|
public void visit(ASTNode[] nodes, SourceUnit source) {
|
||||||
this.sourceUnit = source;
|
this.sourceUnit = source;
|
||||||
List<AnnotationNode> annotationNodes = new ArrayList<AnnotationNode>();
|
List<AnnotationNode> annotationNodes = new ArrayList<AnnotationNode>();
|
||||||
|
|
||||||
ClassVisitor classVisitor = new ClassVisitor(source, annotationNodes);
|
ClassVisitor classVisitor = new ClassVisitor(source, annotationNodes);
|
||||||
for (ASTNode node : nodes) {
|
for (ASTNode node : nodes) {
|
||||||
if (node instanceof ModuleNode) {
|
if (node instanceof ModuleNode) {
|
||||||
ModuleNode module = (ModuleNode) node;
|
ModuleNode module = (ModuleNode) node;
|
||||||
|
|
||||||
visitAnnotatedNode(module.getPackage(), annotationNodes);
|
visitAnnotatedNode(module.getPackage(), annotationNodes);
|
||||||
|
|
||||||
for (ImportNode importNode : module.getImports()) {
|
for (ImportNode importNode : module.getImports()) {
|
||||||
visitAnnotatedNode(importNode, annotationNodes);
|
visitAnnotatedNode(importNode, annotationNodes);
|
||||||
}
|
}
|
||||||
|
|
@ -79,14 +76,12 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
|
||||||
.entrySet()) {
|
.entrySet()) {
|
||||||
visitAnnotatedNode(entry.getValue(), annotationNodes);
|
visitAnnotatedNode(entry.getValue(), annotationNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ClassNode classNode : module.getClasses()) {
|
for (ClassNode classNode : module.getClasses()) {
|
||||||
visitAnnotatedNode(classNode, annotationNodes);
|
visitAnnotatedNode(classNode, annotationNodes);
|
||||||
classNode.visitContents(classVisitor);
|
classNode.visitContents(classVisitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processAnnotationNodes(annotationNodes);
|
processAnnotationNodes(annotationNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,6 +112,7 @@ public abstract class AnnotatedNodeASTTransformation implements ASTTransformatio
|
||||||
private class ClassVisitor extends ClassCodeVisitorSupport {
|
private class ClassVisitor extends ClassCodeVisitorSupport {
|
||||||
|
|
||||||
private final SourceUnit source;
|
private final SourceUnit source;
|
||||||
|
|
||||||
private List<AnnotationNode> annotationNodes;
|
private List<AnnotationNode> annotationNodes;
|
||||||
|
|
||||||
ClassVisitor(SourceUnit source, List<AnnotationNode> annotationNodes) {
|
ClassVisitor(SourceUnit source, List<AnnotationNode> annotationNodes) {
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ public class DevToolsDataSourceAutoConfigurationTests {
|
||||||
public EntityManagerFactory entityManagerFactory() {
|
public EntityManagerFactory entityManagerFactory() {
|
||||||
return mock(EntityManagerFactory.class);
|
return mock(EntityManagerFactory.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,8 @@ class RawConfigurationMetadata {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean hasLength(String s) {
|
private static boolean hasLength(String string) {
|
||||||
return (s != null && s.length() > 0);
|
return (string != null && string.length() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -263,8 +263,7 @@ public class ConfigurationMetadataRepositoryJsonBuilderTests
|
||||||
ConfigurationMetadataSource source = group.getSources().get("org.acme.Foo");
|
ConfigurationMetadataSource source = group.getSources().get("org.acme.Foo");
|
||||||
contains(source.getProperties(), "name");
|
contains(source.getProperties(), "name");
|
||||||
assertThat(source.getProperties()).hasSize(1);
|
assertThat(source.getProperties()).hasSize(1);
|
||||||
ConfigurationMetadataSource source2 = group.getSources()
|
ConfigurationMetadataSource source2 = group.getSources().get("org.acme.Bar");
|
||||||
.get("org.acme.Bar");
|
|
||||||
contains(source2.getProperties(), "title");
|
contains(source2.getProperties(), "title");
|
||||||
assertThat(source2.getProperties()).hasSize(1);
|
assertThat(source2.getProperties()).hasSize(1);
|
||||||
validatePropertyHints(repo.getAllProperties().get("name"), 0, 0);
|
validatePropertyHints(repo.getAllProperties().get("name"), 0, 0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue