http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/event/IvyEventFilter.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/event/IvyEventFilter.java b/src/java/org/apache/ivy/core/event/IvyEventFilter.java index d47059f..6b0d87e 100644 --- a/src/java/org/apache/ivy/core/event/IvyEventFilter.java +++ b/src/java/org/apache/ivy/core/event/IvyEventFilter.java @@ -150,10 +150,7 @@ public class IvyEventFilter implements Filter { } public boolean accept(Object o) { - if (!(o instanceof IvyEvent)) { - return false; - } - return nameFilter.accept(o) && attFilter.accept(o); + return o instanceof IvyEvent && nameFilter.accept(o) && attFilter.accept(o); } }
http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/event/publish/EndArtifactPublishEvent.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/event/publish/EndArtifactPublishEvent.java b/src/java/org/apache/ivy/core/event/publish/EndArtifactPublishEvent.java index 36c98ce..864e5cb 100644 --- a/src/java/org/apache/ivy/core/event/publish/EndArtifactPublishEvent.java +++ b/src/java/org/apache/ivy/core/event/publish/EndArtifactPublishEvent.java @@ -30,6 +30,7 @@ import org.apache.ivy.plugins.resolver.DependencyResolver; */ public class EndArtifactPublishEvent extends PublishEvent { + @SuppressWarnings("unused") private static final long serialVersionUID = -65690169431499422L; public static final String NAME = "post-publish-artifact"; http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/event/publish/StartArtifactPublishEvent.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/event/publish/StartArtifactPublishEvent.java b/src/java/org/apache/ivy/core/event/publish/StartArtifactPublishEvent.java index 2682eb5..42fb224 100644 --- a/src/java/org/apache/ivy/core/event/publish/StartArtifactPublishEvent.java +++ b/src/java/org/apache/ivy/core/event/publish/StartArtifactPublishEvent.java @@ -30,6 +30,7 @@ import org.apache.ivy.plugins.resolver.DependencyResolver; */ public class StartArtifactPublishEvent extends PublishEvent { + @SuppressWarnings("unused") private static final long serialVersionUID = -1134274781039590219L; public static final String NAME = "pre-publish-artifact"; http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/install/InstallEngine.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/install/InstallEngine.java b/src/java/org/apache/ivy/core/install/InstallEngine.java index b213fbb..47e45e7 100644 --- a/src/java/org/apache/ivy/core/install/InstallEngine.java +++ b/src/java/org/apache/ivy/core/install/InstallEngine.java @@ -78,7 +78,7 @@ public class InstallEngine { // build module file declaring the dependency Message.info(":: installing " + mrid + " ::"); - DependencyResolver oldDicator = resolveEngine.getDictatorResolver(); + DependencyResolver oldDictator = resolveEngine.getDictatorResolver(); boolean log = settings.logNotConvertedExclusionRule(); try { settings.setLogNotConvertedExclusionRule(true); @@ -203,7 +203,7 @@ public class InstallEngine { // IVY-834: log the problems if there were any... Message.sumupProblems(); - resolveEngine.setDictatorResolver(oldDicator); + resolveEngine.setDictatorResolver(oldDictator); settings.setLogNotConvertedExclusionRule(log); } } http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java b/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java index ccd262a..607690c 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java +++ b/src/java/org/apache/ivy/core/module/descriptor/AbstractIncludeExcludeRule.java @@ -70,7 +70,7 @@ public abstract class AbstractIncludeExcludeRule extends UnmodifiableExtendableI /** * Add a configuration for this rule * - * @param conf + * @param conf String */ public void addConfiguration(String conf) { confs.add(conf); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/Configuration.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/Configuration.java b/src/java/org/apache/ivy/core/module/descriptor/Configuration.java index de43912..88061d0 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/Configuration.java +++ b/src/java/org/apache/ivy/core/module/descriptor/Configuration.java @@ -42,7 +42,7 @@ public class Configuration extends DefaultExtendableItem implements InheritableI } else if ("public".equals(name)) { return PUBLIC; } else { - throw new IllegalArgumentException("unknwon visibility " + name); + throw new IllegalArgumentException("unknown visibility " + name); } } @@ -203,10 +203,7 @@ public class Configuration extends DefaultExtendableItem implements InheritableI @Override public boolean equals(Object obj) { - if (!(obj instanceof Configuration)) { - return false; - } - return ((Configuration) obj).getName().equals(getName()); + return obj instanceof Configuration && ((Configuration) obj).getName().equals(getName()); } @Override http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java b/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java index b25bebd..e532ebd 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java +++ b/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java @@ -37,7 +37,7 @@ public class ConfigurationGroup extends Configuration { * <p> * This list is built from the configuration name, if some of these configuration names have * actually not been recognized in the module, they will be <code>null</code> when accessed from - * {@link #getIntersectedConfiguration(String)}. + * {@link org.apache.ivy.core.module.descriptor.ConfigurationIntersection#getIntersectedConfiguration(String)}. * </p> * * @return the list of configurations' names this object is an intersection of. http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java b/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java index 42202f9..eca0ecf 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java +++ b/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyArtifactDescriptor.java @@ -42,10 +42,12 @@ public class DefaultDependencyArtifactDescriptor extends UnmodifiableExtendableI private DependencyDescriptor dd; /** - * @param dd - * @param name - * @param type - * @param url + * @param dd DependencyDescriptor + * @param name ditto + * @param type ditto + * @param ext ditto + * @param url ditto + * @param extraAttributes ditto */ public DefaultDependencyArtifactDescriptor(DependencyDescriptor dd, String name, String type, String ext, URL url, Map extraAttributes) { @@ -84,7 +86,7 @@ public class DefaultDependencyArtifactDescriptor extends UnmodifiableExtendableI /** * Add a configuration for this artifact. * - * @param conf + * @param conf ditto */ public void addConfiguration(String conf) { confs.add(conf); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java b/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java index 11ca953..00fdea8 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java +++ b/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java @@ -58,9 +58,9 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor { * namespace, because they aren't transformable (the name space hasn't the ability to convert * regular expressions). However, method doesExclude will work with system artifacts.</i> * - * @param dd - * @param ns - * @return + * @param dd DependencyDescriptor + * @param ns Namespace + * @return DependencyDescriptor */ public static DependencyDescriptor transformInstance(DependencyDescriptor dd, Namespace ns) { NamespaceTransformer t = ns.getToSystemTransformer(); @@ -77,9 +77,9 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor { * will be attached to the transformed dependency descriptor, so calling doesExclude is not * recommended (doesExclude only works when namespace is properly set) * - * @param dd - * @param t - * @return + * @param dd DependencyDescriptor + * @param t NamespaceTransformer + * @return DefaultDependencyDescriptor */ public static DefaultDependencyDescriptor transformInstance(DependencyDescriptor dd, NamespaceTransformer t, boolean fromSystem) { @@ -607,9 +607,8 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor { } /** - * Returns true if this descriptor contains any exclusion rule * - * @return + * @return true if this descriptor contains any exclusion rule */ public boolean canExclude() { return excludeRules != null && !excludeRules.isEmpty(); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/DefaultExtendsDescriptor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/DefaultExtendsDescriptor.java b/src/java/org/apache/ivy/core/module/descriptor/DefaultExtendsDescriptor.java index 1c7be57..1900a05 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/DefaultExtendsDescriptor.java +++ b/src/java/org/apache/ivy/core/module/descriptor/DefaultExtendsDescriptor.java @@ -18,6 +18,7 @@ package org.apache.ivy.core.module.descriptor; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.apache.ivy.core.module.id.ModuleRevisionId; @@ -42,9 +43,7 @@ public class DefaultExtendsDescriptor implements ExtendsDescriptor { this.location = location; this.local = local; this.extendsTypes = new ArrayList(types.length); - for (int i = 0; i < types.length; ++i) { - extendsTypes.add(types[i]); - } + extendsTypes.addAll(Arrays.asList(types)); } public ModuleRevisionId getParentRevisionId() { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java b/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java index 39256d2..1c039b6 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java +++ b/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java @@ -134,9 +134,9 @@ public class DefaultModuleDescriptor implements ModuleDescriptor { * in system namespace, because they aren't transformable (the name space hasn't the ability to * convert regular expressions)</i> * - * @param md - * @param ns - * @return + * @param md ModuleDescriptor + * @param ns Namespace + * @return ModuleDescriptor */ public static ModuleDescriptor transformInstance(ModuleDescriptor md, Namespace ns) { NamespaceTransformer t = ns.getToSystemTransformer(); @@ -362,8 +362,8 @@ public class DefaultModuleDescriptor implements ModuleDescriptor { * Artifact configurations are not used since added artifact may not be entirely completed, so * its configurations data may not be accurate * - * @param conf - * @param artifact + * @param conf ditto + * @param artifact ditto */ public void addArtifact(String conf, Artifact artifact) { Configuration c = getConfiguration(conf); @@ -600,9 +600,9 @@ public class DefaultModuleDescriptor implements ModuleDescriptor { * regular expressions as explained in Pattern class may be used in ModuleId organisation and * name * - * @param moduleId - * @param matcher - * @param resolverName + * @param moduleId ditto + * @param matcher PatternMatcher + * @param manager ConflictManager */ public void addConflictManager(ModuleId moduleId, PatternMatcher matcher, ConflictManager manager) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java b/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java index 1780d1f..13973d8 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java +++ b/src/java/org/apache/ivy/core/module/descriptor/DependencyDescriptor.java @@ -112,9 +112,9 @@ public interface DependencyDescriptor extends ExtendableItem, InheritableItem { /** * Returns true if * - * @param moduleConfigurations - * @param artifactId - * @return + * @param moduleConfigurations ditto + * @param artifactId ditto + * @return boolean */ boolean doesExclude(String[] moduleConfigurations, ArtifactId artifactId); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/ExcludeRule.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/ExcludeRule.java b/src/java/org/apache/ivy/core/module/descriptor/ExcludeRule.java index 33c82c2..33b0027 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/ExcludeRule.java +++ b/src/java/org/apache/ivy/core/module/descriptor/ExcludeRule.java @@ -30,7 +30,7 @@ public interface ExcludeRule extends ExtendableItem { /** * Returns the id of the described artifact, without revision information * - * @return + * @return ArtifactId */ public ArtifactId getId(); @@ -44,7 +44,7 @@ public interface ExcludeRule extends ExtendableItem { /** * Returns the matcher to use to know if an artifact match the current descriptor * - * @return + * @return PatternMatcher */ public PatternMatcher getMatcher(); } http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/IncludeRule.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/IncludeRule.java b/src/java/org/apache/ivy/core/module/descriptor/IncludeRule.java index 7cbeada..14d841d 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/IncludeRule.java +++ b/src/java/org/apache/ivy/core/module/descriptor/IncludeRule.java @@ -22,7 +22,7 @@ import org.apache.ivy.plugins.matcher.PatternMatcher; import org.apache.ivy.util.extendable.ExtendableItem; /** - * This describes a rule of inclusion. It is used to resctrict the artifacts and modules asked for a + * This describes a rule of inclusion. It is used to restrict the artifacts and modules asked for a * dependency, by including only modules and artifacts matching the rule */ public interface IncludeRule extends ExtendableItem { @@ -30,7 +30,7 @@ public interface IncludeRule extends ExtendableItem { /** * Returns the id of the described artifact, without revision information * - * @return + * @return ArtifactId */ public ArtifactId getId(); @@ -44,7 +44,7 @@ public interface IncludeRule extends ExtendableItem { /** * Returns the matcher to use to know if an artifact match the current descriptor * - * @return + * @return PatternMatcher */ public PatternMatcher getMatcher(); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java b/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java index 4eb4a1e..1116d88 100644 --- a/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java +++ b/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java @@ -49,7 +49,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, * Returns true if this descriptor is a default one, i.e. one generated for a module not * actually having one. * - * @return + * @return boolean */ boolean isDefault(); @@ -61,14 +61,14 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, * the returned ModuleRevisionId. This revision must be the same as the module descriptor * resolved revision id unless no module descriptor is defined * - * @return + * @return ModuleRevisionId */ ModuleRevisionId getResolvedModuleRevisionId(); /** * This method update the resolved module revision id * - * @param revId + * @param revId ModuleRevisionId */ void setResolvedModuleRevisionId(ModuleRevisionId revId); @@ -81,7 +81,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, /** * This method update the resolved publication date * - * @param publicationDate + * @param publicationDate Date */ void setResolvedPublicationDate(Date publicationDate); @@ -90,7 +90,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, /** * May be <code>null</code> if unknown in the descriptor itself. * - * @return The publication date or <code>null</code> when not knwon. + * @return The publication date or <code>null</code> when not known. */ Date getPublicationDate(); @@ -125,23 +125,24 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, Artifact[] getAllArtifacts(); /** - * @retun The dependencies of the module. If there is no dependencies return an empty array (non + * @return The dependencies of the module. If there is no dependencies return an empty array (non * null) */ DependencyDescriptor[] getDependencies(); /** - * Returns true if the module described by this descriptor dependes directly upon the given + * Returns true if the module described by this descriptor depends directly upon the given * module descriptor - * - * @param md - * @return + * + * @param matcher VersionMatcher + * @param md ModuleDescriptor + * @return boolean */ boolean dependsOn(VersionMatcher matcher, ModuleDescriptor md); /** - * @param confName - * @return + * @param confName ditto + * @return Configuration */ Configuration getConfiguration(String confName); @@ -149,15 +150,15 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, * Returns the conflict manager to use for the given ModuleId, or <code>null</code> if no * specific conflict manager is associated with the given module id in this module descriptor. * - * @param id - * @return + * @param id ModuleId + * @return ConflictManager */ ConflictManager getConflictManager(ModuleId id); /** * Returns the licenses of the module described by this descriptor * - * @return + * @return License[] */ License[] getLicenses(); @@ -180,7 +181,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, /** * The ModuleDescriptorParser used to parse this module descriptor, null is no parser was used. * - * @return + * @return ModuleDescriptorParser */ ModuleDescriptorParser getParser(); @@ -188,7 +189,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, * The resource being the source of this module descriptor, null if no resource corresponds to * this module descriptor * - * @return + * @return Resource */ Resource getResource(); @@ -216,9 +217,9 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, * Returns true if an exclude rule of this module attached to any of the given configurations * matches the given artifact id, and thus exclude it * - * @param moduleConfs - * @param artifactId - * @return + * @param moduleConfs String[] + * @param artifactId ditto + * @return boolean */ boolean doesExclude(String[] moduleConfs, ArtifactId artifactId); @@ -271,7 +272,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, * description are given. * * @since 2.4.0 - * @return + * @return List<ExtraInfoHolder> */ List<ExtraInfoHolder> getExtraInfos(); @@ -279,7 +280,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, * Returns content from first extrainfo matching with given tag name * * @since 2.4.0 - * @return + * @return ditto */ String getExtraInfoContentByTagName(String tagName); @@ -287,7 +288,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo, * Returns first extrainfo matching with given tag name * * @since 2.4.0 - * @return + * @return ExtraInfoHolder */ ExtraInfoHolder getExtraInfoByTagName(String tagName); } http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/id/MatcherLookup.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/id/MatcherLookup.java b/src/java/org/apache/ivy/core/module/id/MatcherLookup.java index e4650de..c1fa6ad 100644 --- a/src/java/org/apache/ivy/core/module/id/MatcherLookup.java +++ b/src/java/org/apache/ivy/core/module/id/MatcherLookup.java @@ -71,7 +71,7 @@ public class MatcherLookup { * * If matcher is not exact pattern matcher, it will be placed into non-keyed collection * - * @param matcher + * @param matcher MapMatcher */ public void add(MapMatcher matcher) { if (!(matcher.getPatternMatcher() instanceof ExactPatternMatcher)) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/id/ModuleId.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/id/ModuleId.java b/src/java/org/apache/ivy/core/module/id/ModuleId.java index 8d2a85d..7effb7d 100644 --- a/src/java/org/apache/ivy/core/module/id/ModuleId.java +++ b/src/java/org/apache/ivy/core/module/id/ModuleId.java @@ -183,7 +183,7 @@ public class ModuleId implements Comparable<ModuleId> { /** * Returns a ModuleId * - * @param encoded + * @param encoded String * @return The new ModuleId. * @throws IllegalArgumentException * If the given String could not be decoded. http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java b/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java index 38de003..0d63514 100644 --- a/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java +++ b/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java @@ -231,17 +231,11 @@ public class ModuleRevisionId extends UnmodifiableExtendableItem { } ModuleRevisionId other = (ModuleRevisionId) obj; - if (!other.getRevision().equals(getRevision())) { - return false; - } else if (other.getBranch() == null && getBranch() != null) { - return false; - } else if (other.getBranch() != null && !other.getBranch().equals(getBranch())) { - return false; - } else if (!other.getModuleId().equals(getModuleId())) { - return false; - } else { - return other.getQualifiedExtraAttributes().equals(getQualifiedExtraAttributes()); - } + return other.getRevision().equals(getRevision()) + && !(other.getBranch() == null && getBranch() != null) + && !(other.getBranch() != null && !other.getBranch().equals(getBranch())) + && other.getModuleId().equals(getModuleId()) + && other.getQualifiedExtraAttributes().equals(getQualifiedExtraAttributes()); } @Override @@ -337,7 +331,7 @@ public class ModuleRevisionId extends UnmodifiableExtendableItem { private static String normalizeRevision(String revision) { if (revision.startsWith("[") && revision.endsWith("]") && revision.indexOf(',') == -1) { if (IvyPatternHelper.getTokenString(IvyPatternHelper.REVISION_KEY).equals(revision)) { - // this is the case when listing dynamic revions + // this is the case when listing dynamic revisions return revision; } http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/module/status/StatusManager.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/module/status/StatusManager.java b/src/java/org/apache/ivy/core/module/status/StatusManager.java index 53fc382..0e355d7 100644 --- a/src/java/org/apache/ivy/core/module/status/StatusManager.java +++ b/src/java/org/apache/ivy/core/module/status/StatusManager.java @@ -119,7 +119,7 @@ public class StatusManager { Message.debug("unknown status " + status + ": assuming integration"); return true; } - return isIntegration.booleanValue(); + return isIntegration; } public String getDeliveryStatusListString() { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/pack/OsgiBundlePacking.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/pack/OsgiBundlePacking.java b/src/java/org/apache/ivy/core/pack/OsgiBundlePacking.java index a9f9344..737a1f9 100644 --- a/src/java/org/apache/ivy/core/pack/OsgiBundlePacking.java +++ b/src/java/org/apache/ivy/core/pack/OsgiBundlePacking.java @@ -18,7 +18,6 @@ package org.apache.ivy.core.pack; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -37,7 +36,7 @@ public class OsgiBundlePacking extends ZipPacking { } @Override - protected void writeFile(InputStream zip, File f) throws FileNotFoundException, IOException { + protected void writeFile(InputStream zip, File f) throws IOException { // XXX maybe we should only unpack file listed by the 'Bundle-ClassPath' MANIFEST header ? if (f.getName().endsWith(".jar.pack.gz")) { zip = FileUtil.unwrapPack200(zip); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/pack/PackagingManager.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/pack/PackagingManager.java b/src/java/org/apache/ivy/core/pack/PackagingManager.java index 2eba452..0271f87 100644 --- a/src/java/org/apache/ivy/core/pack/PackagingManager.java +++ b/src/java/org/apache/ivy/core/pack/PackagingManager.java @@ -64,11 +64,9 @@ public class PackagingManager implements IvySettingsAware { } ext = packing.getUnpackedExtension(ext); - DefaultArtifact unpacked = new DefaultArtifact(artifact.getModuleRevisionId(), + return new DefaultArtifact(artifact.getModuleRevisionId(), artifact.getPublicationDate(), artifact.getName(), artifact.getType() + "_unpacked", ext); - - return unpacked; } public Artifact unpackArtifact(Artifact artifact, File localFile, File archiveFile) http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/pack/ZipPacking.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/pack/ZipPacking.java b/src/java/org/apache/ivy/core/pack/ZipPacking.java index 87cfbdf..35da694 100644 --- a/src/java/org/apache/ivy/core/pack/ZipPacking.java +++ b/src/java/org/apache/ivy/core/pack/ZipPacking.java @@ -18,7 +18,6 @@ package org.apache.ivy.core.pack; import java.io.File; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -83,7 +82,7 @@ public class ZipPacking extends ArchivePacking { } } - protected void writeFile(InputStream zip, File f) throws FileNotFoundException, IOException { + protected void writeFile(InputStream zip, File f) throws IOException { FileOutputStream out = new FileOutputStream(f); try { FileUtil.copy(zip, out, null, false); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/publish/PublishEngine.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/publish/PublishEngine.java b/src/java/org/apache/ivy/core/publish/PublishEngine.java index 6b42a35..d6a7904 100644 --- a/src/java/org/apache/ivy/core/publish/PublishEngine.java +++ b/src/java/org/apache/ivy/core/publish/PublishEngine.java @@ -182,9 +182,7 @@ public class PublishEngine { for (int i = 0; i < confs.length; i++) { Artifact[] artifacts = md.getArtifacts(confs[i]); - for (int j = 0; j < artifacts.length; j++) { - artifactsSet.add(artifacts[j]); - } + artifactsSet.addAll(Arrays.asList(artifacts)); } Artifact[] extraArtifacts = options.getExtraArtifacts(); if (extraArtifacts != null) { @@ -207,11 +205,9 @@ public class PublishEngine { } if (!artifactsFiles.containsKey(artifact)) { StringBuffer sb = new StringBuffer(); - sb.append("missing artifact " + artifact + ":\n"); + sb.append("missing artifact ").append(artifact).append(":\n"); for (String pattern : srcArtifactPattern) { - sb.append("\t" - + settings.resolveFile(IvyPatternHelper.substitute(pattern, artifact)) - + " file does not exist\n"); + sb.append("\t").append(settings.resolveFile(IvyPatternHelper.substitute(pattern, artifact))).append(" file does not exist\n"); } if (options.isWarnOnMissing() || options.isHaltOnMissing()) { Message.warn(sb.toString()); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java b/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java index a395783..38296df 100644 --- a/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java +++ b/src/java/org/apache/ivy/core/report/ConfigurationResolveReport.java @@ -83,8 +83,6 @@ public class ConfigurationResolveReport { * the new report is serialized there.</br> This function also use the internal dependencies * that must already be filled. This function might be 'heavy' because it may have to parse the * previous report. - * - * @return */ public void checkIfChanged() { ResolutionCacheManager cache = resolveEngine.getSettings().getResolutionCacheManager(); @@ -98,7 +96,7 @@ public class ConfigurationResolveReport { .getDependencyRevisionIds()); HashSet<ModuleRevisionId> previousDepSet = new HashSet<ModuleRevisionId>( previousDeps); - hasChanged = Boolean.valueOf(!previousDepSet.equals(getModuleRevisionIds())); + hasChanged = !previousDepSet.equals(getModuleRevisionIds()); } catch (Exception e) { Message.warn("Error while parsing configuration resolve report " + previousReportFile.getAbsolutePath(), e); @@ -113,7 +111,7 @@ public class ConfigurationResolveReport { * @pre checkIfChanged has been called. */ public boolean hasChanged() { - return hasChanged.booleanValue(); + return hasChanged; } /** @@ -292,7 +290,7 @@ public class ConfigurationResolveReport { * specific download status, and also remove the download report for the evicted modules. * * @param downloadStatus - * the status of download to retreive. Set it to <code>null</code> for no restriction + * the status of download to retrieve. Set it to <code>null</code> for no restriction * on the download status * @param withEvicted * set it to <code>true</code> if the report for the evicted modules have to be @@ -322,7 +320,7 @@ public class ConfigurationResolveReport { } /** - * Get the report on the sucessfull download requests with the evicted modules + * Get the report on the successful download requests with the evicted modules * * @return the list of reports, never <code>null</code> */ http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/report/ResolveReport.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/report/ResolveReport.java b/src/java/org/apache/ivy/core/report/ResolveReport.java index f2d5499..0fb05f0 100644 --- a/src/java/org/apache/ivy/core/report/ResolveReport.java +++ b/src/java/org/apache/ivy/core/report/ResolveReport.java @@ -150,7 +150,7 @@ public class ResolveReport { * specific download status, and also remove the download report for the evicted modules. * * @param downloadStatus - * the status of download to retreive. Set it to <code>null</code> for no restriction + * the status of download to retrieve. Set it to <code>null</code> for no restriction * on the download status * @param withEvicted * set it to <code>true</code> if the report for the evicted modules have to be @@ -320,9 +320,10 @@ public class ResolveReport { * Get every configuration which extends the specified one. The returned list also includes the * specified one. * - * @param extended - * @return + * @param extended String + * @return String[] */ + @SuppressWarnings("unused") private String[] getExtendingConfs(String extended) { String[] allConfs = md.getConfigurationsNames(); Set<String> extendingConfs = new HashSet<String>(); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/repository/RepositoryManagementEngine.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/repository/RepositoryManagementEngine.java b/src/java/org/apache/ivy/core/repository/RepositoryManagementEngine.java index fe552ed..286d7b4 100644 --- a/src/java/org/apache/ivy/core/repository/RepositoryManagementEngine.java +++ b/src/java/org/apache/ivy/core/repository/RepositoryManagementEngine.java @@ -62,7 +62,7 @@ import org.apache.ivy.util.Message; * </p> * <p> * This engine is not intended to be used concurrently with publish, the order of repository loaded - * being undeterministic and long, it could end up in having an inconsistent in memory state. + * being nondeterministic and long, it could end up in having an inconsistent in memory state. * </p> * <p> * For better performance, we strongly suggest using this engine with cache in useOrigin mode. http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/IvyNode.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/IvyNode.java b/src/java/org/apache/ivy/core/resolve/IvyNode.java index 48b23db..4cac6c7 100644 --- a/src/java/org/apache/ivy/core/resolve/IvyNode.java +++ b/src/java/org/apache/ivy/core/resolve/IvyNode.java @@ -391,7 +391,7 @@ public class IvyNode implements Comparable<IvyNode> { // no callers, but maybe some exclude Boolean exclude = doesExclude(md, rootModuleConf, new String[] {rootModuleConf}, dd, a, new Stack<ModuleRevisionId>()); - return exclude == null ? false : exclude.booleanValue(); + return exclude != null && exclude; } return callers.doesCallersExclude(rootModuleConf, a); } @@ -516,7 +516,8 @@ public class IvyNode implements Comparable<IvyNode> { /** * returns the required configurations from the given node * - * @param in + * @param in IvyNode + * @param inConf ditto * @return array of configuration names */ public String[] getRequiredConfigurations(IvyNode in, String inConf) { @@ -564,7 +565,7 @@ public class IvyNode implements Comparable<IvyNode> { /** * Returns the configurations of the dependency required in a given root module configuration. * - * @param rootModuleConf + * @param rootModuleConf String * @return array of configuration names */ public String[] getConfigurations(String rootModuleConf) { @@ -762,7 +763,7 @@ public class IvyNode implements Comparable<IvyNode> { * Returns all the artifacts of this dependency required in the root module configurations in * which the node is not evicted nor blacklisted * - * @param artifactFilter + * @param artifactFilter Filter * @return array of {@link Artifact}s */ public Artifact[] getSelectedArtifacts(Filter<Artifact> artifactFilter) { @@ -780,7 +781,7 @@ public class IvyNode implements Comparable<IvyNode> { * Returns the artifacts of this dependency required in the configurations themselves required * in the given root module configuration * - * @param rootModuleConf + * @param rootModuleConf String * @return array of {@link Artifact}s */ public Artifact[] getArtifacts(String rootModuleConf) { @@ -993,7 +994,7 @@ public class IvyNode implements Comparable<IvyNode> { /** * Returns the last modified timestamp of the module represented by this Node, or 0 if the last - * modified timestamp is currently unkwown (module not loaded) + * modified timestamp is currently unknown (module not loaded) * * @return the last modified timestamp of the module represented by this Node */ @@ -1190,7 +1191,7 @@ public class IvyNode implements Comparable<IvyNode> { * Returns a collection of Nodes in conflict for which conflict has been detected but conflict * resolution hasn't been done yet * - * @param rootModuleConf + * @param rootModuleConf ditto * @param mid * the module id for which pending conflicts should be found * @return a Collection of IvyNode in pending conflict @@ -1217,7 +1218,7 @@ public class IvyNode implements Comparable<IvyNode> { * {@link LatestCompatibleConflictManager} * </p> * - * @param rootModuleConf + * @param bdata * the root module configuration in which the node should be blacklisted */ public void blacklist(IvyNodeBlacklist bdata) { @@ -1259,7 +1260,7 @@ public class IvyNode implements Comparable<IvyNode> { * the root module conf for which we'd like to know if the node is blacklisted * * @return true if this node is blacklisted int he given root module conf, false otherwise - * @see #blacklist(String) + * @see #blacklist(IvyNodeBlacklist) */ public boolean isBlacklisted(String rootModuleConf) { return usage.isBlacklisted(rootModuleConf); @@ -1269,7 +1270,7 @@ public class IvyNode implements Comparable<IvyNode> { * Indicates if this node has been blacklisted in all root module configurations. * * @return true if this node is blacklisted in all root module configurations, false otherwise - * @see #blacklist(String) + * @see #blacklist(IvyNodeBlacklist) */ public boolean isCompletelyBlacklisted() { if (isRoot()) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java b/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java index a53262a..e5f5966 100644 --- a/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java +++ b/src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java @@ -151,9 +151,9 @@ public class IvyNodeCallers { } /** - * @param rootModuleConf - * @param mrid - * @param callerConf + * @param rootModuleConf ditto + * @param callerNode IvyNode + * @param callerConf ditto * @param dependencyConfs * '*' must have been resolved * @param dd @@ -252,9 +252,9 @@ public class IvyNodeCallers { /** * Returns true if ALL callers exclude the given artifact in the given root module conf * - * @param rootModuleConf - * @param artifact - * @return + * @param rootModuleConf ditto + * @param artifact Artifact + * @return boolean */ boolean doesCallersExclude(String rootModuleConf, Artifact artifact) { return doesCallersExclude(rootModuleConf, artifact, new Stack<ModuleRevisionId>()); @@ -268,7 +268,7 @@ public class IvyNodeCallers { if (callers.length == 0) { return false; } - boolean allUnconclusive = true; + boolean allInconclusive = true; for (int i = 0; i < callers.length; i++) { if (!callers[i].canExclude()) { return false; @@ -278,13 +278,13 @@ public class IvyNodeCallers { callers[i].getCallerConfigurations(), callers[i].getDependencyDescriptor(), artifact, callersStack); if (doesExclude != null) { - if (!doesExclude.booleanValue()) { + if (!doesExclude) { return false; } - allUnconclusive = false; + allInconclusive = false; } } - return allUnconclusive ? false : true; + return !allInconclusive; } finally { callersStack.pop(); } http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java b/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java index c08f94a..940dfa1 100644 --- a/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java +++ b/src/java/org/apache/ivy/core/resolve/IvyNodeEviction.java @@ -157,11 +157,7 @@ public class IvyNodeEviction { @Override public boolean equals(Object obj) { - if (!(obj instanceof ModuleIdConf)) { - return false; - } - return getModuleId().equals(((ModuleIdConf) obj).getModuleId()) - && getConf().equals(((ModuleIdConf) obj).getConf()); + return obj instanceof ModuleIdConf && getModuleId().equals(((ModuleIdConf) obj).getModuleId()) && getConf().equals(((ModuleIdConf) obj).getConf()); } @Override @@ -342,7 +338,7 @@ public class IvyNodeEviction { * Returns null if this node has only be evicted transitively, or the the collection of selected * nodes if it has been evicted by other selected nodes * - * @return + * @return Collection<IvyNode> */ public Collection<IvyNode> getAllEvictingNodes() { Collection<IvyNode> allEvictingNodes = null; @@ -390,9 +386,9 @@ public class IvyNodeEviction { * otherwise (if it hasn't been evicted in root) for the given rootModuleConf. Note that this * method only works if conflict resolution has already be done in all the ancestors. * - * @param rootModuleConf - * @param ancestor - * @return + * @param rootModuleConf ditto + * @param ancestor IvyNode + * @return EvictionData */ public EvictionData getEvictionDataInRoot(String rootModuleConf, IvyNode ancestor) { Collection<IvyNode> selectedNodes = node.getRoot().getResolvedNodes(node.getModuleId(), http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java b/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java index cb0eafe..0399f52 100644 --- a/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java +++ b/src/java/org/apache/ivy/core/resolve/IvyNodeUsage.java @@ -66,11 +66,7 @@ public class IvyNodeUsage { @Override public boolean equals(Object obj) { - if (!(obj instanceof NodeConf)) { - return false; - } - return getNode().equals(((NodeConf) obj).getNode()) - && getConf().equals(((NodeConf) obj).getConf()); + return obj instanceof NodeConf && getNode().equals(((NodeConf) obj).getNode()) && getConf().equals(((NodeConf) obj).getConf()); } @Override @@ -151,8 +147,8 @@ public class IvyNodeUsage { /** * Returns the configurations of the dependency required in a given root module configuration. * - * @param rootModuleConf - * @return + * @param rootModuleConf ditto + * @return Set<String> */ protected Set<String> getConfigurations(String rootModuleConf) { return rootModuleConfs.get(rootModuleConf); @@ -273,7 +269,7 @@ public class IvyNodeUsage { * the root module conf for which we'd like to know if the node is blacklisted * * @return true if this node is blacklisted int he given root module conf, false otherwise - * @see #blacklist(String) + * @see #blacklist(IvyNodeBlacklist) */ protected boolean isBlacklisted(String rootModuleConf) { return blacklisted.containsKey(rootModuleConf); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/ResolveData.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/ResolveData.java b/src/java/org/apache/ivy/core/resolve/ResolveData.java index f6cb9a7..0877f8b 100644 --- a/src/java/org/apache/ivy/core/resolve/ResolveData.java +++ b/src/java/org/apache/ivy/core/resolve/ResolveData.java @@ -171,7 +171,7 @@ public class ResolveData { * Sets the currently visited node. WARNING: This should only be called by Ivy core * ResolveEngine! * - * @param currentVisitNode + * @param currentVisitNode VisitNode */ void setCurrentVisitNode(VisitNode currentVisitNode) { this.currentVisitNode = currentVisitNode; @@ -217,7 +217,7 @@ public class ResolveData { } // replace visit data in Map (discards old one) this.visitData.put(mrid, keptVisitData); - // update visit data with discarde visit nodes + // update visit data with discarded visit nodes keptVisitData.addVisitNodes(rootModuleConf, visitData.getVisitNodes(rootModuleConf)); report.updateDependency(mrid, node); @@ -299,7 +299,7 @@ public class ResolveData { // mediating dd through dependers stack List<VisitNode> dependers = new ArrayList<VisitNode>(current.getPath()); // the returned path contains the currently visited node, we are only interested in - // the dependers, so we remove the currently visted node from the end + // the dependers, so we remove the currently visited node from the end dependers.remove(dependers.size() - 1); // we want to apply mediation going up in the dependers stack, not the opposite Collections.reverse(dependers); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/ResolveEngine.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/ResolveEngine.java b/src/java/org/apache/ivy/core/resolve/ResolveEngine.java index 33e908d..7c0a11a 100644 --- a/src/java/org/apache/ivy/core/resolve/ResolveEngine.java +++ b/src/java/org/apache/ivy/core/resolve/ResolveEngine.java @@ -495,12 +495,8 @@ public class ResolveEngine { * * @param ivySource * url of the ivy file to use for dependency resolving - * @param confs - * an array of configuration names to resolve - must not be null nor empty - * @param getCache - * the cache to use - default cache is used if null - * @param date - * the date to which resolution must be done - may be null + * @param options + * ditto * @return an array of the resolved dependencies * @throws ParseException * if a parsing problem occurred in the ivy file @@ -610,7 +606,7 @@ public class ResolveEngine { } } - // prune and reverse sort fectched dependencies + // prune and reverse sort fetched dependencies Collection<IvyNode> nodes = data.getNodes(); // use a Set to avoid duplicates, linked to preserve order Collection<IvyNode> dependencies = new LinkedHashSet<IvyNode>(nodes.size()); @@ -623,7 +619,7 @@ public class ResolveEngine { SortOptions.SILENT); Collections.reverse(sortedDependencies); - handleTransiviteEviction(md, confs, data, sortedDependencies); + handleTransitiveEviction(md, confs, data, sortedDependencies); return dependencies.toArray(new IvyNode[dependencies.size()]); } finally { @@ -631,8 +627,8 @@ public class ResolveEngine { } } - private void handleTransiviteEviction(ModuleDescriptor md, String[] confs, ResolveData data, - List<IvyNode> sortedDependencies) { + private void handleTransitiveEviction(ModuleDescriptor md, String[] confs, ResolveData data, + List<IvyNode> sortedDependencies) { // handle transitive eviction now: // if a module has been evicted then all its dependencies required only by it should be // evicted too. Since nodes are now sorted from the more dependent to the less one, we @@ -811,7 +807,7 @@ public class ResolveEngine { } markDependenciesFetched(node.getNode(), conf); } - // we have finiched with this configuration, if it was the original requested conf + // we have finished with this configuration, if it was the original requested conf // we can clean it now if (requestedConfSet) { node.setRequestedConf(null); @@ -840,9 +836,8 @@ public class ResolveEngine { private String getDependenciesFetchedKey(IvyNode node, String conf) { ModuleRevisionId moduleRevisionId = node.getResolvedId(); - String key = moduleRevisionId.getOrganisation() + "|" + moduleRevisionId.getName() + "|" + return moduleRevisionId.getOrganisation() + "|" + moduleRevisionId.getName() + "|" + moduleRevisionId.getRevision() + "|" + conf; - return key; } private void resolveConflict(VisitNode node, String conf) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/ResolveOptions.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/ResolveOptions.java b/src/java/org/apache/ivy/core/resolve/ResolveOptions.java index b872b4c..f71b015 100644 --- a/src/java/org/apache/ivy/core/resolve/ResolveOptions.java +++ b/src/java/org/apache/ivy/core/resolve/ResolveOptions.java @@ -184,7 +184,7 @@ public class ResolveOptions extends LogOptions { /** * @pre can only be called if useSpecialConfs()==false. When it is true, you have to provide a - * module desciptor so that configurations can be resolved. + * module descriptor so that configurations can be resolved. * @see #getConfs(ModuleDescriptor) */ public String[] getConfs() { @@ -196,7 +196,7 @@ public class ResolveOptions extends LogOptions { } /** - * Get the aksed confs. Special confs (like *) use the moduleDescriptor to find the values * + * Get the asked confs. Special confs (like *) use the moduleDescriptor to find the values * * * @param md * Used to get the exact values for special confs. http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/ResolveProcessException.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/ResolveProcessException.java b/src/java/org/apache/ivy/core/resolve/ResolveProcessException.java index 07ccea8..58e37a3 100644 --- a/src/java/org/apache/ivy/core/resolve/ResolveProcessException.java +++ b/src/java/org/apache/ivy/core/resolve/ResolveProcessException.java @@ -27,6 +27,7 @@ package org.apache.ivy.core.resolve; * Some subclasses have even a stronger power over the resolve process, like * {@link RestartResolveProcess} which orders to restart the resolve process at the start. */ +@SuppressWarnings("serial") public class ResolveProcessException extends RuntimeException { public ResolveProcessException() { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/ResolvedModuleRevision.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/ResolvedModuleRevision.java b/src/java/org/apache/ivy/core/resolve/ResolvedModuleRevision.java index e25b21f..5fefcaf 100644 --- a/src/java/org/apache/ivy/core/resolve/ResolvedModuleRevision.java +++ b/src/java/org/apache/ivy/core/resolve/ResolvedModuleRevision.java @@ -126,10 +126,7 @@ public class ResolvedModuleRevision { } public boolean equals(Object obj) { - if (!(obj instanceof ResolvedModuleRevision)) { - return false; - } - return ((ResolvedModuleRevision) obj).getId().equals(getId()); + return obj instanceof ResolvedModuleRevision && ((ResolvedModuleRevision) obj).getId().equals(getId()); } public int hashCode() { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/RestartResolveProcess.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/RestartResolveProcess.java b/src/java/org/apache/ivy/core/resolve/RestartResolveProcess.java index c074067..4da7153 100644 --- a/src/java/org/apache/ivy/core/resolve/RestartResolveProcess.java +++ b/src/java/org/apache/ivy/core/resolve/RestartResolveProcess.java @@ -25,6 +25,7 @@ package org.apache.ivy.core.resolve; * since the resolve engine itself won't check the same exception is not thrown ad libitum * </p> */ +@SuppressWarnings("serial") public class RestartResolveProcess extends ResolveProcessException { public RestartResolveProcess(String message) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/resolve/VisitNode.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/resolve/VisitNode.java b/src/java/org/apache/ivy/core/resolve/VisitNode.java index ff2d5a1..c38bce1 100644 --- a/src/java/org/apache/ivy/core/resolve/VisitNode.java +++ b/src/java/org/apache/ivy/core/resolve/VisitNode.java @@ -37,16 +37,13 @@ import org.apache.ivy.util.Checks; /** * A visit node is an object used to represent one visit from one parent on an {@link IvyNode} of * the dependency graph. During dependency resolution, the {@link ResolveEngine} visits nodes of the - * depency graph following the dependencies, thus the same node can be visited several times, if it - * is requested from several module. In this case you will have one VisitNode per parent and per + * dependency graph following the dependencies, thus the same node can be visited several times, if + * it is requested from several module. In this case you will have one VisitNode per parent and per * root module configuration. Thus VisitNode stores data specific to the visit: * <ul> - * <li>parent</li> - * the node from which the visit is occuring - * <li>parentConf</li> - * the configuration of the parent in which this node is visited - * <li>rootModuleConf</li> - * the configuration of the root module which is currently resolved + * <li>parent</li> the node from which the visit is occurring + * <li>parentConf</li> the configuration of the parent in which this node is visited + * <li>rootModuleConf</li> the configuration of the root module which is currently resolved * </ul> */ public class VisitNode { @@ -66,7 +63,7 @@ public class VisitNode { private VisitNode root = null; /** - * Direct path from root to this node. Note that the colleciton is ordered but is not a list + * Direct path from root to this node. Note that the collection is ordered but is not a list * implementation This collection is null until it is required, see getPath */ private Collection<VisitNode> path = null; @@ -156,7 +153,7 @@ public class VisitNode { /** * Get an ordered collection with the nodes from the root to this node * - * @return + * @return Collection<VisitNode> */ public Collection<VisitNode> getPath() { if (path == null) { @@ -232,18 +229,14 @@ public class VisitNode { } DependencyDescriptor dd = node.getDependencyDescriptor(getParentNode()); - if ((dd != null) && dd.isTransitive()) { - return true; - } + return (dd != null) && dd.isTransitive() + || node.hasAnyMergedUsageWithTransitiveDependency(rootModuleConf); - return node.hasAnyMergedUsageWithTransitiveDependency(rootModuleConf); } /** * Checks if the current node's parent configuration is transitive. - * - * @param node - * current node + * * @return true if the node's parent configuration is transitive */ protected boolean isParentConfTransitive() { @@ -421,12 +414,12 @@ public class VisitNode { /** * Returns true if this node can already be found in the path * - * @return + * @return boolean */ public boolean isCircular() { if (isCircular == null) { if (parent != null) { - isCircular = Boolean.FALSE; // asumme it's false, and see if it isn't by checking + isCircular = Boolean.FALSE; // assume it's false, and see if it isn't by checking // the parent path for (VisitNode ancestor : parent.getPath()) { if (getId().getModuleId().equals(ancestor.getId().getModuleId())) { @@ -438,7 +431,7 @@ public class VisitNode { isCircular = Boolean.FALSE; } } - return isCircular.booleanValue(); + return isCircular; } public String[] getConfsToFetch() { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java b/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java index 57481de..0e0d68c 100644 --- a/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java +++ b/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java @@ -79,10 +79,10 @@ public class RetrieveEngine { @Deprecated public int retrieve(ModuleRevisionId mrid, String destFilePattern, RetrieveOptions options) throws IOException { - RetrieveOptions retieveOptions = new RetrieveOptions(options); - retieveOptions.setDestArtifactPattern(destFilePattern); + RetrieveOptions retrieveOptions = new RetrieveOptions(options); + retrieveOptions.setDestArtifactPattern(destFilePattern); - RetrieveReport result = retrieve(mrid, retieveOptions); + RetrieveReport result = retrieve(mrid, retrieveOptions); return result.getNbrArtifactsCopied(); } @@ -486,7 +486,7 @@ public class RetrieveEngine { * The returned comparator should consider greater the artifact which gains the conflict battle. * This is used only during retrieve... prefer resolve conflict manager to resolve conflicts. * - * @return + * @return Comparator<ArtifactDownloadReport> */ private Comparator<ArtifactDownloadReport> getConflictResolvingPolicy() { return new Comparator<ArtifactDownloadReport>() { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java b/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java index c80bb71..d3d4443 100644 --- a/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java +++ b/src/java/org/apache/ivy/core/retrieve/RetrieveOptions.java @@ -67,7 +67,7 @@ public class RetrieveOptions extends LogOptions { private String overwriteMode = OVERWRITEMODE_NEWER; /** - * True if the original files should be used insteaad of their cache copy. + * True if the original files should be used instead of their cache copy. */ private boolean useOrigin = false; http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/search/SearchEngine.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/search/SearchEngine.java b/src/java/org/apache/ivy/core/search/SearchEngine.java index b35ee92..537566f 100644 --- a/src/java/org/apache/ivy/core/search/SearchEngine.java +++ b/src/java/org/apache/ivy/core/search/SearchEngine.java @@ -52,8 +52,9 @@ public class SearchEngine { * Returns an empty array when no token values are found. * * @param token + * ditto * @param otherTokenValues - * @return + * @return String[] */ public String[] listTokenValues(String token, Map<String, Object> otherTokenValues) { Set<String> entries = new LinkedHashSet<String>(); @@ -177,9 +178,10 @@ public class SearchEngine { * ModuleId are returned in the system namespace. * </p> * - * @param criteria + * @param moduleCrit + * ModuleId * @param matcher - * @return + * @return ModuleId[] */ public ModuleId[] listModules(ModuleId moduleCrit, PatternMatcher matcher) { List<ModuleId> ret = new ArrayList<ModuleId>(); @@ -213,9 +215,10 @@ public class SearchEngine { * ModuleRevisionId are returned in the system namespace. * </p> * - * @param criteria + * @param moduleCrit + * ModuleRevisionId * @param matcher - * @return + * @return ModuleRevisionId[] */ public ModuleRevisionId[] listModules(ModuleRevisionId moduleCrit, PatternMatcher matcher) { List<ModuleRevisionId> ret = new ArrayList<ModuleRevisionId>(); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/settings/IvySettings.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/settings/IvySettings.java b/src/java/org/apache/ivy/core/settings/IvySettings.java index b5f4849..89c68ef 100644 --- a/src/java/org/apache/ivy/core/settings/IvySettings.java +++ b/src/java/org/apache/ivy/core/settings/IvySettings.java @@ -116,7 +116,7 @@ import org.apache.ivy.util.url.URLHandlerRegistry; public class IvySettings implements SortEngineSettings, PublishEngineSettings, ParserSettings, DeliverEngineSettings, CheckEngineSettings, InstallEngineSettings, ResolverSettings, ResolveEngineSettings, RetrieveEngineSettings, RepositoryManagementEngineSettings { - private static final long INTERUPT_TIMEOUT = 2000; + private static final long INTERRUPT_TIMEOUT = 2000; private Map<String, Class<?>> typeDefs = new HashMap<String, Class<?>>(); @@ -642,7 +642,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P * Returns the variables loaded in configuration file. Those variables may better be seen as ant * properties * - * @return + * @return IvyVariableContainer */ public synchronized IvyVariableContainer getVariables() { return variableContainer; @@ -1212,7 +1212,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P * Filters the names list by removing all names that should be ignored as defined by the listing * ignore list * - * @param names + * @param names ditto */ public synchronized void filterIgnore(Collection<String> names) { names.removeAll(listingIgnore); @@ -1325,42 +1325,42 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P public synchronized boolean logModulesInUse() { String var = getVariable("ivy.log.modules.in.use"); - return var == null || Boolean.valueOf(var).booleanValue(); + return var == null || Boolean.valueOf(var); } public synchronized boolean logModuleWhenFound() { String var = getVariable("ivy.log.module.when.found"); - return var == null || Boolean.valueOf(var).booleanValue(); + return var == null || Boolean.valueOf(var); } public synchronized boolean logResolvedRevision() { String var = getVariable("ivy.log.resolved.revision"); - return var == null || Boolean.valueOf(var).booleanValue(); + return var == null || Boolean.valueOf(var); } public synchronized boolean debugConflictResolution() { if (debugConflictResolution == null) { String var = getVariable("ivy.log.conflict.resolution"); - debugConflictResolution = Boolean.valueOf(var != null - && Boolean.valueOf(var).booleanValue()); + debugConflictResolution = var != null + && Boolean.valueOf(var); } - return debugConflictResolution.booleanValue(); + return debugConflictResolution; } public synchronized boolean debugLocking() { if (debugLocking == null) { String var = getVariable("ivy.log.locking"); - debugLocking = Boolean.valueOf(var != null && Boolean.valueOf(var).booleanValue()); + debugLocking = var != null && Boolean.valueOf(var); } - return debugLocking.booleanValue(); + return debugLocking; } public synchronized boolean dumpMemoryUsage() { if (dumpMemoryUsage == null) { String var = getVariable("ivy.log.memory"); - dumpMemoryUsage = Boolean.valueOf(var != null && Boolean.valueOf(var).booleanValue()); + dumpMemoryUsage = var != null && Boolean.valueOf(var); } - return dumpMemoryUsage.booleanValue(); + return dumpMemoryUsage; } public synchronized boolean logNotConvertedExclusionRule() { @@ -1422,7 +1422,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P } public final long getInterruptTimeout() { - return INTERUPT_TIMEOUT; + return INTERRUPT_TIMEOUT; } public synchronized Collection<DependencyResolver> getResolvers() { @@ -1444,7 +1444,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P /** * Use a different variable container. * - * @param variables + * @param variables IvyVariableContainer */ public synchronized void setVariableContainer(IvyVariableContainer variables) { variableContainer = variables; @@ -1509,7 +1509,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P /** * Validates all {@link Validatable} objects in the collection. * - * @param objects + * @param values * the collection of objects to validate. * @throws IllegalStateException * if any of the objects is not valid. http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java b/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java index a40cc1c..bb9cad3 100644 --- a/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java +++ b/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java @@ -302,7 +302,7 @@ public class XmlSettingsParser extends DefaultHandler { Message.deprecated("'checkUpToDate' is deprecated, " + "use the 'overwriteMode' on the 'ivy:retrieve' task instead (" + settings + ")"); - ivy.setCheckUpToDate(Boolean.valueOf(up2d).booleanValue()); + ivy.setCheckUpToDate(Boolean.valueOf(up2d)); } String resolutionDir = (String) attributes.get("resolutionCacheDir"); if (resolutionDir != null) { @@ -310,7 +310,7 @@ public class XmlSettingsParser extends DefaultHandler { } String useOrigin = (String) attributes.get("useOrigin"); if (useOrigin != null) { - ivy.setDefaultUseOrigin(Boolean.valueOf(useOrigin).booleanValue()); + ivy.setDefaultUseOrigin(Boolean.valueOf(useOrigin)); } String cacheIvyPattern = (String) attributes.get("ivyPattern"); if (cacheIvyPattern != null) { @@ -346,18 +346,18 @@ public class XmlSettingsParser extends DefaultHandler { } String validate = (String) attributes.get("validate"); if (validate != null) { - ivy.setValidate(Boolean.valueOf(validate).booleanValue()); + ivy.setValidate(Boolean.valueOf(validate)); } String up2d = (String) attributes.get("checkUpToDate"); if (up2d != null) { Message.deprecated("'checkUpToDate' is deprecated, " + "use the 'overwriteMode' on the 'ivy:retrieve' task instead (" + settings + ")"); - ivy.setCheckUpToDate(Boolean.valueOf(up2d).booleanValue()); + ivy.setCheckUpToDate(Boolean.valueOf(up2d)); } String useRemoteConfig = (String) attributes.get("useRemoteConfig"); if (useRemoteConfig != null) { - ivy.setUseRemoteConfig(Boolean.valueOf(useRemoteConfig).booleanValue()); + ivy.setUseRemoteConfig(Boolean.valueOf(useRemoteConfig)); } String cacheIvyPattern = (String) attributes.get("cacheIvyPattern"); if (cacheIvyPattern != null) { @@ -402,7 +402,7 @@ public class XmlSettingsParser extends DefaultHandler { "bad include tag: specify file or url to include"); } else { try { - // First asume that it is an absolute URL + // First assume that it is an absolute URL settingsURL = new URL(propFilePath); } catch (MalformedURLException e) { // If that fail, it may be because it is a relative one. @@ -477,8 +477,7 @@ public class XmlSettingsParser extends DefaultHandler { String environmentPrefix = (String) attributes.get("environment"); if (propFilePath != null) { String overrideStr = (String) attributes.get("override"); - boolean override = overrideStr == null ? true : Boolean.valueOf(overrideStr) - .booleanValue(); + boolean override = (overrideStr == null) ? true : Boolean.valueOf(overrideStr); Message.verbose("loading properties: " + propFilePath); try { URL fileUrl = urlFromFileAttribute(propFilePath); @@ -506,8 +505,8 @@ public class XmlSettingsParser extends DefaultHandler { if (value == null) { throw new IllegalArgumentException("missing attribute value on property tag"); } - ivy.setVariable(name, value, override == null ? true : Boolean.valueOf(override) - .booleanValue(), isSetVar, unlessSetVar); + ivy.setVariable(name, value, (override == null) ? true : Boolean.valueOf(override), + isSetVar, unlessSetVar); } private void typedefStarted(Map attributes) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/sort/CollectionOfModulesToSort.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/sort/CollectionOfModulesToSort.java b/src/java/org/apache/ivy/core/sort/CollectionOfModulesToSort.java index c185e37..1f335b9 100644 --- a/src/java/org/apache/ivy/core/sort/CollectionOfModulesToSort.java +++ b/src/java/org/apache/ivy/core/sort/CollectionOfModulesToSort.java @@ -31,7 +31,7 @@ import org.apache.ivy.core.module.id.ModuleId; import org.apache.ivy.plugins.version.VersionMatcher; /** - * Wrap a collection of descriptores wrapped themself in ModuleInSort elements. It contains some + * Wrap a collection of descriptors wrapped themselves in ModuleInSort elements. It contains some * dedicated function to retrieve module descriptors based on dependencies descriptors.<br> * <i>This class is designed to be used internally by the ModuleDescriptorSorter.</i> */ @@ -51,7 +51,7 @@ class CollectionOfModulesToSort implements Iterable<ModuleInSort> { * @param matcher * The matcher to used to check if dependencyDescriptor match a module in this * collection - * @param nonMatchingVersionReporter + * @param nonMatchingVersionReporter ditto */ public CollectionOfModulesToSort(Collection<ModuleDescriptor> modulesToSort, VersionMatcher matcher, NonMatchingVersionReporter nonMatchingVersionReporter) { @@ -87,7 +87,7 @@ class CollectionOfModulesToSort implements Iterable<ModuleInSort> { /** * Find a matching module descriptor in the list of module to sort. * - * @param descriptor + * @param descriptor ditto * @return a ModuleDescriptor from the collection of module descriptors to sort. If none exists * returns null. */ http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/sort/ModuleInSort.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/sort/ModuleInSort.java b/src/java/org/apache/ivy/core/sort/ModuleInSort.java index f0f5556..225ee88 100644 --- a/src/java/org/apache/ivy/core/sort/ModuleInSort.java +++ b/src/java/org/apache/ivy/core/sort/ModuleInSort.java @@ -34,7 +34,8 @@ import org.apache.ivy.util.Message; * ModuleInSort can be used in only one ModuleDescriptorSorter at a time.<br> * The added fields are : <br> * <ul> - * <li><code>isSorted</code> : is true iff this module has already been added to the sorted list.</li> + * <li><code>isSorted</code> : is true iff this module has already been added to the sorted list. + * </li> * <li><code>loopElements</code> : When the module is the root of a loop (=the first element of a * loop met during the sort), <code>loopElements</code> contains all ModuleInSort of the loop * (excluding the root itself.</li> @@ -99,12 +100,12 @@ class ModuleInSort { /** * Check if a adding this element as a dependency of caller will introduce a circular - * dependency. If it is, all the elements of the loop are flaged as 'loopIntermediateElement', + * dependency. If it is, all the elements of the loop are flagged as 'loopIntermediateElement', * and the loopElements of this module (which is the root of the loop) is updated. The * depStrategy is invoked on order to report a correct circular loop message. * - * @param futurCaller - * @param depStrategy + * @param futurCaller ModuleInSort + * @param depStrategy CircularDependencyStrategy * @return true if a loop is detected. */ public boolean checkLoop(ModuleInSort futurCaller, CircularDependencyStrategy depStrategy) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/core/sort/NonMatchingVersionReporter.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/core/sort/NonMatchingVersionReporter.java b/src/java/org/apache/ivy/core/sort/NonMatchingVersionReporter.java index 5870474..d713bd6 100644 --- a/src/java/org/apache/ivy/core/sort/NonMatchingVersionReporter.java +++ b/src/java/org/apache/ivy/core/sort/NonMatchingVersionReporter.java @@ -29,7 +29,7 @@ public interface NonMatchingVersionReporter { * @param descriptor * The non matching dependency descriptor. * @param md - * The module to sort having the corect moduleID but a non matching revision + * The module to sort having the correct moduleID but a non matching revision */ public void reportNonMatchingVersion(DependencyDescriptor descriptor, ModuleDescriptor md); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java b/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java index 136a32c..c97d966 100644 --- a/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java +++ b/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java @@ -80,7 +80,7 @@ public class BundleInfoAdapter { * * @param baseUri * uri to help build the absolute url if the bundle info has a relative uri. - * @return + * @return DefaultModuleDescriptor ditto * @throws ProfileNotFoundException */ public static DefaultModuleDescriptor toModuleDescriptor(ModuleDescriptorParser parser, @@ -249,7 +249,7 @@ public class BundleInfoAdapter { try { return new URI(builder.toString()); } catch (URISyntaxException e) { - throw new RuntimeException("illformed ivy url", e); + throw new RuntimeException("ill-formed ivy url", e); } } @@ -301,8 +301,7 @@ public class BundleInfoAdapter { } ModuleRevisionId amrid = ModuleRevisionId.newInstance(org, name, branch, rev); - DefaultArtifact artifact = new DefaultArtifact(amrid, null, art, type, ext); - return artifact; + return new DefaultArtifact(amrid, null, art, type, ext); } private static void requirementAsDependency(DefaultModuleDescriptor md, BundleInfo bundleInfo, @@ -360,6 +359,7 @@ public class BundleInfoAdapter { return ModuleRevisionId.newInstance(type, name, revision); } + @SuppressWarnings("serial") public static class ProfileNotFoundException extends RuntimeException { public ProfileNotFoundException(String msg) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/osgi/core/ManifestParser.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/osgi/core/ManifestParser.java b/src/java/org/apache/ivy/osgi/core/ManifestParser.java index 2aec72f..dcac35e 100644 --- a/src/java/org/apache/ivy/osgi/core/ManifestParser.java +++ b/src/java/org/apache/ivy/osgi/core/ManifestParser.java @@ -49,12 +49,14 @@ public class ManifestParser { private static final String BUNDLE_VERSION = "Bundle-Version"; + @SuppressWarnings("unused") private static final String BUNDLE_NAME = "Bundle-Name"; private static final String BUNDLE_DESCRIPTION = "Bundle-Description"; private static final String BUNDLE_SYMBOLIC_NAME = "Bundle-SymbolicName"; + @SuppressWarnings("unused") private static final String BUNDLE_MANIFEST_VERSION = "Bundle-ManifestVersion"; private static final String BUNDLE_REQUIRED_EXECUTION_ENVIRONMENT = "Bundle-RequiredExecutionEnvironment"; @@ -73,20 +75,19 @@ public class ManifestParser { public static BundleInfo parseJarManifest(InputStream jarStream) throws IOException, ParseException { + @SuppressWarnings("resource") JarInputStream jis = new JarInputStream(jarStream); Manifest manifest = jis.getManifest(); if (manifest == null) { return null; } - BundleInfo bundleInfo = parseManifest(manifest); - return bundleInfo; + return parseManifest(manifest); } public static BundleInfo parseManifest(File manifestFile) throws IOException, ParseException { FileInputStream fis = new FileInputStream(manifestFile); try { - BundleInfo parseManifest = parseManifest(fis); - return parseManifest; + return parseManifest(fis); } finally { try { fis.close(); @@ -184,7 +185,7 @@ public class ManifestParser { parseCapability(bundleInfo, mainAttributes, EXPORT_SERVICE, BundleInfo.SERVICE_TYPE); - // handle Eclipse specific source attachement + // handle Eclipse specific source attachment String eclipseSourceBundle = mainAttributes.getValue(ECLIPSE_SOURCE_BUNDLE); if (eclipseSourceBundle != null) { bundleInfo.setSource(true); @@ -269,8 +270,8 @@ public class ManifestParser { * Ensure that the lines are not longer than 72 characters, so it can be parsed by the * {@link Manifest} class * - * @param manifest - * @return + * @param manifest ditto + * @return String */ public static String formatLines(String manifest) { StringBuffer buffer = new StringBuffer(manifest.length()); http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java b/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java index e331161..a0cc45b 100644 --- a/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java +++ b/src/java/org/apache/ivy/osgi/core/OSGiManifestParser.java @@ -20,7 +20,6 @@ package org.apache.ivy.osgi.core; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.text.ParseException; @@ -54,10 +53,8 @@ public class OSGiManifestParser implements ModuleDescriptorParser { } public boolean accept(Resource res) { - if (res == null || res.getName() == null || res.getName().trim().equals("")) { - return false; - } - return res.getName().toUpperCase(Locale.US).endsWith("MANIFEST.MF"); + return !(res == null || res.getName() == null || res.getName().trim().equals("")) + && res.getName().toUpperCase(Locale.US).endsWith("MANIFEST.MF"); } public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL, http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java b/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java index 4cdf906..aeb0b49 100644 --- a/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java +++ b/src/java/org/apache/ivy/osgi/core/OsgiLatestStrategy.java @@ -36,15 +36,8 @@ public class OsgiLatestStrategy extends ComparatorLatestStrategy { final class MridComparator implements Comparator<ModuleRevisionId> { public int compare(ModuleRevisionId o1, ModuleRevisionId o2) { - Version v1; - Version v2; - try { - v1 = new Version(o1.getRevision()); - v2 = new Version(o2.getRevision()); - } catch (ParseException e) { - throw new RuntimeException("Uncomparable versions:" + o1.getRevision() + " and " - + o2.getRevision() + " (" + e.getMessage() + ")"); - } + Version v1 = new Version(o1.getRevision()); + Version v2 = new Version(o2.getRevision()); try { return v1.compareTo(v2); } catch (RuntimeException e) { http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/6c92f32e/src/java/org/apache/ivy/osgi/core/jvm-packages.properties ---------------------------------------------------------------------- diff --git a/src/java/org/apache/ivy/osgi/core/jvm-packages.properties b/src/java/org/apache/ivy/osgi/core/jvm-packages.properties index 4aa4ec1..fb9e030 100644 --- a/src/java/org/apache/ivy/osgi/core/jvm-packages.properties +++ b/src/java/org/apache/ivy/osgi/core/jvm-packages.properties @@ -26,7 +26,7 @@ OSGi/Minimum-1.1.pkglist = OSGi/Minimum-1.2.aliases = OSGI_MINIMUM-1.2 OSGi/Minimum-1.2.pkglist = -CDC-1.0/Foundation-1.0.aliases = CDC-1.0_Foundation-1.0 +CDC-1.0/Foundation-1.0.aliases = CDC-1.0_Foundation-1.0 CDC-1.0/Foundation-1.0.pkglist = \ javax.microedition.io
