Example usage for org.aspectj.tools.ajc Main renderExceptionForUser

List of usage examples for org.aspectj.tools.ajc Main renderExceptionForUser

Introduction

In this page you can find the example usage for org.aspectj.tools.ajc Main renderExceptionForUser.

Prototype

public static String renderExceptionForUser(Throwable thrown) 

Source Link

Usage

From source file:org.eclipse.ajdt.core.ant.AjcTask.java

License:Open Source License

/**
 * Compile using ajc per settings.//from   w  w w  .j a v a 2 s . com
 * 
 * @exception BuildException if the compilation has problems or if there were compiler errors and failonerror is true.
 */
public void execute() throws BuildException {
    this.logger = new TaskLogger(this);
    if (executing) {
        throw new IllegalStateException("already executing");
    } else {
        executing = true;
    }
    setupOptions();
    verifyOptions();
    try {
        String[] args = makeCommand();
        if (logCommand) {
            log("ajc " + Arrays.asList(args));
        } else {
            logVerbose("ajc " + Arrays.asList(args));
        }
        if (!fork) {
            wasCompilationSuccessful = executeInSameVM(args);
        } else { // when forking, Adapter handles failonerror
            wasCompilationSuccessful = executeInOtherVM(args);
        }
    } catch (BuildException e) {
        throw e;
    } catch (Throwable x) {
        this.logger.error(Main.renderExceptionForUser(x));
        throw new BuildException(
                "IGNORE -- See " + LangUtil.unqualifiedClassName(x) + " rendered to ant logger");
    } finally {
        executing = false;
        if (null != tmpOutjar) {
            tmpOutjar.delete();
        }
    }
}