FIX: java.lang.Object should be java/lang/Object.
authorCyrille Artho <artho@kth.se>
Sat, 24 Nov 2018 10:17:37 +0000 (11:17 +0100)
committerCyrille Artho <artho@kth.se>
Sat, 24 Nov 2018 10:17:37 +0000 (11:17 +0100)
modified:   src/main/gov/nasa/jpf/vm/Types.java: Fixed incorrect type descr.
modified:   src/tests/gov/nasa/jpf/test/java/lang/ClassTest.java: Unit test.

src/main/gov/nasa/jpf/vm/Types.java
src/tests/gov/nasa/jpf/test/java/lang/ClassTest.java

index fb4add6cc3acba6b8dcb649c53a29451ce15c1b8..ee64f70a8a2ad9c735e44a20b6006288bdfc7aa4 100644 (file)
@@ -415,9 +415,9 @@ public class Types {
    * 
    * int    -> int
    * int[]  -> [I
-   * String -> java.lang.String
-   * String[] -> [Ljava.lang.String;
-   * String[][] -> [[Ljava.lang.String;
+   * String -> java/lang/String
+   * String[] -> [Ljava/lang/String;
+   * String[][] -> [[Ljava/lang/String;
    * 
    * <2do> this is really not very efficient
    */
@@ -1020,7 +1020,7 @@ public class Types {
   public static boolean instanceOf (String type, String ofType) {
     int bType = getBuiltinTypeFromSignature(type);
 
-    if ((bType == T_ARRAY) && ofType.equals("Ljava.lang.Object;")) {
+    if ((bType == T_ARRAY) && ofType.equals("Ljava/lang/Object;")) {
       return true;
     }
 
index 5d7e1d69ce025da9d2b0c36d805b37fa98c378d8..f20f5a8626d71108261535304c116788e78a3ccc 100644 (file)
@@ -582,4 +582,12 @@ public class ClassTest extends TestJPF implements Cloneable, Serializable {
       assertNull(c.getResource("not_existing_resources"));
     }
   }  
+
+  @Test
+  public void instanceOfArrayTest() {
+    String[] args = new String[0];
+    if (verifyNoPropertyViolation()) {
+      assert args instanceof Object;
+    }
+  }
 }