Community
Participate
Working Groups
When a Web, EJB or other modules are imported, the version of the java facet is set to the latest version supported by the target runtime (if a runtime is selected), or to the version appropriate to the Java EE level of the module. But this does not happen for utility or web fragment modules: for those modules, the java facet is always the latest available, which can create a mismatch, for example, if the latest version available for Java is version 1.7, but the target runtime supports up to Java 1.6
Created attachment 210624 [details] Proposed patch This patch was created using R3_3_maintenance. The fix consists on re-calculating the java facet version for Utility and Web fragments, in the same way it is done for other modules. I also found an error in JavaEEQuickPeek, which is corrected in this patch.
approved. please add the PMC text/ questions
* 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. This bug can cause utility and web fragment projects to be imported with java facets which are not supported by a target runtime.If the EAR has a combination of Utility, Web, web fragment and ejb modules, when the EAR is imported, the utility and web fragment modules will have different java version than the other modules. Looks like this behavior has been there for a while, but now with Java 7, this problem is more evident. * Is there a work-around? If so, why do you believe the work-around is insufficient? After importing an EAR that has a combination of Utility, Web, web fragment and ejb modules, if the target server does not support Java 7, the user would have to change the java facet of utility and web fragments projects manually, and assign the target runtime manually. * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Existing JUnits were run. Tested manually. * Give a brief technical overview. Who has reviewed this fix? The model providers for importing utility and web fragment projects were changed to update the java facet based on the target runtime, or the Java EE spec level, similar to other modules like web and ejb. Chuck Bridgham reviewed the fix. * What is the risk associated with this fix? Low
Code committed to R3_3_maintenance and HEAD for WTP 3.3.2 and 3.4. Resolving bug.