groovy
  1. groovy
  2. GROOVY-1759

ProxyMetaClass and Interceptor: some calls are not intercepted

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.6
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The code:

      class A{
         void a(){ b() }
         void b(){}
      }
      
         benchmarkInterceptor = new BenchmarkInterceptor()
         proxy = ProxyMetaClass.getInstance(A.class)
         proxy.setInterceptor(benchmarkInterceptor)
         proxy.use {
              a = new A()
              a.a()
              a.b()
         }
            
      stats = benchmarkInterceptor.statistic()
      stats.each{
         println ""
         it.each{ print it+" "}
      } 
      

      The results:

      b 1 0 
      ctor 1 0 
      a 1 0 
      

      This shows that the call made from a() to b() is not being intercepted.

      As Dierk noted on mailing list, this shows that a respective unit test is missing for ProxyMetaClass and Interceptor. Also, blackdrag insists on that MetaClass should be rewritten (this is "another" collateral of MetaClass incorrect implementation).

      The thread on the mailing list:

      http://www.nabble.com/ProxyMetaClass-and-Interceptors-tf3308499.html

        Activity

          People

          • Assignee:
            Dierk König
            Reporter:
            Andres Gonzalez
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: