summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sangria-core/src/main/java/com/tavianator/sangria/core/PrettyTypes.java12
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();
}