Merge pull request #10 from adriaanm/gkossakowski-nameHashing/private-members

Test & fix for regression in Lazy serialization uncovered by #2325
This commit is contained in:
Grzegorz Kossakowski
2015-12-22 19:46:43 +01:00
4 changed files with 11 additions and 2 deletions
@@ -3,11 +3,17 @@
*/
package xsbti.api;
import java.io.ObjectStreamException;
import java.io.ObjectStreamException;
public abstract class AbstractLazy<T> implements Lazy<T>, java.io.Serializable
{
private Object writeReplace() throws ObjectStreamException
// `writeReplace` must be `protected`, so that the `Impl` subclass
// inherits the serialization override.
//
// (See source-dependencies/java-analysis-serialization-error, which would
// crash trying to serialize an AbstractLazy, because it pulled in an
// unserializable type eventually.)
protected Object writeReplace() throws ObjectStreamException
{
return new StrictLazy<T>(get());
}
@@ -0,0 +1 @@
public class Outer { private class T extends Thread {} }
@@ -0,0 +1 @@
incOptions := incOptions.value.withNameHashing(true).withApiDebug(true)
@@ -0,0 +1 @@
> compile