Interface method mapping not captured in VC under a single common circumstance
Version 0.13.1.0-g63a5aab2 (Dec 1 2024 15:49:06) (Latest release)
Under certain circumstances, the interface method mapping action will not be properly tracked by version control.
Scenarios for reproducing below
1. Everything up-front, .jox has all the information as expected
- Add ClassA, with ClassA:mth()
- Add InterfaceA, with Interface:mth()
- Map implement InterfaceA on ClassA, and select the option to map to existing methods
- Commit
Results in tracking with no problems. The class method mth includes the method mapping info in the interfaceImplements element and JadeInterfaceMethod subelement.
[Expand] See generated .jox
<JadeInterface name="IForTestClass" id="d9ba4588-31b6-44a8-a865-0d1da002b806">
<JadeInterfaceMethod name="mth" id="74538d7c-1e98-414b-ae7b-d767efded87a">
<source>mth();</source>
</JadeInterfaceMethod>
</JadeInterface>
<Class name="TestClassForInterfaces" id="b75c625b-918a-4e12-b2aa-af8e0430d8b6">
<implementedInterfaces>
<JadeInterface name="IForTestClass"/>
</implementedInterfaces>
<superclass name="Object"/>
<persistentAllowed>true</persistentAllowed>
<sharedTransientAllowed>true</sharedTransientAllowed>
<subclassPersistentAllowed>true</subclassPersistentAllowed>
<subclassSharedTransientAllowed>true</subclassSharedTransientAllowed>
<subclassTransientAllowed>true</subclassTransientAllowed>
<transientAllowed>true</transientAllowed>
<DbClassMap file="EthosMap"/>
<JadeMethod name="mth" id="8bcebabe-97bf-4fa5-a714-0612944c797e">
<interfaceImplements>
<JadeInterfaceMethod name="IForTestClass::mth"/>
</interfaceImplements>
<source>mth();
vars
begin
end;
</source>
</JadeMethod>
</Class>
2. More common scenario: class first, interface method mapping later.
- Create the class with the mth method
- Commit
[Expand] See generated .jox
<Class name="TestClass2" id="f5d0b167-17d9-4062-b1a1-76ab2980703e">
<superclass name="Object"/>
<persistentAllowed>true</persistentAllowed>
<sharedTransientAllowed>true</sharedTransientAllowed>
<subclassPersistentAllowed>true</subclassPersistentAllowed>
<subclassSharedTransientAllowed>true</subclassSharedTransientAllowed>
<subclassTransientAllowed>true</subclassTransientAllowed>
<transientAllowed>true</transientAllowed>
<DbClassMap file="EthosMap"/>
<JadeMethod name="mth" id="3376cbc7-2c9c-4dbe-aa3d-6c00119b42a7">
<source>mth();
vars
begin
end;
</source>
</JadeMethod>
</Class>
- Implement the interface, using map to existing methods function
- Commit
[Expand] See generated .jox
<Class name="TestClass2" id="f5d0b167-17d9-4062-b1a1-76ab2980703e">
<implementedInterfaces>
<JadeInterface name="IForTestClass"/>
</implementedInterfaces>
<superclass name="Object"/>
<persistentAllowed>true</persistentAllowed>
<sharedTransientAllowed>true</sharedTransientAllowed>
<subclassPersistentAllowed>true</subclassPersistentAllowed>
<subclassSharedTransientAllowed>true</subclassSharedTransientAllowed>
<subclassTransientAllowed>true</subclassTransientAllowed>
<transientAllowed>true</transientAllowed>
<DbClassMap file="EthosMap"/>
<JadeMethod name="mth" id="3376cbc7-2c9c-4dbe-aa3d-6c00119b42a7">
<source>mth();
vars
begin
end;
</source>
</JadeMethod>
</Class>
Results in the mth method not having the interfaceImplements element and JadeInterfaceMethod subelement (class does say that it implements the interface though), which leads to deployment failing as the mapping method definitions in the deployed scm file does not include the mapping methods explicitly.
Workarounds
I've been told that going into the IDE and recompiling these methods manually will make it get properly picked up by version control.
Another workaround is to commit the missing information (interfaceImplements element and JadeInterfaceMethod subelement under JadeMethod) into the class.jox file directly. In fact, it's the only way if you can't load the commit to trigger a recompile with IDE user actions. Then you can go to the later/amended commit just fine.
Feel free to refer to the sample jox in this document. Mapping method information only needs to mention the interface name and method name. No return types or parameters, as these are on the interface definition & the method that is mapped.