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
String pattern= AppearancePreferencePage.getPkgNamePatternForPackagesView();
		if (pattern.equals(fgPkgNamePattern))
			return;
		else if (pattern.equals("")) { 
			fgPkgNameLength= -1;
			return;
		}
		fgPkgNamePattern= pattern;
		int i= 0;
		fgPkgNameChars= 0;
		fgPkgNamePrefix= ""; 
		fgPkgNamePostfix= ""; 
		while (i < pattern.length()) {
			char ch= pattern.charAt(i);
			if (Character.isDigit(ch)) {
				fgPkgNameChars= ch-48;
				if (i > 0 && i < pattern.length() - 1)
					fgPkgNamePrefix= pattern.substring(0, i);
				if (i >= 0 && i < pattern.length())
					fgPkgNamePostfix= pattern.substring(i+1);
				fgPkgNameLength= fgPkgNamePrefix.length() + fgPkgNameChars + fgPkgNamePostfix.length();					
				return;
			}
			i++;
		}
		fgPkgNamePrefix= pattern;
		fgPkgNameLength= pattern.length();
	}
}