Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 10437 invoked from network); 7 Jan 2007 13:09:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jan 2007 13:09:49 -0000 Received: (qmail 37959 invoked by uid 500); 7 Jan 2007 13:09:55 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 37922 invoked by uid 500); 7 Jan 2007 13:09:55 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 37913 invoked by uid 99); 7 Jan 2007 13:09:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Jan 2007 05:09:55 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Jan 2007 05:09:47 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A20A97142DF for ; Sun, 7 Jan 2007 05:09:27 -0800 (PST) Message-ID: <9279150.1168175367633.JavaMail.jira@brutus> Date: Sun, 7 Jan 2007 05:09:27 -0800 (PST) From: "Vasily Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-547) [classlib][jndi] dead code in javax.naming.spi.DirectoryManager MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462815 ] Vasily Zakharov commented on HARMONY-547: ----------------------------------------- Thanks Tim, the patch applied fine. > [classlib][jndi] dead code in javax.naming.spi.DirectoryManager > --------------------------------------------------------------- > > Key: HARMONY-547 > URL: https://issues.apache.org/jira/browse/HARMONY-547 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Mikhail Loenko > Assigned To: Tim Ellison > 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: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira