@@ -32,7 +32,12 @@ public enum Platform {
32
32
/**
33
33
* Never returned, but can be used to request a browser running on any version of Windows.
34
34
*/
35
- WINDOWS ("" ) {},
35
+ WINDOWS ("" ) {
36
+ @ Override
37
+ public Platform family () {
38
+ return WINDOWS ;
39
+ }
40
+ },
36
41
37
42
/**
38
43
* For versions of Windows that "feel like" Windows XP. These are ones that store files in
@@ -79,7 +84,12 @@ public Platform family() {
79
84
}
80
85
},
81
86
82
- MAC ("mac" , "darwin" , "macOS" , "os x" ) {},
87
+ MAC ("mac" , "darwin" , "macOS" , "os x" ) {
88
+ @ Override
89
+ public Platform family () {
90
+ return MAC ;
91
+ }
92
+ },
83
93
84
94
SNOW_LEOPARD ("snow leopard" , "os x 10.6" ) {
85
95
@ Override
@@ -150,12 +160,17 @@ public String toString() {
150
160
/**
151
161
* Many platforms have UNIX traits, amongst them LINUX, Solaris and BSD.
152
162
*/
153
- UNIX ("solaris" , "bsd" ) {},
163
+ UNIX ("solaris" , "bsd" ) {
164
+ @ Override
165
+ public Platform family () {
166
+ return UNIX ;
167
+ }
168
+ },
154
169
155
170
LINUX ("linux" ) {
156
171
@ Override
157
172
public Platform family () {
158
- return UNIX ;
173
+ return LINUX ;
159
174
}
160
175
},
161
176
@@ -166,20 +181,20 @@ public Platform family() {
166
181
}
167
182
},
168
183
169
- /**
170
- * Provide a temporary workaround for an issue where platformName was being overridden by
171
- * platform for external providers.
172
- */
173
- @ Deprecated
174
184
IOS ("iOS" ) {
175
185
@ Override
176
- public Platform family () { return MAC ; }
186
+ public Platform family () { return IOS ; }
177
187
},
178
188
179
189
/**
180
190
* Never returned, but can be used to request a browser running on any operating system.
181
191
*/
182
192
ANY ("" ) {
193
+ @ Override
194
+ public Platform family () {
195
+ return ANY ;
196
+ }
197
+
183
198
@ Override
184
199
public boolean is (Platform compareWith ) {
185
200
return this == compareWith ;
@@ -190,7 +205,7 @@ public boolean is(Platform compareWith) {
190
205
private int minorVersion = 0 ;
191
206
private int majorVersion = 0 ;
192
207
193
- private Platform (String ... partOfOsName ) {
208
+ Platform (String ... partOfOsName ) {
194
209
this .partOfOsName = partOfOsName ;
195
210
}
196
211
@@ -340,9 +355,7 @@ public boolean is(Platform compareWith) {
340
355
*
341
356
* @return the family platform for the current one
342
357
*/
343
- public Platform family () {
344
- return ANY ;
345
- }
358
+ public abstract Platform family ();
346
359
347
360
private boolean isCurrentPlatform (String osName , String matchAgainst ) {
348
361
return osName .contains (matchAgainst );
0 commit comments