Menu

Detection of "commented out" code

2009-09-24
2012-07-19
  • Nobody/Anonymous

    It is hard to determine when it is uncommented code or a comment

    public boolean equals(Object o)

    {

    if (this == o)

    {

    return true;

    }

    /*

    if (o == null)

    {

    return false;

    }

    */
    if (o.getClass() != getClass())

    {

    return false;

    }

    return (m_key.equals(((KeyValueContainer)o).m_key));

    }

    or

    public boolean equals(Object o)

    {

    if (this == o)

    {

    return true;

    }

    // if (o == null)

    // {

    // return false;

    // }

    if (o.getClass() != getClass())

    {

    return false;

    }

    return (m_key.equals(((KeyValueContainer)o).m_key));

    }

     
  • Joerg Spieler

    Joerg Spieler - 2009-09-24

    Hi,

    in my opinion it is not so usefull or important to find "commented
    out"

    code.

    It also does not fit with the target of UCDetector to find "unnecessary

    code".

    Anywhere, if you are interested, write you own detection. A starting

    point would be here:

    /org.ucdetector.additional/src/org/ucdetector/iterator/CommentIterator.java

    Jörg

     

Anonymous
Anonymous

Add attachments
Cancel