From notifications-return-15629-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Thu Feb 21 06:19:09 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id BB75918077A for ; Thu, 21 Feb 2019 07:19:08 +0100 (CET) Received: (qmail 88825 invoked by uid 500); 21 Feb 2019 06:19:07 -0000 Mailing-List: contact notifications-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 notifications@groovy.apache.org Received: (qmail 88816 invoked by uid 99); 21 Feb 2019 06:19:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2019 06:19:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4D1CD18B029 for ; Thu, 21 Feb 2019 06:19:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id g2op7xid6k4C for ; Thu, 21 Feb 2019 06:19:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 98BA862496 for ; Thu, 21 Feb 2019 06:19:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 46F34E27E6 for ; Thu, 21 Feb 2019 06:19:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A70942452E for ; Thu, 21 Feb 2019 06:19:02 +0000 (UTC) Date: Thu, 21 Feb 2019 06:19:02 +0000 (UTC) From: "Paul King (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (GROOVY-8959) NPE in StaticVerifier MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GROOVY-8959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King closed GROOVY-8959. ----------------------------- > NPE in StaticVerifier > --------------------- > > Key: GROOVY-8959 > URL: https://issues.apache.org/jira/browse/GROOVY-8959 > Project: Groovy > Issue Type: Bug > Components: Compiler > Affects Versions: 2.4.16, 2.5.5 > Reporter: Eric Milles > Assignee: Paul King > Priority: Major > Fix For: 2.5.6, 3.0.0-alpha-5 > > > I don't have the exact code that created this error, but the fix seems pretty simple. > {code:java} > // excerpt from StaticVerifier.visitConstructorOrMethod > public void visitVariableExpression(VariableExpression ve) { > if (exceptions.contains(ve.getName())) return; > /* GRECLIPSE edit -- VariableExpression.isInStaticContext is null safe > Variable av = ve.getAccessedVariable(); > if (av instanceof DynamicVariable || !av.isInStaticContext()) { // this is line 96 > */ > if (ve.getAccessedVariable() instanceof DynamicVariable || !ve.isInStaticContext()) { > // GRECLIPSE end > addVariableError(ve); > } > } > {code} > {code} > java.lang.NullPointerException > at org.codehaus.groovy.control.StaticVerifier$1.visitVariableExpression(StaticVerifier.java:96) > at org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:72) > at org.codehaus.groovy.ast.CodeVisitorSupport.visitPropertyExpression(CodeVisitorSupport.java:302) > at org.codehaus.groovy.ast.expr.PropertyExpression.visit(PropertyExpression.java:57) > at org.codehaus.groovy.control.StaticVerifier.visitConstructorOrMethod(StaticVerifier.java:91) > at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructor(ClassCodeVisitorSupport.java:162) > at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1210) > at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54) > at org.codehaus.groovy.control.StaticVerifier.visitClass(StaticVerifier.java:54) > at org.codehaus.groovy.control.CompilationUnit$13.call(CompilationUnit.java:241) > at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1143) > ... 20 more > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)