langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
changeset 22701 67811024e8b4
parent 22165 ec53c8946fc2
child 23131 90aee246c017
equal deleted inserted replaced
22700:fff5613a52e3 22701:67811024e8b4
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  3646                 this.receiverParam = lastParam;
  3646                 this.receiverParam = lastParam;
  3647             } else {
  3647             } else {
  3648                 params.append(lastParam);
  3648                 params.append(lastParam);
  3649             }
  3649             }
  3650             this.allowThisIdent = false;
  3650             this.allowThisIdent = false;
  3651             while ((lastParam.mods.flags & Flags.VARARGS) == 0 && token.kind == COMMA) {
  3651             while (token.kind == COMMA) {
       
  3652                 if ((lastParam.mods.flags & Flags.VARARGS) != 0) {
       
  3653                     error(lastParam, "varargs.must.be.last");
       
  3654                 }
  3652                 nextToken();
  3655                 nextToken();
  3653                 params.append(lastParam = formalParameter(lambdaParameters));
  3656                 params.append(lastParam = formalParameter(lambdaParameters));
  3654             }
  3657             }
  3655         }
  3658         }
  3656         accept(RPAREN);
  3659         if (token.kind == RPAREN) {
       
  3660             nextToken();
       
  3661         } else {
       
  3662             setErrorEndPos(token.pos);
       
  3663             reportSyntaxError(S.prevToken().endPos, "expected3", COMMA, RPAREN, LBRACKET);
       
  3664         }
  3657         return params.toList();
  3665         return params.toList();
  3658     }
  3666     }
  3659 
  3667 
  3660     List<JCVariableDecl> implicitParameters(boolean hasParens) {
  3668     List<JCVariableDecl> implicitParameters(boolean hasParens) {
  3661         if (hasParens) {
  3669         if (hasParens) {