Ticket #145 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

OT/Equinox weaving fails for sub classes of bound base classes

Reported by: stephan Owned by: stephan
Priority: major Milestone: OTDT_1.2.3
Component: otequinox Version: 1.2.1
Keywords: Cc:

Description

If a role callin-binds to a base method that is overridden in sub-classes of the bound base class, the OTRE needs to weave into those sub-classes, too. In an OT/Equinox setting, this currently fails, because OT/Equinox sees no reason to transform the sub-class and skips the ObjectTeamsTransformer for it.

As a workaround, the aspect code needs to add empty role classes just to make the binding to sub-classes explicit. Examples are in org.objectteams.otdt.debug.adaptor.launching, e.g.:

  • PDEUILaunchingAdaptor, roles MainTab and OSGiTab (same base plugin)
  • DebugUIDialogAdaptor2 and DebugUIDialogAdaptor3 (different base plugins)

For experimentation, the flag -Dotequinox.weave=<bundle-list> can be passed to force considering all classes of the given bundles for transformation.

Change History

Changed 3 years ago by stephan

  • milestone changed from OTDT_1.2.2 to OTDT_1.2.3

Changed 3 years ago by stephan

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

r19072 (plus a fix in r19077) adopt a byte code analyzer written by Oliver Frank. With this patch sub-classes of bound base classes are recognized and will be woven, too.

If a bound base method is overridden by a sub-class residing in a different bundle, OT/Equinox could potentially still miss this base class, because it may be loaded before the adapting team has been analyzed. Currently, we recommend to still use an explicit role-base binding for such a sub-class.

The latter situation requires further investigation, but currently I tend to saying that a sub-class (base) in a different bundle should not implicitly be woven. This would mean that in the context of OT/Equinox "playedBy SomeBase" would be interpreted as SomeBase plus those sub-classes residing in the same bundle.

Closing because the main issue is solved.

Note: See TracTickets for help on using tickets.