@@ -139,6 +139,7 @@ private void shutdown() {
139139
140140 if (debugWriter != null ) {
141141 debugWriter .close ();
142+ debugWriter = null ;
142143 }
143144 }
144145
@@ -409,37 +410,6 @@ private void debugMethod(ConfigurationTypeDescriptor typeDescriptor, String meth
409410 debug ("method registered for reflection" , typeDescriptor + "." + methodName + internalSignature );
410411 }
411412
412- /**
413- * Disables tracing on the current thread from instantiation until {@link #close}.
414- */
415- public sealed interface DisableTracing extends AutoCloseable {
416- @ Override
417- void close ();
418- }
419-
420- private final class DisableTracingImpl implements DisableTracing {
421- final String oldReason ;
422-
423- private DisableTracingImpl (String reason ) {
424- this .oldReason = disableTracingReason .get ();
425- disableTracingReason .set (reason );
426- }
427-
428- @ Override
429- public void close () {
430- disableTracingReason .set (oldReason );
431- }
432- }
433-
434- private static final class DisableTracingNoOp implements DisableTracing {
435- private static final DisableTracingNoOp INSTANCE = new DisableTracingNoOp ();
436-
437- @ Override
438- public void close () {
439- // do nothing
440- }
441- }
442-
443413 /**
444414 * Disables tracing on the current thread from instantiation until {@link DisableTracing#close}.
445415 * Should be used in a try-with-resources block.
@@ -541,6 +511,37 @@ static RuntimeSupport.Hook checkImproperOptionUsageHook() {
541511 }
542512 };
543513 }
514+
515+ /**
516+ * Disables tracing on the current thread from instantiation until {@link #close}.
517+ */
518+ public sealed interface DisableTracing extends AutoCloseable {
519+ @ Override
520+ void close ();
521+ }
522+
523+ private final class DisableTracingImpl implements DisableTracing {
524+ final String oldReason ;
525+
526+ private DisableTracingImpl (String reason ) {
527+ this .oldReason = disableTracingReason .get ();
528+ disableTracingReason .set (reason );
529+ }
530+
531+ @ Override
532+ public void close () {
533+ disableTracingReason .set (oldReason );
534+ }
535+ }
536+
537+ private static final class DisableTracingNoOp implements DisableTracing {
538+ private static final DisableTracingNoOp INSTANCE = new DisableTracingNoOp ();
539+
540+ @ Override
541+ public void close () {
542+ // do nothing
543+ }
544+ }
544545}
545546
546547record TraceOptions (Path path , boolean merge , Path debugLog ) {
0 commit comments