Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2006-04-24 12:23:48 -0400
committerThomas Watson2006-04-24 12:23:48 -0400
commit760459f0ece297a26a69d9d3e1f400d782179305 (patch)
tree8328129d4b892abd6b7e40131de46c66c8757916
parentc1405a5a464c4cb8f77ba0194316de40356ebd9a (diff)
downloadrt.equinox.framework-760459f0ece297a26a69d9d3e1f400d782179305.tar.gz
rt.equinox.framework-760459f0ece297a26a69d9d3e1f400d782179305.tar.xz
rt.equinox.framework-760459f0ece297a26a69d9d3e1f400d782179305.zip
[TCK fix] dynamic imports may be imported multiple times.
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
index ae19cf7ac..25ddf3dfe 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
@@ -181,10 +181,12 @@ class StateBuilder {
checkForDuplicateDirectives(elements);
if (DEFINED_OSGI_VALIDATE_HEADERS[i] == Constants.REEXPORT_PACKAGE)
checkForUsesDirective(elements);
- if (DEFINED_OSGI_VALIDATE_HEADERS[i] == Constants.IMPORT_PACKAGE || DEFINED_OSGI_VALIDATE_HEADERS[i] == Constants.DYNAMICIMPORT_PACKAGE)
- checkImportExportSyntax(elements, false, jreBundle);
+ if (DEFINED_OSGI_VALIDATE_HEADERS[i] == Constants.IMPORT_PACKAGE)
+ checkImportExportSyntax(elements, false, false, jreBundle);
+ if (DEFINED_OSGI_VALIDATE_HEADERS[i] == Constants.DYNAMICIMPORT_PACKAGE)
+ checkImportExportSyntax(elements, false, true, jreBundle);
if (DEFINED_OSGI_VALIDATE_HEADERS[i] == Constants.EXPORT_PACKAGE)
- checkImportExportSyntax(elements, true, jreBundle);
+ checkImportExportSyntax(elements, true, false, jreBundle);
if (DEFINED_OSGI_VALIDATE_HEADERS[i] == Constants.FRAGMENT_HOST)
checkExtensionBundle(elements);
} else if (DEFINED_OSGI_VALIDATE_HEADERS[i] == Constants.BUNDLE_SYMBOLICNAME) {
@@ -480,7 +482,7 @@ class StateBuilder {
return new VersionRange(versionRange);
}
- private static void checkImportExportSyntax(ManifestElement[] elements, boolean export, boolean jreBundle) throws BundleException {
+ private static void checkImportExportSyntax(ManifestElement[] elements, boolean export, boolean dynamic, boolean jreBundle) throws BundleException {
if (elements == null)
return;
int length = elements.length;
@@ -489,7 +491,7 @@ class StateBuilder {
// check for duplicate imports
String[] packageNames = elements[i].getValueComponents();
for (int j = 0; j < packageNames.length; j++) {
- if (!export && packages.contains(packageNames[j]))
+ if (!export && !dynamic && packages.contains(packageNames[j]))
throw new BundleException(NLS.bind(StateMsg.HEADER_PACKAGE_DUPLICATES, packageNames[j]));
// check for java.*
if (!jreBundle && packageNames[j].startsWith("java.")) //$NON-NLS-1$

Back to the top