Performance: Class initializer may be 'static'

This commit is contained in:
TacoTheDank 2020-11-19 15:16:18 -05:00
parent a35050b2e7
commit 830a227507
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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);