From 2b423152c6cab8531631203c7928010083cc25cb5bc3f425a4af4b4b29f8f7f5 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 5 Oct 2017 06:19:16 +0000 Subject: [PATCH] Fix build with jdk9 OBS-URL: https://build.opensuse.org/package/show/Java:packages/axis?expand=0&rev=28 --- axis-MANIFEST.MF | 1 - axis-compareto.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++ axis-encoding.patch | 10 +++++++++ axis-enum.patch | 28 ++++++++++++++++++++++++ axis.changes | 17 +++++++++++++++ axis.spec | 12 +++++++--- 6 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 axis-compareto.patch create mode 100644 axis-encoding.patch create mode 100644 axis-enum.patch diff --git a/axis-MANIFEST.MF b/axis-MANIFEST.MF index 9a6eb41..063ef5e 100644 --- a/axis-MANIFEST.MF +++ b/axis-MANIFEST.MF @@ -31,7 +31,6 @@ Export-Package: org.apache.axis, org.apache.axis.encoding, org.apache.axis.encoding.ser, org.apache.axis.encoding.ser.castor, - org.apache.axis.enum, org.apache.axis.handlers, org.apache.axis.handlers.http, org.apache.axis.handlers.soap, diff --git a/axis-compareto.patch b/axis-compareto.patch new file mode 100644 index 0000000..6197427 --- /dev/null +++ b/axis-compareto.patch @@ -0,0 +1,52 @@ +--- axis-1_4/src/org/apache/axis/types/UnsignedInt.java 2017-10-04 23:06:07.691042250 +0200 ++++ axis-1_4/src/org/apache/axis/types/UnsignedInt.java 2017-10-05 08:10:43.431335157 +0200 +@@ -106,13 +106,20 @@ + + // implement java.lang.comparable interface + public int compareTo(Object obj) { ++ UnsignedInt other = null; ++ if (obj instanceof UnsignedInt) ++ other = (UnsignedInt) obj; ++ if (other != null) { + if (lValue != null) +- return lValue.compareTo(obj); ++ return lValue.compareTo(other.lValue); + else +- if (equals(obj) == true) ++ return 1; // object is greater ++ } else { ++ if (lValue == null) + return 0; // null == null + else +- return 1; // object is greater ++ return -1; ++ } + } + + // Implement java.lang.Number interface +--- axis-1_4/src/org/apache/axis/types/UnsignedLong.java 2017-10-04 23:06:07.691042250 +0200 ++++ axis-1_4/src/org/apache/axis/types/UnsignedLong.java 2017-10-05 08:08:22.105252757 +0200 +@@ -100,12 +100,20 @@ + + // implement java.lang.comparable interface + public int compareTo(Object obj) { ++ UnsignedLong other = null; ++ if (obj instanceof UnsignedLong) ++ other = (UnsignedLong) obj; ++ if (other != null) { + if (lValue != null) +- return lValue.compareTo(obj); +- else if (equals(obj) == true) +- return 0; // null == null ++ return lValue.compareTo(other.lValue); + else + return 1; // object is greater ++ } else { ++ if (lValue == null) ++ return 0; // null == null ++ else ++ return -1; ++ } + } + + // Implement java.lang.Number interface diff --git a/axis-encoding.patch b/axis-encoding.patch new file mode 100644 index 0000000..0267bc6 --- /dev/null +++ b/axis-encoding.patch @@ -0,0 +1,10 @@ +--- axis-1_4/build.xml 2017-10-04 23:06:07.711042250 +0200 ++++ axis-1_4/build.xml 2017-10-04 23:06:59.603042446 +0200 +@@ -99,6 +99,7 @@ + deprecation="${deprecation}" + source="${source}" + target="${target}" ++ encoding="ISO-8859-1" + classpathref="classpath"> + + diff --git a/axis-enum.patch b/axis-enum.patch new file mode 100644 index 0000000..0732314 --- /dev/null +++ b/axis-enum.patch @@ -0,0 +1,28 @@ +--- axis-1_4/tools/org/apache/axis/tools/ant/foreach/ParamSet.java 2017-10-04 23:06:07.711042250 +0200 ++++ axis-1_4/tools/org/apache/axis/tools/ant/foreach/ParamSet.java 2017-10-05 07:51:54.345811416 +0200 +@@ -83,9 +83,9 @@ + and then s. The ordering of the buildfile is + not guaranteed. */ + Vector values = new Vector(); +- Enumeration enum = filesets.elements(); +- while (enum.hasMoreElements()) { +- FileSet fileSet = (FileSet) enum.nextElement(); ++ Enumeration emun = filesets.elements(); ++ while (emun.hasMoreElements()) { ++ FileSet fileSet = (FileSet) emun.nextElement(); + File base = fileSet.getDir(project); + DirectoryScanner scanner = fileSet.getDirectoryScanner(project); + if (TYPE_DIR != type) { +@@ -103,9 +103,9 @@ + } + } + } +- enum = items.elements(); +- while (enum.hasMoreElements()) { +- ParamItem item = (ParamItem) enum.nextElement(); ++ emun = items.elements(); ++ while (emun.hasMoreElements()) { ++ ParamItem item = (ParamItem) emun.nextElement(); + values.addElement(item.getValue()); + } + return values.elements(); diff --git a/axis.changes b/axis.changes index 05ed24a..268b139 100644 --- a/axis.changes +++ b/axis.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Thu Oct 5 05:54:20 UTC 2017 - fstrba@suse.com + +- Remove the 3 deprecated classes from package org.apache.axis.enum + * allows building with java source and target >= 1.5 +- Added patches: + * axis-encoding.patch + + Specify file encoding ISO-8859-1 in order to avoid compiler + errors with characters unmappable in ASCII + * axis-enum.patch + + Rename variable enum to emun to avoid clash with reserved + word in java5+ + * axis-compareto.patch + + Rewrite the UnsignedInt::compareTo and + UnsignedLong::compareTo to check first that the Object we + compare with is instance of the respective class + ------------------------------------------------------------------- Thu Sep 14 14:22:43 UTC 2017 - fstrba@suse.com diff --git a/axis.spec b/axis.spec index 9227971..b375fd0 100644 --- a/axis.spec +++ b/axis.spec @@ -44,6 +44,9 @@ Patch0: unimplemented-dom3-methods.patch Patch1: axis-1.4-gcc44_build.patch Patch2: axis-manifest.patch Patch3: axis-ant-build.patch +Patch4: axis-encoding.patch +Patch5: axis-compareto.patch +Patch6: axis-enum.patch BuildRequires: ant BuildRequires: ant-jdepend BuildRequires: antlr @@ -72,7 +75,6 @@ Requires: log4j Requires: wsdl4j Obsoletes: %{name}-javadoc BuildArch: noarch -BuildConflicts: java-devel >= 1.9 %description Apache Axis is an implementation of the SOAP ("Simple Object Access @@ -92,11 +94,15 @@ Manual for axis %patch1 -p1 -b gcc44-build %patch2 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 # Remove provided binaries find . -name "*.jar" -exec rm -f {} \; find . -name "*.zip" -exec rm -f {} \; find . -name "*.class" -exec rm -f {} \; +rm -rf src/org/apache/axis/enum cp %{SOURCE1} %{SOURCE2} %{SOURCE3} . @@ -119,8 +125,8 @@ ant -Dcompile.ime=true \ -Djunit.jar=$(build-classpath junit 2>/dev/null) \ -Djimi.jar=$(build-classpath jimi 2>/dev/null) \ -Djsse.jar=$(build-classpath jsse/jsse 2>/dev/null) \ - -Dant.build.javac.source=1.4 \ - -Dant.build.javac.target=1.4 \ + -Dant.build.javac.source=1.6 -Dsource=1.6 \ + -Dant.build.javac.target=1.6 -Dtarget=1.6 \ clean compile %install