BadCatchTemplate.java :  » Code-Analyzer » Spoon » spoon » vsuite » common » template » Java Open Source

Java Open Source » Code Analyzer » Spoon 
Spoon » spoon » vsuite » common » template » BadCatchTemplate.java
package spoon.vsuite.common.template;

import spoon.reflect.code.CtStatement;
import spoon.reflect.declaration.CtClass;
import spoon.template.Local;
import spoon.template.Parameter;
import spoon.template.Template;

public class BadCatchTemplate implements Template {

  @Parameter
  Class<?> _Throwable_;

  @Parameter
  Class<?> _ReplacingThrowable_;

  @Parameter
  String _e_;

  void statement() throws Exception {
    _Throwable_ _e_=null;
    throw new _ReplacingThrowable_(_e_.getMessage());
  }

  @Local
  public static CtStatement getStatement(CtClass<BadCatchTemplate> c) {
    return c.getMethod("statement").getBody().getStatements().get(1);
  }
}

@SuppressWarnings("serial")
class _Throwable_ extends Exception {
}

@SuppressWarnings("serial")
class _ReplacingThrowable_ extends Exception {
  public _ReplacingThrowable_(String msg) {
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.