error-prone icon indicating copy to clipboard operation
error-prone copied to clipboard

Check for known reusable types being implicitly wasted.

Open NightlyNexus opened this issue 8 years ago • 1 comments
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.

NightlyNexus avatar Jun 15 '17 22:06 NightlyNexus

Agreed, I just had a look at this in conjunction with the existing ConstantPatternCompile.

davidburstrom avatar Feb 12 '23 10:02 davidburstrom