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

Bug 354224

Summary: mutually exclusive Facets
Product: z_Archived Reporter: Nicolas Bros <nicolas.bros>
Component: EMF-FacetAssignee: Gregoire Dupe <gdupe>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: Ed.Merks, emft.facet-inbox, gdupe
Version: unspecifiedFlags: gdupe: indigo+
Ed.Merks: pmc_approved+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
movie showing what happens
none
Unit test
gdupe: iplog+, nicolas.bros: review+
Patch gdupe: iplog+, nicolas.bros: review+

Description Nicolas Bros CLA 2011-08-09 05:16:48 EDT
I apply 2 Facets from the same FacetSet in the table editor. One Facet is applicable to a uml.NamedElement, and the other is applicable to a uml.Class.

When I apply both, only one facet column appears (instead of two). When I apply only one of both, it always appears correctly.
Comment 1 Nicolas Bros CLA 2011-08-09 05:18:33 EDT
Created attachment 201124 [details]
movie showing what happens
Comment 2 Gregoire Dupe CLA 2011-08-25 11:07:57 EDT
Created attachment 202158 [details]
Unit test

Here is a unit test for this bug.

(a) I, Gregoire Dupe, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.
(d) This contribution contains no Cryptography features.
Comment 3 Gregoire Dupe CLA 2011-08-25 11:08:51 EDT
Created attachment 202159 [details]
Patch

Here is a patch for this bug.

(a) I, Gregoire Dupe, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.
(d) This contribution contains no Cryptography features.
Comment 4 Nicolas Bros CLA 2011-08-26 04:02:10 EDT
Comment on attachment 202159 [details]
Patch

The patch adds a few Java and checkstyle warnings in NatTableWidget.java around line 453.
Apart from this, it looks good to me.
Comment 5 Nicolas Bros CLA 2011-08-26 04:20:50 EDT
Comment on attachment 202158 [details]
Unit test

In Bug354224Test, it took me a while to understand why finalNatTableWidgetList was an ArrayList.
What I usually do to return an instance from a Runnable is to pass it through a primitive array of size 1. I think it makes the purpose clearer.

Even better is the way it's done in SWTBot, with syncExec defined as:
<T> T syncExec(final Result<T> runnable)
Maybe we could make it a utility in EMF Facet.
Comment 6 Gregoire Dupe CLA 2011-08-29 12:30:14 EDT
(In reply to comment #4) and (In reply to comment #5)
> Comment on attachment 202158 [details]
> Comment on attachment 202159 [details] 

Ok, I'll applied the Nicolas' recommendation before to commit.

Ed, do you agree to commit those patches before RC2 ?

Regards,
Gregoire
Comment 7 Gregoire Dupe CLA 2011-08-31 04:51:33 EDT
Comment on attachment 202158 [details]
Unit test

I've committed this patch on the branch 0_1.
Comment 8 Gregoire Dupe CLA 2011-08-31 04:51:54 EDT
Comment on attachment 202159 [details]
Patch

I've committed this patch on the branch 0_1.
Comment 9 Gregoire Dupe CLA 2011-08-31 05:59:54 EDT
Comment on attachment 202159 [details]
Patch

I've committed this patch in the trunk.

Committed revision 806.
Comment 10 Gregoire Dupe CLA 2011-08-31 06:00:25 EDT
Comment on attachment 202158 [details]
Unit test

I've committed this patch in the trunk.

Committed revision 807.
Comment 11 Gregoire Dupe CLA 2011-08-31 06:00:53 EDT
This bug can be marked as fixed.
Comment 12 Gregoire Dupe CLA 2012-05-23 08:10:02 EDT
This bug can be closed.