From 44e8a925b2d13233a643e685fe5ad4ba0a0a0a0d Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Thu, 1 May 2014 11:13:50 -0400 Subject: [PATCH] Fix Tokens.Value.toString on unresolved values It was throwing an exception trying to unwrap unresolved value --- config/src/main/java/com/typesafe/config/impl/Tokens.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/src/main/java/com/typesafe/config/impl/Tokens.java b/config/src/main/java/com/typesafe/config/impl/Tokens.java index 61a4679cd..abcee421b 100644 --- a/config/src/main/java/com/typesafe/config/impl/Tokens.java +++ b/config/src/main/java/com/typesafe/config/impl/Tokens.java @@ -26,7 +26,10 @@ AbstractConfigValue value() { @Override public String toString() { - return "'" + value().unwrapped() + "' (" + value.valueType().name() + ")"; + if (value().resolveStatus() == ResolveStatus.RESOLVED) + return "'" + value().unwrapped() + "' (" + value.valueType().name() + ")"; + else + return "'' (" + value.valueType().name() + ")"; } @Override