[ 
https://issues.apache.org/jira/browse/HADOOP-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066537#comment-13066537
 ] 

Harsh J commented on HADOOP-1859:
---------------------------------

I do not think this still applies. While an old post like 
http://badcheese.com/?q=node/80 tells me there used to be a Buffer subclass in 
FSInputDataStream that threw this before, it does not really exist anymore.

If I load an FSDataInputStream via a LocalFileSystem#open(…) in a test case and 
wrap it to a BufferedInputStream, close the latter and issue 
BufferedInputStream#available, it throws a stream-closed IO exception 
appropriately. There is no BufferedInputStream#getPos, however.

Along the same lines, DFSInputStream recently added a closed-so-ioexception in 
itself to protect against post-closed seeks, but there the closes were managed 
directly. HDFS-1615.

This one looks fixed, meanwhile, due to all the refactoring since '07. Do 
reopen if I've got all of this wrong.

> FSInputDataStream.getPos throws null pointer exception when file has been 
> closed
> --------------------------------------------------------------------------------
>
>                 Key: HADOOP-1859
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1859
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.14.1
>            Reporter: Benjamin Reed
>
> If an FSInputDataStream object has been closed, invoking getPos() will cause 
> a NullPointerException. This is because BufferedInputStream.close() sets in 
> to null, and Buffer.getPos() does not check for in being null.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to