In java 7 to 9, ``++FileInputStream++`` and ``++FileOutputStream++`` rely on finalization to perform final closes if the stream is not already closed. Whether or not the stream is already closed, the finalizer will be called, resulting in extra work for the garbage collector. This can easily be avoided using the ``++Files++`` API.
=== on 21 Feb 2019, 11:32:51 Tobias Gruetzmacher wrote:
Since I just debugged an issue with that class, I'd propose to add ``++java.util.zip.ZipFile++`` to the "dangerous" classes with finalizer... Using an ``++java.util.zip.ZipInputStream++`` avoids the finalizer.
=== on 21 Feb 2019, 11:56:44 Alexandre Gigleux wrote:
Hello [~tobix],
Can you open a thread on \https://community.sonarsource.com/c/suggestions/rules so we can get more details about the problem you faced? It's much more convenient than using JIRA Comments.