File: replace_printfformat.patch

package info (click to toggle)
f2j 0.8.1%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,604 kB
  • sloc: ansic: 18,992; java: 3,987; yacc: 3,804; sh: 153; makefile: 149
file content (44 lines) | stat: -rw-r--r-- 1,480 bytes parent folder | download
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() )