Bug 93105 Remove unnecessary APIs on BindingKey
I20050426-1700 After discussions with JDT/UI, we came to conclusion that the following 3.1 APIs on BindingKey are not suitable; since they may cache element structural information into keys, leaving clients with difficult decisions as to whether to trust the key or the element. - BindingKey#getDeclaringTypeSignature() - BindingKey#toSignature() The only interest for having these APIs on the key is to cache some information avoiding populating the model, and is not mandated by the normal binding key contract, i.e. identify uniquely a type binding. Therefore, they should not be added . If such information was requested again, it should end up in a different spot. Something we could imagine post 3.1 is to precache this information directly into Java elements (pre/partially initialized element infos), and hiding the complexity to clients who could blindly trust the elements to reflect reality.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabels.java
private JavaElementLabels() {
	}
	private static final boolean getFlag(long flags, long flag) {
		return (flags & flag) != 0;
	}
	
	/**
	 * Returns the label of the given object. The object must be of type {@link IJavaElement} or adapt to {@link IWorkbenchAdapter}. The empty string is returned
	 * if the element type is not known.
	 * @param obj Object to get the label from.
	 * @param flags The rendering flags
	 * @return Returns the label or the empty string if the object type is not supported.
	 */
	public static String getTextLabel(Object obj, long flags) {
		if (obj instanceof IJavaElement) {
			return getElementLabel((IJavaElement) obj, flags);
		} else if (obj instanceof IAdaptable) {
			IWorkbenchAdapter wbadapter= (IWorkbenchAdapter) ((IAdaptable)obj).getAdapter(IWorkbenchAdapter.class);
			if (wbadapter != null) {
				return wbadapter.getLabel(obj);
			}
		}
		return ""; 
	}
				
	/**
	 * Returns the label for a Java element with the flags as defined by this class.
	 * @param element The element to render.
	 * @param flags The rendering flags.
	 * @return the label of the Java element