error-prone
error-prone copied to clipboard
Check for known reusable types being implicitly wasted.
trafficstars
String.matches(), String.split(), and String.replaceAll() are prime examples of seductive convenience APIs. These are especially damaging, as they are commonly used in loops, where caching a Pattern is an easy fix. It'd be cool to have Error Prone complain about their usages and suggest using the Pattern APIs directly.
Agreed, I just had a look at this in conjunction with the existing ConstantPatternCompile.