[
https://issues.apache.org/jira/browse/DERBY-6125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13619527#comment-13619527
]
Dag H. Wanvik edited comment on DERBY-6125 at 4/2/13 5:21 AM:
--------------------------------------------------------------
Uploading a new patch, derby-6125-05-a, regression ran OK.
Patch derby-6125-05-a details:
- 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.
- copies bytes in setPKGNAMCBytes to avoid having a package private variable
wriable from outside the package (its an array).
- removed unnecessary a priori allocation to Sqlca#sqlErrd_.
- made Statement#materialStatement_ private; new accessors
- removed unnecessary default NetConnection finalizer
- 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
- 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()...
- made Typdef#FdocaSimpleDataArray private
- made SqlException#SQLExceptionFactory package private (was protected)
was (Author: dagw):
Uploading a new patch, derby-6125-05-a, regression ran OK.
Patch derby-6125-05-a details:
- 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.
- copies bytes in setPKGNAMCBytes to avoid having a package private variable
wriable from outside the package (its an array).
- removed unnecessary a priori allocation to Sqlca#sqlErrd_.
- made Statement#materialStatement_ private; new accessors
- removed unnecessary default NetConnection finalizer
- 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
- 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. "
- made Typdef#FdocaSimpleDataArray private
- made SqlException#SQLExceptionFactory package private (was protected)
> 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-a.diff, derby-6125-03-a.status, derby-6125-04-a.diff,
> derby-6125-04-a.status, derby-6125-05-a.diff
>
>
> 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