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