smiklosovic commented on code in PR #4942:
URL: https://github.com/apache/cassandra/pull/4942#discussion_r3594611489


##########
src/java/org/apache/cassandra/triggers/TriggerExecutor.java:
##########
@@ -252,11 +253,29 @@ private List<Mutation> executeInternal(PartitionUpdate 
update)
         }
     }
 
+    public synchronized Class<? extends ITrigger> loadTriggerClass(String 
triggerClass) throws Exception
+    {
+        // Load without initialization so the type can be verified before the 
class's static initializer runs.
+        Class<? extends ITrigger> trigger;
+        try
+        {
+            trigger = 
FBUtilities.classForNameWithoutInitialization(triggerClass, "trigger", 
ITrigger.class, customClassLoader);
+        }
+        catch (ConfigurationException e)
+        {
+            if (e.getCause() instanceof ClassNotFoundException)
+                throw (ClassNotFoundException) e.getCause();
+            throw e;
+        }
+        trigger.getConstructor();

Review Comment:
   this is redundant, no? You call 
   
   return loadTriggerClass(triggerClass).getConstructor().newInstance();
   
   so `getConstructor()` is called twice. Once here, second time after this 
method is executed. 



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