Skip to content

Commit 76416a6

Browse files
committed
We're on Java 8 already.
1 parent 4f34938 commit 76416a6

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

java/client/src/org/openqa/selenium/os/ExecutableFinder.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ class ExecutableFinder {
3535
private static final ImmutableSet<String> ENDINGS = Platform.getCurrent().is(WINDOWS) ?
3636
ImmutableSet.of("", ".cmd", ".exe", ".com", ".bat") : ImmutableSet.of("");
3737

38-
private static final Method JDK6_CAN_EXECUTE = findJdk6CanExecuteMethod();
39-
4038
private final ImmutableSet.Builder<String> pathSegmentBuilder =
4139
new ImmutableSet.Builder<>();
4240

@@ -105,27 +103,6 @@ private void addMacSpecificPath() {
105103
}
106104

107105
private static boolean canExecute(File file) {
108-
if (!file.exists() || file.isDirectory()) {
109-
return false;
110-
}
111-
112-
if (JDK6_CAN_EXECUTE != null) {
113-
try {
114-
return (Boolean) JDK6_CAN_EXECUTE.invoke(file);
115-
} catch (IllegalAccessException e) {
116-
// Do nothing
117-
} catch (InvocationTargetException e) {
118-
// Still do nothing
119-
}
120-
}
121-
return true;
122-
}
123-
124-
private static Method findJdk6CanExecuteMethod() {
125-
try {
126-
return File.class.getMethod("canExecute");
127-
} catch (NoSuchMethodException e) {
128-
return null;
129-
}
106+
return file.exists() && !file.isDirectory() && file.canExecute();
130107
}
131108
}

0 commit comments

Comments
 (0)