src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java

changeset 1138
7375d4979bd3
parent 1135
36553cb94345
child 1280
5c0b3faeb0b0
equal deleted inserted replaced
1137:c1238fcc9515 1138:7375d4979bd3
33 import javax.tools.Diagnostic; 33 import javax.tools.Diagnostic;
34 import javax.tools.JavaFileObject; 34 import javax.tools.JavaFileObject;
35 35
36 import com.sun.tools.javac.api.DiagnosticFormatter; 36 import com.sun.tools.javac.api.DiagnosticFormatter;
37 import com.sun.tools.javac.code.Lint.LintCategory; 37 import com.sun.tools.javac.code.Lint.LintCategory;
38 import com.sun.tools.javac.parser.EndPosTable;
38 import com.sun.tools.javac.tree.JCTree; 39 import com.sun.tools.javac.tree.JCTree;
39 40
40 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticType.*; 41 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticType.*;
41 42
42 /** An abstraction of a diagnostic message generated by the compiler. 43 /** An abstraction of a diagnostic message generated by the compiler.
311 * location for the diagnostic. */ 312 * location for the diagnostic. */
312 int getPreferredPosition(); 313 int getPreferredPosition();
313 /** If there is a tree node, and if endPositions are available, get 314 /** If there is a tree node, and if endPositions are available, get
314 * the end position of the tree node. Otherwise, just returns the 315 * the end position of the tree node. Otherwise, just returns the
315 * same as getPreferredPosition(). */ 316 * same as getPreferredPosition(). */
316 int getEndPosition(Map<JCTree, Integer> endPosTable); 317 int getEndPosition(EndPosTable endPosTable);
317 } 318 }
318 319
319 /** 320 /**
320 * A DiagnosticPosition that simply identifies a position, but no related 321 * A DiagnosticPosition that simply identifies a position, but no related
321 * tree node, as the location for a diagnostic. Used for scanner and parser 322 * tree node, as the location for a diagnostic. Used for scanner and parser
335 336
336 public int getPreferredPosition() { 337 public int getPreferredPosition() {
337 return pos; 338 return pos;
338 } 339 }
339 340
340 public int getEndPosition(Map<JCTree, Integer> endPosTable) { 341 public int getEndPosition(EndPosTable endPosTable) {
341 return pos; 342 return pos;
342 } 343 }
343 344
344 private final int pos; 345 private final int pos;
345 } 346 }

mercurial