As @Contracted is checked lazily, if no contract is checked after a class with missing @Contracted is loaded, the "@Contracted missing" exception is not thrown. What steps will reproduce the problem? 1. Declare an interface with contracts and a class that implements it. Do not annotate with @Contracted. Do not put contracts anywhere else.
Compile and run normally. What is the expected output? What do you see instead? Expected: exception thrown
See: nothing happens (contract is not triggered (as expected) and @Contracted absence is not detected)
From chat...@google.com on March 23, 2011 08:56:05
As @Contracted is checked lazily, if no contract is checked after a class with missing @Contracted is loaded, the "@Contracted missing" exception is not thrown. What steps will reproduce the problem? 1. Declare an interface with contracts and a class that implements it. Do not annotate with @Contracted. Do not put contracts anywhere else.
Original issue: http://code.google.com/p/cofoja/issues/detail?id=17