Skip to content

Commit

Permalink
Merge pull request #329 from ziyi105/master
Browse files Browse the repository at this point in the history
Check the length of the ingredient name when decoding pantry_stock.txt
  • Loading branch information
NaychiMin authored Nov 12, 2023
2 parents 1c70d23 + 1efa576 commit ceb81dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/seedu/cafectrl/storage/Decoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class Decoder {
private static final String INGREDIENT_DIVIDER = " - ";
private static final Ui ui = new Ui();
private static Logger logger = Logger.getLogger(CafeCtrl.class.getName());

//@@author ShaniceTang
/**
* Decodes an ArrayList of string lines into a Menu object, reconstructing its content.
Expand Down Expand Up @@ -125,6 +126,7 @@ public static Pantry decodePantryStockData(ArrayList<String> encodedPantryStock)

// Check whether the parameters are correct
if (!Parser.containsSpecialChar(ingredientName)
&& !Parser.isNameLengthInvalid(ingredientName)
&& !Parser.isRepeatedIngredientName(ingredientName, pantryStock)
&& !Parser.isInvalidQty(qty)
&& !Parser.isEmptyUnit(unit)
Expand Down Expand Up @@ -226,5 +228,4 @@ private static ArrayList<OrderList> fillOrderListSize(ArrayList<OrderList> order
}
return orderLists;
}

}

0 comments on commit ceb81dc

Please sign in to comment.