Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 122574

Summary: make Expressions.isInstanceOf(Object,String) API and move to Equinox
Product: [Eclipse Project] Equinox Reporter: Christopher Daly <cjdaly>
Component: CompendiumAssignee: equinox.compendium-inbox <equinox.compendium-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: dirk_baeumer
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Christopher Daly CLA 2006-01-03 19:13:13 EST
Can org.eclipse.core.internal.expressions.Expressions.isInstanceOf(..) and isSubtype(..) be moved to a very common / low-level place like org.eclipse.equinox.common and exposed as API so it doesn't have to be re-implemented in multiple other places?

Recently doing some work for org.eclipse.core.commands (see bug# 121709) I needed these methods and had to copy them.  I also noticed other places with code that does basically the same:

org.eclipse.ui.internal.LegacyResourceSupport.isInstanceOf(..)
org.eclipse.ui.internal.ActionExpression.ObjectClassExpression.isEnabledFor(..)
org.eclipse.osgi.framework.internal.core.BundleContextImpl.extensiveCheckServiceClass(..)
Comment 1 Thomas Watson CLA 2006-01-04 09:35:02 EST
Moving to Equinox->Bundles where org.eclipse.equinox.common lives.  CC'ing Dirk since I "think" he may own the Expressions code.
Comment 2 Dirk Baeumer CLA 2006-01-04 11:39:02 EST
Yes I do. If you adopt the code please let me know so that I can remove the code from the expressions plug-in and refer to the one in Equinox.
Comment 3 Jeff McAffer CLA 2006-01-10 22:26:50 EST
-1

Common is not intended for convenience function and JRE fixups.  There are some legacy things in there because they are used widely in Eclipse and/or are specific to Eclipse.  This one function is neither.