You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(28) |
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(103) |
Feb
(44) |
Mar
(65) |
Apr
(140) |
May
(72) |
Jun
(233) |
Jul
(466) |
Aug
(51) |
Sep
(2) |
Oct
(17) |
Nov
(1) |
Dec
(7) |
2004 |
Jan
(8) |
Feb
(5) |
Mar
(28) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(7) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
|
Apr
(3) |
May
(24) |
Jun
(7) |
Jul
(2) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(12) |
2006 |
Jan
|
Feb
(3) |
Mar
(8) |
Apr
(59) |
May
|
Jun
|
Jul
|
Aug
(24) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
(3) |
2008 |
Jan
|
Feb
(1) |
Mar
(16) |
Apr
(2) |
May
(2) |
Jun
|
Jul
(11) |
Aug
(3) |
Sep
(9) |
Oct
(9) |
Nov
(44) |
Dec
(34) |
2009 |
Jan
(12) |
Feb
(14) |
Mar
(11) |
Apr
(16) |
May
(41) |
Jun
(19) |
Jul
(33) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(7) |
2010 |
Jan
(8) |
Feb
(50) |
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(16) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <web...@st...> - 2003-07-14 08:32:02
|
On Fri, 11 Jul 2003, Marc Palmer wrote: | | I've updated NextRelease to start honing the list of real 2.0 requirements: | | http://www.webmacro.org/NextRelease Is this the top part, "Agreed..."? Does this mean that (most of) my suggestions didn't make it? Especially, I'd like all "magic threads" and stuff to go away, and to have rendering options (I'd like my output to appear as it is rendered.. - I believe it now is cached, and not ouput before everything is cached? At least I remember that original WM guy did something like this once.. And btw, why doesn't this page: http://www.webmacro.org/WhatIsWebMacro credit that guy for inventing the WM language and the initial tech etc. etc. Endre |
From: Marc P. <ma...@an...> - 2003-07-13 00:02:03
|
On Fri, 11 Jul 2003 20:35:17 -0700, Brian Goetz <br...@qu...> wrote: >> The o.toString() call indicated is the problem - sometimes "o" is a >> template (StreamTemplate in my case) and toString() is being dumped out >> to the output, which for StreamTemplate at least returns the template >> "name" not the evaluated contents of the template. > > There were a bunch of places where the toString call seemed redundent > and was eliminated in the latest refactor, so that probably had a lot > to do with it. Look at the diffs and I'll bet itll jump out. Actually, the line I talk about is used for other stuff - it writes text content out to the output also, typically whitespace. The problem is Brian, I do not know exactly what this code is supposed to be doing, so I can't tell if I am fixing it or breaking it. Marc -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Lane S. <la...@op...> - 2003-07-12 05:08:25
|
I will look at TestParseInclude and clean this up. -Lane Marc Palmer wrote: > On Fri, 11 Jul 2003 11:18:32 -0400, Eric B. Ridge <eb...@tc...> wrote: > >> it does that on Win32 boxes. One of the tests tries to #include as >> text "/etc/passwd". :) But w/o the test report, I can't be sure of >> what it's doing. > > > Actually it looks like some changes I think Lane committed relating to > eCommerce macros: > > Testcase: testEcommMacros took 0.07 sec > Caused an ERROR > #include allmacros.wmm: Unable to include as macro > org.webmacro.PropertyException: #include allmacros.wmm: Unable to get > template > org.webmacro.ResourceException: Error parsing template allmacros.wmm > org.webmacro.engine.BuildException: #include ecomm/all.wmm: Unable to > include as macro > org.webmacro.PropertyException: #include ecomm/all.wmm: Unable to get > template > org.webmacro.ResourceException: Error parsing template ecomm/all.wmm > org.webmacro.engine.BuildException: #include ecomm/verisign.wmm: > Unable to include as macro > org.webmacro.PropertyException: #include ecomm/verisign.wmm: Not found > by template provider at > D:\webmacro-latest\webmacro\macros\ecomm\all.wmm:6.2 at > D:\webmacro-latest\webmacro\macros\allmacros.wmm:5.2 at unknown:5.2 > org.webmacro.engine.BuildException: #include allmacros.wmm: Unable to > include as macro > org.webmacro.PropertyException: #include allmacros.wmm: Unable to get > template > org.webmacro.ResourceException: Error parsing template allmacros.wmm > org.webmacro.engine.BuildException: #include ecomm/all.wmm: Unable to > include as macro > org.webmacro.PropertyException: #include ecomm/all.wmm: Unable to get > template > org.webmacro.ResourceException: Error parsing template ecomm/all.wmm > org.webmacro.engine.BuildException: #include ecomm/verisign.wmm: > Unable to include as macro > org.webmacro.PropertyException: #include ecomm/verisign.wmm: Not found > by template provider at > D:\webmacro-latest\webmacro\macros\ecomm\all.wmm:6.2 at > D:\webmacro-latest\webmacro\macros\allmacros.wmm:5.2 at unknown:5.2 > > ...it goes on and on. > |
From: Lane S. <la...@op...> - 2003-07-12 05:01:07
|
negative. There are literally a hundred implementations for making a result an 2-d row or column array. -Lane Eric B. Ridge wrote: > Hey! Is there any value to teaching #foreach to iterate over JDBC > ResultSet's? Or perhaps another directive dedicated to this? > > eric > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > |
From: Lane S. <la...@op...> - 2003-07-12 04:59:14
|
I generally like the idea of Brian's below. There needs tho to be a method: WebMacro wm = WebMacro.getDefaultInstance(); Check this in, B. I would like to work on this with Marc's stuff. -Lane Brian Goetz wrote: >> public static void main( String[] args ) >> { >> try >> { >> WebMacro wm = new WM(); >> Template t = new StringTemplate(wm.getBroker(), >> "The value of the variable is: $variable"); >> Context context = wm.getContext(); >> context.put( "variable", "Hello, world!"); >> t.write( System.out, context); >> } >> catch ( Exception e ) >> { >> e.printStackTrace(); } >> } >> >> > >I'd like to eliminate the reference to the WM, if we can. How about >some lazy initialization where, if you don't specify a broker (or "WM >instance"), a Singleton instance with default config gets created in the >background and used? Then you can say: > > > >> public static void main( String[] args ) throws Exception >> { >> Template t = new StringTemplate("The value of the variable is: $variable"); >> Context context = WebMacro.getContext(); // or just new Context >> context.put( "variable", "Hello, world!"); >> t.write( System.out, context); >> } >> >> > > > >------------------------------------------------------- >This SF.Net email sponsored by: Parasoft >Error proof Web apps, automate testing & more. >Download & eval WebKing and get a free book. >www.parasoft.com/bulletproofapps1 >_______________________________________________ >Webmacro-devel mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > |
From: Brian G. <br...@qu...> - 2003-07-12 03:39:21
|
> Brian - I've looked at this more clearly and my hunch was right, it's > standard loop optimisation. Yes, exactly. > However does this really -reliably-give us a performance benefit that is > worthwhile? > > If this is definitely so, while it executes the same block of code > (inlined) 10 times in the loop ( or <10 in the remainder block): It did at the time, and it was a _significant_ improvement (in the JDK 1.2 days.) > ...can we not increase maintainability (and perhaps performance too) by > moving the above block into a (final) method and call the method 10 times > and assume the compiler/VM/JIT will "inline" the method for us? This would > be quite a lot nicer from a source point of view. Probably. My feeling on this one is "ain't broke" (which is different from my feeling on most optimizations in WM, mostly because this one actually made a difference.) > Furthermore, if this kind of optimisation is reliable, either with the code > as it is or with my aforementioned "refactor", we could then inline the > getLineNo and getColNo calls to improve performance even further - which is > certainly more manageable with my single call mechanism. > > Are loops -really-that inefficient in Java? Well, at the time, this call was a profilable hot spot, and this transformation helped. That was several years ago. JITs have gotten better. CPUs faster. Memory cheaper. Probably makes less of a difference now. |
From: Brian G. <br...@qu...> - 2003-07-12 03:35:44
|
> The o.toString() call indicated is the problem - sometimes "o" is a > template (StreamTemplate in my case) and toString() is being dumped out to > the output, which for StreamTemplate at least returns the template "name" > not the evaluated contents of the template. There were a bunch of places where the toString call seemed redundent and was eliminated in the latest refactor, so that probably had a lot to do with it. Look at the diffs and I'll bet itll jump out. |
From: Marc P. <ma...@an...> - 2003-07-12 00:39:46
|
On Sat, 12 Jul 2003 01:22:27 +0100, Marc Palmer <ma...@an...> wrote: > > My guess is that the search for setMyProp is failing, and it is using > put() . The getMyProp is also failing, and it is using get() instead, and > this is hiding the bug that I have found, because the script appears to > work but it is not doing that the test intended. The test needs > improvement. I will see if I can do this. ROFL. I'm completely talking out of my arse here - please forgive me. It's "not possible" for the above to occur, because put would only be able to set "Parameters" to a value, not "Parameters.Name", or at least that's what my frazzled brain is currently telling me. I'm still completely clueless about this bug. -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Tim P. <ti...@pa...> - 2003-07-12 00:31:20
|
Hi,=20 =20 Melati 0.7.1 is available from http://www.melati.org/=20 This release includes support for BigDecimal data types. This requires changes to the ColumnInfo and Setting Tables=20 which are detailed in the RELEASENOTES There has also been further changes to the preprocessor such that=20 field descriptions in the DSD are passed through to javadoc.=20 The maven site (http://maven.melati.org/) now contains the same=20 text as the http://melati.org/ site.=20 yours sincerely Tim Pizey http://www.paneris.org/ |
From: Marc P. <ma...@an...> - 2003-07-12 00:23:02
|
Guys, this is very odd. There is a TestGetSet class in WM's unit test tree that already tests binary accessors. It works. However my test fails. I can'see a difference between them! I found a way to fix WM so my test works - change line 901 of PropertyOperatorCache to: parent = getProperty(context, instance, names, pos, pos + 1); ...where the "+1" is the only new bit. But, doing that breaks TestGetSet's binary accessor access that uses getProps().put(...) I am mystified. TestGetSet does: Script: #set $TestObject.MyProp.Foo='Bar' Object: public void setMyProp (String name, Object val) My test, TestBinaryAccessor does: Script: #set $test.Parameters.Name = 'marc' Object: public void setParameters( String key, Object value) So tell me... how the hell does one work and not the other? I think I have the answer. The test object in TestGetSet has multiple binary accessors: get/put getMyProp/setMyProp getProps/setProps My guess is that the search for setMyProp is failing, and it is using put() . The getMyProp is also failing, and it is using get() instead, and this is hiding the bug that I have found, because the script appears to work but it is not doing that the test intended. The test needs improvement. I will see if I can do this. So, anybody know their way around this better than me? It's very horrible code, and I'm saying that after looking at it. Marc -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Marc P. <ma...@an...> - 2003-07-11 22:59:32
|
I've updated NextRelease to start honing the list of real 2.0 requirements: http://www.webmacro.org/NextRelease Also showing their status. When we agree items, we should put them into the SF RFE tracker. Come on guys, what better thing could you be doing on a Friday night?! :) -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Marc P. <ma...@an...> - 2003-07-11 22:42:52
|
On Thu, 10 Jul 2003 20:49:19 -0700, Brian Goetz <br...@qu...> wrote: >> Why is this required? At best this looks like some really bad >> optimisation! > > Actually, this is some good optimization done by Michael Bayne, from > whom we could all learn a thing about optimization. Brian - I've looked at this more clearly and my hunch was right, it's standard loop optimisation. However does this really -reliably-give us a performance benefit that is worthwhile? If this is definitely so, while it executes the same block of code (inlined) 10 times in the loop ( or <10 in the remainder block): b = bcontent[i]; out.write(b, 0, b.length); teC._lineNo = this.getLineNo(i); teC._columnNo = this.getColNo(i); _macros[i++].write(out, context); ...can we not increase maintainability (and perhaps performance too) by moving the above block into a (final) method and call the method 10 times and assume the compiler/VM/JIT will "inline" the method for us? This would be quite a lot nicer from a source point of view. Furthermore, if this kind of optimisation is reliable, either with the code as it is or with my aforementioned "refactor", we could then inline the getLineNo and getColNo calls to improve performance even further - which is certainly more manageable with my single call mechanism. Are loops -really-that inefficient in Java? I look forward to being enlightened :) Marc -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Marc P. <wj...@wa...> - 2003-07-11 22:24:12
|
Hi guys (in particualr Brian due to earlier discussion), I have tracked down how the template name is somehow getting into the output now. Basically, in o.w.engine.BlockBuilder we have this code: final public Object build (BuildContext bc) throws BuildException { ...do some stuff... if (o instanceof Block) { iterStack.push(iter); iter = ((Block) o).getBlockIterator(); } else { if (o instanceof Macro) { strings.add(s.toString()); s = new StringBuffer(); // do not reuse StringBuffer, // otherwise all strings will contain char[] of max length!! macros.add(o); // Now deal with the line numbers int size = macros.size(); if (ln.length < size) { ln = resizeIntArray(ln, ln.length * 2); cn = resizeIntArray(cn, cn.length * 2); } ln[size - 1] = iter.getLineNo(); cn[size - 1] = iter.getColNo(); } else if (o != null) { s.append(o.toString()); // <<---- HERE } } ...do some stuff... } The o.toString() call indicated is the problem - sometimes "o" is a template (StreamTemplate in my case) and toString() is being dumped out to the output, which for StreamTemplate at least returns the template "name" not the evaluated contents of the template. Now, I've had a quick look at a couple of diffs (BlockBuilder and StreamTemplate) and I can't see how this problem is only now creeping into WM. I can only assume that previously template.toString() meant evaluate the template, or the code has not always blindly done o.toString() and has previously checked for templates and handled them differently. OR... template objects are now being passed to BlockBuilder when previously they weren't. Anybody care to comment? I'm surprised this isn't breaking our tests. I can't track down the conditions under which it occurs, but it seems to be related to #include as macro. Help! -- Marc Palmer wj...@wa... w a n g j a m m e r s java and web software design experts with an ethical outlook http://www.wangjammers.org |
From: Marc P. <ma...@an...> - 2003-07-11 17:09:03
|
On Fri, 11 Jul 2003 11:18:32 -0400, Eric B. Ridge <eb...@tc...> wrote: > it does that on Win32 boxes. One of the tests tries to #include as text > "/etc/passwd". :) But w/o the test report, I can't be sure of what it's > doing. Actually it looks like some changes I think Lane committed relating to eCommerce macros: Testcase: testEcommMacros took 0.07 sec Caused an ERROR #include allmacros.wmm: Unable to include as macro org.webmacro.PropertyException: #include allmacros.wmm: Unable to get template org.webmacro.ResourceException: Error parsing template allmacros.wmm org.webmacro.engine.BuildException: #include ecomm/all.wmm: Unable to include as macro org.webmacro.PropertyException: #include ecomm/all.wmm: Unable to get template org.webmacro.ResourceException: Error parsing template ecomm/all.wmm org.webmacro.engine.BuildException: #include ecomm/verisign.wmm: Unable to include as macro org.webmacro.PropertyException: #include ecomm/verisign.wmm: Not found by template provider at D:\webmacro-latest\webmacro\macros\ecomm\all.wmm:6.2 at D:\webmacro-latest\webmacro\macros\allmacros.wmm:5.2 at unknown:5.2 org.webmacro.engine.BuildException: #include allmacros.wmm: Unable to include as macro org.webmacro.PropertyException: #include allmacros.wmm: Unable to get template org.webmacro.ResourceException: Error parsing template allmacros.wmm org.webmacro.engine.BuildException: #include ecomm/all.wmm: Unable to include as macro org.webmacro.PropertyException: #include ecomm/all.wmm: Unable to get template org.webmacro.ResourceException: Error parsing template ecomm/all.wmm org.webmacro.engine.BuildException: #include ecomm/verisign.wmm: Unable to include as macro org.webmacro.PropertyException: #include ecomm/verisign.wmm: Not found by template provider at D:\webmacro-latest\webmacro\macros\ecomm\all.wmm:6.2 at D:\webmacro-latest\webmacro\macros\allmacros.wmm:5.2 at unknown:5.2 ...it goes on and on. -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Eric B. R. <eb...@tc...> - 2003-07-11 15:18:40
|
On Friday, July 11, 2003, at 10:54 AM, Marc Palmer wrote: > On Fri, 11 Jul 2003 10:18:28 -0400, Eric B. Ridge <eb...@tc...> wrote: > >> Marc, could you add a test case (or a few dozen) into CVS for this? >> :) > > Done. Reliably fails ;-) > > Does this mean you are volunteering to help fix this? no. but it does mean that everyone that runs the testsuite will now be annoyed by this bug. > Also I notice that TestParseInclude is failing on 5 tests. Looks like > we have some missing templates. it does that on Win32 boxes. One of the tests tries to #include as text "/etc/passwd". :) But w/o the test report, I can't be sure of what it's doing. eric > > -- > Marc Palmer > Contract Java Consultant/Developer > > * Available For Hire * > > See my CV at http://www.anyware.co.uk/marc/ > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel |
From: Marc P. <ma...@an...> - 2003-07-11 14:55:31
|
On Fri, 11 Jul 2003 10:18:28 -0400, Eric B. Ridge <eb...@tc...> wrote: > Marc, could you add a test case (or a few dozen) into CVS for this? :) Done. Reliably fails ;-) Does this mean you are volunteering to help fix this? Also I notice that TestParseInclude is failing on 5 tests. Looks like we have some missing templates. -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Eric B. R. <eb...@tc...> - 2003-07-11 14:18:36
|
Marc, could you add a test case (or a few dozen) into CVS for this? :) eric On Friday, July 11, 2003, at 09:50 AM, Marc Palmer wrote: > > OK here I go again boldly declaring a bug in WM, hopefully to receive > egg on my face (I'd prefer vegan egg replacer actually). I've > submitted this to the SF bug tracker though as I am very sure it is a > longstanding bug. > > I reported this some time ago but without a concise example. Binary > accessor "set" is broken in WM, whereby a method such as: > > public void setParameters( String key, Object value) > > should be called when you perform: > > #set $obj.Parameters.MyKey = "MyValue" > > Instead WM spews as it is unable to find a property "Parameters" on > the object: > > org.webmacro.PropertyException$NoSuchPropertyException: No public > property Parameters on variable $test of class TrivialWM$Wrapper at > unknown:3.2 > > Here is standalone code (requires latest CVS code without FastWriter) > that shows the problem. I would be grateful if somebody who knows the > WM introspection code code look at this. That is some truly nasty code > there and I don't want to go chopping and changing! I would appreciate > it if someone could look at this soon because Ignition requires this > functionality (without ugly workaround) and it really is a > longstanding bug in WM... > > If you remove the #set line from the test template in the source, you > will see that the binary "get" works fine, and always has. > > public class TrivialWM > { > public static class Wrapper > { > > private Map params = new Hashtable(); > > public String getParameters( String key) > { > return (String) params.get( key); > } > > public void setParameters( String key, Object value) > { > params.put( key, value); > } > } > > public static void main( String[] args ) > { > final String templateText = > "Current value is: $test.Parameters.Name\n"+ > "Changing it... \n" + > "#set $test.Parameters.Name = 'marc'\n"; > try > { > WebMacro wm = new WM("testconfig.properties"); > Template t = new StringTemplate(wm.getBroker(), > templateText); > Context context = wm.getContext(); > context.put( "test", new Wrapper()); > t.write( System.out, context); > } > catch ( Exception e ) > { > e.printStackTrace(); //To change body of catch statement > use Options | File Templates. > } > } > } > > > -- > Marc Palmer > Contract Java Consultant/Developer > > * Available For Hire * > > See my CV at http://www.anyware.co.uk/marc/ > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel |
From: Marc P. <ma...@an...> - 2003-07-11 13:50:52
|
OK here I go again boldly declaring a bug in WM, hopefully to receive egg on my face (I'd prefer vegan egg replacer actually). I've submitted this to the SF bug tracker though as I am very sure it is a longstanding bug. I reported this some time ago but without a concise example. Binary accessor "set" is broken in WM, whereby a method such as: public void setParameters( String key, Object value) should be called when you perform: #set $obj.Parameters.MyKey = "MyValue" Instead WM spews as it is unable to find a property "Parameters" on the object: org.webmacro.PropertyException$NoSuchPropertyException: No public property Parameters on variable $test of class TrivialWM$Wrapper at unknown:3.2 Here is standalone code (requires latest CVS code without FastWriter) that shows the problem. I would be grateful if somebody who knows the WM introspection code code look at this. That is some truly nasty code there and I don't want to go chopping and changing! I would appreciate it if someone could look at this soon because Ignition requires this functionality (without ugly workaround) and it really is a longstanding bug in WM... If you remove the #set line from the test template in the source, you will see that the binary "get" works fine, and always has. public class TrivialWM { public static class Wrapper { private Map params = new Hashtable(); public String getParameters( String key) { return (String) params.get( key); } public void setParameters( String key, Object value) { params.put( key, value); } } public static void main( String[] args ) { final String templateText = "Current value is: $test.Parameters.Name\n"+ "Changing it... \n" + "#set $test.Parameters.Name = 'marc'\n"; try { WebMacro wm = new WM("testconfig.properties"); Template t = new StringTemplate(wm.getBroker(), templateText); Context context = wm.getContext(); context.put( "test", new Wrapper()); t.write( System.out, context); } catch ( Exception e ) { e.printStackTrace(); //To change body of catch statement use Options | File Templates. } } } -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Marc P. <ma...@an...> - 2003-07-11 12:28:42
|
On Fri, 11 Jul 2003 13:18:00 +0100, Marc Palmer <ma...@an...> wrote: > > Hi, > > I just found a problem in WMServlet after Brian's removal of FastWriter. > There is some redundant FastWriter stuff in the execute() method of > WMServlet which can cause NPEs under some conditions, because it tries to > close a null FW. Fix tested and committed. -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Marc P. <ma...@an...> - 2003-07-11 12:18:20
|
Hi, I just found a problem in WMServlet after Brian's removal of FastWriter. There is some redundant FastWriter stuff in the execute() method of WMServlet which can cause NPEs under some conditions, because it tries to close a null FW. I am working on a fix here, and if it works will commit it shortly. Marc -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Marc P. <ma...@an...> - 2003-07-11 08:57:07
|
On Thu, 10 Jul 2003 20:49:19 -0700, Brian Goetz <br...@qu...> wrote: >> Why is this required? At best this looks like some really bad >> optimisation! > > Actually, this is some good optimization done by Michael Bayne, from > whom we could all learn a thing about optimization. ...but what does it DO? It's not documented from what I can see. Hard to imagine how WM would beneit from this kind of optimisation - so if it isn't obvious it should be documented. -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Brian G. <br...@qu...> - 2003-07-11 03:49:35
|
> Why is this required? At best this looks like some really bad optimisation! Actually, this is some good optimization done by Michael Bayne, from whom we could all learn a thing about optimization. |
From: Marc P. <ma...@an...> - 2003-07-11 02:15:46
|
Oh, just glancing through the WM source trying to find what looks like a new bug in the current source (dumping out template name "randomly" in stream) and I see this in Block.java and I am wondering "what the f*** is this?". Anybody care to explain what this is all about? final public void write (final FastWriter out, final Context context) throws PropertyException, IOException { 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); } ...it goes on with some similar stuff. Why is this required? At best this looks like some really bad optimisation! -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |
From: Brian G. <br...@qu...> - 2003-07-10 18:47:16
|
> public static void main( String[] args ) > { > try > { > WebMacro wm = new WM(); > Template t = new StringTemplate(wm.getBroker(), > "The value of the variable is: $variable"); > Context context = wm.getContext(); > context.put( "variable", "Hello, world!"); > t.write( System.out, context); > } > catch ( Exception e ) > { > e.printStackTrace(); } > } I'd like to eliminate the reference to the WM, if we can. How about some lazy initialization where, if you don't specify a broker (or "WM instance"), a Singleton instance with default config gets created in the background and used? Then you can say: > public static void main( String[] args ) throws Exception > { > Template t = new StringTemplate("The value of the variable is: $variable"); > Context context = WebMacro.getContext(); // or just new Context > context.put( "variable", "Hello, world!"); > t.write( System.out, context); > } |
From: Marc P. <ma...@an...> - 2003-07-10 16:48:21
|
Hi, In trying to write my TrivialWM example to see how well we are doing now that FW is gone, I encountered another frustration with using WM - creating a WM instance. Take the code: public static void main( String[] args ) { try { WebMacro wm = new WM(); Template t = new StringTemplate(wm.getBroker(), "The value of the variable is: $variable"); Context context = wm.getContext(); context.put( "variable", "Hello, world!"); t.write( System.out, context); } catch ( Exception e ) { e.printStackTrace(); } } This is much better than it used to be. However this does not work on my system because I have a WebMacro.properties on the path that relates to servlets. I should be able to easily write code that, without a servlet, uses templates. However the current WM constructors force me to use a properties file even if it is empty or contains non-WM properties. i.e. the only way to make the above code work with a (possibly servlet-dependent) WebMacro.properties file present is to do: WebMacro wm = new WM("dummyfile.properties"); ...and create that file with nothing in it. This obviously sucks. Passing a (String)null or a (Properties)null results in errors. I thought I could do this: WebMacro wm = new WM(new Properties()); ...but that still resorts to the WebMacro.properties on disk, as the implementation adds the properties specified over and above those in WebMacro.properties. I think we definitely need a WM ctor that allows you to instantiate WM with just the WebMacro.defaults settings. IMO, this is important for demonstration purposes. Can we work this into the WM(Properties) scheme or not? I have a feeling that not including the WebMacro.properties when using this ctor will break some of my Ignition stuff, but then I can always merge the Properties myself before calling it. This problem shows up, specifically, if you have WebMacro.properties set to use the DelegatingTemplateProvider and have some webapp:/ paths in there. The ServletContextTemplateLoader dies for obvious reasons. In the future, I strongly feel WM should have DelegatingTemplateProvider as the default, and as such we need to address this problem of creating standalone WM instances hassle-free. -- Marc Palmer Contract Java Consultant/Developer * Available For Hire * See my CV at http://www.anyware.co.uk/marc/ |