Bug 11314 Replace package name fragments should always be smaller
Build 20020214 If you enter "2~." in the 'Replace package name fragments with:' field in the preferences (Java->Work in progress), com.ibm.foobar is replaced with co~.ib~.foobar. I believe that package name compression should only replace a fragment if the compressed name is actually smaller. Thus com. would not be replaced in this example, since co~. is the same length, and contains less info.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLabels.java
}
			
			if (getFlag(flags, M_APP_RETURNTYPE) && method.exists() && !method.isConstructor()) {
				buf.append(DECL_STRING);
				buf.append(Signature.getSimpleName(Signature.toString(method.getReturnType())));	
			}			
			
			
			if (getFlag(flags, M_POST_QUALIFIED)) {
				buf.append(CONCAT_STRING);
				getTypeLabel(method.getDeclaringType(), T_FULLY_QUALIFIED, buf);
			}			
			
		} catch (JavaModelException e) {
			JavaPlugin.log(e); 
		}
	}
	
	/**
	 * Appends the label for a field to a StringBuffer. Considers the F_* flags.
	 */	
	public static void getFieldLabel(IField field, int flags, StringBuffer buf) {
		try {
			if (getFlag(flags, F_PRE_TYPE_SIGNATURE) && field.exists()) {
				buf.append(Signature.toString(field.getTypeSignature()));
				buf.append(' ');
			}
			
			
			if (getFlag(flags, F_FULLY_QUALIFIED)) {