You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by Andrew Jaquith <an...@gmail.com> on 2010/02/15 16:27:49 UTC
Priha bug
Janne --
There's a bug in the current version of Priha included with JSPWiki
that is preventing properties from getting saved properly.
Steps to reproduce:
0. Remove the s.save() statement at line 863 in ReferenceManager that
shouldn't be there.
1. Debug ReferenceManagerTest.testRemoveFromProperty().
2. Step through the two ReferenceManager.addToProperty() calls. This
is called twice in sequence by ReferenceManagerTest, line 392:
mgr.addToProperty( jcrPath, "foo","Value1", true );
mgr.addToProperty( jcrPath, "foo","Value2", true );
3. When you step through ReferenceManager.addToProperty, everything
looks ok. The Session doesn't find the Property the first time, and
adds it as it should. The second time, it finds the Property and adds
the value... again, as it should.
4. Line 394 of ReferenceManagerTest immediately does this:
s.save();
5. When you inspect the file system, only one foo*.data file is there:
foo0.data, and it contains "Value2." So one of the values has gone
missing.
Weird, huh?
Andrew
Re: Priha bug
Posted by Janne Jalkanen <Ja...@ecyrd.com>.
Hmm... This sounds odd. I'll take a look. My immediate thought is that
addToProperty() is doing something wrong with respect to the Value
array.
/Janne
On Feb 15, 2010, at 17:27 , Andrew Jaquith wrote:
> Janne --
>
> There's a bug in the current version of Priha included with JSPWiki
> that is preventing properties from getting saved properly.
>
> Steps to reproduce:
>
> 0. Remove the s.save() statement at line 863 in ReferenceManager that
> shouldn't be there.
> 1. Debug ReferenceManagerTest.testRemoveFromProperty().
> 2. Step through the two ReferenceManager.addToProperty() calls. This
> is called twice in sequence by ReferenceManagerTest, line 392:
>
> mgr.addToProperty( jcrPath, "foo","Value1", true );
> mgr.addToProperty( jcrPath, "foo","Value2", true );
>
> 3. When you step through ReferenceManager.addToProperty, everything
> looks ok. The Session doesn't find the Property the first time, and
> adds it as it should. The second time, it finds the Property and adds
> the value... again, as it should.
>
> 4. Line 394 of ReferenceManagerTest immediately does this:
>
> s.save();
>
> 5. When you inspect the file system, only one foo*.data file is there:
> foo0.data, and it contains "Value2." So one of the values has gone
> missing.
>
> Weird, huh?
>
> Andrew