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

Bug 223650

Summary: allowing testing for project facets that are not defined
Product: [WebTools] WTP Common Tools Reporter: Janelle Carroll <janelle>
Component: Faceted Project FrameworkAssignee: Konstantin Komissarchik <konstantin>
Status: RESOLVED FIXED QA Contact: Konstantin Komissarchik <konstantin>
Severity: enhancement    
Priority: P3 Keywords: plan
Version: 3.0   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch providing an enhancement for FacetedProjectPropertyTester none

Description Janelle Carroll CLA 2008-03-24 10:07:03 EDT
Created attachment 93272 [details]
patch providing an enhancement for FacetedProjectPropertyTester

The FacetedProjectPropertyTester answers true if the value that I pass to it represents a facet that is defined. This is perfectly valid, but I would also like to know if the value that I pass on the property tester represents a facet that may be unknown. For example, in a later verson of the product, the facet that is installed for the project in org.eclipse.wst.common.project.facet.core.xml is no longer defined, but I would like to know if the project has that facet (or maybe it is more correct to say that is had that facet defined and installed at one time).

I am attaching a patch that provides one example of a way to implement this suggestion. Thank you.
Comment 1 Konstantin Komissarchik CLA 2008-03-24 13:13:26 EDT
Thanks for the patch. I will take a look at this for M6.
Comment 2 Konstantin Komissarchik CLA 2008-03-31 18:46:00 EDT
This requires more thought, particularly in the are of how to handle versions. Such as the case where a version range is specified or the case where facet exists but the installed version is undefined.

Will not make it into M6.
Comment 3 Konstantin Komissarchik CLA 2008-05-07 17:23:48 EDT
I can't think of a way to do this without an API change and since we are past API freeze at this point, this will have to wait for a future release.
Comment 4 Konstantin Komissarchik CLA 2009-02-18 16:28:32 EST
Sorry for taking so long, but this feature is finally ready. I didn't end up adding any new API, but instead changed the existing API to cover this use case correctly instead of always returning false. I also added various unit tests to cover the myriad of corner cases of possibilities. It appears to work. Give it a try when you get a chance and open bugs if you find any issues.

Released code changes into the 3.1 M6 code stream.