Feature Map Changes -> NPE [message #419779] |
Fri, 06 June 2008 17:41  |
Eclipse User |
|
|
|
Ed et. al.,
I have an NPE issue that hs shown up under 2.4.0.v200805270202 (RC2
Bundle) but doesn't occur under 2.4.0.v200805052017 and earlier. I'm
guessing this is related to something that I've implemented incorrectly
and is finally biting me. In brief, I have an implementation of the
delgated item provider in the book, where directly contained memebers
are grouped together under a tranisient item provider.
Before laying a bug out there, I thought I'd check and see if this
might be the likely case where I've implemnted something incorrectly or
am using a seprecated approach. The error is:
java.lang.NullPointerException
at
org.eclipse.emf.ecore.util.FeatureMapUtil.isFeatureMap(Featu reMapUtil.java:150)
at
org.eclipse.emf.edit.provider.ItemProviderAdapter.getCreateC hildDescription(ItemProviderAdapter.java:1690)
at
org.eclipse.emf.edit.command.CreateChildCommand.getDescripti on(CreateChildCommand.java:326)
at
org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:194)
at
org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
at
org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
at
org.metaabm.ide.MetaABMEditorActionBarContributor.generateCr eateChildActions(MetaABMEditorActionBarContributor.java:420)
at
org.metaabm.ide.MetaABMEditorActionBarContributor.selectionC hanged(MetaABMEditorActionBarContributor.java:371)
at
org.metaabm.ide.MetaABMEditor.setSelection(MetaABMEditor.jav a:1736)
at org.metaabm.ide.MetaABMEditor$8.selectionChanged(MetaABMEdit or.java:856)
The most relevant change I've been able to find is:
685
}
}
1686
1687
Object sibling = selectionObject;
Object sibling = selectionObject;
1688
Object siblingFeature = getChildFeature(owner, sibling);
EStructuralFeature siblingFeature = getChildFeature(owner, sibling);
1689
1690
if (siblingFeature instanceof EStructuralFeature &&
FeatureMapUtil.isFeatureMap((EStructuralFeature)siblingFeatu re))
if (FeatureMapUtil.isFeatureMap(siblingFeature))
1691
{
{
1692
FeatureMap.Entry entry = (FeatureMap.Entry)sibling;
FeatureMap.Entry entry = (FeatureMap.Entry)sibling;
1693
siblingFeature = entry.getEStructuralFeature();
siblingFeature = entry.getEStructuralFeature();
Let me know if you need more info.
|
|
|
|
Re: Feature Map Changes -> NPE [message #419808 is a reply to message #419781] |
Sat, 07 June 2008 01:41   |
Eclipse User |
|
|
|
Done. Can you think of any Q&D work-arounds? I tried returning a new
EAttribute, but that jsut broke a little further downstream..
On 2008-06-06 16:10:05 -0700, Ed Merks <merks@ca.ibm.com> said:
> Miles,
>
> Comments below.
>
>
> Miles Parker wrote:
>> Ed et. al.,
>>
>> I have an NPE issue that hs shown up under 2.4.0.v200805270202 (RC2
>> Bundle) but doesn't occur under 2.4.0.v200805052017 and earlier. I'm
>> guessing this is related to something that I've implemented incorrectly
>> and is finally biting me. In brief, I have an implementation of the
>> delgated item provider in the book, where directly contained memebers
>> are grouped together under a tranisient item provider.
>>
>> Before laying a bug out there, I thought I'd check and see if this
>> might be the likely case where I've implemnted something incorrectly or
>> am using a seprecated approach. The error is:
>>
>> java.lang.NullPointerException
>> at
>> org.eclipse.emf.ecore.util.FeatureMapUtil.isFeatureMap(Featu reMapUtil.java:150)
at
org.eclipse.emf.edit.provider.ItemProviderAdapter.getCreateC hildDescription(ItemProviderAdapter.java:1690)
at
org.eclipse.emf.edit.command.CreateChildCommand.getDescripti on(CreateChildCommand.java:326)
at
org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:194)
at
org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
at
org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
at
org.metaabm.ide.MetaABMEditorActionBarContributor.generateCr eateChildActions(MetaABMEditorActionBarContributor.java:420)
at
org.metaabm.ide.MetaABMEditorActionBarContributor.selectionC hanged(MetaABMEditorActionBarContributor.java:371)
at
org.metaabm.ide.MetaABMEditor.setSelection(MetaABMEditor.jav a:1736)
at
>>
>> org.metaabm.ide.MetaABMEditor$8.selectionChanged(MetaABMEdit or.java:856)
>>
>>
>> The most relevant change I've been able to find is:
>>
>>
>> 685
>> }
>> }
>> 1686
>> 1687
>> Object sibling = selectionObject;
>> Object sibling = selectionObject;
>> 1688
>> Object siblingFeature = getChildFeature(owner, sibling);
>> EStructuralFeature siblingFeature = getChildFeature(owner, sibling);
>> 1689
>> 1690
>> if (siblingFeature instanceof EStructuralFeature &&
>> FeatureMapUtil.isFeatureMap((EStructuralFeature)siblingFeatu re))
> I suppose this acted as a null guard before; something I hadn't
> considered. We should add the null guard in to do this properly.
> Please open a bugzilla and I'll do that.
>> if (FeatureMapUtil.isFeatureMap(siblingFeature))
>> 1691
>> {
>> {
>> 1692
>> FeatureMap.Entry entry = (FeatureMap.Entry)sibling;
>> FeatureMap.Entry entry = (FeatureMap.Entry)sibling;
>> 1693
>> siblingFeature = entry.getEStructuralFeature();
>> siblingFeature = entry.getEStructuralFeature();
>>
>> Let me know if you need more info.
|
|
|
Re: Feature Map Changes -> NPE [message #419810 is a reply to message #419808] |
Sat, 07 June 2008 07:01   |
Eclipse User |
|
|
|
Miles,
I attached the fixed .class to the bugzilla so you could patch the
jar. Returning a new EReference should work better...
Miles Parker wrote:
>
> Done. Can you think of any Q&D work-arounds? I tried returning a new
> EAttribute, but that jsut broke a little further downstream..
>
> On 2008-06-06 16:10:05 -0700, Ed Merks <merks@ca.ibm.com> said:
>
>> Miles,
>>
>> Comments below.
>>
>>
>> Miles Parker wrote:
>>> Ed et. al.,
>>>
>>> I have an NPE issue that hs shown up under 2.4.0.v200805270202 (RC2
>>> Bundle) but doesn't occur under 2.4.0.v200805052017 and earlier.
>>> I'm guessing this is related to something that I've implemented
>>> incorrectly and is finally biting me. In brief, I have an
>>> implementation of the delgated item provider in the book, where
>>> directly contained memebers are grouped together under a tranisient
>>> item provider.
>>>
>>> Before laying a bug out there, I thought I'd check and see if this
>>> might be the likely case where I've implemnted something incorrectly
>>> or am using a seprecated approach. The error is:
>>>
>>> java.lang.NullPointerException
>>> at
>>> org.eclipse.emf.ecore.util.FeatureMapUtil.isFeatureMap(Featu reMapUtil.java:150)
>>>
> at
> org.eclipse.emf.edit.provider.ItemProviderAdapter.getCreateC hildDescription(ItemProviderAdapter.java:1690)
>
> at
> org.eclipse.emf.edit.command.CreateChildCommand.getDescripti on(CreateChildCommand.java:326)
>
> at
> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:194)
>
> at
> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>
> at
> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>
> at
> org.metaabm.ide.MetaABMEditorActionBarContributor.generateCr eateChildActions(MetaABMEditorActionBarContributor.java:420)
>
> at
> org.metaabm.ide.MetaABMEditorActionBarContributor.selectionC hanged(MetaABMEditorActionBarContributor.java:371)
>
> at
> org.metaabm.ide.MetaABMEditor.setSelection(MetaABMEditor.jav a:1736)
> at
>>>
>>> org.metaabm.ide.MetaABMEditor$8.selectionChanged(MetaABMEdit or.java:856)
>>>
>>>
>>>
>>> The most relevant change I've been able to find is:
>>>
>>>
>>> 685
>>> }
>>> }
>>> 1686
>>> 1687
>>> Object sibling = selectionObject;
>>> Object sibling = selectionObject;
>>> 1688
>>> Object siblingFeature = getChildFeature(owner, sibling);
>>> EStructuralFeature siblingFeature = getChildFeature(owner,
>>> sibling);
>>> 1689
>>> 1690
>>> if (siblingFeature instanceof EStructuralFeature &&
>>> FeatureMapUtil.isFeatureMap((EStructuralFeature)siblingFeatu re))
>> I suppose this acted as a null guard before; something I hadn't
>> considered. We should add the null guard in to do this properly.
>> Please open a bugzilla and I'll do that.
>>> if (FeatureMapUtil.isFeatureMap(siblingFeature))
>>> 1691
>>> {
>>> {
>>> 1692
>>> FeatureMap.Entry entry = (FeatureMap.Entry)sibling;
>>> FeatureMap.Entry entry = (FeatureMap.Entry)sibling;
>>> 1693
>>> siblingFeature = entry.getEStructuralFeature();
>>> siblingFeature = entry.getEStructuralFeature();
>>>
>>> Let me know if you need more info.
>
>
|
|
|
Re: Feature Map Changes -> NPE [message #419816 is a reply to message #419810] |
Sat, 07 June 2008 15:05  |
Eclipse User |
|
|
|
On 2008-06-07 04:01:51 -0700, Ed Merks <merks@ca.ibm.com> said:
> Miles,
>
> I attached the fixed .class to the bugzilla so you could patch the jar.
> Returning a new EReference should work better...
Right. :) I just copied the old code into the relevant item provider..
|
|
|
Powered by
FUDForum. Page generated in 3.28169 seconds