Skip to content

Commit

Permalink
Merge pull request Netflix#469 from mridulv/mridul-fix-getProperty-null
Browse files Browse the repository at this point in the history
Fix Race Condition for null getProperty. Thanks for the contribution @mridulv
  • Loading branch information
howardyuan authored Dec 20, 2016
2 parents e623c01 + dd8a9fe commit 9b3e5d2
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,16 @@ private boolean updateValue() {
return updateValue(newValue);
}

private void setStatusForValues() {
cachedStringValue.isCached = false;
booleanValue.isCached = false;
integerValue.isCached = false;
floatValue.isCached = false;
classValue.isCached = false;
doubleValue.isCached = false;
longValue.isCached = false;
}

// return true iff the value actually changed
boolean updateValue(Object newValue) {
String nv = (newValue == null) ? null : newValue.toString();
Expand All @@ -568,13 +578,7 @@ boolean updateValue(Object newValue) {
return false;
}
stringValue = nv;
cachedStringValue.flush();
booleanValue.flush();
integerValue.flush();
floatValue.flush();
classValue.flush();
doubleValue.flush();
longValue.flush();
setStatusForValues();
changedTime = System.currentTimeMillis();
return true;
}
Expand Down

0 comments on commit 9b3e5d2

Please sign in to comment.