From eb7baa129edd08cba1515d97a8c9fad7adfedf3b16cf697622b3355291043262 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Fri, 27 Sep 2019 07:36:30 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jline?expand=0&rev=36 --- jline-java8compat.patch | 67 +++++++++++++++++++++++++++++++++++++++++ jline.changes | 7 +++++ jline.spec | 2 ++ 3 files changed, 76 insertions(+) create mode 100644 jline-java8compat.patch diff --git a/jline-java8compat.patch b/jline-java8compat.patch new file mode 100644 index 0000000..bc3a6b3 --- /dev/null +++ b/jline-java8compat.patch @@ -0,0 +1,67 @@ +diff -urEbwB jline2-jline-2.14.6/src/main/java/jline/internal/InputStreamReader.java jline2-jline-2.14.6.new/src/main/java/jline/internal/InputStreamReader.java +--- jline2-jline-2.14.6/src/main/java/jline/internal/InputStreamReader.java 2018-03-26 11:14:37.000000000 +0200 ++++ jline2-jline-2.14.6.new/src/main/java/jline/internal/InputStreamReader.java 2019-09-27 09:31:17.518979605 +0200 +@@ -13,6 +13,7 @@ + import java.io.OutputStreamWriter; + import java.io.Reader; + import java.io.UnsupportedEncodingException; ++import java.nio.Buffer; + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; +@@ -68,7 +69,7 @@ + decoder = Charset.defaultCharset().newDecoder().onMalformedInput( + CodingErrorAction.REPLACE).onUnmappableCharacter( + CodingErrorAction.REPLACE); +- bytes.limit(0); ++ ((Buffer)bytes).limit(0); + } + + /** +@@ -101,7 +102,7 @@ + throw (UnsupportedEncodingException) + new UnsupportedEncodingException(enc).initCause(e); + } +- bytes.limit(0); ++ ((Buffer)bytes).limit(0); + } + + /** +@@ -118,7 +119,7 @@ + dec.averageCharsPerByte(); + this.in = in; + decoder = dec; +- bytes.limit(0); ++ ((Buffer)bytes).limit(0); + } + + /** +@@ -136,7 +137,7 @@ + decoder = charset.newDecoder().onMalformedInput( + CodingErrorAction.REPLACE).onUnmappableCharacter( + CodingErrorAction.REPLACE); +- bytes.limit(0); ++ ((Buffer)bytes).limit(0); + } + + /** +@@ -262,7 +263,7 @@ + } else if (was_red == 0) { + break; + } +- bytes.limit(bytes.limit() + was_red); ++ ((Buffer)bytes).limit(bytes.limit() + was_red); + needInput = false; + } + +@@ -273,8 +274,8 @@ + // compact the buffer if no space left + if (bytes.limit() == bytes.capacity()) { + bytes.compact(); +- bytes.limit(bytes.position()); +- bytes.position(0); ++ ((Buffer)bytes).limit(bytes.position()); ++ ((Buffer)bytes).position(0); + } + needInput = true; + } else { diff --git a/jline.changes b/jline.changes index 3acc7cb..ecd9c74 100644 --- a/jline.changes +++ b/jline.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Sep 27 07:34:45 UTC 2019 - Fridrich Strba + +- Added patch: + * jline-java8compat.patch + + build binaries compatible with Java 8 + ------------------------------------------------------------------- Thu Jun 27 09:06:19 UTC 2019 - Fridrich Strba diff --git a/jline.spec b/jline.spec index cbdaaed..b84111d 100644 --- a/jline.spec +++ b/jline.spec @@ -25,6 +25,7 @@ Group: Development/Libraries/Java URL: https://github.com/jline/jline2 Source0: https://github.com/jline/jline2/archive/jline-%{version}.tar.gz Source1: %{name}-build.xml +Patch0: jline-java8compat.patch BuildRequires: ant BuildRequires: fdupes BuildRequires: hawtjni-runtime @@ -50,6 +51,7 @@ This package contains the API documentation for %{name}. %prep %setup -q -n jline2-jline-%{version} +%patch0 -p1 %pom_change_dep org.fusesource.jansi:jansi org.fusesource.jansi:jansi:1.12 cp %{SOURCE1} build.xml mkdir -p lib