struberg commented on a change in pull request #30:
URL: https://github.com/apache/openwebbeans/pull/30#discussion_r460814308



##########
File path: 
webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
##########
@@ -1401,12 +1401,16 @@ else if (packageVetoed)
             {
                 String previousPackage = name.substring(0, idx);
                 Boolean result = packageVetoCache.get(previousPackage);
-                if (result != null && result)
+                if (result != null)
                 {
                     return result;
                 }
                 while (true)
                 {
+                    if (!previousPackage.isEmpty() && 
packageVetoCache.containsKey(previousPackage))

Review comment:
       basically fine, but this will check the uppermost package twice. It 
already got checked before entering the loop for the first time.
   Being a performance critical spot I'd also prefer to do `Boolean result = 
packageVetoCache.get(previousPackage);` as containsKey and get are basically 
the same operation. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to