I have the problem with C4J framework.
So I have class, for example PhysicsUtils
package ua.avereschaka.Utils;
import de.vksi.c4j.ContractReference;
import ua.avereschaka.Contracts.PhysicsUtilsContract;
@ContractReference(PhysicsUtilsContract.class)
public class PhysicsUtils {
public double getMinSpeed(double busSpeed, double distToBus, double distToRoad){
return (busSpeed * distToRoad) / distToBus;
}
}
And Contract class
package ua.avereschaka.Contracts;
import de.vksi.c4j.Contract;
import de.vksi.c4j.Target;
import ua.avereschaka.Utils.PhysicsUtils;
import static de.vksi.c4j.Condition.*;
@Contract
public class PhysicsUtilsContract extends PhysicsUtils {
@Target
private PhysicsUtils target;
@Override
public double getMinSpeed(double busSpeed, double distToBus, double distToRoad) {
if (preCondition()) {
assert busSpeed >= 0;
assert distToBus >= 0;
assert distToRoad >= 0;
}
if (postCondition()) {
assert result() != null;
assert result(Double.class) >= 0;
}
return ignored();
}
}
And when I call this method from some place with wrong params(for example, negative busSpeed) no error occurs.
I use Intellij IDEA 15, C4J Framework is added to the classpath by project settings.
Can you tell me where is my problem?