[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] BinaryContainer fix
|
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.51
diff -u -r1.51 ChangeLog
--- ChangeLog 19 Dec 2002 19:20:57 -0000 1.51
+++ ChangeLog 19 Dec 2002 20:49:22 -0000
@@ -1,5 +1,11 @@
2002-12-19 Alain Magloire
+ * model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java (getFile):
+ Check getParent() it may return null.
+ (getFolder): Check getParent(), it may return null.
+
+2002-12-19 Alain Magloire
+
* src/org/eclipse/cdt/core/ErrorParserManager.java (findFilePath):
The workspace will throw an Exception if the file
is not within the workspace, catch it.
Index: model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java,v
retrieving revision 1.3
diff -u -r1.3 BinaryContainerAdapter.java
--- model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java 13 Dec 2002 14:55:42 -0000 1.3
+++ model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java 19 Dec 2002 20:49:22 -0000
@@ -137,11 +137,14 @@
if (f == null) {
// Pass it to parent to create a fake/phantom if the object
// is not in the archive.
- f = getParent().getFile(path);
- // Add it to the list of phantoms
- if (! phantomResources.contains(f)) {
- phantomResources.add(f);
- phantomResources.trimToSize();
+ IContainer container = getParent();
+ if (container != null) {
+ f = container.getFile(path);
+ // Add it to the list of phantoms
+ if (! phantomResources.contains(f)) {
+ phantomResources.add(f);
+ phantomResources.trimToSize();
+ }
}
}
return f;
@@ -176,10 +179,14 @@
public IFolder getFolder(IPath path) {
// Only Files in the archive pass this to the parent
// to create a phatom resource
- IFolder f = getParent().getFolder(path);
- if (!phantomResources.contains(f)) {
- phantomResources.add(f);
- phantomResources.trimToSize();
+ IFolder f = null;
+ IContainer container = getParent();
+ if (container != null) {
+ f = container.getFolder(path);
+ if (!phantomResources.contains(f)) {
+ phantomResources.add(f);
+ phantomResources.trimToSize();
+ }
}
return f;
}