Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-264

Dtest library does not know to instrument overloaded methods

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.2.0
    • 2.1.4.1
    • Contrib
    • None

    Description

      It is not possible to use instrumentor.instrumentClass call for class which does have overloaded methods.
      Instrumentator adds for each method rule with the same name which ends with parsing error.
      E.g. I have a class with two methods called "call" like void call() and void call(String param). The call InstrumentedClass instrumentedClass = instrumentor.instrumentClass(MyClass.class) then ends with error like:

      Exception in thread "main" java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
              at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:397)
      Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
              at org.jboss.byteman.agent.Main.premain(Main.java:231)
              ... 6 more
      Caused by: java.lang.Exception: Transformer : duplicate script name org.jboss.byteman.contrib.dtest.Instrumentor_org.jboss.qa.SLSBean_call_remotetrace_entryin file /tmp/temporarybytemanscript.btm6820156790243021571  line 22
       previously defined in file /tmp/temporarybytemanscript.btm6820156790243021571  line 14
              at org.jboss.byteman.agent.Transformer.<init>(Transformer.java:89)
              at org.jboss.byteman.agent.Retransformer.<init>(Retransformer.java:48)
              ... 11 more
      

      Attachments

        Activity

          People

            rhn-engineering-adinn Andrew Dinn
            ochaloup@redhat.com Ondrej Chaloupka (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: