changeset in /hg/icedtea6: 2008-12-03 Matthias Klose <doko at ubu...

doko at ubuntu.com doko at ubuntu.com
Wed Dec 3 13:51:21 PST 2008


changeset c8712800dc87 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=c8712800dc87
description:
	2008-12-03  Matthias Klose  <doko at ubuntu.com>

	        * Makefile.am: Update for b14.
	        * Makefile.am (ICEDTEA_PATCHES): Remove patches applied in b14.
	        * patches/icedtea-4486841.patch, patches/icedtea-6484091.patch,
	        patches/icedtea-6497740.patch, patches/icedtea-6588160.patch,
	        patches/icedtea-6592792.patch, patches/icedtea-6721753.patch,
	        patches/icedtea-6726779.patch, patches/icedtea-6733959.patch,
	        patches/icedtea-6734167.patch, patches/icedtea-6755943.patch,
	        patches/icedtea-6766136.patch: Remove.
	        * patches/icedtea-rhino.patch: Update.

diffstat:

14 files changed, 117 insertions(+), 4852 deletions(-)
ChangeLog                              |   12 
Makefile.am                            |   19 
patches/icedtea-rhino.patch            |  202 ++--
patches/security/icedtea-4486841.patch | 1234 ------------------------
patches/security/icedtea-6484091.patch |  129 --
patches/security/icedtea-6497740.patch | 1587 --------------------------------
patches/security/icedtea-6588160.patch |   42 
patches/security/icedtea-6592792.patch |  360 -------
patches/security/icedtea-6721753.patch |  116 --
patches/security/icedtea-6726779.patch |  142 --
patches/security/icedtea-6733959.patch |  231 ----
patches/security/icedtea-6734167.patch |   89 -
patches/security/icedtea-6755943.patch |  617 ------------
patches/security/icedtea-6766136.patch |  189 ---

diffs (truncated from 5073 to 500 lines):

diff -r 1df8eaba0e60 -r c8712800dc87 ChangeLog
--- a/ChangeLog	Wed Dec 03 21:22:19 2008 +0100
+++ b/ChangeLog	Wed Dec 03 22:50:40 2008 +0100
@@ -1,3 +1,15 @@ 2008-12-03  Matthias Klose  <doko at ubuntu
+2008-12-03  Matthias Klose  <doko at ubuntu.com>
+
+	* Makefile.am: Update for b14.
+	* Makefile.am (ICEDTEA_PATCHES): Remove patches applied in b14.
+	* patches/icedtea-4486841.patch, patches/icedtea-6484091.patch,
+	patches/icedtea-6497740.patch, patches/icedtea-6588160.patch,
+	patches/icedtea-6592792.patch, patches/icedtea-6721753.patch,
+	patches/icedtea-6726779.patch, patches/icedtea-6733959.patch,
+	patches/icedtea-6734167.patch, patches/icedtea-6755943.patch,
+	patches/icedtea-6766136.patch: Remove.
+	* patches/icedtea-rhino.patch: Update.
+
 2008-12-03  Matthias Klose  <doko at ubuntu.com>
 
 	* patches/hotspot/14.0b08/icedtea-shark.patch: Fix path name.
diff -r 1df8eaba0e60 -r c8712800dc87 Makefile.am
--- a/Makefile.am	Wed Dec 03 21:22:19 2008 +0100
+++ b/Makefile.am	Wed Dec 03 22:50:40 2008 +0100
@@ -1,6 +1,6 @@ OPENJDK_DATE = 05_nov_2008
-OPENJDK_DATE = 05_nov_2008
-OPENJDK_MD5SUM = eb9a408ac0215f3f0aa5c02fa86d5b30
-OPENJDK_VERSION = b13
+OPENJDK_DATE = 25_nov_2008
+OPENJDK_MD5SUM = 9f9773a822156dd3d576d83d794364ce
+OPENJDK_VERSION = b14
 
 CACAO_VERSION = 0.99.3
 CACAO_MD5SUM = 80de3ad344c1a20c086ec5f1390bd1b8
