Bug 413611 - Reduce compiler warnings in org.eclipse.jface.bindings caused by moving JFace to Java 1.6
Summary: Reduce compiler warnings in org.eclipse.jface.bindings caused by moving JFace...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.5 M7   Edit
Assignee: Simon Scholz CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks: 411383
  Show dependency tree
 
Reported: 2013-07-24 05:27 EDT by Hendrik Still CLA
Modified: 2015-04-28 06:34 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hendrik Still CLA 2013-07-24 05:27:31 EDT
Fix the compiler warnings in package org.eclipse.jface.bindings caused by moving to Java 1.5
Comment 1 Hendrik Still CLA 2013-07-29 06:00:13 EDT
The bindings package is very hard to fix. Especial the org.eclipse.jface.bindings.BindingManager class which has a lot of maps with values of different types in it which were evaluated by runtime.


if (existingMatch instanceof Binding) {
//..
} else if (existingMatch instanceof Collection) { 
//..
}

This makes it hard to define a correct type.

Also some of the types from the parameter description can't be right. For example the Method computeBindings has a parameter triggersByCommandId which is describt with "command identifiers (<code>String</code>) to triggers (<code>TriggerSequence</code>)". But it adds ParameterizedCommand and TriggerSequence to that map.
Comment 2 John Arthorne CLA 2013-07-30 13:22:34 EDT
I suggest to skip it and focus on the viewers.
Comment 3 Lars Vogel CLA 2014-02-28 06:46:31 EST

*** This bug has been marked as a duplicate of bug 428355 ***
Comment 4 Dani Megert CLA 2014-04-29 07:30:38 EDT
.
Comment 5 Lars Vogel CLA 2014-09-11 05:38:32 EDT
Simon, can you have a look at this?
Comment 6 Jeanderson Candido CLA 2014-09-12 00:21:28 EDT
(In reply to Lars Vogel from comment #5)
> Simon, can you have a look at this?

Lars, I found more than 200 warnings on this package. Most of them seems to be related to this issue.

I thought a handy hand to Simon could be useful. If there's no problem, I would like to continue helping on this issue.

Here is a fix for ControlDecorationSupport, SWTObservables, JFaceProperties, ViewerLabelProvider

Patch: https://git.eclipse.org/r/33291
Comment 7 Jeanderson Candido CLA 2014-09-12 01:43:45 EDT
> Lars, I found more than 200 warnings on this package...
Sorry, I mean on this *project*
Comment 8 Lars Vogel CLA 2014-09-12 05:23:58 EDT
(In reply to Jeanderson Candido from comment #6)
> Patch: https://git.eclipse.org/r/33291

Thanks Jeanderson. Applied with https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=721a97a0400700e1836ef59737e844e66475f4c3
Comment 9 Jeanderson Candido CLA 2014-09-12 18:42:21 EDT
I was browsing some code from databinding. Most warnings are caused by Raw types and I think there are two possible solutions for that:

As a matter of example, consider the following declaration:
public class ViewerElementSet implements Set { ... }

1 - We could add support to Generics to databinding data structures
public class ViewerElementSet<E> implements Set<E> { ... }

2 - Remove raw types using Object and wildcards when possible:
public class ViewerElementSet implements Set<Object> { ... }

I honestly think that using the second approach will be easier to fix the issue and have less impact to the project.

The first approach seems to be more complete and flexible but as someone who was working with generification, I think it will require some extra effort generify databinding. Also, we will be breaking the public API and generating more warnings.

Opinions and suggestions?
Comment 10 Lars Vogel CLA 2015-04-17 06:00:08 EDT
I see lots of warnings in lots of plug-ins, does not make sense to have a bug report for individual plug-ins. Marking as fixed, as we fix several warnings in this plug-in.
Comment 11 Lars Vogel CLA 2015-04-28 06:34:21 EDT
.