tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Svetlin Zarev <>
Subject Re: TomcatWebAppBuilder overwrites the last added event listener
Date Thu, 04 Aug 2016 13:22:05 GMT

> 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,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message