From general-return-2285-archive-asf-public=cust-asf.ponee.io@attic.apache.org Mon Jun 4 20:36:01 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B6675180636 for ; Mon, 4 Jun 2018 20:35:59 +0200 (CEST) Received: (qmail 31050 invoked by uid 500); 4 Jun 2018 18:35:58 -0000 Mailing-List: contact general-help@attic.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@attic.apache.org Delivered-To: mailing list general@attic.apache.org Received: (qmail 31039 invoked by uid 99); 4 Jun 2018 18:35:58 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2018 18:35:58 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 040883A00E7 for ; Mon, 4 Jun 2018 18:35:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1832877 - in /xmlbeans/trunk: ./ external/lib/ samples/AbstractTypes/ samples/Any/ samples/DateTime/ samples/MixedContent/ samples/OrderMatters/ samples/SampleTemplate/ samples/SchemaEnum/ samples/SubstitutionGroup/ samples/Validation/ sam... Date: Mon, 04 Jun 2018 18:35:57 -0000 To: general@attic.apache.org From: fanningpj@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20180604183558.040883A00E7@svn01-us-west.apache.org> Author: fanningpj Date: Mon Jun 4 18:35:56 2018 New Revision: 1832877 URL: http://svn.apache.org/viewvc?rev=1832877&view=rev Log: reverse recent commits Added: xmlbeans/trunk/external/lib/piccolo.LICENSE.txt - copied unchanged from r1832297, xmlbeans/trunk/external/lib/piccolo.LICENSE.txt xmlbeans/trunk/external/lib/piccolo_apache_dist_20040629.jar - copied unchanged from r1832297, xmlbeans/trunk/external/lib/piccolo_apache_dist_20040629.jar xmlbeans/trunk/external/lib/piccolo_apache_dist_20040629_v2.jar - copied unchanged from r1832297, xmlbeans/trunk/external/lib/piccolo_apache_dist_20040629_v2.jar xmlbeans/trunk/external/lib/piccolo_apache_dist_20040711.jar - copied unchanged from r1832297, xmlbeans/trunk/external/lib/piccolo_apache_dist_20040711.jar xmlbeans/trunk/external/lib/piccolo_apache_dist_20040711_v2.jar - copied unchanged from r1832297, xmlbeans/trunk/external/lib/piccolo_apache_dist_20040711_v2.jar xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/ConcurrentReaderHashMap.java - copied unchanged from r1832650, xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/ConcurrentReaderHashMap.java xmlbeans/trunk/src/store/org/w3c/ - copied from r1832297, xmlbeans/trunk/src/store/org/w3c/ xmlbeans/trunk/src/xmlpublic/javax/ - copied from r1832297, xmlbeans/trunk/src/xmlpublic/javax/ Removed: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/NullLogger.java xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/SAXHelper.java xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/XBLogFactory.java xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/XBLogger.java Modified: xmlbeans/trunk/CHANGES.txt xmlbeans/trunk/build.xml xmlbeans/trunk/samples/AbstractTypes/build.xml xmlbeans/trunk/samples/Any/build.xml xmlbeans/trunk/samples/DateTime/build.xml xmlbeans/trunk/samples/MixedContent/build.xml xmlbeans/trunk/samples/OrderMatters/build.xml xmlbeans/trunk/samples/SampleTemplate/build.xml xmlbeans/trunk/samples/SchemaEnum/build.xml xmlbeans/trunk/samples/SubstitutionGroup/build.xml xmlbeans/trunk/samples/Validation/build.xml xmlbeans/trunk/samples/XQueryXPath/build.xml xmlbeans/trunk/samples/XmlSort/build.xml xmlbeans/trunk/samples/XmlTree/build.xml xmlbeans/trunk/samples/XsdConfig/build.xml xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Locale.java xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java xmlbeans/trunk/test/perf/build.xml xmlbeans/trunk/test/src/xmlcursor/checkin/StoreTests.java xmlbeans/trunk/test/src/xmlobject/checkin/AssortedTests.java xmlbeans/trunk/test/src/xmlobject/checkin/CDataTest.java xmlbeans/trunk/testbuild.xml Modified: xmlbeans/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/xmlbeans/trunk/CHANGES.txt?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/CHANGES.txt (original) +++ xmlbeans/trunk/CHANGES.txt Mon Jun 4 18:35:56 2018 @@ -1,21 +1,9 @@ -Changes in V2.7.0 since V2.6.0 - -* XMLBEANS-516: remove unnecessary javax and org.w3c classes -* XMLBEANS-515: remove piccolo support -* XMLBEANS-514: make java 6 the lowest supported runtime -* Fix for XMLBEANS-499: xmlbeans2.6.0.jar contains duplicate class files (causes issues -on Android) -* XMLBEANS-447: Drop the ConcurrentReaderHashMap source code -* Fix for XMLBEANS-404: entitizeContent CDATA loop iterating too many times (causes -assertion error or ArrayIndexOutOfBoundsException in replace) -* Fix for XMLBEANS-332: XMLBeans changes surrogate pair bytes to question marks - Changes in V2.6.0 since V2.5.0 * Add new xml option CopyUseNewSynchronizationDomain used for copy. This fixes the scenario when copy and access (ex. selectPath) are used in a multithreading environment. -* Entitize \r when not in pretty print, this helps with maintaining \r +* Entitize \r when not in pretty print, this helps with maintainig \r entities. * Fix validation of integer value containing dot char. * Fix chars in comments to avoid errors in IntelliJ under linux. Modified: xmlbeans/trunk/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/build.xml (original) +++ xmlbeans/trunk/build.xml Mon Jun 4 18:35:56 2018 @@ -15,11 +15,11 @@ --> - - - + + + - + @@ -114,7 +114,7 @@ http://easynews.dl.sourceforge.net/sourceforge/saxon/saxonb8-8j.zip --> @@ -128,6 +128,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -320,8 +353,12 @@ + + + + @@ -451,8 +488,8 @@ store.classes, saaj_api.classes, marshal.classes, xpath.classes, oldxbean.jar, xsdschema.classes, xmlinputstream.classes, resolver.jar, xbean_xpath.jar, - tools.classes, jamsupport.classes"> - + piccolo.classes, tools.classes, jamsupport.classes"> + @@ -472,6 +509,7 @@ + @@ -485,6 +523,10 @@ + + + @@ -503,10 +545,12 @@ - + - + + + @@ -542,6 +586,7 @@ + @@ -552,10 +597,11 @@ - + + @@ -593,7 +639,7 @@ + configschema.classes, toolschema.classes, jsr173_1.0.jars, jam.classes"> @@ -609,6 +655,7 @@ + @@ -634,6 +681,7 @@ + @@ -643,17 +691,17 @@ - - + + @@ -690,15 +738,17 @@ + depends="dirs, common.classes, xmlpublic.classes, typestore.classes, saaj_api.classes, piccolo.classes"> + + @@ -706,16 +756,18 @@ + + @@ -732,11 +784,13 @@ + + @@ -780,7 +834,7 @@ - + @@ -865,6 +919,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: xmlbeans/trunk/samples/AbstractTypes/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/AbstractTypes/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/AbstractTypes/build.xml (original) +++ xmlbeans/trunk/samples/AbstractTypes/build.xml Mon Jun 4 18:35:56 2018 @@ -70,7 +70,7 @@ - + Modified: xmlbeans/trunk/samples/Any/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/Any/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/Any/build.xml (original) +++ xmlbeans/trunk/samples/Any/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="Any.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/DateTime/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/DateTime/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/DateTime/build.xml (original) +++ xmlbeans/trunk/samples/DateTime/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="DateTime.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/MixedContent/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/MixedContent/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/MixedContent/build.xml (original) +++ xmlbeans/trunk/samples/MixedContent/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="MixedContent.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/OrderMatters/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/OrderMatters/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/OrderMatters/build.xml (original) +++ xmlbeans/trunk/samples/OrderMatters/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="OrderMatters.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/SampleTemplate/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/SampleTemplate/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/SampleTemplate/build.xml (original) +++ xmlbeans/trunk/samples/SampleTemplate/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="SampleTemplate.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/SchemaEnum/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/SchemaEnum/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/SchemaEnum/build.xml (original) +++ xmlbeans/trunk/samples/SchemaEnum/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="SchemaEnum.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/SubstitutionGroup/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/SubstitutionGroup/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/SubstitutionGroup/build.xml (original) +++ xmlbeans/trunk/samples/SubstitutionGroup/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="SubstitutionGroup.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/Validation/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/Validation/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/Validation/build.xml (original) +++ xmlbeans/trunk/samples/Validation/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="Validation.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/XQueryXPath/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/XQueryXPath/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/XQueryXPath/build.xml (original) +++ xmlbeans/trunk/samples/XQueryXPath/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="XQueryXPath.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/XmlSort/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/XmlSort/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/XmlSort/build.xml (original) +++ xmlbeans/trunk/samples/XmlSort/build.xml Mon Jun 4 18:35:56 2018 @@ -65,7 +65,7 @@ limitations under the License. destdir="build/classes" classpathref="XmlSort.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/XmlTree/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/XmlTree/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/XmlTree/build.xml (original) +++ xmlbeans/trunk/samples/XmlTree/build.xml Mon Jun 4 18:35:56 2018 @@ -89,7 +89,7 @@ limitations under the License. destdir="build/classes" classpathref="XmlTree.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/samples/XsdConfig/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/samples/XsdConfig/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/samples/XsdConfig/build.xml (original) +++ xmlbeans/trunk/samples/XsdConfig/build.xml Mon Jun 4 18:35:56 2018 @@ -120,13 +120,13 @@ limitations under the License. destdir="build/classes" classpathref="XsdConfig.path" debug="on" - source="1.6" + source="1.4" /> Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java (original) +++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Cur.java Mon Jun 4 18:35:56 2018 @@ -3466,36 +3466,28 @@ final class Cur String s = CharUtil.getString( src, off, cch ); - for ( int i = 0 ; i < s.length(); ) + for ( int i = 0 ; i < s.length() ; i++ ) { - if (i == 36) + if (i== 36) { o.print( "..." ); break; } - int codePoint = s.codePointAt( i ); - char[] chars = Character.toChars(codePoint); - - if ( chars.length == 1 ) { - char ch = chars[0]; - if (ch >= 32 && ch < 127) - o.print( ch ); - else if (ch == '\n') - o.print( "\\n" ); - else if (ch == '\r') - o.print( "\\r" ); - else if (ch == '\t') - o.print( "\\t" ); - else if (ch == '\"') - o.print( "\\\"" ); - else - o.print( "<#" + ((int) ch) + ">" ); - } else { - o.print( "<#" + codePoint + ">" ); - } - - i += Character.charCount(codePoint); + char ch = s.charAt( i ); + + if (ch >= 32 && ch < 127) + o.print( ch ); + else if (ch == '\n') + o.print( "\\n" ); + else if (ch == '\r') + o.print( "\\r" ); + else if (ch == '\t') + o.print( "\\t" ); + else if (ch == '\"') + o.print( "\\\"" ); + else + o.print( "<#" + ((int) ch) + ">" ); } o.print( "\"" ); Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Locale.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Locale.java?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Locale.java (original) +++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Locale.java Mon Jun 4 18:35:56 2018 @@ -1,4 +1,4 @@ -/* Copyright 2004-2017 The Apache Software Foundation +/* Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.xml.sax.InputSource; import org.xml.sax.ext.LexicalHandler; import org.xml.sax.ext.DeclHandler; import org.xml.sax.SAXParseException; +import org.xml.sax.InputSource; import org.xml.sax.XMLReader; import org.xml.sax.SAXException; import org.xml.sax.DTDHandler; @@ -37,6 +38,8 @@ import java.lang.ref.Reference; import java.lang.ref.PhantomReference; import java.lang.ref.SoftReference; +import java.lang.reflect.Method; + import java.io.InputStream; import java.io.Reader; import java.io.StringReader; @@ -103,6 +106,9 @@ import org.apache.xmlbeans.impl.values.T import org.apache.xmlbeans.impl.values.TypeStoreUser; import org.apache.xmlbeans.impl.values.TypeStoreUserFactory; +import org.apache.xmlbeans.impl.piccolo.xml.Piccolo; +import org.apache.xmlbeans.impl.piccolo.io.FileFormatException; + public final class Locale implements DOMImplementation, SaajCallback, XmlLocale { @@ -3029,7 +3035,18 @@ public final class Locale } } - private static SaxLoader getSaxLoader(XmlOptions options) throws XmlException + private static SaxLoader getPiccoloSaxLoader() + { + SaxLoader piccoloLoader = (SaxLoader) SystemCache.get().getSaxLoader(); + if (piccoloLoader == null) + { + piccoloLoader = PiccoloSaxLoader.newInstance(); + SystemCache.get().setSaxLoader(piccoloLoader); + } + return piccoloLoader; + } + + private static SaxLoader getSaxLoader(XmlOptions options) { options = XmlOptions.maskNull(options); @@ -3046,23 +3063,31 @@ public final class Locale er = new DefaultEntityResolver(); } - XMLReader xr = (XMLReader) options.get( - XmlOptions.LOAD_USE_XMLREADER); + SaxLoader sl; - if (xr == null) { - try { - xr = SAXHelper.newXMLReader(); - } catch(Exception e) { - throw new XmlException("Problem creating XMLReader", e); - } - } + if (options.hasOption(XmlOptions.LOAD_USE_XMLREADER)) + { + XMLReader xr = (XMLReader) options.get( + XmlOptions.LOAD_USE_XMLREADER); - SaxLoader sl = new XmlReaderSaxLoader(xr); + if (xr == null) + throw new IllegalArgumentException("XMLReader is null"); - // I've noticed that most XMLReaders don't like a null EntityResolver... + sl = new XmlReaderSaxLoader(xr); - if (er != null) - xr.setEntityResolver(er); + // I've noticed that most XMLReaders don't like a null EntityResolver... + + if (er != null) + xr.setEntityResolver(er); + } + else + { + sl = getPiccoloSaxLoader(); + + // Piccolo doesnot mind a null entity resolver ... + + sl.setEntityResolver(er); + } return sl; } @@ -3076,6 +3101,34 @@ public final class Locale } } + private static class PiccoloSaxLoader + extends SaxLoader + { + private PiccoloSaxLoader(Piccolo p) + { + super(p, p.getStartLocator()); + + _piccolo = p; + } + + static PiccoloSaxLoader newInstance() + { + return new PiccoloSaxLoader(new Piccolo()); + } + + void postLoad(Cur c) + { + XmlDocumentProperties props = getDocProps(c, true); + + props.setEncoding(_piccolo.getEncoding()); + props.setVersion(_piccolo.getVersion()); + + super.postLoad(c); + } + + private Piccolo _piccolo; + } + private static abstract class SaxHandler implements ContentHandler, LexicalHandler , DeclHandler, DTDHandler { @@ -3130,7 +3183,7 @@ public final class Locale if (local.length() == 0) local = qName; - // Out current parser does not error when a + // Out current parser (Piccolo) does not error when a // namespace is used and not defined. Check for these here if (qName.indexOf(':') >= 0 && uri.length() == 0) @@ -3420,6 +3473,12 @@ public final class Locale return c; } + catch (FileFormatException e) + { + _context.abort(); + + throw new XmlException(e.getMessage(), e); + } catch (XmlRuntimeException e) { _context.abort(); Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original) +++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Mon Jun 4 18:35:56 2018 @@ -275,23 +275,7 @@ abstract class Saver end.moveToCur( c ); end.toEnd(); } - - /** - * Test if a character is valid in xml character content. See - * http://www.w3.org/TR/REC-xml#NT-Char - */ - static boolean isBadChar ( char ch ) - { - return ! ( - Character.isHighSurrogate(ch) || - Character.isLowSurrogate(ch) || - (ch >= 0x20 && ch <= 0xD7FF ) || - (ch >= 0xE000 && ch <= 0xFFFD) || - (ch >= 0x10000 && ch <= 0x10FFFF) || - (ch == 0x9) || (ch == 0xA) || (ch == 0xD) - ); - } - + protected boolean saveNamespacesFirst ( ) { return _saveNamespacesFirst; @@ -1403,7 +1387,7 @@ abstract class Saver if (++i == _buf.length) i = 0; - for ( int cch = _lastEmitCch - 2 ; cch > 0 ; cch-- ) + for ( int cch = _lastEmitCch ; cch > 0 ; cch-- ) { char ch = _buf[ i ]; @@ -1568,6 +1552,21 @@ abstract class Saver } /** + * Test if a character is valid in xml character content. See + * http://www.w3.org/TR/REC-xml#NT-Char + */ + + private boolean isBadChar ( char ch ) + { + return ! ( + (ch >= 0x20 && ch <= 0xD7FF ) || + (ch >= 0xE000 && ch <= 0xFFFD) || + (ch >= 0x10000 && ch <= 0x10FFFF) || + (ch == 0x9) || (ch == 0xA) || (ch == 0xD) + ); + } + + /** * Test if a character is to be replaced with an escaped value */ private boolean isEscapedChar ( char ch ) @@ -2191,6 +2190,20 @@ abstract class Saver } } + /** + * Test if a character is valid in xml character content. See + * http://www.w3.org/TR/REC-xml#NT-Char + */ + private boolean isBadChar ( char ch ) + { + return ! ( + (ch >= 0x20 && ch <= 0xD7FF ) || + (ch >= 0xE000 && ch <= 0xFFFD) || + (ch >= 0x10000 && ch <= 0x10FFFF) || + (ch == 0x9) || (ch == 0xA) || (ch == 0xD) + ); + } + private void emitLiteral ( String literal ) { // TODO: systemId production http://www.w3.org/TR/REC-xml/#NT-SystemLiteral Modified: xmlbeans/trunk/test/perf/build.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/perf/build.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/test/perf/build.xml (original) +++ xmlbeans/trunk/test/perf/build.xml Mon Jun 4 18:35:56 2018 @@ -348,7 +348,7 @@ executable="${env.JAVA_HOME}/bin/javac" classpathref="tools.classpath" includes="org/apache/xmlbeans/test/tools/**" - source="1.6"> + source="1.4"> @@ -363,7 +363,7 @@ executable="${env.JAVA_HOME}/bin/javac" classpathref="svn.classpath" includes="org/apache/xmlbeans/test/performance/svn/**,org/apache/xmlbeans/test/performance/utils/**" - source="1.6"> + source="1.4"> @@ -378,7 +378,7 @@ executable="${env.JAVA_HOME}/bin/javac" classpathref="v1.classpath" includes="org/apache/xmlbeans/test/performance/v1/**,org/apache/xmlbeans/test/performance/utils/**" - source="1.6"> + source="1.4"> @@ -393,7 +393,7 @@ executable="${env.JAVA_HOME}/bin/javac" classpathref="v2.classpath" includes="org/apache/xmlbeans/test/performance/v2/**,org/apache/xmlbeans/test/performance/utils/**" - source="1.6"> + source="1.4"> @@ -408,7 +408,7 @@ executable="${env.JAVA_HOME}/bin/javac" classpathref="castor.classpath" includes="org/apache/xmlbeans/test/performance/castor/**,org/apache/xmlbeans/test/performance/utils/**" - source="1.6"> + source="1.4"> @@ -424,7 +424,7 @@ classpathref="jibx.classpath" includes="org/apache/xmlbeans/test/performance/jibx/**,org/apache/xmlbeans/test/performance/utils/**" excludes="org/apache/xmlbeans/test/performance/jibx/binding/**" - source="1.6"> + source="1.4"> @@ -439,7 +439,7 @@ executable="${env.JAVA_HOME}/bin/javac" classpathref="jaxb.classpath" includes="org/apache/xmlbeans/test/performance/jaxb/**,org/apache/xmlbeans/test/performance/utils/**" - source="1.6"> + source="1.4"> @@ -470,7 +470,7 @@ executable="${env.JAVA_HOME}/bin/javac" classpathref="xerces.classpath" includes="org/apache/xmlbeans/test/performance/xerces/**,org/apache/xmlbeans/test/performance/utils/**" - source="1.6"> + source="1.4"> @@ -667,7 +667,7 @@ memoryMaximumSize="1000M" compiler="modern" executable="${env.JAVA_HOME}/bin/javac" - source="1.6" + source="1.4" classpathref="castor.classpath"/> @@ -689,7 +689,7 @@ classpathref="jibx.binding.classpath" includes="org/apache/xmlbeans/test/performance/jibx/binding/**" excludes="org/apache/xmlbeans/test/performance/castor/**,org/apache/xmlbeans/test/performance/svn/**,org/apache/xmlbeans/test/performance/utils/**" - source="1.6"> + source="1.4"> + source="1.4"> Modified: xmlbeans/trunk/test/src/xmlcursor/checkin/StoreTests.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlcursor/checkin/StoreTests.java?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/test/src/xmlcursor/checkin/StoreTests.java (original) +++ xmlbeans/trunk/test/src/xmlcursor/checkin/StoreTests.java Mon Jun 4 18:35:56 2018 @@ -1112,7 +1112,7 @@ public class StoreTests extends TestCase throws Exception { XmlCursor c = XmlObject.Factory.parse( xml ).newCursor(); - Assert.assertEquals( xml, c.xmlText() ); + Assert.assertTrue( c.xmlText().equals( xml ) ); } private void doSaveTest ( String xml ) @@ -1121,16 +1121,6 @@ public class StoreTests extends TestCase doSaverTest( xml ); } - public void testCDATA() throws Exception - { - // https://issues.apache.org/jira/browse/XMLBEANS-404 - String xml = "Unable to render embedded object: >>>>>>><<<<<<<<<<<]]>"; - String expected = ">>>>>>><<<<<<<<<<<]]>"; - XmlOptions options = new XmlOptions().setSaveCDataLengthThreshold(0); - XmlCursor c = XmlObject.Factory.parse(xml, options).newCursor(); - Assert.assertEquals( expected, c.xmlText(options) ); - } - public void testSaving ( ) throws Exception { Modified: xmlbeans/trunk/test/src/xmlobject/checkin/AssortedTests.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/checkin/AssortedTests.java?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/test/src/xmlobject/checkin/AssortedTests.java (original) +++ xmlbeans/trunk/test/src/xmlobject/checkin/AssortedTests.java Mon Jun 4 18:35:56 2018 @@ -40,6 +40,7 @@ public class AssortedTests extends TestC // bug 27489 public static void testSaverCharEscaping() throws XmlException { + String newLine = System.getProperty( "line.separator" ); XmlObject xdoc = XmlObject.Factory.parse("something"); XmlCursor cur = xdoc.newCursor(); cur.toFirstChild(); @@ -47,14 +48,9 @@ public class AssortedTests extends TestC cur.setTextValue(""); Assert.assertEquals("<something or other:\u03C0\uD7FF>", xdoc.toString()); - // invalid chars - control chars, FFFF/FFFE, etc - cur.setTextValue(""); - Assert.assertEquals("<something?or?other:\u0045?>", xdoc.toString()); - - String greekChars = "\uD835\uDF4A\uD835\uDF4B\uD835\uDF4C\uD835\uDF4D\uD835\uDF4E\uD835\uDF4F\uD835\uDF50\uD835" - + "\uDF51\uD835\uDF52\uD835\uDF53\uD835\uDF54\uD835\uDF55"; - cur.setTextValue(greekChars); - Assert.assertEquals("" + greekChars + "", xdoc.toString()); + // invalid chars - control chars, unicode surrogates, FFFF/FFFE, etc + cur.setTextValue(""); + Assert.assertEquals("<something?or?other:\u0045?????\u03C0\uD7FF?>", xdoc.toString()); } // bug 26140/26104 Modified: xmlbeans/trunk/test/src/xmlobject/checkin/CDataTest.java URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/checkin/CDataTest.java?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/test/src/xmlobject/checkin/CDataTest.java (original) +++ xmlbeans/trunk/test/src/xmlobject/checkin/CDataTest.java Mon Jun 4 18:35:56 2018 @@ -53,8 +53,8 @@ public class CDataTest throws Exception { String xmlText = ""; - String resultText = "cdata text"; - checkCData(xmlText, resultText, resultText); + + checkCData(xmlText, xmlText, xmlText); } public void testCData2() @@ -64,10 +64,10 @@ public class CDataTest " regular text" + NL + ""; String expected1 = "\n" + - "cdata text regular text\n" + + "\n" + ""; String expected2 = "" + NL + - " cdata text regular text" + NL + + " " + NL + ""; checkCData(xmlText, expected1, expected2); @@ -88,23 +88,6 @@ public class CDataTest checkCData(xmlText, expected1, expected2); } - - // https://issues.apache.org/jira/browse/XMLBEANS-404 - public void testXmlBeans404() - throws Exception - { - String xmlText = "\n" + - "text \n" + - ""; - String expected1 = "\n" + - "text cdata text]]\n" + - ""; - String expected2 = "" + NL + - " text cdata text]]" + NL + - ""; - - checkCData(xmlText, expected1, expected2); - } private void checkCData(String xmlText, String expected1, String expected2) throws XmlException Modified: xmlbeans/trunk/testbuild.xml URL: http://svn.apache.org/viewvc/xmlbeans/trunk/testbuild.xml?rev=1832877&r1=1832876&r2=1832877&view=diff ============================================================================== --- xmlbeans/trunk/testbuild.xml (original) +++ xmlbeans/trunk/testbuild.xml Mon Jun 4 18:35:56 2018 @@ -580,7 +580,7 @@ destdir="${build.dir.test.src}" classpathref="test.run.classpath" debug="on" - source="1.6" + source="1.4" optimize="on" verbose="false" failonerror="true"> @@ -662,7 +662,7 @@ excludes="${excludes}" classpathref="test.run.classpath" optimize="on" - source="1.6" + source="1.4" debug="on" verbose="false" failonerror="true"/> @@ -914,7 +914,7 @@ classpathref="test.run.classpath" optimize="on" debug="on" - source="1.6" + source="1.4" verbose="false" failonerror="true"/>