Mercurial > hg > icedtea7
changeset 1894:2341c4735ea7
Fix build on systems without java.util.Scanner.
2009-07-15 Andrew John Hughes <ahughes@redhat.com>
* Makefile.am:
Turn on euctw patch for systems without
java.util.Scanner.
* patches/ecj/icedtea-euctw.patch:
Remove java.util.Scanner from GenerateEUC_TW.java
author | Andrew John Hughes <ahughes@redhat.com> |
---|---|
date | Wed, 15 Jul 2009 13:39:06 +0100 |
parents | e2ff1b52131d |
children | f13e31f619e2 |
files | ChangeLog Makefile.am patches/ecj/icedtea-euctw.patch |
diffstat | 3 files changed, 42 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Jul 14 19:44:20 2009 +0100 +++ b/ChangeLog Wed Jul 15 13:39:06 2009 +0100 @@ -1,3 +1,11 @@ +2009-07-15 Andrew John Hughes <ahughes@redhat.com> + + * Makefile.am: + Turn on euctw patch for systems without + java.util.Scanner. + * patches/ecj/icedtea-euctw.patch: + Remove java.util.Scanner from GenerateEUC_TW.java + 2009-07-14 Andrew John Hughes <ahughes@redhat.com> * patches/icedtea-messageutils.patch,
--- a/Makefile.am Tue Jul 14 19:44:20 2009 +0100 +++ b/Makefile.am Wed Jul 15 13:39:06 2009 +0100 @@ -2501,7 +2501,8 @@ patches/ecj/icedtea-dbcs.patch if LACKS_JAVA_UTIL_SCANNER -ICEDTEA_ECJ_PATCHES += $(SCANNER_PATCHES) +ICEDTEA_ECJ_PATCHES += $(SCANNER_PATCHES) \ + patches/ecj/icedtea-euctw.patch else if CP40630 ICEDTEA_ECJ_PATCHES += $(SCANNER_PATCHES)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/ecj/icedtea-euctw.patch Wed Jul 15 13:39:06 2009 +0100 @@ -0,0 +1,32 @@ +diff -Nru openjdk-ecj.orig/jdk/make/tools/src/build/tools/charsetmapping/GenerateEUC_TW.java openjdk-ecj/jdk/make/tools/src/build/tools/charsetmapping/GenerateEUC_TW.java +--- openjdk-ecj.orig/jdk/make/tools/src/build/tools/charsetmapping/GenerateEUC_TW.java 2009-07-15 13:08:40.000000000 +0100 ++++ openjdk-ecj/jdk/make/tools/src/build/tools/charsetmapping/GenerateEUC_TW.java 2009-07-15 13:12:08.000000000 +0100 +@@ -27,7 +27,6 @@ + + import java.io.*; + import java.util.ArrayList; +-import java.util.Scanner; + import java.util.Formatter; + import java.util.regex.*; + import java.nio.charset.*; +@@ -42,16 +41,16 @@ + } + + private static String getCopyright(File f) throws IOException { +- Scanner s = new Scanner(f, "ISO-8859-1"); ++ BufferedReader r = ++ new BufferedReader(new InputStreamReader(new FileInputStream(f), "ISO-8859-1")); + StringBuilder sb = new StringBuilder(); +- while (s.hasNextLine()) { +- String ln = s.nextLine(); ++ for (String ln = r.readLine(); ln != null; ln = r.readLine()) { + sb.append(ln + "\n"); + // assume we have the copyright as the first comment + if (ln.matches("^\\s\\*\\/$")) + break; + } +- s.close(); ++ r.close(); + return sb.toString(); + } +