Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to use 'BeanProperties' without warnings
How to use 'BeanProperties' without warnings [message #1760613] Fri, 28 April 2017 20:54 Go to next message
Glenn Burkhardt is currently offline Glenn BurkhardtFriend
Messages: 5
Registered: April 2017
Junior Member
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.
Re: How to use 'BeanProperties' without warnings [message #1761905 is a reply to message #1760613] Thu, 11 May 2017 15:59 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 657
Registered: January 2012
Senior Member

The beans-based properties haven't been genericized. Tracking work is:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=335792


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Previous Topic:Define Key Binding in Fragment
Next Topic:How to populate undo/redo in an E3/E4 hybrid editor (DIEditorPart)?
Goto Forum:
  


Current Time: Tue Sep 26 18:23:08 GMT 2017

Powered by FUDForum. Page generated in 0.03136 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software