Ticket #13 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

RoleType does not support anchored base class

Reported by: stephan Owned by: stephan
Priority: major Milestone: OTDT_1.1.4
Component: compiler Version: 1.1.3
Keywords: Cc:

Description (last modified by stephan) (diff)

Create a basic structure of layered teams, like

public team class T1 {
    public class R1 {
        void bar() {}
    }
}
public team class T2 {
    final T1 thatTeam= new T1();
    protected class R2 playedBy R1<@thatTeam> { // this declaration causes trouble
        void myBar() {}
        bar <- after bar;
    }
}

Now activate callin markers and open T1 to look for a callin mark at bar().

The CallinMarkerGenerator?2 bails out with:

Java Model Exception: Core Exception [code 0] Base class for role T2.R2 not found.
at org.objectteams.otdt.internal.core.RoleType.getBaseClass(RoleType.java:202)
at org.objectteams.otdt.internal.core.CallinMapping.findBaseMethods(CallinMapping.java:211)
at org.objectteams.otdt.internal.core.CallinMapping.getBoundBaseMethods(CallinMapping.java:186)
at org.objectteams.otdt.internal.ui.callinmarkers.CallinMarkerCreator2.isBaseMethod(CallinMarkerCreator2.java:419)

Reason: anchors of the base class are not converted to the OT-Model. See carp's comment in RoleType.java method checkAndSetBaseAnchor(..).

Required action: need to augment ISourceElementRequestor.TypeInfo and SourceElementParser and probably several others, too.

Change History

Changed 4 years ago by stephan

supposed fix is in r16470:

Support anchored base types in

  • ISourceElementRequester.TypeInfo: new field
  • SourceElementParser: fills new field of TypeInfo
  • SourceTypeConverter: decoding R<@anchor> also in the char[] variant of methods
  • RoleType: store anchor in new field (obsoletes broken checkAndSetBaseAnchor())
  • OTModelManager: set anchor via addType()
  • HierarchyResolver: feed new field into OTModelManager.addType()
  • CompilationUnitStructureRequestor: feed new field into OTModelManager.addType()

Passing nulls (TODO: check):

  • OTModel.getOTElement(..), binary case
  • ClassFileInfo.generateInnerClassHandles(..)

Changed 4 years ago by stephan

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

Fix in r16470 plus r16472 has passed both test suites.

Changed 4 years ago by stephan

  • description modified (diff)
Note: See TracTickets for help on using tickets.