Skip to content

Commit ad360c3

Browse files
Fixed a bug where the quantity of a product in an Order wouldn't update properly.
1 parent d119046 commit ad360c3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

api/src/main/java/coreapi/OrderImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public void addProduct(Product prod, int quantity)
241241
{
242242
if (this.containsProduct(prod))
243243
{
244-
Integer actualQuantity = basket.get(prod);
244+
Integer actualQuantity = Integer.valueOf(quantity + basket.get(prod).intValue());
245245
for (Map.Entry<Product,Integer> e : basket.entrySet())
246246
{
247247
if (e.getKey().equals(prod))

api/target/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/test-classes/

0 commit comments

Comments
 (0)