Here you can find the source of raiseCompilerError(String error)
Parameter | Description |
---|---|
error | The error string to display. |
private static void raiseCompilerError(String error)
//package com.java2s; //License from project: Open Source License import javax.annotation.processing.ProcessingEnvironment; import javax.tools.Diagnostic; import java.util.Arrays; public class Main { private static ProcessingEnvironment processingEnv; /**/*from w ww .j a v a2s . c om*/ * Raises a fatal compiler error with the given message, halting execution. * * @param error The error string to display. */ private static void raiseCompilerError(String error) { // In the case we're aborting before the environment is available... if (processingEnv == null) { return; } processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Fatal error from optimiser: " + error + "\nAt:\n" + Arrays.toString(new Exception().getStackTrace()).replace(',', '\n')); } }