Buggy code:
public class ActionExpression { public static final String EXP_TYPE_OR = "or" ; public static final String EXP_TYPE_AND = "and" ; public static final String EXP_TYPE_NOT = "not" ; public static final String EXP_TYPE_OBJECT_STATE = "objectState" ; public static final String EXP_TYPE_OBJECT_CLASS = "objectClass" ; public static final String EXP_TYPE_PLUG_IN_STATE = "pluginState" ; public static final String EXP_TYPE_SYSTEM_PROPERTY = "systemProperty" ; private static final String ATT_NAME = "name" ; private static final String ATT_VALUE = "value" ; private static final String ATT_ID = "id" ; private static final String PLUGIN_INSTALLED = "installed" ; private static final String PLUGIN_ACTIVATED = "activated" ; private ActionExpression . SingleExpression root ; public ActionExpression ( IConfigurationElement element ) { } public ActionExpression ( String expressionType , String expressionValue ) { } public boolean isEnabledFor ( Object object ) { if ( ( root ) == null ) return false ; return root . isEnabledFor ( object ) ; } public boolean isEnabledForExpression ( Object object , String expressionType ) { } public boolean isEnabledFor ( IStructuredSelection selection ) { } private static ActionExpression . AbstractExpression createExpression ( IConfigurationElement element ) throws IllegalStateException { } private abstract static class AbstractExpression { public abstract boolean isEnabledFor ( Object object ) ; public boolean isEnabledForExpression ( Object object , String expressionType ) { } } private abstract static class CompositeExpression extends ActionExpression . AbstractExpression { protected ArrayList list ; public CompositeExpression ( IConfigurationElement element ) throws IllegalStateException { } public boolean isEnabledForExpression ( Object object , String expressionType ) { } } private static class SingleExpression extends ActionExpression . AbstractExpression { private ActionExpression . AbstractExpression child ; public SingleExpression ( IConfigurationElement element ) throws IllegalStateException { } public SingleExpression ( ActionExpression . AbstractExpression expression ) throws IllegalStateException { } public boolean isEnabledFor ( Object object ) { return child . isEnabledFor ( object ) ; } public boolean isEnabledForExpression ( Object object , String expressionType ) { } } private static class NotExpression extends ActionExpression . SingleExpression { public NotExpression ( IConfigurationElement element ) throws IllegalStateException { } public boolean isEnabledFor ( Object object ) { return ! ( super . isEnabledFor ( object ) ) ; } } private static class OrExpression extends ActionExpression . CompositeExpression { public OrExpression ( IConfigurationElement element ) throws IllegalStateException { } public boolean isEnabledFor ( Object object ) { Iterator iter = list . iterator ( ) ; while ( iter . hasNext ( ) ) { ActionExpression . AbstractExpression expr = ( ( ActionExpression . AbstractExpression ) ( iter . next ( ) ) ) ; if ( expr . isEnabledFor ( object ) ) return true ; } return false ; } } private static class AndExpression extends ActionExpression . CompositeExpression { public AndExpression ( IConfigurationElement element ) throws IllegalStateException { } public boolean isEnabledFor ( Object object ) { Iterator iter = list . iterator ( ) ; while ( iter . hasNext ( ) ) { ActionExpression . AbstractExpression expr = ( ( ActionExpression . AbstractExpression ) ( iter . next ( ) ) ) ; if ( ! ( expr . isEnabledFor ( object ) ) ) return false ; } return true ; } } private static class ObjectStateExpression extends ActionExpression . AbstractExpression { private String name ; private String value ; public ObjectStateExpression ( IConfigurationElement element ) throws IllegalStateException { } public boolean isEnabledFor ( Object object ) { if ( object == null ) { return false ; } if ( preciselyMatches ( object ) ) { return true ; } <START_BUG> Class resourceClass = ObjectContributorManager . getResourceClass ( ) ; <END_BUG> if ( resourceClass == null ) { return false ; } if ( resourceClass . isInstance ( object ) ) { return false ; } else { Object res = null ; if ( object instanceof IAdaptable ) { res = ( ( IAdaptable ) ( object ) ) . getAdapter ( resourceClass ) ; } if ( res == null ) { return false ; } return preciselyMatches ( res ) ; } } private boolean preciselyMatches ( Object object ) { } private IActionFilter getActionFilter ( Object object ) { } } private static class ObjectClassExpression extends ActionExpression . AbstractExpression { private String className ; public ObjectClassExpression ( IConfigurationElement element ) throws IllegalStateException { } public ObjectClassExpression ( String className ) { } public boolean isEnabledFor ( Object object ) { if ( object == null ) return false ; Class clazz = object . getClass ( ) ; while ( clazz != null ) { if ( clazz . getName ( ) . equals ( className ) ) return true ; Class [ ] interfaces = clazz . getInterfaces ( ) ; for ( int i = 0 ; i < ( interfaces . length ) ; i ++ ) { if ( interfaces [ i ] . getName ( ) . equals ( className ) ) return true ; } clazz = clazz . getSuperclass ( ) ; } return false ; } public boolean isEnabledForExpression ( Object object , String expressionType ) { } } private static class PluginStateExpression extends ActionExpression . AbstractExpression { private String id ; private String value ; public PluginStateExpression ( IConfigurationElement element ) throws IllegalStateException { } public boolean isEnabledFor ( Object object ) { IPluginDescriptor desc = Platform . getPluginRegistry ( ) . getPluginDescriptor ( id ) ; if ( desc == null ) return false ; if ( value . equals ( ActionExpression . PLUGIN_INSTALLED ) ) return true ; if ( value . equals ( ActionExpression . PLUGIN_ACTIVATED ) ) return desc . isPluginActivated ( ) ; return false ; } } private static class SystemPropertyExpression extends ActionExpression . AbstractExpression { private String name ; private String value ; public SystemPropertyExpression ( IConfigurationElement element ) throws IllegalStateException { } public boolean isEnabledFor ( Object object ) { String str = System . getProperty ( name ) ; if ( str == null ) return false ;

Fix:
Class resourceClass = LegacyResourceSupport . getResourceClass ( ) ;