From e8641ba4fa939bce1f8bfafdfeb7154f36e1b79b Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 13 Apr 2011 11:38:26 -0700 Subject: [PATCH] We have interned strings here, so we can use reference equality to determine whether we're seeing {{.}} or not. Also reinstated treatment of ".foo" as a compound key. I'm not 100% sure that makes more sense than treating ".foo" as a simple key, but I'd rather change less behavior than more when making the {{.}} fix. --- src/main/java/com/samskivert/mustache/Template.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/samskivert/mustache/Template.java b/src/main/java/com/samskivert/mustache/Template.java index ab6ff8f..2abf193 100644 --- a/src/main/java/com/samskivert/mustache/Template.java +++ b/src/main/java/com/samskivert/mustache/Template.java @@ -80,8 +80,7 @@ public class Template if (!_compiler.standardsMode) { // if we're dealing with a compound key, resolve each component and use the result to // resolve the subsequent component and so forth - - if (name.indexOf(DOT_NAME) > 0 && !DOT_NAME.equals(name)) { + if (name != DOT_NAME && name.indexOf(DOT_NAME) != -1) { String[] comps = name.split("\\."); // we want to allow the first component of a compound key to be located in a parent // context, but once we're selecting sub-components, they must only be resolved in the