[
https://issues.apache.org/jira/browse/DERBY-6125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13624352#comment-13624352
]
Dag H. Wanvik commented on DERBY-6125:
--------------------------------------
Regressions ran fine. Committed patch 05-d with svn 1465193. Commit log:
** ClientXid
- reworked ClientXid#equals to find favor with FindBugs: now tests for null and
wrong type.
The old version would get classcastexception if a wrong type object was
compared.
- made ClientXid#getData clone the result - it is a byte array
** Section
- clone bytes in Section#setPKGNAMCBytes to avoid having a package private
variable
wriable from outside the package (it's an array).
- make Section#getPKGNAMCBytes return a clone
** Sqlca
- removed unnecessary a priori allocation to Sqlca#sqlErrd_.
- made Sqlca#sqlWarn_ private
- changed #getSqlWarn to return String since all its uses need a String anyway.
- made Sqlca#getSqlErrd private
- simplified implementation of Sqlca#getSqlWarn
- made Sqlca#rowsetRowCount_ private
- made Sqlca#containsSqlcax_ private
- made Sqlca#sqlErrmcMessages_ private
- removed argument sqlErrpBytes from Sqlca#setContainsSqlcax (only called once;
with null).
- removed argument sqlErrpBytes from Sqlca#resetRowsetSqlca (only called with
null).
- introduced Sqlca#getReturnValue in Statement#completeExecute instead
of allowing access to sqlca.getSqlErrd()[0]
- removed unused Sqlca#sqlErrmcCcsid_
- introduced public String Sqlca#formatSqlErrd as replacement for
direct access to Sqlca#sqlErrd_.
** NetSqlca
- made NetSqlca#setSqlwarnBytes package private
- made NetSqlca#setSqlerrmcBytes package private and removed its
argument sqlErrmcCcsid
- made NetSqlca#setSqlerrd package private
- removed unnecessary test for BIG_ENDIAN in NetSqlca#getRowCount: the
protocol always uses big endian (SignedBinary.BIG_ENDIAN = 1 is final).
- removed unnecessary type argument to NetSqlca#getRowCount now that endian
test is no longer done
** Statement
- made Statement#materialStatement_ private; new accessors
** NetConnection
- removed unnecessary default NetConnection finalizer
- three methods in NetConnection do nothing except calling the method with the
same name in the super class:
- close()
- closeX()
- closeResources()
Remove them and let NetConnection inherit them from its super class.
- Since we remove these methods from NetConnection, we also make
Connection.closeX() private and unsynchronized, as it will only be
called from Connection.close().
- NetConnection's closeForReuse() method doesn't have any callers;
remove that one too.
- NetConnection.completeConnect() doesn't actually do anything except
calling super.completeConnect(). Remove the override and make the
super method final instead.
** NetXAConnection
- removed potentially harmful finalizer in NetXAConnection: it calls a
finalizer for another class (NetConnection). FindBugs advice on this
(quote):
"If a connected set of objects beings finalizable, then the VM will
invoke the finalize method on all the finalizable object, possibly
at the same time in different threads. Thus, it is a particularly
bad idea, in the finalize method for a class X, invoke finalize on
objects referenced by X, because they may already be getting
finalized in a separate thread. "
It also neglected to call super.finalize()...
** Typdef
- made Typdef#FdocaSimpleDataArray private
- removed unused TypDef#getByteOrder
- made Typdef#environmentTables_ private
** SqlException
- made SqlException#SQLExceptionFactory package private (was protected)
** EncryptionManager
- removed unused methods EncryptionManager#setInitVector and #setSecKey
** NetXACallInfo
- removed unused NetXACallInfo#getCorrelatorToken
> 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
>
>
> 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