/hg/icedtea: Patch the JAXWS source if getDTDType() has the wron...
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Tue Nov 17 08:55:59 PST 2009
changeset 3a12a790af72 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=3a12a790af72
author: Andrew John Hughes <ahughes at redhat.com>
date: Tue Nov 17 17:00:32 2009 +0000
Patch the JAXWS source if getDTDType() has the wrong return type
(gcj 4.3 and earlier)
2009-11-17 Andrew John Hughes <ahughes at redhat.com>
* Makefile.am: Make use of JAXWS dependent on
absence of javax.annotation.Resource and/or getDTDType()
bug. Add new JAXWS patch. (extract-jaxws.stamp): Apply
getDTDType() patch if bug found.
* acinclude.m4: (IT_GETDTDTYPE_CHECK): Check for old versions
of gcj/Classpath which have
javax.xml.stream.events.Attribute.getDTDType() with a return
type of QName not String.
* configure.ac: Invoke new IT_GETDTDTYPE_CHECK macro.
* patches/icedtea-jaxws-getdtdtype.patch: New patch to work
around the getDTDType() bug.
diffstat:
5 files changed, 155 insertions(+), 9 deletions(-)
ChangeLog | 18 +++++++
Makefile.am | 60 ++++++++++++++++++++++---
acinclude.m4 | 74 ++++++++++++++++++++++++++++++++
configure.ac | 1
patches/icedtea-jaxws-getdtdtype.patch | 11 ++++
diffs (229 lines):
diff -r bd1accbb0f3b -r 3a12a790af72 ChangeLog
--- a/ChangeLog Tue Nov 17 13:27:54 2009 +0000
+++ b/ChangeLog Tue Nov 17 17:00:32 2009 +0000
@@ -1,3 +1,21 @@ 2009-11-17 Gary Benson <gbenson at redhat
+2009-11-17 Andrew John Hughes <ahughes at redhat.com>
+
+ * Makefile.am:
+ Make use of JAXWS dependent on absence of
+ javax.annotation.Resource and/or getDTDType()
+ bug. Add new JAXWS patch.
+ (extract-jaxws.stamp): Apply getDTDType() patch
+ if bug found.
+ * acinclude.m4:
+ (IT_GETDTDTYPE_CHECK): Check for old versions of
+ gcj/Classpath which have
+ javax.xml.stream.events.Attribute.getDTDType()
+ with a return type of QName not String.
+ * configure.ac:
+ Invoke new IT_GETDTDTYPE_CHECK macro.
+ * patches/icedtea-jaxws-getdtdtype.patch:
+ New patch to work around the getDTDType() bug.
+
2009-11-17 Gary Benson <gbenson at redhat.com>
* acinclude.m4:
diff -r bd1accbb0f3b -r 3a12a790af72 Makefile.am
--- a/Makefile.am Tue Nov 17 13:27:54 2009 +0000
+++ b/Makefile.am Tue Nov 17 17:00:32 2009 +0000
@@ -85,15 +85,23 @@ JDK_SOLARIS = openjdk/jdk/src/solaris/cl
JDK_SOLARIS = openjdk/jdk/src/solaris/classes
LANGTOOLS = openjdk/langtools/src/share/classes
CORBA = openjdk/corba/src/share/classes
-if LACKS_JAVAX_ANNOTATION_RESOURCE
JAXWS = $(BUILD_OUTPUT_DIR)/jaxws/drop/jaxws_src/src
-endif
NETX_SRCDIR = $(abs_top_srcdir)/netx
NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources
+if DTDTYPE_QNAME
+NEED_JAXWS_SRC = true
+JAXWS_COND = $(JAXWS)
+endif
+
+if LACKS_JAVAX_ANNOTATION_RESOURCE
+NEED_JAXWS_SRC = true
+JAXWS_COND = $(JAXWS)
+endif
+
OPENJDK_SOURCEPATH_DIRS = \
- $(JDK_SHARE):$(JDK_SOLARIS):$(LANGTOOLS):$(CORBA):$(JAXWS)
+ $(JDK_SHARE):$(JDK_SOLARIS):$(LANGTOOLS):$(CORBA):$(JAXWS_COND)
SOURCEPATH_DIRS = $(abs_top_builddir)/generated:$(OPENJDK_SOURCEPATH_DIRS):$(NETX_SRCDIR)
@@ -425,6 +433,10 @@ ICEDTEA_BOOT_PATCHES += $(SCANNER_PATCHE
ICEDTEA_BOOT_PATCHES += $(SCANNER_PATCHES)
endif
endif
+
+# Patches for JAXWS
+
+JAXWS_PATCHES = patches/icedtea-jaxws-getdtdtype.patch
# OpenJDK build environment.
if ZERO_BUILD
@@ -1283,12 +1295,41 @@ clean-extract-cacao: clean-cacao
rm -f stamps/extract-cacao.stamp
stamps/extract-jaxws.stamp: stamps/extract-openjdk.stamp
-if LACKS_JAVAX_ANNOTATION_RESOURCE
- (cd openjdk/jaxws ; \
- $(ANT) -Ddrops.dir=$(abs_top_builddir)/drops \
- -Doutput.dir=$(BUILD_OUTPUT_DIR)/jaxws \
- source ; \
- cd ../..)
+ if test "x$(NEED_JAXWS_SRC)" = "xtrue"; then \
+ (cd openjdk/jaxws ; \
+ $(ANT) -Ddrops.dir=$(abs_top_builddir)/drops \
+ -Doutput.dir=$(BUILD_OUTPUT_DIR)/jaxws \
+ source ; \
+ cd $(abs_top_builddir)) ; \
+ fi
+if DTDTYPE_QNAME
+ (cd $(BUILD_OUTPUT_DIR)/jaxws; \
+ all_patches_ok=yes; \
+ for p in $(JAXWS_PATCHES) ; \
+ do \
+ if test x$${all_patches_ok} = "xyes" \
+ && echo Checking $$p \
+ && $(PATCH) -l -p0 --dry-run -s -t -f \
+ -F 0 < $(abs_top_srcdir)/$$p ; \
+ then \
+ echo Applying $$p ; \
+ $(PATCH) -l -p0 < $(abs_top_srcdir)/$$p ; \
+ if ! grep "^\* $$(basename $$p)" $(abs_top_srcdir)/HACKING \
+ >> stamps/extract-jaxws.stamp.tmp ; \
+ then \
+ echo "* $$(basename $$p): UNDOCUMENTED" \
+ >> stamps/extract-jaxws.stamp.tmp ; \
+ fi ; \
+ else \
+ test x$${all_patches_ok} = "xyes" && all_patches_ok=$$p ; \
+ fi ; \
+ done ; \
+ if ! test x$${all_patches_ok} = "xyes"; then \
+ echo ERROR patch $${all_patches_ok} FAILED! ; \
+ echo WARNING make clean-extract-jaxws before retrying a fix ; \
+ exit 2; \
+ fi ; \
+ cd $(abs_top_builddir)) ;
endif
mkdir -p stamps
touch $@
@@ -1299,6 +1340,7 @@ clean-extract-jaxws:
$(ANT) -Doutput.dir=$(BUILD_OUTPUT_DIR)/jaxws clobber ; \
cd ../../); \
fi
+ mkdir -p stamps
rm -f stamps/extract-jaxws.stamp
# Link ports sources into tree
diff -r bd1accbb0f3b -r 3a12a790af72 acinclude.m4
--- a/acinclude.m4 Tue Nov 17 13:27:54 2009 +0000
+++ b/acinclude.m4 Tue Nov 17 17:00:32 2009 +0000
@@ -1561,3 +1561,77 @@ AC_DEFUN([IT_FIND_NUMBER_OF_PROCESSORS],
])
AC_PROVIDE([$0])dnl
])
+
+AC_DEFUN([IT_GETDTDTYPE_CHECK],[
+ AC_CACHE_CHECK([if javax.xml.stream.events.Attribute.getDTDType() wrongly returns a QName], it_cv_dtdtype, [
+ CLASS=Test.java
+ BYTECODE=$(echo $CLASS|sed 's#\.java##')
+ mkdir tmp.$$
+ cd tmp.$$
+ cat << \EOF > $CLASS
+[/* [#]line __oline__ "configure" */
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.Characters;
+import javax.xml.stream.events.EndElement;
+import javax.xml.stream.events.StartElement;
+
+import java.lang.reflect.Method;
+
+public class Test
+ implements Attribute
+{
+ // This method will not qualify if using an
+ // old version of Classpath where it returns
+ // a QName.
+ public String getDTDType() { return "Boom"; }
+
+ // Other Attribute methods
+ public QName getName() { return null; }
+ public String getValue() { return "Bang"; }
+ public boolean isSpecified() { return false; }
+
+ // XMLEvent methods
+ public Characters asCharacters() { return null; }
+ public EndElement asEndElement() { return null; }
+ public StartElement asStartElement() { return null; }
+ public int getEventType() { return 42; }
+ public Location getLocation() { return null; }
+ public QName getSchemaType() { return null; }
+ public boolean isAttribute() { return true; }
+ public boolean isCharacters() { return false; }
+ public boolean isEndDocument() { return false; }
+ public boolean isEndElement() { return false; }
+ public boolean isEntityReference() { return false; }
+ public boolean isNamespace() { return false; }
+ public boolean isProcessingInstruction() { return false; }
+ public boolean isStartDocument() { return false; }
+ public boolean isStartElement() { return false; }
+ public void writeAsEncodedUnicode(java.io.Writer w) {}
+
+ public static void main(String[] args)
+ {
+ for (Method m : Attribute.class.getMethods())
+ if (m.getName().equals("getDTDType"))
+ if (m.getReturnType().equals(QName.class))
+ System.exit(1);
+ }
+}]
+EOF
+ if $JAVAC -cp . $JAVACFLAGS -source 5 $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then
+ if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then
+ it_cv_dtdtype=no;
+ else
+ it_cv_dtdtype=yes;
+ fi
+ else
+ it_cv_dtdtype=yes;
+ fi
+ rm -f $CLASS *.class
+ cd ..
+ rmdir tmp.$$
+ ])
+AM_CONDITIONAL([DTDTYPE_QNAME], test x"${it_cv_dtdtype}" = "xyes")
+AC_PROVIDE([$0])dnl
+])
diff -r bd1accbb0f3b -r 3a12a790af72 configure.ac
--- a/configure.ac Tue Nov 17 13:27:54 2009 +0000
+++ b/configure.ac Tue Nov 17 17:00:32 2009 +0000
@@ -217,6 +217,7 @@ IT_CHECK_FOR_CLASS([JAVA_UTIL_SCANNER],
IT_CHECK_FOR_CLASS([JAVA_UTIL_SCANNER], [java.util.Scanner])
IT_PR40630_CHECK
IT_CHECK_FOR_CLASS([JAVAX_ANNOTATION_RESOURCE], [javax.annotation.Resource])
+IT_GETDTDTYPE_CHECK
IT_CHECK_ENABLE_WARNINGS
FIND_RHINO_JAR
diff -r bd1accbb0f3b -r 3a12a790af72 patches/icedtea-jaxws-getdtdtype.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-jaxws-getdtdtype.patch Tue Nov 17 17:00:32 2009 +0000
@@ -0,0 +1,11 @@
+--- openjdk.orig/build/linux-amd64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXEventConnector.java 2009-11-17 16:37:06.000000000 +0000
++++ openjdk/build/linux-amd64/jaxws/drop/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StAXEventConnector.java 2009-11-17 16:38:00.000000000 +0000
+@@ -276,7 +276,7 @@
+ qName = localName;
+ else
+ qName = prefix + ':' + localName;
+- String type = staxAttr.getDTDType();
++ String type = staxAttr.getDTDType().toString();
+ String value = staxAttr.getValue();
+
+ attrs.addAttribute(uri, localName, qName, type, value);
More information about the distro-pkg-dev
mailing list