/hg/release/icedtea6-1.2: Add last two batches of security patches.

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Mon Mar 29 14:01:07 PDT 2010


changeset 2b66e5f1a1de in /hg/release/icedtea6-1.2
details: http://icedtea.classpath.org/hg/release/icedtea6-1.2?cmd=changeset;node=2b66e5f1a1de
author: andrew
date: Mon Mar 29 22:00:07 2010 +0100

	Add last two batches of security patches.


diffstat:

45 files changed, 11325 insertions(+), 37 deletions(-)
Makefile.am                   |   45 +
Makefile.in                   |  129 ++-
patches/icedtea-4486841.patch |  838 +++++++++++++++++++++
patches/icedtea-6484091.patch |   86 ++
patches/icedtea-6497740.patch |  773 +++++++++++++++++++
patches/icedtea-6536193.patch |  102 ++
patches/icedtea-6588160.patch |   42 +
patches/icedtea-6592792.patch |  228 +++++
patches/icedtea-6610888.patch |   58 +
patches/icedtea-6610896.patch |  189 ++++
patches/icedtea-6630639.patch |   31 
patches/icedtea-6631533.patch |  184 ++++
patches/icedtea-6632445.patch |  103 ++
patches/icedtea-6632886.patch |  502 ++++++++++++
patches/icedtea-6636360.patch |   66 +
patches/icedtea-6636650.patch |  137 +++
patches/icedtea-6652463.patch |   28 
patches/icedtea-6656633.patch |   51 +
patches/icedtea-6657026.patch | 1609 +++++++++++++++++++++++++++++++++++++++++
patches/icedtea-6657138.patch |  729 ++++++++++++++++++
patches/icedtea-6658158.patch |  815 ++++++++++++++++++++
patches/icedtea-6664512.patch | 1194 ++++++++++++++++++++++++++++++
patches/icedtea-6691246.patch |  166 ++++
patches/icedtea-6717680.patch |   27 
patches/icedtea-6721651.patch |  735 ++++++++++++++++++
patches/icedtea-6721753.patch |   88 ++
patches/icedtea-6726779.patch |   67 +
patches/icedtea-6733959.patch |   19 
patches/icedtea-6734167.patch |   89 ++
patches/icedtea-6737315.patch |   44 +
patches/icedtea-6755943.patch |  245 ++++++
patches/icedtea-6766136.patch |  189 ++++
patches/icedtea-6792554.patch |  415 ++++++++++
patches/icedtea-6804996.patch |   75 +
patches/icedtea-6804997.patch |   31 
patches/icedtea-6804998.patch |   35 
patches/icedtea-6822057.patch |   32 
patches/icedtea-6824265.patch |  120 +++
patches/icedtea-6861062.patch |  341 ++++++++
patches/icedtea-6862968.patch |   60 +
patches/icedtea-6863503.patch |   33 
patches/icedtea-6864911.patch |  422 ++++++++++
patches/icedtea-6872357.patch |   17 
patches/icedtea-6872358.patch |  157 ++++
patches/icedtea-6874643.patch |   16 

diffs (truncated from 11729 to 500 lines):

diff -r 871b70407a13 -r 2b66e5f1a1de Makefile.am
--- a/Makefile.am	Wed May 28 11:07:23 2008 -0400
+++ b/Makefile.am	Mon Mar 29 22:00:07 2010 +0100
@@ -315,6 +315,49 @@ ICEDTEA_PATCHES = \
 	patches/icedtea-hat-spl-gpl.patch \
 	patches/icedtea-sparc.patch \
 	patches/icedtea-override-redirect-metacity.patch \
