Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7-beta-1
-
None
-
None
Description
Most regex/pattern based DGM methods try to allow both, the regex as a String or as a Pattern.
Here are the counter-examples:
String String replaceFirst(Pattern pattern, String replacement) boolean matches(Pattern pattern) Object splitEachLine(String regex) {match -> ... } String replaceAll(String regex) {match -> ... } String replaceAll(Pattern pattern, String replacement) File Object splitEachLine(String sep) {match -> ... } Reader Object splitEachLine(String sep) {match -> ... } InputStream Object splitEachLine(String sep, String charset) {match -> ... } Object splitEachLine(String sep) {match -> ... }
A special case is 'minus', which is particularly bad as you can provide a regex string but this
will not be treated as a regex since that would conflict with String.minus(String).