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 38FE8200CD8 for ; Wed, 19 Jul 2017 03:51:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 37764167EE9; Wed, 19 Jul 2017 01:51:52 +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 7D8A6167E8A for ; Wed, 19 Jul 2017 03:51:51 +0200 (CEST) Received: (qmail 47914 invoked by uid 500); 19 Jul 2017 01:51:50 -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 47901 invoked by uid 99); 19 Jul 2017 01:51:50 -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; Wed, 19 Jul 2017 01:51:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 63B06E382F; Wed, 19 Jul 2017 01:51:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: paulk@apache.org To: commits@groovy.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: GROOVY-8262: GrabAnnotationTransformation.visit has unreachable code Date: Wed, 19 Jul 2017 01:51:50 +0000 (UTC) archived-at: Wed, 19 Jul 2017 01:51:52 -0000 Repository: groovy Updated Branches: refs/heads/master d3343303e -> 4788991f8 GROOVY-8262: GrabAnnotationTransformation.visit has unreachable code Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/4788991f Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/4788991f Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/4788991f Branch: refs/heads/master Commit: 4788991f8cbfcb2ea7056f9b235149ac5875fd76 Parents: d334330 Author: paulk Authored: Wed Jul 19 11:49:58 2017 +1000 Committer: paulk Committed: Wed Jul 19 11:51:38 2017 +1000 ---------------------------------------------------------------------- src/main/groovy/grape/GrabAnnotationTransformation.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/4788991f/src/main/groovy/grape/GrabAnnotationTransformation.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/grape/GrabAnnotationTransformation.java b/src/main/groovy/grape/GrabAnnotationTransformation.java index 16f3b47..e0b501f 100644 --- a/src/main/groovy/grape/GrabAnnotationTransformation.java +++ b/src/main/groovy/grape/GrabAnnotationTransformation.java @@ -256,9 +256,8 @@ public class GrabAnnotationTransformation extends ClassCodeVisitorSupport implem } else { for (String s : GRABRESOLVER_REQUIRED) { String mval = getMemberStringValue(node, s); - if (mval != null && mval.isEmpty()) mval = null; Expression member = node.getMember(s); - if (member == null || mval == null) { + if (member == null || (mval != null && mval.isEmpty())) { addError("The missing attribute \"" + s + "\" is required in @" + node.getClassNode().getNameWithoutPackage() + " annotations", node); continue grabResolverAnnotationLoop; } else if (mval == null) {