This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 146a896  [OWB-1362] avoid NPE when XxHash64 naming is used for proxies
146a896 is described below

commit 146a8966e32fc3e3dc8dd0637bc63d76a06ddadc
Author: Romain Manni-Bucau <rmannibu...@gmail.com>
AuthorDate: Wed Dec 30 12:32:26 2020 +0100

    [OWB-1362] avoid NPE when XxHash64 naming is used for proxies
---
 .../main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
 
b/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
index efb5932..f9625f1 100644
--- 
a/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
+++ 
b/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
@@ -249,8 +249,10 @@ public abstract class AbstractProxyFactory
             // xxhash64 has very low collision so for this kind of has it is 
safe enough
             // and enables to avoid a big concatenation for names
             return Long.toString(Math.abs(XxHash64.apply(Stream.concat(
-                    
Stream.of(proxiedMethods).map(Method::toGenericString).sorted(),
-                    
Stream.of(notProxiedMethods).map(Method::toGenericString).map(it -> "<NOT>" + 
it).sorted()
+                    proxiedMethods == null ? Stream.empty() :
+                            
Stream.of(proxiedMethods).map(Method::toGenericString).sorted(),
+                    notProxiedMethods == null ? Stream.empty() :
+                            
Stream.of(notProxiedMethods).map(Method::toGenericString).map(it -> "<NOT>" + 
it).sorted()
             ).collect(joining("_")))));
         }
         // else unsafe - 1 proxy per class max!

Reply via email to