From ce86f3f8aa7ecaa12f2c62737a801a73f6e386ab Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Sun, 28 Apr 2013 14:20:56 +0000 Subject: [PATCH] Explicit boxing This documents that the boxing is actually intended, rather than an error due to the accidental use of the wrong type. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1476781 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/collections4/iterators/PermutationIterator.java | 4 ++-- .../apache/commons/collections4/queue/CircularFifoQueue.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java index 616007fbd..c0a5d5663 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java @@ -84,7 +84,7 @@ public class PermutationIterator implements Iterator> { int value = 1; objectMap = new HashMap(); for (E e : coll) { - objectMap.put(value, e); + objectMap.put(Integer.valueOf(value), e); keys[value - 1] = value; value++; } @@ -142,7 +142,7 @@ public class PermutationIterator implements Iterator> { if (keys[i] > largestKey) { direction[i] = !direction[i]; } - nextP.add(objectMap.get(keys[i])); + nextP.add(objectMap.get(Integer.valueOf(keys[i]))); } final List result = nextPermutation; nextPermutation = nextP; diff --git a/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java b/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java index 05cfdaf9c..86ca82ad4 100644 --- a/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java +++ b/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java @@ -256,7 +256,7 @@ public class CircularFifoQueue extends AbstractCollection if (index < 0 || index >= sz) { throw new NoSuchElementException( String.format("The specified index (%1$d) is outside the available range [0, %2$d)", - index, sz)); + Integer.valueOf(index), Integer.valueOf(sz))); } final int idx = (start + index) % maxElements;