[ 
https://issues.apache.org/jira/browse/FELIX-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daan de Wit updated FELIX-4347:
-------------------------------

    Description: 
The iPOJO manipulator also instruments static inner classes that don't have any 
iPOJO annotations.
For example:
{code}
private static final Function<String, String> TRIM = new Function() {
    public String apply(String input) {
        return input.trim();
    }
};
{code}

results in the following:

{code}
private static final Function<String, String> TRIM = new Function()
  {
    public String apply(String paramAnonymousString)
    {
      if (!this.this$0.__M1___apply$java_lang_String) {
        return super.__M_apply(paramAnonymousString);
      }
      String str;
      try
      {
        this.this$0.__IM.onEntry(this, "1___apply$java_lang_String", new 
Object[] { paramAnonymousString });
        str = super.__M_apply(paramAnonymousString);
        this.this$0.__IM.onExit(this, "1___apply$java_lang_String", str);
      }
      catch (Throwable localThrowable)
      {
        this.this$0.__IM.onError(this, "1___apply$java_lang_String", 
localThrowable);
        throw localThrowable;
      }
      return str;
    }
    
    public String __M_apply(String input)
    {
      return input.trim();
    }
  };
{code}

This fails at runtime with NoSuchFieldError for this.this$0

  was:
The iPOJO manipulator also instruments static inner classes that don't have any 
iPOJO annotations.
For example:
{code}
private static final Function<String, String> TRIM = new Function() {
    public String apply(String input) {
        return input.trim();
    }
};
{code}

results in the following:

{code}
private static final Function<String, String> TRIM = new Function()
  {
    public String apply(String paramAnonymousString)
    {
      if (!this.this$0.__M1___apply$java_lang_String) {
        return super.__M_apply(paramAnonymousString);
      }
      String str;
      try
      {
        this.this$0.__IM.onEntry(this, "1___apply$java_lang_String", new 
Object[] { paramAnonymousString });
        str = super.__M_apply(paramAnonymousString);
        this.this$0.__IM.onExit(this, "1___apply$java_lang_String", str);
      }
      catch (Throwable localThrowable)
      {
        this.this$0.__IM.onError(this, "1___apply$java_lang_String", 
localThrowable);
        throw localThrowable;
      }
      return str;
    }
    
    public String __M_apply(String input)
    {
      return input.trim();
    }
  };
{code}

This fails at runtime with NoSuchFieldError


> manipulator should ignore static inner classes
> ----------------------------------------------
>
>                 Key: FELIX-4347
>                 URL: https://issues.apache.org/jira/browse/FELIX-4347
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-manipulator-1.11.0
>            Reporter: Daan de Wit
>
> The iPOJO manipulator also instruments static inner classes that don't have 
> any iPOJO annotations.
> For example:
> {code}
> private static final Function<String, String> TRIM = new Function() {
>     public String apply(String input) {
>         return input.trim();
>     }
> };
> {code}
> results in the following:
> {code}
> private static final Function<String, String> TRIM = new Function()
>   {
>     public String apply(String paramAnonymousString)
>     {
>       if (!this.this$0.__M1___apply$java_lang_String) {
>         return super.__M_apply(paramAnonymousString);
>       }
>       String str;
>       try
>       {
>         this.this$0.__IM.onEntry(this, "1___apply$java_lang_String", new 
> Object[] { paramAnonymousString });
>         str = super.__M_apply(paramAnonymousString);
>         this.this$0.__IM.onExit(this, "1___apply$java_lang_String", str);
>       }
>       catch (Throwable localThrowable)
>       {
>         this.this$0.__IM.onError(this, "1___apply$java_lang_String", 
> localThrowable);
>         throw localThrowable;
>       }
>       return str;
>     }
>     
>     public String __M_apply(String input)
>     {
>       return input.trim();
>     }
>   };
> {code}
> This fails at runtime with NoSuchFieldError for this.this$0



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to