geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Kirby (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails
Date Thu, 08 May 2008 14:30:55 GMT

    [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595264#action_12595264
] 

tkirby edited comment on GERONIMODEVTOOLS-342 at 5/8/08 7:30 AM:
--------------------------------------------------------------------

Thanks, BJ.  That works for me!

I am wondering about this code:

{code:java}
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();
                                       }
{code:java}

I know you did not originally write the code, but don't our coding conventions say to use
{} for if statements?

My real question is, do we want to set the vm to null if there is no selection?

I thus propose:
{code:java}
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();
                                           }
                                       }
{code:java}
Possibly the validate could happen unconditionally.

Thoughts?

      was (Author: tkirby):
    Thanks, BJ.  That works for me!

I am wondering about this code:

{code:java}
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();
                                       }
{code:java}

I know you did not originally write the code, but don't our coding conventions say to use
{} for if statements?

My real question is, do we want to set the vm to null if there is no selection?

I thus propose:
{code}
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();
                                           }
                                       }
{code}
Possibly the validate could happen unconditionally.

Thoughts?
  
> 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.


Mime
View raw message