1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Fixin NPE in BaseCElementContentProvider

This commit is contained in:
Alain Magloire 2004-02-29 00:39:24 +00:00
parent f977490590
commit a010158135
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,13 @@
2004-02-28 Alain Magloire
Fixing a NPE.
java.lang.NullPointerException
at org.eclipse.cdt.internal.core.model.Parent.getChildren(Parent.java:47)
at org.eclipse.cdt.internal.ui.BaseCElementContentProvider.getChildren(BaseCElementContentProvider.java:139)
at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(AbstractTreeViewer.java:729)
* src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
2004-02-27 Hoda Amer
Fixed [Bug 53074] The CView to update with each reconcile
Added the ability for CView to update based on the translation unit working copy

View file

@ -134,9 +134,11 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
// if it is not already a working copy
if(!(celement instanceof IWorkingCopy)){
// if it has a valid working copy
IWorkingCopy copy = CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy((ITranslationUnit)celement);
if(copy != null)
ITranslationUnit tu = (ITranslationUnit)celement;
IWorkingCopy copy = tu.findSharedWorkingCopy(CUIPlugin.getBufferFactory());
if(copy != null) {
return ((IParent)copy).getChildren();
}
}
}
return ((IParent)celement).getChildren();