corrected missing filename in debug output
authortupshin <tupshin@tupshin.com>
Mon, 9 Feb 2004 07:53:33 +0000 (07:53 +0000)
committertupshin <tupshin@tupshin.com>
Mon, 9 Feb 2004 07:53:33 +0000 (07:53 +0000)
This patch replaces the FIXME:linenum with filename:linenum, though it doesn't display the path to the file.

darcs-hash:20040209075333-a9258-3bf5767bd9e58a6df083c776ce8269180cfc9e5a.gz

src/org/ibex/HTTP.java
src/org/ibex/Ibex.java
src/org/ibex/Template.java

index 3dbc4cd..b2a6b76 100644 (file)
@@ -778,7 +778,7 @@ public class HTTP {
                 Scheduler.add(new Scheduler.Task() {
                         public void perform() throws IOException, JSExn {
                             Box b = new Box();
-                            Template t = Template.buildTemplate(Stream.getInputStream((JS)Main.builtin.get("org/ibex/builtin/proxy_authorization.ibex")), new Ibex(null));
+                            Template t = Template.buildTemplate("org/ibex/builtin/proxy_authorization.ibex", Stream.getInputStream((JS)Main.builtin.get("org/ibex/builtin/proxy_authorization.ibex")), new Ibex(null));
                             t.apply(b);
                             b.put("realm", realm);
                             b.put("proxyIP", proxyIP);
index 0e04205..ba80775 100644 (file)
@@ -335,7 +335,7 @@ public final class Ibex extends JS.Cloneable {
         public JSScope getStatic() {
             try {
                 // FIXME background?
-                if (t == null) t = Template.buildTemplate(Stream.getInputStream(parent.get(parentkey + ".ixt")), ibex);
+                if (t == null) t = Template.buildTemplate(parentkey + ".ixt", Stream.getInputStream(parent.get(parentkey + ".ixt")), ibex);
                 return t.staticScope;
             } catch (Exception e) {
                 Log.error(this, e);
index edd9334..ec47e7c 100644 (file)
@@ -123,9 +123,9 @@ public class Template {
 
     // XML Parsing /////////////////////////////////////////////////////////////////
 
-    public static Template buildTemplate(InputStream is, Ibex ibex) {
+    public static Template buildTemplate(String sourceName, InputStream is, Ibex ibex) {
         try {
-            return new TemplateHelper(is, ibex).t;
+            return new TemplateHelper(sourceName, is, ibex).t;
         } catch (Exception e) {
             Log.error(Template.class, e);
             return null;
@@ -135,6 +135,7 @@ public class Template {
     /** handles XML parsing; builds a Template tree as it goes */
     static final class TemplateHelper extends XML {
 
+       String sourceName;
         private int state = STATE_INITIAL;
         private static final int STATE_INITIAL = 0;
         private static final int STATE_IN_Ibex_NODE = 1;
@@ -148,7 +149,8 @@ public class Template {
         int meta = 0;
         Ibex ibex;
 
-        public TemplateHelper(InputStream is, Ibex ibex) throws XML.Exn, IOException, JSExn {
+       public TemplateHelper(String sourceName, InputStream is, Ibex ibex) throws XML.Exn, IOException, JSExn {
+            this.sourceName = sourceName;
             this.ibex = ibex;
             parse(new InputStreamReader(is));
             JS staticScript = parseScript(static_content, static_content_start);
@@ -159,7 +161,7 @@ public class Template {
         private JS parseScript(StringBuffer content, int content_start) throws IOException {
             if (content == null) return null;
             String contentString = content.toString();
-            if (contentString.trim().length() > 0) return JS.fromReader("FIXME", content_start, new StringReader(contentString));
+            if (contentString.trim().length() > 0) return JS.fromReader(sourceName, content_start, new StringReader(contentString));
             return null;
         }