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-2920) Share code between readExternal() and readExternalFromArray()
Date Fri, 02 Nov 2012 09:11:12 GMT

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

Knut Anders Hatlen updated DERBY-2920:
--------------------------------------

    Attachment: d2920-1a.diff

There are 23 implementations of readExternalFromArray(). 19 of them are identical to the readExternal()
method in the same class.

The attached patch adds a readExternalFromArray() method to the DataType class, which is a
common base class for all the classes that implement readExternalFromArray(). The new method
simply forwards calls to readExternal().

The patch also removes the 19 readExternalFromArray() methods that are identical to readExternal(),
as they would work correctly by inheriting the method from DataType. The four classes that
have optimized implementations that are not identical to readExternal(), keep their current
implementations.

The four classes that have optimized versions of readExternalFromArray(), are SQLChar, SQLClob,
XML and HeapRowLocation.

All the regression tests passed with the patch.
                
> Share code between readExternal() and readExternalFromArray()
> -------------------------------------------------------------
>
>                 Key: DERBY-2920
>                 URL: https://issues.apache.org/jira/browse/DERBY-2920
>             Project: Derby
>          Issue Type: Improvement
>          Components: Services, SQL
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>              Labels: derby_triage10_10
>         Attachments: d2920-1a.diff
>
>
> Most of the implementations of DataValueDescriptor.readExternalFromArray(ArrayInputStream)
are identical to their corresponding Externalizable.readExternal(ObjectInput) methods. Since
ArrayInputStream implements ObjectInput, readExternalFromArray() could in those cases just
have forwarded calls to readExternal() instead of duplicating the code. A default forwarding
implementation of readExternalFromArray() could be placed in org.apache.derby.iapi.types.DataType,
and all the existing implementations, except those with optimizations for ArrayInputStream,
could be removed.

--
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

Mime
View raw message