Some documentation is good, but do you really need to comment everything imagineable? It actually makes the code less appealing to look at. It's a lot of unnecessary clutter especially when, like in this case, the logic, variables and functions are self explanatory.
Like... come on man!
The logic in the code is fine, but you need to chill on the other stuff. Over documentation (good code is self documenting, and I could understand exactly what was going on after I removed all the comments) and over formatting (like the seemingly random newline indent at maxAmount) makes code no fun to look at.Code:
/* * The amount */ int amount = item.getAmount();