Skip to content
Commits on Source (4)
libandroid-json-org-java (20121204-20090211-3) unstable; urgency=medium
The following BREAKING changes were made:
- The "debian" version of the maven artifact has been reversioned to
"debian-android", this is only relevant for maven-debian-helper users
who may need to update their debian/maven.rules. It should not affect
ordinary users.
- The documentation no longer exists at /usr/share/doc/libandroid-json-org-java/api.
Instead you can find it at /usr/share/doc/libandroid-json-org-java/{android,latest}/api
depending on which version you want.
The following things are DEPRECATED and will be removed in a later release:
- /usr/share/java/json.jar now links to json-android.jar; the former will
be removed in the future. You should either use json-android.jar or
json-latest.jar as appropriate.
-- Ximin Luo <infinity0@debian.org> Mon, 13 Aug 2018 02:37:57 -0700
......@@ -7,3 +7,23 @@ The following classes however are included and might also be the most used:
JSONArray, JSONException, JSONObject, JSONStringer, JSONTokener
-- Thomas Koch <thomas@koch.ro>, Fri, 11 Jan 2013 21:38:27 +0100
This package contains *TWO* versions of the org.json API. One version
("android") is directly from upstream (Android) and reimplements an older
version of Crockford's code. The other version ("latest") derives from the
Android code but has been patched (see debian/patches-latest) to be more
compatible with the latest version of Crockford's code.
In particular, JSONException is unchecked since version 20131018 [1] but the
Android API [2] still defines it as checked. Furthermore many of these API
methods declare "throws JSONException". These cause build errors with newer
projects such as Lizzie, so this Debian package builds both.
[1] https://github.com/stleary/JSON-java/commit/0759465bdf9b7dc1bc61883735b3fb61c488d3b5
[2] https://developer.android.com/reference/org/json/JSONException
Currently these additional patches have only been lightly tested and are most
likely incomplete and/or inefficient. If you need additional changes, please
file a bug report against this package and we will be happy to accommodate you.
-- Ximin Luo <infinity0@debian.org> Mon, 13 Aug 2018 02:37:57 -0700
libandroid-json-org-java (20121204-20090211-4) UNRELEASED; urgency=medium
* Clarify wording in README.Debian, the Android code is a completely new
reimplementation and was not forked from Crockford's code.
-- Ximin Luo <infinity0@debian.org> Mon, 13 Aug 2018 03:48:43 -0700
libandroid-json-org-java (20121204-20090211-3) unstable; urgency=medium
* Update Vcs-* fields.
* Build another version that more closely matches API version 20180130
where JSONException is unchecked. This involves some minor breaking
changes (which should not affect normal users) and some deprecations that
developers need to respond to; see NEWS for details.
-- Ximin Luo <infinity0@debian.org> Mon, 13 Aug 2018 03:22:37 -0700
libandroid-json-org-java (20121204-20090211-2) unstable; urgency=medium
* Team upload.
......
......@@ -2,12 +2,12 @@ Source: libandroid-json-org-java
Section: java
Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Uploaders: Thomas Koch <thomas@koch.ro>
Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper (>= 1.5), junit4
Uploaders: Thomas Koch <thomas@koch.ro>, Ximin Luo <infinity0@debian.org>
Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper (>= 1.5), junit4, quilt
Build-Depends-Indep: default-jdk-doc, libmaven-javadoc-plugin-java
Standards-Version: 3.9.6
Vcs-Git: git://anonscm.debian.org/pkg-java/libandroid-json-org-java.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/libandroid-json-org-java.git
Vcs-Git: https://salsa.debian.org/java-team/libandroid-json-org-java.git
Vcs-Browser: https://salsa.debian.org/java-team/libandroid-json-org-java
Homepage: https://android.googlesource.com/platform/libcore/+/master/json
Package: libandroid-json-org-java
......
......@@ -6,5 +6,7 @@ Abstract: This is the API Javadoc provided for the
Section: Programming
Format: HTML
Index: /usr/share/doc/libandroid-json-org-java/api/index.html
Files: /usr/share/doc/libandroid-json-org-java/api/*
Index: /usr/share/doc/libandroid-json-org-java/android/api/index.html
Files: /usr/share/doc/libandroid-json-org-java/android/api/*
Index: /usr/share/doc/libandroid-json-org-java/latest/api/index.html
Files: /usr/share/doc/libandroid-json-org-java/latest/api/*
target/apidocs/* usr/share/doc/libandroid-json-org-java/api
v-android/target/apidocs/* usr/share/doc/libandroid-json-org-java/android/api
v-latest/target/apidocs/* usr/share/doc/libandroid-json-org-java/latest/api
usr/share/java/json-android.jar usr/share/java/json.jar
......@@ -25,4 +25,6 @@
# --site-xml=<location>: Optional, the location for site.xml if it needs to be installed.
# Empty by default. [mh_install]
#
pom.xml --has-package-version --java-lib --usj-name=json
pom.xml --ignore-pom
v-android/pom.xml --has-package-version --java-lib --usj-name=json-android
v-latest/pom.xml --has-package-version --java-lib --usj-name=json-latest
......@@ -16,5 +16,6 @@
# and version starting with 3., replacing the version with 3.x
# junit junit jar s/3\..*/3.x/
org.json json jar s/.*/debian/ * *
org.json json jar s/2009.*/debian-android/ * *
org.json json jar s/2018.*/debian-latest/ * *
junit junit jar s/4\..*/4.x/
Index: 20180130/src/main/java/org/json/JSONException.java
===================================================================
--- 20180130.orig/src/main/java/org/json/JSONException.java
+++ 20180130/src/main/java/org/json/JSONException.java
@@ -41,7 +41,7 @@ package org.json;
* }
* }</pre>
*/
-public class JSONException extends Exception {
+public class JSONException extends RuntimeException {
public JSONException(String s) {
super(s);
Index: 20180130/src/main/java/org/json/JSONTokener.java
===================================================================
--- 20180130.orig/src/main/java/org/json/JSONTokener.java
+++ 20180130/src/main/java/org/json/JSONTokener.java
@@ -83,6 +83,15 @@ public class JSONTokener {
this.in = in;
}
+ private static String _helper(java.util.Scanner s) {
+ return s.hasNext() ? s.next() : "";
+ }
+
+ public JSONTokener(java.io.InputStream is) {
+ // trick from https://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string
+ this(is == null ? null : _helper(new java.util.Scanner(is).useDelimiter("\\A")));
+ }
+
/**
* Returns the next value from the input.
*
Index: 20180130/src/test/java/org/json/JSONTokenerTest.java
===================================================================
--- 20180130.orig/src/test/java/org/json/JSONTokenerTest.java
+++ 20180130/src/test/java/org/json/JSONTokenerTest.java
@@ -26,78 +26,78 @@ public class JSONTokenerTest extends Tes
public void testNulls() throws JSONException {
// JSONTokener accepts null, only to fail later on almost all APIs!
- new JSONTokener(null).back();
+ new JSONTokener((String)null).back();
try {
- new JSONTokener(null).more();
+ new JSONTokener((String)null).more();
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).next();
+ new JSONTokener((String)null).next();
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).next(3);
+ new JSONTokener((String)null).next(3);
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).next('A');
+ new JSONTokener((String)null).next('A');
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).nextClean();
+ new JSONTokener((String)null).nextClean();
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).nextString('"');
+ new JSONTokener((String)null).nextString('"');
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).nextTo('A');
+ new JSONTokener((String)null).nextTo('A');
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).nextTo("ABC");
+ new JSONTokener((String)null).nextTo("ABC");
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).nextValue();
+ new JSONTokener((String)null).nextValue();
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).skipPast("ABC");
+ new JSONTokener((String)null).skipPast("ABC");
fail();
} catch (NullPointerException e) {
}
try {
- new JSONTokener(null).skipTo('A');
+ new JSONTokener((String)null).skipTo('A');
fail();
} catch (NullPointerException e) {
}
assertEquals("foo! at character 0 of null",
- new JSONTokener(null).syntaxError("foo!").getMessage());
+ new JSONTokener((String)null).syntaxError("foo!").getMessage());
- assertEquals(" at character 0 of null", new JSONTokener(null).toString());
+ assertEquals(" at character 0 of null", new JSONTokener((String)null).toString());
}
public void testEmptyString() throws JSONException {
......@@ -12,6 +12,9 @@ author of the json standard Douglas Crockford. His implementation however is
not free software.
Therefor the Android team did a cleanroom reimplementation of a json library
to be used inplace of the original one.
This version is used in Android and has a different API from the most recent
version of org.json published on maven-central, see README.Debian for details.
</description>
<url>https://android.googlesource.com/platform/libcore/+/master/json</url>
<licenses>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180130</version>
<name>androids rewrite of the evil licensed json.org</name>
<packaging>jar</packaging>
<description>
Json.org is a popular java library to parse and create json string from the
author of the json standard Douglas Crockford. His implementation however is
not free software.
Therefor the Android team did a cleanroom reimplementation of a json library
to be used inplace of the original one.
This contains additional patches from Debian to bring the Android API in line
with version 20180130 of the org.json API, see README.Debian for details.
</description>
<url>https://android.googlesource.com/platform/libcore/+/master/json</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
<organization>
<name>The Android Open Source Project</name>
<!--url></url-->
</organization>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.x</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.json</groupId>
<artifactId>json-all</artifactId>
<version>0</version>
<name>androids rewrite of the evil licensed json.org</name>
<packaging>pom</packaging>
<description>
Json.org is a popular java library to parse and create json string from the
author of the json standard Douglas Crockford. His implementation however is
not free software.
Therefor the Android team did a cleanroom reimplementation of a json library
to be used inplace of the original one.
</description>
<url>https://android.googlesource.com/platform/libcore/+/master/json</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
<organization>
<name>The Android Open Source Project</name>
<!--url></url-->
</organization>
<modules>
<module>v-android</module>
<module>v-latest</module>
</modules>
</project>
......@@ -5,10 +5,16 @@ export JAVA_HOME = /usr/lib/jvm/default-java
%:
dh $@ --buildsystem=maven
override_dh_auto_configure:
cp debian/debian.pom.xml pom.xml
generate-sources:
cp debian/pom.xml pom.xml
mkdir -p v-android && cp -a src v-android/ && cp debian/pom.android.xml v-android/pom.xml
mkdir -p v-latest && cp -a src v-latest/ && cp debian/pom.latest.xml v-latest/pom.xml
cd v-latest && QUILT_PATCHES=../debian/patches-latest quilt push -a
override_dh_auto_configure: generate-sources
dh_auto_configure
override_dh_auto_clean:
dh_auto_clean
rm -rf v-android v-latest
rm -f pom.xml