The isEmpty() method on java.util.Collection is provided to see if a collection has any elements. Comparing the value of size() to 0 merely duplicates existing behavior.public class Foo { void good() { List foo = getList(); if (foo.isEmpty()) { // blah } } void bad() { List foo = getList(); if (foo.size() == 0) { // blah } } }Additional info can be found at this http://pmd.sourceforge.net/rules/design.html#UseCollectionIsEmpty site.
| 1 | org.jcoderz.commons.util.JaxbUtil |
| [279:17] | |
| 1 | org.jcoderz.commons.taskdefs.LuntBuildTask |
| [425:9] | |
| 1 | org.jcoderz.phoenix.sqlparser.SqlParser |
| [341:14] | |
| 1 | org.jcoderz.phoenix.report.ReportNormalizerAntTask |
| [363:11] | |
| 1 | org.jcoderz.phoenix.report.JcoderzReportAntTask |
| [376:11] | |
| 1 | org.jcoderz.phoenix.cmpgen2.TypeMapping |
| [170:17] | |