File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
lib/src/main/java/com/diffplug/spotless/java Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ String fixupTypeAnnotations(String unixStr) {
421421 continue ;
422422 }
423423 lines [i ] = "" ;
424- lines [i + 1 ] = line .stripTrailing ( ) + " " + nextLine .stripLeading ( );
424+ lines [i + 1 ] = line .replaceAll ( " \\ s+$" , "" ) + " " + nextLine .replaceAll ( "^ \\ s+" , "" );
425425 }
426426 }
427427 return String .join ("" , lines );
@@ -432,7 +432,7 @@ String fixupTypeAnnotations(String unixStr) {
432432 */
433433 boolean endsWithTypeAnnotation (String unixLine ) {
434434 // Remove trailing newline.
435- String line = unixLine .stripTrailing ( );
435+ String line = unixLine .replaceAll ( " \\ s+$" , "" );
436436 Matcher m = trailingAnnoPattern .matcher (line );
437437 if (!m .find ()) {
438438 return false ;
You can’t perform that action at this time.
0 commit comments