Reviewed By: jberdine Differential Revision: D4329630 fbshipit-source-id: ae49e3emaster
parent
ebb75d6171
commit
5ffd9e3a7b
@ -1,17 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"bug_type": "NULL_DEREFERENCE",
|
|
||||||
"file": "Hello.java",
|
|
||||||
"procedure": "void Hello.mayCauseNPE()"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"bug_type": "RESOURCE_LEAK",
|
|
||||||
"file": "Hello.java",
|
|
||||||
"procedure": "void Hello.mayLeakResource()"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"bug_type": "RESOURCE_LEAK",
|
|
||||||
"file": "Hello.java",
|
|
||||||
"procedure": "void Hello.twoResources()"
|
|
||||||
}
|
|
||||||
]
|
|
@ -0,0 +1,26 @@
|
|||||||
|
# Copyright (c) 2016 - present Facebook, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This source code is licensed under the BSD style license found in the
|
||||||
|
# LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
# of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
|
TESTS_DIR = ../..
|
||||||
|
ROOT_DIR = $(TESTS_DIR)/../..
|
||||||
|
|
||||||
|
ANALYZER = infer
|
||||||
|
SOURCES_DIR = $(ROOT_DIR)/examples/java_hello
|
||||||
|
SOURCES = $(wildcard $(SOURCES_DIR)/*.java)
|
||||||
|
# no objects since we only run a mock gradle that cannot compile Java sources
|
||||||
|
OBJECTS =
|
||||||
|
INFERPRINT_OPTIONS = --issues-tests
|
||||||
|
|
||||||
|
include $(TESTS_DIR)/java.make
|
||||||
|
include $(TESTS_DIR)/base.make
|
||||||
|
|
||||||
|
infer-out/report.json: $(JAVA_DEPS) $(SOURCES)
|
||||||
|
# mock version of gradle
|
||||||
|
PATH=$(CURDIR)/../mock:"$$PATH"; \
|
||||||
|
cd $(SOURCES_DIR) && \
|
||||||
|
$(call silent_on_success,\
|
||||||
|
$(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/infer-out -- gradle build)
|
@ -0,0 +1,3 @@
|
|||||||
|
Hello.java, void Hello.mayCauseNPE(), 4, NULL_DEREFERENCE, [start of procedure mayCauseNPE(),start of procedure mayReturnNull(...),Taking false branch,return from a call to Pointers$A Pointers.mayReturnNull(int)]
|
||||||
|
Hello.java, void Hello.mayLeakResource(), 7, RESOURCE_LEAK, [start of procedure mayLeakResource(),start of procedure allocateResource(),return from a call to FileOutputStream Resources.allocateResource(),Taking false branch]
|
||||||
|
Hello.java, void Hello.twoResources(), 11, RESOURCE_LEAK, [start of procedure twoResources(),exception java.io.IOException,Switch condition is true. Entering switch case,Taking true branch,exception java.io.IOException]
|
Loading…
Reference in new issue