From 032f63854970c653bcd45dcc387a56d4e6db4cff Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Fri, 11 Feb 2011 20:09:42 -0500 Subject: [PATCH] fix stray Ivy logging message when directly accessing IvySbt#Module --- ivy/Ivy.scala | 8 +++++--- ivy/IvyInterface.scala | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ivy/Ivy.scala b/ivy/Ivy.scala index f5d2bd2bb..ff2412554 100644 --- a/ivy/Ivy.scala +++ b/ivy/Ivy.scala @@ -91,10 +91,12 @@ final class IvySbt(val configuration: IvyConfiguration) def owner = IvySbt.this def logger = configuration.log def withModule[T](f: (Ivy,DefaultModuleDescriptor,String) => T): T = - withIvy[T] { ivy => f(ivy, moduleDescriptor, defaultConfig) } + withIvy[T] { ivy => f(ivy, moduleDescriptor0, defaultConfig0) } - def moduleDescriptor = IvySbt.synchronized { moduleDescriptor0 } - def defaultConfig = IvySbt.synchronized { defaultConfig0 } + def moduleDescriptor = withModule((_,md,_) => md) + def defaultConfig = withModule( (_,_,dc) => dc) + // these should only be referenced by withModule because lazy vals synchronize on this object + // withIvy explicitly locks the IvySbt object, so they have to be done in the right order to avoid deadlock private[this] lazy val (moduleDescriptor0: DefaultModuleDescriptor, defaultConfig0: String) = { val (baseModule, baseConfiguration) = diff --git a/ivy/IvyInterface.scala b/ivy/IvyInterface.scala index 30427c299..b56187ad9 100644 --- a/ivy/IvyInterface.scala +++ b/ivy/IvyInterface.scala @@ -356,7 +356,7 @@ object Artifact val name = file.getName val i = name.lastIndexOf('.') val base = if(i >= 0) name.substring(0, i) else name - Artifact(name, extract(name, defaultType), extract(name, defaultExtension), None, Nil, Some(file.toURI.toURL)) + Artifact(base, extract(name, defaultType), extract(name, defaultExtension), None, Nil, Some(file.toURI.toURL)) } } final case class ModuleConfiguration(organization: String, name: String, revision: String, resolver: Resolver)