title: How can I copy opcodes from a method to another method in Java Class file using ASM?
body: <p>Here are some code.</p>
  
  <pre><code>static synchronized void q(ua paramua, int paramInt) {
  try {
   if (d) { if (paramInt &gt; -16711936);
     return; }
   if (q * 514194583 &gt; 0) { if (paramInt &gt; -16711936);
     abf localabf = new abf(paramua);
     n.d(localabf, -984409319);
   }
   else {
     paramua.ma(false);
   }
   return; } catch (RuntimeException localRuntimeException) { throw aht.d(localRuntimeException, "ck.q(" + 41);
  }
  }
  
  static synchronized void b(ua paramua)
  {
    if (d) return;
    if (q * 514194583 &gt; 0) {
      abf localabf = new abf(paramua);
      n.d(localabf, -836239689);
    }
    else {
      paramua.ma(false);
    }
  }
  </code></pre>
  
  <p>These two methods performs equal actions.
  The second parameter of the first method is psudo-argument, so I want to clear original code and make this method like this...</p>
  
  <pre><code>static synchronized void q(ua paramua, int paramInt)
  {
    if (d) return;
    if (q * 514194583 &gt; 0) {
      abf localabf = new abf(paramua);
      n.d(localabf, -836239689);
    }
    else {
      paramua.ma(false);
    }
  }
  </code></pre>
  
  <p>How can I do this action?
  I tried like this.</p>
  
  <pre><code>destMethodNode.instructions.clear();
  destMethodNode.instructions.add(srcMethodNode.instructions);
  </code></pre>
  
  <p>But throws null pointer exception. What is the reason?</p>