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