Commit 67eb3b74 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #15554 from igor-suhorukov

* pr/15554:
  Polish "Replace redundant call to class isInstance() with instanceof"
  Replace redundant call to class isInstance() with instanceof
parents 372b6605 fd12e696
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -68,7 +68,7 @@ class OnManagementPortCondition extends SpringBootCondition { ...@@ -68,7 +68,7 @@ class OnManagementPortCondition extends SpringBootCondition {
context.getClassLoader())) { context.getClassLoader())) {
return false; return false;
} }
return WebApplicationContext.class.isInstance(resourceLoader); return resourceLoader instanceof WebApplicationContext;
} }
} }
...@@ -61,7 +61,7 @@ public final class ConditionMessage { ...@@ -61,7 +61,7 @@ public final class ConditionMessage {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null || !ConditionMessage.class.isInstance(obj)) { if (!(obj instanceof ConditionMessage)) {
return false; return false;
} }
if (obj == this) { if (obj == this) {
......
...@@ -70,7 +70,7 @@ public class HypermediaAutoConfigurationTests { ...@@ -70,7 +70,7 @@ public class HypermediaAutoConfigurationTests {
LinkDiscoverers discoverers = this.context.getBean(LinkDiscoverers.class); LinkDiscoverers discoverers = this.context.getBean(LinkDiscoverers.class);
assertThat(discoverers).isNotNull(); assertThat(discoverers).isNotNull();
LinkDiscoverer discoverer = discoverers.getLinkDiscovererFor(MediaTypes.HAL_JSON); LinkDiscoverer discoverer = discoverers.getLinkDiscovererFor(MediaTypes.HAL_JSON);
assertThat(HalLinkDiscoverer.class.isInstance(discoverer)).isTrue(); assertThat(discoverer).isInstanceOf(HalLinkDiscoverer.class);
} }
@Test @Test
......
...@@ -198,7 +198,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem { ...@@ -198,7 +198,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
} }
java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger(""); java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger("");
Handler[] handlers = rootLogger.getHandlers(); 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) { 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