title: ByteBuddy agent to replace one method param with another
body: <p>I have a large 3rd party code base I can't modify, but I need to make a small but important change in many different places. I was hoping to use a ByteBuddy based agent, but I can't figure out how. The call I need to replace is of the form:</p>
  
  <pre><code>SomeSystemClass.someMethod("foo")
  </code></pre>
  
  <p>and I need to replace it with</p>
  
  <pre><code>SomeSystemClass.someMethod("bar")
  </code></pre>
  
  <p>while leaving all other calls to the same method untouched</p>
  
  <pre><code>SomeSystemClass.someMethod("ignore me")
  </code></pre>
  
  <p>Since <code>SomeSystemClass</code> is a JDK class, I do not want to advise it, but only the classes that contain calls to it. How can this be done?</p>
  
  <p>Note that:</p>
  
  <ol>
  <li><code>someMethod</code> is static and</li>
  <li>the calls (at least some of them) are inside a static initializer block</li>
  </ol>