Skip to content

Commit

Permalink
maven doesn't like these lambdas, doesn't compile
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyweston committed Sep 16, 2018
1 parent 19cf233 commit 1b3b62e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ public void locksAndUnlocksWhenExceptionThrown() throws Exception {
}

private Callable<Void, RuntimeException> something() {
return () -> null;
return new Callable<Void, RuntimeException>() {
@Override
public Void call() throws RuntimeException {
return null;
}
};
}

private Callable<Void, Exception> somethingThatThrowsException() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ public void hold(Callable<Void, RuntimeException> callable) {

@Override
public Callable<Void, RuntimeException> take() {
return () -> {
countdownAndAwait(latch);
synchronized (lock) {
// take the commodity!
return new Callable<Void, RuntimeException>() {
@Override
public Void call() throws RuntimeException {
SynchronizedLock.this.countdownAndAwait(latch);
synchronized (lock) {
// take the commodity!
}
return null;
}
return null;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ public void isNotSatisfied() {
}

private Callable<String, RuntimeException> lambda(final String value) {
return () -> value;
return new Callable<String, RuntimeException>() {
@Override
public String call() throws RuntimeException {
return value;
}
};
}

private static ProbeFor<String> stateOfTheEconomy() {
Expand Down

0 comments on commit 1b3b62e

Please sign in to comment.