From users-return-24123-apmail-tomee-users-archive=tomee.apache.org@tomee.apache.org Thu Aug 4 13:40:49 2016 Return-Path: X-Original-To: apmail-tomee-users-archive@www.apache.org Delivered-To: apmail-tomee-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 42BF819F6C for ; Thu, 4 Aug 2016 13:40:49 +0000 (UTC) Received: (qmail 55773 invoked by uid 500); 4 Aug 2016 13:40:49 -0000 Delivered-To: apmail-tomee-users-archive@tomee.apache.org Received: (qmail 55735 invoked by uid 500); 4 Aug 2016 13:40:49 -0000 Mailing-List: contact users-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tomee.apache.org Delivered-To: mailing list users@tomee.apache.org Received: (qmail 55723 invoked by uid 99); 4 Aug 2016 13:40:48 -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, 04 Aug 2016 13:40:48 +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 64D87188567 for ; Thu, 4 Aug 2016 13:40:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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 o8wJ5R5Yf26y for ; Thu, 4 Aug 2016 13:40:44 +0000 (UTC) Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id C76395F23C for ; Thu, 4 Aug 2016 13:40:43 +0000 (UTC) Received: by mail-qt0-f194.google.com with SMTP id q11so13215479qtb.2 for ; Thu, 04 Aug 2016 06:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=z4cfvBFUPTcPWl2FqCb+bL8TzfEYevaz7Mp8YyxRw6Q=; b=LwwV0fx6iMHg5Eg29s0lnOdNga+iBkrJBWvFavyYODUWmEY2/6DJwqgRf8NLqm2kBw 59duIdKJvVR3qZ2eBpwF+YQqAb5p8L7U3+2wymvS8OBjBMtfanGVBBvAZ5qFuhgrzpEL FrK59h6L1RBOrtjjYuBayOuQN58zQYbORM+88M+HcWTTi8tZtvGz0IgUqZzm0xK7A5on gwYMvY3Bibmp+sXV7ZGoHFHS483IJN7dXr54HvUW3Zq5gnpZhmVJtnqH8nSzK8rNnLLB 3ig9t+BATe+dSMWroTc1m/bwQpipLVmKSjUtAVv2BBgWfMEVJPTsO3NsP4zLuSqfIlEY aDmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=z4cfvBFUPTcPWl2FqCb+bL8TzfEYevaz7Mp8YyxRw6Q=; b=M6HqFPpSq6ln+OHHwbRF0VHXeJFrdeZoZXQNevkC39Uo8ux86G4Yb6TEsaAEAwIGp0 gO9u9+HyB3sLDNDBxstHW422OZlRyTvJrIabUe+Eeq+6NYeyc542EnNHj5UTxrr+ctEm GI31cuZl5oso791aPaYJEGNdfujPbUN20uN9dJyhmbVwnRI/Ar0flmPZWHsQDnofQOXW uHjw0AIuA7UI7tC2c2xTRkiYcO9wpbDc3hfkpL3TboraJDV47LpOmlVrFCwosjyz+XuH P/CU4PiJIMmMeRydcjk1cX8UDmgLByVoiiu+ITvYELykDHJhkKoC/vOjAMcpvkEYr2Ql hBTw== X-Gm-Message-State: AEkoousahg9ZNF0LGJZkhrTQBsVtOjdPAdp/tvPyFl4g1gaYfpGqhyWbhKvRwGPu7VZ1KypiODksOmVZ44anFw== X-Received: by 10.200.47.253 with SMTP id m58mr6614018qta.60.1470318042732; Thu, 04 Aug 2016 06:40:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.39.186 with HTTP; Thu, 4 Aug 2016 06:40:42 -0700 (PDT) In-Reply-To: References: From: Svetlin Zarev Date: Thu, 4 Aug 2016 16:40:42 +0300 Message-ID: Subject: Re: TomcatWebAppBuilder overwrites the last added event listener To: users@tomee.apache.org Content-Type: multipart/alternative; boundary=001a1134f448a4fd4e05393f1840 --001a1134f448a4fd4e05393f1840 Content-Type: text/plain; charset=UTF-8 Thanks, I've created a JIRA issue and also attached a sample application that demonstrates the issue: https://issues.apache.org/jira/browse/TOMEE-1896 2016-08-04 16:25 GMT+03:00 Romain Manni-Bucau : > Best is either JIRA with a patch or github with a pull request. In both > cases ensure to provide a test case reproducing the issue you think you > spotted > > You probably missed the line just before the arraycopy which init the first > index and the copy starts from index 1 so all is done as expected I think. > > > Romain Manni-Bucau > @rmannibucau | Blog > | Old Wordpress Blog > | Github < > https://github.com/rmannibucau> | > LinkedIn | Tomitriber > | JavaEE Factory > > > 2016-08-04 15:22 GMT+02:00 Svetlin Zarev >: > > > Hi, > > > > > we set the first and last listeners so it looks right. > > > > Notice the initial index of the destination array in the > System.arraycopy() > > call. You start from index 1 -> the first element in the new array is > NULL > > and last one gets overwritten by: > > > > newEventListeners[newEventListeners.length - 1] = endWebBeansListener; > > > > > > But if you System.arraycopy() to the destination array with start index > of > > 0, the first element of the array will not be NULL, but will contain the > > first listener as expected. In that case the last element will be NULL > and > > > > newEventListeners[newEventListeners.length - 1] = endWebBeansListener; > > > > will not overwrite anything. > > > > PS: Is there a better place to report such issues ? Does someone monitor > > the github mirror, so I can make pull request which are much easier to > > review as they have more context ? > > > > Kind regards, > > Svetlin > > > --001a1134f448a4fd4e05393f1840--