This is the mail archive of the mailing list for the Java project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR java/19870 (Part 2/2): Handle private static methods accessed across nested classes


  The attached patch fixes the remaining bit in PR java/19870
for private static methods accessed across nested class 
boundaries. I am also attaching the testsuite adjustments 
needed, including a new testcase that shows what works now.

Instead of repeating the logic for determining accesses 
across nested class boundaries (inner to outer, outer to inner,
inner to sibling-inner, etc.), I chose to generalise
nested_field_access_p() to handle methods as well and rename it
to nested_member_access_p(). This was followed with minor
adjustments to patch_method_invocation() and
maybe_use_access_method() to handle static methods.

Tested on i686-pc-linux-gnu with a complete rebuild of libjava
as well as testing for regressions with Jacks included. The
effect of this patch on Jacks is:

  XPASS: 8.5.2-non-static-member-usage-2
  FAIL: 15.12.3-explicit-constructor-9

The latter confuses me (but both Jikes and javac
compile it without errors). I'd be grateful if someone could
explain exactly why it should *not* be an error.

OK for mainline?


Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web:

Attachment: pr19870_2.txt
Description: Text document

Attachment: pr19870_2_ts.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]