File netbeans-resolver-6.1.patch of Package netbeans-resolver

diff -Nur xml-commons-resolver-1.1/resolver.xml xml-commons-resolver-1.1.new/resolver.xml
--- xml-commons-resolver-1.1/resolver.xml	2003-11-04 21:56:18.000000000 +0300
+++ xml-commons-resolver-1.1.new/resolver.xml	2008-07-12 01:20:42.000000000 +0400
@@ -83,7 +83,7 @@
 
    <echo message="Compiling..." />
 
-   <javac srcdir="${src.dir}" destdir="${build.classes.dir}">
+   <javac srcdir="${src.dir}" destdir="${build.classes.dir}" source="1.4" debug="on">
      <!-- <classpath> not needed since Ant already supplies these Sep-03 -sc -->
      <include name="${resolver.subdir}/*.java"/>
      <include name="${resolver.subdir}/helpers/*.java"/>
diff -Nur xml-commons-resolver-1.1/src/org/apache/xml/resolver/Catalog.java xml-commons-resolver-1.1.new/src/org/apache/xml/resolver/Catalog.java
--- xml-commons-resolver-1.1/src/org/apache/xml/resolver/Catalog.java	2003-11-04 21:56:16.000000000 +0300
+++ xml-commons-resolver-1.1.new/src/org/apache/xml/resolver/Catalog.java	2008-07-12 01:38:28.000000000 +0400
@@ -64,6 +64,7 @@
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Vector;
+import java.util.Iterator;
 import java.net.URL;
 import java.net.MalformedURLException;
 import org.apache.xml.resolver.CatalogManager;
@@ -1164,7 +1165,22 @@
     }
   }
 
-
+  /**
+   * Return all registered public IDs.
+   */
+  public Iterator getPublicIDs() {
+      Vector v = new Vector();
+      Enumeration enum = catalogEntries.elements();
+
+      while (enum.hasMoreElements()) {
+        CatalogEntry e = (CatalogEntry) enum.nextElement();
+        if (e.getEntryType() == PUBLIC) {
+            v.add(e.getEntryArg(0));
+        }
+      }
+      return v.iterator();
+  }
+
   /**
    * Return the applicable DOCTYPE system identifier.
    *
diff -Nur xml-commons-resolver-1.1/src/org/apache/xml/resolver/CatalogManager.java xml-commons-resolver-1.1.new/src/org/apache/xml/resolver/CatalogManager.java
--- xml-commons-resolver-1.1/src/org/apache/xml/resolver/CatalogManager.java	2003-11-04 21:56:16.000000000 +0300
+++ xml-commons-resolver-1.1.new/src/org/apache/xml/resolver/CatalogManager.java	2008-07-12 01:47:35.000000000 +0400
@@ -249,7 +249,11 @@
     // to avoid it.
   }
 
-  /** Constructor that specifies an explicit property file. */
+  /**
+   * Constructor that specifies an explicit property file.
+   * @param propertyFile path to poperty file (e.g. com/resources/CatalogManager).
+   * <code>null</code> means that no property file is consulted at all.
+   */
   public CatalogManager(String propertyFile) {
     this.propertyFile = propertyFile;
 
@@ -276,13 +280,14 @@
    * resources from it.
    */
   private synchronized void readProperties() {
+    if (propertyFile == null) return;
     try {
       propertyFileURI = CatalogManager.class.getResource("/"+propertyFile);
       InputStream in =
 	CatalogManager.class.getResourceAsStream("/"+propertyFile);
       if (in==null) {
 	if (!ignoreMissingProperties) {
-	  System.err.println("Cannot find "+propertyFile);
+	  debug.message(2, "Cannot find "+propertyFile);
 	  // there's no reason to give this warning more than once
 	  ignoreMissingProperties = true;
 	}
diff -Nur xml-commons-resolver-1.1/src/org/apache/xml/resolver/tools/CatalogResolver.java xml-commons-resolver-1.1.new/src/org/apache/xml/resolver/tools/CatalogResolver.java
--- xml-commons-resolver-1.1/src/org/apache/xml/resolver/tools/CatalogResolver.java	2003-11-04 21:56:16.000000000 +0300
+++ xml-commons-resolver-1.1.new/src/org/apache/xml/resolver/tools/CatalogResolver.java	2008-07-12 02:34:22.000000000 +0400
@@ -223,30 +223,9 @@
     String resolved = getResolvedEntity(publicId, systemId);
 
     if (resolved != null) {
-      try {
 	InputSource iSource = new InputSource(resolved);
 	iSource.setPublicId(publicId);
-
-	// Ideally this method would not attempt to open the
-	// InputStream, but there is a bug (in Xerces, at least)
-	// that causes the parser to mistakenly open the wrong
-	// system identifier if the returned InputSource does
-	// not have a byteStream.
-	//
-	// It could be argued that we still shouldn't do this here,
-	// but since the purpose of calling the entityResolver is
-	// almost certainly to open the input stream, it seems to
-	// do little harm.
-	//
-	URL url = new URL(resolved);
-	InputStream iStream = url.openStream();
-	iSource.setByteStream(iStream);
-
 	return iSource;
-      } catch (Exception e) {
-	catalogManager.debug.message(1, "Failed to create InputSource", resolved);
-	return null;
-      }
     }
 
     return null;
openSUSE Build Service is sponsored by