DESCRIPTION

Bug 472672, 335792 - Add generics to databinding.observable

Change-Id: I0789ca45da254f67b9644d5b88d6438242d66e3c
Signed-off-by: Kelly Potter xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2015-07-17 17:56:02.000000000

Patch Set 17:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/6064/

-------------------------------------
author: Brenden Conley
date: 2015-07-17 18:20:34.000000000

Patch Set 17: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/6064/ : SUCCESS

-------------------------------------
author: Kelly Potter
date: 2015-07-17 23:05:51.000000000

Patch Set 17: Code-Review+2

-------------------------------------
author: Gerrit Code Review
date: 2015-07-17 23:05:57.000000000

Change has been successfully merged into the git repository by Kelly Potter

-------------------------------------
author: Reginald Walters
date: 2015-07-21 21:13:25.000000000

Patch Set 17:

(1 comment)

Line:40, bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java -> Using wildcards as the return value on the API is cumbersome for client code; it is either forced to handle the wildcard or cast diff to SetDiff<E>.

Oracle guidelines for generics discourage the use as the return type (https://docs.oracle.com/javase/tutorial/java/generics/wildcardGuidelines.html).

Perhaps we could invert them for the constructor, such as (IObservable<? super F>, SetDiff<F>). I think this way there would be no wildcards for the return types, while having the same functionality.

-------------------------------------
author: Kelly Potter
date: 2015-07-21 21:27:44.000000000

Patch Set 17:

(1 comment)

Line:40, bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java -> We need the constructor argument to be <? extends E> in order to continue supporting code which rebroadcasts diffs. There are a few places in the code (most notably, the *Delegate classes) that receive a diff from one place and reattach that diff to a new event object which they rebroadcast.

I couldn't find a way to make these classes compile without using the "extends" keyword here. However, if you can think of a way to make it work and want to contribute a patch, I'll be happy to review it.

Since this code is already in master, it's too late to change the original patch but we could make a new patch that makes further updates.

Also: I'd suggest that you avoid the use of SetChangeEvent entirely since you can handle most use-cases using ComputedValue, ComputedSet, etc.

-------------------------------------
author: Kelly Potter
date: 2015-07-31 20:25:38.000000000

Patch Set 17:

(1 comment)

Line:40, bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/set/SetChangeEvent.java -> I've filed bug 474065 for this suggestion.

-------------------------------------
