Community
Participate
Working Groups
Two methods, whose visibility modifiers are set to "private" and which are only referred to mutually, should be marked as dead code. See the following example: public class Test { private void foo() { bar(); } private void bar() { foo(); } private void foobar() { // The method ... is never used locally foobar(); } } The methods foo and bar form a cyclic call hierarchy with two elements, but are not marked as unused private members. The method foobar forms a cyclic call hierarchy with one element and is correctly detected as dead code. The unused code detection should of course include cyclic call hierarchies with an arbitrary number of elements and for that case provide an appropriate warning message (because the method is used locally but not reachable).