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

Bug 314162

Summary: Wrong Java Facet set during EE import
Product: [WebTools] WTP Java EE Tools Reporter: Jason Sholl <jsholl>
Component: jst.j2eeAssignee: Jason Sholl <jsholl>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: raghunathan.srinivasan
Version: 3.2Flags: jsholl: pmc_approved? (david_williams)
raghunathan.srinivasan: pmc_approved+
jsholl: pmc_approved? (naci.dai)
deboer: pmc_approved+
jsholl: pmc_approved? (neil.hauge)
jsholl: pmc_approved? (kaloyan)
cbridgha: review+
Target Milestone: 3.2 RC3   
Hardware: PC   
OS: Windows Server 2003   
Whiteboard: PMC_approved
Attachments:
Description Flags
patch none

Description Jason Sholl CLA 2010-05-24 16:41:11 EDT
The Java Facet is not always correct when importing EE artifacts.  There are two problems, the first is that the Java facet should be linked to the server; i.e. the highest Java version the targeted server supports should be used.  The second problem is that during headless import the opposite is not happening; i.e. Java 1.6 is always being used regardless of what the server supports.  This second problem is far more critical because the import fails with exceptions titled: org.eclipse.core.commands.ExecutionException: One or more constraints have not been satisfied.

This bug will fix both issues.  It has been tested using the UI both in WTP and in an adopter product targeting a variety of servers including 'none'.  Also the entire suite of WTP JUnits has been run against it.
Comment 1 Jason Sholl CLA 2010-05-24 16:45:06 EDT
Created attachment 169728 [details]
patch
Comment 2 Chuck Bridgham CLA 2010-05-26 13:50:31 EDT
approve
Comment 3 Jason Sholl CLA 2010-05-26 14:11:25 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. 

In addition to the problems described in the first comment, this is breaking adopter code.

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

UI and JUnit

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

The java facets should be set based on the targeted runtime if one exists.

    * What is the risk associated with this fix? 

No.
Comment 4 Jason Sholl CLA 2010-05-26 17:43:54 EDT
code checked into head for wtp 3.2 rc3