- avoid local variables when possible
@Override
public List<T> getAll () {
// Init map
- List<T> list = new LinkedList<>();
+ final List<T> list = new LinkedList<>();
// Iterate over full item list
for (final T item : this.deque) {
throw new NullPointerException("item is null"); //NOI18N
}
- // Get all items
- List<T> list = this.getAll();
-
// Default is not found
boolean isAdded = false;
// Loop through list
- for (final T i : list) {
+ for (final T currentItem : this.getAll()) {
// Compare id
- if (i.equals(item)) {
+ if (currentItem.equals(item)) {
// Okay, found it
isAdded = true;
break;
* <p>
* @param item Item instance to add
* <p>
- * @throws org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException
- * If
- * the
- * item
- * instance
- * has
- * already
- * been
- * added
+ * @throws BasketItemAlreadyAddedException If the item instance has already
+ * been added
*/
void addItem (final T item) throws BasketItemAlreadyAddedException;