Created
December 28, 2016 16:47
-
-
Save jerrinot/32786cf80e23b10d77c4ce2d18b65068 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lambdaserialization; | |
import org.junit.Test; | |
import java.io.IOException; | |
import java.io.Serializable; | |
import java.util.function.Supplier; | |
public class LambdaSerializationBugTest { | |
@Test | |
public void testSerializationBug() throws IOException, ClassNotFoundException { | |
Supplier<String> s1 = (Supplier & Serializable) new FirstChild()::getFoo; | |
Supplier<String> s2 = (Supplier & Serializable) new SecondChild()::getFoo; | |
Utils.serializeAndDeserialize(s2); | |
} | |
public static class Parent { | |
public String getFoo() { | |
return "foo"; | |
} | |
} | |
public static class FirstChild extends Parent implements Serializable { | |
} | |
public static class SecondChild extends Parent implements Serializable { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://bugs.openjdk.java.net/browse/JDK-8154236