Skip to content

Commit

Permalink
PLANNER-227 Variables of primitive types should be illegal because Co…
Browse files Browse the repository at this point in the history
…nstruction Heuristics consider them initialized (even if they are their default value) : fix test
  • Loading branch information
ge0ffrey committed Jul 13, 2016
1 parent 56a2c98 commit 5472cdb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Expand Up @@ -29,7 +29,6 @@
import org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor;
import org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor;
import org.optaplanner.core.impl.testdata.domain.TestdataObject;
import org.optaplanner.core.impl.testdata.domain.TestdataValue;

@PlanningEntity
public class TestdataValueRangeEntity extends TestdataObject {
Expand All @@ -45,8 +44,8 @@ public static GenuineVariableDescriptor buildVariableDescriptorForValue() {
return entityDescriptor.getGenuineVariableDescriptor("value");
}

private int intValue;
private long longValue;
private Integer integerValue;
private Long longValue;
private BigInteger bigIntegerValue;
private BigDecimal bigDecimalValue;
private LocalDate localDateValue;
Expand All @@ -61,21 +60,21 @@ public TestdataValueRangeEntity(String code) {
super(code);
}

@PlanningVariable(valueRangeProviderRefs = "intValueRange")
public int getIntValue() {
return intValue;
@PlanningVariable(valueRangeProviderRefs = "integerValueRange")
public Integer getIntegerValue() {
return integerValue;
}

public void setIntValue(int intValue) {
this.intValue = intValue;
public void setIntegerValue(Integer integerValue) {
this.integerValue = integerValue;
}

@PlanningVariable(valueRangeProviderRefs = "longValueRange")
public long getLongValue() {
public Long getLongValue() {
return longValue;
}

public void setLongValue(long longValue) {
public void setLongValue(Long longValue) {
this.longValue = longValue;
}

Expand Down
Expand Up @@ -78,7 +78,7 @@ public void setScore(SimpleScore score) {
// Complex methods
// ************************************************************************

@ValueRangeProvider(id = "intValueRange")
@ValueRangeProvider(id = "integerValueRange")
public CountableValueRange<Integer> createIntValueRange() {
return ValueRangeFactory.createIntValueRange(0, 3);
}
Expand Down

0 comments on commit 5472cdb

Please sign in to comment.