2002/08/18 05:30:45
[org.ibex.core.git] / src / org / xwt / Template.java
index 6a8113e..f345718 100644 (file)
@@ -139,10 +139,12 @@ public class Template {
 
     // Methods to apply templates ////////////////////////////////////////////////////////
 
-    private Template() { } 
-    private Template(InputStream is, String nodeName) throws XML.SAXException, IOException {
+    private Template(String nodeName) {
         this.nodeName = nodeName;
         cache.put(nodeName, this);
+    }
+    private Template(InputStream is, String nodeName) throws XML.SAXException, IOException {
+        this(nodeName);
         new TemplateHelper().parseit(is, this);
     }
 
@@ -303,8 +305,7 @@ public class Template {
             if (t != b.template) retemplatize = true;
             b.template = t;
         }
-        if (b.template != null && b.template.changed)
-            retemplatize = true;
+        if (b.template != null && b.template.changed) retemplatize = true;
 
         if (retemplatize) {
 
@@ -526,8 +527,7 @@ public class Template {
                 nodeStack.addElement(t);
 
                 // instantiate a new node, and set its nodeName/importlist/preapply
-                Template t2 = new Template();
-                t2.nodeName = t.nodeName + "." + t.childvect.size();
+                Template t2 = new Template(t.nodeName + "." + t.childvect.size());
                 t2.importlist = t.importlist;
                 t2.startLine = line;
                 if (!name.equals("box")) t2.preapply = new String[] { name };