Skip to content

Commit

Permalink
Add override annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
石宝迪 authored and 石宝迪 committed Sep 26, 2022
1 parent 4728597 commit a51f891
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,23 @@
public final class NoOpLock implements Lock {
public static final NoOpLock INSTANCE = new NoOpLock();

@Override
public void lock() {
}

@Override
public void lockInterruptibly() throws InterruptedException {
if (Thread.interrupted()) {
throw new InterruptedException();
}
}

@Override
public boolean tryLock() {
return true;
}

@Override
public boolean tryLock(long l, TimeUnit tu) throws InterruptedException {
if (Thread.interrupted()) {
throw new InterruptedException();
Expand All @@ -46,9 +50,11 @@ public boolean tryLock(long l, TimeUnit tu) throws InterruptedException {
}
}

@Override
public void unlock() {
}

@Override
public Condition newCondition() {
throw new UnsupportedOperationException();
}
Expand Down

0 comments on commit a51f891

Please sign in to comment.