boolean doparse = false;
Module script = envelope.getModule();
boolean failed = false;
Iterator iter = script.getDependencies();
Address source = envelope.getAddress();
String sourcepath = source.getPathinfo();
Zone zone = source.getZone();
boolean hasPolicy = zone.getDomain().hasPolicy();
while(iter.hasNext()) {
Dependency dep = (Dependency)iter.next();
try {
Address target = dep.getAddress();
if (hasPolicy) {
String targetpath = target.getPathinfo();
if (!ImportPermission.onSameDir(sourcepath, targetpath)) {
if (!zone.checkPermission(new ImportPermission(targetpath))) {
error(dep.getLocation(), "Access denied: "+targetpath);
}
}
}
ModuleEnvelope imported = forge(target);
if (imported != null) {
boolean source_compiled = envelope.isCompiled();
boolean target_compiled = imported.isCompiled();
if (source_compiled) {
if (target_compiled) {
// check signatures
if (!imported.getDescriptor().equals(dep.getDescriptor())) {
doparse = true;
}
} else {
doparse = true;
}
} else {
// source already parsed
}
} else {
boolean report_error = true;
Address addr = dep.getAddress();
if (_notimported == null) {
_notimported = new HashSet();
_notimported.add(addr);
} else {
if (_notimported.contains(addr)) {