import java.util.concurrent.locks.*;

class JSR166 {
	Lock l = new ReentrantLock();

	int x;

	void l() {
		l.lock();
	}

	void foo() {
		l.lock();
		x++;
		if (x >= 0)
			l.unlock();
	}

	void increment() {
		l.lock();
		x++;
		l.unlock();
	}

	void decrement() {
		l.lock();
		try {
			x++;
		} finally {
			l.unlock();
		}
	}

	void waitOnCondition(Condition cond) throws InterruptedException {
		while (x == 0) {
			cond.wait();
			cond.wait(1000L);
			cond.wait(1000L, 10);
		}
	}

	void awaitNotInLoop(Condition cond) throws InterruptedException {
		cond.await();
	}
}

@@ -76,16 +76,79 @@
 tLock();
+%0A%09ReentrantReadWriteLock rwlock = new ReentrantReadWriteLock();
 %0A%0A%09int x
@@ -382,24 +382,153 @@
 ();%0A%09%09%7D%0A%09%7D%0A%0A
+%09Object bug1479629() %7B%0A%09%09try %7B%0A%09%09%09rwlock.readLock().lock();%0A%09%09%09return null;%0A%09%09%7D finally %7B%0A%09%09%09rwlock.readLock().unlock();%0A%09%09%7D%0A%09%7D%0A%0A
 %09void waitOn

false positive bug1479629