The Inspection Connection – Issue #2, Proposition Transformation

This entry was posted in Tips & Tricks and tagged . Bookmark the permalink.

5 Responses to The Inspection Connection – Issue #2, Proposition Transformation

  1. Michael Glockenstein says:

    the first example in #3 repeats the code from #1 and does not show yoda style

  2. Alejandro Hdez. Angeles says:

    In the Merge sequential ‘if’s example, i call intentions but doesn’t appear the option of merging sequencial if’s, i’m using IntelliJ Idea 14 Preview

    • Breandan Considine says:

      Alejandro, sometimes intentions can be a little finicky – your cursor needs to be directly over one of the characters in if (. I’ve updated the Merge sequential ‘if’s example to reflect this and added a ticket to YouTrack to make Show Intention Actions a little more flexible (this seems to be a recurring issue). Gracias por los comentarios!

  3. Alejandro Hdez. Angeles says:

    The example:
    public boolean shortCircuitAnd(Boolean a, Boolean b) {
    if(a == false) { //a = false -> no error
    return false;
    }
    if(false == b) { //false = b -> compiler error
    return false;
    }

    return true;
    }

    should be:
    public boolean shortCircuitAnd(Boolean a, Boolean b) {
    if(a = false) { //a = false -> no error
    return false;
    }
    if(false = b) { //false = b -> compiler error
    return false;
    }

    return true;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *