For example, java.io.File is just a concrete class. My replacement for it supports the resolution of Windows keyboard shortcuts. I need to pre-process the constructor parameters to allow possible .lnk files, because the FileSystem object that performs normalization / canonicalision / resolution on abstract paths is not available. The need for preprocessing eliminates pure subclasses - it cannot preprocess before calling super (...), and the file is unchanged. Therefore, I expand the file and use the delegate, overriding all the constructors and methods of the file (calling super ("") in all the constructors).
This works well, but obviously not perfect - if the file changes, I will not override any new methods or constructors, and this will open a basic empty abstract path. Am I missing something? There seems to be a simpler / better way.
source share