You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2007/02/17 10:13:08 UTC

svn commit: r508742 - in /incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src: main/java/org/apache/tuscany/core/util/ test/java/org/apache/tuscany/core/services/deployment/

Author: lresende
Date: Sat Feb 17 01:13:08 2007
New Revision: 508742

URL: http://svn.apache.org/viewvc?view=rev&rev=508742
Log:
PMD and CheckStyle changes

Modified:
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/FileHelper.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/IOHelper.java
    incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/FileHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/FileHelper.java?view=diff&rev=508742&r1=508741&r2=508742
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/FileHelper.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/FileHelper.java Sat Feb 17 01:13:08 2007
@@ -39,6 +39,10 @@
      * The Windows separator character.
      */
     private static final char WINDOWS_SEPARATOR = '\\';
+    
+    protected FileHelper() {
+        
+    }
     /**
      * Returns the index of the last directory separator character.
      * <p>
@@ -79,7 +83,7 @@
         }
         int extensionPos = filename.lastIndexOf(EXTENSION_SEPARATOR);
         int lastSeparator = indexOfLastSeparator(filename);
-        return (lastSeparator > extensionPos ? -1 : extensionPos);
+        return lastSeparator > extensionPos ? -1 : extensionPos;
     }
     
     /**
@@ -267,7 +271,7 @@
             return null;
         } else {
             String filename = url.getFile().replace('/', File.separatorChar);
-            int pos =0;
+            int pos = 0;
             while ((pos = filename.indexOf('%', pos)) >= 0) {
                 if (pos + 2 < filename.length()) {
                     String hexStr = filename.substring(pos + 1, pos + 3);

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/IOHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/IOHelper.java?view=diff&rev=508742&r1=508741&r2=508742
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/IOHelper.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/IOHelper.java Sat Feb 17 01:13:08 2007
@@ -28,6 +28,10 @@
      * The default buffer size to use.
      */
     private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
+    
+    protected IOHelper() {
+        
+    }
 
     /**
      * Unconditionally close an <code>InputStream</code>.
@@ -79,8 +83,7 @@
      * @throws IOException if an I/O error occurs
      * @since Commons IO 1.1
      */
-    public static int copy(InputStream input, OutputStream output)
-            throws IOException {
+    public static int copy(InputStream input, OutputStream output) throws IOException {
         byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
         int count = 0;
         int n = 0;

Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java?view=diff&rev=508742&r1=508741&r2=508742
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java Sat Feb 17 01:13:08 2007
@@ -20,27 +20,26 @@
 
 import java.net.URL;
 
-import org.apache.tuscany.core.services.deployment.ContentTypeDescriberImpl;
-
 import junit.framework.TestCase;
 
 public class ContentTypeDescriberImplTestCase extends TestCase {
     private ContentTypeDescriberImpl contentTypeBuilder;
 
-    public void testResolveContentType() throws Exception{
+    public void testResolveContentType() throws Exception {
         URL artifactURL = getClass().getResource("test.scdl");
         assertEquals("application/v.tuscany.scdl", contentTypeBuilder.getContentType(artifactURL, null));
     }
 
     
-    public void testUnknownResolveContentType() throws Exception{
+    public void testUnknownResolveContentType() throws Exception {
         URL artifactURL = getClass().getResource("test.ext");
         assertNull(contentTypeBuilder.getContentType(artifactURL, null));
     }
     
-    public void testDefaultContentType() throws Exception{
+    public void testDefaultContentType() throws Exception {
         URL artifactURL = getClass().getResource("test.ext");
-        assertEquals("application/v.tuscany.ext", contentTypeBuilder.getContentType(artifactURL, "application/v.tuscany.ext"));        
+        assertEquals("application/v.tuscany.ext", 
+                contentTypeBuilder.getContentType(artifactURL, "application/v.tuscany.ext"));        
     }
 
     protected void setUp() throws Exception {



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org