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
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
92a3b8b
OAK-11311: Remove usage of Guava ImmutableList - oak-upgrade
reschke Dec 14, 2024
095bda6
OAK-11311: Remove usage of Guava ImmutableList - oak-upgrade
reschke Dec 14, 2024
3f48ee0
OAK-11311: Remove usage of Guava ImmutableList - oak-store-spi
reschke Dec 14, 2024
5075ce9
OAK-11311: Remove usage of Guava ImmutableList - oak-store-document -…
reschke Dec 15, 2024
fd3d69d
OAK-11311: Remove usage of Guava ImmutableList - oak-store-document
reschke Dec 16, 2024
9869b0d
OAK-11311: Remove usage of Guava ImmutableList - oak-store-document
reschke Dec 16, 2024
f9ecb61
OAK-11311: Remove usage of Guava ImmutableList - oak-authorization-cug
reschke Dec 16, 2024
ffd42cb
OAK-11311: Remove usage of Guava ImmutableList - oak-store-composite
reschke Dec 16, 2024
c2397bf
OAK-11311: Remove usage of Guava ImmutableList - oak-solr-cote
reschke Dec 16, 2024
9f20a7f
OAK-11311: Remove usage of Guava ImmutableList - oak-segment-tar
reschke Dec 16, 2024
427f3c4
OAK-11311: Remove usage of Guava ImmutableList - oak-segment-azure
reschke Dec 16, 2024
d078dea
OAK-11311: Remove usage of Guava ImmutableList - oak-security-spi - t…
reschke Dec 16, 2024
46fd54c
OAK-11311: Remove usage of Guava ImmutableList - oak-security-spi
reschke Dec 16, 2024
bde5761
Merge branch 'trunk' into OAK-11311
reschke Dec 17, 2024
ef231b9
OAK-11311: Remove usage of Guava ImmutableList - remove unintended ch…
reschke Dec 17, 2024
6385321
OAK-11311: Remove usage of Guava ImmutableList - oak-search
reschke Dec 17, 2024
e321c28
OAK-11311: Remove usage of Guava ImmutableList - oak-run-commons
reschke Dec 17, 2024
766def6
OAK-11311: Remove usage of Guava ImmutableList - oak-run-commons
reschke Dec 17, 2024
db0d499
OAK-11311: Remove usage of Guava ImmutableList - oak-run
reschke Dec 17, 2024
61c5bf5
OAK-11311: Remove usage of Guava ImmutableList - oak-query-spi
reschke Dec 17, 2024
e788bf2
Merge remote-tracking branch 'origin/trunk' into OAK-11311
reschke Dec 17, 2024
067ec3e
OAK-11311: Remove usage of Guava ImmutableList - oak-lucene
reschke Dec 19, 2024
5b2a863
OAK-11311: Remove usage of Guava ImmutableList - oak-search - remove …
reschke Dec 19, 2024
ffea376
OAK-11311: Remove usage of Guava ImmutableList - oak-store-document -…
reschke Dec 19, 2024
3b7c30a
OAK-11311: Remove usage of Guava ImmutableList - oak-security-spi - m…
reschke Dec 19, 2024
934c344
OAK-11311: Remove usage of Guava ImmutableList - oak-jcr
reschke Dec 19, 2024
1c5d4f1
OAK-11311: Remove usage of Guava ImmutableList - oak-it
reschke Dec 19, 2024
0083a8f
OAK-11311: Remove usage of Guava ImmutableList - oak-exercise
reschke Dec 19, 2024
76d6604
OAK-11311: Remove usage of Guava ImmutableList - oak-core-spi
reschke Dec 19, 2024
95c48a5
OAK-11311: Remove usage of Guava ImmutableList - oak-core tests
reschke Dec 20, 2024
0c827c3
OAK-11311: Remove usage of Guava ImmutableList - oak-core
reschke Dec 20, 2024
36b7820
OAK-11311: Remove usage of Guava ImmutableList - oak-commons
reschke Dec 20, 2024
b7b344d
OAK-11311: Remove usage of Guava ImmutableList - oak-blob-plugins
reschke Dec 20, 2024
6b71d93
OAK-11311: Remove usage of Guava ImmutableList - oak-blob-cloud
reschke Dec 20, 2024
6fc747f
OAK-11311: Remove usage of Guava ImmutableList - oak-benchmarks
reschke Dec 20, 2024
09955bd
OAK-11311: Remove usage of Guava ImmutableList - oak-authorization-pr…
reschke Dec 20, 2024
28a08b8
OAK-11311: Remove usage of Guava ImmutableList - oak-auth-external
reschke Dec 20, 2024
4670629
OAK-11311: Remove usage of Guava ImmutableList - oak-doc
reschke Dec 20, 2024
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 @@ -26,7 +26,6 @@
import javax.jcr.RepositoryException;
import javax.jcr.security.AccessControlManager;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.oak.api.Root;
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
Expand Down Expand Up @@ -171,7 +170,7 @@ public List<? extends CommitHook> getCommitHooks(@NotNull String workspaceName)
@NotNull
@Override
public List<? extends ValidatorProvider> getValidators(@NotNull String workspaceName, @NotNull Set<Principal> principals, @NotNull MoveTracker moveTracker) {
return ImmutableList.of(new CugValidatorProvider());
return List.of(new CugValidatorProvider());
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import javax.jcr.security.AccessControlManager;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.api.JackrabbitSession;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
Expand Down Expand Up @@ -73,7 +72,7 @@ public void before() throws Exception {
* - /content2 : allow everyone, deny testGroup (isolated)
*
*/
acPaths = ImmutableList.of(
acPaths = List.of(
"/content/rep:policy",
PermissionConstants.PERMISSIONS_STORE_PATH,
"/content/a/rep:cugPolicy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import javax.jcr.security.NamedAccessControlPolicy;
import javax.jcr.security.Privilege;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.guava.common.collect.ImmutableSet;
import org.apache.jackrabbit.guava.common.collect.Iterators;
import org.apache.jackrabbit.guava.common.collect.Sets;
Expand Down Expand Up @@ -171,7 +170,7 @@ public void testGetPoliciesAfterManualCreation() throws Exception {
CugPolicy cugPolicy = (CugPolicy) policies[0];
assertTrue(cugPolicy.getPrincipals().isEmpty());

cug.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of("unknownPrincipalName", EveryonePrincipal.NAME), Type.STRINGS);
cug.setProperty(REP_PRINCIPAL_NAMES, List.of("unknownPrincipalName", EveryonePrincipal.NAME), Type.STRINGS);

policies = cugAccessControlManager.getPolicies(SUPPORTED_PATH);
cugPolicy = (CugPolicy) policies[0];
Expand Down Expand Up @@ -324,7 +323,7 @@ public void testSetPolicyPersisted() throws Exception {

@Test
public void testSetInvalidPolicy() throws Exception {
List<AccessControlPolicy> invalidPolicies = ImmutableList.of(
List<AccessControlPolicy> invalidPolicies = List.of(
new AccessControlPolicy() {},
(NamedAccessControlPolicy) () -> "name",
InvalidCug.INSTANCE
Expand Down Expand Up @@ -454,7 +453,7 @@ public void testRemovePolicyMixinAlreadyRemoved() throws Exception {

@Test
public void testRemoveInvalidPolicy() throws Exception {
List<AccessControlPolicy> invalidPolicies = ImmutableList.of(
List<AccessControlPolicy> invalidPolicies = List.of(
new AccessControlPolicy() {},
(NamedAccessControlPolicy) () -> "name",
InvalidCug.INSTANCE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Set;
import javax.jcr.security.AccessControlManager;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.guava.common.collect.ImmutableSet;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
Expand Down Expand Up @@ -187,7 +186,7 @@ public void testExcludedPrincipals() {
CugConstants.PARAM_CUG_SUPPORTED_PATHS, "/content");
CugConfiguration cc = createConfiguration(params);

List<Principal> excluded = ImmutableList.of(
List<Principal> excluded = List.of(
SystemPrincipal.INSTANCE,
(AdminPrincipal) () -> "admin",
(SystemUserPrincipal) () -> "systemUser");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import javax.jcr.security.AccessControlList;
import javax.jcr.security.AccessControlManager;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.JcrConstants;
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
import org.apache.jackrabbit.oak.api.PropertyState;
Expand All @@ -41,7 +40,7 @@
public class CugContextTest extends AbstractCugTest implements NodeTypeConstants {

private static String CUG_PATH = "/content/a/rep:cugPolicy";
private static List<String> NO_CUG_PATH = ImmutableList.of(
private static List<String> NO_CUG_PATH = List.of(
"/content",
"/content/a",
"/content/rep:policy",
Expand Down Expand Up @@ -116,7 +115,7 @@ public void testDefinesLocation() {
assertTrue(CugContext.INSTANCE.definesLocation(TreeLocation.create(root, CUG_PATH)));
assertTrue(CugContext.INSTANCE.definesLocation(TreeLocation.create(root, CUG_PATH + "/" + CugConstants.REP_PRINCIPAL_NAMES)));

List<String> existingNoCug = ImmutableList.of(
List<String> existingNoCug = List.of(
"/content",
"/content/a",
"/content/rep:policy"
Expand All @@ -126,7 +125,7 @@ public void testDefinesLocation() {
assertFalse(path, CugContext.INSTANCE.definesLocation(TreeLocation.create(root, path + "/" + CugConstants.REP_PRINCIPAL_NAMES)));
}

List<String> nonExistingCug = ImmutableList.of(
List<String> nonExistingCug = List.of(
"/content/rep:cugPolicy",
UNSUPPORTED_PATH + "/rep:cugPolicy");
for (String path : nonExistingCug) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import javax.jcr.security.AccessControlList;
import javax.jcr.security.AccessControlManager;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.guava.common.collect.ImmutableSet;
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
import org.apache.jackrabbit.oak.api.CommitFailedException;
Expand Down Expand Up @@ -105,7 +104,7 @@ private PermissionProvider createPermissionProvider(Principal... principals) {

@Test
public void testRead() {
List<String> noAccess = ImmutableList.of(
List<String> noAccess = List.of(
"/", UNSUPPORTED_PATH, /* no access */
"/content/a", "/content/a/b", "/content/aa/bb", /* granted by ace, denied by cug */
"/content2" /* granted by cug only */
Expand All @@ -114,7 +113,7 @@ public void testRead() {
assertFalse(p, testRoot.getTree(p).exists());
}

List<String> readAccess = ImmutableList.of("/content", "/content/subtree", "/content/a/b/c", "/content/aa");
List<String> readAccess = List.of("/content", "/content/subtree", "/content/a/b/c", "/content/aa");
for (String p : readAccess) {
assertTrue(p, testRoot.getTree(p).exists());
}
Expand All @@ -136,7 +135,7 @@ public void testReadAcl2() throws Exception {

@Test
public void testReadCug() {
List<String> noAccess = ImmutableList.of(
List<String> noAccess = List.of(
"/content/a/rep:cugPolicy", "/content/aa/bb/rep:cugPolicy", "/content2/rep:cugPolicy"
);
for (String p : noAccess) {
Expand All @@ -156,7 +155,7 @@ public void testReadCug2() throws Exception {

@Test
public void testWrite() throws Exception {
List<String> readOnly = ImmutableList.of("/content", "/content/a/b/c");
List<String> readOnly = List.of("/content", "/content/a/b/c");
for (String p : readOnly) {
try {
Tree content = testRoot.getTree(p);
Expand All @@ -180,7 +179,7 @@ public void testWrite2() throws Exception {
assertTrue(pp.isGranted(root.getTree("/content/writeTest"), null, Permissions.ADD_NODE));
assertTrue(pp.isGranted(root.getTree("/content/a/b/c/writeTest"), null, Permissions.ADD_NODE));

List<String> paths = ImmutableList.of("/content", "/content/a/b/c");
List<String> paths = List.of("/content", "/content/a/b/c");
for (String p : paths) {
Tree content = r.getTree(p);
TreeUtil.addChild(content, "writeTest", NT_OAK_UNSTRUCTURED);
Expand All @@ -198,7 +197,7 @@ public void testWriteAcl() throws Exception {
Root r = cs.getLatestRoot();
try {
Tree tree = r.getTree("/content/a/b/c");
tree.setProperty(JCR_MIXINTYPES, ImmutableList.of(MIX_REP_CUG_MIXIN, AccessControlConstants.MIX_REP_ACCESS_CONTROLLABLE), Type.NAMES);
tree.setProperty(JCR_MIXINTYPES, List.of(MIX_REP_CUG_MIXIN, AccessControlConstants.MIX_REP_ACCESS_CONTROLLABLE), Type.NAMES);
tree.addChild(AccessControlConstants.REP_POLICY).setProperty(JCR_PRIMARYTYPE, AccessControlConstants.NT_REP_ACL, Type.NAME);
r.commit();
fail();
Expand All @@ -216,7 +215,7 @@ public void testWriteCug() throws Exception {
try {
// modify the existing cug
Tree tree = r.getTree("/content/a/rep:cugPolicy");
tree.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of(EveryonePrincipal.NAME, testGroupPrincipal.getName()), Type.STRINGS);
tree.setProperty(REP_PRINCIPAL_NAMES, List.of(EveryonePrincipal.NAME, testGroupPrincipal.getName()), Type.STRINGS);
r.commit();
fail();
} catch (CommitFailedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import javax.jcr.GuestCredentials;
import javax.jcr.Session;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.guava.common.collect.Iterables;
import org.apache.jackrabbit.oak.api.ContentSession;
import org.apache.jackrabbit.oak.api.Root;
Expand Down Expand Up @@ -88,11 +87,11 @@ public class CugPermissionProviderTest extends AbstractCugTest implements NodeTy
PATH_INCUG_MAP.put(INVALID_PATH, false);
}

private static final List<String> READABLE_PATHS = ImmutableList.of(
private static final List<String> READABLE_PATHS = List.of(
"/content/a/b/c", "/content/a/b/c/jcr:primaryType",
"/content/a/b/c/nonExisting", "/content/a/b/c/nonExisting/jcr:primaryType");

private static final List<String> NOT_READABLE_PATHS = ImmutableList.of(
private static final List<String> NOT_READABLE_PATHS = List.of(
"/", "/jcr:primaryType",
UNSUPPORTED_PATH, UNSUPPORTED_PATH + "/jcr:primaryType",
"/content", "/content/jcr:primaryType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.spi.security.authorization.cug.impl;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.JcrConstants;
import org.apache.jackrabbit.oak.api.CommitFailedException;
import org.apache.jackrabbit.oak.api.PropertyState;
Expand All @@ -37,6 +36,8 @@
import javax.jcr.nodetype.NodeDefinitionTemplate;
import javax.jcr.nodetype.NodeTypeTemplate;

import java.util.List;

import static java.util.Objects.requireNonNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -64,7 +65,7 @@ public void testChangePrimaryType() {
node = root.getTree(SUPPORTED_PATH2);
try {
node.setProperty(JcrConstants.JCR_PRIMARYTYPE, NT_REP_CUG_POLICY, Type.NAME);
node.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of(EveryonePrincipal.NAME), Type.STRINGS);
node.setProperty(REP_PRINCIPAL_NAMES, List.of(EveryonePrincipal.NAME), Type.STRINGS);
root.commit();
fail();
} catch (CommitFailedException e) {
Expand Down Expand Up @@ -118,9 +119,9 @@ public void testPropertyChangedNoCugInvolved() throws Exception {

@Test(expected = CommitFailedException.class)
public void testChangePrimaryTypeOfCug() throws Exception {
node.setProperty(JcrConstants.JCR_MIXINTYPES, ImmutableList.of(MIX_REP_CUG_MIXIN), Type.NAMES);
node.setProperty(JcrConstants.JCR_MIXINTYPES, List.of(MIX_REP_CUG_MIXIN), Type.NAMES);
Tree cug = TreeUtil.addChild(node, REP_CUG_POLICY, NT_REP_CUG_POLICY);
cug.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of(EveryonePrincipal.NAME), Type.STRINGS);
cug.setProperty(REP_PRINCIPAL_NAMES, List.of(EveryonePrincipal.NAME), Type.STRINGS);
root.commit();

try {
Expand All @@ -136,7 +137,7 @@ public void testChangePrimaryTypeOfCug() throws Exception {
@Test(expected = CommitFailedException.class)
public void testInvalidPrimaryType() throws Exception {
Tree cug = TreeUtil.addChild(node, REP_CUG_POLICY, NodeTypeConstants.NT_OAK_UNSTRUCTURED);
cug.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of(EveryonePrincipal.NAME), Type.STRINGS);
cug.setProperty(REP_PRINCIPAL_NAMES, List.of(EveryonePrincipal.NAME), Type.STRINGS);

try {
root.commit();
Expand All @@ -152,7 +153,7 @@ public void testInvalidPrimaryType() throws Exception {
@Test(expected = CommitFailedException.class)
public void testMissingMixin() throws Exception {
Tree cug = TreeUtil.addChild(node, REP_CUG_POLICY, NT_REP_CUG_POLICY);
cug.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of(EveryonePrincipal.NAME), Type.STRINGS);
cug.setProperty(REP_PRINCIPAL_NAMES, List.of(EveryonePrincipal.NAME), Type.STRINGS);

try {
root.commit();
Expand All @@ -167,9 +168,9 @@ public void testMissingMixin() throws Exception {

@Test(expected = CommitFailedException.class)
public void testRemoveMixin() throws Exception {
node.setProperty(JcrConstants.JCR_MIXINTYPES, ImmutableList.of(MIX_REP_CUG_MIXIN), Type.NAMES);
node.setProperty(JcrConstants.JCR_MIXINTYPES, List.of(MIX_REP_CUG_MIXIN), Type.NAMES);
Tree cug = TreeUtil.addChild(node, REP_CUG_POLICY, NT_REP_CUG_POLICY);
cug.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of(EveryonePrincipal.NAME), Type.STRINGS);
cug.setProperty(REP_PRINCIPAL_NAMES, List.of(EveryonePrincipal.NAME), Type.STRINGS);
root.commit();

try {
Expand All @@ -186,9 +187,9 @@ public void testRemoveMixin() throws Exception {

@Test(expected = CommitFailedException.class)
public void testCugPolicyWithDifferentName() throws Exception {
node.setProperty(JcrConstants.JCR_MIXINTYPES, ImmutableList.of(MIX_REP_CUG_MIXIN), Type.NAMES);
node.setProperty(JcrConstants.JCR_MIXINTYPES, List.of(MIX_REP_CUG_MIXIN), Type.NAMES);
Tree cug = TreeUtil.addChild(node, "anotherName", NT_REP_CUG_POLICY);
cug.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of(EveryonePrincipal.NAME), Type.STRINGS);
cug.setProperty(REP_PRINCIPAL_NAMES, List.of(EveryonePrincipal.NAME), Type.STRINGS);
try {
root.commit();
} catch (CommitFailedException e) {
Expand Down Expand Up @@ -228,7 +229,7 @@ protected Tree getTypes() {
public void testJcrNodeTypesOutsideOfSystemIsValidated() throws Exception {
Tree n = TreeUtil.addChild(node, JCR_NODE_TYPES, NT_OAK_UNSTRUCTURED);
Tree cug = TreeUtil.addChild(n, REP_CUG_POLICY, NT_REP_CUG_POLICY);
cug.setProperty(REP_PRINCIPAL_NAMES, ImmutableList.of(EveryonePrincipal.NAME), Type.STRINGS);
cug.setProperty(REP_PRINCIPAL_NAMES, List.of(EveryonePrincipal.NAME), Type.STRINGS);

try {
root.commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.jackrabbit.oak.spi.security.authorization.cug.impl;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.guava.common.collect.Iterables;
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.api.Type;
Expand All @@ -36,6 +35,7 @@
import javax.jcr.security.AccessControlManager;
import javax.jcr.security.AccessControlPolicy;
import java.util.Collections;
import java.util.List;

import static org.apache.jackrabbit.oak.commons.PathUtils.ROOT_PATH;
import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -421,7 +421,7 @@ public void testRemoveWithInvalidHiddenNestedCugEntry() throws Exception {
// cannot be relativized during the reconnect-preparation
NodeBuilder before = new MemoryNodeBuilder(getTreeProvider().asNodeState(adminSession.getLatestRoot().getTree(PathUtils.ROOT_PATH)));
NodeBuilder cugNode = before.getChildNode("content").getChildNode("rep:cugPolicy");
cugNode.setProperty(HIDDEN_NESTED_CUGS, ImmutableList.of("/nested/out/of/hierarchy", "/content/subtree"), Type.STRINGS);
cugNode.setProperty(HIDDEN_NESTED_CUGS, List.of("/nested/out/of/hierarchy", "/content/subtree"), Type.STRINGS);

NestedCugHook nch = new NestedCugHook();
nch.processCommit(before.getNodeState(), after, new CommitInfo("sid", null));
Expand All @@ -442,7 +442,7 @@ public void testRemoveWithMissingHiddenNestedCugEntry() throws Exception {
// for that very cug)
NodeBuilder after = new MemoryNodeBuilder(getTreeProvider().asNodeState(root.getTree(PathUtils.ROOT_PATH)));
NodeBuilder cugNode = after.getChildNode("content").getChildNode("rep:cugPolicy");
cugNode.setProperty(HIDDEN_NESTED_CUGS, ImmutableList.of(), Type.STRINGS);
cugNode.setProperty(HIDDEN_NESTED_CUGS, List.of(), Type.STRINGS);

NodeState before = getTreeProvider().asNodeState(adminSession.getLatestRoot().getTree(PathUtils.ROOT_PATH));

Expand All @@ -467,7 +467,7 @@ public void testRemoveWithMissingHiddenNestedCugEntry2() throws Exception {
// the nested cug of the before-state (and thus cannot clean-up the hidden structure)
NodeBuilder before = new MemoryNodeBuilder(getTreeProvider().asNodeState(adminSession.getLatestRoot().getTree(PathUtils.ROOT_PATH)));
NodeBuilder cugNode = before.getChildNode("content").getChildNode("rep:cugPolicy");
cugNode.setProperty(HIDDEN_NESTED_CUGS, ImmutableList.of(), Type.STRINGS);
cugNode.setProperty(HIDDEN_NESTED_CUGS, List.of(), Type.STRINGS);

NestedCugHook nch = new NestedCugHook();
nch.processCommit(before.getNodeState(), after, new CommitInfo("sid", null));
Expand Down Expand Up @@ -510,7 +510,7 @@ public void testRemoveWithMissingHiddenNestedCugEntryAtRootNode() throws Excepti
// the nested /content with the root node (and thus cannot clean-up the hidden structure,
// which is already 'cleaned' for that very cug)
NodeBuilder after = new MemoryNodeBuilder(getTreeProvider().asNodeState(root.getTree(PathUtils.ROOT_PATH)));
after.setProperty(HIDDEN_NESTED_CUGS, ImmutableList.of(), Type.STRINGS);
after.setProperty(HIDDEN_NESTED_CUGS, List.of(), Type.STRINGS);
after.setProperty(HIDDEN_TOP_CUG_CNT, 0);
NodeState before = getTreeProvider().asNodeState(adminSession.getLatestRoot().getTree(PathUtils.ROOT_PATH));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import javax.jcr.Session;

import org.apache.jackrabbit.guava.common.collect.ImmutableList;
import org.apache.jackrabbit.oak.api.Root;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.plugins.tree.TreeLocation;
Expand All @@ -40,7 +39,7 @@

public class NoCugTest extends AbstractCugTest {

private static final List<String> PATHS = ImmutableList.of(PathUtils.ROOT_PATH, SUPPORTED_PATH, SUPPORTED_PATH + "/subtree", SUPPORTED_PATH3, UNSUPPORTED_PATH, INVALID_PATH);
private static final List<String> PATHS = List.of(PathUtils.ROOT_PATH, SUPPORTED_PATH, SUPPORTED_PATH + "/subtree", SUPPORTED_PATH3, UNSUPPORTED_PATH, INVALID_PATH);

private CugPermissionProvider cugPermProvider;

Expand Down
Loading
Loading