[Minor] Automated Code cleanup: Wrapper type may be primitive
This commit is contained in:
parent
d74ed6fb2d
commit
1462906609
|
@ -78,7 +78,7 @@ public class StrolchPolicyFileParser extends DefaultHandler {
|
|||
return this.policyModel;
|
||||
}
|
||||
|
||||
public class PolicyModel {
|
||||
public static class PolicyModel {
|
||||
private final Map<String, PolicyType> policyTypes;
|
||||
|
||||
public PolicyModel() {
|
||||
|
|
|
@ -66,7 +66,7 @@ public class FloatTimeVariableTest {
|
|||
public void testGetFutureValues() {
|
||||
Collection<ITimeValue<FloatValue>> futureValues = this.timeVariable.getFutureValues(PICK);
|
||||
Long expectedTime = PICK;
|
||||
Double expectedValue = PICK.doubleValue();
|
||||
double expectedValue = PICK.doubleValue();
|
||||
for (ITimeValue<FloatValue> value : futureValues) {
|
||||
assertEquals(expectedTime, value.getTime());
|
||||
assertTrue(value.getValue().matches(new FloatValue(expectedValue)));
|
||||
|
@ -82,7 +82,7 @@ public class FloatTimeVariableTest {
|
|||
public void testGetPastValues() {
|
||||
Collection<ITimeValue<FloatValue>> pastValues = this.timeVariable.getPastValues(MAX);
|
||||
Long expectedTime = 0L;
|
||||
Double expectedValue = expectedTime.doubleValue();
|
||||
double expectedValue = expectedTime.doubleValue();
|
||||
for (ITimeValue<FloatValue> value : pastValues) {
|
||||
assertEquals(expectedTime, value.getTime());
|
||||
assertTrue(value.getValue().matches(new FloatValue(expectedValue)));
|
||||
|
@ -132,7 +132,7 @@ public class FloatTimeVariableTest {
|
|||
assertNotNull(actual);
|
||||
|
||||
IValue<Double> expectedValue = new FloatValue(STEP.doubleValue());
|
||||
assertEquals(true, actual.getValue().matches(expectedValue));
|
||||
assertTrue(actual.getValue().matches(expectedValue));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,7 +142,7 @@ public class FloatTimeVariableTest {
|
|||
public void testCompact() {
|
||||
|
||||
this.timeVariable = new TimeVariable<>();
|
||||
for (Long i = 0L; i < MAX; i += STEP) {
|
||||
for (long i = 0L; i < MAX; i += STEP) {
|
||||
this.timeVariable.setValueAt(i, new FloatValue(STEP.doubleValue()));
|
||||
}
|
||||
// call
|
||||
|
|
|
@ -52,7 +52,7 @@ public class IntegerTimeVariableTest {
|
|||
this.timeVariable = new TimeVariable<>();
|
||||
for (int i = 0; i < MAX; i += STEP) {
|
||||
IntegerValue expectedValue = new IntegerValue(i);
|
||||
Long time = (long) i;
|
||||
long time = (long) i;
|
||||
this.expectedValues.put(time, expectedValue);
|
||||
this.timeVariable.setValueAt(time, expectedValue);
|
||||
}
|
||||
|
@ -71,12 +71,12 @@ public class IntegerTimeVariableTest {
|
|||
public void testGetFutureValues() {
|
||||
Collection<ITimeValue<IntegerValue>> futureValues = this.timeVariable.getFutureValues(PICK);
|
||||
Long expectedTime = PICK;
|
||||
Integer expectedValue = PICK.intValue();
|
||||
int expectedValue = PICK.intValue();
|
||||
for (ITimeValue<IntegerValue> value : futureValues) {
|
||||
assertEquals(expectedTime, value.getTime());
|
||||
assertTrue(value.getValue().matches(new IntegerValue(expectedValue)));
|
||||
expectedTime += STEP;
|
||||
expectedValue += STEP.intValue();
|
||||
expectedValue += STEP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,12 +87,12 @@ public class IntegerTimeVariableTest {
|
|||
public void testGetPastValues() {
|
||||
Collection<ITimeValue<IntegerValue>> pastValues = this.timeVariable.getPastValues(MAX);
|
||||
Long expectedTime = 0L;
|
||||
Integer expectedValue = expectedTime.intValue();
|
||||
int expectedValue = expectedTime.intValue();
|
||||
for (ITimeValue<IntegerValue> value : pastValues) {
|
||||
assertEquals(expectedTime, value.getTime());
|
||||
assertTrue(value.getValue().matches(new IntegerValue(expectedValue)));
|
||||
expectedTime += STEP;
|
||||
expectedValue += STEP.intValue();
|
||||
expectedValue += STEP;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ public class IntegerTimeVariableTest {
|
|||
@Test
|
||||
public void testApplyChange() {
|
||||
|
||||
IntegerValue integerValue = new IntegerValue(STEP.intValue());
|
||||
IntegerValue integerValue = new IntegerValue(STEP);
|
||||
|
||||
IValueChange<IntegerValue> change = new ValueChange<>(PICK, integerValue);
|
||||
this.timeVariable.applyChange(change, false);
|
||||
|
@ -115,7 +115,7 @@ public class IntegerTimeVariableTest {
|
|||
assertEquals(expectedTime, value.getTime());
|
||||
assertTrue(expectedValue.matches(value.getValue()));
|
||||
expectedTime += STEP;
|
||||
expectedValue = expectedValue.add(STEP.intValue());
|
||||
expectedValue = expectedValue.add(STEP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,8 +125,8 @@ public class IntegerTimeVariableTest {
|
|||
@Test
|
||||
public void testCompact() {
|
||||
this.timeVariable = new TimeVariable<>();
|
||||
for (Long i = 0L; i < MAX; i += STEP) {
|
||||
this.timeVariable.setValueAt(i, new IntegerValue(STEP.intValue()));
|
||||
for (long i = 0L; i < MAX; i += STEP) {
|
||||
this.timeVariable.setValueAt(i, new IntegerValue(STEP));
|
||||
}
|
||||
|
||||
// call
|
||||
|
|
|
@ -55,7 +55,7 @@ public class StringTimeVariableTest {
|
|||
@Before
|
||||
public void init() {
|
||||
this.timeVariable = new TimeVariable<>();
|
||||
for (Long i = 0L; i < MAX; i += STEP) {
|
||||
for (long i = 0L; i < MAX; i += STEP) {
|
||||
Set<AString> testSet = new HashSet<>();
|
||||
StringSetValue testValue = new StringSetValue(testSet);
|
||||
this.testSets.put(i, testValue);
|
||||
|
@ -119,7 +119,7 @@ public class StringTimeVariableTest {
|
|||
public void testCompact() {
|
||||
|
||||
this.timeVariable = new TimeVariable<>();
|
||||
for (Long i = 0L; i < MAX; i += STEP) {
|
||||
for (long i = 0L; i < MAX; i += STEP) {
|
||||
Set<AString> testSet = new HashSet<>();
|
||||
StringSetValue testValue = new StringSetValue(testSet);
|
||||
this.testSets.put(i, testValue);
|
||||
|
|
Loading…
Reference in New Issue