We have an application that uses the .properties for storing the language translations. We tried accessing them using PropertyResourceBundle and PropertiesConfiguration (independently). On the local machine (windows) it works correctly but when we commit the code to the repository and run the build using jenkins on a Linux machine it works differently. Here is what happens:
Java Version: JDK_1_7_u21.
Windows 8.1:
PropertyResourceBundle: Using the getString() to get the string. Returns it correctly the whole string.
PropertiesConfiguration: Using getStringArray() returns the strings split by commas.
Linux Ubuntu, kernel 3.5.0-31-generic:
PropertyResourceBundle: Using the getString() to get the string. If a comma is present in the string, returns only the text after the LAST comma. Otherwise works correctly.
E.g.:
String: 123,456
Returns: "456"
PropertiesConfiguration: Using getStringArray() returns the string correctly if no comma is present. If it is, it copies the text again in the next cell array.
E.g.:
String: 123, 456
Returns: ["123,456","123,456"]
Anyone knows what might be the cause of this and how can this be fixed so that the implementation works the same in both environments?
The problem was caused by the repository. It crashed sometime ago and corrupted the .properties files. After fixing this, the problem disappeared.