1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
Author: Andreas Tille <tille@debian.org>
Last-Update: 2016-01-29
Description: Replace non-free class by Java standard String.format
--- a/util/Makefile
+++ b/util/Makefile
@@ -5,7 +5,7 @@
UTIL_JAR=f2jutil.jar
-VER_TARGET=1.2
+VER_TARGET=1.8
$(UTIL_JAR):
mkdir -p $(OUTDIR)
--- a/util/org/j_paine/formatter/Formatter.java
+++ b/util/org/j_paine/formatter/Formatter.java
@@ -553,7 +553,7 @@
/* Convert the number to a string. */
if ( o instanceof Integer || o instanceof Long ) {
String fmtstr = "%" + Integer.toString(getWidth()) + "d";
- s = new PrintfFormat(fmtstr).sprintf(o);
+ s = String.format(fmtstr, o);
/* Throw an exception if the string won't fit. */
if ( s.length() > getWidth() )
@@ -745,7 +745,7 @@
o instanceof Float || o instanceof Double ) {
String fmtstr = "%" + Integer.toString(getWidth()) + "." +
Integer.toString(this.d) + "f";
- s = new PrintfFormat(fmtstr).sprintf(o);
+ s = String.format(fmtstr, o);
/* Throw an exception if the string won't fit. */
if ( s.length() > getWidth() )
@@ -836,7 +836,7 @@
o instanceof Float || o instanceof Double ) {
String fmtstr = "%" + Integer.toString(getWidth()) + "." +
Integer.toString(this.d) + "E";
- s = new PrintfFormat(fmtstr).sprintf(o);
+ s = String.format(fmtstr, o);
/* Throw an exception if the string won't fit. */
if ( s.length() > getWidth() )
|