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 |