Skip to content

Commit bca0cc5

Browse files
author
Tibor Eszes
committed
Change stream implementation to List.contains()
1 parent 10998f1 commit bca0cc5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/CustomResourceUtils.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ public abstract class CustomResourceUtils {
1515
* @throws OperatorException when the Custom Resource has validation error
1616
*/
1717
public static void assertCustomResource(Class<?> resClass, CustomResourceDefinition crd) {
18-
var namespaced =
19-
Arrays.stream(resClass.getInterfaces())
20-
.filter(classInterface -> classInterface.equals(Namespaced.class))
21-
.findAny()
22-
.isPresent();
18+
var namespaced = Arrays.asList(resClass.getInterfaces()).contains(Namespaced.class);
2319

2420
if (!namespaced && Namespaced.class.getSimpleName().equals(crd.getSpec().getScope())) {
2521
throw new OperatorException(

0 commit comments

Comments
 (0)