Summary:
This addresses a test difference between java versions. Infer's java tests are recorded with Java8 where string concat with a constant string uses `toString`. However, if tests are run on a machine where Java 11 is used, string concat is done via `makeConcatWithConstants` which causes tests to fail.
As a workaround, we replace the test so that Java version dependent string concat is not used.
Reviewed By: ngorogiannis
Differential Revision: D27394621
fbshipit-source-id: dfe1af2ac
master
Ezgi Çiçek4 years agocommitted byFacebook GitHub Bot
codetoanalyze/java/biabduction/NullPointerExceptions.java, codetoanalyze.java.infer.NullPointerExceptions.someNPEAfterResourceLeak():void, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure someNPEAfterResourceLeak(),start of procedure sourceOfNullWithResourceLeakBad(),start of procedure SomeResource(),return from a call to SomeResource.<init>(),return from a call to T CloseableAsResourceExample.sourceOfNullWithResourceLeakBad()]
codetoanalyze/java/biabduction/NullPointerExceptions.java, codetoanalyze.java.infer.NullPointerExceptions.stringVarEqualsFalseNPE():void, 5, NULL_DEREFERENCE, B1, ERROR, [start of procedure stringVarEqualsFalseNPE(),start of procedure getString2(),return from a call to String NullPointerExceptions.getString2(),Skipping toString(): unknown method,Taking true branch]
codetoanalyze/java/biabduction/NullPointerExceptions.java, codetoanalyze.java.infer.NullPointerExceptions.stringVarEqualsFalseNPE():void, 5, NULL_DEREFERENCE, B1, ERROR, [start of procedure stringVarEqualsFalseNPE(),start of procedure getString2(),return from a call to String NullPointerExceptions.getString2(),Taking true branch]
codetoanalyze/java/biabduction/NullPointerExceptions.java, codetoanalyze.java.infer.NullPointerExceptions.testSystemGetPropertyArgument():java.lang.String, 1, NULL_DEREFERENCE, B1, ERROR, [start of procedure testSystemGetPropertyArgument()]
codetoanalyze/java/biabduction/NullPointerExceptions.java, codetoanalyze.java.infer.NullPointerExceptions.testSystemGetPropertyReturn():void, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure testSystemGetPropertyReturn()]
codetoanalyze/java/biabduction/NullPointerExceptions.java, codetoanalyze.java.infer.NullPointerExceptions.tryLockThrows(java.nio.channels.FileChannel):java.lang.String, 6, NULL_DEREFERENCE, B1, ERROR, [start of procedure tryLockThrows(...),exception java.io.IOException,Switch condition is true. Entering switch case]