langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java
changeset 40232 4995ab1a4558
parent 38617 d93a7f64e231
child 42827 36468b5fa7f4
equal deleted inserted replaced
40231:ba38ad2dd137 40232:4995ab1a4558
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2016, 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
   172             return;
   172             return;
   173         }
   173         }
   174 
   174 
   175         if (nerrors < MaxErrors) {
   175         if (nerrors < MaxErrors) {
   176             String prefix = (pos == null) ? programName : pos.toString();
   176             String prefix = (pos == null) ? programName : pos.toString();
       
   177             PrintWriter errWriter = getWriter(WriterKind.ERROR);
   177             errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg);
   178             errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg);
   178             errWriter.flush();
   179             errWriter.flush();
   179             prompt();
   180             prompt();
   180             nerrors++;
   181             nerrors++;
   181         }
   182         }
   204             return;
   205             return;
   205         }
   206         }
   206 
   207 
   207         if (nwarnings < MaxWarnings) {
   208         if (nwarnings < MaxWarnings) {
   208             String prefix = (pos == null) ? programName : pos.toString();
   209             String prefix = (pos == null) ? programName : pos.toString();
       
   210             PrintWriter warnWriter = getWriter(WriterKind.WARNING);
   209             warnWriter.println(prefix +  ": " + getText("javadoc.warning") +" - " + msg);
   211             warnWriter.println(prefix +  ": " + getText("javadoc.warning") +" - " + msg);
   210             warnWriter.flush();
   212             warnWriter.flush();
   211             nwarnings++;
   213             nwarnings++;
   212         }
   214         }
   213     }
   215     }
   233         if (diagListener != null) {
   235         if (diagListener != null) {
   234             report(DiagnosticType.NOTE, pos, msg);
   236             report(DiagnosticType.NOTE, pos, msg);
   235             return;
   237             return;
   236         }
   238         }
   237 
   239 
       
   240         PrintWriter noticeWriter = getWriter(WriterKind.NOTICE);
   238         if (pos == null)
   241         if (pos == null)
   239             noticeWriter.println(msg);
   242             noticeWriter.println(msg);
   240         else
   243         else
   241             noticeWriter.println(pos + ": " + msg);
   244             noticeWriter.println(pos + ": " + msg);
   242         noticeWriter.flush();
   245         noticeWriter.flush();