summaryrefslogtreecommitdiffstats
path: root/sangria-core/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-09-25 12:59:14 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-09-25 12:59:14 -0400
commitb0bb30831a334ff30e3e6a13790bbc324db89de5 (patch)
tree069393bbf4331f49ee639fcf905224588979aef5 /sangria-core/src
parent0b0f90ec22c62e191c1331f64660e5c4f282523e (diff)
downloadsangria-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.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();
}