Examples of DiagnosticSource


Examples of com.sun.tools.javac.util.JCDiagnostic.DiagnosticSource

  }
  return sb.toString();
    }

    private String format_std(JCDiagnostic d) {
  DiagnosticSource source = d.getDiagnosticSource();
  DiagnosticType type = d.getType();
  int position = d.getIntPosition();

 
  String format = noPosFormat;
  if (source != null) {
      if (position != Position.NOPOS) {
    format = posFormat;
      } else if (source.getFile() != null &&
           source.getFile().getKind() == JavaFileObject.Kind.CLASS) {
    format = classFormat;
      }
  }

  StringBuilder sb = new StringBuilder();

  for (int i = 0; i < format.length(); i++) {
      char c = format.charAt(i);
      if (c == '%' && i < format.length() - 1) {
    c = format.charAt(++i);
    switch (c) {
    case 'b':
        sb.append(source == null ? "-" : source.getName());
        break;

    case 'e':
        sb.append(position == Position.NOPOS ? "-" : String.valueOf(d.getEndPosition()));
        break;
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.