Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319387

Summary: Jar file appears as source folder in Servlet wizard
Product: [WebTools] WTP Java EE Tools Reporter: Alexander Silgidjian <alexander.silgidjian>
Component: jst.j2eeAssignee: Roberto Sanchez Herrera <shr31223>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: cbridgha, shr31223, thatnitind
Version: 3.2Flags: cbridgha: review+
Target Milestone: 3.6.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Alexander Silgidjian CLA 2010-07-09 09:33:50 EDT
Build Identifier: 20100617-1415

If a JAR file is selected in Project Explorer and I select File -> New -> Servlet menu, the JAR is set by default as source folder for the Servlet. However this is not a valid selection.

The same is valid for EJB case also.

Reproducible: Always

Steps to Reproduce:
1. Create Dynamic Web 2.5 Project
2. Expand the project and select any JAR under JRE System Library container
3. Select File -> New -> Servlet menu

Result: The JAR is set a source folder by default.

The same is valid for EJB case also.
Comment 1 Roberto Sanchez Herrera CLA 2014-12-29 15:54:08 EST
Created attachment 249651 [details]
Proposed patch

In the proposed patch, we check if the selection is binary. If it is, a default src folder is selected instead. 
NewJavaClassWizardPage is used for servlets and EJBs, therefore the change fixes both cases.
Comment 2 Chuck Bridgham CLA 2015-01-14 07:25:45 EST
Thanks for the patch.
Comment 3 Roberto Sanchez Herrera CLA 2015-01-14 12:17:25 EST
Committed to master for WTP 3.6.3 and 3.7. 
I changed a little bit the patch to update the year in the copyright header to be 2015, and increased the version of the plugin (the feature was already updated in another bug)

http://git.eclipse.org/c/jeetools/webtools.javaee.git/commit/?id=4de6ea8d237762cca22b6c96b2482e61c517a75d