db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DERBY-6125) Code clean up in client driver.
Date Thu, 02 May 2013 11:00:17 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13644318#comment-13644318
] 

Dag H. Wanvik edited comment on DERBY-6125 at 5/2/13 10:59 AM:
---------------------------------------------------------------

Uploading a new patch, derby-6125-visibility-02-d which further limits scopes program entities
and also removed dead code, including maintenance of fields that are never read, i.e. used
for anything except setting them.

When I use the term "unused" below it may mean that something is
ultimately unused, e.g a method used to set an unused field, or due to
other code removal transitively.

 * Agent

  Removed unused method batchUpdateExceptionGenerated

* ClientCallableStatement

  Removed two unused overloads: resetCallableStatement

* ClientClob

  Removed unused field encoding_

  Removed unused methods createClobWrapper, convertFromAsciiToCharacterStream

* ClientPreparedStatement

  Removed unused methods resetPreparedStatement,
  initPreparedStatement, writeDescribeOutput, readDescribeOutput,
  writePrepareDescribeInputOutput, checkScaleForINOUTDecimal

  Inlined creation of method not implemented exception, removed
  jdbc3FeatureNotSupported.

* ClientResultSet

  Commented out unused fields updatability_unknown__, updatability_readOnly__

  Removed unused fields NEXT_ROWSET, PREVIOUS_ROWSET, ABSOLUTE_ROWSET,
  FIRST_ROWSET, LAST_ROWSET, RELATIVE_ROWSET, REFRESH_ROWSET, nestingLevel_

  Removed unused method rowCountIsKnown. flowFetch moved to NetResultSet.

* ClientStatement

  Removed unused field returnValueFromProcedure_

  Commented out unused fields isCommitSql__, isRollbackSql__, isPositionedUpdateDeleteSql__

  Removed unused method clientmarkResultSetsClosed, getProcedureName,
  upperCaseProcedureName, jdbc3FeatureNotSupported

* ClobLocatorOutputStream

  Removed unused field connection

* ColumnMetaData

  Removed unused fields singleMixedByteOrDouble_,
  protocolTypeToOverrideLidMapping_, mddOverrideArray_

  Removed unused method isParameterModeGuessedAsOutput, columnIsNotInUnicode

* Configuration

  Removed unused fields jreLevelMajor, jreLevelMinor, jreLevel,
  dncPackageVersion, enableNetConnectionPooling,
  cursorAttribute_InsensitiveRowset,
  cursorAttribute_SensitiveDynamicRowset,
  cursorAttribute_InsensitiveRowset

* CrossConverters

  Removed unused method getBooleanFromByte, getBigDecimalFromBoolean,
  getStringFromBoolean, getDateFromTime(Time),
  getDateFromTimestamp(Timestamp), getTimeFromTimestamp(Timestamp),
  getTimestampFromTime(Time), getTimestampFromDate(Date)

* DisconnectException

  Removed unused constructor DisconnectException(Agent, ClientMessageId, SqlCode)

* LogWriter

  Removed unused traceExit overloads.

* SectionManager

  Removed unused fields collection_, HOLD, NO_HOLD, 
  
* SqlCode

  Removed unused fields invalidCommitOrRollbackUnderXA,
  invalidSetAutoCommitUnderXA, undefinedError

* SqlException

  Removed unused constructor SqlException(LogWriter, ClientMessageId, SqlCode)

* SqlWarning

  Removed unused constructors
  Removed unused method getNextWarning

* Sqlca

  Removed unused methods getReturnValue, includesSqlCode

* Utils

  Removed unused methods getStringFromStrings, padOrTruncate,
  checkForNegativePositiveSqlcard (2X), getUpdateCountFromSqlcard,
  accumulateSQLWarning, getSQLTypeName (we might want to keep this for
  debugging possibly?)

* Version

  Removed unused methods getDriverName, getBuildNumber, isAlpha, isBeta

* XaException

  Removed unused constructors
  Removed unused method copyAsUnchainedXAException

* CodePoint

  Removed many unused code points (fields). One could argue that it's
  nice to keep these if we need them later, opinions welcomed.  For me
  it seems clearer to only keep those we need, we know what the source
  for the constants is anyway, i.e. the DRDA specification.

* DssConstants

  Removed many unused constants, cf previous item considerations.

* FdocaConstants
 
  Removed many unused constants, cf previous item considerations.

* FdocaSimpleDataArray

  Removed unused fields fdocaFieldType_, representation_, mode_, fieldLength_

* NetAgent

  Removed unused fields packageRequest_, 
  Removed unused method convertToStringTcpIpAddress

* NetConfiguration

  Removed unused fields INITIAL_CAPACITY, NON_CHAR_DDM_DATA_PAD_BYTE,
  CURSOR_NOT_OPEN, CURSOR_OPEN, CURSOR_CLOSE_ONLY, DDMHDR_LENGTH,
  PRDDTA_MAX_ACCT_SUFFIX_LEN, MGRLVL_3, MGRLVL_4, MGRLVL_6,
  SECMEC_DCESEC, SECMEC_EUSRIDNWPWD, SYSTEM_ASC

* NetConnection

  Removed unused field pendingEndXACallinfoOffset_, targetSrvclsnm_, seqNo_

  Removed unused methods getSpecialRegisters, addSpecialRegisters,
  getSequenceNumber, getIndoubtTransaction, doResetNow,
  serverSupportsBooleanValues

* NetConnectionRequest

  Removed unused method writeDummyExchangeServerAttributes


* NetCursor

  Removed unused fields targetSqlamForTypdef_, numMddOverrides_

* NetResultSet

  Removed unused method queryDataWasReturnedOnOpen

* NetResultSet

  Method flowFetch moved from ClientResultSet to be able to make it
  package private.

* NetStatement

  Removed unused constructor
  Removed unused method netReset

* NetXACallInfo

  Removed unused fields xaInProgress_, xaWasSuspended,
  currConnection_, freeEntry_, convReleased_, xaResource_, uowid_,
  readOnlyTransaction_

  Removed unused methods setUOWID, getUOWID,
  setReadOnlyTransactionFlag, getReadOnlyTransactionFlag

* NetXAConnection

  Removed unused methods writeLocalXAStart_, readLocalXAStart, getUOWID, getPort

* NetXAResource

  Removed unused fields TMTIMEOUT, ACTIVE_ONLY, XA_NULL_XID,
  RECOVER_XID_ARRAY_LENGTH, XAFUNC_NONE, rmId_, numXACallInfo_,
  connectionCount_, activeXATransCount_, rmIdx_, rmIdy_, port_,
  ipaddr_, specialRegisters_

  Removed unused methods throwXAException, getSpecialRegisters,
  addSpecialRegisters

* Reply

  Removed unused fields dssIsChainedWithDiffID_

  Removed unused methods readIntArray, readLong, readBoolean,
  readString(int), readLDBytes, peekLength

* Request

  Removed unused method createXACommand, writeScalarBytes,
  writeScalarHeader, writeScalarPaddedBytes, writeDDMString

* Typdef

  Removed unused constructor(NetAgent, int, String)
  Removed unused field environment_
  Removed unused methods  clearCcsidSbc, clearCcsidDbc, clearCcsidMbc

* NetIndoubtTransaction removed altogether





                
      was (Author: dagw):
    Uploading a new patch, derby-6125-visibility-02-d which further limits scopes program
entities and also removed dead code, inclusing maintenance of fields that are never read,
i.e. used for anything except setting them.

When I use the term "unused" below it may mean that something is
ultimately unused, e.g a method used to set an unused field, or due to
other code removal transitively.

 * Agent

  Removed unused method batchUpdateExceptionGenerated

* ClientCallableStatement

  Removed two unused overloads: resetCallableStatement

