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. * src/org/eclipse/cdt/internal/ui/viewsupport/CElementLabels.java
This commit is contained in:
parent
2b5f813e6b
commit
cc22c316de
2 changed files with 17 additions and 5 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.
|
||||
|
||||
* src/org/eclipse/cdt/internal/ui/viewsupport/CElementLabels.java
|
||||
|
||||
2004-07-06 Hoda Amer
|
||||
Fix for PR 69330 : Outline is flickering.
|
||||
|
||||
|
|
|
@ -326,9 +326,12 @@ public class CElementLabels {
|
|||
|
||||
//qualification
|
||||
if( getFlag( flags, M_FULLY_QUALIFIED ) ){
|
||||
getTypeLabel( method.getParent(), T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf );
|
||||
ICElement parent = method.getParent();
|
||||
if (parent != null && parent.exists()) {
|
||||
getTypeLabel( parent, T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf );
|
||||
buf.append( "::" ); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
buf.append( method.getElementName() );
|
||||
|
||||
|
@ -455,10 +458,12 @@ public class CElementLabels {
|
|||
public static void getTypeLabel(ICElement elem, int flags, StringBuffer buf) {
|
||||
if (getFlag(flags, T_FULLY_QUALIFIED)) {
|
||||
ISourceRoot root= CModelUtil.getSourceRoot(elem);
|
||||
if (root != null) {
|
||||
getSourceRootLabel(root, (flags & P_COMPRESSED), buf);
|
||||
buf.append(root.getElementName());
|
||||
buf.append('.');
|
||||
}
|
||||
}
|
||||
|
||||
String typeName= elem.getElementName();
|
||||
if (typeName.length() == 0) { // anonymous
|
||||
|
|
Loading…
Add table
Reference in a new issue