test_class.declarator: logger = LoggerFactory.getLogger(PathSearchTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(PathSearchTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: karate-robot/src/test/java/com/intuit/karate/robot/win/PathSearchTest.java
test_class.identifier: PathSearchTest
test_case.body: @Test
      public void testPathEdge() {
          List<PathSearch.Chunk> list = PathSearch.split("/hello//world");
          logger.debug("list: {}", list);
          PathSearch.Chunk first = list.get(0);
          assertFalse(first.anyDepth);
          assertEquals("hello", first.controlType);
          PathSearch.Chunk second = list.get(1);
          assertTrue(second.anyDepth);
          assertEquals("world", second.controlType);
      }
test_case.class_method_signature: PathSearchTest.testPathEdge()
test_case.full_signature: @Test public void testPathEdge()
test_case.identifier: testPathEdge
test_case.invocations: split debug get assertFalse assertEquals get assertTrue assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPathEdge()
focal_class.declarator: PATH_CHUNK = java.util.regex.Pattern.compile("([^.{]+)?(\\.[^{]+)?(\\{.+\\})?")
focal_class.modifier: private static final
focal_class.original_string: private static final java.util.regex.Pattern PATH_CHUNK = java.util.regex.Pattern.compile("([^.{]+)?(\\.[^{]+)?(\\{.+\\})?");
focal_class.type: java.util.regex.Pattern
focal_class.var_name: PATH_CHUNK
focal_class.declarator: SLASH = '/'
focal_class.modifier: private static final
focal_class.original_string: private static final char SLASH = '/';
focal_class.type: char
focal_class.var_name: SLASH
focal_class.declarator: findAll
focal_class.modifier: public final
focal_class.original_string: public final boolean findAll;
focal_class.type: boolean
focal_class.var_name: findAll
focal_class.declarator: path
focal_class.modifier: private final
focal_class.original_string: private final String path;
focal_class.type: String
focal_class.var_name: path
focal_class.declarator: chunks
focal_class.modifier: public final
focal_class.original_string: public final List<Chunk> chunks;
focal_class.type: List<Chunk>
focal_class.var_name: chunks
focal_class.file: karate-robot/src/main/java/com/intuit/karate/robot/win/PathSearch.java
focal_class.identifier: PathSearch
focal_class.class_method_signature: PathSearch.isWildcard(String locator)
focal_class.full_signature: public static boolean isWildcard(String locator)
focal_class.identifier: isWildcard
focal_class.modifiers: public static
focal_class.parameters: (String locator)
focal_class.return: boolean
focal_class.signature: boolean isWildcard(String locator)
focal_class.class_method_signature: PathSearch.PathSearch(String path, boolean findAll)
focal_class.full_signature: public  PathSearch(String path, boolean findAll)
focal_class.identifier: PathSearch
focal_class.modifiers: public
focal_class.parameters: (String path, boolean findAll)
focal_class.signature:  PathSearch(String path, boolean findAll)
focal_class.class_method_signature: PathSearch.split(String s)
focal_class.full_signature: public static List<Chunk> split(String s)
focal_class.identifier: split
focal_class.modifiers: public static
focal_class.parameters: (String s)
focal_class.return: List<Chunk>
focal_class.signature: List<Chunk> split(String s)
focal_class.class_method_signature: PathSearch.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public static List<Chunk> split(String s) {
          int pos = s.indexOf(SLASH);
          if (pos == -1) {
              throw new RuntimeException("path did not start with or contain '/'");
          }
          List<Chunk> list = new ArrayList();
          int startPos = 0;
          int searchPos = 0;
          boolean anyDepth = false;
          while (pos != -1) {
              if (pos == 0) {
                  startPos = 1;
                  searchPos = 1;
              } else if (s.charAt(pos - 1) == '\\') {
                  s = s.substring(0, pos - 1) + s.substring(pos);
                  searchPos = pos;
              } else {
                  String temp = s.substring(startPos, pos);
                  if (temp.isEmpty()) {
                      anyDepth = true;
                  } else {
                      list.add(new Chunk(anyDepth, temp));
                      anyDepth = false; // reset                   
                  }
                  startPos = pos + 1;
                  searchPos = startPos;
              }
              pos = s.indexOf(SLASH, searchPos);
          }
          if (startPos != s.length()) {
              String temp = s.substring(startPos);
              if (!temp.isEmpty()) {
                  list.add(new Chunk(anyDepth, temp));
              }
          }
          return list;
      }
focal_method.class_method_signature: PathSearch.split(String s)
focal_method.full_signature: public static List<Chunk> split(String s)
focal_method.identifier: split
focal_method.invocations: indexOf charAt substring substring substring isEmpty add indexOf length substring isEmpty add
focal_method.modifiers: public static
focal_method.parameters: (String s)
focal_method.return: List<Chunk>
focal_method.signature: List<Chunk> split(String s)