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

Bryan Pendleton commented on DERBY-6391:
----------------------------------------

I'm not certain of such an easy way. I tried this:
{code}
find java/engine -name '*.java' -exec grep -n -A 5 -e 'throw ' {} \; -print > 
/tmp/t
{code}
which gave me a nice file with a lot of examples of exception throwing to
look at, but I didn't immediately see any that fit the problematic pattern.

I think it's quite possible that this particular bug was fixed
by revision 1742858, for example, look at the diffs for StoredPage.java in:

http://svn.apache.org/viewvc?view=revision&revision=1742858

We may be able to close this bug as fixed by 1742858.

> remove unneeded object creation in newException() calls in releases > 10.10
> ---------------------------------------------------------------------------
>
>                 Key: DERBY-6391
>                 URL: https://issues.apache.org/jira/browse/DERBY-6391
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL, Store
>    Affects Versions: 10.11.1.1
>            Reporter: Mike Matrigali
>              Labels: derby_backport_reject_10_10
>
> In releases after 10.10 the code has been converted to use new 
> java language features.  One of the benefits I just noticed is that
> arguments to StandardException.newException() no longer have
> to be Objects.  I believe this is due to reimplementation using varargs.
> As an example old code use to have to be written as:
> throw StandardException.newException(
>                     SQLState.FILE_BAD_CHECKSUM,
>                     id,
>                     new Long(checksum.getValue()),
>                     new Long(onDiskChecksum),
>                     pagedataToHexDump(pageData));
> The only reason for the new Long() calls was to make them Objects so
> that the call would match up to a hard coded N Object arg version of
> the newException call.  I believe these conversions to Objects are no
> longer needed (but formatting of the args might change).
> There may be code size savings to be had by doing this code
> rototil.
> Anyone see a downside to changing the code in this way?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to