langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacMessager.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
26 package com.sun.tools.javac.processing; |
26 package com.sun.tools.javac.processing; |
27 |
27 |
28 import com.sun.tools.javac.model.JavacElements; |
28 import com.sun.tools.javac.model.JavacElements; |
29 import com.sun.tools.javac.util.*; |
29 import com.sun.tools.javac.util.*; |
30 import com.sun.tools.javac.util.DefinedBy.Api; |
30 import com.sun.tools.javac.util.DefinedBy.Api; |
|
31 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag; |
31 import com.sun.tools.javac.tree.JCTree; |
32 import com.sun.tools.javac.tree.JCTree; |
32 import com.sun.tools.javac.tree.JCTree.*; |
33 import com.sun.tools.javac.tree.JCTree.*; |
33 import javax.lang.model.element.*; |
34 import javax.lang.model.element.*; |
34 import javax.tools.JavaFileObject; |
35 import javax.tools.JavaFileObject; |
35 import javax.tools.Diagnostic; |
36 import javax.tools.Diagnostic; |
111 } |
112 } |
112 try { |
113 try { |
113 switch (kind) { |
114 switch (kind) { |
114 case ERROR: |
115 case ERROR: |
115 errorCount++; |
116 errorCount++; |
116 boolean prev = log.multipleErrors; |
117 log.error(DiagnosticFlag.MULTIPLE, pos, "proc.messager", msg.toString()); |
117 log.multipleErrors = true; |
|
118 try { |
|
119 log.error(pos, "proc.messager", msg.toString()); |
|
120 } finally { |
|
121 log.multipleErrors = prev; |
|
122 } |
|
123 break; |
118 break; |
124 |
119 |
125 case WARNING: |
120 case WARNING: |
126 warningCount++; |
121 warningCount++; |
127 log.warning(pos, "proc.messager", msg.toString()); |
122 log.warning(pos, "proc.messager", msg.toString()); |