Added throw Exception to method getSimplifyResultsByName
This commit is contained in:
parent
eed8f32cb7
commit
efdb58e67c
@ -40,11 +40,11 @@ public class GenericGenratorResultForSourceFile {
|
|||||||
public GenericsGeneratorResultForClass getSimplifyResultsByName(String pkgName, String name) {
|
public GenericsGeneratorResultForClass getSimplifyResultsByName(String pkgName, String name) {
|
||||||
|
|
||||||
if (this.pkgName.equals(pkgName)) {
|
if (this.pkgName.equals(pkgName)) {
|
||||||
return genericGeneratorResultForAllClasses
|
return genericGeneratorResultForAllClasses.stream()
|
||||||
.stream()
|
|
||||||
.filter(sr -> sr.getClassName().equals(name))
|
.filter(sr -> sr.getClassName().equals(name))
|
||||||
.findAny()
|
.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");
|
throw new NoSuchElementException("Simplify results for the class " + pkgName + "." + name + " are not found");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user