db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1592486 - in /db/derby/code/branches/10.10: ./ java/engine/org/apache/derby/iapi/services/io/FileUtil.java java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java
Date Mon, 05 May 2014 11:37:01 GMT
Author: kahatlen
Date: Mon May  5 11:37:01 2014
New Revision: 1592486

URL: http://svn.apache.org/r1592486
Log:
DERBY-6410: ClassCastException when launching derby from windows subst drive

Merged revision 1585407 from trunk and manually resolved conflicts.

Modified:
    db/derby/code/branches/10.10/   (props changed)
    db/derby/code/branches/10.10/java/engine/org/apache/derby/iapi/services/io/FileUtil.java
    db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java

Propchange: db/derby/code/branches/10.10/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1585407

Modified: db/derby/code/branches/10.10/java/engine/org/apache/derby/iapi/services/io/FileUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/engine/org/apache/derby/iapi/services/io/FileUtil.java?rev=1592486&r1=1592485&r2=1592486&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/engine/org/apache/derby/iapi/services/io/FileUtil.java
(original)
+++ db/derby/code/branches/10.10/java/engine/org/apache/derby/iapi/services/io/FileUtil.java
Mon May  5 11:37:01 2014
@@ -613,18 +613,12 @@ nextFile:	for (int i = 0; i < list.lengt
     private static Class stringArrayClz;
     private static Class aclEntryBuilderClz;
     private static Class aclEntryTypeClz;
-    private static Class fileStoreClz;
     private static Class aclEntryPermissionClz;
 
     private static Method get;
     private static Method getFileAttributeView;
-    private static Method supportsFileAttributeView;
-    private static Method getFileStore;
     private static Method getOwner;
-    private static Method getAcl;
     private static Method setAcl;
-    private static Method principal;
-    private static Method getName;
     private static Method build;
     private static Method newBuilder;
     private static Method setPrincipal;
@@ -720,8 +714,6 @@ nextFile:	for (int i = 0; i < list.lengt
                         "java.nio.file.attribute.AclEntry$Builder");
                     aclEntryTypeClz = Class.forName(
                         "java.nio.file.attribute.AclEntryType");
-                    fileStoreClz = Class.forName(
-                        "java.nio.file.FileStore");
                     aclEntryPermissionClz = Class.forName(
                             "java.nio.file.attribute.AclEntryPermission");
                     get = pathsClz.getMethod(
@@ -730,22 +722,11 @@ nextFile:	for (int i = 0; i < list.lengt
                     getFileAttributeView = filesClz.getMethod(
                         "getFileAttributeView",
                         new Class[]{pathClz, Class.class, linkOptionArrayClz});
-                    supportsFileAttributeView = fileStoreClz.getMethod(
-                        "supportsFileAttributeView",
-                        new Class[]{Class.class});
-                    getFileStore = filesClz.getMethod("getFileStore",
-                                                      new Class[]{pathClz});
                     getOwner = filesClz.
                         getMethod("getOwner",
                                   new Class[]{pathClz, linkOptionArrayClz});
-                    getAcl = aclFileAttributeViewClz.
-                        getMethod("getAcl", new Class[]{});
                     setAcl = aclFileAttributeViewClz.
                         getMethod("setAcl", new Class[]{List.class});
-                    principal = aclEntryClz.
-                        getMethod("principal", new Class[]{});
-                    getName = userPrincipalClz.
-                        getMethod("getName", new Class[]{});
                     build = aclEntryBuilderClz.
                         getMethod("build", new Class[]{});
                     newBuilder = aclEntryClz.
@@ -885,22 +866,6 @@ nextFile:	for (int i = 0; i < list.lengt
             Object fileP = get.invoke(
                 null, new Object[]{file.getPath(), new String[]{}});
 
-            // ACLs supported on this platform, now check the current file
-            // system:
-            Object fileStore = getFileStore.invoke(
-                null,
-                new Object[]{fileP});
-
-            boolean supported =
-                ((Boolean)supportsFileAttributeView.invoke(
-                    fileStore,
-                    new Object[]{aclFileAttributeViewClz})).booleanValue();
-
-            if (!supported) {
-                return false;
-            }
-
-
             // AclFileAttributeView view =
             //     Files.getFileAttributeView(fileP,
             //         AclFileAttributeView.class);
@@ -911,6 +876,7 @@ nextFile:	for (int i = 0; i < list.lengt
                              Array.newInstance(linkOptionClz, 0)});
 
             if (view == null) {
+                // ACLs not supported on this file system.
                 return false;
             }
 

Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java?rev=1592486&r1=1592485&r2=1592486&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java
(original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/engine/RestrictiveFilePermissionsTest.java
Mon May  5 11:37:01 2014
@@ -515,14 +515,9 @@ public class RestrictiveFilePermissionsT
     private static Class linkOptionArrayClz;
     private static Class linkOptionClz;
     private static Class stringArrayClz;
-    private static Class aclEntryBuilderClz;
-    private static Class aclEntryTypeClz;
-    private static Class fileStoreClz;
 
     private static Method get;
     private static Method getFileAttributeView;
-    private static Method supportsFileAttributeView;
-    private static Method getFileStore;
     private static Method getOwner;
     private static Method getAcl;
     private static Method principal;
@@ -634,12 +629,6 @@ public class RestrictiveFilePermissionsT
                             "java.nio.file.LinkOption");
                         stringArrayClz = Class.forName(
                             "[Ljava.lang.String;");
-                        aclEntryBuilderClz = Class.forName(
-                            "java.nio.file.attribute.AclEntry$Builder");
-                        aclEntryTypeClz = Class.forName(
-                            "java.nio.file.attribute.AclEntryType");
-                        fileStoreClz = Class.forName(
-                            "java.nio.file.FileStore");
 
                         get = pathsClz.
                             getMethod("get",
@@ -651,11 +640,6 @@ public class RestrictiveFilePermissionsT
                                       new Class[]{pathClz,
                                                   Class.class,
                                                   linkOptionArrayClz});
-                        supportsFileAttributeView = fileStoreClz.getMethod(
-                            "supportsFileAttributeView",
-                            new Class[]{Class.class});
-                        getFileStore = filesClz.getMethod("getFileStore",
-                                                          new Class[]{pathClz});
                         getOwner = filesClz.
                             getMethod(
                                 "getOwner",
@@ -708,16 +692,6 @@ public class RestrictiveFilePermissionsT
 
                         // ACLs supported on this platform? Check the current
                         // file system:
-                        Object fileStore = getFileStore.invoke(
-                            null,
-                            new Object[]{fileP});
-
-                        boolean aclsSupported =
-                            ((Boolean)supportsFileAttributeView.invoke(
-                                fileStore,
-                                new Object[]{aclFileAttributeViewClz})).
-                            booleanValue();
-
                         Object aclView = getFileAttributeView.invoke(
                             null,
                             new Object[]{
@@ -732,8 +706,7 @@ public class RestrictiveFilePermissionsT
                                 posixFileAttributeViewClz,
                                 Array.newInstance(linkOptionClz, 0)});
 
-                        if (aclsSupported && aclView != null &&
-                                posixView == null) {
+                        if (aclView != null && posixView == null) {
                             // Windows
                             Object owner = getOwner.invoke(
                                 null,



Mime
View raw message