| Summary: | Add session bean should not always create a ejbModule source folder in the client project | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP EJB Tools | Reporter: | Roberto Sanchez Herrera <shr31223> | ||||||||
| Component: | jst.ejb | Assignee: | Roberto Sanchez Herrera <shr31223> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Kaloyan Raev <kaloyan> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | ccc, makandre | ||||||||
| Version: | 3.2.5P | Flags: | kaloyan:
review+
|
||||||||
| Target Milestone: | 3.3.2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 369832 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Roberto Sanchez Herrera
Created attachment 209936 [details]
EAR for recreating bug
Created attachment 209937 [details]
Proposed patch for 3.3.2 and 3.4
This patch uses existing source folder in ejb client jar if a source folder with the same name as the one uses in the EJB project does not exist.
Any though on this one? Roberto, sorry for the delay. This bug is a good catch and worth fixing it for Indigo. I have one comment on the patch. On line 144 you call "folder.exists" and a few lines later you check "folder == null". It seems like the order is not correct. If folder is null then line 144 will throw NPE. Do you agree? Well, not completely :D The call to getClientSourceFolder() will never return null, so the call to "if (!folder.exists()){ " should be safe. The method getFirstJavaSourceFolderInClientJar() will return null in the case the project does not have a source folder, so that is why I check if the folder in null this time, and if it is, then the folder will be created.
But Carl found a small optimization to the code, that consists on putting the check for null inside the first if, and not at the same level. Attaching a new patch.
Kaloyan, would you mind reviewing it again after these comments?
Thank you!
Created attachment 210120 [details]
Proposed patch for 3.3.2 and 3.4 (version 2)
OK. Now I understand. Thank you for the detailed explanation. Code committed to HEAD and R3_3_maintenance for WTP 3.4 and 3.3.2. Resolving bug. |