Source:
<code>private int run0() throws InterruptedException, DockerException { Thread.sleep(delayMillis); final ContainerInfo info = getContainerInfo(existingContainerId); final String containerId; if (info != null && info.state().running()) { containerId = existingContainerId; this.containerId = Optional.of(existingContainerId); } else { containerId = createAndStartContainer(); this.containerId = Optional.of(containerId); if (healthChecker.isPresent()) { listener.healthChecking(); final RetryScheduler retryScheduler = BoundedRandomExponentialBackoff.newBuilder() .setMinIntervalMillis(SECONDS.toMillis(1)) .setMaxIntervalMillis(SECONDS.toMillis(30)) .build().newScheduler(); while (!healthChecker.get().check(containerId)) { final ContainerState state = getContainerState(containerId); if (state == null) { log.warn("container state was null during health checking: {}: {}", config, containerId); <START> throw new RuntimeException("container state was null during health checking"); <END> } if (!state.running()) { log.warn("container exited during health checking: {}: {}: {}", config, containerId, state.exitCode()); throw new RuntimeException("container exited during health checking"); } final long retryMillis = retryScheduler.nextMillis(); log.warn("container failed healthcheck, will retry in {}ms: {}: {}", retryMillis, config, containerId); Thread.sleep(retryMillis); } } } listener.running(); serviceRegistrationHandle = Optional.fromNullable(registrar.register(config.registration())); final ContainerExit exit; try { exit = docker.waitContainer(containerId); } finally { unregister(); this.containerId = Optional.absent(); } log.info("container exited: {}: {}: {}", config, containerId, exit.statusCode()); listener.exited(exit.statusCode()); return exit.statusCode(); }</code><technical_language>a error message for log line exception "container <containerId> health checking, State object" - as-is ID of container is included totally clear means for state null</technical_language>

Target:
private int run0() throws InterruptedException, DockerException { Thread.sleep(delayMillis); final ContainerInfo info = getContainerInfo(existingContainerId); final String containerId; if (info != null && info.state().running()) { containerId = existingContainerId; this.containerId = Optional.of(existingContainerId); } else { containerId = createAndStartContainer(); this.containerId = Optional.of(containerId); if (healthChecker.isPresent()) { listener.healthChecking(); final RetryScheduler retryScheduler = BoundedRandomExponentialBackoff.newBuilder() .setMinIntervalMillis(SECONDS.toMillis(1)) .setMaxIntervalMillis(SECONDS.toMillis(30)) .build().newScheduler(); while (!healthChecker.get().check(containerId)) { final ContainerState state = getContainerState(containerId); if (state == null) { final String err = "container " + containerId + " was not found during health " + "checking, or has no State object"; log.warn(err); throw new RuntimeException(err); } if (!state.running()) { final String err = "container " + containerId + " exited during health checking. " + "Exit code: " + state.exitCode() + ", Config: " + config; log.warn(err); throw new RuntimeException(err); } final long retryMillis = retryScheduler.nextMillis(); log.warn("container failed healthcheck, will retry in {}ms: {}: {}", retryMillis, config, containerId); Thread.sleep(retryMillis); } } } listener.running(); serviceRegistrationHandle = Optional.fromNullable(registrar.register(config.registration())); final ContainerExit exit; try { exit = docker.waitContainer(containerId); } finally { unregister(); this.containerId = Optional.absent(); } log.info("container exited: {}: {}: {}", config, containerId, exit.statusCode()); listener.exited(exit.statusCode()); return exit.statusCode(); }