Bug 306572

Summary: Classpath Dependency Validator is broken
Product: [WebTools] WTP Java EE Tools Reporter: Carl Anderson <ccc>
Component: jst.j2eeAssignee: Carl Anderson <ccc>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: critical    
Priority: P1 CC: konstantin, robert_gallagher
Version: 3.2   
Target Milestone: 3.2 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 298905    
Bug Blocks:    
Attachments:
Description Flags
Change the validation to an enablement check none

Description Carl Anderson CLA 2010-03-19 14:57:56 EDT
The Classpath Dependency Validator is not working in WTP 3.2.  This validator is crucial for notification of items placed on the Java Build Path that will not be deployed properly to a server, thus potentially causing runtime exceptions on the server.

The reason why this is broken is the change made in bug 298905 - the facet id was changed from jst.java to java, but the Classpath Dependency Validator still enables only for the (now non-existent) jst.java facet.
Comment 1 Konstantin Komissarchik CLA 2010-03-19 15:11:52 EDT
Hi Carl,

Could you point me at where/how this enablement happens. I want to understand how this code bypassed backward compatibility system.

- Konstantin
Comment 2 Carl Anderson CLA 2010-03-19 15:27:34 EDT
Created attachment 162558 [details]
Change the validation to an enablement check
Comment 3 Carl Anderson CLA 2010-03-19 15:29:15 EDT
The chain of things that caused this is getting complicated.

Both the rename of the java facet and the change over from <facet> to <enablement> in the validator extensions impacted this.

For backwards-compatibility's sake, I have simply changed the check over to <enablement>, checking for the (properly aliased) jst.java facet.
Comment 4 Carl Anderson CLA 2010-03-19 15:31:54 EDT
Committed to HEAD for WTP 3.2 M7.
Comment 5 Konstantin Komissarchik CLA 2010-03-19 16:29:47 EDT
Thanks, Carl! I owe you one. Are you going to be at EclipseCon so that I can buy you a frosty one?

What is the story on <facet> vs <enablement> in the validators extension? Is <facet> a deprecated syntax? It sounds like there is a code path that is bypassing the facet aliasing system that we need to patch before someone else runs into this...
Comment 6 Carl Anderson CLA 2010-03-19 16:43:55 EDT
Konstantin, the legacy Validation framework deprecated the <facet> enablement.  However, the code that it uses is in the org.eclipse.wst.validation plugin, in  org.eclipse.wst.validation.internal.ValidationRegistryReader in both calculateVmdsForNatureAndFacets() and containsProjectFacet().
Feel free to poke around, but the <facet> has been deprecated since WTP 1.5.0... were we not past the API freeze, I would remove it.