MutabilityDetector/MutabilityDetector — pull request #54 by marcgs (2013-11-28 19:50:46+00:00)
Title: Consolidated reasons

This is a first concept for consolidating multiple similar mutability reasons.

The idea is that MutabilityReasons can provide a list of other MutabilityReasons that supersede them. As a first example I've configured NON_FINAL_FIELD to be superseded by PUBLISHED_NON_FINAL_FIELD, so in case of a public non final field only the second reason is returned, avoiding a too verbose output (See ConsolidatedReasonsTest).

Superseded reasons are filtered by the SupersededReasonsFilter. At first I implemented the filtering in the AllChecksRunner class, but this had as a consequence that if the superseder of a reason is allowed, then the class is wrongly classified as mutable. I fixed this by moving the filtering to the WithAllowedReasonsMatcher.

Let me know what you think.