src/share/classes/java/util/regex/Pattern.java

Print this page
rev 3186 : 6880112: Project Coin: Port JDK core library code to use diamond operator

*** 1066,1076 **** * around matches of this pattern */ public String[] split(CharSequence input, int limit) { int index = 0; boolean matchLimited = limit > 0; ! ArrayList<String> matchList = new ArrayList<String>(); Matcher m = matcher(input); // Add segments before each match found while(m.find()) { if (!matchLimited || matchList.size() < limit - 1) { --- 1066,1076 ---- * around matches of this pattern */ public String[] split(CharSequence input, int limit) { int index = 0; boolean matchLimited = limit > 0; ! ArrayList<String> matchList = new ArrayList<>(); Matcher m = matcher(input); // Add segments before each match found while(m.find()) { if (!matchLimited || matchList.size() < limit - 1) {
*** 1564,1574 **** compiled = true; } Map<String, Integer> namedGroups() { if (namedGroups == null) ! namedGroups = new HashMap<String, Integer>(2); return namedGroups; } /** * Used to print out a subtree of the Pattern to help with debugging. --- 1564,1574 ---- compiled = true; } Map<String, Integer> namedGroups() { if (namedGroups == null) ! namedGroups = new HashMap<>(2); return namedGroups; } /** * Used to print out a subtree of the Pattern to help with debugging.
*** 5307,5317 **** map.put(name, new CharPropertyFactory() { CharProperty make() { return p.clone();}}); } private static final HashMap<String, CharPropertyFactory> map ! = new HashMap<String, CharPropertyFactory>(); static { // Unicode character property aliases, defined in // http://www.unicode.org/Public/UNIDATA/PropertyValueAliases.txt defCategory("Cn", 1<<Character.UNASSIGNED); --- 5307,5317 ---- map.put(name, new CharPropertyFactory() { CharProperty make() { return p.clone();}}); } private static final HashMap<String, CharPropertyFactory> map ! = new HashMap<>(); static { // Unicode character property aliases, defined in // http://www.unicode.org/Public/UNIDATA/PropertyValueAliases.txt defCategory("Cn", 1<<Character.UNASSIGNED);