Skip to content

Commit

Permalink
refactor: PR second pass suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed Nov 23, 2020
1 parent eac6826 commit 47439b6
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public WatchConnectionManager(final OkHttpClient client, final BaseOperation<T,
}

private void runWatch() {
logger.debug("Connecting websocket ... {}", this);
logger.debug("Connecting websocket to {}...", requestUrl);

HttpUrl.Builder httpUrlBuilder = HttpUrl.get(requestUrl).newBuilder();

Expand Down Expand Up @@ -208,8 +208,7 @@ public void onMessage(WebSocket webSocket, String message) {
if (object instanceof HasMetadata) {
@SuppressWarnings("unchecked")
T obj = (T) object;
// Dirty cast - should always be valid though
resourceVersion.set(((HasMetadata) obj).getMetadata().getResourceVersion());
resourceVersion.set(obj.getMetadata().getResourceVersion());
Watcher.Action action = Watcher.Action.valueOf(event.getType());
watcher.eventReceived(action, obj);
} else if (object instanceof KubernetesResourceList) {
Expand Down Expand Up @@ -237,7 +236,7 @@ public void onMessage(WebSocket webSocket, String message) {
}

watcher.eventReceived(Action.ERROR, null);
logger.error("Error received: {}", status.toString());
logger.error("Error received: {}", status);
} else {
logger.error("Unknown message received: {}", message);
}
Expand Down

0 comments on commit 47439b6

Please sign in to comment.