Need review for 6873621: (file) FileStore.supportsFileAttributeView(Class<FileAttributeView> type) returns wrong result

Andrew John Hughes gnu_andrew at member.fsf.org
Fri Sep 4 06:45:47 PDT 2009


2009/9/4 Andrew John Hughes <gnu_andrew at member.fsf.org>:
> 2009/9/4 Alan Bateman <Alan.Bateman at sun.com>:
>> I need a reviewer for this one - it's very simple.
>> FileStore.supportsFileAttributeView(Class<? extends FileAttributeView>)
>> should return true if the file store supports the given file attribute view.
>> The method needs to be overridden in the Solaris and Linux implementations
>> so that it returns the right answer for the more specialized views. Also,
>> the Windows implementation is missing one case. The webrev is here:
>>   http://cr.openjdk.java.net/~alanb/6873621/webrev.00/
>>
>> Thanks,
>> Alan.
>>
>
> Looks good to me.  I like the idea of making this safer by checking
> against a type rather than an arbitrary String.  This also makes these
> classes match UnixFileStore which already does this for the
> PosixFileAttributeView.
>
> As an aside, I noticed that Solaris is the only implementation to use
> AclFileAttributeView.  Don't both Linux and Windows have some form of
> ACL support?  Something to fix long term I guess.
> --
> Andrew :-)
>
> Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
>
> Support Free Java!
> Contribute to GNU Classpath and the OpenJDK
> http://www.gnu.org/software/classpath
> http://openjdk.java.net
>
> PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
> Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
>

In supportsFileAttributeView(Class<? extends FileAttributeView) in
UnixFileStore, the following:

            FeatureStatus status = checkIfFeaturePresent("posix");
            if (status == FeatureStatus.NOT_PRESENT)
                return false;
            return true;

could be changed to simply:

            FeatureStatus status = checkIfFeaturePresent("posix");
            return (status != FeatureStatus.NOT_PRESENT)

or even:

            return checkIfFeaturePresent("posix") != FeatureStatus.NOT_PRESENT;

as part of your patch.
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


More information about the nio-dev mailing list