commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [vfs] Why doesn't AbstractFileObject override equals?
Date Thu, 12 Jun 2008 11:59:26 GMT
Hi!

I'd go that way:
> 1. in AbstractFileObject.getParent():
>
> replace
>
>   if (this == fs.getRoot()) { ... };
>
> with
>
>   FileObject root = fs.getRoot();
>   if (root instanceof DecoratedFileObject) {
>     root = ((DecoratedFileObject) root).getDecoratedFileObject();
>   }
>   if (this == root) { ... }
But instead of the instanceof thing simply use
FileObject root = FileObjectUtils.getAbstractFileObject(root);

Which does all the unpacking stuff.

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message