+	patches/icedtea-4486841.patch \
+	patches/icedtea-6484091.patch \
+	patches/icedtea-6497740.patch \
+	patches/icedtea-6536193.patch \
+	patches/icedtea-6588160.patch \
+	patches/icedtea-6592792.patch \
+	patches/icedtea-6610888.patch \
+	patches/icedtea-6610896.patch \
+	patches/icedtea-6630639.patch \
+	patches/icedtea-6632886.patch \
+	patches/icedtea-6636360.patch \
+	patches/icedtea-6652463.patch \
+	patches/icedtea-6656633.patch \
+	patches/icedtea-6658158.patch \
+	patches/icedtea-6691246.patch \
+	patches/icedtea-6717680.patch \
+	patches/icedtea-6721651.patch \
+	patches/icedtea-6721753.patch \
+	patches/icedtea-6726779.patch \
+	patches/icedtea-6733959.patch \
+	patches/icedtea-6734167.patch \
+	patches/icedtea-6737315.patch \
+	patches/icedtea-6755943.patch \
+	patches/icedtea-6766136.patch \
+	patches/icedtea-6792554.patch \
+	patches/icedtea-6804996.patch \
+	patches/icedtea-6804997.patch \
+	patches/icedtea-6804998.patch \
+	patches/icedtea-6824265.patch \
+       patches/icedtea-6632445.patch \
+       patches/icedtea-6636650.patch \
+       patches/icedtea-6657026.patch \
+       patches/icedtea-6657138.patch \
+       patches/icedtea-6822057.patch \
+       patches/icedtea-6631533.patch \
+       patches/icedtea-6861062.patch \
+       patches/icedtea-6862968.patch \
+       patches/icedtea-6863503.patch \
+       patches/icedtea-6864911.patch \
+       patches/icedtea-6872357.patch \
+       patches/icedtea-6872358.patch \
+	patches/icedtea-6664512.patch \
+       patches/icedtea-6874643.patch \
 	$(GCC_PATCH) \
 	$(DISTRIBUTION_PATCHES)
 
@@ -342,7 +385,7 @@ stamps/patch.stamp: stamps/extract.stamp
 	do \
 	  if test x$${all_patches_ok} == "xyes" \
 	     && echo Checking $$p \
-	     && $(PATCH) -l -p0 --dry-run -s -t -f -F 0 < $$p ; \
+	     && $(PATCH) -l -p0 --dry-run -s -t -f < $$p ; \
 	  then \
 	    echo Applying $$p ; \
 	    $(PATCH) -l -p0 < $$p ; \
diff -r 871b70407a13 -r 2b66e5f1a1de Makefile.in
--- a/Makefile.in	Wed May 28 11:07:23 2008 -0400
+++ b/Makefile.in	Mon Mar 29 22:00:07 2010 +0100
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,8 +16,9 @@
 @SET_MAKE@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -70,15 +72,16 @@ am__CONFIG_DISTCLEAN_FILES = config.stat
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_CLEAN_FILES = javac javap platform_zero jvm.cfg ergo.c
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
+  { test ! -d "$(distdir)" \
+    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr "$(distdir)"; }; }
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
@@ -247,6 +250,7 @@ srcdir = @srcdir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 OPENJDK_DATE = 11_apr_2008
@@ -417,7 +421,29 @@ ICEDTEA_PATCHES = $(ZERO_PATCHES_COND) \
 	patches/icedtea-fonts.patch patches/icedtea-gervill.patch \
 	patches/icedtea-directaudio-close-trick.patch \
 	patches/icedtea-hat-spl-gpl.patch patches/icedtea-sparc.patch \
