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

ASF GitHub Bot commented on IGNITE-9165:
----------------------------------------

GitHub user zzzadruga opened a pull request:

    https://github.com/apache/ignite/pull/4481

     IGNITE-9165 Close streams in core module

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zzzadruga/ignite IGNITE-9165

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/4481.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4481
    
----
commit f4d542b6bd426ae7fb6546d5c0654fa0cb9b41a4
Author: zzzadruga <zzzadruga@...>
Date:   2018-08-03T07:28:05Z

    IGNITE-9165 Close streams

commit be4c168078c56cef9930322bab9350e3fde41205
Author: zzzadruga <zzzadruga@...>
Date:   2018-08-03T07:58:06Z

    IGNITE-9165 Remove unused import

----


> FindBugs: Methods may fail to close stream in core module
> ---------------------------------------------------------
>
>                 Key: IGNITE-9165
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9165
>             Project: Ignite
>          Issue Type: Bug
>          Components: binary
>    Affects Versions: 2.6
>            Reporter: Nikolai Kulagin
>            Assignee: Nikolai Kulagin
>            Priority: Minor
>              Labels: newbie
>             Fix For: 2.7
>
>         Attachments: 
> findbugs-result-apache-ignite[ignite-core]_2018_08_02_12_38_02.html
>
>
> The method creates an IO stream object, does not assign it to any fields, 
> pass it to other methods that might close it, or return it, and does not 
> appear to close the stream on all paths out of the method.  This may result 
> in a file descriptor leak.
> Example:
>  
> {code:java}
> // GridCacheAbstractLoadTest#GridCacheAbstractLoadTest()
> try {
>  props.load(new FileReader(GridTestUtils.resolveIgnitePath(
>  "modules/tests/config/cache-load.properties")));
> }
> catch (IOException e) {
>  throw new RuntimeException(e);
> }{code}
>  
>  One of possible solutions:
> {code:java}
> try(Reader reader = new FileReader(GridTestUtils.resolveIgnitePath(
>     "modules/tests/config/cache-load.properties"))) {
>     props.load(reader);
> }
> catch (IOException e) {
>     throw new RuntimeException(e);
> }{code}
> List of classes in "core" module:
>   
>  +org.apache.ignite.internal:+   
>  * *BinaryContext*#classesInPackage(String)
>  * *GridClientJdkMarshaller*#marshal(Object, int)
>  * 
> *IgniteExplicitImplicitDeploymentSelfTest*$GridDeploymentResourceTestJob#execute()
>  * *OptimizedObjectStreamSelfTest*#testReadLine()
>  * *PageIdDistributionTest*#_testRealHistory()
>  * *HttpIgniteUpdatesChecker*#getUpdates(boolean)
>  * *IpcSharedMemoryNativeLoaderSelfTest*#readStreams(Process)
> +org.apache.ignite:+
>  * *GridCacheAbstractLoadTest*#GridCacheAbstractLoadTest()
>  * *GridTestUtils*.sslContext()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to