From c218a3c73e9a87adfb17fa1f14b2effc5df60ce6 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Mon, 20 Jul 2020 21:38:46 +0200 Subject: [PATCH] adjustments for Java 11 compatibility --- 0000-source-target-1.8.patch | 35 ++++++++++++++++++++++++++++++++ 0001-java-11-compatibility.patch | 27 ++++++++++++++++++++++++ bsh.spec | 13 +++++++++++- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 0000-source-target-1.8.patch create mode 100644 0001-java-11-compatibility.patch diff --git a/0000-source-target-1.8.patch b/0000-source-target-1.8.patch new file mode 100644 index 0000000..bb33137 --- /dev/null +++ b/0000-source-target-1.8.patch @@ -0,0 +1,35 @@ +From 62ea7bb2656177fbb61d94b90d9a526990876cb8 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Mon, 20 Jul 2020 21:27:20 +0200 +Subject: [PATCH 0/1] source / target 1.8 + +--- + build.xml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/build.xml b/build.xml +index 4f400dc..0d28a7f 100644 +--- a/build.xml ++++ b/build.xml +@@ -170,7 +170,8 @@ + deprecation="${deprecation}" + optimize="on" + debug="on" +- target="1.5" ++ source="1.8" ++ target="1.8" + includes="**/*.java" + excludes="${excludes},**/bak/**" + > +@@ -213,7 +214,7 @@ + destdir="${javadoc-dir}" + author="true" + version="true" +- source="1.5" ++ source="1.8" + use="true" + windowtitle="BeanShell ${version}" + doctitle="<h1>BeanShell ${version}<h1>" +-- +2.26.2 + diff --git a/0001-java-11-compatibility.patch b/0001-java-11-compatibility.patch new file mode 100644 index 0000000..36271b8 --- /dev/null +++ b/0001-java-11-compatibility.patch @@ -0,0 +1,27 @@ +From 9b83372c64f30f44bd56696ae6adcbe6a83e1e2f Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Mon, 20 Jul 2020 21:28:13 +0200 +Subject: [PATCH 1/1] java 11 compatibility + +--- + src/bsh/util/AWTConsole.java | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/bsh/util/AWTConsole.java b/src/bsh/util/AWTConsole.java +index e88fbff..fbb237b 100644 +--- a/src/bsh/util/AWTConsole.java ++++ b/src/bsh/util/AWTConsole.java +@@ -214,8 +214,8 @@ public class AWTConsole extends TextArea + Great. What a piece of crap. + */ + public void setCaretPosition( int pos ) { +- ((java.awt.peer.TextComponentPeer)getPeer()).setCaretPosition( +- pos + countNLs() ); ++ //((java.awt.peer.TextComponentPeer)getPeer()).setCaretPosition( ++ // pos + countNLs() ); + } + + /* +-- +2.26.2 + diff --git a/bsh.spec b/bsh.spec index fb7a928..ae5cf67 100644 --- a/bsh.spec +++ b/bsh.spec @@ -33,7 +33,7 @@ Name: bsh Version: 2.0 -Release: 17.%{reltag}%{?dist} +Release: 18.%{reltag}%{?dist} Epoch: 0 Summary: Lightweight Scripting for Java URL: http://www.beanshell.org/ @@ -48,6 +48,12 @@ Source1: %{name}-desktop.desktop # Remove code marked as SUN PROPRIETARY/CONFIDENTAIL Source2: generate-tarball.sh +# compatibility with Java 11: +# - set javac / javadoc source and target values to 1.8 +Patch0: 0000-source-target-1.8.patch +# - remove references to invisible symbols and methods +Patch1: 0001-java-11-compatibility.patch + BuildRequires: javapackages-local BuildRequires: ant BuildRequires: bsf @@ -109,6 +115,8 @@ This package provides %{summary}. %prep %setup -q -n beanshell-%{version}%{reltag} +%patch0 -p1 +%patch1 -p1 sed -i 's,org.apache.xalan.xslt.extensions.Redirect,http://xml.apache.org/xalan/redirect,' docs/manual/xsl/*.xsl @@ -170,6 +178,9 @@ cat scripts/bshdoc.bsh >> %{buildroot}%{_bindir}/bshdoc %license LICENSE NOTICE %changelog +* Mon Jul 20 2020 Fabio Valentini - 0:2.0-18.b6 +- Make adjustments for Java 11 compatibility. + * Fri Jul 10 2020 Jiri Vanek - 0:2.0-17.b6 - Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11