tpalfy commented on a change in pull request #3894: NIFI-6884 - Native library 
loading fixed/improved
URL: https://github.com/apache/nifi/pull/3894#discussion_r349527062
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarClassLoader.java
 ##########
 @@ -205,26 +216,41 @@ private void updateClasspath(File root) throws 
IOException {
     }
 
     @Override
-    protected String findLibrary(final String libname) {
+    public String findLibrary(String libname) {
 
 Review comment:
   The problem is that the abstract `ClassLoader` has an implementation 
returning null that takes precedent over the interface's default implementation.
   
   But I guess this ties back to the bigger question of wether is it even a 
good idea to use an interface as a trait instead of a member or an abstract 
superclass. (I give my opinion on that on that specific comment.)
   
   (Actually `ClassLoader` defines `findLibrary` as _protected_, which left 
alone wouldn't even compile because it would mean it would try to override the 
visibility of the _public_ definition of the interface. This actually points 
out a weakness of the trait interface approach. Had the ClassLoader defined the 
`findLibrary` as public, it would have been easy to simply leave out this call 
to the interface - as it would have compiled but wouldn't have worked properly 
as it would have returned null.)
   

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


With regards,
Apache Git Services

Reply via email to