Re: [cp-patches] GNU Classpath
Mario Torre wrote: No. Updating the ChangeLog is a requirement. Maybe it's a requirement, but to be honest, is also a very redundant piece of information that is already in the commit log, The commit log is not part of the package. People may want to download the package and see who the contributors were and when; the ChangeLog is a long established convention for them to do this.
Re: [cp-patches] GNU Classpath
Roman Kennke wrote: Am Samstag, den 20.10.2012, 10:03 +0100 schrieb Chris Burdess: Mario Torre wrote: No. Updating the ChangeLog is a requirement. Maybe it's a requirement, but to be honest, is also a very redundant piece of information that is already in the commit log, The commit log is not part of the package. People may want to download the package and see who the contributors were and when; the ChangeLog is a long established convention for them to do this. I don't get it. All of the information of the Changelog is also in the commit history, and if it isn't, it's only a matter of convention to put it there. Then, when doing a release, it should be a matter of a simple script to create a ChangeLog in whatever format is required and put it in the package (I am sure there are existing scripts that accomplish exactly this out there). *All* of it can be automated, and it makes branching, merging, etc much easier, especially in the face of distributed VCSs. I am agnostic on the issue of how the ChangeLog is maintained, only that it should be present and maintained. It is not reasonable to expect a user, having downloaded a GNU package, to have to search around the Web to find the development project resources, download and install configuration management systems with which they may not be familiar, etc etc, simply to see what changes have been made since the last version.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
Andrew Haley wrote: Why are we using yet another VCS, anyway? We can pretty much guarantee that free Java devs are used to Mercural and maybe Subversion, but git? Because nobody spoke up during the review period, so the first suggestion was accepted.
Re: [cp-patches] StAX API change for final version
I redid the API changes myself to avoid any assignment issues; this seems to resolve all the original problems with the StAX API. Committed. 2009-07-08 Chris Burdess d...@gnu.org PR xml/40663: * javax/xml/stream/XMLEventFactory.java, * javax/xml/stream/XMLInputFactory.java, * javax/xml/stream/XMLOutputFactory.java, * javax/xml/stream/events/Namespace.java: Update API to match final version of StAX. * javax/xml/stream/util/ReaderDelegate.java: Removed. * javax/xml/stream/util/StreamReaderDelegate.java: Added (renamed from ReaderDelegate) * gnu/xml/stream/FilteredStreamReader.java, * gnu/xml/stream/NamespaceImpl.java, * gnu/xml/stream/XIncludeFilter.java, * gnu/xml/stream/XMLEventAllocatorImpl.java, * gnu/xml/stream/XMLEventFactoryImpl.java: Update implementation to match final version of StAX API. -- Chris Burdess 40663.patch Description: Binary data
[cp-patches] Fix for prefix validation in XMLStreamWriter
The attached patch fixes an issue with overenthusiatic validation of prefixes in XMLStreamWriter. 2009-07-07 Ludovic Claude ludovic.cla...@laposte.net PR java/40653 * gnu/xml/stream/XMLStreamWriterImpl.java: Permit empty string as prefix. -- Chris Burdess 40653.patch Description: Binary data
[cp-patches] StAX API change for final version
Our current StAX API is based on an early version. This change brings it in line with the final API implemented in J2SE 6.0. 2009-07-07 Ludovic Claude ludovic.cla...@laposte.net PR java/40663 * javax/xml/stream/util/ReaderDelegate.java: Removed. * javax/xml/stream/util/StreamReaderDelegate.java: Renamed class. -- Chris Burdess StreamReaderDelegate.java Description: Binary data
Re: [cp-patches] StAX API change for final version
Andrew John Hughes wrote: 2009/7/7 Chris Burdess d...@bluezoo.org: Our current StAX API is based on an early version. This change brings it in line with the final API implemented in J2SE 6.0. 2009-07-07 Ludovic Claude ludovic.cla...@laposte.net PR java/40663 * javax/xml/stream/util/ReaderDelegate.java: Removed. * javax/xml/stream/util/StreamReaderDelegate.java: Renamed class. -- Chris Burdess Chris, are you committing these patches? Or waiting for approval? Or do you want someone else to commit them? I'm happy with them, I'm not at a location that I can commit right at the moment, so if someone else could do it earlier then great, if not I will do it as soon as I can (sometime this evening). -- Chris Burdess
Re: [cp-patches] StAX API change for final version
Andrew John Hughes wrote: Chris, are you committing these patches? Or waiting for approval? Or do you want someone else to commit them? I'm happy with them, I'm not at a location that I can commit right at the moment, so if someone else could do it earlier then great, if not I will do it as soon as I can (sometime this evening). Ok, it just wasn't clear from your first posts what you actually wanted to do :) I'm about to commit a bugfix and I'd be happy to commit these afterwards. Great, thank you. -- Chris Burdess
Re: [cp-patches] StAX API change for final version
Andrew John Hughes wrote: On closer inspection, there may be an issue as Ludovic does not have a copyright assignment. Both look more complicated at present than simple renaming. The first issue, #40653, involves only a trivial change (a few one- liners). I'm assuming that this file also needs the patch http://gcc.gnu.org/bugzilla/attachment.cgi?id=18143 which seems to have some changes outside just fixing the class used. I'll look into this. -- Chris Burdess
Re: [cp-patches] FYI: fix StAX API incompatibility
Robert Schuster wrote: while trying to compile woodstox 2.0.6 on classpath I stumbled across an incompatibility in out StAX API. The attached patch fixes the interface and adjust all implementations within classpath. Regards Robert 2008-03-04 Robert Schuster [EMAIL PROTECTED] * gnu/xml/stream/AttributeImpl.java: Changed type field to String. (getDTDType): Changed return type to String. * gnu/xml/stream/XMLEventAllocatorImpl.java: (allocate): Removed wrapping of string in QName object. * gnu/xml/stream/XMLEventFactoryImpl.java: (createAttribute(String, String)): Removed wrapping of string in QName object. (createAttribute(QName, String)): Dito. (createAttribute(String, String, String, String)): Dito. * javax/xml/stream/events/Attribute.java: (getDTDType): Changed return type to String. Yes - at the time our StAX implementation was developed the spec was subtlely different. It seems it's now stabilised to define the type property as a String as you say. Please commit. -- Chris Burdess pgphJk3pRtxqL.pgp Description: PGP signature
Re: [cp-patches] FYI: More use of CPStringBuilder
Andrew John Hughes wrote: This switches more StringBuilder use to CPStringBuilder. Sorry, why was this necessary again? -- Chris Burdess pgpbdXRJ04BVN.pgp Description: PGP signature
[cp-patches] Fix for PR 32539
I committed this patch which allows us to avoid looking ahead in the event stream while trying to determine whether there is a next event. 2007-07-28 Chris Burdess [EMAIL PROTECTED] PR 32539 * gnu/xml/stream/XMLParser.java: don't call next() during hasNext(). -- Chris Burdess ? build ? patch Index: gnu/xml/stream/XMLParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/XMLParser.java,v retrieving revision 1.33 diff -u -r1.33 XMLParser.java --- gnu/xml/stream/XMLParser.java 4 May 2007 12:18:11 - 1.33 +++ gnu/xml/stream/XMLParser.java 27 Jul 2007 08:49:30 - @@ -178,11 +178,6 @@ private int event; /** - * Whether we are looking ahead. Used by hasNext. - */ - private boolean lookahead; - - /** * The element name stack. The first element in this stack will be the * root element. */ @@ -1013,24 +1008,12 @@ public boolean hasNext() throws XMLStreamException { -if (event == XMLStreamConstants.END_DOCUMENT) - return false; -if (!lookahead) - { -next(); -lookahead = true; - } -return event != -1; +return (event != XMLStreamConstants.END_DOCUMENT event != -1); } public int next() throws XMLStreamException { -if (lookahead) - { -lookahead = false; -return event; - } if (event == XMLStreamConstants.END_ELEMENT) { // Pop namespace context
[cp-patches] Fix for DOM node cloning
I committed the attached patch to fix bug #32672: 2007-07-09 Chris Burdess [EMAIL PROTECTED] Fixes #32672 * gnu/xml/dom/DomElement.java, * gnu/xml/dom/DomNamedNodeMap.java: don't check owner in setNamedNode when cloning. -- Chris Burdess Index: gnu/xml/dom/DomElement.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomElement.java,v retrieving revision 1.4 diff -u -r1.4 DomElement.java --- gnu/xml/dom/DomElement.java 12 Jan 2006 16:35:52 - 1.4 +++ gnu/xml/dom/DomElement.java 9 Jul 2007 17:53:40 - @@ -124,7 +124,7 @@ node.attributes = new DomNamedNodeMap(node, Node.ATTRIBUTE_NODE); for (DomNode ctx = attributes.first; ctx != null; ctx = ctx.next) { -node.attributes.setNamedItemNS(ctx.cloneNode(true)); +node.attributes.setNamedItem(ctx.cloneNode(true), true, true); } } return node; Index: gnu/xml/dom/DomNamedNodeMap.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomNamedNodeMap.java,v retrieving revision 1.5 diff -u -r1.5 DomNamedNodeMap.java --- gnu/xml/dom/DomNamedNodeMap.java31 Dec 2005 10:32:14 - 1.5 +++ gnu/xml/dom/DomNamedNodeMap.java9 Jul 2007 17:53:40 - @@ -148,7 +148,7 @@ */ public Node setNamedItem(Node arg) { -return setNamedItem(arg, false); +return setNamedItem(arg, false, false); } /** @@ -160,10 +160,10 @@ */ public Node setNamedItemNS(Node arg) { -return setNamedItem(arg, true); +return setNamedItem(arg, true, false); } - Node setNamedItem(Node arg, boolean ns) + Node setNamedItem(Node arg, boolean ns, boolean cloning) { if (readonly) { @@ -171,7 +171,7 @@ } DomNode node = (DomNode) arg; -if (node.owner != owner.owner) +if (!cloning node.owner != owner.owner) { throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR); }
[cp-patches] Small transformer bug fix
This patch, committed, fixes a bug in the XSL transformer where you have a with-param node with empty content. 2007-07-01 Chris Burdess [EMAIL PROTECTED] * gnu/xml/transform/WithParam.java: Handle case where content is empty. -- Chris Burdess Index: gnu/xml/transform/WithParam.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/WithParam.java,v retrieving revision 1.3 diff -u -r1.3 WithParam.java --- gnu/xml/transform/WithParam.java9 Jul 2005 20:38:35 - 1.3 +++ gnu/xml/transform/WithParam.java1 Jul 2007 11:10:30 - @@ -81,6 +81,10 @@ { return select.evaluate(context, pos, len); } +else if (content == null) + { +return ; + } else { Document doc = (context instanceof Document) ? (Document) context :
Re: [cp-patches] Small transformer bug fix
Christian Thalinger wrote: This patch, committed, fixes a bug in the XSL transformer where you have a with-param node with empty content. 2007-07-01 Chris Burdess [EMAIL PROTECTED] * gnu/xml/transform/WithParam.java: Handle case where content is empty. Hi Chris! This patch is the fix for the HotSpot jvmti problem? Seems so... :-) Yes, let me know if you have any more issues. -- Chris Burdess
[cp-patches] DOM node-cloning fix
I committed the following small patch submitted by Robin Garner: 2007-06-01 Robin Garner [EMAIL PROTECTED] Fixes #32162 * gnu/xml/dom/DomNode.java: Correct concurrency problem when deep cloning nodes. patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] RFC: Options to javac
Mario Torre wrote: On #classpath a user reported that he had to pass these switch to build the last classpath with javac. I think it can be a good idea to use them by default. What do you think? Will the switches just be ignored by 1.4 and earlier versions of javac, or will they cause an error? Is there configury in any case to check the version of the JDK being used?
[cp-patches] XML DOM bug fix
This patch (committed) fixes a problem whereby attributes were defaulted when they shouldn't have been. 2007-05-04 Chris Burdess [EMAIL PROTECTED] Fixes PR #31814 * gnu/xml/dom/DomDocument.java, gnu/xml/dom/ls/SAXEventSink.java: Don't default attribute when mode is #IMPLIED and value is not specified. * gnu/xml/stream/XMLParser.java: Add debugging info. patch Description: Binary data
Re: [cp-patches] Little XML patch
Christian Thalinger wrote: On Mon, 2007-04-09 at 21:11 +0200, Christian Thalinger wrote: On Mon, 2007-04-09 at 19:17 +0200, Christian Thalinger wrote: Ok, here we go: input.systemId=file:/home/twisti/cacao/spec/jbb2005/xml/template- document.xml ids.systemId=jbb-document.dtd url=jbb-document.dtd This is the output before Chris' patch: input.systemId=file:/home/twisti/cacao/spec/jbb2005/xml/template- document.xml ids.systemId=file:/home/twisti/cacao/spec/jbb2005/xml/jbb- document.dtd url=file:/home/twisti/cacao/spec/jbb2005/xml/jbb-document.dtd Ok, finally I was able to build a testcase. I've found the problem. java.io.File.toURL() is returning an invalid URL in DomLSParser.getInputSource. I'm sure we've been over this a hundred times or more but maybe it's time to revisit this yet again. Here is an example of a URL returned in my local testcase: file:/home/dog/test/twisti-xml/xml/test.xml According to RFC 1738: A file URL takes the form file://host/path where host is the fully qualified domain name of the system on which the path is accessible, and path is a hierarchical directory path of the form directory/directory/.../name. ... As a special case, host can be the string localhost or the empty string; this is interpreted as `the machine from which the URL is being interpreted'. Therefore File.toURL should be returning a URL of the form file:///home/dog/test/twisti-xml/xml/test.xml Let the flamewar commence... PGP.sig Description: This is a digitally signed message part
[cp-patches] Workaround for XML file URL problem
Provides a workaround for the File.toURL problem and handles any such incorrectly formatted URLs in XML external entity references. 2007-04-16 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/XMLParser.java: Work around a problem with incorrectly formatted file URLs. patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] Patch: FYI: hard-code SAX fallback
Tom Tromey wrote: I think for proper operation we have to remove the various XML service files from META-INF; see the earlier thread. But in order for this to work we also have to fix SAX to properly fall back to the Classpath SAX parser. This patch does this. It is a divergence from upstream, but in a place clearly marked -- both by us and by the SAX maintainers. Let me know what you think. I tried various combinations against the Sun JDK and I think this combination (removing service files and adding this patch) provides best compatibility. I agree that this seems the most sensible place. PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] FYI: Another javax.xml bugfix (PR 30983)
Gary Benson wrote: This commit fixes a bug where the entity resolver (if set) would be used to open the top-level document when parsing an XML file. The spec states that the parser will use the entity resolver before opening any external entity _except_ the top-level document entity. I'm not sure which spec says that. The EntityResolver class documentation says: The application can also use this interface to redirect system identifiers to local URIs or to look up replacements in a catalog (possibly by using the public identifier). Since the application is using the system ID to resolve the top-level document entity (either from LSInput.systemId or LSParser.parseURI (uri), which is equivalent), the spec would suggest that the entity resolver, if set, should be used to resolve the top-level entity. However, it seems expedient to ignore this for the purpose of code compatibility with other implementations. PGP.sig Description: This is a digitally signed message part
[cp-patches] Fix for SAX TransformerHandler behaviour
I committed this patch to fix an NPE when using the SAX TransformerHandler behaviour. 2007-02-19 Chris Burdess [EMAIL PROTECTED] Fixes #30831 * gnu/xml/dom/ls/SAXEventSink.java: Only set extended document properties when reader is available. patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] XML bug fixes
I committed the following patch to fix Bugzilla ticket 30597. 2007-01-26 Chris Burdess [EMAIL PROTECTED] Fixes #30597 * gnu/xml/dom/DomDocumentBuilder.java: Throw IOException where cause of LSException is an IOException. * gnu/xml/dom/ls/DomLSParser.java, gnu/xml/stream/SAXParser.java: Ensure coalescing feature is set correctly during LS parsing. patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] PATCH: Fix schema factory discovery
This patch (committed) implements the algorithm for schema factory implementation discovery. 2006-12-056 Chris Burdess [EMAIL PROTECTED] Fixes PR 28816. * javax/xml/validation/SchemaFactory.java: Use correct algorithm to discover schema factory implementation class. patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] PATCH: fix for XMLStreamWriter.writeDTD
This patch corrects a misunderstanding about XMLStreamWriter.writeDTD. 2006-12-06 Chris Burdess [EMAIL PROTECTED] Fixes PR 29264. * gnu/xml/stream/XMLStreamWriterImpl.java: Allow arbitrary text in writeDTD method. patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] PATCH: trivial fixes in XML classes
This patch - corrects Javadoc formatting in DocumentBuilderFactory - plugs a file descriptor leak in the main method of SAXParser (only used for testing) 2006-12-06 Chris Burdess [EMAIL PROTECTED] Fixes PR 29272. * javax/xml/parsers/DocumentBuilderFactory.java: Fix broken Javadoc. * gnu/xml/stream/SAXParser.java: Fix file descriptor leak. patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] PATCH: DOM event propagation fix
I'm committing this minor patch from Ben Konrath which appears to resolve some NPE problems in Eclipse. Mark, this is not marked critical in Bugzilla so I don't believe it is release critical. 2006-12-06 Ben Konrath [EMAIL PROTECTED] Fixes PR 29853. * gnu/xml/dom/DomAttr.java: Don't report mutation if oldValue and newValue are the same. * gnu/xml/dom/DomNode.java: Set parent if null during mutation. patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] QName
Jeroen Frijters wrote: I'd like some feedback on a change I'd like to make to a small part of the JAXP implementation. [...] Note that this is contentious, because Sun's QName *doesn't do any validation* of its input. However, I still think it's the right thing to do, and I'm not alone: The Sun docs explicitly say that they don't validate: The Namespace URI is not validated as a URI reference. The local part is not validated as a NCName as specified in Namespaces in XML. Ah? That must be a recent amendment, I certainly don't recall it in the original JAXP spec. Probably they felt they had to make this explicit *after* receiving a lot of negative feedback about its behaviour. Well, if the API spec itself is broken, laisse tomber. Besides, I don't see how you can validate an anyURI, since it can be absolute or relative. According to the XML namespaces spec http://www.w3.org/TR/xml-names/#iri-use http://www.w3.org/2000/09/xppa you cannot use relative URIs in XML namespace references. -- Chris Burdess
[cp-patches] QName
I'd like some feedback on a change I'd like to make to a small part of the JAXP implementation. The API in question is the javax.xml.namespace.QName class, which is a common cause of developer error as its constructor uses plain Strings and you have to remember which order the arguments go in: QName(String namespaceUri, String localPart) but QName(String localPart) seems to confuse people a lot, and you often find something like new QName(foo, http://bar.com/my/namespace;) or worse, the arguments are variable names new QName(el, un) - difficult to spot and debug. The attached patch does some simple validation to ensure the consistency of its arguments at runtime. It should help to tie down exactly where a bogus QName is constructed, even if it doesn't catch every possible case. Note that it doesn't do exhaustive testing of the localPart or prefix arguments as the exact criteria depend on the version of XML the author intends. Note that this is contentious, because Sun's QName *doesn't do any validation* of its input. However, I still think it's the right thing to do, and I'm not alone: http://cafe.elharo.com/java/why-methods-should-check-their-arguments/ Anyway, see below for the patch. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] Re: FYI: CSS border support
Stuart Ballard wrote: Here's a can of worms: Do we actually *want* to be better than Sun's implementation, featurewise? For the same reason that we as Free runtime users and developers hate it when people write code which (inadvertently or not) relies on features that are only in Sun's implementation (eg the undocumented sun.* bits that Free runtimes have no intention to duplicate), IMO it's not such a good idea to end up in a situation where people might inadvertently rely on features that only Classpath provides, making their code not portable to other implementations. It's one thing if we put extra stuff into Classpath-specific packages so that people will need to make a conscious choice to use it. But adding CSS support that will silently fail to work on Sun's implementation seems dangerous. What do others think? Implement the CSS spec, not Sun's implementation. -- Chris Burdess
[cp-patches] Small fix for an issue in transformer source resolution from a SAX source
This small patch (committed) fixes a problem that could cause an avoidable exception when trying to resolve a SAX source. 2006-09-18 David Pirkle [EMAIL PROTECTED] Fixes PR 28589 * gnu/xml/transform/XSLURIResolver.java: Test SAXSource for specific input stream during resolution. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] Implement SAXTransformerFactory
This patch (committed) implements javax.xml.transform.sax.SAXTransformerFactory. This JAXP API is flawed by design, since XSL is defined by specification to operate on XML infosets (in-memory trees), *not* event streams or partial documents. Therefore until now the GNU TransformerFactory implementation has not implemented this interface nor advertised such conformance. However, there is existing code out there that casts the TransformerFactory blindly to a SAXTransformerFactory without checking whether it advertises conformance (getFeature (SAXTransformerFactory.FEATURE)). While such code is not guaranteed to work on a conformant Java implementation it does work on Sun's and until now would fail on Classpath. This patch implements SAXTransformerFactory by providing an implementation that will buffer all SAX events into an in-memory tree and then use this tree as the basis of existing transformer operations, and will make such aforementioned code work on Classpath providing that they do not attempt transformer operations during the actual parsing. 2006-09-17 Chris Burdess [EMAIL PROTECTED] Fixes PR 27610 27687. * gnu/xml/dom/ls/SAXEventSink.java: Permit limited subclassing. * gnu/xml/transform/SAXTemplatesHandler.java, * gnu/xml/transform/SAXTransformerHandler.java: New files. * gnu/xml/transform/TransformerFactoryImpl.java: Implement SAXTransformerFactory. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] Fix for bug in stream serialisation
This path (committed) fixes a bug whereby XML entities were being escaped while in text output mode. 2006-09-16 Chris Burdess [EMAIL PROTECTED] Fixes PR 28572. * gnu/xml/transform/StreamSerializer.java: Don't escape XML entities when in text output mode. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] Fix for DOM node length
This patch (committed) fixes a bug which messed up NodeLists after a child node insertion. 2006-09-16 Chris Burdess [EMAIL PROTECTED] Fixes PR 27293. * gnu/xml/dom/DomNode.java: Increment length of node during insert. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] XPath fix
As there appears to be no opposition to this patch I have committed it. 2006-09-09 Chris Burdess [EMAIL PROTECTED] * gnu/xml/xpath/Expr.java: Ensure that node-set evaluation returns an instance of org.w3c.dom.NodeList. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] Re: XPath test still not commited?
On 25 Aug 2006, at 13:23, Mario Torre wrote: Il giorno ven, 25/08/2006 alle 13.01 +0100, Chris Burdess ha scritto: Mark Wielaard wrote: The XPath test i submitted on August 16 has still not been committed. As this was my first submission to this list, It's quite possible I did something wrong. Can anyone let me know what the status is? Sorry, I was hoping Chris could take a look. But I forgot he was on vacation. Chris, if you are back, could you take a look at: http://sourceware.org/ml/mauve-patches/2006/msg00614.html I don't know much about Mauve, but the JAXP part looks correct. Hi! The mauve part is ok (but the test still fails). Please evaluate the following patch. Sorry for the delay. 2006-09-04 Chris Burdess [EMAIL PROTECTED] * gnu/xml/xpath/Expr.java: Ensure that node-set evaluation returns an instance of org.w3c.dom.NodeList. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] XML streams debugging and partial workaround for #27664
I committed this patch which adds support for debugging XML streams via a system property (other suggestions welcomed) and also provides a workaround for a mark/reset problem somewhere in BufferedReader or CRLFReader by not reading more characters than are necessary in XMLParser.tryRead. 2006-06-07 Chris Burdess [EMAIL PROTECTED] * gnu/classpath/debug/TeeInputStream.java, gnu/classpath/debug/TeeOutputStream.java, gnu/classpath/debug/TeeReader.java, gnu/classpath/debug/TeeWriter.java: New classes for debugging streams. * gnu/xml/stream/XMLParser.java: Use tee streams for debugging. Don't read more characters than absolutely necessary in tryRead method. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] RFC: fix for PR27864
Robert Schuster wrote: unfortunately the fix you proposed yesterday on IRC did not work. I have further investigate the problem to find out about your consideration about an NPE happening because of my patch: I found out that if root is null, the code will not reach that code location because then 'here' would be null too and this is handled in line 243. OK. I'm not actually all that familiar with DomIterator. If you're happy that your patch is generally applicable I have no problem with it. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
[cp-patches] Fix for bug in XSL transformer
This patch fixes a bug in the XSL transformer when performing an identity transform to an existing DOMResult. 2006-06-06 Chris Burdess [EMAIL PROTECTED] * gnu/xml/transform/TransformerImpl.java: Check type of created document. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] Follow-on from last patch
This patch follows on from the last to correct the same condition in different parts of the code. 2006-06-06 Chris Burdess [EMAIL PROTECTED] * gnu/xml/transform/TransformerImpl.java: Check type of created document (more cases). -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] Initial implementation of java.net.URLConnection.guessContentTypeFromStream()
Petter Reinholdtsen wrote: Here is a patch to implement some magic numbers in java.net.URLConnection.guessContentTypeFromStream(). I picked a few mime types which seemed relevant from /etc/mime-magic and implemented tests for them. Is this approach good enough? Index: java/net/URLConnection.java === RCS file: /sources/classpath/classpath/java/net/URLConnection.java,v retrieving revision 1.42 diff -u -3 -p -u -r1.42 URLConnection.java --- java/net/URLConnection.java 12 May 2006 20:59:30 - 1.42 +++ java/net/URLConnection.java 16 May 2006 22:08:55 - @@ -971,10 +971,30 @@ public abstract class URLConnection * @exception IOException If an error occurs */ public static String guessContentTypeFromStream(InputStream is) -throws IOException, NotImplementedException +throws IOException { // See /etc/gnome-vfs-mime-magic or /etc/mime-magic for a reasonable // idea of how to handle this. + +is.mark(5); +int c0 = is.read(); +int c1 = is.read(); +int c2 = is.read(); +int c3 = is.read(); +is.reset(); + +if (c0 == 0xFF c1 == 0xD8) + return image/jpeg; + +if (c0 == 'G' c1 == 'I' c2 == 'F' c3 == '8') + return image/gif; + +if (c1 == 'P' c2 == 'N' c3 == 'G') + return image/png; + +if (c0 == 'P' c1 == 'K' c2 == 3 c3 == 4) + return application/zip; + return application/octet-stream; } Not if is.isMarkSupported() returns false... -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
[cp-patches] Fix for DomNode.cloneNode
I committed the following patch to work around a problem cloning DOM doctype nodes containing comments and/or PIs reported by Ian Rogers on IRC. 2006-05-09 Chris Burdess [EMAIL PROTECTED] * gnu/xml/dom/DomNode.java: Permit comments and PIs in doctype nodes to be preserved during cloneNode. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] Patch: RFC: argument parsing and 'jar' utility
Tom Tromey wrote: This weekend I wrote an argument parsing utility. It looked easy and I figured it would be better to simply have our own -- one in the correct namespace, that we can easily hack, and that doesn't have any legal baggage at all. It is reasonably straightforward to use and fully documented. ... Please comment. I propose that we convert all the tools to use the new argument parser. +1 -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] TransformerFactoryImpl
Jeroen Frijters wrote: I know nothing about the XML APIs, so I hope this isn't a dumb question but I just debugged some code from a user of IKVM and it did the following: SAXTransformerFactory factory = (SAXTransformerFactory)TransformerFactory.newInstance(); On the JDK this works. Now obviously the documentation doesn't specify that this is legal, but since there is code out there that assumes this work (dcm4che2, no idea what it does) I was wondering if we could/ should support it too. What do you think? Certainly, if you can find someone to develop such a transformer implementation. Note that the specification of XSL transformations defines that they operate over a tree rather than an event stream, so this is a totally pointless API that makes many assumptions that are clearly false. But it should theoretically be possible to implement it. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] RFC: DatatypeFactory implementation resolution mechanism
Tom Tromey wrote: Chris Please review the following patch for conformance to the API Chris specification of DatatypeFactory.newInstance Looking pretty good. Chris +// 2. jaxp.properties property Chris +File javaHome = new File(System.getProperty (java.home)); Chris +File javaHomeLib = new File(javaHome, lib); We usually use gnu.classpath.home.url here. The specification actually says to use $JAVA_HOME. Chris +// 3. services Chris +InputStream in = DatatypeFactory.class.getClassLoader() Chris + .getResourceAsStream(/META-INF/services/ + Chris + DATATYPEFACTORY_PROPERTY); We usually use gnu.classpath.ServiceFactory for this kind of thing. I incorporated this suggestion and committed. 2006-04-26 Chris Burdess [EMAIL PROTECTED] Fixes PR 27290 * javax/xml/datatype/DatatypeFactory.java: Use complete implementation resolution mechanism. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] Fix for getElementById
I committed the following patch to fix a bug in our DOM implementation: 2006-04-24 Chris Burdess [EMAIL PROTECTED] Fixes PR 27262 * gnu/xml/dom/DomDocument.java: getElementById returns user- defined ID attributes when no doctype exists. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] RFC: DatatypeFactory implementation resolution mechanism
Please review the following patch for conformance to the API specification of DatatypeFactory.newInstance 2006-04-24 Chris Burdess [EMAIL PROTECTED] Fixes PR 27290 * javax/xml/datatype/DatatypeFactory.java: Use complete implementation resolution mechanism. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions
Lillian Angel wrote: That's wrong. The colon is not permitted to appear as the last character in the string. You removed a valid check. Sun does permit a ':' to be the last character in a string. I was rather quick to assume that I was correct. I retested the applets that posed to be a problem, and they now work with this part of the patch reverted. 2006-04-18 Lillian Angel [EMAIL PROTECTED] * gnu/xml/dom/DomDocument.java (checkNCName): Reverted last patch. Added check for colon at last position back in. Thanks for pointing this out, I have changed it back. FYI http://www.w3.org/TR/REC-xml-names/#ns-qualnames http://www.w3.org/TR/xml-names11/#ns-qualnames -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions
Lillian Angel wrote: More bug fixes for the parser and related classes. 2006-04-12 Lillian Angel [EMAIL PROTECTED] * gnu/xml/dom/DomDocument.java (checkNCName): Removed unneeded part of check. Hi Lillian, --- gnu/xml/dom/DomDocument.java12 Jan 2006 16:35:52 - 1.8 +++ gnu/xml/dom/DomDocument.java12 Apr 2006 16:04:42 - @@ -535,8 +535,7 @@ int index = name.indexOf(':'); if (index != -1) { -if (index == 0 || index == (len - 1) || -name.lastIndexOf(':') != index) +if (index == 0 || name.lastIndexOf(':') != index) { throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0); That's wrong. The colon is not permitted to appear as the last character in the string. You removed a valid check. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] Patch: FYI: mime.types parsing
Tom Tromey wrote: This updates our internal mime type database in two ways. It might be worth considering merging or incorporating JAF to do this. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
[cp-patches] JAPI fixes
I committed the following path to fix a couple of API compatibility problems reported by JAPI. 2006-03-30 Chris Burdess [EMAIL PROTECTED] * javax/xml/datatype/DatatypeFactory.java (newDurationDayTime): Fix method signature. * javax/xml/validation/SchemaFactoryLoader.java: New file. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] Fix for classification of XML characters
Andrew Pinski wrote: Chris Burdess wrote: During development of the XML parser I prevented U+fffd from being classified as an XML Char. Since the introduction of the UnicodeReader class this hack is no longer required. I committed this patch to re-classify U+fffd as a Char and permit the parsing of documents containing this character. 2006-03-20 Chris Burdess [EMAIL PROTECTED] Fixes PR 11070 * gnu/xml/stream/XMLParser.java: Permit U+fffd as XML Char. That PR number looks wrong. Sorry, you're right. It should be 26761. I've updated the Changelog. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
[cp-patches] Fix for classification of XML characters
During development of the XML parser I prevented U+fffd from being classified as an XML Char. Since the introduction of the UnicodeReader class this hack is no longer required. I committed this patch to re-classify U+fffd as a Char and permit the parsing of documents containing this character. 2006-03-20 Chris Burdess [EMAIL PROTECTED] Fixes PR 11070 * gnu/xml/stream/XMLParser.java: Permit U+fffd as XML Char. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] Fix for false positive
I committed this patch to fix a false positive on my last commit. 2006-03-15 Chris Burdess [EMAIL PROTECTED] Fixes PR 26700 * gnu/xml/stream/XMLParser.java: Fix for detectEncoding false positive. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] XML parser fixlet
I committed the following patch 2006-03-12 Chris Burdess [EMAIL PROTECTED] Fixes PR 26652 * gnu/xml/stream/XMLParser.java: Fix for case when both reader and encoding are specified. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] Micropatch for XSL transformer
I committed the following patch to resolve #26620: 2006-03-10 Chris Burdess [EMAIL PROTECTED] PR 26620: * gnu/xml/transform/TransformerImpl.java: Suspend wellformedness checking while reindenting. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] RFC: URL fix.
David Daney wrote: With this test case (just added to mauve): import java.net.URL; public class URLTest { public static void main(String []args) { try { URL url = new URL(http://www.foo.bar.com;); url = new URL(url, _urn:testing/); System.out.println(url: + url); } catch (Exception e) { e.printStackTrace(); } } } Classpath is currently treating the _urn: as a protocol and discarding the context even though _urn: is not a valid protocol. Sun's runtime will append the spec to the context in this case instead of replacing the context. There is no way to determine whether a URL scheme is valid or not, assuming that is even meaningful. If we append the spec to the context in this case we should also do so in the case of url = new URL(http://www.foo.bar.com;); url = new URL(url, http://www.foo.bar.com;); this should produce http://www.foo.bar.com/http://www.foo.bar.com;. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] RFC: URL fix.
Olivier Jolly wrote: There is no way to determine whether a URL scheme is valid or not, assuming that is even meaningful. If we append the spec to the context in this case we should also do so in the case of url = new URL(http://www.foo.bar.com;); url = new URL(url, http://www.foo.bar.com;); this should produce http://www.foo.bar.com/http://www.foo.bar.com;. Also please note, I'm not saying this is a good idea, quite the reverse. Actually, there is a way to determine whether a protocol is valid or not, or more precisely, whether we have an handler for it or no. That isn't the same thing, and I think it would be unwise to differentiate based purely on whether there is a runtime handler set up for it. Let's say I have a J2EE application with 30 different jar files, one of which contains a handler for the foo schema. I have the following code: url = new URL(new URL(http://widgets.com;), foo:// override.widgets.com/stuff); Now, because my deployment environment is complicated, perhaps my foo.jar doesn't get included or there is a nasty classloader issue which prevents the handler from getting loaded. I would expect to get a MalformedURLException but instead I silently get a bogus URL http://widgets.com/foo://override.widgets.com/stuff;. At this point I start hunting down the Classpath contributors who made this design decision and popping away at them with an SLR. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
[cp-patches] More CRLF and line input stream fixes
This patch applies the previous CRLF detection patch to the StAX- specific CRLFReader, and addresses a problem whereby CRLFInputStream and LineInputStream would expose the mark-capable functionality of the underlying stream, which they were already using (causing potential mark out-of-sync problems). 2006-02-25 Chris Burdess [EMAIL PROTECTED] * gnu/java/net/CRLFInputStream.java, gnu/java/net/LineInputStream.java: Streams that use mark capabilities on the underlying stream do not expose mark functionality themselves. * gnu/xml/stream/CRLFReader.java: Fix incorrect end condition when off 0. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] RFC: gnu/java/net/protocol/http/ChunkedInputStream fix skip method.
David Daney wrote: The basic problem was that ChunkedInputStream.skip() would skip on the underlying InputStream. This bypassed the byte counting of the chunked protocol resulting in failure on reads following the skip. The fix is to extent InputStream instead of FilterInputStream, as its skip method magically does the right thing. This requires that an implementation of available() and close() also be supplied. We can also use the super class' implementation of read(byte[]), so I removed that as well. I am going to test this patch a bit more, but I think it is generally the right approach. Comments? All looks very good. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
[cp-patches] XML parsing fixes
I committed the following changes to fix several PRs reported in the xml module. 2006-02-17 Chris Burdess [EMAIL PROTECTED] Fixes PRs 26319, 26320, 26321, 26322, 26325 * gnu/xml/stream/SAXParser.java: On error, reset parser before rethrowing exception. * gnu/xml/stream/XMLParser.java: Only report illegal use of 1.1-style prefix unbinding in 1.0 document error for xmlns prefixes, not xmlns attributes. Fix a problem with empty namespace stack at the end of a document. Permit parameter entity references in element and attribute-list definition name area. Corrected normalisation of whitespace character entity references in CDATA attribute values. Fixed number of characters read following a reset when detecting end of character data with characters after a Unicode surrogate pair. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
[cp-patches] More datatype library implementation
I committed some more of the missing parts of the datatype library implementation. 2006-02-15 Chris Burdess [EMAIL PROTECTED] * gnu/xml/validation/datatype/BooleanType.java, gnu/xml/validation/datatype/ByteType.java, gnu/xml/validation/datatype/DateTimeType.java, gnu/xml/validation/datatype/DateType.java, gnu/xml/validation/datatype/DecimalType.java, gnu/xml/validation/datatype/DoubleType.java, gnu/xml/validation/datatype/DurationType.java, gnu/xml/validation/datatype/FloatType.java, gnu/xml/validation/datatype/GDayType.java, gnu/xml/validation/datatype/GMonthDayType.java, gnu/xml/validation/datatype/GMonthType.java, gnu/xml/validation/datatype/GYearMonthType.java, gnu/xml/validation/datatype/GYearType.java, gnu/xml/validation/datatype/IntType.java, gnu/xml/validation/datatype/IntegerType.java, gnu/xml/validation/datatype/LongType.java, gnu/xml/validation/datatype/MaxExclusiveFacet.java, gnu/xml/validation/datatype/MaxInclusiveFacet.java, gnu/xml/validation/datatype/MinExclusiveFacet.java, gnu/xml/validation/datatype/MinInclusiveFacet.java, gnu/xml/validation/datatype/NegativeIntegerType.java, gnu/xml/validation/datatype/NonNegativeIntegerType.java, gnu/xml/validation/datatype/NonPositiveIntegerType.java, gnu/xml/validation/datatype/PositiveIntegerType.java, gnu/xml/validation/datatype/ShortType.java, gnu/xml/validation/datatype/SimpleType.java, gnu/xml/validation/datatype/TimeType.java, gnu/xml/validation/datatype/TypeBuilder.java, gnu/xml/validation/datatype/UnsignedByteType.java, gnu/xml/validation/datatype/UnsignedIntType.java, gnu/xml/validation/datatype/UnsignedLongType.java, gnu/xml/validation/datatype/UnsignedShortType.java: Provide value objects for datatypes. Make maxExclusive,minExclusive,maxInclusive, minInclusive facets use the value space of the base type, and implement. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] Patch: GtkComponentPeer fix
Lillian Angel wrote: I added this check to prevent several assertion errors in GdkGraphics. 2006-02-07 Lillian Angel [EMAIL PROTECTED] * gnu/java/awt/peer/gtk/GtkComponentPeer.java (handleEvent): Added check. Should not paint or update the component if it's width and height are both 0. Surely that should be if either its height or its width are less than 1? -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] RFC: Datatypes library
Mark Wielaard wrote: Arguably, if we change the name we lose any benefit of being able to plug in a 3rd party datatype library implementation. It would be trivial to duplicate just the part of the API we need in a private namespace and use that for our own providers, but we would only be able to use our own implementation. My primary reason for including this API is that it is the current standard API. I believe that much as with JAXP itself, free software benefits by being able to interface with alternate implementations, to provide more choice and facilitate testing. OK. Which other free datatype library implementations are there? James Clark's Jing (http://www.thaiopensource.com/relaxng/jing.html, BSD licence) and Sun's xsdlib2 (don't have current URL, licence probably has Sun-like conditions) provide complete library implementations. Other people have added smaller subsets or extensions to other libraries; see e.g. http://www-128.ibm.com/ developerworks/java/library/x-custyp/ There are other implementations in C++ and .NET which may also be interfaceable to Java. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] RFC: Datatypes library
Mark Wielaard wrote: This patch adds the RELAX NG pluggable datatypes library to Classpath. This API, and an implementation of it, will be used by the W3C XML Schema and RELAX NG JAXP validators currently in development. Please let me know how you feel about this. Could you explain a bit more how this will be used. I see javax.xml.validation.SchemaFactory.newInstance() has a big TODO and I assume you are working on an implementation of this. For which schema languages? I am personally working on a RELAX NG validator. I'm also in contact with someone else who is working on an XML Schema validator, but they haven't signed papers yet (and I haven't seen any code). And how does using this datatypes library fit into that implementation? The validators will use the datatypes library interface in order to look up datatypes by name. The datatype implementation will be responsible for validating just the datatype part of the overall schema. I have a datatype library implementation in development. It is currently based on the relaxngDatatype API. We would expose this package (indirectly) which is why I am a bit hesitant to say great, go ahead. We could do like kaffe does in case it merges an external library and rename it to gnu.xml.org.relaxng.datatype, on the other hand this package has been stable for years so it is unlikely that a user wants to replace it with another version. Arguably, if we change the name we lose any benefit of being able to plug in a 3rd party datatype library implementation. It would be trivial to duplicate just the part of the API we need in a private namespace and use that for our own providers, but we would only be able to use our own implementation. My primary reason for including this API is that it is the current standard API. I believe that much as with JAXP itself, free software benefits by being able to interface with alternate implementations, to provide more choice and facilitate testing. I saw you already notified FSF legal of this and they checked the license to be compatible for inclusion. And adding it to external is the right thing to do. The only other thing needed would be to update the top-level LICENSE file when we decide to include this. Sure -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] ApplyTemplatesNode.clone() null check
Mark Wielaard wrote: I had this local patch in my tree. Unfortunately I lost the test case/program for it and cannot remember when I actually debugged this one. 2006-01-30 Mark Wielaard [EMAIL PROTECTED] * gnu/xml/transform/ApplyTemplatesNode.java (clone): Check whether sortKeys is null. Since ApplyTemplatesNode has more places that check whether or not sortKeys is null and because StyleSheet actually creates a builtInNodeTemplate that has null sortKeys I think it is correct. Chris, what do you think? Looks good to me -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part
Re: [cp-patches] Patch to make Classpath HEAD build work again with Darwin
Roman Kennke wrote: Am Freitag, den 20.01.2006, 21:32 + schrieb Chris Burdess: The attached patch allows the build to complete on Darwin. I'd very much appreciate any comments as I'm really not an expert on the new target-native stuff. This patch looks very good. Please check it in. Here you go. 2006-01-23 Chris Burdess [EMAIL PROTECTED] * native/jni/java-util/Makefile.am: Include library required explicitly by BSD systems. * native/target/generic/target_generic_misc.h: Remove old commented out code. * native/target/generic/target_generic_network.h: Fallbacks (to SO_NOSIGPIPE and then 0) for non-portable glibc MSG_NOSIGNAL. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Patch for text node children
As Pedro Izecksohn suggested (but never seemed to get around to committing?), I have committed this patch to fix #25906 and address a minor issue in the SAX parser. 2006-01-23 Chris Burdess [EMAIL PROTECTED] Fixes bug #25906 * gnu/xml/dom/DomCharacterData.java: Use a separate empty node list class to avoid getLength method contention. * gnu/xml/stream/SAXParser.java: Rethrow correct exception. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Patch to make Classpath HEAD build work again with Darwin
The attached patch allows the build to complete on Darwin. I'd very much appreciate any comments as I'm really not an expert on the new target-native stuff. This fixes bug #25872 among other things. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] XML patch
This patch introduces checking of the arguments to the various XMLStreamWriter methods and fixes some XSLT conformance failures. 2006-01-16 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/XMLParser.java, gnu/xml/stream/XMLStreamWriterImpl.java: Thoroughly check XMLStreamWriter arguments for conformance to the XML specifications. * gnu/xml/transform/Stylesheet.java, gnu/xml/transform/Template.java, gnu/xml/transform/TransformerImpl.java, gnu/xml/xpath/LangFunction.java, gnu/xml/xpath/Selector.java: better handling of template priorities; fix indents when pretty-printing; recursive tests for xml:lang. * gnu/xml/util/XHTMLWriter.java, gnu/xml/util/XMLWriter.java: Deprecate old serializer classes. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] FYI: New Posix Layer
Roman Kennke wrote: I committed the new Posix-Layer that implements a couple of portability macros and functions for use in our native code. This patch causes the build to fail with gcc -dynamiclib -o .libs/libjavaio.0.0.0.dylib .libs/ java_io_VMFile.o .libs/java_io_VMObjectInputStream.o .libs/ java_io_VMObjectStreamClass.o ../../../native/jni/classpath/.libs/ jcl.o -install_name /gnu/lib/classpath/libjavaio.0.dylib -Wl,- compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0 ld: Undefined symbols: _targetNativeLastErrorCode _targetNativeLastErrorString /usr/bin/libtool: internal link edit command failed -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] SAX micropatch
The ChangeLog entry says it all: 2006-01-14 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java: Ensure that parser is reset correctly when I/O and runtime exceptions occur during parsing. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Regression fix for XSLT
This patch fixes a regression in XSLT that I'm seeing, although I'm also getting different conformance results on different machines (single-processor G4 versus dual-processor 64-bit G5), so it will be interesting to see what builder makes of it :-/ I also removed some debugging output I left in accidentally in the last patch. 2006-01-12 Chris Burdess [EMAIL PROTECTED] * gnu/xml/dom/DomNode.java, gnu/xml/transform/ElementAvailableFunction.java: Removed debugging output. * gnu/xml/xpath/NameTest.java, gnu/xml/xpath/NamespaceTest.java, gnu/xml/xpath/Selector.java: Fix regression for namespace axis navigation. * gnu/xml/transform/MessageNode.java: Use standard logging system for outputting messages. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] More XSLT/XPath fixes
This patch corrects a number of smaller XSLT and XPath bugs. 2006-01-12 Chris Burdess [EMAIL PROTECTED] * gnu/xml/dom/DomDocument.java, gnu/xml/dom/DomElement.java, gnu/xml/dom/DomNode.java, gnu/xml/stream/XMLParser.java, gnu/xml/transform/Bindings.java, gnu/xml/transform/ElementAvailableFunction.java, gnu/xml/transform/ElementNode.java, gnu/xml/transform/FunctionAvailableFunction.java, gnu/xml/transform/NamespaceProxy.java, gnu/xml/transform/StreamSerializer.java, gnu/xml/transform/Stylesheet.java, gnu/xml/transform/TransformerImpl.java, gnu/xml/xpath/Selector.java: Implement isEqualNode correctly for document and element nodes; correct coalescing semantics when parsing; attribute-sets can only refer to top-level variables and parameters; fix namespace retrieval during element-available and function-available functions; implement xsl:fallback for extension elements; tokenize whitespace correctly during whitespace stripping; correct following and previous node axes selectors. The conformance appears to have regressed slightly overall to 71%, but this is due to the more correct implementation of Node.isEqualNode. Nothing to worry about. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] FYI: First class for javax.management.
Meskauskas Audrius wrote: /** * The attribute name. */ final String m_name; /** * The attribute value. */ final Object m_value; Do we really need all this m_* Hungarian notation business? We don't use this form (or indeed underscores at all) anywhere else in Classpath. -- Chris Burdess ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] RFC: patch for Unicode scalar value to UTF-16 conversion
Tom Tromey wrote: Chris Please comment. Chris -dst[dstIndex + 1] = (char) ((codePoint 0x3ff) Chris -+ (int) MIN_LOW_SURROGATE ); Chris -dst[dstIndex] = (char) ((codePoint 10) + (int) MIN_HIGH_SURROGATE); Chris +dst[dstIndex + 1] = (char) (((codePoint - 0x1) % 0x400) + 0xdc00); Chris +dst[dstIndex] = (char) (((codePoint - 0x1) / 0x400) + 0xd800); I think it is better to use the named constants instead of the values. Fair enough, but what about the casting: doesn't that make it less efficient? Actually I should only be doing the subtraction once here on that basis. I also have a mild preference for the bit-shifting and masking computation, but this is more minor. The problem is that the bit-shifting method produces the wrong result. What about the version attached here, is that better? -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: java/lang/Character.java === RCS file: /cvsroot/classpath/classpath/java/lang/Character.java,v retrieving revision 1.40 diff -u -r1.40 Character.java --- java/lang/Character.java17 Sep 2005 21:58:41 - 1.40 +++ java/lang/Character.java8 Jan 2006 08:52:41 - @@ -2410,11 +2410,11 @@ { // Write second char first to cause IndexOutOfBoundsException // immediately. -dst[dstIndex + 1] = (char) ((codePoint 0x3ff) -+ (int) MIN_LOW_SURROGATE ); -dst[dstIndex] = (char) ((codePoint 10) + (int) MIN_HIGH_SURROGATE); +final int cp2 = codePoint - 0x1; +dst[dstIndex + 1] = (char) ((cp2 % 0x400) + (int) MIN_LOW_SURROGATE); +dst[dstIndex] = (char) ((cp2 / 0x400) + (int) MIN_HIGH_SURROGATE); result = 2; -} + } else { dst[dstIndex] = (char) codePoint; pgpWxWb1o10Ue.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] RFC: patch for Unicode scalar value to UTF-16conversion
Jeroen Frijters wrote: I think it is better to use the named constants instead of the values. Fair enough, but what about the casting: doesn't that make it less efficient? No, it's a no-op (and not even needed in the source). OK I also have a mild preference for the bit-shifting and masking computation, but this is more minor. The problem is that the bit-shifting method produces the wrong result. In this case they both produce the same result. I think the problem was that the original code forgot to subtract 0x1. I see. So, is there a good reason to do it this way (bitshifting and bitmasking) rather than the arithmetical methods (which presumably get compiled to the same thing, but are much more straightforward to understand)? Here is an updated patch that includes the corresponding conversion back to a Unicode scalar (the original code also forgot to add 0x1). Should I commit this? Or should it be bitshifting and bitmasking? -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: java/lang/Character.java === RCS file: /cvsroot/classpath/classpath/java/lang/Character.java,v retrieving revision 1.40 diff -u -r1.40 Character.java --- java/lang/Character.java17 Sep 2005 21:58:41 - 1.40 +++ java/lang/Character.java8 Jan 2006 10:39:21 - @@ -2410,11 +2410,11 @@ { // Write second char first to cause IndexOutOfBoundsException // immediately. -dst[dstIndex + 1] = (char) ((codePoint 0x3ff) -+ (int) MIN_LOW_SURROGATE ); -dst[dstIndex] = (char) ((codePoint 10) + (int) MIN_HIGH_SURROGATE); +final int cp2 = codePoint - 0x1; +dst[dstIndex + 1] = (char) ((cp2 % 0x400) + (int) MIN_LOW_SURROGATE); +dst[dstIndex] = (char) ((cp2 / 0x400) + (int) MIN_HIGH_SURROGATE); result = 2; -} + } else { dst[dstIndex] = (char) codePoint; @@ -2523,7 +2523,8 @@ */ public static int toCodePoint(char high, char low) { -return ((high - MIN_HIGH_SURROGATE) 10) + (low - MIN_LOW_SURROGATE); +return ((high - MIN_HIGH_SURROGATE) * 0x400) + + (low - MIN_LOW_SURROGATE) + 0x1; } /** pgpvBRBqyWdSh.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Add self to AUTHORS
Inspired by Casey, I thought it might be time to add myself to AUTHORS. I've now authored over 10% of the Java files in Classpath, hurray. Hope everyone is OK with this. 2006-01-07 Chris Burdess [EMAIL PROTECTED] * AUTHORS: add self. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: AUTHORS === RCS file: /cvsroot/classpath/classpath/AUTHORS,v retrieving revision 1.34 diff -u -r1.34 AUTHORS --- AUTHORS 7 Jan 2006 07:06:37 - 1.34 +++ AUTHORS 7 Jan 2006 09:56:20 - @@ -13,6 +13,7 @@ James E. Blair ([EMAIL PROTECTED]) Eric Blake ([EMAIL PROTECTED]) Sascha Brawer ([EMAIL PROTECTED]) +Chris Burdess ([EMAIL PROTECTED]) David Daney ([EMAIL PROTECTED]) Nic Ferrier ([EMAIL PROTECTED]) Paul Fisher ([EMAIL PROTECTED]) pgpyve7r6cwFj.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Updated documentation for XML parser classes
I committed the following patch which provides much more detailed code comments and @see links for the XML parser classes. 2006-01-07 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java, gnu/xml/stream/XIncludeFilter.java, gnu/xml/stream/XMLParser.java: Updated documentation. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: gnu/xml/stream/SAXParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/SAXParser.java,v retrieving revision 1.10 diff -u -r1.10 SAXParser.java --- gnu/xml/stream/SAXParser.java 31 Dec 2005 10:32:14 - 1.10 +++ gnu/xml/stream/SAXParser.java 7 Jan 2006 12:24:44 - @@ -642,6 +642,9 @@ } } + /** + * Indicates whether the specified characters are ignorable whitespace. + */ private boolean isIgnorableWhitespace(XMLParser reader, char[] b, boolean testCharacters) { Index: gnu/xml/stream/XIncludeFilter.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/XIncludeFilter.java,v retrieving revision 1.3 diff -u -r1.3 XIncludeFilter.java --- gnu/xml/stream/XIncludeFilter.java 14 Dec 2005 19:42:12 - 1.3 +++ gnu/xml/stream/XIncludeFilter.java 7 Jan 2006 12:24:44 - @@ -75,6 +75,10 @@ /** * StAX filter for performing XInclude processing. * + * @see http://www.w3.org/TR/xinclude/ + * @see http://www.w3.org/TR/xptr-framework/ + * @see http://www.w3.org/TR/xptr-element/ + * * @author a href='mailto:[EMAIL PROTECTED]'Chris Burdess/a */ class XIncludeFilter Index: gnu/xml/stream/XMLParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/XMLParser.java,v retrieving revision 1.15 diff -u -r1.15 XMLParser.java --- gnu/xml/stream/XMLParser.java 31 Dec 2005 10:32:15 - 1.15 +++ gnu/xml/stream/XMLParser.java 7 Jan 2006 12:24:45 - @@ -90,18 +90,26 @@ /** * An XML parser. * + * @see http://www.w3.org/TR/REC-xml/ + * @see http://www.w3.org/TR/xml11/ + * @see http://www.w3.org/TR/REC-xml-names + * @see http://www.w3.org/TR/xml-names11 + * @see http://www.w3.org/TR/xmlbase/ + * * @author a href='mailto:[EMAIL PROTECTED]'Chris Burdess/a */ public class XMLParser implements XMLStreamReader, NamespaceContext { - private static final int INIT = 0; - private static final int PROLOG = 1; - private static final int CONTENT = 2; - private static final int EMPTY_ELEMENT = 3; - private static final int MISC = 4; + // -- parser state machine states -- + private static final int INIT = 0; // start state + private static final int PROLOG = 1; // in prolog + private static final int CONTENT = 2; // in content + private static final int EMPTY_ELEMENT = 3; // empty element state + private static final int MISC = 4; // in Misc (after root element) + // -- parameters for parsing literals -- private final static int LIT_ENTITY_REF = 2; private final static int LIT_NORMALIZE = 4; private final static int LIT_ATTRIBUTE = 8; @@ -110,54 +118,204 @@ private final static int LIT_DISABLE_EREF = 64; private final static int LIT_PUBID = 256; + // -- types of attribute values -- final static int ATTRIBUTE_DEFAULT_UNDECLARED = 30; final static int ATTRIBUTE_DEFAULT_SPECIFIED = 31; final static int ATTRIBUTE_DEFAULT_IMPLIED = 32; final static int ATTRIBUTE_DEFAULT_REQUIRED = 33; final static int ATTRIBUTE_DEFAULT_FIXED = 34; + /** + * The current input. + */ private Input input; + + /** + * Stack of inputs representing XML general entities. + * The input representing the XML input stream or reader is always the + * first element in this stack. + */ private LinkedList inputStack = new LinkedList(); + + /** + * Stack of start-entity events to be reported. + */ private LinkedList startEntityStack = new LinkedList(); + + /** + * Stack of end-entity events to be reported. + */ private LinkedList endEntityStack = new LinkedList(); + /** + * Current parser state within the main state machine. + */ private int state = INIT; + + /** + * The (type of the) current event. + */ private int event; + + /** + * Whether we are looking ahead. Used by hasNext. + */ private boolean lookahead; + + /** + * The element name stack. The first element in this stack will be the + * root element. + */ private LinkedList stack = new LinkedList(); + + /** + * Stack of namespace contexts. These are maps specifying prefix-to-URI + * mappings. The first element in this stack is the most recent namespace + * context (i.e. the other way around from the element name stack). + */ private LinkedList namespaces = new LinkedList
[cp-patches] Add SAX feature to control XML Base processing
This small patch adds a means to control whether to use XML Base aware processing or not. 2006-01-07 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java: Add SAX feature to set XML Base aware processing. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: gnu/xml/stream/SAXParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/SAXParser.java,v retrieving revision 1.11 diff -u -r1.11 SAXParser.java --- gnu/xml/stream/SAXParser.java 7 Jan 2006 12:29:06 - 1.11 +++ gnu/xml/stream/SAXParser.java 7 Jan 2006 12:33:47 - @@ -147,6 +147,7 @@ throw new IllegalStateException(parsing in progress); final String FEATURES = http://xml.org/sax/features/;; final String PROPERTIES = http://xml.org/sax/properties/;; +final String GNU_FEATURES = http://gnu.org/sax/features/;; if ((FEATURES + namespaces).equals(name)) namespaceAware = Boolean.TRUE.equals(value); else if ((FEATURES + namespace-prefixes).equals(name)) @@ -169,6 +170,8 @@ declHandler = (DeclHandler) value; else if ((PROPERTIES + lexical-handler).equals(name)) lexicalHandler = (LexicalHandler) value; +else if ((GNU_FEATURES + xml-base).equals(name)) + baseAware = Boolean.TRUE.equals(value); else throw new SAXNotSupportedException(name); } @@ -178,6 +181,7 @@ { final String FEATURES = http://xml.org/sax/features/;; final String PROPERTIES = http://xml.org/sax/properties/;; +final String GNU_FEATURES = http://gnu.org/sax/features/;; final String GNU_PROPERTIES = http://gnu.org/sax/properties/;; if ((FEATURES + is-standalone).equals(name)) return xmlStandalone ? Boolean.TRUE : Boolean.FALSE; @@ -207,6 +211,8 @@ return xmlVersion; if ((PROPERTIES + lexical-handler).equals(name)) return lexicalHandler; +if ((GNU_FEATURES + xml-base).equals(name)) + return baseAware ? Boolean.TRUE : Boolean.FALSE; if ((GNU_PROPERTIES + document-xml-encoding).equals(name)) return xmlEncoding; throw new SAXNotSupportedException(name); pgpt2AFjueNQX.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Small XML patch
This patch tidies up a few issues in the XML parser. 2006-01-07 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/BufferedReader.java: Removed commented out code. * gnu/xml/stream/XIncludeFilter.java: Correct XML Base behaviour. * gnu/xml/stream/XMLParser.java: Make additional StAX properties available; correct handling of unparsed entity references; absolutize all base URIs; remove commented out code. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: gnu/xml/stream/BufferedReader.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/BufferedReader.java,v retrieving revision 1.1 diff -u -r1.1 BufferedReader.java --- gnu/xml/stream/BufferedReader.java 27 Dec 2005 19:56:16 - 1.1 +++ gnu/xml/stream/BufferedReader.java 7 Jan 2006 15:50:19 - @@ -84,7 +84,6 @@ { marklimit = readlimit; markpos = pos; -//System.out.println(--mark@+Integer.toHexString(pos)+:+marklimit); } public boolean markSupported() @@ -97,7 +96,6 @@ { if (pos = count !refill()) return -1; -//System.out.println(--read1@+Integer.toHexString(pos)+:+new String(buf, pos, 1)); return (int) buf[pos++]; } @@ -121,7 +119,6 @@ int ret = Math.min(count - pos, len); System.arraycopy(buf, pos, b, off, ret); -//System.out.println(--read2@+Integer.toHexString(pos)+:+new String(b, off, ret)+ (+ret+)); pos += ret; off += ret; len -= ret; @@ -130,7 +127,6 @@ { int remain = Math.min(count - pos, len); System.arraycopy(buf, pos, b, off, remain); -//System.out.println(--read3@+Integer.toHexString(pos)+:+new String(b, off, remain)); pos += remain; off += remain; len -= remain; @@ -146,7 +142,6 @@ if (markpos == -1) throw new IOException(buf == null ? Stream closed. : Invalid mark.); pos = markpos; -//System.out.println(--reset@+Integer.toHexString(pos)); } public long skip(long n) @@ -154,7 +149,6 @@ { if (buf == null) throw new IOException(Stream closed.); -//System.out.println(--skip:+n); final long origN = n; while (n 0L) { @@ -173,13 +167,11 @@ if (buf == null) throw new IOException(Stream closed.); -//System.out.println(--refill:pos=+Integer.toHexString(pos)+ count=+Integer.toHexString(count)); int markcount = count - markpos; if (markpos == -1 || markcount = marklimit) { markpos = -1; pos = count = 0; -//System.out.println(--refill1@+Integer.toHexString(pos)); } else { @@ -193,14 +185,12 @@ count = markcount; pos -= markpos; markpos = 0; - //System.out.println(--refill2@+Integer.toHexString(pos)+:+Integer.toHexString(count)); } int numread = in.read(buf, count, bufferSize); if (numread = 0) return false; -//System.out.println(--refill3(+Integer.toHexString(numread)+):+new String(buf, count, numread)); count += numread; return true; } Index: gnu/xml/stream/XIncludeFilter.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/XIncludeFilter.java,v retrieving revision 1.4 diff -u -r1.4 XIncludeFilter.java --- gnu/xml/stream/XIncludeFilter.java 7 Jan 2006 12:29:06 - 1.4 +++ gnu/xml/stream/XIncludeFilter.java 7 Jan 2006 15:50:19 - @@ -672,6 +672,12 @@ } return space; } + + String getBaseURI() + { +String base = (String) getParent().getProperty(gnu.xml.stream.baseURI); +return (base == null) ? systemId : base; + } boolean includeResource(String href, String parse, String xpointer, String encoding, String accept, @@ -682,10 +688,11 @@ { if (xpointer != null) throw new XMLStreamException(xpointer attribute not yet supported); +String base = getBaseURI(); if (href == null || .equals(href)) - href = systemId; + href = base; else - href = XMLParser.absolutize(systemId, href); + href = XMLParser.absolutize(base, href); if (parse == null || xml.equals(parse)) { seen.clear(); Index: gnu/xml/stream/XMLParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/XMLParser.java,v retrieving revision 1.17 diff -u -r1.17 XMLParser.java --- gnu/xml/stream/XMLParser.java 7 Jan 2006 14:45:30 - 1.17 +++ gnu/xml/stream/XMLParser.java 7 Jan 2006 15:50:20 - @@ -89,6 +89,18 @@ /** * An XML parser. + * This parser supports the following additional StAX properties: + * table
[cp-patches] RFC: patch for Unicode scalar value to UTF-16 conversion
There is currently a problem with Character.toChars whereby the high char of the UTF-16 surrogate pair is incorrectly generated. This patch fixes the problem, ensuring that the output is correct, but it uses the algorithm proposed by the Unicode spec to generate the surrogate pair and may therefore not be optimally efficient. I haven't committed this, I'd just like to solicit some feedback about it. Please comment. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: java/lang/Character.java === RCS file: /cvsroot/classpath/classpath/java/lang/Character.java,v retrieving revision 1.40 diff -u -r1.40 Character.java --- java/lang/Character.java17 Sep 2005 21:58:41 - 1.40 +++ java/lang/Character.java7 Jan 2006 21:01:36 - @@ -2410,9 +2410,8 @@ { // Write second char first to cause IndexOutOfBoundsException // immediately. -dst[dstIndex + 1] = (char) ((codePoint 0x3ff) -+ (int) MIN_LOW_SURROGATE ); -dst[dstIndex] = (char) ((codePoint 10) + (int) MIN_HIGH_SURROGATE); +dst[dstIndex + 1] = (char) (((codePoint - 0x1) % 0x400) + 0xdc00); +dst[dstIndex] = (char) (((codePoint - 0x1) / 0x400) + 0xd800); result = 2; } else pgpoNkdW6XqLz.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] XML validation and conformance
I committed the following patch to improve the validating features and conformance of the XML parser. 2005-12-29 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java, gnu/xml/stream/XMLParser.java: Additional validity constraint checking; parameter entity recognition and replacement checks; checks for xml:space to determine whether whitespace is ignorable; better start- and end-entity event reporting. This patch brings the XML parser to 97.36% conformance against the W3C XML conformance test suite (passed 2105 of 2162 tests). -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: gnu/xml/stream/SAXParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/SAXParser.java,v retrieving revision 1.8 diff -u -r1.8 SAXParser.java --- gnu/xml/stream/SAXParser.java 27 Dec 2005 19:56:16 - 1.8 +++ gnu/xml/stream/SAXParser.java 29 Dec 2005 17:19:04 - @@ -43,6 +43,7 @@ import java.net.URL; import java.util.Iterator; import java.util.Map; +import javax.xml.XMLConstants; import javax.xml.namespace.QName; import javax.xml.stream.Location; import javax.xml.stream.XMLEventReader; @@ -630,6 +631,18 @@ if (doctype == null) return false; String currentElement = reader.getCurrentElement(); +// check for xml:space +int ac = reader.getAttributeCount(); +for (int i = 0; i ac; i++) + { +QName aname = reader.getAttributeQName(i); +if (space.equals(aname.getLocalPart()) +XMLConstants.XML_NS_URI.equals(aname.getNamespaceURI())) + { +if (preserve.equals(reader.getAttributeValue(i))) + return false; + } + } XMLParser.ContentModel model = doctype.getElementModel(currentElement); if (model == null || model.type != XMLParser.ContentModel.ELEMENT) return false; Index: gnu/xml/stream/XMLParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/XMLParser.java,v retrieving revision 1.13 diff -u -r1.13 XMLParser.java --- gnu/xml/stream/XMLParser.java 29 Dec 2005 09:14:20 - 1.13 +++ gnu/xml/stream/XMLParser.java 29 Dec 2005 17:19:05 - @@ -72,6 +72,7 @@ import java.util.LinkedList; import java.util.Map; import java.util.NoSuchElementException; +import java.util.StringTokenizer; import javax.xml.XMLConstants; import javax.xml.namespace.NamespaceContext; @@ -133,7 +134,8 @@ private int[] tmpBuf = new int[1024]; private ContentModel currentContentModel; - private LinkedList validationStack = new LinkedList(); + private LinkedList validationStack; + private HashSet ids, idrefs; private String piTarget, piData; @@ -204,6 +206,12 @@ this.stringInterning = stringInterning; this.reporter = reporter; this.resolver = resolver; +if (validating) + { +validationStack = new LinkedList(); +ids = new HashSet(); +idrefs = new HashSet(); + } pushInput(new Input(in, null, systemId, null)); } @@ -229,6 +237,12 @@ this.stringInterning = stringInterning; this.reporter = reporter; this.resolver = resolver; +if (validating) + { +validationStack = new LinkedList(); +ids = new HashSet(); +idrefs = new HashSet(); + } pushInput(new Input(null, reader, null, systemId, null)); } @@ -238,6 +252,8 @@ { if (XMLConstants.XML_NS_PREFIX.equals(prefix)) return XMLConstants.XML_NS_URI; +if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) + return XMLConstants.XMLNS_ATTRIBUTE_NS_URI; for (Iterator i = namespaces.iterator(); i.hasNext(); ) { LinkedHashMap ctx = (LinkedHashMap) i.next(); @@ -252,6 +268,8 @@ { if (XMLConstants.XML_NS_URI.equals(namespaceURI)) return XMLConstants.XML_NS_PREFIX; +if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) + return XMLConstants.XMLNS_ATTRIBUTE; for (Iterator i = namespaces.iterator(); i.hasNext(); ) { LinkedHashMap ctx = (LinkedHashMap) i.next(); @@ -273,6 +291,8 @@ { if (XMLConstants.XML_NS_URI.equals(namespaceURI)) return Collections.singleton(XMLConstants.XML_NS_PREFIX).iterator(); +if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) + return Collections.singleton(XMLConstants.XMLNS_ATTRIBUTE).iterator(); LinkedList acc = new LinkedList(); for (Iterator i = namespaces.iterator(); i.hasNext(); ) { @@ -302,6 +322,11 @@ buf = null; attrs = null; doctype = null; + +inputStack = null; +validationStack = null; +ids = null; +idrefs = null; } public NamespaceContext getNamespaceContext() @@ -754,8 +779,6 @@ else
[cp-patches] XML parser
I am reverting the default SAX (and therefore DOM) parser to aelfred2 until the mark/reset bug is resolved. 2005-12-25 Chris Burdess [EMAIL PROTECTED] * resource/META-INF/services/javax.xml.parsers.SAXParserFactory: Revert to using aelfred2 driver by default. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: resource/META-INF/services/javax.xml.parsers.SAXParserFactory === RCS file: /cvsroot/classpath/classpath/resource/META-INF/services/javax.xml.parsers.SAXParserFactory,v retrieving revision 1.2 diff -u -r1.2 javax.xml.parsers.SAXParserFactory --- resource/META-INF/services/javax.xml.parsers.SAXParserFactory 24 Dec 2005 14:14:48 - 1.2 +++ resource/META-INF/services/javax.xml.parsers.SAXParserFactory 25 Dec 2005 09:49:00 - @@ -1 +1 @@ -gnu.xml.stream.SAXParserFactory +gnu.xml.aelfred2.JAXPFactory pgpz3L2oy9BdD.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] StAX again
With the attached changes, the SAX-over-StAX driver conformance is again improved, to 95.37% against the W3C test suite. This means that it is now more conformant than aelfred2 (93.89%), and I have therefore made it the default SAX parser. 2005-12-24 Chris Burdess [EMAIL PROTECTED] * doc/README.jaxp: Updated with parameters for SAX-over-StAX driver. * gnu/xml/stream/SAXParser.java, gnu/xml/stream/XMLParser.java: Conformance fixes for XML 1.1 and namespace handling. * gnu/xml/dom/ls/DomLSParser.java, gnu/xml/dom/ls/SAXEventSink.java: Use SAX features and properties to determine XML declaration details. * gnu/xml/aelfred2/SAXDriver.java, gnu/xml/aelfred2/XmlParser.java, gnu/xml/dom/Consumer.java, gnu/xml/pipeline/DomConsumer.java, gnu/xml/pipeline/EventFilter.java: Remove ContentHandler2 hack as DOM Load Save no longer depends on it * javax/xml/parsers/SAXParserFactory.java, resource/META-INF/services/javax.xml.parsers.SAXParserFactory: Make SAX-over-StAX the default SAX implementation. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: doc/README.jaxp === RCS file: /cvsroot/classpath/classpath/doc/README.jaxp,v retrieving revision 1.2 diff -u -r1.2 README.jaxp --- doc/README.jaxp 4 Sep 2005 14:46:44 - 1.2 +++ doc/README.jaxp 24 Dec 2005 13:54:56 - @@ -17,7 +17,7 @@ . gnu.xml.xpath.* ... JAXP XPath implementation . gnu.xml.transform.* ... JAXP XSL transformer implementation . gnu.xml.pipeline.* ... SAX2 event pipeline support -. gnu.xml.stream.* ... StAX pull parser implementation +. gnu.xml.stream.* ... StAX pull parser and SAX-over-StAX driver . gnu.xml.util.* ... various XML utility classes . gnu.xml.libxmlj.dom.* ... libxmlj DOM Level 3 Core and XPath . gnu.xml.libxmlj.sax.* ... libxmlj SAX parser @@ -139,6 +139,9 @@ -Djavax.xml.stream.XMLInputFactory=gnu.xml.stream.XMLInputFactoryImpl -Djavax.xml.stream.XMLOutputFactory=gnu.xml.stream.XMLOutputFactoryImpl + GNU SAX-over-StAX: + -Djavax.xml.parsers.SAXParserFactory=gnu.xml.stream.SAXParserFactory + libxmlj SAX: -Djavax.xml.parsers.SAXParserFactory=gnu.xml.libxmlj.sax.GnomeSAXParserFactory Index: gnu/xml/aelfred2/ContentHandler2.java === RCS file: gnu/xml/aelfred2/ContentHandler2.java diff -N gnu/xml/aelfred2/ContentHandler2.java --- gnu/xml/aelfred2/ContentHandler2.java 2 Jul 2005 20:32:15 - 1.2 +++ /dev/null 1 Jan 1970 00:00:00 - @@ -1,65 +0,0 @@ -/* ContentHandler2.java -- - Copyright (C) 2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath 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 for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.xml.aelfred2; - -import org.xml.sax.ContentHandler; -import org.xml.sax.SAXException; - -/** - * Extension to the SAX ContentHandler interface to report parsing events - * and parameters required by DOM Level 3 but not supported by SAX. - * - * @author a href='mailto:[EMAIL PROTECTED]'Chris Burdess/a - */ -public interface ContentHandler2 - extends ContentHandler -{ - - /** - * Reports the XML declaration
Re: [cp-patches] RFC: Using HashSet for event registration in DomNode
Guilhem Lavaux wrote: To improve performance in the case a DomNode has many event listeners (which may be the case during a eclipse build) it is more efficient to use a HashSet instead of the dumb algorithm currently in place of DomNode. Thanks for doing this. I am trying to check what is the performance boost at the moment but if someone wants to check also... I ran your changes against the DOM conformance test suite, which creates a lot of small DOM trees, and the performance improvement is noticeable. There are no regressions. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin pgpCVnFHdqhHA.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] DTD validation support for StAX parser
This patch enables the StAX parser to behave as an XML validating parser, when configured to do so. That mostly wraps it up for now. Merry Christmas. 2005-12-24 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java, gnu/xml/stream/XMLParser.java: DTD validation support for StAX parser. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: gnu/xml/stream/SAXParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/SAXParser.java,v retrieving revision 1.6 diff -u -r1.6 SAXParser.java --- gnu/xml/stream/SAXParser.java 24 Dec 2005 14:14:48 - 1.6 +++ gnu/xml/stream/SAXParser.java 24 Dec 2005 17:52:57 - @@ -481,8 +481,9 @@ // Element decl if (declHandler != null) { -String model = doctype.getElementModel(name); -declHandler.elementDecl(name, model); +XMLParser.ContentModel model = + doctype.getElementModel(name); +declHandler.elementDecl(name, model.text); } } else if ('A' == c) Index: gnu/xml/stream/XMLParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/XMLParser.java,v retrieving revision 1.10 diff -u -r1.10 XMLParser.java --- gnu/xml/stream/XMLParser.java 24 Dec 2005 14:14:48 - 1.10 +++ gnu/xml/stream/XMLParser.java 24 Dec 2005 17:52:58 - @@ -131,6 +131,9 @@ private StringBuffer nmtokenBuf = new StringBuffer(); private StringBuffer literalBuf = new StringBuffer(); private char[] tmpBuf = new char[1024]; + + private ContentModel currentContentModel; + private LinkedList validationStack = new LinkedList(); private String piTarget, piData; @@ -141,7 +144,7 @@ Doctype doctype; private boolean expandPE, peIsError; - private final boolean validating; // TODO + private final boolean validating; private final boolean stringInterning; private final boolean coalescing; private final boolean replaceERefs; @@ -835,6 +838,8 @@ { reset(); event = readCharData(null); +if (validating) + validatePCData(buf.toString()); } } break; @@ -844,6 +849,8 @@ buf.append(elementName); state = stack.isEmpty() ? MISC : CONTENT; event = XMLStreamConstants.END_ELEMENT; +if (validating) + endElementValidationHook(); break; case INIT: // XMLDecl? if (tryRead(TEST_XML_DECL)) @@ -1586,11 +1593,12 @@ throws IOException, XMLStreamException { if (tryRead(EMPTY)) - doctype.addElementDecl(elementName, EMPTY); + doctype.addElementDecl(elementName, EMPTY, new EmptyContentModel()); else if (tryRead(ANY)) - doctype.addElementDecl(elementName, ANY); + doctype.addElementDecl(elementName, ANY, new AnyContentModel()); else { +ContentModel model; StringBuffer acc = new StringBuffer(); require('('); acc.append('('); @@ -1599,11 +1607,17 @@ { // mixed content acc.append(#PCDATA); +MixedContentModel mm = new MixedContentModel(); +model = mm; skipWhitespace(); if (tryRead(')')) { -acc.append()*); -tryRead('*'); +acc.append()); +if (tryRead('*')) + { +mm.min = 0; +mm.max = -1; + } } else { @@ -1612,27 +1626,32 @@ require('|'); acc.append('|'); skipWhitespace(); -acc.append(readNmtoken(true)); +String name = readNmtoken(true); +acc.append(name); +mm.addName(name); skipWhitespace(); } require('*'); acc.append()*); +mm.min = 0; +mm.max = -1; } } else - readElements(acc); -doctype.addElementDecl(elementName, acc.toString()); + model = readElements(acc); +doctype.addElementDecl(elementName, acc.toString(), model); } } - private void readElements(StringBuffer acc) + private ElementContentModel readElements(StringBuffer acc) throws IOException, XMLStreamException { char
[cp-patches] More StAX
You'll be getting a bit bored of these by now. 2005-12-23 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java, gnu/xml/stream/XMLParser.java: Interim commit during W3C XML conformance testing. The SAX-over-StAX parser is currently scoring 90.33% against the W3C conformance suite. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin Index: gnu/xml/stream/SAXParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/SAXParser.java,v retrieving revision 1.4 diff -u -r1.4 SAXParser.java --- gnu/xml/stream/SAXParser.java 18 Dec 2005 12:28:21 - 1.4 +++ gnu/xml/stream/SAXParser.java 23 Dec 2005 12:38:52 - @@ -76,7 +76,8 @@ */ public class SAXParser extends javax.xml.parsers.SAXParser - implements XMLReader, Attributes2, Locator2, XMLResolver, XMLReporter + implements XMLReader, Attributes2, Locator2, XMLReporter, + XMLParser.XMLResolver2 { ContentHandler contentHandler; @@ -377,6 +378,16 @@ uri = ; localName = ; } +else + { +int nc = reader.getNamespaceCount(); +for (int i = 0; i nc; i++) + { +String nsuri = reader.getNamespaceURI(i); +String nsprefix = reader.getNamespacePrefix(i); +contentHandler.startPrefixMapping(nsprefix, nsuri); + } + } contentHandler.startElement(uri, localName, qName, this); } break; @@ -396,6 +407,15 @@ localName = ; } contentHandler.endElement(uri, localName, qName); +if (namespaceAware) + { +int nc = reader.getNamespaceCount(); +for (int i = 0; i nc; i++) + { +String nsprefix = reader.getNamespacePrefix(i); +contentHandler.endPrefixMapping(nsprefix); + } + } } break; case XMLStreamConstants.COMMENT: @@ -499,17 +519,26 @@ if (ids.notationName != null) { if (dtdHandler != null) - dtdHandler.unparsedEntityDecl(name, -ids.publicId, -ids.systemId, - ids.notationName); + { +String pub = ids.publicId; +String url = ids.systemId; +String not = ids.notationName; +dtdHandler.unparsedEntityDecl(name, + pub, + url, + not); + } } else { if (declHandler != null) - declHandler.externalEntityDecl(name, - ids.publicId, - ids.systemId); + { +String pub = ids.publicId; +String url = ids.systemId; +declHandler.externalEntityDecl(name, + pub, + url); + } } } } @@ -520,8 +549,9 @@ { XMLParser.ExternalIds ids = doctype.getNotation(name); -dtdHandler.notationDecl(name, ids.publicId, -ids.systemId); +String pub = ids.publicId; +String url = ids.systemId; +dtdHandler.notationDecl(name, pub, url
[cp-patches] More StAX
You really don't want the complete list of changes, it would just clog up the ChangeLog ;) 2005-12-18 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java, gnu/xml/stream/XMLParser.java: Various fixes post SAX conformance testing. The SAX-over-StAX parser now scores 85.2% conformance against the combined W3C XML conformance test suite (the Oracle parser scores 41.5%, Xerces scores 90.8%, Ælfred2 scores 93.8%). This should improve when the parser can actually validate against the DTD. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data PGP.sig Description: This is a digitally signed message part ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
Re: [cp-patches] FYI: Patch for EnumSyntax attributes in the print api
Mark Wielaard wrote: On Fri, 2005-12-16 at 20:22 +0100, Wolfgang Baer wrote: + /** + * Tests if the given object is equal to this object. + * The objects are considered equal if both are of the same + * Media subclass, not null and the values are equal. + * + * @param obj the object to test + * + * @return codetrue/code if both objects are equal, + * codefalse/code otherwise. + */ + public boolean equals(Object obj) + { +if ((obj instanceof MediaName this instanceof MediaName) +|| (obj instanceof MediaTray this instanceof MediaTray) +|| (obj instanceof MediaSizeName this instanceof MediaSizeName)) + { +return ((Media) obj).getValue() == this.getValue(); + } + +return false; + } Wouldn't it be a bit more robust to write this as: return (obj.getClass() == this.getClass() ((Media) obj).getValue() == this.getValue()); Then you also accept any future subclasses. Except when obj == null. Then it's less robust. -- Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin pgpyNHqVWgFe6.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] StAX parser fixes
I committed the following changes to XMLParser: 2005-12-15 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/XMLParser.java: Report start-entity and end- entity events; read text declaration for external entities; handle XML namespace; handle xml:base; normalize CR/LF pairs created as a result of mixed text and character entity references. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Properties loading from XML
I changed java.util.Properties to use StAX instead of SAX when loading from XML. Because there is a StAX property to ignore external entities, we can ignore Sun's not-well-formed DTD. 2005-12-15 Chris Burdess [EMAIL PROTECTED] Fixes bug classpath/24496: * java/util/Properties.java (loadFromXML): Use StAX instead of SAX to populate properties. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] More StAX
This patch continues the StAX work in preparation for using the StAX parser with other JAXP factories: 2005-12-15 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java, gnu/xml/stream/XMLInputFactoryImpl.java, gnu/xml/stream/XMLParser.java: Permit setting extended properties via factory interfaces; make base-aware a parameter. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] XInclude filter
This patch provides a very rough and ready XInclude filter to provide XInclude-aware XML processing in the StAX implementation. Extensions to the XPath implementation will be required in order to be conformant. 2005-12-13 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java, gnu/xml/stream/XIncludeFilter.java, gnu/xml/stream/XMLInputFactoryImpl.java, gnu/xml/stream/XMLParser.java: Addition of XInclude filter. -- Chris Burdess Index: gnu/xml/stream/SAXParser.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/stream/SAXParser.java,v retrieving revision 1.1 diff -u -r1.1 SAXParser.java --- gnu/xml/stream/SAXParser.java 12 Dec 2005 19:53:05 - 1.1 +++ gnu/xml/stream/SAXParser.java 13 Dec 2005 17:12:56 - @@ -92,6 +92,7 @@ boolean stringInterning = true; XMLParser parser; + XMLStreamReader reader; String encoding; String xmlVersion; boolean xmlStandalone; @@ -256,9 +257,9 @@ parser = new XMLParser(in, systemId); else { -Reader reader = input.getCharacterStream(); -if (reader != null) - parser = new XMLParser(reader, systemId); +Reader r = input.getCharacterStream(); +if (r != null) + parser = new XMLParser(r, systemId); } if (parser == null) { @@ -268,13 +269,17 @@ in = new URL(systemId).openStream(); parser = new XMLParser(in, systemId); } +reader = parser; parser.setValidating(validating); parser.setNamespaceAware(namespaceAware); -parser.setXIncludeAware(xIncludeAware); parser.setStringInterning(stringInterning); parser.setResolver(this); parser.setReporter(this); + +if (xIncludeAware) + reader = new XIncludeFilter(parser, systemId, namespaceAware, + validating, true); if (contentHandler != null) contentHandler.setDocumentLocator(this); @@ -287,14 +292,14 @@ case XMLStreamConstants.CHARACTERS: if (contentHandler != null) { -char[] b = parser.getTextCharacters(); +char[] b = reader.getTextCharacters(); contentHandler.characters(b, 0, b.length); } break; case XMLStreamConstants.SPACE: if (contentHandler != null) { -char[] b = parser.getTextCharacters(); +char[] b = reader.getTextCharacters(); // TODO determine whether whitespace is ignorable contentHandler.characters(b, 0, b.length); } @@ -304,7 +309,7 @@ lexicalHandler.startCDATA(); if (contentHandler != null) { -char[] b = parser.getTextCharacters(); +char[] b = reader.getTextCharacters(); // TODO determine whether whitespace and ignorable contentHandler.characters(b, 0, b.length); } @@ -314,7 +319,7 @@ case XMLStreamConstants.START_ELEMENT: if (contentHandler != null) { -QName name = parser.getName(); +QName name = reader.getName(); String uri = name.getNamespaceURI(); String localName = name.getLocalPart(); String prefix = name.getPrefix(); @@ -332,7 +337,7 @@ case XMLStreamConstants.END_ELEMENT: if (contentHandler != null) { -QName name = parser.getName(); +QName name = reader.getName(); String uri = name.getNamespaceURI(); String localName = name.getLocalPart(); String prefix = name.getPrefix(); @@ -350,22 +355,22 @@ case XMLStreamConstants.COMMENT: if (lexicalHandler != null) { -char[] b = parser.getTextCharacters(); +char[] b = reader.getTextCharacters(); lexicalHandler.comment(b, 0, b.length); } break; case XMLStreamConstants.PROCESSING_INSTRUCTION: if (contentHandler != null) { -String target = parser.getPITarget(); -String data = parser.getPIData(); +String target = reader.getPITarget(); +String data = reader.getPIData(); contentHandler.processingInstruction(target, data); } break; case XMLStreamConstants.START_DOCUMENT: -encoding = parser.getEncoding
Re: [cp-patches] StAX parser
Mark Wielaard wrote: The attached patch provides a new StAX XML parser, mostly feature complete but currently without support for DTD validation. 2005-12-12 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/XMLInputFactoryImpl.java, gnu/xml/stream/CRLFReader.java, gnu/xml/stream/XMLInputStreamReader.java, gnu/xml/stream/XMLParser.java: New StAX parser. Woot! The files were checked in, but it seems you forgot to add the above entry to the ChangeLog file. Sorry about that, corrected now. -- Chris Burdess pgp65crzhXhyy.pgp Description: PGP signature ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] StAX SAX parser
These classes implement a JAXP SAX parser on top of the new StAX implementation. 2005-12-12 Chris Burdess [EMAIL PROTECTED] * gnu/xml/stream/SAXParser.java, gnu/xml/stream/SAXParserFactory.java, gnu/xml/stream/XMLParser.java: SAX parser using StAX implementation. -- Chris Burdess Index: gnu/xml/stream/SAXParser.java === RCS file: gnu/xml/stream/SAXParser.java diff -N gnu/xml/stream/SAXParser.java --- /dev/null 1 Jan 1970 00:00:00 - +++ gnu/xml/stream/SAXParser.java 12 Dec 2005 19:47:35 - @@ -0,0 +1,670 @@ +/* SAXParser.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.xml.stream; + +import java.io.InputStream; +import java.io.IOException; +import java.io.Reader; +import java.net.URL; +import java.util.Iterator; +import java.util.Map; +import javax.xml.namespace.QName; +import javax.xml.stream.Location; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLReporter; +import javax.xml.stream.XMLResolver; +import javax.xml.stream.XMLStreamConstants; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + +import org.xml.sax.ContentHandler; +import org.xml.sax.DTDHandler; +import org.xml.sax.EntityResolver; +import org.xml.sax.ErrorHandler; +import org.xml.sax.InputSource; +import org.xml.sax.Parser; +import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; +import org.xml.sax.SAXParseException; +import org.xml.sax.XMLReader; +import org.xml.sax.ext.Attributes2; +import org.xml.sax.ext.DeclHandler; +import org.xml.sax.ext.EntityResolver2; +import org.xml.sax.ext.LexicalHandler; +import org.xml.sax.ext.Locator2; + +/** + * JAXP SAX parser using an underlying StAX parser. + * + * @author a href='mailto:[EMAIL PROTECTED]'Chris Burdess/a + */ +class SAXParser + extends javax.xml.parsers.SAXParser + implements XMLReader, Attributes2, Locator2, XMLResolver, XMLReporter +{ + + ContentHandler contentHandler; + DeclHandler declHandler; + DTDHandler dtdHandler; + EntityResolver entityResolver; + ErrorHandler errorHandler; + LexicalHandler lexicalHandler; + + boolean validating; + boolean namespaceAware; + boolean xIncludeAware; + boolean stringInterning = true; + + XMLParser parser; + String encoding; + String xmlVersion; + boolean xmlStandalone; + + SAXParser(boolean validating, boolean namespaceAware, boolean xIncludeAware) + { +this.validating = validating; +this.namespaceAware = namespaceAware; +this.xIncludeAware = xIncludeAware; + } + + // -- SAXParser -- + + public Parser getParser() +throws SAXException + { +return null; + } + + public XMLReader getXMLReader() +throws SAXException + { +return this; + } + + public boolean isNamespaceAware() + { +return namespaceAware; + } + + public boolean isValidating() + { +return validating; + } + + public void setProperty(String name, Object value) +throws SAXNotRecognizedException, SAXNotSupportedException + { +if (parser != null) + throw new IllegalStateException(parsing in progress); +String FEATURES = http://xml.org/sax/features/;; +String PROPERTIES = http
[cp-patches] Fix for Eclipse transformer bug
I committed the attached patch to fix a problem with the transformer closing a stream which Eclipse did not expect to be closed. 2005-11-20 Chris Burdess [EMAIL PROTECTED] * gnu/xml/transform/TransformerImpl.java: Ensure that output stream is not closed if provided in the StreamResult. -- Chris Burdess ? gnu/xml/transform/TeeInputStream.java Index: gnu/xml/transform/TransformerImpl.java === RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/TransformerImpl.java,v retrieving revision 1.6 diff -u -r1.6 TransformerImpl.java --- gnu/xml/transform/TransformerImpl.java 30 Sep 2005 07:17:04 - 1.6 +++ gnu/xml/transform/TransformerImpl.java 20 Nov 2005 12:02:48 - @@ -487,6 +487,7 @@ throws IOException { OutputStream out = null; +boolean created = false; try { out = sr.getOutputStream(); @@ -523,6 +524,7 @@ URL url = new URL(systemId); out = new FileOutputStream(url.getPath()); } +created = true; } out = new BufferedOutputStream(out); StreamSerializer serializer = @@ -539,7 +541,7 @@ { try { -if (out != null) +if (out != null created) { out.close(); } ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Fix for Eclipse-related Ælfred2 bu g
This fixes a problem in the Ælfred2 SAX parser whereby a MalformedURLException was being thrown even though a custom URI resolver was set on the parser instance. Reported by Michael Koch. 2005-11-09 Chris Burdess [EMAIL PROTECTED] * gnu/xml/aelfred2/SAXDriver.java: Ensure that absolutize does not throw exception when custom entity resolver is set. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin patch Description: Binary data ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches
[cp-patches] Fix for StAX stream writer
Commited this patch to fix bug #24250. 2005-11-06 Chris Burdess [EMAIL PROTECTED] * javax/xml/stream/XMLStreamWriterImpl.java: Fixed handling of namespaces when isPrefixDefaulting is set. -- 犬 Chris Burdess They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety. - Benjamin Franklin diff Description: Binary data ___ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches