ObeoNetwork / M2Doc

The M2Doc technology enables the generation of Office Open XML documents from models.
http://obeonetwork.github.io/M2Doc/
Eclipse Public License 2.0
39 stars 22 forks source link

Add support for disambiguating services with almost similar signatures #439

Closed flatombe closed 2 months ago

flatombe commented 3 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please have a look to the support pages of our website : http://m2doc.org/support/

Current behavior

When two different Java service classes each provide a service method which have the same name and parameter types, then the resolution depends on the import order.

Expected behavior

It should be possible to disambiguate these calls, probably using aliases or fully-qualified names.

Minimal reproduction of the problem with instructions

In a Capella model, with service classes org.polarsys.capella.core.model.helpers.ProjectExt and org.polarsys.capella.common.helpers.EcoreUtil2, both org.polarsys.capella.core.model.helpers.ProjectExt.getProject(EObject) org.polarsys.capella.common.helpers.EcoreUtil2.getProject(EObject) have the same parameter types and name, so there is no way to explicitly specify which we want to use.

What is the motivation / use case for changing the behavior?

We can get deadlocked if two service classes each provide two services clashing with the other, and we want to use one service from one service class, and the other service from the other class: because the resolution depends on the import order, only one of the two classes will actually be usable.

Environment


M2Doc version: 3.2.0.202105181517
Eclipse version: Capella 1.4.1.202006301603
Platform version:  Windows 10
ylussaud commented 2 months ago

This is an AQL issue.