From bec5bafc72ad949263c4c965f7da6f638d0d2beb Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Wed, 24 Jun 2015 08:00:48 -0200 Subject: [PATCH] [java] Upstream support for class names with $dollar (requires "opam update") --- INSTALL.md | 4 ++-- .../codetoanalyze/java/infer/NullPointerExceptions.java | 6 ++++++ .../tests/endtoend/java/infer/NullPointerExceptionTest.java | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 764aff9a7..d03a49295 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -49,7 +49,7 @@ Install the OCaml dependencies: ```bash opam init --comp=4.01.0 # (answer 'y' to the question) eval `opam config env` -opam install sawja.1.5 atdgen.1.5.0 javalib.2.3 extlib.1.5.4 +opam install sawja.1.5 atdgen.1.5.0 javalib.2.3a extlib.1.5.4 ``` If you do not require support for the C/Objective-C analysis in Infer, @@ -93,7 +93,7 @@ wget https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Lin chmod +x opam ./opam init --comp=4.01.0 #(then say 'y' to the final question) eval `./opam config env` -./opam install sawja.1.5 atdgen.1.5.0 javalib.2.3 extlib.1.5.4 #(then say 'y' to the question) +./opam install sawja.1.5 atdgen.1.5.0 javalib.2.3a extlib.1.5.4 #(then say 'y' to the question) ``` If you do not require support for the C/Objective-C analysis in Infer, diff --git a/infer/tests/codetoanalyze/java/infer/NullPointerExceptions.java b/infer/tests/codetoanalyze/java/infer/NullPointerExceptions.java index 9d1a5fdd4..2d04b42fa 100644 --- a/infer/tests/codetoanalyze/java/infer/NullPointerExceptions.java +++ b/infer/tests/codetoanalyze/java/infer/NullPointerExceptions.java @@ -323,4 +323,10 @@ public class NullPointerExceptions { int i = arr.length; } + class $$Class$Name$With$Dollars { + void npeWithDollars() { + String s = null; + int n = s.length(); + } + } } diff --git a/infer/tests/endtoend/java/infer/NullPointerExceptionTest.java b/infer/tests/endtoend/java/infer/NullPointerExceptionTest.java index eee08c811..b49b1036f 100644 --- a/infer/tests/endtoend/java/infer/NullPointerExceptionTest.java +++ b/infer/tests/endtoend/java/infer/NullPointerExceptionTest.java @@ -54,7 +54,8 @@ public class NullPointerExceptionTest { "nullableFieldNPE", "nullableParamNPE", "badCheckShouldCauseNPE", - "nullPointerExceptionArrayLength" + "nullPointerExceptionArrayLength", + "npeWithDollars" }; assertThat( "Results should contain " + NULL_DEREFERENCE,