Summary: Infer can then detect the resource leak when resources are stored into a container
Reviewed By: sblackshear
Differential Revision: D5887702
fbshipit-source-id: 6106cfb
master
Jeremy Dubreil7 years agocommitted byFacebook Github Bot
codetoanalyze/java/infer/CloseableAsResourceExample.java, T CloseableAsResourceExample.sourceOfNullWithResourceLeak(), 1, RESOURCE_LEAK, [start of procedure sourceOfNullWithResourceLeak(),start of procedure SomeResource(),return from a call to SomeResource.<init>()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.failToCloseWithCloseQuietly(), 5, RESOURCE_LEAK, [start of procedure failToCloseWithCloseQuietly(),start of procedure SomeResource(),return from a call to SomeResource.<init>(),start of procedure doSomething(),Taking true branch,start of procedure LocalException(),return from a call to LocalException.<init>(),exception codetoanalyze.java.infer.LocalException,return from a call to void SomeResource.doSomething()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.leakFoundWhenIndirectlyImplementingCloseable(), 1, RESOURCE_LEAK, [start of procedure leakFoundWhenIndirectlyImplementingCloseable(),start of procedure CloseableAsResourceExample$MyResource(...),return from a call to CloseableAsResourceExample$MyResource.<init>(CloseableAsResourceExample)]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.notClearinglocalMapContainingResourcesBad(), 4, RESOURCE_LEAK, [start of procedure notClearinglocalMapContainingResourcesBad(),start of procedure SomeResource(),return from a call to SomeResource.<init>()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.notClosingCloseable(), 1, RESOURCE_LEAK, [start of procedure notClosingCloseable(),start of procedure SomeResource(),return from a call to SomeResource.<init>()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.notClosingWrapper(), 2, RESOURCE_LEAK, [start of procedure notClosingWrapper(),start of procedure Resource(),return from a call to Resource.<init>(),start of procedure Sub(...),start of procedure Wrapper(...),return from a call to Wrapper.<init>(Resource),return from a call to Sub.<init>(Resource),start of procedure close(),return from a call to void Resource.close()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.skippedVritualCallDoesNotCloseResourceOnReceiver(), 2, RESOURCE_LEAK, [start of procedure skippedVritualCallDoesNotCloseResourceOnReceiver(),start of procedure SomeResource(),return from a call to SomeResource.<init>(),Skipping foo(...): method has no implementation]
codetoanalyze/java/infer/CloseableAsResourceExample.java, T CloseableAsResourceExample.sourceOfNullWithResourceLeak(), 1, RESOURCE_LEAK, [start of procedure sourceOfNullWithResourceLeak(),start of procedure SomeResource(),return from a call to SomeResource.<init>()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.failToCloseWithCloseQuietly(), 5, RESOURCE_LEAK, [start of procedure failToCloseWithCloseQuietly(),start of procedure SomeResource(),return from a call to SomeResource.<init>(),start of procedure doSomething(),Taking true branch,start of procedure LocalException(),return from a call to LocalException.<init>(),exception codetoanalyze.java.infer.LocalException,return from a call to void SomeResource.doSomething()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.leakFoundWhenIndirectlyImplementingCloseable(), 1, RESOURCE_LEAK, [start of procedure leakFoundWhenIndirectlyImplementingCloseable(),start of procedure CloseableAsResourceExample$MyResource(...),return from a call to CloseableAsResourceExample$MyResource.<init>(CloseableAsResourceExample)]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.notClearinglocalMapContainingResourcesBad(), 4, RESOURCE_LEAK, [start of procedure notClearinglocalMapContainingResourcesBad(),start of procedure SomeResource(),return from a call to SomeResource.<init>()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.notClosingCloseable(), 1, RESOURCE_LEAK, [start of procedure notClosingCloseable(),start of procedure SomeResource(),return from a call to SomeResource.<init>()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.notClosingWrapper(), 2, RESOURCE_LEAK, [start of procedure notClosingWrapper(),start of procedure Resource(),return from a call to Resource.<init>(),start of procedure Sub(...),start of procedure Wrapper(...),return from a call to Wrapper.<init>(Resource),return from a call to Sub.<init>(Resource),start of procedure close(),return from a call to void Resource.close()]
codetoanalyze/java/infer/CloseableAsResourceExample.java, void CloseableAsResourceExample.skippedVritualCallDoesNotCloseResourceOnReceiver(), 2, RESOURCE_LEAK, [start of procedure skippedVritualCallDoesNotCloseResourceOnReceiver(),start of procedure SomeResource(),return from a call to SomeResource.<init>(),Skipping foo(...): method has no implementation]