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

changeset 168
4cdaaf4c5dca
parent 137
e4eaddca54b7
child 194
d0b33fe8e710
equal deleted inserted replaced
166:32e309883246 168:4cdaaf4c5dca
188 public void setEndPosTable(JavaFileObject name, Map<JCTree, Integer> table) { 188 public void setEndPosTable(JavaFileObject name, Map<JCTree, Integer> table) {
189 name.getClass(); // null check 189 name.getClass(); // null check
190 getSource(name).setEndPosTable(table); 190 getSource(name).setEndPosTable(table);
191 } 191 }
192 192
193 /** Return current source name. 193 /** Return current sourcefile.
194 */ 194 */
195 public JavaFileObject currentSource() { 195 public JavaFileObject currentSourceFile() {
196 return source == null ? null : source.getFile(); 196 return source == null ? null : source.getFile();
197 } 197 }
198 198
199 /** Flush the logs 199 /** Flush the logs
200 */ 200 */
393 private void printRawError(int pos, String msg) { 393 private void printRawError(int pos, String msg) {
394 if (source == null || pos == Position.NOPOS) { 394 if (source == null || pos == Position.NOPOS) {
395 printLines(errWriter, "error: " + msg); 395 printLines(errWriter, "error: " + msg);
396 } else { 396 } else {
397 int line = source.getLineNumber(pos); 397 int line = source.getLineNumber(pos);
398 JavaFileObject file = currentSource(); 398 JavaFileObject file = source.getFile();
399 if (file != null) 399 if (file != null)
400 printLines(errWriter, 400 printLines(errWriter,
401 JavacFileManager.getJavacFileName(file) + ":" + 401 JavacFileManager.getJavacFileName(file) + ":" +
402 line + ": " + msg); 402 line + ": " + msg);
403 printErrLine(pos, errWriter); 403 printErrLine(pos, errWriter);
406 } 406 }
407 407
408 /** report an error: 408 /** report an error:
409 */ 409 */
410 public void rawError(int pos, String msg) { 410 public void rawError(int pos, String msg) {
411 if (nerrors < MaxErrors && shouldReport(currentSource(), pos)) { 411 if (nerrors < MaxErrors && shouldReport(currentSourceFile(), pos)) {
412 printRawError(pos, msg); 412 printRawError(pos, msg);
413 prompt(); 413 prompt();
414 nerrors++; 414 nerrors++;
415 } 415 }
416 errWriter.flush(); 416 errWriter.flush();

mercurial