/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6769027
* @summary Source line should be displayed immediately after the first diagnostic line
* @author Maurizio Cimadamore
*/
public class T6769027 {
enum OutputKind {
}
}
}
enum CaretKind {
}
}
boolean isEnabled() {
}
}
enum SourceLineKind {
}
}
boolean isAfterSummary() {
return this == DEFAULT || this == AFTER_SUMMARY;
}
}
enum XDiagsSource {
if (this != DEFAULT) {
}
}
}
}
}
enum XDiagsCompact {
if (this != DEFAULT) {
}
}
}
}
enum ErrorKind {
"compiler.err.single: Hello!",
"KXThis is a test error message Hello!"),
"compiler.err.double: Hello!",
"KXThis is a test error message.\n" +
"KXYThis is another line of the above error message Hello!");
return key;
}
this.nonRawOutput = nonRawOutput;
}
nonRawOutput.replace("X", summaryIndent.string).replace("Y", detailsIndent.string).replace("K", "");
}
String getOutput(OutputKind outKind, IndentKind summaryIndent, IndentKind detailsIndent, String indent) {
nonRawOutput.replace("X", summaryIndent.string).replace("Y", detailsIndent.string).replace("K", indent);
}
}
enum MultilineKind {
{"", ",{(E),(E)}", ",{(E,{(E)})}", ",{(E,{(E)}),(E,{(E)})}"}, //ENABLED
{"", "", "", "",""}, //DISABLED
{"", ",{(E)}", ",{(E,{(E)})}", ",{(E,{(E)})}"}, //LIMIT_LENGTH
{"", ",{(E),(E)}", ",{(E)}", ",{(E),(E)}"}, //LIMIT_DEPTH
{"", ",{(E)}", ",{(E)}", ",{(E)}"}}; //LIMIT_BOTH
{"", "\nE\nE", "\nE\nQ", "\nE\nQ\nE\nQ"}, //ENABLED
{"", "", "", "",""}, //DISABLED
{"", "\nE", "\nE\nQ", "\nE\nQ"}, //LIMIT_LENGTH
{"", "\nE\nE", "\nE", "\nE\nE"}, //LIMIT_DEPTH
{"", "\nE", "\nE", "\nE"}}; //LIMIT_BOTH
int index;
}
boolean isDouble() {
return this == DOUBLE || this == DOUBLE_NESTED;
}
boolean isNested() {
return this == NESTED || this == DOUBLE_NESTED;
}
String errMsg2 = errKind.getOutput(outKind, summaryIndent, detailsIndent, constIndent + constIndent);
}
}
enum MultilinePolicy {
int index;
}
}
}
enum PositionKind {
int pos;
this.nonRawOutput = nonRawOutput;
}
}
}
}
}
return text;
}
}
enum IndentKind {
}
}
super(ctx);
}
}
return true;
}
}
}
}
void test() {
}
}
}
}
}
}
}
}
}
}
}
}
}
if (nerrors != 0)
}
}
errorLine += multiKind.getOutput(outputKind, errorKind, multiPolicy, summaryIndent, detailsIndent, subdiagsIndent);
}
if (shouldPrintSource) {
if (sourceLineKind.isAfterSummary()) {
errorLine += "\n";
sep = "";
}
}
else
}
nerrors++;
}
}
}
}