In C# I have the following attribute above a method:
[Test, SetCulture("en-GB")]
which, I assume, means that whatever happens inside this test method (e.g. number parsing) will obey the rules of the en-GB culture.
Is there any way to do the same thing in Java? Have some annotation that indicates the Locale applicable to a method? I’d really hate to have an extra parameter that gets passed everywhere.
No, I don’t think there is such an annotation.
Your VM starts with the locale that is present in the world outside of the VM (e.G. in the way your terminal is configured) and if you don’t like it you have to set it yourself on every place you might need it.
Sorry about that. Looks like a cool feature.
edit: look here for how to configure the locale for the VM: https://stackoverflow.com/questions/64038/setting-java-locale-settings