You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by gs...@apache.org on 2007/06/08 08:31:55 UTC
svn commit: r545457 - in /incubator/ivy/core/trunk: src/etc/checkstyle/
src/java/org/apache/ivy/ src/java/org/apache/ivy/ant/
src/java/org/apache/ivy/core/sort/ src/java/org/apache/ivy/plugins/circular/
test/java/org/apache/ivy/core/sort/
Author: gscokart
Date: Fri Jun 8 01:31:53 2007
New Revision: 545457
URL: http://svn.apache.org/viewvc?view=rev&rev=545457
Log:
remove warnings during a resolve + code cleaning
Added:
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java (with props)
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SilentNonMatchingVersionReporter.java
- copied, changed from r545439, incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/DefaultNonMatchingVersionReporter.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/WarningNonMatchingVersionReporter.java (with props)
Removed:
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/DefaultNonMatchingVersionReporter.java
Modified:
incubator/ivy/core/trunk/src/etc/checkstyle/checkstyle-config
incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy14.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/AbstractCircularDependencyStrategy.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyException.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyStrategy.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/ErrorCircularDependencyStrategy.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/IgnoreCircularDependencyStrategy.java
incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/WarnCircularDependencyStrategy.java
incubator/ivy/core/trunk/test/java/org/apache/ivy/core/sort/SortTest.java
Modified: incubator/ivy/core/trunk/src/etc/checkstyle/checkstyle-config
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/etc/checkstyle/checkstyle-config?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/etc/checkstyle/checkstyle-config (original)
+++ incubator/ivy/core/trunk/src/etc/checkstyle/checkstyle-config Fri Jun 8 01:31:53 2007
@@ -61,7 +61,6 @@
<!-- Modifier Checks -->
<module name="ModifierOrder"/>
- <module name="RedundantModifier"/>
<!-- Checks for blocks -->
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java Fri Jun 8 01:31:53 2007
@@ -51,6 +51,7 @@
import org.apache.ivy.core.search.SearchEngine;
import org.apache.ivy.core.settings.IvySettings;
import org.apache.ivy.core.sort.NonMatchingVersionReporter;
+import org.apache.ivy.core.sort.SilentNonMatchingVersionReporter;
import org.apache.ivy.core.sort.SortEngine;
import org.apache.ivy.plugins.matcher.PatternMatcher;
import org.apache.ivy.plugins.repository.TransferEvent;
@@ -338,10 +339,15 @@
*
* @param moduleDescriptors
* a Collection of ModuleDescriptor to sort
+ * @param nonMatchingVersionReporter
+ * Used to report some non matching version (when a modules depends on a specific
+ * revision of an other modules present in the of modules to sort with a different
+ * revision.
* @return a List of sorted ModuleDescriptors
+ * @deprecated Use sortModuleDescriptors(Collection,NonMatchingVersionReporter)
*/
public List sortModuleDescriptors(Collection moduleDescriptors) {
- return sortEngine.sortModuleDescriptors(moduleDescriptors);
+ return sortEngine.sortModuleDescriptors(moduleDescriptors, new SilentNonMatchingVersionReporter());
}
public List sortModuleDescriptors(Collection moduleDescriptors,
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy14.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy14.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy14.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/Ivy14.java Fri Jun 8 01:31:53 2007
@@ -44,6 +44,7 @@
import org.apache.ivy.core.search.ModuleEntry;
import org.apache.ivy.core.search.OrganisationEntry;
import org.apache.ivy.core.search.RevisionEntry;
+import org.apache.ivy.core.sort.SilentNonMatchingVersionReporter;
import org.apache.ivy.plugins.matcher.PatternMatcher;
import org.apache.ivy.plugins.resolver.DependencyResolver;
import org.apache.ivy.util.filter.Filter;
@@ -459,7 +460,7 @@
}
public List sortModuleDescriptors(Collection moduleDescriptors) {
- return ivy.sortModuleDescriptors(moduleDescriptors);
+ return ivy.sortModuleDescriptors(moduleDescriptors, new SilentNonMatchingVersionReporter());
}
public List sortNodes(Collection nodes) {
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java Fri Jun 8 01:31:53 2007
@@ -36,6 +36,7 @@
import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
import org.apache.ivy.core.module.id.ModuleId;
import org.apache.ivy.core.settings.IvySettings;
+import org.apache.ivy.core.sort.WarningNonMatchingVersionReporter;
import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
import org.apache.ivy.util.Message;
import org.apache.tools.ant.BuildException;
@@ -173,7 +174,7 @@
} else {
Message.verbose("no ivy file for " + buildFile + ": ivyfile=" + ivyFile
+ ": adding it at the beginning of the path");
- Message.verbose("\t(set skipbuildwithoutivy to true if you don't want this"
+ Message.verbose("\t(set skipbuildwithoutivy to true if you don't want this"
+ " file to be added to the path)");
independent.add(buildFile);
}
@@ -214,7 +215,9 @@
mds = filterModulesFromLeaf(mds, leafModuleDescriptors);
}
- List sortedModules = ivy.sortModuleDescriptors(mds);
+ WarningNonMatchingVersionReporter nonMatchingVersionReporter =
+ new WarningNonMatchingVersionReporter();
+ List sortedModules = ivy.sortModuleDescriptors(mds, nonMatchingVersionReporter);
for (ListIterator iter = independent.listIterator(); iter.hasNext();) {
File buildFile = (File) iter.next();
Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java?view=auto&rev=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java (added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java Fri Jun 8 01:31:53 2007
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.ivy.core.sort;
+
+import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
+import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
+
+abstract class MessageBasedNonMatchingVersionReporter implements NonMatchingVersionReporter {
+
+ public void reportNonMatchingVersion(DependencyDescriptor descriptor, ModuleDescriptor md) {
+ ModuleRevisionId dependencyRevisionId = descriptor.getDependencyRevisionId();
+ ModuleRevisionId parentRevisionId = descriptor.getParentRevisionId();
+ if (parentRevisionId == null) {
+ // There are some rare case where DependencyDescriptor have no parent.
+ // This is should not be used in the SortEngine, but if it is, we
+ // show a decent trace.
+ reportMessage("Non matching revision detected when sorting. Dependency "
+ + dependencyRevisionId + " doesn't match " + md.getModuleRevisionId());
+ } else {
+ ModuleId parentModuleId = parentRevisionId.getModuleId();
+ reportMessage("Non matching revision detected when sorting. " + parentModuleId
+ + " depends on " + dependencyRevisionId + ", doesn't match "
+ + md.getModuleRevisionId());
+ }
+ }
+
+ protected abstract void reportMessage(String msg);
+
+}
Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/MessageBasedNonMatchingVersionReporter.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SilentNonMatchingVersionReporter.java (from r545439, incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/DefaultNonMatchingVersionReporter.java)
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SilentNonMatchingVersionReporter.java?view=diff&rev=545457&p1=incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/DefaultNonMatchingVersionReporter.java&r1=545439&p2=incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SilentNonMatchingVersionReporter.java&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/DefaultNonMatchingVersionReporter.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SilentNonMatchingVersionReporter.java Fri Jun 8 01:31:53 2007
@@ -17,33 +17,16 @@
*/
package org.apache.ivy.core.sort;
-import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
-import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
-import org.apache.ivy.core.module.id.ModuleId;
-import org.apache.ivy.core.module.id.ModuleRevisionId;
import org.apache.ivy.util.Message;
/**
- * A default implementation of the reporter used in the sort. The reporting is isolated here to make
- * it easier to test, and to have a place where adding different type of reporting (silent, warning,
- * exceptions)
+ * A NonMatchingVersionReporter that only print debug message.
*/
-public class DefaultNonMatchingVersionReporter implements NonMatchingVersionReporter {
-
- public void reportNonMatchingVersion(DependencyDescriptor descriptor, ModuleDescriptor md) {
- ModuleRevisionId dependencyRevisionId = descriptor.getDependencyRevisionId();
- ModuleRevisionId parentRevisionId = descriptor.getParentRevisionId();
- if (parentRevisionId == null) {
- // There are some rare case where DependencyDescriptor have no parent.
- // This is should not be used in the SortEngine, but if it is, we show a decent trace.
- Message.warn("Non matching revision detected in sort. Dependency " + dependencyRevisionId
- + " doesn't match " + md);
- } else {
- ModuleId parentModuleId = parentRevisionId.getModuleId();
- Message.warn("Non matching revision detected. " + parentModuleId + " depends on "
- + dependencyRevisionId + ", doesn't match " + md);
- }
+public class SilentNonMatchingVersionReporter extends MessageBasedNonMatchingVersionReporter
+ implements NonMatchingVersionReporter {
+ protected void reportMessage(String msg) {
+ Message.debug(msg);
}
}
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/SortEngine.java Fri Jun 8 01:31:53 2007
@@ -28,6 +28,8 @@
import org.apache.ivy.core.resolve.IvyNode;
import org.apache.ivy.core.settings.IvySettings;
import org.apache.ivy.plugins.circular.CircularDependencyException;
+import org.apache.ivy.plugins.circular.CircularDependencyStrategy;
+import org.apache.ivy.plugins.version.VersionMatcher;
public class SortEngine {
private IvySettings settings;
@@ -36,7 +38,7 @@
this.settings = settings;
}
- public List sortNodes(Collection nodes) {
+ public List sortNodes(Collection nodes) throws CircularDependencyException {
/*
* here we want to use the sort algorithm which work on module descriptors : so we first put
* dependencies on a map from descriptors to dependency, then we sort the keySet (i.e. a
@@ -59,7 +61,8 @@
n.add(node);
}
}
- List list = sortModuleDescriptors(dependenciesMap.keySet());
+ List list = sortModuleDescriptors(dependenciesMap.keySet(),
+ new SilentNonMatchingVersionReporter());
List ret = new ArrayList((int) (list.size() * 1.3 + nulls.size())); // attempt to adjust the
// size to avoid too much list resizing
for (int i = 0; i < list.size(); i++) {
@@ -78,20 +81,21 @@
*
* @param moduleDescriptors
* a Collection of ModuleDescriptor to sort
+ * @param nonMatchingVersionReporter
+ * Used to report some non matching version (when a modules depends on a specific
+ * revision of an other modules present in the of modules to sort with a different
+ * revision.
* @return a List of sorted ModuleDescriptors
* @throws CircularDependencyException
* if a circular dependency exists
*/
- public List sortModuleDescriptors(Collection moduleDescriptors)
- throws CircularDependencyException {
- return sortModuleDescriptors(moduleDescriptors, new DefaultNonMatchingVersionReporter());
- }
-
public List sortModuleDescriptors(Collection moduleDescriptors,
- NonMatchingVersionReporter nonMatchingVersionReporter) {
- ModuleDescriptorSorter sorter = new ModuleDescriptorSorter(moduleDescriptors, settings
- .getVersionMatcher(), nonMatchingVersionReporter, settings
- .getCircularDependencyStrategy());
+ NonMatchingVersionReporter nonMatchingVersionReporter)
+ throws CircularDependencyException {
+ VersionMatcher versionMatcher = settings.getVersionMatcher();
+ CircularDependencyStrategy circularDepStrategy = settings.getCircularDependencyStrategy();
+ ModuleDescriptorSorter sorter = new ModuleDescriptorSorter(moduleDescriptors,
+ versionMatcher, nonMatchingVersionReporter, circularDepStrategy);
return sorter.sortModuleDescriptors();
}
Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/WarningNonMatchingVersionReporter.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/WarningNonMatchingVersionReporter.java?view=auto&rev=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/WarningNonMatchingVersionReporter.java (added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/WarningNonMatchingVersionReporter.java Fri Jun 8 01:31:53 2007
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.ivy.core.sort;
+
+import org.apache.ivy.util.Message;
+
+/**
+ * A NonMatchingVersionReporter that raise warnings.
+ */
+public class WarningNonMatchingVersionReporter extends MessageBasedNonMatchingVersionReporter
+ implements NonMatchingVersionReporter {
+
+ protected void reportMessage(String msg) {
+ Message.warn(msg);
+ }
+
+}
Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/sort/WarningNonMatchingVersionReporter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/AbstractCircularDependencyStrategy.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/AbstractCircularDependencyStrategy.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/AbstractCircularDependencyStrategy.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/AbstractCircularDependencyStrategy.java Fri Jun 8 01:31:53 2007
@@ -18,14 +18,14 @@
package org.apache.ivy.plugins.circular;
public abstract class AbstractCircularDependencyStrategy implements CircularDependencyStrategy {
- private String _name;
+ private String name;
protected AbstractCircularDependencyStrategy(String name) {
- _name = name;
+ this.name = name;
}
public String getName() {
- return _name;
+ return this.name;
}
public String toString() {
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyException.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyException.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyException.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyException.java Fri Jun 8 01:31:53 2007
@@ -25,7 +25,7 @@
public class CircularDependencyException extends RuntimeException {
- private ModuleRevisionId[] _mrids;
+ private ModuleRevisionId[] mrids;
/**
* @param descriptors
@@ -33,11 +33,11 @@
*/
public CircularDependencyException(final ModuleRevisionId[] mrids) {
super(CircularDependencyHelper.formatMessage(mrids));
- _mrids = mrids;
+ this.mrids = mrids;
}
public ModuleRevisionId[] getPath() {
- return _mrids;
+ return this.mrids;
}
}
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyStrategy.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyStrategy.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyStrategy.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/CircularDependencyStrategy.java Fri Jun 8 01:31:53 2007
@@ -22,6 +22,6 @@
public interface CircularDependencyStrategy {
String getName();
- void handleCircularDependency(ModuleRevisionId[] mrids);
+ void handleCircularDependency(ModuleRevisionId[] mrids) throws CircularDependencyException;
}
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/ErrorCircularDependencyStrategy.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/ErrorCircularDependencyStrategy.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/ErrorCircularDependencyStrategy.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/ErrorCircularDependencyStrategy.java Fri Jun 8 01:31:53 2007
@@ -19,9 +19,10 @@
import org.apache.ivy.core.module.id.ModuleRevisionId;
-public class ErrorCircularDependencyStrategy extends AbstractCircularDependencyStrategy {
+public final class ErrorCircularDependencyStrategy extends AbstractCircularDependencyStrategy {
- private static final CircularDependencyStrategy INSTANCE = new ErrorCircularDependencyStrategy();
+ private static final CircularDependencyStrategy INSTANCE =
+ new ErrorCircularDependencyStrategy();
public static CircularDependencyStrategy getInstance() {
return INSTANCE;
@@ -31,7 +32,8 @@
super("error");
}
- public void handleCircularDependency(ModuleRevisionId[] mrids) {
+ public void handleCircularDependency(ModuleRevisionId[] mrids)
+ throws CircularDependencyException {
throw new CircularDependencyException(mrids);
}
}
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/IgnoreCircularDependencyStrategy.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/IgnoreCircularDependencyStrategy.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/IgnoreCircularDependencyStrategy.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/IgnoreCircularDependencyStrategy.java Fri Jun 8 01:31:53 2007
@@ -20,9 +20,10 @@
import org.apache.ivy.core.module.id.ModuleRevisionId;
import org.apache.ivy.util.Message;
-public class IgnoreCircularDependencyStrategy extends AbstractCircularDependencyStrategy {
+public final class IgnoreCircularDependencyStrategy extends AbstractCircularDependencyStrategy {
- private static final CircularDependencyStrategy INSTANCE = new IgnoreCircularDependencyStrategy();
+ private static final CircularDependencyStrategy INSTANCE =
+ new IgnoreCircularDependencyStrategy();
public static CircularDependencyStrategy getInstance() {
return INSTANCE;
Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/WarnCircularDependencyStrategy.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/WarnCircularDependencyStrategy.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/WarnCircularDependencyStrategy.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/circular/WarnCircularDependencyStrategy.java Fri Jun 8 01:31:53 2007
@@ -20,7 +20,7 @@
import org.apache.ivy.core.module.id.ModuleRevisionId;
import org.apache.ivy.util.Message;
-public class WarnCircularDependencyStrategy extends AbstractCircularDependencyStrategy {
+public final class WarnCircularDependencyStrategy extends AbstractCircularDependencyStrategy {
private static final CircularDependencyStrategy INSTANCE = new WarnCircularDependencyStrategy();
Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/core/sort/SortTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/core/sort/SortTest.java?view=diff&rev=545457&r1=545456&r2=545457
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/core/sort/SortTest.java (original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/core/sort/SortTest.java Fri Jun 8 01:31:53 2007
@@ -55,9 +55,9 @@
*/
protected void setUp() throws Exception {
super.setUp();
- md1 = createModuleDescriptorToSort("md1", null); // The revison is often not set in the
+ md1 = createModuleDescriptorToSort("md1", null); // The revison is often not set in the
// ivy.xml file that are ordered
- md2 = createModuleDescriptorToSort("md2", "rev2");// But somtimes they are set
+ md2 = createModuleDescriptorToSort("md2", "rev2"); // But somtimes they are set
md3 = createModuleDescriptorToSort("md3", "rev3");
md4 = createModuleDescriptorToSort("md4", "rev4");
@@ -236,13 +236,15 @@
Assert.assertEquals("reportNonMatchingVersion has not be called", 1, nbOfCall);
}
}
- NonMatchingVersionReporterMock nonMatchingVersionReporterMock = new NonMatchingVersionReporterMock();
+ NonMatchingVersionReporterMock nonMatchingVersionReporterMock =
+ new NonMatchingVersionReporterMock();
List toSort = Arrays.asList(new ModuleDescriptor[] {md4, md3, md2, md1});
ivy.sortModuleDescriptors(toSort, nonMatchingVersionReporterMock);
nonMatchingVersionReporterMock.validate();
}
- private DefaultModuleDescriptor createModuleDescriptorToSort(String moduleName, String revision) {
+ private DefaultModuleDescriptor createModuleDescriptorToSort(String moduleName,
+ String revision) {
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org", moduleName, revision);
return new DefaultModuleDescriptor(mrid, "integration", new Date());
}
@@ -283,19 +285,22 @@
StringBuffer errorMessage = new StringBuffer();
errorMessage.append("Unexpected order : \n{ ");
for (int i = 0; i < sorted.size(); i++) {
- if (i > 0)
+ if (i > 0) {
errorMessage.append(" , ");
+ }
errorMessage.append(((DefaultModuleDescriptor) sorted.get(i)).getModuleRevisionId());
}
errorMessage.append("}\nEpected : \n");
for (int i = 0; i < listOfPossibleSort.length; i++) {
DefaultModuleDescriptor[] expectedList = listOfPossibleSort[i];
- if (i > 0)
+ if (i > 0) {
errorMessage.append(" or\n");
+ }
errorMessage.append("{ ");
for (int j = 0; j < expectedList.length; j++) {
- if (j > 0)
+ if (j > 0) {
errorMessage.append(" , ");
+ }
errorMessage.append(expectedList[j].getModuleRevisionId());
}
errorMessage.append(" } ");
@@ -305,7 +310,8 @@
/** Returns a collection of lists that contains the elements a,b,c and d */
private Collection getAllLists(Object a, Object b, Object c, Object d) {
- ArrayList r = new ArrayList(24);
+ final int nbOfList = 24;
+ ArrayList r = new ArrayList(nbOfList);
r.add(Arrays.asList(new Object[] {a, b, c, d}));
r.add(Arrays.asList(new Object[] {a, b, d, c}));
r.add(Arrays.asList(new Object[] {a, c, b, d}));