diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2014-09-25 12:59:14 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2014-09-25 12:59:14 -0400 |
commit | b0bb30831a334ff30e3e6a13790bbc324db89de5 (patch) | |
tree | 069393bbf4331f49ee639fcf905224588979aef5 /sangria-core/src | |
parent | 0b0f90ec22c62e191c1331f64660e5c4f282523e (diff) | |
download | sangria-b0bb30831a334ff30e3e6a13790bbc324db89de5.tar.xz |
core: Make PrettyTypes use PotentialAnnotation to format annotations.
Diffstat (limited to 'sangria-core/src')
-rw-r--r-- | sangria-core/src/main/java/com/tavianator/sangria/core/PrettyTypes.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sangria-core/src/main/java/com/tavianator/sangria/core/PrettyTypes.java b/sangria-core/src/main/java/com/tavianator/sangria/core/PrettyTypes.java index 81f4159..14ff87b 100644 --- a/sangria-core/src/main/java/com/tavianator/sangria/core/PrettyTypes.java +++ b/sangria-core/src/main/java/com/tavianator/sangria/core/PrettyTypes.java @@ -67,14 +67,10 @@ public class PrettyTypes { private static String format(Key<?> key) { StringBuilder builder = new StringBuilder(key.getTypeLiteral().toString()); - if (key.getAnnotationType() != null) { - builder.append(" annotated with "); - if (key.getAnnotation() != null) { - builder.append(key.getAnnotation()); - } else { - builder.append("@") - .append(format(key.getAnnotationType())); - } + PotentialAnnotation annotation = PotentialAnnotation.from(key); + if (annotation.hasAnnotation()) { + builder.append(" annotated with ") + .append(annotation); } return builder.toString(); } |