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:
parent
a5ad43c3f8
commit
233c76b736
3 changed files with 13 additions and 7 deletions
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue