From: <dr...@us...> - 2002-12-20 02:25:57
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv29350/src/org/webmacro Modified Files: Context.java PropertyException.java Log Message: - (very) minor performance optimizations. It seems that: Object[] o = new Object[1]; o = foo; is slightly slower than: Object[] o = { foo }; - Also removed an unnecessary synchronization in LogFile Index: Context.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/Context.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Context.java 15 Dec 2002 10:22:36 -0000 1.58 --- Context.java 20 Dec 2002 02:25:23 -0000 1.59 *************** *** 617,623 **** && parmTypes[1].equals(_ctorArgs1[1])){ ctor = ctors[i]; ! Object[] args = new Object[2]; ! args[0] = key; ! args[1] = new SubSettings(_broker.getSettings(), key); try { instance = ctor.newInstance(args); --- 617,621 ---- && parmTypes[1].equals(_ctorArgs1[1])){ ctor = ctors[i]; ! Object[] args = { key, new SubSettings(_broker.getSettings(), key) }; try { instance = ctor.newInstance(args); *************** *** 636,641 **** if (parmTypes.length == 1 && parmTypes[0].equals(_ctorArgs1[0])){ ctor = ctors[i]; ! Object[] args = new Object[1]; ! args[0] = key; try { instance = ctor.newInstance(args); --- 634,638 ---- if (parmTypes.length == 1 && parmTypes[0].equals(_ctorArgs1[0])){ ctor = ctors[i]; ! Object[] args = { key }; try { instance = ctor.newInstance(args); Index: PropertyException.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/PropertyException.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PropertyException.java 15 Dec 2002 10:22:36 -0000 1.15 --- PropertyException.java 20 Dec 2002 02:25:24 -0000 1.16 *************** *** 40,43 **** --- 40,44 ---- */ public class PropertyException extends ContextException { + private String _message = null; public PropertyException( String reason ) { *************** *** 54,58 **** } ! // Subclasses --- 55,74 ---- } ! public void setMessage (String message) { ! _message = message; ! } ! ! public String getMessage() { ! if (_message == null) { ! return super.getMessage(); ! } else { ! String msg = _message; ! if ( getContextLocation() != null && msg != null ) { ! msg += " at " + getContextLocation(); ! } ! return msg; ! } ! } ! // Subclasses |