# HG changeset patch # User mchung # Date 1352774696 28800 # Node ID 6cb58c62c5fe0396e4ffb4e92300417030f28158 # Parent 8adc970057f1c4874c6f27454e6cfbbe1cc93425# Parent 27ab79568c34abf80958d5fa8c04fd1740d243da Merge diff -r 8adc970057f1 -r 6cb58c62c5fe .hgtags --- a/.hgtags Tue Jul 24 16:13:34 2012 +0100 +++ b/.hgtags Mon Nov 12 18:44:56 2012 -0800 @@ -176,3 +176,18 @@ 300f45e990643af230d6cca39477ff62c44a9a54 jdk8-b46 404521944ac9383afda7d55d60713b212c730646 jdk8-b47 1c88da9a1365797e49be77ae42c34bbc0a3c3f0c jdk8-b48 +f81e981eca7b63316cf9d778f93903a4fc62161d jdk8-b49 +2791ec55f66b57a702349c649567a391e6301f4e jdk8-b50 +dc1ea77ed9d9746e0f98bb1268987c3596c8b4b5 jdk8-b51 +bd3c00d5761408954cc29ffb82016a76cbc90b43 jdk8-b52 +2c566f25c39f0087464b73e3bcf1c1421d0f2a7e jdk8-b53 +7dd81ccb7c1134df70969b3068b1e98def701746 jdk8-b54 +7c2363666890c6675194948fbcd74d81ddb84298 jdk8-b55 +f19d63b2119a0092f016203981ffef5cc31bc3c5 jdk8-b56 +7c9475c7618cb131bcd7470f859bf43c5e5f9905 jdk8-b57 +1cb19abb3f7b40bf233b349cd2f51f02d37a9f5b jdk8-b58 +af9e8b0f1900b631a8a0fcccff9f1514fe58c808 jdk8-b59 +2d1dff5310daaf226421a8c92823cb8afcf35f31 jdk8-b60 +6b1db0b41d2f6e2a7b3bdbc8a8db823b47752906 jdk8-b61 +5d0fa0108d028c05753a47bcf2a598357dabf0c0 jdk8-b62 +192d8a244bc36427757866e9fb3a08938c0e674c jdk8-b63 diff -r 8adc970057f1 -r 6cb58c62c5fe makefiles/BuildJaxp.gmk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makefiles/BuildJaxp.gmk Mon Nov 12 18:44:56 2012 -0800 @@ -0,0 +1,61 @@ +# +# Copyright (c) 2007, 2012, Oracle and/or its affiliates. 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This must be the first rule +default: all + +-include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk + +JAVAC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" \ + -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar +DISABLE_JAXP_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough + +# The generate new bytecode uses the new compiler for to generate bytecode +# for the new jdk that is being built. The code compiled by this setup +# cannot necessarily be run with the boot jdk. +$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG,\ + JVM:=$(JAVA),\ + JAVAC:=$(JAVAC_JARS),\ + FLAGS:=-XDignore.symbol.file=true $(DISABLE_JAXP_WARNINGS) -g,\ + SERVER_DIR:=$(SJAVAC_SERVER_DIR),\ + SERVER_JVM:=$(SJAVAC_SERVER_JAVA))) + +$(eval $(call SetupJavaCompilation,BUILD_JAXP,\ + SETUP:=GENERATE_NEWBYTECODE_DEBUG,\ + SRC:=$(JAXP_TOPDIR)/src,\ + CLEAN:=.properties,\ + BIN:=$(JAXP_OUTPUTDIR)/classes,\ + SRCZIP:=$(JAXP_OUTPUTDIR)/dist/lib/src.zip)) + +$(eval $(call SetupArchive,ARCHIVE_JAXP,$(BUILD_JAXP),\ + SRCS:=$(JAXP_OUTPUTDIR)/classes,\ + SUFFIXES:=.class .properties,\ + JAR:=$(JAXP_OUTPUTDIR)/dist/lib/classes.jar)) + +all: $(JAXP_OUTPUTDIR)/dist/lib/classes.jar $(JAXP_OUTPUTDIR)/dist/lib/src.zip + +.PHONY: default all diff -r 8adc970057f1 -r 6cb58c62c5fe makefiles/Makefile --- a/makefiles/Makefile Tue Jul 24 16:13:34 2012 +0100 +++ b/makefiles/Makefile Mon Nov 12 18:44:56 2012 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, Oracle and/or its affiliates. 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 @@ -23,41 +23,27 @@ # questions. # -# This must be the first rule -default: all +# Locate this Makefile +ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) + makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) +else + makefile_path:=$(lastword $(MAKEFILE_LIST)) +endif +repo_dir:=$(patsubst %/makefiles/Makefile,%,$(makefile_path)) --include $(SPEC) -include MakeBase.gmk -include JavaCompilation.gmk - -JAVAC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" \ - -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar -DISABLE_JAXP_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough +# What is the name of this subsystem (langtools, corba, etc)? +subsystem_name:=$(notdir $(repo_dir)) -# The generate new bytecode uses the new compiler for to generate bytecode -# for the new jdk that is being built. The code compiled by this setup -# cannot necessarily be run with the boot jdk. -$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG,\ - JVM:=$(JAVA),\ - JAVAC:=$(JAVAC_JARS),\ - FLAGS:=-Xprefer:source -XDignore.symbol.file=true $(DISABLE_JAXP_WARNINGS) -g,\ - SERVER_DIR:=$(JAVAC_SERVERS),\ - SERVER_JVM:=$(SERVER_JAVA),\ - MODE:=$(JAVAC_USE_MODE),\ - USE_DEPS:=$(JAVAC_USE_DEPS))) +# Try to locate top-level makefile +top_level_makefile:=$(repo_dir)/../common/makefiles/Makefile +ifneq ($(wildcard $(top_level_makefile)),) + $(info Will run $(subsystem_name) target on top-level Makefile) + $(info WARNING: This is a non-recommended way of building!) + $(info ===================================================) +else + $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?) + $(error Build from top-level Makefile instead) +endif -$(eval $(call SetupJavaCompilation,BUILD_JAXP,\ - SETUP:=GENERATE_NEWBYTECODE_DEBUG,\ - SRC:=$(JAXP_TOPDIR)/src,\ - CLEAN:=.properties,\ - BIN:=$(JAXP_OUTPUTDIR)/classes,\ - SRCZIP:=$(JAXP_OUTPUTDIR)/dist/lib/src.zip)) - -$(eval $(call SetupArchive,ARCHIVE_JAXP,$(BUILD_JAXP),\ - SRCS:=$(JAXP_OUTPUTDIR)/classes,\ - SUFFIXES:=.class .properties,\ - JAR:=$(JAXP_OUTPUTDIR)/dist/lib/classes.jar)) - -all: $(JAXP_OUTPUTDIR)/dist/lib/classes.jar $(JAXP_OUTPUTDIR)/dist/lib/src.zip - -.PHONY: default all +all: + @$(MAKE) -f $(top_level_makefile) $(subsystem_name) diff -r 8adc970057f1 -r 6cb58c62c5fe src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java --- a/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Tue Jul 24 16:13:34 2012 +0100 +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Mon Nov 12 18:44:56 2012 -0800 @@ -806,6 +806,7 @@ * where the entity encoding is not auto-detected (e.g. * internal entities or a document entity that is * parsed from a java.io.Reader). + * @param augs Additional information that may include infoset augmentations * * @throws XNIException Thrown by handler to signal an error. */ @@ -833,7 +834,7 @@ // call handler if (fDocumentHandler != null && !fScanningAttribute) { if (!name.equals("[xml]")) { - fDocumentHandler.startGeneralEntity(name, identifier, encoding, null); + fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs); } } @@ -845,6 +846,7 @@ * are just specified by their name. * * @param name The name of the entity. + * @param augs Additional information that may include infoset augmentations * * @throws XNIException Thrown by handler to signal an error. */ @@ -869,7 +871,7 @@ // call handler if (fDocumentHandler != null && !fScanningAttribute) { if (!name.equals("[xml]")) { - fDocumentHandler.endGeneralEntity(name, null); + fDocumentHandler.endGeneralEntity(name, augs); } } diff -r 8adc970057f1 -r 6cb58c62c5fe src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java --- a/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java Tue Jul 24 16:13:34 2012 +0100 +++ b/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java Mon Nov 12 18:44:56 2012 -0800 @@ -602,7 +602,7 @@ if (reader == null) { stream = xmlInputSource.getByteStream(); if (stream == null) { - URL location = new URL(escapeNonUSAscii(expandedSystemId)); + URL location = new URL(expandedSystemId); URLConnection connect = location.openConnection(); if (!(connect instanceof HttpURLConnection)) { stream = connect.getInputStream(); @@ -2586,76 +2586,6 @@ } // fixURI(String):String - /** - * Escape invalid URI characters. - * - * Passed a URI that contains invalid characters (like spaces, non-ASCII Unicode characters, and the like), - * this function percent encodes the invalid characters per the URI specification (i.e., as a sequence of - * %-encoded UTF-8 octets). - * - * N.B. There are two problems. If the URI contains a '%' character, that might be an indication that - * the URI has already been escaped by the author, or it might be an invalid '%'. In the former case, - * it's important not to escape it, or we'll wind up with invalid, doubly-escaped '%'s. In the latter, - * the URI is broken if we don't encode it. Similarly, a '#' character might be the start of a fragment - * identifier or it might be an invalid '#'. - * - * Given that the former is vastly more likely than the latter in each case (most users are familiar with - * the magic status of '%' and '#' and they occur relatively infrequently in filenames, and if the user parses - * a proper Java File, we will already have %-escaped the URI), we simply assume that %'s and #'s are legit. - * - * Very rarely, we may be wrong. If so, tell the user to fix the clearly broken URI. - */ - protected static String escapeNonUSAscii(String str) { - if (str == null) { - return str; - } - int len = str.length(), i=0, ch; - for (; i < len; i++) { - ch = str.charAt(i); - // if it's not an ASCII 7 character, break here, and use UTF-8 encoding - if (ch >= 128) - break; - } - - // we saw no non-ascii-7 character - if (i == len) { - return str; - } - - // get UTF-8 bytes for the string - StringBuffer buffer = new StringBuffer(); - byte[] bytes = null; - byte b; - try { - bytes = str.getBytes("UTF-8"); - } catch (java.io.UnsupportedEncodingException e) { - // should never happen - return str; - } - - len = bytes.length; - - // for each byte - for (i = 0; i < len; i++) { - b = bytes[i]; - // for non-ascii character: make it positive, then escape - if (b < 0) { - ch = b + 256; - buffer.append('%'); - buffer.append(gHexChs[ch >> 4]); - buffer.append(gHexChs[ch & 0xf]); - } - else if (b != '%' && b != '#' && gNeedEscaping[b]) { - buffer.append('%'); - buffer.append(gAfterEscaping1[b]); - buffer.append(gAfterEscaping2[b]); - } - else { - buffer.append((char)b); - } - } - return buffer.toString(); - } // // Package visible methods diff -r 8adc970057f1 -r 6cb58c62c5fe src/javax/xml/stream/XMLEventFactory.java --- a/src/javax/xml/stream/XMLEventFactory.java Tue Jul 24 16:13:34 2012 +0100 +++ b/src/javax/xml/stream/XMLEventFactory.java Mon Nov 12 18:44:56 2012 -0800 @@ -49,6 +49,10 @@ public abstract class XMLEventFactory { protected XMLEventFactory(){} + static final String JAXPFACTORYID = "javax.xml.stream.XMLEventFactory"; + static final String DEFAULIMPL = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl"; + + /** * Create a new instance of the factory * @throws FactoryConfigurationError if an instance of this factory cannot be loaded @@ -57,8 +61,8 @@ throws FactoryConfigurationError { return (XMLEventFactory) FactoryFinder.find( - "javax.xml.stream.XMLEventFactory", - "com.sun.xml.internal.stream.events.XMLEventFactoryImpl"); + JAXPFACTORYID, + DEFAULIMPL); } /** @@ -90,8 +94,8 @@ throws FactoryConfigurationError { return (XMLEventFactory) FactoryFinder.find( - "javax.xml.stream.XMLEventFactory", - "com.sun.xml.internal.stream.events.XMLEventFactoryImpl"); + JAXPFACTORYID, + DEFAULIMPL); } /** @@ -114,7 +118,7 @@ throws FactoryConfigurationError { try { //do not fallback if given classloader can't find the class, throw exception - return (XMLEventFactory) FactoryFinder.newInstance(factoryId, classLoader, false); + return (XMLEventFactory) FactoryFinder.find(factoryId, classLoader, null); } catch (FactoryFinder.ConfigurationError e) { throw new FactoryConfigurationError(e.getException(), e.getMessage()); @@ -141,7 +145,7 @@ throws FactoryConfigurationError { try { //do not fallback if given classloader can't find the class, throw exception - return (XMLEventFactory) FactoryFinder.newInstance(factoryId, classLoader, false); + return (XMLEventFactory) FactoryFinder.find(factoryId, classLoader, null); } catch (FactoryFinder.ConfigurationError e) { throw new FactoryConfigurationError(e.getException(), e.getMessage());