You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Uwe Schäfer <sc...@thomas-daily.de> on 2008/08/07 17:12:14 UTC
NPE
Hi
the current (1.4-m3) impl of
ComponentStringResourceLoader.loadStringResource(Class,String,Locale,String)
throws an NPE, that i am not sure of.
I´d suggest:
public String loadStringResource(Class clazz, final String key, final
Locale locale,
final String style)
{
if (clazz == null)
{
return null;
}
// Load the properties associated with the path
IPropertiesFactory propertiesFactory =
Application.get().getResourceSettings()
.getPropertiesFactory();
while (true)
{
// new lines here:
if (clazz == null)
{
return null;
}
right ?
--
THOMAS DAILY GmbH
Adlerstraße 19
79098 Freiburg
Deutschland
T + 49 761 3 85 59 0
F + 49 761 3 85 59 550
E schaefer@thomas-daily.de
www.thomas-daily.de
Geschäftsführer/Managing Directors:
Wendy Thomas, Susanne Larbig
Handelsregister Freiburg i.Br., HRB 3947
Registrieren Sie sich unter http://morningnews.thomas-daily.de für die
kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages
morgens um 9:00 in Ihrer Mailbox.
Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um
8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach
16:00 Uhr des Vortages eingegangen sind. Die Email-Adresse unserer
Redaktion lautet redaktion@thomas-daily.de.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: NPE
Posted by Uwe Schäfer <us...@thomas-daily.de>.
Igor Vaynberg schrieb:
> i patched it in 1.3.x and trunk
thanks, igor!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: NPE
Posted by Igor Vaynberg <ig...@gmail.com>.
i patched it in 1.3.x and trunk
-igor
On Thu, Aug 7, 2008 at 10:30 AM, Uwe Schäfer <sc...@thomas-daily.de> wrote:
> Igor Vaynberg schrieb:
>
>> whats the stacktrace for the npe?
>
> java.lang.NullPointerException
> at
> org.apache.wicket.resource.loader.ComponentStringResourceLoader.loadStringResource(ComponentStringResourceLoader.java:129)
>
> so
>
> // Move to the next superclass
> clazz = clazz.getSuperclass();
>
> returns null because we use this method with an interface as the clazz
> parameter (maybe this is considered abuse of this class?)
>
> cu uwe
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: NPE
Posted by Uwe Schäfer <sc...@thomas-daily.de>.
Igor Vaynberg schrieb:
> whats the stacktrace for the npe?
java.lang.NullPointerException
at
org.apache.wicket.resource.loader.ComponentStringResourceLoader.loadStringResource(ComponentStringResourceLoader.java:129)
so
// Move to the next superclass
clazz = clazz.getSuperclass();
returns null because we use this method with an interface as the clazz
parameter (maybe this is considered abuse of this class?)
cu uwe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: NPE
Posted by Igor Vaynberg <ig...@gmail.com>.
whats the stacktrace for the npe?
-igor
2008/8/7 Uwe Schäfer <sc...@thomas-daily.de>:
> Hi
>
> the current (1.4-m3) impl of
>
> ComponentStringResourceLoader.loadStringResource(Class,String,Locale,String)
>
> throws an NPE, that i am not sure of.
>
> I´d suggest:
>
> public String loadStringResource(Class clazz, final String key, final Locale
> locale,
> final String style)
> {
> if (clazz == null)
> {
> return null;
> }
>
> // Load the properties associated with the path
> IPropertiesFactory propertiesFactory =
> Application.get().getResourceSettings()
> .getPropertiesFactory();
>
> while (true)
> {
>
> // new lines here:
>
> if (clazz == null)
> {
> return null;
> }
>
> right ?
>
>
> --
>
> THOMAS DAILY GmbH
> Adlerstraße 19
> 79098 Freiburg
> Deutschland
> T + 49 761 3 85 59 0
> F + 49 761 3 85 59 550
> E schaefer@thomas-daily.de
> www.thomas-daily.de
>
> Geschäftsführer/Managing Directors:
> Wendy Thomas, Susanne Larbig
> Handelsregister Freiburg i.Br., HRB 3947
>
> Registrieren Sie sich unter http://morningnews.thomas-daily.de für die
> kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages
> morgens um 9:00 in Ihrer Mailbox.
>
> Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um
> 8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach 16:00
> Uhr des Vortages eingegangen sind. Die Email-Adresse unserer Redaktion
> lautet redaktion@thomas-daily.de.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org