|
Re: unexpected null return value from IPluginModelBase.getBundleDescription() [message #57434 is a reply to message #55391] |
Tue, 21 April 2009 18:43 |
No real name 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 |
No real name 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
|
|
|
Powered by
FUDForum. Page generated in 0.03480 seconds