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

  • Priha bug Andrew Jaquith
    • Re: Priha bug Janne Jalkanen

Reply via email to