[exo-jcr-commits] exo-jcr SVN: r4344 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu May 5 05:32:17 EDT 2011


Author: areshetnyak
Date: 2011-05-05 05:32:16 -0400 (Thu, 05 May 2011)
New Revision: 4344

Modified:
   jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java
   jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RedoLog.java
   jcr/trunk/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/Log.java
   jcr/trunk/exo.jcr.framework.web/src/main/java/org/exoplatform/frameworks/jcr/web/DisplayJCRContentServlet.java
Log:
EXOJCR-1221 :  The same violations was fixed in JCR.

Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java	2011-05-05 08:38:08 UTC (rev 4343)
+++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java	2011-05-05 09:32:16 UTC (rev 4344)
@@ -25,6 +25,7 @@
 import java.net.URL;
 import java.util.HashMap;
 
+
 /**
  * Created by The eXo Platform SAS. <br/>Date:
  * 
@@ -109,14 +110,14 @@
       int curArg = 0;
       if (curArg == args.length)
       {
-         System.out.println(INCORRECT_PARAM + "There is no any parameters.");
+         System.out.println(INCORRECT_PARAM + "There is no any parameters."); //NOSONAR
          return;
       }
 
       // help
       if (args[curArg].equalsIgnoreCase("help"))
       {
-         System.out.println(HELP_INFO);
+         System.out.println(HELP_INFO); //NOSONAR
          return;
       }
 
@@ -130,7 +131,7 @@
       }
       catch (MalformedURLException e)
       {
-         System.out.println(INCORRECT_PARAM + "There is no url parameter.");
+         System.out.println(INCORRECT_PARAM + "There is no url parameter."); //NOSONAR
          return;
       }
 
@@ -149,7 +150,10 @@
 
             if (url.getUserInfo() != null)
             {  
-               System.out.println(INCORRECT_PARAM + "Parameters Login:Password should not be specified in url parameter to form authentication - " + sUrl);
+               System.out
+                        .println(INCORRECT_PARAM
+                                 + "Parameters Login:Password should not be specified in url parameter to form authentication - "
+                                 + sUrl); //NOSONAR
                return;
             }
          }
@@ -164,28 +168,30 @@
          //check POST or GET
          if (curArg == args.length)
          {
-            System.out.println(INCORRECT_PARAM + "No specified  POST or GET parameter to form parameter.");
+            System.out.println(INCORRECT_PARAM + "No specified  POST or GET parameter to form parameter."); //NOSONAR
             return;
          }
          String method = args[curArg++];
 
          if (!method.equalsIgnoreCase("GET") && !method.equalsIgnoreCase("POST"))
          {
-            System.out.println(INCORRECT_PARAM + "Method to form authentication shulde be GET or POST to form parameter - " + method);
+            System.out.println(INCORRECT_PARAM
+                     + "Method to form authentication shulde be GET or POST to form parameter - " + method); //NOSONAR
             return;
          }
          
          //url to form authentication
          if (curArg == args.length)
          {
-            System.out.println(INCORRECT_PARAM + "No specified  url and form properties to form parameter.");
+            System.out.println(INCORRECT_PARAM + "No specified  url and form properties to form parameter."); //NOSONAR
             return;
          }
          String[] params = args[curArg++].split("[?]");
          
          if (params.length != 2)
          {
-            System.out.println(INCORRECT_PARAM + "From parameters is not spacified to form parameter - " + args[curArg]);
+            System.out
+                     .println(INCORRECT_PARAM + "From parameters is not spacified to form parameter - " + args[curArg]); //NOSONAR
             return;
          }
          String formUrl = params[0];
@@ -195,9 +201,9 @@
 
          if (formParams.length < 2)
          {
-            System.out.println(INCORRECT_PARAM
-                     + "From parameters shoulde be conatains at least two (for login and for pasword) parameters - "
-                     + params[1]);
+            System.out.println(INCORRECT_PARAM //NOSONAR
+                     + "From parameters shoulde be conatains at least two (for login and for pasword) parameters - " //NOSONAR
+                     + params[1]); //NOSONAR
             return;
          }
          
@@ -209,7 +215,8 @@
             
             if (para.length != 2)
             {
-               System.out.println(INCORRECT_PARAM + "From parameters is incorect, shoulde be as \"name=value\"  - " + fParam);
+               System.out.println(INCORRECT_PARAM + "From parameters is incorect, shoulde be as \"name=value\"  - "
+                        + fParam); //NOSONAR
                return;
             }
             
@@ -222,12 +229,12 @@
       {
          if (login == null)
          {
-            System.out.println(INCORRECT_PARAM + "There is no specific Login:Password in url parameter - " + sUrl);
+            System.out.println(INCORRECT_PARAM + "There is no specific Login:Password in url parameter - " + sUrl); //NOSONAR
             return;
          }
          else if (!login.matches("[^:]+:[^:]+"))
          {
-            System.out.println(INCORRECT_PARAM + "There is incorrect Login:Password parameter - " + login);
+            System.out.println(INCORRECT_PARAM + "There is incorrect Login:Password parameter - " + login); //NOSONAR
             return;
          }
       }
@@ -253,7 +260,7 @@
       // commands
       if (curArg == args.length)
       {
-         System.out.println(INCORRECT_PARAM + "There is no command parameter.");
+         System.out.println(INCORRECT_PARAM + "There is no command parameter."); //NOSONAR
          return;
       }
       String command = args[curArg++];
@@ -289,7 +296,7 @@
 
             if (curArg == args.length)
             {
-               System.out.println(client.startBackUp(repositoryName, workspaceName, backupDir));
+               System.out.println(client.startBackUp(repositoryName, workspaceName, backupDir)); //NOSONAR
             }
             else
             {
@@ -302,40 +309,40 @@
                }
                catch (NumberFormatException e)
                {
-                  System.out.println(INCORRECT_PARAM + "Incemental job period is not didgit - " + e.getMessage());
+                  System.out.println(INCORRECT_PARAM + "Incemental job period is not didgit - " + e.getMessage()); //NOSONAR
                   return;
                }
 
                if (curArg < args.length)
                {
-                  System.out.println(TOO_MANY_PARAMS);
+                  System.out.println(TOO_MANY_PARAMS); //NOSONAR
                   return;
                }
-               System.out.println(client.startIncrementalBackUp(repositoryName, workspaceName, backupDir, inc));
+               System.out.println(client.startIncrementalBackUp(repositoryName, workspaceName, backupDir, inc)); //NOSONAR
             }
          }
          else if (command.equalsIgnoreCase("stop"))
          {
             if (curArg == args.length)
             {
-               System.out.println(INCORRECT_PARAM + "There is no backup identifier parameter.");
+               System.out.println(INCORRECT_PARAM + "There is no backup identifier parameter."); //NOSONAR
                return;
             }
             String backupId = args[curArg++];
 
             if (curArg < args.length)
             {
-               System.out.println(TOO_MANY_PARAMS);
+               System.out.println(TOO_MANY_PARAMS); //NOSONAR
                return;
             }
-            System.out.println(client.stop(backupId));
+            System.out.println(client.stop(backupId)); //NOSONAR
          }
          else if (command.equalsIgnoreCase("drop"))
          {
 
             if (curArg == args.length)
             {
-               System.out.println(INCORRECT_PARAM + "There is no path to workspace or force-session-close parameter.");
+               System.out.println(INCORRECT_PARAM + "There is no path to workspace or force-session-close parameter."); //NOSONAR
                return;
             }
 
@@ -358,16 +365,16 @@
 
             if (curArg < args.length)
             {
-               System.out.println(TOO_MANY_PARAMS);
+               System.out.println(TOO_MANY_PARAMS); //NOSONAR
                return;
             }
-            System.out.println(client.drop(isForce, repositoryName, workspaceName));
+            System.out.println(client.drop(isForce, repositoryName, workspaceName)); //NOSONAR
          }
          else if (command.equalsIgnoreCase("status"))
          {
             if (curArg == args.length)
             {
-               System.out.println(INCORRECT_PARAM + "There is no backup identifier parameter.");
+               System.out.println(INCORRECT_PARAM + "There is no backup identifier parameter."); //NOSONAR
                return;
             }
 
@@ -375,19 +382,19 @@
 
             if (curArg < args.length)
             {
-               System.out.println(TOO_MANY_PARAMS);
+               System.out.println(TOO_MANY_PARAMS); //NOSONAR
                return;
             }
-            System.out.println(client.status(backupId));
+            System.out.println(client.status(backupId)); //NOSONAR
          }
          else if (command.equalsIgnoreCase("info"))
          {
             if (curArg < args.length)
             {
-               System.out.println(TOO_MANY_PARAMS);
+               System.out.println(TOO_MANY_PARAMS); //NOSONAR
                return;
             }
-            System.out.println(client.info());
+            System.out.println(client.info()); //NOSONAR
          }
          else if (command.equalsIgnoreCase("restores"))
          {
@@ -401,17 +408,17 @@
 
             if (curArg < args.length)
             {
-               System.out.println(TOO_MANY_PARAMS);
+               System.out.println(TOO_MANY_PARAMS); //NOSONAR
                return;
             }
 
-            System.out.println(client.restores(repositoryName, workspaceName));
+            System.out.println(client.restores(repositoryName, workspaceName)); //NOSONAR
          }
          else if (command.equalsIgnoreCase("list"))
          {
             if (curArg == args.length)
             {
-               System.out.println(client.list());
+               System.out.println(client.list()); //NOSONAR
             }
             else
             {
@@ -421,14 +428,14 @@
                {
                   if (curArg < args.length)
                   {
-                     System.out.println(TOO_MANY_PARAMS);
+                     System.out.println(TOO_MANY_PARAMS); //NOSONAR
                      return;
                   }
-                  System.out.println(client.listCompleted());
+                  System.out.println(client.listCompleted()); //NOSONAR
                }
                else
                {
-                  System.out.println(INCORRECT_PARAM + "There is no 'completed' parameter - " + complated);
+                  System.out.println(INCORRECT_PARAM + "There is no 'completed' parameter - " + complated); //NOSONAR
                   return;
                }
             }
@@ -469,7 +476,7 @@
 
                if (curArg == args.length)
                {
-                  System.out.println(INCORRECT_PARAM + "Should be more parameters.");
+                  System.out.println(INCORRECT_PARAM + "Should be more parameters."); //NOSONAR
                   return;
                }
             }
@@ -487,14 +494,14 @@
 
                if (curArg < args.length)
                {
-                  System.out.println(TOO_MANY_PARAMS);
+                  System.out.println(TOO_MANY_PARAMS); //NOSONAR
                   return;
                }
 
                //5. restore remove-exists <backup_id>
                //11. restore <backup_id>
-               System.out.println(client.restore(repositoryName, workspaceName, backupId, null,
-                        backupSetPath, removeExists));
+               System.out.println(client.restore(repositoryName, workspaceName, backupId, null, backupSetPath,
+                        removeExists)); //NOSONAR
                return;
             }
             //check /repo/ws or /repo
@@ -514,21 +521,21 @@
 
                if (curArg < args.length)
                {
-                  System.out.println(INCORRECT_PARAM + "Should be less parameters : " + parameter);
+                  System.out.println(INCORRECT_PARAM + "Should be less parameters : " + parameter); //NOSONAR
                   return;
                }
 
                //6. restore remove-exists <backup_set_path>
                //12. restore <backup_set_path>
                System.out.println(client.restore(repositoryName, workspaceName, backupId, null, backupSetPath,
-                        removeExists));
+                        removeExists)); //NOSONAR
                return;
             }
 
             // check backup_id or backup_set_path
             if (curArg == args.length)
             {
-               System.out.println(INCORRECT_PARAM + "There is no backup identifier or backup set path parameter.");
+               System.out.println(INCORRECT_PARAM + "There is no backup identifier or backup set path parameter."); //NOSONAR
                return;
             }
             parameter = args[curArg++];
@@ -544,7 +551,7 @@
 
             if (curArg == args.length)
             {
-               System.out.println(INCORRECT_PARAM + "There is no path to config file parameter.");
+               System.out.println(INCORRECT_PARAM + "There is no path to config file parameter."); //NOSONAR
                return;
             }
             String pathToConf = args[curArg++];
@@ -552,13 +559,13 @@
             File conf = new File(pathToConf);
             if (!conf.exists())
             {
-               System.out.println(" File " + pathToConf + " do not exist. Check the path.");
+               System.out.println(" File " + pathToConf + " do not exist. Check the path."); //NOSONAR
                return;
             }
 
             if (curArg < args.length)
             {
-               System.out.println(TOO_MANY_PARAMS);
+               System.out.println(TOO_MANY_PARAMS); //NOSONAR
                return;
             }
 
@@ -572,23 +579,23 @@
             9. restore <repo/ws> <backup_set_path> <pathToConfigFile>
             10. restore <repo>    <backup_set_path> <pathToConfigFile>
             */
