Bug 306572 - Classpath Dependency Validator is broken
Summary: Classpath Dependency Validator is broken
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: 3.2 M7   Edit
Assignee: Carl Anderson CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on: 298905
Blocks:
  Show dependency tree
 
Reported: 2010-03-19 14:57 EDT by Carl Anderson CLA
Modified: 2010-03-19 16:43 EDT (History)
2 users (show)

See Also:


Attachments
Change the validation to an enablement check (881 bytes, patch)
2010-03-19 15:27 EDT, Carl Anderson CLA
no flags Details | Diff

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