File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
hub/src/main/java/cloud/katta/core Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 44
55package cloud .katta .core ;
66
7+ import ch .cyberduck .core .Controller ;
78import ch .cyberduck .core .Factory ;
89
910import org .apache .commons .lang3 .reflect .ConstructorUtils ;
@@ -20,16 +21,16 @@ private DeviceSetupCallbackFactory() {
2021 super ("factory.devicesetupcallback.class" );
2122 }
2223
23- public DeviceSetupCallback create () {
24+ public DeviceSetupCallback create (final Controller controller ) {
2425 try {
2526 final Constructor <? extends DeviceSetupCallback > constructor
26- = ConstructorUtils .getMatchingAccessibleConstructor (clazz );
27+ = ConstructorUtils .getMatchingAccessibleConstructor (clazz , controller . getClass () );
2728 if (null == constructor ) {
28- log .warn ("No default controller in {}" , constructor .getClass ());
29+ log .warn ("No matching constructor for parameter {}" , controller .getClass ());
2930 // Call default constructor for disabled implementations
3031 return clazz .getDeclaredConstructor ().newInstance ();
3132 }
32- return constructor .newInstance ();
33+ return constructor .newInstance (controller );
3334 }
3435 catch (InstantiationException | InvocationTargetException | IllegalAccessException | NoSuchMethodException e ) {
3536 log .error ("Failure loading callback class {}. {}" , clazz , e .getMessage ());
You can’t perform that action at this time.
0 commit comments