Bug 235218 - OpenJ2EEResourceAction updateSelection not checking for none existent file
Summary: OpenJ2EEResourceAction updateSelection not checking for none existent file
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 3.0.1   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-06-02 16:29 EDT by Ian Tewksbury CLA
Modified: 2008-09-10 16:26 EDT (History)
2 users (show)

See Also:
cbridgha: review+


Attachments
Path (1.42 KB, patch)
2008-06-02 16:31 EDT, Ian Tewksbury CLA
no flags Details | Diff
Updated Patch (2.61 KB, patch)
2008-06-17 11:17 EDT, Ian Tewksbury CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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