mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
2004-07-06 Chris Wiebe
This patch prevents some NPEs from happening in the class browser. I suggest this should be applied to both HEAD and CDT_2_0 branch. * browser/org/eclipse/cdt/core/browser/TypeInfo.java
This commit is contained in:
parent
7d99be71a5
commit
2b5f813e6b
2 changed files with 11 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2004-07-06 Chris Wiebe
|
||||||
|
|
||||||
|
This patch prevents some NPEs from happening in the class browser. I
|
||||||
|
suggest this should be applied to both HEAD and CDT_2_0 branch.
|
||||||
|
|
||||||
|
* browser/org/eclipse/cdt/core/browser/TypeInfo.java
|
||||||
|
|
||||||
2004-06-22 Alain Magloire
|
2004-06-22 Alain Magloire
|
||||||
Part of PR 68246.
|
Part of PR 68246.
|
||||||
Close the inputstream to release resource handle
|
Close the inputstream to release resource handle
|
||||||
|
|
|
@ -58,7 +58,10 @@ public class TypeInfo implements ITypeInfo
|
||||||
ITypeReference ref = getResolvedReference();
|
ITypeReference ref = getResolvedReference();
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
ICElement[] elems = ref.getCElements();
|
ICElement[] elems = ref.getCElements();
|
||||||
if (elems.length > 1) {
|
if (elems != null && elems.length > 0) {
|
||||||
|
if (elems.length == 1)
|
||||||
|
return elems[0];
|
||||||
|
|
||||||
for (int i = 0; i < elems.length; ++i) {
|
for (int i = 0; i < elems.length; ++i) {
|
||||||
ICElement elem = elems[i];
|
ICElement elem = elems[i];
|
||||||
if (elem.getElementType() == fElementType && elem.getElementName().equals(getName())) {
|
if (elem.getElementType() == fElementType && elem.getElementName().equals(getName())) {
|
||||||
|
@ -66,8 +69,6 @@ public class TypeInfo implements ITypeInfo
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (elems.length == 1) {
|
|
||||||
return elems[0];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue