From 8c50ab98364c9c2012e39e4a76e1e15790bee5c6 Mon Sep 17 00:00:00 2001 From: gil Date: Sat, 5 Apr 2014 01:23:08 +0200 Subject: [PATCH] make JDOM sort methods public --- jdom-2.0.5-java8.patch | 33 +++++++++++++++++++++++++++++++++ jdom2.spec | 6 ++++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 jdom-2.0.5-java8.patch diff --git a/jdom-2.0.5-java8.patch b/jdom-2.0.5-java8.patch new file mode 100644 index 0000000..9399b81 --- /dev/null +++ b/jdom-2.0.5-java8.patch @@ -0,0 +1,33 @@ +diff -Nru jdom-JDOM-2.0.5/core/src/java/org/jdom2/AttributeList.java jdom-JDOM-2.0.5-gil/core/src/java/org/jdom2/AttributeList.java +--- jdom-JDOM-2.0.5/core/src/java/org/jdom2/AttributeList.java 2013-04-17 00:00:39.000000000 +0200 ++++ jdom-JDOM-2.0.5-gil/core/src/java/org/jdom2/AttributeList.java 2014-04-05 01:16:17.473795389 +0200 +@@ -606,7 +606,7 @@ + * + * @param comp The Comparator to use for sorting. + */ +- void sort(Comparator comp) { ++ public void sort(Comparator comp) { + final int sz = size; + int[] indexes = new int[sz]; + for (int i = 0 ; i < sz; i++) { +diff -Nru jdom-JDOM-2.0.5/core/src/java/org/jdom2/ContentList.java jdom-JDOM-2.0.5-gil/core/src/java/org/jdom2/ContentList.java +--- jdom-JDOM-2.0.5/core/src/java/org/jdom2/ContentList.java 2013-04-17 00:00:39.000000000 +0200 ++++ jdom-JDOM-2.0.5-gil/core/src/java/org/jdom2/ContentList.java 2014-04-05 01:17:24.004508188 +0200 +@@ -628,7 +628,7 @@ + return left; + } + +- final void sort(final Comparator comp) { ++ public final void sort(final Comparator comp) { + final int sz = size; + int[] indexes = new int[sz]; + for (int i = 0 ; i < sz; i++) { +@@ -1238,7 +1238,7 @@ + } + + +- final void sort(final Comparator comp) { ++ public final void sort(final Comparator comp) { + // this size() forces a full scan/update of the list. + final int sz = size(); + final int[] indexes = new int[sz]; diff --git a/jdom2.spec b/jdom2.spec index bdf6b11..78ff78c 100644 --- a/jdom2.spec +++ b/jdom2.spec @@ -12,6 +12,9 @@ Source2: jdom-junit-template.pom # Disable gpg signatures # Process contrib and junit pom files Patch0: jdom-2.0.5-build.patch +# Resolve conflict with java8 +# make JDOM sort methods public +Patch1: jdom-2.0.5-java8.patch BuildRequires: java-devel BuildRequires: java-javadoc @@ -62,14 +65,13 @@ find . -name "*.jar" -print -delete %patch0 -p0 sed -i "s|%{_javadir}/objectweb-asm|%{_javadir}/objectweb-asm3|" build.xml +%patch1 -p1 cp -p %{SOURCE1} maven/contrib.pom cp -p %{SOURCE2} maven/junit.pom sed -i 's/\r//' LICENSE.txt README.txt -sed -i "s|final void sort(final Comparator comp) {|public final void sort(final Comparator comp) {|" core/src/java/org/jdom2/ContentList.java - %build ant -Dversion=%{version} -Dj2se.apidoc=%{_javadocdir}/java maven