From 830a2275078214a2b989e8155fc777288c186918 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Thu, 19 Nov 2020 15:16:18 -0500 Subject: [PATCH] Performance: Class initializer may be 'static' --- OsmAnd/src/net/osmand/plus/OsmAndFormatter.java | 2 +- .../osmand/core/samples/android/sample1/SampleFormatter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java index 92bcdef9a6..3fd1aa1adc 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java @@ -63,7 +63,7 @@ public class OsmAndFormatter { private static final char WEST = 'W'; private static final char EAST = 'E'; - { + static { fixed2.setMinimumFractionDigits(2); fixed1.setMinimumFractionDigits(1); fixed1.setMinimumIntegerDigits(1); diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleFormatter.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleFormatter.java index 9397f5ea7d..6a340aa528 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleFormatter.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/SampleFormatter.java @@ -23,7 +23,7 @@ public class SampleFormatter { public final static float FEET_IN_ONE_METER = YARDS_IN_ONE_METER * 3f; private static final DecimalFormat fixed2 = new DecimalFormat("0.00"); private static final DecimalFormat fixed1 = new DecimalFormat("0.0"); - { + static { fixed2.setMinimumFractionDigits(2); fixed1.setMinimumFractionDigits(1); fixed1.setMinimumIntegerDigits(1);