You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(97) |
Dec
(35) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(55) |
Mar
(21) |
Apr
(3) |
May
(7) |
Jun
(25) |
Jul
(108) |
Aug
(23) |
Sep
|
Oct
|
Nov
|
Dec
(4) |
2006 |
Jan
|
Feb
|
Mar
(6) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(13) |
Feb
|
Mar
(257) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(38) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(63) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <lan...@us...> - 2002-12-21 01:07:00
|
Update of /cvsroot/webmacro/webmacro/macros In directory sc8-pr-cvs1:/tmp/cvs-serv12896/macros Modified Files: allmacros.wmm Log Message: macro additions Index: allmacros.wmm =================================================================== RCS file: /cvsroot/webmacro/webmacro/macros/allmacros.wmm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** allmacros.wmm 25 Nov 2002 23:55:25 -0000 1.2 --- allmacros.wmm 21 Dec 2002 01:06:55 -0000 1.3 *************** *** 4,5 **** --- 4,6 ---- } #include as macro "ecomm/all.wmm" + #include as macro "html/all.wmm" |
From: <lan...@us...> - 2002-12-21 00:59:17
|
Update of /cvsroot/webmacro/webmacro/macros/html In directory sc8-pr-cvs1:/tmp/cvs-serv11090/html Log Message: Directory /cvsroot/webmacro/webmacro/macros/html added to the repository |
From: <dr...@us...> - 2002-12-20 02:25:57
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv29350/src/org/webmacro/directive Modified Files: BeanDirective.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: BeanDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/BeanDirective.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** BeanDirective.java 11 Nov 2002 04:26:12 -0000 1.10 --- BeanDirective.java 20 Dec 2002 02:25:24 -0000 1.11 *************** *** 164,169 **** } else { ! initArgs = new Object[1]; ! initArgs[0] = initArgObj; } --- 164,168 ---- } else { ! initArgs = new Object[] { initArgObj }; } |
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 |
From: <dr...@us...> - 2002-12-20 02:25:31
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv29350/src/org/webmacro/util Modified Files: ComponentMap.java LogFile.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: ComponentMap.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/ComponentMap.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ComponentMap.java 12 Jun 2002 17:17:28 -0000 1.9 --- ComponentMap.java 20 Dec 2002 02:25:26 -0000 1.10 *************** *** 214,220 **** try { Constructor ctor = c.getConstructor(_ctorArgs1); ! Object[] args = new Object[2]; ! args[0] = key; ! args[1] = new SubSettings(_config, key); instance = ctor.newInstance(args); } --- 214,218 ---- try { Constructor ctor = c.getConstructor(_ctorArgs1); ! Object[] args = { key, new SubSettings(_config, key) }; instance = ctor.newInstance(args); } *************** *** 234,239 **** try { Constructor ctor = c.getConstructor(_ctorArgs2); ! Object[] args = new Object[1]; ! args[0] = key; instance = ctor.newInstance(args); } --- 232,236 ---- try { Constructor ctor = c.getConstructor(_ctorArgs2); ! Object[] args = { key }; instance = ctor.newInstance(args); } Index: LogFile.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/LogFile.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LogFile.java 10 Nov 2002 20:35:08 -0000 1.11 --- LogFile.java 20 Dec 2002 02:25:26 -0000 1.12 *************** *** 125,129 **** public void log( Date date, String name, String level, String message, Throwable e ) { - Object[] _args = new Object[ 4 ]; if ( _logFilePerDay ) { --- 125,128 ---- *************** *** 139,156 **** } ! synchronized ( _args ) { ! _args[ 0 ] = date; ! _args[ 1 ] = name; ! _args[ 2 ] = level; ! _args[ 3 ] = message; ! _out.println( _mf.format( _args ) ); ! if ( _trace && ( e != null ) ) { ! e.printStackTrace( _out ); ! } ! if ( _logFileAutoFlush ) { ! flush(); ! } ! } } --- 138,150 ---- } ! Object[] _args = { date, name, level, message }; ! _out.println( _mf.format( _args ) ); ! if ( _trace && ( e != null ) ) { ! e.printStackTrace( _out ); ! } ! if ( _logFileAutoFlush ) { ! flush(); ! } } |
From: <dr...@us...> - 2002-12-20 02:25:30
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv29350/src/org/webmacro/engine Modified Files: PropertyOperatorCache.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: PropertyOperatorCache.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PropertyOperatorCache.java 15 Dec 2002 07:21:24 -0000 1.16 --- PropertyOperatorCache.java 20 Dec 2002 02:25:24 -0000 1.17 *************** *** 1233,1238 **** final boolean set(final Object instance, final Object value) throws PropertyException, NoSuchMethodException { ! Object[] args = new Object[1]; ! args[0] = value; return setImpl(instance, args); } --- 1233,1237 ---- final boolean set(final Object instance, final Object value) throws PropertyException, NoSuchMethodException { ! Object[] args = { value }; return setImpl(instance, args); } *************** *** 1257,1262 **** final Object get(final Object instance, String prop) throws PropertyException, NoSuchMethodException { ! Object[] args = new Object[1]; ! args[0] = prop; return PropertyOperator.invoke(_getMethod, instance, args); } --- 1256,1260 ---- final Object get(final Object instance, String prop) throws PropertyException, NoSuchMethodException { ! Object[] args = { prop }; return PropertyOperator.invoke(_getMethod, instance, args); } *************** *** 1264,1270 **** final boolean set(final Object instance, String prop, Object value) throws PropertyException, NoSuchMethodException { ! Object[] args = new Object[2]; ! args[0] = prop; ! args[1] = value; return setImpl(instance, args); } --- 1262,1266 ---- final boolean set(final Object instance, String prop, Object value) throws PropertyException, NoSuchMethodException { ! Object[] args = { prop, value }; return setImpl(instance, args); } |
From: <dr...@us...> - 2002-12-20 02:25:30
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv29350/src/org/webmacro/servlet Modified Files: ListUtil.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: ListUtil.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/ListUtil.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ListUtil.java 11 Jun 2002 17:43:22 -0000 1.8 --- ListUtil.java 20 Dec 2002 02:25:25 -0000 1.9 *************** *** 133,138 **** else { // put the object into a single element list ! Object[] oa = new Object[1]; ! oa[0] = arg; list = Arrays.asList(oa); } --- 133,137 ---- else { // put the object into a single element list ! Object[] oa = { arg }; list = Arrays.asList(oa); } |
From: <dr...@us...> - 2002-12-20 02:01:52
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv24959 Modified Files: WebMacro.defaults Log Message: Move the #bean directive configuration above the "These are currently broken" comment... just to avoid confusion Index: WebMacro.defaults =================================================================== RCS file: /cvsroot/webmacro/webmacro/WebMacro.defaults,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** WebMacro.defaults 17 Dec 2002 06:45:29 -0000 1.34 --- WebMacro.defaults 20 Dec 2002 02:01:49 -0000 1.35 *************** *** 211,214 **** --- 211,215 ---- Directives.default: org.webmacro.directive.DefaultDirective Directives.count: org.webmacro.directive.CountDirective + Directives.bean: org.webmacro.directive.BeanDirective *************** *** 217,221 **** # Directives.escape: org.webmacro.directive.EscapeDirective # Directives.silence: org.webmacro.directive.SilenceDirective - Directives.bean: org.webmacro.directive.BeanDirective --- 218,221 ---- |
From: <dr...@us...> - 2002-12-18 06:21:47
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv3871/src/org/webmacro/engine Modified Files: Block.java Log Message: properly implement BlockInterator in Block.java... forgot to commit this file last night Index: Block.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/Block.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Block.java 15 Dec 2002 10:22:36 -0000 1.22 --- Block.java 18 Dec 2002 06:21:41 -0000 1.23 *************** *** 233,236 **** --- 233,240 ---- } + public String getName() { + return block.getTemplateName(); + } + public int getLineNo() { return block.getLineNo(i - 1); |
From: <dr...@us...> - 2002-12-17 06:45:33
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv15955/test/unit/org/webmacro Added Files: TestFastWriter.java Log Message: Make the MAX_POOL_SIZE and DEFAULT_BUFFER_SIZE values configurable via WebMacro.properties. add a simple test for FastWriter --- NEW FILE: TestFastWriter.java --- /* * Created by IntelliJ IDEA. * User: e_ridge * Date: Dec 17, 2002 * Time: 1:24:35 AM * To change template for new class use * Code Style | Class Templates options (Tools | IDE Options). */ package org.webmacro; import junit.framework.TestCase; public class TestFastWriter extends TestCase { private WebMacro wm; public TestFastWriter(String name) { super(name); } protected void setUp() throws Exception { java.lang.System.setProperty("org.webmacro.LogLevel", "NONE"); wm = new WM(); } public void testFastWriter() throws Exception { doIt(4 * 1024); doIt(10 * 1024); doIt(100 * 1024); doIt(1000* 1024); doIt(4000 * 1024); } private void doIt(int size) throws Exception { String data = makeData(size); long start = System.currentTimeMillis(); FastWriter fw = FastWriter.getInstance(wm.getBroker(), null, "ISO8859_1"); fw.write(data); String after = fw.toString(); fw.close(); long end = System.currentTimeMillis(); System.err.println (size + " bytes in " + ((end-start)/1000D) + " seconds."); assert (after.equals(data)); } private String makeData (int size) { StringBuffer sb = new StringBuffer(size); for (int x=0; x<size; x++) sb.append('x'); return sb.toString(); } } |
From: <dr...@us...> - 2002-12-17 06:45:32
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv15955 Modified Files: WebMacro.defaults Log Message: Make the MAX_POOL_SIZE and DEFAULT_BUFFER_SIZE values configurable via WebMacro.properties. add a simple test for FastWriter Index: WebMacro.defaults =================================================================== RCS file: /cvsroot/webmacro/webmacro/WebMacro.defaults,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** WebMacro.defaults 17 Nov 2002 16:26:21 -0000 1.33 --- WebMacro.defaults 17 Dec 2002 06:45:29 -0000 1.34 *************** *** 301,304 **** --- 301,315 ---- Parsers.wm: org.webmacro.parser.WMParser + + # + # FastWriter Configuration + # + # Misconfiguration of these settings can cause severe performance + # and resource penalties + + FastWriter.MaxPoolSize = 10 + FastWriter.DefaultBufferSize = 4096 + + # # Template caching |
From: <dr...@us...> - 2002-12-17 06:45:32
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv15955/src/org/webmacro Modified Files: FastWriter.java Log Message: Make the MAX_POOL_SIZE and DEFAULT_BUFFER_SIZE values configurable via WebMacro.properties. add a simple test for FastWriter Index: FastWriter.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/FastWriter.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** FastWriter.java 11 Nov 2002 19:22:35 -0000 1.27 --- FastWriter.java 17 Dec 2002 06:45:29 -0000 1.28 *************** *** 68,73 **** */ public static final String SAFE_UNICODE_ENCODING; - public static final int DEFAULT_BUFFER_SIZE = 4096; - public static final int MAX_POOL_SIZE = 10; // find the safe encoding --- 68,71 ---- *************** *** 84,87 **** --- 82,87 ---- + private final int DEFAULT_BUFFER_SIZE; + private final int MAX_POOL_SIZE; private final String _encoding; // what encoding we use private final Writer _bwriter; *************** *** 112,115 **** --- 112,117 ---- public FastWriter( Broker broker, OutputStream out, String encoding ) throws UnsupportedEncodingException { + MAX_POOL_SIZE = broker.getSettings().getIntegerSetting("FastWriter.MaxPoolSize", 10); + DEFAULT_BUFFER_SIZE = broker.getSettings().getIntegerSetting("FastWriter.DefaultBufferSize", 4096); _encoding = hackEncoding( encoding ); _bstream = new ByteBufferOutputStream( DEFAULT_BUFFER_SIZE ); |
From: <dr...@us...> - 2002-12-17 06:01:31
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv5523/src/org/webmacro/engine Modified Files: BlockBuilder.java Log Message: that didn't need to change. Index: BlockBuilder.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/BlockBuilder.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** BlockBuilder.java 17 Dec 2002 05:59:32 -0000 1.17 --- BlockBuilder.java 17 Dec 2002 06:01:28 -0000 1.18 *************** *** 37,41 **** public class BlockBuilder implements Builder { ! private static final int INITIAL_SIZE = 65; private static Macro[] mArray = new Macro[0]; --- 37,41 ---- public class BlockBuilder implements Builder { ! private static final int INITIAL_SIZE = 64; private static Macro[] mArray = new Macro[0]; |
From: <dr...@us...> - 2002-12-17 05:59:37
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv5006/src/org/webmacro/engine Modified Files: BlockBuilder.java WMTemplate.java Log Message: Cleanup line/column number tracking Index: BlockBuilder.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/BlockBuilder.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** BlockBuilder.java 16 Dec 2002 17:18:31 -0000 1.16 --- BlockBuilder.java 17 Dec 2002 05:59:32 -0000 1.17 *************** *** 37,41 **** public class BlockBuilder implements Builder { ! private static final int INITIAL_SIZE = 64; private static Macro[] mArray = new Macro[0]; --- 37,41 ---- public class BlockBuilder implements Builder { ! private static final int INITIAL_SIZE = 65; private static Macro[] mArray = new Macro[0]; *************** *** 57,60 **** --- 57,62 ---- public interface BlockIterator extends Iterator { + public String getName(); + public int getLineNo(); *************** *** 71,74 **** --- 73,80 ---- } + public String getName() { + return name; + } + public boolean hasNext() { return (i < size); *************** *** 97,101 **** int[] ln = new int[elements.size()]; int[] cn = new int[elements.size()]; - int pos=0; Stack iterStack = new Stack(); StringBuffer s = new StringBuffer(); --- 103,106 ---- *************** *** 108,122 **** BlockIterator iter = new BBIterator(); - tec._templateName = name; while (iter.hasNext()) { Object o = iter.next(); ! // track line/column numbers in the build context ! // so that bc.getCurrentLocation() stays current ! tec._lineNo = ln[pos]; ! tec._columnNo = cn[pos++]; ! if (o instanceof Builder) ! o = ((Builder) o).build(bc); if (o instanceof Block) { --- 113,139 ---- BlockIterator iter = new BBIterator(); while (iter.hasNext()) { Object o = iter.next(); ! if (o instanceof Builder) { ! // track line/column numbers in the build context ! // so that bc.getCurrentLocation() stays current ! tec._templateName = iter.getName(); ! tec._lineNo = iter.getLineNo(); ! tec._columnNo = iter.getColNo(); ! try { ! o = ((Builder) o).build(bc); ! } catch (BuildException be) { ! // restore line/column info to what it was before ! // we tried to build the block ! tec._templateName = iter.getName(); ! tec._lineNo = iter.getLineNo(); ! tec._columnNo = iter.getColNo(); ! ! // and rethrow the exception ! throw be; ! } ! } if (o instanceof Block) { Index: WMTemplate.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/WMTemplate.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** WMTemplate.java 15 Dec 2002 10:22:36 -0000 1.45 --- WMTemplate.java 17 Dec 2002 05:59:32 -0000 1.46 *************** *** 182,186 **** catch (Exception e) { _log.error("Error parsing template: " + this, e); ! throw new BuildException("Error parsing template: " + this, e); } finally { --- 182,189 ---- catch (Exception e) { _log.error("Error parsing template: " + this, e); ! BuildException be = new BuildException("Error parsing template: " + this, e); ! if (bc != null) ! be.setContextLocation(bc.getCurrentLocation()); ! throw be; } finally { |
From: <dr...@us...> - 2002-12-16 17:19:06
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv9624/src/org/webmacro/engine Modified Files: BlockBuilder.java Log Message: minor bug fix to line/column number tracking by BlockBuilder Index: BlockBuilder.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/BlockBuilder.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** BlockBuilder.java 15 Dec 2002 10:22:36 -0000 1.15 --- BlockBuilder.java 16 Dec 2002 17:18:31 -0000 1.16 *************** *** 97,100 **** --- 97,101 ---- int[] ln = new int[elements.size()]; int[] cn = new int[elements.size()]; + int pos=0; Stack iterStack = new Stack(); StringBuffer s = new StringBuffer(); *************** *** 113,118 **** // track line/column numbers in the build context // so that bc.getCurrentLocation() stays current ! tec._lineNo = iter.getLineNo(); ! tec._columnNo = iter.getColNo(); if (o instanceof Builder) --- 114,119 ---- // track line/column numbers in the build context // so that bc.getCurrentLocation() stays current ! tec._lineNo = ln[pos]; ! tec._columnNo = cn[pos++]; if (o instanceof Builder) |
From: <dr...@us...> - 2002-12-15 10:26:04
|
Update of /cvsroot/webmacro/webmacro/distroot In directory sc8-pr-cvs1:/tmp/cvs-serv16966/distroot Modified Files: RELEASE-NOTES Log Message: tracking what has been changed and bumping version to 1.1b3, but I'm not actually doing a release. Index: RELEASE-NOTES =================================================================== RCS file: /cvsroot/webmacro/webmacro/distroot/RELEASE-NOTES,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** RELEASE-NOTES 27 Nov 2002 04:24:52 -0000 1.17 --- RELEASE-NOTES 15 Dec 2002 10:26:01 -0000 1.18 *************** *** 1,3 **** ! WebMacro 1.1b2 --------------- --- 1,3 ---- ! WebMacro 1.1b3 --------------- *************** *** 21,24 **** --- 21,38 ---- ----------------------- + - cleanup to various error messages (eric) + + - make line/column info available in more situations (eric) + + - fix stupid warnings in IncludeDirective (eric) + + - expanded test cases (eric) + + - avoid exception throwing in ContextTool creation (keats) + + + Changes Prior to this Release + ----------------------------- + - more documentation concerning new features (brian, keats, lane) *************** *** 28,32 **** - logging API now accepts Throwable instead of Exception. (eric) ! This one might require you to recompile your classes. - the syntax for #default has changed to: --- 42,46 ---- - logging API now accepts Throwable instead of Exception. (eric) ! This one might require you to recompile your classes. - the syntax for #default has changed to: *************** *** 37,41 **** whereas previously it did not. ! - fixed parser bug where a missing #end or } would not throw an exception, but would instead consider the end of the file as the end of the block. (eric) --- 51,55 ---- whereas previously it did not. ! - fixed parser bug where a missing #end or } would not throw an exception, but would instead consider the end of the file as the end of the block. (eric) *************** *** 48,56 **** - additional unit tests for #macros, parser bugs, and other things (lane, eric) - - - - Changes Prior to this Release - ----------------------------- - added #macro directive (brian) --- 62,65 ---- |
From: <dr...@us...> - 2002-12-15 10:26:04
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv16966 Modified Files: build.xml Log Message: tracking what has been changed and bumping version to 1.1b3, but I'm not actually doing a release. Index: build.xml =================================================================== RCS file: /cvsroot/webmacro/webmacro/build.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** build.xml 30 Nov 2002 23:56:33 -0000 1.30 --- build.xml 15 Dec 2002 10:26:01 -0000 1.31 *************** *** 41,45 **** </target> ! <property name="version" value="1.1b2" /> <property name="app.name" value="webmacro" /> <property name="tmpdir" value="tmp" /> --- 41,45 ---- </target> ! <property name="version" value="1.1b3" /> <property name="app.name" value="webmacro" /> <property name="tmpdir" value="tmp" /> |
From: <dr...@us...> - 2002-12-15 10:22:39
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv11422/test/unit/org/webmacro/template Modified Files: TemplateTestCase.java TestLineNumbers.java TestMacro.java Log Message: - cleanup to #macro errors. - Changed Context.TemplateEvaluationContext to track templateName, lineNo, and colNo individually (instead of tracking Blocks) This allows us to report line/column information during the build() process - Expanded test cases - cleanup the $Variable.returnNull().doSomething() error message - cleanup log usage in IncludeDirective - include template name in the deprecated warning messages emitted by the parser Index: TemplateTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TemplateTestCase.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TemplateTestCase.java 15 Dec 2002 07:21:24 -0000 1.12 --- TemplateTestCase.java 15 Dec 2002 10:22:37 -0000 1.13 *************** *** 209,213 **** if (!re.match(caught.getMessage())) { System.err.println("Exception " + caught.getMessage() ! + "does not match /" + messageMatchText + "/"); assert(false); --- 209,213 ---- if (!re.match(caught.getMessage())) { System.err.println("Exception " + caught.getMessage() ! + " does not match /" + messageMatchText + "/"); assert(false); Index: TestLineNumbers.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestLineNumbers.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestLineNumbers.java 6 Dec 2001 06:47:52 -0000 1.1 --- TestLineNumbers.java 15 Dec 2002 10:22:37 -0000 1.2 *************** *** 94,99 **** } ! public void testEvalNullMethod () throws Exception { } --- 94,101 ---- } + public void testEvaluationOfNullReturnValue() throws Exception { + } ! public void testEvalNullMethod () throws Exception { } Index: TestMacro.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestMacro.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMacro.java 2 Dec 2001 01:12:45 -0000 1.1 --- TestMacro.java 15 Dec 2002 10:22:37 -0000 1.2 *************** *** 5,10 **** import org.webmacro.*; import org.webmacro.engine.StringTemplate; ! import org.webmacro.engine.DefaultEvaluationExceptionHandler; ! import junit.framework.*; --- 5,11 ---- import org.webmacro.*; import org.webmacro.engine.StringTemplate; ! import org.webmacro.engine.DefaultEvaluationExceptionHandler; ! import org.webmacro.engine.BuildException; ! import junit.framework.*; *************** *** 19,22 **** --- 20,28 ---- context.put ("string", "Foo!"); } + + public void testUndefinedMacro() throws Exception { + assertStringTemplateThrows ("#foo()", BuildException.class, "#foo: no such [M,m]acro or [D,d]irective at \\w+:\\d+\\.\\d+"); + assertStringTemplateThrows ("#foo", BuildException.class, "#foo: no such [M,m]acro or [D,d]irective at \\w+:\\d+\\.\\d+"); + } public void testNoArgs() throws Exception { |
From: <dr...@us...> - 2002-12-15 10:22:39
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/parser In directory sc8-pr-cvs1:/tmp/cvs-serv11422/src/org/webmacro/parser Modified Files: WMParser_impl.java WMParser_impl.jj Log Message: - cleanup to #macro errors. - Changed Context.TemplateEvaluationContext to track templateName, lineNo, and colNo individually (instead of tracking Blocks) This allows us to report line/column information during the build() process - Expanded test cases - cleanup the $Variable.returnNull().doSomething() error message - cleanup log usage in IncludeDirective - include template name in the deprecated warning messages emitted by the parser Index: WMParser_impl.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_impl.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** WMParser_impl.java 26 Nov 2002 06:54:44 -0000 1.44 --- WMParser_impl.java 15 Dec 2002 10:22:36 -0000 1.45 *************** *** 37,40 **** --- 37,41 ---- this.broker = broker; this.templateName = templateName; + } *************** *** 156,160 **** // Warning routines private void warnDeprecated(String feature, int line, int col) { ! broker.getLog("parser").warning("Deprecated feature: " + feature + " at " + line + "." + col); } --- 157,161 ---- // Warning routines private void warnDeprecated(String feature, int line, int col) { ! broker.getLog("parser").warning("Deprecated feature: " + feature + " at " + templateName + ":" + line + "." + col); } Index: WMParser_impl.jj =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_impl.jj,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** WMParser_impl.jj 26 Nov 2002 06:54:45 -0000 1.43 --- WMParser_impl.jj 15 Dec 2002 10:22:37 -0000 1.44 *************** *** 159,163 **** // Warning routines private void warnDeprecated(String feature, int line, int col) { ! broker.getLog("parser").warning("Deprecated feature: " + feature + " at " + line + "." + col); } } --- 159,163 ---- // Warning routines private void warnDeprecated(String feature, int line, int col) { ! broker.getLog("parser").warning("Deprecated feature: " + feature + " at " + templateName + ":" + line + "." + col); } } |
From: <dr...@us...> - 2002-12-15 10:22:39
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv11422/src/org/webmacro/directive Modified Files: IncludeDirective.java Log Message: - cleanup to #macro errors. - Changed Context.TemplateEvaluationContext to track templateName, lineNo, and colNo individually (instead of tracking Blocks) This allows us to report line/column information during the build() process - Expanded test cases - cleanup the $Variable.returnNull().doSomething() error message - cleanup log usage in IncludeDirective - include template name in the deprecated warning messages emitted by the parser Index: IncludeDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/IncludeDirective.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** IncludeDirective.java 15 Dec 2002 07:21:24 -0000 1.18 --- IncludeDirective.java 15 Dec 2002 10:22:36 -0000 1.19 *************** *** 265,271 **** if (o instanceof Macro) { if (_type == TYPE_TEXT || _type == TYPE_MACRO) { ! broker.getLog("IncludeDirective") ! .warning("Included a 'static' file type using a dynamic filename." ! + "File will be included, but any included #macro's will not."); } _macFilename = (Macro) o; --- 265,270 ---- if (o instanceof Macro) { if (_type == TYPE_TEXT || _type == TYPE_MACRO) { ! _log.warning("Included a 'static' file type using a dynamic filename. " ! + "File will be included, but any included #macro's will not at " + bc.getCurrentLocation()); } _macFilename = (Macro) o; |
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv11422/src/org/webmacro/engine Modified Files: Block.java BlockBuilder.java BuildContext.java MacroBuilder.java MacroDefinition.java WMTemplate.java Log Message: - cleanup to #macro errors. - Changed Context.TemplateEvaluationContext to track templateName, lineNo, and colNo individually (instead of tracking Blocks) This allows us to report line/column information during the build() process - Expanded test cases - cleanup the $Variable.returnNull().doSomething() error message - cleanup log usage in IncludeDirective - include template name in the deprecated warning messages emitted by the parser Index: Block.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/Block.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Block.java 11 Jun 2002 17:43:21 -0000 1.21 --- Block.java 15 Dec 2002 10:22:36 -0000 1.22 *************** *** 80,138 **** final byte[][] bcontent = out.getEncoder().encode(_block); byte[] b; ! Context.TemplateEvaluationContext teC ! = context.getTemplateEvaluationContext(); ! Block wasBlock = teC._curBlock; ! int wasIndex = teC._curIndex; int i = 0; - teC._curBlock = this; - teC._curIndex = i; - switch (_remainder) { case 1: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; case 2: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; case 3: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; case 4: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; case 5: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; case 6: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; case 7: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; case 8: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; case 9: b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; } --- 80,143 ---- final byte[][] bcontent = out.getEncoder().encode(_block); byte[] b; ! Context.TemplateEvaluationContext teC = context.getTemplateEvaluationContext(); ! String oldName = teC._templateName; + teC._templateName = _name; int i = 0; switch (_remainder) { case 1: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); case 2: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); case 3: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); case 4: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); case 5: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); case 6: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); case 7: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); case 8: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); case 9: b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); } *************** *** 140,186 **** b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; b = bcontent[i]; out.write(b, 0, b.length); _macros[i++].write(out, context); - teC._curIndex = i; } b = bcontent[_length]; out.write(b, 0, b.length); ! teC._curBlock = wasBlock; ! teC._curIndex = wasIndex; } --- 145,200 ---- b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); b = bcontent[i]; out.write(b, 0, b.length); + teC._lineNo = this.getLineNo(i); + teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); } b = bcontent[_length]; out.write(b, 0, b.length); ! teC._templateName = oldName; } *************** *** 194,202 **** public int getLineNo(int i) { ! return (_lineNos != null && _lineNos.length >= i) ? _lineNos[i] : 0; } public int getColNo(int i) { ! return (_colNos != null && _colNos.length >= i) ? _colNos[i] : 0; } --- 208,216 ---- public int getLineNo(int i) { ! return (_lineNos != null && i>=0 && _lineNos.length > i) ? _lineNos[i] : 0; } public int getColNo(int i) { ! return (_colNos != null && i>=0 && _colNos.length > i) ? _colNos[i] : 0; } Index: BlockBuilder.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/BlockBuilder.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** BlockBuilder.java 12 Jun 2002 17:17:28 -0000 1.14 --- BlockBuilder.java 15 Dec 2002 10:22:36 -0000 1.15 *************** *** 27,30 **** --- 27,31 ---- import org.webmacro.Macro; + import org.webmacro.Context; /** *************** *** 98,101 **** --- 99,103 ---- Stack iterStack = new Stack(); StringBuffer s = new StringBuffer(); + Context.TemplateEvaluationContext tec = bc.getTemplateEvaluationContext(); // flatten everything and view the content as being: *************** *** 105,110 **** --- 107,119 ---- BlockIterator iter = new BBIterator(); + tec._templateName = name; while (iter.hasNext()) { Object o = iter.next(); + + // track line/column numbers in the build context + // so that bc.getCurrentLocation() stays current + tec._lineNo = iter.getLineNo(); + tec._columnNo = iter.getColNo(); + if (o instanceof Builder) o = ((Builder) o).build(bc); Index: BuildContext.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/BuildContext.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** BuildContext.java 11 Jun 2002 17:43:21 -0000 1.22 --- BuildContext.java 15 Dec 2002 10:22:36 -0000 1.23 *************** *** 62,65 **** --- 62,68 ---- } + + + /** * Find out whether the named variable is a tool, local variable, Index: MacroBuilder.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/MacroBuilder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MacroBuilder.java 11 Jun 2002 17:43:21 -0000 1.3 --- MacroBuilder.java 15 Dec 2002 10:22:36 -0000 1.4 *************** *** 55,59 **** MacroDefinition md = bc.getMacro(name); if (md == null) ! throw new BuildException("No such macro " + name); Object[] args = argsBuilder.buildAsArray(bc); return md.expand(args, bc); --- 55,59 ---- MacroDefinition md = bc.getMacro(name); if (md == null) ! throw new BuildException ("#" + name + ": no such Macro or Directive"); Object[] args = argsBuilder.buildAsArray(bc); return md.expand(args, bc); Index: MacroDefinition.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/MacroDefinition.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MacroDefinition.java 11 Jun 2002 17:43:21 -0000 1.3 --- MacroDefinition.java 15 Dec 2002 10:22:36 -0000 1.4 *************** *** 63,67 **** throws BuildException { if (args.length != argNames.length) ! throw new BuildException("Macro #" + name + " invoked with " + args.length + " arguments, expecting " + argNames.length + " arguments"); --- 63,67 ---- throws BuildException { if (args.length != argNames.length) ! throw new BuildException("#" + name + ": invoked with " + args.length + " arguments, expecting " + argNames.length + " arguments"); Index: WMTemplate.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/WMTemplate.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** WMTemplate.java 5 Jul 2002 02:48:48 -0000 1.44 --- WMTemplate.java 15 Dec 2002 10:22:36 -0000 1.45 *************** *** 156,159 **** --- 156,160 ---- Map newMacros = null; Reader in = null; + BuildContext bc = null; try { Parser parser = getParser(); *************** *** 161,165 **** BlockBuilder bb = parser.parseBlock(getName(), in); in.close(); ! BuildContext bc = new BuildContext(_broker); newParameters = bc.getMap(); newMacros = bc.getMacros(); --- 162,167 ---- BlockBuilder bb = parser.parseBlock(getName(), in); in.close(); ! ! bc = new BuildContext(_broker); newParameters = bc.getMap(); newMacros = bc.getMacros(); *************** *** 167,170 **** --- 169,174 ---- } catch (BuildException be) { + if (bc != null) + be.setContextLocation(bc.getCurrentLocation()); newContent = null; _log.error("Template contained invalid data", be); |
From: <dr...@us...> - 2002-12-15 10:22:39
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv11422/src/org/webmacro Modified Files: Context.java PropertyException.java WebMacroException.java Log Message: - cleanup to #macro errors. - Changed Context.TemplateEvaluationContext to track templateName, lineNo, and colNo individually (instead of tracking Blocks) This allows us to report line/column information during the build() process - Expanded test cases - cleanup the $Variable.returnNull().doSomething() error message - cleanup log usage in IncludeDirective - include template name in the deprecated warning messages emitted by the parser Index: Context.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/Context.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Context.java 7 Dec 2002 06:15:52 -0000 1.57 --- Context.java 15 Dec 2002 10:22:36 -0000 1.58 *************** *** 94,99 **** public final static class TemplateEvaluationContext { ! public Block _curBlock; ! public int _curIndex; } --- 94,102 ---- public final static class TemplateEvaluationContext { ! // public Block _curBlock; ! // public int _curIndex; ! public String _templateName; ! public int _lineNo; ! public int _columnNo; } *************** *** 193,205 **** public final String getCurrentLocation() { ! Block b = _teContext._curBlock; ! if (b == null) { ! return "(unknown)"; ! } ! else { ! return b.getTemplateName() + ":" ! + Integer.toString(b.getLineNo(_teContext._curIndex)) ! + "." + Integer.toString(b.getColNo(_teContext._curIndex)); ! } } --- 196,203 ---- public final String getCurrentLocation() { ! StringBuffer loc = new StringBuffer(); ! loc.append(_teContext._templateName == null ? "(unknown)" : _teContext._templateName); ! loc.append(":").append(_teContext._lineNo).append(".").append(_teContext._columnNo); ! return loc.toString(); } Index: PropertyException.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/PropertyException.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PropertyException.java 29 Jul 2002 07:07:01 -0000 1.14 --- PropertyException.java 15 Dec 2002 10:22:36 -0000 1.15 *************** *** 41,46 **** public class PropertyException extends ContextException { - private String _contextLocation; - public PropertyException( String reason ) { super( reason ); --- 41,44 ---- *************** *** 54,104 **** super( reason, e ); setContextLocation( contextLocation ); - } - - /** - * Record the line and column info from the template that - * caused this ProeprtyException to be thrown. - */ - public void setContextLocation( String location ) { - _contextLocation = location; - Throwable cause = getCause(); - if ( cause instanceof PropertyException ) { - PropertyException pe = ( PropertyException ) cause; - if ( pe.getContextLocation() == null ) { - pe.setContextLocation( location ); - } - } - cause = getRootCause(); - if ( cause instanceof PropertyException ) { - PropertyException pe = ( PropertyException ) cause; - if ( pe.getContextLocation() == null ) { - pe.setContextLocation( location ); - } - } - - } - - /** - * @return location (line/column) from the template that caused - * this PropertyException to be thrown. Can be null - * if this exception instance wasn't previously handled - * by a core EvaluationExceptionHandler. - */ - public String getContextLocation() { - return _contextLocation; - } - - - /** - * Overloaded to return the <code>reason</code> specified during construction - * <b>plus</b> the context location, if any. - */ - public String getMessage() { - String msg = super.getMessage(); - if ( _contextLocation != null && msg != null ) { - msg += " at " + _contextLocation; - } - - return msg; } --- 52,55 ---- Index: WebMacroException.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/WebMacroException.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WebMacroException.java 11 Jun 2002 17:43:20 -0000 1.5 --- WebMacroException.java 15 Dec 2002 10:22:36 -0000 1.6 *************** *** 30,33 **** --- 30,35 ---- public class WebMacroException extends RethrowableException { + private String _contextLocation; + public WebMacroException() { super(); *************** *** 41,44 **** --- 43,96 ---- super(reason, e); } + + + /** + * Overloaded to return the <code>reason</code> specified during construction + * <b>plus</b> the context location, if any. + */ + public String getMessage() { + String msg = super.getMessage(); + if ( _contextLocation != null && msg != null ) { + msg += " at " + _contextLocation; + } + + return msg; + } + + + /** + * Record the line and column info from the template that + * caused this ProeprtyException to be thrown. + */ + public void setContextLocation( String location ) { + _contextLocation = location; + Throwable cause = getCause(); + if ( cause instanceof PropertyException ) { + PropertyException pe = ( PropertyException ) cause; + if ( pe.getContextLocation() == null ) { + pe.setContextLocation( location ); + } + } + cause = getRootCause(); + if ( cause instanceof PropertyException ) { + PropertyException pe = ( PropertyException ) cause; + if ( pe.getContextLocation() == null ) { + pe.setContextLocation( location ); + } + } + + } + + /** + * @return location (line/column) from the template that caused + * this PropertyException to be thrown. Can be null + * if this exception instance wasn't previously handled + * by a core EvaluationExceptionHandler. + */ + public String getContextLocation() { + return _contextLocation; + } + + } |
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv827/test/unit/org/webmacro/template Modified Files: AbstractVariableTestCase.java TemplateTestCase.java TestAbuse.java TestCrankyEEH.java TestDefaultEEH.java Log Message: - cleanup the error message produced by: $Foo.Null.Whatever and add test cases to look for this situation. - fix (another) type-o in IncludeDirective Index: AbstractVariableTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/AbstractVariableTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractVariableTestCase.java 15 Oct 2001 08:13:12 -0000 1.3 --- AbstractVariableTestCase.java 15 Dec 2002 07:21:24 -0000 1.4 *************** *** 14,18 **** */ public abstract class AbstractVariableTestCase extends TemplateTestCase { ! public AbstractVariableTestCase (String name) { super (name); --- 14,24 ---- */ public abstract class AbstractVariableTestCase extends TemplateTestCase { ! ! public static class ObjectWithNullMethod { ! public Object getNull () { ! return null; ! } ! } ! public AbstractVariableTestCase (String name) { super (name); *************** *** 109,112 **** --- 115,125 ---- } + /** + * This is the old "... --possibly null?" error message. + * It has always thrown a PropertyExcpetion, and probably still should. + */ + public void testEvaluationOfNullReturnValue() throws Exception { + assert(false); + } Index: TemplateTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TemplateTestCase.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TemplateTestCase.java 17 Nov 2002 16:26:22 -0000 1.11 --- TemplateTestCase.java 15 Dec 2002 07:21:24 -0000 1.12 *************** *** 239,242 **** --- 239,243 ---- + " threw " + e.getClass() + "/, expecting match /" + resultPattern + "/"); + e.printStackTrace(System.err); assert(false); } Index: TestAbuse.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestAbuse.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestAbuse.java 26 Nov 2002 07:00:36 -0000 1.6 --- TestAbuse.java 15 Dec 2002 07:21:24 -0000 1.7 *************** *** 97,101 **** } ! /** the infamous "but I want to put Javascript in an #if block!!" Currently fails when using { and }, but passes with --- 97,101 ---- } ! /** the infamous "but I want to put Javascript in an #if block!!" Currently fails when using { and }, but passes with Index: TestCrankyEEH.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestCrankyEEH.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestCrankyEEH.java 14 Dec 2001 06:23:51 -0000 1.6 --- TestCrankyEEH.java 15 Dec 2002 07:21:24 -0000 1.7 *************** *** 28,32 **** context.put ("NullTestObject", new NullTestObject()); context.put("enum",new ThrowingEnumeration()); ! } --- 28,32 ---- context.put ("NullTestObject", new NullTestObject()); context.put("enum",new ThrowingEnumeration()); ! context.put ("OWNM", new ObjectWithNullMethod()); } *************** *** 152,155 **** --- 152,164 ---- java.util.NoSuchElementException.class); } + + /** + * This is the old "... --possibly null?" error message. + * It has always thrown a PropertyExcpetion, and probably still should. + */ + public void testEvaluationOfNullReturnValue() throws Exception { + assertStringTemplateThrows ("$OWNM.Null.toString()", PropertyException.class); + } + /* Index: TestDefaultEEH.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestDefaultEEH.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestDefaultEEH.java 14 Dec 2001 06:23:51 -0000 1.7 --- TestDefaultEEH.java 15 Dec 2002 07:21:24 -0000 1.8 *************** *** 23,26 **** --- 23,27 ---- context.put ("NullTestObject", new NullTestObject()); context.put ("NullObject", null); + context.put ("OWNM", new ObjectWithNullMethod()); } *************** *** 126,129 **** --- 127,138 ---- public void testNullVariable () throws Exception { assertStringTemplateMatches ("$NullObject", ""); + } + + /** + * This is the old "... --possibly null?" error message. + * It has always thrown a PropertyExcpetion, and probably still should. + */ + public void testEvaluationOfNullReturnValue() throws Exception { + assertStringTemplateThrows ("$OWNM.Null.toString()", PropertyException.class); } |
From: <dr...@us...> - 2002-12-15 07:21:27
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv827/src/org/webmacro/engine Modified Files: PropertyOperatorCache.java Log Message: - cleanup the error message produced by: $Foo.Null.Whatever and add test cases to look for this situation. - fix (another) type-o in IncludeDirective Index: PropertyOperatorCache.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PropertyOperatorCache.java 31 Oct 2002 17:34:04 -0000 1.15 --- PropertyOperatorCache.java 15 Dec 2002 07:21:24 -0000 1.16 *************** *** 716,723 **** } catch (NullPointerException e) { ! // will we ever get here? --eric ! throw new PropertyException("No way to access property " + ! fillInName(names, start) + " on object " + instance + " of " ! + instance.getClass() + "--possibly null?"); } } --- 716,721 ---- } catch (NullPointerException e) { ! // $Foo.getNull().SomeProperty is what makes this happen ! throw new PropertyException("$" + fillInName(names,start) + " is null. Cannot access ." + names[end]); } } |
From: <dr...@us...> - 2002-12-15 07:21:27
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv827/src/org/webmacro/directive Modified Files: IncludeDirective.java Log Message: - cleanup the error message produced by: $Foo.Null.Whatever and add test cases to look for this situation. - fix (another) type-o in IncludeDirective Index: IncludeDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/IncludeDirective.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** IncludeDirective.java 15 Dec 2002 06:45:47 -0000 1.17 --- IncludeDirective.java 15 Dec 2002 07:21:24 -0000 1.18 *************** *** 350,354 **** : (_type == TYPE_TEMPLATE) ? "TEMPLATE" : (_type == TYPE_TEXT) ? "TEXT" ! : "UNKNOWN. Throwing exceptin")); } --- 350,354 ---- : (_type == TYPE_TEMPLATE) ? "TEMPLATE" : (_type == TYPE_TEXT) ? "TEXT" ! : "UNKNOWN. Throwing exception")); } |