From daa267ccde5bee6bed72b1076b89afd47a471283 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Wed, 7 Apr 2021 05:14:53 +0100 Subject: [PATCH] fix for java 16 --- .../com/muwire/gui/SizeFormatter.groovy | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/gui/src/main/groovy/com/muwire/gui/SizeFormatter.groovy b/gui/src/main/groovy/com/muwire/gui/SizeFormatter.groovy index 8eb2b9b6..7990470b 100644 --- a/gui/src/main/groovy/com/muwire/gui/SizeFormatter.groovy +++ b/gui/src/main/groovy/com/muwire/gui/SizeFormatter.groovy @@ -1,8 +1,6 @@ package com.muwire.gui import java.text.DecimalFormat -import java.text.FieldPosition -import java.text.Format class SizeFormatter { @@ -22,7 +20,7 @@ class SizeFormatter { val /= 1024d } - fmt.format(val,sb, DontCareFieldPosition.INSTANCE) + fmt.format(val,sb, java.text.DontCareFieldPosition.INSTANCE) sb.append(' ') switch(scale) { case 1 : sb.append('K'); break; @@ -37,26 +35,4 @@ class SizeFormatter { sb.append(' ') } } - - private static class DontCareFieldPosition extends FieldPosition { - // The singleton of DontCareFieldPosition. - static final FieldPosition INSTANCE = new java.text.DontCareFieldPosition(); - - private final Format.FieldDelegate noDelegate = new Format.FieldDelegate() { - public void formatted(Format.Field attr, Object value, int start, - int end, StringBuffer buffer) { - } - public void formatted(int fieldID, Format.Field attr, Object value, - int start, int end, StringBuffer buffer) { - } - }; - - private DontCareFieldPosition() { - super(0); - } - - Format.FieldDelegate getFieldDelegate() { - return noDelegate; - } - } }