db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-5012) [patch] bad allocation guard
Date Tue, 08 Feb 2011 10:24:57 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5012?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-5012:

    Attachment: no-alloc.diff

The patch looks correct to me. The reason why it still works, even if the check is backwards,
is that the call to updateColumn() in the loop below will allocate the array if it is null.

Since both of the arrays will be allocated lazily by updateColumn() anyways, I'm thinking
that it may make sense to stop allocating them in resetUpdatedColumnsForInsert() altogether.
See the attached patch (no-alloc.diff), which simplifies that method a bit.

> [patch] bad allocation guard
> ----------------------------
>                 Key: DERBY-5012
>                 URL: https://issues.apache.org/jira/browse/DERBY-5012
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions:
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For:
>         Attachments: bad_allocation_guard.diff, no-alloc.diff
>   Original Estimate: 1h
>  Remaining Estimate: 1h
> code checks to see if an array is _not_ null, and if so allocates the array. This is
backwards. Should check to see if the array is null.

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message