Fix build with jdk9

OBS-URL: https://build.opensuse.org/package/show/Java:packages/axis?expand=0&rev=28
This commit is contained in:
Fridrich Strba 2017-10-05 06:19:16 +00:00 committed by Git OBS Bridge
parent f5ff3461a1
commit 2b423152c6
6 changed files with 116 additions and 4 deletions

View File

@ -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,

52
axis-compareto.patch Normal file
View File

@ -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

10
axis-encoding.patch Normal file
View File

@ -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">
<exclude name="**/old/**/*" />
<exclude name="**/bak/**"/>

28
axis-enum.patch Normal file
View File

@ -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 <item>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();

View File

@ -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

View File

@ -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