JBoss Tools Properties Editor Surprise

The latest JBoss Tools Eclipse plugin, which if like me you are running on a platform that they haven’t released RedHat Developer Studio for is a pretty good option, which can be installed through Eclipse using this update URL:

http://download.jboss.org/jbosstools/updates/development

Sets up your default editor of .properties files to be the new Red Hat Properties Editor. It looks very snazzy. However, at least on my machine (Eclipse 3.3, JDK 1.5, OS X 10.4.10), whenever it opens a properties file, it happily strips out all of the equals signs separating property names from their values. They still look good in the graphical portion of the Red Hat Editor, but of course don’t work very well anywhere else.

You can fix this by going into the Eclipse Preferences, General, Editors, File Associations, scrolling down until you see the “*.properties” entry and choosing the “Properties File Editor” as your default.

Basically the resource bundle editor uses a space-equals-space to separate keys from values. ” = “. This is how Sun’s examples of resource bundle properties file look so that seems reasonable. However, the Red Hat editor goes by the strict definition of a Java Properties file, which lets you use spaces as the delimiter, and ignore any immediately subsequent delimiters. It then rewrites the delimiter to only the first valid delimiter it finds, which in this case is a space ” “.