From b0bb30831a334ff30e3e6a13790bbc324db89de5 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 25 Sep 2014 12:59:14 -0400 Subject: core: Make PrettyTypes use PotentialAnnotation to format annotations. --- .../main/java/com/tavianator/sangria/core/PrettyTypes.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sangria-core') 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(); } -- cgit v1.2.3