void () { getSettings().WRAP_LONG_LINES = true; getSettings().RIGHT_MARGIN = 140; getSettings().PREFER_PARAMETERS_WRAP = true; getSettings().CALL_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM; String before = "processingEnv.getMessenger().printMessage(Diagnostic.Kind.ERROR, " + "String.format(\"Could not process annotations: %s%n%s\", e.toString(), writer.toString()));"; String afterFirstReformat = """ processingEnv.getMessenger().printMessage( Diagnostic.Kind.ERROR, String.format( "Could not process annotations: %s%n%s", e.toString(), writer.toString() ) );"""; String after = """ processingEnv.getMessenger().printMessage( Diagnostic.Kind.ERROR, String.format( "Could not process annotations: %s%n%s", e.toString(), writer.toString() ) );"""; doMethodTest(afterFirstReformat, after); getSettings().CALL_PARAMETERS_RPAREN_ON_NEXT_LINE = true; getSettings().CALL_PARAMETERS_LPAREN_ON_NEXT_LINE = true; doMethodTest(before, """ processingEnv.getMessenger().printMessage( Diagnostic.Kind.ERROR, String.format("Could not process annotations: %s%n%s", e.toString(), writer.toString()) );"""); String literal = "\"" + StringUtil.repeatSymbol('A', 128) + "\""; before = "processingEnv.getMessenger().printMessage(Diagnostic.Kind.ERROR, call(" + literal + "));\n"; after = "processingEnv.getMessenger().printMessage(\n" + " Diagnostic.Kind.ERROR,\n" + " call(" + literal + ")\n" + ");\n"; doMethodTest(before, after); }