Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » unexpected null return value from IPluginModelBase.getBundleDescription()
unexpected null return value from IPluginModelBase.getBundleDescription() [message #55391] Wed, 15 April 2009 20:52 Go to next message
No real name is currently offline No real nameFriend
Messages: 6
Registered: July 2009
Junior Member
Hi all,

Someone on the equinox newsgroup suggested I post this here. We're
running Eclipse in headless mode and computing classpaths for plugin
projects via BundleDescriptions. On some runs, we unexpectedly get null
as the return value from a call to
IPluginModelBase.getBundleDescription(). Here is the code:


private IPluginModelBase findModel(IProject p) {
return PDECore.getDefault().getModelManager().findModel(p);
}

IProject p = ...;
BundleDescription bd = findModel(p).getBundleDescription();

The documentation says that null can be returned if the project is in a
classic format, but we know that's not the case here since most of the
time getBundleDescription() works correctly and returns a non-null value.
Our guess is that we're hitting some kind of race condition, but I tried
running the above code in a Job that locks the whole workspace, and we
still saw the problem. I searched Bugzilla and didn't see anything
directly relevant. Any advice on this issue would be very welcome.
Thanks!

Best,
Manu
Re: unexpected null return value from IPluginModelBase.getBundleDescription() [message #57434 is a reply to message #55391] Tue, 21 April 2009 18:43 Go to previous message
No real name is currently offline No real nameFriend
Messages: 6
Registered: July 2009
Junior Member
Just another query on the issue below. We've resorted to sleeping and
trying again a few times to try to always get a non-null return value from
getBundleDescription() when it behaves strangely. The fact that this
works (sometimes) strongly indicates this is a race condition. If there
is some job we should be waiting on or lock we should be acquiring before
calling getBundleDescription(), please let me know. Otherwise, I will
just file a bug.

Best,
Manu

Manu Sridharan wrote:

> Hi all,

> Someone on the equinox newsgroup suggested I post this here. We're
> running Eclipse in headless mode and computing classpaths for plugin
> projects via BundleDescriptions. On some runs, we unexpectedly get null
> as the return value from a call to
> IPluginModelBase.getBundleDescription(). Here is the code:


> private IPluginModelBase findModel(IProject p) {
> return PDECore.getDefault().getModelManager().findModel(p);
> }

> IProject p = ...;
> BundleDescription bd = findModel(p).getBundleDescription();

> The documentation says that null can be returned if the project is in a
> classic format, but we know that's not the case here since most of the
> time getBundleDescription() works correctly and returns a non-null value.
> Our guess is that we're hitting some kind of race condition, but I tried
> running the above code in a Job that locks the whole workspace, and we
> still saw the problem. I searched Bugzilla and didn't see anything
> directly relevant. Any advice on this issue would be very welcome.
> Thanks!

> Best,
> Manu
Re: unexpected null return value from IPluginModelBase.getBundleDescription() [message #596007 is a reply to message #55391] Tue, 21 April 2009 18:43 Go to previous message
No real name is currently offline No real nameFriend
Messages: 6
Registered: July 2009
Junior Member
Just another query on the issue below. We've resorted to sleeping and
trying again a few times to try to always get a non-null return value from
getBundleDescription() when it behaves strangely. The fact that this
works (sometimes) strongly indicates this is a race condition. If there
is some job we should be waiting on or lock we should be acquiring before
calling getBundleDescription(), please let me know. Otherwise, I will
just file a bug.

Best,
Manu

Manu Sridharan wrote:

> Hi all,

> Someone on the equinox newsgroup suggested I post this here. We're
> running Eclipse in headless mode and computing classpaths for plugin
> projects via BundleDescriptions. On some runs, we unexpectedly get null
> as the return value from a call to
> IPluginModelBase.getBundleDescription(). Here is the code:


> private IPluginModelBase findModel(IProject p) {
> return PDECore.getDefault().getModelManager().findModel(p);
> }

> IProject p = ...;
> BundleDescription bd = findModel(p).getBundleDescription();

> The documentation says that null can be returned if the project is in a
> classic format, but we know that's not the case here since most of the
> time getBundleDescription() works correctly and returns a non-null value.
> Our guess is that we're hitting some kind of race condition, but I tried
> running the above code in a Job that locks the whole workspace, and we
> still saw the problem. I searched Bugzilla and didn't see anything
> directly relevant. Any advice on this issue would be very welcome.
> Thanks!

> Best,
> Manu
Previous Topic:How to manually mark editor dirty?
Next Topic:Headless RCP Product Export
Goto Forum:
  


Current Time: Thu Apr 25 17:58:06 GMT 2024

Powered by FUDForum. Page generated in 5.04010 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top