appendTypePath((IType) imp, pathBuffer);
appendTypePath(imp, pathBuffer);
	public static URL getJavadocLocation(IJavaElement element, boolean includeMemberReference) throws JavaModelException {		URL baseLocation= getJavadocBaseLocation(element);		if (baseLocation == null) {			return null;		}		String urlString= baseLocation.toExternalForm();		StringBuffer pathBuffer= new StringBuffer(urlString);		if (!urlString.endsWith("/")) { //$NON-NLS-1$			pathBuffer.append('/');		}		switch (element.getElementType()) {			case IJavaElement.PACKAGE_FRAGMENT:				appendPackageSummaryPath((IPackageFragment) element, pathBuffer);				break;			case IJavaElement.JAVA_PROJECT:			case IJavaElement.PACKAGE_FRAGMENT_ROOT :				appendIndexPath(pathBuffer);				break;			case IJavaElement.IMPORT_CONTAINER :				element= element.getParent();				// fall through			case IJavaElement.COMPILATION_UNIT :				IType mainType= ((ICompilationUnit) element).findPrimaryType();				if (mainType == null) {					return null;				}				appendTypePath(mainType, pathBuffer);				break;			case IJavaElement.CLASS_FILE :				appendTypePath(((IClassFile) element).getType(), pathBuffer);				break;			case IJavaElement.TYPE :				appendTypePath((IType) element, pathBuffer);				break;			case IJavaElement.FIELD :				IField field= (IField) element;				appendTypePath(field.getDeclaringType(), pathBuffer);				if (includeMemberReference) {					appendFieldReference(field, pathBuffer);				}				break;			case IJavaElement.METHOD :				IMethod method= (IMethod) element;				appendTypePath(method.getDeclaringType(), pathBuffer);				if (includeMemberReference) {					appendMethodReference(method, pathBuffer);				}				break;			case IJavaElement.INITIALIZER :				appendTypePath(((IMember) element).getDeclaringType(), pathBuffer);				break;			case IJavaElement.IMPORT_DECLARATION :				IImportDeclaration decl= (IImportDeclaration) element;				if (decl.isOnDemand()) {					IJavaElement cont= JavaModelUtil.findTypeContainer(element.getJavaProject(), Signature.getQualifier(decl.getElementName()));					if (cont instanceof IType) {						appendTypePath((IType) cont, pathBuffer);					} else if (cont instanceof IPackageFragment) {						appendPackageSummaryPath((IPackageFragment) cont, pathBuffer);					}				} else {					IType imp= element.getJavaProject().findType(decl.getElementName());					appendTypePath((IType) imp, pathBuffer);				}				break;			case IJavaElement.PACKAGE_DECLARATION :				IJavaElement pack= element.getAncestor(IJavaElement.PACKAGE_FRAGMENT);				if (pack != null) {					appendPackageSummaryPath((IPackageFragment) pack, pathBuffer);				} else {					return null;				}				break;			default :				return null;		}		try {			return new URL(pathBuffer.toString());		} catch (MalformedURLException e) {			JavaPlugin.log(e);		}		return null;	}	