Author: xavier Date: Sun Feb 10 03:58:04 2008 New Revision: 620263 URL: http://svn.apache.org/viewvc?rev=620263&view=rev Log: when looking for default branch, test if there's already an Ivy instance loaded, to avoid loading a default one just to get the default branch
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java?rev=620263&r1=620262&r2=620263&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java Sun Feb 10 03:58:04 2008 @@ -178,8 +178,12 @@ Map extraAttributes) { super(null, extraAttributes); this.moduleId = moduleId; - this.branch = branch == null ? IvyContext.getContext().getSettings().getDefaultBranch( - moduleId) : branch; + IvyContext context = IvyContext.getContext(); + this.branch = branch == null + // we test if there's already an Ivy instance loaded, to avoid loading a default one + // just to get the default branch + ? (context.peekIvy() == null ? null : context.getSettings().getDefaultBranch(moduleId)) + : branch; this.revision = revision == null ? Ivy.getWorkingRevision() : revision; setStandardAttribute(IvyPatternHelper.ORGANISATION_KEY, this.moduleId.getOrganisation()); setStandardAttribute(IvyPatternHelper.MODULE_KEY, this.moduleId.getName());