The following code causes the error
com.google.java.contract.InvariantError: field != 0
to be thrown when a ClassWithFinalField object is instantiated.
@Invariant("field != 0")
public class ClassWithFinalField {
private final int field;
public ClassWithFinalField(int field) {
this.field = field;
}
}
public class CofojaClassWithFinalFieldTest {
@Test
public void canCreateClassWithFinalFieldAndValidInvariant() {
new ClassWithFinalField(1);
}
}
Original issue reported on code.google.com by tom.mago...@gmail.com on 26 Apr 2011 at 10:14
Original issue reported on code.google.com by
tom.mago...@gmail.com
on 26 Apr 2011 at 10:14