style: include SPP_USE_ISEMPTY
(#5238)
This commit is contained in:
parent
22f2abd94f
commit
a710fe11c4
@ -132,9 +132,6 @@
|
||||
<Match>
|
||||
<Bug pattern="USBR_UNNECESSARY_STORE_BEFORE_RETURN" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Bug pattern="SPP_USE_ISEMPTY" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Bug pattern="BL_BURYING_LOGIC" />
|
||||
</Match>
|
||||
|
@ -64,7 +64,7 @@ public class LargeTreeNode<E> extends TreeNode<E> {
|
||||
*/
|
||||
@Override
|
||||
public boolean isLeafNode() {
|
||||
return (childNodes == null || childNodes.size() == 0);
|
||||
return (childNodes == null || childNodes.isEmpty());
|
||||
}
|
||||
|
||||
public Collection<LargeTreeNode<E>> getChildNodes() {
|
||||
|
@ -31,7 +31,7 @@ public final class QuickSelect {
|
||||
public static <T extends Comparable<T>> T select(List<T> list, int n) {
|
||||
Objects.requireNonNull(list, "The list of elements must not be null.");
|
||||
|
||||
if (list.size() == 0) {
|
||||
if (list.isEmpty()) {
|
||||
String msg = "The list of elements must not be empty.";
|
||||
throw new IllegalArgumentException(msg);
|
||||
}
|
||||
|
@ -34,13 +34,13 @@ public class MergeSortRecursive {
|
||||
}
|
||||
|
||||
private static List<Integer> sort(List<Integer> unsortedA, List<Integer> unsortedB) {
|
||||
if (unsortedA.size() <= 0 && unsortedB.size() <= 0) {
|
||||
if (unsortedA.isEmpty() && unsortedB.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
if (unsortedA.size() <= 0) {
|
||||
if (unsortedA.isEmpty()) {
|
||||
return unsortedB;
|
||||
}
|
||||
if (unsortedB.size() <= 0) {
|
||||
if (unsortedB.isEmpty()) {
|
||||
return unsortedA;
|
||||
}
|
||||
if (unsortedA.get(0) <= unsortedB.get(0)) {
|
||||
|
Loading…
Reference in New Issue
Block a user