Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
configcat-developer committed Oct 7, 2018
1 parent f5b3a50 commit 5baeb56
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.2.3
version=1.2.4
Binary file added src/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/com/configcat/RolloutEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public JsonElement evaluate(JsonObject json, String key, User user) {
for (JsonElement rule: percentageRules) {
JsonObject ruleObject = rule.getAsJsonObject();

bucket += ruleObject.get("Percentage").getAsFloat();
bucket += ruleObject.get("Percentage").getAsInt();
if(scaled < bucket)
return ruleObject.get("Value");
}
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/com/configcat/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ private User(String identifier, String email, String country, Map<String, Strin
this.identifier = identifier;
this.attributes = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
this.attributes.put("identifier", identifier);
this.attributes.put("country", country);
this.attributes.put("email", email);

if(country != null && !country.isEmpty())
this.attributes.put("country", country);

if(email != null && !email.isEmpty())
this.attributes.put("email", email);

if(custom != null)
this.attributes.putAll(custom);
Expand Down
Binary file added src/test/.DS_Store
Binary file not shown.

0 comments on commit 5baeb56

Please sign in to comment.