fix for java 16

reproducible
Zlatin Balevsky 2021-04-07 05:14:53 +01:00
parent 15efb83be7
commit daa267ccde
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 1 additions and 25 deletions

View File

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