diff options
author | Diego Parra <diegolparra@gmail.com> | 2016-04-04 15:56:13 -0300 |
---|---|---|
committer | Diego Parra <diegolparra@gmail.com> | 2016-04-04 15:56:13 -0300 |
commit | 37a47488359758d96d73c592fe962a81bf856201 (patch) | |
tree | e4c2d2417dc84d2e1bd1f51acddeed02252f98f5 /kamon-autoweave/src/main/scala/kamon/autoweave | |
parent | d5ed007f3ac76fd1e1146d00a6665a4690af5c83 (diff) | |
parent | 483246fc184fe11d66e0e8307c114b3c48d6cc12 (diff) | |
download | Kamon-37a47488359758d96d73c592fe962a81bf856201.tar.gz Kamon-37a47488359758d96d73c592fe962a81bf856201.tar.bz2 Kamon-37a47488359758d96d73c592fe962a81bf856201.zip |
Merge pull request #338 from markus1189/breakable
= kamon-autoweave: Remove usage of `breakable`
Diffstat (limited to 'kamon-autoweave/src/main/scala/kamon/autoweave')
-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 } } |