-
Notifications
You must be signed in to change notification settings - Fork 348
Minor: Fix possible NPE. #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| */ | ||
| package io.polaris.core.persistence; | ||
|
|
||
| import com.google.common.base.Preconditions; | ||
| import com.google.common.collect.ImmutableList; | ||
| import io.polaris.core.entity.PolarisEntity; | ||
| import io.polaris.core.entity.PolarisGrantRecord; | ||
|
|
@@ -45,6 +46,7 @@ public ResolvedPolarisEntity( | |
| } | ||
|
|
||
| public ResolvedPolarisEntity(EntityCacheEntry cacheEntry) { | ||
| Preconditions.checkNotNull(cacheEntry, "An entity cache can't be null."); | ||
|
||
| this.entity = PolarisEntity.of(cacheEntry.getEntity()); | ||
| this.grantRecordsAsGrantee = ImmutableList.copyOf(cacheEntry.getGrantRecordsAsGrantee()); | ||
| this.grantRecordsAsSecurable = ImmutableList.copyOf(cacheEntry.getGrantRecordsAsSecurable()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -403,7 +403,11 @@ public PolarisResolvedPathWrapper getResolvedTopLevelEntity( | |
| if (resolvedCacheEntry == null) { | ||
| return null; | ||
| } | ||
| return new PolarisResolvedPathWrapper( | ||
| List.of(getResolvedRootContainerEntity(), new ResolvedPolarisEntity(resolvedCacheEntry))); | ||
|
|
||
| ResolvedPolarisEntity resolvedRootContainerEntity = getResolvedRootContainerEntity(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like there are more calls to |
||
| return resolvedRootContainerEntity == null | ||
| ? new PolarisResolvedPathWrapper(List.of(new ResolvedPolarisEntity(resolvedCacheEntry))) | ||
| : new PolarisResolvedPathWrapper( | ||
| List.of(resolvedRootContainerEntity, new ResolvedPolarisEntity(resolvedCacheEntry))); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1320,7 +1320,7 @@ private void validateMetadataFileInTableDir( | |
| return storageInfoEntity; | ||
| } | ||
|
|
||
| private class BasePolarisViewOperations extends BaseViewOperations { | ||
| protected class BasePolarisViewOperations extends BaseViewOperations { | ||
|
||
| private final TableIdentifier identifier; | ||
| private final String fullViewName; | ||
| private FileIO viewFileIO; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.