Ticket #194 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

Analyzing role-method visibility should be separated out

Reported by: stephan Owned by: stephan
Priority: minor Milestone: OTDT_1.2.6
Component: compiler Version: 1.2.5
Keywords: Cc:

Description

During recent changes we repeatable broke the analysis whether a role method is visible in a given context. This shows that the current implementation is fragile, because it is tangled with the original implementation of std. Java visibility rules.

For role fields we already use a separate method Protections.canFieldBeSeenBy. This method should be generalized to cover methods, too.

Here is an almost random list of test cases that recently should some effect while trying out different implementations:

JUnit tests:

  • ModifierCorrectionsQuickFixTest (OT-variant)

Furthermore, compiling the OTDT's OT-plugins also gives a pretty good test case ;-)

Change History

Changed 3 years ago by stephan

r19518 did a first step in implementing this issue which should yield a stricter implementation according to OTJLD §1.2.1(e). As expected this broke many jacks tests (~240), because many tests used default visible role methods from the team and from sibling roles, which is no longer possible (never was legal).

r19519 contains some fixes, like not checking super/tsuper calls of callin methods.

Additional help is coming from issue #195, where I proposed to add more flexibililty to how visibility of callout methods is controlled. With this and many corrections in the test suite, the next test run should produce much better results (pending).

Changed 3 years ago by stephan

Implementation is further improved in:

  • r19522: super access
  • r19523: new diagnostic if tsuper method is invisible (indirectly inherited)
  • r19529: correction and simplification in Protections
  • r19533: preserve the information that a call was made via an externalized role (always requires method to be public)
  • r19535: fix analysis of visibility (here static callout) even when advertized via the (synthetic) interface

Changed 3 years ago by stephan

  • status changed from new to closed
  • resolution set to fixed

The OTDT was migrated to strict compliance with OTJLD §1.2.1(e) as of r19538/r19540.

Guard predicate methods are now generated as protected, too (r19547).

Also checking of static role methods has been improved (r19549).

Build 1.2.6.200902101416 shows no more regressions caused by the restructuring.

Note: See TracTickets for help on using tickets.