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 xa...@apache.org on 2007/06/05 12:02:43 UTC

svn commit: r544459 [15/36] - in /incubator/ivy/core/trunk: src/java/org/apache/ivy/ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/ src/java/org/apache/ivy/core/cache/ src/java/org/apache/ivy/core/check/ src/java/org/apache/ivy/core/deliver...

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ModuleIdMatcher.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ModuleIdMatcher.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ModuleIdMatcher.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ModuleIdMatcher.java Tue Jun  5 05:02:27 2007
@@ -20,27 +20,28 @@
 import org.apache.ivy.core.module.id.ModuleId;
 
 public class ModuleIdMatcher {
-// TODO this class should be moved out of this package
+    // TODO this class should be moved out of this package
     private Matcher _orgMatcher;
+
     private Matcher _moduleMatcher;
+
     private ModuleId _mid;
+
     private PatternMatcher _pm;
-    
+
     public ModuleIdMatcher(ModuleId mid, PatternMatcher pm) {
         _mid = mid;
         _pm = pm;
-        _orgMatcher = pm.getMatcher(
-        		mid.getOrganisation()==null?
-        				PatternMatcher.ANY_EXPRESSION
-        				:mid.getOrganisation());
+        _orgMatcher = pm.getMatcher(mid.getOrganisation() == null ? PatternMatcher.ANY_EXPRESSION
+                : mid.getOrganisation());
         _moduleMatcher = pm.getMatcher(mid.getName());
     }
-    
+
     public boolean matches(ModuleId mid) {
         return _orgMatcher.matches(mid.getOrganisation()) && _moduleMatcher.matches(mid.getName());
     }
-    
+
     public String toString() {
-        return _mid+" ("+_pm.getName()+")";
+        return _mid + " (" + _pm.getName() + ")";
     }
 }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/NoMatcher.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/NoMatcher.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/NoMatcher.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/NoMatcher.java Tue Jun  5 05:02:27 2007
@@ -20,7 +20,7 @@
 /**
  * A matcher that matches nothing.
  */
