pnowojski commented on a change in pull request #8768: [FLINK-12143] Fix file 
system dynamic class loading on create
URL: https://github.com/apache/flink/pull/8768#discussion_r294722813
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/core/plugin/Plugin.java
 ##########
 @@ -21,13 +21,26 @@
 import org.apache.flink.annotation.PublicEvolving;
 import org.apache.flink.configuration.Configuration;
 
+import javax.annotation.Nullable;
+
 /**
  * Interface for plugins. Plugins typically extend this interface in their SPI 
and the concrete implementations of a
  * service then implement the SPI contract.
  */
 @PublicEvolving
 public interface Plugin {
 
+       /**
+        * Helper method to get the class loader used to load the plugin. This 
may be needed for some plugins that use
+        * dynamic class loading afterwards the plugin was loaded.
+        *
+        * @return the class loader used to load the plugin. {@code null} value 
may represent the bootstrap class loader.
 
 Review comment:
   (re `null`) - I think this is impossible to happen. How could bootstrap 
class loader be responsible for loading a `Plugin` class? It would have to be 
provided by rt.jar
   
   If I'm right, I would remove `@Nullable` annotation and add a checkState 
here `this.getClass().getClassLoader() != null`, to avoid `null` handling 
branches.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to