From 56c86a1684389c282179efdb1aaee9198b87fb3d Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Tue, 13 Jan 2026 09:11:35 +0900 Subject: [PATCH] [2.x] Delete TrapExitSecurityException (#8503) --- build.sbt | 1 + .../scala/sbt/TrapExitSecurityException.scala | 23 ------------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 run/src/main/scala/sbt/TrapExitSecurityException.scala diff --git a/build.sbt b/build.sbt index 06d065e38..cbbd89382 100644 --- a/build.sbt +++ b/build.sbt @@ -485,6 +485,7 @@ lazy val runProj = (project in file("run")) contrabandSettings, mimaSettings, mimaBinaryIssueFilters ++= Seq( + exclude[MissingClassProblem]("sbt.TrapExitSecurityException"), ) ) .configure(addSbtIO, addSbtCompilerClasspath) diff --git a/run/src/main/scala/sbt/TrapExitSecurityException.scala b/run/src/main/scala/sbt/TrapExitSecurityException.scala deleted file mode 100644 index 894a2baff..000000000 --- a/run/src/main/scala/sbt/TrapExitSecurityException.scala +++ /dev/null @@ -1,23 +0,0 @@ -/* - * sbt - * Copyright 2023, Scala center - * Copyright 2011 - 2022, Lightbend, Inc. - * Copyright 2008 - 2010, Mark Harrah - * Licensed under Apache License 2.0 (see LICENSE) - */ - -package sbt - -/** - * A custom SecurityException that tries not to be caught. Closely based on a similar class in - * Nailgun. The main goal of this exception is that once thrown, it propagates all of the way up the - * call stack, terminating the thread's execution. - */ -private final class TrapExitSecurityException(val exitCode: Int) extends SecurityException { - override def printStackTrace = throw this - override def toString = throw this - override def getCause = throw this - override def getMessage = throw this - override def fillInStackTrace = throw this - override def getLocalizedMessage = throw this -}