diff --git a/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerActivator.java b/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerActivator.java index 61ce3cdad..f2e57ef7d 100644 --- a/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerActivator.java +++ b/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAnalyzerActivator.java @@ -21,7 +21,6 @@ import com.fr.record.analyzer.AnalyzerConfiguration; import com.fr.record.analyzer.AnalyzerKey; import com.fr.record.analyzer.DBMetrics; import com.fr.record.analyzer.FineAnalyzer; -import com.fr.record.analyzer.advice.AnalyzerAdviceConfiguration; import com.fr.record.analyzer.advice.AnalyzerAdviceKey; import com.fr.record.analyzer.advice.FineAdviceAssistant; import com.fr.record.analyzer.configuration.AnalyzerAssemblyFactory; @@ -60,7 +59,7 @@ public class DesignerAnalyzerActivator extends Activator implements Prepare { ExecutorService es = newSingleThreadExecutor(new NamedThreadFactory("designer-analyzer", true)); try { // 加入 retransform 部分的逻辑 - List adviceConfigurations = findMutable(AnalyzerAdviceKey.KEY); + List adviceConfigurations = findMutable(AnalyzerAdviceKey.KEY); if (!CollectionUtils.isEmpty(adviceConfigurations)) { AnalyzerConfiguration[] configurations = convertConfigurations(adviceConfigurations); @@ -77,10 +76,10 @@ public class DesignerAnalyzerActivator extends Activator implements Prepare { } @NotNull - private AnalyzerConfiguration[] convertConfigurations(List list) { + private AnalyzerConfiguration[] convertConfigurations(List list) { return list.stream() - .map((e) -> AnalyzerConfiguration.create(new FineAdviceAssistant(e.getMatcher(), e.getAdviceClass()))) + .map(AnalyzerConfiguration::create) .toArray(AnalyzerConfiguration[]::new); } @@ -92,27 +91,27 @@ public class DesignerAnalyzerActivator extends Activator implements Prepare { @Override public void prepare() { - addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( + addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( ElementMatchers.isAnnotatedWith(Focus.class), FocusAdvice.class )); - addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( + addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( ElementMatchers.isAnnotatedWith(Compute.class), MonitorAdvice.class )); - addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( + addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( ElementMatchers.isAnnotatedWith(DBMetrics.class), DBMonitorAdvice.class )); - addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( + addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( ElementMatchers.isAnnotatedWith(PerformancePoint.class), PerformancePointAdvice.class )); - addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( + addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( ElementMatchers.isAnnotatedWith(FaultTolerance.class), FaultToleranceAdvice.class )); diff --git a/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAssemblyFactory.java b/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAssemblyFactory.java index 0c8ffa40e..2e5fdc408 100644 --- a/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAssemblyFactory.java +++ b/designer-base/src/main/java/com/fr/design/record/analyzer/DesignerAssemblyFactory.java @@ -12,7 +12,7 @@ import java.util.Map; * * created by Harrison on 2022/03/07 **/ -public class DesignerAssemblyFactory implements AnalyzerAssemblyFactory { +public class DesignerAssemblyFactory implements AnalyzerAssemblyFactory { /** * 每次执行 1 个 class 的 retransform @@ -38,7 +38,7 @@ public class DesignerAssemblyFactory implements AnalyzerAssemblyFactory { } @Override - public AnalyzerAssemblyFactory prepare(Object material) { + public AnalyzerAssemblyFactory prepare(Void material) { return this; }