« Return to Thread: [vfs] Why doesn't AbstractFileObject override equals?

Re: [vfs] Why doesn't AbstractFileObject override equals?

by Mario Ivankovits :: Rate this Message:

Reply to Author | View in Thread

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@...
For additional commands, e-mail: user-help@...

 « Return to Thread: [vfs] Why doesn't AbstractFileObject override equals?

LightInTheBox - Buy quality products at wholesale price!