• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bug (feature?) in J2MEWTK ?  RSS feed

 
Horaci Macias
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've seen that if you specify optional properties in a MidLet whose values begin with spaces, when you try to retrieve those values using getAppProperty, leading spaces are lost !?
Does anybody know if this is a bug or I'm just missing some specification about Midlet properties ?
Thank you,
Horaci Macias
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should consider using another character than a space like an underscore (_) or something. It may well be the case the the String representing the property is trimmed before storing and the space is lost... I don't think it's a bug...
 
Horaci Macias
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote to Sun j2mewtk team. Here's the answer:
Hi,
Much like a properties file, the whitespaces between the separator (i.e.
: or = ) and the property value are ignored.
Regards,
The J2ME Wireless Toolkit team
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I thought. The bottom line is that a space should not be used in the boundaries (before the first character and after the last character) of properties. Or if used, it will be trimmed anyway...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!