Skip to content

Commit

Permalink
chore(dependencies): Autobump korkVersion (#1278)
Browse files Browse the repository at this point in the history
* chore(dependencies): Autobump korkVersion

* refactor(dependency): replace JacksonFactory to GsonFactory

---------

Co-authored-by: root <root@0e8a9747aac9>
Co-authored-by: Edgar Garcia <[email protected]>
  • Loading branch information
3 people authored Sep 26, 2024
1 parent ac0396b commit b47721e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fiatVersion=1.50.0
korkVersion=7.239.0
korkVersion=7.240.0
org.gradle.parallel=true
spinnakerGradleVersion=8.32.1
targetJava17=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.cloudbuild.v1.CloudBuild;
import com.google.api.services.storage.Storage;
import com.google.auth.http.HttpCredentialsAdapter;
Expand All @@ -38,7 +38,7 @@ final class CloudBuildFactory {
private final int connectTimeoutSec = 10;
private final int readTimeoutSec = 10;

private final JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
private final JsonFactory jsonFactory = GsonFactory.getDefaultInstance();
private final HttpTransport httpTransport;

// Override the base URL for all requests to the cloud build API; primarily for testing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.netflix.spinnaker.igor.gcb;

import com.google.api.client.json.JsonGenerator;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.json.gson.GsonFactory;
import java.io.IOException;
import java.io.StringWriter;
import java.io.UncheckedIOException;
Expand All @@ -34,11 +34,11 @@
@Component
@ConditionalOnProperty("gcb.enabled")
final class GoogleCloudBuildParser {
private final JacksonFactory jacksonFactory = JacksonFactory.getDefaultInstance();
private final GsonFactory gsonFactory = GsonFactory.getDefaultInstance();

<T> T parse(String input, Class<T> destinationClass) {
try {
return jacksonFactory.createJsonParser(input).parse(destinationClass);
return gsonFactory.createJsonParser(input).parse(destinationClass);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand All @@ -51,7 +51,7 @@ <T> T convert(Object input, Class<T> destinationClass) {

String serialize(Object input) {
Writer writer = new StringWriter();
try (JsonGenerator generator = jacksonFactory.createJsonGenerator(writer)) {
try (JsonGenerator generator = gsonFactory.createJsonGenerator(writer)) {
generator.serialize(input);
} catch (IOException e) {
throw new UncheckedIOException(e);
Expand Down

0 comments on commit b47721e

Please sign in to comment.