From af4ecb70d9ebd336dbb439c3fdfb40cf0dbb76b6 Mon Sep 17 00:00:00 2001 From: Andre Dietisheim Date: Wed, 21 Jun 2023 15:54:39 +0200 Subject: [PATCH] create new builder each time new msg is created Signed-off-by: Andre Dietisheim --- .../core/service/TelemetryServiceFactory.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/telemetry/core/service/TelemetryServiceFactory.java b/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/telemetry/core/service/TelemetryServiceFactory.java index 4f925b501..184f83a2c 100644 --- a/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/telemetry/core/service/TelemetryServiceFactory.java +++ b/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/telemetry/core/service/TelemetryServiceFactory.java @@ -18,23 +18,23 @@ public class TelemetryServiceFactory { - private final Environment.Builder builder = new Environment.Builder() - .ide(new IDE.Factory().create().setJavaVersion()); + private final IDE ide = new IDE.Factory() + .create() + .setJavaVersion(); - public TelemetryService create(Plugin plugin) { - Environment environment = builder.plugin(plugin).build(); - TelemetryConfiguration configuration = TelemetryConfiguration.getInstance(); - IMessageBroker broker = createSegmentBroker(configuration.isDebug(), environment); - return new TelemetryService(configuration, broker); - } + public TelemetryService create(Plugin plugin) { + Environment environment = new Environment.Builder() + .ide(ide) + .plugin(plugin) + .build(); + TelemetryConfiguration configuration = TelemetryConfiguration.getInstance(); + IMessageBroker broker = createSegmentBroker(configuration.isDebug(), environment); + return new TelemetryService(configuration, broker); + } - private IMessageBroker createSegmentBroker(boolean isDebug, Environment environment) { - SegmentConfiguration brokerConfiguration = new SegmentConfiguration(); - return new SegmentBroker( - isDebug, - UserId.INSTANCE.get(), - environment, - brokerConfiguration); - } + private IMessageBroker createSegmentBroker(boolean isDebug, Environment environment) { + SegmentConfiguration brokerConfiguration = new SegmentConfiguration(); + return new SegmentBroker(isDebug, UserId.INSTANCE.get(), environment, brokerConfiguration); + } }