We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example - assert getX() should really be assert target.getX():
assert getX()
assert target.getX()
public class A { private int x; public int getX() { return x; } public void setX(int x) { this.x = x; } } import static de.andrena.c4j.Condition.postCondition; import static de.andrena.c4j.Condition.preCondition; import de.andrena.c4j.Target; public class AContract extends A { @Override public void setX(int x) { if (preCondition()) { assert x > 0 : "x > 0"; } if (postCondition()) { assert getX() == x : "x set"; } } } import org.junit.Test; public class ATest { @Test public void test() { A a = new A(); a.setX(5); } }
The text was updated successfully, but these errors were encountered:
03ca943
BenRomberg
No branches or pull requests
Example -
assert getX()
should really beassert target.getX()
:The text was updated successfully, but these errors were encountered: