Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PropertyResourceBundle.getStringArray() doesn't quite work as expected...

 
SAFROLE YUTANI
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a property file that I read into a PropertyResourceBundle object like this....
PropertyResourceBundle resource = (PropertyResourceBundle)ResourceBundle.getBundle( "db");
I have an entry in the "db" property file that contains values which are comma delimited, like this...
arr=1,2,3
but when I call resource.getStringArray("arr"), I get a ClassCastException.
I want to get back a String array, which is the return type of getStringArray() anyway! I dont see what the problem is.
Any help would be appreciated!
SAF
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is arr an array of Strings?
 
SAFROLE YUTANI
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. "arr" is an entry in the properties file. It doesn't matter at this point anyway because I managed to find a work around for it.
thanks
SAF
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic