SetParent: Simplify lambda expression
SonarLint reports: Lambdas containing only one statement should not nest this statement in a block (squid:S1602). Change-Id: If42c79c135ba0639e1ff6e352e6a72252efc6d77
This commit is contained in:
@@ -161,12 +161,7 @@ public class SetParent
|
||||
throw new ResourceConflictException("cannot set parent to self");
|
||||
}
|
||||
|
||||
if (Iterables.tryFind(
|
||||
parent.tree(),
|
||||
p -> {
|
||||
return p.getNameKey().equals(project);
|
||||
})
|
||||
.isPresent()) {
|
||||
if (Iterables.tryFind(parent.tree(), p -> p.getNameKey().equals(project)).isPresent()) {
|
||||
throw new ResourceConflictException(
|
||||
"cycle exists between " + project.get() + " and " + parent.getName());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user