dev@glassfish.java.net

Re: duplicate message keys

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Sat, 16 Jan 2010 09:33:20 +1100

Hi Bobby,

Could you send the tool out again?

I've gone through all your e-mails in this mailing list in my mail box
but couldn't find it. Must have lost it.

Cheers,
Dies


On 16/01/2010 05:05, Bobby Bissett wrote:
>>
>> I see that there are several duplicate message keys in two
>> LogStrings.properties files. For example, j2eerunner.initError and
>> enterprise.orb_reference_exception are message keys that both appear
>> in two different LogStrings.properties files.
>
> Is that a problem as long as they're in different packages?
>
>> In each case, the duplicate message keys are associated to different
>> messages. It is not a case where the text is simply copied and pasted
>> into a different file.
>>
>> In addition, I noticed that these message keys are not in the Java
>> files. My plan is to remove the message keys and messages unless I
>> hear I should not.
>
> I wrote a tool and sent it out to the dev alias some time ago that
> reports unused keys and duplicate keys within a props file. As long as
> you have Python installed, it takes less than a minute to set up and ~1
> second to run. If anyone is interested, I can send it out again. It has
> to be run on a submodule as it takes a single source root and property
> file root (e.g. foo/src/main/java and foo/src/main/resources), otherwise
> I'd just run it on the whole v3 workspace.
>
> Cheers,
> Bobby
>
> p.s. Here's an example usage on v3/admin/server-mgmt (picked at random).
> Note that there are a bunch of unused keys reported. They could be used
> in some other module if it's using the same logger as in this module.
> That's up to the module owner to figure out.