Compare commits

...

9 Commits

Author SHA1 Message Date
Johannes Frohnmeyer bf388059a3
Merge remote-tracking branch 'origin/master'
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 17:33:52 +01:00
dependabot[bot] bc04dd20b9
Bump jackson-databind from 2.14.0 to 2.14.1 (#2241)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.14.0 to 2.14.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-23 08:33:01 -08:00
dependabot[bot] 3f1e62d1e1
Bump japicmp-maven-plugin from 0.16.0 to 0.17.1 (#2238)
Bumps [japicmp-maven-plugin](https://github.com/siom79/japicmp) from 0.16.0 to 0.17.1.
- [Release notes](https://github.com/siom79/japicmp/releases)
- [Changelog](https://github.com/siom79/japicmp/blob/master/release.py)
- [Commits](https://github.com/siom79/japicmp/compare/japicmp-base-0.16.0...japicmp-base-0.17.1)

---
updated-dependencies:
- dependency-name: com.github.siom79.japicmp:japicmp-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-17 06:39:01 -08:00
Éamonn McManus 818faeeaa2
Adjust version numbers and a test to conform to the SemVer spec. (#2237)
* Adjust version numbers and a test to conform to the SemVer spec.

Gson releases since 2.8.0 have been following this spec. We mistakenly released 2.10
without the .0 patch version, and adjusted `GsonVersionDiagnosticsTest` so it would
accept that, as well as the two-digit `10`. Here we make the test no longer accept
versions without a patch number, while still accepting two-digit minor versions of course.
We also change the snapshot version to 2.11.0-SNAPSHOT instead of 2.11-SNAPSHOT.
2022-11-13 15:36:09 -08:00
Doug Hoard ceb3b8747e
Added JsonObject method isEmpty() (#2233)
* Added isEmpty()

* Fixed Javadoc typo

* Changed test to use assertTrue() and assertFalse()
2022-11-13 12:58:30 -08:00
Marcono1234 92b7ae0ca0
Mention in CHANGELOG that GitHub Releases are used in the future (#2230) 2022-11-13 09:08:06 -08:00
dependabot[bot] 94b5310da4
Bump maven-release-plugin from 3.0.0-M6 to 3.0.0-M7 (#2232)
Bumps [maven-release-plugin](https://github.com/apache/maven-release) from 3.0.0-M6 to 3.0.0-M7.
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.0-M6...maven-release-3.0.0-M7)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-release-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-13 09:07:33 -08:00
dependabot[bot] c995c12b5a
Bump jackson-databind from 2.13.4.2 to 2.14.0 (#2234)
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.4.2 to 2.14.0.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-13 09:07:11 -08:00
dependabot[bot] b504d0e9ff
Bump os-maven-plugin from 1.7.0 to 1.7.1 (#2235)
Bumps [os-maven-plugin](https://github.com/trustin/os-maven-plugin) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/trustin/os-maven-plugin/releases)
- [Commits](https://github.com/trustin/os-maven-plugin/compare/os-maven-plugin-1.7.0...os-maven-plugin-1.7.1)

---
updated-dependencies:
- dependency-name: kr.motd.maven:os-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-13 09:06:54 -08:00
9 changed files with 37 additions and 11 deletions

View File

@ -1,6 +1,8 @@
Change Log
==========
The change log for versions newer than 2.10 is available only on the [GitHub Releases page](https://github.com/google/gson/releases).
## Version 2.10
* Support for serializing and deserializing Java records, on Java ≥ 16. (https://github.com/google/gson/pull/2201)

View File

@ -3,7 +3,7 @@
<parent>
<groupId>io.gitlab.jfronny</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
</parent>
<artifactId>gson-extras</artifactId>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>io.gitlab.jfronny</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
</parent>
<artifactId>gson</artifactId>

View File

@ -155,6 +155,16 @@ public final class JsonObject extends JsonElement {
return members.size();
}
/**
* Returns true if the number of key/value pairs in the object is zero.
*
* @return true if the number of key/value pairs in the object is zero.
* @since $next-version$
*/
public boolean isEmpty() {
return members.size() == 0;
}
/**
* Convenience method to check if a member with the specified name is present in this object.
*

View File

@ -222,6 +222,18 @@ public class JsonObjectTest {
assertEquals(1, o.size());
}
@Test
public void testIsEmpty() {
JsonObject o = new JsonObject();
assertTrue(o.isEmpty());
o.add("Hello", new JsonPrimitive(1));
assertFalse(o.isEmpty());
o.remove("Hello");
assertTrue(o.isEmpty());
}
@Test
public void testDeepCopy() {
JsonObject original = new JsonObject();

View File

@ -35,7 +35,9 @@ import junit.framework.TestCase;
* @author Inderjeet Singh
*/
public class GsonVersionDiagnosticsTest extends TestCase {
private static final Pattern GSON_VERSION_PATTERN = Pattern.compile("(\\(GSON \\d\\.\\d+(\\.\\d)?)(?:[-.][A-Z]+)?\\)$");
// We require a patch number, even if it is .0, consistent with https://semver.org/#spec-item-2.
private static final Pattern GSON_VERSION_PATTERN =
Pattern.compile("(\\(GSON \\d\\.\\d+\\.\\d)(?:[-.][A-Z]+)?\\)$");
private Gson gson;

View File

@ -3,7 +3,7 @@
<parent>
<groupId>io.gitlab.jfronny</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
</parent>
<artifactId>gson-metrics</artifactId>
@ -32,7 +32,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.2</version>
<version>2.14.1</version>
</dependency>
<dependency>
<groupId>com.google.caliper</groupId>
@ -47,7 +47,7 @@
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.16.0</version>
<version>0.17.1</version>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check API -->
<skip>true</skip>

View File

@ -5,7 +5,7 @@
<groupId>io.gitlab.jfronny</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Gson Parent</name>
@ -147,7 +147,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M6</version>
<version>3.0.0-M7</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<!-- Disable Maven Super POM release profile and instead use own one -->
@ -234,7 +234,7 @@
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.16.0</version>
<version>0.17.1</version>
<configuration>
<oldVersion>
<dependency>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.gitlab.jfronny</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
</parent>
<artifactId>proto</artifactId>
@ -60,7 +60,7 @@
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
<version>1.7.1</version>
</extension>
</extensions>