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
getPackageFragmentRootLabel(root, ROOT_QUALIFIED, buf);
		}
	}
	/**
	 * Appends the label for a method to a StringBuffer. Considers the M_* flags.
	 */		
	public static void getMethodLabel(IMethod method, int flags, StringBuffer buf) {
		try {
			
			if (getFlag(flags, M_PRE_RETURNTYPE) && method.exists() && !method.isConstructor()) {
				buf.append(Signature.getSimpleName(Signature.toString(method.getReturnType())));
				buf.append(' ');
			}
			
			
			if (getFlag(flags, M_FULLY_QUALIFIED)) {
				getTypeLabel(method.getDeclaringType(), T_FULLY_QUALIFIED | (flags & P_COMPRESSED), buf);
				buf.append('.');
			}
				
			buf.append(method.getElementName());
			
			
			if (getFlag(flags, M_PARAMETER_TYPES | M_PARAMETER_NAMES)) {
				buf.append('(');
				
				String[] types= getFlag(flags, M_PARAMETER_TYPES) ? method.getParameterTypes() : null;
				String[] names= (getFlag(flags, M_PARAMETER_NAMES) && method.exists()) ? method.getParameterNames() : null;
				int nParams= types != null ? types.length : names.length;