Creates a JSError from a file and Node position.

@param n Determines the line and char position and source file name
@param type The DiagnosticType
@param arguments Arguments to be incorporated into the message
429313
public static JSError make(Node n, DiagnosticType type, String... arguments) {
    return new JSError(n.getSourceFileName(), n, type, arguments);
  }
945197
void expectValidTypeofName(Node n, String found) {
    report(JSError.make(n, UNKNOWN_TYPEOF_VALUE, found));
  }
938828
private void visitNew(Node n) {
    Node constructor = n.getFirstChild();
    JSType type = getJSType(constructor).restrictByNotNullOrUndefined();
    if (!couldBeAConstructor(type)
        || type.isEquivalentTo(typeRegistry.getNativeType(SYMBOL_OBJECT_FUNCTION_TYPE))) {
      report(n, NOT_A_CONSTRUCTOR);
      ensureTyped(n);
      return;
    }

    FunctionType fnType = type.toMaybeFunctionType();
    if (fnType != null && fnType.hasInstanceType()) {
      FunctionType ctorType = fnType.getInstanceType().getConstructor();
      if (ctorType != null && ctorType.isAbstract()) {
        report(n, INSTANTIATE_ABSTRACT_CLASS);
      }
      visitArgumentList(n, fnType);
      ensureTyped(n, fnType.getInstanceType());
    } else {
      ensureTyped(n);
    }
  }
132766
void expectNumberStrict(Node n, JSType type, String msg) {
    if (!type.isSubtypeOf(getNativeType(NUMBER_TYPE))) {
      registerMismatchAndReport(
          n, INVALID_OPERAND_TYPE, msg, type, getNativeType(NUMBER_TYPE), null, null);
    }
  }
395640
private void convertError(CharBuffer buf, int line)
  {
    String srcFilename = null;
    int destLine = 0;
    int srcLine = 0;
    int srcTailLine = Integer.MAX_VALUE;
    
    for (int i = 0; i < _lines.size(); i++) {
      Line map = (Line) _lines.get(i);

      if (map._dstLine <= line && line <= map.getLastDestinationLine()) {
        srcFilename = map._srcFilename;
        destLine = map._dstLine;
        srcLine = map.getSourceLine(line);
        break;
      }
    }

    if (srcFilename != null) {
    }
    else if (_lines.size() > 0)
      srcFilename = ((Line) _lines.get(0))._srcFilename;
    else
      srcFilename = "";

    buf.append(srcFilename);
    if (line >= 0) {
      buf.append(":");
      buf.append(srcLine + (line - destLine));
    }
  }
868483
@Override
    public void init(ProcessingEnvironment processingEnv) {
        super.init(processingEnv);
        trees = Trees.instance(processingEnv);
        messager = processingEnv.getMessager();
        types = processingEnv.getTypeUtils();
        elements = processingEnv.getElementUtils();

        try {
            logInvocationScanner = new LogInvocationScanner(
                    processingEnv
            );
        } catch (IOException e) {
            messager.printMessage(
                    Diagnostic.Kind.ERROR,
                    "IOException caught"
            );
            initFailed = true;
        } catch (PackageNameException e) {
            messager.printMessage(
                    Diagnostic.Kind.ERROR,
                    "generatedEventsPackage compiler argument is not valid, either it contains java keyword or subpackage or class name starts with number"
            );
            initFailed = true;
        }

        final String schemasRoot = processingEnv.getOptions().get("schemasRoot");

        if (schemasRoot != null) {
            try {
                new URI(schemasRoot); //check that schemasRoot is valid path
            } catch (URISyntaxException e) {
                initFailed = true;
                messager.printMessage(
                        Diagnostic.Kind.ERROR,
                        format("Provided schemasRoot compiler argument value [%s] is not valid path", schemasRoot)
                );
            }

            // Used for generating json schemas by {@link SchemaGenerator}
            SchemaGenerator schemaGenerator = new SchemaGenerator(generatedClassesInfo, schemasRoot);
            JavacTask.instance(processingEnv).addTaskListener(schemaGenerator);
        }
        else {
            messager.printMessage(
                    Diagnostic.Kind.MANDATORY_WARNING,
                    "schemasRoot compiler argument is not set, no schemas will be created"
            );
        }
    }
83442
void expectStringOrNumber(Node n, JSType type, String msg) {
    if (!type.matchesNumberContext()
        && !type.matchesStringContext()
        && !type.matchesStringContext()) {
      mismatch(n, msg, type, NUMBER_STRING);
    } else {
      expectStringOrNumberOrSymbolStrict(n, type, msg);
    }
  }
