You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Nicolas Lalevée (JIRA)" <ji...@apache.org> on 2008/11/18 17:17:44 UTC

[jira] Created: (IVYDE-133) The decorators can throw a NPE at startup

The decorators can throw a NPE at startup
-----------------------------------------

                 Key: IVYDE-133
                 URL: https://issues.apache.org/jira/browse/IVYDE-133
             Project: IvyDE
          Issue Type: Bug
    Affects Versions: 2.0
            Reporter: Nicolas Lalevée
            Assignee: Nicolas Lalevée
            Priority: Minor


When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
{noformat}
java.lang.NullPointerException
        at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
        at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
        at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
{noformat}

This may be due to the way the decorator listeners are accessed.

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


[jira] Commented: (IVYDE-133) The decorators can throw a NPE at startup

Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVYDE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653233#action_12653233 ] 

Nicolas Lalevée commented on IVYDE-133:
---------------------------------------

Thanks for looking into it Matt. Effectivelly the code is badly assuming an order of loading.
Althouth your solution will avoid the NPE, but we will loose the notifications. IvyDE should probably buffer the non transmitted status when the decorator is not yet there, and as soon as it has been loaded, fire the pending changes.

> The decorators can throw a NPE at startup
> -----------------------------------------
>
>                 Key: IVYDE-133
>                 URL: https://issues.apache.org/jira/browse/IVYDE-133
>             Project: IvyDE
>          Issue Type: Bug
>    Affects Versions: 2.0.0.beta1
>            Reporter: Nicolas Lalevée
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: 2.0.0.final
>
>
> When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
> {noformat}
> java.lang.NullPointerException
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> {noformat}
> This may be due to the way the decorator listeners are accessed.

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


[jira] Commented: (IVYDE-133) The decorators can throw a NPE at startup

Posted by "Matt Goldspink (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVYDE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651956#action_12651956 ] 

Matt Goldspink commented on IVYDE-133:
--------------------------------------

I hit this error this morning when starting up Eclipse with 2.0.0.beta1. I don't think the statement: "When launching Eclipse, and if there are some failing resolve job" is correct because the code in the IvyClasspathContainerConfiguration.setConfStatus() method says: 

            if (e != null) {
                setResolveStatus(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR, e
                        .getMessage(), e.getCause()));
            } else {
                setResolveStatus(Status.OK_STATUS); <!--- So it sets the status when its ok
            }

I did a bit of debugging and it looks like the line:

           IvyPlugin.getDefault().getContainerDecorator().statusChaged(this);

throws the null pointer and its because the call to getContainerDecoractor() is returning null. The reason is because Eclipse hasn't yet initialized that part of the plugin because none of the projects are expanded yet. Is it possible to just add a simple check to change the above line to be:

           IvyClasspathContainerDecorator decorator = IvyPlugin.getDefault().getContainerDecorator();
           if (decorator != null) {
                    decorator.statusChaged(this);
           }

Matt


> The decorators can throw a NPE at startup
> -----------------------------------------
>
>                 Key: IVYDE-133
>                 URL: https://issues.apache.org/jira/browse/IVYDE-133
>             Project: IvyDE
>          Issue Type: Bug
>    Affects Versions: 2.0.0.beta1
>            Reporter: Nicolas Lalevée
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: 2.0.0.final
>
>
> When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
> {noformat}
> java.lang.NullPointerException
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> {noformat}
> This may be due to the way the decorator listeners are accessed.

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


[jira] Resolved: (IVYDE-133) The decorators can throw a NPE at startup

Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVYDE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Lalevée resolved IVYDE-133.
-----------------------------------

    Resolution: Fixed

I fixed it by removing the error marker on the classpath container: it will be now set on the parent project

> The decorators can throw a NPE at startup
> -----------------------------------------
>
>                 Key: IVYDE-133
>                 URL: https://issues.apache.org/jira/browse/IVYDE-133
>             Project: IvyDE
>          Issue Type: Bug
>    Affects Versions: 2.0.0.beta1
>            Reporter: Nicolas Lalevée
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: 2.0.0.final
>
>
> When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
> {noformat}
> java.lang.NullPointerException
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> {noformat}
> This may be due to the way the decorator listeners are accessed.

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


[jira] Commented: (IVYDE-133) The decorators can throw a NPE at startup

Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVYDE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660084#action_12660084 ] 

