Community
Participate
Working Groups
In this example, class A { static int foo() { return 10; } static int bar() { return 11; } } public class X extends A { public static void main(String argv[]) { int i = A.foo(); int j = bar(); System.out.println(i + " - " + j); } } The method invocation A.foo() should have the declaring class A, but the method invocation bar() should have the declaring class X. Not A.
Created attachment 17877 [details] Apply on HEAD This patch fixes the declaring class by using the actualReceiverType if the receiver is an implicit this.
I am not sure that the test if (receiver.isImplicitThis()) { is required, because the actualReceiverType is fine in both cases.
Consider static receiver type from 1.4 compliance on, also had to tweak lookup using static imports to properly set the actualReceiverType. Updated Compliance_1* tests to match new behavior. We now match 1.4.2 (and no longer 1.4.1). Fixed
Verified in I20050330-0500