-public final /*@Immutable*/ class NoMatcher implements Matcher {
+public final/* @Immutable */class NoMatcher implements Matcher {
 
     public final static Matcher INSTANCE = new NoMatcher();
 

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/PatternMatcher.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/PatternMatcher.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/PatternMatcher.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/PatternMatcher.java Tue Jun  5 05:02:27 2007
@@ -18,10 +18,9 @@
 package org.apache.ivy.plugins.matcher;
 
 /**
- * Interface for a pattern matcher.
- * <p/>
- * The pattern matcher is the main abstraction regarding the matching of an expression. Implementation may vary
- * depending on the expression syntax handling that is desired.
+ * Interface for a pattern matcher. <p/> The pattern matcher is the main abstraction regarding the
+ * matching of an expression. Implementation may vary depending on the expression syntax handling
+ * that is desired.
  */
 public interface PatternMatcher {
 
@@ -52,21 +51,21 @@
 
     /**
      * Return the matcher for the given expression.
-     *
-     * @param expression the expression to be matched. Cannot be null ?
+     * 
+     * @param expression
+     *            the expression to be matched. Cannot be null ?
      * @return the matcher instance for the given expression. Never null.
      */
-    public /*@NotNull*/ Matcher getMatcher(/*@NotNull*/ String expression);
+    public/* @NotNull */Matcher getMatcher(/* @NotNull */String expression);
 
     /**
      * return the name of this pattern matcher
-     *
+     * 
      * @return the name of this pattern matcher. Never null.
      * @see #EXACT
      * @see #REGEXP
      * @see #GLOB
      * @see #EXACT_OR_REGEXP
      */
-    public /*@NotNull*/ String getName();
+    public/* @NotNull */String getName();
 }
-

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java Tue Jun  5 05:02:27 2007
@@ -22,19 +22,18 @@
 
 /**
  * A pattern matcher matching input using regular expressions.
- *
+ * 
  * @see Pattern
  */
-public final /*@Immutable*/ class RegexpPatternMatcher extends AbstractPatternMatcher {
+public final/* @Immutable */class RegexpPatternMatcher extends AbstractPatternMatcher {
     public static final RegexpPatternMatcher INSTANCE = new RegexpPatternMatcher();
 
     /*
-    NOTE: Regexp compiler does ~200K compilation/s
-    - If necessary look into using ThreadLocal Pattern to cut on useless object creation
-    - If expression are reused over and over a LRU cache could make sense
+     * NOTE: Regexp compiler does ~200K compilation/s - If necessary look into using ThreadLocal
+     * Pattern to cut on useless object creation - If expression are reused over and over a LRU
+     * cache could make sense
      */
 
-
     public RegexpPatternMatcher() {
         super(REGEXP);
     }
@@ -43,7 +42,7 @@
         return new RegexpMatcher(expression);
     }
 
-    private static /*@Immutable*/ class RegexpMatcher implements Matcher {
+    private static/* @Immutable */class RegexpMatcher implements Matcher {
         private Pattern _pattern;
 
         public RegexpMatcher(String expression) throws PatternSyntaxException {

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/MRIDRule.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/MRIDRule.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/MRIDRule.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/MRIDRule.java Tue Jun  5 05:02:27 2007
@@ -19,42 +19,56 @@
 
 public class MRIDRule {
     private String _org;
+
     private String _module;
+
     private String _branch;
+
     private String _rev;
+
     public MRIDRule(String org, String mod, String rev) {
         _org = org;
         _module = mod;
         _rev = rev;
     }
-    public MRIDRule() {        
+
+    public MRIDRule() {
     }
-    
+
     public String getModule() {
         return _module;
     }
+
     public void setModule(String module) {
         _module = module;
     }
+
     public String getOrg() {
         return _org;
     }
+
     public void setOrg(String org) {
         _org = org;
     }
+
     public String getRev() {
         return _rev;
     }
+
     public void setRev(String rev) {
         _rev = rev;
     }
+
     public String toString() {
-        return "[ "+_org+" "+_module+(_branch != null?" "+_branch:"")+" "+_rev+" ]";
+        return "[ " + _org + " " + _module + (_branch != null ? " " + _branch : "") + " " + _rev
+                + " ]";
+    }
+
+    public String getBranch() {
+        return _branch;
+    }
+
+    public void setBranch(String branch) {
+        _branch = branch;
     }
-	public String getBranch() {
-		return _branch;
-	}
-	public void setBranch(String branch) {
-		_branch = branch;
-	}
 }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/MRIDTransformationRule.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/MRIDTransformationRule.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/MRIDTransformationRule.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/MRIDTransformationRule.java Tue Jun  5 05:02:27 2007
@@ -26,14 +26,15 @@
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.util.Message;
 
-
 public class MRIDTransformationRule implements NamespaceTransformer {
     private static class MridRuleMatcher {
         private static final String[] TYPES = new String[] {"o", "m", "b", "r"};
+
         private Matcher[] _matchers = new Matcher[4];
-        
+
         public boolean match(MRIDRule src, ModuleRevisionId mrid) {
-            _matchers[0] = Pattern.compile(getPattern(src.getOrg())).matcher(mrid.getOrganisation());
+            _matchers[0] = Pattern.compile(getPattern(src.getOrg()))
+                    .matcher(mrid.getOrganisation());
             if (!_matchers[0].matches()) {
                 return false;
             }
@@ -42,69 +43,74 @@
                 return false;
             }
             if (mrid.getBranch() == null) {
-            	_matchers[2] = null;
+                _matchers[2] = null;
             } else {
-            	_matchers[2] =  Pattern.compile(getPattern(src.getBranch())).matcher(mrid.getBranch());
-            	if (!_matchers[2].matches()) {
-            		return false;
-            	}
+                _matchers[2] = Pattern.compile(getPattern(src.getBranch())).matcher(
+                    mrid.getBranch());
+                if (!_matchers[2].matches()) {
+                    return false;
+                }
             }
             _matchers[3] = Pattern.compile(getPattern(src.getRev())).matcher(mrid.getRevision());
             if (!_matchers[3].matches()) {
                 return false;
             }
-            
+
             return true;
         }
+
         public ModuleRevisionId apply(MRIDRule dest, ModuleRevisionId mrid) {
             String org = applyRules(dest.getOrg(), "o");
             String mod = applyRules(dest.getModule(), "m");
             String branch = applyRules(dest.getBranch(), "b");
             String rev = applyRules(dest.getRev(), "r");
-            
+
             return ModuleRevisionId.newInstance(org, mod, branch, rev, mrid.getExtraAttributes());
         }
+
         private String applyRules(String str, String type) {
             for (int i = 0; i < TYPES.length; i++) {
                 str = applyTypeRule(str, TYPES[i], type, _matchers[i]);
             }
             return str;
         }
-        
+
         private String applyTypeRule(String rule, String type, String ruleType, Matcher m) {
-        	if (m == null) {
-        		return rule;
-        	}
-            String res = rule == null ? "$"+ruleType+"0" : rule;
+            if (m == null) {
+                return rule;
+            }
+            String res = rule == null ? "$" + ruleType + "0" : rule;
             for (int i = 0; i < TYPES.length; i++) {
                 if (TYPES[i].equals(type)) {
-                    res = res.replaceAll("([^\\\\])\\$"+type, "$1\\$");
-                    res = res.replaceAll("^\\$"+type, "\\$");
+                    res = res.replaceAll("([^\\\\])\\$" + type, "$1\\$");
+                    res = res.replaceAll("^\\$" + type, "\\$");
                 } else {
-                    res = res.replaceAll("([^\\\\])\\$"+TYPES[i], "$1\\\\\\$"+TYPES[i]);
-                    res = res.replaceAll("^\\$"+TYPES[i], "\\\\\\$"+TYPES[i]);
+                    res = res.replaceAll("([^\\\\])\\$" + TYPES[i], "$1\\\\\\$" + TYPES[i]);
+                    res = res.replaceAll("^\\$" + TYPES[i], "\\\\\\$" + TYPES[i]);
                 }
             }
-            
+
             StringBuffer sb = new StringBuffer();
             m.reset();
             m.find();
             m.appendReplacement(sb, res);
 
             String str = sb.toString();
-			// null rule not replaced, let it be null 
-            if (rule == null && ("$"+ruleType+"0").equals(str)) {
-            	return null;
+            // null rule not replaced, let it be null
+            if (rule == null && ("$" + ruleType + "0").equals(str)) {
+                return null;
             }
-            
+
             return str;
         }
-        
+
         private String getPattern(String p) {
             return p == null ? ".*" : p;
         }
     }
+
     private List _src = new ArrayList();
+
     private MRIDRule _dest;
 
     public void addSrc(MRIDRule src) {
@@ -121,10 +127,11 @@
     public ModuleRevisionId transform(ModuleRevisionId mrid) {
         MridRuleMatcher matcher = new MridRuleMatcher();
         for (Iterator iter = _src.iterator(); iter.hasNext();) {
-            MRIDRule rule = (MRIDRule)iter.next();
+            MRIDRule rule = (MRIDRule) iter.next();
             if (matcher.match(rule, mrid)) {
                 ModuleRevisionId destMrid = matcher.apply(_dest, mrid);
-                Message.debug("found matching namespace rule: "+rule+". Applied "+_dest+" on "+mrid+". Transformed to "+destMrid);
+                Message.debug("found matching namespace rule: " + rule + ". Applied " + _dest
+                        + " on " + mrid + ". Transformed to " + destMrid);
                 return destMrid;
             }
         }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/NameSpaceHelper.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/NameSpaceHelper.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/NameSpaceHelper.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/NameSpaceHelper.java Tue Jun  5 05:02:27 2007
@@ -35,7 +35,8 @@
         return DefaultDependencyDescriptor.transformInstance(dd, ns);
     }
 
-    public static DependencyDescriptor transform(DependencyDescriptor dd, NamespaceTransformer t, boolean fromSystem) {
+    public static DependencyDescriptor transform(DependencyDescriptor dd, NamespaceTransformer t,
+            boolean fromSystem) {
         return DefaultDependencyDescriptor.transformInstance(dd, t, fromSystem);
     }
 
@@ -51,7 +52,8 @@
         if (md.equals(rmr.getDescriptor())) {
             return rmr;
         }
-        return new DefaultModuleRevision(rmr.getResolver(), rmr.getArtifactResolver(), md, rmr.isSearched(), rmr.isDownloaded(), rmr.getLocalMDUrl());
+        return new DefaultModuleRevision(rmr.getResolver(), rmr.getArtifactResolver(), md, rmr
+                .isSearched(), rmr.isDownloaded(), rmr.getLocalMDUrl());
     }
 
     public static Artifact transform(Artifact artifact, NamespaceTransformer t) {
@@ -62,7 +64,9 @@
         if (artifact.getModuleRevisionId().equals(mrid)) {
             return artifact;
         }
-        return new DefaultArtifact(mrid, artifact.getPublicationDate(), artifact.getName(), artifact.getType(), artifact.getExt(), artifact.getUrl(), artifact.getExtraAttributes());
+        return new DefaultArtifact(mrid, artifact.getPublicationDate(), artifact.getName(),
+                artifact.getType(), artifact.getExt(), artifact.getUrl(), artifact
+                        .getExtraAttributes());
     }
 
     public static ArtifactId transform(ArtifactId artifactId, NamespaceTransformer t) {

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/Namespace.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/Namespace.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/Namespace.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/Namespace.java Tue Jun  5 05:02:27 2007
@@ -23,20 +23,22 @@
 
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 
-
 public class Namespace {
     public static final Namespace SYSTEM_NAMESPACE;
     static {
         SYSTEM_NAMESPACE = new Namespace();
     }
-    
+
     private List _rules = new ArrayList();
+
     private String _name;
+
     private boolean _chainRules = false;
+
     private NamespaceTransformer _fromSystemTransformer = new NamespaceTransformer() {
         public ModuleRevisionId transform(ModuleRevisionId mrid) {
             for (Iterator iter = _rules.iterator(); iter.hasNext();) {
-                NamespaceRule rule = (NamespaceRule)iter.next();
+                NamespaceRule rule = (NamespaceRule) iter.next();
                 ModuleRevisionId nmrid = rule.getFromSystem().transform(mrid);
                 if (_chainRules) {
                     mrid = nmrid;
@@ -46,14 +48,16 @@
             }
             return mrid;
         }
+
         public boolean isIdentity() {
             return _rules.isEmpty();
         }
     };
+
     private NamespaceTransformer _toSystemTransformer = new NamespaceTransformer() {
         public ModuleRevisionId transform(ModuleRevisionId mrid) {
             for (Iterator iter = _rules.iterator(); iter.hasNext();) {
-                NamespaceRule rule = (NamespaceRule)iter.next();
+                NamespaceRule rule = (NamespaceRule) iter.next();
                 ModuleRevisionId nmrid = rule.getToSystem().transform(mrid);
                 if (_chainRules) {
                     mrid = nmrid;
@@ -63,11 +67,12 @@
             }
             return mrid;
         }
+
         public boolean isIdentity() {
             return _rules.isEmpty();
         }
     };
-    
+
     public void addRule(NamespaceRule rule) {
         _rules.add(rule);
     }
@@ -79,10 +84,11 @@
     public void setName(String name) {
         _name = name;
     }
-    
+
     public NamespaceTransformer getFromSystemTransformer() {
         return _fromSystemTransformer;
     }
+
     public NamespaceTransformer getToSystemTransformer() {
         return _toSystemTransformer;
     }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/NamespaceRule.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/NamespaceRule.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/NamespaceRule.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/namespace/NamespaceRule.java Tue Jun  5 05:02:27 2007
@@ -19,38 +19,47 @@
 
 public class NamespaceRule {
     private String _name;
+
     private String _description;
-    
+
     private MRIDTransformationRule _fromSystem;
+
     private MRIDTransformationRule _toSystem;
-    
+
     public MRIDTransformationRule getFromSystem() {
         return _fromSystem;
     }
+
     public void addFromsystem(MRIDTransformationRule fromSystem) {
         if (_fromSystem != null) {
             throw new IllegalArgumentException("only one fromsystem is allowed per rule");
         }
         _fromSystem = fromSystem;
     }
+
     public MRIDTransformationRule getToSystem() {
         return _toSystem;
     }
+
     public void addTosystem(MRIDTransformationRule toSystem) {
         if (_toSystem != null) {
             throw new IllegalArgumentException("only one tosystem is allowed per rule");
         }
         _toSystem = toSystem;
     }
+
     public String getDescription() {
         return _description;
     }
+
     public void setDescription(String description) {
         _description = description;
     }
+
     public String getName() {
         return _name;
     }
+
     public void setName(String name) {
         _name = name;
     }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java Tue Jun  5 05:02:27 2007
@@ -40,76 +40,90 @@
 import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.DefaultHandler;
 
-
 public abstract class AbstractModuleDescriptorParser implements ModuleDescriptorParser {
-    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL, boolean validate) throws ParseException, IOException {
+    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL,
+            boolean validate) throws ParseException, IOException {
         return parseDescriptor(ivySettings, descriptorURL, new URLResource(descriptorURL), validate);
     }
-    
+
     protected abstract static class AbstractParser extends DefaultHandler {
         private static final String DEFAULT_CONF_MAPPING = "*->*";
+
         private String _defaultConf; // used only as defaultconf, not used for
-                                     // guesssing right side part of a mapping
+
+        // guesssing right side part of a mapping
         private String _defaultConfMapping; // same as default conf but is used
-                                            // for guesssing right side part of a mapping                                    
+
+        // for guesssing right side part of a mapping
         private DefaultDependencyDescriptor _defaultConfMappingDescriptor;
+
         private Resource _res;
+
         private List _errors = new ArrayList();
+
         protected DefaultModuleDescriptor _md;
-		private ModuleDescriptorParser _parser;
-        
+
+        private ModuleDescriptorParser _parser;
+
         protected AbstractParser(ModuleDescriptorParser parser) {
-        	_parser = parser;
+            _parser = parser;
         }
-        
+
         public ModuleDescriptorParser getModuleDescriptorParser() {
-        	return _parser;
+            return _parser;
         }
-        
+
         protected void checkErrors() throws ParseException {
             if (!_errors.isEmpty()) {
                 throw new ParseException(_errors.toString(), 0);
             }
         }
-        
+
         protected void setResource(Resource res) {
             _res = res; // used for log and date only
             _md = new DefaultModuleDescriptor(_parser, res);
             _md.setLastModified(getLastModified());
         }
-        
+
         protected Resource getResource() {
             return _res;
         }
-        
+
         protected String getDefaultConfMapping() {
             return _defaultConfMapping;
         }
-        
+
         protected void setDefaultConfMapping(String defaultConf) {
             _defaultConfMapping = defaultConf;
-        }        
-        
-        
+        }
+
         protected void parseDepsConfs(String confs, DefaultDependencyDescriptor dd) {
-            parseDepsConfs(confs, dd, _defaultConfMapping != null);        
+            parseDepsConfs(confs, dd, _defaultConfMapping != null);
         }
-        protected void parseDepsConfs(String confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperande) {
-        	parseDepsConfs(confs, dd, useDefaultMappingToGuessRightOperande, true);
+
+        protected void parseDepsConfs(String confs, DefaultDependencyDescriptor dd,
+                boolean useDefaultMappingToGuessRightOperande) {
+            parseDepsConfs(confs, dd, useDefaultMappingToGuessRightOperande, true);
         }
-        protected void parseDepsConfs(String confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperande, boolean evaluateConditions) {
-        	if (confs == null) {
-        		return;
-        	}
-        	
+
+        protected void parseDepsConfs(String confs, DefaultDependencyDescriptor dd,
+                boolean useDefaultMappingToGuessRightOperande, boolean evaluateConditions) {
+            if (confs == null) {
+                return;
+            }
+
             String[] conf = confs.split(";");
             parseDepsConfs(conf, dd, useDefaultMappingToGuessRightOperande, evaluateConditions);
         }
-        protected void parseDepsConfs(String[] conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperande) {
-        	parseDepsConfs(conf, dd, useDefaultMappingToGuessRightOperande, true);
+
+        protected void parseDepsConfs(String[] conf, DefaultDependencyDescriptor dd,
+                boolean useDefaultMappingToGuessRightOperande) {
+            parseDepsConfs(conf, dd, useDefaultMappingToGuessRightOperande, true);
         }
-        protected void parseDepsConfs(String[] conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperande, boolean evaluateConditions) {
-        	replaceConfigurationWildcards(_md);
+
+        protected void parseDepsConfs(String[] conf, DefaultDependencyDescriptor dd,
+                boolean useDefaultMappingToGuessRightOperande, boolean evaluateConditions) {
+            replaceConfigurationWildcards(_md);
             for (int i = 0; i < conf.length; i++) {
                 String[] ops = conf[i].split("->");
                 if (ops.length == 1) {
@@ -120,17 +134,23 @@
                         }
                     } else {
                         for (int j = 0; j < modConfs.length; j++) {
-                            String[] depConfs = getDefaultConfMappingDescriptor().getDependencyConfigurations(modConfs[j]);
+                            String[] depConfs = getDefaultConfMappingDescriptor()
+                                    .getDependencyConfigurations(modConfs[j]);
                             if (depConfs.length > 0) {
                                 for (int k = 0; k < depConfs.length; k++) {
-                                	String mappedDependency = evaluateConditions ? evaluateCondition(depConfs[k].trim(), dd): depConfs[k].trim();
-                                	if (mappedDependency != null) {
-                                        dd.addDependencyConfiguration(modConfs[j].trim(), mappedDependency);
-                                	}
+                                    String mappedDependency = evaluateConditions ? evaluateCondition(
+                                        depConfs[k].trim(), dd)
+                                            : depConfs[k].trim();
+                                    if (mappedDependency != null) {
+                                        dd.addDependencyConfiguration(modConfs[j].trim(),
+                                            mappedDependency);
+                                    }
                                 }
                             } else {
-                                // no default mapping found for this configuration, map configuration to itself
-                                dd.addDependencyConfiguration(modConfs[j].trim(), modConfs[j].trim());
+                                // no default mapping found for this configuration, map
+                                // configuration to itself
+                                dd.addDependencyConfiguration(modConfs[j].trim(), modConfs[j]
+                                        .trim());
                             }
                         }
                     }
@@ -139,145 +159,151 @@
                     String[] depConfs = ops[1].split(",");
                     for (int j = 0; j < modConfs.length; j++) {
                         for (int k = 0; k < depConfs.length; k++) {
-                        	String mappedDependency = evaluateConditions ? evaluateCondition(depConfs[k].trim(), dd): depConfs[k].trim();
-                        	if (mappedDependency != null) {
+                            String mappedDependency = evaluateConditions ? evaluateCondition(
+                                depConfs[k].trim(), dd) : depConfs[k].trim();
+                            if (mappedDependency != null) {
                                 dd.addDependencyConfiguration(modConfs[j].trim(), mappedDependency);
-                        	}
+                            }
                         }
                     }
                 } else {
-                    addError("invalid conf "+conf[i]+" for "+dd.getDependencyRevisionId());                        
+                    addError("invalid conf " + conf[i] + " for " + dd.getDependencyRevisionId());
                 }
             }
-            
+
             if (_md.isMappingOverride()) {
-            	addExtendingConfigurations(conf, dd, useDefaultMappingToGuessRightOperande);
+                addExtendingConfigurations(conf, dd, useDefaultMappingToGuessRightOperande);
             }
         }
+
         /**
-         * Evaluate the optional condition in the given configuration, like "[org=MYORG]confX".
-         * If the condition evaluates to true, the configuration is returned, if the condition
-         * evaluatate to false, null is returned.
-         * If there are no conditions, the configuration itself is returned.
+         * Evaluate the optional condition in the given configuration, like "[org=MYORG]confX". If
+         * the condition evaluates to true, the configuration is returned, if the condition
+         * evaluatate to false, null is returned. If there are no conditions, the configuration
+         * itself is returned.
          * 
-		 * @param conf the configuration to evaluate
-		 * @param dd the dependencydescriptor to which the configuration will be added
-		 * @return the evaluated condition
-		 */
-		private String evaluateCondition(String conf, DefaultDependencyDescriptor dd) {
-			if (conf.charAt(0) != '[') {
-				return conf;
-			}
-			
-			int endConditionIndex = conf.indexOf(']');
-			if (endConditionIndex == -1) {
-				addError("invalid conf " + conf + " for " + dd.getDependencyRevisionId());
+         * @param conf
+         *            the configuration to evaluate
+         * @param dd
+         *            the dependencydescriptor to which the configuration will be added
+         * @return the evaluated condition
+         */
+        private String evaluateCondition(String conf, DefaultDependencyDescriptor dd) {
+            if (conf.charAt(0) != '[') {
+                return conf;
+            }
+
+            int endConditionIndex = conf.indexOf(']');
+            if (endConditionIndex == -1) {
+                addError("invalid conf " + conf + " for " + dd.getDependencyRevisionId());
                 return null;
-			}
-			
-			String condition = conf.substring(1, endConditionIndex);
-			
-			int notEqualIndex = condition.indexOf("!=");
-			if (notEqualIndex == -1) {
-				int equalIndex = condition.indexOf('=');
-				if (equalIndex == -1) { 
-					addError("invalid conf " + conf + " for " + dd.getDependencyRevisionId());
+            }
+
+            String condition = conf.substring(1, endConditionIndex);
+
+            int notEqualIndex = condition.indexOf("!=");
+            if (notEqualIndex == -1) {
+                int equalIndex = condition.indexOf('=');
+                if (equalIndex == -1) {
+                    addError("invalid conf " + conf + " for " + dd.getDependencyRevisionId());
                     return null;
-				}
-				
-				String leftOp = condition.substring(0, equalIndex).trim();
-				String rightOp = condition.substring(equalIndex + 1).trim();
-				
-				// allow organisation synonyms, like 'org' or 'organization'
-				if (leftOp.equals("org") || leftOp.equals("organization")) {
-					leftOp = "organisation";
-				}
-				
-				String attrValue = dd.getAttribute(leftOp);
-				if (!rightOp.equals(attrValue)) {
-					return null;
-				}
-			} else {
-				String leftOp = condition.substring(0, notEqualIndex).trim();
-				String rightOp = condition.substring(notEqualIndex + 2).trim();
-				
-				// allow organisation synonyms, like 'org' or 'organization'
-				if (leftOp.equals("org") || leftOp.equals("organization")) {
-					leftOp = "organisation";
-				}
-				
-				String attrValue = dd.getAttribute(leftOp);
-				if (rightOp.equals(attrValue)) {
-					return null;
-				}
-			}
-			
-			return conf.substring(endConditionIndex + 1);
-		}
-
-		private void addExtendingConfigurations(String[] confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperande) {
-        	for (int i = 0; i < confs.length; i++) {
-        		addExtendingConfigurations(confs[i], dd, useDefaultMappingToGuessRightOperande);
-        	}
-        }        
-        private void addExtendingConfigurations(String conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperande) {
-        	Set configsToAdd = new HashSet();
-        	Configuration[] configs = _md.getConfigurations();
-        	for (int i = 0; i < configs.length; i++) {
-        		String[] ext = configs[i].getExtends();
-        		for (int j = 0; j < ext.length; j++) {
-        			if (conf.equals(ext[j])) {
-        				String configName = configs[i].getName();
-//                		if (getDefaultConfMappingDescriptor().getDependencyConfigurations(configName).length > 0) {
-            				configsToAdd.add(configName);
-//                		} else {
-                			addExtendingConfigurations(configName, dd, useDefaultMappingToGuessRightOperande);
-//                		}
-        			}
-        		}
-        	}
-        	
-        	String[] confs = (String[]) configsToAdd.toArray(new String[configsToAdd.size()]);
-        	parseDepsConfs(confs, dd, useDefaultMappingToGuessRightOperande);
+                }
+
+                String leftOp = condition.substring(0, equalIndex).trim();
+                String rightOp = condition.substring(equalIndex + 1).trim();
+
+                // allow organisation synonyms, like 'org' or 'organization'
+                if (leftOp.equals("org") || leftOp.equals("organization")) {
+                    leftOp = "organisation";
+                }
+
+                String attrValue = dd.getAttribute(leftOp);
+                if (!rightOp.equals(attrValue)) {
+                    return null;
+                }
+            } else {
+                String leftOp = condition.substring(0, notEqualIndex).trim();
+                String rightOp = condition.substring(notEqualIndex + 2).trim();
+
+                // allow organisation synonyms, like 'org' or 'organization'
+                if (leftOp.equals("org") || leftOp.equals("organization")) {
+                    leftOp = "organisation";
+                }
+
+                String attrValue = dd.getAttribute(leftOp);
+                if (rightOp.equals(attrValue)) {
+                    return null;
+                }
+            }
+
+            return conf.substring(endConditionIndex + 1);
+        }
+
+        private void addExtendingConfigurations(String[] confs, DefaultDependencyDescriptor dd,
+                boolean useDefaultMappingToGuessRightOperande) {
+            for (int i = 0; i < confs.length; i++) {
+                addExtendingConfigurations(confs[i], dd, useDefaultMappingToGuessRightOperande);
+            }
+        }
+
+        private void addExtendingConfigurations(String conf, DefaultDependencyDescriptor dd,
+                boolean useDefaultMappingToGuessRightOperande) {
+            Set configsToAdd = new HashSet();
+            Configuration[] configs = _md.getConfigurations();
+            for (int i = 0; i < configs.length; i++) {
+                String[] ext = configs[i].getExtends();
+                for (int j = 0; j < ext.length; j++) {
+                    if (conf.equals(ext[j])) {
+                        String configName = configs[i].getName();
+                        // if
+                        // (getDefaultConfMappingDescriptor().getDependencyConfigurations(configName).length
+                        // > 0) {
+                        configsToAdd.add(configName);
+                        // } else {
+                        addExtendingConfigurations(configName, dd,
+                            useDefaultMappingToGuessRightOperande);
+                        // }
+                    }
+                }
+            }
+
+            String[] confs = (String[]) configsToAdd.toArray(new String[configsToAdd.size()]);
+            parseDepsConfs(confs, dd, useDefaultMappingToGuessRightOperande);
         }
-        
+
         protected DependencyDescriptor getDefaultConfMappingDescriptor() {
             if (_defaultConfMappingDescriptor == null) {
-                _defaultConfMappingDescriptor = new DefaultDependencyDescriptor(ModuleRevisionId.newInstance("", "", ""), false);
+                _defaultConfMappingDescriptor = new DefaultDependencyDescriptor(ModuleRevisionId
+                        .newInstance("", "", ""), false);
                 parseDepsConfs(_defaultConfMapping, _defaultConfMappingDescriptor, false, false);
             }
             return _defaultConfMappingDescriptor;
         }
-        
+
         protected void addError(String msg) {
             if (_res != null) {
-                _errors.add(msg+" in "+_res+"\n");
+                _errors.add(msg + " in " + _res + "\n");
             } else {
-                _errors.add(msg+"\n");
+                _errors.add(msg + "\n");
             }
         }
+
         public void warning(SAXParseException ex) {
-            Message.warn("xml parsing: " +
-                    getLocationString(ex)+": "+
-                    ex.getMessage());
+            Message.warn("xml parsing: " + getLocationString(ex) + ": " + ex.getMessage());
         }
-        
+
         public void error(SAXParseException ex) {
-            addError("xml parsing: " +
-                    getLocationString(ex)+": "+
-                    ex.getMessage());
+            addError("xml parsing: " + getLocationString(ex) + ": " + ex.getMessage());
         }
-        
+
         public void fatalError(SAXParseException ex) throws SAXException {
-            addError("[Fatal Error] "+
-                    getLocationString(ex)+": "+
-                    ex.getMessage());
+            addError("[Fatal Error] " + getLocationString(ex) + ": " + ex.getMessage());
         }
-        
+
         /** Returns a string of the location. */
         private String getLocationString(SAXParseException ex) {
             StringBuffer str = new StringBuffer();
-            
+
             String systemId = ex.getSystemId();
             if (systemId != null) {
                 int index = systemId.lastIndexOf('/');
@@ -291,34 +317,39 @@
             str.append(ex.getLineNumber());
             str.append(':');
             str.append(ex.getColumnNumber());
-            
+
             return str.toString();
-            
+
         } // getLocationString(SAXParseException):String
-        
+
         protected String getDefaultConf() {
-            return _defaultConfMapping != null ? _defaultConfMapping : (_defaultConf != null ? _defaultConf : DEFAULT_CONF_MAPPING);
+            return _defaultConfMapping != null ? _defaultConfMapping
+                    : (_defaultConf != null ? _defaultConf : DEFAULT_CONF_MAPPING);
         }
+
         protected void setDefaultConf(String defaultConf) {
             _defaultConf = defaultConf;
         }
+
         public ModuleDescriptor getModuleDescriptor() throws ParseException {
             checkErrors();
             return _md;
         }
+
         protected Date getDefaultPubDate() {
             return new Date(_md.getLastModified());
         }
+
         protected long getLastModified() {
             long last = getResource().getLastModified();
             if (last > 0) {
-                return  last;
+                return last;
             } else {
-                Message.debug("impossible to get date for "+getResource()+": using 'now'");
+                Message.debug("impossible to get date for " + getResource() + ": using 'now'");
                 return System.currentTimeMillis();
             }
         }
-        
+
         private void replaceConfigurationWildcards(ModuleDescriptor md) {
             Configuration[] configs = md.getConfigurations();
             for (int i = 0; i < configs.length; i++) {
@@ -326,5 +357,5 @@
             }
         }
 
-    }    
+    }
 }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParser.java Tue Jun  5 05:02:27 2007
@@ -27,20 +27,22 @@
 import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.repository.Resource;
 
-
 public interface ModuleDescriptorParser {
-    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL, boolean validate) throws ParseException, IOException;
-    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL, Resource res, boolean validate) throws ParseException, IOException;
-    
+    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL,
+            boolean validate) throws ParseException, IOException;
+
+    public ModuleDescriptor parseDescriptor(IvySettings ivySettings, URL descriptorURL,
+            Resource res, boolean validate) throws ParseException, IOException;
+
     /**
-     * Convert a module descriptor to an ivy file.
-     * 
-     * This method MUST close the given input stream when job is finished
-     * 
-     * @param is input stream with opened on original module descriptor resource
+     * Convert a module descriptor to an ivy file. This method MUST close the given input stream
+     * when job is finished
      * 
+     * @param is
+     *            input stream with opened on original module descriptor resource
      */
-    public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md) throws ParseException, IOException;
+    public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)
+            throws ParseException, IOException;
 
     public boolean accept(Resource res);
 }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java Tue Jun  5 05:02:27 2007
@@ -33,51 +33,54 @@
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.util.Message;
 
-
 public class ModuleDescriptorParserRegistry extends AbstractModuleDescriptorParser {
     private static ModuleDescriptorParserRegistry INSTANCE = new ModuleDescriptorParserRegistry();
-    
+
     public static ModuleDescriptorParserRegistry getInstance() {
         return INSTANCE;
     }
 
     private List _parsers = new LinkedList();
+
     private ModuleDescriptorParserRegistry() {
         _parsers.add(PomModuleDescriptorParser.getInstance());
         _parsers.add(XmlModuleDescriptorParser.getInstance());
     }
-    
+
     /**
      * Adds a the given parser to this registry.
      * 
-     * @param parser the parser to add
+     * @param parser
+     *            the parser to add
      */
     public void addParser(ModuleDescriptorParser parser) {
-    	/*
-    	 * The parser is added in the front of the list of parsers. This is necessary because
-    	 * the XmlModuleDescriptorParser accepts all resources!
-    	 */
-    	_parsers.add(0, parser);
+        /*
+         * The parser is added in the front of the list of parsers. This is necessary because the
+         * XmlModuleDescriptorParser accepts all resources!
+         */
+        _parsers.add(0, parser);
     }
-    
+
     public ModuleDescriptorParser[] getParsers() {
-        return (ModuleDescriptorParser[])_parsers.toArray(new ModuleDescriptorParser[_parsers.size()]);
+        return (ModuleDescriptorParser[]) _parsers.toArray(new ModuleDescriptorParser[_parsers
+                .size()]);
     }
-    
+
     public ModuleDescriptorParser getParser(Resource res) {
         for (Iterator iter = _parsers.iterator(); iter.hasNext();) {
-            ModuleDescriptorParser parser = (ModuleDescriptorParser)iter.next();
+            ModuleDescriptorParser parser = (ModuleDescriptorParser) iter.next();
             if (parser.accept(res)) {
                 return parser;
             }
         }
         return null;
-    }    
-    
-    public ModuleDescriptor parseDescriptor(IvySettings settings, URL descriptorURL, Resource res, boolean validate) throws ParseException, IOException {
+    }
+
+    public ModuleDescriptor parseDescriptor(IvySettings settings, URL descriptorURL, Resource res,
+            boolean validate) throws ParseException, IOException {
         ModuleDescriptorParser parser = getParser(res);
         if (parser == null) {
-            Message.warn("no module descriptor parser found for "+res);
+            Message.warn("no module descriptor parser found for " + res);
             return null;
         }
         return parser.parseDescriptor(settings, descriptorURL, res, validate);
@@ -87,10 +90,11 @@
         return getParser(res) != null;
     }
 
-    public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md) throws ParseException, IOException {
+    public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)
+            throws ParseException, IOException {
         ModuleDescriptorParser parser = getParser(res);
         if (parser == null) {
-            Message.warn("no module descriptor parser found for "+res);
+            Message.warn("no module descriptor parser found for " + res);
         } else {
             parser.toIvyFile(is, res, destFile, md);
         }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?view=diff&rev=544459&r1=544458&r2=544459
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java Tue Jun  5 05:02:27 2007
@@ -55,54 +55,95 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
-
 public class PomModuleDescriptorParser extends AbstractModuleDescriptorParser {
     public static final Configuration[] MAVEN2_CONFIGURATIONS = new Configuration[] {
-        new Configuration("default", Visibility.PUBLIC, "runtime dependencies and master artifact can be used with this conf", new String[] {"runtime", "master"}),
-        new Configuration("master", Visibility.PUBLIC, "contains only the artifact published by this module itself, with no transitive dependencies", new String[0]),
-        new Configuration("compile", Visibility.PUBLIC, "this is the default scope, used if none is specified. Compile dependencies are available in all classpaths.", new String[0]),
-        new Configuration("provided", Visibility.PUBLIC, "this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive.", new String[0]),
-        new Configuration("runtime", Visibility.PUBLIC, "this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.", new String[] {"compile"}),
-        new Configuration("test", Visibility.PRIVATE, "this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.", new String[0]),
-        new Configuration("system", Visibility.PUBLIC, "this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.", new String[0]),
-    };
-    private static final Configuration OPTIONAL_CONFIGURATION = new Configuration("optional", Visibility.PUBLIC, "contains all optional dependencies", new String[0]);
+            new Configuration("default", Visibility.PUBLIC,
+                    "runtime dependencies and master artifact can be used with this conf",
+                    new String[] {"runtime", "master"}),
+            new Configuration(
+                    "master",
+                    Visibility.PUBLIC,
+                    "contains only the artifact published by this module itself, with no transitive dependencies",
+                    new String[0]),
+            new Configuration(
+                    "compile",
+                    Visibility.PUBLIC,
+                    "this is the default scope, used if none is specified. Compile dependencies are available in all classpaths.",
+                    new String[0]),
+            new Configuration(
+                    "provided",
+                    Visibility.PUBLIC,
+                    "this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive.",
+                    new String[0]),
+            new Configuration(
+                    "runtime",
+                    Visibility.PUBLIC,
+                    "this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath.",
+                    new String[] {"compile"}),
+            new Configuration(
+                    "test",
+                    Visibility.PRIVATE,
+                    "this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases.",
+                    new String[0]),
+            new Configuration(
+                    "system",
+                    Visibility.PUBLIC,
+                    "this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.",
+                    new String[0]),};
+
+    private static final Configuration OPTIONAL_CONFIGURATION = new Configuration("optional",
+            Visibility.PUBLIC, "contains all optional dependencies", new String[0]);
+
     private static final Map MAVEN2_CONF_MAPPING = new HashMap();
-    
+
     static {
         MAVEN2_CONF_MAPPING.put("compile", "compile->@(*),master(*);runtime->@(*)");
-        MAVEN2_CONF_MAPPING.put("provided", "provided->compile(*),provided(*),runtime(*),master(*)");
+        MAVEN2_CONF_MAPPING
+                .put("provided", "provided->compile(*),provided(*),runtime(*),master(*)");
         MAVEN2_CONF_MAPPING.put("runtime", "runtime->compile(*),runtime(*),master(*)");
         MAVEN2_CONF_MAPPING.put("test", "test->compile(*),runtime(*),master(*)");
         MAVEN2_CONF_MAPPING.put("system", "system->master(*)");
     }
-    
+
     private static final class Parser extends AbstractParser {
         private IvySettings _settings;
+
         private Stack _contextStack = new Stack();
+
         private String _organisation;
+
         private String _module;
+
         private String _revision;
+
         private String _scope;
+
         private String _classifier;
+
         private String _type;
+
         private String _ext;
+
         private boolean _optional = false;
+
         private List _exclusions = new ArrayList();
+
         private DefaultDependencyDescriptor _dd;
+
         private Map _properties = new HashMap();
 
         public Parser(ModuleDescriptorParser parser, IvySettings settings, Resource res) {
-        	super(parser);
+            super(parser);
             _settings = settings;
             setResource(res);
             _md.setResolvedPublicationDate(new Date(res.getLastModified()));
             for (int i = 0; i < MAVEN2_CONFIGURATIONS.length; i++) {
                 _md.addConfiguration(MAVEN2_CONFIGURATIONS[i]);
-            }            
+            }
         }
 
-        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+        public void startElement(String uri, String localName, String qName, Attributes attributes)
+                throws SAXException {
             _contextStack.push(qName);
             String context = getContext();
             if ("optional".equals(qName)) {
@@ -110,17 +151,17 @@
             } else if ("project/dependencies/dependency/exclusions".equals(context)) {
                 if (_dd == null) {
                     // stores dd now cause exclusions will override org and module
-                    _dd = new DefaultDependencyDescriptor(_md, ModuleRevisionId.newInstance(_organisation, _module, _revision), true, false, true);
+                    _dd = new DefaultDependencyDescriptor(_md, ModuleRevisionId.newInstance(
+                        _organisation, _module, _revision), true, false, true);
                     _organisation = null;
                     _module = null;
                     _revision = null;
                 }
             } else if (_md.getModuleRevisionId() == null) {
-            	if ("project/dependencies".equals(context)
-            			|| "project/profiles".equals(context)
-            			|| "project/build".equals(context)) {
-            		fillMrid();
-            	}
+                if ("project/dependencies".equals(context) || "project/profiles".equals(context)
+                        || "project/build".equals(context)) {
+                    fillMrid();
+                }
             }
         }
 
@@ -144,70 +185,74 @@
             if (_type == null) {
                 _type = _ext = "jar";
             }
-            _md.addArtifact("master", new DefaultArtifact(mrid, getDefaultPubDate(),_module, _type, _ext));
+            _md.addArtifact("master", new DefaultArtifact(mrid, getDefaultPubDate(), _module,
+                    _type, _ext));
             _organisation = null;
             _module = null;
             _revision = null;
         }
-        
+
         public void endElement(String uri, String localName, String qName) throws SAXException {
-            if (_md.getModuleRevisionId() == null  && ("project".equals(getContext()))) {
-                fillMrid();                
-            } else if (((_organisation != null && _module != null && _revision != null) || _dd != null) && "project/dependencies/dependency".equals(getContext())) {
+            if (_md.getModuleRevisionId() == null && ("project".equals(getContext()))) {
+                fillMrid();
+            } else if (((_organisation != null && _module != null && _revision != null) || _dd != null)
+                    && "project/dependencies/dependency".equals(getContext())) {
                 if (_dd == null) {
-                    _dd = new DefaultDependencyDescriptor(_md, ModuleRevisionId.newInstance(_organisation, _module, _revision), true, false, true);
+                    _dd = new DefaultDependencyDescriptor(_md, ModuleRevisionId.newInstance(
+                        _organisation, _module, _revision), true, false, true);
                 }
                 _scope = _scope == null ? "compile" : _scope;
                 if (_optional && "compile".equals(_scope)) {
                     _scope = "runtime";
                 }
-                String mapping = (String)MAVEN2_CONF_MAPPING.get(_scope);
+                String mapping = (String) MAVEN2_CONF_MAPPING.get(_scope);
                 if (mapping == null) {
-                    Message.verbose("unknown scope "+_scope+" in "+getResource());
-                    mapping = (String)MAVEN2_CONF_MAPPING.get("compile");
+                    Message.verbose("unknown scope " + _scope + " in " + getResource());
+                    mapping = (String) MAVEN2_CONF_MAPPING.get("compile");
                 }
                 if (_optional) {
-                    mapping = mapping.replaceAll(_scope+"\\-\\>", "optional->");
+                    mapping = mapping.replaceAll(_scope + "\\-\\>", "optional->");
                     if (_md.getConfiguration("optional") == null) {
                         _md.addConfiguration(OPTIONAL_CONFIGURATION);
                     }
                 }
                 parseDepsConfs(mapping, _dd);
-                
+
                 if (_classifier != null) {
-                	// we deal with classifiers by setting an extra attribute and forcing the dependency to assume such an artifact is published
+                    // we deal with classifiers by setting an extra attribute and forcing the
+                    // dependency to assume such an artifact is published
                     Map extraAtt = new HashMap();
                     extraAtt.put("classifier", _classifier);
                     String[] confs = _dd.getModuleConfigurations();
                     for (int i = 0; i < confs.length; i++) {
-                    	_dd.addDependencyArtifact(
-                    			confs[i], 
-                    			new DefaultDependencyArtifactDescriptor(
-                    					_dd.getDependencyId().getName(),
-                    					"jar", 
-                    					"jar", // here we have to assume a type and ext for the artifact, so this is a limitation compared to how m2 behave with classifiers
-                    					null,
-                    					extraAtt));
+                        _dd.addDependencyArtifact(confs[i],
+                            new DefaultDependencyArtifactDescriptor(
+                                    _dd.getDependencyId().getName(), "jar", "jar", // here we have
+                                    // to assume a
+                                    // type
+                                    // and ext for the artifact, so
+                                    // this is a limitation compared
+                                    // to how m2 behave with
+                                    // classifiers
+                                    null, extraAtt));
                     }
                 }
                 for (Iterator iter = _exclusions.iterator(); iter.hasNext();) {
-                    ModuleId mid = (ModuleId)iter.next();
+                    ModuleId mid = (ModuleId) iter.next();
                     String[] confs = _dd.getModuleConfigurations();
                     for (int i = 0; i < confs.length; i++) {
-                        _dd.addExcludeRule(confs[i], 
-                        		new DefaultExcludeRule(
-                        				new ArtifactId(
-                        						mid, 
-                        						PatternMatcher.ANY_EXPRESSION, 
-                        						PatternMatcher.ANY_EXPRESSION, 
-                        						PatternMatcher.ANY_EXPRESSION), 
-                						ExactPatternMatcher.INSTANCE,
-                						null));
+                        _dd
+                                .addExcludeRule(confs[i], new DefaultExcludeRule(new ArtifactId(
+                                        mid, PatternMatcher.ANY_EXPRESSION,
+                                        PatternMatcher.ANY_EXPRESSION,
+                                        PatternMatcher.ANY_EXPRESSION),
+                                        ExactPatternMatcher.INSTANCE, null));
                     }
                 }
                 _md.addDependency(_dd);
                 _dd = null;
-            } else if ((_organisation != null && _module != null) && "project/dependencies/dependency/exclusions/exclusion".equals(getContext())) {
+            } else if ((_organisation != null && _module != null)
+                    && "project/dependencies/dependency/exclusions/exclusion".equals(getContext())) {
                 _exclusions.add(new ModuleId(_organisation, _module));
                 _organisation = null;
                 _module = null;
@@ -223,38 +268,40 @@
             }
             _contextStack.pop();
         }
-        
+
         public void characters(char[] ch, int start, int length) throws SAXException {
-            String txt = IvyPatternHelper.substituteVariables(new String(ch, start, length).trim(), _properties);
+            String txt = IvyPatternHelper.substituteVariables(new String(ch, start, length).trim(),
+                _properties);
             if (txt.trim().length() == 0) {
-            	return;
+                return;
             }
             String context = getContext();
             if (context.equals("project/parent/groupId") && _organisation == null) {
-            	_organisation = txt;
+                _organisation = txt;
                 return;
             }
             if (context.equals("project/parent/version") && _revision == null) {
-            	_revision = txt;
+                _revision = txt;
                 return;
             }
             if (context.equals("project/parent/packaging") && _type == null) {
-            	_type = txt;
-	        _ext = txt;
+                _type = txt;
+                _ext = txt;
                 return;
             }
             if (context.startsWith("project/parent")) {
                 return;
             }
             if (_md.getModuleRevisionId() == null
-            		 || context.startsWith("project/dependencies/dependency")) {
+                    || context.startsWith("project/dependencies/dependency")) {
                 if (context.equals("project/groupId")) {
                     _organisation = txt;
                 } else if (_organisation == null && context.endsWith("groupId")) {
-                	_organisation = txt;
+                    _organisation = txt;
                 } else if (_module == null && context.endsWith("artifactId")) {
                     _module = txt;
-                } else if (context.equals("project/version") || (_revision == null && context.endsWith("version"))) {
+                } else if (context.equals("project/version")
+                        || (_revision == null && context.endsWith("version"))) {
                     _revision = txt;
                 } else if (_revision == null && context.endsWith("version")) {
                     _revision = txt;
@@ -264,15 +311,15 @@
                 } else if (_scope == null && context.endsWith("scope")) {
                     _scope = txt;
                 } else if (_classifier == null && context.endsWith("dependency/classifier")) {
-                	_classifier = txt;
+                    _classifier = txt;
                 }
             }
         }
-        
+
         private String getContext() {
             StringBuffer buf = new StringBuffer();
             for (Iterator iter = _contextStack.iterator(); iter.hasNext();) {
-                String ctx = (String)iter.next();
+                String ctx = (String) iter.next();
                 buf.append(ctx).append("/");
             }
             if (buf.length() > 0) {
@@ -290,43 +337,47 @@
     }
 
     private static PomModuleDescriptorParser INSTANCE = new PomModuleDescriptorParser();
-    
+
     public static PomModuleDescriptorParser getInstance() {
         return INSTANCE;
     }
-    
+
     private PomModuleDescriptorParser() {
-        
+
     }
 
-    public ModuleDescriptor parseDescriptor(IvySettings settings, URL descriptorURL, Resource res, boolean validate) throws ParseException, IOException {
+    public ModuleDescriptor parseDescriptor(IvySettings settings, URL descriptorURL, Resource res,
+            boolean validate) throws ParseException, IOException {
         Parser parser = new Parser(this, settings, res);
         try {
             XMLHelper.parse(descriptorURL, null, parser);
         } catch (SAXException ex) {
-            ParseException pe = new ParseException(ex.getMessage()+" in "+descriptorURL, 0);
+            ParseException pe = new ParseException(ex.getMessage() + " in " + descriptorURL, 0);
             pe.initCause(ex);
             throw pe;
         } catch (ParserConfigurationException ex) {
-            IllegalStateException ise = new IllegalStateException(ex.getMessage()+" in "+descriptorURL);
+            IllegalStateException ise = new IllegalStateException(ex.getMessage() + " in "
+                    + descriptorURL);
             ise.initCause(ex);
             throw ise;
         }
         return parser.getDescriptor();
     }
 
-    public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md) throws ParseException, IOException {
-    	try {
-    		XmlModuleDescriptorWriter.write(md, destFile);
-    	} finally {
-    		if (is != null) {
-    			is.close();
-    		}
-    	}
+    public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)
+            throws ParseException, IOException {
+        try {
+            XmlModuleDescriptorWriter.write(md, destFile);
+        } finally {
+            if (is != null) {
+                is.close();
+            }
+        }
     }
 
     public boolean accept(Resource res) {
-        return res.getName().endsWith(".pom") || res.getName().endsWith("pom.xml") || res.getName().endsWith("project.xml");
+        return res.getName().endsWith(".pom") || res.getName().endsWith("pom.xml")
+                || res.getName().endsWith("project.xml");
     }
 
     public String toString() {