title: Groovy - interceptor of ProxyMetaClass does not affect inner methods calls
body: <p>The code snippet is from the book &lt; Groovy in action 2nd >, with minor modifications.</p>
  
  <p>1 this code works as expected</p>
  
  <pre><code>package test
  
  class InspectMe {
      int outer(){
          return inner()
      }
      int inner(){
          return 1
      }
  }
  
  def tracer = new TracingInterceptor(writer: new StringWriter())
  def proxyMetaClass = ProxyMetaClass.getInstance(InspectMe)
  proxyMetaClass.interceptor = tracer
  InspectMe inspectMe = new InspectMe()
  
  inspectMe.metaClass = proxyMetaClass
  inspectMe.outer()
  println(tracer.writer.toString())
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>before test.InspectMe.outer()
    before test.InspectMe.inner()
    after  test.InspectMe.inner()
  after  test.InspectMe.outer()
  </code></pre>
  
  <p>2 but this code's output is different</p>
  
  <pre><code>package test
  
  class InspectMe {
      int outer(){
          return inner()
      }
      int inner(){
          return 1
      }
  }
  
  def tracer = new TracingInterceptor(writer: new StringWriter())
  def proxyMetaClass = ProxyMetaClass.getInstance(InspectMe)
  proxyMetaClass.interceptor = tracer
  InspectMe inspectMe = new InspectMe()
  
  proxyMetaClass.use(inspectMe){
      inspectMe.outer()
  }
  println(tracer.writer.toString())
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>before test.InspectMe.outer()
  after  test.InspectMe.outer()
  </code></pre>
  
  <p>It seems TracingInterceptor dosen't intercept inner methods in the second code.
  Maybe it's normal behavior, But it seems to me like a bug.
  Can somebody please explain this? </p>