Browse Source

Fix #524 (#525)

pull/527/head
dre4merp 2 years ago committed by GitHub
parent
commit
bdadc6667a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      demo/app/src/main/java/org/pf4j/demo/DemoPluginFactory.java
  2. 2
      pf4j/src/main/java/org/pf4j/DefaultPluginFactory.java

7
demo/app/src/main/java/org/pf4j/demo/DemoPluginFactory.java

@ -15,15 +15,18 @@
*/ */
package org.pf4j.demo; package org.pf4j.demo;
import java.lang.reflect.Constructor;
import org.pf4j.DefaultPluginFactory; import org.pf4j.DefaultPluginFactory;
import org.pf4j.Plugin; import org.pf4j.Plugin;
import org.pf4j.PluginWrapper; import org.pf4j.PluginWrapper;
import org.pf4j.demo.api.PluginContext; import org.pf4j.demo.api.PluginContext;
import org.slf4j.Logger;
import java.lang.reflect.Constructor; import org.slf4j.LoggerFactory;
class DemoPluginFactory extends DefaultPluginFactory { class DemoPluginFactory extends DefaultPluginFactory {
private static final Logger log = LoggerFactory.getLogger(DemoPluginFactory.class);
@Override @Override
protected Plugin createInstance(Class<?> pluginClass, PluginWrapper pluginWrapper) { protected Plugin createInstance(Class<?> pluginClass, PluginWrapper pluginWrapper) {
PluginContext context = new PluginContext(pluginWrapper.getRuntimeMode()); PluginContext context = new PluginContext(pluginWrapper.getRuntimeMode());

2
pf4j/src/main/java/org/pf4j/DefaultPluginFactory.java

@ -29,7 +29,7 @@ import java.lang.reflect.Modifier;
*/ */
public class DefaultPluginFactory implements PluginFactory { public class DefaultPluginFactory implements PluginFactory {
protected static final Logger log = LoggerFactory.getLogger(DefaultPluginFactory.class); private static final Logger log = LoggerFactory.getLogger(DefaultPluginFactory.class);
/** /**
* Creates a plugin instance. If an error occurs than that error is logged and the method returns {@code null}. * Creates a plugin instance. If an error occurs than that error is logged and the method returns {@code null}.

Loading…
Cancel
Save