File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
src/main/java/com/google/firebase/remoteconfig Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 2424import com .google .firebase .remoteconfig .internal .ServerTemplateResponse .AndConditionResponse ;
2525import com .google .firebase .remoteconfig .internal .ServerTemplateResponse .OneOfConditionResponse ;
2626
27- import java .util .ArrayList ;
2827import java .util .List ;
2928import java .util .stream .Collectors ;
3029
@@ -49,8 +48,8 @@ final class AndCondition {
4948 }
5049
5150 @ NonNull
52- List <OneOfCondition > getConditions () {
53- return new ArrayList <>( conditions ) ;
51+ ImmutableList <OneOfCondition > getConditions () {
52+ return conditions ;
5453 }
5554
5655 AndConditionResponse toAndConditionResponse () {
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ final class ConditionEvaluator {
4343 private static final int MAX_CONDITION_RECURSION_DEPTH = 10 ;
4444 private static final Logger logger = LoggerFactory .getLogger (ConditionEvaluator .class );
4545 private static final BigInteger MICRO_PERCENT_MODULO = BigInteger .valueOf (100_000_000L );
46+ private static final Pattern SEMVER_PATTERN = Pattern .compile ("^[0-9]+(?:\\ .[0-9]+){0,4}$" );
4647
4748 /**
4849 * Evaluates server conditions and assigns a boolean value to each condition.
@@ -340,7 +341,6 @@ private List<Integer> parseSemanticVersion(String versionString) {
340341 }
341342
342343 private boolean validateSemanticVersion (String version ) {
343- Pattern pattern = Pattern .compile ("^[0-9]+(?:\\ .[0-9]+){0,4}$" );
344- return pattern .matcher (version ).matches ();
344+ return SEMVER_PATTERN .matcher (version ).matches ();
345345 }
346346}
Original file line number Diff line number Diff line change 2323import com .google .firebase .internal .NonNull ;
2424import com .google .firebase .remoteconfig .internal .ServerTemplateResponse .OneOfConditionResponse ;
2525import com .google .firebase .remoteconfig .internal .ServerTemplateResponse .OrConditionResponse ;
26- import java .util .ArrayList ;
2726import java .util .List ;
2827import java .util .stream .Collectors ;
2928
@@ -46,8 +45,8 @@ public OrCondition(@NonNull List<OneOfCondition> conditions) {
4645 }
4746
4847 @ NonNull
49- List <OneOfCondition > getConditions () {
50- return new ArrayList <>( conditions ) ;
48+ ImmutableList <OneOfCondition > getConditions () {
49+ return conditions ;
5150 }
5251
5352 OrConditionResponse toOrConditionResponse () {
You can’t perform that action at this time.
0 commit comments