Skip to content
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

OAK-11311: Remove usage of Guava ImmutableList #1909

Closed
wants to merge 38 commits into from
Closed

Conversation

reschke
Copy link
Contributor

@reschke reschke commented Dec 17, 2024

Ready for review.

@reschke reschke marked this pull request as draft December 17, 2024 09:16
@@ -86,7 +86,7 @@ public static Set<String> getChildNodeNames(Collection<String> keys, Matcher mat
int expectedDepth = matcher.depth() + 1;

for (String key : keys){
List<String> elements = ImmutableList.copyOf(PathUtils.elements(key));
List<String> elements = CollectionUtils.toList(PathUtils.elements(key));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collections.unmodifiableList miss or intended ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it's clearly ok.

@reschke
Copy link
Contributor Author

reschke commented Dec 18, 2024

I will review all of these once I'm done with the next module - FWIW, none of these changes cause tests to fail.

@reschke reschke marked this pull request as ready for review December 20, 2024 15:51
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
73.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

List<String> builder = new ArrayList<>();
builder.add(MongoUtils.URL);
builder.addAll(Arrays.asList(args));
this.args = Collections.unmodifiableList(builder);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for Collections.unmodifiableList in test class.

@@ -161,7 +159,8 @@ public void orToUnions() throws RepositoryException, CommitFailedException {
statement = String.format(
"SELECT * FROM [%s] WHERE (p = 'a' AND p1 = 'a1') OR (p = 'b' AND p1 = 'b1')",
NT_OAK_UNSTRUCTURED);
expected = of("/test/a", "/test/b");
expected = List.of("/test/a", "/test/b");
expected = List.of("/test/a", "/test/b");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeat of above line.

@@ -239,14 +239,13 @@ boolean reverseOrder() {
List<AggregatedPermissionProvider> getAggregatedProviders(@NotNull String workspaceName,
@NotNull AuthorizationConfiguration config,
@NotNull Set<Principal> principals) {
ImmutableList<AggregatedPermissionProvider> l = ImmutableList.of(
List<AggregatedPermissionProvider> l = new ArrayList<>(List.of(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List<AggregatedPermissionProvider> l = new ArrayList<>(List.of(
List<AggregatedPermissionProvider> l = Stream.of((AggregatedPermissionProvider) config.getPermissionProvider(root, workspaceName, principals),
getTestPermissionProvider()).collect(Collectors.toList());

@@ -36,6 +37,7 @@
import org.jetbrains.annotations.Nullable;
import org.junit.Test;


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert this.

@reschke reschke marked this pull request as draft December 22, 2024 09:41
@reschke reschke closed this Dec 22, 2024
@reschke reschke deleted the OAK-11311 branch December 22, 2024 10:43
@reschke reschke restored the OAK-11311 branch December 22, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants