What's new in C4J

Here is a list of new features in each new version:


Version 2.6 compared to 2.5

Contracts for overloaded methods and constructors

Contracts for overloaded methods and constructors is now supported. Note however that overloaded methods with the same number of parameters where the parameter types have the same name (but not the same package) is not supported.

For example, the following will not work:

public void foo(java.lang.String s)
public void foo(my.company.String s)
Version 2.5 compared to 2.4

Resolving simple contractClassName attributes

It is now possible to specify the contract class name with its simple name in the ContractReference annotation, if the contract class if defined in the same package as the target class.

Assume the classes below are defined in the same package (of course, they may be in different source trees). Then the following code now works:

public class DummyContract extends ContractBase<Dummy> {
    ...
}

@ContractReference(contractClassName="DummyContract")
public class Dummy {
    ...
}