if (_version != null) {
return _version;
}
if (_resourceVersionProvider != null) {
AbstractResourceVersion max = _minVersion;
for (ResourceSpec spec : specs) {
try {
AbstractResourceVersion version = _resourceVersionProvider.getVersion(spec
.getScope(), spec.getFile());
if (max == null || version.compareTo(max) > 0) {
max = version;
}
} catch (VersionException e) {
if (_requireVersion) {
throw e;