[Git][java-team/derby][master] 8 commits: apply patch for libjson-simple-java transition (Closes: #968937)

Tony Mancill gitlab at salsa.debian.org
Sat Sep 5 21:36:05 BST 2020



Tony Mancill pushed to branch master at Debian Java Maintainers / derby


Commits:
8fe3aaad by tony mancill at 2020-09-05T08:50:12-07:00
apply patch for libjson-simple-java transition (Closes: #968937)

- - - - -
a095a254 by tony mancill at 2020-09-05T11:28:00-07:00
Use debhelper-compat 13

- - - - -
75bf7d27 by tony mancill at 2020-09-05T11:28:43-07:00
Set "Rules-Requires-Root: no" in debian/control

- - - - -
75c79a04 by tony mancill at 2020-09-05T11:56:55-07:00
Use https URLs in copyright, control and watch

- - - - -
9bef75aa by tony mancill at 2020-09-05T11:57:08-07:00
Bump Standards-Version to 4.5.0

- - - - -
943f9328 by tony mancill at 2020-09-05T12:06:23-07:00
Override dh_auto_test in debian/rules, not dh_test

- - - - -
5c35962b by tony mancill at 2020-09-05T12:55:01-07:00
Update debian/rules to add json-simple during tests

- - - - -
83378a99 by tony mancill at 2020-09-05T12:55:01-07:00
prepare changelog for upload to unstable

- - - - -


8 changed files:

- debian/changelog
- − debian/compat
- debian/control
- debian/copyright
- + debian/patches/json-simple-3.patch
- debian/patches/series
- debian/rules
- debian/watch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,20 @@
+derby (10.14.2.0-2) unstable; urgency=medium
+
+  * Team upload
+
+  [ Gilles Filippini ]
+  * Tentative support for json-simple >= 3 (Closes: #968937)
+
+  [ tony mancill ]
+  * Use debhelper-compat 13
+  * Set "Rules-Requires-Root: no" in debian/control
+  * Use https URLs in copyright, control and watch
+  * Bump Standards-Version to 4.5.0
+  * Override dh_auto_test in debian/rules, not dh_test
+  * Update debian/rules to add json-simple during tests
+
+ -- tony mancill <tmancill at debian.org>  Sat, 05 Sep 2020 11:57:12 -0700
+
 derby (10.14.2.0-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-11


=====================================
debian/control
=====================================
@@ -7,7 +7,7 @@ Uploaders:
  Emmanuel Bourg <ebourg at apache.org>
 Build-Depends:
  ant (>= 1.7),
- debhelper (>= 11),
+ debhelper-compat (= 13),
  default-jdk,
  javacc4,
  junit,
@@ -16,10 +16,11 @@ Build-Depends:
  liboro-java,
  libservlet3.1-java,
  maven-repo-helper
-Standards-Version: 4.1.4
+Standards-Version: 4.5.0
 Vcs-Git: https://salsa.debian.org/java-team/derby.git
 Vcs-Browser: https://salsa.debian.org/java-team/derby
-Homepage: http://db.apache.org/derby/
+Homepage: https://db.apache.org/derby/
+Rules-Requires-Root: no
 
 Package: libderbyclient-java
 Architecture: all


=====================================
debian/copyright
=====================================
@@ -1,6 +1,6 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: Apache Derby
-Source: http://db.apache.org/derby/
+Source: https://db.apache.org/derby/
 
 Files: *
 Copyright: 2004-2014, The Apache Software Foundation


=====================================
debian/patches/json-simple-3.patch
=====================================
@@ -0,0 +1,504 @@
+Index: derby-10.14.2.0/java/optional/org/apache/derby/optional/api/SimpleJsonUtils.java
+===================================================================
+--- derby-10.14.2.0.orig/java/optional/org/apache/derby/optional/api/SimpleJsonUtils.java
++++ derby-10.14.2.0/java/optional/org/apache/derby/optional/api/SimpleJsonUtils.java
+@@ -42,9 +42,9 @@ import java.sql.ResultSet;
+ import java.sql.ResultSetMetaData;
+ import java.sql.SQLException;
+ 
+-import org.json.simple.JSONArray;
+-import org.json.simple.JSONObject;
+-import org.json.simple.parser.JSONParser;
++import @JSON_SIMPLE at .JsonArray;
++import @JSON_SIMPLE at .JsonObject;
++import @JSON_SIMPLE at .Jsoner;
+ 
+ import org.apache.derby.iapi.types.HarmonySerialClob;
+ import org.apache.derby.iapi.util.StringUtil;
+@@ -77,9 +77,9 @@ public abstract class SimpleJsonUtils
+ 
+     /**
+      * <p>
+-     * Pack a ResultSet into a JSONArray. This method could be called
++     * Pack a ResultSet into a JsonArray. This method could be called
+      * client-side on any query result from any DBMS. Each row is
+-     * converted into a JSONObject whose keys are the corresponding
++     * converted into a JsonObject whose keys are the corresponding
+      * column names from the ResultSet.
+      * Closes the ResultSet once it has been drained. Datatypes map
+      * to JSON values as follows:
+@@ -98,17 +98,17 @@ public abstract class SimpleJsonUtils
+      * </ul>
+      */
+     @SuppressWarnings("unchecked")
+-    public  static  JSONArray   toJSON( ResultSet rs )
++    public  static  JsonArray   toJSON( ResultSet rs )
+         throws SQLException
+     {
+         ResultSetMetaData   rsmd = rs.getMetaData();
+         int                 columnCount = rsmd.getColumnCount();
+-        JSONArray           result = new JSONArray();
++        JsonArray           result = new JsonArray();
+ 
+         try {
+             while( rs.next() )
+             {
+-                JSONObject  row = new JSONObject();
++                JsonObject  row = new JsonObject();
+ 
+                 for ( int i = 1; i <= columnCount; i++ )
+                 {
+@@ -133,34 +133,32 @@ public abstract class SimpleJsonUtils
+     }
+ 
+     /**
+-     * Construct a JSONArray from a Reader.
++     * Construct a JsonArray from a Reader.
+      */
+-    public static JSONArray readArray( Reader reader )
++    public static JsonArray readArray( Reader reader )
+         throws SQLException
+     {
+-        JSONParser  parser = new JSONParser();
+-        
+         Object  obj = null;
+         try {
+-            obj = parser.parse( reader );
++            obj = Jsoner.deserialize( reader );
+         }
+         catch( Throwable t) { throw ToolUtilities.wrap( t ); }
+ 
+-        if ( (obj == null) || !(obj instanceof JSONArray) )
++        if ( (obj == null) || !(obj instanceof JsonArray) )
+         {
+             throw new SQLException( "Document is not a JSON array." );
+         }
+ 
+-        return (JSONArray) obj;
++        return (JsonArray) obj;
+     }
+ 
+     /**
+      * <p>
+-     * SQL FUNCTION to convert a JSON document string into a JSONArray.
++     * SQL FUNCTION to convert a JSON document string into a JsonArray.
+      * This function is registered by the simpleJson optional tool.
+      * </p>
+      */
+-    public  static  JSONArray   readArrayFromString( String document )
++    public  static  JsonArray   readArrayFromString( String document )
+         throws SQLException
+     {
+         if ( document == null ) { document = ""; }
+@@ -169,10 +167,10 @@ public abstract class SimpleJsonUtils
+     }
+ 
+     /**
+-     * Read a JSONArray from an InputStream. Close the stream
+-     * after reading the JSONArray.
++     * Read a JsonArray from an InputStream. Close the stream
++     * after reading the JsonArray.
+      */
+-    public static JSONArray readArrayFromStream
++    public static JsonArray readArrayFromStream
+         ( InputStream inputStream, String characterSetName )
+         throws SQLException
+     {
+@@ -190,10 +188,10 @@ public abstract class SimpleJsonUtils
+     }
+ 
+     /**
+-     * SQL FUNCTION to read a JSONArray from a File. This function
++     * SQL FUNCTION to read a JsonArray from a File. This function
+      * is registered by the simpleJson optional tool.
+      */
+-    public static JSONArray readArrayFromFile
++    public static JsonArray readArrayFromFile
+         ( String fileName, String characterSetName )
+         throws SQLException
+     {
+@@ -217,10 +215,10 @@ public abstract class SimpleJsonUtils
+     }
+ 
+     /**
+-     * SQL FUNCTION to read a JSONArray from an URL address.
++     * SQL FUNCTION to read a JsonArray from an URL address.
+      * This function is registered by the simpleJson optional tool.
+      */
+-    public static JSONArray readArrayFromURL
++    public static JsonArray readArrayFromURL
+         ( String urlString, String characterSetName )
+         throws SQLException
+     {
+@@ -245,12 +243,12 @@ public abstract class SimpleJsonUtils
+     }
+ 
+     /**
+-     * SQL FUNCTION to convert a JSONArray into a CLOB.
++     * SQL FUNCTION to convert a JsonArray into a CLOB.
+      */
+-    public static Clob arrayToClob( JSONArray array )
++    public static Clob arrayToClob( JsonArray array )
+     {
+         if ( array == null ) { return null; }
+-        else { return new HarmonySerialClob( array.toJSONString() ); }
++        else { return new HarmonySerialClob( Jsoner.serialize(array) ); }
+     }
+ 
+     /////////////////////////////////////////////////////////////////
+@@ -273,8 +271,8 @@ public abstract class SimpleJsonUtils
+             (obj instanceof Double) ||
+             (obj instanceof Boolean) ||
+             (obj instanceof String) ||
+-            (obj instanceof JSONObject) ||
+-            (obj instanceof JSONArray)
++            (obj instanceof JsonObject) ||
++            (obj instanceof JsonArray)
+             )
+         {
+             return obj;
+Index: derby-10.14.2.0/java/optional/org/apache/derby/optional/api/SimpleJsonVTI.java
+===================================================================
+--- derby-10.14.2.0.orig/java/optional/org/apache/derby/optional/api/SimpleJsonVTI.java
++++ derby-10.14.2.0/java/optional/org/apache/derby/optional/api/SimpleJsonVTI.java
+@@ -28,8 +28,8 @@ import java.sql.DriverManager;
+ import java.sql.SQLException;
+ import java.sql.SQLWarning;
+ 
+-import org.json.simple.JSONArray;
+-import org.json.simple.JSONObject;
++import @JSON_SIMPLE at .JsonArray;
++import @JSON_SIMPLE at .JsonObject;
+ 
+ import org.apache.derby.vti.VTITemplate;
+ 
+@@ -38,7 +38,7 @@ import org.apache.derby.optional.utils.T
+ /**
+  * <p>
+  * This is a table function which turns a JSON array into a relational
+- * ResultSet. This table function relies on the JSON.simple JSONArray class
++ * ResultSet. This table function relies on the JSON.simple JsonArray class
+  * found at https://code.google.com/p/json-simple/.
+  * Each object in the array is turned into a row.
+  * The shape of the row is declared by the CREATE FUNCTION ddl
+@@ -61,8 +61,8 @@ import org.apache.derby.optional.utils.T
+  * </ul>
+  *
+  * <p>
+- * This table function relies on the JSONArray type loaded by the simpleJson optional
+- * tool. This table function can be combined with other JSONArray-creating
++ * This table function relies on the JsonArray type loaded by the simpleJson optional
++ * tool. This table function can be combined with other JsonArray-creating
+  * functions provided by that tool.
+  * </p>
+  *
+@@ -74,7 +74,7 @@ import org.apache.derby.optional.utils.T
+  * <pre>
+  * call syscs_util.syscs_register_tool( 'simpleJson', true );
+  *
+- * create function thermostatReadings( jsonDocument JSONArray )
++ * create function thermostatReadings( jsonDocument JsonArray )
+  * returns table
+  * (
+  *   "id" int,
+@@ -136,9 +136,9 @@ public class SimpleJsonVTI extends VTITe
+     //
+     ////////////////////////////////////////////////////////////////////////
+ 
+-    private JSONArray   _topArray = null;
++    private JsonArray   _topArray = null;
+     private int         _nextIdx = 0;
+-    private JSONObject  _currentRow = null;
++    private JsonObject  _currentRow = null;
+     private boolean     _wasNull = true;
+ 
+     private Connection  _connection;
+@@ -152,12 +152,12 @@ public class SimpleJsonVTI extends VTITe
+     ////////////////////////////////////////////////////////////////////////
+ 
+     /**
+-     * Construct from a JSONArray object.
++     * Construct from a JsonArray object.
+      */
+-    private SimpleJsonVTI( JSONArray array )
++    private SimpleJsonVTI( JsonArray array )
+         throws SQLException
+     {
+-        _topArray = (JSONArray) array;
++        _topArray = (JsonArray) array;
+         _connection = DriverManager.getConnection( "jdbc:default:connection" );
+     }
+ 
+@@ -169,10 +169,10 @@ public class SimpleJsonVTI extends VTITe
+ 
+     /**
+      * <p>
+-     * Create a SimpleJsonVTI from a JSONArray object.
++     * Create a SimpleJsonVTI from a JsonArray object.
+      * </p>
+      */
+-    public  static  SimpleJsonVTI   readArray( JSONArray array )
++    public  static  SimpleJsonVTI   readArray( JsonArray array )
+         throws SQLException
+     {
+         return new SimpleJsonVTI( array );
+@@ -201,7 +201,7 @@ public class SimpleJsonVTI extends VTITe
+ 
+         Object obj = _topArray.get( _nextIdx );
+ 
+-        if ( (obj == null) || !(obj instanceof JSONObject) )
++        if ( (obj == null) || !(obj instanceof JsonObject) )
+         {
+             _currentRow = null;
+             String  cellType = (obj == null) ? "NULL" : obj.getClass().getName();
+@@ -209,7 +209,7 @@ public class SimpleJsonVTI extends VTITe
+         }
+         else
+         {
+-            _currentRow = (JSONObject) obj;
++            _currentRow = (JsonObject) obj;
+         }
+ 
+         _nextIdx++;
+Index: derby-10.14.2.0/java/optional/org/apache/derby/optional/json/SimpleJsonTool.java
+===================================================================
+--- derby-10.14.2.0.orig/java/optional/org/apache/derby/optional/json/SimpleJsonTool.java
++++ derby-10.14.2.0/java/optional/org/apache/derby/optional/json/SimpleJsonTool.java
+@@ -28,7 +28,7 @@ import java.sql.PreparedStatement;
+ import java.sql.ResultSet;
+ import java.sql.SQLException;
+ 
+-import org.json.simple.JSONArray;
++import @JSON_SIMPLE at .JsonArray;
+ 
+ import org.apache.derby.iapi.sql.dictionary.OptionalTool;
+ import org.apache.derby.iapi.tools.i18n.LocalizedResource;
+@@ -45,16 +45,16 @@ import org.apache.derby.optional.utils.T
+  * </p>
+  *
+  * <ul>
+- * <li><b>JSONArray</b> - A UDT bound to the JSON.simple JSONArray class.</li>
++ * <li><b>JsonArray</b> - A UDT bound to the JSON.simple JsonArray class.</li>
+  * <li><b>toJSON</b> - A function for packaging up query results as a
+- * JSONArray. Each cell in the array is a row. Each row
++ * JsonArray. Each cell in the array is a row. Each row
+  * has key/value pairs for all columns returned by the query.</li>
+  * <li><b>readArrayFromString</b> - A function which turns a JSON document
+- * string into a JSONArray.</li>
++ * string into a JsonArray.</li>
+  * <li><b>readArrayFromFile</b> - A function which reads a file containing a
+- * JSON document and turns it into a JSONArray.</li>
++ * JSON document and turns it into a JsonArray.</li>
+  * <li><b>readArrayFromURL</b> - A function which reads a JSON document from an
+- * URL address and turns it into a JSONArray.</li>
++ * URL address and turns it into a JsonArray.</li>
+  * </ul>
+  */
+ public	class   SimpleJsonTool  implements OptionalTool
+@@ -74,7 +74,7 @@ public	class   SimpleJsonTool  implement
+             "\n(" +
+             "\n\tqueryString varchar( 32672 )," +
+             "\n\tqueryArgs varchar( 32672 ) ..." +
+-            "\n)\nreturns JSONArray\n" +
++            "\n)\nreturns JsonArray\n" +
+             "\nlanguage java parameter style derby reads sql data" +
+             "\nexternal name 'org.apache.derby.optional.json.SimpleJsonTool.toJSON'\n"
+         ),
+@@ -83,7 +83,7 @@ public	class   SimpleJsonTool  implement
+         (
+             "readArrayFromString",
+             "create function readArrayFromString( document varchar( 32672 ) )\n" +
+-            "returns JSONArray\n" +
++            "returns JsonArray\n" +
+             "language java parameter style java contains sql\n" +
+             "external name 'org.apache.derby.optional.api.SimpleJsonUtils.readArrayFromString'\n"
+         ),
+@@ -93,7 +93,7 @@ public	class   SimpleJsonTool  implement
+             "readArrayFromFile",
+             "create function readArrayFromFile\n" +
+             "( fileName varchar( 32672 ), characterSetName varchar( 100 ) )\n" +
+-            "returns JSONArray\n" +
++            "returns JsonArray\n" +
+             "language java parameter style java contains sql\n" +
+             "external name 'org.apache.derby.optional.api.SimpleJsonUtils.readArrayFromFile'\n"
+         ),
+@@ -103,7 +103,7 @@ public	class   SimpleJsonTool  implement
+             "readArrayFromURL",
+             "create function readArrayFromURL\n" +
+             "( urlString varchar( 32672 ), characterSetName varchar( 100 ) )\n" +
+-            "returns JSONArray\n" +
++            "returns JsonArray\n" +
+             "language java parameter style java contains sql\n" +
+             "external name 'org.apache.derby.optional.api.SimpleJsonUtils.readArrayFromURL'\n"
+         ),
+@@ -111,7 +111,7 @@ public	class   SimpleJsonTool  implement
+         new FunctionDescriptor
+         (
+             "arrayToClob",
+-            "create function arrayToClob( jsonDocument JSONArray ) returns clob\n" +
++            "create function arrayToClob( jsonDocument JsonArray ) returns clob\n" +
+             "language java parameter style java no sql\n" +
+             "external name 'org.apache.derby.optional.api.SimpleJsonUtils.arrayToClob'"
+         ),
+@@ -152,8 +152,8 @@ public	class   SimpleJsonTool  implement
+ 
+     /**
+      * <p>
+-     * Binds a UDT to JSONArray and creates a function to turn a query result
+-     * into a JSONArray. There are no parameters to this method.
++     * Binds a UDT to JsonArray and creates a function to turn a query result
++     * into a JsonArray. There are no parameters to this method.
+      * </p>
+      */
+     public  void    loadTool( String... configurationParameters )
+@@ -178,7 +178,7 @@ public	class   SimpleJsonTool  implement
+      */
+     private void    grantPermissions( Connection conn )  throws SQLException
+     {
+-        executeDDL( conn, "grant usage on type JSONArray to public" );
++        executeDDL( conn, "grant usage on type JsonArray to public" );
+ 
+         for ( FunctionDescriptor desc : _functionDescriptors )
+         {
+@@ -215,11 +215,11 @@ public	class   SimpleJsonTool  implement
+     /**
+      * <p>
+      * Compile a query (with optional ? parameters) and pack the results
+-     * into a JSONArray. This is the entry point which the simpleJson
++     * into a JsonArray. This is the entry point which the simpleJson
+      * tool binds to the function name "toJSON".
+      * </p>
+      */
+-    public  static  JSONArray   toJSON
++    public  static  JsonArray   toJSON
+         (
+          String queryString,
+          String... queryArgs
+@@ -267,7 +267,7 @@ public	class   SimpleJsonTool  implement
+         throws SQLException
+     {
+         String  createString =
+-            "create type JSONArray external name 'org.json.simple.JSONArray' language java";
++            "create type JsonArray external name '@JSON_SIMPLE at .JsonArray' language java";
+         
+         executeDDL( derbyConn, createString );
+     }
+@@ -279,7 +279,7 @@ public	class   SimpleJsonTool  implement
+         throws SQLException
+     {
+         String  createString =
+-            "drop type JSONArray restrict";
++            "drop type JsonArray restrict";
+         
+         executeDDL( derbyConn, createString );
+     }
+Index: derby-10.14.2.0/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SimpleJsonTest.java
+===================================================================
+--- derby-10.14.2.0.orig/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SimpleJsonTest.java
++++ derby-10.14.2.0/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SimpleJsonTest.java
+@@ -35,8 +35,8 @@ import org.apache.derbyTesting.junit.Sup
+ import org.apache.derbyTesting.junit.TestConfiguration;
+ import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests;
+ 
+-import org.json.simple.JSONArray;
+-import org.json.simple.JSONObject;
++import @JSON_SIMPLE at .JsonArray;
++import @JSON_SIMPLE at .JsonObject;
+ 
+ /**
+  * <p>
+@@ -231,7 +231,7 @@ public class SimpleJsonTest extends Base
+         goodStatement
+             (
+              conn,
+-             "create function prettyPrint( doc JSONArray ) returns varchar( 32672 )\n" +
++             "create function prettyPrint( doc JsonArray ) returns varchar( 32672 )\n" +
+              "language java parameter style java no sql\n" +
+              "external name '" + getClass().getName() + ".prettyPrint'\n"
+              );
+@@ -450,7 +450,7 @@ public class SimpleJsonTest extends Base
+         goodStatement
+             (
+              conn,
+-             "create function prettyPrint( doc JSONArray ) returns varchar( 32672 )\n" +
++             "create function prettyPrint( doc JsonArray ) returns varchar( 32672 )\n" +
+              "language java parameter style java no sql\n" +
+              "external name 'org.apache.derbyTesting.functionTests.tests.lang.SimpleJsonTest.prettyPrint'\n"
+              );
+@@ -546,7 +546,7 @@ public class SimpleJsonTest extends Base
+         goodStatement
+             (
+              conn,
+-             "create function thermostatReadings( jsonDocument JSONArray )\n" +
++             "create function thermostatReadings( jsonDocument JsonArray )\n" +
+              "returns table\n" +
+              "(\n" +
+              "\"id\" int,\n" +
+@@ -734,7 +734,7 @@ public class SimpleJsonTest extends Base
+         goodStatement
+             (
+              conn,
+-             "create function f_" + datatype + "( jsonArray JSONArray )\n" +
++             "create function f_" + datatype + "( jsonArray JsonArray )\n" +
+              "returns table\n" +
+              "(\n" +
+              "  str_col varchar( 10 ),\n" +
+@@ -792,10 +792,10 @@ public class SimpleJsonTest extends Base
+ 
+     /**
+      * <p>
+-     * Pretty-print a JSONArray.
++     * Pretty-print a JsonArray.
+      * </p>
+      */
+-    public static String prettyPrint( JSONArray array )
++    public static String prettyPrint( JsonArray array )
+     {
+         StringBuilder   buffer = new StringBuilder();
+ 
+@@ -808,7 +808,7 @@ public class SimpleJsonTest extends Base
+         (
+          StringBuilder buffer,
+          int indentLevel,
+-         JSONArray array
++         JsonArray array
+          )
+     {
+         buffer.append( "[" );
+@@ -830,7 +830,7 @@ public class SimpleJsonTest extends Base
+         (
+          StringBuilder buffer,
+          int indentLevel,
+-         JSONObject obj
++         JsonObject obj
+          )
+     {
+         buffer.append( "{" );
+@@ -862,10 +862,10 @@ public class SimpleJsonTest extends Base
+          )
+     {
+         if ( obj == null ) { buffer.append( "null" ); }
+-        else if ( obj instanceof JSONArray )
+-        { prettyPrintArray( buffer, indentLevel, (JSONArray) obj ); }
+-        else if ( obj instanceof JSONObject )
+-        { prettyPrintObject( buffer, indentLevel, (JSONObject) obj ); }
++        else if ( obj instanceof JsonArray )
++        { prettyPrintArray( buffer, indentLevel, (JsonArray) obj ); }
++        else if ( obj instanceof JsonObject )
++        { prettyPrintObject( buffer, indentLevel, (JsonObject) obj ); }
+         else if ( (obj instanceof Number) || (obj instanceof Boolean) )
+         { buffer.append( obj.toString() ); }
+         else { buffer.append( doubleQuote( obj.toString() ) ); }
+Index: derby-10.14.2.0/java/testing/org/apache/derbyTesting/junit/JDBC.java
+===================================================================
+--- derby-10.14.2.0.orig/java/testing/org/apache/derbyTesting/junit/JDBC.java
++++ derby-10.14.2.0/java/testing/org/apache/derbyTesting/junit/JDBC.java
+@@ -128,7 +128,7 @@ public class JDBC {
+ 
+     /** Is the json-simple core jar file on the classpath */
+     public  static  final   boolean HAVE_JSON_SIMPLE =
+-        haveClass( "org.json.simple.JSONArray" );
++        haveClass( "@JSON_SIMPLE at .JsonArray" );
+ 
+     /**
+      * Does java.sql.ResultSet implement java.lang.AutoCloseable?


=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@
 02-skip-jardriftcheck.patch
 03-offline-package-list.patch
 04-java10-compatibility.patch
+json-simple-3.patch


=====================================
debian/rules
=====================================
@@ -8,6 +8,15 @@ export ANT_OPTS=-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888 -Duser.home=`pw
 pkg := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
 version=$(shell dpkg-parsechangelog -ldebian/changelog | grep Version: | cut -f2 -d' ' | sed 's/[-+].*//' )
 
+# debian: bullseye - transitioning
+JSON_SIMPLE_VERSION = $(shell dpkg -l libjson-simple-java | grep '^ii' | awk '{print $$3}')
+JSON_SIMPLE_3 = $(shell dpkg --compare-versions '$(JSON_SIMPLE_VERSION)' '>' '3.1.1-1~' && echo yes || echo no)
+ifeq (yes,$(JSON_SIMPLE_3))
+JSON_SIMPLE_PACKAGE = com.github.cliftonlabs.json_simple
+else
+JSON_SIMPLE_PACKAGE = org.json.simple
+endif
+
 %:
 	dh $@
 
@@ -19,9 +28,18 @@ override_dh_auto_clean:
 	# Other bits
 	rm -f *.log
 	rm -Rf packageListLoc*
-	cd java/demo/toursdb/ ; rm -rf *generated* ToursDB_schema.sql loadTables.sql
+	cd java/demo/toursdb/ ; rm -rf *generated*
+	find . -type f -name \*.java.json-simple \
+	  -exec sh -c 'file={} && mv $$file $${file%.json-simple}' \; -print
+
 	
 override_dh_auto_build:
+	@# debian: bullseye - transitioning
+	find . -type f -name \*.java -exec grep -q '@JSON_SIMPLE@' {} \; \
+	  -exec sed -i.json-simple \
+		    -e 's, at JSON_SIMPLE@,$(JSON_SIMPLE_PACKAGE),' \
+		    {} \; -print
+
 	#Put .jar files in place
 	mkdir -p tools/java
 	cat /usr/share/java/oro.jar > tools/java/jakarta-oro-2.0.8.jar
@@ -37,10 +55,10 @@ override_dh_installdocs:
 	rm -Rf javadoc/testing
 	dh_installdocs
 
-override_dh_test:
+override_dh_auto_test:
 	env CLASSPATH=`echo jars/insane/*.jar | tr ' ' ':'` \
 	    java org.apache.derby.tools.sysinfo
-	ant all
+	ant all -Djson_simple=/usr/share/java/json-simple.jar
 
 override_dh_compress:
 	# Disable the compression of the individual files in the documentation package


=====================================
debian/watch
=====================================
@@ -1,2 +1,2 @@
 version=3
-http://archive.apache.org/dist/db/derby/db-derby-([\d\.]+)/db-derby-([\d\.]+)-src.tar.gz debian debian/orig-tar.sh
+https://archive.apache.org/dist/db/derby/db-derby-([\d\.]+)/db-derby-([\d\.]+)-src.tar.gz debian debian/orig-tar.sh



View it on GitLab: https://salsa.debian.org/java-team/derby/-/compare/15e9386d452437b3c5c6a85328f34b2bb1021578...83378a9957e98bbe9e3ba66c71988c4a04073bc5

-- 
View it on GitLab: https://salsa.debian.org/java-team/derby/-/compare/15e9386d452437b3c5c6a85328f34b2bb1021578...83378a9957e98bbe9e3ba66c71988c4a04073bc5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20200905/fd3f0d8e/attachment.html>


More information about the pkg-java-commits mailing list