Potential heuristics

algo for statically polymorphism method guessing:

  1. get the methods with the same name within a hierarchy-tree
  2. get the names of classes within this tree if there are more than one method with the same signature
  3. for all these classes, get the ones which are instantiated

further heuristics for instance-variables:


  • A a = new A() if A has subclasses
  • A b = new B() if B has subclasses
  • Downcasting (equal to A a = new B())

Example: A a = new A(); B b = new B(); If (b instanceOf A) a = (A)b;

Last changed by admin on 21 April 2009