harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasily Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-547) [classlib][jndi] dead code in javax.naming.spi.DirectoryManager
Date Sun, 24 Dec 2006 23:26:23 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-547?page=all ]

Vasily Zakharov updated HARMONY-547:
------------------------------------

    Attachment: Harmony-547.patch

Attached a fix patch.

In fact, "ctx instanceof Context" is equivalent to "ctx != null" in these situations, and
specification clearly states that null values are not possible here. So removing the code
specified would be correct. Parts of the proposed corrections were already made by some previous
patches, the remaining changes are done in this patch.

No regression test is necessary for this issue.


> [classlib][jndi] dead code in javax.naming.spi.DirectoryManager
> ---------------------------------------------------------------
>
>                 Key: HARMONY-547
>                 URL: http://issues.apache.org/jira/browse/HARMONY-547
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Mikhail Loenko
>         Attachments: Harmony-547.patch
>
>
> There are two dead blocks in DirectoryManager:
>         Context nextContext = null;
>         try {
>             nextContext = NamingManager.getContinuationContext(cpe);
>         } catch (CannotProceedException e) {
>             // tolerate CannotProceedException here
>         }
>         
>         // if it is a DirContext
>         if (nextContext instanceof DirContext) {
>             // return as DirContext
>             return (DirContext) nextContext;
>         } else if (nextContext instanceof Context) { <<<<<<<<<<
always true
>             // in case it's Context but not DirContext, wrap it as DirContext and return
>             return new Context2DirContextWrapper(nextContext, cpe);
>         } else {  <<<<<<<<<<<<<< dead block
>             // return a dummy DirContext, even if no context is obtained
>             return new Context2DirContextWrapper(null, cpe);
>         }
> and
>             if (ctx instanceof Context) {   <<<<<<<<< always
true
>                 return ctx;
>             }
>             cpe.fillInStackTrace();     <<<<<<<<<<<<<<<
dead block
>             throw cpe;
> I'm not sure how to fix it. Seems like special care for null should be done

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message