diff options
Diffstat (limited to 'sangria-core/src/main')
-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(); } |