Apparently, other people are combining Scala with Drools Planner and
running into this problem too:
http://stackoverflow.com/questions/5279149/implementing-methods-having-ra...
So I created an issue and fixed it:
https://issues.jboss.org/browse/JBRULES-2924
Op 06-02-10 14:28, Adam Warski schreef:
Hello,
> Michael Neale (the drools guvnor guy) is also using Scala and Drools
> Planner together. His code is at github.
I was looking for his account but a search for "Neale" only finds some comments
in BMW's repos. You know what his username is?
> If the issue still makes sense, feel free to open an issue for the
> org.drools.planner.core.solution.Solution#getScore():Score<?>
> discussion (and copy this part of the discussion).
> Why should it be Score<?> and not
> 2) Score<S extends Score>
> 3) or Score<<S extends Score<S extends Score> >> ?
Well in case 2) Scala would still complain about a missing type parameter for the inner
Score. Same for 3, it could go on forever. So for recursive type parameters you need to
stop at some point and put in a wildcard (? in java or _ in scala). Score<?> and
Score have the same meaning in Java (they both mean any Score), the only difference is
that one works, the other not in Scala ;). And for the use in the Solution interface I
think it's write - the get/set method store any score, you don't know which one.
> 4) Or maybe it should be, just like EnumSet?
> class Solution<S extends Score> {
> public S getScore()
> }
This would of course work also, but it's a much bigger refactoring. And it could have
some viral consequences. Score<?> instead of Score is just a drop-in replacement
:).
--
With kind regards,
Geoffrey De Smet