karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1551492 - /karaf/branches/karaf-2.x/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java
Date Tue, 17 Dec 2013 09:21:14 GMT
Author: gnodet
Date: Tue Dec 17 09:21:14 2013
New Revision: 1551492

URL: http://svn.apache.org/r1551492
Log:
[KARAF-2627] The features:list command is slow when doing unnecessary repo validation

Modified:
    karaf/branches/karaf-2.x/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java

Modified: karaf/branches/karaf-2.x/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.x/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java?rev=1551492&r1=1551491&r2=1551492&view=diff
==============================================================================
--- karaf/branches/karaf-2.x/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java
(original)
+++ karaf/branches/karaf-2.x/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java
Tue Dec 17 09:21:14 2013
@@ -57,13 +57,15 @@ public class ListUrlCommand extends Feat
                 String line = "";
                 line += repos[i].isValid() ? "  true " : "  false";
 
-                try {
-                    admin.validateRepository(uri);
-                    // append valid flag if validation mode is tuned on
-                    line += !validation ? "" : "     true   ";
-                } catch (Exception e) {
-                    line += !validation ? "" : "     false  ";
-                    verboseOutput += uri + ":" + e.getMessage() + "\n";
+                if (validation || verbose) {
+                    try {
+                        admin.validateRepository(uri);
+                        // append valid flag if validation mode is tuned on
+                        line += !validation ? "" : "     true   ";
+                    } catch (Exception e) {
+                        line += !validation ? "" : "     false  ";
+                        verboseOutput += uri + ":" + e.getMessage() + "\n";
+                    }
                 }
 
                 System.out.println(line + "   " + uri);



Mime
View raw message