File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
src/com/esotericsoftware/kryo/util
test-kotlin/com.esotericsoftware.kryo Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -93,8 +93,9 @@ public Class nextGenericClass () {
93
93
94
94
@ Override
95
95
public int pushTypeVariables (GenericsHierarchy hierarchy , GenericType [] args ) {
96
- // Do not store type variables if hierarchy is empty or we do not have arguments for all root parameters.
97
- if (hierarchy .total == 0 || hierarchy .rootTotal > args .length ) return 0 ;
96
+ // Do not store type variables if hierarchy is empty, or we do not have arguments for all root parameters,
97
+ // or we have more arguments than the hierarchy has parameters.
98
+ if (hierarchy .total == 0 || hierarchy .rootTotal > args .length || args .length > hierarchy .counts .length ) return 0 ;
98
99
99
100
int startSize = this .argumentsSize ;
100
101
Original file line number Diff line number Diff line change @@ -4,16 +4,12 @@ import com.esotericsoftware.kryo.io.Input
4
4
import com.esotericsoftware.kryo.io.Output
5
5
import org.junit.jupiter.api.Assertions.assertEquals
6
6
import org.junit.jupiter.api.Assertions.assertNotSame
7
- import org.junit.jupiter.api.Disabled
8
7
import org.junit.jupiter.api.Test
9
8
10
- class LambdaTest {
11
- class Example (private val p : (Long ) -> String ) {
12
- constructor () : this ({ it.toString() })
13
- }
9
+ class SerializationTest {
14
10
11
+ // https://github.com/EsotericSoftware/kryo/issues/864
15
12
@Test
16
- @Disabled(" Expected to fail" )
17
13
fun testLambda () {
18
14
val kryo = Kryo ().apply {
19
15
isRegistrationRequired = false
@@ -33,5 +29,9 @@ class LambdaTest {
33
29
assertEquals(example::class .java, deserialized::class .java)
34
30
assertNotSame(example, deserialized)
35
31
}
32
+
33
+ class Example (private val p : (Long ) -> String ) {
34
+ constructor () : this ({ it.toString() })
35
+ }
36
36
}
37
37
You can’t perform that action at this time.
0 commit comments