Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-47736] Unnecessary serialization of a JSONObject.
  • Loading branch information
jglick committed Oct 30, 2017
1 parent 5932021 commit 162947a
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -29,7 +29,6 @@
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.util.logging.Logger;
import java.util.logging.Level;
Expand Down Expand Up @@ -76,12 +75,13 @@ public DockerRegistryWebHookPayload(@Nonnull JSONObject data) {

}

private DockerRegistryPushNotification createPushNotification(@Nonnull final String repoName, @Nonnull final JSONObject data) {
private DockerRegistryPushNotification createPushNotification(@Nonnull final String repoName, @Nonnull JSONObject data) {
final String timestamp = data.optString("timestamp");
final String host = data.getJSONObject("request").optString("host");
return new DockerRegistryPushNotification(this, repoName){{
DateTimeFormatter parser = ISODateTimeFormat.dateTimeParser();
String timestamp = data.optString("timestamp");
setPushedAt(parser.parseDateTime(timestamp).toDate());
setRegistryHost(data.getJSONObject("request").optString("host"));
setRegistryHost(host);
}};
}
}

0 comments on commit 162947a

Please sign in to comment.