Author: maartenc
Date: Sat Jan 8 07:46:44 2011
New Revision: 1056649
URL: http://svn.apache.org/viewvc?rev=1056649&view=rev
Log:
Fixed failing unit tests with JDK 1.4
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/UpdateSiteDigestParser.java
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java?rev=1056649&r1=1056648&r2=1056649&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
Sat Jan 8 07:46:44 2011
@@ -32,12 +32,8 @@ import org.apache.ivy.osgi.util.Version;
import org.apache.ivy.util.Message;
import org.apache.ivy.util.XMLHelper;
import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
public class OBRXMLParser {
@@ -47,9 +43,7 @@ public class OBRXMLParser {
try {
XMLHelper.parse(in, null, handler, null);
} catch (ParserConfigurationException e) {
- ParseException exc = new ParseException(e.getMessage(), 0);
- exc.initCause(e);
- throw exc;
+ throw new SAXException(e);
}
return handler.repo;
}
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java?rev=1056649&r1=1056648&r2=1056649&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
Sat Jan 8 07:46:44 2011
@@ -25,14 +25,14 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.ivy.osgi.p2.PropertiesParser.PropertiesHandler;
import org.apache.ivy.osgi.util.DelegetingHandler;
import org.apache.ivy.osgi.util.Version;
+import org.apache.ivy.util.XMLHelper;
import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
public class P2ArtifactParser implements XMLInputParser {
@@ -43,10 +43,12 @@ public class P2ArtifactParser implements
}
public void parse(InputStream in) throws ParseException, IOException,
SAXException {
- XMLReader reader = XMLReaderFactory.createXMLReader();
RepositoryHandler handler = new RepositoryHandler(p2Descriptor);
- reader.setContentHandler(handler);
- reader.parse(new InputSource(in));
+ try {
+ XMLHelper.parse(in, null, handler, null);
+ } catch (ParserConfigurationException e) {
+ throw new SAXException(e);
+ }
}
static class RepositoryHandler extends DelegetingHandler {
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java?rev=1056649&r1=1056648&r2=1056649&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
Sat Jan 8 07:46:44 2011
@@ -19,7 +19,6 @@ package org.apache.ivy.osgi.p2;
import java.io.IOException;
import java.io.InputStream;
-import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.ParseException;
@@ -28,6 +27,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.ivy.osgi.core.BundleCapability;
import org.apache.ivy.osgi.core.BundleInfo;
import org.apache.ivy.osgi.core.BundleRequirement;
@@ -36,11 +37,9 @@ import org.apache.ivy.osgi.p2.Properties
import org.apache.ivy.osgi.util.DelegetingHandler;
import org.apache.ivy.osgi.util.Version;
import org.apache.ivy.osgi.util.VersionRange;
+import org.apache.ivy.util.XMLHelper;
import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
public class P2MetadataParser implements XMLInputParser {
@@ -51,10 +50,12 @@ public class P2MetadataParser implements
}
public void parse(InputStream in) throws ParseException, IOException,
SAXException {
- XMLReader reader = XMLReaderFactory.createXMLReader();
RepositoryHandler handler = new RepositoryHandler(p2Descriptor);
- reader.setContentHandler(handler);
- reader.parse(new InputSource(in));
+ try {
+ XMLHelper.parse(in, null, handler, null);
+ } catch (ParserConfigurationException e) {
+ throw new SAXException(e);
+ }
}
static class RepositoryHandler extends DelegetingHandler {
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java?rev=1056649&r1=1056648&r2=1056649&view=diff
==============================================================================
---
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java
(original)
+++
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/EclipseUpdateSiteParser.java
Sat Jan 8 07:46:44 2011
@@ -21,23 +21,24 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.text.ParseException;
-import java.util.ArrayList;
+
+import javax.xml.parsers.ParserConfigurationException;
import org.apache.ivy.osgi.util.DelegetingHandler;
import org.apache.ivy.osgi.util.Version;
+import org.apache.ivy.util.XMLHelper;
import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
public class EclipseUpdateSiteParser {
public static UpdateSite parse(InputStream in) throws ParseException,
IOException, SAXException {
- XMLReader reader = XMLReaderFactory.createXMLReader();
SiteHandler handler = new SiteHandler();
- reader.setContentHandler(handler);
- reader.parse(new InputSource(in));
+ try {
+ XMLHelper.parse(in, null, handler, null);
+ } catch (ParserConfigurationException e) {
+ throw new SAXException(e);
+ }
return handler.updatesite;
}
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java?rev=1056649&r1=1056648&r2=1056649&view=diff
==============================================================================
---
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java
(original)
+++
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/FeatureParser.java
Sat Jan 8 07:46:44 2011
@@ -24,27 +24,24 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.ivy.osgi.util.DelegetingHandler;
import org.apache.ivy.osgi.util.Version;
+import org.apache.ivy.util.XMLHelper;
import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
public class FeatureParser {
public static EclipseFeature parse(InputStream in) throws ParseException,
IOException,
SAXException {
- XMLReader reader;
+ FeatureHandler handler = new FeatureHandler();
try {
- reader = XMLReaderFactory.createXMLReader();
- } catch (SAXException e) {
- throw new ParseException(e.getMessage(), 0);
+ XMLHelper.parse(in, null, handler, null);
+ } catch (ParserConfigurationException e) {
+ throw new SAXException(e);
}
- FeatureHandler handler = new FeatureHandler();
- reader.setContentHandler(handler);
- reader.parse(new InputSource(in));
return handler.feature;
}
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/UpdateSiteDigestParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/UpdateSiteDigestParser.java?rev=1056649&r1=1056648&r2=1056649&view=diff
==============================================================================
---
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/UpdateSiteDigestParser.java
(original)
+++
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/updatesite/xml/UpdateSiteDigestParser.java
Sat Jan 8 07:46:44 2011
@@ -21,23 +21,25 @@ import java.io.IOException;
import java.io.InputStream;
import java.text.ParseException;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.ivy.osgi.core.ExecutionEnvironmentProfileProvider;
import org.apache.ivy.osgi.updatesite.UpdateSiteDescriptor;
import org.apache.ivy.osgi.updatesite.xml.FeatureParser.FeatureHandler;
import org.apache.ivy.osgi.util.DelegetingHandler;
-import org.xml.sax.InputSource;
+import org.apache.ivy.util.XMLHelper;
import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
public class UpdateSiteDigestParser {
public static UpdateSiteDescriptor parse(InputStream in, UpdateSite site)
throws ParseException, IOException, SAXException {
- XMLReader reader = XMLReaderFactory.createXMLReader();
DigestHandler handler = new DigestHandler(site);
- reader.setContentHandler(handler);
- reader.parse(new InputSource(in));
+ try {
+ XMLHelper.parse(in, null, handler, null);
+ } catch (ParserConfigurationException e) {
+ throw new SAXException(e);
+ }
return handler.repoDescriptor;
}