X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=kona%2Fsrc%2Ftest%2Fjava%2Fsemantics%2Finstance_of.java;h=47d2d826fb302bda29993097cd9d5685af7b44f3;hb=50b49f257f5bf55707e8e9b63754c0bed07afb46;hp=3900856608dec7fbfae8d314f62348c67847fe7d;hpb=67d3d9a5e40685d3898f34a3651944c8a0c3e2ca;p=feisty_meow.git diff --git a/kona/src/test/java/semantics/instance_of.java b/kona/src/test/java/semantics/instance_of.java index 39008566..47d2d826 100644 --- a/kona/src/test/java/semantics/instance_of.java +++ b/kona/src/test/java/semantics/instance_of.java @@ -1,29 +1,29 @@ - - package test.java.semantics; import java.util.List; +//hmmm: convert this to simple unit test. class instance_of { - public instance_of() {} - - public Object cogitate() { - return null; - } + public instance_of() + { + } - public static void main(String s[]) throws Exception - { - // we are just asserting that it is safe to do instanceof on an object that is null. - // let's test that theory. - instance_of tony = new instance_of(); - Object fred = tony.cogitate(); // will produce null. - if (fred instanceof List) { - throw new Exception("that should not have happened!"); - } else { - System.out.println("told us null is not an instance of List, which is correct."); - } - - } + public Object cogitate() + { + return null; + } + public static void main(String s[]) throws Exception + { + // we are just asserting that it is safe to do instanceof on an object that is null. + // let's test that theory. + instance_of tony = new instance_of(); + Object fred = tony.cogitate(); // will produce null. + if (fred instanceof List) { + throw new Exception("FAILURE! fred should not be instance of List ! null is an instance of something!"); + } else { + System.out.println("told us null is not an instance of List, which is correct."); + } + } } \ No newline at end of file