Johannes Frohnmeyer
89ae8b48c2
Merge remote-tracking branch 'origin/master'
...
ci/woodpecker/push/woodpecker Pipeline was successful
Details
# Conflicts:
# extras/pom.xml
# extras/src/main/java/com/google/gson/graph/GraphAdapterBuilder.java
# extras/src/main/java/com/google/gson/interceptors/InterceptorFactory.java
# extras/src/test/java/com/google/gson/typeadapters/PostConstructAdapterFactoryTest.java
# gson/src/main/java/com/google/gson/Gson.java
# gson/src/main/java/com/google/gson/GsonBuilder.java
# gson/src/main/java/com/google/gson/util/ISO8601Utils.java
# gson/src/main/java/module-info.java
# gson/src/test/java/com/google/gson/GsonTest.java
# gson/src/test/java/com/google/gson/functional/ArrayTest.java
# gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java
# gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java
# gson/src/test/java/com/google/gson/functional/EnumWithObfuscatedTest.java
# gson/src/test/java/com/google/gson/functional/InternationalizationTest.java
# gson/src/test/java/com/google/gson/functional/Java17RecordTest.java
# gson/src/test/java/com/google/gson/functional/JavaUtilConcurrentAtomicTest.java
# gson/src/test/java/com/google/gson/functional/JavaUtilTest.java
# gson/src/test/java/com/google/gson/functional/JsonAdapterAnnotationOnClassesTest.java
# gson/src/test/java/com/google/gson/functional/JsonAdapterAnnotationOnFieldsTest.java
# gson/src/test/java/com/google/gson/functional/JsonParserTest.java
# gson/src/test/java/com/google/gson/functional/MapTest.java
# gson/src/test/java/com/google/gson/functional/PrimitiveTest.java
# gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java
# gson/src/test/java/com/google/gson/functional/StreamingTypeAdaptersTest.java
# gson/src/test/java/com/google/gson/functional/TypeAdapterPrecedenceTest.java
# gson/src/test/java/com/google/gson/internal/bind/Java17ReflectiveTypeAdapterFactoryTest.java
# gson/src/test/java/com/google/gson/internal/bind/JsonTreeReaderTest.java
# gson/src/test/java/com/google/gson/internal/bind/JsonTreeWriterTest.java
# gson/src/test/java/com/google/gson/internal/reflect/Java17ReflectionHelperTest.java
# gson/src/test/java/com/google/gson/regression/JsonAdapterNullSafeTest.java
# gson/src/test/java/com/google/gson/stream/JsonReaderPathTest.java
# gson/src/test/java/com/google/gson/stream/JsonReaderTest.java
# metrics/pom.xml
# metrics/src/main/java/com/google/gson/metrics/NonUploadingCaliperRunner.java
# metrics/src/main/java/com/google/gson/metrics/ParseBenchmark.java
# pom.xml
# proto/pom.xml
2023-02-23 14:21:42 +01:00
Maicol
49b00d1a86
Port all Junit assert to Truth asserts ( #2304 )
...
* Port Junit assert to Truth in `com.google.gson.stream`
* Port Junit assert to Truth in `com.google.gson.regression`
* Port Junit assert to Truth in `om.google.gson.reflect`
* Port Junit assert to Truth in `com.google.gson.metrics`
* Port Junit assert to Truth in `com.google.gson.internal`
* Port Junit assert to Truth in `com.google.gson.internal.sql`
* Port Junit assert to Truth in `com.google.gson.internal.reflect`
* Port Junit assert to Truth in `com.google.gson.internal.bind`
* Port Junit assert to Truth in `com.google.gson.internal.bind.util`
* Port Junit assert to Truth in `com.google.gson.functional`
* Replaces `List.of` with `Arrays.asList` to grant legacy
* Simplify `==` asserts
* Simplify `.contain()` asserts + Minor fixes
* Simplify asserts
2023-01-31 11:20:54 -08:00
Johannes Frohnmeyer
b6cc63919d
Merge remote-tracking branch 'origin/master'
...
ci/woodpecker/push/woodpecker Pipeline failed
Details
# Conflicts:
# .github/ISSUE_TEMPLATE/bug_report.md
# .github/workflows/build.yml
# extras/pom.xml
# extras/src/main/java/com/google/gson/graph/GraphAdapterBuilder.java
# extras/src/main/java/com/google/gson/typeadapters/UtcDateTypeAdapter.java
# extras/src/test/java/com/google/gson/interceptors/InterceptorTest.java
# extras/src/test/java/com/google/gson/typeadapters/PostConstructAdapterFactoryTest.java
# extras/src/test/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactoryTest.java
# extras/src/test/java/com/google/gson/typeadapters/UtcDateTypeAdapterTest.java
# gson/src/test/java/com/google/gson/CommentsTest.java
# gson/src/test/java/com/google/gson/ToNumberPolicyTest.java
# gson/src/test/java/com/google/gson/functional/EnumWithObfuscatedTest.java
# gson/src/test/java/com/google/gson/functional/JsonParserTest.java
# gson/src/test/java/com/google/gson/functional/LeniencyTest.java
# gson/src/test/java/com/google/gson/functional/MapTest.java
# gson/src/test/java/com/google/gson/functional/PrimitiveCharacterTest.java
# gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java
# gson/src/test/java/com/google/gson/functional/SecurityTest.java
# gson/src/test/java/com/google/gson/stream/JsonReaderTest.java
# gson/src/test/resources/testcases-proguard.conf
# metrics/pom.xml
# metrics/src/main/java/com/google/gson/metrics/BagOfPrimitives.java
# proto/pom.xml
# proto/src/test/java/com/google/gson/protobuf/functional/ProtosWithAnnotationsTest.java
# proto/src/test/java/com/google/gson/protobuf/functional/ProtosWithComplexAndRepeatedFieldsTest.java
# proto/src/test/java/com/google/gson/protobuf/functional/ProtosWithPrimitiveTypesTest.java
2023-01-21 14:24:25 +01:00
Maicol
1a2170b99c
Port tests from JUnit 3 to JUnit 4 ( #2294 )
...
* Port tests from JUnit 3 to JUnit 4
* Port tests from JUnit 3 to JUnit 4
* Add `@Test` above `@Ignore`
2022-12-22 06:04:16 -08:00
Marcono1234
6c27553c83
Improve exception message for duplicate field names ( #2251 )
2022-12-04 17:27:43 -08:00
Johannes Frohnmeyer
9409197165
Merge remote-tracking branch 'origin/master'
...
# Conflicts:
# gson/src/main/java/com/google/gson/stream/JsonReader.java
# gson/src/test/java/com/google/gson/functional/ReflectionAccessFilterTest.java
# gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java
# gson/src/test/java/com/google/gson/internal/bind/DefaultDateTypeAdapterTest.java
# pom.xml
2022-10-31 12:44:34 +01:00
Marcono1234
66d9621ce8
Adjust Record adapter and extend test coverage ( #2224 )
...
* Adjust Record adapter and extend test coverage
* Address review feedback
* Make constructor string more concise
* Add tests for Gson default behavior for static fields
* Improve exception for deserializing static final field
Previously it would report "Unexpected IllegalAccessException occurred..."
due to the uncaught IllegalAccessException.
* Improve handling of exception thrown by accessor
Such an exception is not 'unexpected' (which was claimed by the previous
exception handling) because user code could throw it.
* Improve constructor invocation exception handling and add tests
2022-10-22 09:01:56 -07:00
Johannes Frohnmeyer
ce02cb3bc1
Merge remote-tracking branch 'origin/master'
...
# Conflicts:
# gson/pom.xml
# gson/src/main/java/com/google/gson/Gson.java
# gson/src/main/java/com/google/gson/GsonBuilder.java
# gson/src/main/java/com/google/gson/internal/bind/ArrayTypeAdapter.java
# gson/src/main/java/com/google/gson/stream/JsonWriter.java
# gson/src/test/java/com/google/gson/functional/ArrayTest.java
# gson/src/test/java/com/google/gson/functional/MapTest.java
# pom.xml
2022-09-14 19:20:24 +02:00
Marcono1234
f7a164d98b
Fail Maven build on compiler warnings; remove some warning suppressions ( #2183 )
...
* Fail Maven build on compiler warnings; remove some warning suppressions
* Fix compiler warnings causing failure for newer JDK
* Improve placement of "raw" and "unchecked" warning suppressions
* Adjust javac documentation link
* Fix compilation error on newer JDKs
2022-08-26 17:36:18 -07:00
Johannes Frohnmeyer
dc4e61ac7b
Several breaking changes
2022-05-17 21:20:10 +02:00
Marcono1234
4dda4ec5ba
Use diamond operator when creating generic instances ( #2104 )
2022-04-17 15:27:21 -07:00
Marcono1234
49ddab9eeb
Add CodeQL GitHub code scanning workflow ( #2076 )
...
* Add CodeQL GitHub code scanning workflow
* Only compile main sources for code scanning
* Move test .proto files to test sources
`annotations.proto` also seems to be only relevant for tests because the test
explicitly registers them as extensions. By default the Proto adapter does not
consider them.
* Address some code scanning findings
* Fix some more findings
2022-02-17 18:40:40 -08:00
Marcono1234
d38e397421
Fix ObjectTest not restoring default Locale ( #2050 )
2022-01-10 07:18:42 -08:00
inder123
a6890bbaba
Fixed https://github.com/google/gson/issues/1310 ( #1311 )
...
* Fixed https://github.com/google/gson/issues/1310
Also renamed VersionUtils to more readable abstraction JavaVersion
Added support for debian naming convention
Using min supported version (6) as the default if JDK version can't be figured out
* Moved JavaVersion to an internal package
2018-05-09 13:10:08 -07:00
Andrey Mogilev
0aaf5ff408
fix Java9 DateFormat changes ( #1211 )
...
* fix Java9 DateFormat changes
* fix Codacy warnings
2017-12-30 00:44:43 +05:30
Inderjeet Singh
a3f11150cc
removed more eclipse warnings
2013-04-12 20:12:12 +00:00
Joel Leitch
b0531e1649
Ensure "excluder" is added prior to user defined type adapters/factories.
...
- Added test expose bad behaviour.
2012-12-20 19:41:33 +00:00
Inderjeet Singh
31964507c1
Updated SuppressWarnings annotations to Eclipse 3.6/3.7 which is unfortunately incompatible with Eclipse 3.5 (rawtypes vs unchecked)
...
This CL eliminates all eclipse warnings.
2011-10-20 21:32:46 +00:00
Jesse Wilson
3a3870591e
Tests to demonstrate that GSON 2 fixes some user-reported bugs.
2011-10-02 15:18:12 +00:00
Jesse Wilson
38ce53766e
More consistency on serializeNulls: we never emit the empty string for top-level objects.
2011-10-01 01:10:11 +00:00
Jesse Wilson
bb7f0b6bb0
Adopt JsonElementWriter in GSON.
...
Add setSerializeNulls() to JsonWriter, so nulls can be skipped from serialization. This does not yet impact JsonElementWriter.
One change in behavior: if the only value is skipped, we now emit "null" rather than "".
2011-09-30 07:08:44 +00:00
Inderjeet Singh
52288d7127
rawtypes -> unchecked
...
Fixed spurious eclipse warnings on deprecation, missing classes or parameters, etc.
2011-02-24 22:47:55 +00:00
Jesse Wilson
103edb9c36
Don't return null on an unexpected EOF unless the document is empty. This brings us back to compatibility with GSON 1.5.
2010-11-08 19:16:05 +00:00
Inderjeet Singh
d3eda04f33
Added support for deserializing from null input to a null value.
...
Added toString() method to ObjectTypePair.
2010-10-22 16:06:59 +00:00
Jesse Wilson
eb7b1e4ac7
Test attempting (and failing) to reproduce issue 215.
2010-08-27 07:10:00 +00:00
Inderjeet Singh
de0f8da151
replaced unchecked suppressed warnings token with more specific rawtypes.
...
removed unused imports.
2010-08-20 16:27:46 +00:00
Inderjeet Singh
1da3ef9891
Ensured that a custom handler is not visited during deserialization.
...
Ensured that JsonTreeNavigator can handle null values as children of JsonObject. This is now possible since Gson exposes toJson(JsonElement) method to which the user can pass a JsonElement with null values.
2009-10-06 01:15:28 +00:00
Inderjeet Singh
907082102d
Added code to ensure that circular reference situations with custom handlers are detected.
...
Split CircularReferenceTest out of ObjectTest.
2009-09-29 20:43:31 +00:00
Inderjeet Singh
3e7ebf8556
Fixed issue 156.
...
Added support for serializing an object field (or array elements) as per its actual type.
Refactored inheritance related tests into its own test class. Added regression tests for issue 156.
2009-09-25 19:54:25 +00:00
Joel Leitch
8297437610
Reverting r499.
2009-09-23 19:25:50 +00:00
Joel Leitch
c6f762f36b
Fix Warnings
2009-09-23 19:09:01 +00:00
Inderjeet Singh
3b0f8f4340
Removed all the JDK warnings about unused fields in test classes or unused constructors for use by Gson or instanceof calls on parameterized types.
2009-09-23 17:45:16 +00:00
Joel Leitch
18b301dfeb
- Serializing of Object arrays.
...
- Fixed incorrect warning
2009-09-22 19:04:27 +00:00
Inderjeet Singh
82771f006c
removed Java 1.5 warnings
2009-08-31 17:51:47 +00:00
Inderjeet Singh
cbcf7defa3
Updated Grammar for matching JsonArray to be left-associative rather than right-associative. Gson can now parse arrays of size over 11MB instead of 80KB which was the prior limit. Thanks for the tip, kenotron.
2009-08-22 01:03:27 +00:00
Inderjeet Singh
03a3cc83c3
Attempt to reproduce issue 140
2009-08-07 01:12:41 +00:00
Inderjeet Singh
64172d1dac
Added support to serialize and deserialize array of java.lang.Object when the content is a primitive type.
2009-07-27 23:24:23 +00:00
Joel Leitch
abf4ab2d78
Fix project so it still compiles with JDK 1.5.
2009-05-19 17:51:02 +00:00
Inderjeet Singh
6e59e502c2
Refactored the Async parser interface out of JsonParser into a new class JsonParserAsync. Updated the JsonParser to detect Eof and return a null instead of throwing a ParseException.
2009-05-14 20:18:45 +00:00
Inderjeet Singh
e340801d25
Moved enum-related tests under EnumTest class.
2009-03-30 18:36:55 +00:00
Inderjeet Singh
4fc6400f5c
Fixed the test that broke while fixing issue 100 in r394 by using a TreeSet for SortedSets and HashSet for other kind of sets.
2009-03-12 18:17:14 +00:00
Joel Leitch
8e1c6a2b37
Ensure that BigDecimals fields are properly converted into its string representation.
2008-12-14 05:56:41 +00:00
Joel Leitch
ea79cd6812
Allow booleans and number to be deserialized into a "String" field/object.
2008-12-14 04:42:16 +00:00
Inderjeet Singh
7334a33d14
Test to verify support for object member names without quotes (see Issue 41).
2008-11-26 17:49:35 +00:00
Joel Leitch
0d8150fe52
Major restructuring of Primitve type serialization and deserializtion. From the end-user's point of view there should be no difference other than the user can now override the default serialization/deserialization their own custom type adapter (not sure if there is a real use-case out there for this).
...
This restructuring greatly cleans up the code and reduces some complexity; however, there is more that can be done to clean this up (i.e. get rid of "InstanceCreators" for primitive Type Adapters).
2008-11-15 02:26:57 +00:00
Inderjeet Singh
5631132892
Fixed Issue 54 to enable serialization of fields that are declared of type
...
Object.
2008-10-13 21:12:41 +00:00
Inderjeet Singh
f6a278018e
test for Issue 51 for inner classes serialization and deserialization.
2008-10-13 19:49:05 +00:00
Inderjeet Singh
1abf693b70
Fix for Issue 55 where GSON was unable to deserialize JSON with single quotes
...
(') used for field name/values. Gson now supports different fields with-in the
JSON to use either single quote or double quote. However, a single field name
or value must use ' or "" to delimit itself.
2008-10-10 02:53:54 +00:00
Inderjeet Singh
427c17a732
added a test for checking if GSON can parse JSON that uses single quotes
...
instead of double quotes for various field values.
2008-10-10 02:32:50 +00:00
Inderjeet Singh
3b8404dac5
refactored String related functional tests out in a separate test class.
2008-10-10 02:29:06 +00:00