[m-rev.] diff: delete a workaround for versions of Java < 1.6

Julien Fischer jfischer at opturion.com
Tue Oct 11 11:19:53 AEDT 2016


Delete a workaround for versions of Java < 1.6.

library/io.m:
     As above.

Julien.

diff --git a/library/io.m b/library/io.m
index d8ad548..8d4517a 100644
--- a/library/io.m
+++ b/library/io.m
@@ -3311,22 +3311,7 @@ check_file_accessibility(FileName, AccessTypes, Result, !IO) :-
          }

          if (ok && CheckExecute == bool.YES) {
-            // File.canExecute() was added in Java 1.6 but we only require
-            // Java 1.5.
-            try {
-                java.lang.reflect.Method canExecute =
-                    file.getClass().getMethod(""canExecute"");
-                ok = (Boolean) canExecute.invoke(file);
-            }
-            catch (java.lang.NoSuchMethodException e) {
-                // Assume the file is executable.
-            }
-            catch (java.lang.IllegalAccessException e) {
-                // Assume the file is executable.
-            }
-            catch (java.lang.reflect.InvocationTargetException e) {
-                ok = false;
-            }
+            ok = file.canExecute();
          }

          if (ok) {


More information about the reviews mailing list