1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -71,8 +71,8 @@ private static Profiles parseTokens(String expression, StringTokenizer tokens, C
71
71
}
72
72
switch (token ) {
73
73
case "(" :
74
- Profiles contents = parseTokens (expression , tokens , Context .BRACKET );
75
- if (context == Context .INVERT ) {
74
+ Profiles contents = parseTokens (expression , tokens , Context .PARENTHESIS );
75
+ if (context == Context .NEGATE ) {
76
76
return contents ;
77
77
}
78
78
elements .add (contents );
@@ -86,11 +86,11 @@ private static Profiles parseTokens(String expression, StringTokenizer tokens, C
86
86
operator = Operator .OR ;
87
87
break ;
88
88
case "!" :
89
- elements .add (not (parseTokens (expression , tokens , Context .INVERT )));
89
+ elements .add (not (parseTokens (expression , tokens , Context .NEGATE )));
90
90
break ;
91
91
case ")" :
92
92
Profiles merged = merge (expression , elements , operator );
93
- if (context == Context .BRACKET ) {
93
+ if (context == Context .PARENTHESIS ) {
94
94
return merged ;
95
95
}
96
96
elements .clear ();
@@ -99,7 +99,7 @@ private static Profiles parseTokens(String expression, StringTokenizer tokens, C
99
99
break ;
100
100
default :
101
101
Profiles value = equals (token );
102
- if (context == Context .INVERT ) {
102
+ if (context == Context .NEGATE ) {
103
103
return value ;
104
104
}
105
105
elements .add (value );
@@ -142,10 +142,9 @@ private static Predicate<Profiles> isMatch(Predicate<String> activeProfile) {
142
142
}
143
143
144
144
145
- private enum Operator {AND , OR }
145
+ private enum Operator { AND , OR }
146
146
147
-
148
- private enum Context {NONE , INVERT , BRACKET }
147
+ private enum Context { NONE , NEGATE , PARENTHESIS }
149
148
150
149
151
150
private static class ParsedProfiles implements Profiles {
0 commit comments