logo       

[ checkstyle-Bugs-1728772 ] Incorrect checking of unusaed var in inner clas: msg#00199

Subject: [ checkstyle-Bugs-1728772 ] Incorrect checking of unusaed var in inner class
Bugs item #1728772, was opened at 2007-05-31 17:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1728772&group_id=29721

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group:  release 4.3
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tim Vernum (tpv)
Assigned to: Nobody/Anonymous (nobody)
Summary: Incorrect checking of unusaed var in inner class

Initial Comment:
In the following code, Checkstyle 4.3 reports _index as an unused variable, 
which is incorrect.

////////////////////////////////////////
public void blah() throws Throwable
{
    final boolean[] called = new boolean[4];

    class Foo 
    {
        private final int _index;

        public Foo(int index)
        {
            _index = index;
        }

        public void execute() throws Throwable
        {
            called[_index] = true;
        }
    }

    new Foo(0).execute();
}
////////////////////////////////////////



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1728772&group_id=29721

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


<Prev in Thread] Current Thread [Next in Thread>