Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324020 - Remove unnecessary in J2EEComponentClasspathContainer cast to avoid potential class cast exceptions
Summary: Remove unnecessary in J2EEComponentClasspathContainer cast to avoid potential...
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.2   Edit
Assignee: Jason Sholl CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-30 15:18 EDT by Jason Sholl CLA
Modified: 2010-08-31 21:59 EDT (History)
0 users

See Also:
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+


Attachments
patch (1.69 KB, patch)
2010-08-30 15:20 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-08-30 15:18:31 EDT
This cast is completely unnecessary and has caused the following exception.  Best to remove it.

Problems occurred when invoking code from plug-in: "org.eclipse.jst.j2ee".
java.lang.ClassCastException: org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent incompatible with org.eclipse.jst.j2ee.componentcore.util.EARVirtualComponent
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.getBaseEARLibRefs(Unknown Source)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.requiresUpdate(Unknown Source)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.refresh(Unknown Source)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.processModules(Unknown Source)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.access$4(Unknown Source)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob$1.run(Unknown Source)
	at org.eclipse.core.runtime.SafeRunner.run(Unknown Source)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.run(Unknown Source)
	at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)
Comment 1 Jason Sholl CLA 2010-08-30 15:20:12 EDT
Created attachment 177768 [details]
patch
Comment 2 Jason Sholl CLA 2010-08-30 15:21:44 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. 

If this exception occurs the EAR Libraries classpath container could be corrupted.

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

Manually

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

There is no reason for this cast.  Jason & Chuck

    * What is the risk associated with this fix? 

None
Comment 3 Chuck Bridgham CLA 2010-08-30 15:27:32 EDT
approved
Comment 4 Jason Sholl CLA 2010-08-30 17:21:09 EDT
code checked into head for 3.2.2 and 3.3