src/java.base/share/classes/java/util/regex/Pattern.java
changeset 52902 e3398b2e1ab0
parent 52080 a2c72b476c9f
child 53018 8bf9268df0e2
equal deleted inserted replaced
52901:3ba9ff4d4aaf 52902:e3398b2e1ab0
  1288             matchList.add(input.subSequence(index, input.length()).toString());
  1288             matchList.add(input.subSequence(index, input.length()).toString());
  1289 
  1289 
  1290         // Construct result
  1290         // Construct result
  1291         int resultSize = matchList.size();
  1291         int resultSize = matchList.size();
  1292         if (limit == 0)
  1292         if (limit == 0)
  1293             while (resultSize > 0 && matchList.get(resultSize-1).equals(""))
  1293             while (resultSize > 0 && matchList.get(resultSize-1).isEmpty())
  1294                 resultSize--;
  1294                 resultSize--;
  1295         String[] result = new String[resultSize];
  1295         String[] result = new String[resultSize];
  1296         return matchList.subList(0, resultSize).toArray(result);
  1296         return matchList.subList(0, resultSize).toArray(result);
  1297     }
  1297     }
  1298 
  1298