You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2013/12/18 12:31:05 UTC

[3/4] git commit: When listing bundles, put fragments and hosts after the name

When listing bundles, put fragments and hosts after the name


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/1729203c
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/1729203c
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/1729203c

Branch: refs/heads/karaf-2.x
Commit: 1729203cb49aca9ac59bb13f048e794ecc45b985
Parents: 52e8608
Author: gnodet <gn...@gmail.com>
Authored: Wed Nov 14 16:10:12 2012 +0100
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Wed Dec 18 12:20:25 2013 +0100

----------------------------------------------------------------------
 .../apache/karaf/shell/osgi/ListBundles.java    | 21 +++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/1729203c/shell/osgi/src/main/java/org/apache/karaf/shell/osgi/ListBundles.java
----------------------------------------------------------------------
diff --git a/shell/osgi/src/main/java/org/apache/karaf/shell/osgi/ListBundles.java b/shell/osgi/src/main/java/org/apache/karaf/shell/osgi/ListBundles.java
index 1456300..8588710 100644
--- a/shell/osgi/src/main/java/org/apache/karaf/shell/osgi/ListBundles.java
+++ b/shell/osgi/src/main/java/org/apache/karaf/shell/osgi/ListBundles.java
@@ -156,39 +156,36 @@ public class ListBundles extends OsgiCommandSupport {
 	                    }
 	                }
 	                line += " [" + level + "] " + name;
-	                System.out.println(line);
-	
+
 	                if (admin != null) {
 	                    Bundle[] fragments = admin.getFragments(bundles[i]);
 	                    Bundle[] hosts = admin.getHosts(bundles[i]);
-	
 	                    if (fragments != null) {
-	                        System.out.print("                                       Fragments: ");
+                            line += ", Fragments: ";
 	                        int ii = 0;
 	                        for (Bundle fragment : fragments) {
 	                            ii++;
-	                            System.out.print(fragment.getBundleId());
+	                            line += fragment.getBundleId();
 	                            if ((fragments.length > 1) && ii < (fragments.length)) {
-	                                System.out.print(",");
+	                                line += ",";
 	                            }
 	                        }
-	                        System.out.println();
 	                    }
-	
 	                    if (hosts != null) {
-	                        System.out.print("                                       Hosts: ");
+	                        line += ", Hosts: ";
 	                        int ii = 0;
 	                        for (Bundle host : hosts) {
 	                            ii++;
-	                            System.out.print(host.getBundleId());
+	                            line += host.getBundleId();
 	                            if ((hosts.length > 1) && ii < (hosts.length)) {
-	                                System.out.print(",");
+	                                line += ",";
 	                            }
 	                        }
-	                        System.out.println();
 	                    }
 	
 	                }
+
+                    System.out.println(line);
 	            }
             }
         }