docs: @Override
      public void setPoolState(int i) {
          if (pm.gConfigProps.callResourceAdapterStatMethods) {
              if (poolState.get() == 0) {
                  /*
                   * If current state is 0, we are a new connection, or we are in
                   * transition to one of the pools.
                   */
                  if (i == 1) {
                      /*
                       * This connection is moving from new/transaction to free
                       */
                      synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfFreeConnections;
                      }
                  }
                  if (i == 2) {
                      /*
                       * This connection is moving from new/transaction to shared
                       */
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 3) {
                      /*
                       * This connection is moving from new/transaction to unshared
                       */
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 4) {
                      /*
                       * This connection is moving from new/transaction to waiter
                       */
                      // do nothing here
                      //++pm.gConfigProps.numberOfInuseConnections;
                  }
              }
              if (poolState.get() == 1) {
                  /*
                   * We are in the free pool, moving to inuse.
                   */
                  if (i == 0) {
                      /*
                       * This connection is moving from free to transition
                       */
                      synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
                          --pm.gConfigProps.numberOfFreeConnections;
                      }
                  }
                  if (i == 2) {
                      /*
                       * This connection is moving from free to shared
                       */
                      synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
                          --pm.gConfigProps.numberOfFreeConnections;
                      }
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 3) {
                      /*
                       * This connection is moving from free to unshared
                       */
                      synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
                          --pm.gConfigProps.numberOfFreeConnections;
                      }
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 4) {
                      /*
                       * This connection is moving from free to waiter
                       */
                      synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
                          --pm.gConfigProps.numberOfFreeConnections;
                      }
                      //--pm.gConfigProps.numberOfFreeConnections;
                      //++pm.gConfigProps.numberOfInuseConnections;
                  }
  
              }
              if (poolState.get() == 2) {
                  /*
                   * We are in the shared pool, moving to free/transition.
                   */
                  if (i == 0) {
                      /*
                       * This connection is moving from shared to transition
                       */
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          --pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 1) {
                      /*
                       * This connection is moving from shared to free
                       */
                      synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfFreeConnections;
                      }
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          --pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 3) {
                      /*
                       * This connection is moving from shared to unshared
                       */
                      // do nothing
                      //--pm.gConfigProps.numberOfFreeConnections;
                      //++pm.gConfigProps.numberOfInuseConnections;
                  }
                  if (i == 4) {
                      /*
                       * This connection is moving from shared to waiter
                       */
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          --pm.gConfigProps.numberOfInuseConnections;
                      }
                      //--pm.gConfigProps.numberOfFreeConnections;
                      //++pm.gConfigProps.numberOfInuseConnections;
                  }
  
              }
              if (poolState.get() == 3) {
                  /*
                   * We are in the unshared pool, moving to free/transition.
                   */
                  if (i == 0) {
                      /*
                       * This connection is moving from unshared to transition
                       */
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          --pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 1) {
                      /*
                       * This connection is moving from unshared to free
                       */
                      synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfFreeConnections;
                      }
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          --pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 2) {
                      /*
                       * This connection is moving from unshared to shared
                       */
                      // do nothing
                      //--pm.gConfigProps.numberOfFreeConnections;
                      //++pm.gConfigProps.numberOfInuseConnections;
                  }
                  if (i == 4) {
                      /*
                       * This connection is moving from unshared to waiter
                       */
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          --pm.gConfigProps.numberOfInuseConnections;
                      }
                      //--pm.gConfigProps.numberOfFreeConnections;
                      //++pm.gConfigProps.numberOfInuseConnections;
                  }
  
              }
              if (poolState.get() == 4) {
                  /*
                   * We are in the waiter pool, moving to free/transition.
                   */
                  if (i == 0) {
                      /*
                       * This connection is moving from waiter to transition
                       */
                      // do nothing
                      //--pm.gConfigProps.numberOfInuseConnections;
                  }
                  if (i == 1) {
                      /*
                       * This connection is moving from waiter to free
                       */
                      synchronized (pm.gConfigProps.numberOfFreeConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfFreeConnections;
                      }
                      //--pm.gConfigProps.numberOfInuseConnections;
                  }
                  if (i == 2) {
                      /*
                       * This connection is moving from waiter to shared
                       */
                      // do nothing
                      //--pm.gConfigProps.numberOfFreeConnections;
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
                  if (i == 3) {
                      /*
                       * This connection is moving from waiter to unshared
                       */
                      // do nothing here
                      //--pm.gConfigProps.numberOfFreeConnections;
                      synchronized (pm.gConfigProps.numberOfInuseConnectionsLockObject) {
                          ++pm.gConfigProps.numberOfInuseConnections;
                      }
                  }
              }
  
          }
          poolState.set(i);
      }