8036007: javac crashes when encountering an unresolvable interface jdk8u20-b21

Tue, 18 Mar 2014 22:12:46 +0000

author
vromero
date
Tue, 18 Mar 2014 22:12:46 +0000
changeset 2434
7de1481c6cd8
parent 2433
d231957fe310
child 2435
61fb0d8b1691
child 2437
49f7c1e4ae41

8036007: javac crashes when encountering an unresolvable interface
Reviewed-by: vromero, jlahoda
Contributed-by: paul.govereau@oracle.com

src/share/classes/com/sun/tools/javac/code/Types.java file | annotate | diff | comparison | revisions
test/tools/javac/missingSuperRecovery/MissingInterfaceTest.java file | annotate | diff | comparison | revisions
test/tools/javac/missingSuperRecovery/MissingInterfaceTest.out file | annotate | diff | comparison | revisions
test/tools/javac/missingSuperRecovery/MissingInterfaceTestDep.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Jun 25 12:55:45 2014 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Mar 18 22:12:46 2014 +0000
     1.3 @@ -3218,6 +3218,7 @@
     1.4              return tvar.rank_field;
     1.5          }
     1.6          case ERROR:
     1.7 +        case NONE:
     1.8              return 0;
     1.9          default:
    1.10              throw new AssertionError();
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/test/tools/javac/missingSuperRecovery/MissingInterfaceTest.java	Tue Mar 18 22:12:46 2014 +0000
     2.3 @@ -0,0 +1,15 @@
     2.4 +/*
     2.5 + * @test /nodynamiccopyright/
     2.6 + * @bug 8036007
     2.7 + * @summary javac crashes when encountering an unresolvable interface
     2.8 + * @build MissingInterfaceTestDep
     2.9 + * @clean Closeable
    2.10 + * @compile/fail/ref=MissingInterfaceTest.out -XDrawDiagnostics MissingInterfaceTest.java
    2.11 + */
    2.12 +
    2.13 +public class MissingInterfaceTest {
    2.14 +    void test(MissingInterfaceTestDep s) {
    2.15 +        s.call();
    2.16 +        s.another();
    2.17 +    }
    2.18 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/tools/javac/missingSuperRecovery/MissingInterfaceTest.out	Tue Mar 18 22:12:46 2014 +0000
     3.3 @@ -0,0 +1,3 @@
     3.4 +MissingInterfaceTest.java:12:10: compiler.err.cant.access: Closeable, (compiler.misc.class.file.not.found: Closeable)
     3.5 +MissingInterfaceTest.java:13:10: compiler.err.cant.resolve.location.args: kindname.method, another, , , (compiler.misc.location.1: kindname.variable, s, MissingInterfaceTestDep)
     3.6 +2 errors
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/tools/javac/missingSuperRecovery/MissingInterfaceTestDep.java	Tue Mar 18 22:12:46 2014 +0000
     4.3 @@ -0,0 +1,26 @@
     4.4 +/*
     4.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     4.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 + *
     4.8 + * This code is free software; you can redistribute it and/or modify it
     4.9 + * under the terms of the GNU General Public License version 2 only, as
    4.10 + * published by the Free Software Foundation.
    4.11 + *
    4.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    4.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.15 + * version 2 for more details (a copy is included in the LICENSE file that
    4.16 + * accompanied this code).
    4.17 + *
    4.18 + * You should have received a copy of the GNU General Public License version
    4.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    4.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.21 + *
    4.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.23 + * or visit www.oracle.com if you need additional information or have any
    4.24 + * questions.
    4.25 + */
    4.26 +
    4.27 +public class MissingInterfaceTestDep implements Intermediate {}
    4.28 +interface Intermediate extends Closeable { }
    4.29 +interface Closeable {}

mercurial