You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Ted Kirby (JIRA)" <ji...@apache.org> on 2008/05/06 21:26:55 UTC

[jira] Created: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

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: Tim McConnell
            Priority: Minor
             Fix For: 2.1.1




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


[jira] Updated: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "B.J. Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

B.J. Reed updated GERONIMODEVTOOLS-342:
---------------------------------------

    Attachment: GERONIMODEVTOOLS-342b.patch

Originally, I didn't want to mess up the style of the code by adding some comments to it :)  This patch replaces the first one and has 2 sets of block comments relating to the relationship between the combo and the underlying JRE array list.  No real code difference between this and the first one.

> 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-342b.patch
>
>


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


[jira] Commented: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "Ted Kirby (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595264#action_12595264 ] 

Ted Kirby commented on GERONIMODEVTOOLS-342:
--------------------------------------------

Thanks, BJ.  That works for me!

I am wondering about this code:

{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}

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.


[jira] Resolved: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "Tim McConnell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim McConnell resolved GERONIMODEVTOOLS-342.
--------------------------------------------

    Resolution: Fixed

Works great. Tested the patch by switching between three JREs: 1.4, 1.5, and 1.6. As expected, server starts fine with 1.5 and 1.6 but not with 1.4. Thanks to BJ Reed for the patch and the code comments explaining how it works. Applied with Revision 654831.

> 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-342b.patch
>
>


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


[jira] Issue Comment Edited: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "Ted Kirby (JIRA)" <ji...@apache.org>.
    [ 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:29 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}
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?

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

I am wondering about this code:

{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}

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.


[jira] Issue Comment Edited: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "Ted Kirby (JIRA)" <ji...@apache.org>.
    [ 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:31 AM:
--------------------------------------------------------------------

Thanks, BJ.  That works for me!

I am wondering about this code:

{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}

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?

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


[jira] Commented: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "B.J. Reed (JIRA)" <ji...@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.


[jira] Commented: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "Ted Kirby (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595266#action_12595266 ] 

Ted Kirby commented on GERONIMODEVTOOLS-342:
--------------------------------------------

Also, why don't my {code} tags work above?

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


[jira] Updated: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "B.J. Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

B.J. Reed updated GERONIMODEVTOOLS-342:
---------------------------------------

    Attachment: GERONIMODEVTOOLS-342.patch

In the selection listener for the combo box, it appears that we were setting the VMInstall of the GeronimoRuntime instead of the RuntimeDelegate.  Please try this patch with a one line change to see if it helps.

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


[jira] Issue Comment Edited: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "Ted Kirby (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "Tim McConnell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim McConnell updated GERONIMODEVTOOLS-342:
-------------------------------------------

    Assignee: B.J. Reed  (was: Tim McConnell)

Per Ted, if you try to use a 1.4 JRE the server will fail, then you cannot change it to something other than 1.4.....

> 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
>
>


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


[jira] Commented: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "Ted Kirby (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595353#action_12595353 ] 

Ted Kirby commented on GERONIMODEVTOOLS-342:
--------------------------------------------

Thanks for the explanation.  It sounds good.  Can we get some of it as
a comment in the code?



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


[jira] Updated: (GERONIMODEVTOOLS-342) Setting the JRE on the Edit Server Runtime panel usually fails

Posted by "B.J. Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

B.J. Reed updated GERONIMODEVTOOLS-342:
---------------------------------------

    Attachment:     (was: GERONIMODEVTOOLS-342.patch)

> 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-342b.patch
>
>


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