@@ -48,9 +48,9 @@ static ImmutableList<String> argsAsTexts(
4848 if (position < 0 ) {
4949 return ImmutableList .of ();
5050 }
51- ImmutableList .Builder <String > builder = ImmutableList .builder ();
5251 LineMap lineMap = state .getPath ().getCompilationUnit ().getLineMap ();
53- boolean inMultiline = inMultiline (invocationStart , args , state );
52+ boolean inMultiline = inMultiline (position , args , lineMap );
53+ ImmutableList .Builder <String > builder = ImmutableList .builder ();
5454 for (int i = 0 ; i < args .size (); i ++) {
5555 ExpressionTree arg = args .get (i );
5656 int next = state .getEndPosition (arg );
@@ -71,11 +71,10 @@ static ImmutableList<String> argsAsTexts(
7171 }
7272
7373 private static boolean inMultiline (
74- ExpressionTree invocationStart , List <? extends ExpressionTree > args , VisitorState state ) {
75- LineMap lineMap = state .getPath ().getCompilationUnit ().getLineMap ();
76- long baseLine = lineMap .getLineNumber (ASTHelpers .getStartPosition (invocationStart ));
74+ int startPosition , List <? extends ExpressionTree > args , LineMap lineMap ) {
75+ long baseLine = lineMap .getLineNumber (startPosition );
7776 return args .stream ()
78- .anyMatch (arg -> lineMap .getLineNumber (ASTHelpers .getStartPosition (arg )) != baseLine );
77+ .anyMatch (arg -> lineMap .getLineNumber (ASTHelpers .getStartPosition (arg )) > baseLine );
7978 }
8079 private static int locateLineEnd (VisitorState state , int pos ) {
8180 CharSequence source = state .getSourceCode ();
0 commit comments