Issue #71

Reversing "implicit" imports for inheritance fail

Added by Michaël Piffret over 7 years ago. Updated about 7 years ago.

Status:ResolvedStart date:09 August 2012
Priority:HighDue date:
Assignee:Christophe Malgouyres% Done:

50%

Category:-
Target version:2.1.01

Description

I’ve had a case where reverse-engineering fails to identify the Interface used by a Class, though it is in the Java source code I’m reversing.

After a bit of digging around, I’ve found exactly how to reproduce this : Java does not need an “import” clause if the Interface is in the same package as the Class. And JavaDesigner fails to locate the Interface that’s implemented when there is no “import” clause for this Interface.

See included failing and working examples. This is a show-stopper to using reverse engineering on our projects :(

javatest.zip (7.75 KB) Michaël Piffret, 09 August 2012 16:36

inheritance_test.zip (12.1 KB) Michaël Piffret, 09 August 2012 17:08

association_test.zip (23.9 KB) Michaël Piffret, 09 August 2012 17:08

History

#1 Updated by Michaël Piffret over 7 years ago

I forgot to join the file…

#2 Updated by Michaël Piffret over 7 years ago

This one is driving me mad : I’m finding very strange bugs in inheritance and associations too… Reversing only seems to work if the imported class is imported before, meaning imports must be in alphabetical order (B may import A, A may not import B). I have uploaded the examples I’ve been using.

The problem goes away after round tripping : reverse semi-fails, code generation works, round-tripping updates the model properly. Am I doing something very wrong ?

I am using Modelio 2.2 (Extensions 7.1.6.8020) and JavaDesigner 2.1 (2.1.0.8020). I’m trying to prototype using Modelio to reverse our projects to introduce MDA, and it doesn’t look good yet.

#3 Updated by Christophe Malgouyres about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Christophe Malgouyres
  • Target version set to 2.1.01

Hi,

I’ve been trying to reverse your samples, and as far as I can tell, I might have found what is going on: in the source reverse wizard, the namespace lookup root was always the file typed in the upper zone, instead of the tree selection.

You should be able to workaround your lookup problems using the wizard like this: 1. Open the reverse wizard. 2. Set the reverse root, for example “c:\test\association_test\association_different_packages”. 3. Select the package to reverse, for example “com”. 4. Launch the reverse.

By the way, I noticed errors in inheritance_test/inheritance_fails => “MonInterface” doesn’t exist and therefore can’t be found. “com.a.MonParent” should be “com.parent.MonParent”…

#4 Updated by Christophe Malgouyres about 7 years ago

  • Status changed from Assigned to Resolved

Fixed by revision 308

Also available in: Atom PDF