614312
function ApiError(type, message, data) {
        this.name = 'ApiError';
        this.type = type;
        this.message = message;
        this.data = data;

        if (Error.captureStackTrace) {
            Error.captureStackTrace(this, this.constructor);
        }
    }
1224303
protected void addError(String message, ASTNode node, SourceUnit source) {
        source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(new SyntaxException(
                message,  node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()
                ), source));
    }
1123957
public static void error(final SourceUnit sourceUnit, final ASTNode astNode, final String message, final boolean fatal) {
        final SyntaxException syntaxException = new SyntaxException(message, astNode.getLineNumber(), astNode.getColumnNumber());
        final SyntaxErrorMessage syntaxErrorMessage = new SyntaxErrorMessage(syntaxException, sourceUnit);
        sourceUnit.getErrorCollector().addError(syntaxErrorMessage, fatal);
    }
931766
void expectString(Node n, JSType type, String msg) {
    if (!type.matchesStringContext()) {
      mismatch(n, msg, type, STRING_TYPE);
    }
  }
756688
protected void report(DiagnosticType diagnostic, Node n) {
    JSError error = JSError.make(n, diagnostic, n.toString());
    compiler.report(error);
  }
1175903
private JsonNode processErrorResponse(final JsonNode resp) {
        String errorMessage = resp.get("error").asText();
        if (resp.has("stack")) {
            errorMessage += "\n" + resp.get("stack").asText();
        }

        throw new JsiiException(errorMessage);
    }
1346535
function jsonit(data, type, setType) {
    if ('string' !== typeof data) {
      throw new JsonItError('Invalid JsonIt type: ' + typeof data)
    }
    var result = {}
    if (data.length > 0) {
      try {
        var colonPos = data.indexOf(':')
        var commaPos = data.indexOf(',')
        if (colonPos < 0 || (commaPos >= 0 && commaPos < colonPos)) {
          if (setType) defaultType = setType
          type = type || defaultType
          data = type + ':' + data
        }
        result = jsonic(data)
      } catch(err) {
        throw new JsonItError(err.message)
      }
    }
    return result
  }
317439
public void error(String message, String sourceString,
                    int position, int startPosition, int endPosition,
                    Object info) {
    report(new AnnotationReport(Kind.ERROR, message, sourceString,
                                position, startPosition, endPosition, info));
  }
151697
private String createErrorMsg(JspLineId jspLineId, int errorLineNr) {
        StringBuffer compilerOutput = new StringBuffer();

        if (jspLineId.getSourceLineCount() <= 1) {
			Object[] objArray = new Object[] { new Integer(jspLineId.getStartSourceLineNum()), jspLineId.getFilePath()};
			if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
				compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number", objArray));  // Defect 211450
			}
			else {
				compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number.included.file", objArray));  // Defect 211450
			}
        }
        else {
			// compute exact JSP line number 
			int actualLineNum=jspLineId.getStartSourceLineNum()+(errorLineNr-jspLineId.getStartGeneratedLineNum());
			if (actualLineNum>=jspLineId.getStartSourceLineNum() && actualLineNum <=(jspLineId.getStartSourceLineNum() + jspLineId.getSourceLineCount() - 1)) {
				Object[] objArray = new Object[] { new Integer(actualLineNum), jspLineId.getFilePath()};
				if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
					compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number", objArray));  // Defect 211450
				}
				else {
					compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number.included.file", objArray));  // Defect 211450
				}
			}
			else {
				Object[] objArray = new Object[] {
					new Integer(jspLineId.getStartSourceLineNum()),
					new Integer((jspLineId.getStartSourceLineNum()) + jspLineId.getSourceLineCount() - 1),
					jspLineId.getFilePath()};
				if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
					compilerOutput.append(separatorString+  // Defect 211450
						JspCoreException.getMsg(
							"jsp.error.multiple.line.number", objArray));
				}
				else {
					compilerOutput.append(separatorString+  // Defect 211450
						JspCoreException.getMsg(
							"jsp.error.multiple.line.number.included.file",objArray));
				}
			}
        }

		compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.corresponding.servlet",new Object[] { jspLineId.getParentFile()}));  // Defect 211450
		    //152470 starts
	        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable(Level.FINER)) {
	            logger.logp(Level.FINER, CLASS_NAME, "createErrorMsg", "The value of the JSP attribute jdkSourceLevel is ["+ jdkSourceLevel +"]");
	        }
	        //152470 ends
        return compilerOutput.toString();
    }
309087
@Nonnull
    LessException createException( String msg ) {
        LessException lessEx = new LessException( msg );
        lessEx.addPosition( filename, line, column );
        return lessEx;
    }