Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335013 - Wrong behavior or the EJB client JAR creation action, when some of the interfaces to be moved are nested
Summary: Wrong behavior or the EJB client JAR creation action, when some of the interf...
Status: NEW
Alias: None
Product: WTP EJB Tools
Classification: WebTools
Component: jst.ejb (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: jst.ejb CLA
QA Contact: Kaloyan Raev CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-21 08:39 EST by Krum Bakalsky CLA
Modified: 2011-01-25 04:01 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krum Bakalsky CLA 2011-01-21 08:39:32 EST
Build Identifier: Build id: M20110105-0951

Please see the 'Steps to Reproduce' section

Reproducible: Always

Steps to Reproduce:
1. Create an 'old' EJB project - version EJB 2.1, from the wizard choose to add it to an EAR project, but don't choose to create a client JAR.
2. So, we have the EJB and the EAR projects created. Create, for example, a stateless session bean. Choose to have all interfaces created.
3. Refactor, for example, its home interface to be nested: put it in an enclosing class.
4. Fix all issues related to the previous step: replace the FQN name of the interface in the ejb-jar.xml with the new one, fix some import statements as well.
5. Trigger the EJB client JAR creation action: right click on the EJB project ->
'Java EE Tools' -> 'Create EJB Client Jar'.


Problem: After the action completes, we have the client JAR project created, but the home interface of our stateless session bean is not moved to it.

According to the EJB 2.1 specification, the session bean classes must be top-level classes, so they cannot be nested/inner classes. But there is no such restriction for the home/component interfaces of the session beans. So, this is a possible use-case.

Notes: Within org.eclipse.jst.j2ee.internal.ejb.archiveoperations.EJBClientJarCreationHelper, the files that have to be moved to the new project, are obtained via the getFilesToMove() method. Internally, it uses the private void computeJavaTypes(JavaClass javaClass) method, which uses the JavaClass API of JEM. The problem is that, when such a reference refers to a nested interfacee type, the used getJavaPackage() and getSimpleName() methods don't yield correct results.
Comment 1 Carl Anderson CLA 2011-01-21 09:22:33 EST
Krum, judging by your build ID, I am assuming that this was done with Eclipse Indigo M4, which corresponds to WTP 3.3 M4.  If that is incorrect, please let us know the correct version.