Bug 16858 Preceding space in package compression pattern sometimes ignored
(In the following discussion, all patterns were entered without the enclosing quote marks.) The pattern "1 " causes one character of each package name to be displayed with a single space separator between them. The pattern " 1 " causes one space to precede the first single-character package name and two spaces to appear between each one. Both of the above cases were expected. However, if you set the patttern to " 1" (i.e. space before, but no space after), no spaces are displayed in the result.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLabels.java
private static String fgPkgNamePostfix;
	private static int fgPkgNameChars;
	private static int fgPkgNameLength;
	private JavaElementLabels() {
	}
	private static boolean getFlag(int flags, int flag) {
		return (flags & flag) != 0;
	}
	
	public static String getTextLabel(Object obj, int 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. Flags as defined above.
	 */
	public static String getElementLabel(IJavaElement element, int flags) {
		StringBuffer buf= new StringBuffer();
		getElementLabel(element, flags, buf);
		return buf.toString();
	}
	/**