if() with an instanceof pattern can be merged with the if() using that
pattern's assigned variable.
Change-Id: I531231c04b180abd4096716f982efa7a6011c70c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
requireNonNull(genericType);
for (var type : subclass.getGenericInterfaces()) {
- if (type instanceof ParameterizedType ptype) {
- if (genericType.equals(ptype.getRawType())) {
- return Optional.of(ptype);
- }
+ if (type instanceof ParameterizedType ptype && genericType.equals(ptype.getRawType())) {
+ return Optional.of(ptype);
}
}