/* Termination checker */ /* Carsten Schuermann */ /* Date: Tue Mar 14 11:48:52 2006 */ import java.lang.reflect.*; class Test1 { public void run () { while (true) { } } } class Test2 { public void run () { int x = 13; } } class TerminationCheck { Class c; Method m; public static void main(String[] args) throws Exception { Class c = Class.forName("Test2"); Method m = c.getMethod("run", new Class[] {}); TerminationCheck checker = new TerminationCheck(); try { m.invoke (new Test2 ()); System.out.println ("yes"); } catch (Exception e) { System.out.println(e); } } }