OpenJDK / amber / amber
changeset 56660:a2e239a39bb0 records-and-sealed
bug on record class reading
Reviewed-by: vromero
Contributed-by: jan.lahoda@oracle.com
author | vromero |
---|---|
date | Wed, 12 Jun 2019 10:01:57 -0400 |
parents | d273dc2ae04b |
children | 5c16b711138f b5765fdbce5c |
files | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java test/langtools/tools/javac/datum/writeread/Record.java test/langtools/tools/javac/datum/writeread/WriteReadTest.java |
diffstat | 3 files changed, 63 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java Fri Jun 07 11:02:13 2019 -0400 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java Wed Jun 12 10:01:57 2019 -0400 @@ -1220,6 +1220,7 @@ if (sym.kind == TYP) { sym.flags_field |= RECORD; } + bp = bp + attrLen; } } };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/langtools/tools/javac/datum/writeread/Record.java Wed Jun 12 10:01:57 2019 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +record Record1(int i, int j);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/langtools/tools/javac/datum/writeread/WriteReadTest.java Wed Jun 12 10:01:57 2019 -0400 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Verify javac can read record classfiles it writes + * @compile Record.java + * @compile WriteReadTest.java + */ +public class WriteReadTest { + + Record1 r1; + +}