For this piece of code (JavaFX).
StringProperty sp;
DoubleProperty dp;
StringConverter<Double> converter = new DoubleStringConverter();
Bindings.bindBidirectional(sp, dp, converter);
I get compilation error (in Eclipse IDE)
This is the method signature:
public static <T> void bindBidirectional(Property<String> stringProperty, Property<T> otherProperty, StringConverter<T> converter)
But if I remove parametrization (of StringConverter), then I get only warnings and code works.
StringConverter converter = new DoubleStringConverter();
I am trying to avoid to use raw type of generics so that I don't have to suppress warnings in my IDE.
So the question is:
What is the right pattern to write this piece of code?