138
138
// easily get a caller by its mrid
139
139
private Map callersByRootConf = new HashMap();
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
268
268
boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Stack callersStack) {
269
if (callersStack.contains(node.getId())) {
272
269
callersStack.push(node.getId());
274
271
Caller[] callers = getCallers(rootModuleConf);
275
272
if (callers.length == 0) {
275
boolean allUnconclusive = true;
278
276
for (int i = 0; i < callers.length; i++) {
279
277
if (!callers[i].canExclude()) {
282
280
ModuleDescriptor md = callers[i].getModuleDescriptor();
283
if (!doesExclude(md, rootModuleConf, callers[i].getCallerConfigurations(),
284
callers[i].getDependencyDescriptor(), artifact, callersStack)) {
281
Boolean doesExclude = node.doesExclude(md, rootModuleConf, callers[i].getCallerConfigurations(),
282
callers[i].getDependencyDescriptor(), artifact, callersStack);
283
if (doesExclude != null) {
284
if (!doesExclude.booleanValue()) {
287
allUnconclusive = false;
290
return allUnconclusive ? false : true;
290
292
callersStack.pop();
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...
298
if (dd.doesExclude(moduleConfs, artifact.getId().getArtifactId())) {
302
if (md.doesExclude(moduleConfs, artifact.getId().getArtifactId())) {
305
// ... or if it is excluded by all its callers
306
IvyNode c = node.getData().getNode(md.getModuleRevisionId());
308
return c.doesCallersExclude(rootModuleConf, artifact, callersStack);