Code with Misuse: |
class ZargoFilePersister { /* * @see org.argouml.persistence.ProjectFilePersister#doLoad(java.io.File) */ @Override public Project doLoad(File file) throws OpenException, InterruptedException { ProgressMgr progressMgr = new ProgressMgr(); progressMgr.setNumberOfPhases(3 + UML_PHASES_LOAD); ThreadUtils.checkIfInterrupted();
int fileVersion; String releaseVersion; try { String argoEntry = getEntryNames(file, ".argo").iterator().next(); URL argoUrl = makeZipEntryUrl(toURL(file), argoEntry); fileVersion = getPersistenceVersion(argoUrl.openStream()); releaseVersion = getReleaseVersion(argoUrl.openStream()); } catch (MalformedURLException e) { throw new OpenException(e); } catch (IOException e) { throw new OpenException(e); }
// TODO: The commented code below was commented out by Bob Tarling // in order to resolve bugs 4845 and 4857. Hopefully we can // determine the cause and reintroduce. //boolean upgradeRequired = !checkVersion(fileVersion, releaseVersion) boolean upgradeRequired = true; LOG.info("Loading zargo file of version " + fileVersion); final Project p; if (upgradeRequired) { File combinedFile = zargoToUml(file, progressMgr); p = super.doLoad(file, combinedFile, progressMgr); } else { p = loadFromZargo(file, progressMgr); }
progressMgr.nextPhase();
p.setURI(file.toURI()); return p;
}
}
|