package npe;


public class GuaranteedDereferenceInteractionWithAssertionMethods {

	public Object x;

	public boolean b;

	public int falsePositive() {

		if (x == null)
			System.out.println("x is null");
		if (b) {
			x = bar();
			checkForError();
		}

		return x.hashCode();
	}

	public void checkForError() {

	}
	public void reportError() {

	}
	public Object bar() {
		return new Object();
	}

	public int report(Object x, Object y, Object z) {
		if (x == null && y == null) 
			reportError();
			
		if (z == null)
			z = new Object();
		return x.hashCode() + z.hashCode();
	}
	
	public int report2(Object x, Object y, Object z) {
		if (x == null && y == null) 
			reportError();
			
		if (z == null)
			z = new Object();
		int result = x.hashCode() + z.hashCode();
		checkForError();
		return result;
	}
}

package npe;


public class GuaranteedDereferenceInteractionWithAssertionMethods {

	public Object x;

	public boolean b;

	public int falsePositive() {

		if (x == null)
			System.out.println("x is null");
		if (b) {
			x = bar();
			checkForError();
		}

		return x.hashCode();
	}

	int falsePositive2(Object x) {
		if (x == null) 
			reportError();
		return x.hashCode();
		
		
	}
	public void checkForError() {

	}
	public void reportError() {

	}
	public Object bar() {
		return new Object();
	}

	public int report(Object x, Object y, Object z) {
		if (x == null && y == null) 
			reportError();
			
		if (z == null)
			z = new Object();
		return x.hashCode() + z.hashCode();
	}
	
	public int report2(Object x, Object y, Object z) {
		if (x == null && y == null) 
			reportError();
			
		if (z == null)
			z = new Object();
		int result = x.hashCode() + z.hashCode();
		checkForError();
		return result;
	}
}

Add another false positive test case
Add another false positive test case


git-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@6399 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3
