You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2012/02/16 16:38:07 UTC

svn commit: r1245032 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2: ./ cache/ provider/ftps/ provider/http/ provider/https/ provider/local/ provider/ram/ provider/sftp/ util/

Author: ggregory
Date: Thu Feb 16 15:38:07 2012
New Revision: 1245032

URL: http://svn.apache.org/viewvc?rev=1245032&view=rev
Log:
Fix Checkstyle issues.

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/https/HttpsFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFile.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java Thu Feb 16 15:38:07 2012
@@ -63,7 +63,7 @@ public class FileSystemException
      */
     public FileSystemException(final String code)
     {
-        this(code, null, (Object[])null);
+        this(code, null, (Object[]) null);
     }
 
     /**
@@ -110,7 +110,7 @@ public class FileSystemException
      */
     public FileSystemException(final String code, final Throwable throwable)
     {
-        this(code, throwable, (Object[])null);
+        this(code, throwable, (Object[]) null);
     }
 
     /**
@@ -173,7 +173,7 @@ public class FileSystemException
      */
     public FileSystemException(final Throwable throwable)
     {
-        this(throwable.getMessage(), throwable, (Object[])null);
+        this(throwable.getMessage(), throwable, (Object[]) null);
     }
 
     /**
@@ -183,7 +183,7 @@ public class FileSystemException
     @Override
     public String getMessage()
     {
-        return Messages.getString(super.getMessage(), (Object[])getInfo());
+        return Messages.getString(super.getMessage(), (Object[]) getInfo());
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/cache/SoftRefFilesCache.java Thu Feb 16 15:38:07 2012
@@ -59,7 +59,7 @@ public class SoftRefFilesCache extends A
           new HashMap<Reference<FileObject>, FileSystemAndNameKey>(100);
     private final ReferenceQueue<FileObject> refqueue = new ReferenceQueue<FileObject>();
 
-    private final AtomicReference<SoftRefReleaseThread> softRefReleaseThread = 
+    private final AtomicReference<SoftRefReleaseThread> softRefReleaseThread =
             new AtomicReference<SoftRefReleaseThread>();
 
     private final Lock lock = new ReentrantLock();

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java Thu Feb 16 15:38:07 2012
@@ -35,6 +35,8 @@ import org.apache.commons.vfs2.util.User
  */
 public final class FtpsClientFactory
 {
+    private static final int SHORT_MONTH_NAME_LEN = 40;
+
     private FtpsClientFactory()
     {
     }
@@ -118,7 +120,7 @@ public final class FtpsClientFactory
                         fileSystemOptions);
                     if (shortMonthNames != null)
                     {
-                        StringBuilder shortMonthNamesStr = new StringBuilder(40);
+                        StringBuilder shortMonthNamesStr = new StringBuilder(SHORT_MONTH_NAME_LEN);
                         for (String shortMonthName : shortMonthNames)
                         {
                             if (shortMonthNamesStr.length() > 0)

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileNameParser.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileNameParser.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileNameParser.java Thu Feb 16 15:38:07 2012
@@ -25,11 +25,13 @@ import org.apache.commons.vfs2.provider.
  */
 public class HttpFileNameParser extends URLFileNameParser
 {
+    private static final int DEFAULT_PORT = 80;
+    
     private static final HttpFileNameParser INSTANCE = new HttpFileNameParser();
 
     public HttpFileNameParser()
     {
-        super(80);
+        super(DEFAULT_PORT);
     }
 
     public static FileNameParser getInstance()

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/https/HttpsFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/https/HttpsFileNameParser.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/https/HttpsFileNameParser.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/https/HttpsFileNameParser.java Thu Feb 16 15:38:07 2012
@@ -25,11 +25,13 @@ import org.apache.commons.vfs2.provider.
  */
 public class HttpsFileNameParser extends URLFileNameParser
 {
+    private static final int DEFAULT_PORT = 443;
+    
     private static final HttpsFileNameParser INSTANCE = new HttpsFileNameParser();
 
     public HttpsFileNameParser()
     {
-        super(443);
+        super(DEFAULT_PORT);
     }
 
     public static FileNameParser getInstance()

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFile.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFile.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFile.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFile.java Thu Feb 16 15:38:07 2012
@@ -271,7 +271,7 @@ public class LocalFile extends AbstractF
             // those characters before returning
             return UriParser.decode(getName().getURI());
         }
-        catch(FileSystemException e)
+        catch (FileSystemException e)
         {
             return getName().getURI();
         }

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFileName.java Thu Feb 16 15:38:07 2012
@@ -95,7 +95,7 @@ public class LocalFileName extends Abstr
 
                 uri = UriParser.encode(uri, RESERVED_URI_CHARS);
             }
-            catch(FileSystemException e)
+            catch (FileSystemException e)
             {
                 // Default to base uri value
             }
@@ -123,7 +123,7 @@ public class LocalFileName extends Abstr
 
                 uri = UriParser.encode(uri, RESERVED_URI_CHARS);
             }
-            catch(FileSystemException e)
+            catch (FileSystemException e)
             {
                 // Default to base uri value
             }
@@ -143,7 +143,7 @@ public class LocalFileName extends Abstr
         {
             return UriParser.decode(super.getURI());
         }
-        catch(FileSystemException e)
+        catch (FileSystemException e)
         {
             return super.getURI();
         }

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileObject.java Thu Feb 16 15:38:07 2012
@@ -136,7 +136,8 @@ public class RamFileObject extends Abstr
     protected void doDelete() throws Exception
     {
 
-        if (this.isContentOpen()) {
+        if (this.isContentOpen()) 
+        {
             throw new FileSystemException(this.getName() + " cannot be deleted while the file is openg");
         }
         fs.delete(this);

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileRandomAccessContent.java Thu Feb 16 15:38:07 2012
@@ -123,7 +123,8 @@ public class RamFileRandomAccessContent 
             {
                 int retLen = -1;
                 final int left = getLeftBytes();
-                if (left > 0) {
+                if (left > 0) 
+                {
                     retLen = Math.min(len, left);
                     RamFileRandomAccessContent.this.readFully(b, off, retLen);
                 }
@@ -155,7 +156,8 @@ public class RamFileRandomAccessContent 
      */
     public void seek(long pos) throws IOException
     {
-        if (pos < 0) {
+        if (pos < 0) 
+        {
             throw new IOException("Attempt to position before the start of the file");
         }
         this.filePointer = (int) pos;

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java Thu Feb 16 15:38:07 2012
@@ -65,7 +65,7 @@ public final class SftpClientFactory
      * @throws FileSystemException if an error occurs.
      */
     public static Session createConnection(String hostname, int port, char[] username, char[] password,
-                                           FileSystemOptions fileSystemOptions) throws FileSystemException
+            FileSystemOptions fileSystemOptions) throws FileSystemException
     {
         JSch jsch = new JSch();
 

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java?rev=1245032&r1=1245031&r2=1245032&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java Thu Feb 16 15:38:07 2012
@@ -53,14 +53,14 @@ public final class Messages
 
     /**
      * Formats a message.
-     *
+     * 
      * @param code
      *            The message code.
      * @param param
      *            The message parameter.
      * @return The formatted message.
-     * @deprecated Will be removed in 3.0 in favor of {@link #getString(String, Object[])} When removed, calls to this method will
-     *             automatically recompile to {@link #getString(String, Object[])}
+     * @deprecated Will be removed in 3.0 in favor of {@link #getString(String, Object[])} When removed, calls to this
+     *             method will automatically recompile to {@link #getString(String, Object[])}
      */
     @Deprecated
     public static String getString(final String code, final Object param)