@@ -68,6 +68,14 @@ public class PolarisResolutionManifest implements PolarisResolutionManifestCatal
6868 // Set when resolveAll is called
6969 private ResolverStatus primaryResolverStatus = null ;
7070
71+ private ResolverStatus requirePrimaryResolverStatus () {
72+ diagnostics .checkNotNull (
73+ primaryResolverStatus ,
74+ "resolver_not_run_before_access" ,
75+ "resolveAll() must be called before reading resolution results" );
76+ return primaryResolverStatus ;
77+ }
78+
7179 public PolarisResolutionManifest (
7280 PolarisDiagnostics diagnostics ,
7381 RealmContext realmContext ,
@@ -256,7 +264,7 @@ public Set<PolarisBaseEntity> getAllActivatedPrincipalRoleEntities() {
256264 }
257265
258266 private @ Nullable ResolvedPolarisEntity getResolvedRootContainerEntity () {
259- if (primaryResolverStatus .getStatus () != ResolverStatus .StatusEnum .SUCCESS ) {
267+ if (requirePrimaryResolverStatus () .getStatus () != ResolverStatus .StatusEnum .SUCCESS ) {
260268 return null ;
261269 }
262270 ResolvedPolarisEntity resolvedEntity =
@@ -277,6 +285,7 @@ public PolarisResolvedPathWrapper getResolvedRootContainerEntityAsPath() {
277285
278286 public PolarisResolvedPathWrapper getResolvedReferenceCatalogEntity (
279287 boolean prependRootContainer ) {
288+ requirePrimaryResolverStatus ();
280289 // This is a server error instead of being able to legitimately return null, since this means
281290 // a callsite failed to incorporate a reference catalog into its authorization flow but is
282291 // still trying to perform operations on the (nonexistence) reference catalog.
@@ -298,6 +307,7 @@ public PolarisResolvedPathWrapper getResolvedReferenceCatalogEntity(
298307 }
299308
300309 public PolarisEntitySubType getLeafSubType (Object key ) {
310+ requirePrimaryResolverStatus ();
301311 diagnostics .check (
302312 pathLookup .containsKey (key ),
303313 "never_registered_key_for_resolved_path" ,
@@ -320,6 +330,7 @@ public PolarisEntitySubType getLeafSubType(Object key) {
320330 * "optional"
321331 */
322332 public PolarisResolvedPathWrapper getResolvedPath (Object key , boolean prependRootContainer ) {
333+ requirePrimaryResolverStatus ();
323334 diagnostics .check (
324335 pathLookup .containsKey (key ),
325336 "never_registered_key_for_resolved_path" ,
@@ -384,6 +395,7 @@ public PolarisResolvedPathWrapper getResolvedPath(
384395
385396 public PolarisResolvedPathWrapper getResolvedTopLevelEntity (
386397 String entityName , PolarisEntityType entityType ) {
398+ requirePrimaryResolverStatus ();
387399 // For now, all top-level entities will have the root container prepended so we don't have
388400 // a variation of this method that allows specifying whether to prepend the root container.
389401 diagnostics .check (
0 commit comments