}
if (cycleStart != -1 && cycleEnd != -1) {
ArrayList<IConnector> cyclePath = new ArrayList<IConnector>(cycleEnd - cycleStart + 1);
// mark cycle
for (int i = cycleStart; i <= cycleEnd; i++) {
IConnector inCycleConnector = subPath.get(i);
inCycleConnector.setInCycle(true);
cyclePath.add(inCycleConnector);
}
Status status = new Status(IStatus.WARNING, Activator.PLUGIN_ID, "Cycle found : " + cyclePath
+ " as subset of path : " + subPath);
LOGGER.log(status);
continue;
}
// -- VERSION 2 : End cycle detection as subset of path --
if (connectorTarget.equals(dst)) {
// Path from src to dst is found
allPath.add(subPath);
continue;
} else {
// Simulate recursive function call.
MemoPoint mp = new MemoPoint(connectorTarget, subPath, compressedSubPath);
stack.push(mp);
}
} else {
// CYCLE FOUND = subPath
Status status = new Status(IStatus.WARNING, Activator.PLUGIN_ID, "Cycle found in path : " + subPath);
LOGGER.log(status);
for (IConnector inCycleConnector : subPath) {
inCycleConnector.setInCycle(true);
}
continue;
}
}
}