Removed nullpointer
This commit is contained in:
parent
6f211c8b86
commit
9fca87d677
|
@ -1,5 +1,6 @@
|
||||||
package love.distributedrebirth.bassboon.jpp.util.concurrent.locks;
|
package love.distributedrebirth.bassboon.jpp.util.concurrent.locks;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.locks.Condition;
|
import java.util.concurrent.locks.Condition;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
|
@ -14,6 +15,7 @@ public final class DummyReadWriteLock implements ReadWriteLock {
|
||||||
|
|
||||||
private final static Lock LOCK_READ = new DummyLock();
|
private final static Lock LOCK_READ = new DummyLock();
|
||||||
private final static Lock LOCK_WRITE = new DummyLock();
|
private final static Lock LOCK_WRITE = new DummyLock();
|
||||||
|
private final static DummyCondition LOCK_CONDITION = new DummyCondition();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Lock readLock() {
|
public Lock readLock() {
|
||||||
|
@ -25,6 +27,40 @@ public final class DummyReadWriteLock implements ReadWriteLock {
|
||||||
return LOCK_WRITE;
|
return LOCK_WRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static final class DummyCondition implements Condition {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void await() throws InterruptedException {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean await(long arg0, TimeUnit arg1) throws InterruptedException {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long awaitNanos(long nanosTimeout) throws InterruptedException {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void awaitUninterruptibly() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean awaitUntil(Date deadline) throws InterruptedException {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void signal() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void signalAll() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static final class DummyLock implements Lock {
|
static final class DummyLock implements Lock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,7 +73,7 @@ public final class DummyReadWriteLock implements ReadWriteLock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Condition newCondition() {
|
public Condition newCondition() {
|
||||||
return null;
|
return LOCK_CONDITION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue