#767 AbstractPredicateSet.isEmpty is backwards

open
nobody
8
2009-06-01
2009-06-01
No

The check in AbstractPredicateSet.isEmpty is backwards. Here is the source code for that test, in file plt/src/edu/rice/cs/plt/collect/AbstractPredicateSet.java:

/** Returns {@code size(1) != 0}. */
@Override public boolean isEmpty() { return size(1) != 0; }

This function will return true precisely when the receiver set is not empty. The correct code should be:

/** Returns {@code size(1) != 0}. */
@Override public boolean isEmpty() { return size(1) == 0; }

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks