Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C323010F8D for ; Tue, 14 Jan 2014 08:32:40 +0000 (UTC) Received: (qmail 73675 invoked by uid 500); 14 Jan 2014 08:28:43 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 73638 invoked by uid 500); 14 Jan 2014 08:28:39 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 73606 invoked by uid 99); 14 Jan 2014 08:28:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 08:28:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 08:28:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0FDFD2388A9B for ; Tue, 14 Jan 2014 08:27:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1557968 [5/26] - in /ant/ivy/core/trunk: src/java/org/apache/ivy/ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/ src/java/org/apache/ivy/core/cache/ src/java/org/apache/ivy/core/check/ src/java/org/apache/ivy/core/deliver/ src/... Date: Tue, 14 Jan 2014 08:27:43 -0000 To: notifications@ant.apache.org From: jlboudart@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140114082759.0FDFD2388A9B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ModuleDescriptorMemoryCache.java Tue Jan 14 08:27:37 2014 @@ -28,20 +28,20 @@ import org.apache.ivy.plugins.parser.Par import org.apache.ivy.util.Message; /** - * Cache ModuleDescriptors so that when the same module is used twice (in multi-module build for - * instance), it is parsed only once. - * This cache is has a limited size, and keep the most recently used entries. - * The entry in the cache are invalidated if there is a change to one variable - * used in the module descriptor. + * Cache ModuleDescriptors so that when the same module is used twice (in multi-module build for + * instance), it is parsed only once. This cache is has a limited size, and keep the most recently + * used entries. The entry in the cache are invalidated if there is a change to one variable used in + * the module descriptor. */ class ModuleDescriptorMemoryCache { private final int maxSize; - private final LinkedHashMap/**/ valueMap; - - + + private final LinkedHashMap/* */valueMap; + /** * Create a cache of the given size + * * @param size */ public ModuleDescriptorMemoryCache(int size) { @@ -51,7 +51,7 @@ class ModuleDescriptorMemoryCache { public ModuleDescriptor get(File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider) throws ParseException, IOException { - + ModuleDescriptor descriptor = getFromCache(ivyFile, ivySettings, validated); if (descriptor == null) { descriptor = getStale(ivyFile, ivySettings, validated, mdProvider); @@ -60,31 +60,31 @@ class ModuleDescriptorMemoryCache { } /** - * Get the module descriptor from the mdProvider and store it into the cache. + * Get the module descriptor from the mdProvider and store it into the cache. */ public ModuleDescriptor getStale(File ivyFile, ParserSettings ivySettings, boolean validated, ModuleDescriptorProvider mdProvider) throws ParseException, IOException { ParserSettingsMonitor settingsMonitor = new ParserSettingsMonitor(ivySettings); ModuleDescriptor descriptor = mdProvider.provideModule( - settingsMonitor.getMonitoredSettings() , ivyFile, validated); + settingsMonitor.getMonitoredSettings(), ivyFile, validated); putInCache(ivyFile, settingsMonitor, validated, descriptor); return descriptor; } ModuleDescriptor getFromCache(File ivyFile, ParserSettings ivySettings, boolean validated) { if (maxSize <= 0) { - //cache is disbaled + // cache is disbaled return null; } CacheEntry entry = (CacheEntry) valueMap.get(ivyFile); if (entry != null) { if (entry.isStale(validated, ivySettings)) { - Message.debug("Entry is found in the ModuleDescriptorCache but entry should be " - + "reevaluated : " + ivyFile); + Message.debug("Entry is found in the ModuleDescriptorCache but entry should be " + + "reevaluated : " + ivyFile); valueMap.remove(ivyFile); return null; } else { - //Move the entry at the end of the list + // Move the entry at the end of the list valueMap.remove(ivyFile); valueMap.put(ivyFile, entry); Message.debug("Entry is found in the ModuleDescriptorCache : " + ivyFile); @@ -93,15 +93,13 @@ class ModuleDescriptorMemoryCache { } else { Message.debug("No entry is found in the ModuleDescriptorCache : " + ivyFile); return null; - } + } } - - - void putInCache(File url, ParserSettingsMonitor ivySettingsMonitor, boolean validated, + void putInCache(File url, ParserSettingsMonitor ivySettingsMonitor, boolean validated, ModuleDescriptor descriptor) { if (maxSize <= 0) { - //cache is disabled + // cache is disabled return; } if (valueMap.size() >= maxSize) { @@ -110,26 +108,27 @@ class ModuleDescriptorMemoryCache { it.next(); it.remove(); } - valueMap.put(url, new CacheEntry(descriptor , validated, ivySettingsMonitor)); + valueMap.put(url, new CacheEntry(descriptor, validated, ivySettingsMonitor)); } - private static class CacheEntry { private final ModuleDescriptor md; + private final boolean validated; + private final ParserSettingsMonitor parserSettingsMonitor; - CacheEntry(ModuleDescriptor md , boolean validated, - ParserSettingsMonitor parserSettingsMonitor) { + CacheEntry(ModuleDescriptor md, boolean validated, + ParserSettingsMonitor parserSettingsMonitor) { this.md = md; this.validated = validated; this.parserSettingsMonitor = parserSettingsMonitor; } - + boolean isStale(boolean validated, ParserSettings newParserSettings) { - return (validated && !this.validated) + return (validated && !this.validated) || parserSettingsMonitor.hasChanged(newParserSettings); } } - + } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ModuleDescriptorWriter.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ModuleDescriptorWriter.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ModuleDescriptorWriter.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ModuleDescriptorWriter.java Tue Jan 14 08:27:37 2014 @@ -25,6 +25,6 @@ import org.apache.ivy.core.module.descri import org.apache.ivy.plugins.resolver.util.ResolvedResource; public interface ModuleDescriptorWriter { - public void write(ResolvedResource originalMdResource, ModuleDescriptor md, - File src, File dest) throws IOException, ParseException; + public void write(ResolvedResource originalMdResource, ModuleDescriptor md, File src, File dest) + throws IOException, ParseException; } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ParserSettingsMonitor.java Tue Jan 14 08:27:37 2014 @@ -49,40 +49,40 @@ import org.apache.ivy.util.Message; class ParserSettingsMonitor { private ParserSettings delegatedSettings; - private final Map/**/ substitutes; - - + + private final Map/* */substitutes; + public ParserSettingsMonitor(ParserSettings settings) { this.delegatedSettings = settings; this.substitutes = new HashMap(); } - + /** - * @return The parser settings that must be used in place of the orignal settings - * The returned object delegates all the call to the original settings. + * @return The parser settings that must be used in place of the orignal settings The returned + * object delegates all the call to the original settings. */ public ParserSettings getMonitoredSettings() { return monitoredSettings; } - + /** - * Free the ressource used during the monitoring, keeping only the info - * required to evaluate hasChanged. + * Free the ressource used during the monitoring, keeping only the info required to evaluate + * hasChanged. */ public void endMonitoring() { monitoredSettings = null; delegatedSettings = null; } - + /** - * Check if the newSettings is compatible with the original settings that - * has been monitored. Only the info that was actually used is compared. + * Check if the newSettings is compatible with the original settings that has been monitored. + * Only the info that was actually used is compared. */ public boolean hasChanged(ParserSettings newSettings) { for (Iterator it = substitutes.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Entry) it.next(); String key = (String) entry.getKey(); - Object oldValue = entry.getValue(); + Object oldValue = entry.getValue(); String newValue = newSettings.substitute(key); if (!oldValue.equals(newValue)) { Message.debug("settings variable has changed for : " + entry.getKey()); @@ -91,8 +91,7 @@ class ParserSettingsMonitor { } return false; } - - + private ParserSettings monitoredSettings = new ParserSettings() { public ConflictManager getConflictManager(String name) { @@ -122,11 +121,11 @@ class ParserSettingsMonitor { public StatusManager getStatusManager() { return delegatedSettings.getStatusManager(); } - + public File resolveFile(String filename) { return delegatedSettings.resolveFile(filename); } - + public String getDefaultBranch(ModuleId moduleId) { return delegatedSettings.getDefaultBranch(moduleId); } @@ -134,7 +133,7 @@ class ParserSettingsMonitor { public Namespace getContextNamespace() { return delegatedSettings.getContextNamespace(); } - + public Map substitute(Map strings) { Map substituted = new LinkedHashMap(); for (Iterator it = strings.entrySet().iterator(); it.hasNext();) { Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/RepositoryCacheManager.java Tue Jan 14 08:27:37 2014 @@ -36,6 +36,7 @@ public interface RepositoryCacheManager /** * Returns the name of the repository cache manager. + * * @return the name of the repository cache manager. */ public abstract String getName(); @@ -52,13 +53,13 @@ public interface RepositoryCacheManager * @param artifactResolverName * artifact resolver name */ - public abstract void saveResolvers( - ModuleDescriptor descriptor, String metadataResolverName, String artifactResolverName); + public abstract void saveResolvers(ModuleDescriptor descriptor, String metadataResolverName, + String artifactResolverName); /** * Returns the artifact origin of the given artifact as saved in this cache. *

- * If the origin is unknown, the returned ArtifactOrigin instance will return true when + * If the origin is unknown, the returned ArtifactOrigin instance will return true when * {@link ArtifactOrigin#isUnknown(ArtifactOrigin)} is called. * * @param artifact @@ -82,10 +83,10 @@ public interface RepositoryCacheManager * @return the ResolvedModuleRevision corresponding to the module found, null if none correct * has been found in cache */ - public abstract ResolvedModuleRevision findModuleInCache( - DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, - CacheMetadataOptions options, String expectedResolver); - + public abstract ResolvedModuleRevision findModuleInCache(DependencyDescriptor dd, + ModuleRevisionId requestedRevisionId, CacheMetadataOptions options, + String expectedResolver); + /** * Downloads an artifact to this cache. * @@ -97,13 +98,11 @@ public interface RepositoryCacheManager * @param resourceDownloader * a resource downloader to use if actual download of the resource is needed * @param options - * a set of options to adjust the download + * a set of options to adjust the download * @return a report indicating how the download was performed */ - public abstract ArtifactDownloadReport download( - Artifact artifact, - ArtifactResourceResolver resourceResolver, - ResourceDownloader resourceDownloader, + public abstract ArtifactDownloadReport download(Artifact artifact, + ArtifactResourceResolver resourceResolver, ResourceDownloader resourceDownloader, CacheDownloadOptions options); /** @@ -155,8 +154,8 @@ public interface RepositoryCacheManager * if an exception occurred while parsing the module descriptor */ public ResolvedModuleRevision cacheModuleDescriptor(DependencyResolver resolver, - ResolvedResource orginalMetadataRef, DependencyDescriptor dd, - Artifact requestedMetadataArtifact, ResourceDownloader downloader, + ResolvedResource orginalMetadataRef, DependencyDescriptor dd, + Artifact requestedMetadataArtifact, ResourceDownloader downloader, CacheMetadataOptions options) throws ParseException; /** @@ -176,7 +175,7 @@ public interface RepositoryCacheManager public void originalToCachedModuleDescriptor(DependencyResolver resolver, ResolvedResource orginalMetadataRef, Artifact requestedMetadataArtifact, ResolvedModuleRevision rmr, ModuleDescriptorWriter writer); - + /** * Cleans the whole cache. */ @@ -185,9 +184,11 @@ public interface RepositoryCacheManager /** * Caches a dynamic revision constraint resolution. * - * @param dynamicMrid the dynamic module revision id - * @param revision the resolved revision + * @param dynamicMrid + * the dynamic module revision id + * @param revision + * the resolved revision */ public void saveResolvedRevision(ModuleRevisionId dynamicMrid, String revision); - + } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ResolutionCacheManager.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ResolutionCacheManager.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ResolutionCacheManager.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/ResolutionCacheManager.java Tue Jan 14 08:27:37 2014 @@ -25,21 +25,22 @@ import org.apache.ivy.core.module.descri import org.apache.ivy.core.module.id.ModuleRevisionId; public interface ResolutionCacheManager { - + File getResolutionCacheRoot(); - + File getResolvedIvyFileInCache(ModuleRevisionId mrid); - + File getResolvedIvyPropertiesInCache(ModuleRevisionId mrid); File getConfigurationResolveReportInCache(String resolveId, String conf); File[] getConfigurationResolveReportsInCache(final String resolveId); - - ModuleDescriptor getResolvedModuleDescriptor(ModuleRevisionId mrid) throws ParseException, IOException; - + + ModuleDescriptor getResolvedModuleDescriptor(ModuleRevisionId mrid) throws ParseException, + IOException; + void saveResolvedModuleDescriptor(ModuleDescriptor md) throws ParseException, IOException; - + /** * Cleans the whole cache. */ Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java Tue Jan 14 08:27:37 2014 @@ -87,14 +87,13 @@ public class CheckEngine { if (!"*".equals(masterConfs[j].trim()) && md.getConfiguration(masterConfs[j]) == null) { Message.info("dependency required in non existing conf for " + ivyFile - + " \n\tin " + dds[i] + ": " - + masterConfs[j]); + + " \n\tin " + dds[i] + ": " + masterConfs[j]); result = false; } } // resolve - DependencyResolver resolver = - settings.getResolver(dds[i].getDependencyRevisionId()); + DependencyResolver resolver = settings + .getResolver(dds[i].getDependencyRevisionId()); ResolvedModuleRevision rmr = resolver.getDependency(dds[i], data); if (rmr == null) { Message.info("dependency not found in " + ivyFile + ":\n\t" + dds[i]); @@ -106,16 +105,14 @@ public class CheckEngine { if (!Arrays.asList(rmr.getDescriptor().getConfigurationsNames()).contains( depConfs[j])) { Message.info("dependency configuration is missing for " + ivyFile - + "\n\tin " + dds[i] + ": " - + depConfs[j]); + + "\n\tin " + dds[i] + ": " + depConfs[j]); result = false; } Artifact[] arts = rmr.getDescriptor().getArtifacts(depConfs[j]); for (int k = 0; k < arts.length; k++) { if (!resolver.exists(arts[k])) { Message.info("dependency artifact is missing for " + ivyFile - + "\n\t in " + dds[i] + ": " - + arts[k]); + + "\n\t in " + dds[i] + ": " + arts[k]); result = false; } } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverEngine.java Tue Jan 14 08:27:37 2014 @@ -109,9 +109,8 @@ public class DeliverEngine { // 1) find the resolved module descriptor in cache ModuleDescriptor md = getCache().getResolvedModuleDescriptor(mrid); - md.setResolvedModuleRevisionId(ModuleRevisionId.newInstance(md.getModuleRevisionId(), - options.getPubBranch() == null ? mrid.getBranch() : options.getPubBranch(), - revision)); + md.setResolvedModuleRevisionId(ModuleRevisionId.newInstance(md.getModuleRevisionId(), + options.getPubBranch() == null ? mrid.getBranch() : options.getPubBranch(), revision)); md.setResolvedPublicationDate(options.getPubdate()); // 2) parse resolvedRevisions From properties file @@ -141,15 +140,15 @@ public class DeliverEngine { } } dependenciesStatus.put(decodedMrid, parts[1]); - + if (options.isReplaceForcedRevisions()) { if (parts.length <= 2) { // maybe the properties file was generated by an older Ivy version // so it is possible that this part doesn't exist. - throw new IllegalStateException("ivy properties file generated by an older" + - " version of Ivy which doesn't support replacing forced revisions!"); + throw new IllegalStateException("ivy properties file generated by an older" + + " version of Ivy which doesn't support replacing forced revisions!"); } - + resolvedRevisions.put(decodedMrid, parts[2]); } } @@ -170,24 +169,21 @@ public class DeliverEngine { .getDependencyRevisionId()); ModuleRevisionId mrid2 = null; if (bra == null) { - mrid2 = ModuleRevisionId.newInstance(dependencies[i].getDependencyRevisionId(), rev); - } - else { - mrid2 = ModuleRevisionId.newInstance(dependencies[i].getDependencyRevisionId(), bra, rev); + mrid2 = ModuleRevisionId + .newInstance(dependencies[i].getDependencyRevisionId(), rev); + } else { + mrid2 = ModuleRevisionId.newInstance(dependencies[i].getDependencyRevisionId(), + bra, rev); } resolvedDependencies.put(dependencies[i].getDependencyRevisionId(), options - .getPdrResolver().resolve( - md, - options.getStatus(), - mrid2, - depStatus)); + .getPdrResolver().resolve(md, options.getStatus(), mrid2, depStatus)); } // 4) copy the source resolved ivy to the destination specified, // updating status, revision and dependency revisions obtained by // PublishingDependencyRevisionResolver - File publishedIvy = settings.resolveFile( - IvyPatternHelper.substitute(destIvyPattern, md.getResolvedModuleRevisionId())); + File publishedIvy = settings.resolveFile(IvyPatternHelper.substitute(destIvyPattern, + md.getResolvedModuleRevisionId())); Message.info("\tdelivering ivy file to " + publishedIvy); String[] confs = ConfigurationUtils.replaceWildcards(options.getConfs(), md); @@ -196,17 +192,17 @@ public class DeliverEngine { try { UpdateOptions opts = new UpdateOptions() - .setSettings(settings) - .setResolvedRevisions(resolvedDependencies) - .setStatus(options.getStatus()) - .setRevision(revision) - .setBranch(options.getPubBranch()) - .setPubdate(options.getPubdate()) - .setGenerateRevConstraint(options.isGenerateRevConstraint()) - .setMerge(options.isMerge()) - .setMergedDescriptor(md) - .setConfsToExclude((String[]) confsToRemove - .toArray(new String[confsToRemove.size()])); + .setSettings(settings) + .setResolvedRevisions(resolvedDependencies) + .setStatus(options.getStatus()) + .setRevision(revision) + .setBranch(options.getPubBranch()) + .setPubdate(options.getPubdate()) + .setGenerateRevConstraint(options.isGenerateRevConstraint()) + .setMerge(options.isMerge()) + .setMergedDescriptor(md) + .setConfsToExclude( + (String[]) confsToRemove.toArray(new String[confsToRemove.size()])); if (!resolvedBranches.isEmpty()) { opts = opts.setResolvedBranches(resolvedBranches); } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverOptions.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverOptions.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverOptions.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/DeliverOptions.java Tue Jan 14 08:27:37 2014 @@ -34,6 +34,7 @@ public class DeliverOptions { private boolean validate = true; private boolean resolveDynamicRevisions = true; + private boolean replaceForcedRevisions = false; private String resolveId; @@ -41,13 +42,13 @@ public class DeliverOptions { private String[] confs; private String pubBranch; - + /** - * True to indicate that the revConstraint attribute should be generated if - * applicable, false to never generate the revConstraint attribute. + * True to indicate that the revConstraint attribute should be generated if applicable, false to + * never generate the revConstraint attribute. */ private boolean generateRevConstraint = true; - + /** true to merge parent descriptor elements into delivered child descriptor */ private boolean merge = true; @@ -60,8 +61,8 @@ public class DeliverOptions { * @return a DeliverOptions instance ready to be used or customized */ public static DeliverOptions newInstance(IvySettings settings) { - return new DeliverOptions(null, new Date(), - new DefaultPublishingDRResolver(), settings.doValidate(), true, null); + return new DeliverOptions(null, new Date(), new DefaultPublishingDRResolver(), + settings.doValidate(), true, null); } /** @@ -74,7 +75,7 @@ public class DeliverOptions { /** * Creates an instance of DeliverOptions with all options explicitly set. */ - public DeliverOptions(String status, Date pubDate, + public DeliverOptions(String status, Date pubDate, PublishingDependencyRevisionResolver pdrResolver, boolean validate, boolean resolveDynamicRevisions, String[] confs) { this.status = status; @@ -123,11 +124,11 @@ public class DeliverOptions { this.resolveDynamicRevisions = resolveDynamicRevisions; return this; } - + public boolean isReplaceForcedRevisions() { return replaceForcedRevisions; } - + public DeliverOptions setReplaceForcedRevisions(boolean replaceForcedRevisions) { this.replaceForcedRevisions = replaceForcedRevisions; return this; @@ -196,8 +197,8 @@ public class DeliverOptions { } /** - * Return the configurations which must be deliverd. Returns null if all - * configurations has to be deliverd. Attention: the returned array can contain wildcards! + * Return the configurations which must be deliverd. Returns null if all configurations + * has to be deliverd. Attention: the returned array can contain wildcards! * * @return the configurations to deliver */ @@ -240,10 +241,11 @@ public class DeliverOptions { this.pubBranch = pubBranch; return this; } - + public boolean isGenerateRevConstraint() { return generateRevConstraint; } + public DeliverOptions setGenerateRevConstraint(boolean generateRevConstraint) { this.generateRevConstraint = generateRevConstraint; return this; @@ -260,10 +262,8 @@ public class DeliverOptions { public String toString() { return "status=" + status + " pubdate=" + pubdate + " validate=" + validate - + " resolveDynamicRevisions=" + resolveDynamicRevisions - + " merge=" + merge - + " resolveId=" + resolveId - + " pubBranch=" + pubBranch; + + " resolveDynamicRevisions=" + resolveDynamicRevisions + " merge=" + merge + + " resolveId=" + resolveId + " pubBranch=" + pubBranch; } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/PublishingDependencyRevisionResolver.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/PublishingDependencyRevisionResolver.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/PublishingDependencyRevisionResolver.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/deliver/PublishingDependencyRevisionResolver.java Tue Jan 14 08:27:37 2014 @@ -35,7 +35,7 @@ public interface PublishingDependencyRev * @param status * @return the revision of the dependency */ - String resolve(ModuleDescriptor published, String publishedStatus, ModuleRevisionId depMrid, + String resolve(ModuleDescriptor published, String publishedStatus, ModuleRevisionId depMrid, String status); } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java Tue Jan 14 08:27:37 2014 @@ -116,12 +116,12 @@ public class IvyEvent { } public int hashCode() { - //CheckStyle:MagicNumber| OFF + // CheckStyle:MagicNumber| OFF int hash = 37; hash = 13 * hash + getSource().hashCode(); hash = 13 * hash + getName().hashCode(); hash = 13 * hash + attributes.hashCode(); - //CheckStyle:MagicNumber| ON + // CheckStyle:MagicNumber| ON return hash; } } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEventFilter.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEventFilter.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEventFilter.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEventFilter.java Tue Jan 14 08:27:37 2014 @@ -32,7 +32,8 @@ import org.apache.ivy.util.filter.OrFilt * to construct this object. The filter expression is a string describing how the event should be * filtered according to its attributes values. The matching between the filter values and the event * attribute values is done using the {@link PatternMatcher} used to construct this object. Here are - * some examples: + * some examples: + *
* * * @@ -57,10 +58,11 @@ import org.apache.ivy.util.filter.OrFilt * * * - *
expressioneffectNOT type=srcaccepts event with a type attribute NOT matching src
Combination of these can be used, but no parentheses are supported right now, so only - * the default priority can be used. The priority order is this one: AND OR NOT = This means that - * artifact=foo AND ext=zip OR type=src will match event with artifact matching foo AND (ext - * matching zip OR type matching src) + * + * Combination of these can be used, but no parentheses are supported right now, so only the default + * priority can be used. The priority order is this one: AND OR NOT = This means that artifact=foo + * AND ext=zip OR type=src will match event with artifact matching foo AND (ext matching zip OR type + * matching src) * * @since 1.4 */ @@ -90,8 +92,8 @@ public class IvyEventFilter implements F } }; } - attFilter = filterExpression == null || filterExpression.trim().length() == 0 - ? NoFilter.INSTANCE : parseExpression(filterExpression); + attFilter = filterExpression == null || filterExpression.trim().length() == 0 ? NoFilter.INSTANCE + : parseExpression(filterExpression); } private Filter parseExpression(String filterExpression) { Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/EndResolveDependencyEvent.java Tue Jan 14 08:27:37 2014 @@ -29,7 +29,7 @@ public class EndResolveDependencyEvent e private long duration; - public EndResolveDependencyEvent(DependencyResolver resolver, DependencyDescriptor dd, + public EndResolveDependencyEvent(DependencyResolver resolver, DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, ResolvedModuleRevision module, long duration) { super(NAME, resolver, dd, requestedRevisionId); this.module = module; @@ -41,12 +41,11 @@ public class EndResolveDependencyEvent e .getRevision()); // now that we have loaded the dependency descriptor, we can put the extra attributes // contained in the descriptor too - addAttributes( - this.module.getDescriptor().getResolvedModuleRevisionId() - .getQualifiedExtraAttributes()); - addAttributes( - this.module.getDescriptor().getResolvedModuleRevisionId().getExtraAttributes()); - + addAttributes(this.module.getDescriptor().getResolvedModuleRevisionId() + .getQualifiedExtraAttributes()); + addAttributes(this.module.getDescriptor().getResolvedModuleRevisionId() + .getExtraAttributes()); + addAttribute("resolved", "true"); } else { addAttribute("resolved", "false"); @@ -56,7 +55,7 @@ public class EndResolveDependencyEvent e public ResolvedModuleRevision getModule() { return module; } - + /** * Returns the time elapsed to resolve the dependency. *

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java Tue Jan 14 08:27:37 2014 @@ -37,10 +37,9 @@ public class ResolveDependencyEvent exte addAttributes(this.dd.getQualifiedExtraAttributes()); addAttributes(this.dd.getExtraAttributes()); addAttribute("req-revision", requestedRevisionId.getRevision()); - addAttribute("req-revision-default", - dd.getDependencyRevisionId().getRevision()); - addAttribute("req-revision-dynamic", - dd.getDynamicConstraintDependencyRevisionId().getRevision()); + addAttribute("req-revision-default", dd.getDependencyRevisionId().getRevision()); + addAttribute("req-revision-dynamic", dd.getDynamicConstraintDependencyRevisionId() + .getRevision()); addAttribute("req-branch", requestedRevisionId.getBranch()); addAttribute("req-branch-default", dd.getDependencyRevisionId().getBranch()); } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/StartResolveDependencyEvent.java Tue Jan 14 08:27:37 2014 @@ -24,8 +24,7 @@ import org.apache.ivy.plugins.resolver.D public class StartResolveDependencyEvent extends ResolveDependencyEvent { public static final String NAME = "pre-resolve-dependency"; - public StartResolveDependencyEvent( - DependencyResolver resolver, DependencyDescriptor dd, + public StartResolveDependencyEvent(DependencyResolver resolver, DependencyDescriptor dd, ModuleRevisionId requestedRevisionId) { super(NAME, resolver, dd, requestedRevisionId); } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/EndRetrieveArtifactEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/EndRetrieveArtifactEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/EndRetrieveArtifactEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/EndRetrieveArtifactEvent.java Tue Jan 14 08:27:37 2014 @@ -24,8 +24,7 @@ import org.apache.ivy.core.report.Artifa public class EndRetrieveArtifactEvent extends RetrieveArtifactEvent { public static final String NAME = "post-retrieve-artifact"; - public EndRetrieveArtifactEvent( - ArtifactDownloadReport report, File destFile) { + public EndRetrieveArtifactEvent(ArtifactDownloadReport report, File destFile) { super(NAME, report, destFile); } } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/EndRetrieveEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/EndRetrieveEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/EndRetrieveEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/EndRetrieveEvent.java Tue Jan 14 08:27:37 2014 @@ -72,9 +72,10 @@ public class EndRetrieveEvent extends Re public int getNbUpToDate() { return nbUpToDate; } - + /** * Total size of all copied (or symlinked) artifacts, in bytes. + * * @return Total size of all copied (or symlinked) artifacts, in bytes. */ public long getTotalCopiedSize() { Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/RetrieveArtifactEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/RetrieveArtifactEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/RetrieveArtifactEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/RetrieveArtifactEvent.java Tue Jan 14 08:27:37 2014 @@ -28,17 +28,15 @@ public class RetrieveArtifactEvent exten private File destFile; - public RetrieveArtifactEvent( - String name, - ArtifactDownloadReport report, File destFile) { + public RetrieveArtifactEvent(String name, ArtifactDownloadReport report, File destFile) { super(name); addArtifactAttributes(report.getArtifact()); - + this.report = report; this.destFile = destFile; addAttribute("from", report.getLocalFile().getAbsolutePath()); addAttribute("to", destFile.getAbsolutePath()); - addAttribute("size", String.valueOf(destFile.length())); + addAttribute("size", String.valueOf(destFile.length())); } protected void addArtifactAttributes(Artifact artifact) { @@ -46,11 +44,11 @@ public class RetrieveArtifactEvent exten addAttributes(artifact.getAttributes()); addAttribute("metadata", String.valueOf(artifact.isMetadata())); } - + public File getDestFile() { return destFile; } - + public ArtifactDownloadReport getReport() { return report; } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/RetrieveEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/RetrieveEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/RetrieveEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/RetrieveEvent.java Tue Jan 14 08:27:37 2014 @@ -23,10 +23,11 @@ import org.apache.ivy.core.retrieve.Retr public class RetrieveEvent extends IvyEvent { private ModuleRevisionId mrid; + private RetrieveOptions options; - protected RetrieveEvent(String name, ModuleRevisionId mrid, - String[] confs, RetrieveOptions options) { + protected RetrieveEvent(String name, ModuleRevisionId mrid, String[] confs, + RetrieveOptions options) { super(name); this.mrid = mrid; addMridAttributes(mrid); @@ -39,7 +40,7 @@ public class RetrieveEvent extends IvyEv public ModuleRevisionId getModuleRevisionId() { return mrid; } - + public RetrieveOptions getOptions() { return options; } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/StartRetrieveArtifactEvent.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/StartRetrieveArtifactEvent.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/StartRetrieveArtifactEvent.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/retrieve/StartRetrieveArtifactEvent.java Tue Jan 14 08:27:37 2014 @@ -24,8 +24,7 @@ import org.apache.ivy.core.report.Artifa public class StartRetrieveArtifactEvent extends RetrieveArtifactEvent { public static final String NAME = "pre-retrieve-artifact"; - public StartRetrieveArtifactEvent( - ArtifactDownloadReport report, File destFile) { + public StartRetrieveArtifactEvent(ArtifactDownloadReport report, File destFile) { super(NAME, report, destFile); } } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java Tue Jan 14 08:27:37 2014 @@ -58,7 +58,7 @@ public class InstallEngine { this.resolveEngine = resolveEngine; } - public ResolveReport install(ModuleRevisionId mrid, String from, String to, + public ResolveReport install(ModuleRevisionId mrid, String from, String to, InstallOptions options) throws IOException { DependencyResolver fromResolver = settings.getResolver(from); DependencyResolver toResolver = settings.getResolver(to); @@ -98,41 +98,40 @@ public class InstallEngine { for (int j = 0; j < depConfs.length; j++) { final String depConf = depConfs[j].trim(); - + if (MatcherHelper.isExact(matcher, mrid)) { - DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, mrid, false, - false, options.isTransitive()); + DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, mrid, + false, false, options.isTransitive()); dd.addDependencyConfiguration("default", depConf); md.addDependency(dd); } else { - ModuleRevisionId[] mrids = searchEngine.listModules(fromResolver, mrid, matcher); - + ModuleRevisionId[] mrids = searchEngine.listModules(fromResolver, mrid, + matcher); + for (int i = 0; i < mrids.length; i++) { Message.info("\tfound " + mrids[i] + " to install: adding to the list"); - DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, mrids[i], - false, false, options.isTransitive()); + DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, + mrids[i], false, false, options.isTransitive()); dd.addDependencyConfiguration("default", depConf); md.addDependency(dd); } } } } - + // resolve using appropriate resolver ResolveReport report = new ResolveReport(md, resolveId); Message.info(":: resolving dependencies ::"); - ResolveOptions resolveOptions = new ResolveOptions() - .setResolveId(resolveId) - .setConfs(new String[] {"default"}) - .setValidate(options.isValidate()); + ResolveOptions resolveOptions = new ResolveOptions().setResolveId(resolveId) + .setConfs(new String[] {"default"}).setValidate(options.isValidate()); IvyNode[] dependencies = resolveEngine.getDependencies(md, resolveOptions, report); report.setDependencies(Arrays.asList(dependencies), options.getArtifactFilter()); Message.info(":: downloading artifacts to cache ::"); - resolveEngine.downloadArtifacts( - report, options.getArtifactFilter(), new DownloadOptions()); - + resolveEngine.downloadArtifacts(report, options.getArtifactFilter(), + new DownloadOptions()); + // now that everything is in cache, we can publish all these modules Message.info(":: installing in " + to + " ::"); for (int i = 0; i < dependencies.length; i++) { @@ -143,43 +142,48 @@ public class InstallEngine { boolean successfullyPublished = false; try { toResolver.beginPublishTransaction(depMrid, options.isOverwrite()); - + // publish artifacts - ArtifactDownloadReport[] artifacts = - report.getArtifactsReports(depMrid); + ArtifactDownloadReport[] artifacts = report.getArtifactsReports(depMrid); for (int j = 0; j < artifacts.length; j++) { if (artifacts[j].getLocalFile() != null) { - toResolver.publish(artifacts[j].getArtifact(), + toResolver.publish(artifacts[j].getArtifact(), artifacts[j].getLocalFile(), options.isOverwrite()); } } - + // publish metadata MetadataArtifactDownloadReport artifactDownloadReport = dependencies[i] .getModuleRevision().getReport(); File localIvyFile = artifactDownloadReport.getLocalFile(); - toResolver.publish( - depmd.getMetadataArtifact(), localIvyFile, options.isOverwrite()); - + toResolver.publish(depmd.getMetadataArtifact(), localIvyFile, + options.isOverwrite()); + if (options.isInstallOriginalMetadata()) { if (artifactDownloadReport.getArtifactOrigin() != null && artifactDownloadReport.getArtifactOrigin().isExists() - && !ArtifactOrigin.isUnknown(artifactDownloadReport.getArtifactOrigin()) + && !ArtifactOrigin.isUnknown(artifactDownloadReport + .getArtifactOrigin()) && artifactDownloadReport.getArtifactOrigin().getArtifact() != null && artifactDownloadReport.getArtifactOrigin().getArtifact() - .getType().endsWith(".original") - && !artifactDownloadReport.getArtifactOrigin().getArtifact() - .getType().equals(depmd.getMetadataArtifact().getType()+".original")) { - // publish original metadata artifact, too, as it has a different type - toResolver.publish(artifactDownloadReport.getArtifactOrigin().getArtifact(), - artifactDownloadReport.getOriginalLocalFile(), - options.isOverwrite()); + .getType().endsWith(".original") + && !artifactDownloadReport + .getArtifactOrigin() + .getArtifact() + .getType() + .equals( + depmd.getMetadataArtifact().getType() + ".original")) { + // publish original metadata artifact, too, as it has a different + // type + toResolver.publish(artifactDownloadReport.getArtifactOrigin() + .getArtifact(), artifactDownloadReport + .getOriginalLocalFile(), options.isOverwrite()); } } - + // end module publish toResolver.commitPublishTransaction(); - successfullyPublished = true; + successfullyPublished = true; } finally { if (!successfullyPublished) { toResolver.abortPublishTransaction(); @@ -191,8 +195,8 @@ public class InstallEngine { Message.info(":: install resolution report ::"); // output report - resolveEngine.outputReport( - report, settings.getResolutionCacheManager(), resolveOptions); + resolveEngine + .outputReport(report, settings.getResolutionCacheManager(), resolveOptions); return report; } finally { Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallOptions.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallOptions.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallOptions.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallOptions.java Tue Jan 14 08:27:37 2014 @@ -23,58 +23,77 @@ import org.apache.ivy.util.filter.Filter public class InstallOptions { private boolean transitive = true; + private boolean validate = true; + private boolean overwrite = false; + private boolean installOriginalMetadata = false; + private String[] confs = {"*"}; + private Filter artifactFilter = FilterHelper.NO_FILTER; + private String matcherName = PatternMatcher.EXACT; - + public boolean isTransitive() { return transitive; } + public InstallOptions setTransitive(boolean transitive) { this.transitive = transitive; return this; } + public boolean isValidate() { return validate; } + public InstallOptions setValidate(boolean validate) { this.validate = validate; return this; } + public boolean isOverwrite() { return overwrite; } + public InstallOptions setOverwrite(boolean overwrite) { this.overwrite = overwrite; return this; } + public Filter getArtifactFilter() { return artifactFilter; } + public InstallOptions setArtifactFilter(Filter artifactFilter) { this.artifactFilter = artifactFilter == null ? FilterHelper.NO_FILTER : artifactFilter; return this; } + public String getMatcherName() { return matcherName; } + public InstallOptions setMatcherName(String matcherName) { this.matcherName = matcherName; return this; } + public String[] getConfs() { return confs; } + public InstallOptions setConfs(String[] conf) { this.confs = conf; return this; } + public boolean isInstallOriginalMetadata() { return installOriginalMetadata; } + public InstallOptions setInstallOriginalMetadata(boolean installOriginalMetadata) { this.installOriginalMetadata = installOriginalMetadata; return this; Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/AbstractArtifact.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/AbstractArtifact.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/AbstractArtifact.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/AbstractArtifact.java Tue Jan 14 08:27:37 2014 @@ -32,16 +32,15 @@ public abstract class AbstractArtifact i } Artifact art = (Artifact) obj; return getModuleRevisionId().equals(art.getModuleRevisionId()) - && getPublicationDate() == null ? (art.getPublicationDate() == null) : getPublicationDate().equals( - art.getPublicationDate()) - && getName().equals(art.getName()) - && getExt().equals(art.getExt()) - && getType().equals(art.getType()) - && getQualifiedExtraAttributes().equals(art.getQualifiedExtraAttributes()); + && getPublicationDate() == null ? (art.getPublicationDate() == null) + : getPublicationDate().equals(art.getPublicationDate()) + && getName().equals(art.getName()) && getExt().equals(art.getExt()) + && getType().equals(art.getType()) + && getQualifiedExtraAttributes().equals(art.getQualifiedExtraAttributes()); } public int hashCode() { - //CheckStyle:MagicNumber| OFF + // CheckStyle:MagicNumber| OFF int hash = 33; hash = hash * 17 + getModuleRevisionId().hashCode(); if (getPublicationDate() != null) { @@ -51,7 +50,7 @@ public abstract class AbstractArtifact i hash = hash * 17 + getExt().hashCode(); hash = hash * 17 + getType().hashCode(); hash = hash * 17 + getQualifiedExtraAttributes().hashCode(); - //CheckStyle:MagicNumber| ON + // CheckStyle:MagicNumber| ON return hash; } @@ -74,10 +73,9 @@ public abstract class AbstractArtifact i public Map getExtraAttributes() { return getId().getExtraAttributes(); } - + public Map getQualifiedExtraAttributes() { return getId().getQualifiedExtraAttributes(); } - } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java Tue Jan 14 08:27:37 2014 @@ -27,8 +27,8 @@ import org.apache.ivy.plugins.matcher.Pa import org.apache.ivy.util.extendable.UnmodifiableExtendableItem; /** - * Abstract class used as implementation for both {@link IncludeRule} and {@link ExcludeRule}, - * since their contract is almost identical + * Abstract class used as implementation for both {@link IncludeRule} and {@link ExcludeRule}, since + * their contract is almost identical */ public abstract class AbstractIncludeExcludeRule extends UnmodifiableExtendableItem implements ConfigurationAware { Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Artifact.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Artifact.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Artifact.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Artifact.java Tue Jan 14 08:27:37 2014 @@ -26,8 +26,8 @@ import org.apache.ivy.util.extendable.Ex /** * Representation of a published 'file' in the development environment. An artifact is generally a - * file that is produced by a project build. This is typically a jar, - * a war, an ear, a zip, a deb, etc. + * file that is produced by a project build. This is typically a jar, a + * war, an ear, a zip, a deb, etc. */ public interface Artifact extends ExtendableItem { @@ -88,7 +88,7 @@ public interface Artifact extends Extend * @return the id of the artifact */ ArtifactRevisionId getId(); - + /** * Returns true if this artifact represents a module metadata artifact, false if it's a * published artifact Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java Tue Jan 14 08:27:37 2014 @@ -56,8 +56,9 @@ public class Configuration extends Defau return name; } } - - public static Collection/**/ findConfigurationExtending(String conf, Configuration[] confs) { + + public static Collection/* */findConfigurationExtending(String conf, + Configuration[] confs) { Collection extendingConfs = new ArrayList(); for (int i = 0; i < confs.length; i++) { if (confs[i] != null && Arrays.asList(confs[i].getExtends()).contains(conf)) { @@ -77,46 +78,53 @@ public class Configuration extends Defau private Visibility visibility; private boolean transitive = true; - + private String deprecated; - + private ModuleRevisionId sourceModule; /** * Creates a new configuration. * - * @param name the name of the configuration + * @param name + * the name of the configuration */ public Configuration(String name) { this(name, Visibility.PUBLIC, null, null, true, null); } - + public Configuration(Configuration source, ModuleRevisionId sourceModule) { - this(source.getAttributes(), source.getQualifiedExtraAttributes(), source.getName(), - source.getVisibility(), source.getDescription(), source.getExtends(), - source.isTransitive(), source.getDeprecated(), sourceModule); + this(source.getAttributes(), source.getQualifiedExtraAttributes(), source.getName(), source + .getVisibility(), source.getDescription(), source.getExtends(), source + .isTransitive(), source.getDeprecated(), sourceModule); } /** * Creates a new configuration. * - * @param name the name of the configuration - * @param visibility the visibility of the configuration - * @param description a description - * @param ext the configurations to extend from - * @param transitive indicates if the configuration is transitive - * @param deprecated the deprecation message + * @param name + * the name of the configuration + * @param visibility + * the visibility of the configuration + * @param description + * a description + * @param ext + * the configurations to extend from + * @param transitive + * indicates if the configuration is transitive + * @param deprecated + * the deprecation message */ - public Configuration(String name, Visibility visibility, String description, String[] ext, + public Configuration(String name, Visibility visibility, String description, String[] ext, boolean transitive, String deprecated) { this(null, null, name, visibility, description, ext, transitive, deprecated, null); } - + private Configuration(Map attributes, Map extraAttributes, String name, Visibility visibility, - String description, String[] ext, boolean transitive, String deprecated, - ModuleRevisionId sourceModule) { + String description, String[] ext, boolean transitive, String deprecated, + ModuleRevisionId sourceModule) { super(attributes, extraAttributes); - + if (name == null) { throw new NullPointerException("null configuration name not allowed"); } @@ -141,12 +149,13 @@ public class Configuration extends Defau /** * Returns the deprecation message, or null if not specified. + * * @return Returns the deprecation message. */ public String getDeprecated() { return deprecated; } - + /** * @return Returns the description. It may be null. */ @@ -181,7 +190,7 @@ public class Configuration extends Defau public final boolean isTransitive() { return transitive; } - + public ModuleRevisionId getSourceModule() { return sourceModule; } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java Tue Jan 14 08:27:37 2014 @@ -25,9 +25,9 @@ import java.util.Map; */ public class ConfigurationGroup extends Configuration { - private final Map/**/ members; + private final Map/* */members; - public ConfigurationGroup(String confName, Map /**/ members) { + public ConfigurationGroup(String confName, Map /* */members) { super(confName); this.members = members; } @@ -43,14 +43,13 @@ public class ConfigurationGroup extends * @return the list of configurations' names this object is an intersection of. */ public String[] getMembersConfigurationNames() { - return (String[]) members.keySet() - .toArray(new String[members.size()]); + return (String[]) members.keySet().toArray(new String[members.size()]); } /** - * Returns the {@link Configuration} object for the given conf name, or - * null if the given conf name is not part of this group or if this conf - * name isn't defined in the module in which this group has been built. + * Returns the {@link Configuration} object for the given conf name, or null if the + * given conf name is not part of this group or if this conf name isn't defined in the module in + * which this group has been built. * * @param confName * the name of the configuration to return. @@ -59,7 +58,7 @@ public class ConfigurationGroup extends public Configuration getMemberConfiguration(String confName) { return (Configuration) members.get(confName); } - + public Visibility getVisibility() { for (Iterator it = members.values().iterator(); it.hasNext();) { Configuration c = (Configuration) it.next(); Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java Tue Jan 14 08:27:37 2014 @@ -25,9 +25,10 @@ import java.util.Map; */ public class ConfigurationIntersection extends Configuration { - private final Map/**/ intersectedConfs; + private final Map/* */intersectedConfs; - public ConfigurationIntersection(String confName, Map /**/ intersectedConfs) { + public ConfigurationIntersection(String confName, + Map /* */intersectedConfs) { super(confName); this.intersectedConfs = intersectedConfs; } @@ -43,8 +44,7 @@ public class ConfigurationIntersection e * @return the list of configurations' names this object is an intersection of. */ public String[] getIntersectedConfigurationNames() { - return (String[]) intersectedConfs.keySet() - .toArray(new String[intersectedConfs.size()]); + return (String[]) intersectedConfs.keySet().toArray(new String[intersectedConfs.size()]); } /** @@ -59,7 +59,7 @@ public class ConfigurationIntersection e public Configuration getIntersectedConfiguration(String confName) { return (Configuration) intersectedConfs.get(confName); } - + public Visibility getVisibility() { for (Iterator it = intersectedConfs.values().iterator(); it.hasNext();) { Configuration c = (Configuration) it.next(); Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultArtifact.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultArtifact.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultArtifact.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultArtifact.java Tue Jan 14 08:27:37 2014 @@ -47,33 +47,21 @@ public class DefaultArtifact extends Abs public static Artifact cloneWithAnotherTypeAndExt(Artifact artifact, String newType, String newExt) { - return new DefaultArtifact( - ArtifactRevisionId.newInstance( - artifact.getModuleRevisionId(), - artifact.getName(), newType, newExt, - artifact.getQualifiedExtraAttributes()), - artifact.getPublicationDate(), - artifact.getUrl(), artifact.isMetadata()); + return new DefaultArtifact(ArtifactRevisionId.newInstance(artifact.getModuleRevisionId(), + artifact.getName(), newType, newExt, artifact.getQualifiedExtraAttributes()), + artifact.getPublicationDate(), artifact.getUrl(), artifact.isMetadata()); } public static Artifact cloneWithAnotherName(Artifact artifact, String name) { - return new DefaultArtifact( - ArtifactRevisionId.newInstance( - artifact.getModuleRevisionId(), - name, artifact.getType(), artifact.getExt(), - artifact.getQualifiedExtraAttributes()), - artifact.getPublicationDate(), - artifact.getUrl(), artifact.isMetadata()); + return new DefaultArtifact(ArtifactRevisionId.newInstance(artifact.getModuleRevisionId(), + name, artifact.getType(), artifact.getExt(), artifact.getQualifiedExtraAttributes()), + artifact.getPublicationDate(), artifact.getUrl(), artifact.isMetadata()); } public static Artifact cloneWithAnotherMrid(Artifact artifact, ModuleRevisionId mrid) { - return new DefaultArtifact( - ArtifactRevisionId.newInstance( - mrid, - artifact.getName(), artifact.getType(), artifact.getExt(), - artifact.getQualifiedExtraAttributes()), - artifact.getPublicationDate(), - artifact.getUrl(), artifact.isMetadata()); + return new DefaultArtifact(ArtifactRevisionId.newInstance(mrid, artifact.getName(), + artifact.getType(), artifact.getExt(), artifact.getQualifiedExtraAttributes()), + artifact.getPublicationDate(), artifact.getUrl(), artifact.isMetadata()); } private Date publicationDate; @@ -81,16 +69,16 @@ public class DefaultArtifact extends Abs private ArtifactRevisionId arid; private URL url; - + private boolean isMetadata = false; - public DefaultArtifact(ModuleRevisionId mrid, Date publicationDate, - String name, String type, String ext) { + public DefaultArtifact(ModuleRevisionId mrid, Date publicationDate, String name, String type, + String ext) { this(mrid, publicationDate, name, type, ext, null, null); } - public DefaultArtifact(ModuleRevisionId mrid, Date publicationDate, - String name, String type, String ext, boolean isMetadata) { + public DefaultArtifact(ModuleRevisionId mrid, Date publicationDate, String name, String type, + String ext, boolean isMetadata) { this(mrid, publicationDate, name, type, ext, null, null); this.isMetadata = isMetadata; } @@ -102,11 +90,12 @@ public class DefaultArtifact extends Abs public DefaultArtifact(ModuleRevisionId mrid, Date publicationDate, String name, String type, String ext, URL url, Map extraAttributes) { - this(ArtifactRevisionId.newInstance(mrid, name, type, ext, extraAttributes), - publicationDate, url, false); + this(ArtifactRevisionId.newInstance(mrid, name, type, ext, extraAttributes), + publicationDate, url, false); } - public DefaultArtifact( - ArtifactRevisionId arid, Date publicationDate, URL url, boolean isMetadata) { + + public DefaultArtifact(ArtifactRevisionId arid, Date publicationDate, URL url, + boolean isMetadata) { if (arid == null) { throw new NullPointerException("null arid not allowed"); } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java?rev=1557968&r1=1557967&r2=1557968&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java Tue Jan 14 08:27:37 2014 @@ -47,8 +47,8 @@ public class DefaultDependencyArtifactDe * @param type * @param url */ - public DefaultDependencyArtifactDescriptor(DependencyDescriptor dd, - String name, String type, String ext, URL url, Map extraAttributes) { + public DefaultDependencyArtifactDescriptor(DependencyDescriptor dd, String name, String type, + String ext, URL url, Map extraAttributes) { super(null, extraAttributes); Checks.checkNotNull(dd, "dd"); Checks.checkNotNull(name, "name"); @@ -89,7 +89,7 @@ public class DefaultDependencyArtifactDe public void addConfiguration(String conf) { confs.add(conf); } - + public DependencyDescriptor getDependencyDescriptor() { return dd; }