Revision: 1979 http://svn.sourceforge.net/vexi/?rev=1979&view=rev Author: mkpg2 Date: 2007-07-11 06:12:34 -0700 (Wed, 11 Jul 2007)
Log Message: ----------- Refactor. coerceToString did need to throw an exception. Modified Paths: -------------- core/trunk/org.ibex.js/src/org/ibex/js/Interpreter.jpp core/trunk/org.ibex.js/src/org/ibex/js/JS.jpp core/trunk/org.ibex.js/src/org/ibex/js/JSArray.jpp core/trunk/org.ibex.js/src/org/ibex/js/JSExn.java core/trunk/org.ibex.js/src/org/ibex/js/JSFunction.java core/trunk/org.ibex.js/src/org/ibex/js/JSPrimitive.jpp core/trunk/org.ibex.js/src/org/ibex/js/JSRegexp.jpp core/trunk/org.ibex.js/src/org/ibex/js/JSU.jpp core/trunk/org.ibex.js/src_dev/org/ibex/js/DevUtil.java core/trunk/org.ibex.js/src_dev/org/ibex/js/RunJS.java core/trunk/org.ibex.js/src_dev/org/ibex/js/Test.java core/trunk/org.ibex.js/src_unused/org/ibex/js/Directory.java core/trunk/org.ibex.js/src_unused/org/ibex/js/JSReflection.java core/trunk/org.vexi.core/src/org/vexi/core/Blessing.java core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp core/trunk/org.vexi.core/src/org/vexi/core/Main.java core/trunk/org.vexi.core/src/org/vexi/core/Surface.java core/trunk/org.vexi.core/src/org/vexi/core/Template.java core/trunk/org.vexi.core/src/org/vexi/core/Vexi.jpp core/trunk/org.vexi.core/src/org/vexi/graphics/PNG.java core/trunk/org.vexi.devl/src/org/ibex/js/ScopeInfoManager.java core/trunk/org.vexi.devl/src/org/ibex/js/Test.java Modified: core/trunk/org.ibex.js/src/org/ibex/js/Interpreter.jpp =================================================================== --- core/trunk/org.ibex.js/src/org/ibex/js/Interpreter.jpp 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src/org/ibex/js/Interpreter.jpp 2007-07-11 13:12:34 UTC (rev 1979) @@ -288,8 +288,8 @@ JS val = (JS)stack.pop(); JS key = (JS)stack.pop(); JS target = (JS)stack.peek(); - if (target == null) throw je("tried to put " + JSU.str(val) + " to the " + JSU.str(key) + " property on the null value"); - if (key == null) throw je("tried to assign \"" + JSU.str(val) + "\" to the null key"); + if (target == null) throw je("tried to put " + JSU.toString(val) + " to the " + JSU.toString(key) + " property on the null value"); + if (key == null) throw je("tried to assign \"" + JSU.toString(val) + "\" to the null key"); JS.Trap t = target.getTrap(key); if(t != null) t = t.write(); @@ -324,8 +324,8 @@ stack.push(key); } JS ret = null; - if (key == null) throw je("tried to get the null key from " + JSU.str(target)); - if (target == null) throw je("tried to get property \"" + JSU.str(key) + "\" from the null object"); + if (key == null) throw je("tried to get the null key from " + JSU.toString(target)); + if (target == null) throw je("tried to get property \"" + JSU.toString(key) + "\" from the null object"); JS.Trap t = null; try { t = target.getTrap(key); } catch (JSExn e) {} @@ -370,7 +370,7 @@ if (object == null) { method = (JS)stack.pop(); object = (JS)stack.pop(); - throw new JSExn("function '"+JSU.str(method)+"' not found in " + JSU.str(object)); + throw new JSExn("function '"+JSU.toString(method)+"' not found in " + JSU.toString(object)); } else if (object == JS.METHOD) { method = (JS)stack.pop(); object = (JS)stack.pop(); @@ -605,7 +605,7 @@ if(f == null) return null; String s = f.sourceName + ":" + f.line[pc-1]; if(this instanceof Interpreter.TrapMarker) - s += " (trap on " + JSU.str(((Interpreter.TrapMarker)this).t.key()) + ")"; + s += " (trap on " + JSU.toString(((Interpreter.TrapMarker)this).t.key()) + ")"; return s; } @@ -688,7 +688,7 @@ } public JS get(JS key) throws JSExn { if(JSU.isInt(key) && JSU.toInt(key) == 0) return val; - //#switch(JSU.str(key)) + //#switch(JSU.toString(key)) case "trapee": return t.target(); case "callee": return t.function(); case "trapname": return trapname; @@ -697,7 +697,7 @@ return super.get(key); } public void put(JS key, JS val) throws JSExn { - String prop = JSU.str(key); + String prop = JSU.toString(key); if(prop.equals("trapname")){ trapname = val; }else Modified: core/trunk/org.ibex.js/src/org/ibex/js/JS.jpp =================================================================== --- core/trunk/org.ibex.js/src/org/ibex/js/JS.jpp 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src/org/ibex/js/JS.jpp 2007-07-11 13:12:34 UTC (rev 1979) @@ -60,7 +60,7 @@ // FEATURE: consider renaming/removing these public JS unclone(); - public String coerceToString() throws JSExn; + public String coerceToString(); // Implementations //////////////////////////////////////////////////////// @@ -79,17 +79,17 @@ public JS call(JS method, JS[] args) throws JSExn { if (method == null) throw new JSExn( "object cannot be called, class ["+ getClass().getName() +"]"); - throw new JSExn("method not found: " + JSU.str(method) + " class="+this.getClass().getName()); + throw new JSExn("method not found: " + JSU.toString(method) + " class="+this.getClass().getName()); } public String[] getFormalArgs() { return emptystr; } - public String coerceToString() throws JSExn { return "[" +getClass().getName()+ "]"; } + public String coerceToString() { return "[" +getClass().getName()+ "]"; } public JS putAndTriggerTraps(JS key, JS val) throws JSExn { throw new JSExn("'" + key + "' is trap read only on class ["+ getClass().getName() +"]"); } public JS getAndTriggerTraps(JS key) throws JSExn { return null; } public void addTrap(JS key, JS function) throws JSExn { - JSU.warn("'" + JSU.str(key) + "' is not trappable on class ["+ getClass().getName() +"]"); } + JSU.warn("'" + JSU.toString(key) + "' is not trappable on class ["+ getClass().getName() +"]"); } public void delTrap(JS key, JS function) throws JSExn { - JSU.warn("'" + JSU.str(key) + "' trap is read only on class ["+ getClass().getName() +"]"); } + JSU.warn("'" + JSU.toString(key) + "' trap is read only on class ["+ getClass().getName() +"]"); } public Trap getTrap(JS key) throws JSExn { return null; } } @@ -118,7 +118,7 @@ public JS call(JS t, JS m, JS[] a) throws JSExn { return clonee.call(t, m, a); } public JS call(JS m, JS[] a) throws JSExn { return clonee.call(this, m, a); } public String[] getFormalArgs() { return clonee.getFormalArgs(); } - public String coerceToString() throws JSExn { return clonee.coerceToString(); } + public String coerceToString() { return clonee.coerceToString(); } // Trap methods implementation @@ -195,7 +195,7 @@ return call(method, args);} public JS call(JS method, JS[] args) throws JSExn { - throw new JSExn(method==null ? "cannot call a " + getClass().getName() : "method not found: " + JSU.str(method)); } + throw new JSExn(method==null ? "cannot call a " + getClass().getName() : "method not found: " + JSU.toString(method)); } public Keys keys() throws JSExn { return new Keys(){ @@ -236,7 +236,7 @@ if(__invoke__!=null && __invoke__ instanceof JSFunction){ return __invoke__.call(null, new JS[]{method,new JSArray(args)}); } - throw new JSExn(method==null ? "cannot call a " + getClass().getName() : "method not found: " + JSU.str(method)); } + throw new JSExn(method==null ? "cannot call a " + getClass().getName() : "method not found: " + JSU.toString(method)); } */ public void put(JS key, JS val) throws JSExn { super.put(key, val, 0); } @@ -325,7 +325,7 @@ * Uniqueness(so can act as a keys in a map) and some human readability are * the only two things we really require from these strings. * REMARK - the hash should be unique, though its not guaranteed by Java*/ - public String coerceToString() throws JSExn { return "obj$" + Integer.toHexString(hashCode()); } + public String coerceToString() { return "obj$" + Integer.toHexString(hashCode()); } // UNUSED private static final class Placeholder implements Serializable {} @@ -367,7 +367,7 @@ protected JS size() throws JSExn{ throw new JSExn("Cannot call size on [" + getClass().getName() +"]");} public JS get(JS key) throws JSExn { - //#switch(JSU.str(key)) + //#switch(JSU.toString(key)) case "contains": return METHOD; case "iterator": return METHOD; case "remove": return METHOD; @@ -377,7 +377,7 @@ } public JS call(JS method, JS[] args) throws JSExn { - //#switch(JSU.str(method)) + //#switch(JSU.toString(method)) case "contains": return contains(args[0]); case "iterator": return iterator(); case "remove": return remove(args[0]); @@ -406,7 +406,7 @@ } public JS get(JS key) throws JSExn { - //#switch(JSU.str(key)) + //#switch(JSU.toString(key)) case "hasNext": return JSU.B(hasNext()); case "next": return next(); //#end Modified: core/trunk/org.ibex.js/src/org/ibex/js/JSArray.jpp =================================================================== --- core/trunk/org.ibex.js/src/org/ibex/js/JSArray.jpp 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src/org/ibex/js/JSArray.jpp 2007-07-11 13:12:34 UTC (rev 1979) @@ -39,7 +39,7 @@ } public JS get(JS key) throws JSExn { if (key == null || !JSU.isInt(key)) { - //#switch(JSU.str(key)) + //#switch(JSU.toString(key)) case "copy": return METHOD; case "join": return METHOD; case "length": return JSU.N(size()); @@ -53,7 +53,7 @@ case "toString": return METHOD; case "unshift": return METHOD; //#end - throw new JSExn("arrays only support positive integer keys, can not use: "+JSU.str(key)); + throw new JSExn("arrays only support positive integer keys, can not use: "+JSU.toString(key)); } int i = JSU.toInt(key); if (i < 0) throw new JSExn("attempt to get negative key '"+i+"' from an array"); @@ -62,10 +62,10 @@ } catch (IndexOutOfBoundsException e) { return null; } } public void put(JS key, JS val) throws JSExn { - if (JSU.str(key).equals("length")) { setSize(JSU.toInt(val)); } + if (JSU.toString(key).equals("length")) { setSize(JSU.toInt(val)); } if (key == null || !(JSU.isInt(key)))// - throw new JSExn("arrays only support positive integer keys, can not use: "+JSU.str(key)); + throw new JSExn("arrays only support positive integer keys, can not use: "+JSU.toString(key)); int i = JSU.toInt(key); if (i < 0) throw new JSExn("attempt to put to negative key '"+i+" on an array"); if (size() < i+1) size(i + 1); @@ -74,15 +74,15 @@ } public String[] getFormalArgs() { return empty; } - public String coerceToString() throws JSExn { + public String coerceToString(){ return "[" +getClass().getName()+ "]"; //throw new JSExn("cannot coerce a "+getClass().getName()+" to a string"); } public JS call(JS method, JS[] args) throws JSExn { - //#switch(JSU.str(method)) + //#switch(JSU.toString(method)) case "copy": return copy(); - case "join": return join(args.length == 0 ? "," : JSU.str(args[0])); + case "join": return join(args.length == 0 ? "," : JSU.toString(args[0])); case "pop": return size() == 0 ? null : (JS)remove(size() - 1); case "push": addAll(args); return JSU.N(size()); case "reverse": reverse(); return this; @@ -98,7 +98,7 @@ for (int i=0; i < args.length; i++) add(i, args[i]); return JSU.N(size()); //#end - throw new JSExn("arrays have no function: "+JSU.str(method)); + throw new JSExn("arrays have no function: "+JSU.toString(method)); } public JS putAndTriggerTraps(JS key, JS val) throws JSExn { put(key, val); return val; } @@ -181,8 +181,7 @@ private static final Basket.CompareFunc defaultSort = new Basket.CompareFunc() { public int compare(Object a, Object b) { - try { return JSU.toString((JS)a).compareTo(JSU.toString((JS)b)); } - catch (JSExn e) { throw new JSExn.Wrapper(e); } + return JSU.toString((JS)a).compareTo(JSU.toString((JS)b)); } }; private JS sort(JS comparator) throws JSExn { Modified: core/trunk/org.ibex.js/src/org/ibex/js/JSExn.java =================================================================== --- core/trunk/org.ibex.js/src/org/ibex/js/JSExn.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src/org/ibex/js/JSExn.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -76,13 +76,6 @@ return e; } } - - public static class IO extends JSExn { - public IO(java.io.IOException ioe) { - super("ibex.io: " + ioe.toString()); - JSU.warn(ioe); - } - } public JS getObject() { return js; } @@ -112,7 +105,7 @@ } public String getMessage(){ try{ - return JSU.str(js.get(SC_message)); + return JSU.toString(js.get(SC_message)); }catch(JSExn e){// Shouldn't happen } return null; Modified: core/trunk/org.ibex.js/src/org/ibex/js/JSFunction.java =================================================================== --- core/trunk/org.ibex.js/src/org/ibex/js/JSFunction.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src/org/ibex/js/JSFunction.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -91,7 +91,7 @@ sb.append(i).append(" (").append(line[i]).append("): "); sb.append(JSU.opName(op[i])); sb.append(" "); - sb.append(arg[i] == null ? "(no arg)" : arg[i] instanceof JS ? JSU.str((JS)arg[i]) : arg[i]); + sb.append(arg[i] == null ? "(no arg)" : arg[i] instanceof JS ? JSU.toString((JS)arg[i]) : arg[i]); if((op[i] == JF || op[i] == JT || op[i] == JMP) && arg[i] != null && arg[i] instanceof Number) { sb.append(" jump to ").append(i+((Number) arg[i]).intValue()); } else if(op[i] == TRY) { Modified: core/trunk/org.ibex.js/src/org/ibex/js/JSPrimitive.jpp =================================================================== --- core/trunk/org.ibex.js/src/org/ibex/js/JSPrimitive.jpp 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src/org/ibex/js/JSPrimitive.jpp 2007-07-11 13:12:34 UTC (rev 1979) @@ -9,7 +9,7 @@ public JS call(JS method, JS[] args) throws JSExn { String s = coerceToString(); int slength = s.length(); - //#switch(JSU.str(method)) + //#switch(JSU.toString(method)) case "charAt": { int p = args.length >= 1 ? JSU.toInt(args[0]) : 0; if (p < 0 || p >= slength) return SC_; Modified: core/trunk/org.ibex.js/src/org/ibex/js/JSRegexp.jpp =================================================================== --- core/trunk/org.ibex.js/src/org/ibex/js/JSRegexp.jpp 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src/org/ibex/js/JSRegexp.jpp 2007-07-11 13:12:34 UTC (rev 1979) @@ -45,7 +45,7 @@ public JS call(JS method, JS[] args) throws JSExn { switch(args.length) { case 1: { - //#switch(JSU.str(method)) + //#switch(JSU.toString(method)) case "exec": { String s = JSU.toString(args[0]); int start = global ? lastIndex : 0; @@ -68,14 +68,14 @@ break; } case 2: { - //#switch(JSU.str(method)) + //#switch(JSU.toString(method)) case "stringMatch": return stringMatch(args[0], args[1]); case "stringSearch": return stringSearch(args[0], args[1]); //#end break; } case 3: { - //#switch(JSU.str(method)) + //#switch(JSU.toString(method)) case "stringReplace": return stringReplace(args[0], args[1], args[2]); //#end break; @@ -85,7 +85,7 @@ } public JS get(JS key) throws JSExn { - //#switch(JSU.str(key)) + //#switch(JSU.toString(key)) case "exec": return METHOD; case "test": return METHOD; case "toString": return METHOD; Modified: core/trunk/org.ibex.js/src/org/ibex/js/JSU.jpp =================================================================== --- core/trunk/org.ibex.js/src/org/ibex/js/JSU.jpp 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src/org/ibex/js/JSU.jpp 2007-07-11 13:12:34 UTC (rev 1979) @@ -52,7 +52,7 @@ //#end /** Coerce a JS object to a String. */ - public static String toString(JS o) throws JSExn { + public static String toString(JS o) { if(o == null) return "null"; return o.coerceToString(); } @@ -118,12 +118,6 @@ return i == -1 ? negone : i >= 0 && i < icache.length ? icache[i] : new JSNumber.I(i); } - /** Internal method for coercing to String without throwing a JSExn. */ - public static String str(JS o) { - try { return toString(o); } - catch(JSExn e) { return o.toString(); } - } - public static JS cloneWithNewGlobalScope(JS js, JS s) { return js instanceof JSFunction ? ((JSFunction)js)._cloneWithNewParentScope(new Scope.Top(s)) : js; } @@ -132,8 +126,10 @@ if(message instanceof JSExn.ExnJSObj){ message = ((JSExn.ExnJSObj)message).getJSExn(); }else if(message instanceof JS){ - try{message = toString((JS)message);}catch(JSExn e){Log.error(JSU.class, e);} - }else if(message == null) message = "*null*"; + message = toString((JS)message); + }else if(message == null){ + message = "*null*"; + } Log.uLog(Interpreter.getSourceName(), ""+ Interpreter.getLine(), message, level); } Modified: core/trunk/org.ibex.js/src_dev/org/ibex/js/DevUtil.java =================================================================== --- core/trunk/org.ibex.js/src_dev/org/ibex/js/DevUtil.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src_dev/org/ibex/js/DevUtil.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -76,7 +76,7 @@ if (f.op[i] < 0) sb.append(bytecodeToString[-f.op[i]]); else sb.append(codeToString[f.op[i]]); sb.append(" "); - sb.append(f.arg[i] == null ? "(no arg)" : f.arg[i] instanceof JS ? JSU.str((JS)f.arg[i]) : f.arg[i]); + sb.append(f.arg[i] == null ? "(no arg)" : f.arg[i] instanceof JS ? JSU.toString((JS)f.arg[i]) : f.arg[i]); if((f.op[i] == JF || f.op[i] == JT || f.op[i] == JMP) && f.arg[i] != null && f.arg[i] instanceof Number) { sb.append(" jump to ").append(i+((Number) f.arg[i]).intValue()); } else if(f.op[i] == TRY) { Modified: core/trunk/org.ibex.js/src_dev/org/ibex/js/RunJS.java =================================================================== --- core/trunk/org.ibex.js/src_dev/org/ibex/js/RunJS.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src_dev/org/ibex/js/RunJS.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -356,10 +356,10 @@ if(!JSU.isString(method)) return null; String methName = JSU.toString(method); - if("log.debug".equals(methName)) { if(args.length<1) JSU.debug("**null**"); else JSU.debug(args[0]); return null;} - if("log.info".equals(methName)) { if(args.length<1) JSU.info("**null**"); else JSU.info(args[0]); return null;} - if("log.warn".equals(methName)) { if(args.length<1) JSU.warn("**null**"); else JSU.warn(args[0]); return null;} - if("log.error".equals(methName)) { if(args.length<1) JSU.error("**null**"); else JSU.error(args[0]); return null;} + if("log.debug".equals(methName)) { if(args.length<1) JSU.debug(null); else JSU.debug(args[0]); return null;} + if("log.info".equals(methName)) { if(args.length<1) JSU.info(null); else JSU.info(args[0]); return null;} + if("log.warn".equals(methName)) { if(args.length<1) JSU.warn(null); else JSU.warn(args[0]); return null;} + if("log.error".equals(methName)) { if(args.length<1) JSU.error(null); else JSU.error(args[0]); return null;} if("clone".equals(methName)) return args.length < 1 || args[0] == null ? null : new JS.Clone(args[0]); if("firethis".equals(methName)) { Modified: core/trunk/org.ibex.js/src_dev/org/ibex/js/Test.java =================================================================== --- core/trunk/org.ibex.js/src_dev/org/ibex/js/Test.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src_dev/org/ibex/js/Test.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -103,7 +103,7 @@ // if(!JSU.isString(method)) return null; // String methName = JSU.toString(method); // if("print".equals(methName)) { -// System.out.println(JSU.str(args[0])); +// System.out.println(JSU.toString(args[0])); // return null; // } // if("clone".equals(methName)) Modified: core/trunk/org.ibex.js/src_unused/org/ibex/js/Directory.java =================================================================== --- core/trunk/org.ibex.js/src_unused/org/ibex/js/Directory.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src_unused/org/ibex/js/Directory.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -16,6 +16,7 @@ import org.ibex.io.Stream; import org.ibex.util.Encode; +import org.ibex.util.Log; // FEATURE: support for move // FEATURE: support for bytestreams @@ -71,7 +72,13 @@ } f.delete(); } - + + //REMARK - here as its the only class using this atm. + public JSExn ioExn(java.io.IOException ioe){ + Log.uWarn("IO",ioe); + return new JSExn("ibex.io: " + ioe.toString()); + } + public void put(JS key0, JS val) throws JSExn { try { if (key0 == null) return; @@ -101,7 +108,7 @@ } } } catch (IOException ioe) { - throw new JSExn.IO(ioe); + throw ioExn(ioe); } } @@ -121,7 +128,7 @@ numchars += numread; } } catch (IOException ioe) { - throw new JSExn.IO(ioe); + throw ioExn(ioe); } } Modified: core/trunk/org.ibex.js/src_unused/org/ibex/js/JSReflection.java =================================================================== --- core/trunk/org.ibex.js/src_unused/org/ibex/js/JSReflection.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.ibex.js/src_unused/org/ibex/js/JSReflection.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -7,6 +7,8 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; +import org.ibex.util.Log; + /** Automatic JS-ification via Reflection (not for use in the core) */ public class JSReflection extends JS.Immutable { public static JS wrap(Object o) throws JSExn { @@ -60,7 +62,7 @@ } catch (InvocationTargetException it) { Throwable ite = it.getTargetException(); if (ite instanceof JSExn) throw ((JSExn)ite); - JSU.warn(ite); + Log.uWarn(JSReflection.class,ite); throw new JSExn("unhandled reflected exception: " + ite.toString()); } catch (SecurityException nfe) { } throw new JSExn("called a reflection method with the wrong number of arguments"); @@ -122,7 +124,7 @@ } catch (InvocationTargetException it) { Throwable ite = it.getTargetException(); if (ite instanceof JSExn) throw ((JSExn)ite); - JSU.warn(ite); + Log.uWarn(JSReflection.class, ite); throw new JSExn("unhandled reflected exception: " + ite.toString()); } catch (SecurityException nfe) { } throw new JSExn("called a reflection method with the wrong number of arguments"); Modified: core/trunk/org.vexi.core/src/org/vexi/core/Blessing.java =================================================================== --- core/trunk/org.vexi.core/src/org/vexi/core/Blessing.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.core/src/org/vexi/core/Blessing.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -106,11 +106,11 @@ private String description() { if(parent==null) return ""; - String s = JSU.str(parentkey); - for(Blessing b = parent; b.parentkey != null; b = b.parent) s = JSU.str(b.parentkey) + "." + s; + String s = JSU.toString(parentkey); + for(Blessing b = parent; b.parentkey != null; b = b.parent) s = JSU.toString(b.parentkey) + "." + s; return s;/* - String s = "";//JSU.str(parentkey); - for(Blessing b = this; b != null; b = b.parent) s = JSU.str(b.parentkey) + "." + s; + String s = "";//JSU.toString(parentkey); + for(Blessing b = this; b != null; b = b.parent) s = JSU.toString(b.parentkey) + "." + s; return s;*/ } @@ -135,7 +135,7 @@ return t; } - public String coerceToString() throws JSExn { + public String coerceToString(){ return description()+"$"+Integer.toHexString(hashCode()); } Modified: core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp =================================================================== --- core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp 2007-07-11 13:12:34 UTC (rev 1979) @@ -250,7 +250,7 @@ // Instance Methods ///////////////////////////////////////////////////////////////////// - public String coerceToString() throws JSExn { return "box$" + Integer.toHexString(hashCode()); } + public String coerceToString() { return "box$" + Integer.toHexString(hashCode()); } // FEATURE: use cx2/cy2 format /** Adds the intersection of (x,y,w,h) and the node's current actual geometry to the Surface's dirty list */ @@ -1335,7 +1335,7 @@ throw new JSExn("Attempt to set a non-box value as a 'redirect' property on a box"); for (Box cur = (Box)value; cur != null || cur == redirect; cur = cur.parent) if (cur == redirect) { redirect = (Box)value; return; } - JSU.error("Attempt to set 'redirect' to a value that is not a descendant of the context box"); + throw new JSExn("Attempt to set 'redirect' to a value that is not a descendant of the context box"); case "x": if (parent == null) { this.x = JSU.toInt(value); Modified: core/trunk/org.vexi.core/src/org/vexi/core/Main.java =================================================================== --- core/trunk/org.vexi.core/src/org/vexi/core/Main.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.core/src/org/vexi/core/Main.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -232,5 +232,5 @@ public BuiltinFountain(String data, String name) { this.data = data; this.name = name; } public String getCacheKey() throws NotCacheableException { throw new NotCacheableException(); } public InputStream getInputStream() throws IOException { return Encode.JavaSourceCode.decode(data); } - public String coerceToString() throws JSExn { return name!=null?name:super.coerceToString(); } + public String coerceToString(){ return name!=null?name:super.coerceToString(); } } Modified: core/trunk/org.vexi.core/src/org/vexi/core/Surface.java =================================================================== --- core/trunk/org.vexi.core/src/org/vexi/core/Surface.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.core/src/org/vexi/core/Surface.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -453,7 +453,7 @@ } return o; } - public String toString() { return "Message [name=" + name + ", value=" + JSU.str(value) + "]"; } + public String toString() { return "Message [name=" + name + ", value=" + JSU.toString(value) + "]"; } } Modified: core/trunk/org.vexi.core/src/org/vexi/core/Template.java =================================================================== --- core/trunk/org.vexi.core/src/org/vexi/core/Template.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.core/src/org/vexi/core/Template.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -219,7 +219,7 @@ switch (JSU.toString(val).charAt(0)) { case '$': val = pis.get(val); - if (val == null) throw new JSExn("unknown box id '"+JSU.str(vals[i])+"' referenced in XML attribute"); + if (val == null) throw new JSExn("unknown box id '"+JSU.toString(vals[i])+"' referenced in XML attribute"); break; case '.': val = Vexi.resolveString(vexi, JSU.toString(val).substring(1), false); Modified: core/trunk/org.vexi.core/src/org/vexi/core/Vexi.jpp =================================================================== --- core/trunk/org.vexi.core/src/org/vexi/core/Vexi.jpp 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.core/src/org/vexi/core/Vexi.jpp 2007-07-11 13:12:34 UTC (rev 1979) @@ -191,10 +191,10 @@ case "file.load": return new Fountain.File(Platform.fileDialog("", false)); case "file.save": return new Fountain.File(Platform.fileDialog("", true)); // FIXME support object dumping - case "log.debug": if(args.length<1) JSU.debug("**null**"); else JSU.debug(args[0]); return null; - case "log.info": if(args.length<1) JSU.info("**null**"); else JSU.info(args[0]); return null; - case "log.warn": if(args.length<1) JSU.warn("**null**"); else JSU.warn(args[0]); return null; - case "log.error": if(args.length<1) JSU.error("**null**"); else JSU.error(args[0]); return null; + case "log.debug": if(args.length<1) JSU.debug(null); else JSU.debug(args[0]); return null; + case "log.info": if(args.length<1) JSU.info(null); else JSU.info(args[0]); return null; + case "log.warn": if(args.length<1) JSU.warn(null); else JSU.warn(args[0]); return null; + case "log.error": if(args.length<1) JSU.error(null); else JSU.error(args[0]); return null; case "net.rpc.soap": return new SOAP(JSU.toString(args[0]), JSU.toString(args[1]), JSU.toString(args[2])); case "stream.url": return Resources.fountainForNames(args); //#end Modified: core/trunk/org.vexi.core/src/org/vexi/graphics/PNG.java =================================================================== --- core/trunk/org.vexi.core/src/org/vexi/graphics/PNG.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.core/src/org/vexi/graphics/PNG.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -257,7 +257,7 @@ if (!multipass) break; } while(dis.read() != -1) Log.warn(PNG.class, - JSU.str(p.stream) +"\n"+ + JSU.toString(p.stream) +"\n"+ "Leftover data encountered. "); // 24-bit color is our native format Modified: core/trunk/org.vexi.devl/src/org/ibex/js/ScopeInfoManager.java =================================================================== --- core/trunk/org.vexi.devl/src/org/ibex/js/ScopeInfoManager.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.devl/src/org/ibex/js/ScopeInfoManager.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -95,13 +95,8 @@ nametype = "n"; else nametype = ""; - String name; - try{ - name = JSU.toString(jskey); - }catch(JSExn jse){ - // Won't be possible for the client to return all the information to fetch in this case ..., but oh well. - name = "??"; - } + String name = JSU.toString(jskey); + // REMARK - is this type business necessary? // Unfortunately JS.Obj currently treats numbers and their // string representations differently ... Modified: core/trunk/org.vexi.devl/src/org/ibex/js/Test.java =================================================================== --- core/trunk/org.vexi.devl/src/org/ibex/js/Test.java 2007-07-10 23:38:08 UTC (rev 1978) +++ core/trunk/org.vexi.devl/src/org/ibex/js/Test.java 2007-07-11 13:12:34 UTC (rev 1979) @@ -156,7 +156,7 @@ // if(!JSU.isString(method)) return null; // String methName = JSU.toString(method); // if("print".equals(methName)) { -// System.out.println(JSU.str(args[0])); +// System.out.println(JSU.toString(args[0])); // return null; // } // if("clone".equals(methName)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn