Inspection granularity: Allow "control flow without braces" single-liners

Issue #977 resolved
Jason Clark created an issue

Title says it all. I'm pretty stringent about requiring braces, but I do like the brevity of single liners, especially for if statements that bail out or throw exceptions. e.g.,

if (viewsById == null) return;

if (rate == null) throw new InterestRateException(currentInterestDate);

Comments (3)

  1. Jason Clark reporter

    In fact, that might even make sense as options:

    • allow if without braces (always)
    • allow if without braces for return statements
    • allow if without braces for throw statements
  2. Log in to comment