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-6162) Simplify privileged actions in NetworkServerControlApiTest
Date Wed, 10 Apr 2013 10:46:17 GMT

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

Knut Anders Hatlen updated DERBY-6162:

    Attachment: d6162-1a.diff

Attaching d6162-1a.diff which simplifies the two methods as described above.

While at it, I also moved NetworkServerControlApiTest to a different build target that makes
it compiled with source level 1.5, so that generics could be used to simplify the call to
the privileged code further (saved a cast). The test only runs on Java 5 and higher, so it
should be OK to raise the compiler level.

I've run the derbynet suite successfully on Java 7 and on OJEC 1.1 with the patch.
> Simplify privileged actions in NetworkServerControlApiTest
> ----------------------------------------------------------
>                 Key: DERBY-6162
>                 URL: https://issues.apache.org/jira/browse/DERBY-6162
>             Project: Derby
>          Issue Type: Improvement
>          Components: Test
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Trivial
>         Attachments: d6162-1a.diff
> Noticed two privileged blocks in NetworkServerControlApiTest that could be simplified:
> - privInetAddressGetByName() tests whether the PrivilegedActionException wraps a SecurityException.
PAE only wraps checked exceptions, and SecurityException is an unchecked exception, so that
can never happen.
> - fileExists() could use the existing helper method PrivilegedFileOpsForTests.exists()
and remove its privileged block.

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

View raw message