This is the original code, which did work: class PropertyModel

public PropertyModel(final IModel model, final String expression,
boolean applyFormatting)
{
        super(null);

        if (model == null)
        {
                throw new NullPointerException("Parameter 'model' must not be 
null");
        }
        
        this.model = model;
        this.expression = expression;
        this.applyFormatting = applyFormatting;
}

and this is the new one

    public PropertyModel(final IModel model, final String expression)
    {
        super(null);

        checkModelNotNull(model);
        
        this.model = model;
        this.expression = expression;

        ApplicationSettings settings =
RequestCycle.get().getApplication().getSettings();
        this.applyFormatting = settings.isPropertyModelDefaultApplyFormatting();
    }


NPE is thrown because RequestCycle.get() returns null. The
RequestCycle has not yet been initialized. Though it may be a problem
of our unit tests only, I'd still suggest to fix it.

Juergen


On Fri, 7 Jan 2005 20:24:01 +0100, Juergen Donnerstag
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> after modifying the MarkupParser javadoc (and committing it), run
> maven jar on wicket core and I was surprised that it failed. I thought
> I made the mistake while changeing the javadoc, but after debugging
> the problem I not sure. The problem is that RequesrCycle.get() returns
> null and throws a NPE in cases where it didn't happen before. Any idea
> what about cause?
> 
> Juergen
>


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to