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-6231) Remove unnecessary checks for UnsupportedEncodingException in the client
Date Wed, 29 May 2013 07:55:20 GMT

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

Knut Anders Hatlen updated DERBY-6231:
--------------------------------------

    Attachment: derby-6231-01-a.diff

The attached patch derby-6231-01-a.diff makes the client code use Charset constants for ISO-8859-1,
UTF-8 and UTF-16BE instead of referring to them by name. This way, it doesn't have to check
for the availability of these encodings each time they are used, and consequently it doesn't
have to check for UnsupportedEncodingException each time they are used. Since all of these
encodings are guaranteed to be supported by all Java SE implementations, the removed error
handlers were unused code in the first place.

All the regression tests ran cleanly with the patch.
                
> Remove unnecessary checks for UnsupportedEncodingException in the client
> ------------------------------------------------------------------------
>
>                 Key: DERBY-6231
>                 URL: https://issues.apache.org/jira/browse/DERBY-6231
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>    Affects Versions: 10.11.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: derby-6231-01-a.diff
>
>
> Many methods in the client need handling of UnsupportedEncodingException, typically because
they call String methods that take the name of the encoding as argument. Most of these methods
have overloads that take a Charset instead of a String to describe the encoding, and those
methods don't throw UnsupportedEncodingException as the encoding is known to be supported
once we have a Charset instance for it. We should use the methods that take a Charset and
simplify the exception handling.

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