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 D4E2A200C32 for ; Thu, 9 Mar 2017 08:20:44 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D3A19160B84; Thu, 9 Mar 2017 07:20:44 +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 2F5AC160B64 for ; Thu, 9 Mar 2017 08:20:44 +0100 (CET) Received: (qmail 15002 invoked by uid 500); 9 Mar 2017 07:20:43 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 14886 invoked by uid 99); 9 Mar 2017 07:20:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 07:20:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 96545C7C0E for ; Thu, 9 Mar 2017 07:20:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.451 X-Spam-Level: * X-Spam-Status: No, score=1.451 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id H3c0V9Uc0J0Q for ; Thu, 9 Mar 2017 07:20:41 +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 44AD05FBE4 for ; Thu, 9 Mar 2017 07:20:41 +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 800B4E044C for ; Thu, 9 Mar 2017 07:20:39 +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 71FE4243D8 for ; Thu, 9 Mar 2017 07:20:38 +0000 (UTC) Date: Thu, 9 Mar 2017 07:20:38 +0000 (UTC) From: "Dmitri Blinov (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (JEXL-221) Sporadic undefined property error caused by NPE at MapGetExecutor.tryInvoke() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 09 Mar 2017 07:20:45 -0000 [ https://issues.apache.org/jira/browse/JEXL-221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15902603#comment-15902603 ] Dmitri Blinov commented on JEXL-221: ------------------------------------ Do you think we could also cross-check other Get|SetExecutors for similar bugs? > Sporadic undefined property error caused by NPE at MapGetExecutor.tryInvoke() > ----------------------------------------------------------------------------- > > Key: JEXL-221 > URL: https://issues.apache.org/jira/browse/JEXL-221 > Project: Commons JEXL > Issue Type: Bug > Affects Versions: 3.0 > Reporter: Dmitri Blinov > Assignee: Henri Biestro > > I'm getting sporadic undefined property error when accessing hashmap by a key. The stack trace tells the cause is NPE in MapGetExecutor.tryInvoke() at the following line: > {code} > if (obj != null && method != null > && objectClass.equals(obj.getClass()) > && (key == null || property.getClass().equals(key.getClass()))) { > {code} > I have managed to overcome this issue by adding the following null check: > {code} > if (obj != null && method != null > && objectClass.equals(obj.getClass()) > && (key == null || property != null && property.getClass().equals(key.getClass()))) { > {code} > I have only vague understanding of how things work inside jexl with tryInvoke() and unfortunately can not provide any test case for this, but it has worked in my case, so if nobody have any objections please include the fix in source tree. > Thanks! -- This message was sent by Atlassian JIRA (v6.3.15#6346)