Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Html formatter of report ant task only supports basic locales #289
The html elemet of the jacoco report ant task supports the 'locale' attribute. Unfortunately, there's currently no way to configure a Locale for a specific country, since ant seems to convert the String from the ant file to a Locale by invoking the constructor with one String argument, which only allows selection of language, but not of country.
To test this, you can use e.g. 'de' (German) and 'de-CH' (German (Switzerland)), which use different number formats, even though the language is the same.
Other libs that cannot use Java 7 (yet) usually rely on the '_' delimited format that Locale#toString produces. Unfortunately though, there's no parsing api for that. The parsing code however isn't that complicated, see e.g. https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/LocaleTypeDescriptor.java