blerer commented on a change in pull request #1398:
URL: https://github.com/apache/cassandra/pull/1398#discussion_r783836720



##########
File path: src/java/org/apache/cassandra/cql3/QueryEvents.java
##########
@@ -250,10 +242,19 @@ public void notifyPrepareFailure(@Nullable CQLStatement 
statement, String query,
         }
     }
 
-    private String possiblyObfuscateQuery(CQLStatement statement, String query)
+    private String maybeObfuscatePassword(CQLStatement statement, String query)
     {
         // Statement might be null as side-effect of failed parsing, 
originates from QueryMessage#execute
-        return null == statement || statement instanceof 
AuthenticationStatement ? passwordObfuscator.obfuscate(query) : query;
+        String res;
+
+        if (statement == null)
+            res = PasswordObfuscator.obfuscate(query);
+        else if (statement instanceof AuthenticationStatement)
+            res = ((AuthenticationStatement) 
statement).obfuscatePassword(query);
+        else
+            res = query;
+
+        return res;

Review comment:
       I do not believe that the impact of branch misprediction will be high in 
this case. This part of code is also not on the critical path so I would 
clearly prefer clarity. :-) 




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to