do not use loadPackageFromCacheOnly from outside cache manager

This commit is contained in:
Grahame Grieve 2024-10-05 06:41:33 +08:00
parent 0a03628e97
commit 837aa319c0
2 changed files with 5 additions and 5 deletions

View File

@ -472,7 +472,7 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
* @throws IOException If the package cannot be loaded
*/
@Override
public NpmPackage loadPackageFromCacheOnly(String id, String version) throws IOException {
public NpmPackage loadPackageFromCacheOnly(String id, @Nullable String version) throws IOException {
if (!Utilities.noString(version) && version.startsWith("file:")) {
return loadPackageFromFile(id, version.substring(5));

View File

@ -518,9 +518,9 @@ public class IgLoader implements IValidationEngineLoader {
if (pi != null)
System.out.println(" ... Using version " + pi.version());
} else
pi = getPackageCacheManager().loadPackageFromCacheOnly(id, version);
pi = getPackageCacheManager().loadPackage(id, version);
if (pi == null) {
return resolvePackage(id, version, loadInContext);
throw new FHIRException("Unable to find package "+src);
} else
return loadPackage(pi, loadInContext);
}
@ -670,9 +670,9 @@ public class IgLoader implements IValidationEngineLoader {
if (pi != null)
System.out.println(" ... Using version " + pi.version());
} else
pi = getPackageCacheManager().loadPackageFromCacheOnly(id, version);
pi = getPackageCacheManager().loadPackage(id, version);
if (pi == null) {
return resolvePackageForVersion(id, version);
throw new FHIRException("Unable to resolve package "+src);
} else {
return pi.fhirVersion();
}