* ClientClob

  Removed unused field encoding_

  Removed unused methods createClobWrapper, convertFromAsciiToCharacterStream

* ClientPreparedStatement

  Removed unused methods resetPreparedStatement,
  initPreparedStatement, writeDescribeOutput, readDescribeOutput,
  writePrepareDescribeInputOutput, checkScaleForINOUTDecimal

  Inlined creation of method not implemented exception, removed
  jdbc3FeatureNotSupported.

* ClientResultSet

  Commented out unused fields updatability_unknown__, updatability_readOnly__

  Removed unused fields NEXT_ROWSET, PREVIOUS_ROWSET, ABSOLUTE_ROWSET,
  FIRST_ROWSET, LAST_ROWSET, RELATIVE_ROWSET, REFRESH_ROWSET, nestingLevel_

  Removed unused method rowCountIsKnown. flowFetch moved to NetResultSet.

* ClientStatement

  Removed unused field returnValueFromProcedure_

  Commented out unused fields isCommitSql__, isRollbackSql__, isPositionedUpdateDeleteSql__

  Removed unused method clientmarkResultSetsClosed, getProcedureName,
  upperCaseProcedureName, jdbc3FeatureNotSupported

* ClobLocatorOutputStream

  Removed unused field connection

* ColumnMetaData

  Removed unused fields singleMixedByteOrDouble_,
  protocolTypeToOverrideLidMapping_, mddOverrideArray_

  Removed unused method isParameterModeGuessedAsOutput, columnIsNotInUnicode

* Configuration

  Removed unused fields jreLevelMajor, jreLevelMinor, jreLevel,
  dncPackageVersion, enableNetConnectionPooling,
  cursorAttribute_InsensitiveRowset,
  cursorAttribute_SensitiveDynamicRowset,
  cursorAttribute_InsensitiveRowset

* CrossConverters

  Removed unused method getBooleanFromByte, getBigDecimalFromBoolean,
  getStringFromBoolean, getDateFromTime(Time),
  getDateFromTimestamp(Timestamp), getTimeFromTimestamp(Timestamp),
  getTimestampFromTime(Time), getTimestampFromDate(Date)

* DisconnectException

  Removed unused constructor DisconnectException(Agent, ClientMessageId, SqlCode)

* LogWriter

  Removed unused traceExit overloads.

* SectionManager

  Removed unused fields collection_, HOLD, NO_HOLD, 
  
* SqlCode

  Removed unused fields invalidCommitOrRollbackUnderXA,
  invalidSetAutoCommitUnderXA, undefinedError

* SqlException

  Removed unused constructor SqlException(LogWriter, ClientMessageId, SqlCode)

* SqlWarning

  Removed unused constructors
  Removed unused method getNextWarning

* Sqlca

  Removed unused methods getReturnValue, includesSqlCode

* Utils

  Removed unused methods getStringFromStrings, padOrTruncate,
  checkForNegativePositiveSqlcard (2X), getUpdateCountFromSqlcard,
  accumulateSQLWarning, getSQLTypeName (we might want to keep this for
  debugging possibly?)

* Version

  Removed unused methods getDriverName, getBuildNumber, isAlpha, isBeta

* XaException

  Removed unused constructors
  Removed unused method copyAsUnchainedXAException

* CodePoint

  Removed many unused code points (fields). One could argue that it's
  nice to keep these if we need them later, opinions welcomed.  For me
  it seems clearer to only keep those we need, we know what the source
  for the constants is anyway, i.e. the DRDA specification.

* DssConstants

  Removed many unused constants, cf previous item considerations.

* FdocaConstants
 
  Removed many unused constants, cf previous item considerations.

* FdocaSimpleDataArray

  Removed unused fields fdocaFieldType_, representation_, mode_, fieldLength_

* NetAgent

  Removed unused fields packageRequest_, 
  Removed unused method convertToStringTcpIpAddress