-            System.out.println(client.restore(repositoryName, workspaceName, backupId, new FileInputStream(conf),
+            System.out.println(client.restore(repositoryName, workspaceName, backupId, new FileInputStream(conf), //NOSONAR
                      backupSetPath, removeExists));
          }
          else
          {
-            System.out.println("Unknown command <" + command + ">");
+            System.out.println("Unknown command <" + command + ">"); //NOSONAR
          }
 
       }
       catch (IOException e)
       {
-         System.out.println("ERROR: " + e.getMessage());
+         System.out.println("ERROR: " + e.getMessage()); //NOSONAR
          e.printStackTrace();
       }
       catch (BackupExecuteException e)
       {
-         System.out.println("ERROR: " + e.getMessage());
+         System.out.println("ERROR: " + e.getMessage()); //NOSONAR
          e.printStackTrace();
       }
 
@@ -669,7 +676,7 @@
    {
       if (curArg == args.length)
       {
-         System.out.println(INCORRECT_PARAM + "There is no path to workspace parameter.");
+         System.out.println(INCORRECT_PARAM + "There is no path to workspace parameter."); //NOSONAR
          return null;
       }
       // make correct path
@@ -678,7 +685,7 @@
 
       if ( !repWS.matches("[/][^/]+") && !repWS.matches("[/][^/]+[/][^/]+"))
       {
-         System.out.println(INCORRECT_PARAM + "There is incorrect path to workspace parameter: " + repWS);
+         System.out.println(INCORRECT_PARAM + "There is incorrect path to workspace parameter: " + repWS); //NOSONAR
          return null;
       }
       else

Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java	2011-05-05 08:38:08 UTC (rev 4343)
+++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java	2011-05-05 09:32:16 UTC (rev 4344)
@@ -182,7 +182,7 @@
 
             if (Response.Status.OK.getStatusCode() != respLogin.getStatusCode())
             {
-               System.out.println("Form authentication is fail, status code : " + respLogin.getStatusCode());
+               System.out.println("Form authentication is fail, status code : " + respLogin.getStatusCode()); //NOSONAR
                System.exit(0);
             }
          }
