felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r757684 - /felix/trunk/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java
Date Tue, 24 Mar 2009 08:11:38 GMT
Author: clement
Date: Tue Mar 24 08:11:37 2009
New Revision: 757684

URL: http://svn.apache.org/viewvc?rev=757684&view=rev
Log:
Fix issue Felix-996.
Now, 'arch -factory xxx' will display facotry description as follows:
description of xxx (1)
[empty line]
description of xxx (2)
...

Despite having several times the same factory can be weird with the configuration admin, it
makes sense in some cases.

Modified:
    felix/trunk/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java

Modified: felix/trunk/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java?rev=757684&r1=757683&r2=757684&view=diff
==============================================================================
--- felix/trunk/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java
(original)
+++ felix/trunk/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java
Tue Mar 24 08:11:37 2009
@@ -197,13 +197,20 @@
      * @param err : error print stream (if the factory is not found)
      */
     private void printFactory(String name, PrintStream out, PrintStream err) {
+        boolean found = false;
         for (int i = 0; i < m_factories.length; i++) {
             if (m_factories[i].getName().equalsIgnoreCase(name)) {
+                // Skip a line if already found
+                if (found) {
+                    out.println();
+                }
                 out.println(m_factories[i].getDescription());
-                return;
+                found = true;
             }
         }
-        err.println("Factory " + name + " not found");
+        if (! found) {
+            err.println("Factory " + name + " not found");
+        }
     }
     
     /**



Mime
View raw message