### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.core Index: src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java =================================================================== RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java,v retrieving revision 1.68 diff -u -r1.68 BundleErrorReporter.java --- src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 14 Oct 2008 16:08:45 -0000 1.68 +++ src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 27 Feb 2009 16:20:37 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,7 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation - * Code 9 Corporation - on going enhancements and maintenance + * EclipseSource Corporation - ongoing enhancements and maintenance * Brock Janiczak - bug 169373 * Gary Duprex - bug 150225 * Bartosz Michalik - bug 209432, 214156 @@ -170,7 +170,7 @@ IPluginBase base = fModel.getPluginBase(); // must check the existence of plugin.xml file instead of using IPluginBase because if the bundle is not a singleton, // it won't be registered with the extension registry and will always return 0 when querying extensions/extension points - boolean hasExtensions = base != null && fProject.findMember(ICoreConstants.PLUGIN_PATH) != null; + boolean hasExtensions = base != null && (fProject.findMember(ICoreConstants.PLUGIN_PATH) != null || fProject.findMember(ICoreConstants.FRAGMENT_PATH) != null); if (hasExtensions) { if (TargetPlatformHelper.getTargetVersion() >= 3.1) { @@ -193,6 +193,16 @@ report(message, header.getLineNumber() + 1, CompilerFlags.ERROR, PDEMarkerFactory.M_SINGLETON_ATT_NOT_SET, PDEMarkerFactory.CAT_OTHER); return; } + // if we're a fragment, ensure the host is a singleton + if (fModel.isFragmentModel()) { + IHeader fHeader = getHeader(Constants.FRAGMENT_HOST); + if (fHeader == null) + return; + String host = fHeader.getValue(); + if (host != null) { + // TODO call the PluginRegistry to find the host model, see if it has the singleton attribute marked + } + } } if (fOsgiR4) {