code: private void waitForHawkularInventory(HttpClientBuilder hcb, StorageAdapterConfiguration storageAdapterConfig)
              throws Exception {
          OkHttpClient httpclient = hcb.getHttpClient();
          String statusUrl = Util
                  .getContextUrlString(storageAdapterConfig.getUrl(), storageAdapterConfig.getInventoryContext())
                  .append("status").toString();
          Request request = hcb.buildJsonGetRequest(statusUrl, null);
          int counter = 0;
          while (true) {
              Response response = null;
              try {
                  response = httpclient.newCall(request).execute();
                  if (response.code() != 200) {
                      if (response.code() != 401) {
                          log.debugf("Hawkular Inventory is not ready yet: %d/%s", response.code(), response.message());
                      } else {
                          log.warnBadHawkularCredentials(response.code(), response.message());
                      }
                  } else {
                      String bodyString = response.body().string();
                      if (checkStatusReallyUp(bodyString)) {
                          log.infof("Hawkular Inventory is ready: %s", bodyString);
                          break;
                      } else {
                          log.debugf("Hawkular Inventory is still starting: %s", bodyString);
                      }
                  }
              } catch (Exception e) {
                  log.debugf("Hawkular Inventory is not ready yet: %s", e.toString());
              } finally {
                  if (response != null) {
                      response.body().close();
                  }
              }
              Thread.sleep(5000L);
              counter++;
              if (counter % 12 == 0) {
                  log.warnConnectionDelayed(counter, "inventory", statusUrl);
              }
          }
      }
docs: this method doesn't use fields that aren't initialized yet. Pass everything through parameters.