diff options
Diffstat (limited to 'kamon-autoweave/src')
-rw-r--r-- | kamon-autoweave/src/main/scala/kamon/autoweave/loader/AttachmentProviders.scala | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/kamon-autoweave/src/main/scala/kamon/autoweave/loader/AttachmentProviders.scala b/kamon-autoweave/src/main/scala/kamon/autoweave/loader/AttachmentProviders.scala index 40f58502..ebb112e4 100644 --- a/kamon-autoweave/src/main/scala/kamon/autoweave/loader/AttachmentProviders.scala +++ b/kamon-autoweave/src/main/scala/kamon/autoweave/loader/AttachmentProviders.scala @@ -50,20 +50,6 @@ object AttachmentProviders extends { override def run(): ClassLoader = new URLClassLoader(Array[URL](toolsJar.toURI.toURL), null) } - def resolve(): Option[Class[_]] = { - import scala.util.control.Breaks._ - - var vmClazz: Option[Class[_]] = None - - breakable { - for (provider ← providers) { - val vmClass = provider.resolve() - if (vmClass.isDefined) { - vmClazz = vmClass - break - } - } - } - vmClazz - } + def resolve(): Option[Class[_]] = + providers.iterator.map(_.resolve()).collectFirst { case Some(clazz) ⇒ clazz } } |