svn commit: r519206 - /xml/xindice/trunk/java/scratchpad/admin/src/org/apache/xindice/admin/commands/ListCommand.java

[email protected]
Newsgroups gmane.text.xml.xindice.devel
Message-ID <[email protected]>
Author: vgritsenko
Date: Fri Mar 16 18:43:42 2007
New Revision: 519206

URL: http://svn.apache.org/viewvc?view=rev&rev=519206
Log:
enum -> e

Modified:
    xml/xindice/trunk/java/scratchpad/admin/src/org/apache/xindice/admin/commands/ListCommand.java

Modified: xml/xindice/trunk/java/scratchpad/admin/src/org/apache/xindice/admin/commands/ListCommand.java
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/scratchpad/admin/src/org/apache/xindice/admin/commands/ListCommand.java?view=diff&rev=519206&r1=519205&r2=519206
==============================================================================
--- xml/xindice/trunk/java/scratchpad/admin/src/org/apache/xindice/admin/commands/ListCommand.java (original)
+++ xml/xindice/trunk/java/scratchpad/admin/src/org/apache/xindice/admin/commands/ListCommand.java Fri Mar 16 18:43:42 2007
@@ -38,13 +38,12 @@
 	}
 
 	public void execute(String args[]) {
-
         String option = args[0];
-        String rpcmessage = null;
+        String rpcmessage;
 
-        if(option.startsWith("col")){
+        if (option.startsWith("col")) {
             rpcmessage = "ListCollections";
-        } else if (option.startsWith("doc")){
+        } else if (option.startsWith("doc")) {
             rpcmessage = "ListDocuments";
         } else {
             prompt.out.println("Invalid option");
@@ -54,20 +53,21 @@
         Hashtable message = new Hashtable();
         message.put("message", rpcmessage);
         message.put("collection", XindiceAdmin.getDB());
-        Hashtable result = null;
+
+        Hashtable result;
         try {
-            result = (Hashtable) XindiceAdmin.run(message);
+            result = XindiceAdmin.run(message);
         } catch(Exception e) {
-            //prompt.out.println(e);
+            // prompt.out.println(e);
             return;
         }
 
-        if(result != null) {
+        if (result != null) {
             Vector list = (Vector) result.get("result");
-            if( list.size() > 0) {
-                Enumeration enum = list.elements();
-                while ( enum.hasMoreElements() ) {
-                    prompt.out.println("\t" + enum.nextElement().toString());
+            if (list.size() > 0) {
+                Enumeration e = list.elements();
+                while (e.hasMoreElements()) {
+                    prompt.out.println("\t" + e.nextElement().toString());
                 }
             } else {
                 prompt.out.println("\tNo collections");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.