mozilla/rhino — pull request #15 by ianso (2011-10-21 13:57:25+00:00)
Title: NativeJavaPackage implements Serializable, contains non-serialisable members

Hello everyone,

The class `NativeJavaPackage` has a `ClassLoader` as a member field, and in the Sun OpenJDK 6 this is generally a non-serialisable class.

The attached patch modifies this field to be transient, and adds a `readObject` method that re-sets the classloader from the `Context` in which the object is being read.

This is a very small patch but is a prerequisite for fixing the [second of these test-cases ](http://groups.google.com/group/mozilla-rhino/browse_thread/thread/4dd522e2689705bb) concerning continuations & script serialization.

Best regards,

- Ian