< prev index next > test/langtools/tools/javac/records/RecordCompilationTests.java
Print this page
class RecordCompilationTests extends CompilationTestCase {
private static String[] OPTIONS_WITH_AP = {"-processor", SimplestAP.class.getName()};
private static final List<String> BAD_COMPONENT_NAMES = List.of(
- "clone", "finalize", "getClass", "hashCode",
+ "clone", "finalize", "getClass", "hashCode", "isValueObject",
"notify", "notifyAll", "toString", "wait");
/* simplest annotation processor just to force a round of annotation processing for all tests
*/
@SupportedAnnotationTypes("*")
// If types match, names must match
assertFail("compiler.err.invalid.canonical.constructor.in.record",
"record R(int x, int y) { public R(int y, int x) { this.x = this.y = 0; }}");
- // first invocation should be one to the canonical
- assertFail("compiler.err.first.statement.must.be.call.to.another.constructor",
+ // constructor is not canonical, so it must only invoke another constructor
+ assertFail("compiler.err.non.canonical.constructor.invoke.another.constructor",
"record R(int x, int y) { public R(int y, int x, int z) { this.x = this.y = 0; } }");
- assertFail("compiler.err.first.statement.must.be.call.to.another.constructor",
+ assertFail("compiler.err.non.canonical.constructor.invoke.another.constructor",
"record R(int x, int y) { public R(int y, int x, int z) { super(); this.x = this.y = 0; } }");
assertOK("record R(int x, int y) { " +
" public R(int x, int y, int z) { this(x, y); } " +
"}");
< prev index next >