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

Knut Anders Hatlen commented on DERBY-6125:
-------------------------------------------

Patch 05-a:

- Section.setPKGNAMCBytes(): new + arraycopy -> clone

- It wasn't entirely obvious to me that removing the allocation in 
Sqlca.getSqlErrd() was safe. Do we know that setSqlErrd() has always been 
called in the code that calls getSqlErrd() without checking that the return 
value is non-null? (Sqlca.getMessage() and Statement.completeExecute())

Maybe it's better not to expose the sqlErrd_ array at all. That is:
  - make getSqlErrd() private
  - move most of ExceptionFormatter.printTrace(Sqlca,PrintWriter,String) into a 
new method (getTraceString()?) in the Sqlca class
  - replace the call to getSqlErrd() in Statement.completeExecute() with a call 
to a new method (getReturnValue()?) that returns the first element of sqlErrd_ 
rather than the whole array

That change may allow more of Sqlca's methods, like getSqlWarn(), to become 
private as well.

- The only remaining caller of Typedef.getByteOrder() is 
NetCursor.parseSQLDCGRP(). The return value is only used to set 
Sqlca.sqlErrmcCcsid_, which is never read. Remove that field and the 
getByteOrder() method?
                
> 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

Reply via email to