This is an automated email from the git hooks/post-receive script. New commit to branch feature/7275_fix in repository tutti. See http://git.codelutin.com/tutti.git commit b278daeac0aedc1baf342259891c36f4a8ddcf32 Author: Kevin Morin <morin@codelutin.com> Date: Mon Dec 21 18:08:02 2015 +0100 le séparateur espace était celui par défaut, donc ca passait sur nos machines, mais en fait il n'était pas pris en compte. fixes #7275 --- .../fr/ifremer/tutti/service/DecoratorService.java | 46 +++++++++++----------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java index ada5cbc..fa0c741 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java @@ -137,28 +137,7 @@ public class DecoratorService extends AbstractTuttiService { return bean == null ? "" : String.valueOf(bean); } }); - registerDecorator(SPACE_EVERY_3_DIGIT, new Decorator<String>(String.class) { - - DecimalFormatSymbols symbols = new DecimalFormatSymbols(); - DecimalFormat df = new DecimalFormat("###,###", symbols); - - { - symbols.setGroupingSeparator(' '); - } - - - @Override - public String toString(Object bean) { - String s = (String) bean; - try { - int i = Integer.parseInt(s); - return df.format(i); - - } catch (NumberFormatException e) { - return ""; - } - } - }); + registerDecorator(SPACE_EVERY_3_DIGIT, new SpaceEvery3DigitDecorator()); registerDecorator(new VesselDecorator()); registerDecorator(new ProgramDecorator()); registerTuttiDecorator(Program.class, ONLY_NAME, "${name}$s", SEPARATOR, " - "); @@ -377,4 +356,27 @@ public class DecoratorService extends AbstractTuttiService { } } + public static class SpaceEvery3DigitDecorator extends Decorator<String> implements Cloneable { + + DecimalFormat df; + + public SpaceEvery3DigitDecorator() throws NullPointerException { + super(String.class); + DecimalFormatSymbols symbols = new DecimalFormatSymbols(); + symbols.setGroupingSeparator(' '); + df = new DecimalFormat("###,###", symbols); + } + + @Override + public String toString(Object bean) { + String s = (String) bean; + try { + int i = Integer.parseInt(s); + return df.format(i); + + } catch (NumberFormatException e) { + return ""; + } + } + } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.