You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "rishabhdaim (via GitHub)" <gi...@apache.org> on 2024/12/30 08:17:15 UTC
[PR] OAK-11324 : removed usage of Guava's Sets.symmetricDifference [jackrabbit-oak]
rishabhdaim opened a new pull request, #1924:
URL: https://github.com/apache/jackrabbit-oak/pull/1924
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11324 : removed usage of Guava's Sets.symmetricDifference [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #1924:
URL: https://github.com/apache/jackrabbit-oak/pull/1924#discussion_r1899368882
##########
oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/collections/CollectionUtilsTest.java:
##########
@@ -308,6 +308,68 @@ public void testIntersectionWithNoCommonElements() {
Assert.assertEquals(Collections.EMPTY_SET, CollectionUtils.intersection(set1, set2));
}
+ @Test
+ public void testSymmetricDifferenceWithNonEmptySets() {
+ final Set<String> set1 = Set.of("a", "b", "c");
+ final Set<String> set2 = Set.of("b", "c", "d");
+
+ final Set<String> result = CollectionUtils.symmetricDifference(set1, set2);
+
+ final Set<String> expected = Set.of("a", "d");
+ Assert.assertEquals(expected, result);
+ }
+
+ @Test
+ public void testSymmetricDifferenceWithEmptySet() {
+ final Set<String> set1 = Set.of("a", "b", "c");
+ final Set<String> set2 = new HashSet<>();
Review Comment:
```suggestion
final Set<String> set2 = Set.of();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11324 : removed usage of Guava's Sets.symmetricDifference [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim merged PR #1924:
URL: https://github.com/apache/jackrabbit-oak/pull/1924
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11324 : removed usage of Guava's Sets.symmetricDifference [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1924:
URL: https://github.com/apache/jackrabbit-oak/pull/1924#issuecomment-2565302888
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11324 : removed usage of Guava's Sets.symmetricDifference [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim commented on code in PR #1924:
URL: https://github.com/apache/jackrabbit-oak/pull/1924#discussion_r1899373726
##########
oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/collections/CollectionUtilsTest.java:
##########
@@ -308,6 +308,68 @@ public void testIntersectionWithNoCommonElements() {
Assert.assertEquals(Collections.EMPTY_SET, CollectionUtils.intersection(set1, set2));
}
+ @Test
+ public void testSymmetricDifferenceWithNonEmptySets() {
+ final Set<String> set1 = Set.of("a", "b", "c");
+ final Set<String> set2 = Set.of("b", "c", "d");
+
+ final Set<String> result = CollectionUtils.symmetricDifference(set1, set2);
+
+ final Set<String> expected = Set.of("a", "d");
+ Assert.assertEquals(expected, result);
+ }
+
+ @Test
+ public void testSymmetricDifferenceWithEmptySet() {
+ final Set<String> set1 = Set.of("a", "b", "c");
+ final Set<String> set2 = new HashSet<>();
Review Comment:
done in https://github.com/apache/jackrabbit-oak/pull/1924/commits/78590cb471e03f626fd91f904dd507171759090b
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11324 : removed usage of Guava's Sets.symmetricDifference [jackrabbit-oak]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #1924:
URL: https://github.com/apache/jackrabbit-oak/pull/1924#issuecomment-2565330902
## [](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=org.apache.jackrabbit%3Ajackrabbit-oak&pullRequest=1924)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11324 : removed usage of Guava's Sets.symmetricDifference [jackrabbit-oak]
Posted by "rishabhdaim (via GitHub)" <gi...@apache.org>.
rishabhdaim commented on code in PR #1924:
URL: https://github.com/apache/jackrabbit-oak/pull/1924#discussion_r1899373848
##########
oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/collections/CollectionUtilsTest.java:
##########
@@ -308,6 +308,68 @@ public void testIntersectionWithNoCommonElements() {
Assert.assertEquals(Collections.EMPTY_SET, CollectionUtils.intersection(set1, set2));
}
+ @Test
+ public void testSymmetricDifferenceWithNonEmptySets() {
+ final Set<String> set1 = Set.of("a", "b", "c");
+ final Set<String> set2 = Set.of("b", "c", "d");
+
+ final Set<String> result = CollectionUtils.symmetricDifference(set1, set2);
+
+ final Set<String> expected = Set.of("a", "d");
+ Assert.assertEquals(expected, result);
+ }
+
+ @Test
+ public void testSymmetricDifferenceWithEmptySet() {
+ final Set<String> set1 = Set.of("a", "b", "c");
+ final Set<String> set2 = new HashSet<>();
+
+ final Set<String> result = CollectionUtils.symmetricDifference(set1, set2);
+
+ final Set<String> expected = Set.of("a", "b", "c");
+ Assert.assertEquals(expected, result);
+ }
+
+ @Test
+ public void testSymmetricDifferenceWithBothEmptySets() {
+ final Set<String> set1 = new HashSet<>();
+ final Set<String> set2 = new HashSet<>();
+
Review Comment:
done in https://github.com/apache/jackrabbit-oak/pull/1924/commits/78590cb471e03f626fd91f904dd507171759090b
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OAK-11324 : removed usage of Guava's Sets.symmetricDifference [jackrabbit-oak]
Posted by "reschke (via GitHub)" <gi...@apache.org>.
reschke commented on code in PR #1924:
URL: https://github.com/apache/jackrabbit-oak/pull/1924#discussion_r1899369039
##########
oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/collections/CollectionUtilsTest.java:
##########
@@ -308,6 +308,68 @@ public void testIntersectionWithNoCommonElements() {
Assert.assertEquals(Collections.EMPTY_SET, CollectionUtils.intersection(set1, set2));
}
+ @Test
+ public void testSymmetricDifferenceWithNonEmptySets() {
+ final Set<String> set1 = Set.of("a", "b", "c");
+ final Set<String> set2 = Set.of("b", "c", "d");
+
+ final Set<String> result = CollectionUtils.symmetricDifference(set1, set2);
+
+ final Set<String> expected = Set.of("a", "d");
+ Assert.assertEquals(expected, result);
+ }
+
+ @Test
+ public void testSymmetricDifferenceWithEmptySet() {
+ final Set<String> set1 = Set.of("a", "b", "c");
+ final Set<String> set2 = new HashSet<>();
+
+ final Set<String> result = CollectionUtils.symmetricDifference(set1, set2);
+
+ final Set<String> expected = Set.of("a", "b", "c");
+ Assert.assertEquals(expected, result);
+ }
+
+ @Test
+ public void testSymmetricDifferenceWithBothEmptySets() {
+ final Set<String> set1 = new HashSet<>();
+ final Set<String> set2 = new HashSet<>();
+
Review Comment:
Same here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: oak-dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org