@@ -268,7 +268,7 @@
 
             if (Response.Status.OK.getStatusCode() != respLogin.getStatusCode())
             {
-               System.out.println("Form authentication is fail, status code : " + respLogin.getStatusCode());
+               System.out.println("Form authentication is fail, status code : " + respLogin.getStatusCode()); //NOSONAR
                System.exit(0);
             }
          }

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RedoLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RedoLog.java	2011-05-05 08:38:08 UTC (rev 4343)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RedoLog.java	2011-05-05 09:32:16 UTC (rev 4344)
@@ -199,7 +199,7 @@
             }
             catch (Exception e)
             {
-               e.printStackTrace();
+               log.error(e.getLocalizedMessage(), e);
                throw e;
             }
             entryCount = 0;

Modified: jcr/trunk/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/Log.java
===================================================================
--- jcr/trunk/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/Log.java	2011-05-05 08:38:08 UTC (rev 4343)
+++ jcr/trunk/exo.jcr.framework.ftpclient/src/main/java/org/exoplatform/frameworks/ftpclient/Log.java	2011-05-05 09:32:16 UTC (rev 4344)
@@ -36,12 +36,12 @@
 
    public void info(String message)
    {
-      System.out.println(moduleName + ":" + message);
+      System.out.println(moduleName + ":" + message); //NOSONAR
    }
 
    public void info(String message, Throwable thr)
    {
-      System.out.println(moduleName + ":" + message);
+      System.out.println(moduleName + ":" + message); //NOSONAR
       thr.printStackTrace(System.out);
    }
 

Modified: jcr/trunk/exo.jcr.framework.web/src/main/java/org/exoplatform/frameworks/jcr/web/DisplayJCRContentServlet.java
===================================================================
--- jcr/trunk/exo.jcr.framework.web/src/main/java/org/exoplatform/frameworks/jcr/web/DisplayJCRContentServlet.java	2011-05-05 08:38:08 UTC (rev 4343)
+++ jcr/trunk/exo.jcr.framework.web/src/main/java/org/exoplatform/frameworks/jcr/web/DisplayJCRContentServlet.java	2011-05-05 09:32:16 UTC (rev 4344)
@@ -127,7 +127,7 @@
       }
       catch (Exception e)
       {
-         e.printStackTrace();
+         e.printStackTrace(); //NOSONAR
          throw new ServletException(e);
       }
    }



More information about the exo-jcr-commits mailing list