Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Oct 31, 2016
1 parent 49b244b commit 57d5a2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ private TypeMirror getDeclaredType(Types types, Class<?> typeClass,
/**
* Return the qualified name of the specified element.
* @param element the element to handle
* @return the fully qualified name of the element, suitable for a call
* to {@link Class#forName(String)}
* @return the fully qualified name of the element, suitable for a call to
* {@link Class#forName(String)}
*/
public String getQualifiedName(Element element) {
if (element == null) {
Expand All @@ -106,19 +106,20 @@ public String getQualifiedName(Element element) {
TypeElement enclosingElement = getEnclosingTypeElement(element.asType());
if (enclosingElement != null) {
return getQualifiedName(enclosingElement) + "$"
+ ((DeclaredType) element.asType()).asElement().getSimpleName().toString();
+ ((DeclaredType) element.asType()).asElement().getSimpleName()
.toString();
}
if (element instanceof TypeElement) {
return ((TypeElement) element).getQualifiedName().toString();
}
throw new IllegalStateException("Could not extract qualified name from "
+ element);
throw new IllegalStateException(
"Could not extract qualified name from " + element);
}

/**
* Return the type of the specified {@link TypeMirror} including all its generic
* information.
* @param type the type to handle
* @param type the type to handle
* @return a representation of the type including all its generic information
*/
public String getType(TypeMirror type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,20 +374,17 @@ public void genericTypes() throws IOException {
assertThat(metadata).has(Metadata.withGroup("generic.foo.bar.biz").ofType(
"org.springframework.boot.configurationsample.specific.GenericConfig$Bar$Biz"));
assertThat(metadata).has(Metadata.withProperty("generic.foo.name")
.ofType(String.class)
.fromSource(GenericConfig.Foo.class));
.ofType(String.class).fromSource(GenericConfig.Foo.class));
assertThat(metadata).has(Metadata.withProperty("generic.foo.string-to-bar")
.ofType("java.util.Map<java.lang.String,org.springframework.boot.configurationsample.specific.GenericConfig.Bar<java.lang.Integer>>")
.fromSource(GenericConfig.Foo.class));
assertThat(metadata).has(Metadata.withProperty("generic.foo.string-to-integer")
.ofType("java.util.Map<java.lang.String,java.lang.Integer>")
.fromSource(GenericConfig.Foo.class));
assertThat(metadata).has(Metadata.withProperty("generic.foo.bar.name")
.ofType("java.lang.String")
.fromSource(GenericConfig.Bar.class));
.ofType("java.lang.String").fromSource(GenericConfig.Bar.class));
assertThat(metadata).has(Metadata.withProperty("generic.foo.bar.biz.name")
.ofType("java.lang.String")
.fromSource(GenericConfig.Bar.Biz.class));
.ofType("java.lang.String").fromSource(GenericConfig.Bar.Biz.class));
assertThat(metadata.getItems()).hasSize(9);
}

Expand Down

0 comments on commit 57d5a2e

Please sign in to comment.