From: Eric B. R. <eb...@tc...> - 2005-10-16 17:47:04
|
On Oct 12, 2005, at 11:40 AM, Lane Sharman wrote: > Keats, Eric: > > It is urgent that you guys fix the map bug: > > #set $foo = { } > #set $foo = {} > #set $foo = { } > should all resolve to a new empy map and according to marc, they do > not. See marc's comments below. The whitespace handling issues have been fixed and some test cases (org/webmacro/tempalte/TestMap.java) have been added to CVS. All existing test cases still pass. However, I've been unable to reproduce Marc's report of #set $x = {} sometimes returning a previously created Map. I've even tried the #include thing as he mentioned to no avail. There's the start of a test case for this inside TestMap.java if anyone wants to expand upon it. I did study the code and it looks like a *new* HashMap instance is being returned for every use of {}. The MapBuilder is modeled after the long-existing ListBuilder. I'm at a loss on this one. Marc, do you think you can steal 45 minutes to try to come up with a re- produceable test case? eric > > also, keats, this week is the last week to deposit ProperyDirective > or InversionDirective (since that it is what it would be used for). > > -Lane > > > -------- Original Message -------- > Subject: Planning://November 1 - Map support bugs > Date: Wed, 12 Oct 2005 12:15:59 +0100 > From: Marc Palmer <ma...@an...> > Reply-To: ma...@an... > To: Lane Sharman <la...@op...> > References: <433...@op...> > > > > -----Original Message----- > From: Lane Sharman <la...@op...> > To: web...@li... > Date: Sat, 01 Oct 2005 12:16:48 -0700 > Subject: [Webmacro-devel] Planning://November 1 Is Official Release > Date > of WebMacro 2.0Final > > >> Guys, >> For planning purposes, Nov 1 is the official release of 2.0. For many >> of you, this is a non-event. But, for me it is the culmination of >> a lot of >> work. >> How about one you rogering up and writing a press release and >> making contact with the zines and developing some new buzz for WM >> 2.0? >> > > I can try to do the press release. > > HOWEVER I have found what I am pretty sure are some nasty bugs in > the map > support - I believe we must fix these before release. > > Forgive me if these have already been fixed. > > ******** Problem #1 - the worst > > #set $myVar = {} does not guarantee an empty map. In some > circumstances > (I cannot ascertain which at the moment) values from a previous > usage of a > Map remain in this new "empty" map. This is even between requests! > > You can prove this because the only workaround is: > > #set $myVar = {} > $myVar.clear() > > That is the only way I can suppress this bug. Assigning null to the > variable before assigning {} does not work. > This implies to me that in some situations the "new" map used to > assign > the {} value to a variable is in fact cached/reused. > > I repeat, I see the data persisting between separate WM render > cycles, not > just in the same template. > > It may be related to using #set $x = {} within an included > template, as > that is our scenario here. Unfortunately my curernt employer won't > afford > me the time to pin this down, but I may try to nail it down more (and > write unit test) soon if I have the time but you will probably have > noticed I haven't been around much. > > ******** Problem #2 > The parser doesn't like whitespace when creating empy maps: > > #set $x = { } > > This throws a parser error. You must use #set $x = {} > > It just seems unnecessarily strict, and the error message is obtuse. > > Once again, very sorry I haven't come through with putting the JSP/ > Spring > stuff into CVS yet. I just haven't had any time. I am using it however > daily. In December I will have a little more time as I will not > have so > much work on, and will be using WM+Spring in a new project, so > hopefully I > can put this stuff into a WM 2.1 for release in early 2006? > > I must confess though that last night I was thinking of moving to > Velocity, purely because of the cleaner programmatic configuration > and no > FastWriter issues etc. > > You see I want my new project to be able to do this kind of thing: > > WebMacro wm = (WebMacro)springContext.getBean("webmacroEngine"); > wm.addDirective( "getCMSContent", new CMSRepositoryReadDirective() ); > > ...at runtime. > > Also after doing quite a lot of PHP I am startnig to wish that WM > supported relative filenames for templates, relative to the current > template location. Has anybody got ideas about doing that using a > custom > TemplateLoader? > > > Cheers > > > > > -- > Lane Sharman > Providing Private and SPAM-Free Email > http://www.opendoors.com > 858-755-2868 > > |