Skip to content
Permalink
Browse files

[JENKINS-47736] Unnecessary serialization of a JSONObject.

  • Loading branch information
jglick committed Oct 30, 2017
1 parent 5932021 commit 162947aa5d4267fbb25ea8528c4fcdf2186eb31e
@@ -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;
@@ -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.