Nicolas Lalevée commented on IVYDE-133:
---------------------------------------

I have also just found out that it is triggering the resolve process twice at Eclipse startup. Not sure who is the guilty here, but illegally accessing some internal classes of the JDT is probably a good suspect.

> The decorators can throw a NPE at startup
> -----------------------------------------
>
>                 Key: IVYDE-133
>                 URL: https://issues.apache.org/jira/browse/IVYDE-133
>             Project: IvyDE
>          Issue Type: Bug
>    Affects Versions: 2.0.0.beta1
>            Reporter: Nicolas Lalevée
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: 2.0.0.final
>
>
> When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
> {noformat}
> java.lang.NullPointerException
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> {noformat}
> This may be due to the way the decorator listeners are accessed.

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


[jira] Commented: (IVYDE-133) The decorators can throw a NPE at startup

Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVYDE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660050#action_12660050 ] 

Nicolas Lalevée commented on IVYDE-133:
---------------------------------------

The more I look into this, the more I see that kind of problem marker is a hack to work around that the JDT API doesn't provide extended management of classpath containers.
The IvyClasspathContainerDecorator is actually trying to redo what exist for IResource (classpath containers are not IResource): org.eclipse.jdt.ui.ProblemsLabelDecorator.
I think a more proper solution will be to use the already existing marker management, and then more than trying to put an error marker on the classpath container, the error marker will on the java project containing the problematic classpath container.
If there is no objection, I will change it.

> The decorators can throw a NPE at startup
> -----------------------------------------
>
>                 Key: IVYDE-133
>                 URL: https://issues.apache.org/jira/browse/IVYDE-133
>             Project: IvyDE
>          Issue Type: Bug
>    Affects Versions: 2.0.0.beta1
>            Reporter: Nicolas Lalevée
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: 2.0.0.final
>
>
> When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
> {noformat}
> java.lang.NullPointerException
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> {noformat}
> This may be due to the way the decorator listeners are accessed.

-- 
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: (IVYDE-133) The decorators can throw a NPE at startup

Posted by "Matt Goldspink (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVYDE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651956#action_12651956 ] 

mattgoldspink edited comment on IVYDE-133 at 12/1/08 2:13 AM:
---------------------------------------------------------------

I hit this error this morning when starting up Eclipse with 2.0.0.beta1. I don't think the statement: "When launching Eclipse, and if there are some failing resolve job" is correct because the code in the IvyClasspathContainerConfiguration.setConfStatus() method says: 

{code:java}
            if (e != null) {
                setResolveStatus(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR, e
                        .getMessage(), e.getCause()));
            } else {
                setResolveStatus(Status.OK_STATUS); <!--- So it sets the status when its ok
            }
{code} 

I did a bit of debugging and it looks like the line:

{code:java}
           IvyPlugin.getDefault().getContainerDecorator().statusChaged(this);
{code}

throws the null pointer and its because the call to getContainerDecoractor() is returning null. The reason is because Eclipse hasn't yet initialized that part of the plugin because none of the projects are expanded yet. Is it possible to just add a simple check to change the above line to be:

{code:java}
           IvyClasspathContainerDecorator decorator = IvyPlugin.getDefault().getContainerDecorator();
           if (decorator != null) {
                    decorator.statusChaged(this);
           }
{code}

Matt


      was (Author: mattgoldspink):
    I hit this error this morning when starting up Eclipse with 2.0.0.beta1. I don't think the statement: "When launching Eclipse, and if there are some failing resolve job" is correct because the code in the IvyClasspathContainerConfiguration.setConfStatus() method says: 

            if (e != null) {
                setResolveStatus(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR, e
                        .getMessage(), e.getCause()));
            } else {
                setResolveStatus(Status.OK_STATUS); <!--- So it sets the status when its ok
            }

I did a bit of debugging and it looks like the line:

           IvyPlugin.getDefault().getContainerDecorator().statusChaged(this);

throws the null pointer and its because the call to getContainerDecoractor() is returning null. The reason is because Eclipse hasn't yet initialized that part of the plugin because none of the projects are expanded yet. Is it possible to just add a simple check to change the above line to be:

           IvyClasspathContainerDecorator decorator = IvyPlugin.getDefault().getContainerDecorator();
           if (decorator != null) {
                    decorator.statusChaged(this);
           }

