[infer][java] For the lazy dynamic dispatch algorithm, only specialize the methods on object parameters
[infer][java] For the lazy dynamic dispatch algorithm, only specialize the methods on object parameters

Summary:
The specialization of the methods based on the type of the arguments should only be performed when the type is an object type. This should in theory be always the case according to the Java semantics but the previous version of the code was relying on Infer to be correct all the way down the the method call:

Before this diff, the analysis on examples like this:

  String foo(Object object) {
     object.toString();
  }

  String bar() {
    int[] array = {1, 2, 3};
    foo(array);
  }

This is a legit code that Infer is getting wrong because Java objects are translated as C objects instead of objects containing a C-style object. There may be other issues like this so it is safer to filter out the types when performing the substitution.

Reviewed By: jberdine

Differential Revision: D4345760

fbshipit-source-id: 1c74593

jsachs/infer,blzq/infer,xennygrimmato/infer,ryoon/infer,xennygrimmato/infer,xennygrimmato/infer,blzq/infer,jsachs/infer,facebook/infer,jsachs/infer,kageiit/infer,jvillard/infer,jsachs/infer,ropas/infer,facebook/infer,ryoon/infer,ropas/infer,blzq/infer,jsachs/infer,xennygrimmato/infer,facebook/infer,kageiit/infer,ropas/infer,xennygrimmato/infer,jvillard/infer,jvillard/infer,kageiit/infer,jsachs/infer,xennygrimmato/infer,ropas/infer,xennygrimmato/infer,facebook/infer,facebook/infer,ryoon/infer,ropas/infer,ropas/infer,blzq/infer,kageiit/infer,kageiit/infer,jvillard/infer,jvillard/infer,ryoon/infer,kageiit/infer,blzq/infer,facebook/infer,blzq/infer,ryoon/infer,jvillard/infer,jvillard/infer,ryoon/infer,facebook/infer,kageiit/infer