1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-19 23:15: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 a description string or null if not available
*/
public String getDescription() {
ICSourceNotFoundDescription description = (ICSourceNotFoundDescription) element.getAdapter(ICSourceNotFoundDescription.class);
if (description != null)

View file

@ -20,12 +20,11 @@ package org.eclipse.cdt.debug.internal.core.sourcelookup;
public interface ICSourceNotFoundDescription {
/**
* Returns a description of the debug element suitable for
* use by the CSourceNotFoundEditor. This description is then
* used by the editor to inform the user when describing what
* it can't locate source for.
* Returns a description of the debug element suitable for use by the
* CSourceNotFoundEditor. This description is then used by the editor to
* inform the user when describing what 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();

View file

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