Menu

#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.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.