PackageStringResourceLoader does not look up to superclasses

View: New views
3 Messages — Rating Filter:   Alert me  

PackageStringResourceLoader does not look up to superclasses

by Daniel Stoch-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

ComponentStringResourceLoader attempts to find the resource from given
component stack and if not found, then it tries to find a resource in
component class hierarchy. Method:
public String loadStringResource(Class<?> clazz, final String key,
final Locale locale, final String style)
performs a loop through superclasses of the given clazz.

But in PackageStringResourceLoader implementation the same method only
checks the given clazz and does not perform a check in superclasses.
I think it should to handle such scenario:
1. Component com.aaa.CompA has a resource string defined in
"package.properties" file in package com.aaa.
2. In some other package (eg. com.bbb) I'm using CompA component and
overriding its one method (so I've created a new subclass of CompA).
Then resource strings from "package.properties" in package com.aaa
will not be loaded.

What do you think?

--
Daniel

Re: PackageStringResourceLoader does not look up to superclasses

by jthomerson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you file a JIRA and attach a quickstart?

--
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Oct 23, 2009 at 8:59 AM, Daniel Stoch <daniel.stoch@...>wrote:

> Hi,
>
> ComponentStringResourceLoader attempts to find the resource from given
> component stack and if not found, then it tries to find a resource in
> component class hierarchy. Method:
> public String loadStringResource(Class<?> clazz, final String key,
> final Locale locale, final String style)
> performs a loop through superclasses of the given clazz.
>
> But in PackageStringResourceLoader implementation the same method only
> checks the given clazz and does not perform a check in superclasses.
> I think it should to handle such scenario:
> 1. Component com.aaa.CompA has a resource string defined in
> "package.properties" file in package com.aaa.
> 2. In some other package (eg. com.bbb) I'm using CompA component and
> overriding its one method (so I've created a new subclass of CompA).
> Then resource strings from "package.properties" in package com.aaa
> will not be loaded.
>
> What do you think?
>
> --
> Daniel
>

Re: PackageStringResourceLoader does not look up to superclasses

by Daniel Stoch-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

WICKET-2539 (with quickstart)

--
Daniel

On Fri, Oct 23, 2009 at 5:25 PM, Jeremy Thomerson
<jeremy@...> wrote:
> Can you file a JIRA and attach a quickstart?
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com