incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gscok...@apache.org
Subject svn commit: r542920 - in /incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor: DefaultDependencyDescriptor.java ModuleDescriptor.java
Date Wed, 30 May 2007 19:43:17 GMT
Author: gscokart
Date: Wed May 30 12:43:16 2007
New Revision: 542920

URL: http://svn.apache.org/viewvc?view=rev&rev=542920
Log:
refactor to make more visible when there is no ModuleDescriptor.

Modified:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java?view=diff&rev=542920&r1=542919&r2=542920
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
Wed May 30 12:43:16 2007
@@ -84,12 +84,8 @@
     public static DefaultDependencyDescriptor transformInstance(DependencyDescriptor dd,
NamespaceTransformer t, boolean fromSystem) {
         ModuleRevisionId transformParentId = t.transform(dd.getParentRevisionId());
         ModuleRevisionId transformMrid = t.transform(dd.getDependencyRevisionId());
-        DefaultDependencyDescriptor newdd = new DefaultDependencyDescriptor();
+        DefaultDependencyDescriptor newdd = new DefaultDependencyDescriptor(null, transformMrid,
dd.isForce(), dd.isChanging(), dd.isTransitive());
         newdd._parentId = transformParentId;
-        newdd._revId = transformMrid;
-        newdd._force = dd.isForce();
-        newdd._changing = dd.isChanging();
-        newdd._transitive = dd.isTransitive();
         String[] moduleConfs = dd.getModuleConfigurations();
         if (moduleConfs.length == 1 && "*".equals(moduleConfs[0])) {
             if (dd instanceof DefaultDependencyDescriptor) {
@@ -139,10 +135,11 @@
      * This namespace should be used to check 
      */
     private Namespace _namespace = null;
-    private ModuleDescriptor _md;
+    private final ModuleDescriptor _md;
 	private DependencyDescriptor _asSystem = this; 
     
     public DefaultDependencyDescriptor(DependencyDescriptor dd, String revision) {
+    	_md = null;
         _parentId = dd.getParentRevisionId();
         _revId = ModuleRevisionId.newInstance(dd.getDependencyRevisionId(), revision);
         _force = dd.isForce();
@@ -169,13 +166,12 @@
     }
     
     public DefaultDependencyDescriptor(ModuleRevisionId mrid, boolean force, boolean changing)
{
+    	_md = null;
         _revId = mrid;
         _force = force;
         _changing = changing;
     }
     
-    private DefaultDependencyDescriptor() {        
-    }
     
     public ModuleId getDependencyId() {
         return getDependencyRevisionId().getModuleId();

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java?view=diff&rev=542920&r1=542919&r2=542920
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java
Wed May 30 12:43:16 2007
@@ -89,6 +89,8 @@
     String[] getPublicConfigurationsNames();
     Artifact[] getArtifacts(String conf);
 	Artifact[] getAllArtifacts();
+	
+	/** @retun The dependencies of the module.  If there is no dependencies return an empty
array (non null) */
     DependencyDescriptor[] getDependencies();
     
     /**



Mime
View raw message