How to use 'BeanProperties' without warnings [message #1760613] |
Fri, 28 April 2017 16:54  |
Eclipse User |
|
|
|
I'm using Eclipse 4.6.3 with Java 8u121. When using data binding, I can't seem to figure out how to write the binding so that I don't get errors about raw types.
So with a statement like
bindingContext.bindValue(WidgetProperties.text(SWT.Modify).observe(textWidget),
BeanProperties.value("propertyName").observe(object))
the compiler gives the warning:
Type safety: The method observe(Object) belongs to the raw type IValueProperty. References to generic type IValueProperty<S,T> should be parameterized
I've tried different type casts, but then I get additional warnings:
- Type safety: Unchecked cast from IObservableValue to IObservableValue<String>
- Unnecessary cast from IObservableValue to IObservableValue<String>
How should this be written so the check for raw types is enabled, but no warnings are issued?
P.S. The code works as desired, despite the warnings.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02932 seconds