title: frida calls the wrong constructor
body: <p>I'm trying to hook the following constructor of java.net.URL:
  URL(URL context, String spec, URLStreamHandler handler)</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>import argparse
  import frida
  import sys
  
  jscode = """
  Java.perform(function () {
      Java.use('java.net.URL').$init.overload('java.net.URL', 'java.lang.String', 'java.net.URLStreamHandler').implementation = function(arg0,arg1,arg2) {
            return this.$init(arg0,arg1,arg2);
        };
  });
  """
  
  parser = argparse.ArgumentParser()
  parser.add_argument("target")
  args = parser.parse_args()
  process = frida.get_usb_device().attach(args.target)
  script = process.create_script(jscode)
  script.load()
  sys.stdin.read()
  </code></pre>
  
  <p>This causes the application (and sometimes frida-server) to crash. Inspecting the logcat shows:</p>
  
  <pre><code>03-25 16:09:03.347 23490 23563 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference
  03-25 16:09:03.347 23490 23563 E AndroidRuntime:        at java.net.URL.&lt;init&gt;(URL.java:391)
  03-25 16:09:03.347 23490 23563 E AndroidRuntime:        at java.net.URL.&lt;init&gt;(URL.java:316)
  03-25 16:09:03.347 23490 23563 E AndroidRuntime:        at java.net.URL.&lt;init&gt;(URL.java:339)
  03-25 16:09:03.347 23490 23563 E AndroidRuntime:        at java.net.URL.&lt;init&gt;(Native Method)
  03-25 16:09:03.347 23490 23563 E AndroidRuntime:        at java.net.URL.&lt;init&gt;(URL.java:498)
  03-25 16:09:03.347 23490 23563 E AndroidRuntime:        at java.net.URL.&lt;init&gt;(URL.java:447)
  03-25 16:09:03.347 23490 23563 E AndroidRuntime:        at okhttp3.HttpUrl.url(HttpUrl.kt:1)
  ...
  </code></pre>
  
  <p>This means that the init I tried to call is the wrong init function, as the URL.java:339 maps to the <code>URL(String protocol, String host, String file)</code> constructor. I suspect this might be because both arg0 and arg2 are null in this call chain. </p>
  
  <p>Is there a way to call to a specific overload?</p>