Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-03-04 11:04:00 -0500
committerThomas Watson2008-03-04 11:04:00 -0500
commit15283df08ac2855ac93e6a2f4a53e70e19c7d3b7 (patch)
tree630a0441f84f553833118de959712f61c5424b91 /bundles/org.eclipse.osgi/resolver
parent1ce9e5a07dad985939342edb95b2a39982fd639f (diff)
downloadrt.equinox.framework-15283df08ac2855ac93e6a2f4a53e70e19c7d3b7.tar.gz
rt.equinox.framework-15283df08ac2855ac93e6a2f4a53e70e19c7d3b7.tar.xz
rt.equinox.framework-15283df08ac2855ac93e6a2f4a53e70e19c7d3b7.zip
Bug 221339 NPE in VersionConstraintImpl.getName()
Diffstat (limited to 'bundles/org.eclipse.osgi/resolver')
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java9
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java6
2 files changed, 12 insertions, 3 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
index 33a91cd7a..040cbdecb 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
@@ -47,8 +47,12 @@ public class ImportPackageSpecificationImpl extends VersionConstraintImpl implem
}
public String getBundleSymbolicName() {
- if (Constants.SYSTEM_BUNDLE_SYMBOLICNAME.equals(symbolicName))
+ if (Constants.SYSTEM_BUNDLE_SYMBOLICNAME.equals(symbolicName)) {
+ StateImpl state = (StateImpl) getBundle().getContainingState();
+ if (state == null)
+ return Constants.getInternalSymbolicName();
return ((StateImpl) getBundle().getContainingState()).getSystemBundle();
+ }
return symbolicName;
}
@@ -72,7 +76,8 @@ public class ImportPackageSpecificationImpl extends VersionConstraintImpl implem
String[] friends = (String[]) pkgDes.getDirective(Constants.FRIENDS_DIRECTIVE);
Boolean internal = (Boolean) pkgDes.getDirective(Constants.INTERNAL_DIRECTIVE);
if (internal.booleanValue() || friends != null) {
- boolean strict = ((StateImpl) getBundle().getContainingState()).inStrictMode();
+ StateImpl state = (StateImpl) getBundle().getContainingState();
+ boolean strict = state == null ? false : state.inStrictMode();
if (strict) {
if (internal.booleanValue())
return false;
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java
index 4953ad8fc..7c2fdbc8b 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java
@@ -21,8 +21,12 @@ public abstract class VersionConstraintImpl implements VersionConstraint {
private BaseDescription supplier;
public String getName() {
- if (Constants.SYSTEM_BUNDLE_SYMBOLICNAME.equals(name))
+ if (Constants.SYSTEM_BUNDLE_SYMBOLICNAME.equals(name)) {
+ StateImpl state = (StateImpl) getBundle().getContainingState();
+ if (state == null)
+ return Constants.getInternalSymbolicName();
return ((StateImpl) bundle.getContainingState()).getSystemBundle();
+ }
return name;
}

Back to the top