Commit 7424f488 authored by igor-suhorukov's avatar igor-suhorukov Committed by Stephane Nicoll

Replace redundant call to class isInstance() with instanceof

See gh-15554
parent 372b6605
......@@ -68,7 +68,7 @@ class OnManagementPortCondition extends SpringBootCondition {
context.getClassLoader())) {
return false;
}
return WebApplicationContext.class.isInstance(resourceLoader);
return resourceLoader instanceof WebApplicationContext;
}
}
......@@ -61,7 +61,7 @@ public final class ConditionMessage {
@Override
public boolean equals(Object obj) {
if (obj == null || !ConditionMessage.class.isInstance(obj)) {
if (!(obj instanceof ConditionMessage)) {
return false;
}
if (obj == this) {
......
......@@ -70,7 +70,7 @@ public class HypermediaAutoConfigurationTests {
LinkDiscoverers discoverers = this.context.getBean(LinkDiscoverers.class);
assertThat(discoverers).isNotNull();
LinkDiscoverer discoverer = discoverers.getLinkDiscovererFor(MediaTypes.HAL_JSON);
assertThat(HalLinkDiscoverer.class.isInstance(discoverer)).isTrue();
assertThat(discoverer instanceof HalLinkDiscoverer).isTrue();
}
@Test
......
......@@ -198,7 +198,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
}
java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger("");
Handler[] handlers = rootLogger.getHandlers();
return handlers.length == 1 && SLF4JBridgeHandler.class.isInstance(handlers[0]);
return handlers.length == 1 && handlers[0] instanceof SLF4JBridgeHandler;
}
private void addLevelChangePropagator(LoggerContext loggerContext) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment