Is there a CheckStyle rule to force if else keywords to be on the same line in an if/else ladder?
问题 Based on this question it appears that the default template for CheckStyle will allow if else ladders to separate the if and else with a line break. Meaning I would like this code to be flagged as a violation: if (true) { System.out.println("20"); } else if (true) { System.out.println("30"); } Is there a CheckStyle rule to prevent this? Looking over the docs, I don't see one, and I'd prefer not to use the generic regex rule, if I don't have to. Also, if I use the GenericIllegalRegexp module,