From e17e157ae1546d5581ccf7954dbf1df85a8462bc Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Tue, 26 Sep 2017 11:26:32 -0700 Subject: [PATCH] [infer][java] no longer combine the type environment with the type environment of the models Summary: This is no longer necessary Reviewed By: sblackshear Differential Revision: D5893926 fbshipit-source-id: 2f5f528 --- infer/models/java/src/java/lang/Process.java | 2 +- infer/models/java/src/java/lang/ProcessManager.java | 10 +--------- infer/src/java/jMain.ml | 1 - infer/tests/codetoanalyze/java/infer/issues.exp | 1 - infer/tests/codetoanalyze/java/tracing/issues.exp | 2 ++ 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/infer/models/java/src/java/lang/Process.java b/infer/models/java/src/java/lang/Process.java index 5034a6d3b..41e2b422e 100644 --- a/infer/models/java/src/java/lang/Process.java +++ b/infer/models/java/src/java/lang/Process.java @@ -14,7 +14,7 @@ import com.facebook.infer.builtins.InferUndefined; import java.io.FileDescriptor; -public abstract class Process { +public class Process { public Process(int pid, FileDescriptor in, FileDescriptor out, FileDescriptor err) { InferBuiltins.__set_file_attribute(this); diff --git a/infer/models/java/src/java/lang/ProcessManager.java b/infer/models/java/src/java/lang/ProcessManager.java index 8537247d1..b62ea9b52 100644 --- a/infer/models/java/src/java/lang/ProcessManager.java +++ b/infer/models/java/src/java/lang/ProcessManager.java @@ -28,17 +28,9 @@ abstract class ProcessManager { FileDescriptor out = new FileDescriptor(); FileDescriptor err = new FileDescriptor(); - ProcessImpl process = new ProcessImpl(InferUndefined.int_undefined(), in, out, err); - return process; + return new Process(InferUndefined.int_undefined(), in, out, err); } public static native ProcessManager getInstance(); - static class ProcessImpl extends Process { - - ProcessImpl(int pid, FileDescriptor in, FileDescriptor out, FileDescriptor err) { - super(pid, in, out, err); - } - } - } diff --git a/infer/src/java/jMain.ml b/infer/src/java/jMain.ml index 91a17e176..c34e8302b 100644 --- a/infer/src/java/jMain.ml +++ b/infer/src/java/jMain.ml @@ -79,7 +79,6 @@ let load_tenv () = (* Store to a file the type environment containing all the types required to perform the analysis *) let save_tenv tenv = - if not Config.models_mode then JTransType.add_models_types tenv ; (* TODO: this prevents per compilation step incremental analysis at this stage *) if DB.file_exists DB.global_tenv_fname then DB.file_remove DB.global_tenv_fname ; L.(debug Capture Medium) "writing new tenv %s@." (DB.filename_to_string DB.global_tenv_fname) ; diff --git a/infer/tests/codetoanalyze/java/infer/issues.exp b/infer/tests/codetoanalyze/java/infer/issues.exp index a80fcd7a9..7f4f3f9c8 100644 --- a/infer/tests/codetoanalyze/java/infer/issues.exp +++ b/infer/tests/codetoanalyze/java/infer/issues.exp @@ -174,7 +174,6 @@ codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.closeWithCloseab codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.closedQuietlyWithCloseables(), 5, UNINITIALIZED_VALUE, [start of procedure closedQuietlyWithCloseables(),exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.closedWithCloseables(), 5, UNINITIALIZED_VALUE, [start of procedure closedWithCloseables(),exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.contextObtainTypedArrayAndLeak(Context), 2, RESOURCE_LEAK, [start of procedure contextObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(TypedArray)] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.copyFileLeak(File,File), 6, UNINITIALIZED_VALUE, [start of procedure copyFileLeak(...),exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.copyFileLeak(File,File), 11, RESOURCE_LEAK, [start of procedure copyFileLeak(...),Skipping transferTo(...): unknown method,Taking true branch,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.copyFileLeak(File,File), 11, RESOURCE_LEAK, [start of procedure copyFileLeak(...),exception java.io.FileNotFoundException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.deflaterLeak(), 1, RESOURCE_LEAK, [start of procedure deflaterLeak()] diff --git a/infer/tests/codetoanalyze/java/tracing/issues.exp b/infer/tests/codetoanalyze/java/tracing/issues.exp index 46fe65489..8c28ad412 100644 --- a/infer/tests/codetoanalyze/java/tracing/issues.exp +++ b/infer/tests/codetoanalyze/java/tracing/issues.exp @@ -25,7 +25,9 @@ codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions. codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionArrayLength(), 3, java.lang.NullPointerException, [start of procedure nullPointerExceptionArrayLength(),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionArrayLength()] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionCallArrayReadMethod(), 3, java.lang.NullPointerException, [start of procedure nullPointerExceptionCallArrayReadMethod(),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionCallArrayReadMethod()] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionCallArrayReadMethod(), 3, java.lang.NullPointerException, [start of procedure nullPointerExceptionCallArrayReadMethod(),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionCallArrayReadMethod()] +codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionFromFailingFileOutputStreamConstructor(), 7, UNINITIALIZED_VALUE, [start of procedure nullPointerExceptionFromFailingFileOutputStreamConstructor(),exception java.io.FileNotFoundException,Switch condition is false. Skipping switch case] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionFromFailingFileOutputStreamConstructor(), 9, java.lang.NullPointerException, [start of procedure nullPointerExceptionFromFailingFileOutputStreamConstructor(),Taking true branch,return from a call to void NullPointerExceptions.nullPointerExceptionFromFailingFileOutputStreamConstructor()] +codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionFromFaillingResourceConstructor(), 6, UNINITIALIZED_VALUE, [start of procedure nullPointerExceptionFromFaillingResourceConstructor(),exception java.io.FileNotFoundException,Switch condition is false. Skipping switch case] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionFromFaillingResourceConstructor(), 8, java.lang.NullPointerException, [start of procedure nullPointerExceptionFromFaillingResourceConstructor(),Taking true branch,return from a call to void NullPointerExceptions.nullPointerExceptionFromFaillingResourceConstructor()] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionUnlessFrameFails(), 6, java.lang.NullPointerException, [start of procedure nullPointerExceptionUnlessFrameFails(),start of procedure NullPointerExceptions$A(...),return from a call to NullPointerExceptions$A.(NullPointerExceptions),start of procedure frame(...),start of procedure id_generics(...),Taking true branch,return from a call to Object NullPointerExceptions.id_generics(NullPointerExceptions$A),Taking true branch,return from a call to NullPointerExceptions$A NullPointerExceptions.frame(NullPointerExceptions$A),Taking true branch,exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionUnlessFrameFails()] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionWithNullArrayParameter(), 2, java.lang.NullPointerException, [start of procedure nullPointerExceptionWithNullArrayParameter(),start of procedure expectNotNullArrayParameter(...),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.expectNotNullArrayParameter(codetoanalyze.java.infer.NullPointerExceptions$A[]),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionWithNullArrayParameter()]