I'm writing a unit test for a patch and I'm getting a
NullPointerException in an interesting place.

I have a property defined like this:

    @Property
    @Persist(org.apache.tapestry5.PersistenceConstants.FLASH)
    private static Map<Integer, TestObject> selected;

and in method

public boolean isObjectSelected() {
        final TestObject obj = getLoopObject();
// This line causes a nullpointerexception
        final boolean notNull = selected != null;

        return notNull && selected.containsKey(obj.getId());
    }

If I use the default Session persistence then I don't get the null
pointer exception. I'm not having any trouble narrowing it down.

Here's the interesting part of the exception:

Caused by: java.lang.NullPointerException
        at 
org.apache.tapestry5.integration.app2.pages.TestPageForCheckbox.isObjectSelected(TestPageForCheckbox.java:82)
        at $PropertyConduit_129ce4d1f5a.get($PropertyConduit_129ce4d1f5a.java)
        at 
org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:59)

Thoughts?

Josh

-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to