From 84fc5c908d78a5a78f7d00226e066e56b9c6cafe Mon Sep 17 00:00:00 2001 From: Carsten Hammer Date: Sat, 6 Apr 2019 20:13:26 +0200 Subject: Convert to lambda or member reference Convert anonymous inner classes to lambda expressions or member references Bug: 545856 CQ: 19537 Change-Id: I621431c178e8b99316314602f7c66c9a36f9ae98 Signed-off-by: Carsten Hammer Signed-off-by: Matthias Sohn --- .../org/eclipse/jgit/junit/MockSystemReader.java | 30 ++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'org.eclipse.jgit.junit/src/org/eclipse') diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java index 8de386e344..89f2530a31 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java @@ -171,22 +171,20 @@ public class MockSystemReader extends SystemReader { /** {@inheritDoc} */ @Override public MonotonicClock getClock() { - return new MonotonicClock() { - @Override - public ProposedTimestamp propose() { - long t = getCurrentTime(); - return new ProposedTimestamp() { - @Override - public long read(TimeUnit unit) { - return unit.convert(t, TimeUnit.MILLISECONDS); - } - - @Override - public void blockUntil(Duration maxWait) { - // Do not wait. - } - }; - } + return () -> { + long t = getCurrentTime(); + return new ProposedTimestamp() { + + @Override + public long read(TimeUnit unit) { + return unit.convert(t, TimeUnit.MILLISECONDS); + } + + @Override + public void blockUntil(Duration maxWait) { + // Do not wait. + } + }; }; } -- cgit v1.2.3