aboutsummaryrefslogtreecommitdiff
path: root/patches/boot/scanner-dbcs.patch
blob: 4dc399086ccf691f11ad8703f1c4bd6948517ada (plain)
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
diff -Nru openjdk-boot.orig/jdk/make/tools/src/build/tools/charsetmapping/DBCS.java openjdk-boot/jdk/make/tools/src/build/tools/charsetmapping/DBCS.java
--- openjdk-boot.orig/jdk/make/tools/src/build/tools/charsetmapping/DBCS.java	2010-05-04 14:24:56.000000000 +0100
+++ openjdk-boot/jdk/make/tools/src/build/tools/charsetmapping/DBCS.java	2010-05-04 14:34:01.000000000 +0100
@@ -27,7 +27,6 @@
 import java.io.*;
 import java.util.Arrays;
 import java.util.ArrayList;
-import java.util.Scanner;
 import java.util.Formatter;
 import java.util.regex.*;
 import java.nio.charset.*;
@@ -39,9 +38,8 @@
 
     public static void genClass(String args[]) throws Exception {
 
-        Scanner s = new Scanner(new File(args[0], args[2]));
-        while (s.hasNextLine()) {
-            String line = s.nextLine();
+        BufferedReader s = new BufferedReader(new FileReader(new File(args[0], args[2])));
+        for (String line = s.readLine(); line != null; line = s.readLine()) {
             if (line.startsWith("#") || line.length() == 0)
                 continue;
             String[] fields = line.split("\\s+");
@@ -188,14 +186,13 @@
         String b2cNR = b2cNRSB.toString();
         String c2bNR = c2bNRSB.toString();
 
-        Scanner s = new Scanner(new File(srcDir, template));
+        BufferedReader s = new BufferedReader(new FileReader(new File(srcDir, template)));
         PrintStream ops = new PrintStream(new FileOutputStream(
                              new File(dstDir, clzName + ".java")));
         if (hisName == null)
             hisName = "";
 
-        while (s.hasNextLine()) {
-            String line = s.nextLine();
+        for (String line = s.readLine(); line != null; line = s.readLine()) {
             if (line.indexOf("$") == -1) {
                 ops.println(line);
                 continue;