From 55e8eac25d81f07bebb16d812c97edaf1393083f Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Wed, 13 Sep 2017 00:43:25 +1200 Subject: [PATCH] Fix FindBugs issues --- src/main/java/org/apache/commons/collections4/ListUtils.java | 3 --- .../java/org/apache/commons/collections4/list/TreeList.java | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/ListUtils.java b/src/main/java/org/apache/commons/collections4/ListUtils.java index c81ca1181..38e2e8b98 100644 --- a/src/main/java/org/apache/commons/collections4/ListUtils.java +++ b/src/main/java/org/apache/commons/collections4/ListUtils.java @@ -673,9 +673,6 @@ public class ListUtils { @Override public List get(final int index) { final int listSize = size(); - if (listSize < 0) { - throw new IllegalArgumentException("negative size: " + listSize); - } if (index < 0) { throw new IndexOutOfBoundsException("Index " + index + " must not be negative"); } diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java index feffa1c4a..f8a52f4d5 100644 --- a/src/main/java/org/apache/commons/collections4/list/TreeList.java +++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java @@ -622,7 +622,7 @@ public class TreeList extends AbstractList { } if (getRightSubTree() == null) { if (relativePosition > 0) { - left.relativePosition += relativePosition + (relativePosition > 0 ? 0 : 1); + left.relativePosition += relativePosition; } left.max().setRight(null, right); return left;