Skip to content

Commit 89a660e

Browse files
committed
Rename JFunc to JFunction.
So as to avoid the inconsistent abbreviation with `JFunctionN`.
1 parent 597ed63 commit 89a660e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sourceGenerators in Compile <+= sourceManaged in Compile map { dir =>
1010
IO.write(f, content)
1111
f
1212
}
13-
Seq(write("JFunc", CodeGen.factory)) ++ (0 to 22).map(n => write("JFunction" + n, CodeGen.fN(n))) ++ (1 to 22).map(n => write("JProcedure" + n, CodeGen.pN(n)))
13+
Seq(write("JFunction", CodeGen.factory)) ++ (0 to 22).map(n => write("JFunction" + n, CodeGen.fN(n))) ++ (1 to 22).map(n => write("JProcedure" + n, CodeGen.pN(n)))
1414
}
1515

1616
sourceGenerators in Test <+= sourceManaged in Test map { dir =>

project/CodeGen.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ object CodeGen {
278278
|
279279
|import scala.runtime.BoxedUnit;
280280
|
281-
|public final class JFunc {
282-
| private JFunc() {}
281+
|public final class JFunction {
282+
| private JFunction() {}
283283
| public static <R> scala.Function0<R> func(JFunction0<R> f) { return f; }
284284
|${indent(ms)}
285285
|}

src/test/java/scala/compat/jdk8/LambdaTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import scala.runtime.*;
77
import static scala.compat.jdk8.TestAPI.*;
8-
import static scala.compat.jdk8.JFunc.*;
8+
import static scala.compat.jdk8.JFunction.*;
99

1010
public class LambdaTest {
1111
public static void main(String[] args) {
@@ -40,7 +40,7 @@ public static void main(String[] args) {
4040
// F1 is a subclass of Function1:
4141
scala.Function1<String, String> f2 = f1;
4242

43-
// Factory methods in `JFunc` can reduce the verbosity a little:
43+
// Factory methods in `JFunction` can reduce the verbosity a little:
4444
// `func` is actually just an identity method; it only exists to
4545
// trigger lambda creation using the `JFunction1` functional interface.
4646
scala.Function1<String, String> f3 = func((String s) -> s);
@@ -65,7 +65,7 @@ public static void main(String[] args) {
6565
// Functions returning unit must use the `JProcedure1`, ... functional interfaces
6666
// in order to convert a void lamdba return to Scala's Unit.
6767
//
68-
// The easiest way to do this is via `JFunc.proc`, ....
68+
// The easiest way to do this is via `JFunction.proc`, ....
6969
//
7070
// Note that the lambda has a return type of `void` if the last
7171
// statement is a call to a `void` returning method, or if it is
@@ -108,4 +108,3 @@ private static String join(String... ss) {
108108
return result;
109109
}
110110
}
111-

0 commit comments

Comments
 (0)