Skip to content
Permalink
Browse files

Merge pull request #16 from jglick/whitelist-JENKINS-47736

[JENKINS-47736] Unnecessary serialization of a JSONObject
  • Loading branch information
jglick committed Oct 31, 2017
2 parents 5932021 + 162947a commit 9641b4f4d9d416119f9bc803a132994a9278340d
@@ -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 9641b4f

Please sign in to comment.