Commit e5e286fc authored by mey's avatar mey
Browse files

fixed java 1.7 copatibility for zmt.launcher

deleted redundant type arguments

Launcher.java
    fixed calling method that is introduced in java 1.8
        and therefore incompatible to java 1.7
parent 9a10652b
......@@ -27,7 +27,7 @@ public abstract class AbstractLimitedStoragePipeline<Q extends Quantity>
private static final long serialVersionUID = 1L;
private final LimitedStorage<Q> sum;
private final Queue<DelayedStorage<Q>> queue = new SerializableDelayQueue<DelayedStorage<Q>>();
private final Queue<DelayedStorage<Q>> queue = new SerializableDelayQueue<>();
/**
*
......
......@@ -145,7 +145,7 @@ public class ConfigurableStorage<Q extends Quantity> extends BaseStorage<Q> impl
if (atLimit(limit, direction)) {
// if already at limit, return full amount
return new ChangeResult<Q>(AmountUtil.zero(amountToAdd), amountToAdd);
return new ChangeResult<>(AmountUtil.zero(amountToAdd), amountToAdd);
}
Amount<Q> productAmount = amountToAdd.times(factor);
......@@ -160,7 +160,7 @@ public class ConfigurableStorage<Q extends Quantity> extends BaseStorage<Q> impl
amount = limit;
// remove the factor
rejectedAmount = rejectedAmount.divide(factor);
return new ChangeResult<Q>(storedAmount, rejectedAmount);
return new ChangeResult<>(storedAmount, rejectedAmount);
}
}
......@@ -174,7 +174,7 @@ public class ConfigurableStorage<Q extends Quantity> extends BaseStorage<Q> impl
amount = Amount.valueOf(amount.getEstimatedValue(), amount.getUnit());
}
return new ChangeResult<Q>(storedAmount, rejectedAmount);
return new ChangeResult<>(storedAmount, rejectedAmount);
}
/** Set the storage to its lower limit or to zero if no limit set. */
......
......@@ -77,7 +77,7 @@ public class ConfigurableStorageTest {
@Test
public void testWithoutLimits() {
ConfigurableStorage<Dimensionless> storage = new ConfigurableStorage<Dimensionless>(Unit.ONE, true);
ConfigurableStorage<Dimensionless> storage = new ConfigurableStorage<>(Unit.ONE, true);
storage.add(CHANGE_AMOUNT);
storage.add(CHANGE_AMOUNT);
storage.add(CHANGE_AMOUNT.opposite());
......
......@@ -70,7 +70,7 @@ public class StoragePipelineTest implements Serializable {
public void testWithoutLimits() {
logger.info("Testing Pipeline without limits.");
StoragePipeline<Dimensionless> pipeline = new Pipeline(new ConfigurableStorage<Dimensionless>(Unit.ONE));
StoragePipeline<Dimensionless> pipeline = new Pipeline(new ConfigurableStorage<>(Unit.ONE));
// initialize
logger.info(pipeline.toString());
......@@ -98,7 +98,7 @@ public class StoragePipelineTest implements Serializable {
public void testSerialization() throws IOException, ClassNotFoundException {
logger.info("Testing Pipeline serialization.");
Pipeline pipeline = new Pipeline(new ConfigurableStorage<Dimensionless>(Unit.ONE));
Pipeline pipeline = new Pipeline(new ConfigurableStorage<>(Unit.ONE));
Pipeline restoredPipeline;
byte[] objData;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment