Patch: FYI: make xml classes work
Tom Tromey
tromey@redhat.com
Tue Aug 23 16:53:00 GMT 2005
I'm checking this in on the trunk.
A simple program like this will fail right now:
import org.xml.sax.*;
import org.xml.sax.helpers.*;
public class xml {
public static void main(String[] args) throws Throwable {
XMLReader r = XMLReaderFactory.createXMLReader();
System.out.println(r);
}
}
The reason is that we don't set a default XML provider.
This is easily solved by compiling in the META-INF resources.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* aclocal.m4, Makefile.in: Rebuilt.
* Makefile.am (property_files): Added META-INF files.
(propertyo_files): Changed definition.
($(propertyo_files)): Updated patterns.
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.499
diff -u -r1.499 Makefile.am
--- Makefile.am 22 Aug 2005 22:36:26 -0000 1.499
+++ Makefile.am 23 Aug 2005 16:50:42 -0000
@@ -298,11 +298,15 @@
classpath/resource/gnu/java/awt/peer/gtk/font.properties \
classpath/resource/gnu/regexp/MessagesBundle_it.properties \
classpath/resource/gnu/regexp/MessagesBundle_fr.properties \
-classpath/resource/gnu/regexp/MessagesBundle.properties
+classpath/resource/gnu/regexp/MessagesBundle.properties \
+classpath/resource/META-INF/services/org.xml.sax.driver \
+classpath/resource/META-INF/services/javax.xml.parsers.SAXParserFactory \
+classpath/resource/META-INF/services/javax.xml.parsers.DocumentBuilderFactory \
+classpath/resource/META-INF/services/javax.xml.parsers.TransformerFactory
-propertyo_files = $(patsubst classpath/resource/%,%,$(property_files:.properties=.properties.lo))
+propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))
-$(propertyo_files): %.properties.lo: classpath/resource/%.properties
+$(propertyo_files): %.lo: classpath/resource/%
$(mkinstalldirs) `dirname $@`; \
$(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)
More information about the Java-patches
mailing list