package types;
public class Foo{
public void m(Object o){
String[] s = (String[]) o;
s = new String[2];
}
public static int foo(Z1 z){
return z.m();
}
public static int foo2(){
A ob;
ob = new C();
return ob.m();
}
public static int foo3(A ob){
// We should get 4 paths (type(ob) = A, type(ob) = B, type(ob) = C and ob = null)
// Currently we only get two, the first and the last one.
int x = ob.a;
int y = ((B)ob).b;
int z = ((C)ob).c;
return x + y + z;
}
public static int foo4(A ob){
// We should get 3 paths (type(ob) = C, ob = null, and type(ob) = A or B)
// Currently we do not get the last one
return ((C)ob).c;
}
public static int foo5(B ob){
ob.a = 11;
return ob.a + ((C)ob).a;
}
public static void main(String[] args){
System.out.println(foo5(new C()));
}
}
interface Z1 {
public int m();
}
interface Z2 extends Z1{
}
class A implements Z2{
int a = 1;
public int m(){
return 1;
}
public int q(){
return 111;
}
}
class B extends A {
int b = 2;
}
class C extends B {
int c = 3;
public int m(){
return 3;
}
public int p(int i){
if (i < 0) return i;
else return q();
}
}
|