I knew that Java's regular expressions would come with a horrible syntax I wouldn't want to use. I didn't know that the syntax would appear to be designed by someone who completely misses the point.
In order to use a precompiled regex pattern, you get it to produce a Matcher object
Pattern p = Pattern.compile("a*b");
Matcher m = p.matcher("aaaaab");
boolean b = m.matches();
For what mind numbing purpose was it decided that a Matcher object should have a String to match against as a piece of instance data? Are you going to construct one of these Matchers and pass it around so that different pieces of code can check over and over again if the same String matches?
This could have simply been implemented as Pattern.matches(String), or, if you simply must have a Matcher class, then get your Matcher from Pattern.matcher(), taking no parameters, and then require a String parameter to Matcher.matches(String).
What possible reason could there be for not following either of those approaches, instead of what they gave me?
As a sop, you get a static Pattern.matches(String pattern, String) method, but that completely prevents you from using precompiled patterns.
Clueless, Sun. Just clueless. Or is it the Java community that I have to blame for this? I've seen so many features elegantly added into Java, and then I see stuff like this.