Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 71539 invoked from network); 8 May 2008 15:07:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 May 2008 15:07:17 -0000 Received: (qmail 44432 invoked by uid 500); 8 May 2008 15:07:18 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 44381 invoked by uid 500); 8 May 2008 15:07:18 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 44362 invoked by uid 99); 8 May 2008 15:07:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 May 2008 08:07:18 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 May 2008 15:06:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8DDD8234C107 for ; Thu, 8 May 2008 08:06:55 -0700 (PDT) Message-ID: <250307096.1210259215576.JavaMail.jira@brutus> Date: Thu, 8 May 2008 08:06:55 -0700 (PDT) From: "B.J. Reed (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Commented: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails In-Reply-To: <1164868970.1210102015591.JavaMail.jira@brutus> 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/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595279#action_12595279 ] B.J. Reed commented on GERONIMODEVTOOLS-342: -------------------------------------------- Actaully, the braces would only be around the next line...so to improve the code, it should be ... public void widgetSelected(SelectionEvent e) { int sel = combo.getSelectionIndex(); IVMInstall vmInstall = null; if (sel > 0) { vmInstall = (IVMInstall) installedJREs.get(sel - 1); } getRuntimeDelegate().setVMInstall(vmInstall); validate(); } I did some investigation about setting to null and took me a whiile last night to track down what's really happening here. Basically, there is an assumption that the default JRE will always be the first item listed in the combo box. I believe that this is a good assumption based on the way that the combo is filled. The rest of the items in the combo come from an array of VM Installs so that combo 1 refers to array item 0 and combo 2 refers to array item 1 (hence the -1 which threw me for a long time). By passing a null into the setVMInstall, the code is essentially saying "don't use the array list, the user specified the default VM" (which isn't in the array list) I do think that adding the { } to the if statement is a good idea and may reduce some further confusion. > Setting the JRE on the Edit Server Runtime panel usually fails > -------------------------------------------------------------- > > Key: GERONIMODEVTOOLS-342 > URL: https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342 > Project: Geronimo-Devtools > Issue Type: Bug > Components: eclipse-plugin > Affects Versions: 2.1.0 > Reporter: Ted Kirby > Assignee: B.J. Reed > Priority: Minor > Fix For: 2.1.1 > > Attachments: GERONIMODEVTOOLS-342.patch > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.