@@ -578,18 +578,7 @@ ICEDTEA_PATCHES = \
 	patches/icedtea-display-mode-changer.patch \
 	patches/icedtea-testenv.patch \
 	patches/icedtea-samejvm-safe.patch \
-	patches/icedtea-6728542-epoll.patch \
-	patches/security/icedtea-4486841.patch \
-        patches/security/icedtea-6484091.patch \
-        patches/security/icedtea-6497740.patch \
-        patches/security/icedtea-6588160.patch \
-        patches/security/icedtea-6592792.patch \
-        patches/security/icedtea-6721753.patch \
-        patches/security/icedtea-6726779.patch \
-        patches/security/icedtea-6733959.patch \
-        patches/security/icedtea-6734167.patch \
-        patches/security/icedtea-6755943.patch \
-        patches/security/icedtea-6766136.patch
+	patches/icedtea-6728542-epoll.patch
 
 if WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
diff -r 1df8eaba0e60 -r c8712800dc87 patches/icedtea-rhino.patch
--- a/patches/icedtea-rhino.patch	Wed Dec 03 21:22:19 2008 +0100
+++ b/patches/icedtea-rhino.patch	Wed Dec 03 22:50:40 2008 +0100
@@ -1,5 +1,26 @@
---- openjdk.orig/jdk/make/com/sun/Makefile	2008-06-22 18:53:03.000000000 +0200
-+++ openjdk/jdk/make/com/sun/Makefile	2008-06-22 18:56:41.000000000 +0200
+--- openjdk/hotspot/src/share/vm/runtime/os.cpp.orig	2008-11-22 00:11:18.000000000 +0000
++++ openjdk/hotspot/src/share/vm/runtime/os.cpp	2008-12-03 21:16:14.000000000 +0000
+@@ -886,6 +886,7 @@
+         "%/lib/jsse.jar:"
+         "%/lib/jce.jar:"
+         "%/lib/charsets.jar:"
++        "%/lib/rhino.jar:"
+         "%/classes";
+     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
+     if (sysclasspath == NULL) return false;
+--- openjdk/jdk/make/com/sun/script/Makefile.orig	2008-11-25 09:01:10.000000000 +0000
++++ openjdk/jdk/make/com/sun/script/Makefile	2008-12-03 21:13:14.000000000 +0000
+@@ -31,6 +31,8 @@
+ 
+ AUTO_FILES_JAVA_DIRS = com/sun/script
+ 
++OTHER_JAVACFLAGS = -classpath $(RHINO_JAR)
++
+ #
+ # Files that need to be copied
+ #
+--- openjdk/jdk/make/com/sun/Makefile.orig	2008-11-25 09:01:09.000000000 +0000
++++ openjdk/jdk/make/com/sun/Makefile	2008-12-03 21:14:36.000000000 +0000
 @@ -31,15 +31,8 @@
  PRODUCT = sun
  include $(BUILDDIR)/common/Defs.gmk
@@ -14,11 +35,54 @@
  # Omit mirror since it's built with the apt tool.
 -SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \
 +SUBDIRS = script image security crypto/provider jndi jmx \
-     java inputmethods org xml rowset net/httpserver net/ssl demo \
+     java inputmethods org rowset net/httpserver net/ssl demo \
      tools jarsigner
  
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2008-06-22 19:02:39.000000000 +0200
+--- openjdk/jdk/make/common/Release.gmk.orig	2008-12-03 21:12:23.000000000 +0000
++++ openjdk/jdk/make/common/Release.gmk	2008-12-03 21:13:14.000000000 +0000
+@@ -772,6 +772,7 @@
+ 	$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
+ 	$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
+ 	$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
++	$(LN) -sf $(RHINO_JAR) $(JRE_IMAGE_DIR)/lib/rhino.jar
+ 	@# Generate meta-index to make boot and extension class loaders lazier
+ 	$(CD) $(JRE_IMAGE_DIR)/lib && \
+ 	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2008-12-03 21:13:13.000000000 +0000
+@@ -25,7 +25,7 @@
+ 
+ package com.sun.script.javascript;
+ 
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ import javax.script.*;
+ 
+ /**
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2008-12-03 21:13:05.000000000 +0000
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ import javax.script.*;
+ import java.util.*;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ import com.sun.script.util.*;
+ 
+ /**
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2008-12-03 21:13:14.000000000 +0000
+@@ -24,7 +24,7 @@
+  */
+ 
+ package com.sun.script.javascript;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ import javax.script.*;
+ import java.util.*;
+ 
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	2008-12-03 21:13:05.000000000 +0000
 @@ -26,7 +26,7 @@
  package com.sun.script.javascript;
  import com.sun.script.util.*;
