title: IntelliJ suggests 'replace()' could be replaced by compiled java.util.regex.Pattern construct
body: <p>One particular IntelliJ IDEA inspection gets triggered when I have code like:</p>
  
  <pre><code>string1 = string2.replace(string3, string4);
  </code></pre>
  
  <p>The inspection says:</p>
  
  <blockquote>
    <p>'replace()' could be replaced by compiled java.util.regex.Pattern construct.</p>
  </blockquote>
  
  <p>And then offers to refactor the code for me, which results in using a constant literal Pattern.</p>
  
  <p>I have this inspection turned on mainly for cases where I'm actually creating a regex dynamically. It can sometimes improve performance if I follow IntelliJ's suggestion. But in the case of <code>String.replace()</code> the argument is not a regex. Is it true that following IntelliJ's suggestion in this case would not result in any performance improvement at all, and all it would do is hurt readability?</p>
  
  <p>Is it possible to turn it off for <code>String.replace()</code> but keep it on for <code>String.replaceAll()</code> and <code>String.replaceFirst()</code>? I couldn't see such an option.</p>