@@ -19,13 +19,12 @@ object LambdaDeserializer {
19
19
* concurrent deserialization of the same lambda expression may spin up more than one class.
20
20
*
21
21
* Assumptions:
22
- * - No additional marker interfaces are required beyond `{ java.io,scala.} Serializable`. These are
22
+ * - No additional marker interfaces are required beyond `java.io. Serializable`. These are
23
23
* not stored in `SerializedLambda`, so we can't reconstitute them.
24
24
* - No additional bridge methods are passed to `altMetafactory`. Again, these are not stored.
25
25
*
26
26
* @param lookup The factory for method handles. Must have access to the implementation method, the
27
- * functional interface class, and `java.io.Serializable` or `scala.Serializable` as
28
- * required.
27
+ * functional interface class, and `java.io.Serializable`.
29
28
* @param cache A cache used to avoid spinning up a class for each deserialization of a given lambda. May be `null`
30
29
* @param serialized The lambda to deserialize. Note that this is typically created by the `readResolve`
31
30
* member of the anonymous class created by `LambdaMetaFactory`.
@@ -77,20 +76,15 @@ object LambdaDeserializer {
77
76
throw new IllegalArgumentException (" Illegal lambda deserialization" )
78
77
}
79
78
80
- val flags : Int = LambdaMetafactory .FLAG_SERIALIZABLE | LambdaMetafactory .FLAG_MARKERS
81
- val isScalaFunction = functionalInterfaceClass.getName.startsWith(" scala.Function" )
82
- val markerInterface : Class [_] = loader.loadClass(if (isScalaFunction) ScalaSerializable else JavaIOSerializable )
79
+ val flags : Int = LambdaMetafactory .FLAG_SERIALIZABLE
83
80
84
81
LambdaMetafactory .altMetafactory(
85
82
lookup, getFunctionalInterfaceMethodName, invokedType,
86
83
87
84
/* samMethodType = */ funcInterfaceSignature,
88
85
/* implMethod = */ implMethod,
89
86
/* instantiatedMethodType = */ instantiated,
90
- /* flags = */ flags.asInstanceOf [AnyRef ],
91
- /* markerInterfaceCount = */ 1 .asInstanceOf [AnyRef ],
92
- /* markerInterfaces[0] = */ markerInterface,
93
- /* bridgeCount = */ 0 .asInstanceOf [AnyRef ]
87
+ /* flags = */ flags.asInstanceOf [AnyRef ]
94
88
)
95
89
}
96
90
@@ -111,8 +105,6 @@ object LambdaDeserializer {
111
105
factory.invokeWithArguments(captures : _* )
112
106
}
113
107
114
- private [this ] val ScalaSerializable = " scala.Serializable"
115
-
116
108
private [this ] val JavaIOSerializable = {
117
109
// We could actually omit this marker interface as LambdaMetaFactory will add it if
118
110
// the FLAG_SERIALIZABLE is set and of the provided markers extend it. But the code
0 commit comments