Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-09-17 13:08:55 -0400
committerChristopher Frost2012-09-17 13:08:55 -0400
commit609379c860e067070441cfbd2bc8a9ca03912419 (patch)
tree1ed53bd543ec6e4e7e2cb74d2980778630165f80 /org.eclipse.virgo.shell.command
parente1aace51970bb3c69cb4f2fea5d21d101bf4c015 (diff)
downloadorg.eclipse.virgo.kernel-609379c860e067070441cfbd2bc8a9ca03912419.tar.gz
org.eclipse.virgo.kernel-609379c860e067070441cfbd2bc8a9ca03912419.tar.xz
org.eclipse.virgo.kernel-609379c860e067070441cfbd2bc8a9ca03912419.zip
Making the QuasiFramework more robust and improving the Shells use of the QuasiFramework
Diffstat (limited to 'org.eclipse.virgo.shell.command')
-rw-r--r--org.eclipse.virgo.shell.command/src/main/java/org/eclipse/virgo/shell/internal/formatting/BundleInstallArtifactCommandFormatter.java22
-rw-r--r--org.eclipse.virgo.shell.command/src/test/java/org/eclipse/virgo/shell/stubs/StubQuasiBundle.java5
2 files changed, 17 insertions, 10 deletions
diff --git a/org.eclipse.virgo.shell.command/src/main/java/org/eclipse/virgo/shell/internal/formatting/BundleInstallArtifactCommandFormatter.java b/org.eclipse.virgo.shell.command/src/main/java/org/eclipse/virgo/shell/internal/formatting/BundleInstallArtifactCommandFormatter.java
index 6ceae7a8..0fab679b 100644
--- a/org.eclipse.virgo.shell.command/src/main/java/org/eclipse/virgo/shell/internal/formatting/BundleInstallArtifactCommandFormatter.java
+++ b/org.eclipse.virgo.shell.command/src/main/java/org/eclipse/virgo/shell/internal/formatting/BundleInstallArtifactCommandFormatter.java
@@ -297,21 +297,23 @@ public final class BundleInstallArtifactCommandFormatter implements InstallArtif
return lines;
}
- public List<String> formatHeaders(QuasiBundle bundle) {
- if (bundle == null) {
+ public List<String> formatHeaders(QuasiBundle quasiBundle) {
+ if (quasiBundle == null) {
return Arrays.asList("Unable to locate bundle");
}
List<String> lines = new ArrayList<String>();
- Dictionary<String, String> headers = bundle.getBundle().getHeaders();
- Enumeration<String> keys = headers.keys();
- while (keys.hasMoreElements()) {
- String key = keys.nextElement();
- lines.add(String.format("%s: ", key));
- lines.addAll(formatHeaderValue(headers.get(key)));
+ Bundle bundle = quasiBundle.getBundle();
+ if(bundle != null){
+ Dictionary<String, String> headers = bundle.getHeaders();
+ Enumeration<String> keys = headers.keys();
+ while (keys.hasMoreElements()) {
+ String key = keys.nextElement();
+ lines.add(String.format("%s: ", key));
+ lines.addAll(formatHeaderValue(headers.get(key)));
+ }
}
-
return lines;
}
@@ -388,7 +390,7 @@ public final class BundleInstallArtifactCommandFormatter implements InstallArtif
}
public String getBundleLocation() {
- return this.bundle.getBundle().getLocation();
+ return this.bundle.getBundleLocation();
}
public boolean getSpringPowered() {
diff --git a/org.eclipse.virgo.shell.command/src/test/java/org/eclipse/virgo/shell/stubs/StubQuasiBundle.java b/org.eclipse.virgo.shell.command/src/test/java/org/eclipse/virgo/shell/stubs/StubQuasiBundle.java
index 4c1018a5..86a11672 100644
--- a/org.eclipse.virgo.shell.command/src/test/java/org/eclipse/virgo/shell/stubs/StubQuasiBundle.java
+++ b/org.eclipse.virgo.shell.command/src/test/java/org/eclipse/virgo/shell/stubs/StubQuasiBundle.java
@@ -130,4 +130,9 @@ public class StubQuasiBundle implements QuasiBundle {
return null;
}
+ @Override
+ public String getBundleLocation() {
+ return null;
+ }
+
}

Back to the top