There are two classes
foo.bar.FileUploader and barbar.foofoo.FileUploader
Both are identical and extend Uploader
Somewhere in the code the foo.bar.FileUploader is used and are given as a parameter to my function as an Uploader type.
Now I need to cast it back to FileUploader but the barbar.foofoo.FileUploader. And this gives an error:
ERROR – unhandled error
java.lang.ClassCastException:
foo.bar.FileUploadercannot be cast
tobarbar.foofoo.FileUploader
And I can’t figure out what’s going wrong, I suppose it’s because the package is different. In that case: Is there a way to still use the class and get the cast done?
Thanks for the help people.
I just solved the problem by importing the the barbar.foofoo.FileUploader. Now it runs fine!