Bug 29375 Search for reference gives strange results when references are in static initialisers [search]
[M4] When references to a class or method are in the static initialiser for a class (which is also in a package other than the default one) the results contain spurious nulls. Test case: package foo.bar; public class Test { static { new Test().toString(); } } Highlight "Test" (either place) and search for references in the workspace. The result will be: nullnullbar.Test.{...}
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLabels.java
buf.append(CONCAT_STRING);
			getTypeLabel(initializer.getDeclaringType(), T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf);
		}
	}
	/**
	 * Appends the label for a type to a StringBuffer. Considers the T_* flags.
	 */		
	public static void getTypeLabel(IType type, int flags, StringBuffer buf) {
		if (getFlag(flags, T_FULLY_QUALIFIED)) {
			IPackageFragment pack= type.getPackageFragment();
			if (!pack.isDefaultPackage()) {
				getPackageFragmentLabel(pack, (flags & P_COMPRESSED), buf);
				buf.append('.');
			}
			buf.append(JavaModelUtil.getTypeQualifiedName(type));
		} else if (getFlag(flags, T_CONTAINER_QUALIFIED)) {
			buf.append(JavaModelUtil.getTypeQualifiedName(type));
		} else {
			buf.append(type.getElementName());
		}
		
		if (getFlag(flags, T_POST_QUALIFIED)) {
			buf.append(CONCAT_STRING);
			IType declaringType= type.getDeclaringType();
			if (declaringType != null) {
				getTypeLabel(declaringType, T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf);
			} else {
				getPackageFragmentLabel(type.getPackageFragment(), (flags & P_COMPRESSED), buf);
			}
		}