harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r820625 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java
Date Thu, 01 Oct 2009 12:22:22 GMT
Author: tellison
Date: Thu Oct  1 12:22:22 2009
New Revision: 820625

URL: http://svn.apache.org/viewvc?rev=820625&view=rev
Log:
Make the check for a null argument explicit.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java?rev=820625&r1=820624&r2=820625&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java
Thu Oct  1 12:22:22 2009
@@ -69,9 +69,14 @@
         super();
         SecurityManager security = System.getSecurityManager();
         if (security != null) {
+            // For compatibility, nulls are passed to the manager.
             String filePath = (null == file ? null : file.getPath());
             security.checkRead(filePath);
         }
+        if (file == null) {
+            // KA001=Argument must not be null
+            throw new NullPointerException(Msg.getString("KA001")); //$NON-NLS-1$
+        }
         fd = new FileDescriptor();
         fd.readOnly = true;
         fd.descriptor = fileSystem.open(file.properPath(true),



Mime
View raw message