Skip to content
This repository was archived by the owner on Aug 13, 2018. It is now read-only.

Commit 7574c69

Browse files
committed
removed small bug
1 parent b7694b7 commit 7574c69

File tree

3 files changed

+28
-20
lines changed

3 files changed

+28
-20
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ Function<String, String> func = new Closure().func()
7575

7676
## FRP - combining both in Java
7777

78+
## persistent and immutable data structures in Java

src/org/rapidpm/workshop/frp/core/model/Memoizer.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.rapidpm.workshop.frp.core.model;
22

3-
import org.rapidpm.workshop.frp.m05_functional.v002_memoizing.M05V011;
3+
44

55
import java.util.Map;
66
import java.util.Objects;
@@ -47,13 +47,13 @@ public static <T1, T2, R> BiFunction<T1, T2, R> memoize(final BiFunction<T1, T2,
4747
public interface TriFunction<T1, T2,T3, R> {
4848
R apply(T1 t1, T2 t2, T3 t3);
4949

50-
default <V> M05V011.TriFunction<T1, T2,T3, V> andThen(Function<? super R, ? extends V> after) {
50+
default <V> TriFunction<T1, T2,T3, V> andThen(Function<? super R, ? extends V> after) {
5151
Objects.requireNonNull(after);
5252
return (T1 t1, T2 t2, T3 t3) -> after.apply(apply(t1, t2, t3));
5353
}
5454
}
5555

56-
public static <T1, T2,T3, R> M05V011.TriFunction<T1, T2,T3, R> memoize(final TriFunction<T1, T2,T3, R> threeFunc) {
56+
public static <T1, T2,T3, R> TriFunction<T1, T2,T3, R> memoize(final TriFunction<T1, T2,T3, R> threeFunc) {
5757
final TriFunction<T1, T2,T3, Supplier<R>> threeFuncSupplier = (x, y, z) -> () -> threeFunc.apply(x, y,z);
5858
final Function<T1, Function<T2, Function<T3, R>>> transformed
5959
= Memoizer.memoize(

src/org/rapidpm/workshop/frp/m00_basics/v000/Main001.java

+24-17
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,37 @@
1616
*/
1717
public class Main001 {
1818

19-
public static class DemoClass {
20-
static {
21-
System.out.println(" static 001");
22-
}
19+
public static final MySubClass MY_SUB_CLASS_STATIC_001 = new MySubClass();
20+
public final MySubClass mySubClass = new MySubClass();
2321

24-
static {
25-
System.out.println(" static 002");
26-
}
22+
static {
23+
System.out.println("static 01");
24+
}
2725

28-
{
29-
System.out.println(" non- static 001");
30-
}
26+
public static final MySubClass MY_SUB_CLASS_STATIC_002 = new MySubClass();
3127

32-
{
33-
System.out.println(" non- static 002");
34-
}
28+
static {
29+
System.out.println("static 02");
30+
}
31+
32+
{
33+
System.out.println("non- static 01");
34+
35+
}
36+
{
37+
System.out.println("non- static 02");
3538

36-
public DemoClass() {
37-
System.out.println(" constructor ");
38-
}
3939
}
4040

4141
public static void main(String[] args) {
42-
new DemoClass();
42+
43+
final MySubClass mySubClass = new MySubClass();
44+
final Main001 myClass = new Main001();
4345
}
4446

47+
public static class MySubClass {
48+
public MySubClass() {
49+
System.out.println(" MySubClass ");
50+
}
51+
}
4552
}

0 commit comments

Comments
 (0)