You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Andrey Zagrebin (Jira)" <ji...@apache.org> on 2019/08/22 13:45:00 UTC

[jira] [Created] (FLINK-13820) Breaking long function argument lists and chained method calls

Andrey Zagrebin created FLINK-13820:
---------------------------------------

             Summary: Breaking long function argument lists and chained method calls
                 Key: FLINK-13820
                 URL: https://issues.apache.org/jira/browse/FLINK-13820
             Project: Flink
          Issue Type: Sub-task
          Components: Documentation, Project Website
            Reporter: Andrey Zagrebin
            Assignee: Andrey Zagrebin


Breaking the line of too long statements (line longness is yet to be fully defined) to improve code readability in case of
 * Long function argument lists (declaration or call): void func(type1 arg1, type2 arg2, ...)
 * Long sequence of chained calls: list.stream().map(...).reduce(...).collect(...)...

Rules:
 * Break the list of arguments/calls if the line exceeds limit or earlier if you believe that the breaking would improve the code readability
 * If you break the line then each argument/call should have a separate line, including the first one
 * Each new line argument/call should have one extra indentation relative to the line of the parent function name or called entity
 * The opening parenthesis always stays on the line of the parent function name
 * The possible thrown exception list is never broken and stays on the same last line
 * The dot of a chained call is always on the line of that chained call proceeding the call at the beginning

Examples of breaking:
 * Function arguments

{code:java}
public void func(
    int arg1,
    int arg2,
    ...) throws E1, E2, E3 {
    
}{code}

 * Chained method calls:

{code:java}
values
    .stream()
    .map(...)
    .collect(...);{code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)