2 Commits

Author SHA256 Message Date
Fridrich Štrba
63c193cce2 2.3.1 changes file 2025-10-05 16:59:35 +02:00
Fridrich Štrba
2bd6daed5a 2.3.1 2025-10-03 19:39:25 +02:00
5 changed files with 153 additions and 39 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a380f6605c0d7c9c97451f57f206e641b3a437322f9008b1c04beaa8d1b6421b
size 22343

BIN
json-simple-2.3.1.tar.gz LFS Normal file

Binary file not shown.

View File

@@ -1,18 +0,0 @@
diff -uNr json-simple-1.1.1.ORIG/src/test/java/org/json/simple/Test.java json-simple-1.1.1/src/test/java/org/json/simple/Test.java
--- json-simple-1.1.1.ORIG/src/test/java/org/json/simple/Test.java 2014-07-22 09:55:47.058000000 +0000
+++ json-simple-1.1.1/src/test/java/org/json/simple/Test.java 2014-07-22 14:17:16.942000000 +0000
@@ -294,7 +294,7 @@
pe.printStackTrace();
}
}
-
+ /*
public void testEncode() throws Exception{
System.out.println("=======encode=======");
@@ -388,4 +388,5 @@
System.out.println(jsonString);
assertEquals("[{\"k11\":\"v11\",\"k12\":\"v12\",\"k13\":\"v13\",\"k14\":{\"k31\":\"v3\",\"k32\":123.45,\"k33\":false,\"k34\":null,\"k35\":[\"vvv\",\"1.23456789123456789\",true,null]}},{\"k22\":\"v22\",\"k21\":\"v21\",\"k23\":\"v23\"}]",jsonString);
}
+ */
}

View File

@@ -1,3 +1,142 @@
-------------------------------------------------------------------
Sun Oct 5 14:40:12 UTC 2025 - Fridrich Strba <fstrba@suse.com>
- Update to cliftonlabs fork 2.3.1, backward compatible with 1.1.1
* Changes of 2.3.1
+ Bugfix: patched Chris's fix backwards for 2.*
* Changes of 2.3.0
+ Deprecated the feature in Jsoner that serializes Enums to
fully qualified strings, the Enums should implement Jsonable
instead.
+ Deprecated getEnum and getEnumOrDefault methods in JsonArray
and JsonObject.
+ Deprecated get___(String) and get___OrDefault(String, ___) in
favor of get___(JsonKey) and get___OrDefault(JsonKey)
respectively.
+ Enhancement: Added JsonKey interface to aid with code
maintainability and convenience.
+ Enhancement: Jsoner can mint a JsonKey.
+ Enhancement: Jsoner deserialization no longer throws
IOExceptions in favor of a DeserializationException with an
IOEXCEPTION problem since the code to handle one is typically
duplicated to handle the other.
* Changes of 2.2.0
+ Bug fix: getEnum and getInteger and friends return null when
the paired value is null to better match the java Map
contract.
+ Enhancement: Jsoner can prettyPrint with tabs or spaces.
* Changes of 2.1.2
+ Bug fix: Jsoner#prettyPrint(printable) no longer quotes
colons.
+ Enhancement: for convenience a colon missing between a key
value pair will officially continue to function as it has
since the 1.* versions. Deserialization test cases have been
updated.
* Changes of 2.1.1
+ Separated the CHANGLOG and LICENSE from the README as they are
recognized by tools like github. Most of the information in
README is linked to on the project's website.
+ Enhancement: JsonArray and JsonObject convenience gets are
more flexible on their expected value. Booleans now allow
Booleans or Strings. Numbers now allow Numbers or Strings.
Strings now allow Booleans, Numbers, or Strings.
* Changes of 2.1.0
+ Bug fix: JsonObject#getDefaultByte(key, defaultValue) now
properly returns a byte value instead of a float.
+ Enhancement: JsonObject has typed gets for each JSON value
type.
+ Enhancement: JsonArray and JsonObject no longer return
primitives.
* Changes 2.0.0
+ Removed ant build file.
+ SCM section of the POM is updated with the github information
since the svn repo urls were 404s.
+ POM now defines the source at 1.7 instead of 1.2, and is the
only cause for the major version increment. The 2.0.0 release
of this library is otherwise 100% backwards compatible with
the older versions.
+ Minor code quality changes have been made to the old files of
the project.
+ JFlex plugin now included in POM.
+ JFlex will produce a lexing class from all lex files in
src/main/lex.
+ Javadocs are now produced when the jar goal is executed.
+ Moved lex files from doc/ to src/main/lex.
+ Deprecated the old json.lex in favor of jsonstrict.lex.
+ Deprecated ContentHandler and doesn't have a 2.0 equivalent.
+ Deprecated ContainerFactory and doesn't have a 2.0 equivalent.
+ Deprecated ItemList and doesn't have a 2.0 equivalent.
+ Deprecated JSONParse and JSONValue in favor of Jsoner.
+ Deprecated JSONStreamAware and JSONAware in favor of Jsonable.
+ Deprecated JSONObject in favor of JsonObject.
+ Deprecated JSONArray in favor of JsonArray.
+ Deprecated org.json.simple.parser.ParseException for
org.json.simple.DeserializationException.
+ Deprecated org.json.simple.parser.Yytoken for
org.json.simple.Yytoken.
+ Deprecated org.json.simple.parser.Yylex for
org.json.simple.Yylex.
+ Tests for deprecated classes have been reorganized and updated
to ensure backwards compatibility is maintained throughout the
2.x release lifetime.
+ Classes that have been deprecated still have shoddy javadocs
but were updated to not produce errors and warnings during the
build process.
+ Classes introduced in the 2.0 release have substantial
javadocs to help projects heathily update ASAP.
+ The Jsonable interface allows others to define how their
objects should be serialized in JSON.
+ DeserializationException has a new problem type for disallowed
tokens.
+ DeserializationException now recommends recovery actions based
on the problem that caused the DeserializationException in its
message. All recovery scenarios are basically the same so
DeserializationException is still the only json-simple
exception class.
+ The new Yytoken types are renamed.
+ The new Yytoken is robustly constructed only allowing a null
value when it is a null value in the DATUM tokens.
+ Jsoner can escape strings provided to it to help with
implementing the Jsonable interface.
+ Jsoner can pretty print JSON strings provided to it for
logging and basic display purposes.
+ Jsoner can serialize data defined in the RFC 4627
specification and objects that implement the Jsonable
interface. If data could be serialized multiple ways the
deepest Jsonable implementation in the heiarchy is preferred.
Any defined Jsonable implementation will be preferred before
falling back to a default serialization.
+ Jsoner can serialize an Enum that doesn't implement Jsonable.
+ Jsoner will deserialize any numerical value as a BigDecimal.
+ Jsoner can deserialize JsonArrays, JsonObjects, Strings,
Numbers, Booleans, and null from strings provided to it.
+ Jsoner can deserialize a JsonArray and exception out if any
other value would be returned.
+ Jsoner can deserialize a JsonObject and exception out if any
other value would be returned.
+ Jsoner can deserialize multiple JsonArrays, JsonObjects,
Strings, Numbers, Booleans, and nulls from a single string
provided to it.
+ Jsoner deserialization (parsing) is thread safe.
+ JsonArray is based on ArrayList<Object>. So it won't produce
code warnings and can be used to construct a more convenient
Collection.
+ JsonArrays that are homogeneous can be cast and copied into a
provided collection of the homogenous type.
+ JsonArray contains gets for each allowed data type in JSON and
convenience methods for Collections, Enums, and Maps. Note
that they will throw ClassCastExceptions in such cases since
it is still indicative of a programmer's error.
+ JsonObject is based on HashMap<String, Object>.
+ JsonObject contains getTypeOrDefault for each allowed data
type in JSON and convenience methods for Collections, Enums,
and Maps. Note that they will throw ClassCastExceptions in
such cases since it is still indicative of a programmer's
error.
- Removed patch:
* json-simple-hash-java-1.8.patch
+ not needed with this version
-------------------------------------------------------------------
Wed Feb 21 10:48:04 UTC 2024 - Gus Kenion <gus.kenion@suse.com>

