Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java
index 06c261d6377..fdea5db0a10 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java
@@ -16,6 +16,7 @@ import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.internal.ui.CodanUIMessages;
import org.eclipse.cdt.core.model.ICContainer;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -46,11 +47,12 @@ public class RunCodeAnalysis implements IObjectActionDelegate {
return Status.CANCEL_STATUS;
for (Iterator iterator = ss.iterator(); iterator.hasNext();) {
Object o = iterator.next();
-
if (o instanceof ICContainer) {
o = ((ICContainer) o).getResource();
}
-
+ if (o instanceof IAdaptable) {
+ o = ((IAdaptable) o).getAdapter(IResource.class);
+ }
if (o instanceof IResource) {
IResource res = (IResource) o;
SubProgressMonitor subMon = new SubProgressMonitor(

Back to the top