Package com.sun.tools.javac.main

Examples of com.sun.tools.javac.main.JavaCompiler.errorCount()


        JavaCompiler c = JavaCompiler.instance(context);

        c.compile(List.of(f));

        if (c.errorCount() != 0)
            throw new AssertionError("compilation failed");

        long msec = c.elapsed_msec;
        if (msec < 0 || msec > 5 * 60 * 1000) // allow test 5 mins to execute, should be more than enough!
            throw new AssertionError("elapsed time is suspect: " + msec);
View Full Code Here


                this.exitState = ExitState.cmderror();
                return EXIT_CMDERR;
            }
            comp.compile(fileObjects, classnames.toList(), processors);

            int errorCount = comp.errorCount();
            //ceylonBackendErrors = comp.log instanceof CeylonLog ? ((CeylonLog)comp.log).ceylonBackendErrors() : false;
            if (errorCount != 0) {
                this.exitState = ExitState.error(comp);
                return EXIT_ERROR;
            }
View Full Code Here

            throw new EnvironmentException(ex);
        } catch (Throwable ex) {
            // Nasty. If we've already reported an error, compensate
            // for buggy compiler error recovery by swallowing thrown
            // exceptions.
            if (comp == null || comp.errorCount() == 0 || options == null || options.get("dev") != null) {
                bugMessage(ex);
            }
            this.exitState = ExitState.abnormal(comp, ex, options);
            return EXIT_ABNORMAL;
        } finally {
View Full Code Here

        JavaCompiler c = JavaCompiler.instance(context);

        c.compile(List.of(f));

        if (c.errorCount() != 0)
            throw new AssertionError("compilation failed");

        long msec = c.elapsed_msec;
        if (msec < 0 || msec > 5 * 60 * 1000) // allow test 5 mins to execute, should be more than enough!
            throw new AssertionError("elapsed time is suspect: " + msec);
View Full Code Here

        runAround:
        while(true) {
            DEBUG.P("roundNumber="+roundNumber);
            DEBUG.P("fatalErrors="+fatalErrors);
            DEBUG.P("compiler.errorCount()="+compiler.errorCount());
           
            if (fatalErrors && compiler.errorCount() != 0) {
                errorStatus = true;
                break runAround;
            }
View Full Code Here

        while(true) {
            DEBUG.P("roundNumber="+roundNumber);
            DEBUG.P("fatalErrors="+fatalErrors);
            DEBUG.P("compiler.errorCount()="+compiler.errorCount());
           
            if (fatalErrors && compiler.errorCount() != 0) {
                errorStatus = true;
                break runAround;
            }

            this.context = currentContext;
View Full Code Here

        if (taskListener != null)
            taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING));

        if (errorStatus) {
            compiler.log.nerrors += messager.errorCount();
            if (compiler.errorCount() == 0)
                compiler.log.nerrors++;
        } else if (procOnly) {
            compiler.todo.clear();
        } else { // Final compilation
            compiler.close();
View Full Code Here

        int roundNumber = 0;
        boolean errorStatus = false;

        runAround:
        while(true) {
            if (fatalErrors && compiler.errorCount() != 0) {
                errorStatus = true;
                break runAround;
            }

            this.context = currentContext;
View Full Code Here

        if (taskListener != null)
            taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING));

        if (errorStatus) {
            compiler.log.nerrors += messager.errorCount();
            if (compiler.errorCount() == 0)
                compiler.log.nerrors++;
        } else if (procOnly) {
            compiler.todo.clear();
        } else { // Final compilation
            compiler.close();
View Full Code Here

  protected JCTree parseWithTargetCompiler(Source source) throws Exception {
    Context context = new Context();
    JavaCompiler compiler = new JavaCompiler(context);
    compiler.genEndPos = true;
    JCTree result = compiler.parse(new ContentBasedJavaFileObject(source.getName(), source.getRawInput()));
    return compiler.errorCount() > 0 ? null : result;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.