[
https://issues.apache.org/jira/browse/DERBY-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Knut Anders Hatlen updated DERBY-5847:
--------------------------------------
Attachment: d5847-5a-performance-warnings.patch
The patch d5847-5a-performance-warnings.patch addresses a batch of warnings
that NetBeans classifies as performance warnings. None of the warnings appear
to be in particularly performance critical code, but they still look like good
suggestions, I think. Three different kinds of warnings are addressed by the
patch:
- System.arraycopy() should be used instead of manual loops where possible.
- StringBuilder should be used instead of StringBuffer if synchronization is
not required.
- String concatenation should not happen in the arguments to
StringBuffer.append(). Instead, there should be multiple calls to append().
The patch changes the code as suggested. In addition, it eliminates the use of
StringBuffer in convertToHexString() by using the utility method
StringUtil.toHexString().
Tests passed. Committed revision 1359635.
> Clean up IDE warnings in DRDAConnThread
> ---------------------------------------
>
> Key: DERBY-5847
> URL: https://issues.apache.org/jira/browse/DERBY-5847
> Project: Derby
> Issue Type: Improvement
> Components: Network Server
> Affects Versions: 10.10.0.0
> Reporter: Knut Anders Hatlen
> Assignee: Knut Anders Hatlen
> Priority: Minor
> Attachments: d5847-1a-string-equality.patch,
> d5847-2a-unnecessary-return.patch, d5847-3a-static-fields-and-imports.patch,
> d5847-4a-unused-assignment.patch, d5847-5a-performance-warnings.patch
>
>
> When I open DRDAConnThread in NetBeans, I see 49 warnings. Most of them are
> harmless (like static fields accessed via an instance, suggestions about
> using StringBuilder instead of StringBuffer, or using System.arraycopy()
> instead of for loops). Others indicate real problems, like the use of != to
> compare SQL states in writeSQLDIAGGRP().
> We should clean up the warnings so that it's easier to notice new warnings
> about potential problems.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira