Skip to content

Commit 192cb88

Browse files
authored
touch up User Profile Service (#103)
1 parent 8181314 commit 192cb88

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ public DecisionService(@Nonnull Bucketer bucketer,
8181
return null;
8282
}
8383

84-
Variation variation;
85-
8684
// check for whitelisting
87-
variation = getWhitelistedVariation(experiment, userId);
85+
Variation variation = getWhitelistedVariation(experiment, userId);
8886
if (variation != null) {
8987
return variation;
9088
}
@@ -96,11 +94,10 @@ public DecisionService(@Nonnull Bucketer bucketer,
9694
Map<String, Object> userProfileMap = userProfileService.lookup(userId);
9795
if (userProfileMap == null) {
9896
logger.info("We were unable to get a user profile map from the UserProfileService.");
99-
}
100-
else if (UserProfileUtils.isValidUserProfileMap(userProfileMap)) {
97+
} else if (UserProfileUtils.isValidUserProfileMap(userProfileMap)) {
10198
userProfile = UserProfileUtils.convertMapToUserProfile(userProfileMap);
10299
} else {
103-
logger.warn("The User Profile Service returned an invalid map.");
100+
logger.warn("The UserProfileService returned an invalid map.");
104101
}
105102
} catch (Exception exception) {
106103
logger.error(exception.getMessage());

core-api/src/main/java/com/optimizely/ab/bucketing/UserProfileUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ static boolean isValidUserProfileMap(@Nonnull Map<String, Object> map) {
6868

6969
/**
7070
* Convert a Map to a {@link UserProfile} instance.
71-
* @param map The map to construct the User Profile from.
72-
* @return A User Profile instance.
71+
* @param map The map to construct the {@link UserProfile} from.
72+
* @return A {@link UserProfile} instance.
7373
*/
7474
static UserProfile convertMapToUserProfile(@Nonnull Map<String, Object> map) {
7575
String userId = (String) map.get(UserProfileService.userIdKey);

0 commit comments

Comments
 (0)