In this question, an edit to the code (by other than the asker) added this block of comments to the code:

    // duplication
    //     ||
    //    \||/
    //     \/
    try {
        listener = (SomeListener) activity;
    } catch (ClassCastException e) {
        throw new ClassCastException(activity.toString()
                + " must implement SomeListener");

This appears to be an answer or comment, of sorts.

Is this good practice? Should I flag it for moderator attention?


1 Answer 1


The edit history at https://codereview.stackexchange.com/posts/39091/revisions shows that that edit was made by the OP.

Also IMO it's OK to edit question text to clarify the question (if you're sure of your clarification): similarly therefore IMO it's OK to add comments (not code) to the code, if (again) you're sure of your clarification, and if you think that clarification is necessary/helpful to help other people to understand the question.

  • \$\begingroup\$ I missed that it was the OP who made the edit. I didn't read the history close enough. Oops! \$\endgroup\$ Jan 12, 2014 at 14:28
  • 2
    \$\begingroup\$ Similarly, if you're sure that an edit is wrong, you can use edit history to "Roll back" the edit to a previous version (explaining why you did so in an edit comment). If doing so results in an "edit war" then you might/must flag it for moderator attention. \$\endgroup\$
    – ChrisW
    Jan 12, 2014 at 14:32
  • \$\begingroup\$ @ChrisW: Community♦ will also raise an autoflag in these instances. \$\endgroup\$
    – Jamal
    Jan 12, 2014 at 18:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .