Skip to content

Commit f70156b

Browse files
authored
Update dependency com.google.code.gson:gson to v2.11.0 (#2128)
2 parents 7bbe908 + 1e55d6c commit f70156b

File tree

8 files changed

+11
-10
lines changed

8 files changed

+11
-10
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1818
* Bump default `eclipse` version to latest `4.29` -> `4.32`. ([#2179](https://github.com/diffplug/spotless/pull/2179))
1919
* Bump default `greclipse` version to latest `4.29` -> `4.32`. ([#2179](https://github.com/diffplug/spotless/pull/2179), [#2190](https://github.com/diffplug/spotless/pull/2190))
2020
* Bump default `cdt` version to latest `11.3` -> `11.6`. ([#2179](https://github.com/diffplug/spotless/pull/2179))
21+
* Bump default `gson` version to latest `2.10.1` -> `2.11.0`. ([#2128](https://github.com/diffplug/spotless/pull/2128))
2122
### Fixed
2223
* Fix compatibility issue introduced by `ktfmt` `0.51`. ([#2172](https://github.com/diffplug/spotless/issues/2172))
2324
### Added

lib/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ dependencies {
9595
// googleJavaFormat
9696
googleJavaFormatCompileOnly 'com.google.googlejavaformat:google-java-format:1.22.0'
9797
// gson
98-
gsonCompileOnly 'com.google.code.gson:gson:2.10.1'
98+
gsonCompileOnly 'com.google.code.gson:gson:2.11.0'
9999
// jackson
100100
String VER_JACKSON='2.17.1'
101101
jacksonCompileOnly "com.fasterxml.jackson.core:jackson-databind:$VER_JACKSON"

lib/src/main/java/com/diffplug/spotless/json/gson/GsonStep.java

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class GsonStep implements Serializable {
3030
private static final String MAVEN_COORDINATES = "com.google.code.gson:gson";
3131
private static final String INCOMPATIBLE_ERROR_MESSAGE = "There was a problem interacting with Gson; maybe you set an incompatible version?";
3232
public static final String NAME = "gson";
33+
public static final String DEFAULT_VERSION = "2.11.0";
3334

3435
private final JarState.Promised jarState;
3536
private final GsonConfig gsonConfig;

plugin-gradle/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111
* Bump default `eclipse` version to latest `4.29` -> `4.32`. ([#2179](https://github.com/diffplug/spotless/pull/2179))
1212
* Bump default `greclipse` version to latest `4.29` -> `4.32`. ([#2179](https://github.com/diffplug/spotless/pull/2179), [#2190](https://github.com/diffplug/spotless/pull/2190))
1313
* Bump default `cdt` version to latest `11.3` -> `11.6`. ([#2179](https://github.com/diffplug/spotless/pull/2179))
14+
* Bump default `gson` version to latest `2.10.1` -> `2.11.0`. ([#2128](https://github.com/diffplug/spotless/pull/2128))
1415
### Fixed
1516
* Fix compatibility issue introduced by `ktfmt` `0.51`. ([#2172](https://github.com/diffplug/spotless/issues/2172))
1617
### Added

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JsonExtension.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
public class JsonExtension extends FormatExtension {
3333
private static final int DEFAULT_INDENTATION = 4;
34-
private static final String DEFAULT_GSON_VERSION = "2.10.1";
3534
private static final String DEFAULT_ZJSONPATCH_VERSION = "0.4.14";
3635
static final String NAME = "json";
3736

@@ -112,7 +111,7 @@ public GsonConfig() {
112111
this.indentSpaces = DEFAULT_INDENTATION;
113112
this.sortByKeys = false;
114113
this.escapeHtml = false;
115-
this.version = DEFAULT_GSON_VERSION;
114+
this.version = GsonStep.DEFAULT_VERSION;
116115
addStep(createStep());
117116
}
118117

plugin-maven/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111
* Bump default `eclipse` version to latest `4.29` -> `4.32`. ([#2179](https://github.com/diffplug/spotless/pull/2179))
1212
* Bump default `greclipse` version to latest `4.29` -> `4.32`. ([#2179](https://github.com/diffplug/spotless/pull/2179), [#2190](https://github.com/diffplug/spotless/pull/2190))
1313
* Bump default `cdt` version to latest `11.3` -> `11.6`. ([#2179](https://github.com/diffplug/spotless/pull/2179))
14+
* Bump default `gson` version to latest `2.10.1` -> `2.11.0`. ([#2128](https://github.com/diffplug/spotless/pull/2128))
1415
### Fixed
1516
* Fix compatibility issue introduced by `ktfmt` `0.51`. ([#2172](https://github.com/diffplug/spotless/issues/2172))
1617
### Added

plugin-maven/src/main/java/com/diffplug/spotless/maven/json/Gson.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 DiffPlug
2+
* Copyright 2023-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,6 @@
2424
import com.diffplug.spotless.maven.FormatterStepFactory;
2525

2626
public class Gson implements FormatterStepFactory {
27-
private static final String DEFAULT_GSON_VERSION = "2.10.1";
28-
2927
@Parameter
3028
int indentSpaces = Json.DEFAULT_INDENTATION;
3129

@@ -36,7 +34,7 @@ public class Gson implements FormatterStepFactory {
3634
boolean escapeHtml = false;
3735

3836
@Parameter
39-
String version = DEFAULT_GSON_VERSION;
37+
String version = GsonStep.DEFAULT_VERSION;
4038

4139
@Override
4240
public FormatterStep newFormatterStep(FormatterStepConfig stepConfig) {

testlib/src/test/java/com/diffplug/spotless/json/gson/GsonStepTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2023 DiffPlug
2+
* Copyright 2022-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
1515
*/
1616
package com.diffplug.spotless.json.gson;
1717

18+
import static com.diffplug.spotless.json.gson.GsonStep.DEFAULT_VERSION;
19+
1820
import java.io.File;
1921

2022
import org.assertj.core.api.Assertions;
@@ -28,8 +30,6 @@
2830

2931
public class GsonStepTest extends JsonFormatterStepCommonTests {
3032

31-
private static final String DEFAULT_VERSION = "2.10.1";
32-
3333
@Test
3434
void handlesComplexNestedObject() {
3535
doWithResource("cucumberJsonSampleGson");

0 commit comments

Comments
 (0)