File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 55
66
77import com .azure .data .cosmos .internal .Constants ;
8+ import com .google .common .base .CaseFormat ;
89import org .apache .commons .lang3 .StringUtils ;
910
1011/**
@@ -41,12 +42,12 @@ public ConsistencyPolicy() {
4142 public ConsistencyLevel defaultConsistencyLevel () {
4243
4344 ConsistencyLevel result = ConsistencyPolicy .DEFAULT_DEFAULT_CONSISTENCY_LEVEL ;
45+ String consistencyLevelString = super .getString (Constants .Properties .DEFAULT_CONSISTENCY_LEVEL );
4446 try {
45- result = ConsistencyLevel .valueOf (
46- StringUtils .upperCase (super .getString (Constants .Properties .DEFAULT_CONSISTENCY_LEVEL )));
47+ result = ConsistencyLevel .valueOf (CaseFormat .UPPER_CAMEL .to (CaseFormat .UPPER_UNDERSCORE , consistencyLevelString ));
4748 } catch (IllegalArgumentException e ) {
4849 // ignore the exception and return the default
49- this .getLogger ().warn ("Unknown consistency level {}, value ignored." , super . getString ( Constants . Properties . DEFAULT_CONSISTENCY_LEVEL ) );
50+ this .getLogger ().warn ("Unknown consistency level {}, value ignored." , consistencyLevelString );
5051 }
5152 return result ;
5253 }
You can’t perform that action at this time.
0 commit comments