Bug 560579: Deprecated modules should deprecate all methods and fields
fix classcast error
Change-Id: I38dc388b1add6d710787ca9aebd5318c09f235c0
diff --git a/plugins/org.eclipse.ease.ui/src/org/eclipse/ease/ui/modules/ui/ModulesLabelProvider.java b/plugins/org.eclipse.ease.ui/src/org/eclipse/ease/ui/modules/ui/ModulesLabelProvider.java
index 2d6da3b..7e04340 100644
--- a/plugins/org.eclipse.ease.ui/src/org/eclipse/ease/ui/modules/ui/ModulesLabelProvider.java
+++ b/plugins/org.eclipse.ease.ui/src/org/eclipse/ease/ui/modules/ui/ModulesLabelProvider.java
@@ -14,7 +14,6 @@
package org.eclipse.ease.ui.modules.ui;
-import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -102,8 +101,11 @@
if (element instanceof ModuleDefinition)
return ((ModuleDefinition) element).isDeprecated();
- if (element instanceof AccessibleObject)
- return ModuleHelper.isDeprecated((AccessibleObject) element) || (((Method) element).getDeclaringClass().getAnnotation(Deprecated.class) != null);
+ if (element instanceof Method)
+ return ModuleHelper.isDeprecated((Method) element) || (((Method) element).getDeclaringClass().getAnnotation(Deprecated.class) != null);
+
+ if (element instanceof Field)
+ return ModuleHelper.isDeprecated((Field) element) || (((Field) element).getDeclaringClass().getAnnotation(Deprecated.class) != null);
return false;
}