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

Adrien Grand commented on LUCENE-7789:
--------------------------------------

+1 We could still use the {{@SuppressForbidden}} annotation if there are rare 
cases that actually need a FileInputStream or a FileOutputStream.

> replace & forbid "new FileInputStream" and "new FileOutputStream" with 
> Files.newInputStream & Files.newOutputStream
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-7789
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7789
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Hoss Man
>
> I haven't looked into the details of this much, but saw these links today and 
> thought it would be worth opening a jira for discussion...
> * 
> https://dzone.com/articles/fileinputstream-fileoutputstream-considered-harmful
> * https://issues.jenkins-ci.org/browse/JENKINS-42934
> * https://bugs.openjdk.java.net/browse/JDK-8080225
> The crux of the issue being that the "FileInputStream" and "FileOutputStream" 
> classes have finalizer methods with GC overhead that can be avoided using 
> Files.newInputStream and Files.newOutputStream in their place.
> This seems like it would make these methods good candidates for forbidding in 
> lucene/solr (if possible).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to