Skip to content

Commit

Permalink
#28 fixed some minor spelling things
Browse files Browse the repository at this point in the history
  • Loading branch information
Plugsocket committed Dec 9, 2018
1 parent 86b895d commit f0472e2
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ public Optional<Response> handle(HandlerInput input) {
String actualCategorie = (String) input.getAttributesManager().getSessionAttributes().get(CATEGORY_KEY);
CookingBook cookingBook = new CookingBook();
Category[] categories = Category.values();
List<Recipe> a = new ArrayList<>();
List<Recipe> foundRecipes = new ArrayList<>();

if (actualCategorie != null || !actualCategorie.isEmpty()) {

for (int i = 0; i <= Category.values().length; i++) {
if (categories[i].getName() == actualCategorie) {
a.add((Recipe) cookingBook.findByCategory(categories[i]));
foundRecipes = cookingBook.findByCategory(categories[i]);
}
}

String b = null;
for (int i = 0; i <= a.size(); i++){
b += a.get(0).getName();
String responseMessage = null;
for (int i = 0; i <= foundRecipes.size(); i++){
responseMessage += foundRecipes.get(i).getName();
}

speechText = String.format(PhrasesForAlexa.TELL_CATEGORIES, b);
speechText = String.format(PhrasesForAlexa.TELL_CATEGORIES, responseMessage);

}

Expand Down

0 comments on commit f0472e2

Please sign in to comment.