package org.eclipse.jdt.tests.compiler.regression; import java.util.Map; import org.eclipse.jdt.core.tests.compiler.regression.*; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import junit.framework.Test; public class NegativeTest extends AbstractRegressionTest { public NegativeTest(String name) { super(name); } /** * Cannot compile a string bigger than 64K, so this test case is split in two. */ private String getTest005Data1() { return "package p;\n" + "public class X {\n" + "void foo(){\n" + " int[] intarray = {\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n"; } /** * Cannot compile a string bigger than 64K, so this test case is split in two. */ private String getTest005Data2() { return " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n" + " 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20\n" + " };\n" + " System.out.println(intarray);\n" + "}\n" + "}"; } public static Test suite() { return setupSuite(testClass()); } public void test001() { this.runNegativeTest( new String[] { "p/A1.java", "package p;\n" + "public class A1 {\n" + " static interface I{}\n" + " \n" + "Class bar() {\n" + " return Object.class; \n" + "}\n" + "void baz() {\n" + " String message = \"Test\";\n" + " message += System.out.println(3);\n" + " System.out.println(\"Message is \" + message);\n" + "}\n" + "void baz2() {\n" + " String message = \"Test\";\n" + " message += System.out.println(3);\n" + " System.out.println(\"Message is \" + message);\n" + "}\n" + "boolean f(int p) {\n" + " return true;\n" + "}\n" + "boolean f2(int p) {\n" + " return true;\n" + "}\n" + "void foo() {\n" + " int i;\n" + " do {\n" + " try {\n" + " break;\n" + " } finally {\n" + " i = 1;\n" + " continue;\n" + " }\n" + " } while (i++ < 10);\n" + "}\n" + " static void main(String argv[]){\n" + " final int b = 0;\n" + " //b = 0;\n" + " if ((b == 0) && (b == 1))\n" + " System.out.println(\"Hello\");\n" + " } \n" + "public static void main2(String[] args) {\n" + " try {\n" + " } catch (Exception e) {\n" + " System.out.println(\"caught\");\n" + " }\n" + "}\n" + "int v(int i) {\n" + " int j;\n" + " out : for (;;) {\n" + " if (f(i)) {\n" + " j = 1;\n" + " break out;\n" + " }\n" + " }\n" + " return j;\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\A1.java (at line 10)\n" + " message += System.out.println(3);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The operator += is undefined for the argument type(s) String, void\n" + "----------\n" + "2. ERROR in p\\A1.java (at line 15)\n" + " message += System.out.println(3);\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The operator += is undefined for the argument type(s) String, void\n" + "----------\n" + "3. WARNING in p\\A1.java (at line 29)\n" + " } finally {\n" + " i = 1;\n" + " continue;\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "finally block does not complete normally\n" + "----------\n" ); } public void test003() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " void f() throws InstantiationException {\n" + " new Object() {\n" + " {\n" + " throw new InstantiationException(\"test\");\n" + " }\n" + " };\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " {\n" + " throw new InstantiationException(\"test\");\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Initializer does not complete normally\n" + "----------\n" ); } public void test004() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public Object foo() {\n" + " java.io.Serializable o = null;\n" + " if (o == 0) return o;\n" + " return this;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " if (o == 0) return o;\n" + " ^^^^^^\n" + "Incompatible operand types Serializable and int\n" + "----------\n" ); } public void test005() { this.runNegativeTest( new String[] { "p/X.java", this.getTest005Data1() + this.getTest005Data2(), }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " void foo(){\n" + " ^^^^^\n" + "The code of method foo() is exceeding the 65535 bytes limit\n" + "----------\n" ); } public void test006() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " void foo(Buzz b) {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " void foo(Buzz b) {\n" + " ^^^^\n" + "Buzz cannot be resolved (or is not a valid type) for the argument b of the method foo\n" + "----------\n" ); } public void test008() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X {\n" + " X() {\n" + " true.super();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " true.super();\n" + " ^^^^\n" + "Illegal enclosing instance specification for type Object\n" + "----------\n" ); } public void test009() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X {\n" + " class X1 {\n" + " X1() {\n" + " this();\n" + " }\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " this();\n" + " ^^^^^^\n" + "Recursive constructor invocation X.X1()\n" + "----------\n" ); } public void test010() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X{\n" + " int x;\n" + " void f(int a){\n" + " System.out.println(\"Hello World\");\n" + " }\n" + "public static void main(String args[]) {\n" + " class A\n" + " {\n" + " void df(){\n" + " f(x);\n" + " }\n" + " void f(Object a){\n" + " System.out.println(\"Inner Short\");\n" + " }\n" + " }\n" + " //A b = new znew().new A();\n" + " A b = new A();\n" + " b.df(); \n" + " \n" + " \n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 11)\n" + " f(x);\n" + " ^\n" + "Cannot make a static reference to the non-static field x\n" + "----------\n" ); } public void test011() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public static void main(String[] args){ \n" + " int[2] = 3; // Syntax Error!!!\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " int[2] = 3; // Syntax Error!!!\n" + " ^^^\n" + "Syntax error on token \"int\", invalid Expression\n" + "----------\n" ); } public void test012() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + "void foo() {\n" + " for (;;) {\n" + " break;\n" + " }\n" + " out : do {\n" + " try {\n" + " while (true) break out;\n" + " } finally {\n" + " continue;\n" + " }\n" + " } while (true);\n" + " return; // unreachable\n" + "}\n" + "}", }, "----------\n" + "1. WARNING in p\\X.java (at line 10)\n" + " } finally {\n" + " continue;\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^\n" + "finally block does not complete normally\n" + "----------\n" + "2. ERROR in p\\X.java (at line 14)\n" + " return; // unreachable\n" + " ^^^^^^\n" + "Unreachable code\n" + "----------\n" ); } public void test013() { this.runNegativeTest( new String[] { "p/baz.java", "package p;\n" + "class baz extends foo {\n" + " \n" + " baz() {super(this);} //causes compiler crash \n" + "} ", }, "----------\n" + "1. ERROR in p\\baz.java (at line 2)\n" + " class baz extends foo {\n" + " ^^^\n" + "foo cannot be resolved or is not a valid superclass\n" + "----------\n" + "2. ERROR in p\\baz.java (at line 4)\n" + " baz() {super(this);} //causes compiler crash \n" + " ^^^^\n" + "Cannot refer to \'this\' nor \'super\' while explicitly invoking a constructor\n" + "----------\n" ); } public void test015() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public static void main(String args[]) {\n" + " boolean b1, b2;\n" + " boolean r = false;\n" + " boolean t = true;\n" + " if ((r | (b1 = false)) || r);\n" + " else\n" + " r = b1;\n" + " if (r)\n" + " System.out.println(\"FAILED\");\n" + " if (r | (r || (b2 = false)));\n" + " else\n" + " r = !b2;\n" + " if (!r)\n" + " System.out.println(\"FAILED\");\n" + " System.out.println(\"SUCCESS\");\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 14)\n" + " r = !b2;\n" + " ^^\n" + "The local variable b2 may not have been initialized\n" + "----------\n" ); } public void test020() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "// test blank finals - they must be assigned a value once \n" + "// and only once. y is ok, x is not.\n" + "class X {\n" + " final int x;\n" + " final int y;\n" + " X(int i){\n" + " if (i == 0){\n" + " try {\n" + " x = 2;\n" + " y = 2; // assigns y in then part\n" + " throw new Exception();\n" + " }\n" + " catch (Exception e) {\n" + " x = 4; // oops\n" + " }\n" + " } \n" + " else {\n" + " try{\n" + " x = 1;\n" + " throw new Exception();\n" + " }\n" + " catch (Exception e) {\n" + " x = 3; // oops\n" + " }\n" + " finally {\n" + " y = 1; // assigns y in else part\n" + " x = 5; // oops\n" + " }\n" + " }\n" + " } \n" + " public void testExceptionHandling(){\n" + " try{ throw new Exception(); }\n" + " finally { return; }\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 7)\n" + " X(int i){\n" + " ^^^^^^^^\n" + "The blank final field y may not have been initialized\n" + "----------\n" + "2. ERROR in p\\X.java (at line 15)\n" + " x = 4; // oops\n" + " ^\n" + "The final field x may already have been assigned\n" + "----------\n" + "3. ERROR in p\\X.java (at line 24)\n" + " x = 3; // oops\n" + " ^\n" + "The final field x may already have been assigned\n" + "----------\n" + "4. ERROR in p\\X.java (at line 28)\n" + " x = 5; // oops\n" + " ^\n" + "The final field x may already have been assigned\n" + "----------\n" + "5. WARNING in p\\X.java (at line 34)\n" + " finally { return; }\n" + " ^^^^^^^^^^^\n" + "finally block does not complete normally\n" + "----------\n" ); } public void test021() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " \n" + " public static void main(String[] argv) {\n" + " int i1 = -2147483649; // error: -2147483549 out-of-range\n" + " System.out.println(i1);\n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " int i1 = -2147483649; // error: -2147483549 out-of-range\n" + " ^^^^^^^^^^\n" + "The literal 2147483649 of type int is out of range \n" + "----------\n" ); } public void test022() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X {\n" + " int f(){\n" + " class A{\n" + " }\n" + " class A{\n" + " }\n" + " return 0;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 6)\n" + " class A{\n" + " ^\n" + "Duplicate nested type A\n" + "----------\n" ); } public void test023() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public static void main(String argv[]) {\n" + " int t = 10;\n" + " synchronized (null) {\n" + " System.out.println ( \"failed\" );\n" + " }\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " synchronized (null) {\n" + " ^^^^\n" + "null is not a valid argument for the synchronized statement\n" + "----------\n" ); } public void test024() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X {\n" + " int i = 3;\n" + " static int j = i;\n" + " static int foo(){ return i; } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " static int j = i;\n" + " ^\n" + "Cannot make a static reference to the non-static field i\n" + "----------\n" + "2. ERROR in p\\X.java (at line 5)\n" + " static int foo(){ return i; } \n" + " ^\n" + "Cannot make a static reference to the non-static field i\n" + "----------\n" ); } public void test025() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X {\n" + " \n" + " // local class in a instance initailizer block \n" + " {\n" + " protected class inner { } //error- protected not allowed \n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 6)\n" + " protected class inner { } //error- protected not allowed \n" + " ^^^^^\n" + "Illegal modifier for the local class inner; only one of abstract or final is permitted\n" + "----------\n" ); } public void test026() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X{\n" + " \n" + " int xi = 100;\n" + " \n" + " // static top-level class for X \n" + " static class Y {\n" + " public void test() { int yi = xi; } //error - cannot use instance \n" + " //variable xi of class X \n" + " }\n" + " \n" + " public static void foo() {\n" + " boolean res;\n" + " Double d = new Double(3.14);\n" + " String s = \"string\", n = null;\n" + " char [] a = new char [10];\n" + " char [][] b = null;\n" + " res = d != s;\n" + " res = n != d;\n" + " res = b != n;\n" + " res = s != a;\n" + " res = a != b;\n" + " }\n" + " public static void foo1() {\n" + " int res;\n" + " int a = 10;\n" + " --a %= 4; \n" + " a-- %= 4; \n" + " // HERE JDK 1.2 complains, but not VA/Java.\n" + " //(a) expecting ;%= 4;\n" + " return 0;\n" + " }\n" + "} ", }, "----------\n" + "1. ERROR in p\\X.java (at line 8)\n" + " public void test() { int yi = xi; } //error - cannot use instance \n" + " ^^\n" + "Cannot make a static reference to the non-static field xi\n" + "----------\n" + "2. ERROR in p\\X.java (at line 18)\n" + " res = d != s;\n" + " ^^^^^^\n" + "Incompatible operand types Double and String\n" + "----------\n" + "3. ERROR in p\\X.java (at line 19)\n" + " res = n != d;\n" + " ^^^^^^\n" + "Incompatible operand types String and Double\n" + "----------\n" + "4. ERROR in p\\X.java (at line 20)\n" + " res = b != n;\n" + " ^^^^^^\n" + "Incompatible operand types char[][] and String\n" + "----------\n" + "5. ERROR in p\\X.java (at line 21)\n" + " res = s != a;\n" + " ^^^^^^\n" + "Incompatible operand types String and char[]\n" + "----------\n" + "6. ERROR in p\\X.java (at line 22)\n" + " res = a != b;\n" + " ^^^^^^\n" + "Incompatible operand types char[] and char[][]\n" + "----------\n" + "7. ERROR in p\\X.java (at line 27)\n" + " --a %= 4; \n" + " ^^\n" + "Syntax error on token \"--\", delete this token\n" + "----------\n" ); } public void test027() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X\n" + " {\n" + " int i = 3;\n" + " static class Y\n" + " {\n" + " int i = 3;\n" + " {\n" + " class A\n" + " {\n" + " int j = X.this.i; //error: can\'t access the outermost top\n" + " } //level class, instance member.\n" + " }\n" + " }\n" + " }", }, "----------\n" + "1. WARNING in p\\X.java (at line 7)\n" + " int i = 3;\n" + " ^\n" + "The field X.Y.i is hiding a field from type X\n" + "----------\n" + "2. ERROR in p\\X.java (at line 11)\n" + " int j = X.this.i; //error: can\'t access the outermost top\n" + " ^^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + "----------\n" ); } public void test028() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public void method1(){\n" + " int i = 0;\n" + " i.f = 1;\n" + " // ^ The field i.f is undefined\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " i.f = 1;\n" + " ^^^\n" + "The primitive type int of i does not have a field f\n" + "----------\n" ); } public void test029() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X {\n" + " static int X = 100;\n" + " //inner class Y \n" + " class Y { \n" + " public int j = 0;\n" + " Y(int x){ j = x; }\n" + " } \n" + " \n" + " class Z { \n" + " int m=100;\n" + " byte b=31;\n" + " void test(){};\n" + " }\n" + " class Z1 {\n" + " void test(){\n" + " new Z()\n" + " {\n" + " int m=200; \n" + " byte b=0;\n" + " void test()\n" + " {\n" + " if (m != 200) System.out.println(\"bad m\");\n" + " if (b != (byte)0) System.out.println(\"bad b\");\n" + " if (Z.this.m != 100) System.out.println(\"bad Z.this.m\");\n" + " if (Z.this.b != (byte)31) System.out.println(\"bad Z.this.b\");\n" + " }\n" + " }.test();\n" + " }\n" + " }\n" + " public void call_inner()\n" + " {\n" + " if (test_anonymous().j != 100)\n" + " System.out.println(\"j is incorrect\");\n" + " } \n" + " public static void main(String argv[])\n" + " {\n" + " X ox = new X();\n" + " ox.call_inner(); \n" + " System.out.println(\"job done\");\n" + " } \n" + " Y test_anonymous()\n" + " { \n" + " System.out.println(\"executing test_anonymous()\");\n" + " //anonymous implementation of class Y\n" + " return new Y(X) //X should be implicitely passed to Y()\n" + " {\n" + " }; \n" + " \n" + " } //end test_anonymous \n" + "void testFor(){\n" + " for(int i=(i=10),j=i; i< 11; i++,j++);\n" + "} \n" + "} ", }, "----------\n" + "1. WARNING in p\\X.java (at line 19)\n" + " int m=200; \n" + " ^\n" + "The field .m is hiding a field from type X.Z\n" + "----------\n" + "2. WARNING in p\\X.java (at line 20)\n" + " byte b=0;\n" + " ^\n" + "The field .b is hiding a field from type X.Z\n" + "----------\n" + "3. ERROR in p\\X.java (at line 25)\n" + " if (Z.this.m != 100) System.out.println(\"bad Z.this.m\");\n" + " ^^^^^^\n" + "No enclosing instance of the type X.Z is accessible in scope\n" + "----------\n" + "4. ERROR in p\\X.java (at line 26)\n" + " if (Z.this.b != (byte)31) System.out.println(\"bad Z.this.b\");\n" + " ^^^^^^\n" + "No enclosing instance of the type X.Z is accessible in scope\n" + "----------\n" ); } public void test030() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "interface XTopLevelI {\n" + " public void doI();\n" + "}\n" + "public abstract class X implements XTopLevelI {\n" + "}\n" + "class XTopLevelB extends X {\n" + "}\n" + "class XTopLevelC extends XTopLevelB {\n" + "}\n" + "abstract class XTopLevelD extends XTopLevelC {\n" + "}\n" + "class XTopLevelE extends XTopLevelD {\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 7)\n" + " class XTopLevelB extends X {\n" + " ^^^^^^^^^^\n" + "Class must implement the inherited abstract method XTopLevelI.doI()\n" + "----------\n" ); } public void test031() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " int x;\n" + " public class Y extends p1.Y {\n" + " Y() throws java.io.IOException {\n" + " super(new p1.Z(), new java.io.FileInputStream(foo() + x));\n" + " scanComments = true;\n" + " }\n" + " }\n" + " String foo() {\n" + " return \"\";\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " public class Y extends p1.Y {\n" + " ^^^^\n" + "p1 cannot be resolved or is not a valid superclass\n" + "----------\n" + "2. ERROR in p\\X.java (at line 6)\n" + " super(new p1.Z(), new java.io.FileInputStream(foo() + x));\n" + " ^^^^\n" + "p1 cannot be resolved or is not a type\n" + "----------\n" + "3. ERROR in p\\X.java (at line 7)\n" + " scanComments = true;\n" + " ^^^^^^^^^^^^\n" + "scanComments cannot be resolved\n" + "----------\n" ); } public void test032() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public static void main(String argv []){\n" + " final int i;\n" + " class Local {\n" + " int j = i; \n" + " };\n" + " i = 1;\n" + " Local l = new Local();\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 6)\n" + " int j = i; \n" + " ^\n" + "The local variable i may not have been initialized\n" + "----------\n" ); } public void test033() { this.runNegativeTest( new String[] { "p/bar.java", "package p;\n" + "class bar extends foo {\n" + " \n" + " bar() {super(super);} \n" + "} ", }, "----------\n" + "1. ERROR in p\\bar.java (at line 2)\n" + " class bar extends foo {\n" + " ^^^\n" + "foo cannot be resolved or is not a valid superclass\n" + "----------\n" + "2. ERROR in p\\bar.java (at line 4)\n" + " bar() {super(super);} \n" + " ^^^^^\n" + "Syntax error on token \"super\", delete this token\n" + "----------\n" ); } public void test035() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " default void foo() {\n" + " public void bar() {}\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " default void foo() {\n" + " ^^^^^^^\n" + "Syntax error on token \"default\", delete this token\n" + "----------\n" + "2. ERROR in p\\X.java (at line 3)\n" + " default void foo() {\n" + " ^\n" + "Syntax error, insert \"}\" to complete MethodBody\n" + "----------\n" + "3. ERROR in p\\X.java (at line 6)\n" + " }\n" + " ^\n" + "Syntax error on token \"}\", delete this token\n" + "----------\n" ); } public void test036() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "import missing.pkg.*;\n" + "import missing.pkg.C;\n" + "public class X {\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 2)\n" + " import missing.pkg.*;\n" + " ^^^^^^^\n" + "The import missing cannot be resolved\n" + "----------\n" + "2. ERROR in p\\X.java (at line 3)\n" + " import missing.pkg.C;\n" + " ^^^^^^^\n" + "The import missing cannot be resolved\n" + "----------\n" ); } public void test038() { this.runNegativeTest( new String[] { "p/Toplevel6.java", "package p;\n" + "//redefinition\n" + "public class Toplevel6 { \n" + " int foo(){\n" + " class Toplevel6{};\n" + " return 34;\n" + " } // \n" + "}", }, "----------\n" + "1. ERROR in p\\Toplevel6.java (at line 5)\n" + " class Toplevel6{};\n" + " ^^^^^^^^^\n" + "Nested type Toplevel6 hides an enclosing type\n" + "----------\n" ); } public void test040() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " final int x, y;\n" + " void foo() {\n" + " final int i;\n" + " try {\n" + " i = 10;\n" + " } finally {\n" + " i = 20;\n" + " };\n" + " }\n" + " void foo1() {\n" + " final int i;\n" + " try {\n" + " System.out.println(\"hello\");\n" + " } catch (Exception e) {\n" + " i = 11;\n" + " } finally {\n" + " i = 21;\n" + " };\n" + " }\n" + " X(int i) {\n" + " if (i == 0) {\n" + " try {\n" + " x = 22;\n" + " y = 32; // assigns y in then part\n" + " throw new Exception();\n" + " } catch (Exception e) {\n" + " x = 42; // oops\n" + " }\n" + " } else {\n" + " try {\n" + " x = 52;\n" + " throw new Exception();\n" + " } catch (Exception e) {\n" + " x = 62; // oops\n" + " } finally {\n" + " y = 72; // assigns y in else part\n" + " x = 82; // oops\n" + " }\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 9)\n" + " i = 20;\n" + " ^\n" + "The final local variable i may already have been assigned\n" + "----------\n" + "2. ERROR in p\\X.java (at line 19)\n" + " i = 21;\n" + " ^\n" + "The final local variable i may already have been assigned\n" + "----------\n" + "3. ERROR in p\\X.java (at line 22)\n" + " X(int i) {\n" + " ^^^^^^^^\n" + "The blank final field y may not have been initialized\n" + "----------\n" + "4. ERROR in p\\X.java (at line 29)\n" + " x = 42; // oops\n" + " ^\n" + "The final field x may already have been assigned\n" + "----------\n" + "5. ERROR in p\\X.java (at line 36)\n" + " x = 62; // oops\n" + " ^\n" + "The final field x may already have been assigned\n" + "----------\n" + "6. ERROR in p\\X.java (at line 39)\n" + " x = 82; // oops\n" + " ^\n" + "The final field x may already have been assigned\n" + "----------\n" ); } public void test041() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "/**\n" + " * 1PQO3W5\n" + " */\n" + "class X {\n" + " final int x;\n" + " static class XMember {\n" + " int bar(){ return foo(); }\n" + " }\n" + " X(X b, int i){\n" + " this.x = i; \n" + " } \n" + " int foo(){ return 1;}\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 8)\n" + " int bar(){ return foo(); }\n" + " ^^^\n" + "The method foo() from the type X.XMember is not static\n" + "----------\n" ); } public void test042() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X{\n" + " void f(){\n" + " final Object o = new Runnable(){\n" + " public void run(){\n" + " o.toString();\n" + " }\n" + " }; \n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 6)\n" + " o.toString();\n" + " ^\n" + "The local variable o may not have been initialized\n" + "----------\n" ); } public void test043() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X{\n" + " \n" + " class X {} //error: inner class has the same simple name\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " class X {} //error: inner class has the same simple name\n" + " ^\n" + "Nested type X hides an enclosing type\n" + "----------\n" ); } public void test044() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "interface X {\n" + " final int i;\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " final int i;\n" + " ^\n" + "The blank final field i may not have been initialized\n" + "----------\n" ); } public void test045() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public static final x;\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " public static final x;\n" + " ^^^^^\n" + "Syntax error on token \"final\", invalid Type\n" + "----------\n" ); } public void test046() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " static final Class CLASSCLASS;\n" + " static {\n" + " try {\n" + " CLASSCLASS = Class.forName(\"java.lang.Class\");\n" + " }\n" + " catch (ClassNotFoundException cnf) {\n" + " CLASSCLASS = null;\n" + " }; // Has to be found\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 9)\n" + " CLASSCLASS = null;\n" + " ^^^^^^^^^^\n" + "The final field CLASSCLASS may already have been assigned\n" + "----------\n" ); } public void test047() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X_Dummy {\n" + " public static void main(String args[]) {\n" + " int [] i = {1, 2, 3};\n" + " (i[0] + 777)++;\n" + " (x.i)--;\n" + " new int [4] ++;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 2)\n" + " public class X_Dummy {\n" + " ^^^^^^^\n" + "The public type X_Dummy must be defined in its own file\n" + "----------\n" + "2. ERROR in p\\X.java (at line 5)\n" + " (i[0] + 777)++;\n" + " ^^^^^^^^^^^^\n" + "Invalid argument to operation ++/--\n" + "----------\n" + "3. ERROR in p\\X.java (at line 7)\n" + " new int [4] ++;\n" + " ^^^^^^^^^^^\n" + "Invalid argument to operation ++/--\n" + "----------\n" ); } public void test048() { this.runNegativeTest( new String[] { "p/Init.java", "package p;\n" + "public class Init {\n" + "public static void main(String argv[]) {\n" + " int i = 1;\n" + " boolean nodeHasBeenAdded;\n" + " switch (i) {\n" + " case 1 :\n" + " nodeHasBeenAdded = false;\n" + " case 2 :\n" + " };\n" + " if (!nodeHasBeenAdded) {\n" + " return;\n" + " }\n" + "}\n" + "public static void test1() {\n" + " int i = 1;\n" + " boolean nodeHasBeenAdded;\n" + " switch (i) {\n" + " case 1 :\n" + " nodeHasBeenAdded = false;\n" + " case 2 :\n" + " if (!nodeHasBeenAdded) {\n" + " return;\n" + " }\n" + " };\n" + "} \n" + "}", }, "----------\n" + "1. ERROR in p\\Init.java (at line 11)\n" + " if (!nodeHasBeenAdded) {\n" + " ^^^^^^^^^^^^^^^^\n" + "The local variable nodeHasBeenAdded may not have been initialized\n" + "----------\n" + "2. ERROR in p\\Init.java (at line 22)\n" + " if (!nodeHasBeenAdded) {\n" + " ^^^^^^^^^^^^^^^^\n" + "The local variable nodeHasBeenAdded may not have been initialized\n" + "----------\n" ); } public void test049() { this.runNegativeTest( new String[] { "p/Init2.java", "package p;\n" + "public class Init2 {\n" + " public static void main(String argv []){\n" + " final int i;\n" + " class Local {\n" + " int j = i; // Javac complains here (Jikes does not)\n" + " };\n" + " i = 1;\n" + " Local l = new Local();\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\Init2.java (at line 6)\n" + " int j = i; // Javac complains here (Jikes does not)\n" + " ^\n" + "The local variable i may not have been initialized\n" + "----------\n" ); } public void test050() { this.runNegativeTest( new String[] { "p/InitExceptionBug0.java", "package p;\n" + " class InitExceptionBug0 {\n" + " \n" + " void f() throws InstantiationException {\n" + " new Object() {\n" + " {\n" + " throw new InstantiationException(\"test\");\n" + " }\n" + " };\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\InitExceptionBug0.java (at line 6)\n" + " {\n" + " throw new InstantiationException(\"test\");\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Initializer does not complete normally\n" + "----------\n" ); } public void test051() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " Object o = null.o; // \"The field null.o is undefined\"\n" + " Object oo = (1).o;\n" + " Object ooo = null.toString(); // \"Cannot send toString to the primitve type null\"\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " Object o = null.o; // \"The field null.o is undefined\"\n" + " ^\n" + "o cannot be resolved or is not a field\n" + "----------\n" + "2. ERROR in p\\X.java (at line 4)\n" + " Object oo = (1).o;\n" + " ^\n" + "o cannot be resolved or is not a field\n" + "----------\n" + "3. ERROR in p\\X.java (at line 5)\n" + " Object ooo = null.toString(); // \"Cannot send toString to the primitve type null\"\n" + " ^^^^^^^^^^^^^^^\n" + "Cannot invoke toString() on the primitive type null\n" + "----------\n" ); } public void test053() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public void method1()[] {\n" + " }\n" + " public void[] method1() {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " public void method1()[] {\n" + " ^^^^^^^^^^^\n" + "An array of void is an invalid return type for the method method1\n" + "----------\n" + "2. ERROR in p\\X.java (at line 3)\n" + " public void method1()[] {\n" + " ^^^^^^^^^^^\n" + "Duplicate method method1 in type X\n" + "----------\n" + "3. ERROR in p\\X.java (at line 5)\n" + " public void[] method1() {\n" + " ^^^^^^^^^\n" + "An array of void is an invalid return type for the method method1\n" + "----------\n" + "4. ERROR in p\\X.java (at line 5)\n" + " public void[] method1() {\n" + " ^^^^^^^^^\n" + "Duplicate method method1 in type X\n" + "----------\n" ); } public void test054() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "import java.util.Date;\n" + "import java.lang.reflect.*;\n" + "public class X extends Date implements Runnable{\n" + " \n" + " Integer w = new Integer(90);\n" + " protected double x = 91.1;\n" + " public long y = 92;\n" + " static public Boolean z = new Boolean(true); \n" + " public class X_inner {\n" + " public X_inner() {\n" + " this.super();\n" + " System.out.println(\"....\");\n" + " }\n" + " }\n" + " X_inner a = new X_inner();\n" + " public interface X_interface {\n" + " public void f(); \n" + " }\n" + " static {\n" + " System.out.println(\"Static initializer\");\n" + " }\n" + " public X() { } \n" + " public X(int a1,int b1) { } \n" + " private void a() { System.out.println(\"A\");} \n" + " protected void b() { System.out.println(\"B\");} \n" + " public void c() { System.out.println(\"C\");} \n" + " static public int d() {System.out.println(\"Static D\");return -1;} \n" + " public static void main(String args[]) {\n" + " X b = new X();\n" + " Class c = b.getClass();\n" + " Class _getClasses [] = X.class.getClasses(); \n" + "// System.out.println(_getClasses[0].toString());\n" + "// System.out.println(_getClasses[1].toString());\n" + " if (_getClasses.length == 0) {System.out.println(\"FAILED\");};\n" + " Constructor _getConstructors[] = c.getConstructors(); \n" + " try {\n" + " Field _getField = c.getField(\"y\");\n" + " Method _getMethod = c.getMethod(\"d\",null);\n" + " \n" + " Boolean b_z = X.z; \n" + " }\n" + " catch (NoSuchFieldException e) { System.out.println(\"NoSuchFieldException\");}\n" + " catch (NoSuchMethodException e) { System.out.println(\"NoSuchMethodException\");};\n" + " } \n" + " public void run() {System.out.println(\"RUN\");} \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 12)\n" + " this.super();\n" + " ^^^^\n" + "Illegal enclosing instance specification for type Object\n" + "----------\n" + "2. WARNING in p\\X.java (at line 25)\n" + " private void a() { System.out.println(\"A\");} \n" + " ^^^\n" + "The private method a() from the type X is never used locally\n" + "----------\n" ); } public void test055() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X {\n" + " static int i;\n" + " { int i = 10;\n" + " return; \n" + " }\n" + " X()\n" + " {\n" + " i = 10;\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " { int i = 10;\n" + " return; \n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Initializer does not complete normally\n" + "----------\n" + "2. WARNING in p\\X.java (at line 4)\n" + " { int i = 10;\n" + " ^\n" + "The local variable i is hiding a field from type X\n" + "----------\n" + "3. ERROR in p\\X.java (at line 5)\n" + " return; \n" + " ^^^^^^\n" + "Cannot return from within an initializer\n" + "----------\n" ); } public void test056() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class Y {\n" + " Y() {//Y0\n" + " }\n" + " Y(String s) {\n" + " this((float) s.length());//Y1\n" + " }\n" + " Y(int i) {\n" + " this((double) i);//Y2\n" + " }\n" + " Y(double d) {\n" + " this((byte) d);//Y3\n" + " }\n" + " Y(byte b) {\n" + " this((float) b);//Y4\n" + " }\n" + " Y(float f) {\n" + " this((int) f);//Y5\n" + " }\n" + "}\n" + "public class X {\n" + " Y() {//Y0\n" + " }\n" + " Y(String s) {\n" + " this((float) s.length());//Y1\n" + " }\n" + " Y(int i) {\n" + " this((byte) i);//Y2\n" + " }\n" + " Y(double d) {\n" + " this((float) d);//Y3\n" + " }\n" + " Y(byte b) {\n" + " this((float) b);//Y4\n" + " }\n" + " Y(float f) {\n" + " this((int) f);//Y5\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 9)\n" + " this((double) i);//Y2\n" + " ^^^^^^^^^^^^^^^^\n" + "Recursive constructor invocation Y(double)\n" + "----------\n" + "2. ERROR in p\\X.java (at line 12)\n" + " this((byte) d);//Y3\n" + " ^^^^^^^^^^^^^^\n" + "Recursive constructor invocation Y(byte)\n" + "----------\n" + "3. ERROR in p\\X.java (at line 15)\n" + " this((float) b);//Y4\n" + " ^^^^^^^^^^^^^^^\n" + "Recursive constructor invocation Y(float)\n" + "----------\n" + "4. ERROR in p\\X.java (at line 18)\n" + " this((int) f);//Y5\n" + " ^^^^^^^^^^^^^\n" + "Recursive constructor invocation Y(int)\n" + "----------\n" + "5. ERROR in p\\X.java (at line 22)\n" + " Y() {//Y0\n" + " ^^^\n" + "Return type for the method is missing\n" + "----------\n" + "6. ERROR in p\\X.java (at line 24)\n" + " Y(String s) {\n" + " ^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "7. ERROR in p\\X.java (at line 25)\n" + " this((float) s.length());//Y1\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" + "8. ERROR in p\\X.java (at line 27)\n" + " Y(int i) {\n" + " ^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "9. ERROR in p\\X.java (at line 28)\n" + " this((byte) i);//Y2\n" + " ^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" + "10. ERROR in p\\X.java (at line 30)\n" + " Y(double d) {\n" + " ^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "11. ERROR in p\\X.java (at line 31)\n" + " this((float) d);//Y3\n" + " ^^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" + "12. ERROR in p\\X.java (at line 33)\n" + " Y(byte b) {\n" + " ^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "13. ERROR in p\\X.java (at line 34)\n" + " this((float) b);//Y4\n" + " ^^^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" + "14. ERROR in p\\X.java (at line 36)\n" + " Y(float f) {\n" + " ^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "15. ERROR in p\\X.java (at line 37)\n" + " this((int) f);//Y5\n" + " ^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" ); } public void test057() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public static void main(String[] args) {\n" + " if (args.length == 0) (System.out.println(\"if is true\"));\n" + " else (System.out.println(\"if is false\"));\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " if (args.length == 0) (System.out.println(\"if is true\"));\n" + " ^\n" + "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + "----------\n" + "2. ERROR in p\\X.java (at line 5)\n" + " else (System.out.println(\"if is false\"));\n" + " ^\n" + "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + "----------\n" ); } public void test058() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X {\n" + " static {\n" + " new Object() {\n" + " Object obj = X.this;\n" + " };\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " Object obj = X.this;\n" + " ^^^^^^\n" + "No enclosing instance of the type X is accessible in scope\n" + "----------\n" ); } public void test060() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + "void f () [] {\n" + " throw new RuntimeException();\n" + "}\n" + "void f1() {\n" + " final int x;\n" + " try {\n" + " x = 4;\n" + " throw new Exception();\n" + " }\n" + " catch (Exception e) {\n" + " x = 5; // oops!\n" + " }\n" + "}\n" + "void f2() {\n" + " final int a;\n" + " while (true) {\n" + " a = 1;\n" + " break;\n" + " }\n" + "} \n" + " public void testExceptionHandling(){\n" + " try{ throw new Exception(); } \n" + " finally { return; }\n" + " } \n" + " public void testExceptionHandling2(){\n" + " throw (Error) null; \n" + " } \n" + " public void testNullCast(){\n" + " String s = (String) null;\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " void f () [] {\n" + " ^^^^^^^\n" + "An array of void is an invalid return type for the method f\n" + "----------\n" + "2. ERROR in p\\X.java (at line 13)\n" + " x = 5; // oops!\n" + " ^\n" + "The final local variable x may already have been assigned\n" + "----------\n" + "3. WARNING in p\\X.java (at line 25)\n" + " finally { return; }\n" + " ^^^^^^^^^^^\n" + "finally block does not complete normally\n" + "----------\n" ); } public void test061() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " class Task implements Runnable {\n" + " private String taskName;\n" + " private int maxIteration;\n" + " public Task(String name, int value) {\n" + " taskName = name; \n" + " maxIteration = value;\n" + " }\n" + " public String toString() { return taskName; }\n" + " public void run() {\n" + " for(int i = 0; i < maxIteration; i++)\n" + " notifyCompletion( (int)((float) (i + 1) / maxIteration * 100));\n" + " } \n" + " \n" + " void notifyCompletion(int percentage) {\n" + " System.out.println( \" task \"+ toString() + \" \" + percentage+ \" %\");\n" + " }\n" + " }\n" + " public static void main(String argv[]){\n" + " X multi = new Object().new X(); // NO NEED FOR ENCLOSING INSTANCE\n" + " int maxTasks = 3;\n" + " Task tasks[] = new Task[maxTasks];\n" + " for (int i = 0; i < maxTasks; i++) \n" + " tasks[i] = multi.new Task(String.valueOf(i),5);\n" + " try {\n" + " multi.performTasks(tasks);\n" + " }\n" + " catch(InterruptedException e){};\n" + " }\n" + " void notifyExecutionEnd() {\n" + " System.out.println(\"EXECUTION FINISHED\");\n" + " }\n" + " void notifyExecutionStart() {\n" + " System.out.println(\"EXECUTION STARTING\");\n" + " }\n" + " void performTasks(Task tasks[]) throws InterruptedException {\n" + " Thread workers[] = new Thread[tasks.length];\n" + " notifyExecutionStart();\n" + " \n" + " // Launching the tasks\n" + " for (int i = 0; i < tasks.length; i++) {\n" + " workers[i] = new Thread(tasks[i],\"Running task(\"+(tasks[i].toString())+\")\");\n" + " workers[i].start();\n" + " }\n" + " // Waiting for *all* tasks to be ended\n" + " for (int i = 0; i < tasks.length; i++)\n" + " workers[i].join();\n" + " notifyExecutionEnd();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 21)\n" + " X multi = new Object().new X(); // NO NEED FOR ENCLOSING INSTANCE\n" + " ^\n" + "Object.X cannot be resolved or is not a type\n" + "----------\n" ); } public void test062() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "import java.io.*;\n" + "public class X {\n" + " Object methodWhichMayThrowAnException() throws IOException {\n" + " return null;\n" + " }\n" + " void foo() {\n" + " final Object o;\n" + " try {\n" + " o = methodWhichMayThrowAnException();\n" + " } catch (IOException e) {\n" + " o = null; // declared elsewhere\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 12)\n" + " o = null; // declared elsewhere\n" + " ^\n" + "The final local variable o may already have been assigned\n" + "----------\n" ); } public void test063() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " class Task implements Runnable {\n" + " private String taskName;\n" + " private int maxIteration;\n" + " public Task(String name, int value) {\n" + " taskName = name; \n" + " maxIteration = value;\n" + " }\n" + " public String toString() { return taskName; }\n" + " public void run() {\n" + " for(int i = 0; i < maxIteration; i++)\n" + " notifyCompletion( (int)((float) (i + 1) / maxIteration * 100));\n" + " } \n" + " \n" + " void notifyCompletion(int percentage) {\n" + " System.out.println( \" task \"+ toString() + \" \" + percentage+ \" %\");\n" + " }\n" + " }\n" + " public static void main(String argv[]){\n" + " X multi = new X();\n" + " int maxTasks = 3;\n" + " Task tasks[] = new Task[maxTasks];\n" + " for (int i = 0; i < maxTasks; i++) \n" + " tasks[i] = new Task(String.valueOf(i),5); // MISSING ENCLOSING INSTANCE\n" + " try {\n" + " multi.performTasks(tasks);\n" + " }\n" + " catch(InterruptedException e){};\n" + " }\n" + " void notifyExecutionEnd() {\n" + " System.out.println(\"EXECUTION FINISHED\");\n" + " }\n" + " void notifyExecutionStart() {\n" + " System.out.println(\"EXECUTION STARTING\");\n" + " }\n" + " void performTasks(Task tasks[]) throws InterruptedException {\n" + " Thread workers[] = new Thread[tasks.length];\n" + " notifyExecutionStart();\n" + " \n" + " // Launching the tasks\n" + " for (int i = 0; i < tasks.length; i++) {\n" + " workers[i] = new Thread(tasks[i],\"Running task(\"+(tasks[i].toString())+\")\");\n" + " workers[i].start();\n" + " }\n" + " // Waiting for *all* tasks to be ended\n" + " for (int i = 0; i < tasks.length; i++)\n" + " workers[i].join();\n" + " notifyExecutionEnd();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 25)\n" + " tasks[i] = new Task(String.valueOf(i),5); // MISSING ENCLOSING INSTANCE\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type X is accessible. Must qualify the allocation with an enclosing instance of type X (e.g. x.new A() where x is an instance of X).\n" + "----------\n" ); } public void test064() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X extends Thread {\n" + " Thread foo() {\n" + " return Thread.this;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " return Thread.this;\n" + " ^^^^^^^^^^^\n" + "No enclosing instance of the type Thread is accessible in scope\n" + "----------\n" ); } public void test065() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class X{\n" + " static void [] v = {};\n" + " X(){}\n" + "} ", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " static void [] v = {};\n" + " ^\n" + "An array of void is an invalid type for the variable v\n" + "----------\n" ); } public void test066() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " int x;\n" + " static class Member {}\n" + " void foo(){\n" + " this.new Member();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 6)\n" + " this.new Member();\n" + " ^^^^\n" + "Illegal enclosing instance specification for type X.Member\n" + "----------\n" ); } public void test067() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " class X {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " class X {\n" + " ^\n" + "Nested type X hides an enclosing type\n" + "----------\n" ); } public void test068() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " void foo () {\n" + " if (y.x)\n" + " return;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " if (y.x)\n" + " ^\n" + "y cannot be resolved\n" + "----------\n" ); } public void test069() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "class XHelper {\n" + " XHelper(int i) {\n" + " }\n" + "}\n" + "public class X extends XHelper {\n" + " X() {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 7)\n" + " X() {\n" + " ^^^\n" + "Implicit super constructor XHelper() is undefined. Must explicitly invoke another constructor\n" + "----------\n" ); } public void test070() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " \n" + " public class B extends Exception {\n" + " public B(String msg) { super(msg); }\n" + " }\n" + " \n" + " \n" + " void foo() throws X$B {\n" + " Object hello$1 = null;\n" + " try {\n" + " throw new B(\"Inside foo()\");\n" + " } catch(B e) {\n" + " System.out.println(\"Caught B\");\n" + " } \n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 9)\n" + " void foo() throws X$B {\n" + " ^^^\n" + "The exception type X$B cannot be referenced using its binary name\n" + "----------\n" ); } public void test071() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "import missingPackage.KentTrouble;\n" + "public class X {\n" + " void m() {\n" + " KentTrouble a = new KentTrouble();\n" + " System.out.println(a);\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 2)\n" + " import missingPackage.KentTrouble;\n" + " ^^^^^^^^^^^^^^\n" + "The import missingPackage cannot be resolved\n" + "----------\n" + "2. ERROR in p\\X.java (at line 5)\n" + " KentTrouble a = new KentTrouble();\n" + " ^^^^^^^^^^^\n" + "KentTrouble cannot be resolved or is not a type\n" + "----------\n" + "3. ERROR in p\\X.java (at line 5)\n" + " KentTrouble a = new KentTrouble();\n" + " ^^^^^^^^^^^\n" + "KentTrouble cannot be resolved or is not a type\n" + "----------\n" ); } public void test072() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public void doit() {\n" + " int sum = 0;\n" + " for (int i = 0; i < max; i++) //Note missing opening brace\n" + " sum += i;\n" + " }\n" + " sum = 0;\n" + " sum = 1\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " for (int i = 0; i < max; i++) //Note missing opening brace\n" + " ^^^\n" + "max cannot be resolved\n" + "----------\n" + "2. ERROR in p\\X.java (at line 7)\n" + " }\n" + " ^\n" + "Syntax error on token \"}\", { expected after this token\n" + "----------\n" + "3. ERROR in p\\X.java (at line 9)\n" + " sum = 1\n" + " ^\n" + "Syntax error, insert \";\" to complete Statement\n" + "----------\n" ); } public void test073() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " public class X {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " public class X {\n" + " ^\n" + "Nested type X hides an enclosing type\n" + "----------\n" ); } public void test074() { this.runNegativeTest( new String[] { "p/CheckBlankFinals.java", "package p;\n" + "public class CheckBlankFinals {\n" + " class MemberA {\n" + " final int a; // never initialized\n" + " class MemberB {\n" + " final int b; \n" + " { b = 2; }\n" + " }\n" + " } \n" + " // checking for collision between final blank field inits amongst nested types\n" + " \n" + " void foo(){\n" + " class LocA {\n" + " final int a; // never initialized\n" + " class LocB {\n" + " final int b; \n" + " //{ b = 2; }\n" + " };\n" + " }; \n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\CheckBlankFinals.java (at line 3)\n" + " class MemberA {\n" + " ^^^^^^^\n" + "The blank final field a may not have been initialized\n" + "----------\n" + "2. ERROR in p\\CheckBlankFinals.java (at line 13)\n" + " class LocA {\n" + " ^^^^\n" + "The blank final field a may not have been initialized\n" + "----------\n" + "3. ERROR in p\\CheckBlankFinals.java (at line 15)\n" + " class LocB {\n" + " ^^^^\n" + "The blank final field b may not have been initialized\n" + "----------\n" ); } public void test075() { this.runNegativeTest( new String[] { "p/Toplevel13.java", "package p;\n" + "//passing a super instance to the super constructor\n" + "public class Toplevel13 {\n" + " Object local(){\n" + " class Package1 {\n" + " class Root {}\n" + " }\n" + " class Package2 {\n" + " class Sub extends Package1.Root {\n" + " Sub(){\n" + " new Package1().super();\n" + " } \n" + " }\n" + " }\n" + " return new Package2().new Package2.Sub();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\Toplevel13.java (at line 15)\n" + " return new Package2().new Package2.Sub();\n" + " ^^^\n" + "Syntax error on token \"new\", delete this token\n" + "----------\n" ); } public void test076() { this.runNegativeTest( new String[] { "p/Toplevel14.java", "package p;\n" + "//passing a super instance to the super constructor\n" + "public class Toplevel14 {\n" + " Object local(){\n" + " class Package1 {\n" + " class Root {}\n" + " }\n" + " class Package2 {\n" + " class Sub extends Package1.Root {\n" + " Sub(){\n" + " new Package1().super();\n" + " } \n" + " }\n" + " }\n" + " return new Package2.Sub();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\Toplevel14.java (at line 15)\n" + " return new Package2.Sub();\n" + " ^^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type Package2 is accessible. Must qualify the allocation with an enclosing instance of type Package2 (e.g. x.new A() where x is an instance of Package2).\n" + "----------\n" ); } public void test077() { this.runNegativeTest( new String[] { "p/Toplevel2.java", "package p;\n" + "//anonymous\n" + "public class Toplevel2{\n" + " public boolean foo(){\n" + " Toplevel2 o = new Toplevel2(){ \n" + " boolean foo() { return false; } // no copy in fact\n" + " };\n" + " return o.foo();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\Toplevel2.java (at line 6)\n" + " boolean foo() { return false; } // no copy in fact\n" + " ^^^^^\n" + "Cannot reduce the visibility of the inherited method from Toplevel2\n" + "----------\n" ); } public void test079() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "import java.io.;\n" + "public class X {\n" + " public static void main(java.lang.String[] args) {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 2)\n" + " import java.io.;\n" + " ^\n" + "Syntax error on token \".\", Identifier expected after this token\n" + "----------\n" ); } public void test080() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class X {\n" + " static int i;\n" + " {\n" + " int i = 10;\n" + " return; // Wrong.\n" + " }\n" + " A() {\n" + " i = 10;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 4)\n" + " {\n" + " int i = 10;\n" + " return; // Wrong.\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Initializer does not complete normally\n" + "----------\n" + "2. WARNING in p\\X.java (at line 5)\n" + " int i = 10;\n" + " ^\n" + "The local variable i is hiding a field from type X\n" + "----------\n" + "3. ERROR in p\\X.java (at line 6)\n" + " return; // Wrong.\n" + " ^^^^^^\n" + "Cannot return from within an initializer\n" + "----------\n" + "4. ERROR in p\\X.java (at line 8)\n" + " A() {\n" + " ^^^\n" + "Return type for the method is missing\n" + "----------\n" ); } public void test081() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "import java.io.*;\n" + "public class X {\n" + " void foo() {\n" + " Reader reader = chars.new Reader();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 5)\n" + " Reader reader = chars.new Reader();\n" + " ^^^^^\n" + "chars cannot be resolved\n" + "----------\n" ); } public void test082() { this.runNegativeTest( new String[] { "p/X.java", "package p;\n" + "public class Object {\n" + " public Object(){\n" + " super();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 2)\n" + " public class Object {\n" + " ^^^^^^\n" + "The public type Object must be defined in its own file\n" + "----------\n" ); } public void test083() { this.runNegativeTest( new String[] { "p/AQ.java", "package p;\n" + "/*\n" + " * 1PR2W5S\n" + " */\n" + "public class AQ {\n" + " void check_unreachable() {\n" + " throw new RuntimeException();\n" + " synchronized (this) {\n" + " int i = 10;\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AQ.java (at line 8)\n" + " synchronized (this) {\n" + " int i = 10;\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); } public void test084() { this.runNegativeTest( new String[] { "p/BytecodeA.java", "package p;\n" + "class BytecodeA {\n" + " \n" + "int foo() { // good\n" + " boolean b = true;\n" + " if (b) {\n" + " if (true)\n" + " return 0;\n" + " } else {\n" + " if (true)\n" + " return 1;\n" + " }\n" + " return 5;\n" + "}\n" + "int foo10() {\n" + " try {\n" + " //if (true)\n" + " return 0;\n" + " } catch (Exception e) {\n" + " if (true)\n" + " return 1;\n" + " } finally {\n" + " if (true)\n" + " return 2;\n" + " };\n" + " return 1;\n" + "} \n" + "int foo11() {\n" + " synchronized (this) {\n" + " if (true)\n" + " return 1;\n" + " };\n" + " return 2;\n" + "} \n" + "int foo12() {\n" + " for (;;)\n" + " return 1;\n" + "}\n" + "int foo13() {\n" + " for (;;)\n" + " if (true)\n" + " return 1;\n" + "}\n" + "int foo14() {\n" + " for (int i = 1; i < 10; i++)\n" + " if (true)\n" + " return 1;\n" + " return 2;\n" + "} \n" + "int foo15() {\n" + " for (int i = 1; i < 10; i++)\n" + " return 1;\n" + " return 2;\n" + "}\n" + "int foo16() {\n" + " final int i;\n" + " while (true) {\n" + " i = 1;\n" + " if (true)\n" + " break;\n" + " };\n" + " return 1;\n" + "} \n" + "int foo17() {\n" + " final int i;\n" + " for (;;) {\n" + " i = 1;\n" + " if (true)\n" + " break;\n" + " };\n" + " return 1;\n" + "} \n" + "void foo2() {\n" + " L1 :; // good\n" + "}\n" + "void foo20() {\n" + " if (true)\n" + " return;\n" + "} \n" + "void foo3() {\n" + " L : if (true) {\n" + " for (;;) {\n" + " continue L; // bad\n" + " }\n" + " }\n" + "} \n" + "void foo4() {\n" + " L : if (true) {\n" + " try {\n" + " for (;;) {\n" + " continue L; // bad\n" + " }\n" + " } finally {\n" + " return;\n" + " }\n" + " } \n" + "}\n" + "void foo5() {\n" + " L : for (;;) {\n" + " continue L; // good\n" + " }\n" + "}\n" + "void foo5bis() {\n" + " L : K : for (;;) {\n" + " continue L; // good\n" + " }\n" + "}\n" + "void foo6(){\n" + " int i;\n" + " boolean a[] = new boolean[5];\n" + " a[i=1] = i > 0; // good\n" + "} \n" + "void foo7(){\n" + " Object x[];\n" + " x [1] = (x = new Object[5]); // bad\n" + "} \n" + "void foo8() {\n" + " try {\n" + " } catch (java.io.IOException e) {\n" + " foo(); // unreachable\n" + " }\n" + "}\n" + "void foo9() {\n" + " try {\n" + " } catch (NullPointerException e) {\n" + " foo(); // ok\n" + " }\n" + "}\n" + " public static void main(String args[]) {\n" + " BytecodeA a = new BytecodeA();\n" + " a.foo10();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\BytecodeA.java (at line 83)\n" + " continue L; // bad\n" + " ^^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" + "2. ERROR in p\\BytecodeA.java (at line 91)\n" + " continue L; // bad\n" + " ^^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" + "3. WARNING in p\\BytecodeA.java (at line 93)\n" + " } finally {\n" + " return;\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "finally block does not complete normally\n" + "----------\n" + "4. ERROR in p\\BytecodeA.java (at line 105)\n" + " continue L; // good\n" + " ^^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" + "5. ERROR in p\\BytecodeA.java (at line 115)\n" + " x [1] = (x = new Object[5]); // bad\n" + " ^\n" + "The local variable x may not have been initialized\n" + "----------\n" + "6. ERROR in p\\BytecodeA.java (at line 119)\n" + " } catch (java.io.IOException e) {\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" + "----------\n" ); } public void test086() { this.runNegativeTest( new String[] { "p/CC.java", "package p;\n" + "class CC {\n" + " abstract class a {} // no error\n" + "abstract void m(); // compile-time error \n" + "} ", }, "----------\n" + "1. ERROR in p\\CC.java (at line 4)\n" + " abstract void m(); // compile-time error \n" + " ^^^\n" + "The abstract method m in type CC can only be defined by an abstract class\n" + "----------\n" ); } public void test087() { this.runNegativeTest( new String[] { "p/CC6.java", "package p;\n" + "class CC6 {\n" + " abstract class a {} // no error\n" + " \n" + " abstract void m(); // compile-time error \n" + "} ", }, "----------\n" + "1. ERROR in p\\CC6.java (at line 5)\n" + " abstract void m(); // compile-time error \n" + " ^^^\n" + "The abstract method m in type CC6 can only be defined by an abstract class\n" + "----------\n" ); } public void test088() { this.runNegativeTest( new String[] { "p/Top3.java", "package p;\n" + "public class Top3 {\n" + " void foo() {\n" + " class In extends In {};\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\Top3.java (at line 4)\n" + " class In extends In {};\n" + " ^^\n" + "In causes a cycle - the type In cannot extend/implement itself or one of its own member types\n" + "----------\n" ); } public void test089() { this.runNegativeTest( new String[] { "p/Top4.java", "package p;\n" + "public class Top4 {\n" + " \n" + " void foo() {\n" + " class In extends In {};\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\Top4.java (at line 5)\n" + " class In extends In {};\n" + " ^^\n" + "In causes a cycle - the type In cannot extend/implement itself or one of its own member types\n" + "----------\n" ); } public void test090() { this.runNegativeTest( new String[] { "p/Top5.java", "package p;\n" + "public class Top5 {\n" + " \n" + " void foo() {\n" + " class In extends In {};\n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\Top5.java (at line 5)\n" + " class In extends In {};\n" + " ^^\n" + "In causes a cycle - the type In cannot extend/implement itself or one of its own member types\n" + "----------\n" ); } public void test091() { this.runNegativeTest( new String[] { "p/Top6.java", "package p;\n" + "public class Top6 {\n" + " void foo(){\n" + " class In extends In {};\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\Top6.java (at line 4)\n" + " class In extends In {};\n" + " ^^\n" + "In causes a cycle - the type In cannot extend/implement itself or one of its own member types\n" + "----------\n" ); } public void test092() { this.runNegativeTest( new String[] { "p/Toplevel12.java", "package p;\n" + "//passing a super instance to the super constructor\n" + "public class Toplevel12 {\n" + " Object local(){\n" + " class Package1 {\n" + " class Root {}\n" + " }\n" + " class Package2 {\n" + " class Sub extends Package1.Root {\n" + " Sub(){\n" + " new Package1().super();\n" + " } \n" + " }\n" + " }\n" + " return new Package2.Sub();\n" + " }\n" + " void local(){\n" + " class Package1 {\n" + " class Root {}\n" + " }\n" + " class Package2 {\n" + " class Sub extends Package1.Root {\n" + " Sub(){\n" + " new Package1().super();\n" + " } \n" + " }\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\Toplevel12.java (at line 4)\n" + " Object local(){\n" + " ^^^^^^^\n" + "Duplicate method local in type Toplevel12\n" + "----------\n" + "2. ERROR in p\\Toplevel12.java (at line 17)\n" + " void local(){\n" + " ^^^^^^^\n" + "Duplicate method local in type Toplevel12\n" + "----------\n" ); } public void test093() { this.runNegativeTest( new String[] { "p/Test.java", "package p;\n" + "class Test {\n" + " Object fred = new Runnable() {\n" + " public void run() { 1; }; \n" + " }; \n" + " class Bidule { \n" + " int foo();\n" + " void bar() { 1; }\n" + " } \n" + "/**\n" + " * This method was created by a SmartGuide.\n" + " */\n" + " int foo();\n" + " int foo2() {\n" + " new Object(){\n" + " void foo();\n" + " Object bar(){ \n" + " return new Object(){ public void run() { 1; };};}\n" + " };\n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\Test.java (at line 4)\n" + " public void run() { 1; }; \n" + " ^\n" + "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + "----------\n" + "2. ERROR in p\\Test.java (at line 7)\n" + " int foo();\n" + " ^^^^^\n" + "This method requires a body instead of a semicolon\n" + "----------\n" + "3. ERROR in p\\Test.java (at line 8)\n" + " void bar() { 1; }\n" + " ^\n" + "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + "----------\n" + "4. ERROR in p\\Test.java (at line 13)\n" + " int foo();\n" + " ^^^^^\n" + "This method requires a body instead of a semicolon\n" + "----------\n" + "5. ERROR in p\\Test.java (at line 18)\n" + " return new Object(){ public void run() { 1; };};}\n" + " ^\n" + "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + "----------\n" ); } public void test094() { this.runNegativeTest( new String[] { "p/Test1.java", "package p;\n" + "class test1 {\n" + "public static void main(String argv[]) {\n" + " class Local {\n" + " int boom() throws Exception {\n" + " throw new Exception();\n" + " }\n" + " }\n" + " final int i;\n" + " try {\n" + " i = new Local().boom();\n" + " } catch (Exception e) {\n" + " i = 2;\n" + " } finally {\n" + " i = 3;\n" + " }\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\Test1.java (at line 13)\n" + " i = 2;\n" + " ^\n" + "The final local variable i may already have been assigned\n" + "----------\n" + "2. ERROR in p\\Test1.java (at line 15)\n" + " i = 3;\n" + " ^\n" + "The final local variable i may already have been assigned\n" + "----------\n" ); } public void test095() { this.runNegativeTest( new String[] { "p/Test1x.java", "package p;\n" + "class Test1x {\n" + " int t = new Test1xHelp().x;\n" + " int foo() {}\n" + "}", }, "----------\n" + "1. ERROR in p\\Test1x.java (at line 3)\n" + " int t = new Test1xHelp().x;\n" + " ^^^^^^^^^^\n" + "Test1xHelp cannot be resolved or is not a type\n" + "----------\n" ); } public void test096() { this.runNegativeTest( new String[] { "p/TheSub.java", "package p;\n" + "public class TheSub {\n" + " int x;\n" + " class TheMember {};\n" + "void method () {\n" + " class SuperLocal extends TheSuper {}\n" + " class SubLocal extends SuperLokcal {}\n" + "}\n" + "void method2 () {\n" + " class SuperLocal {}\n" + " class MidLocal extends SuperLocal {}\n" + " class SubLocal extends MidLocal {}\n" + "}\n" + "void method3 () {\n" + " class SuperLocal extends TheMember {\n" + " int y = x; }\n" + " class MidLocal extends SuperLocal {}\n" + " class SubLocal extends MidLocal {}\n" + "}\n" + "void method4 () {\n" + " class SuperLocal extends TheMember {\n" + " Object o = TheSub.this; }\n" + " class MidLocal extends SuperLocal {}\n" + " class SubLocal extends MidLocal {}\n" + "}\n" + "void method5 () {\n" + " class SuperLocal extends TheMember {}\n" + " class MidLocal extends SuperLocal {}\n" + " class SubLocal extends MidLocal {}\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\TheSub.java (at line 6)\n" + " class SuperLocal extends TheSuper {}\n" + " ^^^^^^^^\n" + "TheSuper cannot be resolved or is not a valid superclass\n" + "----------\n" + "2. ERROR in p\\TheSub.java (at line 7)\n" + " class SubLocal extends SuperLokcal {}\n" + " ^^^^^^^^^^^\n" + "SuperLokcal cannot be resolved or is not a valid superclass\n" + "----------\n" ); } public void test097() { this.runNegativeTest( new String[] { "p/CheckBlankFinals1.java", "package p;\n" + "public class CheckBlankFinals1 {\n" + " static { // zork();\n" + " }\n" + "CheckBlankFinals1() {\n" + " char c = \'\\\'\'; \n" + "} \n" + " // checking for collision between final blank field inits amongst nested types\n" + " \n" + " void foo(){\n" + " class LocA {\n" + " final int a; // never initialized\n" + " class LocB {\n" + " final int b; \n" + " { b = 2; }\n" + " };\n" + " }; \n" + " } \n" + "public static void main(String argv[]) {\n" + " new CheckBlankFinals1().foo();\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\CheckBlankFinals1.java (at line 11)\n" + " class LocA {\n" + " ^^^^\n" + "The blank final field a may not have been initialized\n" + "----------\n" ); } public void test098() { this.runNegativeTest( new String[] { "p/CheckBlankFinals2.java", "package p;\n" + "public class CheckBlankFinals2 {\n" + " // checking for collision between final blank field inits amongst nested types\n" + " \n" + " void foo(){\n" + " class LocA {\n" + " final int a; // never initialized\n" + " class LocB {\n" + " final int b; // never initialized\n" + " };\n" + " }; \n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\CheckBlankFinals2.java (at line 6)\n" + " class LocA {\n" + " ^^^^\n" + "The blank final field a may not have been initialized\n" + "----------\n" + "2. ERROR in p\\CheckBlankFinals2.java (at line 8)\n" + " class LocB {\n" + " ^^^^\n" + "The blank final field b may not have been initialized\n" + "----------\n" ); } public void test099() { this.runNegativeTest( new String[] { "p/CheckBlankFinals3.java", "package p;\n" + "public class CheckBlankFinals3 {\n" + " class MemberA {\n" + " final int a; // never initialized\n" + " void foo() {\n" + " class MemberB {\n" + " final int b; \n" + " { b = 2; }\n" + " }\n" + " } \n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\CheckBlankFinals3.java (at line 3)\n" + " class MemberA {\n" + " ^^^^^^^\n" + "The blank final field a may not have been initialized\n" + "----------\n" ); } public void test100() { this.runNegativeTest( new String[] { "p/CheckBlankFinals4.java", "package p;\n" + "public class CheckBlankFinals4 {\n" + " void foo() {\n" + " final int i;\n" + " try { i = 1;}\n" + " finally { i = 2; };\n" + " } \n" + " void foo1() {\n" + " final int i;\n" + " try { System.out.println(\"hello\"); }\n" + " catch(Exception e) { i = 1; }\n" + " finally { i = 2; };\n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\CheckBlankFinals4.java (at line 6)\n" + " finally { i = 2; };\n" + " ^\n" + "The final local variable i may already have been assigned\n" + "----------\n" + "2. ERROR in p\\CheckBlankFinals4.java (at line 12)\n" + " finally { i = 2; };\n" + " ^\n" + "The final local variable i may already have been assigned\n" + "----------\n" ); } public void test101() { this.runNegativeTest( new String[] { "p/CheckLabels.java", "package p;\n" + "/*\n" + " Beginning with version 1.2 Beta 3, the compiler properly detects duplicate, \n" + " nested labels. These are disallowed by the JLS. This is a fix for\n" + " bug 1241001. This fix makes the following example statement illegal: \n" + "*/\n" + "public class CheckLabels {\n" + " {\n" + " i: int i; // local variable declaration may not follow a statement label\n" + " }\n" + " void foo(boolean condition, boolean condition2){\n" + " sameName:\n" + " while (condition) {\n" + " sameName:\n" + " while (condition2) {\n" + " break sameName;\n" + " }\n" + " }\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\CheckLabels.java (at line 9)\n" + " i: int i; // local variable declaration may not follow a statement label\n" + " ^\n" + "Syntax error on token \":\", EmptyStatement expected after this token\n" + "----------\n" ); } public void test102() { this.runNegativeTest( new String[] { "p/Chk.java", "package p;\n" + "class Chk{\n" + " int d;\n" + " static void chkIntVal(String msg1, String msg2, int val1, int val2){\n" + " if (val1 != val2)\n" + " System.out.println(msg1 + \" - wrong value for \" + msg2 + \"expecting \" + val2 + \" instead of \" + val1);\n" + " }\n" + "static void endTest(String msg1) {\n" + " System.out.println(msg1 + \" completed\");\n" + "}\n" + "int foo(){\n" + " return Chk.foo();\n" + "} \n" + "}", }, "----------\n" + "1. ERROR in p\\Chk.java (at line 12)\n" + " return Chk.foo();\n" + " ^^^^^^^^^\n" + "The method foo() from the type Chk is not static\n" + "----------\n" ); } public void test103() { this.runNegativeTest( new String[] { "p/FC.java", "package p;\n" + "/**\n" + " * 1FL0KQH\n" + " */\n" + "import java.io.PrintStream;\n" + "class FC_SomeClass {\n" + " static class In {\n" + " int in = 3;\n" + " }\n" + " public static int i;\n" + "}\n" + "public class FC {\n" + " public static void main(String args[]) {\n" + " System.exit(run(args, System.out) + 95);\n" + " }\n" + " public static int run(String args[], PrintStream out) {\n" + " FC_SomeClass s = new FC_SomeClass();\n" + " FC_SomeClass.In x = s.new In();\n" + " return 0;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\FC.java (at line 18)\n" + " FC_SomeClass.In x = s.new In();\n" + " ^\n" + "Illegal enclosing instance specification for type FC_SomeClass.In\n" + "----------\n" ); } public void test104() { this.runNegativeTest( new String[] { "p/G.java", "package p;\n" + "class G {\n" + " final int x;\n" + " static class BMember {\n" + " int bar(){ return foo(); }\n" + " }\n" + " G(B b, int i){\n" + " this.x = i; \n" + " } \n" + " int foo(){ return 1;}\n" + "}", "p/B.java", "package p;\n" + "class B{\n" + " int f(){\n" + " final int i;" + " i = 1;\n" + " if (false) i = 2;\n" + " return i;\n" + " }\n" + " int g(){\n" + " int i; \n" + " if(true) i = 1;\n" + " return i; \n" + " }\n" + " int h(){\n" + " if(true) return 1;\n" + " return 2;\n" + " return 3;\n" + " } \n" + " int i(){\n" + " if(false) ; else return 1;\n" + " return 2;\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\G.java (at line 5)\n" + " int bar(){ return foo(); }\n" + " ^^^\n" + "The method foo() from the type G.BMember is not static\n" + "----------\n" + "----------\n" + "1. ERROR in p\\B.java (at line 16)\n" + " return 3;\n" + " ^^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); } public void test105() { this.runNegativeTest( new String[] { "p/GC.java", "package p;\n" + "/**\n" + " * 1FL0KQH\n" + " */\n" + "public class GC {\n" + " static class GC_B {}\n" + " {\n" + " new GC().new GC_B();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\GC.java (at line 8)\n" + " new GC().new GC_B();\n" + " ^^^^^^^^\n" + "Illegal enclosing instance specification for type GC.GC_B\n" + "----------\n" ); } public void test106() { this.runNegativeTest( new String[] { "p/IC.java", "package p;\n" + "/**\n" + " * 1FMXEGJ\n" + " */\n" + "public class mIC {\n" + " public static void main(){\n" + " public Object myObject = new Object();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\IC.java (at line 5)\n" + " public class mIC {\n" + " ^^^\n" + "The public type mIC must be defined in its own file\n" + "----------\n" ); } public void test107() { this.runNegativeTest( new String[] { "p/I1.java", "package p;\n" + "interface I1 {\n" + " public int x;\n" + " void f();\n" + "} ", }, "----------\n" + "1. ERROR in p\\I1.java (at line 3)\n" + " public int x;\n" + " ^\n" + "The blank final field x may not have been initialized\n" + "----------\n" ); } public void test108() { this.runNegativeTest( new String[] { "p/QA.java", "package p;\n" + "/**\n" + " * 1FLZVYG\n" + " */\n" + "public class QA {\n" + " public void method1(){\n" + " char c = \'character\';\n" + " // ^~^ Invalid character constant\n" + " }\n" + " public void method2(){\n" + " String c = \"xxxxx\\u123xxxxx\";\n" + " // ^~~~~~~~~~~~~~~~~^ Invalid unicode\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\QA.java (at line 7)\n" + " char c = \'character\';\n" + " ^^^^^^^^^^^\n" + "Invalid character constant\n" + "----------\n" + "2. ERROR in p\\QA.java (at line 11)\n" + " String c = \"xxxxx\\u123xxxxx\";\n" + " ^^^^^^\n" + "Invalid unicode\n" + "----------\n" ); } public void test110() { this.runNegativeTest( new String[] { "p/S.java", "package p;\n" + "/**\n" + " * 1PQM7XM\n" + " */\n" + "public class S {\n" + " S(Object z) {\n" + " }\n" + " S() {\n" + " this(bar());\n" + " }\n" + " Object bar() {\n" + " return null;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\S.java (at line 9)\n" + " this(bar());\n" + " ^^^\n" + "Cannot refer to an instance method while explicitly invoking a constructor\n" + "----------\n" ); } public void test111() { this.runNegativeTest( new String[] { "p/StaticMemberBug.java", "package p;\n" + "public class StaticMemberBug{\n" + " \n" + " static class Member{};\n" + " \n" + " static void main(String argv[]) {\n" + " new StaticMemberBug().new Member();\n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\StaticMemberBug.java (at line 7)\n" + " new StaticMemberBug().new Member();\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "Illegal enclosing instance specification for type StaticMemberBug.Member\n" + "----------\n" ); } public void test112() { this.runNegativeTest( new String[] { "p/SuperInitBug.java", "package p;\n" + "class SuperInitBug {\n" + " static class S {\n" + " void hi() { System.out.println(\"You shouldn\'t see this message\"); }\n" + " S() { hi(); }\n" + " }\n" + " static class T {\n" + " void greet() { System.out.println(\"You won\'t see this either.\"); }\n" + " class N extends S {\n" + " void hi() {\n" + " T.this.greet(); //throws a NullPointerException!!\n" + " }\n" + " }\n" + " }\n" + " \n" + " public static void main(String av[]) { new T().new N(); } \n" + " void testmethod() {\n" + " class Inner {}; \n" + " try { \n" + " class Inner {};\n" + " Object x = new Inner();\n" + " }\n" + " finally {};\n" + " Object y = new Inner();\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\SuperInitBug.java (at line 20)\n" + " class Inner {};\n" + " ^^^^^\n" + "Duplicate nested type Inner\n" + "----------\n" ); } public void test113() { this.runNegativeTest( new String[] { "p/T.java", "package p;\n" + "class T{\n" + "T(){\n" + " System.out.super();\n" + "} \n" + "} ", }, "----------\n" + "1. ERROR in p\\T.java (at line 4)\n" + " System.out.super();\n" + " ^^^^^^^^^^\n" + "Illegal enclosing instance specification for type Object\n" + "----------\n" ); } public void test114() { this.runNegativeTest( new String[] { "p/Outer12.java", "package p;\n" + "class Outer12 {\n" + " \n" + " void f() {\n" + " final int count;\n" + " class Local {\n" + " void g() {\n" + " class Local2 {\n" + " int n = count + count; // another compiler rejects\n" + " } \n" + " //Local2 l2 = new Local2();\n" + " } \n" + " }\n" + " //count = 10; \n" + " Local l = new Local(); \n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\Outer12.java (at line 9)\n" + " int n = count + count; // another compiler rejects\n" + " ^^^^^\n" + "The local variable count may not have been initialized\n" + "----------\n" + "2. ERROR in p\\Outer12.java (at line 9)\n" + " int n = count + count; // another compiler rejects\n" + " ^^^^^\n" + "The local variable count may not have been initialized\n" + "----------\n" ); } public void test115() { this.runNegativeTest( new String[] { "p/P.java", "package p;\n" + "public class P {\n" + " INonExistingType fField;\n" + "}", }, "----------\n" + "1. ERROR in p\\P.java (at line 3)\n" + " INonExistingType fField;\n" + " ^^^^^^^^^^^^^^^^\n" + "INonExistingType cannot be resolved (or is not a valid type) for the field P.fField\n" + "----------\n" ); } public void test116() { this.runNegativeTest( new String[] { "p/Protected.java", "package p;\n" + "public class Protected {\n" + " public static void main(String args[]) {\n" + " Object o = new Object();\n" + " try {\n" + " // fixed - should give an error\n" + " //o.finalize();\n" + " // broken - should also give an error\n" + " ((java.io.Serializable)o).finalize();\n" + " } catch (Throwable e) {}\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\Protected.java (at line 9)\n" + " ((java.io.Serializable)o).finalize();\n" + " ^^^^^^^^\n" + "The method finalize() from the type Object is not visible\n" + "----------\n" ); } public void test117() { this.runNegativeTest( new String[] { "p/Q.java", "package p;\n" + "public class Q {\n" + " public int f()\n" + " {\n" + " int f =10;\n" + " return (f);\n" + " }\n" + " \n" + " public void f1()\n" + " {\n" + " ++ f() ;// error: f() cannot be the left-hand operand.\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\Q.java (at line 11)\n" + " ++ f() ;// error: f() cannot be the left-hand operand.\n" + " ^^^\n" + "Invalid argument to operation ++/--\n" + "----------\n" ); } public void test118() { this.runNegativeTest( new String[] { "p/EC.java", "package p;\n" + "/**\n" + " * 1FL0L3V\n" + " */\n" + "class EC_A {\n" + " static class EC_B {} \n" + " {\n" + " new EC_A().new EC_B();\n" + " }\n" + "}\n" + "class EC_X {\n" + " static class EC_Y {}\n" + "}\n" + "class EC_T {\n" + " class EC_U extends EC_X.EC_Y {\n" + " EC_U(){\n" + " new EC_X().super(); // no need for enclosing instance.\n" + " }\n" + " }\n" + "}\n" + "class EC_V {\n" + " EC_V() {\n" + " System.out.super(); \n" + " // \"System.out\" cannot be the \'enclosing instance\' for an instance of T\'s superclass (Object)\n" + " }\n" + "}\n" + "public class EC {\n" + " int x;\n" + " static void foo(){\n" + " class EC_L {\n" + " class EC_M {\n" + " }\n" + " };\n" + " new EC_L.EC_M(); // should be fine ? - no\n" + " }\n" + "} ", }, "----------\n" + "1. ERROR in p\\EC.java (at line 8)\n" + " new EC_A().new EC_B();\n" + " ^^^^^^^^^^\n" + "Illegal enclosing instance specification for type EC_A.EC_B\n" + "----------\n" + "2. ERROR in p\\EC.java (at line 17)\n" + " new EC_X().super(); // no need for enclosing instance.\n" + " ^^^^^^^^^^\n" + "Illegal enclosing instance specification for type EC_X.EC_Y\n" + "----------\n" + "3. ERROR in p\\EC.java (at line 23)\n" + " System.out.super(); \n" + " ^^^^^^^^^^\n" + "Illegal enclosing instance specification for type Object\n" + "----------\n" + "4. ERROR in p\\EC.java (at line 34)\n" + " new EC_L.EC_M(); // should be fine ? - no\n" + " ^^^^^^^^^^^^^^^\n" + "No enclosing instance of type EC_L is accessible. Must qualify the allocation with an enclosing instance of type EC_L (e.g. x.new A() where x is an instance of EC_L).\n" + "----------\n" ); } public void test119() { this.runNegativeTest( new String[] { "p/Example1.java", "package p;\n" + "// Double-assignment of final variables, though illegal, would pass previous compilers in some circumstances. For example, the following two\n" + "// samples would pass 1.1.x compilers, even though both involve double-assignment of a final variable: \n" + " public class Example1 {\n" + " \n" + " public static void main(String[] argv) {\n" + " int k=0;\n" + " for (final int a;;) {\n" + " k++;\n" + " a=k;\n" + " System.out.println(\"a=\"+a);\n" + " if (k>3)\n" + " return;\n" + " }\n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\Example1.java (at line 10)\n" + " a=k;\n" + " ^\n" + "The final local variable a may already have been assigned\n" + "----------\n" ); } public void test120() { this.runNegativeTest( new String[] { "p/Example2.java", "package p;\n" + "// Double-assignment of final variables, though illegal, would pass previous compilers in some circumstances. For example, the following two\n" + "// samples would pass 1.1.x compilers, even though both involve double-assignment of a final variable: \n" + "public class Example2\n" + " {\n" + " final int k;\n" + " \n" + " Example2() {\n" + " k = 1;\n" + " } \n" + " Example2(Object whatever) {\n" + " this();\n" + " k = 2;\n" + " } \n" + " static public void main(String[] args) {\n" + " Example2 t = new Example2(null);\n" + " System.out.println(\"k is \"+ t.k);\n" + " } \n" + "} ", }, "----------\n" + "1. ERROR in p\\Example2.java (at line 13)\n" + " k = 2;\n" + " ^\n" + "The final field k may already have been assigned\n" + "----------\n" ); } public void test121() { this.runNegativeTest( new String[] { "p/Example3.java", "package p;\n" + "// In version 1.2, an assignment expression is not accepted as the third \n" + "// subexpression of a conditional statement. For example, the statement \n" + "// myVal = condition ? x = 7 : x = 3;\n" + "// will cause a parse error in 1.2. If this problem occurs in existing code, \n" + "// placing the offending assignment expression in parentheses will cause\n" + "// the code to compile as it did in previous versions of the Java Development Kit: \n" + "public class Example3 {\n" + " void foo(int x) {\n" + " int myVal = condition ? x = 7 : x = 3;\n" + " }\n" + " void foo(int x, boolean condition) {\n" + " int myVal = condition ? x = 7 : (x = 3);\n" + " }\n" + "} ", }, "----------\n" + "1. ERROR in p\\Example3.java (at line 10)\n" + " int myVal = condition ? x = 7 : x = 3;\n" + " ^\n" + "Syntax error on token \"=\", != expected\n" + "----------\n" ); } public void test122() { this.runNegativeTest( new String[] { "p/Excep.java", "package p;\n" + "//import java.io.*;\n" + "public class Excep {\n" + " public Excep() throws IOException {\n" + " super();\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\Excep.java (at line 4)\n" + " public Excep() throws IOException {\n" + " ^^^^^^^^^^^\n" + "IOException cannot be resolved (or is not an exception type) for the method Excep\n" + "----------\n" ); } public void test123() { this.runNegativeTest( new String[] { "p/F.java", "package p;\n" + "class F {\n" + " \n" + " void f () {\n" + " while (true) {\n" + " class Inner {\n" + " { if (true) break; }\n" + " }\n" + " new Inner();\n" + " }\n" + " } \n" + "void foo(){\n" + " for (int i = 0; i < 10; ++i) int j1; // illegal\n" + " \n" + " while (1 == 2) int j2; // illegal\n" + " \n" + " do int j3; // illegal\n" + " while (false);\n" + "}\n" + "} ", }, "----------\n" + "1. ERROR in p\\F.java (at line 7)\n" + " { if (true) break; }\n" + " ^^^^^\n" + "break cannot be used outside of a loop or a switch\n" + "----------\n" + "2. ERROR in p\\F.java (at line 13)\n" + " for (int i = 0; i < 10; ++i) int j1; // illegal\n" + " ^\n" + "Syntax error on token \")\", { expected after this token\n" + "----------\n" + "3. ERROR in p\\F.java (at line 15)\n" + " while (1 == 2) int j2; // illegal\n" + " ^\n" + "Syntax error on token \")\", { expected after this token\n" + "----------\n" + "4. ERROR in p\\F.java (at line 17)\n" + " do int j3; // illegal\n" + " ^^\n" + "Syntax error on token \"do\", { expected after this token\n" + "----------\n" + "5. ERROR in p\\F.java (at line 18)\n" + " while (false);\n" + " ^\n" + "Syntax error, insert \"}\" to complete Block\n" + "----------\n" + "6. ERROR in p\\F.java (at line 18)\n" + " while (false);\n" + " ^\n" + "Syntax error, insert \"}\" to complete Block\n" + "----------\n" + "7. ERROR in p\\F.java (at line 18)\n" + " while (false);\n" + " ^\n" + "Syntax error, insert \"}\" to complete Block\n" + "----------\n" + "8. ERROR in p\\F.java (at line 18)\n" + " while (false);\n" + " ^\n" + "Syntax error, insert \"while ( Expression ) ;\" to complete DoStatement\n" + "----------\n" ); } public void test125() { this.runNegativeTest( new String[] { "p/N.java", "package p;\n" + "public class N {\n" + " public void foo() {\n" + " int[2] = 3; // Syntax Error!!!\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\N.java (at line 4)\n" + " int[2] = 3; // Syntax Error!!!\n" + " ^^^\n" + "Syntax error on token \"int\", invalid Expression\n" + "----------\n" ); } public void test126() { this.runNegativeTest( new String[] { "p/NA.java", "package p;\n" + "/**\n" + " * 1FL11OL\n" + " */\n" + "public class NA {\n" + " public static void main(String[] args) {\n" + " (new Class1).run();\n" + " (new Class2).run();\n" + " (new Class3).run();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\NA.java (at line 7)\n" + " (new Class1).run();\n" + " ^^^\n" + "Syntax error on token \"new\", delete this token\n" + "----------\n" + "2. ERROR in p\\NA.java (at line 8)\n" + " (new Class2).run();\n" + " ^^^\n" + "Syntax error on token \"new\", delete this token\n" + "----------\n" + "3. ERROR in p\\NA.java (at line 9)\n" + " (new Class3).run();\n" + " ^^^\n" + "Syntax error on token \"new\", delete this token\n" + "----------\n" ); } public void test127() { this.runNegativeTest(new String[] { "p/New.java", "package p;\n" + "import java.awt.*;\n" + " public class New extends New\n" + " {\n" + " \n" + " public New(String t)\n" + " {\n" + " super(t);\n" + " } \n" + "} ", }, "----------\n" + "1. WARNING in p\\New.java (at line 2)\n" + " import java.awt.*;\n" + " ^^^^^^^^\n" + "The import java.awt is never used\n" + "----------\n" + "2. ERROR in p\\New.java (at line 3)\n" + " public class New extends New\n" + " ^^^\n" + "New causes a cycle - the type New cannot extend/implement itself or one of its own member types\n" + "----------\n" + "3. ERROR in p\\New.java (at line 8)\n" + " super(t);\n" + " ^^^^^^^^\n" + "The constructor Object(String) is undefined\n" + "----------\n" ); } public void test128() { this.runNegativeTest( new String[] { "p/O.java", "package p;\n" + "public class O {\n" + " void foo() {\n" + " System.out.println(Object.FOO);\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\O.java (at line 4)\n" + " System.out.println(Object.FOO);\n" + " ^^^^^^^^^^\n" + "Object.FOO cannot be resolved\n" + "----------\n" ); } public void test129() { this.runNegativeTest( new String[] { "p/Outer1.java", "package p;\n" + "public class Outer1 {\n" + " void[] field = {};\n" + " void field2;\n" + "Outer1(void [] x){\n" + " Zork z;}\n" + " int foo(void [] args){\n" + " //new Object(){ void[] xx;};\n" + " return args.lengths;} \n" + " int foo1(/*void [] args*/){\n" + " new Object(){ void[] xx;};\n" + " return args.lengths;} \n" + " int foo1(void [] args){\n" + " new Object(){ void[] xx;};\n" + " return args.lengths;} \n" + "}", }, "----------\n" + "1. ERROR in p\\Outer1.java (at line 3)\n" + " void[] field = {};\n" + " ^^^^^\n" + "An array of void is an invalid type for the variable field\n" + "----------\n" + "2. ERROR in p\\Outer1.java (at line 4)\n" + " void field2;\n" + " ^^^^^^\n" + "void is an invalid type for the variable field2\n" + "----------\n" + "3. ERROR in p\\Outer1.java (at line 5)\n" + " Outer1(void [] x){\n" + " ^^^^^^^^^^^^^^^^^\n" + "An array of void is an invalid type for the argument x of the method Outer1\n" + "----------\n" + "4. ERROR in p\\Outer1.java (at line 6)\n" + " Zork z;}\n" + " ^^^^\n" + "Zork cannot be resolved or is not a type\n" + "----------\n" + "5. ERROR in p\\Outer1.java (at line 7)\n" + " int foo(void [] args){\n" + " ^^^^^^^^^^^^^^^^^\n" + "An array of void is an invalid type for the argument args of the method foo\n" + "----------\n" + "6. ERROR in p\\Outer1.java (at line 11)\n" + " new Object(){ void[] xx;};\n" + " ^^\n" + "An array of void is an invalid type for the variable xx\n" + "----------\n" + "7. ERROR in p\\Outer1.java (at line 12)\n" + " return args.lengths;} \n" + " ^^^^\n" + "args cannot be resolved\n" + "----------\n" + "8. ERROR in p\\Outer1.java (at line 13)\n" + " int foo1(void [] args){\n" + " ^^^^^^^^^^^^^^^^^^\n" + "An array of void is an invalid type for the argument args of the method foo1\n" + "----------\n" + "9. ERROR in p\\Outer1.java (at line 14)\n" + " new Object(){ void[] xx;};\n" + " ^^\n" + "An array of void is an invalid type for the variable xx\n" + "----------\n"); } public void test130() { this.runNegativeTest( new String[] { "p/AJ.java", "package p;\n" + "/**\n" + " * 1PQM35L\n" + " */\n" + "public class AJ {\n" + " char c = \'\\u000D\'; // This is an errouneous unicode escape character.\n" + "}", }, "----------\n" + "1. ERROR in p\\AJ.java (at line 6)\n" + " char c = \'\\u000D\'; // This is an errouneous unicode escape character.\n" + " ^^^^^^^^\n" + "Invalid character constant\n" + "----------\n" ); } public void test131() { this.runNegativeTest( new String[] { "p/AK.java", "package p;\n" + "/**\n" + " * 1PQM23Q\n" + " */\n" + "public class AK {\n" + " Object o = null.o; // \"The field null.o is undefined\"\n" + " Object oo = (1).o;\n" + " Object ooo = null.toString(); // \"Cannot send toString to the primitve type null\"\n" + "}", }, "----------\n" + "1. ERROR in p\\AK.java (at line 6)\n" + " Object o = null.o; // \"The field null.o is undefined\"\n" + " ^\n" + "o cannot be resolved or is not a field\n" + "----------\n" + "2. ERROR in p\\AK.java (at line 7)\n" + " Object oo = (1).o;\n" + " ^\n" + "o cannot be resolved or is not a field\n" + "----------\n" + "3. ERROR in p\\AK.java (at line 8)\n" + " Object ooo = null.toString(); // \"Cannot send toString to the primitve type null\"\n" + " ^^^^^^^^^^^^^^^\n" + "Cannot invoke toString() on the primitive type null\n" + "----------\n" ); } public void test132() { this.runNegativeTest( new String[] { "p/AJA.java", "package p;\n" + "/**\n" + " * 1FHISJJ\n" + " */\n" + "public class AJA {\n" + " void foo() {\n" + " Object item = new String() {\n" + " public boolean equals() {\n" + " return false;\n" + " }\n" + " }.;\n" + " item.\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AJA.java (at line 11)\n" + " }.;\n" + " ^\n" + "Syntax error on token \";\", delete this token\n" + "----------\n" + "2. ERROR in p\\AJA.java (at line 12)\n" + " item.\n" + " ^\n" + "Syntax error on token \".\", ; expected\n" + "----------\n" ); } public void test134() { this.runNegativeTest( new String[] { "p/AIA.java", "package p;\n" + "import java.io.*;\n" + "/**\n" + " * 1FF6F2L\n" + " */\n" + "public class AIA {\n" + " public static void main(java.lang.String[] args) {\n" + " File a = new File(\"c:\\abc.txt\");\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AIA.java (at line 8)\n" + " File a = new File(\"c:\\abc.txt\");\n" + " ^^^^^^^^^^^^\n" + "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\ )\n" + "----------\n" ); } public void test135() { this.runNegativeTest( new String[] { "p/AH.java", "package p;\n" + "/**\n" + " * 1PQNOKQ\n" + " */\n" + "public class AH {\n" + "void testmethod() {\n" + " final int local = 5;\n" + " class Inner {\n" + " int innervar = var;\n" + " private int innerprivatevar = 10;\n" + " int innermethod() {\n" + " return 1000;\n" + " }\n" + " };\n" + " Inner y = new Inner();\n" + " y.innermethod();\n" + " try {\n" + " class Inner extends Inner { // Wrong !\n" + " int inner2method() {\n" + " System.out.println(innermethod());\n" + " }\n" + " };\n" + " Inner x = new Inner();\n" + " x.inner2method();\n" + " }\n" + " finally {\n" + " };\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\AH.java (at line 9)\n" + " int innervar = var;\n" + " ^^^\n" + "var cannot be resolved\n" + "----------\n" + "2. ERROR in p\\AH.java (at line 18)\n" + " class Inner extends Inner { // Wrong !\n" + " ^^^^^\n" + "Duplicate nested type Inner\n" + "----------\n" + "3. ERROR in p\\AH.java (at line 24)\n" + " x.inner2method();\n" + " ^^^^^^^^^^^^\n" + "The method inner2method() is undefined for the type Inner\n" + "----------\n" ); } public void test136() { this.runNegativeTest( new String[] { "p1/p2/p3/X.java", "package p1.p2.p3;\n" + "public class X {\n" + " public static final Class TYPE = p1.p2.p4.Y.foo(\"F\");\n" + "}", }, "----------\n" + "1. ERROR in p1\\p2\\p3\\X.java (at line 3)\n" + " public static final Class TYPE = p1.p2.p4.Y.foo(\"F\");\n" + " ^^^^^^^^\n" + "p1.p2.p4 cannot be resolved\n" + "----------\n" ); } public void test138() { this.runNegativeTest( new String[] { "p/AGA.java", "package p;\n" + "/**\n" + " * 1FEXF2L\n" + " */\n" + "public class AGA {\n" + " public int method1() {\n" + " public class Local {\n" + " }\n" + " return 0;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AGA.java (at line 7)\n" + " public class Local {\n" + " ^^^^^\n" + "Illegal modifier for the local class Local; only one of abstract or final is permitted\n" + "----------\n" ); } public void test139() { this.runNegativeTest( new String[] { "p/AEA.java", "package p;\n" + "/**\n" + " * 1FFN9D3\n" + " */\n" + "public class AEA {\n" + " void aBar() {\n" + " }\n" + " class Temp {\n" + " void foobar() {\n" + " }\n" + " class HypeLocal {\n" + " }\n" + " int s;\n" + " }\n" + " class A {\n" + " void foo() {\n" + " }\n" + " }\n" + " void aFootoplevel() {\n" + " }\n" + " void aDuplicate() {\n" + " }\n" + " void topLevelMethod() {\n" + " Object aEnclosingVariable;\n" + " class TopLevelLocal {\n" + " void aFirst() {\n" + " }\n" + " void aSecond() {\n" + " int aInteger;\n" + " class Local {\n" + " void ThisIsADummyMethodThatIsCreatedOnlyForThePurposesOfTheCodeAssist() {\n" + " System.out.println(this.getClass());\n" + " }\n" + " void aDuplicate() {\n" + " }\n" + " void aLocalMethod() {\n" + " a TopLevelLocal.;\n" + " }\n" + " }\n" + " }\n" + " void aThird() {\n" + " }\n" + " }\n" + " TopLevelLocal temp;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AEA.java (at line 37)\n" + " a TopLevelLocal.;\n" + " ^\n" + "Syntax error on token \".\", delete this token\n" + "----------\n" ); } public void test141() { this.runNegativeTest( new String[] { "p/AFA.java", "package p;\n" + "/**\n" + " * 1PQM35L\n" + " */\n" + "public class AFA {\n" + " char c = \'\\u000D\'; // This is an errouneous unicode escape character.\n" + "}", }, "----------\n" + "1. ERROR in p\\AFA.java (at line 6)\n" + " char c = \'\\u000D\'; // This is an errouneous unicode escape character.\n" + " ^^^^^^^^\n" + "Invalid character constant\n" + "----------\n" ); } public void test142() { this.runNegativeTest( new String[] { "p/ABA.java", "package p;\n" + "/**\n" + " * 1FF84EI\n" + " */\n" + "public class ABA {\n" + " public static void main(String[] args) {\n" + " new Object() {\n" + " void foo() {\n" + " }\n" + " }[0] = null;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ABA.java (at line 7)\n" + " new Object() {\n" + " void foo() {\n" + " }\n" + " }[0] = null;\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The type of the expression must be an array type but it resolved to \n" + "----------\n" ); } public void test143() { this.runNegativeTest( new String[] { "p/ABB.java", "package p;\n" + "/**\n" + " * 1FI767R\n" + " */\n" + "public class ABB {\n" + " void foo() {\n" + " String name = \"\";\n" + " name.indexOf(\"\\\");\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ABB.java (at line 8)\n" + " name.indexOf(\"\\\");\n" + " }\n" + " ^^^^^^\n" + "String literal is not properly closed by a double-quote\n" + "----------\n" ); } public void test144() { this.runNegativeTest( new String[] { "p/AC.java", "package p;\n" + "/**\n" + " * 1F9T9IS\n" + " */\n" + "public class AC {\n" + " static class B {\n" + " static class C {\n" + " }\n" + " }\n" + " static {\n" + " new W().new B.C();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AC.java (at line 11)\n" + " new W().new B.C();\n" + " ^^^\n" + "Syntax error on token \"new\", delete this token\n" + "----------\n" ); } public void test145() { this.runNegativeTest( new String[] { "p/AA.java", "package p;\n" + "class AA {\n" + " class Member {\n" + " void bar() {\n" + " System.out.print(\"Perrier, c\'est \");\n" + " foo();\n" + " }\n" + " }\n" + "void bar(){\n" + " switch (java.awt.Label.RIGHT) {\n" + " case getLabel().RIGHT: {\n" + " // ^ can\'t have a method call in a case statement\n" + " System.out.println(\"Test\");\n" + " break;\n" + " }\n" + " }\n" + "}\n" + " \n" + "private void foo() {\n" + " System.out.println(\"foo!\");\n" + "}\n" + " public static java.awt.Label getLabel() {\n" + " return new java.awt.Label();\n" + " }\n" + "public static void main(String argv[]) {\n" + " new AA().new Member().bar();\n" + "}\n" + "}", }, "----------\n" + "1. WARNING in p\\AA.java (at line 6)\n" + " foo();\n" + " ^^^^^\n" + "Access to enclosing method foo() from the type AA is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "2. WARNING in p\\AA.java (at line 11)\n" + " case getLabel().RIGHT: {\n" + " ^^^^^\n" + "The static field Label.RIGHT should be accessed in a static way\n" + "----------\n" + "3. ERROR in p\\AA.java (at line 11)\n" + " case getLabel().RIGHT: {\n" + " ^^^^^\n" + "case expressions must be constant expressions\n" + "----------\n" ); } public void test146() { this.runNegativeTest( new String[] { "p/AAA.java", "package p;\n" + "public class AAA {\n" + "public int bar() {\n" + " if (true)\n" + " return 1;\n" + "}\n" + "public void foo() throws NullPointerException {\n" + " System.out.println(\"hello\");\n" + "}\n" + "/**\n" + " * This method was created in VisualAge.\n" + " * @param args java.lang.String[]\n" + " */\n" + "public static void main(String args[]) {\n" + " \n" + " new AAA().foo();\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\AAA.java (at line 3)\n" + " public int bar() {\n" + " ^^^^^\n" + "This method must return a result of type int\n" + "----------\n" ); } public void test147() { this.runNegativeTest( new String[] { "p/AAB.java", "package p;\n" + "public class AAB{\n" + "void bar(){\n" + " int i = 1;\n" + " int j = (i);\n" + " int k = 1/0;\n" + "} \n" + "void foo(){\n" + " try{\n" + " throw new Exception();\n" + " }\n" + " finally{ return; } // the exception will not be actually thrown\n" + "}\n" + " public static void main(String argv[]){\n" + " Object o = Error;\n" + " throw Error; \n" + " if(Boolean == null) return; \n" + " Object a = true ? Error : Error;\n" + " boolean b = ! Error;\n" + " } \n" + "public static int test() {\n" + " final int b;\n" + " do {\n" + " b = 3;\n" + " System.out.println(\"Hello WOrld\");\n" + " } while (false);\n" + " return 3;\n" + "} \n" + "public static int test2() {\n" + " final int b;\n" + " while (true) {\n" + " b = 3;\n" + " System.out.println(\"Hello WOrld\");\n" + " break;\n" + " }\n" + " return 3;\n" + "}\n" + "}", }, "----------\n" + "1. WARNING in p\\AAB.java (at line 12)\n" + " finally{ return; } // the exception will not be actually thrown\n" + " ^^^^^^^^^^^\n" + "finally block does not complete normally\n" + "----------\n" + "2. ERROR in p\\AAB.java (at line 15)\n" + " Object o = Error;\n" + " ^^^^^\n" + "Error cannot be resolved\n" + "----------\n" + "3. ERROR in p\\AAB.java (at line 16)\n" + " throw Error; \n" + " ^^^^^\n" + "Error cannot be resolved\n" + "----------\n" + "4. ERROR in p\\AAB.java (at line 17)\n" + " if(Boolean == null) return; \n" + " ^^^^^^^\n" + "Boolean cannot be resolved\n" + "----------\n" + "5. ERROR in p\\AAB.java (at line 18)\n" + " Object a = true ? Error : Error;\n" + " ^^^^^\n" + "Error cannot be resolved\n" + "----------\n" + "6. ERROR in p\\AAB.java (at line 18)\n" + " Object a = true ? Error : Error;\n" + " ^^^^^\n" + "Error cannot be resolved\n" + "----------\n" + "7. ERROR in p\\AAB.java (at line 19)\n" + " boolean b = ! Error;\n" + " ^^^^^\n" + "Error cannot be resolved\n" + "----------\n" ); } public void test149() { this.runNegativeTest( new String[] { "p/ACA.java", "package p;\n" + "/**\n" + " * 1FF6KW8\n" + " */\n" + "public class ACA {\n" + " void,\n" + " public static void foo() {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ACA.java (at line 6)\n" + " void,\n" + " ^^^^^\n" + "Syntax error on tokens, delete these tokens\n" + "----------\n" ); } public void test150() { this.runNegativeTest( new String[] { "p/AD.java", "package p;\n" + "/**\n" + " * 1PQGAU4\n" + " */\n" + "public class AD {\n" + " void foo() {\n" + " System.out.println(\"\") \n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AD.java (at line 7)\n" + " System.out.println(\"\") \n" + " ^\n" + "Syntax error, insert \";\" to complete BlockStatements\n" + "----------\n" ); } public void test151() { this.runNegativeTest( new String[] { "p/ADA.java", "package p;\n" + "/**\n" + " * 1PQM776\n" + " */\n" + "public class ADA {\n" + " static int i;\n" + " {\n" + " if (i > 10) return;\n" + " }\n" + " ADA() {\n" + " i = 10;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ADA.java (at line 8)\n" + " if (i > 10) return;\n" + " ^^^^^^\n" + "Cannot return from within an initializer\n" + "----------\n" ); } public void test153() { this.runNegativeTest( new String[] { "p/A3.java", "package p;\n" + "class A3 extends B {\n" + " void fee() {\n" + " C c = new C() {\n" + " void foo() {\n" + " B b = B.this;\n" + " }\n" + " };\n" + " }\n" + "}", "p/B.java", "package p;\n" + "class B{\n" + " int f(){\n" + " final int i;" + " i = 1;\n" + " if (false) i = 2;\n" + " return i;\n" + " }\n" + " int g(){\n" + " int i; \n" + " if(true) i = 1;\n" + " return i; \n" + " }\n" + " int h(){\n" + " if(true) return 1;\n" + " return 2;\n" + " return 3;\n" + " } \n" + " int i(){\n" + " if(false) ; else return 1;\n" + " return 2;\n" + " } \n" + "}", "p/C.java", "package p;\n" + "public class C {\n" + "void bar(int i){\n" + " class Local {\n" + " int x = i;\n" + " }\n" + "}\n" + " void foo(){\n" + " int k;\n" + " int n = 5;\n" + " if (n > 2) k = 3;\n" + " System.out.println(k); // k is not \"definitely assigned\" before this\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\A3.java (at line 6)\n" + " B b = B.this;\n" + " ^^^^^^\n" + "No enclosing instance of the type B is accessible in scope\n" + "----------\n" + "----------\n" + "1. ERROR in p\\B.java (at line 16)\n" + " return 3;\n" + " ^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "----------\n" + "1. ERROR in p\\C.java (at line 5)\n" + " int x = i;\n" + " ^\n" + "Cannot refer to a non-final variable i inside an inner class defined in a different method\n" + "----------\n" + "2. ERROR in p\\C.java (at line 12)\n" + " System.out.println(k); // k is not \"definitely assigned\" before this\n" + " ^\n" + "The local variable k may not have been initialized\n" + "----------\n" ); } public void test154() { this.runNegativeTest( new String[] { "p/A4.java", "package p;\n" + "class A4 {\n" + " void foo(){\n" + " new A().new B(){};\n" + " }\n" + "}", "p/A.java", "package p;\n" + "class A{\n" + "void bar() {\n" + " String s = \"\\u000D\";\n" + " String t = \"\\u000D\"; \n" + " String u = \"\\u000D\";\n" + "} \n" + "void f(){\n" + " final int x;\n" + " try {\n" + " x = 1;\n" + " mayThrowSomeException();\n" + " }\n" + " catch(Exception e) { x = 2; }\n" + " finally { x = 3; } \n" + "}\n" + "public void foo() {\n" + " try {\n" + " } catch (java.io.IOException e) {\n" + " System.out.println(e.getMessage());\n" + " e.printStackTrace();\n" + " }\n" + "}\n" + "public static void main(java.lang.String[] args) {\n" + " Thread t = new Thread() {\n" + " run() {}\n" + " };\n" + " t.start();\n" + "}\n" + "void mayThrowSomeException() {\n" + " throw new NullPointerException();\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\A4.java (at line 4)\n" + " new A().new B(){};\n" + " ^\n" + "A.B cannot be resolved or is not a type\n" + "----------\n" + "----------\n" + "1. ERROR in p\\A.java (at line 4)\n" + " String s = \"\\u000D\";\n" + " ^^^^^^^^\n" + "String literal is not properly closed by a double-quote\n" + "----------\n" + "2. ERROR in p\\A.java (at line 11)\n" + " catch(Exception e) { x = 2; }\n" + " ^\n" + "The final local variable x may already have been assigned\n" + "----------\n" + "3. ERROR in p\\A.java (at line 12)\n" + " finally { x = 3; } \n" + " ^\n" + "The final local variable x may already have been assigned\n" + "----------\n" + "4. ERROR in p\\A.java (at line 16)\n" + " } catch (java.io.IOException e) {\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" + "----------\n" + "5. ERROR in p\\A.java (at line 23)\n" + " run() {}\n" + " ^^^^^\n" + "Return type for the method is missing\n" + "----------\n" ); } public void test155() { this.runNegativeTest( new String[] { "p/A5.java", "package p;\n" + "/**\n" + " * 1F9WTED\n" + " */\n" + "public class A5 {\n" + " int foo() {\n" + " return;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\A5.java (at line 7)\n" + " return;\n" + " ^^^^^^\n" + "This method must return a result of type int\n" + "----------\n" ); } public void test156() { this.runNegativeTest( new String[] { "p/A6.java", "package p;\n" + "/**\n" + " * 1F9WS8K\n" + " */\n" + "public class A6 {\n" + " void f() {\n" + " int i;\n" + " \n" + " i = 1 ? 5 : 0; // error: cannot convert int to boolean\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\A6.java (at line 9)\n" + " i = 1 ? 5 : 0; // error: cannot convert int to boolean\n" + " ^\n" + "Type mismatch: cannot convert from int to boolean\n" + "----------\n" ); } public void test157() { this.runNegativeTest( new String[] { "p/A7.java", "package p;\n" + "/**\n" + " * 1F9WLDG\n" + " */\n" + "import java.io.*;\n" + "class Y extends Exception \n" + "{\n" + " void fn() throws Y\n" + " {\n" + " throw new Y();\n" + " }\n" + "}\n" + "public class A7 {\n" + " void func()\n" + " {\n" + " try\n" + " {\n" + " class A7 { } //error: inner class has the same simple name\n" + " new Y().fn();\n" + " }\n" + " \n" + " catch(Exception e) {}\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\A7.java (at line 5)\n" + " import java.io.*;\n" + " ^^^^^^^\n" + "The import java.io is never used\n" + "----------\n" + "2. ERROR in p\\A7.java (at line 18)\n" + " class A7 { } //error: inner class has the same simple name\n" + " ^^\n" + "Nested type A7 hides an enclosing type\n" + "----------\n" ); } public void test158() { this.runNegativeTest( new String[] { "p/A8.java", "package p;\n" + "/**\n" + " * 1FA4IYW\n" + " */\n" + "public class A8 {\n" + " INonExistingType fField;\n" + "}", }, "----------\n" + "1. ERROR in p\\A8.java (at line 6)\n" + " INonExistingType fField;\n" + " ^^^^^^^^^^^^^^^^\n" + "INonExistingType cannot be resolved (or is not a valid type) for the field A8.fField\n" + "----------\n" ); } public void test159() { this.runNegativeTest( new String[] { "p/A9.java", "package p;\n" + "/**\n" + " * 1FA4ETM\n" + " */\n" + " \n" + "class A9 {\n" + " public static void main(String[] args) {\n" + " System.out.println(Object.FOO); // error Object.FOO undefined\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\A9.java (at line 8)\n" + " System.out.println(Object.FOO); // error Object.FOO undefined\n" + " ^^^^^^^^^^\n" + "Object.FOO cannot be resolved\n" + "----------\n" ); } public void test161() { this.runNegativeTest( new String[] { "p/A11.java", "package p;\n" + "class A11{\n" + "void f(){\n" + " class B{\n" + " static {}\n" + " }\n" + "} \n" + "void g(){\n" + " final int b;\n" + " class A {\n" + " void f()\n" + " {\n" + " b=3; // B has not been definitely assigned!\n" + " }\n" + " };\n" + " //b = 1;\n" + " System.out.println(b);\n" + "} \n" + "}", }, "----------\n" + "1. ERROR in p\\A11.java (at line 5)\n" + " static {}\n" + " ^^\n" + "Cannot define static initializer in inner type B\n" + "----------\n" + "2. ERROR in p\\A11.java (at line 13)\n" + " b=3; // B has not been definitely assigned!\n" + " ^\n" + "The final local variable b cannot be assigned, since it is defined in an enclosing type\n" + "----------\n" + "3. ERROR in p\\A11.java (at line 17)\n" + " System.out.println(b);\n" + " ^\n" + "The local variable b may not have been initialized\n" + "----------\n" ); } public void test162() { this.runNegativeTest( new String[] { "p/A12.java", "package p;\n" + "/**\n" + " * 1F9WP5X\n" + " */\n" + "class A12 {\n" + " public int f() {\n" + " int f =10;\n" + " return (f);\n" + " }\n" + " public void f1() {\n" + " ++f() ;// error: f() cannot be the left-hand operand.\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\A12.java (at line 11)\n" + " ++f() ;// error: f() cannot be the left-hand operand.\n" + " ^^^\n" + "Invalid argument to operation ++/--\n" + "----------\n" ); } public void test163() { this.runNegativeTest( new String[] { "p/ACB.java", "package p;\n" + "/**\n" + " * 1FKPLNU\n" + " */\n" + "public class ACB {\n" + " byte[] b;\n" + " int foo(){\n" + " // }\n" + "}", }, "----------\n" + "1. ERROR in p\\ACB.java (at line 9)\n" + " }\n" + " ^\n" + "Syntax error, insert \"}\" to complete ClassBody\n" + "----------\n" ); } public void test164() { this.runNegativeTest( new String[] { "p/ADB.java", "package p;\n" + "/**\n" + " * 1FK7IGQ\n" + " */\n" + "public class ADB {\n" + " class M {\n" + " private int h = 1;\n" + " private int h() {return h;}\n" + " }\n" + " class N extends M {\n" + " int j = h() + h;\n" + " int k = super.h() + super.h;\n" + " int l = new M().h() + new M().h;\n" + " int foo(M m) {\n" + " return m.h() + m.h;\n" + " }\n" + " }\n" + " static class M2 {\n" + " private static int h = 1;\n" + " private static int h() {return h;}\n" + " }\n" + " class N2 {\n" + " int l = M2.h() + M2.h;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ADB.java (at line 11)\n" + " int j = h() + h;\n" + " ^\n" + "The method h() from the type ADB.M is not visible\n" + "----------\n" + "2. ERROR in p\\ADB.java (at line 11)\n" + " int j = h() + h;\n" + " ^\n" + "The field h is not visible\n" + "----------\n" + "3. WARNING in p\\ADB.java (at line 23)\n" + " int l = M2.h() + M2.h;\n" + " ^^^^^^\n" + "Access to enclosing method h() from the type ADB.M2 is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "4. WARNING in p\\ADB.java (at line 23)\n" + " int l = M2.h() + M2.h;\n" + " ^^^^\n" + "Read access to enclosing field ADB.M2.h is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" ); } public void test165() { this.runNegativeTest( new String[] { "p/AEB.java", "package p;\n" + "/**\n" + " * 1FJ9ST6\n" + " */\n" + "class AEB implements AEB.Constants {\n" + " private interface Constants {\n" + " int TOTO = 10;\n" + " }\n" + " public static void main(String args[]) {\n" + " System.out.println(TOTO);\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AEB.java (at line 5)\n" + " class AEB implements AEB.Constants {\n" + " ^^^^^^^^^^^^^\n" + "Constants causes a cycle - the type AEB cannot extend/implement itself or one of its own member types\n" + "----------\n" + "2. ERROR in p\\AEB.java (at line 10)\n" + " System.out.println(TOTO);\n" + " ^^^^\n" + "TOTO cannot be resolved\n" + "----------\n" ); } public void test166() { this.runNegativeTest( new String[] { "p/AFB.java", "package p;\n" + "/**\n" + " * 1FJ9ST6\n" + " */\n" + "class X implements p.X.I {\n" + " interface I {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AFB.java (at line 5)\n" + " class X implements p.X.I {\n" + " ^^^^^\n" + "I causes a cycle - the type X cannot extend/implement itself or one of its own member types\n" + "----------\n" ); } public void test167() { this.runNegativeTest( new String[] { "p/AGB.java", "package p;\n" + "/**\n" + " * 1FL10PF\n" + " */\n" + "public class AGB {\n" + " public static void main(String args[]) {\n" + " final int i;\n" + " while (true){\n" + " i = 0;\n" + " try {Thread.sleep(100);} catch (InterruptedException e) {}\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AGB.java (at line 9)\n" + " i = 0;\n" + " ^\n" + "The final local variable i may already have been assigned\n" + "----------\n" ); } public void test168() { this.runNegativeTest( new String[] { "p/AHB.java", "package p;\n" + "/**\n" + " * 1FL4TRG\n" + " */\n" + "public class AHB {\n" + " public void foo() {\n" + " final int i;\n" + " switch (1) {\n" + " case 1 :\n" + " i = 2;\n" + " break;\n" + " }\n" + " i = 3;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AHB.java (at line 13)\n" + " i = 3;\n" + " ^\n" + "The final local variable i may already have been assigned\n" + "----------\n" ); } public void test169() { this.runNegativeTest( new String[] { "p/AIB.java", "package p;\n" + "/**\n" + " * 1FL34A7\n" + " */\n" + "class AIB {\n" + " void foo() {\n" + " Zork z = null; // variable type does not exist\n" + " if (z != null){\n" + " z.zork();\n" + " return;\n" + " }\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\AIB.java (at line 7)\n" + " Zork z = null; // variable type does not exist\n" + " ^^^^\n" + "Zork cannot be resolved or is not a type\n" + "----------\n" ); } public void test170() { this.runNegativeTest( new String[] { "p/AJB.java", "package p;\n" + "/**\n" + " * 1FL34A7\n" + " */\n" + "class AJB {\n" + " void foo() {\n" + " Zork z = null;\n" + " if (z != null){\n" + " z.zork();\n" + " z.foo.bar.zork();\n" + " zork(z.foo);\n" + " return;\n" + " }\n" + " new Object(){\n" + " void bar(Zork x){\n" + " Object x = z;\n" + " }\n" + " };\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\AJB.java (at line 7)\n" + " Zork z = null;\n" + " ^^^^\n" + "Zork cannot be resolved or is not a type\n" + "----------\n" + "2. ERROR in p\\AJB.java (at line 15)\n" + " void bar(Zork x){\n" + " ^^^^\n" + "Zork cannot be resolved (or is not a valid type) for the argument x of the method bar\n" + "----------\n" + "3. ERROR in p\\AJB.java (at line 16)\n" + " Object x = z;\n" + " ^\n" + "Duplicate local variable x\n" + "----------\n" + "4. ERROR in p\\AJB.java (at line 16)\n" + " Object x = z;\n" + " ^\n" + "Cannot refer to a non-final variable z inside an inner class defined in a different method\n" + "----------\n"); } public void test171() { this.runNegativeTest( new String[] { "p/APA.java", "package p;\n" + "/**\n" + " * 1FJ618Z\n" + " */\n" + "public class APA extends MISSING {\n" + " MISSING foo() {\n" + " }\n" + " public static void main(String[] args) {\n" + " APA a = new APA();\n" + " System.out.println(a);\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\APA.java (at line 5)\n" + " public class APA extends MISSING {\n" + " ^^^^^^^\n" + "MISSING cannot be resolved or is not a valid superclass\n" + "----------\n" + "2. ERROR in p\\APA.java (at line 6)\n" + " MISSING foo() {\n" + " ^^^^^^^\n" + "MISSING cannot be resolved (or is not a valid return type) for the method foo\n" + "----------\n" ); } public void test172() { this.runNegativeTest( new String[] { "p/AUA.java", "package p;\n" + "/**\n" + " * 1FK6X3M\n" + " */\n" + "import missingPackage.KentTrouble;\n" + "public class AUA {\n" + " void m(KentTrouble param) {\n" + " KentTrouble a = new KentTrouble();\n" + " System.out.println(a);\n" + " System.out.println(param);\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AUA.java (at line 5)\n" + " import missingPackage.KentTrouble;\n" + " ^^^^^^^^^^^^^^\n" + "The import missingPackage cannot be resolved\n" + "----------\n" + "2. ERROR in p\\AUA.java (at line 7)\n" + " void m(KentTrouble param) {\n" + " ^^^^^^^^^^^\n" + "KentTrouble cannot be resolved (or is not a valid type) for the argument param of the method m\n" + "----------\n" + "3. ERROR in p\\AUA.java (at line 8)\n" + " KentTrouble a = new KentTrouble();\n" + " ^^^^^^^^^^^\n" + "KentTrouble cannot be resolved or is not a type\n" + "----------\n" + "4. ERROR in p\\AUA.java (at line 8)\n" + " KentTrouble a = new KentTrouble();\n" + " ^^^^^^^^^^^\n" + "KentTrouble cannot be resolved or is not a type\n" + "----------\n"); } public void test173() { this.runNegativeTest( new String[] { "p/AVA.java", "package p;\n" + "/**\n" + " * 1FIT5KH\n" + " */\n" + "import package x.y.z.*;\n" + "class A {\n" + "}", }, "----------\n" + "1. ERROR in p\\AVA.java (at line 5)\n" + " import package x.y.z.*;\n" + " ^^^^^^^\n" + "Syntax error on token \"package\", delete this token\n" + "----------\n" ); } public void test174() { this.runNegativeTest( new String[] { "p/AWA.java", "package p;\n" + "/**\n" + " * 1FKLX4Q\n" + " */\n" + "public class AWA {\n" + " private void static foo(int i, int j) {\n" + " }\n" + " static class B {\n" + " {\n" + " foo(1, 2);\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AWA.java (at line 6)\n" + " private void static foo(int i, int j) {\n" + " ^^^^\n" + "Syntax error on token \"void\", volatile expected\n" + "----------\n" + "2. ERROR in p\\AWA.java (at line 6)\n" + " private void static foo(int i, int j) {\n" + " ^^^^^^^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "3. ERROR in p\\AWA.java (at line 10)\n" + " foo(1, 2);\n" + " ^^^\n" + "The method foo(int, int) is undefined for the type AWA.B\n" + "----------\n" ); } public void test175() { this.runNegativeTest( new String[] { "p/AXB.java", "package java.lang.Object; // compile-time error, the same class exists\n" + "/**\n" + " * 1FM41K1\n" + " */\n" + "import java.io.PrintStream;\n" + "public class AXB { \n" + " public static void main(String argv[]) {\n" + " System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);\n" + " }\n" + " public static int run(String argv[], PrintStream out) {\n" + " out.println(\"failed\");\n" + " return 0/*STATUS_PASSED*/;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AXB.java (at line 1)\n" + " package java.lang.Object; // compile-time error, the same class exists\n" + " ^^^^^^^^^^^^^^^^\n" + "The package java.lang.Object collides with a type\n" + "----------\n" + "2. WARNING in p\\AXB.java (at line 5)\n" + " import java.io.PrintStream;\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The import java.io.PrintStream is never used\n" + "----------\n" ); } public void test176() { this.runNegativeTest( new String[] { "p/AKB.java", "package p;\n" + "/**\n" + " * 1FL36TJ\n" + " */\n" + "class AKB {\n" + " void foo() {\n" + " this.z.zork();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AKB.java (at line 7)\n" + " this.z.zork();\n" + " ^^^^^^\n" + "z cannot be resolved or is not a field\n" + "----------\n" ); } public void test177() { this.runNegativeTest( new String[] { "p/ALB.java", "package p;\n" + "/**\n" + " * 1FL4JVK\n" + " */\n" + "public class ALB {\n" + " public void m1(){\n" + " this.i = 1;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ALB.java (at line 7)\n" + " this.i = 1;\n" + " ^^^^^^\n" + "i cannot be resolved or is not a field\n" + "----------\n" ); } public void test178() { this.runNegativeTest( new String[] { "p/AP.java", "package p;\n" + "class AP {\n" + "static void f(){\n" + " boolean b3;\n" + " boolean f = false; \n" + " boolean t = false;\n" + " if ((f && (b3 = false)) == (t)) {\n" + " System.out.println(\"f = b3\");\n" + " f = b3; // VA does not complain, JDKs do\n" + " System.out.println(\"f = \" + f);\n" + " System.out.println(\"b3 = \" + b3);\n" + " }\n" + " System.out.println(f); \n" + "}\n" + "static void f1(){\n" + " boolean b3;\n" + " boolean f = false; \n" + " boolean t = false;\n" + " if ((f && (b3 = false)) == true) {\n" + " System.out.println(\"f = b3\");\n" + " f = b3; // VA does not complain, JDKs do\n" + " System.out.println(\"f = \" + f);\n" + " System.out.println(\"b3 = \" + b3);\n" + " }\n" + " System.out.println(f); \n" + "} \n" + "static void f2(){\n" + " boolean b3;\n" + " boolean f = false; \n" + " boolean t = false;\n" + " if ((f && (b3 = false)) == false) {\n" + " System.out.println(\"f = b3\");\n" + " f = b3; // VA does not complain, JDKs do\n" + " System.out.println(\"f = \" + f);\n" + " System.out.println(\"b3 = \" + b3);\n" + " }\n" + " System.out.println(f); \n" + "} \n" + "static void f3(){\n" + " boolean b3;\n" + " boolean f = false; \n" + " boolean t = false;\n" + " if (false == (f && (b3 = false))) {\n" + " System.out.println(\"f = b3\");\n" + " f = b3; // VA does not complain, JDKs do\n" + " System.out.println(\"f = \" + f);\n" + " System.out.println(\"b3 = \" + b3);\n" + " }\n" + " System.out.println(f); \n" + "} \n" + "static void f4(){\n" + " boolean b3;\n" + " boolean f = false; \n" + " boolean t = false;\n" + " if (true == (f && (b3 = false))) {\n" + " System.out.println(\"f = b3\");\n" + " f = b3; // VA does not complain, JDKs do\n" + " System.out.println(\"f = \" + f);\n" + " System.out.println(\"b3 = \" + b3);\n" + " }\n" + " System.out.println(f); \n" + "} \n" + "static void g(){ \n" + " boolean b3;\n" + " boolean f = false;\n" + " boolean t = true;\n" + " if ((t && (b3 = f)) == (f || (b3 = f))) {\n" + " System.out.println( \"f = b3\" );\n" + " f = b3; // VA does not complain, JDKs do\n" + " System.out.println( \"f = \" + f );\n" + " System.out.println( \"b3 = \" + b3 );\n" + " }\n" + " System.out.println( f );\n" + "} \n" + "public static void main(String argv[]){\n" + " f();\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\AP.java (at line 9)\n" + " f = b3; // VA does not complain, JDKs do\n" + " ^^\n" + "The local variable b3 may not have been initialized\n" + "----------\n" + "2. ERROR in p\\AP.java (at line 11)\n" + " System.out.println(\"b3 = \" + b3);\n" + " ^^\n" + "The local variable b3 may not have been initialized\n" + "----------\n" + "3. ERROR in p\\AP.java (at line 33)\n" + " f = b3; // VA does not complain, JDKs do\n" + " ^^\n" + "The local variable b3 may not have been initialized\n" + "----------\n" + "4. ERROR in p\\AP.java (at line 35)\n" + " System.out.println(\"b3 = \" + b3);\n" + " ^^\n" + "The local variable b3 may not have been initialized\n" + "----------\n" + "5. ERROR in p\\AP.java (at line 45)\n" + " f = b3; // VA does not complain, JDKs do\n" + " ^^\n" + "The local variable b3 may not have been initialized\n" + "----------\n" + "6. ERROR in p\\AP.java (at line 47)\n" + " System.out.println(\"b3 = \" + b3);\n" + " ^^\n" + "The local variable b3 may not have been initialized\n" + "----------\n" + "7. ERROR in p\\AP.java (at line 69)\n" + " f = b3; // VA does not complain, JDKs do\n" + " ^^\n" + "The local variable b3 may not have been initialized\n" + "----------\n" + "8. ERROR in p\\AP.java (at line 71)\n" + " System.out.println( \"b3 = \" + b3 );\n" + " ^^\n" + "The local variable b3 may not have been initialized\n" + "----------\n" ); } public void test179() { this.runNegativeTest( new String[] { "p/APB.java", "package p;\n" + "/**\n" + " * 1FKXKSC\n" + " */\n" + "public class APB {\n" + " int[] data;\n" + " \n" + " void foo() {\n" + " System.arraycopy(APB.data, 0, data, 0, 3);\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\APB.java (at line 9)\n" + " System.arraycopy(APB.data, 0, data, 0, 3);\n" + " ^^^^^^^^\n" + "Cannot make a static reference to the non-static field APB.data\n" + "----------\n" ); } public void test180() { this.runNegativeTest( new String[] { "p/AQB.java", "package p;\n" + "/**\n" + " * 1FLA6QP\n" + " */\n" + "class AQBHelper {\n" + " public void method1() {\n" + " }\n" + "}\n" + "public class AQB extends AQBHelper {\n" + " public static void method1() {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AQB.java (at line 10)\n" + " public static void method1() {\n" + " ^^^^^^^^^\n" + "This static method cannot hide the instance method from AQBHelper\n" + "----------\n" ); } public void test181() { this.runNegativeTest( new String[] { "p/ARB.java", "package p;\n" + "/**\n" + " * 1FL4VH5\n" + " */\n" + "public class ARB {\n" + " public void method1(int i, long j){\n" + " }\n" + " public class B {\n" + " public void method1(){\n" + " method1(1, 1); // Error is here\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ARB.java (at line 10)\n" + " method1(1, 1); // Error is here\n" + " ^^^^^^^\n" + "The method method1() in the type ARB.B is not applicable for the arguments (int, int)\n" + "----------\n" ); } public void test182() { this.runNegativeTest( new String[] { "p/ASB.java", "package p;\n" + "/**\n" + " * 1FLA8TI\n" + " */\n" + "class ASB {\n" + " int x;\n" + " static void foo(){\n" + " class L {\n" + " int l = ASB.this.x; // no enclosing instance of type X is available\n" + " };\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ASB.java (at line 9)\n" + " int l = ASB.this.x; // no enclosing instance of type X is available\n" + " ^^^^^^^^\n" + "No enclosing instance of the type ASB is accessible in scope\n" + "----------\n" ); } public void test183() { this.runNegativeTest( new String[] { "p/ATB.java", "package p;\n" + "/**\n" + " * 1FLHNKX\n" + " */\n" + "public class ATB {\n" + " void foo() {\n" + " if(true)\n" + " System.out.println(\"true\");\n" + " else\n" + " (System.out.println(\"true\"));\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ATB.java (at line 10)\n" + " (System.out.println(\"true\"));\n" + " ^\n" + "Syntax error, insert \"AssignmentOperator ArrayInitializer\" to complete Expression\n" + "----------\n" ); } public void test184() { this.runNegativeTest( new String[] { "p/AUB.java", "package p;\n" + "/**\n" + " * 1FLUJJG\n" + " */\n" + "public class AUB {\n" + " final int f1 = 1;\n" + " {\n" + " f1 = 1;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AUB.java (at line 8)\n" + " f1 = 1;\n" + " ^^\n" + "The final field AUB.f1 cannot be assigned. It must be blank in this context, not qualified and not in compound assignment\n" + "----------\n" ); } public void test185() { this.runNegativeTest( new String[] { "p/AVB.java", "package p;\n" + "/**\n" + " * 1FLUQPE\n" + " */\n" + "public class AVB {\n" + " public void method1(){\n" + " try {\n" + " }\n" + " catch(Exception e){\n" + " }\n" + " catch(java.io.IOException e){ // <-- Unreachable catch block\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AVB.java (at line 11)\n" + " catch(java.io.IOException e){ // <-- Unreachable catch block\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Unreachable catch block for IOException. It is already handled by the catch block for Exception\n" + "----------\n" ); } public void test186() { this.runNegativeTest( new String[] { "p/AX.java", "package p;\n" + "/**\n" + " * 1FEGPXG\n" + " */\n" + "public class AX {\n" + " public AX() {\n" + " }\n" + " public static void main(java.lang.String[] args) {\n" + " new AX();\n" + " }\n" + " public AX() {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\AX.java (at line 6)\n" + " public AX() {\n" + " ^^^^\n" + "Duplicate method AX in type AX\n" + "----------\n" + "2. ERROR in p\\AX.java (at line 9)\n" + " new AX();\n" + " ^^^^^^^^\n" + "The constructor AX() is undefined\n" + "----------\n" + "3. ERROR in p\\AX.java (at line 11)\n" + " public AX() {\n" + " ^^^^\n" + "Duplicate method AX in type AX\n" + "----------\n" ); } public void test187() { this.runNegativeTest( new String[] { "p/AYHelper.java", "package p;\n" + "/**\n" + " * 1FCSIO4\n" + " */\n" + "public class AYHelper {\n" + " void foo() {\n" + " new AY().foo();\n" + " }\n" + "}", "p/AY.java", "package p;\n" + "/**\n" + " * 1FCSIO4\n" + " */\n" + "public class AY {\n" + " /**\n" + " * @deprecated\n" + " */\n" + " public AY() {\n" + " }\n" + " /**\n" + " * Random comment.\n" + " */\n" + " public AY(int i) {\n" + " }\n" + " \n" + " /**\n" + " * @deprecated\n" + " */\n" + " void foo() {\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\AYHelper.java (at line 7)\n" + " new AY().foo();\n" + " ^^^^^^^^^^^^^^\n" + "The method foo() from the type AY is deprecated\n" + "----------\n" + "2. WARNING in p\\AYHelper.java (at line 7)\n" + " new AY().foo();\n" + " ^^^^^^^^\n" + "The constructor AY() is deprecated\n" + "----------\n" ); } public void test188() { this.runNegativeTest( new String[] { "p/AZA.java", "package p;\n" + "/**\n" + " * 1FKKCO4\n" + " */\n" + "public class AZA {\n" + " DeepObject deep= new DeepObject();\n" + " ObjectWithFields owf = new ObjectWithFields();\n" + " owf.initFields();\n" + " owf.fString = \"modified string\";\n" + " owf.initFields();\n" + " owf.fString = \"modified string again\";\n" + " owf.initFields();\n" + " owf.fString = \"the end\";\n" + "}", }, "----------\n" + "1. ERROR in p\\AZA.java (at line 6)\n" + " DeepObject deep= new DeepObject();\n" + " ^^^^^^^^^^\n" + "DeepObject cannot be resolved (or is not a valid type) for the field AZA.deep\n" + "----------\n" + "2. ERROR in p\\AZA.java (at line 6)\n" + " DeepObject deep= new DeepObject();\n" + " ^^^^^^^^^^\n" + "DeepObject cannot be resolved or is not a type\n" + "----------\n" + "3. ERROR in p\\AZA.java (at line 7)\n" + " ObjectWithFields owf = new ObjectWithFields();\n" + " ^^^^^^^^^^^^^^^^\n" + "ObjectWithFields cannot be resolved (or is not a valid type) for the field AZA.owf\n" + "----------\n" + "4. ERROR in p\\AZA.java (at line 7)\n" + " ObjectWithFields owf = new ObjectWithFields();\n" + " ^^^^^^^^^^^^^^^^\n" + "ObjectWithFields cannot be resolved or is not a type\n" + "----------\n" + "5. ERROR in p\\AZA.java (at line 8)\n" + " owf.initFields();\n" + " ^^^^^^^^^^\n" + "Syntax error on token \"initFields\", Identifier expected after this token\n" + "----------\n" + "6. ERROR in p\\AZA.java (at line 9)\n" + " owf.fString = \"modified string\";\n" + " ^^^^^^^\n" + "Syntax error on token \"fString\", VariableDeclaratorId expected after this token\n" + "----------\n" + "7. ERROR in p\\AZA.java (at line 10)\n" + " owf.initFields();\n" + " ^^^^^^^^^^\n" + "Syntax error on token \"initFields\", Identifier expected after this token\n" + "----------\n" + "8. ERROR in p\\AZA.java (at line 11)\n" + " owf.fString = \"modified string again\";\n" + " ^^^^^^^\n" + "Syntax error on token \"fString\", VariableDeclaratorId expected after this token\n" + "----------\n" + "9. ERROR in p\\AZA.java (at line 12)\n" + " owf.initFields();\n" + " ^^^^^^^^^^\n" + "Syntax error on token \"initFields\", Identifier expected after this token\n" + "----------\n" + "10. ERROR in p\\AZA.java (at line 13)\n" + " owf.fString = \"the end\";\n" + " ^^^^^^^\n" + "Syntax error on token \"fString\", VariableDeclaratorId expected after this token\n" + "----------\n" ); } public void test189() { this.runNegativeTest( new String[] { "p/B1.java", "package p;\n" + "class B1 {\n" + " { throw new Throwable(); }\n" + " { System.out.println(\"I\'m dead as a doornail!\"); } // ??\n" + " B1 () throws Throwable {}\n" + "}", }, "----------\n" + "1. ERROR in p\\B1.java (at line 3)\n" + " { throw new Throwable(); }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Initializer does not complete normally\n" + "----------\n" ); } public void test190() { this.runNegativeTest( new String[] { "p/BC.java", "package p;\n" + "/**\n" + " * 1FKXJGO\n" + " */\n" + "import java.io.PrintStream;\n" + "import java.lang.Runtime;\n" + " \n" + "class BC_a {\n" + " int result1=2;\n" + " BC_a(int arg1, int arg2) {\n" + " this(arg1);\n" + " int result1=arg2;\n" + " }\n" + " BC_a(int arg1) {\n" + " this(arg1,2);\n" + " }\n" + "}\n" + "public class BC {\n" + " public static void main(String argv[])\n" + " {\n" + " System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);\n" + " }\n" + " public static int run(String argv[],PrintStream out) {\n" + " BC_a x = new BC_a(666);\n" + " return 2;\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\BC.java (at line 6)\n" + " import java.lang.Runtime;\n" + " ^^^^^^^^^^^^^^^^^\n" + "The import java.lang.Runtime is never used\n" + "----------\n" + "2. ERROR in p\\BC.java (at line 11)\n" + " this(arg1);\n" + " ^^^^^^^^^^\n" + "Recursive constructor invocation BC_a(int)\n" + "----------\n" + "3. WARNING in p\\BC.java (at line 12)\n" + " int result1=arg2;\n" + " ^^^^^^^\n" + "The local variable result1 is hiding a field from type BC_a\n" + "----------\n" + "4. ERROR in p\\BC.java (at line 15)\n" + " this(arg1,2);\n" + " ^^^^^^^^^^^^\n" + "Recursive constructor invocation BC_a(int, int)\n" + "----------\n" ); } public void test193() { this.runNegativeTest( new String[] { "p/ZA.java", "package p;\n" + "class ZA{\n" + " class InnerMember{};\n" + " \n" + " ZA(Object o){\n" + " } \n" + " Object foo(Object o){\n" + " new Thread(String); \n" + " foo(Object); \n" + " Object [] oo = new Object[]{Object };\n" + " synchronized(Object){};\n" + " if (Object) {} else {};\n" + " while (Object){};\n" + " do {} while (Object);\n" + " o = (String)Object;\n" + " return Object;\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\ZA.java (at line 8)\n" + " new Thread(String); \n" + " ^^^^^^\n" + "String cannot be resolved\n" + "----------\n" + "2. ERROR in p\\ZA.java (at line 9)\n" + " foo(Object); \n" + " ^^^^^^\n" + "Object cannot be resolved\n" + "----------\n" + "3. ERROR in p\\ZA.java (at line 10)\n" + " Object [] oo = new Object[]{Object };\n" + " ^^^^^^\n" + "Object cannot be resolved\n" + "----------\n" + "4. ERROR in p\\ZA.java (at line 11)\n" + " synchronized(Object){};\n" + " ^^^^^^\n" + "Object cannot be resolved\n" + "----------\n" + "5. ERROR in p\\ZA.java (at line 12)\n" + " if (Object) {} else {};\n" + " ^^^^^^\n" + "Object cannot be resolved\n" + "----------\n" + "6. ERROR in p\\ZA.java (at line 13)\n" + " while (Object){};\n" + " ^^^^^^\n" + "Object cannot be resolved\n" + "----------\n" + "7. ERROR in p\\ZA.java (at line 14)\n" + " do {} while (Object);\n" + " ^^^^^^\n" + "Object cannot be resolved\n" + "----------\n" + "8. ERROR in p\\ZA.java (at line 15)\n" + " o = (String)Object;\n" + " ^^^^^^\n" + "Object cannot be resolved\n" + "----------\n" + "9. ERROR in p\\ZA.java (at line 16)\n" + " return Object;\n" + " ^^^^^^\n" + "Object cannot be resolved\n" + "----------\n" ); } public void test194() { this.runNegativeTest( new String[] { "p/X_1.java", "package p;\n" + "/* dena JTest Suite, Version 2.2, September 1997\n" + " * Copyright (c) 1995-1997 Modena Software (I) Pvt. Ltd., All Rights Reserved\n" + " */\n" + "/* Section : Inner classes \n" + " * FileName : ciner026.java\n" + " * Purpose : Positive test for Inner classes\n" + " * \n" + " * An anonymous class can have initializers but cannot have a constructor.\n" + " * The argument list of the associated new expression is implicitely \n" + " * passed to the constructor of the super class. \n" + " *\n" + " */\n" + " \n" + " class X_1 {\n" + " static int xx = 100;\n" + " //inner class Y \n" + " static class Y { \n" + " public int j = 0;\n" + " Y(int x){ j = x; }\n" + " } \n" + " public void call_inner()\n" + " {\n" + " int i = test_anonymous().j;\n" + " } \n" + " public static void main(String argv[])\n" + " {\n" + " X_1 ox = new X_1();\n" + " ox.call_inner(); \n" + " } \n" + "public void newMethod ( ) {\n" + " Float f1 = null;\n" + " f1=(f1==0.0)?1.0:f1;\n" + "}\n" + " static Y test_anonymous()\n" + " { \n" + " //anonymous implementation of class Y\n" + " return new Y(xx) //xx should be implicitely passed to Y()\n" + " {\n" + " }; \n" + " \n" + " } //end test_anonymous \n" + "} ", }, "----------\n" + "1. ERROR in p\\X_1.java (at line 33)\n" + " f1=(f1==0.0)?1.0:f1;\n" + " ^^^^^^^^^\n" + "Incompatible operand types Float and double\n" + "----------\n" ); } public void test195() { this.runNegativeTest( new String[] { "p/X1FW597H.java", "public class X1FW597H {\n" + " void foo(){\n" + " final int z1 = missing + 0; // WB\n" + " final int z2 = missing ? 0 : 1;\n" + " final int z3 = !missing; // WB\n" + " final int z4 = missing == 0;\n" + " final int z5 = missing.foo(0);\n" + " final int z6 = this.foo(missing);\n" + " final int z7 = zork().x; // WB\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X1FW597H.java (at line 3)\n" + " final int z1 = missing + 0; // WB\n" + " ^^^^^^^\n" + "missing cannot be resolved\n" + "----------\n" + "2. ERROR in p\\X1FW597H.java (at line 4)\n" + " final int z2 = missing ? 0 : 1;\n" + " ^^^^^^^\n" + "missing cannot be resolved\n" + "----------\n" + "3. ERROR in p\\X1FW597H.java (at line 5)\n" + " final int z3 = !missing; // WB\n" + " ^^^^^^^\n" + "missing cannot be resolved\n" + "----------\n" + "4. ERROR in p\\X1FW597H.java (at line 6)\n" + " final int z4 = missing == 0;\n" + " ^^^^^^^\n" + "missing cannot be resolved\n" + "----------\n" + "5. ERROR in p\\X1FW597H.java (at line 7)\n" + " final int z5 = missing.foo(0);\n" + " ^^^^^^^\n" + "missing cannot be resolved\n" + "----------\n" + "6. ERROR in p\\X1FW597H.java (at line 8)\n" + " final int z6 = this.foo(missing);\n" + " ^^^^^^^\n" + "missing cannot be resolved\n" + "----------\n" + "7. ERROR in p\\X1FW597H.java (at line 9)\n" + " final int z7 = zork().x; // WB\n" + " ^^^^\n" + "The method zork() is undefined for the type X1FW597H\n" + "----------\n" ); } public void test197() { this.runNegativeTest( new String[] { "p/BCil.java", "package p;\n" + "class BCil {\n" + " class InnerB1 {\n" + " static int i;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\BCil.java (at line 4)\n" + " static int i;\n" + " ^\n" + "The field i cannot be declared static; static fields can only be declared in static or top level types\n" + "----------\n" ); } public void test198() { this.runNegativeTest( new String[] { "p/DCBug.java", "package p;\n" + "public class DCBug {\n" + " \n" + " class Member {\n" + " Member() throws java.io.IOException {}\n" + " }\n" + " class SubMember extends Member {\n" + "// SubMember() {}\n" + " void foo(){ \n" + " try {\n" + " new SubMember();}\n" + " catch(java.io.IOException e){};\n" + " } \n" + " }\n" + "private static void check_break ()\n" + " {\n" + " boolean status = false;\n" + " {\n" + " // The value of status in the beginning is false\n" + " outer:\n" + " while (true) // the labelled break target can be a if statement\n" + " {\n" + " middle:\n" + " while (true)\n" + " {\n" + " inner:\n" + " do\n" + " {\n" + " break inner;\n" + " }while (true);\n" + " status = true;\n" + " break;\n" + " }\n" + "// Chk.chkBooleanVal (\"err_1\", \"status\", status, true);\n" + " status = false;\n" + " break;\n" + " } \n" + " }\n" + " {\n" + " // The value of status in the beginning is false\n" + " outer:\n" + " for (int i = 0; i < 1000; i++)\n" + " {\n" + " middle:\n" + " for (int j = 0; j < 1000; j++)\n" + " {\n" + " inner:\n" + " for (int k = 0; k < 1000; k++)\n" + " break middle;\n" + " status = true;\n" + " break;\n" + " }\n" + "// Chk.chkBooleanVal (\"err_2\", \"status\", status, false);\n" + " status = false;\n" + " break;\n" + " } \n" + " }\n" + " {\n" + " // The value of status in the beginning is false\n" + " outer:\n" + " while (true)\n" + " {\n" + " middle:\n" + " while (true)\n" + " {\n" + " inner:\n" + " for (int k = 0; k < 1000; k++)\n" + " break outer;\n" + " status = true;\n" + " break;\n" + " }\n" + " status = true;\n" + " break;\n" + " }\n" + "// Chk.chkBooleanVal (\"err_3\", \"status\", status, false);\n" + " }\n" + " }\n" + " static void f3(int j)\n" + " {\n" + " int i;\n" + " \n" + " do \n" + " {\n" + " if (j == 10)\n" + " {\n" + " i = 10;\n" + " break;\n" + " }\n" + " else\n" + " {\n" + " i = 20;\n" + " continue;\n" + " }\n" + " } while (( i == 10) && (j != 10)); \n" + " }\n" + "} ", }, "----------\n" + "1. ERROR in p\\DCBug.java (at line 7)\n" + " class SubMember extends Member {\n" + " ^^^^^^^^^\n" + "Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor\n" + "----------\n" + "2. ERROR in p\\DCBug.java (at line 12)\n" + " catch(java.io.IOException e){};\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" + "----------\n" + "3. WARNING in p\\DCBug.java (at line 15)\n" + " private static void check_break ()\n" + " ^^^^^^^^^^^^^^\n" + "The private method check_break() from the type DCBug is never used locally\n" + "----------\n" ); } public void test199() { this.runNegativeTest( new String[] { "p/DependencyTest.java", "package p;\n" + "public class DependencyTest {\n" + "DependencyTest() {\n" + " class Local {\n" + " Missing o;\n" + " };\n" + "} \n" + "}", }, "----------\n" + "1. ERROR in p\\DependencyTest.java (at line 5)\n" + " Missing o;\n" + " ^^^^^^^\n" + "Missing cannot be resolved (or is not a valid type) for the field Local.o\n" + "----------\n" ); } public void test200() { this.runNegativeTest( new String[] { "p/ErrorTest.java", "package p;\n" + "import java.util.Vector;\n" + "class ErrorTest\n" + "{\n" + "// protected Vector vector;\n" + " protected String vector;\n" + " // protected String vector;\n" + " public ErrorTest( Vector inVec )\n" + " {\n" + " vector = inVec;\n" + " } \n" + " public void doStuff( ) \n" + " {\n" + " vector.addElement( new Object( ) );\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\ErrorTest.java (at line 10)\n" + " vector = inVec;\n" + " ^^^^^\n" + "Type mismatch: cannot convert from Vector to String\n" + "----------\n" + "2. ERROR in p\\ErrorTest.java (at line 14)\n" + " vector.addElement( new Object( ) );\n" + " ^^^^^^^^^^\n" + "The method addElement(Object) is undefined for the type String\n" + "----------\n" ); } public void test202() { this.runNegativeTest( new String[] { "p/H.java", "package p;\n" + "public class H {\n" + " H(Object z){}\n" + " H(){\n" + " this(bar());}\n" + " Object bar(){return null;}\n" + "}", }, "----------\n" + "1. ERROR in p\\H.java (at line 5)\n" + " this(bar());}\n" + " ^^^\n" + "Cannot refer to an instance method while explicitly invoking a constructor\n" + "----------\n" ); } public void test203() { this.runNegativeTest( new String[] { "p/I.java", "package p;\n" + "public class I {\n" + " static int i;\n" + " {\n" + " int i = 10;\n" + " return; // Wrong.\n" + " }\n" + " I() {\n" + " i = 10;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\I.java (at line 4)\n" + " {\n" + " int i = 10;\n" + " return; // Wrong.\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Initializer does not complete normally\n" + "----------\n" + "2. WARNING in p\\I.java (at line 5)\n" + " int i = 10;\n" + " ^\n" + "The local variable i is hiding a field from type I\n" + "----------\n" + "3. ERROR in p\\I.java (at line 6)\n" + " return; // Wrong.\n" + " ^^^^^^\n" + "Cannot return from within an initializer\n" + "----------\n" ); } public void test204() { this.runNegativeTest( new String[] { "p/II.java", "package p;\n" + "import java;\n" + "public class II {\n" + " public class II {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\II.java (at line 2)\n" + " import java;\n" + " ^^^^\n" + "The import java cannot be resolved\n" + "----------\n" + "2. ERROR in p\\II.java (at line 4)\n" + " public class II {\n" + " ^^\n" + "Nested type II hides an enclosing type\n" + "----------\n" ); } public void test205() { this.runNegativeTest( new String[] { "p/JJ.java", "package p;\n" + "import java;\n" + "public class JJ {\n" + "}", }, "----------\n" + "1. ERROR in p\\JJ.java (at line 2)\n" + " import java;\n" + " ^^^^\n" + "The import java cannot be resolved\n" + "----------\n" ); } public void test206() { this.runNegativeTest( new String[] { "p/L.java", "package p;\n" + "public class L {\n" + " void foo() {\n" + " System.out.println(\"\") \n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\L.java (at line 4)\n" + " System.out.println(\"\") \n" + " ^\n" + "Syntax error, insert \";\" to complete BlockStatements\n" + "----------\n" ); } public void test208() { this.runNegativeTest( new String[] { "p/Outer.java", "package p;\n" + "class Outer {\n" + " \n" + " void f() {\n" + " final int count;\n" + " class Local {\n" + " int n = count; // another compiler rejects\n" + " }\n" + " count = 10;\n" + " Local l = new Local();\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\Outer.java (at line 7)\n" + " int n = count; // another compiler rejects\n" + " ^^^^^\n" + "The local variable count may not have been initialized\n" + "----------\n" ); } public void test209() { this.runNegativeTest( new String[] { "p/DA.java", "package com.ibm.compiler.java.test.suite.conform;\n" + "public class DA {\n" + " class Y {\n" + " Y () {\n" + " DA.this.this(DA.this);\n" + " }\n" + " Y (DA DA) {\n" + " DA.this();\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\DA.java (at line 5)\n" + " DA.this.this(DA.this);\n" + " ^^^^^^^\n" + "Illegal enclosing instance specification for type DA.Y\n" + "----------\n" + "2. ERROR in p\\DA.java (at line 8)\n" + " DA.this();\n" + " ^^\n" + "Illegal enclosing instance specification for type DA.Y\n" + "----------\n" ); } public void test211() { this.runNegativeTest( new String[] { "p/aa/B.java", "package p.aa;\n" + "/**\n" + " * 1FKS4ST\n" + " */\n" + "class A {\n" + " public void foo(){}\n" + "}\n" + "public class B extends A {\n" + " private void foo(){}\n" + " void bar() throws java.io.IOException{}\n" + "}", "p/aa/C.java", "package p.aa;\n" + "class C {\n" + " void foo(){\n" + " try {\n" + " new B().bar();\n" + " } catch(java.io.IOException e){\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\aa\\B.java (at line 9)\n" + " private void foo(){}\n" + " ^^^^^\n" + "Cannot reduce the visibility of the inherited method from A\n" + "----------\n" ); } public void test212() { this.runNegativeTest( new String[] { "p/a/Init.java", "package p.a;\n" + "/**\n" + " * 1PQO0WX\n" + " */\n" + "public class Init {\n" + " public static void main(String argv []){\n" + " final int i;\n" + " class Local {\n" + " int j = i; // Javac complains here (Jikes does not)\n" + " };\n" + " i = 1;\n" + " Local l = new Local();\n" + " } \n" + "}", "p/a/Outer.java", "package p.a;\n" + "/**\n" + " * 1PQO0WX\n" + " */\n" + "class Outer {\n" + " void f() {\n" + " final int count;\n" + " class Local {\n" + " int n = count; // another compiler rejects\n" + " }\n" + " count = 10;\n" + " Local l = new Local();\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\a\\Init.java (at line 9)\n" + " int j = i; // Javac complains here (Jikes does not)\n" + " ^\n" + "The local variable i may not have been initialized\n" + "----------\n" + "----------\n" + "1. ERROR in p\\a\\Outer.java (at line 9)\n" + " int n = count; // another compiler rejects\n" + " ^^^^^\n" + "The local variable count may not have been initialized\n" + "----------\n" ); } public void test213() { this.runNegativeTest( new String[] { "p/z/AClass.java", "package p.z;\n" + "public class AClass {\n" + " public class Inner1 {\n" + " String test() {\n" + " return \"inner1\";\n" + " }\n" + " }\n" + " static public class Inner2 {\n" + " String test() {\n" + " return \"Inner2\";\n" + " }\n" + " }\n" + " static private class Inner3 {\n" + " String test() {\n" + " return \"Inner3\";\n" + " }\n" + " }\n" + " private class Inner4 {\n" + " String test() {\n" + " return \"inner4\";\n" + " }\n" + " }\n" + " public String test() {\n" + " \n" + " return \"A\";\n" + " }\n" + " public Object test1() {\n" + " \n" + " return new Object() {\n" + " int x = 3;\n" + " public String test() {\n" + " return \"Object\" + x;\n" + " }\n" + " };\n" + " }\n" + " public Object test2() {\n" + " \n" + " class L1 {\n" + " public String test() {\n" + " return \"L1\";\n" + " };\n" + " }\n" + " \n" + " return new L1().test();\n" + " }\n" + "}", "p/z/AClassExtension.java", "package p.z;\n" + "public class AClassExtension extends AClass.Inner1 {}", }, //TODO should improve error message to suggest addition of explicit constructor instead "----------\n" + "1. WARNING in p\\z\\AClass.java (at line 13)\n" + " static private class Inner3 {\n" + " ^^^^^^\n" + "The private type AClass.Inner3 is never used locally\n" + "----------\n" + "2. WARNING in p\\z\\AClass.java (at line 18)\n" + " private class Inner4 {\n" + " ^^^^^^\n" + "The private type AClass.Inner4 is never used locally\n" + "----------\n" + "----------\n" + "1. ERROR in p\\z\\AClassExtension.java (at line 2)\n" + " public class AClassExtension extends AClass.Inner1 {}\n" + " ^^^^^^^^^^^^^^^\n" + "No enclosing instance of type AClass is available due to some intermediate constructor invocation\n" + "----------\n" ); } public void test216() { this.runNegativeTest( new String[] { "p/w/M.java", "package p.w;\n" + "// File: @(#)innr059_VARIANT.java 1.1 97/02/01 \n" + "// Copyright 02/01/97 Sun Microsystems, Inc. All Rights Reserved\n" + "// TestGen source\n" + "import java.io.PrintStream;\n" + "class M extends T.N {\n" + " M(String s) {\n" + " new T(\"M:\"+s).super();\n" + " }\n" + "}", "p/w/T.java", "package p.w;\n" + "// File: @(#)innr059_VARIANT.java 1.1 97/02/01 \n" + "// Copyright 02/01/97 Sun Microsystems, Inc. All Rights Reserved\n" + "// TestGen source\n" + "import java.io.PrintStream;\n" + "class T {\n" + " String s = \"empty\";\n" + " class N {\n" + " public String toString() {\n" + " return s;\n" + " }\n" + " class I {\n" + " }\n" + " }\n" + " T(String s) {\n" + " this.s = s;\n" + " }\n" + "}", "p/w/innr059_VAR_BAD_71.java", "package p.w;\n" + "// File: @(#)innr059_VAR_BAD_71.java 1.1 97/02/01 \n" + "// Copyright 02/01/97 Sun Microsystems, Inc. All Rights Reserved\n" + "// TestGen VARIANT=VAR_BAD_71\n" + "import java.io.PrintStream;\n" + "/**\n" + " * Test innr059:\n" + " * A new expression can begin with Primary . new Identifier.\n" + " *

\n" + " * Test innr060:\n" + " * A qualified new expression can have an ClassBody.\n" + " *

\n" + " * Test innr061:\n" + " * A qualified new expression with a ClassBody can have an ArgumentList.\n" + " *

\n" + " * Test innr062:\n" + " * A qualified new expression must use a simple inner class name.\n" + " *

\n" + " * Test innr063:\n" + " * A super expression may be qualified.\n" + " */\n" + "public class innr059_VAR_BAD_71 {\n" + " public static PrintStream out;\n" + " public static boolean check(Object x, Object y) {\n" + " if (x == y || x != null && x.equals(y))\n" + " return true;\n" + " return fail(\"Not equal: \"+x+\"; \"+y);\n" + " }\n" + " public static boolean fail(String msg) {\n" + " out.println(\"TEST FAILED: \"+msg);\n" + " Thread.dumpStack();\n" + " return false;\n" + " }\n" + " public static void main(String argv[]) {\n" + " System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);\n" + " }\n" + " public static int run(String argv[],PrintStream out) {\n" + " innr059_VAR_BAD_71.out = out;\n" + " if (argv.length == 0) {\n" + " String defaultArgv[] = { \"one\", \"two\", \"three\" };\n" + " argv = defaultArgv;\n" + " }\n" + " out.print(\"Testing: \");\n" + " innr059_VAR_BAD_71 x = new innr059_VAR_BAD_71();\n" + " if (!x.test(argv)) {\n" + " return 2;\n" + " }\n" + " out.println(\"Test passed.\");\n" + " return 0;\n" + " }\n" + " public boolean test(String argv[]) {\n" + " boolean res = true; // success\n" + " for (int i = 0; i < argv.length; i++) {\n" + " String a = argv[i];\n" + " // //TRY\n" + " T t = new T(a);\n" + " check(t.new N().toString(), a);\n" + " check(new T(a+1).new N().toString(), a+1);\n" + " check(new S(a+2).new N().toString(), \"S:\"+a+2);\n" + " check(new S(a+3).new M(\"t:\").toString(), \"t:S:\"+a+3);\n" + " check(new S(a+4).new M(\"t:\") {\n" + " public String toString() {\n" + " return \"A:\"+super.toString();\n" + " }\n" + " }.toString(), \"A:t:S:\"+a+4);\n" + " check(new M(a+11).toString(), \"M:\"+a+11);\n" + " check(new T(a+12).new N() {\n" + " public String toString() {\n" + " return \"A:\"+super.toString();\n" + " }\n" + " }.toString(), \"A:\"+a+12);\n" + " // Negative tests:\n" + " // check(new T.N(a).toString(), a); //BAD\n" + " check(t.new T.N(a).toString(), a); //BAD\n" + " // check(t.new N.I().toString(), a); //BAD\n" + " // check(t.new M().toString(), a); //BAD\n" + " }\n" + " return res;\n" + " }\n" + "}", "p/w/S.java", "package p.w;\n" + "// File: @(#)innr059_VARIANT.java 1.1 97/02/01 \n" + "// Copyright 02/01/97 Sun Microsystems, Inc. All Rights Reserved\n" + "// TestGen source\n" + "import java.io.PrintStream;\n" + "class S extends T {\n" + " class M extends N {\n" + " String t;\n" + " M(String t) {\n" + " this.t = t;\n" + " }\n" + " public String toString() {\n" + " return t + super.toString();\n" + " }\n" + " }\n" + " S(String s) {\n" + " super(\"S:\" + s);\n" + " }\n" + "}", "p/w/innr059_VAR_BAD_72.java", "package p.w;\n" + "// File: @(#)innr059_VAR_BAD_72.java 1.1 97/02/01 \n" + "// Copyright 02/01/97 Sun Microsystems, Inc. All Rights Reserved\n" + "// TestGen VARIANT=VAR_BAD_72\n" + "import java.io.PrintStream;\n" + "/**\n" + " * Test innr059:\n" + " * A new expression can begin with Primary . new Identifier.\n" + " *

\n" + " * Test innr060:\n" + " * A qualified new expression can have an ClassBody.\n" + " *

\n" + " * Test innr061:\n" + " * A qualified new expression with a ClassBody can have an ArgumentList.\n" + " *

\n" + " * Test innr062:\n" + " * A qualified new expression must use a simple inner class name.\n" + " *

\n" + " * Test innr063:\n" + " * A super expression may be qualified.\n" + " */\n" + "public class innr059_VAR_BAD_72 {\n" + " public static PrintStream out;\n" + " public static boolean check(Object x, Object y) {\n" + " if (x == y || x != null && x.equals(y))\n" + " return true;\n" + " return fail(\"Not equal: \"+x+\"; \"+y);\n" + " }\n" + " public static boolean fail(String msg) {\n" + " out.println(\"TEST FAILED: \"+msg);\n" + " Thread.dumpStack();\n" + " return false;\n" + " }\n" + " public static void main(String argv[]) {\n" + " System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);\n" + " }\n" + " public static int run(String argv[],PrintStream out) {\n" + " innr059_VAR_BAD_72.out = out;\n" + " if (argv.length == 0) {\n" + " String defaultArgv[] = { \"one\", \"two\", \"three\" };\n" + " argv = defaultArgv;\n" + " }\n" + " out.print(\"Testing: \");\n" + " innr059_VAR_BAD_72 x = new innr059_VAR_BAD_72();\n" + " if (!x.test(argv)) {\n" + " return 2;\n" + " }\n" + " out.println(\"Test passed.\");\n" + " return 0;\n" + " }\n" + " public boolean test(String argv[]) {\n" + " boolean res = true; // success\n" + " for (int i = 0; i < argv.length; i++) {\n" + " String a = argv[i];\n" + " // //TRY\n" + " T t = new T(a);\n" + " check(t.new N().toString(), a);\n" + " check(new T(a+1).new N().toString(), a+1);\n" + " check(new S(a+2).new N().toString(), \"S:\"+a+2);\n" + " check(new S(a+3).new M(\"t:\").toString(), \"t:S:\"+a+3);\n" + " check(new S(a+4).new M(\"t:\") {\n" + " public String toString() {\n" + " return \"A:\"+super.toString();\n" + " }\n" + " }.toString(), \"A:t:S:\"+a+4);\n" + " check(new M(a+11).toString(), \"M:\"+a+11);\n" + " check(new T(a+12).new N() {\n" + " public String toString() {\n" + " return \"A:\"+super.toString();\n" + " }\n" + " }.toString(), \"A:\"+a+12);\n" + " // Negative tests:\n" + " // check(new T.N(a).toString(), a); //BAD\n" + " // check(t.new T.N(a).toString(), a); //BAD\n" + " check(t.new N.I().toString(), a); //BAD\n" + " // check(t.new M().toString(), a); //BAD\n" + " }\n" + " return res;\n" + " }\n" + "}", "p/w/innr059_VAR_BAD_73.java", "package p.w;\n" + "// File: @(#)innr059_VAR_BAD_73.java 1.1 97/02/01 \n" + "// Copyright 02/01/97 Sun Microsystems, Inc. All Rights Reserved\n" + "// TestGen VARIANT=VAR_BAD_73\n" + "import java.io.PrintStream;\n" + "/**\n" + " * Test innr059:\n" + " * A new expression can begin with Primary . new Identifier.\n" + " *

\n" + " * Test innr060:\n" + " * A qualified new expression can have an ClassBody.\n" + " *

\n" + " * Test innr061:\n" + " * A qualified new expression with a ClassBody can have an ArgumentList.\n" + " *

\n" + " * Test innr062:\n" + " * A qualified new expression must use a simple inner class name.\n" + " *

\n" + " * Test innr063:\n" + " * A super expression may be qualified.\n" + " */\n" + "public class innr059_VAR_BAD_73 {\n" + " public static PrintStream out;\n" + " public static boolean check(Object x, Object y) {\n" + " if (x == y || x != null && x.equals(y))\n" + " return true;\n" + " return fail(\"Not equal: \"+x+\"; \"+y);\n" + " }\n" + " public static boolean fail(String msg) {\n" + " out.println(\"TEST FAILED: \"+msg);\n" + " Thread.dumpStack();\n" + " return false;\n" + " }\n" + " public static void main(String argv[]) {\n" + " System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);\n" + " }\n" + " public static int run(String argv[],PrintStream out) {\n" + " innr059_VAR_BAD_73.out = out;\n" + " if (argv.length == 0) {\n" + " String defaultArgv[] = { \"one\", \"two\", \"three\" };\n" + " argv = defaultArgv;\n" + " }\n" + " out.print(\"Testing: \");\n" + " innr059_VAR_BAD_73 x = new innr059_VAR_BAD_73();\n" + " if (!x.test(argv)) {\n" + " return 2;\n" + " }\n" + " out.println(\"Test passed.\");\n" + " return 0;\n" + " }\n" + " public boolean test(String argv[]) {\n" + " boolean res = true; // success\n" + " for (int i = 0; i < argv.length; i++) {\n" + " String a = argv[i];\n" + " // //TRY\n" + " T t = new T(a);\n" + " check(t.new N().toString(), a);\n" + " check(new T(a+1).new N().toString(), a+1);\n" + " check(new S(a+2).new N().toString(), \"S:\"+a+2);\n" + " check(new S(a+3).new M(\"t:\").toString(), \"t:S:\"+a+3);\n" + " check(new S(a+4).new M(\"t:\") {\n" + " public String toString() {\n" + " return \"A:\"+super.toString();\n" + " }\n" + " }.toString(), \"A:t:S:\"+a+4);\n" + " check(new M(a+11).toString(), \"M:\"+a+11);\n" + " check(new T(a+12).new N() {\n" + " public String toString() {\n" + " return \"A:\"+super.toString();\n" + " }\n" + " }.toString(), \"A:\"+a+12);\n" + " // Negative tests:\n" + " // check(new T.N(a).toString(), a); //BAD\n" + " // check(t.new T.N(a).toString(), a); //BAD\n" + " // check(t.new N.I().toString(), a); //BAD\n" + " check(t.new M().toString(), a); //BAD\n" + " }\n" + " return res;\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\w\\M.java (at line 5)\n" + " import java.io.PrintStream;\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The import java.io.PrintStream is never used\n" + "----------\n" + "----------\n" + "1. WARNING in p\\w\\T.java (at line 5)\n" + " import java.io.PrintStream;\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The import java.io.PrintStream is never used\n" + "----------\n" + "----------\n" + "1. WARNING in p\\w\\innr059_VAR_BAD_71.java (at line 37)\n" + " public static int run(String argv[],PrintStream out) {\n" + " ^^^\n" + "The argument out is hiding a field from type innr059_VAR_BAD_71\n" + "----------\n" + "2. ERROR in p\\w\\innr059_VAR_BAD_71.java (at line 74)\n" + " check(t.new T.N(a).toString(), a); //BAD\n" + " ^^^\n" + "Syntax error on token \"new\", delete this token\n" + "----------\n" + "----------\n" + "1. WARNING in p\\w\\S.java (at line 5)\n" + " import java.io.PrintStream;\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The import java.io.PrintStream is never used\n" + "----------\n" + "----------\n" + "1. WARNING in p\\w\\innr059_VAR_BAD_72.java (at line 37)\n" + " public static int run(String argv[],PrintStream out) {\n" + " ^^^\n" + "The argument out is hiding a field from type innr059_VAR_BAD_72\n" + "----------\n" + "2. ERROR in p\\w\\innr059_VAR_BAD_72.java (at line 75)\n" + " check(t.new N.I().toString(), a); //BAD\n" + " ^^^\n" + "Syntax error on token \"new\", delete this token\n" + "----------\n" + "----------\n" + "1. WARNING in p\\w\\innr059_VAR_BAD_73.java (at line 37)\n" + " public static int run(String argv[],PrintStream out) {\n" + " ^^^\n" + "The argument out is hiding a field from type innr059_VAR_BAD_73\n" + "----------\n" + "2. ERROR in p\\w\\innr059_VAR_BAD_73.java (at line 76)\n" + " check(t.new M().toString(), a); //BAD\n" + " ^\n" + "T.M cannot be resolved or is not a type\n" + "----------\n" ); } public void test217() { this.runNegativeTest( new String[] { "p/v/X1.java", "package p.v;\n" + "class X1 {\n" + " final int fi1;\n" + " {\n" + " fi1 = 10;\n" + " } \n" + " class inner {\n" + " { \n" + " fi1 += 20;\n" + " }\n" + " }\n" + "}", "p/v/X2.java", "package p.v;\n" + "class X2 extends X1 {\n" + " {\n" + " fi1 = 10;\n" + " } \n" + "}", }, "----------\n" + "1. ERROR in p\\v\\X1.java (at line 9)\n" + " fi1 += 20;\n" + " ^^^\n" + "The final field X1.fi1 cannot be assigned. It must be blank in this context, not qualified and not in compound assignment\n" + "----------\n" + "----------\n" + "1. ERROR in p\\v\\X2.java (at line 4)\n" + " fi1 = 10;\n" + " ^^^\n" + "The final field X1.fi1 cannot be assigned. It must be blank in this context, not qualified and not in compound assignment\n" + "----------\n" ); } public void test218() { this.runNegativeTest( new String[] { "p/u/SortableTableModelAdapter.java", "package p.u;\n" + "class SortableTableModelAdapter\n" + " {\n" + " public class TableHeaderMouseListener {}\n" + " }", "p/u/scott.java", "package p.u;\n" + "class scott {\n" + " SortableTableModelAdapter.TableHeaderMouseListener t = new SortableTableModelAdapter.TableHeaderMouseListener();\n" + "public static void main(String[] args) {\n" + " try {\n" + " } catch (Exception e) {\n" + " System.out.println(\"caught\");\n" + " }\n" + "}\n" + " static void method() {\n" + " SortableTableModelAdapter.TableHeaderMouseListener t = new SortableTableModelAdapter.TableHeaderMouseListener();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\u\\scott.java (at line 3)\n" + " SortableTableModelAdapter.TableHeaderMouseListener t = new SortableTableModelAdapter.TableHeaderMouseListener();\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type SortableTableModelAdapter is accessible. Must qualify the allocation with an enclosing instance of type SortableTableModelAdapter (e.g. x.new A() where x is an instance of SortableTableModelAdapter).\n" + "----------\n" + "2. ERROR in p\\u\\scott.java (at line 11)\n" + " SortableTableModelAdapter.TableHeaderMouseListener t = new SortableTableModelAdapter.TableHeaderMouseListener();\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "No enclosing instance of type SortableTableModelAdapter is accessible. Must qualify the allocation with an enclosing instance of type SortableTableModelAdapter (e.g. x.new A() where x is an instance of SortableTableModelAdapter).\n" + "----------\n" ); } public void test220() { this.runNegativeTest( new String[] { "p/s/Outer1.java", "package p.s;\n" + "class Outer1 {\n" + " int a = 1;\n" + " B b = new B();\n" + " class inner {}\n" + " class B {\n" + " int b = 2;\n" + " C c = new C();\n" + " class C extends inner {\n" + " int c = 3;\n" + " C() {\n" + " super();\n" + " D d = new D() {\n" + " int d = 4;\n" + " X x = new X();\n" + " class X {\n" + " int x = 5;\n" + " Y y = new Y();\n" + " class Y {\n" + " int y = 6;\n" + " Z z = new Z();\n" + " class Z extends D.inner {\n" + " int z = 7;\n" + " Z() {\n" + " new D().super(B.this.a, b, c, d, x, y);\n" + " System.out.println(\"The value of a is \" + a);\n" + " System.out.println(\"The value of b is \" + b);\n" + " System.out.println(\"The value of c is \" + c);\n" + " System.out.println(\"The value of d is \" + d);\n" + " System.out.println(\"The value of x is \" + x);\n" + " System.out.println(\"The value of y is \" + y);\n" + " System.out.println(\"The value of z is \" + z);\n" + " }\n" + " }\n" + " }\n" + " }\n" + " }; \n" + " }\n" + " }\n" + " }\n" + "}", "p/s/D.java", "package p.s;\n" + "class D {\n" + " class inner {\n" + " inner(int a, int b, int c, int d, int x, int y) {\n" + " System.out.println(\"The value of a is \" + a);\n" + " System.out.println(\"The value of b is \" + b);\n" + " System.out.println(\"The value of c is \" + c);\n" + " System.out.println(\"The value of d is \" + d);\n" + " System.out.println(\"The value of x is \" + x);\n" + " System.out.println(\"The value of y is \" + y);\n" + " System.out.println(\"\");\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\s\\Outer1.java (at line 7)\n" + " int b = 2;\n" + " ^\n" + "The field Outer1.B.b is hiding a field from type Outer1\n" + "----------\n" + "2. WARNING in p\\s\\Outer1.java (at line 10)\n" + " int c = 3;\n" + " ^\n" + "The field Outer1.B.C.c is hiding a field from type Outer1.B\n" + "----------\n" + "3. WARNING in p\\s\\Outer1.java (at line 14)\n" + " int d = 4;\n" + " ^\n" + "The field .d is hiding another local variable defined in an enclosing type scope\n" + "----------\n" + "4. WARNING in p\\s\\Outer1.java (at line 17)\n" + " int x = 5;\n" + " ^\n" + "The field .X.x is hiding a field from type \n" + "----------\n" + "5. WARNING in p\\s\\Outer1.java (at line 20)\n" + " int y = 6;\n" + " ^\n" + "The field .X.Y.y is hiding a field from type .X\n" + "----------\n" + "6. WARNING in p\\s\\Outer1.java (at line 23)\n" + " int z = 7;\n" + " ^\n" + "The field .X.Y.Z.z is hiding a field from type .X.Y\n" + "----------\n" + "7. ERROR in p\\s\\Outer1.java (at line 25)\n" + " new D().super(B.this.a, b, c, d, x, y);\n" + " ^^^^^^^^\n" + "a cannot be resolved or is not a field\n" + "----------\n" ); } public void test221() { this.runNegativeTest(new String[] { "p/r2/A.java", "package p.r2;\n" + "public class A {\n" + " protected static int i;\n" + " protected int ns;\n" + " protected static int x = 1;\n" + " static void foo() {p.r2.helper.B.x = 100;}\n" + "}", "p/r2/CMain.java", "package p.r2;\n" + "/*\n" + " Concerning accessibility in qualified names, JLS 6.6.1 states the following: \n" + " A member (field or method) of a reference (class, interface, or array) type \n" + " or a constructor of a class type is accessible only if *the type is accessible* \n" + " [emphasis mine] and the member or constructor is declared to permit access. \n" + " Prior to version 1.2beta3, the compiler did not enforce this rule correctly, \n" + " granting access if the member or constructor was declared to permit access without \n" + " regard to the accessibility of the type to which it belongs. Thus the following \n" + " illegal program would be accepted: \n" + "*/\n" + "import p.r2.helper.P1;\n" + " public class CMain {\n" + " \n" + " public static void main(String[] args) {\n" + " P1 p1 = new P1();\n" + " // The accesses to field \'i\' below are\n" + " // illegal, as the type of \'p2\', the\n" + " // class type \'pack1.P2\', is not accessible.\n" + " p1.p2.i = 3;\n" + " System.out.println(p1.p2.i);\n" + " } \n" + "} ", "p/r2/Point.java", "package p.r2;\n" + "/**\n" + " * This class was generated by a SmartGuide.\n" + " * \n" + " */\n" + "public class Point {\n" + " protected int x, y;\n" + " protected class PointMember {};\n" + " void warp(p.r2.helper.Point3d a) {\n" + " if (a.z > 0) a.delta(this);\n" + " } \n" + "}", "p/r2/Point4d.java", "package p.r2;\n" + "public class Point4d extends p.r2.helper.Point3d {\n" + " protected int t;\n" + "void splash(p.r2.helper.Point3d p){ \n" + " x = p.x;\n" + " y = p.y;\n" + " z = p.z; }\n" + "}", "p/r2/SubSubA.java", "package p.r2;\n" + "public class SubSubA extends p.r2.helper.SubA {\n" + " int j = super.i;\n" + "}", "p/r2/Test.java", "package p.r2;\n" + "public class Test {\n" + " protected void assertEquals(boolean flag) {}\n" + "}", "p/r2/helper/P1.java", "package p.r2.helper;\n" + "public class P1 {\n" + " public P2 p2 = new P2();\n" + " }", "p/r2/helper/P2.java", "package p.r2.helper;\n" + "// Note the absence of an access modifier, making\n" + " // \'P2\' accessible only from within package \'pack1\'.\n" + " class P2 {\n" + " public int i = 0;\n" + " }", "p/r2/helper/Point3d.java", "package p.r2.helper;\n" + "/**\n" + " * This class was generated by a SmartGuide.\n" + " * \n" + " */\n" + "public class Point3d extends p.r2.Point {\n" + " protected int z;\n" + " public void delta(p.r2.Point p) {\n" + " p.x += this.x;\n" + " p.y += this.y;\n" + " } \n" + "}", "p/r2/helper/B.java", "package p.r2.helper;\n" + "public class B extends p.r2.A {\n" + " protected static int x = 10;\n" + " static void foo() {p.r2.A.x = 100;} \n" + "}", "p/r2/helper/SomeTest.java", "package p.r2.helper;\n" + "public class SomeTest extends p.r2.Test {\n" + " public void test (){\n" + " new Runnable (){\n" + " public void run() {\n" + " assertEquals(false);\n" + " }\n" + " };\n" + " }\n" + "}", "p/r2/helper/SubA.java", "package p.r2.helper;\n" + "public class SubA extends p.r2.A {\n" + " int j = super.i;\n" + "public static void main(String argv[]) {\n" + " p.r2.A.i = 5; // ok\n" + " p.r2.helper.SubA.i = 5; // ok\n" + " p.r2.SubSubA.i = 5; // ok\n" + " p.r2.helper2.SubSubA2.i = 5; // ok\n" + " \n" + " Object o = new Object(){\n" + " int x = i; }; // bad since from inside inner\n" + "} \n" + "}", "p/r2/helper2/SubSubA2.java", "package p.r2.helper2;\n" + "public class SubSubA2 extends p.r2.helper.SubA {\n" + " int j = super.i;\n" + "public static void main(String argv[]) {\n" + " p.r2.helper.SubA.i = 5; // ok\n" + " p.r2.SubSubA.i = 5; // ok\n" + " p.r2.helper2.SubSubA2.i = 5; // ok\n" + "} \n" + "}", }, "----------\n" + "1. ERROR in p\\r2\\A.java (at line 6)\n" + " static void foo() {p.r2.helper.B.x = 100;}\n" + " ^^^^^^^^^^^^^^^\n" + "The field p.r2.helper.B.x is not visible\n" + "----------\n" + "----------\n" + "1. ERROR in p\\r2\\CMain.java (at line 20)\n" + " p1.p2.i = 3;\n" + " ^^^^^^^\n" + "The type P2 is not visible\n" + "----------\n" + "2. ERROR in p\\r2\\CMain.java (at line 21)\n" + " System.out.println(p1.p2.i);\n" + " ^^^^^^^\n" + "The type P2 is not visible\n" + "----------\n" + "----------\n" + "1. ERROR in p\\r2\\Point.java (at line 10)\n" + " if (a.z > 0) a.delta(this);\n" + " ^^^\n" + "The field a.z is not visible\n" + "----------\n" + "----------\n" + "1. ERROR in p\\r2\\Point4d.java (at line 7)\n" + " z = p.z; }\n" + " ^^^\n" + "The field p.z is not visible\n" + "----------\n" + "----------\n" + "1. ERROR in p\\r2\\helper\\Point3d.java (at line 9)\n" + " p.x += this.x;\n" + " ^^^\n" + "The field p.x is not visible\n" + "----------\n" + "2. ERROR in p\\r2\\helper\\Point3d.java (at line 10)\n" + " p.y += this.y;\n" + " ^^^\n" + "The field p.y is not visible\n" + "----------\n" + "----------\n" + "1. WARNING in p\\r2\\helper\\B.java (at line 3)\n" + " protected static int x = 10;\n" + " ^\n" + "The field B.x is hiding a field from type A\n" + "----------\n" + "2. WARNING in p\\r2\\helper\\B.java (at line 4)\n" + " static void foo() {p.r2.A.x = 100;} \n" + " ^^^^^\n" + "The method B.foo() does not override the inherited method from A since it is private to a different package.\n" + "----------\n" + "----------\n" + "1. WARNING in p\\r2\\helper\\SomeTest.java (at line 6)\n" + " assertEquals(false);\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Access to enclosing method assertEquals(boolean) from the type Test is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "----------\n" + "1. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" + " int x = i; }; // bad since from inside inner\n" + " ^\n" + "The field .x is hiding a field from type A\n" + "----------\n" + "2. WARNING in p\\r2\\helper\\SubA.java (at line 11)\n" + " int x = i; }; // bad since from inside inner\n" + " ^\n" + "Read access to enclosing field A.i is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" ); } public void test222() { this.runNegativeTest(new String[] { "p/q/X.java", "package p.q;\n" + "import java.io.PrintStream;\n" + "//}\n" + "// All the references to X.this are negative tests of [innr024]\n" + "class X {\n" + " static class T implements GetCurrent {\n" + " static Object f() {\n" + " // if (false) return new Object[] { T.this }; // BAD\n" + " return null;\n" + " }\n" + " public Object[] getCurrent() {\n" + " // if (false) return new Object[] { X.this }; // BAD\n" + " return new Object[] { this, T.this };\n" + " }\n" + " class C implements GetCurrent {\n" + " public Object[] getCurrent() {\n" + " // if (false) return new Object[] { X.this }; // BAD\n" + " return new Object[] { this, C.this, T.this };\n" + " }\n" + " class N implements GetCurrent {\n" + " public Object[] getCurrent() {\n" + " // if (false) return new Object[] { X.this }; // BAD\n" + " return new Object[] { this, N.this, C.this, T.this };\n" + " }\n" + " }\n" + " }\n" + " static class U implements GetCurrent {\n" + " static Object f() {\n" + " // if (false) return new Object[] { T.this }; // BAD\n" + " // if (false) return new Object[] { U.this }; // BAD\n" + " return null;\n" + " }\n" + " public Object[] getCurrent() {\n" + " // if (false) return new Object[] { X.this }; // BAD\n" + " // if (false) return new Object[] { T.this }; // BAD\n" + " return new Object[] { this, U.this };\n" + " }\n" + " class M implements GetCurrent {\n" + " public Object[] getCurrent() {\n" + " // if (false) return new Object[] { X.this }; // BAD\n" + " // if (false) return new Object[] { T.this }; // BAD\n" + " return new Object[] { this, M.this, U.this };\n" + " }\n" + " }\n" + " }\n" + " }\n" + " static Object f() {\n" + " // if (false) return new Object[] { X.this }; // BAD\n" + " return null;\n" + " }\n" + "}", "p/q/innr021_VAR_BAD_118.java", "package p.q;\n" + "import java.io.PrintStream;\n" + "/**\n" + " * Test innr021:\n" + " * In an inner class T.C, the current C instance is visible.\n" + " *

\n" + " * Test innr022:\n" + " * In an inner class T.N.C, the current N instance is visible.\n" + " *

\n" + " * Test innr023:\n" + " * In an inner class T.C, the current T instance is visible.\n" + " *

\n" + " * Test innr024:\n" + " * Only the innermost top-level class has a visible current instance.\n" + " *

\n" + " * Test innr025:\n" + " * A top-level class does not have multiple current instances.\n" + " *

\n" + " * Test innr026:\n" + " * In static code, there are no current instances.\n" + " *

\n" + " * Test innr027:\n" + " * A current instance of class C can be named as C.this.\n" + " *

\n" + " * Test innr028:\n" + " * The innermost current instance can be named this.\n" + " */\n" + "public class innr021_VAR_BAD_118 {\n" + " public static PrintStream out;\n" + " public static boolean check(Object x, Object y) {\n" + " if (x == y || x != null && x.equals(y))\n" + " return true;\n" + " return fail(\"Not equal: \"+x+\"; \"+y);\n" + " }\n" + " boolean checkCurrent(GetCurrent o, Object y[]) {\n" + " Object x[] = o.getCurrent();\n" + " boolean res = check(new Integer(x.length), new Integer(y.length));\n" + " for (int i = 0; i < x.length && res; i++) {\n" + " res &= check(x[i], y[i]);\n" + " }\n" + " return res;\n" + " }\n" + " public static boolean fail(String msg) {\n" + " out.println(\"TEST FAILED: \"+msg);\n" + " Thread.dumpStack();\n" + " return false;\n" + " }\n" + " public static void main(String argv[]) {\n" + " run(argv, System.out);\n" + " }\n" + " public static int run(String argv[],PrintStream out) {\n" + " innr021_VAR_BAD_118.out = out;\n" + " if (argv.length == 0) {\n" + " String defaultArgv[] = { \"one\", \"two\", \"three\" };\n" + " argv = defaultArgv;\n" + " }\n" + " out.print(\"Testing: \");\n" + " innr021_VAR_BAD_118 x = new innr021_VAR_BAD_118();\n" + " if (!x.test(argv)) {\n" + " return 2;\n" + " }\n" + " out.println(\"Test passed.\");\n" + " return 0;\n" + " }\n" + " public boolean test(String argv[]) {\n" + " boolean res = true; // success\n" + " // //TRY\n" + " {\n" + " T t = new T();\n" + " T.C c = t.new C();\n" + " T.C.N n = c.new N();\n" + " Object tt[] = { t, t };\n" + " Object cct[] = { c, c, t };\n" + " Object nnct[] = { n, n, c, t };\n" + " res &= checkCurrent(t, tt);\n" + " res &= checkCurrent(c, cct);\n" + " res &= checkCurrent(n, nnct);\n" + " }\n" + " {\n" + " X.T t = new X.T();\n" + " X.T.C c = t.new C();\n" + " X.T.C.N n = c.new N();\n" + " X.T.U u = new X.T.U();\n" + " X.T.U.M m = u.new M();\n" + " Object tt[] = { t, t };\n" + " Object cct[] = { c, c, t };\n" + " Object nnct[] = { n, n, c, t };\n" + " Object uu[] = { u, u };\n" + " Object mmu[] = { m, m, u };\n" + " res &= checkCurrent(t, tt);\n" + " res &= checkCurrent(c, cct);\n" + " res &= checkCurrent(n, nnct);\n" + " res &= checkCurrent(u, uu);\n" + " res &= checkCurrent(m, mmu);\n" + " }\n" + " return res;\n" + " }\n" + "}", "p/q/GetCurrent.java", "package p.q;\n" + "import java.io.PrintStream;\n" + "interface GetCurrent {\n" + " Object[] getCurrent();\n" + "}", "p/q/T.java", "package p.q;\n" + "import java.io.PrintStream;\n" + "//package innr021 {\n" + " //static\n" + " class T implements GetCurrent {\n" + " class C implements GetCurrent {\n" + " public Object[] getCurrent() {\n" + " return new Object[] { this, C.this, T.this };\n" + " }\n" + " class N implements GetCurrent {\n" + " public Object[] getCurrent() {\n" + " return new Object[] { this, N.this, C.this, T.this };\n" + " }\n" + " }\n" + " }\n" + " \n" + " static Object f() {\n" + " if (false) return new Object[] { T.this }; // BAD\n" + " return null;\n" + " }\n" + " public Object[] getCurrent() {\n" + " return new Object[] { this, T.this };\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\q\\X.java (at line 2)\n" + " import java.io.PrintStream;\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The import java.io.PrintStream is never used\n" + "----------\n" + "----------\n" + "1. WARNING in p\\q\\innr021_VAR_BAD_118.java (at line 51)\n" + " public static int run(String argv[],PrintStream out) {\n" + " ^^^\n" + "The argument out is hiding a field from type innr021_VAR_BAD_118\n" + "----------\n" + "----------\n" + "1. WARNING in p\\q\\GetCurrent.java (at line 2)\n" + " import java.io.PrintStream;\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The import java.io.PrintStream is never used\n" + "----------\n" + "----------\n" + "1. WARNING in p\\q\\T.java (at line 2)\n" + " import java.io.PrintStream;\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The import java.io.PrintStream is never used\n" + "----------\n" + "2. ERROR in p\\q\\T.java (at line 18)\n" + " if (false) return new Object[] { T.this }; // BAD\n" + " ^^^^^^\n" + "Cannot use this in a static context \n" + "----------\n" ); } public void test223() { this.runNegativeTest( new String[] { "p/p/Fred.java", "package p.p;\n" + "class Fred {\n" + "/**\n" + " * Fred constructor comment.\n" + " */\n" + "public Fred() {\n" + " super();\n" + "}\n" + " Fred.Z foo() {\n" + " return null;\n" + " }\n" + "}", "p/p/ambig1.java", "package p.p;\n" + "class ambig1 implements iface {\n" + " class inner implements iface {\n" + " void v() {\n" + " int i = constant;\n" + " }\n" + " }\n" + "}", "p/p/iface.java", "package p.p;\n" + "interface iface {\n" + " int constant = 0;\n" + "}", "p/p/Z.java", "package p.p;\n" + "public class Z {\n" + " int x;\n" + " public class Scanner extends sun.tools.java.Scanner {\n" + " Scanner() throws java.io.IOException {\n" + " super(new sun.tools.java.Environment(), new java.io.FileInputStream(foo() + x));\n" + " scanComments = true;\n" + " }\n" + " }\n" + " String foo() {\n" + " return \"\";\n" + " }\n" + "}", "p/p/instanceof1.java", "package p.p;\n" + "// anonymous inner classes should be final for instanceof and casts\n" + "class instanceof1 {\n" + " void v() {\n" + " Object o = new Object() {\n" + " boolean b = this instanceof iface;\n" + " };\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\p\\Fred.java (at line 9)\n" + " Fred.Z foo() {\n" + " ^^^^^^\n" + "Fred.Z cannot be resolved (or is not a valid return type) for the method foo\n" + "----------\n" + "----------\n" + "1. ERROR in p\\p\\Z.java (at line 4)\n" + " public class Scanner extends sun.tools.java.Scanner {\n" + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "sun.tools.java cannot be resolved or is not a valid superclass\n" + "----------\n" + "2. ERROR in p\\p\\Z.java (at line 6)\n" + " super(new sun.tools.java.Environment(), new java.io.FileInputStream(foo() + x));\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "sun.tools.java cannot be resolved or is not a type\n" + "----------\n" + "3. ERROR in p\\p\\Z.java (at line 7)\n" + " scanComments = true;\n" + " ^^^^^^^^^^^^\n" + "scanComments cannot be resolved\n" + "----------\n" + "----------\n" + "1. ERROR in p\\p\\instanceof1.java (at line 6)\n" + " boolean b = this instanceof iface;\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "Incompatible conditional operand types and iface\n" + "----------\n" ); } public void test224() { this.runNegativeTest( new String[] { "p/o/clss21706_a.java", "package p.o;\n" + "class clss21706_a extends clss21706_b {\n" + " int field2;\n" + " clss21706_a() {\n" + " this(meth());\n" + " }\n" + " clss21706_a(float f) {\n" + " super(meth());\n" + " }\n" + " clss21706_a(int arg) {\n" + " field2 = arg;\n" + " }\n" + " clss21716_a() {\n" + " super(meth());\n" + " }\n" + "}", "p/o/clss21706_b.java", "package p.o;\n" + "class clss21706_b {\n" + " int field1;\n" + " int meth() {\n" + " return 666;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\o\\clss21706_a.java (at line 5)\n" + " this(meth());\n" + " ^^^^\n" + "Cannot refer to an instance method while explicitly invoking a constructor\n" + "----------\n" + "2. ERROR in p\\o\\clss21706_a.java (at line 8)\n" + " super(meth());\n" + " ^^^^\n" + "Cannot refer to an instance method while explicitly invoking a constructor\n" + "----------\n" + "3. ERROR in p\\o\\clss21706_a.java (at line 13)\n" + " clss21716_a() {\n" + " ^^^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "4. ERROR in p\\o\\clss21706_a.java (at line 14)\n" + " super(meth());\n" + " ^^^^^^^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n" ); } public void test225() { this.runNegativeTest( new String[] { "p/l/Z21.java", "package p.l;\n" + "public class Z21 extends Z22{\n" + " \n" + " static inner1 A = Z22.new inner1(); // ***** LINE X\n" + " // static inner1 A;\n" + "public static void main (String args[]){\n" + " System.out.println(A.z);\n" + " }\n" + "}", "p/l/Z22.java", "package p.l;\n" + "public class Z22 {\n" + " final int a1;\n" + " class inner1{\n" + " int z = a1;\n" + " }\n" + " Z22(){\n" + " a1=1;\n" + " }\n" + " public void bug(java.io.Serializable name) {\n" + " Object temp = (Object)name;\n" + " System.out.println( (String)temp );\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\l\\Z21.java (at line 4)\n" + " static inner1 A = Z22.new inner1(); // ***** LINE X\n" + " ^^^\n" + "Z22 cannot be resolved\n" + "----------\n" ); } public void test226() { this.runNegativeTest(new String[] { "p/k/ExtendsA.java", "package p.k;\n" + "public class ExtendsA {\n" + " public int a() {\n" + " int i = new AA().new Inner().i; // THIS LINE SHOULD CAUSE AN ERROR\n" + " // OR :\n" + " // A a = new A();\n" + " // int i = a.new Inner().i;\n" + " return i;\n" + " } \n" + "}", "p/k/AA.java", "package p.k;\n" + "public class AA {\n" + " private class Inner {\n" + " int i = 10;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\k\\ExtendsA.java (at line 4)\n" + " int i = new AA().new Inner().i; // THIS LINE SHOULD CAUSE AN ERROR\n" + " ^^^^^\n" + "The type AA.Inner is not visible\n" + "----------\n" + "----------\n" + "1. WARNING in p\\k\\AA.java (at line 3)\n" + " private class Inner {\n" + " ^^^^^\n" + "The private type AA.Inner is never used locally\n" + "----------\n" ); } public void test227() { this.runNegativeTest( new String[] { "p/j/A.java", "package p.j;\n" + "class A{\n" + " \n" + "static void f1(){\n" + " boolean b3;\n" + " boolean f = false; \n" + " boolean t = false;\n" + " if ((f && (b3 = false)) == true) {\n" + " System.out.println(\"f = b3\");\n" + " }\n" + " b3 = f;\n" + " System.out.println(b3);\n" + "}\n" + "static void f2(int curChar){\n" + " long l = 1L << (curChar & 077);\n" + "} \n" + "} ", "p/j/e522z.java", "package p.j;\n" + "class e522z extends e522a {\n" + " e522a.A b = new e522a.A();\n" + " // A b = new A();\n" + "}", }, "----------\n" + "1. ERROR in p\\j\\e522z.java (at line 2)\n" + " class e522z extends e522a {\n" + " ^^^^^\n" + "e522a cannot be resolved or is not a valid superclass\n" + "----------\n" + "2. ERROR in p\\j\\e522z.java (at line 3)\n" + " e522a.A b = new e522a.A();\n" + " ^^^^^^^\n" + "e522a cannot be resolved (or is not a valid type) for the field e522z.b\n" + "----------\n" + "3. ERROR in p\\j\\e522z.java (at line 3)\n" + " e522a.A b = new e522a.A();\n" + " ^^^^^^^\n" + "e522a cannot be resolved or is not a type\n" + "----------\n" ); } public void test228() { this.runNegativeTest( new String[] { "p/i/B.java", "package p.i;\n" + "class B { // JDK accepts\n" + " static { System.out.println(B.a); }\n" + " static int b = B.a;\n" + " static int a; \n" + "}", "p/i/B1.java", "package p.i;\n" + "class B1 { // JDK rejects\n" + " static { System.out.println(a); }\n" + " static int b = a;\n" + " static int a;\n" + "}", }, "----------\n" + "1. ERROR in p\\i\\B1.java (at line 3)\n" + " static { System.out.println(a); }\n" + " ^\n" + "Cannot reference a field before it is defined\n" + "----------\n" + "2. ERROR in p\\i\\B1.java (at line 4)\n" + " static int b = a;\n" + " ^\n" + "Cannot reference a field before it is defined\n" + "----------\n" ); } public void test229() { this.runNegativeTest( new String[] { "p/h/X12.java", "package p.h;\n" + "class X12 extends B {\n" + "}", "p/h/X1.java", "package p.h;\n" + "class X1 extends B {\n" + " int i;\n" + " static boolean flag = true;\n" + " {\n" + " throw new Exception();\n" + " }\n" + " X1() {\n" + " this(i);\n" + " }\n" + " X1(int ii) {\n" + " }\n" + " final void bar() {\n" + " }\n" + " final void bar(X aX) {\n" + " Object obj = X.this;\n" + " }\n" + " int foo() {\n" + " class Local {\n" + " class Member {\n" + " };\n" + " };\n" + " new Local().new Member();\n" + " return 1;\n" + " }\n" + " //default constructor\n" + " //generated\n" + " public static void main(String[] arg) throws java.io.IOException {\n" + " class Local {\n" + " void foo() {\n" + " synchronized (this) {\n" + " int i = 1;\n" + " }\n" + " }\n" + " }\n" + " }\n" + "}", "p/h/B.java", "package p.h;\n" + "class B extends Exception {\n" + " static int i;\n" + "B() throws java.io.IOException {\n" + " i = 10;\n" + " throw new java.io.IOException();\n" + "}\n" + "}", }, "----------\n" + "1. ERROR in p\\h\\X12.java (at line 2)\n" + " class X12 extends B {\n" + " ^^^\n" + "Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor\n" + "----------\n" + "----------\n" + "1. WARNING in p\\h\\X1.java (at line 3)\n" + " int i;\n" + " ^\n" + "The field X1.i is hiding a field from type B\n" + "----------\n" + "2. ERROR in p\\h\\X1.java (at line 5)\n" + " {\n" + " throw new Exception();\n" + " }\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Initializer does not complete normally\n" + "----------\n" + "3. ERROR in p\\h\\X1.java (at line 6)\n" + " throw new Exception();\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "Unhandled exception type Exception\n" + "----------\n" + "4. ERROR in p\\h\\X1.java (at line 9)\n" + " this(i);\n" + " ^\n" + "Cannot refer to an instance field i while explicitly invoking a constructor\n" + "----------\n" + "5. ERROR in p\\h\\X1.java (at line 11)\n" + " X1(int ii) {\n" + " ^^^^^^^^^^\n" + "Unhandled exception type IOException\n" + "----------\n" + "6. ERROR in p\\h\\X1.java (at line 15)\n" + " final void bar(X aX) {\n" + " ^\n" + "X cannot be resolved (or is not a valid type) for the argument aX of the method bar\n" + "----------\n" + "7. ERROR in p\\h\\X1.java (at line 16)\n" + " Object obj = X.this;\n" + " ^\n" + "X cannot be resolved or is not a type\n" + "----------\n" ); } public void test230() { this.runNegativeTest( new String[] { "p/g/TestException.java", "package p.g;\n" + "public class TestException {\n" + "public TestException() throws java.io.IOException {\n" + " super();\n" + "}\n" + "}", "p/g/TestException2.java", "package p.g;\n" + "public class TestException2 {\n" + " { TestException e = new TestException(); }\n" + "}", }, "----------\n" + "1. ERROR in p\\g\\TestException2.java (at line 3)\n" + " { TestException e = new TestException(); }\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor\n" + "----------\n" ); } public void test232() { this.runNegativeTest( new String[] { "p/ea/EA.java", "package p.ea;\n" + "/**\n" + " * 1FI3SVP\n" + " */\n" + "public class EA {\n" + " /**\n" + " * @deprecated Use IOperation.OK instead\n" + " */\n" + " void foo() {\n" + " }\n" + "}", "p/ea/AHA.java", "package p.ea;\n" + "/**\n" + " * 1FI3SVP\n" + " */\n" + "public class AHA {\n" + " /**\n" + " * @deprecated Use IOperation.OK instead\n" + " */\n" + " void foo() {\n" + " }\n" + "}", "p/ea/EAHelper.java", "package p.ea;\n" + "public class EAHelper {\n" + " void bar() {\n" + " new EA().foo();\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\ea\\EAHelper.java (at line 4)\n" + " new EA().foo();\n" + " ^^^^^^^^^^^^^^\n" + "The method foo() from the type EA is deprecated\n" + "----------\n" ); } public void test233() { this.runNegativeTest( new String[] { "p/e/C_sub.java", "package p.e;\n" + "class C_sub extends X.C.D {\n" + " C_sub(X obj) { \n" + " obj.super(); // error: To invoke D\'s const. C obj required.. // ERROR here !\n" + " } \n" + "}", "p/e/X.java", "package p.e;\n" + "class X {\n" + " Zork x;\n" + " //inner class C \n" + " class C {\n" + " class D {}\n" + " }\n" + " \n" + "}", }, "----------\n" + "1. ERROR in p\\e\\C_sub.java (at line 4)\n" + " obj.super(); // error: To invoke D\'s const. C obj required.. // ERROR here !\n" + " ^^^\n" + "Type mismatch: cannot convert from X to X.C\n" + "----------\n" + "----------\n" + "1. ERROR in p\\e\\X.java (at line 3)\n" + " Zork x;\n" + " ^^^^\n" + "Zork cannot be resolved (or is not a valid type) for the field X.x\n" + "----------\n" ); } public void test234() { this.runNegativeTest( new String[] { "p/da/Mangled.java", "package p.da;\n" + "/**\n" + " * 1FCBQ4M\n" + " */\n" + "public class Mangled extends Mangled {\n" + "}\n" + "class Victim extends Mangled {\n" + "}", }, "----------\n" + "1. ERROR in p\\da\\Mangled.java (at line 5)\n" + " public class Mangled extends Mangled {\n" + " ^^^^^^^\n" + "Mangled causes a cycle - the type Mangled cannot extend/implement itself or one of its own member types\n" + "----------\n" + "2. ERROR in p\\da\\Mangled.java (at line 7)\n" + " class Victim extends Mangled {\n" + " ^^^^^^\n" + "The hierarchy of the type Victim is inconsistent\n" + "----------\n" ); } public void test235() { this.runNegativeTest( new String[] { "p/d/One1.java", "package p.d;\n" + "public class One1 extends One {\n" + " static class One2 {\n" + " public void problem2() {\n" + " final int dialog = 2;\n" + " new Object() {\n" + " public void problem2() {\n" + " if(dialog == 3) return;\n" + " }\n" + " };\n" + " }\n" + " }\n" + "}", "p/d/JE_5_AWT.java", "package p.d;\n" + "import java.awt.*;\n" + "import java.awt.event.*;\n" + "public class JE_5_AWT extends Frame {\n" + " //Dialog Box\n" + " Dialog d;\n" + " public JE_5_AWT() {\n" + " //super(JE_5_AWT.this);\n" + " setTitle(\"Common GUI Controls\");\n" + " //Menu item \n" + " MenuBar mb = new MenuBar(); \n" + " Menu m = new Menu(\"File\");\n" + " MenuItem mi = new MenuItem(\"New\");\n" + " //Dialog Box\n" + " d = new Dialog(JE_5_AWT.this, \"Dialog\", true); //<------ Problem occurs here\n" + " Button b = new Button(\"Close\");\n" + " } \n" + "public JE_5_AWT(double d) {\n" + " this(null);\n" + " new Object() {\n" + " Object obj = JE_5_AWT.this; //<---------OK\n" + " };\n" + "} \n" + "public JE_5_AWT(float f) {\n" + " this(new Object() {\n" + " Object obj = JE_5_AWT.this; //<---------KO \n" + " });\n" + "} \n" + "public JE_5_AWT(int i) {\n" + " this(new Object() {\n" + " Object obj = this; // OK\n" + " Object obj2 = d; // KO\n" + " }); \n" + "} \n" + "public JE_5_AWT(long l) {\n" + " this(new Object() {\n" + " Object myself() {\n" + " return this; // <--------- should be ok \n" + " }\n" + " });\n" + "} \n" + "public JE_5_AWT(Object o) {\n" + " class Local {\n" + " JE_5_AWT obj = JE_5_AWT.this;\n" + " };\n" + "} \n" + "public JE_5_AWT(String s) {\n" + " this(new Object() {\n" + " Object outer() {\n" + " return JE_5_AWT.this; //<---- KO\n" + " }\n" + " }); \n" + "} \n" + "void bar() {\n" + " class Local extends Thread {\n" + " Local() {\n" + " super((Local) (Object) JE_5_AWT.this); // should be ok\n" + " }\n" + " };\n" + "} \n" + "}", "p/d/One.java", "package p.d;\n" + "public class One {\n" + " /** @deprecated */\n" + " int dialog = 3;\n" + " static class One1 {\n" + " One1(final int dialog) {\n" + " this((float)dialog);\n" + " }\n" + " One1 (final float f){}\n" + " public void problem2() {\n" + " final int dialog = 2;\n" + " new Object() {\n" + " public void problem2() {\n" + " if(dialog == 3) return;\n" + " }\n" + " };\n" + " }\n" + " }\n" + " public One() {\n" + " this(new Object() {\n" + " \n" + " public void setValueAt() {\n" + " // PROBLEM 1\n" + " fireTableCellUpdated();\n" + " }\n" + " });\n" + " }\n" + " public One(Object o) {\n" + " }\n" + " void fireTableCellUpdated() { }\n" + "public void problem3(int type, Object token) {\n" + " switch (type) {\n" + " \n" + " case \'|\':\n" + " break;\n" + " case \',\': {\n" + " Object m = new Object();\n" + " for (int i = 0 ; i < 4 ; i++, m = new Object());\n" + " // PROBLEM HERE\n" + " if (m == null) return;\n" + " break;\n" + " \n" + " }\n" + " }\n" + "}\n" + "}", }, "----------\n" + "1. WARNING in p\\d\\JE_5_AWT.java (at line 3)\n" + " import java.awt.event.*;\n" + " ^^^^^^^^^^^^^^\n" + "The import java.awt.event is never used\n" + "----------\n" + "2. ERROR in p\\d\\JE_5_AWT.java (at line 26)\n" + " Object obj = JE_5_AWT.this; //<---------KO \n" + " ^^^^^^^^^^^^^\n" + "No enclosing instance of the type JE_5_AWT is accessible in scope\n" + "----------\n" + "3. ERROR in p\\d\\JE_5_AWT.java (at line 32)\n" + " Object obj2 = d; // KO\n" + " ^\n" + "Cannot refer to an instance field d while explicitly invoking a constructor\n" + "----------\n" + "4. ERROR in p\\d\\JE_5_AWT.java (at line 50)\n" + " return JE_5_AWT.this; //<---- KO\n" + " ^^^^^^^^^^^^^\n" + "No enclosing instance of the type JE_5_AWT is accessible in scope\n" + "----------\n" + "----------\n" + "1. ERROR in p\\d\\One.java (at line 24)\n" + " fireTableCellUpdated();\n" + " ^^^^^^^^^^^^^^^^^^^^\n" + "Cannot refer to an instance method while explicitly invoking a constructor\n" + "----------\n"); } public void test236() { this.runNegativeTest( new String[] { "p/cb/Bogus.java", "package p.cb;\n" + "/**\n" + " * 1PR4G3Q\n" + " */\n" + "import bogus.thing; // bogus import on purpose\n" + "public class Bogus {\n" + " public static final int Const = 1;\n" + "}\n" + "class Y {\n" + " {\n" + " int i = 1;\n" + " switch(i){\n" + " case BogusX.Const: break;\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\cb\\Bogus.java (at line 5)\n" + " import bogus.thing; // bogus import on purpose\n" + " ^^^^^\n" + "The import bogus cannot be resolved\n" + "----------\n" + "2. ERROR in p\\cb\\Bogus.java (at line 13)\n" + " case BogusX.Const: break;\n" + " ^^^^^^\n" + "BogusX cannot be resolved\n" + "----------\n" ); } public void test237() { this.runNegativeTest( new String[] { "p/c/A5.java", "package p.c;\n" + "class A5 extends A6 implements IA5 {\n" + "void foo() throws CloneNotSupportedException {\n" + " this.clone();\n" + "}\n" + "}", "p/c/A6.java", "package p.c;\n" + "class A6 {\n" + " void foo(A5 a5) throws CloneNotSupportedException {\n" + " a5.clone();\n" + " }\n" + " void foo(IA5 ia5) throws CloneNotSupportedException {\n" + " ia5.clone();\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\c\\A5.java (at line 2)\n" + " class A5 extends A6 implements IA5 {\n" + " ^^^\n" + "IA5 cannot be resolved or is not a valid superinterface\n" + "----------\n" + "----------\n" + "1. ERROR in p\\c\\A6.java (at line 6)\n" + " void foo(IA5 ia5) throws CloneNotSupportedException {\n" + " ^^^\n" + "IA5 cannot be resolved (or is not a valid type) for the argument ia5 of the method foo\n" + "----------\n" ); } public void test238() { this.runNegativeTest( new String[] { "p/bb/A2.java", "package p.bb;\n" + "public class A2 {\n" + " {\n" + " int i = 1;\n" + " switch(i){\n" + " case A1.x: break;\n" + " }\n" + " }\n" + "}\n" + "class A1 {\n" + " static final int x = 2.0; // type mismatch\n" + "}", }, "----------\n" + "1. ERROR in p\\bb\\A2.java (at line 11)\n" + " static final int x = 2.0; // type mismatch\n" + " ^\n" + "Type mismatch: cannot convert from double to int\n" + "----------\n" ); } public void test239() { this.runNegativeTest( new String[] { "p/b/AAA.java", "package p.b;\n" + "public class AAA implements J1 {\n" + " private int foo() {\n" + " System.out.println(\"hi\");\n" + " return 1;\n" + " }\n" + "}", "p/b/J1.java", "package p.b;\n" + "interface J1 extends J2 {}", }, "----------\n" + "1. ERROR in p\\b\\AAA.java (at line 2)\n" + " public class AAA implements J1 {\n" + " ^^^\n" + "The hierarchy of the type AAA is inconsistent\n" + "----------\n" + "----------\n" + "1. ERROR in p\\b\\J1.java (at line 2)\n" + " interface J1 extends J2 {}\n" + " ^^\n" + "J2 cannot be resolved or is not a valid superinterface\n" + "----------\n" ); } public void test240() { this.runNegativeTest( new String[] { "p/ab/Cycle1.java", "package p.ab;\n" + "/**\n" + " * 1PR2SAZ\n" + " */\n" + "public class Cycle1 extends Cycle2 {\n" + "}\n" + "class Cycle2 extends Cycle3 {\n" + "}\n" + "class Cycle3 extends Cycle1 {\n" + "}", }, "----------\n" + "1. ERROR in p\\ab\\Cycle1.java (at line 5)\n" + " public class Cycle1 extends Cycle2 {\n" + " ^^^^^^\n" + "The hierarchy of the type Cycle1 is inconsistent\n" + "----------\n" + "2. ERROR in p\\ab\\Cycle1.java (at line 7)\n" + " class Cycle2 extends Cycle3 {\n" + " ^^^^^^\n" + "The hierarchy of the type Cycle2 is inconsistent\n" + "----------\n" + "3. ERROR in p\\ab\\Cycle1.java (at line 9)\n" + " class Cycle3 extends Cycle1 {\n" + " ^^^^^^\n" + "A cycle exists in the type hierarchy between Cycle3 and Cycle1\n" + "----------\n" ); } public void test241() { this.runNegativeTest( new String[] { "p/ba/SubMain.java", "package p.ba;\n" + "/**\n" + " * 1PQRA43\n" + " */\n" + "public class SubMain extends p.ba.helper.Main {\n" + " public void nonStaticMethod () {\n" + " nonStaticProtectedMethod();\n" + " }\n" + " public static void staticMethod () {\n" + " nonStaticProtectedMethod();\n" + " }\n" + " \n" + " class Member {\n" + " void instanceMemberMethod() {\n" + " System.out.println(SubMain.this.nonStaticProtectedMethod());\n" + " }\n" + " }\n" + "}", "p/ba/helper/Main.java", "package p.ba.helper;\n" + "public class Main {\n" + " protected int nonStaticProtectedMethod() {\n" + " return 0;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ba\\SubMain.java (at line 10)\n" + " nonStaticProtectedMethod();\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The method nonStaticProtectedMethod() from the type SubMain is not static\n" + "----------\n" + "2. WARNING in p\\ba\\SubMain.java (at line 15)\n" + " System.out.println(SubMain.this.nonStaticProtectedMethod());\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Access to enclosing method nonStaticProtectedMethod() from the type Main is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" ); } public void test242() { this.runNegativeTest( new String[] { "p/ca/SubMain.java", "package p.ca;\n" + "/**\n" + " * 1PQRA43\n" + " */\n" + "public class SubMain extends p.ca.helper.Main {\n" + " public void nonStaticMethod1 () { nonStaticProtectedMethod(1); } // succeeds with javac\n" + " public void nonStaticMethod2 () { new p.ca.helper.Main().nonStaticProtectedMethod(2); } // fails\n" + " public void nonStaticMethod3 () { new SubMain().nonStaticProtectedMethod(3); } // succeeds with javac\n" + " \n" + " class Member {\n" + " void instanceMemberMethod() {\n" + " new SubMain().nonStaticProtectedMethod(4); // succeeds with javac 1.3.1 and 1.4\n" + " SubMain.this.nonStaticProtectedMethod(5); // succeeds with javac 1.3.1 and 1.4\n" + " nonStaticProtectedMethod(6); // is NOW allowed with JDK 1.3\n" + " }\n" + " }\n" + "}\n" + "class SubMainX {\n" + " SubMain m = new SubMain();\n" + " { m.nonStaticProtectedMethod(7); } // fails\n" + "}", "p/ca/helper/Main.java", "package p.ca.helper;\n" + "/**\n" + " * 1PQRA43\n" + " */\n" + "public class Main {\n" + " protected int nonStaticProtectedMethod(int i) {\n" + " return i;\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ca\\SubMain.java (at line 7)\n" + " public void nonStaticMethod2 () { new p.ca.helper.Main().nonStaticProtectedMethod(2); } // fails\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The method nonStaticProtectedMethod(int) from the type Main is not visible\n" + "----------\n" + "2. WARNING in p\\ca\\SubMain.java (at line 12)\n" + " new SubMain().nonStaticProtectedMethod(4); // succeeds with javac 1.3.1 and 1.4\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Access to enclosing method nonStaticProtectedMethod(int) from the type Main is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "3. WARNING in p\\ca\\SubMain.java (at line 13)\n" + " SubMain.this.nonStaticProtectedMethod(5); // succeeds with javac 1.3.1 and 1.4\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Access to enclosing method nonStaticProtectedMethod(int) from the type Main is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "4. WARNING in p\\ca\\SubMain.java (at line 14)\n" + " nonStaticProtectedMethod(6); // is NOW allowed with JDK 1.3\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Access to enclosing method nonStaticProtectedMethod(int) from the type Main is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "5. ERROR in p\\ca\\SubMain.java (at line 20)\n" + " { m.nonStaticProtectedMethod(7); } // fails\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The method nonStaticProtectedMethod(int) from the type Main is not visible\n" + "----------\n" ); } public void test243() { this.runNegativeTest( new String[] { "p/fa/A.java", "package p.fa;\n" + "/**\n" + " * 1FLA3PY\n" + " */\n" + "import p.fa.helper1.B;\n" + "import p.fa.helper2.B;\n" + "public class A {\n" + "}", "p/fa/helper1/B.java", "package p.fa.helper1;\n" + "public class B {\n" + "}", "p/fa/helper2/B.java", "package p.fa.helper2;\n" + "public class B {\n" + "}", }, "----------\n" + "1. WARNING in p\\fa\\A.java (at line 5)\n" + " import p.fa.helper1.B;\n" + " ^^^^^^^^^^^^^^\n" + "The import p.fa.helper1.B is never used\n" + "----------\n" + "2. ERROR in p\\fa\\A.java (at line 6)\n" + " import p.fa.helper2.B;\n" + " ^^^^^^^^^^^^^^\n" + "The import p.fa.helper2.B collides with another imported type\n" + "----------\n" ); } public void test244() { this.runNegativeTest( new String[] { "p/ga/A.java", "package p.ga;\n" + "/**\n" + " * 1FLUEHZ\n" + " */\n" + "public class A {\n" + " public class A1 {\n" + " }\n" + "}", "p/ga/B.java", "package p.ga;\n" + "/**\n" + " * 1FLUEHZ\n" + " */\n" + "public class B {\n" + " public class B1 extends A.A1 {\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\ga\\B.java (at line 6)\n" + " public class B1 extends A.A1 {\n" + " ^^\n" + "No enclosing instance of type A is accessible to invoke the super constructor. Must define a constructor and explicitly qualify its super constructor invocation with an instance of A (e.g. x.super() where x is an instance of A).\n" + "----------\n" ); } public void test245() { this.runNegativeTest( new String[] { "p/ha/A.java", "package p.ha;\n" + "/**\n" + " * 1FM3I2T\n" + " */\n" + "interface I {\n" + " void foo();\n" + "}\n" + "abstract class A implements I {\n" + " abstract void bar ();\n" + "}\n" + "class B extends A { }\n" + "class C extends B { }\n" + "abstract class D extends C { }\n" + "class E extends D { }\n" + "class M implements I {}\n" + "class N extends M { }\n" + "abstract class O extends N { }\n" + "class P extends O { }\n" + "class V {\n" + " public void foo() {\n" + " }\n" + "}\n" + "class X extends V implements I {}\n" + "abstract class Y extends X implements I {}\n" + "class Z extends Y {}", }, "----------\n" + "1. ERROR in p\\ha\\A.java (at line 11)\n" + " class B extends A { }\n" + " ^\n" + "Class must implement the inherited abstract method A.bar()\n" + "----------\n" + "2. ERROR in p\\ha\\A.java (at line 11)\n" + " class B extends A { }\n" + " ^\n" + "Class must implement the inherited abstract method I.foo()\n" + "----------\n" + "3. ERROR in p\\ha\\A.java (at line 15)\n" + " class M implements I {}\n" + " ^\n" + "Class must implement the inherited abstract method I.foo()\n" + "----------\n" ); } public void test246() { this.runNegativeTest( new String[] { "p/ia/A.java", "package p.ia;\n" + "/**\n" + " * 1FMQ346\n" + " */\n" + "public abstract class A implements I1 {\n" + "}", "p/ia/B.java", "package p.ia;\n" + "/**\n" + " * 1FMQ346\n" + " */\n" + "public class B extends A {\n" + " public int method1(){\n" + " return 0;\n" + " }\n" + "}", "p/ia/I1.java", "package p.ia;\n" + "/**\n" + " * 1FMQ346\n" + " */\n" + "public interface I1 {\n" + " public void method1();\n" + "}", }, "----------\n" + "1. ERROR in p\\ia\\B.java (at line 6)\n" + " public int method1(){\n" + " ^^^^^^^^^\n" + "The return type is incompatible with I1.method1()\n" + "----------\n" ); } public void test247() { this.runNegativeTest( new String[] { "p/runtime/V.java", "package com.ibm.compiler.java.test.suite.conform.runtime;\n" + "/**\n" + " * 1FKYWQ9\n" + " */\n" + "public class V {\n" + " public static void main(String args[]) {\n" + " }\n" + " public static int run(String args[]) {\n" + " int i = 777, j;\n" + " boolean b;\n" + " if (b = i > 0)\n" + " if (!b)\n" + " return 2;\n" + " if (b = (i > 0 && (j = -1) < 0))\n" + " if (j != -1)\n" + " return 3;\n" + " return 0;\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\runtime\\V.java (at line 11)\n" + " if (b = i > 0)\n" + " ^^^^^^^^^\n" + "Possible accidental assignment in place of a comparison. A condition expression should not be reduced to an assignment\n" + "----------\n" + "2. WARNING in p\\runtime\\V.java (at line 14)\n" + " if (b = (i > 0 && (j = -1) < 0))\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Possible accidental assignment in place of a comparison. A condition expression should not be reduced to an assignment\n" + "----------\n" + "3. ERROR in p\\runtime\\V.java (at line 15)\n" + " if (j != -1)\n" + " ^\n" + "The local variable j may not have been initialized\n" + "----------\n" ); } /* * From JDC Bug Id 4139320 - compiler crashes when an interface extends a class. */ public void test248() { /* first compile int1.java */ this.runConformTest( new String[] { /* int1.java */ "int1.java", "public interface int1 extends int2 {} \n"+ "interface int2{} \n" }, null, null); // no specific success output string /* then compile with previous input */ this.runConformTest( new String[] { /* int2.java */ "int2.java", "public class int2 {} \n" }, null, // no specific success output string null, // use default class-path false, null); // do not flush previous output dir content /* then compile with previous input */ this.runNegativeTest( new String[] { /* clss.java */ "clss.java", "public class clss implements int1 {} \n" }, "", // binary compatibility error is detected at runtime - no error at compile-time null, // use default class-path false); // do not flush previous output dir content } /* * 5616 NPE when compiling invalid code defining a array of strings */ public void test249() { this.runNegativeTest( new String[] { "p/A.java", "package p;\n" + "public class A {\n" + " private String stuff = {\n" + " {\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"},\n" + " {\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"},\n" + " {\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"}};\n" + "}", }, "----------\n" + "1. ERROR in p\\A.java (at line 3)\n" + " private String stuff = {\n" + " {\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"},\n" + " {\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"},\n" + " {\"A\",\"B\",\"C\",\"D\",\"E\",\"F\"}};\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Type mismatch: cannot convert from String[][] to String\n" + "----------\n" ); } public void test250() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n" + "import java.io.IOException; \n" + "public class X { \n" + " public static void main(String argv[]) { \n" + " new Object(){ \n" + " { \n" + " if (true) throw new IOException(); \n" + " if (true) throw new Exception(); \n" + " } \n" + " }; \n" + " } \n" + "} \n", }, "----------\n" + "1. ERROR in p1\\X.java (at line 5)\n" + " new Object(){ \n" + " { \n" + " if (true) throw new IOException(); \n" + " if (true) throw new Exception(); \n" + " } \n" + " }; \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unhandled exception type Exception\n" + "----------\n" ); } public void test251() { this.runNegativeTest( new String[] { "p1/I.java", "package p1; \n" + "public interface I { \n" + " void toString(); \n" + "} \n", }, "----------\n" + "1. ERROR in p1\\I.java (at line 3)\n" + " void toString(); \n" + " ^^^^^^^^^^\n" + "The return type is incompatible with Object.toString()\n" + "----------\n" ); } public void test252() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n" + "interface I { \n" + " Object clone() throws CloneNotSupportedException; \n" + "} \n" + "public abstract class X implements I { \n" + "} \n", }, "----------\n" + "1. ERROR in p1\\X.java (at line 5)\n" + " public abstract class X implements I { \n" + " ^\n" + "The inherited method Object.clone() cannot hide the public abstract method in I\n" + "----------\n" ); } public void test253() { this.runNegativeTest( new String[] { "p1/Agent.java", "package p1; \n" + "abstract public class Agent { \n" + " public abstract String talk(); \n" + " public abstract listen(String message); \n" + "} \n", }, "----------\n" + "1. ERROR in p1\\Agent.java (at line 4)\n" + " public abstract listen(String message); \n" + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n"); } /* * PR http://dev.eclipse.org/bugs/show_bug.cgi?id=8697 */ public void test254() { this.runNegativeTest( new String[] { "p1/X2.java", "package p1; \n" + "import java.awt.Frame;\n" + "public class X2 {\n" + "public synchronized Frame cancel() {\n" + " Frame sharedOwnerFrame = null;\n" + " if (sharedOwnerFrame == null) {\n" + " sharedOwnerFrame = new Frame() {\n" + " public synchronized void dispose() {\n" + " }\n" + " };\n" + " }\n" + " return sharedOwnerFrame;\n" + " }\n" + " void foo() {\n" + " synchronized(this) {\n" + " return;\n" + " synchronized(this) {}\n" + " }\n" + "}\n" + "}\n" }, "----------\n" + "1. ERROR in p1\\X2.java (at line 17)\n" + " synchronized(this) {}\n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" ); } /* * http://bugs.eclipse.org/bugs/show_bug.cgi?id=9398 */ public void test255() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public static void main(String[] args) { \n" + " double size = { {}, {}}; \n" + " }\n" + "} \n" }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " double size = { {}, {}}; \n" + " ^^^^^^^^^\n" + "Type mismatch: cannot convert from Object[][] to double\n" + "----------\n"); } // unresolved method signatures (keep investigating content) public void test256() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " int foo(Zork z){ \n" + " try { \n" + " System.out.println(); \n" + " } finally { \n" + " return z.i; \n" + " } \n" + " } \n" + "} \n" }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " int foo(Zork z){ \n" + " ^^^^\n" + "Zork cannot be resolved (or is not a valid type) for the argument z of the method foo\n" + "----------\n"); } /* * http://bugs.eclipse.org/bugs/show_bug.cgi?id=11435 * variant - non visible method is ignored since abstract method is available through interface */ public void test258() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n"+ "public class X extends AbstractY { \n"+ " public void init(){ \n"+ " super.init(); \n"+ " } \n"+ "} \n"+ "abstract class AbstractY extends AbstractZ implements I { \n"+ "} \n"+ "abstract class AbstractZ { \n"+ " private void init(){} \n"+ "} \n"+ "interface I { \n"+ " void init(); \n"+ "} \n" }, "----------\n" + "1. ERROR in p1\\X.java (at line 4)\n" + " super.init(); \n" + " ^^^^^^^^^^^^\n" + "Cannot directly invoke the abstract method init() for the type I\n" + "----------\n" + "2. WARNING in p1\\X.java (at line 10)\n" + " private void init(){} \n" + " ^^^^^^\n" + "The private method init() from the type AbstractZ is never used locally\n" + "----------\n" ); } /* * http://bugs.eclipse.org/bugs/show_bug.cgi?id=12418 * should only be some syntax errors */ public void test259() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n"+ "class X { \n"+ " X(int i){} \n"+ "} \n"+ "class Y extends X { \n"+ " Y (int i){ \n"+ " super(i); \n"+ " System.out.println( // syntax error \n"+ " } \n"+ "} \n" }, "----------\n" + "1. ERROR in p1\\X.java (at line 8)\n" + " System.out.println( // syntax error \n" + " ^\n" + "Syntax error, insert \")\" to complete Expression\n" + "----------\n" + "2. ERROR in p1\\X.java (at line 8)\n" + " System.out.println( // syntax error \n" + " ^\n" + "Syntax error, insert \";\" to complete Statement\n" + "----------\n"); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=12969 * jacks - synchronized(void) */ public void test260() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n" + "public class X {\n" + " public static void main(String[] arguments) {\n" + " synchronized (System.out.println()) {};\n" + " }\n" + "}\n" }, "----------\n" + "1. ERROR in p1\\X.java (at line 4)\n" + " synchronized (System.out.println()) {};\n" + " ^^^^^^^^^^^^^^^^^^^^\n" + "Expression must return a value\n" + "----------\n"); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=12975 * jacks - qualified assignment to final field should be rejected */ public void test261() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n" + "public class X {\n" + " final int i;\n" + " {\n" + " X.this.i = 1;\n" + " }\n" + "}\n" }, "----------\n" + "1. ERROR in p1\\X.java (at line 2)\n" + " public class X {\n" + " ^\n" + "The blank final field i may not have been initialized\n" + "----------\n" + "2. ERROR in p1\\X.java (at line 5)\n" + " X.this.i = 1;\n" + " ^^^^^^^^\n" + "The final field X.i cannot be assigned. It must be blank in this context, not qualified and not in compound assignment\n" + "----------\n"); } /* * http://bugs.eclipse.org/bugs/show_bug.cgi?id=12908 * NPE reporting incorrect argument modifier */ public void test262() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n" + "public class X {\n" + " public X(private int i){} \n"+ " public static void main(String[] arguments) { \n"+ " try { \n"+ " new Object(){ \n"+ " void foo(private int obj){ \n"+ " } \n"+ " }; \n"+ " } catch(private Exception e){ \n"+ " } \n"+ " } \n"+ "} \n" }, "----------\n" + "1. ERROR in p1\\X.java (at line 3)\n" + " public X(private int i){} \n" + " ^\n" + "Illegal modifier for argument i; only final is permitted\n" + "----------\n" + "2. ERROR in p1\\X.java (at line 7)\n" + " void foo(private int obj){ \n" + " ^^^\n" + "Illegal modifier for argument obj; only final is permitted\n" + "----------\n" + "3. ERROR in p1\\X.java (at line 10)\n" + " } catch(private Exception e){ \n" + " ^\n" + "Illegal modifier for the variable e; only final is permitted\n" + "----------\n" ); } /* * http://bugs.eclipse.org/bugs/show_bug.cgi?id=12908 * NPE reporting incorrect argument modifier (variant with duplicate modifiers) */ public void test263() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n" + "public class X {\n" + " public X(private private int i){} \n"+ " public static void main(String[] arguments) { \n"+ " try { \n"+ " new Object(){ \n"+ " void foo(private private int obj){ \n"+ " } \n"+ " }; \n"+ " } catch(private private Exception e){ \n"+ " } \n"+ " } \n"+ "} \n" }, "----------\n" + "1. ERROR in p1\\X.java (at line 3)\n" + " public X(private private int i){} \n" + " ^\n" + "Illegal modifier for argument i; only final is permitted\n" + "----------\n" + "2. ERROR in p1\\X.java (at line 3)\n" + " public X(private private int i){} \n" + " ^\n" + "Duplicate modifier for argument i\n" + "----------\n" + "3. ERROR in p1\\X.java (at line 7)\n" + " void foo(private private int obj){ \n" + " ^^^\n" + "Illegal modifier for argument obj; only final is permitted\n" + "----------\n" + "4. ERROR in p1\\X.java (at line 7)\n" + " void foo(private private int obj){ \n" + " ^^^\n" + "Duplicate modifier for argument obj\n" + "----------\n" + "5. ERROR in p1\\X.java (at line 10)\n" + " } catch(private private Exception e){ \n" + " ^\n" + "Illegal modifier for the variable e; only final is permitted\n" + "----------\n" + "6. ERROR in p1\\X.java (at line 10)\n" + " } catch(private private Exception e){ \n" + " ^\n" + "Duplicate modifier for the variable e\n" + "----------\n"); } /* * http://bugs.eclipse.org/bugs/show_bug.cgi?id=12908 * NPE reporting incorrect argument modifier (variant with duplicate modifiers) */ public void test264() { this.runNegativeTest( new String[] { "p1/X.java", "package p1; \n" + "public class X { \n" + " public final int CST3 = 13; \n" + " public void bar() { \n" + " class Local extends C { \n" + " public final int CST = 10; \n" + " public final int CST1 = 11; \n" + " public final int CST2 = 12; \n" + " void foo(int i){ \n" + " switch(i){ \n" + " case this.CST : \n" + " System.out.println(\"CST=10\"); \n" + " case CST1 : \n" + " System.out.println(\"CST1=11\"); \n" + " case super.CST2 : \n" + " System.out.println(\"CST2=12\"); \n" + " case X.this.CST3 : \n" + " System.out.println(\"CST2=12\"); \n" + " } \n" + " } \n" + " }; \n" + " } \n" + "} \n" + "class C { \n" + " public final int CST2 = 12; \n" + "} \n" }, "----------\n" + "1. WARNING in p1\\X.java (at line 8)\n" + " public final int CST2 = 12; \n" + " ^^^^\n" + "The field Local.CST2 is hiding a field from type C\n" + "----------\n" + "2. ERROR in p1\\X.java (at line 11)\n" + " case this.CST : \n" + " ^^^^^^^^\n" + "case expressions must be constant expressions\n" + "----------\n" + "3. ERROR in p1\\X.java (at line 15)\n" + " case super.CST2 : \n" + " ^^^^^^^^^^\n" + "case expressions must be constant expressions\n" + "----------\n" + "4. ERROR in p1\\X.java (at line 17)\n" + " case X.this.CST3 : \n" + " ^^^^^^^^^^^\n" + "case expressions must be constant expressions\n" + "----------\n"); } /* * http://bugs.eclipse.org/bugs/show_bug.cgi?id=17145 */ public void test265() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private int i; \n"+ " public X() { \n"+ " i = 5 \n"+ " } \n"+ " public X(String s) { \n"+ " this(); \n"+ " } \n"+ " public X(short numberOfNodes, String s) { \n"+ " this(s); \n"+ " } \n"+ "} \n" }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " i = 5 \n" + " ^\n" + "Syntax error, insert \";\" to complete BlockStatements\n" + "----------\n" ); } /* * Test reporting of optional problems for expression receiver in static invocation/field access */ public void test267() { this.runNegativeTest( new String[] { "p/X.java", "package p; \n" + "public class X extends X0 { \n" + " static void staticMethod(){} \n" + " void method(){} \n" + " static int staticField = 0; \n" + " int field = 1; \n" + " X other; \n" + " void test(){ \n" + " X x = new X(); \n" + " x.other = this; \n" + " method(); \n" + " this.method(); \n" + " super.method(); \n" + " new X().method(); \n" + " x.method(); \n" + " x.other.method(); \n" + " X.method(); \n" + " staticMethod(); \n" + " this.staticMethod(); \n" + " super.staticMethod(); \n" + " new X().staticMethod(); \n" + " x.staticMethod(); \n" + " x.other.staticMethod(); \n" + " X.staticMethod(); \n" + " int i; \n" + " i = field; \n" + " i = this.field; \n" + " i = super.field; \n" + " i = new X().field; \n" + " i = x.field; \n" + " i = x.other.field; \n" + " i = X.field; \n" + " i = staticField; \n" + " i = this.staticField; \n" + " i = super.staticField; \n" + " i = new X().staticField; \n" + " i = x.staticField; \n" + " i = x.other.staticField; \n" + " i = X.staticField; \n" + " } \n" + " static void staticTest(){ \n" + " method(); \n" + " staticMethod(); \n" + " int i; \n" + " i = field; \n" + " i = staticField; \n" + " } \n" + "} \n" + "class X0 { \n" + " static void staticMethod(){} \n" + " void method(){ } \n" + " static int staticField = 0; \n" + " int field = 1; \n" + "} \n" }, "----------\n" + "1. WARNING in p\\X.java (at line 5)\n" + " static int staticField = 0; \n" + " ^^^^^^^^^^^\n" + "The field X.staticField is hiding a field from type X0\n" + "----------\n" + "2. WARNING in p\\X.java (at line 6)\n" + " int field = 1; \n" + " ^^^^^\n" + "The field X.field is hiding a field from type X0\n" + "----------\n" + "3. ERROR in p\\X.java (at line 17)\n" + " X.method(); \n" + " ^^^^^^^^^^\n" + "The method method() from the type X is not static\n" + "----------\n" + "4. WARNING in p\\X.java (at line 19)\n" + " this.staticMethod(); \n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The static method staticMethod() from the type X should be accessed in a static way\n" + "----------\n" + "5. WARNING in p\\X.java (at line 21)\n" + " new X().staticMethod(); \n" + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "The static method staticMethod() from the type X should be accessed in a static way\n" + "----------\n" + "6. WARNING in p\\X.java (at line 22)\n" + " x.staticMethod(); \n" + " ^^^^^^^^^^^^^^^^\n" + "The static method staticMethod() from the type X should be accessed in a static way\n" + "----------\n" + "7. WARNING in p\\X.java (at line 23)\n" + " x.other.staticMethod(); \n" + " ^^^^^^^^^^^^^^^^^^^^^^\n" + "The static method staticMethod() from the type X should be accessed in a static way\n" + "----------\n" + "8. ERROR in p\\X.java (at line 32)\n" + " i = X.field; \n" + " ^^^^^^^\n" + "Cannot make a static reference to the non-static field X.field\n" + "----------\n" + "9. WARNING in p\\X.java (at line 34)\n" + " i = this.staticField; \n" + " ^^^^^^^^^^^^^^^^\n" + "The static field X.staticField should be accessed in a static way\n" + "----------\n" + "10. WARNING in p\\X.java (at line 36)\n" + " i = new X().staticField; \n" + " ^^^^^^^^^^^\n" + "The static field X.staticField should be accessed in a static way\n" + "----------\n" + "11. WARNING in p\\X.java (at line 37)\n" + " i = x.staticField; \n" + " ^^^^^^^^^^^^^\n" + "The static field X.staticField should be accessed in a static way\n" + "----------\n" + "12. WARNING in p\\X.java (at line 38)\n" + " i = x.other.staticField; \n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The static field X.staticField should be accessed in a static way\n" + "----------\n" + "13. ERROR in p\\X.java (at line 42)\n" + " method(); \n" + " ^^^^^^\n" + "The method method() from the type X is not static\n" + "----------\n" + "14. ERROR in p\\X.java (at line 45)\n" + " i = field; \n" + " ^^^^^\n" + "Cannot make a static reference to the non-static field field\n" + "----------\n"); } /* * Test reporting of optional problems for expression receiver in static invocation/field access */ public void test268() { this.runNegativeTest( new String[] { "p/X.java", "package p; \n" + "public class X { \n" + " public static void main(String[] args) { \n" + " a : b : for (int i = 0; i < 10; i++) { \n" + " if (i % 2 == 0) \n" + " continue b; \n" + " if (i % 2 == 1) \n" + " continue a; \n" + " } \n" + " } \n" + "} \n" }, "----------\n" + "1. ERROR in p\\X.java (at line 8)\n" + " continue a; \n" + " ^^^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n" ); } /* * Test TO-DO tag support */ public void test269() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:,#todo#"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "/** \n"+ " * TODO:todo1 \n"+ " */ \n"+ "public class X { \n"+ "/** \n"+ " * TODO: todo2 \n"+ " */ \n"+ " public static final char MY_CHAR = 'A'; \n"+ " \n"+ "/** \n"+ " * TODO:todo3 \n"+ " */ \n"+ "// TODO:todo4a \n"+ "//#todo# todo4b \n"+ " public static void main(String[] args) { \n"+ " \n"+ "/** \n"+ " * TODO:todo5 \n"+ " */ \n"+ " X self = new X(); \n"+ "/** \n"+ " * TODO:todo6a \n"+ " * TODO:todo6b \n"+ " */ \n"+ " System.out.println(\"My char: \" + String.valueOf((char)self.MY_CHAR)); \n"+ "/** \n"+ " * TODO:todo7 \n"+ " */ \n"+ " } \n"+ "/** \n"+ " * TODO:todo8 */ \n"+ "} \n"+ " \n"+ "/** \n"+ " * TODO:todo9 \n"+ " */ \n" }, "----------\n" + "1. WARNING in p\\X.java (at line 3)\n" + " * TODO:todo1 \n" + " ^^^^^^^^^^\n" + "TODO: todo1\n" + "----------\n" + "2. WARNING in p\\X.java (at line 7)\n" + " * TODO: todo2 \n" + " ^^^^^^^^^^^^^\n" + "TODO: todo2\n" + "----------\n" + "3. WARNING in p\\X.java (at line 12)\n" + " * TODO:todo3 \n" + " ^^^^^^^^^^\n" + "TODO: todo3\n" + "----------\n" + "4. WARNING in p\\X.java (at line 14)\n" + " // TODO:todo4a \n" + " ^^^^^^^^^^^\n" + "TODO: todo4a\n" + "----------\n" + "5. WARNING in p\\X.java (at line 15)\n" + " //#todo# todo4b \n" + " ^^^^^^^^^^^^^^^\n" + "#todo# todo4b\n" + "----------\n" + "6. WARNING in p\\X.java (at line 19)\n" + " * TODO:todo5 \n" + " ^^^^^^^^^^\n" + "TODO: todo5\n" + "----------\n" + "7. WARNING in p\\X.java (at line 23)\n" + " * TODO:todo6a \n" + " ^^^^^^^^^^^\n" + "TODO: todo6a\n" + "----------\n" + "8. WARNING in p\\X.java (at line 24)\n" + " * TODO:todo6b \n" + " ^^^^^^^^^^^\n" + "TODO: todo6b\n" + "----------\n" + "9. WARNING in p\\X.java (at line 26)\n" + " System.out.println(\"My char: \" + String.valueOf((char)self.MY_CHAR)); \n" + " ^^^^^^^^^^^^\n" + "The static field X.MY_CHAR should be accessed in a static way\n" + "----------\n" + "10. WARNING in p\\X.java (at line 28)\n" + " * TODO:todo7 \n" + " ^^^^^^^^^^\n" + "TODO: todo7\n" + "----------\n" + "11. WARNING in p\\X.java (at line 32)\n" + " * TODO:todo8 */ \n" + " ^^^^^^^^^^\n" + "TODO: todo8\n" + "----------\n" + "12. WARNING in p\\X.java (at line 36)\n" + " * TODO:todo9 \n" + " ^^^^^^^^^^\n" + "TODO: todo9\n" + "----------\n", null, true, customOptions); } /* * Test deprecation reporting inside deprecated code */ public void test270(){ Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.ENABLED); this.runNegativeTest( new String[] { "X.java", "public class X implements I { // should complain about I deprecation \n"+ " \n"+ " /** @deprecated */ \n"+ " public int foo(){ // should NOT complain about foo() deprecation \n"+ " return 0; \n"+ " } \n"+ " public int bar(){ // should complain about bar() deprecation \n"+ " return 0; \n"+ " } \n"+ " \n"+ " I someI; // should complain about I deprecation \n"+ " /** @deprecated */ \n"+ " I otherI; // should complain about I deprecation \n"+ " \n"+ " int i = someI.foo(); // should complain about foo() deprecation \n"+ " \n"+ " /** @deprecated */ \n"+ " int j = someI.bar(); // should NOT complain about bar() deprecation \n"+ " \n"+ " void a(I i){}// should complain about I deprecation \n"+ " /** @deprecated */ \n"+ " void b(I i){}// should NOT complain about I deprecation \n"+ " \n"+ " { \n"+ " someI.foo(); // should complain about foo() deprecation \n"+ " } \n"+ " /** @deprecated */ \n"+ " class M { \n"+ " { \n"+ " someI.foo(); // should NOT complain about foo() deprecation \n"+ " } \n"+ " } \n"+ "} \n", "I.java", "/** @deprecated */ \n"+ "public interface I { \n"+ " \n"+ " /** @deprecated */ \n"+ " int foo(); \n"+ " \n"+ " /** @deprecated */ \n"+ " int bar(); \n"+ " \n"+ " /** @deprecated */ \n"+ " char[] field = \"a\".toCharArray(); \n"+ "} \n" }, "----------\n" + "1. WARNING in X.java (at line 1)\n" + " public class X implements I { // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "2. WARNING in X.java (at line 7)\n" + " public int bar(){ // should complain about bar() deprecation \n" + " ^^^^^\n" + "The method X.bar() overrides a deprecated method from I\n" + "----------\n" + "3. WARNING in X.java (at line 11)\n" + " I someI; // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "4. WARNING in X.java (at line 15)\n" + " int i = someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n" + "5. WARNING in X.java (at line 20)\n" + " void a(I i){}// should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "6. WARNING in X.java (at line 20)\n" + " void a(I i){}// should complain about I deprecation \n" + " ^\n" + "The argument i is hiding a field from type X\n" + "----------\n" + "7. WARNING in X.java (at line 22)\n" + " void b(I i){}// should NOT complain about I deprecation \n" + " ^\n" + "The argument i is hiding a field from type X\n" + "----------\n" + "8. WARNING in X.java (at line 25)\n" + " someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n", null, true, customOptions);} /* * Test deprecation reporting inside deprecated code */ public void test271(){ Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED); customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.ENABLED); this.runNegativeTest( new String[] { "X.java", "public class X implements I { // should complain about I deprecation \n"+ " \n"+ " /** @deprecated */ \n"+ " public int foo(){ // should complain about foo() deprecation \n"+ " return 0; \n"+ " } \n"+ " public int bar(){ // should complain about bar() deprecation \n"+ " return 0; \n"+ " } \n"+ " \n"+ " I someI; // should complain about I deprecation \n"+ " /** @deprecated */ \n"+ " I otherI; // should complain about I deprecation \n"+ " \n"+ " int i = someI.foo(); // should complain about foo() deprecation \n"+ " \n"+ " /** @deprecated */ \n"+ " int j = someI.bar(); // should complain about bar() deprecation \n"+ " \n"+ " void a(I i){}// should complain about I deprecation \n"+ " /** @deprecated */ \n"+ " void b(I i){}// should complain about I deprecation \n"+ " \n"+ " { \n"+ " someI.foo(); // should complain about foo() deprecation \n"+ " } \n"+ " /** @deprecated */ \n"+ " class M { \n"+ " { \n"+ " someI.foo(); // should complain about foo() deprecation \n"+ " } \n"+ " } \n"+ "} \n", "I.java", "/** @deprecated */ \n"+ "public interface I { \n"+ " \n"+ " /** @deprecated */ \n"+ " int foo(); \n"+ " \n"+ " /** @deprecated */ \n"+ " int bar(); \n"+ " \n"+ " /** @deprecated */ \n"+ " char[] field = \"a\".toCharArray(); \n"+ "} \n" }, "----------\n" + "1. WARNING in X.java (at line 1)\n" + " public class X implements I { // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "2. WARNING in X.java (at line 4)\n" + " public int foo(){ // should complain about foo() deprecation \n" + " ^^^^^\n" + "The method X.foo() overrides a deprecated method from I\n" + "----------\n" + "3. WARNING in X.java (at line 7)\n" + " public int bar(){ // should complain about bar() deprecation \n" + " ^^^^^\n" + "The method X.bar() overrides a deprecated method from I\n" + "----------\n" + "4. WARNING in X.java (at line 11)\n" + " I someI; // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "5. WARNING in X.java (at line 13)\n" + " I otherI; // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "6. WARNING in X.java (at line 15)\n" + " int i = someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n" + "7. WARNING in X.java (at line 18)\n" + " int j = someI.bar(); // should complain about bar() deprecation \n" + " ^^^^^^^^^^^\n" + "The method bar() from the type I is deprecated\n" + "----------\n" + "8. WARNING in X.java (at line 20)\n" + " void a(I i){}// should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "9. WARNING in X.java (at line 20)\n" + " void a(I i){}// should complain about I deprecation \n" + " ^\n" + "The argument i is hiding a field from type X\n" + "----------\n" + "10. WARNING in X.java (at line 22)\n" + " void b(I i){}// should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "11. WARNING in X.java (at line 22)\n" + " void b(I i){}// should complain about I deprecation \n" + " ^\n" + "The argument i is hiding a field from type X\n" + "----------\n" + "12. WARNING in X.java (at line 25)\n" + " someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n" + "13. WARNING in X.java (at line 30)\n" + " someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n", null, true, customOptions); } /* * Test unused import warning in presence of syntax errors * http://bugs.eclipse.org/bugs/show_bug.cgi?id=21022 */ public void test272(){ this.runNegativeTest( new String[] { "X.java", "import java.io.*; \n" + "public class X { \n" + " void foo(){\n" + " ()\n" + " IOException e;\n" + " } \n" + "} \n" }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " ()\n" + " ^^\n" + "Syntax error on tokens, delete these tokens\n" + "----------\n"); } /* * Test exception handling in variable initializer. */ public void test273(){ this.runNegativeTest( new String[] { "X.java", "import java.io.*; \n" + "public class X { \n" + " Object o = foo(); // ko \n" + " { \n" + " foo(); //ok \n" + " } \n"+ " Object foo() throws IOException { \n" + " return this; \n" + " } \n" + "} \n" }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " Object o = foo(); // ko \n" + " ^^^^^\n" + "Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor\n" + "----------\n" + "2. ERROR in X.java (at line 5)\n" + " foo(); //ok \n" + " ^^^^^\n" + "Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor\n" + "----------\n"); } /* * Test unhandled exception reporting in case same exception is declared to be thrown more than once. */ public void test274(){ this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public static void main( String args[] ) {\n" + " new X().foo();\n" + " }\n" + " void foo() throws MyException1, MyException2, MyException1 {}\n" + " class MyException1 extends Exception {}\n" + " class MyException2 extends Exception {}\n" + "}\n", }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " new X().foo();\n" + " ^^^^^^^^^^^^^\n" + "Unhandled exception type X.MyException1\n" + "----------\n" + "2. ERROR in X.java (at line 3)\n" + " new X().foo();\n" + " ^^^^^^^^^^^^^\n" + "Unhandled exception type X.MyException2\n" + "----------\n"); } /* public class X { public final int CST3 = 13; public void bar() { class Local extends C { public final int CST = 10; public final int CST1 = 11; public final int CST2 = 12; void foo(int i){ switch(i){ case this.CST : System.out.println("CST=10"); case CST1 : System.out.println("CST1=11"); case super.CST2 : System.out.println("CST2=12"); case X.this.CST3 : System.out.println("CST2=12"); } } }; } } class C { public final int CST2 = 12; } * */ public void test275() { StringBuffer buffer = new StringBuffer(); buffer .append("public class Test13939 {\r\n"); int[] characters = new int[] { 9, 10, 11, 12, 13, 28, 29, 30, 31, 32, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8203, 8232, 8233, 12288}; for (int i = 0, max = characters.length; i < max; i++) { char c = (char) characters[i]; buffer .append("\tvoid foo" + (int) c + "() {\r\n\t\tchar c") .append((int) c) .append("\\u"); String s = Integer.toHexString(c); int length = s.length(); switch(length) { case 1: buffer.append("000" + s); break; case 2: buffer.append("00" + s); break; case 3: buffer.append("0" + s); break; default: buffer.append(s); break; } buffer.append(";\r\n\t}\r\n"); } buffer.append("\r\n}\r\n"); this.runNegativeTest( new String[] { "Test13939.java", buffer.toString() }, "----------\n" + "1. ERROR in Test13939.java (at line 9)\n" + " char c11\\u000b;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "2. ERROR in Test13939.java (at line 18)\n" + " char c28\\u001c;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "3. ERROR in Test13939.java (at line 21)\n" + " char c29\\u001d;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "4. ERROR in Test13939.java (at line 24)\n" + " char c30\\u001e;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "5. ERROR in Test13939.java (at line 27)\n" + " char c31\\u001f;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "6. ERROR in Test13939.java (at line 33)\n" + " char c5760\\u1680;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "7. ERROR in Test13939.java (at line 36)\n" + " char c8192\\u2000;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "8. ERROR in Test13939.java (at line 39)\n" + " char c8193\\u2001;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "9. ERROR in Test13939.java (at line 42)\n" + " char c8194\\u2002;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "10. ERROR in Test13939.java (at line 45)\n" + " char c8195\\u2003;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "11. ERROR in Test13939.java (at line 48)\n" + " char c8196\\u2004;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "12. ERROR in Test13939.java (at line 51)\n" + " char c8197\\u2005;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "13. ERROR in Test13939.java (at line 54)\n" + " char c8198\\u2006;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "14. ERROR in Test13939.java (at line 57)\n" + " char c8199\\u2007;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "15. ERROR in Test13939.java (at line 60)\n" + " char c8200\\u2008;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "16. ERROR in Test13939.java (at line 63)\n" + " char c8201\\u2009;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "17. ERROR in Test13939.java (at line 66)\n" + " char c8202\\u200a;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "18. ERROR in Test13939.java (at line 69)\n" + " char c8203\\u200b;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "19. ERROR in Test13939.java (at line 72)\n" + " char c8232\\u2028;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "20. ERROR in Test13939.java (at line 75)\n" + " char c8233\\u2029;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "21. ERROR in Test13939.java (at line 78)\n" + " char c12288\\u3000;\n" + " ^^^^^^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" ); } /* * Test if the argument is resolved when qualifier cannot be resolved. */ public void test276() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public void foo(X x){ \n" + " } \n" + " public void foo(){ \n" + " new Y().foo(new X(1)); \n" + " } \n" + "} \n", }, "----------\n" + "1. ERROR in X.java (at line 5)\n" + " new Y().foo(new X(1)); \n" + " ^\n" + "Y cannot be resolved or is not a type\n" + "----------\n" + "2. ERROR in X.java (at line 5)\n" + " new Y().foo(new X(1)); \n" + " ^^^^^^^^\n" + "The constructor X(int) is undefined\n" + "----------\n"); } public void test278() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public class Inner{ \n" + " public Inner(X x) { \n" + " } \n" + " } \n" + " public void foo(){ \n" + " thiz.new Inner(new X(1)); \n" + " } \n" + "} \n", }, "----------\n" + "1. ERROR in X.java (at line 7)\n" + " thiz.new Inner(new X(1)); \n" + " ^^^^\n" + "thiz cannot be resolved\n" + "----------\n" + "2. ERROR in X.java (at line 7)\n" + " thiz.new Inner(new X(1)); \n" + " ^^^^^^^^\n" + "The constructor X(int) is undefined\n" + "----------\n"); } public void test279() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public class Inner{ \n" + " public Inner(X x) { \n" + " } \n" + " } \n" + " public void foo(){ \n" + " thiz.new Innerz(new X()); \n" + " } \n" + "} \n", }, "----------\n" + "1. ERROR in X.java (at line 7)\n" + " thiz.new Innerz(new X()); \n" + " ^^^^\n" + "thiz cannot be resolved\n" + "----------\n"); } public void test280() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public class Inner{ \n" + " public Inner(X x) { \n" + " } \n" + " } \n" + " public void foo(){ \n" + " thiz.new Innerz(new X(1)); \n" + " } \n" + "} \n", }, "----------\n" + "1. ERROR in X.java (at line 7)\n" + " thiz.new Innerz(new X(1)); \n" + " ^^^^\n" + "thiz cannot be resolved\n" + "----------\n" + "2. ERROR in X.java (at line 7)\n" + " thiz.new Innerz(new X(1)); \n" + " ^^^^^^^^\n" + "The constructor X(int) is undefined\n" + "----------\n"); } public void test282() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public class Inner{ \n" + " public Inner(X x) { \n" + " } \n" + " } \n" + " public void foo(){ \n" + " new Innerz(new X()) { \n" + " }; \n" + " } \n" + "} \n", }, "----------\n" + "1. ERROR in X.java (at line 7)\n" + " new Innerz(new X()) { \n" + " ^^^^^^\n" + "Innerz cannot be resolved or is not a type\n" + "----------\n"); } public void test283() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public class Inner{ \n" + " public Inner(X x) { \n" + " } \n" + " } \n" + " public void foo(){ \n" + " new Innerz(new X(1)) { \n" + " }; \n" + " } \n" + "} \n", }, "----------\n" + "1. ERROR in X.java (at line 7)\n" + " new Innerz(new X(1)) { \n" + " ^^^^^^\n" + "Innerz cannot be resolved or is not a type\n" + "----------\n" + "2. ERROR in X.java (at line 7)\n" + " new Innerz(new X(1)) { \n" + " ^^^^^^^^\n" + "The constructor X(int) is undefined\n" + "----------\n"); } /* * Check diagnosis for unused local variable, if only used in fake reachable code (should not report as unused) * http://bugs.eclipse.org/bugs/show_bug.cgi?id=22581 */ public void test284() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING); this.runNegativeTest( new String[] { "Test.java", "public class Test { \n"+ " static final boolean DEBUG = false; \n"+ " private void doTest() { \n"+ " long time; \n"+ " if (DEBUG){ \n"+ " time = System.currentTimeMillis(); \n"+ " } \n"+ " System.out.println(\"bob\"); \n"+ " if (DEBUG) { \n"+ " System.out.println(\"Bob takes: \" + (System.currentTimeMillis() - time) + \" ms\"); \n"+ " } \n"+ " int i = 0; \n"+ " if (DEBUG){ \n"+ " int j = 1; \n"+ " j++; \n"+ " } \n"+ " } \n"+ "} \n", }, "----------\n" + "1. WARNING in Test.java (at line 3)\n" + " private void doTest() { \n" + " ^^^^^^^^\n" + "The private method doTest() from the type Test is never used locally\n" + "----------\n" + "2. WARNING in Test.java (at line 12)\n" + " int i = 0; \n" + " ^\n" + "The local variable i is never read\n" + "----------\n" , null, true, customOptions); } /* * Check diagnosis for unused local variable, if only used in fake reachable code (should not report as unused) * http://bugs.eclipse.org/bugs/show_bug.cgi?id=22581 * More complete test case * The criteria: * -differentiate runtime used from compile-time used * -differentiate conditionnally from definitely unreachable code. */ public void test285() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " static final boolean FALSE = false; \n"+ " static final boolean TRUE = true; \n"+ " \n"+ " void unread1() { \n"+ " Object obj = \"dummy\"; \n"+ " //obj reported as not runtime-read because of shortcut OR below, although compiletime-used \n"+ " //cannot remove variable without impact for compile-time \n"+ " if (TRUE || obj != null) { \n"+ " doit(null); \n"+ " } \n"+ " } \n"+ " \n"+ " void unread2() { \n"+ " Object obj = \"dummy\"; \n"+ " //obj reported as not runtime-used, although compiletime-used \n"+ " //cannot remove variable without impact for compile-time \n"+ " if (FALSE) { \n"+ " doit(obj); \n"+ " } \n"+ " \n"+ " if (false) { \n"+ " doit(obj); \n"+ " } \n"+ " } \n"+ " \n"+ " void unread3() { \n"+ " Object obj = \"dummy\"; \n"+ " //obj reported as not runtime-used, and actually not compiletime-used too \n"+ " doit(null); \n"+ " } \n"+ " \n"+ " void unreachable1() { \n"+ " Object obj = \"dummy\"; \n"+ " \n"+ " if (false) { \n"+ " doit(obj); //this is DEFINITELY unreachable code, but is not recognized as such \n"+ " } \n"+ " \n"+ " if (FALSE) { \n"+ " doit(obj); //this is conditionnally unreachable code, but is not recognized as such \n"+ " } \n"+ " \n"+ " while (false) { \n"+ " doit(obj); //this is DEFINITELY unreachable code, and is recognized as such, with error \n"+ " } \n"+ " \n"+ " while (FALSE) { \n"+ " doit(obj); //this is conditionnally unreachable code, but is recognized as definitely unreacheable code, with error \n"+ " } \n"+ " \n"+ " for (; false;) { \n"+ " doit(obj); //this is DEFINITELY unreachable code, but is recognized as definitely unreacheable code, with error \n"+ " } \n"+ " \n"+ " for (; FALSE;) { \n"+ " doit(obj); //this is conditionnally unreachable code, but is recognized as definitely unreacheable code, with error \n"+ " } \n"+ " \n"+ " int i = (false ? doit(\"0\") : doit(\"1\")); \n"+ " //doit(\"0\") is DEFINITELY unreachable code, but is not recognized as such \n"+ " \n"+ " int j = (FALSE ? doit(\"0\") : doit(\"1\")); \n"+ " //doit(\"0\") is conditionnally unreachable code, but is not recognized as such \n"+ " } \n"+ " \n"+ " void unreachable2() { \n"+ " Object obj = \"dummy\"; \n"+ " //obj reported as not runtime-used, although compiletime-used \n"+ " //cannot remove variable without impact for compile-time \n"+ " if (TRUE) { \n"+ " throw new RuntimeException(); \n"+ " } \n"+ " \n"+ " //since the variable is supposed to be unused, \n"+ " //how can this following code not be declared unreacheable? \n"+ " doit(obj); //this is conditionnally unreachable code \n"+ " } \n"+ " \n"+ " void unreachable3() { \n"+ " Object obj = \"dummy\"; \n"+ " //obj reported as not runtime-used, although compiletime-used \n"+ " //cannot remove variable without impact for compile-time \n"+ " \n"+ " if (true) { \n"+ " throw new RuntimeException(); \n"+ " } \n"+ " \n"+ " //since the variable is supposed to be unused, \n"+ " //how can this code not be declared unreacheable? \n"+ " doit(obj); //this is DEFINITELY unreachable code \n"+ " } \n"+ " \n"+ " //------------------ \n"+ " \n"+ " int doit(Object obj) { \n"+ " System.out.println(\"hey\" + obj); \n"+ " return obj == null ? 0 : 1; \n"+ " } \n"+ "}", }, "----------\n" + "1. WARNING in X.java (at line 28)\n" + " Object obj = \"dummy\"; \n" + " ^^^\n" + "The local variable obj is never read\n" + "----------\n" + "2. ERROR in X.java (at line 44)\n" + " while (false) { \n" + " doit(obj); //this is DEFINITELY unreachable code, and is recognized as such, with error \n" + " } \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "3. ERROR in X.java (at line 48)\n" + " while (FALSE) { \n" + " doit(obj); //this is conditionnally unreachable code, but is recognized as definitely unreacheable code, with error \n" + " } \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "4. ERROR in X.java (at line 52)\n" + " for (; false;) { \n" + " doit(obj); //this is DEFINITELY unreachable code, but is recognized as definitely unreacheable code, with error \n" + " } \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" + "5. ERROR in X.java (at line 56)\n" + " for (; FALSE;) { \n" + " doit(obj); //this is conditionnally unreachable code, but is recognized as definitely unreacheable code, with error \n" + " } \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Unreachable code\n" + "----------\n" , null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=24559 */ public void test286() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n"+ " public void run(X result) {\n"+ " //TODO:hkjhkhkj\n"+ " result.run(this);\n"+ " }\n"+ "}" }, "----------\n" + "1. WARNING in p\\X.java (at line 4)\n" + " //TODO:hkjhkhkj\n" + " ^^^^^^^^^^^^^\n" + "TODO: hkjhkhkj\n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=24559 */ public void test287() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n"+ " public void run(X result) {\n"+ "{\n"+ " //TODO:hkjhkhkj\n"+ " result.run(this);\n"+ " }\n"+ "}" }, "----------\n" + "1. WARNING in p\\X.java (at line 5)\n" + " //TODO:hkjhkhkj\n" + " ^^^^^^^^^^^^^\n" + "TODO: hkjhkhkj\n" + "----------\n" + "2. ERROR in p\\X.java (at line 8)\n" + " }\n" + " ^\n" + "Syntax error, insert \"}\" to complete ClassBody\n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=24744 */ public void test288() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X {\n"+ "}\n"+ "// TODO: something\n" }, "----------\n" + "1. WARNING in p\\X.java (at line 4)\n" + " // TODO: something\n" + " ^^^^^^^^^^^^^^^\n" + "TODO: something\n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=24833 */ public void test289() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:"); this.runNegativeTest( new String[] { "X.java", "// TODO: something\n" }, "----------\n" + "1. WARNING in X.java (at line 1)\n" + " // TODO: something\n" + " ^^^^^^^^^^^^^^^\n" + "TODO: something\n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=25298 */ public void test290() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "A.java", "public class A {\n" + " void foo() {\n" + " System.out.println(\n" + " \"a\" +\n" + " \"b\" +\n" + " \"c\" +\n" + " \"d\" +\n" + " \"e\"\n" + " );\n" + " } \n" + "}" }, "----------\n" + "1. ERROR in A.java (at line 4)\n" + " \"a\" +\n" + " ^^^\n" + "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n" + "2. ERROR in A.java (at line 5)\n" + " \"b\" +\n" + " ^^^\n" + "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n" + "3. ERROR in A.java (at line 6)\n" + " \"c\" +\n" + " ^^^\n" + "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n" + "4. ERROR in A.java (at line 7)\n" + " \"d\" +\n" + " ^^^\n" + "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n" + "5. ERROR in A.java (at line 8)\n" + " \"e\"\n" + " ^^^\n" + "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n", null, true, customOptions); } // http://dev.eclipse.org/bugs/show_bug.cgi?id=26124 public void test292() { this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " void foo() { \n" + " a: break a; //ok \n" + " b: break; //ko \n" + " while(true) c: break; //ok (break while) \n" + " d: continue; //ko \n" + " while(true) e: continue; //ok (continue while) \n" + " } \n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " b: break; //ko \n" + " ^^^^^\n" + "break cannot be used outside of a loop or a switch\n" + "----------\n" + "2. ERROR in X.java (at line 6)\n" + " d: continue; //ko \n" + " ^^^^^^^^\n" + "continue cannot be used outside of a loop\n" + "----------\n"); } // should only complain once for unreachable code (against first unreachable statement) public void test293() { this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " void bar() { \n" + " return; \n" + " bar(); //1 \n" + " bar(); //2 \n" + " bar(); //3 \n" + " } \n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " bar(); //1 \n" + " ^^^^^\n" + "Unreachable code\n" + "----------\n"); } // http://dev.eclipse.org/bugs/show_bug.cgi?id=26142 public void test294() { this.runNegativeTest( new String[] { "X.java", "public class X {} /*" }, "----------\n" + "1. ERROR in X.java (at line 1)\n" + " public class X {} /*\n" + " ^^\n" + "Unexpected end of comment\n" + "----------\n"); } // http://dev.eclipse.org/bugs/show_bug.cgi?id=26142 public void test295() { this.runNegativeTest( new String[] { "X.java", "class X {} \\" }, "----------\n" + "1. ERROR in X.java (at line 1)\n" + " class X {} \\\n" + " ^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n"); } public void test296() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:,#todo#"); this.runNegativeTest( new String[] { "p/X.java", "public class X {" + " /**\n" + " * TODO:commentTODO:comment 2#todo#\n" + " */\n" + " // TODO:comment 3#todo#comment 4TODO:\n" + " /**\n" + " * TODO:comment 5 TODO:comment 6 #todo# \n" + " */\n" + " // #todo#comment 7 TODO:comment 8 TODO: \n" + "}" }, "----------\n" + "1. WARNING in p\\X.java (at line 2)\n" + " * TODO:commentTODO:comment 2#todo#\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "TODO: commentTODO:comment 2\n" + "----------\n" + "2. WARNING in p\\X.java (at line 2)\n" + " * TODO:commentTODO:comment 2#todo#\n" + " ^^^^^^\n" + "#todo# \n" + "----------\n" + "3. WARNING in p\\X.java (at line 4)\n" + " // TODO:comment 3#todo#comment 4TODO:\n" + " ^^^^^^^^^^^^^^\n" + "TODO: comment 3\n" + "----------\n" + "4. WARNING in p\\X.java (at line 4)\n" + " // TODO:comment 3#todo#comment 4TODO:\n" + " ^^^^^^^^^^^^^^^^^^^^\n" + "#todo# comment 4TODO:\n" + "----------\n" + "5. WARNING in p\\X.java (at line 6)\n" + " * TODO:comment 5 TODO:comment 6 #todo# \n" + " ^^^^^^^^^^^^^^\n" + "TODO: comment 5\n" + "----------\n" + "6. WARNING in p\\X.java (at line 6)\n" + " * TODO:comment 5 TODO:comment 6 #todo# \n" + " ^^^^^^^^^^^^^^\n" + "TODO: comment 6\n" + "----------\n" + "7. WARNING in p\\X.java (at line 6)\n" + " * TODO:comment 5 TODO:comment 6 #todo# \n" + " ^^^^^^\n" + "#todo# \n" + "----------\n" + "8. WARNING in p\\X.java (at line 8)\n" + " // #todo#comment 7 TODO:comment 8 TODO: \n" + " ^^^^^^^^^^^^^^^\n" + "#todo# comment 7\n" + "----------\n" + "9. WARNING in p\\X.java (at line 8)\n" + " // #todo#comment 7 TODO:comment 8 TODO: \n" + " ^^^^^^^^^^^^^^\n" + "TODO: comment 8\n" + "----------\n" + "10. WARNING in p\\X.java (at line 8)\n" + " // #todo#comment 7 TODO:comment 8 TODO: \n" + " ^^^^^\n" + "TODO: \n" + "----------\n", null, true, customOptions); } // checking for captured outer local initialization status // NOTE: only complain against non-inlinable outer locals // http://bugs.eclipse.org/bugs/show_bug.cgi?id=26134 public void test297() { this.runNegativeTest( new String[] { "X.java", "public class X { \n" + " public static void main(String[] args) { \n" + " String nonInlinedString = \"[Local]\"; \n" + " int i = 2; \n" + " switch(i){ \n" + " case 1: \n" + " final String displayString = nonInlinedString;\n" + " final String inlinedString = \"a\"; \n" + " class Local { \n" + " public String toString() { \n" + " return inlinedString + displayString; \n" + " } \n" + " } \n" + " case 2: \n" + " System.out.print(new Local()); \n" + " System.out.print(\"-\"); \n" + " System.out.println(new Local(){ \n" + " public String toString() { \n" + " return super.toString()+\": anonymous\"; \n" + " } \n" + " }); \n" + " } \n" + " } \n" + "} \n", }, "----------\n" + "1. ERROR in X.java (at line 15)\n" + " System.out.print(new Local()); \n" + " ^^^^^^^^^^^\n" + "The local variable displayString may not have been initialized\n" + "----------\n" + "2. ERROR in X.java (at line 17)\n" + " System.out.println(new Local(){ \n" + " public String toString() { \n" + " return super.toString()+\": anonymous\"; \n" + " } \n" + " }); \n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "The local variable displayString may not have been initialized\n" + "----------\n"); } // checking for deprecation reporting for qualified names // http://bugs.eclipse.org/bugs/show_bug.cgi?id=26664 public void test298() { this.runNegativeTest( new String[] { "X.java", //-------------------------------- "public class X { \n" + " public static void main(String[] args) { \n" + " System.out.println(INew.Constant); \n" + " System.out.println(Old.Constant); // should report deprecation \n" + " } \n" + "} \n", "INew.java", //-------------------------------- "public interface INew { \n" + " public static final int Constant = 42; \n" + "} \n", "Old.java", //-------------------------------- "/** @deprecated */ \n" + "public interface Old extends INew { \n" + "} \n", }, "----------\n" + "1. WARNING in X.java (at line 4)\n" + " System.out.println(Old.Constant); // should report deprecation \n" + " ^^^^^^^^^^^^\n" + "The type Old is deprecated\n" + "----------\n"); } // recursive constructor invocation // http://bugs.eclipse.org/bugs/show_bug.cgi?id=26195 public void test299() { this.runNegativeTest( new String[] { "TestEclipseBug.java", //-------------------------------- "public class TestEclipseBug { \n" + " private Object root; \n" + " private Number count; \n" + " public TestEclipseBug(Class rootClass) { \n" + " this(rootClass, null); \n" + " } \n" + " public TestEclipseBug(Class rootClass, Number count) { \n" + " this.root=rootClass; \n" + " this.count=count; \n" + " } \n" + " public TestEclipseBug(String objEntityName) { \n" + " this(objEntityName); // recursive constructor call \n" + " } \n" + " public TestEclipseBug(String aName, Number count) { \n" + " this.root=aName; \n" + " this.count=count; \n" + " } \n" + "} \n", }, "----------\n" + "1. WARNING in TestEclipseBug.java (at line 2)\n" + " private Object root; \n" + " ^^^^\n" + "The private field TestEclipseBug.root is never read locally\n" + "----------\n" + "2. WARNING in TestEclipseBug.java (at line 3)\n" + " private Number count; \n" + " ^^^^^\n" + "The private field TestEclipseBug.count is never read locally\n" + "----------\n" + "3. ERROR in TestEclipseBug.java (at line 12)\n" + " this(objEntityName); // recursive constructor call \n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Recursive constructor invocation TestEclipseBug(String)\n" + "----------\n"); } // non-visible member type import // http://bugs.eclipse.org/bugs/show_bug.cgi?id=26841 public void test300() { this.runNegativeTest( new String[] { "p/X.java", //-------------------------------- "package p; \n" + "public class X { \n" + " private class Y { \n" + " public class Z { \n" + " } \n" + " } \n" + "} \n", "q/Y.java", //-------------------------------- "package q; \n" + "import p.X.Y.Z; \n" + "public class Y extends p.X.Y.Z { \n" + "} \n", }, "----------\n" + "1. WARNING in p\\X.java (at line 3)\n" + " private class Y { \n" + " ^\n" + "The private type X.Y is never used locally\n" + "----------\n" + "----------\n" + "1. ERROR in q\\Y.java (at line 2)\n" + " import p.X.Y.Z; \n" + " ^^^^^\n" + "The imported type p.X.Y is not visible\n" + "----------\n" + "2. ERROR in q\\Y.java (at line 3)\n" + " public class Y extends p.X.Y.Z { \n" + " ^^^^^^^\n" + "Superclass p.X.Y is not visible\n" + "----------\n" ); } /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=28617 */ public void test301() { this.runNegativeTest( new String[] { "A.java", //-------------------------------- "public class A {\n" + " class B {\n" + " public String toString() {\n" + " return (A.super).toString();\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in A.java (at line 4)\n" + " return (A.super).toString();\n" + " ^^^^^^^^^\n" + "Invalid parenthesized expression\n" + "----------\n"); } /** * http://bugs.eclipse.org/bugs/show_bug.cgi?id=29365 */ public void test302() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "A.java", //-------------------------------- "public class A {\n" + " public static void main(String[] args) { \n" + " System.out.println(\"Hello\"); //$NON-NLS-1$ \n" + "}", }, "----------\n" + "1. ERROR in A.java (at line 4)\n" + " }\n" + " ^\n" + "Syntax error, insert \"}\" to complete ClassBody\n" + "----------\n", null, true, customOptions); } public void test304() { this.runNegativeTest( new String[] { "I.java", //-------------------------------- "interface I { \n"+ " int finalize(); \n"+ "} \n", "J.java", //-------------------------------- "interface J extends I { \n"+ " double finalize(); \n"+ "} \n" }, "----------\n" + "1. WARNING in I.java (at line 2)\n" + " int finalize(); \n" + " ^^^^^^^^^^\n" + "The return type is incompatible with Object.finalize(), thus this interface cannot be implemented\n" + "----------\n" + "----------\n" + "1. WARNING in J.java (at line 2)\n" + " double finalize(); \n" + " ^^^^^^^^^^\n" + "The return type is incompatible with Object.finalize(), thus this interface cannot be implemented\n" + "----------\n" + "2. ERROR in J.java (at line 2)\n" + " double finalize(); \n" + " ^^^^^^^^^^\n" + "The return type is incompatible with I.finalize()\n" + "----------\n" ); } // check private unused detection public void test305() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private int foo() { \n"+ " return 0; \n"+ " } \n"+ " private X(){ //block instantiation\n"+ " } \n"+ " private X(int i){ \n"+ " } \n"+ "} \n" }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private int foo() { \n" + " ^^^^^\n" + "The private method foo() from the type X is never used locally\n" + "----------\n" + "2. WARNING in X.java (at line 7)\n" + " private X(int i){ \n" + " ^^^^^^^^\n" + "The private constructor X(int) is never used locally\n" + "----------\n"); } // no private unused if syntax error public void test306() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private int foo() { \n"+ " return 0; \n"+ " } \n"+ " private X(){ //block instantiation\n"+ " } \n"+ " private X(int i){ \n"+ " } \n"+ " int foo1 \n"+ "} \n" }, "----------\n" + "1. ERROR in X.java (at line 9)\n" + " int foo1 \n" + " ^^^^\n" + "Syntax error, insert \";\" to complete FieldDeclaration\n" + "----------\n"); } // check private unused detection public void test307() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private int foo() { \n"+ " return 0; \n"+ " } \n"+ " private X(){ //block instantiation\n"+ " } \n"+ " private X(int i){ \n"+ " } \n"+ "} \n", "Y.java", "public class Y extends X { \n"+ " int y = foo(); \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private int foo() { \n" + " ^^^^^\n" + "The private method foo() from the type X is never used locally\n" + "----------\n" + "2. WARNING in X.java (at line 7)\n" + " private X(int i){ \n" + " ^^^^^^^^\n" + "The private constructor X(int) is never used locally\n" + "----------\n" + "----------\n" + "1. ERROR in Y.java (at line 1)\n" + " public class Y extends X { \n" + " ^\n" + "Implicit super constructor X() is not visible for default constructor. Must define an explicit constructor\n" + "----------\n" + "2. ERROR in Y.java (at line 2)\n" + " int y = foo(); \n" + " ^^^\n" + "The method foo() from the type X is not visible\n" + "----------\n"); } // check private unused detection public void test308() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private int foo() { \n"+ " return 0; \n"+ " } \n"+ " private X(){ //block instantiation\n"+ " } \n"+ " private X(int i){ \n"+ " } \n"+ "} \n"+ "class Y { \n"+ " int y = new X(0).foo(); \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private int foo() { \n" + " ^^^^^\n" + "The private method foo() from the type X is never used locally\n" + "----------\n" + "2. WARNING in X.java (at line 7)\n" + " private X(int i){ \n" + " ^^^^^^^^\n" + "The private constructor X(int) is never used locally\n" + "----------\n" + "3. ERROR in X.java (at line 11)\n" + " int y = new X(0).foo(); \n" + " ^^^^^^^^\n" + "The constructor X(int) is not visible\n" + "----------\n" + "4. ERROR in X.java (at line 11)\n" + " int y = new X(0).foo(); \n" + " ^^^\n" + "The method foo() from the type X is not visible\n" + "----------\n"); } // check private unused detection public void test309() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private class M {} \n"+ " private int f; \n"+ "} \n"+ "class Y { \n"+ " int y = new X().f; \n"+ " X.M xm = new X().new M(); \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private class M {} \n" + " ^\n" + "The private type X.M is never used locally\n" + "----------\n" + "2. WARNING in X.java (at line 3)\n" + " private int f; \n" + " ^\n" + "The private field X.f is never read locally\n" + "----------\n" + "3. ERROR in X.java (at line 6)\n" + " int y = new X().f; \n" + " ^\n" + "The field f is not visible\n" + "----------\n" + "4. ERROR in X.java (at line 7)\n" + " X.M xm = new X().new M(); \n" + " ^^^\n" + "The type X.M is not visible for the field Y.xm\n" + "----------\n" + "5. ERROR in X.java (at line 7)\n" + " X.M xm = new X().new M(); \n" + " ^\n" + "The type X.M is not visible\n" + "----------\n"); } // check private unused detection public void test310() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private class M { \n"+ " { X.this.foo(); } \n"+ " { X.this.f++; } \n"+ " } \n"+ " private void foo() {} \n"+ " private int f; \n"+ "} \n"+ "class Y { \n"+ " int y = new X().f; \n"+ " X.M xm = new X().new M(); \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private class M { \n" + " ^\n" + "The private type X.M is never used locally\n" + "----------\n" + "2. WARNING in X.java (at line 3)\n" + " { X.this.foo(); } \n" + " ^^^^^^^^^^^^\n" + "Access to enclosing method foo() from the type X is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "3. WARNING in X.java (at line 4)\n" + " { X.this.f++; } \n" + " ^^^^^^^^\n" + "Write access to enclosing field X.f is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "4. WARNING in X.java (at line 4)\n" + " { X.this.f++; } \n" + " ^^^^^^^^\n" + "Read access to enclosing field X.f is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "5. ERROR in X.java (at line 10)\n" + " int y = new X().f; \n" + " ^\n" + "The field f is not visible\n" + "----------\n" + "6. ERROR in X.java (at line 11)\n" + " X.M xm = new X().new M(); \n" + " ^^^\n" + "The type X.M is not visible for the field Y.xm\n" + "----------\n"+ "7. ERROR in X.java (at line 11)\n" + " X.M xm = new X().new M(); \n" + " ^\n" + "The type X.M is not visible\n" + "----------\n"); } /** * check receiver type visibility issue for array type Object methods */ public void test311() { this.runNegativeTest( new String[] { "X.java", //-------------------------------- "public class X {\n" + " public static void main(String[] arguments) {\n" + " System.out.println(p.Bar.array.toString());\n" + " }\n" + "}\n", "p/Bar.java", //---------------------------- "package p;\n" + "public class Bar {\n" + " public static Z[] array;\n" + "}\n" + "class Z {\n" + "}\n" }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " System.out.println(p.Bar.array.toString());\n" + " ^^^^^^^^^^^\n" + "The type Z is not visible\n" + "----------\n"); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=30282 */ public void test312() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:,#todo#"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "/** \n"+ " * TODO:todo1 \n" + " *\n"+ " *\n"+ " *\n"+ " *\n"+ " * #todo# second todo TODO: third todo\n" + " */ \n"+ "public class X { \n"+ "}" }, "----------\n" + "1. WARNING in p\\X.java (at line 3)\n" + " * TODO:todo1 \n" + " ^^^^^^^^^^\n" + "TODO: todo1\n" + "----------\n" + "2. WARNING in p\\X.java (at line 8)\n" + " * #todo# second todo TODO: third todo\n" + " ^^^^^^^^^^^^^^^^^^\n" + "#todo# second todo\n" + "----------\n" + "3. WARNING in p\\X.java (at line 8)\n" + " * #todo# second todo TODO: third todo\n" + " ^^^^^^^^^^^^^^^^\n" + "TODO: third todo\n" + "----------\n", null, true, customOptions); } //derived from http://bugs.eclipse.org/bugs/show_bug.cgi?id=30704 public void test313() { this.runNegativeTest( new String[] { "A.java", "public class A {\n" + " public static void main(String[] args) {\n" + " int i = 01e0; \n" + " }\n" + "}", }, "----------\n" + "1. ERROR in A.java (at line 3)\n" + " int i = 01e0; \n" + " ^\n" + "Type mismatch: cannot convert from double to int\n" + "----------\n"); } /** * Test unused parameter reporting */ public void test324() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "p/X.java", //================================ "package p; \n" + "public abstract class X implements I { \n" + " void unused(int someParam0) {} \n" + " public static void main(String[] args) {} \n" + " public void foo(int someParam1) {} \n" + " public abstract void bar(int someParam2); \n" + " { \n" + " new X() { \n" + " public void foo(int someParam3) {} \n" + " public void bar(int someParam4) {} \n" + " }; \n" + " } \n" + "} \n" + "interface I { \n" + " void foo(int someParam5); \n" + "} \n" }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " void unused(int someParam0) {} \n" + " ^^^^^^^^^^\n" + "The argument someParam0 is never read\n" + "----------\n", null, true, customOptions); } /** * Test unused parameter reporting */ public void test325() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.DISABLED); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.ENABLED); this.runNegativeTest( new String[] { "p/X.java", //================================ "package p; \n" + "public abstract class X implements I { \n" + " void unused(int someParam0) {} \n" + " public static void main(String[] args) {} \n" + " public void foo(int someParam1) {} \n" + " public abstract void bar(int someParam2); \n" + " public void concrete(int someParam3){} \n" + " { \n" + " new X() { \n" + " public void foo(int someParam4) {} \n" + " public void bar(int someParam5) {} \n" + " public void concrete(int someParam6) {} \n" + " }; \n" + " } \n" + "} \n" + "interface I { \n" + " void foo(int someParam7); \n" + "} \n" }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " void unused(int someParam0) {} \n" + " ^^^^^^^^^^\n" + "The argument someParam0 is never read\n" + "----------\n" + "2. ERROR in p\\X.java (at line 7)\n" + " public void concrete(int someParam3){} \n" + " ^^^^^^^^^^\n" + "The argument someParam3 is never read\n" + "----------\n" + "3. ERROR in p\\X.java (at line 12)\n" + " public void concrete(int someParam6) {} \n" + " ^^^^^^^^^^\n" + "The argument someParam6 is never read\n" + "----------\n", null, true, customOptions); } /** * Test unused parameter reporting */ public void test326() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.ERROR); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, CompilerOptions.ENABLED); customOptions.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "p/X.java", //================================ "package p; \n" + "public abstract class X implements I { \n" + " void unused(int someParam0) {} \n" + " public static void main(String[] args) {} \n" + " public void foo(int someParam1) {} \n" + " public abstract void bar(int someParam2); \n" + " public void concrete(int someParam3){} \n" + " { \n" + " new X() { \n" + " public void foo(int someParam4) {} \n" + " public void bar(int someParam5) {} \n" + " public void concrete(int someParam6) {} \n" + " }; \n" + " } \n" + "} \n" + "interface I { \n" + " void foo(int someParam7); \n" + "} \n" }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " void unused(int someParam0) {} \n" + " ^^^^^^^^^^\n" + "The argument someParam0 is never read\n" + "----------\n" + "2. ERROR in p\\X.java (at line 5)\n" + " public void foo(int someParam1) {} \n" + " ^^^^^^^^^^\n" + "The argument someParam1 is never read\n" + "----------\n" + "3. ERROR in p\\X.java (at line 7)\n" + " public void concrete(int someParam3){} \n" + " ^^^^^^^^^^\n" + "The argument someParam3 is never read\n" + "----------\n" + "4. ERROR in p\\X.java (at line 10)\n" + " public void foo(int someParam4) {} \n" + " ^^^^^^^^^^\n" + "The argument someParam4 is never read\n" + "----------\n" + "5. ERROR in p\\X.java (at line 11)\n" + " public void bar(int someParam5) {} \n" + " ^^^^^^^^^^\n" + "The argument someParam5 is never read\n" + "----------\n", null, true, customOptions); } /** * Test unused member reporting - ignore serialization support */ public void test327() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "p/X.java", //================================ "package p; \n" + "public class X implements java.io.Serializable { \n" + " private static final long serialVersionUID = 1; \n" + " private void readObject(java.io.ObjectInputStream s) {} \n" + " private void writeObject(java.io.ObjectOutputStream s) {} \n" + " private Object readResolve() { return null; } \n" + " private Object writeReplace() { return null; } \n" + " private void unused(){ \n" + // should complain " class Local {}; \n" + " new Object() { \n" + " private void readObject(Local loc) {} \n"+ // should complain " }; \n" + " } \n" + "} \n" }, "----------\n" + "1. ERROR in p\\X.java (at line 8)\n" + " private void unused(){ \n" + " ^^^^^^^^\n" + "The private method unused() from the type X is never used locally\n" + "----------\n" + "2. ERROR in p\\X.java (at line 11)\n" + " private void readObject(Local loc) {} \n" + " ^^^^^^^^^^^^^^^^^^^^^\n" + "The private method readObject(Local) from the type is never used locally\n" + "----------\n", null, true, customOptions); } /** * 31867 - Test unused duplicate import */ public void test328() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "p/X.java", //================================ "package p; \n" + " import java.io.*; \n" + " import java.io.*; // duplicate\n" + " import java.io.IOException; \n" + " import java.io.IOException; // duplicate\n" + " import java.lang.*; //implicit duplicate\n" + "public class X extends IOException implements Serializable { \n" + "} \n" }, "----------\n" + "1. ERROR in p\\X.java (at line 3)\n" + " import java.io.*; // duplicate\n" + " ^^^^^^^\n" + "The import java.io is never used\n" + "----------\n" + "2. ERROR in p\\X.java (at line 5)\n" + " import java.io.IOException; // duplicate\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "The import java.io.IOException is never used\n" + "----------\n" + "3. ERROR in p\\X.java (at line 6)\n" + " import java.lang.*; //implicit duplicate\n" + " ^^^^^^^^^\n" + "The import java.lang is never used\n" + "----------\n", null, true, customOptions); } /** * 31628 - Test unused import matching package name */ public void test329() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "p/X.java", //================================ "package p; \n" + " import p.*; \n" + "public class X { \n" + "} \n" }, "----------\n" + "1. ERROR in p\\X.java (at line 2)\n" + " import p.*; \n" + " ^\n" + "The import p is never used\n" + "----------\n", null, true, customOptions); } // check private unused detection // 31765 - private recursive methods not marked as unused public void test331() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private void foo(int i) { \n"+ " if (i > 0) foo(1); \n"+ " new Object(){ \n"+ " void bar() { \n"+ " foo(2); \n"+ " } \n"+ " }; \n"+ " } \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private void foo(int i) { \n" + " ^^^^^^^^^^\n" + "The private method foo(int) from the type X is never used locally\n" + "----------\n" + "2. WARNING in X.java (at line 6)\n" + " foo(2); \n" + " ^^^^^^\n" + "Access to enclosing method foo(int) from the type X is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n"); } // check private unused detection // 31765 - private recursive methods not marked as unused // variation for not considering usage from within private type public void test332() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private class Member { \n" + " private Member foo(int i) { \n"+ " if (i > 0) return foo(1); \n"+ " return new Object(){ \n"+ " Member bar() { \n"+ " return foo(2); \n"+ " } \n"+ " }.bar(); \n"+ " } \n" + " } \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private class Member { \n" + " ^^^^^^\n" + "The private type X.Member is never used locally\n" + "----------\n" + "2. WARNING in X.java (at line 3)\n" + " private Member foo(int i) { \n" + " ^^^^^^^^^^\n" + "The private method foo(int) from the type X.Member is never used locally\n" + "----------\n" + "3. WARNING in X.java (at line 7)\n" + " return foo(2); \n" + " ^^^^^^\n" + "Access to enclosing method foo(int) from the type X.Member is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n"); } // check private unused detection // 31765 - private recursive methods not marked as unused // variation for not considering usage from within private field declaration public void test333() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private int field = \n"+ " new Object() { \n"+ " int foo() { \n"+ " field = 0; \n"+ " return field; \n"+ " } \n"+ " }.foo(); \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private int field = \n" + " ^^^^^\n" + "The private field X.field is never read locally\n" + "----------\n" + "2. WARNING in X.java (at line 5)\n" + " field = 0; \n" + " ^^^^^\n" + "Write access to enclosing field X.field is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "3. WARNING in X.java (at line 6)\n" + " return field; \n" + " ^^^^^\n" + "Read access to enclosing field X.field is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n"); } // check detection of local variable hiding field public void test334() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " int x = \n"+ " new Object() { \n"+ " int foo() { \n"+ " int x = 0; \n"+ " return x; \n"+ " } \n"+ " }.foo(); \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 5)\n" + " int x = 0; \n" + " ^\n" + "The local variable x is hiding a field from type X\n" + "----------\n", null, true, customOptions); } // check detection of local variable hiding field public void test335() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " int x = 0;\n"+ " int foo() { \n"+ " int x = 0; \n"+ " return x; \n"+ " } \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " int x = 0; \n" + " ^\n" + "The local variable x is hiding a field from type X\n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=35338 */ public void test336() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "//TODOTODO\n"+ "public class X { \n"+ "}//TODO" }, "----------\n" + "1. WARNING in p\\X.java (at line 4)\n" + " }//TODO\n" + " ^^^^\n" + "TODO \n" + "----------\n", null, true, customOptions); } /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=35438 */ public void test337() { this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n" + " static String Y = \"a\"; \n" + " class Y1 { } \n" + " public static void main(String[] args) { \n" + " Y y1 = (Y) null; \n" + " X.Y y2 = (X.Y) null; \n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 6)\n" + " Y y1 = (Y) null; \n" + " ^\n" + "Y cannot be resolved or is not a type\n" + "----------\n" + "2. ERROR in p\\X.java (at line 6)\n" + " Y y1 = (Y) null; \n" + " ^\n" + "Y cannot be resolved or is not a type\n" + "----------\n" + "3. ERROR in p\\X.java (at line 7)\n" + " X.Y y2 = (X.Y) null; \n" + " ^^^\n" + "X.Y cannot be resolved or is not a type\n" + "----------\n" + "4. ERROR in p\\X.java (at line 7)\n" + " X.Y y2 = (X.Y) null; \n" + " ^^^\n" + "X.Y cannot be resolved or is not a type\n" + "----------\n"); } /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=35438 */ public void test338() { this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n" + " static String Y = \"a\"; \n" + " class Y1 { } \n" + " public static void main(String[] args) { \n" + " Y y1 = (Y) null; \n" + " X.Y y2 = (X.Y) null; \n" + " }\n" + "}", }, "----------\n" + "1. ERROR in p\\X.java (at line 6)\n" + " Y y1 = (Y) null; \n" + " ^\n" + "Y cannot be resolved or is not a type\n" + "----------\n" + "2. ERROR in p\\X.java (at line 6)\n" + " Y y1 = (Y) null; \n" + " ^\n" + "Y cannot be resolved or is not a type\n" + "----------\n" + "3. ERROR in p\\X.java (at line 7)\n" + " X.Y y2 = (X.Y) null; \n" + " ^^^\n" + "X.Y cannot be resolved or is not a type\n" + "----------\n" + "4. ERROR in p\\X.java (at line 7)\n" + " X.Y y2 = (X.Y) null; \n" + " ^^^\n" + "X.Y cannot be resolved or is not a type\n" + "----------\n"); } // check detection of field hiding field public void test339() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " int x = \n"+ " new Object() { \n"+ " int x; \n"+ " int foo() { \n"+ " return x; \n"+ " } \n"+ " }.foo(); \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " int x; \n" + " ^\n" + "The field .x is hiding a field from type X\n" + "----------\n", null, true, customOptions); } // check detection of field hiding local public void test340() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportFieldHiding, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " { int x = \n"+ " new Object() { \n"+ " int x; \n"+ " int foo() { \n"+ " return x; \n"+ " } \n"+ " }.foo(); \n"+ " } \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " int x; \n" + " ^\n" + "The field .x is hiding another local variable defined in an enclosing type scope\n" + "----------\n", null, true, customOptions); } // check detection of argument hiding field public void test341() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " int x = \n"+ " new Object() { \n"+ " int foo(int x) { \n"+ " return x; \n"+ " } \n"+ " }.foo(0); \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " int foo(int x) { \n" + " ^\n" + "The argument x is hiding a field from type X\n" + "----------\n", null, true, customOptions); } // check detection of argument hiding field public void test342() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " int x = 0;\n"+ " int foo(int x) { \n"+ " return x; \n"+ " } \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " int foo(int x) { \n" + " ^\n" + "The argument x is hiding a field from type X\n" + "----------\n", null, true, customOptions); } // check detection of argument hiding field public void test343() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " { int x = \n"+ " new Object() { \n"+ " int foo(int x) { \n"+ " return x; \n"+ " } \n"+ " }.foo(0); \n"+ " } \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " int foo(int x) { \n" + " ^\n" + "The argument x is hiding another local variable defined in an enclosing type scope\n" + "----------\n", null, true, customOptions); } // check detection of argument hiding private field public void test344() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private int x = 0;\n"+ " int foo(int x) { \n"+ " return x; \n"+ " } \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 2)\n" + " private int x = 0;\n" + " ^\n" + "The private field X.x is never read locally\n" + "----------\n" + "2. ERROR in X.java (at line 3)\n" + " int foo(int x) { \n" + " ^\n" + "The argument x is hiding a field from type X\n" + "----------\n", null, true, customOptions); } // check private unused detection // 34896 - only consider field read access public void test345() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " private X someX; \n"+ " private X nextX; \n" + " void foo(int i) { \n"+ " someX.nextX = null; \n"+ " new Object(){ \n"+ " void bar() { \n"+ " someX.nextX = null; \n"+ " } \n"+ " }; \n"+ " } \n"+ "} \n", }, "----------\n" + "1. WARNING in X.java (at line 3)\n" + " private X nextX; \n" + " ^^^^^\n" + "The private field X.nextX is never read locally\n" + "----------\n" + "2. WARNING in X.java (at line 8)\n" + " someX.nextX = null; \n" + " ^^^^^^^^^^^\n" + "Write access to enclosing field X.nextX is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n" + "3. WARNING in X.java (at line 8)\n" + " someX.nextX = null; \n" + " ^^^^^^^^^^^\n" + "Read access to enclosing field X.someX is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + "----------\n"); } // invalid type expression (extra parenthesis) // 38124 public void test346() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " void foo() { \n"+ " Object o1 = (Object) new X(); \n"+ " Object o2 = ((Object)) new X(); \n"+ " Object o3 = (((Object))) new X(); \n"+ " } \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " Object o2 = ((Object)) new X(); \n" + " ^^^^^^^^\n" + "Invalid cast type expression\n" + "----------\n" + "2. ERROR in X.java (at line 5)\n" + " Object o3 = (((Object))) new X(); \n" + " ^^^^^^^^^^\n" + "Invalid cast type expression\n" + "----------\n" ); }// cannot assign to this // 38143 public void test347() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " void foo() { \n"+ " this = null; \n"+ " X.this = null; \n"+ " this += null; \n"+ " this++; \n"+ " } \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " this = null; \n" + " ^^^^\n" + "The left-hand side of an assignment must be a variable\n" + "----------\n" + "2. ERROR in X.java (at line 4)\n" + " X.this = null; \n" + " ^^^^^^\n" + "The left-hand side of an assignment must be a variable\n" + "----------\n" + "3. ERROR in X.java (at line 5)\n" + " this += null; \n" + " ^^^^\n" + "The left-hand side of an assignment must be a variable\n" + "----------\n" + "4. ERROR in X.java (at line 6)\n" + " this++; \n" + " ^^^^\n" + "The left-hand side of an assignment must be a variable\n" + "----------\n" ); } // abstract method shouldn't complain about semicolon body when missing return type // 38838 public void test348() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " abstract foo(); \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " abstract foo(); \n" + " ^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "2. ERROR in X.java (at line 2)\n" + " abstract foo(); \n" + " ^^^^^\n" + "The abstract method foo in type X can only be defined by an abstract class\n" + "----------\n" ); } // abstract method shouldn't complain about semicolon body when missing return type // 38838 - variation involving recovery public void test349() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " int i =; //missing init to trigger recovery \n"+ " abstract foo(); \n"+ "} \n", }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " int i =; //missing init to trigger recovery \n" + " ^\n" + "Syntax error on token \"=\", VariableInitializer expected after this token\n" + "----------\n" + "2. ERROR in X.java (at line 3)\n" + " abstract foo(); \n" + " ^^^^^\n" + "The abstract method foo in type X can only be defined by an abstract class\n" + "----------\n" + "3. ERROR in X.java (at line 3)\n" + " abstract foo(); \n" + " ^^^^^\n" + "Return type for the method is missing\n" + "----------\n" ); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=38759 */ public void test350() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TEST,TODO"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "/** Value for property with key KEY_TESTCHECKCOUNT. */\n"+ // shouldn't be recognized as a task "public class X { \n"+ "}//TODO" }, "----------\n" + "1. WARNING in p\\X.java (at line 4)\n" + " }//TODO\n" + " ^^^^\n" + "TODO \n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=37006 */ public void test351() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO,REM"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n"+ " int foo; \n"+ " void setFoo(int foo) { \n"+ " /*TODO*/ \n"+ " this.foo = foo; \n"+ " //TODO REMPLACER aa \n"+ // not a REM task " } \n"+ "}//TODO \n" }, "----------\n" + "1. WARNING in p\\X.java (at line 5)\n" + " /*TODO*/ \n" + " ^^^^^^\n" + "TODO */\n" + "----------\n" + "2. WARNING in p\\X.java (at line 7)\n" + " //TODO REMPLACER aa \n" + " ^^^^^^^^^^^^^^^^^\n" + "TODO REMPLACER aa\n" + "----------\n" + "3. WARNING in p\\X.java (at line 9)\n" + " }//TODO \n" + " ^^^^\n" + "TODO \n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=37006 * variation - if tag doesn't finish with letter then compact is allowed (REM:) */ public void test352() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO,REM:"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n"+ " int foo; \n"+ " void setFoo(int foo) { \n"+ " /*TODO*/ \n"+ " this.foo = foo; \n"+ " //TODO REM:PLACER aa \n"+ " } \n"+ "}//TODO \n" }, "----------\n" + "1. WARNING in p\\X.java (at line 5)\n" + " /*TODO*/ \n" + " ^^^^^^\n" + "TODO */\n" + "----------\n" + "2. WARNING in p\\X.java (at line 7)\n" + " //TODO REM:PLACER aa \n" + " ^^^^\n" + "TODO \n" + "----------\n" + "3. WARNING in p\\X.java (at line 7)\n" + " //TODO REM:PLACER aa \n" + " ^^^^^^^^^^^^^\n" + "REM: PLACER aa\n" + "----------\n" + "4. WARNING in p\\X.java (at line 9)\n" + " }//TODO \n" + " ^^^^\n" + "TODO \n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=37006 * variation - if tag doesn't finish with letter then compact is allowed (REM:) */ public void test353() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "TODO:,REM:"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n"+ " int foo; \n"+ " void setFoo(int foo) { \n"+ " /*TODO:*/ \n"+ " this.foo = foo; \n"+ " //TODO:REM:PLACER aa \n"+ " } \n"+ "}//TODO: \n" }, "----------\n" + "1. WARNING in p\\X.java (at line 5)\n" + " /*TODO:*/ \n" + " ^^^^^^^\n" + "TODO: */\n" + "----------\n" + "2. WARNING in p\\X.java (at line 7)\n" + " //TODO:REM:PLACER aa \n" + " ^^^^^\n" + "TODO: \n" + "----------\n" + "3. WARNING in p\\X.java (at line 7)\n" + " //TODO:REM:PLACER aa \n" + " ^^^^^^^^^^^^^\n" + "REM: PLACER aa\n" + "----------\n" + "4. WARNING in p\\X.java (at line 9)\n" + " }//TODO: \n" + " ^^^^^\n" + "TODO: \n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=37006 * variation - tag can be prefixed with letters if non starting with letter itself */ public void test354() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_TaskTags, "#TODO#"); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n"+ " int foo; \n"+ " void setFoo(int foo) { \n"+ " this.foo = foo; \n"+ " //consider#TODO#\n"+ " } \n"+ "}//#TODO#\n" }, "----------\n" + "1. WARNING in p\\X.java (at line 6)\n" + " //consider#TODO#\n" + " ^^^^^^\n" + "#TODO# \n" + "----------\n" + "2. WARNING in p\\X.java (at line 8)\n" + " }//#TODO#\n" + " ^^^^^^\n" + "#TODO# \n" + "----------\n", null, true, customOptions); } /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=39248 */ public void test355() { this.runNegativeTest( new String[] { "X.java", "public class X { \n"+ " public static void main(String[] args) { \n"+ " Object o = null; \n"+ " o += \"String\"; \n"+ // ko (39248) " o = o + \"String2\"; \n"+// ok " o += new Thread(); \n"+// ko " o += 1; \n"+ // ko " System.out.println(o); \n"+ " } \n"+ "} \n" }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " o += \"String\"; \n" + " ^^^^^^^^^^^^^\n" + "The operator += is undefined for the argument type(s) Object, String\n" + "----------\n" + "2. ERROR in X.java (at line 6)\n" + " o += new Thread(); \n" + " ^^^^^^^^^^^^^^^^^\n" + "The operator += is undefined for the argument type(s) Object, Thread\n" + "----------\n" + "3. ERROR in X.java (at line 7)\n" + " o += 1; \n" + " ^^^^^^\n" + "The operator += is undefined for the argument type(s) Object, int\n" + "----------\n"); } /* * check diagnosis for unnecessary empty statements */ public void test356() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportSuperfluousSemicolon, CompilerOptions.WARNING); this.runNegativeTest( new String[] { "p/X.java", "package p; \n"+ "public class X { \n"+ " void foo() { \n"+ " ;; \n"+ " if (true); \n"+ " if (true) { }; \n"+ " for (int i = 0; i < 10; i++); \n"+ " for (int i = 0; i < 10; i++) {}; \n"+ " while (this == null); \n"+ " while (this == null){}; \n"+ " do ; while (this == null); \n"+ " do { ; } while (this == null); \n"+ " class Object { }; \n"+ " return; \n"+ " } \n"+ "}\n" }, "----------\n" + "1. WARNING in p\\X.java (at line 4)\n" + " ;; \n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "2. WARNING in p\\X.java (at line 4)\n" + " ;; \n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "3. WARNING in p\\X.java (at line 6)\n" + " if (true) { }; \n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "4. WARNING in p\\X.java (at line 8)\n" + " for (int i = 0; i < 10; i++) {}; \n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "5. WARNING in p\\X.java (at line 10)\n" + " while (this == null){}; \n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "6. WARNING in p\\X.java (at line 12)\n" + " do { ; } while (this == null); \n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "7. WARNING in p\\X.java (at line 13)\n" + " class Object { }; \n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n", null, true, customOptions); } /* * check diagnosis for unnecessary semicolons */ public void test357() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportSuperfluousSemicolon, CompilerOptions.WARNING); this.runNegativeTest( new String[] { "X.java", ";//1\n" + ";//2\n" + "public class X {\n" + " int i = 0;;//3\n" + " class M {\n" + " } ;//4\n" + " ;//5\n" + " void foo() {\n" + " class L {\n" + " };//6\n" + " };//7\n" + "};//8\n" }, "----------\n" + "1. WARNING in X.java (at line 1)\n" + " ;//1\n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "2. WARNING in X.java (at line 2)\n" + " ;//2\n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "3. WARNING in X.java (at line 4)\n" + " int i = 0;;//3\n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "4. WARNING in X.java (at line 6)\n" + " } ;//4\n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "5. WARNING in X.java (at line 7)\n" + " ;//5\n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "6. WARNING in X.java (at line 10)\n" + " };//6\n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "7. WARNING in X.java (at line 11)\n" + " };//7\n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n" + "8. WARNING in X.java (at line 12)\n" + " };//8\n" + " ^\n" + "Unnecessary semicolon\n" + "----------\n", null, true, customOptions); } public void test358() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "A.java", "public class A {\n" + " void foo() {\n" + " System.out.println(\"a\");\n" + " } //$NON-NLS-1$ \n" + "}" }, "----------\n" + "1. ERROR in A.java (at line 3)\n" + " System.out.println(\"a\");\n" + " ^^^\n" + "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n", null, true, customOptions); } public void test359() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X extends XZ {\n" + " \n" + " void foo() {\n" + " int j = X.S;\n" + " int k = super.S;\n" + " int l = XZ.S;\n" + " int m = XY.S;\n" + " \n" + " bar();\n" + " X.bar();\n" + " XY.bar();\n" + " XZ.bar();\n" + " }\n" + "}\n" + "class XY {\n" + " static int S = 10;\n" + " static void bar(){}\n" + "}\n" + "class XZ extends XY {\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " int j = X.S;\n" + " ^^^\n" + "The static field XY.S should be accessed directly\n" + "----------\n" + "2. ERROR in X.java (at line 5)\n" + " int k = super.S;\n" + " ^^^^^^^\n" + "The static field XY.S should be accessed directly\n" + "----------\n" + "3. ERROR in X.java (at line 6)\n" + " int l = XZ.S;\n" + " ^^^^\n" + "The static field XY.S should be accessed directly\n" + "----------\n" + "4. ERROR in X.java (at line 10)\n" + " X.bar();\n" + " ^^^^^^^\n" + "The static method bar() from the type XY should be accessed directly \n" + "----------\n" + "5. ERROR in X.java (at line 12)\n" + " XZ.bar();\n" + " ^^^^^^^^\n" + "The static method bar() from the type XY should be accessed directly \n" + "----------\n", null, true, customOptions); } public void test360() { this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " public X(){\n" + " System.out.println();\n" + " super();\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " super();\n" + " ^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n"); } public void test361() { this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " public void foo(){\n" + " super();\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " super();\n" + " ^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n"); } public void test362() { this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " public foo(){\n" + " super();\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " public foo(){\n" + " ^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "2. ERROR in X.java (at line 3)\n" + " super();\n" + " ^^^^^^^\n" + "Constructor call must be the first statement in a constructor\n" + "----------\n"); } public void test363() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " void foo() {\n" + " try{ \n"+ " bar(); \n"+ " } catch (Exception e) { \n"+ " } \n"+ " } \n" + " void bar() throws Exception {\n" + " }\n" + "}\n" }, "----------\n" + "1. ERROR in X.java (at line 5)\n" + " } catch (Exception e) { \n" + " } \n" + " ^^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "2. ERROR in X.java (at line 8)\n" + " void bar() throws Exception {\n" + " }\n" + " ^^^^\n" + "Empty block should be documented\n" + "----------\n", null, true, customOptions); } // check that deprecation warning is issued if last javadoc is followed by some other comments public void test375() { this.runNegativeTest( new String[] { "p/AYHelper.java", "package p;\n" + "/**\n" + " * 1FCSIO4\n" + " */\n" + "public class AYHelper {\n" + " void foo() {\n" + " new AY().foo();\n" + " }\n" + "}", "p/AY.java", "package p;\n" + "public class AY {\n" + " /**\n" + " * @deprecated\n" + " *///some other comment to ignore\n" + " public AY() {\n" + " }\n" + " public AY(int i) {\n" + " }\n" + " \n" + " /**\n" + " * @deprecated\n" + " *//* some trailing comment to ignore*/\n" + " void foo() {\n" + " }\n" + "}", }, "----------\n" + "1. WARNING in p\\AYHelper.java (at line 7)\n" + " new AY().foo();\n" + " ^^^^^^^^^^^^^^\n" + "The method foo() from the type AY is deprecated\n" + "----------\n" + "2. WARNING in p\\AYHelper.java (at line 7)\n" + " new AY().foo();\n" + " ^^^^^^^^\n" + "The constructor AY() is deprecated\n" + "----------\n" ); } // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=39763 public void test376() { this.runNegativeTest( new String[] { "p/Foo.java", "package p;\n" + "public class Foo { \n" + " public void foo() {\n" + " System.out.println(\"string1\" + \"string2\" //$NON-NLS-1$//$NON-NLS-2$\n" + " );\n" + "}", }, "----------\n" + "1. ERROR in p\\Foo.java (at line 6)\n" + " }\n" + " ^\n" + "Syntax error, insert \"}\" to complete ClassBody\n" + "----------\n" ); } // Variation of bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=39763 public void test377() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "p/Foo.java", "package p;\n" + "public class Foo { \n" + " public void foo() {\n" + " System.out.println(\"string1\" + \"string2\" //$NON-NLS-1$\n" + " );\n" + "}", }, "----------\n" + "1. ERROR in p\\Foo.java (at line 4)\n" + " System.out.println(\"string1\" + \"string2\" //$NON-NLS-1$\n" + " ^^^^^^^^^\n" + "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n" + "2. ERROR in p\\Foo.java (at line 6)\n" + " }\n" + " ^\n" + "Syntax error, insert \"}\" to complete ClassBody\n" + "----------\n", null, true, customOptions); } public void test382() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "import java.io.IOException;\n" + "\n" + "public class X {\n" + " \n" + " void foo() {\n" + " try {\n" + " if (true) throw new IOException();\n" + " // irrelevant comment for next catch block\n" + " while (true){} \n" + " } catch(IOException e) {\n" + " // relevant comment\n" + " /** other comment in block */\n" + " } catch(NullPointerException e) {\n" + " } \n" + " // irrelevant trailing comment for previous empty block\n" + " catch(Exception e) {\n" + " } finally {\n" + " } // irrelevant trailing comment for previous empty block\n" + " // some irrelevant comment\n" + " }\n" + "}\n" }, "----------\n" + "1. ERROR in X.java (at line 9)\n" + " while (true){} \n" + " ^^\n" + "Empty block should be documented\n" + "----------\n" + "2. ERROR in X.java (at line 13)\n" + " } catch(NullPointerException e) {\n" + " } \n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "3. ERROR in X.java (at line 16)\n" + " catch(Exception e) {\n" + " } finally {\n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "4. ERROR in X.java (at line 17)\n" + " } finally {\n" + " } // irrelevant trailing comment for previous empty block\n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n", null, true, customOptions); } public void test386() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " { System.out.println(\"a\"); } \n" + " static { System.out.println(\"b\"); } \n" + " void foo() {\n" + " if (true) {} /*irrelevant*/ else ; \n" + " }\n" + "}\n" }, "----------\n" + "1. ERROR in X.java (at line 5)\n" + " if (true) {} /*irrelevant*/ else ; \n" + " ^^\n" + "Empty block should be documented\n" + "----------\n", null, true, customOptions); } public void test387() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " { /*empty on purpose*/ } \n" + " static { /*empty on purpose*/ } \n" + " { } //irrelevant \n" + " static /*irrelevant*/{ } \n" + "}\n" }, "----------\n" + "1. ERROR in X.java (at line 4)\n" + " { } //irrelevant \n" + " ^^^\n" + "Empty block should be documented\n" + "----------\n" + "2. ERROR in X.java (at line 5)\n" + " static /*irrelevant*/{ } \n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n", null, true, customOptions); } public void test388() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " #\n" + " {\n" + " System.out.println();\n" + // shouldn't diagnose empty statement after recovery " } // irrelevant\n" + "}\n" }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " #\n" + " ^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n", null, true, customOptions); } public void test389() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " #\n" + " {\n" + // should diagnose empty statement after recovery " } // irrelevant\n" + "}\n" }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " #\n" + " ^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "2. ERROR in X.java (at line 3)\n" + " {\n" + " } // irrelevant\n" + " ^^^^\n" + "Empty block should be documented\n" + "----------\n", null, true, customOptions); } public void test390() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " public static void main(String[] args) {\n" + " }\n" + " void bar() {\n" + " bar();\n" + " }\n" + " void baz() { //empty on purpose\n" + " }\n" + " X(){}\n" + " \n" + " missingReturnType(){\n" + " }\n" + " missingReturnType2(){ /*do nothing*/\n" + " }\n" + "}\n" + "\n" + "interface IX {\n" + " void foo();\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " public static void main(String[] args) {\n" + " }\n" + " ^^^^\n" + "Empty block should be documented\n" + "----------\n" + "2. ERROR in X.java (at line 9)\n" + " X(){}\n" + " ^^\n" + "Empty block should be documented\n" + "----------\n" + "3. ERROR in X.java (at line 11)\n" + " missingReturnType(){\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "4. ERROR in X.java (at line 11)\n" + " missingReturnType(){\n" + " }\n" + " ^^^^\n" + "Empty block should be documented\n" + "----------\n" + "5. ERROR in X.java (at line 13)\n" + " missingReturnType2(){ /*do nothing*/\n" + " ^^^^^^^^^^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n", null, true, customOptions); } public void test391() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " public static void main(String[] args) {\n" + " }\n" + " #\n" + // recovery " void bar() {\n" + " bar();\n" + " }\n" + " void baz() { //empty on purpose\n" + " }\n" + " X(){}\n" + " \n" + " missingReturnType(){\n" + " }\n" + " missingReturnType2(){ /*do nothing*/\n" + " }\n" + "}\n" + "\n" + "interface IX {\n" + " void foo();\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " public static void main(String[] args) {\n" + " }\n" + " ^^^^\n" + "Empty block should be documented\n" + "----------\n" + "2. ERROR in X.java (at line 4)\n" + " #\n" + " ^\n" + "Syntax error on token \"Invalid Character\", delete this token\n" + "----------\n" + "3. ERROR in X.java (at line 10)\n" + " X(){}\n" + " ^^\n" + "Empty block should be documented\n" + "----------\n" + "4. ERROR in X.java (at line 12)\n" + " missingReturnType(){\n" + " ^^^^^^^^^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n" + "5. ERROR in X.java (at line 12)\n" + " missingReturnType(){\n" + " }\n" + " ^^^^\n" + "Empty block should be documented\n" + "----------\n" + "6. ERROR in X.java (at line 14)\n" + " missingReturnType2(){ /*do nothing*/\n" + " ^^^^^^^^^^^^^^^^^^^^\n" + "Return type for the method is missing\n" + "----------\n", null, true, customOptions); } public void test392() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " public class Empty {\n" + " }\n" + " public class NonEmpty {\n" + " /* empty on purpose */\n" + " }\n" + " \n" + " void bar() {\n" + " class EmptyLocal {}\n" + " class NonEmptyLocal {\n" + " // empty on purpose\n" + " }\n" + " new Object() {\n" + " // empty on purpose\n" + " };\n" + " new Object() {\n" + " };\n" + " }\n" + "interface IX {}\n" + "}\n", }, "----------\n" + "1. ERROR in X.java (at line 2)\n" + " public class Empty {\n" + " }\n" + " public class NonEmpty {\n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "2. ERROR in X.java (at line 9)\n" + " class EmptyLocal {}\n" + " class NonEmptyLocal {\n" + " ^^^\n" + "Empty block should be documented\n" + "----------\n" + "3. ERROR in X.java (at line 16)\n" + " new Object() {\n" + " };\n" + " ^^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "4. ERROR in X.java (at line 19)\n" + " interface IX {}\n" + "}\n" + " ^^^\n" + "Empty block should be documented\n" + "----------\n", null, true, customOptions); } public void test394() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " public static void main(String[] args) {\n" + " while(args != null){} // empty while block\n" + " do {} while(args != null); // empty do-while block\n" + " for (int i = 0; i < args.length; i++) {} // empty for block\n" + " switch (args.length) /*ignore*/ {\n" + " } // empty switch block\n" + " try /*empty try block*/{ \n" + " } catch(Exception e) /*empty catch block*/{\n" + " } finally /*empty finally block*/{\n" + " }\n" + " synchronized(args)/*empty synchronized block*/{\n" + " }\n" + " {\n" + " /*empty block*/{\n" + " }\n" + " }\n" + " }\n" + "}", }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " while(args != null){} // empty while block\n" + " ^^\n" + "Empty block should be documented\n" + "----------\n" + "2. ERROR in X.java (at line 4)\n" + " do {} while(args != null); // empty do-while block\n" + " ^^\n" + "Empty block should be documented\n" + "----------\n" + "3. ERROR in X.java (at line 5)\n" + " for (int i = 0; i < args.length; i++) {} // empty for block\n" + " ^^\n" + "Empty block should be documented\n" + "----------\n" + "4. ERROR in X.java (at line 6)\n" + " switch (args.length) /*ignore*/ {\n" + " } // empty switch block\n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "5. ERROR in X.java (at line 8)\n" + " try /*empty try block*/{ \n" + " } catch(Exception e) /*empty catch block*/{\n" + " ^^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "6. ERROR in X.java (at line 9)\n" + " } catch(Exception e) /*empty catch block*/{\n" + " } finally /*empty finally block*/{\n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "7. ERROR in X.java (at line 10)\n" + " } finally /*empty finally block*/{\n" + " }\n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "8. ERROR in X.java (at line 12)\n" + " synchronized(args)/*empty synchronized block*/{\n" + " }\n" + " ^^^^^\n" + "Empty block should be documented\n" + "----------\n" + "9. ERROR in X.java (at line 15)\n" + " /*empty block*/{\n" + " }\n" + " ^^^^^^\n" + "Empty block should be documented\n" + "----------\n", null, true, customOptions); } // unnecessary cast diagnosis should also consider receiver type (40572) public void test395() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "p1/A.java", "package p1;\n" + "public class A {\n" + " void foo() {\n" + " }\n" + "}\n", "p2/B.java", "package p2;\n" + "import p1.A;\n" + "public class B extends A {\n" + "}\n", "p1/C.java", "package p1;\n" + "import p2.B;\n" + "public class C extends B {\n" + " void baz(B b) {\n" + " ((A)b).foo(); // necessary since may change declaring class in constant pool\n" + " ((A)zork()).foo(); // fault-tolerance\n" + " }\n" + "}\n", }, "----------\n" + "1. ERROR in p1\\C.java (at line 6)\n" + " ((A)zork()).foo(); // fault-tolerance\n" + " ^^^^\n" + "The method zork() is undefined for the type C\n" + "----------\n", null, true, customOptions); } // unnecessary cast diagnosis should also consider receiver type (40572) public void test396() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "p1/A.java", "package p1;\n" + "public class A {\n" + " public int field; \n" + "}\n", "p2/B.java", "package p2;\n" + "import p1.A;\n" + "public class B extends A {\n" + " public int field; \n" + "}\n", "p1/C.java", "package p1;\n" + "import p2.B;\n" + "public class C extends B {\n" + " void baz(B b) {\n" + " ((A)b).field = 0; // necessary since may change declaring class in constant pool\n" + " ((A)zork()).field = 1; // fault-tolerance\n" + " }\n" + "}\n", }, "----------\n" + "1. WARNING in p2\\B.java (at line 4)\n" + " public int field; \n" + " ^^^^^\n" + "The field B.field is hiding a field from type A\n" + "----------\n" + "----------\n" + "1. ERROR in p1\\C.java (at line 6)\n" + " ((A)zork()).field = 1; // fault-tolerance\n" + " ^^^^\n" + "The method zork() is undefined for the type C\n" + "----------\n", null, true, customOptions); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=41805 public void test399() { Map customOptions = getCompilerOptions(); this.runNegativeTest( new String[] { "Foo.java", "public class Foo { \n"+ " private String g() { \n"+ " final synchronized int i[]; \n"+ " for (i= null; i != null; ) { \n"+ " } \n"+ " return toString(); \n"+ " } \n"+ "}", }, "----------\n" + "1. ERROR in Foo.java (at line 3)\n" + " final synchronized int i[]; \n" + " ^\n" + "Illegal modifier for argument i; only final is permitted\n" + "----------\n", null, true, customOptions); } public void test400() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "import java.io.IOException;\n"+ "public abstract class X {\n" + " \n" + " void foo() throws Exception { // reachable by unchecked\n" + " }\n" + " void bar() throws IOException {\n" + " }\n" + " \n" + " X(int i) throws Exception { // reachable by unchecked\n" + " }\n" + " \n" + " X(long l) throws IOException {\n" + " }\n" + " \n" + " abstract void baz() throws IOException; // no complaint for abstracts\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 6)\n" + " void bar() throws IOException {\n" + " ^^^^^^^^^^^\n" + "The declared exception IOException is not actually thrown by the method bar() from type X\n" + "----------\n" + "2. ERROR in X.java (at line 12)\n" + " X(long l) throws IOException {\n" + " ^^^^^^^^^^^\n" + "The declared exception IOException is not actually thrown by the constructor X(long)\n" + "----------\n", null, true, customOptions); } public void test401() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.ERROR); this.runNegativeTest( new String[] { "X.java", "public abstract class X {\n" + " \n" + " int i, j;\n" + " X x, y;\n" + " void foo() {\n" + " i = 0;\n" + " this.j = 1;\n" + " x.y.i = 2;\n" + " this.x.y.j = 3;\n" + "\n" + " class Local {\n" + " int k = i;\n" + " int l = X.this.j;\n" + " int m = x.y.i;\n" + " }\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 6)\n" + " i = 0;\n" + " ^\n" + "Unqualified access to the field X.i \n" + "----------\n" + "2. ERROR in X.java (at line 8)\n" + " x.y.i = 2;\n" + " ^^^^^\n" + "Unqualified access to the field X.x \n" + "----------\n" + "3. ERROR in X.java (at line 12)\n" + " int k = i;\n" + " ^\n" + "Unqualified access to the field X.i \n" + "----------\n" + "4. ERROR in X.java (at line 14)\n" + " int m = x.y.i;\n" + " ^^^^^\n" + "Unqualified access to the field X.x \n" + "----------\n", null, true, customOptions); } /* * Test deprecation reporting inside deprecated code - shouldn't complain about deprecation (48333) */ public void test402(){ Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", "/**\n" + " * @deprecated\n" + " */\n" + "public class X {\n" + " /**\n" + " * @deprecated\n" + " */\n" + " A foo = new A(null){};\n" + " \n" + " \n" + " /**\n" + " * @deprecated\n" + " */\n" + " A foo() {\n" + " return null;\n" + " }\n" + " \n" + "\n" + " void bar() {\n" + " class Local extends A {\n" + " \n" + " class LocalMember extends A {\n" + " LocalMember(A.B b) {\n" + " super(b);\n" + " }\n" + " }\n" + " Local(A.B b) {\n" + " super(b);\n" + " }\n" + " }\n" + " }\n" + "}\n" + "\n", "A.java", "/** @deprecated */ \n"+ "public interface A { \n"+ " class B {} \n"+ " int foo(); \n"+ " int bar(); \n"+ " char[] field = \"a\".toCharArray(); \n"+ "} \n" }, "----------\n" + "1. ERROR in X.java (at line 8)\n" + " A foo = new A(null){};\n" + " ^^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "2. ERROR in X.java (at line 8)\n" + " A foo = new A(null){};\n" + " ^^^^^^^\n" + "Class must implement the inherited abstract method A.foo()\n" + "----------\n" + "3. ERROR in X.java (at line 8)\n" + " A foo = new A(null){};\n" + " ^^^^^^^\n" + "Class must implement the inherited abstract method A.bar()\n" + "----------\n" + "4. ERROR in X.java (at line 20)\n" + " class Local extends A {\n" + " ^\n" + "The interface A cannot be the superclass of Local; a superclass must be a class\n" + "----------\n" + "5. ERROR in X.java (at line 22)\n" + " class LocalMember extends A {\n" + " ^\n" + "The interface A cannot be the superclass of LocalMember; a superclass must be a class\n" + "----------\n" + "6. ERROR in X.java (at line 24)\n" + " super(b);\n" + " ^^^^^^^^\n" + "The constructor Object(A.B) is undefined\n" + "----------\n" + "7. ERROR in X.java (at line 28)\n" + " super(b);\n" + " ^^^^^^^^\n" + "The constructor Object(A.B) is undefined\n" + "----------\n", null, true, customOptions); } /* * Test deprecation reporting inside deprecated code - shouldn't complain about deprecation (48333) */ public void test403(){ Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", "public class X {\n" + " /**\n" + " * @deprecated\n" + " */\n" + " A foo = new A(null){};\n" + " \n" + " \n" + " /**\n" + " * @deprecated\n" + " */\n" + " A foo() {\n" + " return null;\n" + " }\n" + "}\n" + "\n", "A.java", "/** @deprecated */ \n"+ "public interface A { \n"+ " class B {} \n"+ " int foo(); \n"+ " int bar(); \n"+ " char[] field = \"a\".toCharArray(); \n"+ "} \n" }, "----------\n" + "1. ERROR in X.java (at line 5)\n" + " A foo = new A(null){};\n" + " ^^^^^^^^^^^^^\n" + "The constructor Object(null) is undefined\n" + "----------\n" + "2. ERROR in X.java (at line 5)\n" + " A foo = new A(null){};\n" + " ^^^^^^^\n" + "Class must implement the inherited abstract method A.foo()\n" + "----------\n" + "3. ERROR in X.java (at line 5)\n" + " A foo = new A(null){};\n" + " ^^^^^^^\n" + "Class must implement the inherited abstract method A.bar()\n" + "----------\n", null, true, customOptions); } /* * Test deprecation reporting inside deprecated code when overriding mode disabled */ public void test404(){ Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.DISABLED); this.runNegativeTest( new String[] { "X.java", "public class X implements I { // should complain about I deprecation \n"+ " \n"+ " /** @deprecated */ \n"+ " public int foo(){ // should NOT complain about foo() deprecation \n"+ " return 0; \n"+ " } \n"+ " public int bar(){ // should complain about bar() deprecation \n"+ " return 0; \n"+ " } \n"+ " \n"+ " I someI; // should complain about I deprecation \n"+ " /** @deprecated */ \n"+ " I otherI; // should complain about I deprecation \n"+ " \n"+ " int i = someI.foo(); // should complain about foo() deprecation \n"+ " \n"+ " /** @deprecated */ \n"+ " int j = someI.bar(); // should NOT complain about bar() deprecation \n"+ " \n"+ " void a(I i){}// should complain about I deprecation \n"+ " /** @deprecated */ \n"+ " void b(I i){}// should NOT complain about I deprecation \n"+ " \n"+ " { \n"+ " someI.foo(); // should complain about foo() deprecation \n"+ " } \n"+ " /** @deprecated */ \n"+ " class M { \n"+ " { \n"+ " someI.foo(); // should NOT complain about foo() deprecation \n"+ " } \n"+ " } \n"+ "} \n", "I.java", "/** @deprecated */ \n"+ "public interface I { \n"+ " \n"+ " /** @deprecated */ \n"+ " int foo(); \n"+ " \n"+ " /** @deprecated */ \n"+ " int bar(); \n"+ " \n"+ " /** @deprecated */ \n"+ " char[] field = \"a\".toCharArray(); \n"+ "} \n" }, "----------\n" + "1. WARNING in X.java (at line 1)\n" + " public class X implements I { // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "2. WARNING in X.java (at line 11)\n" + " I someI; // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "3. WARNING in X.java (at line 15)\n" + " int i = someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n" + "4. WARNING in X.java (at line 20)\n" + " void a(I i){}// should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "5. WARNING in X.java (at line 20)\n" + " void a(I i){}// should complain about I deprecation \n" + " ^\n" + "The argument i is hiding a field from type X\n" + "----------\n" + "6. WARNING in X.java (at line 22)\n" + " void b(I i){}// should NOT complain about I deprecation \n" + " ^\n" + "The argument i is hiding a field from type X\n" + "----------\n" + "7. WARNING in X.java (at line 25)\n" + " someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n", null, true, customOptions); } /* * Test deprecation reporting inside deprecated code when overriding mode is disabled */ public void test405(){ Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED); customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.ENABLED); this.runNegativeTest( new String[] { "X.java", "public class X implements I { // should complain about I deprecation \n"+ " \n"+ " /** @deprecated */ \n"+ " public int foo(){ // should complain about foo() deprecation \n"+ " return 0; \n"+ " } \n"+ " public int bar(){ // should complain about bar() deprecation \n"+ " return 0; \n"+ " } \n"+ " \n"+ " I someI; // should complain about I deprecation \n"+ " /** @deprecated */ \n"+ " I otherI; // should complain about I deprecation \n"+ " \n"+ " int i = someI.foo(); // should complain about foo() deprecation \n"+ " \n"+ " /** @deprecated */ \n"+ " int j = someI.bar(); // should complain about bar() deprecation \n"+ " \n"+ " void a(I i){}// should complain about I deprecation \n"+ " /** @deprecated */ \n"+ " void b(I i){}// should complain about I deprecation \n"+ " \n"+ " { \n"+ " someI.foo(); // should complain about foo() deprecation \n"+ " } \n"+ " /** @deprecated */ \n"+ " class M { \n"+ " { \n"+ " someI.foo(); // should complain about foo() deprecation \n"+ " } \n"+ " } \n"+ "} \n", "I.java", "/** @deprecated */ \n"+ "public interface I { \n"+ " \n"+ " /** @deprecated */ \n"+ " int foo(); \n"+ " \n"+ " /** @deprecated */ \n"+ " int bar(); \n"+ " \n"+ " /** @deprecated */ \n"+ " char[] field = \"a\".toCharArray(); \n"+ "} \n" }, "----------\n" + "1. WARNING in X.java (at line 1)\n" + " public class X implements I { // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "2. WARNING in X.java (at line 4)\n" + " public int foo(){ // should complain about foo() deprecation \n" + " ^^^^^\n" + "The method X.foo() overrides a deprecated method from I\n" + "----------\n" + "3. WARNING in X.java (at line 7)\n" + " public int bar(){ // should complain about bar() deprecation \n" + " ^^^^^\n" + "The method X.bar() overrides a deprecated method from I\n" + "----------\n" + "4. WARNING in X.java (at line 11)\n" + " I someI; // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "5. WARNING in X.java (at line 13)\n" + " I otherI; // should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "6. WARNING in X.java (at line 15)\n" + " int i = someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n" + "7. WARNING in X.java (at line 18)\n" + " int j = someI.bar(); // should complain about bar() deprecation \n" + " ^^^^^^^^^^^\n" + "The method bar() from the type I is deprecated\n" + "----------\n" + "8. WARNING in X.java (at line 20)\n" + " void a(I i){}// should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "9. WARNING in X.java (at line 20)\n" + " void a(I i){}// should complain about I deprecation \n" + " ^\n" + "The argument i is hiding a field from type X\n" + "----------\n" + "10. WARNING in X.java (at line 22)\n" + " void b(I i){}// should complain about I deprecation \n" + " ^\n" + "The type I is deprecated\n" + "----------\n" + "11. WARNING in X.java (at line 22)\n" + " void b(I i){}// should complain about I deprecation \n" + " ^\n" + "The argument i is hiding a field from type X\n" + "----------\n" + "12. WARNING in X.java (at line 25)\n" + " someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n" + "13. WARNING in X.java (at line 30)\n" + " someI.foo(); // should complain about foo() deprecation \n" + " ^^^^^^^^^^^\n" + "The method foo() from the type I is deprecated\n" + "----------\n", null, true, customOptions); } public static Class testClass() { return NegativeTest.class; } }