maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [5/5] git commit: Minor code simplifications
Date Thu, 14 Nov 2013 03:13:57 GMT
Minor code simplifications


Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/0d6d1f3a
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/0d6d1f3a
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/0d6d1f3a

Branch: refs/heads/master
Commit: 0d6d1f3ad432a0a257e0bc7404ac31dbe0ae7810
Parents: ddfeecf
Author: Emmanuel Bourg <ebourg@apache.org>
Authored: Wed Nov 13 13:06:55 2013 +0100
Committer: Emmanuel Bourg <ebourg@apache.org>
Committed: Wed Nov 13 13:06:55 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/maven/wagon/FileTestUtils.java  | 8 ++++----
 .../java/org/apache/maven/wagon/http/HttpWagonTestCase.java  | 2 +-
 .../ssh/interactive/ConsoleInteractiveUserInfo.java          | 2 +-
 .../providers/ssh/knownhost/StreamKnownHostsProvider.java    | 2 +-
 .../java/org/apache/maven/wagon/tck/http/GetWagonTests.java  | 4 ++--
 .../apache/maven/wagon/tck/http/fixture/LatencyServlet.java  | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/0d6d1f3a/wagon-provider-test/src/main/java/org/apache/maven/wagon/FileTestUtils.java
----------------------------------------------------------------------
diff --git a/wagon-provider-test/src/main/java/org/apache/maven/wagon/FileTestUtils.java b/wagon-provider-test/src/main/java/org/apache/maven/wagon/FileTestUtils.java
index 61fad86..75aa3f0 100644
--- a/wagon-provider-test/src/main/java/org/apache/maven/wagon/FileTestUtils.java
+++ b/wagon-provider-test/src/main/java/org/apache/maven/wagon/FileTestUtils.java
@@ -33,7 +33,7 @@ import java.io.Writer;
 public class FileTestUtils
 {
 
-    public static final File createUniqueFile( final String dirname, final String name )
+    public static File createUniqueFile( final String dirname, final String name )
         throws IOException
     {
 
@@ -46,7 +46,7 @@ public class FileTestUtils
     }
 
 
-    public static final File createUniqueDir( final String name )
+    public static File createUniqueDir( final String name )
         throws IOException
     {
 
@@ -57,7 +57,7 @@ public class FileTestUtils
     }
 
 
-    public static final File createDir( final String name )
+    public static File createDir( final String name )
         throws IOException
     {
 
@@ -81,7 +81,7 @@ public class FileTestUtils
         return retValue;
     }
 
-    public static final File getTestOutputDir()
+    public static File getTestOutputDir()
     {
         final String tempDir = System.getProperty( "java.io.tmpdir" );
 

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/0d6d1f3a/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
----------------------------------------------------------------------
diff --git a/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
b/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
index 12a3fce..4535e9f 100644
--- a/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
+++ b/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
@@ -1705,7 +1705,7 @@ public abstract class HttpWagonTestCase
         public void handle( String target, HttpServletRequest request, HttpServletResponse
response, int dispatch )
             throws IOException, ServletException
         {
-            headers = new HashMap();
+            headers = new HashMap<String, String>();
             for ( Enumeration e = request.getHeaderNames(); e.hasMoreElements(); )
             {
                 String name = (String) e.nextElement();

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/0d6d1f3a/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/interactive/ConsoleInteractiveUserInfo.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/interactive/ConsoleInteractiveUserInfo.java
b/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/interactive/ConsoleInteractiveUserInfo.java
index a8f3c52..a104810 100644
--- a/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/interactive/ConsoleInteractiveUserInfo.java
+++ b/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/interactive/ConsoleInteractiveUserInfo.java
@@ -58,7 +58,7 @@ public class ConsoleInteractiveUserInfo
         String ret;
         try
         {
-            ret = prompter.prompt( message, Arrays.asList( new String[]{"yes", "no"} ) );
+            ret = prompter.prompt( message, Arrays.asList( "yes", "no" ) );
         }
         catch ( PrompterException e )
         {

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/0d6d1f3a/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/knownhost/StreamKnownHostsProvider.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/knownhost/StreamKnownHostsProvider.java
b/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/knownhost/StreamKnownHostsProvider.java
index 7b2cae3..8579c85 100644
--- a/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/knownhost/StreamKnownHostsProvider.java
+++ b/wagon-providers/wagon-ssh-common/src/main/java/org/apache/maven/wagon/providers/ssh/knownhost/StreamKnownHostsProvider.java
@@ -64,7 +64,7 @@ public class StreamKnownHostsProvider
         
         BufferedReader br = new BufferedReader( new StringReader( contents ) );
         
-        String line = null;
+        String line;
         
         do 
         {

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/0d6d1f3a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java
----------------------------------------------------------------------
diff --git a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java
b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java
index 0a1da70..24a1ca7 100644
--- a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java
+++ b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/GetWagonTests.java
@@ -128,7 +128,7 @@ public class GetWagonTests
 
                     if ( getWagon() instanceof StreamWagon )
                     {
-                        logger.info( "Connection timeout is: " + ( (StreamWagon) getWagon()
).getTimeout() );
+                        logger.info( "Connection timeout is: " + getWagon().getTimeout()
);
                     }
 
                     File target = newTempFile();
@@ -510,7 +510,7 @@ public class GetWagonTests
 
         if ( getWagon() instanceof StreamWagon )
         {
-            logger.info( "Connection timeout is: " + ( (StreamWagon) getWagon() ).getTimeout()
);
+            logger.info( "Connection timeout is: " + getWagon().getTimeout() );
         }
 
         File target = newTempFile();

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/0d6d1f3a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/LatencyServlet.java
----------------------------------------------------------------------
diff --git a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/LatencyServlet.java
b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/LatencyServlet.java
index a4fa54f..df9487b 100644
--- a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/LatencyServlet.java
+++ b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/LatencyServlet.java
@@ -87,7 +87,7 @@ public class LatencyServlet
             logger.info( "Starting high-latency transfer. This should take about "
                 + ( ( f.length() / BUFFER_SIZE * latencyMs / 1000 ) + ( latencyMs / 1000
) ) + " seconds." );
 
-            int read = -1;
+            int read;
             byte[] buf = new byte[BUFFER_SIZE];
             while ( ( read = in.read( buf ) ) > -1 )
             {


Mime
View raw message