Sorry for the wordy title :) Here is the Scala object:
object TokenPosition extends java.lang.ThreadLocal[Int]
And here is the Java code that uses it:
TokenPosition$.MODULE$.set(position);
Eclipse gives me the following warning:
Type safety: The method
set(Object)belongs to the raw typeThreadLocal. References to generic typeThreadLocal<T>should be parameterized
What should I do? Or is this an inherent limitation of Generics and Java/Scala interop?
TokenPosition.set( position )not work? does it still warn?class TokenPosition;for the forwarding and specialize,object TokenPosition extends java.lang.ThreadLocal[Int] { def set( i : Int ) : Unit = super.set(i); }