View File

@@ -17,21 +17,15 @@
Name: json-simple
Version: 1.1.1
Version: 2.3.1
Release: 0
Summary: Simple Java toolkit for JSON
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://code.google.com/p/json-simple/
# svn export http://json-simple.googlecode.com/svn/tags/tag_release_1_1_1/ json-simple-1.1.1
# tar czf json-simple-1.1.1-src-svn.tar.gz json-simple-1.1.1
Source0: json-simple-1.1.1-src-svn.tar.gz
#https://code.google.com/p/json-simple/issues/detail?id=97
Patch0: json-simple-hash-java-1.8.patch
Source0: https://github.com/cliftonlabs/%{name}/archive/refs/tags/%{name}-%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: maven-local
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildArch: noarch
%description
@@ -56,21 +50,20 @@ Group: Development/Libraries/Java
This package contains %{summary}.
%prep
%setup -q -n json-simple-%{version}
find . -name '*.jar' -exec rm -f '{}' \;
# All the files have dos line endings, remove them.
find . -type f -exec sed -i 's/\r//' {} \;
%patch -P 0 -p1
%setup -q -n %{name}-%{name}-%{version}
# Remove hard-coded compiler settings
%pom_remove_plugin :maven-compiler-plugin
# Do not regenerate the files
%pom_remove_plugin :maven-jflex-plugin
%pom_remove_plugin :nexus-staging-maven-plugin
%pom_remove_plugin :maven-javadoc-plugin
%{mvn_file} : %{name}
%{mvn_alias} com.github.cliftonlabs: com.googlecode.json-simple:
%build
%{mvn_build} -f -- \
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \
-Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%install
@@ -79,10 +72,10 @@ find . -type f -exec sed -i 's/\r//' {} \;
%fdupes %{buildroot}%{datadir}/javadoc
%files -f .mfiles
%license LICENSE.txt
%doc AUTHORS.txt ChangeLog.txt README.txt
%license LICENSE
%doc CHANGELOG README
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt
%license LICENSE
%changelog