~ubuntu-branches/ubuntu/trusty/ivy/trusty-proposed

« back to all changes in this revision

Viewing changes to src/java/org/apache/ivy/core/resolve/IvyNodeCallers.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-05-15 17:44:57 UTC
  • mfrom: (3.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130515174457-ogntd0vxluwalq11
Tags: 2.3.0-2
* Team upload.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
    // easily get a caller by its mrid
139
139
    private Map callersByRootConf = new HashMap();
140
140
 
141
 
    // this map contains all the module ids calling this one (including transitively) as keys
 
141
    // this map contains all the module ids calling this one (including transitively) as keys.
142
142
    // the mapped nodes (values) correspond to a direct caller from which the transitive caller
143
143
    // comes
144
144
 
266
266
    }
267
267
 
268
268
    boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Stack callersStack) {
269
 
        if (callersStack.contains(node.getId())) {
270
 
            return false;
271
 
        }
272
269
        callersStack.push(node.getId());
273
270
        try {
274
271
            Caller[] callers = getCallers(rootModuleConf);
275
272
            if (callers.length == 0) {
276
273
                return false;
277
274
            }
 
275
            boolean allUnconclusive = true;
278
276
            for (int i = 0; i < callers.length; i++) {
279
277
                if (!callers[i].canExclude()) {
280
278
                    return false;
281
279
                }
282
280
                ModuleDescriptor md = callers[i].getModuleDescriptor();
283
 
                if (!doesExclude(md, rootModuleConf, callers[i].getCallerConfigurations(),
284
 
                    callers[i].getDependencyDescriptor(), artifact, callersStack)) {
285
 
                    return false;
286
 
                }
 
281
                Boolean doesExclude = node.doesExclude(md, rootModuleConf, callers[i].getCallerConfigurations(),
 
282
                    callers[i].getDependencyDescriptor(), artifact, callersStack);
 
283
                if (doesExclude != null) {
 
284
                    if (!doesExclude.booleanValue()) {
 
285
                        return false;
 
286
                    }
 
287
                    allUnconclusive = false;
 
288
                } 
287
289
            }
288
 
            return true;
 
290
            return allUnconclusive ? false : true;
289
291
        } finally {
290
292
            callersStack.pop();
291
293
        }
292
294
    }
293
295
 
294
 
    private boolean doesExclude(ModuleDescriptor md, String rootModuleConf, String[] moduleConfs,
295
 
            DependencyDescriptor dd, Artifact artifact, Stack callersStack) {
296
 
        // artifact is excluded if it match any of the exclude pattern for this dependency...
297
 
        if (dd != null) {
298
 
            if (dd.doesExclude(moduleConfs, artifact.getId().getArtifactId())) {
299
 
                return true;
300
 
            }
301
 
        }
302
 
        if (md.doesExclude(moduleConfs, artifact.getId().getArtifactId())) {
303
 
            return true;
304
 
        }
305
 
        // ... or if it is excluded by all its callers
306
 
        IvyNode c = node.getData().getNode(md.getModuleRevisionId());
307
 
        if (c != null) {
308
 
            return c.doesCallersExclude(rootModuleConf, artifact, callersStack);
309
 
        } else {
310
 
            return false;
311
 
        }
312
 
    }
313
 
 
314
296
}