Adapt external/beanshell to Java 9

For one, drop a spurious target="1.5" so that ant instead uses the passed-in
JAVA_TARGET_VER (which needs to be 1.6 for Java 9).

For another, the deprecated java.awt.Component.getPeer method finally got
removed, so bsh.util.AWTConsole would no longer compile.  But it looks like that
class is not used by us anyway, so just remove the problematic code.
(workdir/UnpackedTarball/beanshell/docs/manual/bshmanual.html: "Web Browser
Access:  After starting the server you can connect your web browser to the port
you specified.   BeanShell will respond by sending an HTML page offering you a
choice of the Swing based JConsole or the older AWTConsole.  You may choose
whichever is appropriate for your web browser.  [...]  The bsh.util.AWTConsole
is a legacy implementation of the GUI Console using AWT instead of Swing.  This
console does work, but it is not as slick or pretty as the JConsole.  The
primary reason it is still here is to support remote access from generic web
browsers using only Java 1.1.")

Change-Id: I9f1112caebae9a55e4eec7f9baa0114b2254ccda
This commit is contained in:
Stephan Bergmann
2017-08-31 11:47:28 +02:00
parent 4082b5874a
commit f20810a131
2 changed files with 22 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,beanshell,\
$(eval $(call gb_UnpackedTarball_add_patches,beanshell,\
external/beanshell/bsh-2.0b1-src.patch \
external/beanshell/beanshell-invoke.patch \
external/beanshell/java9.patch.0 \
))
# vim: set noet sw=4 ts=4:

21
external/beanshell/java9.patch.0 vendored Normal file
View File

@@ -0,0 +1,21 @@
--- build.xml
+++ build.xml
@@ -176,7 +176,6 @@
deprecation="${deprecation}"
optimize="on"
debug="on"
- target="1.5"
includes="**/*.java"
excludes="${excludes},**/bak/**"
>
--- src/bsh/util/AWTConsole.java
+++ src/bsh/util/AWTConsole.java
@@ -214,8 +214,6 @@
Great. What a piece of crap.
*/
public void setCaretPosition( int pos ) {
- ((java.awt.peer.TextComponentPeer)getPeer()).setCaretPosition(
- pos + countNLs() );
}
/*