@@ -396,18 +396,11 @@ private static boolean isSpace(final char ch) {
396396
397397 /**
398398 * Conditionally trim all leading and trailing whitespace in the specified String. All strings of
399- * white space are replaced by a single space character (#x20), except spaces after punctuation
400- * which receive double spaces if doublePunctuationSpaces is true. This function may be useful to
401- * a formatter, but to get first class results, the formatter should probably do it's own white
402- * space handling based on the semantics of the formatting object.
399+ * white space are replaced by a single space character (#x20), except spaces after punctuation.
403400 *
404- * @param trimHead Trim leading whitespace?
405- * @param trimTail Trim trailing whitespace?
406- * @param doublePunctuationSpaces Use double spaces for punctuation?
407401 * @return The trimmed string.
408402 */
409- public XString fixWhiteSpace (
410- final boolean trimHead , final boolean trimTail , final boolean doublePunctuationSpaces ) {
403+ public XString fixWhiteSpace () {
411404
412405 // %OPT% !!!!!!!
413406 final int len = this .length ();
@@ -439,16 +432,7 @@ public XString fixWhiteSpace(
439432
440433 buf [d ++] = ' ' ;
441434
442- if (doublePunctuationSpaces && (s != 0 )) {
443- final char prevChar = buf [s - 1 ];
444-
445- if (!((prevChar == '.' ) || (prevChar == '!' ) || (prevChar == '?' ))) {
446- pres = true ;
447- }
448- }
449- else {
450- pres = true ;
451- }
435+ pres = true ;
452436 }
453437 else {
454438 edit = true ;
@@ -461,15 +445,15 @@ public XString fixWhiteSpace(
461445 }
462446 }
463447
464- if (trimTail && 1 <= d && ' ' == buf [d - 1 ]) {
448+ if (1 <= d && ' ' == buf [d - 1 ]) {
465449 edit = true ;
466450
467451 d --;
468452 }
469453
470454 int start = 0 ;
471455
472- if (trimHead && 0 < d && ' ' == buf [0 ]) {
456+ if (0 < d && ' ' == buf [0 ]) {
473457 edit = true ;
474458
475459 start ++;
0 commit comments