From efdb58e67cf4ec60c686999ec8ecafea6d6e2a80 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Wed, 31 Jul 2019 10:33:43 +0200 Subject: [PATCH] Added throw Exception to method getSimplifyResultsByName --- .../simplifyRes/GenericGenratorResultForSourceFile.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/simplifyRes/GenericGenratorResultForSourceFile.java b/src/main/java/de/dhbwstuttgart/bytecode/simplifyRes/GenericGenratorResultForSourceFile.java index f311899e7..76713ce0f 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/simplifyRes/GenericGenratorResultForSourceFile.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/simplifyRes/GenericGenratorResultForSourceFile.java @@ -40,11 +40,11 @@ public class GenericGenratorResultForSourceFile { public GenericsGeneratorResultForClass getSimplifyResultsByName(String pkgName, String name) { if (this.pkgName.equals(pkgName)) { - return genericGeneratorResultForAllClasses - .stream() + return genericGeneratorResultForAllClasses.stream() .filter(sr -> sr.getClassName().equals(name)) .findAny() - .orElse(new GenericsGeneratorResultForClass(name)); + .orElseThrow(() -> new NoSuchElementException( + "Simplify results for the class " + pkgName + "." + name + " are not found")); } throw new NoSuchElementException("Simplify results for the class " + pkgName + "." + name + " are not found"); }