-	patches/icedtea-override-redirect-metacity.patch $(GCC_PATCH) \
+	patches/icedtea-override-redirect-metacity.patch \
+	patches/icedtea-4486841.patch patches/icedtea-6484091.patch \
+	patches/icedtea-6497740.patch patches/icedtea-6536193.patch \
+	patches/icedtea-6588160.patch patches/icedtea-6592792.patch \
+	patches/icedtea-6610888.patch patches/icedtea-6610896.patch \
+	patches/icedtea-6630639.patch patches/icedtea-6632886.patch \
+	patches/icedtea-6636360.patch patches/icedtea-6652463.patch \
+	patches/icedtea-6656633.patch patches/icedtea-6658158.patch \
+	patches/icedtea-6691246.patch patches/icedtea-6717680.patch \
+	patches/icedtea-6721651.patch patches/icedtea-6721753.patch \
+	patches/icedtea-6726779.patch patches/icedtea-6733959.patch \
+	patches/icedtea-6734167.patch patches/icedtea-6737315.patch \
+	patches/icedtea-6755943.patch patches/icedtea-6766136.patch \
+	patches/icedtea-6792554.patch patches/icedtea-6804996.patch \
+	patches/icedtea-6804997.patch patches/icedtea-6804998.patch \
+ 	patches/icedtea-6824265.patch patches/icedtea-6632445.patch \
+	patches/icedtea-6636650.patch patches/icedtea-6657026.patch \
+	patches/icedtea-6657138.patch patches/icedtea-6822057.patch \
+	patches/icedtea-6631533.patch patches/icedtea-6861062.patch \
+	patches/icedtea-6862968.patch patches/icedtea-6863503.patch \
+	patches/icedtea-6864911.patch patches/icedtea-6872357.patch \
+	patches/icedtea-6872358.patch patches/icedtea-6664512.patch \
+	patches/icedtea-6874643.patch $(GCC_PATCH) \
 	$(DISTRIBUTION_PATCHES) $(am__append_7)
 
 # Patch OpenJDK for plug replacements and ecj.
@@ -478,15 +504,15 @@ am--refresh:
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
-	      cd $(srcdir) && $(AUTOMAKE) --gnu  \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
 		&& exit 0; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -502,9 +528,10 @@ Makefile: $(srcdir)/Makefile.in $(top_bu
 	$(SHELL) ./config.status --recheck
 
 $(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(srcdir) && $(AUTOCONF)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
 javac: $(top_builddir)/config.status $(srcdir)/javac.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 javap: $(top_builddir)/config.status $(srcdir)/javap.in
@@ -524,7 +551,7 @@ CTAGS:
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
-	test -d $(distdir) || mkdir $(distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -540,21 +567,26 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
 	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
-	|| chmod -R a+r $(distdir)
+	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
 	$(am__remove_distdir)
@@ -565,6 +597,10 @@ dist-bzip2: distdir
 
 dist-lzma: distdir
 	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
 	$(am__remove_distdir)
 
 dist-tarZ: distdir
@@ -595,6 +631,8 @@ distcheck: dist
 	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lzma*) \
 	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
@@ -606,9 +644,11 @@ distcheck: dist
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-	  && cd $(distdir)/_build \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
@@ -630,13 +670,15 @@ distcheck: dist
 	  && rm -rf "$$dc_destdir" \
 	  && $(MAKE) $(AM_MAKEFLAGS) dist \
 	  && rm -rf $(DIST_ARCHIVES) \
-	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
 	$(am__remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@cd $(distuninstallcheck_dir) \
+	@$(am__cd) '$(distuninstallcheck_dir)' \
 	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
@@ -677,6 +719,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -694,6 +737,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -702,17 +747,27 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
+
+install-info-am:
 
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
+
+install-ps-am:
 
 installcheck-am:
 
@@ -736,20 +791,21 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
 
 .PHONY: all all-am all-local am--refresh check check-am check-local \
 	clean clean-generic dist dist-all dist-bzip2 dist-gzip \
-	dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
-	distclean-generic distclean-local distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
+	dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
+	distclean distclean-generic distclean-local distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+	uninstall-am
 
 
 # Top-Level Targets
@@ -848,7 +904,7 @@ stamps/patch.stamp: stamps/extract.stamp
 	do \
 	  if test x$${all_patches_ok} == "xyes" \
 	     && echo Checking $$p \
-	     && $(PATCH) -l -p0 --dry-run -s -t -f -F 0 < $$p ; \
+	     && $(PATCH) -l -p0 --dry-run -s -t -f < $$p ; \
 	  then \
 	    echo Applying $$p ; \
 	    $(PATCH) -l -p0 < $$p ; \
@@ -1460,6 +1516,7 @@ clean: distclean-local
 clean: distclean-local
 
 jtreg: stamps/jtreg.stamp
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff -r 871b70407a13 -r 2b66e5f1a1de patches/icedtea-4486841.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-4486841.patch	Mon Mar 29 22:00:07 2010 +0100
@@ -0,0 +1,838 @@
+--- 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) {



More information about the distro-pkg-dev mailing list