aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common/command
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2024-09-03 20:37:54 +0100
committerLuck <git@lucko.me>2024-09-03 20:37:54 +0100
commit684cc5e071e30161bea825ba2b4b9f7b9984805d (patch)
tree8f61f2d3970ccb274cb0617d1a31849dd8424b19 /spark-common/src/main/java/me/lucko/spark/common/command
parent35b557af4fd1bc0ce0a5745716e898cd1300a08c (diff)
downloadspark-684cc5e071e30161bea825ba2b4b9f7b9984805d.tar.gz
spark-684cc5e071e30161bea825ba2b4b9f7b9984805d.tar.bz2
spark-684cc5e071e30161bea825ba2b4b9f7b9984805d.zip
Refactor sampler node export process
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/command')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java
index 334e416..cc7d56b 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/SamplerModule.java
@@ -37,12 +37,11 @@ import me.lucko.spark.common.sampler.SamplerMode;
import me.lucko.spark.common.sampler.ThreadDumper;
import me.lucko.spark.common.sampler.ThreadGrouper;
import me.lucko.spark.common.sampler.async.AsyncSampler;
-import me.lucko.spark.common.sampler.node.MergeMode;
+import me.lucko.spark.common.sampler.java.MergeStrategy;
import me.lucko.spark.common.sampler.source.ClassSourceLookup;
import me.lucko.spark.common.tick.TickHook;
import me.lucko.spark.common.util.FormatUtil;
import me.lucko.spark.common.util.MediaTypes;
-import me.lucko.spark.common.util.MethodDisambiguator;
import me.lucko.spark.common.ws.ViewerSocket;
import me.lucko.spark.proto.SparkSamplerProtos;
import net.kyori.adventure.text.Component;
@@ -507,12 +506,7 @@ public class SamplerModule implements CommandModule {
return new Sampler.ExportProps()
.creator(resp.senderData())
.comment(Iterables.getFirst(arguments.stringFlag("comment"), null))
- .mergeMode(() -> {
- MethodDisambiguator methodDisambiguator = new MethodDisambiguator(platform.createClassFinder());
- return arguments.boolFlag("separate-parent-calls")
- ? MergeMode.separateParentCalls(methodDisambiguator)
- : MergeMode.sameMethod(methodDisambiguator);
- })
+ .mergeStrategy(arguments.boolFlag("separate-parent-calls") ? MergeStrategy.SEPARATE_PARENT_CALLS : MergeStrategy.SAME_METHOD)
.classSourceLookup(() -> ClassSourceLookup.create(platform));
}