1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-20 15:35:24 +02:00

Bug 313821: Intermittent NPE during shutdown, in source-not-found handling

This commit is contained in:
John Cortell 2010-05-20 21:57:16 +00:00
parent a5ad43c3f8
commit 233c76b736
3 changed files with 13 additions and 7 deletions

View file

@ -46,6 +46,9 @@ public class CSourceNotFoundElement {
return file; return file;
} }
/**
* @return a description string or null if not available
*/
public String getDescription() { public String getDescription() {
ICSourceNotFoundDescription description = (ICSourceNotFoundDescription) element.getAdapter(ICSourceNotFoundDescription.class); ICSourceNotFoundDescription description = (ICSourceNotFoundDescription) element.getAdapter(ICSourceNotFoundDescription.class);
if (description != null) if (description != null)

View file

@ -20,12 +20,11 @@ package org.eclipse.cdt.debug.internal.core.sourcelookup;
public interface ICSourceNotFoundDescription { public interface ICSourceNotFoundDescription {
/** /**
* Returns a description of the debug element suitable for * Returns a description of the debug element suitable for use by the
* use by the CSourceNotFoundEditor. This description is then * CSourceNotFoundEditor. This description is then used by the editor to
* used by the editor to inform the user when describing what * inform the user when describing what it can't locate source for.
* it can't locate source for.
* *
* @return the description of the debug element. * @return the description of the debug element, or null if not available
*/ */
String getDescription(); String getDescription();

View file

@ -22,8 +22,12 @@ public class CSourceNotFoundEditorInput extends CommonSourceNotFoundEditorInput
@Override @Override
public String getName() { public String getName() {
if (getArtifact() instanceof CSourceNotFoundElement) if (getArtifact() instanceof CSourceNotFoundElement) {
return ((CSourceNotFoundElement)getArtifact()).getDescription(); String description = ((CSourceNotFoundElement)getArtifact()).getDescription();
if (description != null) {
return description;
}
}
return super.getName(); return super.getName();
} }