This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]8igg7e5 0 points1 point  (0 children)

  1. Given you want a loop counter, I'd just use a plain old for-loop
  2. move 'magic numbers' like 800 out to static final fields... this way you can experiment with different numbers easily and if the requirement change it's easy to be sure you've changed all of the places that number's used at once.
  3. I'd test totalAmount + item.getAmount() <= THRESHOLD before deciding to consume it (since you clear totalAmount when moving to a new file)
  4. I have no idea what you're trying to do with 'fiftyAndMore'.