Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ public class PolarisResolutionManifest implements PolarisResolutionManifestCatal
// Set when resolveAll is called
private ResolverStatus primaryResolverStatus = null;

private boolean isResolveAllSucceeded() {
diagnostics.checkNotNull(
primaryResolverStatus,
"resolver_not_run_before_access",
"resolveAll() must be called before reading resolution results");
return primaryResolverStatus.getStatus() == ResolverStatus.StatusEnum.SUCCESS;
}

public PolarisResolutionManifest(
PolarisDiagnostics diagnostics,
RealmContext realmContext,
Expand Down Expand Up @@ -256,7 +264,7 @@ public Set<PolarisBaseEntity> getAllActivatedPrincipalRoleEntities() {
}

private @Nullable ResolvedPolarisEntity getResolvedRootContainerEntity() {
if (primaryResolverStatus.getStatus() != ResolverStatus.StatusEnum.SUCCESS) {
if (!isResolveAllSucceeded()) {
return null;
}
ResolvedPolarisEntity resolvedEntity =
Expand Down Expand Up @@ -327,7 +335,7 @@ public PolarisResolvedPathWrapper getResolvedPath(Object key, boolean prependRoo
key,
pathLookup);

if (primaryResolverStatus.getStatus() != ResolverStatus.StatusEnum.SUCCESS) {
if (!isResolveAllSucceeded()) {
return null;
}
int index = pathLookup.get(key);
Expand Down Expand Up @@ -394,7 +402,7 @@ public PolarisResolvedPathWrapper getResolvedTopLevelEntity(
entityType,
addedTopLevelNames);

if (primaryResolverStatus.getStatus() != ResolverStatus.StatusEnum.SUCCESS) {
if (!isResolveAllSucceeded()) {
return null;
}

Expand Down