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
commit b76db70044
4 changed files with 11 additions and 2 deletions

View File

@ -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());
}

View File

@ -0,0 +1 @@
public class Outer { private class T extends Thread {} }

View File

@ -0,0 +1 @@
incOptions := incOptions.value.withNameHashing(true).withApiDebug(true)

View File

@ -0,0 +1 @@
> compile