Bug 235218

Summary: OpenJ2EEResourceAction updateSelection not checking for none existent file
Product: [WebTools] WTP Java EE Tools Reporter: Ian Tewksbury <tewksbur>
Component: jst.j2eeAssignee: Ian Tewksbury <tewksbur>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: major    
Priority: P2 CC: ccc, jsholl
Version: 3.0Keywords: contributed
Target Milestone: 3.0.1Flags: cbridgha: review+
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Path
none
Updated Patch bjorn.freeman-benson: iplog+

Description Ian Tewksbury CLA 2008-06-02 16:29:47 EDT
In 'OpenJ2EEResourceAction's updateSelection if the selected element is an EOjbect it does not check to see if the file exists which is necessary because of JEE5 projects without DDs.  Without the necessary check the 'open' option is listed on the context menu for the nodes that represent the 'virtual DDs' and they should not be because there is no way to open them.
Comment 1 Ian Tewksbury CLA 2008-06-02 16:31:31 EDT
Created attachment 103200 [details]
Path

This patch adds the necessary 'file.exists()' check to the updateSelection method.
In the case were the file does not exist currentDescriptor is set to null and the method returns false.
Comment 2 Chuck Bridgham CLA 2008-06-03 10:36:17 EDT
Without this fix, many exception were being thrown, and the wrong editor was being selected if the underlying IResource doesn't exist.
Comment 3 Chuck Bridgham CLA 2008-06-12 10:37:32 EDT
looks good - waiting for patch stream
Comment 4 Ian Tewksbury CLA 2008-06-17 11:17:49 EDT
Created attachment 105174 [details]
Updated Patch

With the original patch if an EJB3 had no DD but had a bean, if you tried to open the bean the option to open was not listed.  This is because the 'WorkbenchResourceHelper' returns the DD file as the associated file for any Bean nested under it.

The new patch first checks to see if the EObject is actually a DD and if it is does the check to be sure it exists, otherwise if the EObject is not a DD then the code executes as it originally did allowing the an associated Bean to open.
Comment 5 Chuck Bridgham CLA 2008-06-18 09:39:51 EDT
approved earlier...
Comment 6 Carl Anderson CLA 2008-06-18 21:37:51 EDT
Committed to R3_0_maintenance
Comment 7 Carl Anderson CLA 2008-06-30 17:01:19 EDT
Also committed to HEAD