@@ -28,8 +92,30 @@
  import java.lang.reflect.Method;
  import java.io.*;
  import java.util.*;
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2008-06-22 19:02:49.000000000 +0200
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2008-12-03 21:13:05.000000000 +0000
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ 
+ import java.util.*;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ 
+ /**
+  * This class prevents script access to certain sensitive classes.
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2008-12-03 21:13:14.000000000 +0000
+@@ -26,7 +26,7 @@
+ package com.sun.script.javascript;
+ 
+ import javax.script.Invocable;
+-import sun.org.mozilla.javascript.internal.*;
++import org.mozilla.javascript.*;
+ 
+ /**
+  * This class implements Rhino-like JavaAdapter to help implement a Java
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JSAdapter.java	2008-12-03 21:13:05.000000000 +0000
 @@ -25,7 +25,7 @@
  
  package com.sun.script.javascript;
@@ -39,30 +125,19 @@
  import java.util.*;
  
  /**
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoClassShutter.java	2008-06-22 19:03:00.000000000 +0200
-@@ -26,7 +26,7 @@
- package com.sun.script.javascript;
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2008-12-03 21:13:14.000000000 +0000
+@@ -27,7 +27,7 @@
  
- import java.util.*;
+ import java.lang.reflect.*;
+ import static sun.security.util.SecurityConstants.*;
 -import sun.org.mozilla.javascript.internal.*;
 +import org.mozilla.javascript.*;
  
  /**
-  * This class prevents script access to certain sensitive classes.
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoScriptEngineFactory.java	2008-06-22 19:03:10.000000000 +0200
-@@ -26,7 +26,7 @@
- package com.sun.script.javascript;
- import javax.script.*;
- import java.util.*;
--import sun.org.mozilla.javascript.internal.*;
-+import org.mozilla.javascript.*;
- import com.sun.script.util.*;
- 
- /**
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2008-06-22 19:03:25.000000000 +0200
+  * This wrap factory is used for security reasons. JSR 223 script
+--- openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java.orig	2008-11-25 09:02:56.000000000 +0000
++++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoCompiledScript.java	2008-12-03 21:13:05.000000000 +0000
 @@ -25,7 +25,7 @@
  
  package com.sun.script.javascript;
@@ -72,78 +147,3 @@
  
  /**
   * Represents compiled JavaScript code.
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoTopLevel.java	2008-06-22 19:03:35.000000000 +0200
-@@ -25,7 +25,7 @@
- 
- package com.sun.script.javascript;
- 
--import sun.org.mozilla.javascript.internal.*;
-+import org.mozilla.javascript.*;
- import javax.script.*;
- 
- /**
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/RhinoWrapFactory.java	2008-06-22 19:03:48.000000000 +0200
-@@ -27,7 +27,7 @@
- 
- import java.lang.reflect.*;
- import static sun.security.util.SecurityConstants.*;
--import sun.org.mozilla.javascript.internal.*;
-+import org.mozilla.javascript.*;
- 
- /**
-  * This wrap factory is used for security reasons. JSR 223 script
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/JavaAdapter.java	2008-06-22 19:05:17.000000000 +0200
-@@ -26,7 +26,7 @@
- package com.sun.script.javascript;
- 
- import javax.script.Invocable;
--import sun.org.mozilla.javascript.internal.*;
-+import org.mozilla.javascript.*;
- 
- /**
-  * This class implements Rhino-like JavaAdapter to help implement a Java
---- openjdk.orig/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2008-06-22 18:52:46.000000000 +0200
-+++ openjdk/jdk/src/share/classes/com/sun/script/javascript/ExternalScriptable.java	2008-06-22 19:05:31.000000000 +0200
-@@ -24,7 +24,7 @@
-  */
- 
- package com.sun.script.javascript;
--import sun.org.mozilla.javascript.internal.*;
-+import org.mozilla.javascript.*;
- import javax.script.*;
- import java.util.*;
- 
---- openjdk.orig/jdk/make/com/sun/script/Makefile	2008-06-22 18:53:02.000000000 +0200
-+++ openjdk/jdk/make/com/sun/script/Makefile	2008-06-22 21:12:35.000000000 +0200
-@@ -31,6 +31,8 @@
- 
- AUTO_FILES_JAVA_DIRS = com/sun/script
- 
-+OTHER_JAVACFLAGS = -classpath $(RHINO_JAR)
-+
- #
- # Files that need to be copied
- #
---- openjdk.orig/jdk/make/common/Release.gmk	2008-06-22 18:53:02.000000000 +0200
-+++ openjdk/jdk/make/common/Release.gmk	2008-06-23 00:14:02.000000000 +0200
-@@ -772,6 +772,7 @@
- 	$(CP) $(RT_JAR) $(JRE_IMAGE_DIR)/lib/rt.jar
- 	$(CP) $(RESOURCES_JAR) $(JRE_IMAGE_DIR)/lib/resources.jar
- 	$(CP) $(JSSE_JAR) $(JRE_IMAGE_DIR)/lib/jsse.jar
-+	$(LN) -sf $(RHINO_JAR) $(JRE_IMAGE_DIR)/lib/rhino.jar
- 	@# Generate meta-index to make boot and extension class loaders lazier
- 	$(CD) $(JRE_IMAGE_DIR)/lib && \
- 	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
---- openjdk/hotspot/src/share/vm/runtime/os.cpp.orig	2008-06-23 00:17:03.000000000 +0200
-+++ openjdk/hotspot/src/share/vm/runtime/os.cpp	2008-06-22 22:34:33.000000000 +0200
-@@ -949,6 +949,7 @@
- 	"%/lib/jsse.jar:"
- 	"%/lib/jce.jar:"
-         "%/lib/charsets.jar:"
-+        "%/lib/rhino.jar:"
- 	"%/classes";
-     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
-     if (sysclasspath == NULL) return false;
diff -r 1df8eaba0e60 -r c8712800dc87 patches/security/icedtea-4486841.patch
--- a/patches/security/icedtea-4486841.patch	Wed Dec 03 21:22:19 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1234 +0,0 @@
---- old/src/share/classes/sun/nio/cs/UTF_8.java	Thu Oct  9 16:02:01 2008
-+++ openjdk/jdk/src/share/classes/sun/nio/cs/UTF_8.java	Thu Oct  9 16:02:01 2008
-@@ -1,5 +1,5 @@
- /*
-- * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
-+ * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
-  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-  *
-  * This code is free software; you can redistribute it and/or modify it
-@@ -25,34 +25,36 @@
- 
- package sun.nio.cs;
- 
-+import java.nio.Buffer;
- import java.nio.ByteBuffer;
- import java.nio.CharBuffer;
--import java.nio.BufferOverflowException;
--import java.nio.BufferUnderflowException;
- import java.nio.charset.Charset;
- import java.nio.charset.CharsetDecoder;
- import java.nio.charset.CharsetEncoder;
- import java.nio.charset.CoderResult;
--import java.nio.charset.CharacterCodingException;
--import java.nio.charset.MalformedInputException;
--import java.nio.charset.UnmappableCharacterException;
- 
--
--/*
-- * # Bits   Bit pattern
-- * 1    7   0xxxxxxx
-- * 2   11   110xxxxx 10xxxxxx
-- * 3   16   1110xxxx 10xxxxxx 10xxxxxx
-- * 4   21   11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-- * 5   26   111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
-- * 6   31   1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
-+/* Legal UTF-8 Byte Sequences
-  *
-- * UCS-2 uses 1-3, UTF-16 uses 1-4, UCS-4 uses 1-6
-+ * #    Code Points      Bits   Bit/Byte pattern
-+ * 1                     7      0xxxxxxx
-+ *      U+0000..U+007F          00..7F
-+ *
-+ * 2                     11     110xxxxx    10xxxxxx
-+ *      U+0080..U+07FF          C2..DF      80..BF
-+ *
-+ * 3                     16     1110xxxx    10xxxxxx    10xxxxxx
-+ *      U+0800..U+0FFF          E0          A0..BF      80..BF
-+ *      U+1000..U+FFFF          E1..EF      80..BF      80..BF
-+ *
-+ * 4                     21     11110xxx    10xxxxxx    10xxxxxx    10xxxxxx
-+ *     U+10000..U+3FFFF         F0          90..BF      80..BF      80..BF
-+ *     U+40000..U+FFFFF         F1..F3      80..BF      80..BF      80..BF
-+ *    U+100000..U10FFFF         F4          80..8F      80..BF      80..BF
-+ *
-  */
- 
- class UTF_8 extends Unicode
- {
--
-     public UTF_8() {
-         super("UTF-8", StandardCharsets.aliases_UTF_8);
-     }
-@@ -69,6 +71,11 @@
-         return new Encoder(this);
-     }
- 
-+    static final void updatePositions(Buffer src, int sp,
-+                                      Buffer dst, int dp) {
-+        src.position(sp - src.arrayOffset());
-+        dst.position(dp - dst.arrayOffset());
-+    }
- 
-     private static class Decoder extends CharsetDecoder {
-         private Decoder(Charset cs) {
-@@ -75,161 +82,182 @@
-             super(cs, 1.0f, 1.0f);
-         }
- 
--        private boolean isContinuation(int b) {
--            return ((b & 0xc0) == 0x80);
-+        private static boolean isNotContinuation(int b) {
-+            return (b & 0xc0) != 0x80;
-         }
- 
--        private final Surrogate.Generator sgg = new Surrogate.Generator();
-+        //  [C2..DF] [80..BF]
-+        private static boolean isMalformed2(int b1, int b2) {
-+            return (b1 & 0x1e) == 0x0 || (b2 & 0xc0) != 0x80;
-+        }
- 
-+        //  [E0]     [A0..BF] [80..BF]
-+        //  [E1..EF] [80..BF] [80..BF]
-+        private static boolean isMalformed3(int b1, int b2, int b3) {
-+            return (b1 == (byte)0xe0 && (b2 & 0xe0) == 0x80) ||
-+                   (b2 & 0xc0) != 0x80 || (b3 & 0xc0) != 0x80;
-+        }
-+
-+        //  [F0]     [90..BF] [80..BF] [80..BF]
-+        //  [F1..F3] [80..BF] [80..BF] [80..BF]
-+        //  [F4]     [80..8F] [80..BF] [80..BF]
-+        //  only check 80-be range here, the [0xf0,0x80...] and [0xf4,0x90-...]
-+        //  will be checked by Surrogate.neededFor(uc)
-+        private static boolean isMalformed4(int b2, int b3, int b4) {
-+            return (b2 & 0xc0) != 0x80 || (b3 & 0xc0) != 0x80 ||
-+                   (b4 & 0xc0) != 0x80;
-+        }
-+
-+        private static CoderResult lookupN(ByteBuffer src, int n)
-+        {
-+            for (int i = 1; i < n; i++) {
-+               if (isNotContinuation(src.get()))
-+                   return CoderResult.malformedForLength(i);
-+            }
-+            return CoderResult.malformedForLength(n);
-+        }
-+
-+        private static CoderResult malformedN(ByteBuffer src, int nb) {
-+            switch (nb) {
-+            case 1:
-+                int b1 = src.get();
-+                if ((b1 >> 2) == -2) {
-+                    // 5 bytes 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
-+                    if (src.remaining() < 4)
-+                        return CoderResult.UNDERFLOW;
-+                    return lookupN(src, 5);
-+                }
-+                if ((b1 >> 1) == -2) {
-+                    // 6 bytes 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
-+                    if (src.remaining() < 5)
-+                        return CoderResult.UNDERFLOW;
-+                    return lookupN(src, 6);
-+                }
-+                return CoderResult.malformedForLength(1);
-+            case 2:                    // always 1
-+                return CoderResult.malformedForLength(1);
-+            case 3:
-+                b1 = src.get();
-+                int b2 = src.get();    // no need to lookup b3
-+                return CoderResult.malformedForLength(
-+                    ((b1 == (byte)0xe0 && (b2 & 0xe0) == 0x80) ||
-+                     isNotContinuation(b2))?1:2);
-+            case 4:  // we don't care the speed here
-+                b1 = src.get() & 0xff;
-+                b2 = src.get() & 0xff;
-+                if (b1 > 0xf4 ||
-+                    (b1 == 0xf0 && (b2 < 0x90 || b2 > 0xbf)) ||
-+                    (b1 == 0xf4 && (b2 & 0xf0) != 0x80) ||
-+                    isNotContinuation(b2))
-+                    return CoderResult.malformedForLength(1);
-+                if (isNotContinuation(src.get()))
-+                    return CoderResult.malformedForLength(2);
-+                return CoderResult.malformedForLength(3);
-+            default:
-+                assert false;
-+                return null;
-+            }
-+        }
-+
-+        private static CoderResult malformed(ByteBuffer src, int sp,
-+                                             CharBuffer dst, int dp,
-+                                             int nb)
-+        {
-+            src.position(sp - src.arrayOffset());
-+            CoderResult cr = malformedN(src, nb);
-+            updatePositions(src, sp, dst, dp);
-+            return cr;
-+        }
-+
-+        private static CoderResult malformed(ByteBuffer src,
-+                                             int mark, int nb)
-+        {
-+            src.position(mark);
-+            CoderResult cr = malformedN(src, nb);
-+            src.position(mark);
-+            return cr;
-+        }
-+
-+        private static CoderResult xflow(Buffer src, int sp, int sl,
-+                                         Buffer dst, int dp, int nb) {
-+            updatePositions(src, sp, dst, dp);
-+            return (nb == 0 || sl - sp < nb)
-+                   ?CoderResult.UNDERFLOW:CoderResult.OVERFLOW;
-+        }
-+
-+        private static CoderResult xflow(Buffer src, int mark, int nb) {
-+            CoderResult cr = (nb == 0 || src.remaining() < (nb - 1))
-+                             ?CoderResult.UNDERFLOW:CoderResult.OVERFLOW;
-+            src.position(mark);
-+            return cr;
-+        }
-+
-         private CoderResult decodeArrayLoop(ByteBuffer src,
-                                             CharBuffer dst)
-         {
-+            // This method is optimized for ASCII input.
-             byte[] sa = src.array();
-             int sp = src.arrayOffset() + src.position();
-             int sl = src.arrayOffset() + src.limit();
--            assert (sp <= sl);
--            sp = (sp <= sl ? sp : sl);
-+
-             char[] da = dst.array();
-             int dp = dst.arrayOffset() + dst.position();



More information about the distro-pkg-dev mailing list