Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-47736] Unnecessary serialization of a JSONObject.
- Loading branch information
|
@@ -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); |
|
|
}}; |
|
|
} |
|
|
} |