I ran the following test case but any problem was not found:

  | ExprEditor ed = new ExprEditor() {
  |     public void edit(NewExpr expr) throws CannotCompileException {
  |         expr.replace("$_ = new test2.HashMapWrapper($1, 1);");
  |     }
  | };
  | 
  | CtClass cc = ClassPool.getDefault().get("NewExprInTry");
  | CtMethod m1 = cc.getDeclaredMethod("foo");
  | m1.instrument(ed);
  | cc.writeFile();
  | 

The definitions of NewExprInTry is:


  | class HashMapWrapper extends HashMap {
  |     HashMapWrapper(int size, int args) {
  |         super(size);
  |     }
  | }
  | 
  | public class NewExprInTry {
  |     public int foo(int size) {
  |         HashMap h;
  |         try {
  |             h = new HashMap(size);
  |         }
  |         catch (Exception e) {}
  |         return 1;
  |     }
  | }
  | 

Could you post a test case?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3845611#3845611

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3845611


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to