mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-25 15:20:11 +00:00
8014643: Parser regression in JDK 8 when compiling super.x
Fixed latent bug in JavacParser.analyzeParens() Reviewed-by: jjg, vromero
This commit is contained in:
parent
59c9296f63
commit
372fabc476
@ -1535,11 +1535,18 @@ public class JavacParser implements Parser {
|
||||
outer: for (int lookahead = 0 ; ; lookahead++) {
|
||||
TokenKind tk = S.token(lookahead).kind;
|
||||
switch (tk) {
|
||||
case EXTENDS: case SUPER: case COMMA:
|
||||
case COMMA:
|
||||
type = true;
|
||||
case QUES: case DOT: case AMP:
|
||||
case EXTENDS: case SUPER: case DOT: case AMP:
|
||||
//skip
|
||||
break;
|
||||
case QUES:
|
||||
if (peekToken(lookahead, EXTENDS) ||
|
||||
peekToken(lookahead, SUPER)) {
|
||||
//wildcards
|
||||
type = true;
|
||||
}
|
||||
break;
|
||||
case BYTE: case SHORT: case INT: case LONG: case FLOAT:
|
||||
case DOUBLE: case BOOLEAN: case CHAR:
|
||||
if (peekToken(lookahead, RPAREN)) {
|
||||
|
||||
41
langtools/test/tools/javac/parser/8014643/T8014643.java
Normal file
41
langtools/test/tools/javac/parser/8014643/T8014643.java
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8014643
|
||||
* @summary Parser regression in JDK 8 when compiling super.x
|
||||
* @compile T8014643.java
|
||||
*/
|
||||
class T8014643 {
|
||||
|
||||
static class A {
|
||||
int b = 1;
|
||||
}
|
||||
|
||||
static class B extends A {
|
||||
int b = 12;
|
||||
|
||||
int m() { return (super.b); }
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user