--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Wed Jul 06 09:42:27 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Wed Jul 06 12:46:37 2016 -0700
@@ -106,6 +106,9 @@
/** dump statistics about lambda code generation */
private boolean dumpLambdaToMethodStats;
+ /** force serializable representation, for stress testing **/
+ private final boolean forceSerializable;
+
/** Flag for alternate metafactories indicating the lambda object is intended to be serializable */
public static final int FLAG_SERIALIZABLE = 1 << 0;
@@ -141,6 +144,7 @@
Options options = Options.instance(context);
dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
attr = Attr.instance(context);
+ forceSerializable = options.isSet("forceSerializable");
}
// </editor-fold>
@@ -1825,6 +1829,9 @@
/** does this functional expression require serialization support? */
boolean isSerializable() {
+ if (forceSerializable) {
+ return true;
+ }
for (Type target : tree.targets) {
if (types.asSuper(target, syms.serializableType.tsym) != null) {
return true;