@@ -235,7 +235,7 @@ private void updateSelectorList(String path, PathSearchContext context) {
235235 if (!StringUtils .hasText (text )) {
236236 text = "." ;
237237 }
238- PartsText partsText = PathSearchContext .ofNameMatchPartsx (text , positions );
238+ PartsText partsText = PathSearchContext .ofPositions (text , positions );
239239 PathViewItem item = new PathViewItem (scoredPath .getPath (), partsText , false );
240240 return item ;
241241 })
@@ -438,13 +438,13 @@ public PartsText getPartsText() {
438438 * @param positions the positions array, expected to be ordered and no duplicates
439439 * @return parts text
440440 */
441- public static PartsText ofNameMatchPartsx (String text , int [] positions ) {
441+ public static PartsText ofPositions (String text , int [] positions ) {
442442 List <PartText > parts = new ArrayList <>();
443443 if (positions .length == 0 ) {
444- parts .addAll (nameMatchPartsx (text , -1 ));
444+ parts .addAll (ofPosition (text , -1 ));
445445 }
446446 else if (positions .length == 1 && positions [0 ] == text .length ()) {
447- parts .addAll (nameMatchPartsx (text , text .length () - 1 ));
447+ parts .addAll (ofPosition (text , text .length () - 1 ));
448448 }
449449 else {
450450 int sidx = 0 ;
@@ -453,22 +453,22 @@ else if (positions.length == 1 && positions[0] == text.length()) {
453453 eidx = positions [i ];
454454 if (sidx < text .length ()) {
455455 String partText = text .substring (sidx , eidx + 1 );
456- parts .addAll (nameMatchPartsx (partText , eidx - sidx ));
456+ parts .addAll (ofPosition (partText , eidx - sidx ));
457457 }
458458 else {
459- parts .addAll (nameMatchPartsx (String .valueOf (text .charAt (text .length () - 1 )), 0 ));
459+ parts .addAll (ofPosition (String .valueOf (text .charAt (text .length () - 1 )), 0 ));
460460 }
461461 sidx = eidx + 1 ;
462462 }
463463 if (sidx < text .length ()) {
464464 String partText = text .substring (sidx , text .length ());
465- parts .addAll (nameMatchPartsx (partText , -1 ));
465+ parts .addAll (ofPosition (partText , -1 ));
466466 }
467467 }
468468 return PartsText .of (parts );
469469 }
470470
471- static List <PartText > nameMatchPartsx (String text , int position ) {
471+ static List <PartText > ofPosition (String text , int position ) {
472472 List <PartText > parts = new ArrayList <>();
473473 if (position < 0 ) {
474474 parts .add (PartText .of (text , false ));
0 commit comments