Matt

  
> The decorators can throw a NPE at startup
> -----------------------------------------
>
>                 Key: IVYDE-133
>                 URL: https://issues.apache.org/jira/browse/IVYDE-133
>             Project: IvyDE
>          Issue Type: Bug
>    Affects Versions: 2.0.0.beta1
>            Reporter: Nicolas Lalevée
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: 2.0.0.final
>
>
> When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
> {noformat}
> java.lang.NullPointerException
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> {noformat}
> This may be due to the way the decorator listeners are accessed.

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


[jira] Updated: (IVYDE-133) The decorators can throw a NPE at startup

Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVYDE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Lalevée updated IVYDE-133:
----------------------------------

    Fix Version/s: 2.0.0.final

> The decorators can throw a NPE at startup
> -----------------------------------------
>
>                 Key: IVYDE-133
>                 URL: https://issues.apache.org/jira/browse/IVYDE-133
>             Project: IvyDE
>          Issue Type: Bug
>    Affects Versions: 2.0.0.beta1
>            Reporter: Nicolas Lalevée
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: 2.0.0.final
>
>
> When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
> {noformat}
> java.lang.NullPointerException
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> {noformat}
> This may be due to the way the decorator listeners are accessed.

-- 
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: (IVYDE-133) The decorators can throw a NPE at startup

Posted by "Matt Goldspink (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVYDE-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651956#action_12651956 ] 

mattgoldspink edited comment on IVYDE-133 at 12/1/08 2:14 AM:
---------------------------------------------------------------

I hit this error this morning when starting up Eclipse with 2.0.0.beta1. I don't think the statement: "When launching Eclipse, and if there are some failing resolve job" is correct because the code in the IvyClasspathContainerConfiguration.setConfStatus() method says: 

{code:java}
            if (e != null) {
                setResolveStatus(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR, e
                        .getMessage(), e.getCause()));
            } else {
                setResolveStatus(Status.OK_STATUS); <!--- So it sets the status when its ok
            }
{code} 

which shows that this method is called everytime, not just when there is an error. I did a bit of debugging and it looks like the line:

{code:java}
           IvyPlugin.getDefault().getContainerDecorator().statusChaged(this);
{code}

throws the null pointer and its because the call to getContainerDecoractor() is returning null. The reason is because Eclipse hasn't yet initialized that part of the plugin because none of the projects are expanded yet. Is it possible to just add a simple check to change the above line to be:

{code:java}
           IvyClasspathContainerDecorator decorator = IvyPlugin.getDefault().getContainerDecorator();
           if (decorator != null) {
                    decorator.statusChaged(this);
           }
{code}

Matt


      was (Author: mattgoldspink):
    I hit this error this morning when starting up Eclipse with 2.0.0.beta1. I don't think the statement: "When launching Eclipse, and if there are some failing resolve job" is correct because the code in the IvyClasspathContainerConfiguration.setConfStatus() method says: 

{code:java}
            if (e != null) {
                setResolveStatus(new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR, e
                        .getMessage(), e.getCause()));
            } else {
                setResolveStatus(Status.OK_STATUS); <!--- So it sets the status when its ok
            }
{code} 

I did a bit of debugging and it looks like the line:

{code:java}
           IvyPlugin.getDefault().getContainerDecorator().statusChaged(this);
{code}

throws the null pointer and its because the call to getContainerDecoractor() is returning null. The reason is because Eclipse hasn't yet initialized that part of the plugin because none of the projects are expanded yet. Is it possible to just add a simple check to change the above line to be:

{code:java}
           IvyClasspathContainerDecorator decorator = IvyPlugin.getDefault().getContainerDecorator();
           if (decorator != null) {
                    decorator.statusChaged(this);
           }
{code}

Matt

  
> The decorators can throw a NPE at startup
> -----------------------------------------
>
>                 Key: IVYDE-133
>                 URL: https://issues.apache.org/jira/browse/IVYDE-133
>             Project: IvyDE
>          Issue Type: Bug
>    Affects Versions: 2.0.0.beta1
>            Reporter: Nicolas Lalevée
>            Assignee: Nicolas Lalevée
>            Priority: Minor
>             Fix For: 2.0.0.final
>
>
> When launching Eclipse, and if there are some failing resolve job, a NPE can be raised:
> {noformat}
> java.lang.NullPointerException
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
>         at org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
>         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> {noformat}
> This may be due to the way the decorator listeners are accessed.

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