harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r478538 - in /harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio: CharSequenceAdapter.java ReadOnlyCharArrayBuffer.java
Date Thu, 23 Nov 2006 11:38:45 GMT
Author: tellison
Date: Thu Nov 23 03:38:40 2006
New Revision: 478538

URL: http://svn.apache.org/viewvc?view=rev&rev=478538
Log:
Remove unnecessary null checks found by FindBugs tool.

Modified:
    harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharSequenceAdapter.java
    harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyCharArrayBuffer.java

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharSequenceAdapter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharSequenceAdapter.java?view=diff&rev=478538&r1=478537&r2=478538
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharSequenceAdapter.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/CharSequenceAdapter.java
Thu Nov 23 03:38:40 2006
@@ -125,20 +125,12 @@
             throw new BufferOverflowException();
         }
         
-        if(src == null){
-            throw new NullPointerException();
-        }
-        
         throw new ReadOnlyBufferException();
     }
 
     public CharBuffer put(String src, int start, int end) {
-        int length = src.length();
-        if ((start < 0 ) || (end < 0) || (long)start + (long)end > length) {
+        if ((start < 0 ) || (end < 0) || (long)start + (long)end > src.length())
{
             throw new IndexOutOfBoundsException();
-        }
-        if(src == null){
-            throw new NullPointerException();
         }
         throw new ReadOnlyBufferException();
     }  

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyCharArrayBuffer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyCharArrayBuffer.java?view=diff&rev=478538&r1=478537&r2=478538
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyCharArrayBuffer.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/java/nio/ReadOnlyCharArrayBuffer.java
Thu Nov 23 03:38:40 2006
@@ -92,9 +92,6 @@
         if ((start < 0 ) || (end < 0) || (long)start + (long)end > src.length())
{
             throw new IndexOutOfBoundsException();
         }
-        if(src == null){
-            throw new NullPointerException();
-        }
         throw new ReadOnlyBufferException();
     }
 
@@ -102,5 +99,4 @@
 		return new ReadOnlyCharArrayBuffer(remaining(), backingArray, offset
 				+ position);
 	}
-
 }



Mime
View raw message