From 40f8fa94026d482f8318481bb64ae0245a39acbc Mon Sep 17 00:00:00 2001 From: michelou Date: Tue, 10 Mar 2009 11:39:04 +0000 Subject: removed deprecated warning, updated svn props, ... removed deprecated warning, updated svn props, cleaned up code --- src/compiler/scala/tools/nsc/plugins/Plugin.scala | 6 +++--- src/compiler/scala/tools/nsc/plugins/Plugins.scala | 11 +++-------- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'src/compiler/scala/tools/nsc/plugins') diff --git a/src/compiler/scala/tools/nsc/plugins/Plugin.scala b/src/compiler/scala/tools/nsc/plugins/Plugin.scala index 4ebc83daa2..bce4876c41 100644 --- a/src/compiler/scala/tools/nsc/plugins/Plugin.scala +++ b/src/compiler/scala/tools/nsc/plugins/Plugin.scala @@ -81,7 +81,7 @@ object Plugin { val jar = new JarFile(jarfile) try { val ent = jar.getEntry("scalac-plugin.xml") - if(ent == null) return None + if (ent == null) return None val inBytes = jar.getInputStream(ent) val packXML = XML.load(inBytes) @@ -92,7 +92,7 @@ object Plugin { jar.close() } } catch { - case _:ZipException => None + case _: ZipException => None } } @@ -132,7 +132,7 @@ object Plugin { dir <- dirs if dir.isDirectory entries = dir.listFiles if entries ne null - entry <- entries.toList.sort((f1, f2) => f1.getName <= f2.getName) + entry <- entries.toList.sort(_.getName <= _.getName) if entry.toString.toLowerCase endsWith ".jar" pdesc <- loadDescription(entry) if !(ignoring contains pdesc.name) diff --git a/src/compiler/scala/tools/nsc/plugins/Plugins.scala b/src/compiler/scala/tools/nsc/plugins/Plugins.scala index cd457dfec1..812bfd7ce8 100644 --- a/src/compiler/scala/tools/nsc/plugins/Plugins.scala +++ b/src/compiler/scala/tools/nsc/plugins/Plugins.scala @@ -20,7 +20,8 @@ trait Plugins { self: Global => /** Load a rough list of the plugins. For speed, it * does not instantiate a compiler run. Therefore it cannot * test for same-named phases or other problems that are - * filtered from the final list of plugins. */ + * filtered from the final list of plugins. + */ protected def loadRoughPluginsList(): List[Plugin] = { val jars = settings.plugin.value.map(new File(_)) val dirs = @@ -41,7 +42,6 @@ trait Plugins { self: Global => roughPluginsListCache.get } - /** Load all available plugins. Skips plugins that * either have the same name as another one, or which * define a phase name that another one does. @@ -117,7 +117,6 @@ trait Plugins { self: Global => plugs } - private var pluginsCache: Option[List[Plugin]] = None def plugins: List[Plugin] = { @@ -126,7 +125,6 @@ trait Plugins { self: Global => pluginsCache.get } - /** A description of all the plugins that are loaded */ def pluginDescriptions: String = { val messages = @@ -140,10 +138,7 @@ trait Plugins { self: Global => * @see phasesSet */ protected def computePluginPhases() { - - var plugPhases = plugins.flatMap(_.components) - - // Add all phases supplied by plugins to the phasesSet + val plugPhases = plugins.flatMap(_.components) for (pPhase <- plugPhases) { phasesSet += pPhase } -- cgit v1.2.3