### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.core Index: src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java,v retrieving revision 1.47 diff -u -r1.47 BundleErrorReporter.java --- src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 25 Sep 2007 21:52:36 -0000 1.47 +++ src/org/eclipse/pde/internal/core/builders/BundleErrorReporter.java 28 Sep 2007 19:05:26 -0000 @@ -225,7 +225,11 @@ if (TargetPlatformHelper.getTargetVersion() >= 3.1) { if (!"true".equals(singletonDir)) { //$NON-NLS-1$ if ("true".equals(singletonAttr)) { //$NON-NLS-1$ - if (isCheckDeprecated()) { + + // Grab manifest header + IHeader manifestVersion = getHeader(Constants.BUNDLE_MANIFESTVERSION); + + if (isCheckDeprecated() && (manifestVersion != null && !"1".equals(manifestVersion.getValue()))) { String message = PDECoreMessages.BundleErrorReporter_deprecated_attribute_singleton; report(message, getLine(header, ICoreConstants.SINGLETON_ATTRIBUTE + "="), //$NON-NLS-1$ CompilerFlags.P_DEPRECATED, PDEMarkerFactory.M_SINGLETON_DIR_NOT_SET, PDEMarkerFactory.CAT_DEPRECATION); @@ -245,14 +249,27 @@ } } + // Grab manifest header + IHeader manifestVersion = getHeader(Constants.BUNDLE_MANIFESTVERSION); + if (TargetPlatformHelper.getTargetVersion() >= 3.1) { if (singletonAttr != null) { - if (isCheckDeprecated()) { + if (isCheckDeprecated() && (manifestVersion != null && !"1".equals(manifestVersion.getValue()))) { String message = PDECoreMessages.BundleErrorReporter_deprecated_attribute_singleton; report(message, getLine(header, ICoreConstants.SINGLETON_ATTRIBUTE + "="), //$NON-NLS-1$ CompilerFlags.P_DEPRECATED, PDEMarkerFactory.M_SINGLETON_DIR_NOT_SET, PDEMarkerFactory.CAT_OTHER); } } + + // Check we are not using directive with legal version 1 syntax + if (singletonDir != null && (manifestVersion == null || "1".equals(manifestVersion.getValue()))) { + if (isCheckDeprecated()) { + String message = PDECoreMessages.BundleErrorReporter_incompatibleSingletonDirective; + report(message, getLine(header, Constants.SINGLETON_DIRECTIVE + ":="), //$NON-NLS-1$ + CompilerFlags.P_DEPRECATED, PDEMarkerFactory.M_SINGLETON_DIR_NOT_SUPPORTED, PDEMarkerFactory.CAT_OTHER); + + } + } } else if (singletonDir != null) { if (isCheckDeprecated()) { String message = PDECoreMessages.BundleErrorReporter_unsupportedSingletonDirective; Index: src/org/eclipse/pde/internal/core/PDECoreMessages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDECoreMessages.java,v retrieving revision 1.40 diff -u -r1.40 PDECoreMessages.java --- src/org/eclipse/pde/internal/core/PDECoreMessages.java 24 Sep 2007 12:12:34 -0000 1.40 +++ src/org/eclipse/pde/internal/core/PDECoreMessages.java 28 Sep 2007 19:05:24 -0000 @@ -41,6 +41,8 @@ public static String BundleErrorReporter_unsupportedSingletonDirective; + public static String BundleErrorReporter_incompatibleSingletonDirective; + public static String BundleTextChangeListener_editNames_insert; public static String BundleTextChangeListener_editNames_modify; Index: src/org/eclipse/pde/internal/core/pderesources.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/pderesources.properties,v retrieving revision 1.76 diff -u -r1.76 pderesources.properties --- src/org/eclipse/pde/internal/core/pderesources.properties 24 Sep 2007 12:12:34 -0000 1.76 +++ src/org/eclipse/pde/internal/core/pderesources.properties 28 Sep 2007 19:05:25 -0000 @@ -147,6 +147,7 @@ BundleErrorReporter_unresolvedHost=Host bundle ''{0}'' exists but is unresolved BundleErrorReporter_lazyStart_unsupported=The Eclipse-LazyStart header is not supported by pre-3.2 targets BundleErrorReporter_unsatisfiedConstraint=Unsatisfied constraint: ''{0}'' +BundleErrorReporter_incompatibleSingletonDirective=The singleton directive is not supported by manifest version 1 format BundleErrorReporter_noExecutionEnvironmentSet=No Execution Environment has been set BundleTextChangeListener_editNames_newLine=Add a new line at the end of the file BundleTextChangeListener_editNames_remove=Remove "{0}" header