Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319417 - ClassCastExceptions during refactorying and Fixes for All Dependency Tests
Summary: ClassCastExceptions during refactorying and Fixes for All Dependency Tests
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Jason Sholl CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-09 13:52 EDT by Jason Sholl CLA
Modified: 2010-07-20 11:22 EDT (History)
2 users (show)

See Also:
david_williams: pmc_approved+
jsholl: pmc_approved? (raghunathan.srinivasan)
jsholl: pmc_approved? (naci.dai)
deboer: pmc_approved+
jsholl: pmc_approved? (neil.hauge)
jsholl: pmc_approved? (kaloyan)
cbridgha: review+


Attachments
patch for 3.2.1 (14.59 KB, patch)
2010-07-09 13:55 EDT, Jason Sholl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Sholl CLA 2010-07-09 13:52:49 EDT
The default folder mapping for utility jars was recently changed from / to /lib when mapping into EARs with version 5.0 or greater (see bug 318515).  Some of the JUnits were broken because of this.  There was also a problem with the implementation which causes class cast exceptions during refactoring.  The changes to the following files fix these two problems:

AddComponentToEnterpriseApplicationDataModelProvider
EarUtilities

JUnit classes:
EarLibDirContainerTests
DependencyCreationUtil
DependencyVerificationUtil

The above change to the default behavior also exposed another bug that has always been there which causes failures when removing modules; this is fixed with:

RemoveReferenceComponentOperation

The rewrite of the dependency graph (see bug 317120) has caused refactoring to fail to update META-INF/MANIFEST.MF dependencies.  This is because the new graph does not track these dependencies.  The fix is addressed with the change in:

ProjectRefactoringListener

Note that there are still some failures in these JUnits which are timing related (putting Thread.sleep in key places causes them to pass).  I will continue to work on fixing this and will address that in another bug.  But with the changes above (and the Thread.sleep() calls not included here) the JUnits are now passing 100%.
Comment 1 Jason Sholl CLA 2010-07-09 13:55:08 EDT
Created attachment 173887 [details]
patch for 3.2.1

This has been tested with the JUnits and with the UI.  The risk for regression is minimal.
Comment 2 Chuck Bridgham CLA 2010-07-09 15:39:33 EDT
approved
Comment 3 Jason Sholl CLA 2010-07-12 15:58:19 EDT
    * 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. 

There are a few minor regressions resulting from earlier fixes.

    * 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? 

Existing JUnits caught these problems, and testing with the UI.

    * Give a brief technical overview. Who has reviewed this fix? 

See original comment

    * What is the risk associated with this fix? 

None
Comment 4 David Williams CLA 2010-07-12 17:06:56 EDT
I think having "class cast" problems in summary would be better than emphasizing unit test fixes ... but, I'm fine with the fix itself.
Comment 5 Jason Sholl CLA 2010-07-13 12:07:54 EDT
code checked into HEAD for WTP 3.2.1