Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3CFE7200CC6 for ; Tue, 18 Jul 2017 16:09:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 39E91166E67; Tue, 18 Jul 2017 14:09:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 80D55166E63 for ; Tue, 18 Jul 2017 16:09:35 +0200 (CEST) Received: (qmail 65834 invoked by uid 500); 18 Jul 2017 14:09:34 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 65825 invoked by uid 99); 18 Jul 2017 14:09:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jul 2017 14:09:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E199DE0192; Tue, 18 Jul 2017 14:09:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sunlan@apache.org To: commits@groovy.apache.org Message-Id: <1c0de535bb5c4dacbe5cbd74d720b54f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: Minor refactoring Date: Tue, 18 Jul 2017 14:09:33 +0000 (UTC) archived-at: Tue, 18 Jul 2017 14:09:36 -0000 Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X 98b4e57d9 -> f0d835bb6 Minor refactoring (cherry picked from commit d334330) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/f0d835bb Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/f0d835bb Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/f0d835bb Branch: refs/heads/GROOVY_2_6_X Commit: f0d835bb64730f2c770886f143d10c4a2c33bddb Parents: 98b4e57 Author: sunlan Authored: Tue Jul 18 22:05:21 2017 +0800 Committer: sunlan Committed: Tue Jul 18 22:09:18 2017 +0800 ---------------------------------------------------------------------- .../org/apache/groovy/parser/antlr4/AstBuilder.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/f0d835bb/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java ---------------------------------------------------------------------- diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java index 064afc5..3709576 100644 --- a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java +++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java @@ -2210,7 +2210,7 @@ public class AstBuilder extends GroovyParserBaseVisitor implements Groov VariableExpression.THIS_EXPRESSION, (baseExpr instanceof VariableExpression) - ? this.createConstantExpression((VariableExpression) baseExpr) + ? this.createConstantExpression(baseExpr) : baseExpr, this.configureAST( @@ -3948,7 +3948,7 @@ public class AstBuilder extends GroovyParserBaseVisitor implements Groov VariableExpression.THIS_EXPRESSION, (baseExpr instanceof VariableExpression) - ? this.createConstantExpression((VariableExpression) baseExpr) + ? this.createConstantExpression(baseExpr) : baseExpr, arguments @@ -4108,11 +4108,8 @@ public class AstBuilder extends GroovyParserBaseVisitor implements Groov return true; } - if (isAnonymousInnerEnumDeclaration) { - return true; - } + return isAnonymousInnerEnumDeclaration; - return false; } // the mixins of interface and annotation should be null @@ -4145,11 +4142,8 @@ public class AstBuilder extends GroovyParserBaseVisitor implements Groov private boolean isPackageInfoDeclaration() { String name = this.sourceUnit.getName(); - if (null != name && name.endsWith(PACKAGE_INFO_FILE_NAME)) { - return true; - } + return null != name && name.endsWith(PACKAGE_INFO_FILE_NAME); - return false; } private boolean isBlankScript(CompilationUnitContext ctx) {