I found a bug when define more than one resource-file in resource tag and iScreen try to get the value of message key. Currently to support correctly more than one resource-file should define only one resource-file in resource tag and add as many nested resource-file as you need to use. But if you define more then one resource-file, when iScreen looks for a message key in one of the resource-file, although it finds a message key in the file, continue looking for in the rest of resource-file defined.
The solution it's easy, only have to add a break sentence when find a message key in one resource-file.
Bug found in iScreen version 2.0.1
Class: ConfiguredResource
Code modified: added new sentence 'break' inside the block 'try' in method getValue(String key, Locale, locale).
public String getValue( String key, Locale locale )
{
String value;
Iterator it;
value = ( String ) messageMap.get( key );
if ( value != null )
{
return value;
}
it = resources.iterator();
while ( it.hasNext() )
{
String bundleName;
ResourceBundle bundle;
bundleName = ( String ) it.next();
bundle = ResourceBundle.getBundle( bundleName,
locale,
Thread.currentThread().getContextClassLoader() );
try
{
value = bundle.getString( key );
break; //BUG SOLUTION.
}
catch ( MissingResourceException e )
{
continue;
}
catch ( ClassCastException e )
{
value = bundle.getObject( key ).toString();
break;
}
}
if ( value == null && ref != null )
{
return ref.getValue( key, locale );
}
return value;
} //end getValue()
Class modified