package test.of.arguments; class Bar { public static void staticCall() { int a = 0; return; } public void test() { staticCall(); } } class Foo { Foo f ; public Foo(Foo f) { this.f=f; } public Foo() { super(); } void test() { return; } Foo getF() { return f; } public void run(Bar b,String s) { //legeal call: argument object int length= s.length(); //legal if(f==null || f.getF()==null) return; //legal test(); //legal b.test(); //legal getF(); //illegal f.f.run(b,s); } public void run() { } public static void main(String[] args) { System.out.println("***** A correct implementation should report the following violations:\n"+ "********* Foo.java:50"); Foo aFoo=new Foo(new Foo(new Foo())); aFoo.run(new Bar(),"Hello,world"); } }