|
1 | 1 | /*
|
2 | 2 | * Copyright (C) 2012-2015 Typesafe Inc. <http://www.typesafe.com>
|
3 | 3 | */
|
4 |
| -package scala.compat.java8; |
| 4 | +package scala.runtime.java8; |
5 | 5 |
|
6 | 6 | import org.apache.commons.lang3.SerializationUtils;
|
7 | 7 | import scala.runtime.*;
|
8 | 8 |
|
9 | 9 | import static junit.framework.Assert.assertEquals;
|
10 |
| -import static scala.compat.java8.JFunction.*; |
11 |
| -import static scala.compat.java8.TestAPI.*; |
| 10 | +import static scala.runtime.java8.JFunction.*; |
| 11 | +import static scala.runtime.java8.TestAPI.*; |
12 | 12 |
|
13 | 13 | import org.junit.Test;
|
14 | 14 |
|
@@ -99,20 +99,23 @@ public void lambdaDemo() {
|
99 | 99 | acceptFunction22Unit( proc((v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) -> {v1.toUpperCase(); return;}));
|
100 | 100 | }
|
101 | 101 |
|
| 102 | + /* |
| 103 | + // The JFunctions in 2.12.0-M4 are not Serializable anymore |
102 | 104 | @Test
|
103 | 105 | public void isSerializable() {
|
104 |
| - scala.compat.java8.JFunction0<String> f0 = () -> "foo"; |
| 106 | + scala.runtime.java8.JFunction0<String> f0 = () -> "foo"; |
105 | 107 | assertEquals("foo", SerializationUtils.clone(f0).apply());
|
106 | 108 |
|
107 |
| - scala.compat.java8.JFunction1<String, String> f1 = (a) -> a.toUpperCase(); |
| 109 | + scala.runtime.java8.JFunction1<String, String> f1 = (a) -> a.toUpperCase(); |
108 | 110 | assertEquals("FOO", SerializationUtils.clone(f1).apply("foo"));
|
109 | 111 |
|
110 |
| - scala.compat.java8.JFunction2<String, String, String> f2 = (a, b) -> a + b; |
| 112 | + scala.runtime.java8.JFunction2<String, String, String> f2 = (a, b) -> a + b; |
111 | 113 | assertEquals("foobar", SerializationUtils.clone(f2).apply("foo", "bar"));
|
112 | 114 |
|
113 |
| - scala.compat.java8.JFunction3<String, String, String, String> f3 = (a, b, c) -> a + b + c; |
| 115 | + scala.runtime.java8.JFunction3<String, String, String, String> f3 = (a, b, c) -> a + b + c; |
114 | 116 | assertEquals("foobarbaz", SerializationUtils.clone(f3).apply("foo", "bar", "baz"));
|
115 | 117 | }
|
| 118 | + */ |
116 | 119 |
|
117 | 120 | private static scala.concurrent.Future<Integer> futureExample(
|
118 | 121 | scala.concurrent.Future<String> future, scala.concurrent.ExecutionContext ec) {
|
|
0 commit comments