jgettext/gettext-commons

Please use equals() to compare two strings in I18n.java

Closed this issue · 2 comments

In I18n.java:

this could cause problems:
return translated == key ? text : translated;

it should be:
return translated.equals( key ) ? text : translated;


Regards, 
Rainer


Original issue reported on code.google.com by google@backend-server.de on 23 Feb 2009 at 9:57

Hi, Rainer,

I don't see a problem with that. As you can see I18n.tr(String) returns the 
argument if the resource can't be 
found, so an == comparison should be fine there.

Original comment by berge...@gmail.com on 23 Feb 2009 at 1:51

Original comment by berge...@gmail.com on 1 Mar 2009 at 9:39

  • Changed state: WontFix