Book a Demo

Author Topic: Import Java: Ambiguous Generalization Relationship  (Read 6874 times)

funkiwan

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Import Java: Ambiguous Generalization Relationship
« on: November 01, 2003, 02:05:50 pm »
I'm trying to import a Java source directory tree. The import displays a number of prompts during this process titled:

Ambiguous Generalization Relationship:
Enterprise Architect cannot resolve an ambiguous relationship. Please select the appropriate element to create a generalization link to

Which is followed by a number of element choices.

The problem is that I'm importing Java, and some of the choices include table names that aren't even the same case, i.e., Product (Java) and PRODUCT (my DB table).

How do I prevent this problem from occurring?

Thanks for your help.

DaveEchols

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
  • !
    • View Profile
Re: Import Java: Ambiguous Generalization Relation
« Reply #1 on: May 11, 2004, 04:39:47 am »
Wasany help or answer ever given for this. I am having the same problem trying to setup packages and class so I can use EA for Java development. I also ran into this message/error when importing .NET class files. Any help or pointers would be appreciated.

angel-o-sphere

  • EA User
  • **
  • Posts: 112
  • Karma: +0/-0
    • View Profile
Re: Import Java: Ambiguous Generalization Relation
« Reply #2 on: May 11, 2004, 08:29:09 am »
I have also the same problem and never got an answer.
angel'o'sphere

DaveEchols

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
  • !
    • View Profile
Re: Import Java: Ambiguous Generalization Relation
« Reply #3 on: May 15, 2004, 09:19:43 pm »
     I got everything to import, but know there have to be errors. Once the error dialog pops up, I hold down the enter key until the import finishes. I actually use a book and a wine bottle cork to hold down the Enter key. So much for modern technology!!
    By the way, I imported the java, javax, com, org and sunw folders, and wound up with a file size of 107 mb. Folks, there has got to be a better way. I am sure the .NET framework will be just as large once I get all of that imported.

jkorman

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Import Java: Ambiguous Generalization Relation
« Reply #4 on: May 17, 2004, 07:35:10 pm »
Besides the size of the resulting model, it is probably not correct either.

The java source code has some interesting formatting that causes the EA parser to incorrectly identify the
methods. For instance the following code

  public abstract int FooC1A(); // Correct

  public
  abstract int FooC1B(); // Identifies as package abstract
 
  public
  abstract
  int FooC1C(); //  // Identifies as package abstract
 
  public
  abstract
  int
  FooC1D(); //  // Identifies as package abstract
There is a active bug report in on this!

Also. When you've RE'd the source code.  Go into the resulting classes and get rid of all of the
package and private methods, attributes, and inner classes. You can't use them anyway.

Jim

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Import Java: Ambiguous Generalization Relation
« Reply #5 on: May 19, 2004, 09:43:24 pm »
Hi everyone,

I suspect that the Ambiguous Generalization Relationship messages are due to Classes of the same name inside different packages.  EA is currently limited in some areas as to its differentiation of classes with the same name.  Resolving relationships would be one of those areas.  I can't get it to do it with names where there is a difference in case though.

This shouldn't stop the code from importing.  It isn't even a problem if you hold down enter do avoid the messages.  What that will do is not create the generalization link to any of the classes.

I'm not really surprised that the result of importing all of those directory structure generated a large file.  Realistically, it has to be big.  (Although I don't know exactly how big it should be)

Finally, thanks for that example of problem code.  I've fixed the parser to deal with that properly and it should be included as part of build 728.

Simon