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
int nParams= types != null ? types.length : names.length;
				
				for (int i= 0; i < nParams; i++) {
					if (i > 0) {
						buf.append(COMMA_STRING); 
					}
					if (types != null) {
						buf.append(Signature.getSimpleName(Signature.toString(types[i])));
					}
					if (names != null) {
						if (types != null) {
							buf.append(' ');
						}
						buf.append(names[i]);
					}
				}
				buf.append(')');
			}
					
			if (getFlag(flags, M_EXCEPTIONS) && method.exists()) {
				String[] types= method.getExceptionTypes();
				if (types.length > 0) {
					buf.append(" throws "); 
					for (int i= 0; i < types.length; i++) {
						if (i > 0) {
							buf.append(COMMA_STRING);
						}
						buf.append(Signature.getSimpleName(Signature.toString(types[i])));
					}
				}