=== modified file 'src/com/goldencode/p2j/admin/client/application/home/console/recordlocks/RecordLocksView.java'
--- old/src/com/goldencode/p2j/admin/client/application/home/console/recordlocks/RecordLocksView.java	2018-06-07 18:20:54 +0000
+++ new/src/com/goldencode/p2j/admin/client/application/home/console/recordlocks/RecordLocksView.java	2022-05-02 09:56:32 +0000
@@ -2,11 +2,12 @@
 ** Module   : RecordLocksView.java
 ** Abstract : RecordLocksView represents a view to access the record locks functionality.
 **
-** Copyright (c) 2017-2018, Golden Code Development Corporation.
+** Copyright (c) 2017-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ----------------Description----------------------
 ** 001 SBI 20170601 Created initial version.
 ** 002 CA  20180605 Added program trace in the record locks view.
+** 003 TJD 20220331 Removed deprecated reference to Inputdialog.showFilterDialog()
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -312,21 +313,30 @@
    /**
     * The Filter button click handler.
     * 
-    * @param    e
+    * @param    event
     *           Click event
     */
    @UiHandler("filter")
-   void onFilter(ClickEvent e)
+   void onFilterAction(ClickEvent event)
    {
-      // trigger for "Filter" dialog
+      InputDialog.Field newFilter;
       InputDialog inputDialog = this.inputDialogProvider.get();
-      inputDialog.showFilterDialog(
-                                    getUiHandlers().getCurrentFilter(),
-                                    modalFragment,
-                                    filter ->
-                                    {
-                                       getUiHandlers().setDataSelectionFilter(filter);
-                                    });
+      String hlpText = "<h4>Define the filtering specification below. Press the&nbsp;" +
+                       "'OK' button without any specification to remove any&nbsp;" +
+                       "previous filter.</h4>";
+      inputDialog.build("Filter", hlpText , new InputDialog.Field[]
+      {
+         newFilter = new InputDialog.Field("Filter", getUiHandlers().getCurrentFilter(), true)
+      });
+      inputDialog.show(modalFragment, true, values ->
+      {
+         if (values != null)
+         {
+            String newFilterValue = (String) values.get(newFilter);
+            getUiHandlers().setDataSelectionFilter(newFilterValue);
+            logger.info("inputDialog -> " + newFilterValue);
+         }
+      });
    }
    
    /**

=== modified file 'src/com/goldencode/p2j/admin/client/application/home/print/PrintPreviewView.java'
--- old/src/com/goldencode/p2j/admin/client/application/home/print/PrintPreviewView.java	2017-09-25 15:09:47 +0000
+++ new/src/com/goldencode/p2j/admin/client/application/home/print/PrintPreviewView.java	2022-05-02 09:56:32 +0000
@@ -2,10 +2,11 @@
 ** Module   : PrintPreviewView.java
 ** Abstract : PrintPreviewView defines UI to work with print preview.
 **
-** Copyright (c) 2017, Golden Code Development Corporation.
+** Copyright (c) 2017-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ----------------Description----------------------
 ** 001 SBI 20170601 Created initial version.
+** 002 TJD 20220331 Removed deprecated reference to Inputdialog.showFilterDialog()
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -453,19 +454,24 @@
    @UiHandler("filterAction")
    void onFilterAction(ClickEvent event)
    {
+      InputDialog.Field newFilter;
       InputDialog inputDialog = this.inputDialogProvider.get();
-      inputDialog.showFilterDialog(
-                                    getUiHandlers().getCurrentFilter(),
-                                    modalFragment,
-                                    filter ->
-                                    {
-                                       previewContainer.clear();
-                                       previewContent.clearContent();
-                                       previewContent.setRowCount(0, true);
-                                       pager.setPageStart(0);
-                                       getUiHandlers().setDataSelectionFilter(filter);
-                                    });
-
+      String hlpText = "<h4>Define the filtering specification below. Press the&nbsp;" +
+               "'OK' button without any specification to remove any&nbsp;" +
+               "previous filter.</h4>";
+      inputDialog.build("Filter", hlpText , new InputDialog.Field[]
+      {
+         newFilter = new InputDialog.Field("Filter", getUiHandlers().getCurrentFilter(), true)
+      });
+      inputDialog.show(modalFragment, true, values ->
+      {
+         if (values != null)
+         {
+            String newFilterValue = (String) values.get(newFilter);
+            getUiHandlers().setDataSelectionFilter(newFilterValue);
+            logger.info("inputDialog -> " + newFilterValue);
+         }
+      });
    }
 
    /**

=== modified file 'src/com/goldencode/p2j/admin/client/widget/dialog/InputDialog.java'
--- old/src/com/goldencode/p2j/admin/client/widget/dialog/InputDialog.java	2020-01-22 10:48:31 +0000
+++ new/src/com/goldencode/p2j/admin/client/widget/dialog/InputDialog.java	2022-05-02 09:56:32 +0000
@@ -2,13 +2,14 @@
 ** Module   : InputDialog.java
 ** Abstract : Generic input data dialog.
 **
-** Copyright (c) 2017-2019, Golden Code Development Corporation.
+** Copyright (c) 2017-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- --------------------------------Description-----------------------------------
 ** 001 HC  20170612 Initial version.
 ** 002 EVL 20170926 Javadoc fix.
 ** 003 OM  20190111 Got rid of compile warning related to ambiguous method call.
-*/
+** 004 TJD 20220331 Removed deprecated Inputdialog.showFilterDialog()
+**/
 
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -1716,38 +1717,5 @@
       }
    }
 
-   /**
-    * Builds and shows a filter input dialog.
-    * TOOD: This method should not be here, InputDialog class should not handle any specific
-    *       application logic.
-    *
-    * @param   filter
-    *          The initial filter value.
-    * @param   parent
-    *          The modal dialog parent.
-    * @param   actionHandler
-    *          The callback called when the dialog is dismissed.
-    */
-   @Deprecated
-   public void showFilterDialog(String filter, HasWidgets parent, Consumer<String> actionHandler)
-   {
-      String hlpText = "<h4>Define the filtering specification below. Press the&nbsp;" +
-                       "'OK' button without any specification to remove any&nbsp;" +
-                       "previous filter.</h4>";
-      String label = "Filter";
-      
-      InputDialog.Field fFilter;
-      
-      build("Filter", hlpText, new InputDialog.Field[]
-      {
-         fFilter = new InputDialog.Field(label, filter, true)
-      });
-      show(parent, true, values ->
-      {
-         if (values != null)
-         {
-            actionHandler.accept((String) values.get(fFilter));
-         }
-      });
-   }
+
 }

=== modified file 'src/com/goldencode/p2j/main/WebClientsManager.java'
--- old/src/com/goldencode/p2j/main/WebClientsManager.java	2021-09-27 09:36:58 +0000
+++ new/src/com/goldencode/p2j/main/WebClientsManager.java	2022-05-02 09:56:32 +0000
@@ -2,7 +2,7 @@
 ** Module   : WebClientsManager.java
 ** Abstract : WebClientsManager implements business methods to allocate and release web clients.
 **
-** Copyright (c) 2017-2021, Golden Code Development Corporation.
+** Copyright (c) 2017-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ----------------Description----------------------
 ** 001 SBI 20170628 Created initial version.
@@ -14,7 +14,8 @@
 ** 005 IAS 20210412 Used daemon thread pool for the HTTP client.
 ** 006 SBI 20210926 Added allocateAgentPorts, updateOptionsForJavaDebuggerAndJMXAgents, isAgentRangeConfigured
 **                  to manage agent ports for new web client.
-*/
+** 007 TJD 20220331 Replaced deprecated new SslContextFactory() with SslContextFactory.Client()
+**/
 /*
 ** This program is free software: you can redistribute it and/or modify
 ** it under the terms of the GNU Affero General Public License as
@@ -239,7 +240,7 @@
       if (portsRestricted)
       {
          // setup ssl engine to test
-         SslContextFactory sslContextFactory = new SslContextFactory();
+         SslContextFactory sslContextFactory = new SslContextFactory.Client();
          SSLContext sslContext = SecurityManager.getInstance().getSecureSocketContext();
          sslContextFactory.setSslContext(sslContext);
          

=== modified file 'src/com/goldencode/p2j/oo/web/WebResponseWriter.java'
--- old/src/com/goldencode/p2j/oo/web/WebResponseWriter.java	2022-01-20 16:27:48 +0000
+++ new/src/com/goldencode/p2j/oo/web/WebResponseWriter.java	2022-05-02 09:56:32 +0000
@@ -15,6 +15,7 @@
 **                  Do not use TypeFactory.object for internal usages, use ObjectVar if the reference must 
 **                  be tracked.
 **                  All TypeFactory.object variable definitions must be done outside of the top-level block.
+**     TJD 20220331 Suppress warnings in writeStatusLine 
 */
 
 /*
@@ -500,6 +501,7 @@
       }));
    }
 
+   @SuppressWarnings("deprecation")
    @LegacySignature(type = Type.METHOD, name = "WriteStatusLine")
    @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
    protected void writeStatusLine()
@@ -516,7 +518,6 @@
             {
                httpResponse.setStatus(response.ref().getStatusCode().intValue(), 
                         response.ref().getStatusReason().toStringMessage());
-               
             }
          }
       }));

=== modified file 'src/com/goldencode/p2j/persist/DatabaseStatistics.java'
--- old/src/com/goldencode/p2j/persist/DatabaseStatistics.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/DatabaseStatistics.java	2022-05-02 09:56:32 +0000
@@ -2,7 +2,7 @@
 ** Module   : DatabaseStatistics.java
 ** Abstract : Collects query and second level cache database statistics
 **
-** Copyright (c) 2015-2019, Golden Code Development Corporation.
+** Copyright (c) 2015-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ---------------------------------Description---------------------------------
 ** 001 ECF 20150726 Created initial version.
@@ -11,6 +11,8 @@
 ** 004 ECF 20171127 Prepended "./" to database URL.
 ** 005 SBI 20180518 Renamed file-system/pkgroot into legacy-system/pkgroot.
 ** 006 OM  20191113 Dropped Hibernate support. Deprecated this class.
+**     TJD 20220331 Removed deprecation from class,
+**                  as Hibernate is no longer in use it needs to be reimplemented
 */
 
 /*
@@ -130,7 +132,6 @@
  * <p>
  * TODO: document <code>perfdb</code> schema.
  *
- * @deprecated Hibernate no longer in use; needs reimplementation or removal.
  */
 public final class DatabaseStatistics
 {

=== modified file 'src/com/goldencode/p2j/persist/dialect/P2JPostgreSQLDialect.java'
--- old/src/com/goldencode/p2j/persist/dialect/P2JPostgreSQLDialect.java	2022-01-31 12:15:04 +0000
+++ new/src/com/goldencode/p2j/persist/dialect/P2JPostgreSQLDialect.java	2022-05-02 09:56:32 +0000
@@ -111,7 +111,8 @@
 **     IAS 20210803          Generate 'words' UDFs which can switch between using Java and SQL
 **                           low-level UDFs 
 **     IAS 20211223          Special processing of errors raised by UDFs. 
-**     IAS 20220112          Resolve dialect by JDBC database type. 
+**     IAS 20220112          Resolve dialect by JDBC database type.
+**     TJD 20220331          Removed reference to IOUtils.toInputStream
 */
 
 /*
@@ -170,6 +171,7 @@
 package com.goldencode.p2j.persist.dialect;
 
 import java.io.*;
+import java.nio.charset.Charset;
 import java.sql.*;
 import java.sql.Date;
 import java.text.*;
@@ -2126,7 +2128,7 @@
       public InputStream getAsciiStream() 
       throws SQLException
       {
-         return IOUtils.toInputStream(data);
+         return new ByteArrayInputStream(data.getBytes(Charset.defaultCharset()));
       }
 
       /**

=== modified file 'src/com/goldencode/p2j/persist/id/IdentityPool.java'
--- old/src/com/goldencode/p2j/persist/id/IdentityPool.java	2022-04-06 17:39:09 +0000
+++ new/src/com/goldencode/p2j/persist/id/IdentityPool.java	2022-05-02 09:56:32 +0000
@@ -31,6 +31,7 @@
 ** 129 ECF 20200906          New ORM implementation.
 **     CA  20220210          Removed Commitable.rollbackPending and its notifications, as there is no actual 
 **                           implementation of this method.
+**     TJD 20220331          Removed unused/deprecated KeyScanner
 */
 
 /*
@@ -444,10 +445,7 @@
       
       if (scanMethod != ScanMethod.NONE)
       {
-         Thread scanningThread = new Thread(new KeyScanner());
-         scanningThread.setName("Identity pool scanning thread");
-         scanningThread.setDaemon(true);
-         scanningThread.start();
+         LOG.log(Level.WARNING, "The only supported ScanMethod is NONE");
       }
    }
    
@@ -572,320 +570,6 @@
       }
    }
    
-   /**
-    * This helper class implements functionality of Identity pool scanning thread.
-    */
-   private class KeyScanner
-   implements Runnable
-   {
-      /** Key retriever which is used to scan for available keys. */
-      private KeyRetriever keyRetriever;
-      
-      /**
-       * Performs periodical scanning for available keys.
-       */
-      public void run()
-      {
-         // Create and initialize key retriever.
-         switch (scanMethod)
-         {
-            case JDBC:
-               keyRetriever = new JdbcKeyRetriever();
-               break;
-            case STORED_PROCEDURE:
-               keyRetriever = new StoredProcKeyRetriever();
-               break;
-            case NONE:
-               return;
-         }
-         
-         keyRetriever.initialize(database);
-         
-         Session session = null;
-         
-         // Main loop.
-         while (true)
-         {
-            try
-            {
-               if (stopped)
-               {
-                  if (session != null)
-                  {
-                     session.close();
-                  }
-                  
-                  return;
-               }
-               
-               if (session == null)
-               {
-                  session = new Session(database);
-               }
-               
-               // Determine lower bound for scanning.
-               long minKey = Math.max(maxKey - scanRange + 1, 1);
-               long oldMaxKey = maxKey;
-               
-               // Move down the upper bound for scanning. Do it now because we
-               // don't want to scan a range twice if any error has occurred.
-               maxKey = minKey - 1;
-               
-               long startTime, endTime;
-               List<Range> newKeys;
-               try
-               {
-                  synchronized (currentlyScannedRange)
-                  {
-                     currentlyScannedRange.setBounds(minKey, oldMaxKey);
-                  }
-                  
-                  // Retrieve available keys.
-                  startTime = System.currentTimeMillis();
-                  newKeys = keyRetriever.retrieveFreeKeys(minKey, oldMaxKey, session);
-                  
-                  endTime = System.currentTimeMillis();
-               }
-               finally
-               {
-                  synchronized (currentlyScannedRange)
-                  {
-                     currentlyScannedRange.makeEmpty();
-                  }
-               }
-               
-               int newKeysCount = 0;
-               if (newKeys != null)
-               {
-                  for (Range range : newKeys)
-                  {
-                     newKeysCount += range.getRangeSize();
-                  }
-               }
-               
-               if (LOG.isLoggable(Level.FINE))
-               {
-                  LOG.log(Level.FINE,
-                          "Range [" + minKey + ", " + oldMaxKey + "] was " +
-                          "scanned in " + (endTime - startTime) + " ms. " +
-                          newKeysCount + " free keys were found.");
-                  
-                  if (newKeys != null)
-                  {
-                     for (Range range : newKeys)
-                     {
-                        LOG.log(Level.FINE, "Found range: " + range);
-                     }
-                  }
-               }
-               
-               // Add recently retrieved keys to the main pool.
-               long newPoolSize;
-               synchronized (keysPool)
-               {
-                  if (newKeys != null)
-                  {
-                     // Get reclaimed keys that should be moved from reclaimed
-                     // keys pool to the main keys pool.
-                     SortedSet<Long> reclaimedKeysToMove =
-                        reclaimedKeysPool.subSet(minKey, oldMaxKey + 1);
-                     
-                     for (Range range : newKeys)
-                     {
-                        // Check whether some numbers in this range are
-                        // already present in the reclaimed keys.
-                        Iterator<Long> iter = reclaimedKeysToMove.iterator();
-                        while (iter.hasNext())
-                        {
-                           Long key = iter.next();
-                           if (range.contains(key))
-                           {
-                              // Key is also deleted for reclaimedKeysPool
-                              // (because it backs reclaimedKeysToMove subset)
-                              iter.remove();
-                              poolSize--;
-                           }
-                        }
-                     }
-                     
-                     // Add remaining reclaimed keys to the ranges.
-                     for (Long key : reclaimedKeysToMove)
-                     {
-                        newKeys.add(new Range(key));
-                     }
-                     
-                     // Get all handed out keys.
-                     SortedSet<Long> allKeysInHands = handedOutKeys.subSet(minKey, oldMaxKey + 1);
-                     allKeysInHands.addAll(pendingHandedOutKeys);
-                     
-                     // Remove keys handed out from the new keys.
-                     for (Range range : newKeys)
-                     {
-                        SortedSet<Long> extractedNumbers
-                           = allKeysInHands.subSet(range.getLowerBound(),
-                                                   range.getUpperBound() + 1);
-                        
-                        if (extractedNumbers.isEmpty())
-                        {
-                           keysPool.add(range);
-                           poolSize += range.getRangeSize();
-                           
-                           if (LOG.isLoggable(Level.FINE))
-                           {
-                              LOG.log(Level.FINE, "Scanned range was added: " + range);
-                           }
-                        }
-                        else
-                        {
-                           List<Range> subranges = range.splitRange(extractedNumbers);
-                           
-                           for (Range subrange : subranges)
-                           {
-                              keysPool.add(subrange);
-                              poolSize += subrange.getRangeSize();
-                              
-                              if (LOG.isLoggable(Level.FINE))
-                              {
-                                 LOG.log(Level.FINE, "Scanned range was added: " + subrange);
-                              }
-                           }
-                        }
-                     }
-                     
-                     // delete keys from reclaimedKeysPool (they have already 
-                     // been moved to keysPool)
-                     poolSize -= reclaimedKeysToMove.size();
-                     reclaimedKeysToMove.clear();
-                  }
-                  
-                  pendingHandedOutKeys.clear();
-                  newPoolSize = poolSize;
-               }
-               
-               if (minKey == 1)
-               {
-                  if (LOG.isLoggable(Level.FINE))
-                  {
-                     LOG.log(Level.FINE, "The entire database has been scanned.");
-                  }
-                  
-                  session.close();
-                  session = null;
-                  
-                  return;
-               }
-               
-               // Determine whether we have to perform next scan and time
-               // delay before it.
-               boolean performNextScan = false;
-               int delay = 0;
-               if (newPoolSize < scanThreshold)
-               {
-                  // We have the number of keys below the scanThreshold.
-                  performNextScan = true;
-                  
-                  // Double scan interval.
-                  scanInterval = Math.min(scanInterval * 2, maximumScanInterval);
-                  delay = Math.max(scanInterval, scanDelay);
-               }
-               else if (newPoolSize < targetSize)
-               {
-                  // We have the number of keys below the targetSize.
-                  performNextScan = true;
-                  delay = scanDelay;
-               }
-               
-               if (!performNextScan)
-               {
-                  // Close the session since we do not know how soon the next
-                  // scan will be performed.
-                  session.close();
-                  session = null;
-                  
-                  if (LOG.isLoggable(Level.FINE))
-                  {
-                     LOG.log(Level.FINE, "Waiting for pool to shrink to scanThreshold.");
-                  }
-                  
-                  try
-                  {
-                     synchronized (waitLock)
-                     {
-                        if (stopped)
-                        {
-                           return;
-                        }
-                        
-                        waitLock.wait();
-                     }
-                  }
-                  catch (InterruptedException e)
-                  {
-                     // Ignore.
-                  }
-               }
-               else
-               {
-                  if (LOG.isLoggable(Level.FINE))
-                  {
-                     LOG.log(Level.FINE, "Next scan will be forced in " + delay + " seconds.");
-                  }
-                  
-                  if (delay > sessionHoldTime)
-                  {
-                     // Close the session if the next scan will not be performed soon enough.
-                     session.close();
-                     session = null;
-                  }
-                  
-                  if (delay > 0)
-                  {
-                     try
-                     {
-                        // Pause.
-                        Thread.sleep(delay * 1000);
-                     }
-                     catch (InterruptedException e)
-                     {
-                        // Ignore.
-                     }
-                  }
-               }
-            }
-            catch (PersistenceException exc)
-            {
-               if (session != null)
-               {
-                  try
-                  {
-                     session.close();
-                  }
-                  catch (PersistenceException exc2)
-                  {
-                     // ignore
-                  }
-               }
-               LOG.log(Level.SEVERE,
-                       "Identity pool has been stopped because of an exception:", exc);
-               return;
-            }
-            catch (OutOfMemoryError oome)
-            {
-               try
-               {
-                  LOG.log(Level.SEVERE, "OOME into id pool scanning thread", oome);
-                  
-                  // Some delay to let OOME disappear.
-                  Thread.sleep(5000);
-               }
-               catch (OutOfMemoryError | InterruptedException e)
-               {
-                  // Ignore.
-               }
-            }
-         }
-      }
-   }
    
    /**
     * Context-local container which manages the keys which were returned by
@@ -971,12 +655,7 @@
     */
    private enum ScanMethod
    {
-      /** Retrieve keys using SQL queries */
-      JDBC,
-      
-      /** Retrieve keys by calling a stored procedure */
-      STORED_PROCEDURE,
-      
+   
       /** Do not retrieve keys */
       NONE
    }

=== removed file 'src/com/goldencode/p2j/persist/id/JdbcKeyRetriever.java'
--- old/src/com/goldencode/p2j/persist/id/JdbcKeyRetriever.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/id/JdbcKeyRetriever.java	1970-01-01 00:00:00 +0000
@@ -1,295 +0,0 @@
-/*
-** Module   : JdbcKeyRetriever.java
-** Abstract : KeyRetriever implementation which retrieves keys using SQL
-**            queries.
-**
-** Copyright (c) 2005-2020, Golden Code Development Corporation.
-**
-** -#- -I- --Date-- --JPRM-- ----------------------------Description----------------------------
-** 001 SVL 20080827  @39779  Created initial version. Retrieves free keys using two subsequent 
-**                           queries.
-** 002 SVL 20091126  @44444  Use external function for retrieving the list of database tables.
-** 003 SVL 20120331          Upgraded to Hibernate 4.
-** 004 OM  20140603          Use multiple queries in order to workaround the SQL Server limitation
-**                           of maximum 2100 parameters per query.
-** 005 OM  20151130          Adjusted the theoretical number of parameters per query to practical
-**                           value.
-** 006 ECF 20200906          Deprecated this class.
-**                           TODO: eliminate dependencies and remove the class.
-*/
-/*
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU Affero General Public License as
-** published by the Free Software Foundation, either version 3 of the
-** License, or (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-** GNU Affero General Public License for more details.
-**
-** You may find a copy of the GNU Affero GPL version 3 at the following
-** location: https://www.gnu.org/licenses/agpl-3.0.en.html
-** 
-** Additional terms under GNU Affero GPL version 3 section 7:
-** 
-**   Under Section 7 of the GNU Affero GPL version 3, the following additional
-**   terms apply to the works covered under the License.  These additional terms
-**   are non-permissive additional terms allowed under Section 7 of the GNU
-**   Affero GPL version 3 and may not be removed by you.
-** 
-**   0. Attribution Requirement.
-** 
-**     You must preserve all legal notices or author attributions in the covered
-**     work or Appropriate Legal Notices displayed by works containing the covered
-**     work.  You may not remove from the covered work any author or developer
-**     credit already included within the covered work.
-** 
-**   1. No License To Use Trademarks.
-** 
-**     This license does not grant any license or rights to use the trademarks
-**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
-**     of Golden Code Development Corporation. You are not authorized to use the
-**     name Golden Code, FWD, or the names of any author or contributor, for
-**     publicity purposes without written authorization.
-** 
-**   2. No Misrepresentation of Affiliation.
-** 
-**     You may not represent yourself as Golden Code Development Corporation or FWD.
-** 
-**     You may not represent yourself for publicity purposes as associated with
-**     Golden Code Development Corporation, FWD, or any author or contributor to
-**     the covered work, without written authorization.
-** 
-**   3. No Misrepresentation of Source or Origin.
-** 
-**     You may not represent the covered work as solely your work.  All modified
-**     versions of the covered work must be marked in a reasonable way to make it
-**     clear that the modified work is not originating from Golden Code Development
-**     Corporation or FWD.  All modified versions must contain the notices of
-**     attribution required in this license.
-*/
-
-package com.goldencode.p2j.persist.id;
-
-import com.goldencode.p2j.persist.*;
-import java.util.*;
-import com.goldencode.p2j.persist.dialect.*;
-import com.goldencode.p2j.persist.orm.*;
-//import com.goldencode.p2j.persist.type.*;
-
-/**
- * Provides a service for retrieving available primary keys from database using SQL queries.
- * 
- * @deprecated Remove this class ASAP; this whole concept has turned out to be unsafe.
- */
-public class JdbcKeyRetriever
-implements KeyRetriever
-{
-   /** Query which returns the number of busy keys in the given range. */
-   private String[] predictionQueries;
-   
-   /** Query which retrieves all busy keys in the given range. */
-   private String[] retrievalQueries;
-   
-   /** The number of tables queried at once (in a single SQL statement). */
-   private int bucketSize; 
-   
-   /**
-    * Initialize key retriever for the given database.
-    * Because the number of tables from a database may be too big (at least SQL Server has a
-    * limitation of 2100 parameters in a query) the keys for the tables are retrieved in buckets.
-    *
-    * @param   database
-    *          Database for which will be scanned for available keys.
-    */
-   @Override
-   public void initialize(Database database)
-   {
-      /*
-      // Get all table names.
-      List<String> tableNames = DatabaseManager.getDatabaseTables(database);
-      final int tableCount = tableNames.size();
-      
-      // Obtain the is the maximum number of tables that are scanned at in a single SQL query.
-      Dialect dialect = DatabaseManager.getDialect(database);
-      // There are 2 parameter for each table
-      final int bucketSize = dialect.getMaxParameterCount() / 3; 
-      
-      // compute the necessary number of buckets to hold all tables
-      int bucketCount;
-      if (bucketSize <= 0)
-      {
-         // disable bucket-ing, all at once
-         bucketCount = 1;
-         this.bucketSize = tableCount;
-      }
-      else
-      {
-         if ((tableCount % bucketSize) == 0)
-         {
-            // no remainder / leftovers 
-            bucketCount = tableCount / bucketSize;
-         }
-         else
-         {
-            // the remainder of tables go to extra bucket
-            bucketCount = tableCount / bucketSize + 1;
-         }
-         this.bucketSize = bucketSize;
-      }
-      // debug only:
-      // System.out.println("JdbcKeyRetriever is using bucketSize=" + this.bucketSize + 
-      //   ", the queries (" + tableCount + ") will be split in " + bucketCount + " queries");
-      
-      predictionQueries = new String[bucketCount];
-      retrievalQueries = new String[bucketCount];
-      
-      // Compose prediction queries which look like
-      // 'select(
-      //  (select count(id) from table1 where id >= :minId and id <= :maxId) +
-      //  (select count(id) from table2 where id >= :minId and id <= :maxId) +
-      //  ...) as cnt'
-      // in the final step the subqueries intermediary result will be summed to a grand total
-      int bucket = 0;
-      StringBuilder buf = new StringBuilder("select (");
-      for (int i = 0; i < tableCount; i++)
-      {
-         assert buf != null;
-         buf.append("(select count(id) from ");
-         buf.append(tableNames.get(i));
-         buf.append(" where id >= :minId and id <= :maxId)");
-         
-         if (isLastInBucket(i, tableCount))
-         {
-            // bucket full, next bucket
-            buf.append(") as cnt");
-            predictionQueries[bucket] = buf.toString();
-            ++bucket;
-            
-            // prepare for next bucket
-            buf = (bucket != bucketCount) ? new StringBuilder("select (") : null;
-         }
-         else
-         {
-            // there are more items in this bucket
-            buf.append(" + ");
-         }
-      }
-      
-      // Compose id retrieval query which looks like
-      // 'select id from table1 where id >= :minId and id <= :maxId UNION
-      //  select id from table2 where id >= :minId and id <= :maxId UNION
-      //  ....  ORDER BY id asc'
-      bucket = 0;
-      buf = new StringBuilder();
-      for (int i = 0; i < tableCount; i++)
-      {
-         assert buf != null;
-         buf.append("select id from ");
-         buf.append(tableNames.get(i));
-         buf.append(" where id >= :minId and id <= :maxId");
-         
-         if (isLastInBucket(i, tableCount))
-         {
-            buf.append(" ORDER BY id asc");
-            retrievalQueries[bucket] = buf.toString();
-            ++bucket;
-            buf = (bucket != bucketCount) ? new StringBuilder() : null;
-         }
-         else
-         {
-           // combine with other items from the current bucket
-            buf.append(" UNION ");
-         }
-      }
-      */
-   }
-   
-   /**
-    * Get available keys.
-    * Each bucket is queried independently and the  the results are put back together.
-    *
-    * @param   minKey
-    *          Lower bound of a range of identifiers on which search will be made.
-    * @param   maxKey
-    *          Upper bound of a range of identifiers on which search will be made.
-    * @param   session
-    *          Hibernate session which will be used to perform queries.
-    *          
-    * @return  a list of ranges of available keys
-    */
-   @Override
-   public List<Range> retrieveFreeKeys(Long minKey, Long maxKey, Session session)
-   {
-      /*
-      long rangeSize = maxKey - minKey + 1;
-      
-      long count = 0;
-      for (String pQuery : predictionQueries)
-      {
-         // Execute prediction queries.
-         SQLQuery query = session.createSQLQuery(pQuery);
-         query.addScalar("cnt", StandardBasicTypes.LONG);
-         query.setLong("minId", minKey);
-         query.setLong("maxId", maxKey);
-         
-         // sum up the bucket subtotals
-         count += (Long) query.uniqueResult();
-      }
-      
-      if (count == 0L)
-      {
-         // All ids in the given range are free.
-         List<Range> res = new ArrayList<>();
-         res.add(new Range(minKey, maxKey));
-         return res;
-      }
-      else if (count == rangeSize)
-      {
-         // No ids available.
-         return null;
-      }
-      
-      SortedSet<Long> busyKeys = new TreeSet<>();
-      for (String rQuery : retrievalQueries)
-      {
-         // Execute the query which will return all busy ids in the given range.
-         SQLQuery query = session.createSQLQuery(rQuery);
-         query.addScalar("id", StandardBasicTypes.LONG);
-         query.setLong("minId", minKey);
-         query.setLong("maxId", maxKey);
-         
-         busyKeys.addAll((List<Long>) query.list());
-      }
-      
-      return new Range(minKey, maxKey).splitRange(busyKeys);
-      */
-      
-      return null;
-   }
-   
-   /**
-    * Checks if <code>i</code> is the last item in the bucket. Useful for combining items in a
-    * bucket; the last item is usually handled differently.
-    * 
-    * @param   i
-    *          The current item, related to global item array.
-    * @param   size
-    *          The global item array size.
-    *          
-    * @return  <code>true</code> if i is the last item in his bucket
-    */
-   private boolean isLastInBucket(int i, int size)
-   {
-      if (i == size - 1) 
-      {
-         // since this is the last item globally, it is also the last item in the last bucket
-         return true;
-      }
-      
-      // compute the position in the bucket
-      int bucketPosition = i % this.bucketSize;
-      return bucketPosition == this.bucketSize - 1;
-   }
-}

=== removed file 'src/com/goldencode/p2j/persist/id/KeyRetriever.java'
--- old/src/com/goldencode/p2j/persist/id/KeyRetriever.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/id/KeyRetriever.java	1970-01-01 00:00:00 +0000
@@ -1,102 +0,0 @@
-/*
-** Module   : KeyRetriever.java
-** Abstract : Interface for objects which retrieve available primary keys
-**            from database.
-**
-** Copyright (c) 2005-2017, Golden Code Development Corporation.
-**
-** -#- -I- --Date-- --JPRM-- ---------------------------------Description----------------------------------
-** 001 SVL 20080827   @39780 Created initial version. Defines interface
-**                           to be used by objects which retrieve
-**                           available primary keys from database.
-** 002 ECF 20200906          New ORM implementation.
-*/
-/*
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU Affero General Public License as
-** published by the Free Software Foundation, either version 3 of the
-** License, or (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-** GNU Affero General Public License for more details.
-**
-** You may find a copy of the GNU Affero GPL version 3 at the following
-** location: https://www.gnu.org/licenses/agpl-3.0.en.html
-** 
-** Additional terms under GNU Affero GPL version 3 section 7:
-** 
-**   Under Section 7 of the GNU Affero GPL version 3, the following additional
-**   terms apply to the works covered under the License.  These additional terms
-**   are non-permissive additional terms allowed under Section 7 of the GNU
-**   Affero GPL version 3 and may not be removed by you.
-** 
-**   0. Attribution Requirement.
-** 
-**     You must preserve all legal notices or author attributions in the covered
-**     work or Appropriate Legal Notices displayed by works containing the covered
-**     work.  You may not remove from the covered work any author or developer
-**     credit already included within the covered work.
-** 
-**   1. No License To Use Trademarks.
-** 
-**     This license does not grant any license or rights to use the trademarks
-**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
-**     of Golden Code Development Corporation. You are not authorized to use the
-**     name Golden Code, FWD, or the names of any author or contributor, for
-**     publicity purposes without written authorization.
-** 
-**   2. No Misrepresentation of Affiliation.
-** 
-**     You may not represent yourself as Golden Code Development Corporation or FWD.
-** 
-**     You may not represent yourself for publicity purposes as associated with
-**     Golden Code Development Corporation, FWD, or any author or contributor to
-**     the covered work, without written authorization.
-** 
-**   3. No Misrepresentation of Source or Origin.
-** 
-**     You may not represent the covered work as solely your work.  All modified
-**     versions of the covered work must be marked in a reasonable way to make it
-**     clear that the modified work is not originating from Golden Code Development
-**     Corporation or FWD.  All modified versions must contain the notices of
-**     attribution required in this license.
-*/
-
-package com.goldencode.p2j.persist.id;
-
-import com.goldencode.p2j.persist.*;
-import com.goldencode.p2j.persist.orm.*;
-import java.util.*;
-
-/**
- * Interface which must be implemented by classes which provide service for
- * retrieving available primary keys from database.
- */
-public interface KeyRetriever
-{
-   /**
-    * Initialize key retriever for the given database.
-    *
-    * @param database
-    *        Database for which will be scanned for available keys.
-    */
-   public void initialize(Database database);
-   
-   /**
-    * Get available keys.
-    *
-    * @param  minKey
-    *         Lower bound of a range of identifiers on which search will be
-    *         made.
-    * @param  maxKey
-    *         Upper bound of a range of identifiers on which search will be
-    *         made.
-    * @param  session
-    *         Hibernate session which will be used to perform queries.
-    * 
-    * @return A list of ranges of available keys
-    */
-   public List<Range> retrieveFreeKeys(Long minKey, Long maxKey, Session session);
-}
\ No newline at end of file

=== removed file 'src/com/goldencode/p2j/persist/id/StoredProcKeyRetriever.java'
--- old/src/com/goldencode/p2j/persist/id/StoredProcKeyRetriever.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/id/StoredProcKeyRetriever.java	1970-01-01 00:00:00 +0000
@@ -1,147 +0,0 @@
-/*
-** Module   : StoredProcKeyRetriever.java
-** Abstract : KeyRetriever implementation which retrieves keys using stored
-**            procedure.
-**
-** Copyright (c) 2005-2020, Golden Code Development Corporation.
-**
-** -#- -I- --Date-- --JPRM-- ---------------------------------Description----------------------------------
-** 001 SVL 20080827   @39782 Created initial version. Retrieves free keys
-**                           using a stored procedure.
-** 002 SVL 20120331          Upgraded to Hibernate 4.
-** 003 ECF 20200906          Deprecated this class.
-**                           TODO: eliminate any dependencies and remove this class.
-*/
-
-/*
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU Affero General Public License as
-** published by the Free Software Foundation, either version 3 of the
-** License, or (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-** GNU Affero General Public License for more details.
-**
-** You may find a copy of the GNU Affero GPL version 3 at the following
-** location: https://www.gnu.org/licenses/agpl-3.0.en.html
-** 
-** Additional terms under GNU Affero GPL version 3 section 7:
-** 
-**   Under Section 7 of the GNU Affero GPL version 3, the following additional
-**   terms apply to the works covered under the License.  These additional terms
-**   are non-permissive additional terms allowed under Section 7 of the GNU
-**   Affero GPL version 3 and may not be removed by you.
-** 
-**   0. Attribution Requirement.
-** 
-**     You must preserve all legal notices or author attributions in the covered
-**     work or Appropriate Legal Notices displayed by works containing the covered
-**     work.  You may not remove from the covered work any author or developer
-**     credit already included within the covered work.
-** 
-**   1. No License To Use Trademarks.
-** 
-**     This license does not grant any license or rights to use the trademarks
-**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
-**     of Golden Code Development Corporation. You are not authorized to use the
-**     name Golden Code, FWD, or the names of any author or contributor, for
-**     publicity purposes without written authorization.
-** 
-**   2. No Misrepresentation of Affiliation.
-** 
-**     You may not represent yourself as Golden Code Development Corporation or FWD.
-** 
-**     You may not represent yourself for publicity purposes as associated with
-**     Golden Code Development Corporation, FWD, or any author or contributor to
-**     the covered work, without written authorization.
-** 
-**   3. No Misrepresentation of Source or Origin.
-** 
-**     You may not represent the covered work as solely your work.  All modified
-**     versions of the covered work must be marked in a reasonable way to make it
-**     clear that the modified work is not originating from Golden Code Development
-**     Corporation or FWD.  All modified versions must contain the notices of
-**     attribution required in this license.
-*/
-
-package com.goldencode.p2j.persist.id;
-
-import com.goldencode.p2j.persist.*;
-import com.goldencode.p2j.persist.orm.*;
-import java.util.*;
-
-/**
- * Provides a service for retrieving available primary keys from database
- * by calling stored procedure.
- *
- * @deprecated
- */
-public class StoredProcKeyRetriever
-implements KeyRetriever
-{
-   /** Query which is used for stored procedure call. */
-   private String retrieveQuery;
-   
-   /**
-    * Name of the stored procedure used for id retrieval.
-    * Procedure should be declared as 'FUNCTION procedure_name(min_id bigint, 
-    * max_id bigint) RETURNS SETOF range_type'
-    */
-   private static String STORED_PROCEDURE_NAME = "get_free_ids";
-   
-   /**
-    * Initialize key retriever for the given database.
-    *
-    * @param database
-    *        Database for which will be scanned for available keys.
-    */
-   public void initialize(Database database)
-   {
-      StringBuilder buf = new StringBuilder();
-      buf.append("select lower_bound, upper_bound from ");
-      buf.append(STORED_PROCEDURE_NAME);
-      buf.append("(:minId, :maxId)");
-      
-      retrieveQuery = buf.toString();
-   }
-   
-   /**
-    * Get available keys.
-    *
-    * @param  minKey
-    *         Lower bound of a range of identifiers on which search will be
-    *         made.
-    * @param  maxKey
-    *         Upper bound of a range of identifiers on which search will be
-    *         made.
-    * @param  session
-    *         Hibernate session which will be used to perform queries.
-    * @return A list of ranges of available keys
-    */
-   public List<Range> retrieveFreeKeys(Long minKey, Long maxKey, Session session)
-   {
-      // TODO: remove this and related classes; this concept has been shown to be unsafe
-      /*
-      // Execute the query which will return all ranges of free ids in the
-      // given global range. 
-      SQLQuery query = session.createSQLQuery(retrieveQuery);
-      query.addScalar("lower_bound", StandardBasicTypes.LONG);
-      query.addScalar("upper_bound", StandardBasicTypes.LONG);
-      query.setLong("minId", minKey);
-      query.setLong("maxId", maxKey);
-      
-      List<Range> res = new ArrayList<Range>();
-      List<Object[]> bounds = (List<Object[]>) query.list();
-      for (Object[] bound : bounds)
-      {
-         res.add(new Range((Long)bound[0], (Long)bound[1]));
-      }
-      
-      return res;
-      */
-      
-      return null;
-   }
-}
\ No newline at end of file

=== modified file 'src/com/goldencode/p2j/persist/orm/QueryStatistics.java'
--- old/src/com/goldencode/p2j/persist/orm/QueryStatistics.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/orm/QueryStatistics.java	2022-05-02 09:56:32 +0000
@@ -1,10 +1,68 @@
 package com.goldencode.p2j.persist.orm;
+/*
+ * 
+** Module   : DatabaseStatistics.java
+** Abstract : Stubbed, temporary class for transition to new ORM implementation.
+**
+** Copyright (c) 2015-2022, Golden Code Development Corporation.
+**
+** -#- -I- --Date-- ---------------------------------Description---------------------------------
+**     TJD 20220331 Removed deprecation from class,
+**                  as Hibernate is no longer in use it needs to be reimplemented
+*/
 
-/**
- * Stubbed, temporary class for transition to new ORM implementation.
- * 
- * @deprecated Only used by deprecated, Hibernate-based, database statistics collector.
- */
+/*
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU Affero General Public License as
+** published by the Free Software Foundation, either version 3 of the
+** License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU Affero General Public License for more details.
+**
+** You may find a copy of the GNU Affero GPL version 3 at the following
+** location: https://www.gnu.org/licenses/agpl-3.0.en.html
+** 
+** Additional terms under GNU Affero GPL version 3 section 7:
+** 
+**   Under Section 7 of the GNU Affero GPL version 3, the following additional
+**   terms apply to the works covered under the License.  These additional terms
+**   are non-permissive additional terms allowed under Section 7 of the GNU
+**   Affero GPL version 3 and may not be removed by you.
+** 
+**   0. Attribution Requirement.
+** 
+**     You must preserve all legal notices or author attributions in the covered
+**     work or Appropriate Legal Notices displayed by works containing the covered
+**     work.  You may not remove from the covered work any author or developer
+**     credit already included within the covered work.
+** 
+**   1. No License To Use Trademarks.
+** 
+**     This license does not grant any license or rights to use the trademarks
+**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
+**     of Golden Code Development Corporation. You are not authorized to use the
+**     name Golden Code, FWD, or the names of any author or contributor, for
+**     publicity purposes without written authorization.
+** 
+**   2. No Misrepresentation of Affiliation.
+** 
+**     You may not represent yourself as Golden Code Development Corporation or FWD.
+** 
+**     You may not represent yourself for publicity purposes as associated with
+**     Golden Code Development Corporation, FWD, or any author or contributor to
+**     the covered work, without written authorization.
+** 
+**   3. No Misrepresentation of Source or Origin.
+** 
+**     You may not represent the covered work as solely your work.  All modified
+**     versions of the covered work must be marked in a reasonable way to make it
+**     clear that the modified work is not originating from Golden Code Development
+**     Corporation or FWD.  All modified versions must contain the notices of
+**     attribution required in this license.
+*/
 public class QueryStatistics
 {
    public long getExecutionMaxTime()

=== modified file 'src/com/goldencode/p2j/persist/orm/SecondLevelCacheStatistics.java'
--- old/src/com/goldencode/p2j/persist/orm/SecondLevelCacheStatistics.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/orm/SecondLevelCacheStatistics.java	2022-05-02 09:56:32 +0000
@@ -1,10 +1,69 @@
 package com.goldencode.p2j.persist.orm;
-
-/**
- * Stubbed, temporary class for transition to new ORM implementation.
+/*
  * 
- * @deprecated Only used by deprecated, Hibernate-based, database statistics collector.
- */
+** Module   : SecondLevelCacheStatistics.java
+** Abstract : Stubbed, temporary class for transition to new ORM implementation.
+**
+** Copyright (c) 2015-2022, Golden Code Development Corporation.
+**
+** -#- -I- --Date-- ---------------------------------Description---------------------------------
+**     TJD 20220331 Removed deprecation from class,
+**                  as Hibernate is no longer in use it needs to be reimplemented
+*/
+
+/*
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU Affero General Public License as
+** published by the Free Software Foundation, either version 3 of the
+** License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU Affero General Public License for more details.
+**
+** You may find a copy of the GNU Affero GPL version 3 at the following
+** location: https://www.gnu.org/licenses/agpl-3.0.en.html
+** 
+** Additional terms under GNU Affero GPL version 3 section 7:
+** 
+**   Under Section 7 of the GNU Affero GPL version 3, the following additional
+**   terms apply to the works covered under the License.  These additional terms
+**   are non-permissive additional terms allowed under Section 7 of the GNU
+**   Affero GPL version 3 and may not be removed by you.
+** 
+**   0. Attribution Requirement.
+** 
+**     You must preserve all legal notices or author attributions in the covered
+**     work or Appropriate Legal Notices displayed by works containing the covered
+**     work.  You may not remove from the covered work any author or developer
+**     credit already included within the covered work.
+** 
+**   1. No License To Use Trademarks.
+** 
+**     This license does not grant any license or rights to use the trademarks
+**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
+**     of Golden Code Development Corporation. You are not authorized to use the
+**     name Golden Code, FWD, or the names of any author or contributor, for
+**     publicity purposes without written authorization.
+** 
+**   2. No Misrepresentation of Affiliation.
+** 
+**     You may not represent yourself as Golden Code Development Corporation or FWD.
+** 
+**     You may not represent yourself for publicity purposes as associated with
+**     Golden Code Development Corporation, FWD, or any author or contributor to
+**     the covered work, without written authorization.
+** 
+**   3. No Misrepresentation of Source or Origin.
+** 
+**     You may not represent the covered work as solely your work.  All modified
+**     versions of the covered work must be marked in a reasonable way to make it
+**     clear that the modified work is not originating from Golden Code Development
+**     Corporation or FWD.  All modified versions must contain the notices of
+**     attribution required in this license.
+*/
+
 public class SecondLevelCacheStatistics
 {
    public long getElementCountInMemory()

=== modified file 'src/com/goldencode/p2j/persist/orm/Statistics.java'
--- old/src/com/goldencode/p2j/persist/orm/Statistics.java	2020-09-06 23:15:41 +0000
+++ new/src/com/goldencode/p2j/persist/orm/Statistics.java	2022-05-02 09:56:32 +0000
@@ -1,10 +1,69 @@
 package com.goldencode.p2j.persist.orm;
 
-/**
- * Stubbed, temporary class for transition to new ORM implementation.
+/*
  * 
- * @deprecated Only used by deprecated, Hibernate-based, database statistics collector.
- */
+** Module   : Statistics.java
+** Abstract : Stubbed, temporary class for transition to new ORM implementation.
+**
+** Copyright (c) 2015-2022, Golden Code Development Corporation.
+**
+** -#- -I- --Date-- ---------------------------------Description---------------------------------
+**     TJD 20220331 Removed deprecation from class,
+**                  as Hibernate is no longer in use it needs to be reimplemented
+*/
+
+/*
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU Affero General Public License as
+** published by the Free Software Foundation, either version 3 of the
+** License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU Affero General Public License for more details.
+**
+** You may find a copy of the GNU Affero GPL version 3 at the following
+** location: https://www.gnu.org/licenses/agpl-3.0.en.html
+** 
+** Additional terms under GNU Affero GPL version 3 section 7:
+** 
+**   Under Section 7 of the GNU Affero GPL version 3, the following additional
+**   terms apply to the works covered under the License.  These additional terms
+**   are non-permissive additional terms allowed under Section 7 of the GNU
+**   Affero GPL version 3 and may not be removed by you.
+** 
+**   0. Attribution Requirement.
+** 
+**     You must preserve all legal notices or author attributions in the covered
+**     work or Appropriate Legal Notices displayed by works containing the covered
+**     work.  You may not remove from the covered work any author or developer
+**     credit already included within the covered work.
+** 
+**   1. No License To Use Trademarks.
+** 
+**     This license does not grant any license or rights to use the trademarks
+**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
+**     of Golden Code Development Corporation. You are not authorized to use the
+**     name Golden Code, FWD, or the names of any author or contributor, for
+**     publicity purposes without written authorization.
+** 
+**   2. No Misrepresentation of Affiliation.
+** 
+**     You may not represent yourself as Golden Code Development Corporation or FWD.
+** 
+**     You may not represent yourself for publicity purposes as associated with
+**     Golden Code Development Corporation, FWD, or any author or contributor to
+**     the covered work, without written authorization.
+** 
+**   3. No Misrepresentation of Source or Origin.
+** 
+**     You may not represent the covered work as solely your work.  All modified
+**     versions of the covered work must be marked in a reasonable way to make it
+**     clear that the modified work is not originating from Golden Code Development
+**     Corporation or FWD.  All modified versions must contain the notices of
+**     attribution required in this license.
+*/
 public class Statistics
 {
    public String[] getQueries()

=== modified file 'src/com/goldencode/p2j/persist/orm/UnclosablePreparedStatement.java'
--- old/src/com/goldencode/p2j/persist/orm/UnclosablePreparedStatement.java	2022-03-01 01:32:33 +0000
+++ new/src/com/goldencode/p2j/persist/orm/UnclosablePreparedStatement.java	2022-05-02 09:56:32 +0000
@@ -8,6 +8,7 @@
 ** 001 AIL 20201020 Created initial version.
 **     OM  20220228 Added toString() implementation to allow the statements to be correctly displayed with
 **                  SQLStatementLogger. Javadoc fixes.
+**     TJD 20220331 Removed deprecation from setUnicodeStream as it   is a proxy class
 */
 
 /*
@@ -308,6 +309,7 @@
       this.target.setTimestamp(parameterIndex, x); }
    public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { 
       this.target.setAsciiStream(parameterIndex, x, length); }
+   @SuppressWarnings("deprecation")
    public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
       this.target.setUnicodeStream(parameterIndex, x, length);}
    public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { 

=== modified file 'src/com/goldencode/p2j/security/AcmeClient.java'
--- old/src/com/goldencode/p2j/security/AcmeClient.java	2021-09-17 15:14:10 +0000
+++ new/src/com/goldencode/p2j/security/AcmeClient.java	2022-05-02 09:56:32 +0000
@@ -2,13 +2,14 @@
 ** Module   : AcmeClient.java
 ** Abstract : Implements ACME client to get certificates signed by well-known trusted authority.
 **
-** Copyright (c) 2017-2021, Golden Code Development Corporation.
+** Copyright (c) 2017-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ---------------------------------Description----------------------------------
 ** 001 SBI 20171030 First version.
 ** 002 SBI 20171110 Fixed a NPE in askCertificates.
 ** 003 SBI 20171116 Added CertificateSuite usage.
-**     VVT 20210917 Javadoc fixed. 
+**     VVT 20210917 Javadoc fixed.
+**     TJD 20220331 Disabled ACME client as tlsSniChallenge is no longer supported
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -167,9 +168,10 @@
     */
    public AcmeClient(String acmeServerUri, String host, int port)
    {
-      this.acmeServerUri = acmeServerUri;
-      this.host          = host;
-      this.port          = port;
+      throw new RuntimeException("AcmeClient is non-functional, cant be used");
+//      this.acmeServerUri = acmeServerUri;
+//      this.host          = host;
+//      this.port          = port;
    }
    
    /**
@@ -508,6 +510,7 @@
     * @throws   AcmeException
     *           iff the tls-sni-01 challenge validation is failed.
     */
+   @SuppressWarnings("deprecation")
    private void authorize(String domain)
    throws AcmeException
    {
@@ -528,7 +531,6 @@
       {
          return;
       }
-      
       if (!acceptTlsSniChallenge(((TlsSni01Challenge) challenge).getSubject(),
                                  ACCEPT_CHALLENGE_TIMEOUT))
       {
@@ -822,6 +824,10 @@
     */
    public static void main(String[] args)
    {
+      LOG.error("As tlsSniChallenge is not supported AcmeClient"
+               + " is non-functional at the moment, exiting");
+      System.exit(0);
+
       InputParameters inputParameters = new InputParameters();
       
       CmdLineParser parser = new CmdLineParser(inputParameters);

=== modified file 'src/com/goldencode/p2j/security/ManagedWebServer.java'
--- old/src/com/goldencode/p2j/security/ManagedWebServer.java	2017-11-12 11:45:47 +0000
+++ new/src/com/goldencode/p2j/security/ManagedWebServer.java	2022-05-02 09:56:32 +0000
@@ -2,11 +2,12 @@
 ** Module   : ManagedWebServer.java
 ** Abstract : Implements Managed Web Server to prove the ownership of the target domain.
 **
-** Copyright (c) 2017, Golden Code Development Corporation.
+** Copyright (c) 2017-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ---------------------------------Description----------------------------------
 ** 001 SBI 20171030 First version.
 ** 002 SBI 20171112 Added CertificateSuite usage.
+** 003 TJD 20220331 Replaced deprecated new SslContextFactory() with SslContextFactory.Server()
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -194,7 +195,7 @@
       server.addHandler(handler);
       server.startup(host, port);
       
-      SslContextFactory sslContextFactory = new SslContextFactory();
+      SslContextFactory sslContextFactory = new SslContextFactory.Server();
       
       sslContextFactory.setTrustStore(certStore);
       

=== modified file 'src/com/goldencode/p2j/ui/GenericWidget.java'
--- old/src/com/goldencode/p2j/ui/GenericWidget.java	2022-04-21 17:39:58 +0000
+++ new/src/com/goldencode/p2j/ui/GenericWidget.java	2022-05-02 11:36:55 +0000
@@ -337,6 +337,8 @@
 **     ME  20220216          Revert drop of 'wasRealized' configuration.
 **     RFB 20220311          Display warning when trying to query FORMAT attribute on a BROWSE. Ref. #5485.
 **     HC  20220421          Added setAttr method overload to allow skipping equality check.
+**     TJD 20220501          Removed Deprecated from pushWidgetAttr and flushWidgetAttrs 
+**                           to reduce unnecessary warnings Ref:6208#note-22 
 */
 
 /*
@@ -5705,7 +5707,8 @@
     * @param    value
     *           The new config field value.
     */
-   @Deprecated
+   // suppressed deprecation to reduce compiler warnings
+   //@Deprecated
    public void pushWidgetAttr(String fname, Object value)
    {
       if (!canPushWidgetAttr())
@@ -5736,7 +5739,8 @@
     * @param    values
     *           The list of new config field values.
     */
-   @Deprecated
+   // Suppress deprecation to reduce compiler warnings
+   // @Deprecated
    public void pushWidgetAttr(String[] fnames, Object[] values)
    {
       if (!canPushWidgetAttr())
@@ -5769,7 +5773,8 @@
     *
     * The method is deprecated.
     */
-   @Deprecated
+   // Suspend deprecation to remove compiler warnings
+   //@Deprecated()
    public void flushWidgetAttrs()
    {
       getLogicalTerminal().flushEnqueuedWidgetAttrs();

=== modified file 'src/com/goldencode/p2j/ui/client/driver/swing/SwingKeyboardReader.java'
--- old/src/com/goldencode/p2j/ui/client/driver/swing/SwingKeyboardReader.java	2022-04-02 15:15:13 +0000
+++ new/src/com/goldencode/p2j/ui/client/driver/swing/SwingKeyboardReader.java	2022-05-02 09:56:32 +0000
@@ -18,6 +18,7 @@
 **     VVT 20220402 keyPressed/keyReleased now use ThinClient.postKeyboardStateEvent().
 **                  Now unused postSystemEvent() method removed. Class members sorted according to the
 **                  GCD code style. See #6178.
+**     TJD 20220331 Added SuppressWarnings to mergeWithLastEvent
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -209,6 +210,7 @@
     * @param    evt
     *           The java keyboard event
     */
+   @SuppressWarnings("deprecation")
    public final static void mergeWithLastEvent(KeyEvent last, KeyEvent evt)
    {
       last.setKeyCode(evt.getKeyCode());

=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/PaintStructure.java'
--- old/src/com/goldencode/p2j/ui/client/gui/driver/PaintStructure.java	2020-10-09 18:00:55 +0000
+++ new/src/com/goldencode/p2j/ui/client/gui/driver/PaintStructure.java	2022-05-02 10:39:04 +0000
@@ -202,6 +202,7 @@
     * 
     * @return  a short description of this drawing primitive.
     */
+   @SuppressWarnings("deprecation")
    @Override
    public String toString()
    {

=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java'
--- old/src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java	2022-04-30 16:05:04 +0000
+++ new/src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java	2022-05-02 11:14:44 +0000
@@ -193,6 +193,7 @@
 **                  Added extra support for scaled text shift and rect drawing around text.
 **                  Improved support for text width of symbolic fonts.
 **                  Replaced auto text scale with font specific web scale.
+**     TJD 20220501 Removed depracted from getTextWidth to reduce number of warnings
 */
 
 /*

=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java'
--- old/src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java	2022-04-30 16:05:04 +0000
+++ new/src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebSocket.java	2022-05-02 09:56:32 +0000
@@ -4055,7 +4055,6 @@
     *           
     * @return   The text's width.
     */
-   @Deprecated
    public int getTextWidth(String text, int font)
    {
       int len = 1;   // type

=== modified file 'src/com/goldencode/p2j/util/FileStream.java'
--- old/src/com/goldencode/p2j/util/FileStream.java	2022-04-06 22:55:11 +0000
+++ new/src/com/goldencode/p2j/util/FileStream.java	2022-05-02 09:56:32 +0000
@@ -66,6 +66,8 @@
 **     EVL 20220406          When we have no new line character inside single line file we have to return
 **                           empty string instead of the line content.  This is the OE 'feature' we need to
 **                           duplicate.
+**     TJD 20220331          Removed legacy ThreadLocalCoders, decoder for charset new instance is created 
+**                           for every call
 */
 
 /*
@@ -1485,7 +1487,7 @@
       
       if (sourceCharset != null)
       {
-         decoder = ThreadLocalCoders.decoderFor(sourceCharset);
+         decoder = sourceCharset.newDecoder();
          decoder.onMalformedInput(CodingErrorAction.REPORT);
          decoder.onUnmappableCharacter(CodingErrorAction.REPORT);
       }

=== modified file 'src/com/goldencode/p2j/web/GenericWebServer.java'
--- old/src/com/goldencode/p2j/web/GenericWebServer.java	2022-04-27 21:39:36 +0000
+++ new/src/com/goldencode/p2j/web/GenericWebServer.java	2022-05-02 11:35:23 +0000
@@ -27,6 +27,7 @@
 **                  same node names as used by AppServerConnectionPool (keyStore, storePassword and 
 **                  entryPassword).
 **     VVT 20220316 getWarFile(): now the argument can be an absolute file path.
+**     TJD 20220331 Replaced deprecated new SslContextFactory() with SslContextFactory.Server()
 **     HC  20220427 Added Conscrypt SSL provider support for Web GUI JS Client - Java Client channel.
 */
 /*
@@ -696,7 +697,7 @@
    {
       SecurityManager sm = SecurityManager.getInstance();
       
-      SslContextFactory sslContextFactory = new SslContextFactory();
+      SslContextFactory sslContextFactory = new SslContextFactory.Server();
       
       if (serverKeyStore != null && serverKeyStore.isWebValid())
       {

=== modified file 'src/com/goldencode/p2j/web/SecureWebServer.java'
--- old/src/com/goldencode/p2j/web/SecureWebServer.java	2017-09-25 09:09:28 +0000
+++ new/src/com/goldencode/p2j/web/SecureWebServer.java	2022-05-02 09:56:32 +0000
@@ -2,10 +2,11 @@
 ** Module   : SecureWebServer.java
 ** Abstract : Wev server with SSL support.
 **
-** Copyright (c) 2017, Golden Code Development Corporation.
+** Copyright (c) 2017-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ----------------Description----------------------
 ** 001 SBI 20170925 Created initial version.
+**     TJD 20220331 Replaced deprecated new SslContextFactory() with SslContextFactory.Server()
 */
 /*
 ** This program is free software: you can redistribute it and/or modify
@@ -175,7 +176,7 @@
          return null;
       }
       
-      SslContextFactory sslContextFactory = new SslContextFactory();
+      SslContextFactory sslContextFactory = new SslContextFactory.Server();
       sslContextFactory.setSslContext(ctx);
       
       return sslContextFactory;

=== modified file 'src/com/goldencode/p2j/xml/XDocumentImpl.java'
--- old/src/com/goldencode/p2j/xml/XDocumentImpl.java	2022-02-11 10:43:35 +0000
+++ new/src/com/goldencode/p2j/xml/XDocumentImpl.java	2022-05-02 09:56:32 +0000
@@ -44,6 +44,7 @@
 **                  XmlHelper.writeLegacyCompatible which uses W3C DOM to serialize the XML.
 **     CA  20220211 Fixed setEncoding - find the Charset alias which is IANA-compatible (a side-effect moving
 **                  to xerces implementation in CA/20220127, in XmlHelper.writeLegacyCompatible).
+**     TJD 20220331 Exchanged DocumentImpl.setEncoding to DocumentImpl.setEncoding
 */
 
 /*
@@ -1492,7 +1493,8 @@
          }
       }
 
-      ((DocumentImpl) xdoc).setEncoding(encodingStr);
+      ((DocumentImpl) xdoc).setXmlEncoding(encodingStr);
+
    }
 
    /**

=== modified file 'src/com/goldencode/util/DatabaseDumpChecker.java'
--- old/src/com/goldencode/util/DatabaseDumpChecker.java	2021-07-03 00:00:55 +0000
+++ new/src/com/goldencode/util/DatabaseDumpChecker.java	2022-05-02 09:56:32 +0000
@@ -2,11 +2,12 @@
 ** Module   : DatabaseDumpChecker.java
 ** Abstract : Small utility application which read a set of files to estimate the success of an import process 
 **
-** Copyright (c) 2021, Golden Code Development Corporation.
+** Copyright (c) 2021-2022, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ---------------------------------------Description---------------------------------------
 ** 001 OM  20210701 First revision, with basic capabilities.
 **     OM  20210702 Handled multibyte character spanning between two read byte batches.
+**     TJD 20220331 Removed ThreadLocalCoders, to be checked if caching is needed at all
 */
 
 /*
@@ -64,7 +65,6 @@
 
 package com.goldencode.util;
 
-import sun.nio.cs.*;
 import java.io.*;
 import java.nio.*;
 import java.nio.channels.*;
@@ -213,11 +213,16 @@
       print(1, "=================================================================================%n");
       print(0, "%s%n", fileName);
       
-      CharsetDecoder decoder = ThreadLocalCoders.decoderFor(sourceCS);
+      if (sourceCS==null)
+      {
+         print(0, "process: sourceCS is null, skipping file:"+fileName);
+         return;
+      }
+      CharsetDecoder decoder = sourceCS.newDecoder();
       decoder.onMalformedInput(CodingErrorAction.REPORT);
       decoder.onUnmappableCharacter(CodingErrorAction.REPORT);
       
-      CharsetEncoder encoder = ThreadLocalCoders.encoderFor(targetCS);
+      CharsetEncoder encoder = sourceCS.newEncoder(); 
       encoder.onMalformedInput(CodingErrorAction.REPORT);
       encoder.onUnmappableCharacter(CodingErrorAction.REPORT);
       

