@@ -285,8 +285,8 @@ public void readLine(String tagLine) {
285
285
286
286
String [] args ;
287
287
if (signature != null && !signature .equals ("()" ) &&
288
- !signature .startsWith ("() " ) && (args =
289
- splitSignature (signature )) != null ) {
288
+ !signature .startsWith ("() " ) && (args =
289
+ splitSignature (signature )) != null ) {
290
290
for (String arg : args ) {
291
291
//TODO this algorithm assumes that data types occur to
292
292
// the left of the argument name, so it will not
@@ -312,7 +312,9 @@ public void readLine(String tagLine) {
312
312
arg = a [0 ]; // throws away assigned value
313
313
}
314
314
arg = arg .trim ();
315
- if (arg .length () < 1 ) continue ;
315
+ if (arg .length () < 1 ) {
316
+ continue ;
317
+ }
316
318
317
319
cidx = bestIndexOfArg (lineno , whole , arg );
318
320
@@ -398,7 +400,9 @@ private void addTag(Definitions defs, int lineno, String symbol,
398
400
private CpatIndex bestIndexOfTag (int lineno , String whole ,
399
401
String str ) {
400
402
401
- if (whole .length () < 1 ) return new CpatIndex (lineno , 0 , 1 , true );
403
+ if (whole .length () < 1 ) {
404
+ return new CpatIndex (lineno , 0 , 1 , true );
405
+ }
402
406
String origWhole = whole ;
403
407
404
408
int t = tabSize ;
@@ -456,14 +460,18 @@ private CpatIndex bestIndexOfTag(int lineno, String whole,
456
460
* @return a defined instance
457
461
*/
458
462
private CpatIndex bestIndexOfArg (int lineno , String whole , String arg ) {
459
- if (whole .length () < 1 ) return new CpatIndex (lineno , 0 , 1 , true );
463
+ if (whole .length () < 1 ) {
464
+ return new CpatIndex (lineno , 0 , 1 , true );
465
+ }
460
466
461
467
int t = tabSize ;
462
468
int s , e ;
463
469
464
470
// First search arg as-is in the current `whole' -- strict then lax.
465
471
int woff = strictIndexOf (whole , arg );
466
- if (woff < 0 ) woff = whole .indexOf (arg );
472
+ if (woff < 0 ) {
473
+ woff = whole .indexOf (arg );
474
+ }
467
475
if (woff >= 0 ) {
468
476
s = ExpandTabsReader .translate (whole , woff , t );
469
477
e = ExpandTabsReader .translate (whole , woff + arg .length (), t );
@@ -532,7 +540,9 @@ private CpatIndex bestIndexOfArg(int lineno, String whole, String arg) {
532
540
}
533
541
} else {
534
542
pr = bestMatch (cut , arg , argpat );
535
- if (pr .start >= 0 ) return bestLineOfMatch (lineno , pr , cut );
543
+ if (pr .start >= 0 ) {
544
+ return bestLineOfMatch (lineno , pr , cut );
545
+ }
536
546
}
537
547
538
548
/**
@@ -549,7 +559,9 @@ private CpatIndex bestIndexOfArg(int lineno, String whole, String arg) {
549
559
*/
550
560
private PatResult bestMatch (String whole , String arg , Pattern argpat ) {
551
561
PatResult m = strictMatch (whole , arg , argpat );
552
- if (m .start >= 0 ) return m ;
562
+ if (m .start >= 0 ) {
563
+ return m ;
564
+ }
553
565
Matcher marg = argpat .matcher (whole );
554
566
if (marg .find ()) {
555
567
return new PatResult (marg .start (), marg .end (), marg .group ());
@@ -573,7 +585,9 @@ private int strictIndexOf(String whole, String substr) {
573
585
int spos = 0 ;
574
586
do {
575
587
int woff = whole .indexOf (substr , spos );
576
- if (woff < 0 ) return -1 ;
588
+ if (woff < 0 ) {
589
+ return -1 ;
590
+ }
577
591
578
592
spos = woff + 1 ;
579
593
String onechar ;
@@ -718,11 +732,11 @@ private static String[] splitSignature(String signature) {
718
732
719
733
// Trim outer punctuation if it exists.
720
734
while (soff < signature .length () && (signature .charAt (soff ) == '(' ||
721
- signature .charAt (soff ) == '{' )) {
735
+ signature .charAt (soff ) == '{' )) {
722
736
++soff ;
723
737
}
724
738
while (eoff - 1 > soff && (signature .charAt (eoff - 1 ) == ')' ||
725
- signature .charAt (eoff - 1 ) == '}' )) {
739
+ signature .charAt (eoff - 1 ) == '}' )) {
726
740
--eoff ;
727
741
}
728
742
if (soff > off0 || eoff < offz ) {
@@ -738,15 +752,19 @@ private static String[] splitSignature(String signature) {
738
752
*/
739
753
private String trySplitterCut (int lineOffset , int maxLines ) {
740
754
if (splitter == null ) {
741
- if (splitterSupplier == null || triedSplitterSupplier ) return null ;
755
+ if (splitterSupplier == null || triedSplitterSupplier ) {
756
+ return null ;
757
+ }
742
758
triedSplitterSupplier = true ;
743
759
splitter = splitterSupplier .get ();
744
- if (splitter == null ) return null ;
760
+ if (splitter == null ) {
761
+ return null ;
762
+ }
745
763
}
746
764
747
765
StringBuilder cutbld = new StringBuilder ();
748
766
for (int i = lineOffset ; i < lineOffset + maxLines &&
749
- i < splitter .count (); ++i ) {
767
+ i < splitter .count (); ++i ) {
750
768
cutbld .append (splitter .getLine (i ));
751
769
}
752
770
return cutbld .toString ();
0 commit comments