Configuration object builder expression: Slightly improved error message for 
something=NoSuchClass when the class name contains no dot


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/f0a6f451
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/f0a6f451
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/f0a6f451

Branch: refs/heads/2.3
Commit: f0a6f4511e79d2e7aeb3d6ba5c7c2b12b96159b8
Parents: 017e9f5
Author: ddekany <ddek...@apache.org>
Authored: Fri May 26 10:22:25 2017 +0200
Committer: ddekany <ddek...@apache.org>
Committed: Fri May 26 10:22:25 2017 +0200

----------------------------------------------------------------------
 src/main/java/freemarker/core/_ObjectBuilderSettingEvaluator.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/f0a6f451/src/main/java/freemarker/core/_ObjectBuilderSettingEvaluator.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/_ObjectBuilderSettingEvaluator.java 
b/src/main/java/freemarker/core/_ObjectBuilderSettingEvaluator.java
index 2f91b55..ae99899 100644
--- a/src/main/java/freemarker/core/_ObjectBuilderSettingEvaluator.java
+++ b/src/main/java/freemarker/core/_ObjectBuilderSettingEvaluator.java
@@ -879,7 +879,7 @@ public class _ObjectBuilderSettingEvaluator {
                         throw new 
LegacyExceptionWrapperSettingEvaluationExpression(e);
                     }
                 } catch (LegacyExceptionWrapperSettingEvaluationExpression e) {
-                    if (!canBeStaticField) {
+                    if (!canBeStaticField || className.indexOf('.') == -1) {
                         throw e;
                     }
                     // Silently try to interpret className as static filed, 
throw the original exception if that fails. 

Reply via email to