diff --git a/rhino-457336.diff b/rhino-457336.diff new file mode 100644 index 0000000..450daee --- /dev/null +++ b/rhino-457336.diff @@ -0,0 +1,32 @@ +This patch attempts to fix a null pointer exception in Rhino when Rhino's +attempt to dynamically load the jline library fails. See Red Hat Bugzilla +bug #457336: + https://bugzilla.redhat.com/show_bug.cgi?id=457336 + +This patch is subject to the Rhino License: + https://developer.mozilla.org/en/Rhino_License + +This patch can be applied with: + patch -p 0 < rhino-457336.diff +Please send comments and questions to: + selliott4@austin.rr.com + +--- toolsrc/org/mozilla/javascript/tools/shell/ShellLine.java.orig 2009-05-30 18:59:58.000000000 -0500 ++++ toolsrc/org/mozilla/javascript/tools/shell/ShellLine.java 2009-05-30 21:17:10.000000000 -0500 +@@ -62,6 +62,16 @@ + // We don't want a compile-time dependency on the JLine jar, so use + // reflection to load and reference the JLine classes. + ClassLoader classLoader = ShellLine.class.getClassLoader(); ++ if (classLoader == null) { ++ // If the attempt to get a class specific class loader above failed ++ // then fallback to the system class loader. ++ classLoader = ClassLoader.getSystemClassLoader(); ++ } ++ if (classLoader == null) { ++ // If for some reason we still don't have a handle to a class ++ // loader then give up (avoid a NullPointerException). ++ return null; ++ } + Class readerClass = Kit.classOrNull(classLoader, "jline.ConsoleReader"); + if (readerClass == null) + return null; diff --git a/rhino.script b/rhino.script index 8d78ce2..6417c55 100644 --- a/rhino.script +++ b/rhino.script @@ -18,7 +18,9 @@ fi # Configuration MAIN_CLASS=org.mozilla.javascript.tools.shell.Main -BASE_JARS="rhino xmlbeans/xbean" +# Remove xmlbeans until we have it in Fedora +#BASE_JARS="rhino jline xmlbeans/xbean" +BASE_JARS="rhino jline" # Set parameters set_jvm diff --git a/rhino.spec b/rhino.spec index 9cfe478..dca30ce 100644 --- a/rhino.spec +++ b/rhino.spec @@ -28,11 +28,11 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -%define cvs_version 1_7R2pre +%define cvs_version 1_7R2 Name: rhino Version: 1.7 -Release: 0.5.r2pre.1.1%{?dist} +Release: 0.6.r2%{?dist} Epoch: 0 Summary: JavaScript for Java License: MPLv1.1 or GPLv2+ @@ -42,14 +42,17 @@ Source0: ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino%{cvs_version}.zip Source2: %{name}.script Patch0: %{name}-build.patch +# Patch to try several methods of loading jline library or fail gracefully +Patch1: %{name}-457336.diff URL: http://www.mozilla.org/rhino/ Group: Development/Libraries/Java BuildRequires: ant BuildRequires: bea-stax-api BuildRequires: java-1.6.0-openjdk-devel >= 1:1.6.0.0 -Requires: jpackage-utils - +Requires: jpackage-utils +Requires: jline + # Disable xmlbeans until we can get it into Fedora #Requires: xmlbeans #BuildRequires: xmlbeans @@ -86,6 +89,7 @@ Javadoc for %{name}. %prep %setup -q -n %{name}%{cvs_version} %patch0 -p1 +%patch1 -p0 -b .jline # Fix build %{__perl} -pi -e 's|.*\n||' build.xml testsrc/build.xml toolsrc/org/mozilla/javascript/tools/debugger/build.xml xmlimplsrc/build.xml @@ -158,8 +162,9 @@ popd %doc %{_javadocdir}/* %changelog -* Mon Apr 20 2009 Lillian Angel - 0:1.7-0.5.r2pre.1.1 -- Updated release. +* Sun May 31 2009 Toshio Kuratomi - 0:1.7-0.6.r2 +- Update to rhino1_7R2 +- Add patch from Steven Elliott to fix exception in the interpreter shell. * Mon Apr 20 2009 Lillian Angel - 0:1.7-0.4.r2pre.1.1 - Added jpackage-utils requirement. diff --git a/sources b/sources index 1da0988..a3ccdef 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d891a156695f1f51450899424a3ca0dc rhino1_7R2pre.zip +40d0a9abec8169e42920214b37fa8e0e rhino1_7R2.zip