You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Claus Ibsen (JIRA)" <ib...@incubator.apache.org> on 2007/05/06 12:02:15 UTC

[jira] Commented: (IBATIS-359) Performance Improvement when No SecurityManager installed

    [ https://issues.apache.org/jira/browse/IBATIS-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493916 ] 

Claus Ibsen commented on IBATIS-359:
------------------------------------

This looks trivial to fix. Why hasn't it been done?

> Performance Improvement when No SecurityManager installed
> ---------------------------------------------------------
>
>                 Key: IBATIS-359
>                 URL: https://issues.apache.org/jira/browse/IBATIS-359
>             Project: iBatis for Java
>          Issue Type: Improvement
>          Components: SQL Maps
>    Affects Versions: 2.0.8, 2.0.9, 2.0.9b, 2.1.0, 2.1.5, 2.1.6, 2.1.7, 2.2.0, 2.3.0
>         Environment: Linux/Windows
>            Reporter: Philippe Mouawad
>
> In class com.ibatis.common.beans.ClassInfo, when NO SecurityManager is installed, each time the method ClassInfo#canAccessPrivateMethods()  is called, a NullPointer exception is thrown, it would be more performant to test for nullity:
>   private boolean canAccessPrivateMethods() {
>     try {
>       SecurityManager manager = System.getSecurityManager();
>       if (manager == null)
>       {
>             return true;
>       }
>       manager.checkPermission(new ReflectPermission("suppressAccessChecks"));
>       return true;
>     } catch (SecurityException e) {
>       return false;
>     } catch (NullPointerException e) {
>       return true;
>     }
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.