MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / getCurrent

Method getCurrent

java/src/org/openqa/selenium/Platform.java:387–409  ·  view source on GitHub ↗

Get current platform (not necessarily the same as operating system). @return current platform

()

Source from the content-addressed store, hash-verified

385 * @return current platform
386 */
387 public static Platform getCurrent() {
388 if (current == null) {
389 current = extractFromSysProperty(System.getProperty("os.name"));
390
391 String version = System.getProperty("os.version", "0.0.0");
392 int major = 0;
393 int minor = 0;
394
395 final Matcher matcher = VERSION_PATTERN.matcher(version);
396 if (matcher.matches()) {
397 try {
398 major = Integer.parseInt(matcher.group(1));
399 minor = Integer.parseInt(matcher.group(2));
400 } catch (NumberFormatException e) {
401 // These things happen
402 }
403 }
404
405 current.majorVersion = major;
406 current.minorVersion = minor;
407 }
408 return current;
409 }
410
411 /**
412 * Extracts platforms based on system properties in Java and uses a heuristic to determine the

Calls 3

getPropertyMethod · 0.80
matchesMethod · 0.65