Book a Demo

Author Topic: EA does not properly handle Java packages  (Read 2433 times)

svedloff

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
EA does not properly handle Java packages
« on: March 25, 2004, 10:07:14 am »
I have tried several things to get EA to properly generate Java package "import" statements.  The best that I could come up with was to come up with a new View for each package.  In that case, "import" statements are properly generated (the View name becomes the package name), but the directory structure is completely messed up.

For example, if I create a View called "com.mycompany.mypackage", the directory called "com.mycompany.mypackage" will be generated under the directory that I specified as the generation directory, and all the generated source files will go there.  Obviously, I would like it to expand the package name and create the proper directory structure.

On reverse engineering, package names are completely ignored.  All classes that are brought in go into the same place.

All this makes round-trip engineering difficult, if not impossible.


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: EA does not properly handle Java packages
« Reply #1 on: March 25, 2004, 05:28:31 pm »
As benc noted in another thread (http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.cgi?board=general;action=display;num=1080173350) incorrect Java import statements and package names have been noted as a bug and should be fixed soon.

Ignoring that for now, the correct directory output can be achieved by creating a package structure in EA.  (Right clicking on the project view gives an option for insert package)  This can then be generated (make sure you have currently selected the package that you want to be the root package)  I haven't had any problems reading what this produces back into EA either.

Simon