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) {
421
421
continue ;
422
422
}
423
423
lines [i ] = "" ;
424
- lines [i + 1 ] = line .stripTrailing ( ) + " " + nextLine .stripLeading ( );
424
+ lines [i + 1 ] = line .replaceAll ( " \\ s+$" , "" ) + " " + nextLine .replaceAll ( "^ \\ s+" , "" );
425
425
}
426
426
}
427
427
return String .join ("" , lines );
@@ -432,7 +432,7 @@ String fixupTypeAnnotations(String unixStr) {
432
432
*/
433
433
boolean endsWithTypeAnnotation (String unixLine ) {
434
434
// Remove trailing newline.
435
- String line = unixLine .stripTrailing ( );
435
+ String line = unixLine .replaceAll ( " \\ s+$" , "" );
436
436
Matcher m = trailingAnnoPattern .matcher (line );
437
437
if (!m .find ()) {
438
438
return false ;
You can’t perform that action at this time.
0 commit comments