1   package org.apache.commons.javaflow.bytecode.transformation.rewrite;
2   
3   import junit.framework.Assert;
4   
5   
6   /**
7    * Test that allocates a lot of new objects. Javaflow performs some tricky
8    * instrumentation on new object allocations, especially when it has arguments.
9    * Nesting object allocations makes it even more interesting.
10   * 
11   * @author Kohsuke Kawaguchi
12   */
13  public final class NewObject implements Runnable {
14    static char[] ch = { 'a', 'b', 'c'};
15    
16    public void run() {
17  
18      String s = new String( new String( new String( ch, 0, ch.length).toCharArray(), 0, ch.length));
19      // String s = new String( new String( ch).toCharArray());
20  
21      Assert.assertEquals( s, "abc");
22    }
23  
24  }
25