You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/03/11 08:18:32 UTC

[GitHub] [commons-vfs] boris-petrov commented on pull request #155: FileContentThreadData: lazy ArrayList initialization to save memory

boris-petrov commented on pull request #155:
URL: https://github.com/apache/commons-vfs/pull/155#issuecomment-796556036


   @MaxKellermann, @garydgregory - this commit (I think) causes my tests to fail with NPEs on version 2.8.0:
   
   ```
   Caused by: java.lang.NullPointerException: Cannot invoke "java.util.ArrayList.remove(Object)" because "this.inputStreamList" is null
   	at org.apache.commons.vfs2.provider.FileContentThreadData.remove(FileContentThreadData.java:82)
   	at org.apache.commons.vfs2.provider.DefaultFileContent.endInput(DefaultFileContent.java:555)
   	at org.apache.commons.vfs2.provider.DefaultFileContent.access$000(DefaultFileContent.java:44)
   	at org.apache.commons.vfs2.provider.DefaultFileContent$FileContentInputStream.onClose(DefaultFileContent.java:662)
   	at org.apache.commons.vfs2.util.MonitorInputStream.close(MonitorInputStream.java:92)
   	at org.apache.commons.vfs2.provider.DefaultFileContent$FileContentInputStream.close(DefaultFileContent.java:648)
   ```
   
   Isn't there a test that gets a file's content and then closes it right after that? I think that will reproduce the problem.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org