[
https://issues.jboss.org/browse/JBRULES-2924?page=com.atlassian.jira.plug...
]
Geoffrey De Smet edited comment on JBRULES-2924 at 3/13/11 8:21 AM:
--------------------------------------------------------------------
{code}
[MAJOR] Solution now has a generic type of Score: Solution<S extends Score>
(JBRULES-2924)
Your Solution implementation itself should not be generic, but it should define it's
Score type through implements.
Before in *.java if you use a SimpleScore:
public class ... implements Solution {
...
public void setScore(Score score) {
this.score = (SimpleScore) score;
}
...
}
After in *.java if you use a SimpleScore:
public class ... implements Solution<SimpleScore> {
...
public void setScore(SimpleScore score) {
this.score = score;
}
...
}
Before in *.java if you use a HardAndSoftScore:
public class ... implements Solution {
...
public void setScore(Score score) {
this.score = (HardAndSoftScore) score;
}
...
}
After in *.java if you use a HardAndSoftScore:
public class ... implements Solution<HardAndSoftScore> {
...
public void setScore(HardAndSoftScore score) {
this.score = score;
}
...
}
{code}
was (Author: ge0ffrey):
[MAJOR] Solution now has a generic type of Score: Solution<S extends Score>
(JBRULES-2924)
Your Solution implementation itself should not be generic, but it should define it's
Score type through implements.
Before in *.java if you use a SimpleScore:
public class ... implements Solution {
...
public void setScore(Score score) {
this.score = (SimpleScore) score;
}
...
}
After in *.java if you use a SimpleScore:
public class ... implements Solution<SimpleScore> {
...
public void setScore(SimpleScore score) {
this.score = score;
}
...
}
Before in *.java if you use a HardAndSoftScore:
public class ... implements Solution {
...
public void setScore(Score score) {
this.score = (HardAndSoftScore) score;
}
...
}
After in *.java if you use a HardAndSoftScore:
public class ... implements Solution<HardAndSoftScore> {
...
public void setScore(HardAndSoftScore score) {
this.score = score;
}
...
}
Planner: make it scala friendly and avoid casting in
Solution.setScore() implementation: Solution interface gets a type S extend Score so
Solution.getScore() returns S and Solution.setScore() now has a parameter S
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBRULES-2924
URL:
https://issues.jboss.org/browse/JBRULES-2924
Project: Drools
Issue Type: Enhancement
Security Level: Public(Everyone can see)
Components: drools-planner
Reporter: Geoffrey De Smet
Assignee: Geoffrey De Smet
Fix For: 5.2.0.M2
See
http://stackoverflow.com/questions/5279149/implementing-methods-having-ra...
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira