@Test(expectedExceptions = IllegalMonitorStateException.class) public void testCheckHoldWriteLockFail() { GraphLock lock = new GraphLock(); lock.checkHoldWriteLock(); }
public void checkHoldWriteLock() { if (!readWriteLock.isWriteLockedByCurrentThread()) { throw new IllegalMonitorStateException( "Impossible to perform a write operation without lock. Wrap your code with a write lock to solve this."); } }
GraphLock { public void checkHoldWriteLock() { if (!readWriteLock.isWriteLockedByCurrentThread()) { throw new IllegalMonitorStateException( "Impossible to perform a write operation without lock. Wrap your code with a write lock to solve this."); } } }
GraphLock { public void checkHoldWriteLock() { if (!readWriteLock.isWriteLockedByCurrentThread()) { throw new IllegalMonitorStateException( "Impossible to perform a write operation without lock. Wrap your code with a write lock to solve this."); } } GraphLock(); }
GraphLock { public void checkHoldWriteLock() { if (!readWriteLock.isWriteLockedByCurrentThread()) { throw new IllegalMonitorStateException( "Impossible to perform a write operation without lock. Wrap your code with a write lock to solve this."); } } GraphLock(); void readLock(); void readUnlock(); void readUnlockAll(); void writeLock(); void writeUnlock(); void checkHoldWriteLock(); }
GraphLock { public void checkHoldWriteLock() { if (!readWriteLock.isWriteLockedByCurrentThread()) { throw new IllegalMonitorStateException( "Impossible to perform a write operation without lock. Wrap your code with a write lock to solve this."); } } GraphLock(); void readLock(); void readUnlock(); void readUnlockAll(); void writeLock(); void writeUnlock(); void checkHoldWriteLock();  }