* NetConfiguration

  Removed unused fields INITIAL_CAPACITY, NON_CHAR_DDM_DATA_PAD_BYTE,
  CURSOR_NOT_OPEN, CURSOR_OPEN, CURSOR_CLOSE_ONLY, DDMHDR_LENGTH,
  PRDDTA_MAX_ACCT_SUFFIX_LEN, MGRLVL_3, MGRLVL_4, MGRLVL_6,
  SECMEC_DCESEC, SECMEC_EUSRIDNWPWD, SYSTEM_ASC

* NetConnection

  Removed unused field pendingEndXACallinfoOffset_, targetSrvclsnm_, seqNo_

  Removed unused methods getSpecialRegisters, addSpecialRegisters,
  getSequenceNumber, getIndoubtTransaction, doResetNow,
  serverSupportsBooleanValues

* NetConnectionRequest

  Removed unused method writeDummyExchangeServerAttributes


* NetCursor

  Removed unused fields targetSqlamForTypdef_, numMddOverrides_

* NetResultSet

  Removed unused method queryDataWasReturnedOnOpen

* NetResultSet

  Method flowFetch moved from ClientResultSet to be able to make it
  package private.

* NetStatement

  Removed unused constructor
  Removed unused method netReset

* NetXACallInfo

  Removed unused fields xaInProgress_, xaWasSuspended,
  currConnection_, freeEntry_, convReleased_, xaResource_, uowid_,
  readOnlyTransaction_

  Removed unused methods setUOWID, getUOWID,
  setReadOnlyTransactionFlag, getReadOnlyTransactionFlag

* NetXAConnection

  Removed unused methods writeLocalXAStart_, readLocalXAStart, getUOWID, getPort

* NetXAResource

  Removed unused fields TMTIMEOUT, ACTIVE_ONLY, XA_NULL_XID,
  RECOVER_XID_ARRAY_LENGTH, XAFUNC_NONE, rmId_, numXACallInfo_,
  connectionCount_, activeXATransCount_, rmIdx_, rmIdy_, port_,
  ipaddr_, specialRegisters_

  Removed unused methods throwXAException, getSpecialRegisters,
  addSpecialRegisters

* Reply

  Removed unused fields dssIsChainedWithDiffID_

  Removed unused methods readIntArray, readLong, readBoolean,
  readString(int), readLDBytes, peekLength

* Request

  Removed unused method createXACommand, writeScalarBytes,
  writeScalarHeader, writeScalarPaddedBytes, writeDDMString

* Typdef

  Removed unused constructor(NetAgent, int, String)
  Removed unused field environment_
  Removed unused methods  clearCcsidSbc, clearCcsidDbc, clearCcsidMbc

* NetIndoubtTransaction removed altogether





                  
> Code clean up in client driver.
> -------------------------------
>
>                 Key: DERBY-6125
>                 URL: https://issues.apache.org/jira/browse/DERBY-6125
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: derby-6125-01-a.diff, derby-6125-01-b.diff, derby-6125-01-b.status,
derby-6125-02-a.diff, derby-6125-02-a.status, derby-6125-03-04-followup.diff, derby-6125-03-04-followup.status,
derby-6125-03-a.diff, derby-6125-03-a.status, derby-6125-04-a.diff, derby-6125-04-a.status,
derby-6125-05-a.diff, derby-6125-05-c.diff, derby-6125-05-c.status, derby-6125-05-d.diff,
derby-6125-05-d.status, derby-6125-imports-01-a.diff, derby-6125-imports-01-a.status, derby-6125-rename-01-c.diff.gz,
derby-6125-rename-01-c.stat, derby-6125-visibility-01-a.diff, derby-6125-visibility-01-a.status,
derby-6125-visibility-01-b.diff, derby-6125-visibility-02-e.diff, derby-6125-visibility-02-e.status,
derby-6125-visibility-03-a.diff, derby-6125-visibility-03-a.status
>
>
> Clean up unused code, lacking finals, too wide visibility etc.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message