jheytompkins/jclouds-commons-vfs — comment on commit 22a2edb6567c0670ae070a7e565d1ae4a0faf786
File:  line 0
By aledsage:

For the cast in the constructor:
AbstractFileName.class.cast(fileName)
Looks like perhaps you didn't understand Adrian's point about the code smell.
The constructor signature should give a clear indication of what is required when calling the method. It will fail if you pass in anything other than an AbstractFileName instance, so why not declare that as the parameter type in the signature? Currently, calling code will think that it's allowed to use any FileName and it won't be until runtime that it gets the ClassCastException - we have the opportunity to make it a compile-time check without any loss of functionality.
Is there a good reason not to do this?