[jbosstools-dev] One more duplicate message: APPLICATION_IS_ALREADY_REGISTERED

Sean Flanigan sflaniga at redhat.com
Thu Apr 2 03:17:47 EDT 2009


The duplicated message in
/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
  APPLICATION_IS_ALREADY_REGISTERED=Application {0} is already
registered in {1}
  APPLICATION_IS_ALREADY_REGISTERED=Application is already registered.

is used in these methods:
org.jboss.tools.jst.web.context.RegisterServerContext.getErrorMessage()
org.jboss.tools.jst.web.server.RegistrationHelper.getRegistrationError(IModule,
String, IServer)

The odd thing is, both methods provide the NLS.bind parameters -
  return NLS.bind(WebUIMessages.APPLICATION_IS_ALREADY_REGISTERED,
applicationName, targetServers[i].getName()); //$NON-NLS-2$
  return NLS.bind(WebUIMessages.APPLICATION_IS_ALREADY_REGISTERED,
appname, server.getName());

- but at runtime, the first definition will be ignored, and NLS will use
the simple string "Application is already registered."

I can't work out how the duplicate got in, since they are on adjacent
lines, and it predates the Exadel import, so "svn blame" doesn't help.

I propose to delete the second definition.  I'm pretty sure the
intention is to use the first message which takes parameters to provide
a better error message, and the string is already being passed to
NLS.bind, so it should be a perfectly safe change.

This will change the message used at runtime, but hopefully for the
better.  Any objections?


-- 
Sean Flanigan

Senior Software Engineer
Engineering - Internationalisation
Red Hat

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/jbosstools-dev/attachments/20090402/4dad2e28/attachment.bin 


More information about the jbosstools-dev mailing list