Skip to content

Commit 6de4559

Browse files
authored
Merge pull request #591 from splitio/development
Release 4.16.1
2 parents 193f3c4 + a686521 commit 6de4559

File tree

16 files changed

+247
-94
lines changed

16 files changed

+247
-94
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ jobs:
5959
if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development'
6060
run: mvn checkstyle::check
6161

62-
- name: Deploy
63-
if: matrix.jdk == '8' && github.event_name == 'push' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development'
64-
run: mvn --batch-mode deploy -P test
62+
# - name: Deploy
63+
# if: matrix.jdk == '8' && github.event_name == 'push' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development'
64+
# run: mvn --batch-mode deploy -P test
6565

6666
- name: SonarQube Scan (Push)
6767
if: matrix.jdk == '11' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
4.16.1 (Jul 21, 2025)
2+
- Fixed vulnerabilities:
3+
- Upgraded org.apache.commons-commons-lang3 to 3.18.0
4+
- Upgraded com.google.code.gson.gson to 2.13.1
5+
16
4.16.0 (May 28, 2025)
27
- Added support for rule-based segments. These segments determine membership at runtime by evaluating their configured rules against the user attributes provided to the SDK.
38
- Added support for feature flag prerequisites. This allows customers to define dependency conditions between flags, which are evaluated before any allowlists or targeting rules.

client/pom.xml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<parent>
66
<groupId>io.split.client</groupId>
77
<artifactId>java-client-parent</artifactId>
8-
<version>4.16.0</version>
8+
<version>4.16.1</version>
99
</parent>
10-
<version>4.16.0</version>
10+
<version>4.16.1</version>
1111
<artifactId>java-client</artifactId>
1212
<packaging>jar</packaging>
1313
<name>Java Client</name>
@@ -19,12 +19,15 @@
1919
<build>
2020
<plugins>
2121
<plugin>
22-
<groupId>org.sonatype.plugins</groupId>
23-
<artifactId>nexus-staging-maven-plugin</artifactId>
24-
<version>1.6.3</version>
22+
<groupId>org.sonatype.central</groupId>
23+
<artifactId>central-publishing-maven-plugin</artifactId>
24+
<version>0.8.0</version>
2525
<extensions>true</extensions>
2626
<configuration>
27-
<skipNexusStagingDeployMojo>false</skipNexusStagingDeployMojo>
27+
<ignorePublishedComponents>true</ignorePublishedComponents>
28+
<publishingServerId>central</publishingServerId>
29+
<autoPublish>false</autoPublish>
30+
<waitUntil>published</waitUntil>
2831
</configuration>
2932
</plugin>
3033
</plugins>
@@ -173,7 +176,7 @@
173176
<dependency>
174177
<groupId>com.google.code.gson</groupId>
175178
<artifactId>gson</artifactId>
176-
<version>2.9.0</version>
179+
<version>2.13.1</version>
177180
</dependency>
178181
<dependency>
179182
<groupId>org.yaml</groupId>
@@ -185,7 +188,7 @@
185188
<dependency>
186189
<groupId>org.apache.commons</groupId>
187190
<artifactId>commons-lang3</artifactId>
188-
<version>3.4</version>
191+
<version>3.18.0</version>
189192
<scope>test</scope>
190193
</dependency>
191194
<dependency>

client/src/main/java/io/split/client/events/EventsSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.net.URISyntaxException;
1313
import java.util.List;
1414

15-
import static com.google.gson.internal.$Gson$Preconditions.checkNotNull;
15+
import static com.google.common.base.Preconditions.checkNotNull;
1616

