You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2009/10/01 14:22:22 UTC
svn commit: r820625 -
/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java
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),