java.util.PropertyResourceBundle
is based on the java.util.Properties
. Technically java.util.Properties
implements Map<Object,Object>
but when you load properties from a file the keys and values are restricted to String
only (check the source of the java.util.Properties.load()
methods). And the '[' character has no special meaning in the properties file format.
Hence it is impossible to get ClassCastException
due to attempted cast of String[]
to String
if all your resource bundles are indeed based on property files.
Most likely you have a ListResourceBundle
-based bundle (or a custom subclass of ResourceBundle
) which can contain values of any type, arrays included.
And it is possible to mix property-based and class-based resources bundles with the same base name, for example the default resource bundle can be properties file while locale-specific child bundles are ListResourceBundle
-based.