The error you have there is that you are trying to use a static method from a dynamic context. This cannot be done since it doesn't know what you are trying to do - non-static methods cannot be called statically as they require a context of an object in which to work.
See this example:
PHP Code:
public class StaticTest
{
public static void testStatic()
{
staticCall("This is a static call"); // Chain from a static to a static
}
public void testDynamic()
{
dynamicCall("This is a dynamic call"); // Chain from a dynamic to a dynamic
}
public static void staticCall(String sStatic)
{
System.out.println(sStatic);
}
public void dynamicCall(String sDynamic)
{
System.out.println(sDynamic);
}
public static void main(String... argv)
{
StaticTest s = new StaticTest();
s.testDynamic(); // requires a object context since this is static method
testStatic(); // This is a static method so no explicit class could be chosen
}
}
Personally, I resolve all methods and members to either the class name or this. I do this simply because languages like PHP to not accept variable masking in OOP, so they are required to resolve the method to the class or context.