1717
public class EventsSender {
1818

client/src/main/java/io/split/client/events/InMemoryEventsStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.util.concurrent.BlockingQueue;
1313
import java.util.concurrent.LinkedBlockingQueue;
1414

15-
import static com.google.gson.internal.$Gson$Preconditions.checkNotNull;
15+
import static com.google.common.base.Preconditions.checkNotNull;
1616

1717
public class InMemoryEventsStorage implements EventsStorage{
1818

client/src/main/java/io/split/client/impressions/UniqueKeysTrackerImp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private void sendUniqueKeys(){
117117
}
118118
try {
119119
if (uniqueKeysTracker.size() == 0) {
120-
_log.warn("The Unique Keys Tracker is empty");
120+
_log.debug("The Unique Keys Tracker is empty");
121121
return;
122122
}
123123
HashMap<String, HashSet<String>> uniqueKeysHashMap = popAll();

client/src/main/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ public Set<String> getSegments() {
104104

105105
@Override
106106
public boolean contains(Set<String> ruleBasedSegmentNames) {
107-
return getSegments().containsAll(ruleBasedSegmentNames);
107+
return _concurrentMap.keySet().containsAll(ruleBasedSegmentNames);
108108
}
109109
}

client/src/main/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private List<ParsedRuleBasedSegment> stringsToParsedRuleBasedSegments(List<Strin
9696

9797
@Override
9898
public boolean contains(Set<String> ruleBasedSegmentNames) {
99-
return getSegments().containsAll(ruleBasedSegmentNames);
99+
return _userStorageWrapper.getKeysByPrefix(PrefixAdapter.buildGetAllRuleBasedSegment()).containsAll(ruleBasedSegmentNames);
100100
}
101101

102102
}

client/src/test/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImplTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import com.google.common.collect.Lists;
1717

1818
import java.util.ArrayList;
19+
import java.util.Arrays;
20+
import java.util.HashSet;
1921
import java.util.List;
2022

2123
public class RuleBasedSegmentCacheInMemoryImplTest extends TestCase {
@@ -31,6 +33,8 @@ public void testAddAndDeleteSegment(){
3133
ruleBasedSegmentCache.update(Lists.newArrayList(parsedRuleBasedSegment), null, 123);
3234
assertEquals(123, ruleBasedSegmentCache.getChangeNumber());
3335
assertEquals(parsedRuleBasedSegment, ruleBasedSegmentCache.get("sample_rule_based_segment"));
36+
assertTrue(ruleBasedSegmentCache.contains(new HashSet<>(Arrays.asList("sample_rule_based_segment"))));
37+
assertFalse(ruleBasedSegmentCache.contains(new HashSet<>(Arrays.asList("sample_rule_based_segment", "123"))));
3438

3539
ruleBasedSegmentCache.update(null, Lists.newArrayList("sample_rule_based_segment"), 124);
3640
assertEquals(124, ruleBasedSegmentCache.getChangeNumber());
@@ -62,5 +66,7 @@ public void testMultipleSegment(){
6266
ruleBasedSegmentCache.update(Lists.newArrayList(parsedRuleBasedSegment1, parsedRuleBasedSegment2), null, 123);
6367
assertEquals(Lists.newArrayList("another_rule_based_segment", "sample_rule_based_segment"), ruleBasedSegmentCache.ruleBasedSegmentNames());
6468
assertEquals(Sets.newHashSet("segment2", "segment1", "employees"), ruleBasedSegmentCache.getSegments());
69+
assertTrue(ruleBasedSegmentCache.contains(new HashSet<>(Arrays.asList("sample_rule_based_segment", "another_rule_based_segment"))));
70+
assertTrue(ruleBasedSegmentCache.contains(new HashSet<>(Arrays.asList("sample_rule_based_segment"))));
6571
}
6672
}

client/src/test/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumerTest.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.split.storages.pluggable.adapters;
22

33
import com.google.common.collect.Lists;
4+
import com.google.common.collect.Maps;
45
import io.split.client.dtos.*;
56
import io.split.client.utils.Json;
67
import io.split.engine.ConditionsTestUtil;
@@ -16,10 +17,14 @@
1617
import java.lang.reflect.Field;
1718
import java.lang.reflect.Modifier;
1819
import java.util.*;
20+
import java.util.concurrent.ConcurrentMap;
21+
import java.util.concurrent.atomic.AtomicLong;
1922
import java.util.stream.Collectors;
2023
import java.util.stream.Stream;
2124

2225
import static io.split.TestHelper.makeRuleBasedSegment;
26+
import static org.junit.Assert.assertFalse;
27+
import static org.junit.Assert.assertTrue;
2328

2429
public class UserCustomRuleBasedSegmentAdapterConsumerTest {
2530

@@ -66,10 +71,16 @@ public void testGetChangeNumberWithGsonFailing() {
6671
public void testGetRuleBasedSegment() {
6772
RuleBasedSegmentParser ruleBasedSegmentParser = new RuleBasedSegmentParser();
6873
RuleBasedSegment ruleBasedSegment = getRuleBasedSegment(RULE_BASED_SEGMENT_NAME);
74+
ParsedRuleBasedSegment expected = ruleBasedSegmentParser.parse(ruleBasedSegment);
75+
ConcurrentMap<String, ParsedRuleBasedSegment> rbsCollection = Maps.newConcurrentMap();
76+
rbsCollection.put(RULE_BASED_SEGMENT_NAME, expected);
6977
Mockito.when(_userStorageWrapper.get(PrefixAdapter.buildRuleBasedSegmentKey(RULE_BASED_SEGMENT_NAME))).thenReturn(getRuleBasedSegmentAsJson(ruleBasedSegment));
78+
Mockito.when(_userStorageWrapper.getKeysByPrefix("SPLITIO.rbsegment*")).thenReturn(new HashSet<>(Arrays.asList(RULE_BASED_SEGMENT_NAME)));
7079
ParsedRuleBasedSegment result = _userCustomRuleBasedSegmentAdapterConsumer.get(RULE_BASED_SEGMENT_NAME);
71-
ParsedRuleBasedSegment expected = ruleBasedSegmentParser.parse(ruleBasedSegment);
7280
Assert.assertEquals(expected, result);
81+
assertTrue(_userCustomRuleBasedSegmentAdapterConsumer.contains(new HashSet<>(Arrays.asList(RULE_BASED_SEGMENT_NAME))));
82+
assertFalse(_userCustomRuleBasedSegmentAdapterConsumer.contains(new HashSet<>(Arrays.asList(RULE_BASED_SEGMENT_NAME, "123"))));
83+
7384
}
7485

7586
@Test
@@ -135,7 +146,7 @@ public void testGetSegments() {
135146
Mockito.when(_userStorageWrapper.getMany(Mockito.anyObject())).
136147
thenReturn(getManyExpected);
137148
HashSet<String> segmentResult = (HashSet<String>) _userCustomRuleBasedSegmentAdapterConsumer.getSegments();
138-
Assert.assertTrue(segmentResult.contains("employee"));
149+
assertTrue(segmentResult.contains("employee"));
139150
}
140151

141152
@Test

0 commit comments

Comments
 (0)