public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: FYI: disable XML service files
@ 2007-03-09 22:09 Tom Tromey
  2007-03-10  6:39 ` Andrew Haley
  2007-03-12  9:55 ` Gary Benson
  0 siblings, 2 replies; 13+ messages in thread
From: Tom Tromey @ 2007-03-09 22:09 UTC (permalink / raw)
  To: GCJ-patches

I'm checking this in on the trunk and the RH 4.1 branch.

This removes the XML service files from libgcj.so.  This lets us
override things properly again.

Andrew, I tried your test case from ifoox, but I can only see the
failure if I back out some of the latest XML bug fixes.  However a
simpler test case shows which thing we're actually loading:

    import javax.xml.parsers.*;
    public class q {
      public static void main(String[] args) throws Throwable{
        DocumentBuilderFactory tf = DocumentBuilderFactory.newInstance();
        System.out.println(tf.getClass());
      }
    }

Eg, here's the bug in action:

opsy. gij -Djava.class.path=/usr/share/java/xerces-j2.jar:. q
class gnu.xml.dom.DomDocumentBuilderFactory

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* sources.am, Makefile.in: Rebuilt.
	* scripts/makemake.tcl (scan_directory): Allow service files to be
	omitted.
	Omit all XML-related service files.

Index: scripts/makemake.tcl
===================================================================
--- scripts/makemake.tcl	(revision 122761)
+++ scripts/makemake.tcl	(working copy)
@@ -123,6 +123,14 @@
 # We haven't merged locale resources yet.
 set properties_map(gnu/java/locale) _
 
+# We want to be able to load xerces if it is on the class path.  So,
+# we have to avoid compiling in the XML-related service files.
+set properties_map(META-INF/services/javax.xml.parsers.DocumentBuilderFactory) _
+set properties_map(META-INF/services/javax.xml.parsers.SAXParserFactory) _
+set properties_map(META-INF/services/javax.xml.parsers.TransformerFactory) _
+set properties_map(META-INF/services/org.relaxng.datatype.DatatypeLibraryFactory) _
+set properties_map(META-INF/services/org.w3c.dom.DOMImplementationSourceList) _
+set properties_map(META-INF/services/org.xml.sax.driver) _
 
 # List of all properties files.
 set properties_files {}
@@ -223,8 +231,10 @@
     } elseif {[file isdirectory $file]} {
       lappend subdirs $subdir/$file
     } elseif {$subdir == "META-INF/services"} {
-      # All service files are included as properties.
-      lappend properties_files $basedir/$subdir/$file
+      # Service files are generally included as properties.
+      if {! [info exists properties_map($subdir/$file)]} {
+	lappend properties_files $basedir/$subdir/$file
+      }
     }
   }
   cd $here

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-03-13 18:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-09 22:09 Patch: FYI: disable XML service files Tom Tromey
2007-03-10  6:39 ` Andrew Haley
2007-03-10 18:34   ` Tom Tromey
2007-03-12  9:55 ` Gary Benson
2007-03-12 13:06   ` Andrew Haley
2007-03-12 15:44     ` Gary Benson
2007-03-12 15:51       ` Andrew Haley
2007-03-12 16:50         ` Gary Benson
2007-03-12 17:08           ` Andrew Haley
2007-03-13 10:07             ` Gary Benson
2007-03-12 18:05   ` Tom Tromey
2007-03-13 10:01     ` Gary Benson
2007-03-13 18:53       ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).