@@ -215,7 +215,7 @@ private boolean evaluateCustomSignalCondition(CustomSignalCondition condition,
215215 }
216216 }
217217
218- private BigInteger getMicroPercentile (String seed , Object randomizationId ) {
218+ private BigInteger getMicroPercentile (String seed , String randomizationId ) {
219219 String seedPrefix = seed != null && !seed .isEmpty () ? seed + "." : "" ;
220220 String stringToHash = seedPrefix + randomizationId ;
221221 BigInteger hash = hashSeededRandomizationId (stringToHash );
@@ -250,14 +250,13 @@ private BigInteger hashSeededRandomizationId(String seededRandomizationId) {
250250 }
251251 }
252252
253- private boolean compareStrings (ImmutableList <String > targetValues , Object customSignal ,
253+ private boolean compareStrings (ImmutableList <String > targetValues , String customSignal ,
254254 BiPredicate <String , String > compareFunction ) {
255- String customSignalValue = customSignal .toString ();
256255 return targetValues .stream ().anyMatch (targetValue ->
257- compareFunction .test (customSignalValue , targetValue ));
256+ compareFunction .test (customSignal , targetValue ));
258257 }
259258
260- private boolean compareNumbers (ImmutableList <String > targetValues , Object customSignal ,
259+ private boolean compareNumbers (ImmutableList <String > targetValues , String customSignal ,
261260 IntPredicate compareFunction ) {
262261 if (targetValues .size () != 1 ) {
263262 logger .warn (String .format (
@@ -267,9 +266,9 @@ private boolean compareNumbers(ImmutableList<String> targetValues, Object custom
267266 }
268267
269268 try {
270- double customSignalValue = Double .parseDouble (customSignal . toString () );
269+ double customSignalDouble = Double .parseDouble (customSignal );
271270 double targetValue = Double .parseDouble (targetValues .get (0 ));
272- int comparisonResult = Double .compare (customSignalValue , targetValue );
271+ int comparisonResult = Double .compare (customSignalDouble , targetValue );
273272 return compareFunction .test (comparisonResult );
274273 } catch (NumberFormatException e ) {
275274 logger .warn ("Error parsing numeric values: customSignal=%s, targetValue=%s" ,
@@ -279,27 +278,26 @@ private boolean compareNumbers(ImmutableList<String> targetValues, Object custom
279278 }
280279
281280 private boolean compareSemanticVersions (ImmutableList <String > targetValues ,
282- Object customSignalValue ,
281+ String customSignal ,
283282 IntPredicate compareFunction ) {
284283 if (targetValues .size () != 1 ) {
285284 logger .warn (String .format ("Target values must contain 1 element for semantic operation." ));
286285 return false ;
287286 }
288287
289288 String targetValueString = targetValues .get (0 );
290- String customSignalValueString = customSignalValue .toString ();
291289 if (!validateSemanticVersion (targetValueString )
292- || !validateSemanticVersion (customSignalValueString )) {
290+ || !validateSemanticVersion (customSignal )) {
293291 return false ;
294292 }
295293
296294 List <Integer > targetVersion = parseSemanticVersion (targetValueString );
297- List <Integer > customSignalVersion = parseSemanticVersion (customSignalValueString );
295+ List <Integer > customSignalVersion = parseSemanticVersion (customSignal );
298296
299297 int maxLength = 5 ;
300298 if (targetVersion .size () > maxLength || customSignalVersion .size () > maxLength ) {
301299 logger .warn ("Semantic version max length(%s) exceeded. Target: %s, Custom Signal: %s" ,
302- maxLength , targetValueString , customSignalValueString );
300+ maxLength , targetValueString , customSignal );
303301 return false ;
304302 }
305303
0 commit comments