ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r952453 - in /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2: PomModuleDescriptorParser.java PomReader.java
Date Mon, 07 Jun 2010 21:49:11 GMT
Author: maartenc
Date: Mon Jun  7 21:49:10 2010
New Revision: 952453

URL: http://svn.apache.org/viewvc?rev=952453&view=rev
Log:
We don't need to pass a URL if we have a Resource available

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=952453&r1=952452&r2=952453&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
Mon Jun  7 21:49:10 2010
@@ -114,7 +114,7 @@ public final class PomModuleDescriptorPa
                                                                     this, res, ivySettings);
         
         try {           
-            PomReader domReader = new PomReader(descriptorURL, res);            
+            PomReader domReader = new PomReader(res);            
             domReader.setProperty("parent.version", domReader.getParentVersion());
             domReader.setProperty("parent.groupId", domReader.getParentGroupId());
             domReader.setProperty("project.parent.version", domReader.getParentVersion());
@@ -140,7 +140,7 @@ public final class PomModuleDescriptorPa
                 if (parentModule != null) {
                     parentDescr = parentModule.getDescriptor();
                 } else {
-                    throw new IOException("Impossible to load parent for " + descriptorURL
+ "."
+                    throw new IOException("Impossible to load parent for " + res.getName()
+ "."
                        + " Parent=" + parentModRevID);
                 }
                 if (parentDescr != null) {
@@ -247,7 +247,7 @@ public final class PomModuleDescriptorPa
                                 mdBuilder.addDependencyMgt((PomDependencyMgt) it2.next());
                             }
                         } else {
-                            throw new IOException("Impossible to import module for " + descriptorURL
+ "."
+                            throw new IOException("Impossible to import module for " + res.getName()
+ "."
                                + " Import=" + importModRevID);
                         }
                         

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=952453&r1=952452&r2=952453&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java Mon Jun  7
21:49:10 2010
@@ -23,7 +23,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.LineNumberReader;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -88,8 +87,8 @@ public class PomReader {
     private final Element projectElement;
     private final Element parentElement;
     
-    public PomReader(URL descriptorURL, Resource res) throws IOException, SAXException {
-        InputStream stream = new AddDTDFilterInputStream(descriptorURL.openStream());
+    public PomReader(Resource res) throws IOException, SAXException {
+        InputStream stream = new AddDTDFilterInputStream(res.openStream());
         try {
             Document pomDomDoc = XMLHelper.parseToDom(stream, res, new EntityResolver() {
                 public InputSource resolveEntity(String publicId, String systemId) 



Mime
View raw message