Replaced Collection.size() > 0 through !Collection.isEmpty()
This commit is contained in:
parent
489c1f4b5c
commit
e63c849766
7 changed files with 8 additions and 8 deletions
|
@ -120,7 +120,7 @@ public class ModuleParserRSS1 implements ModuleParser {
|
|||
licenses.add(License.findByValue(licenseTag.getAttributeValue("resource", RDF)));
|
||||
}
|
||||
|
||||
if (licenses.size() > 0) {
|
||||
if (!licenses.isEmpty()) {
|
||||
module.setLicenses(licenses.toArray(new License[licenses.size()]));
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public class ModuleParserRSS2 implements ModuleParser {
|
|||
licenses.add(license);
|
||||
}
|
||||
}
|
||||
if (licenses.size() > 0) {
|
||||
if (!licenses.isEmpty()) {
|
||||
module.setAllLicenses(licenses.toArray(new License[0]));
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public class ModuleParserRSS2 implements ModuleParser {
|
|||
final Element licenseTag = it.next();
|
||||
licenses.add(License.findByValue(licenseTag.getTextTrim()));
|
||||
}
|
||||
if (licenses.size() > 0) {
|
||||
if (!licenses.isEmpty()) {
|
||||
module.setLicenses(licenses.toArray(new License[0]));
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
|
|||
|
||||
final List<ContentItem> contentItems = cm.getContentItems();
|
||||
|
||||
if (contentItems != null && contentItems.size() > 0) {
|
||||
if (contentItems != null && !contentItems.isEmpty()) {
|
||||
final Element items = new Element("items", CONTENT_NS);
|
||||
final Element bag = new Element("Bag", RDF_NS);
|
||||
items.addContent(bag);
|
||||
|
|
|
@ -81,7 +81,7 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
|
|||
final ArrayList<String> contentStrings = new ArrayList<String>();
|
||||
final ArrayList<String> encodedStrings = new ArrayList<String>();
|
||||
|
||||
if (encodeds.size() > 0) {
|
||||
if (!encodeds.isEmpty()) {
|
||||
foundSomething = true;
|
||||
|
||||
for (int i = 0; i < encodeds.size(); i++) {
|
||||
|
|
|
@ -89,7 +89,7 @@ public class OpenSearchModuleParser implements ModuleParser {
|
|||
|
||||
final List<Element> queries = dcRoot.getChildren("Query", OS_NS);
|
||||
|
||||
if (queries != null && queries.size() > 0) {
|
||||
if (queries != null && !queries.isEmpty()) {
|
||||
|
||||
// Create the OSQuery list
|
||||
final List<OSQuery> osqList = new LinkedList<OSQuery>();
|
||||
|
|
|
@ -112,7 +112,7 @@ public class ModuleGenerator implements com.sun.syndication.io.ModuleGenerator {
|
|||
listInfo.addContent(sort);
|
||||
}
|
||||
|
||||
if (listInfo.getChildren().size() > 0) {
|
||||
if (!listInfo.getChildren().isEmpty()) {
|
||||
element.addContent(listInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ public class SSE091Parser implements DelegatingModuleParser {
|
|||
private Element getFirstContent(final Element element, final String name) {
|
||||
final List<Element> filterList = element.getContent(new ContentFilter(name));
|
||||
Element firstContent = null;
|
||||
if (filterList != null && filterList.size() > 0) {
|
||||
if (filterList != null && !filterList.isEmpty()) {
|
||||
firstContent = filterList.get(0);
|
||||
}
|
||||
return firstContent;
|
||||
|
|
Loading…
Reference in a new issue