| Summary: | Adding user library to project other than web and EAR creates cycle dependency | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Java EE Tools | Reporter: | Jason Sholl <jsholl> | ||||||
| Component: | jst.j2ee | Assignee: | Jason Sholl <jsholl> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Chuck Bridgham <cbridgha> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | larryisaacs | ||||||
| Version: | 3.2 | Flags: | jsholl:
pmc_approved?
(david_williams) jsholl: pmc_approved? (raghunathan.srinivasan) jsholl: pmc_approved? (naci.dai) deboer: pmc_approved+ jsholl: pmc_approved? (neil.hauge) jsholl: pmc_approved? (kaloyan) cbridgha: review+ |
||||||
| Target Milestone: | 3.2 RC1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | PMC_approved | ||||||||
| Attachments: |
|
||||||||
Created attachment 167405 [details]
patch
Created attachment 167486 [details]
patch
Updated to remove NPE risk in component equals() methods
approve *** Bug 311993 has been marked as a duplicate of this bug. *** code checked in for RC1 |
I added a user library to a connector project and the EAR libraries container shows that it added itself and I see JDT cycle dependency errors. The problem is that this library reference is consumed (as opposed to used). A check is necessary in J2EEComponentClasspathContainer to ensure consumed type references are not added directly to the classpath (because these references will always point back to the same project rather than the resolved contents). While I was testing this with some elaborate assembly scenarios, I noticed some NPEs coming from the RemoveComponentFromEnterpriseApplicaitonOperation code; that's what the change in there is for. While I was investigating that, I steped into the getModuleURI() method a few lines up and discovered the reason this module wasn't being found was because there was no equals or hashcode defined for ClasspathContainerVirtualComponent or its super class; so I created those, and also filtered out the consumed references from this list anyways. * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. Without this fix there will be cyclicial classpaths, and NPEs * Is there a work-around? If so, why do you believe the work-around is insufficient? No * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Tested with UI; no JUnit * Give a brief technical overview. Who has reviewed this fix? see above. Chuck and Jason have reviewed * What is the risk associated with this fix? minimal