@@ -141,7 +141,7 @@ class Driver implements ServerStarter {
141141 DetachableFileSystemManager ? detachableFileSystemManager;
142142
143143 /// The instrumentation service that is to be used by the analysis server.
144- InstrumentationService ? instrumentationService ;
144+ late final InstrumentationService _instrumentationService ;
145145
146146 /// Use the given command-line [arguments] to start this server.
147147 ///
@@ -270,10 +270,7 @@ class Driver implements ServerStarter {
270270 var logFilePath =
271271 results.option (PROTOCOL_TRAFFIC_LOG ) ??
272272 results.option (PROTOCOL_TRAFFIC_LOG_ALIAS );
273- var allInstrumentationServices =
274- this .instrumentationService == null
275- ? < InstrumentationService > []
276- : [this .instrumentationService! ];
273+ var allInstrumentationServices = < InstrumentationService > [];
277274 if (logFilePath != null ) {
278275 _rollLogFiles (logFilePath, 5 );
279276 allInstrumentationServices.add (
@@ -289,21 +286,20 @@ class Driver implements ServerStarter {
289286 allInstrumentationServices.add (
290287 CrashReportingInstrumentation (crashReportSender),
291288 );
292- var instrumentationService = MulticastInstrumentationService (
289+ _instrumentationService = MulticastInstrumentationService (
293290 allInstrumentationServices,
294291 );
295- this .instrumentationService = instrumentationService;
296292
297- instrumentationService .logVersion (
293+ _instrumentationService .logVersion (
298294 results.option (TRAIN_USING ) != null
299295 ? 'training-0'
300- : _readUuid (instrumentationService ),
296+ : _readUuid (_instrumentationService ),
301297 analysisServerOptions.clientId ?? '' ,
302298 analysisServerOptions.clientVersion ?? '' ,
303299 PROTOCOL_VERSION ,
304300 defaultSdk.languageVersion.toString (),
305301 );
306- AnalysisEngine .instance.instrumentationService = instrumentationService ;
302+ AnalysisEngine .instance.instrumentationService = _instrumentationService ;
307303
308304 int ? diagnosticServerPort;
309305 var portValue =
@@ -335,7 +331,7 @@ class Driver implements ServerStarter {
335331 analysisServerOptions,
336332 dartSdkManager,
337333 analyticsManager,
338- instrumentationService ,
334+ _instrumentationService ,
339335 diagnosticServerPort,
340336 errorNotifier,
341337 );
@@ -347,7 +343,7 @@ class Driver implements ServerStarter {
347343 dartSdkManager,
348344 analyticsManager,
349345 crashReportingAttachmentsBuilder,
350- instrumentationService ,
346+ _instrumentationService ,
351347 RequestStatisticsHelper (),
352348 diagnosticServerPort,
353349 errorNotifier,
0 commit comments