I like generics and I use them as much as I can. From time to time I need to use one of my classes in another project, which should run on the old JVM (before 5.0), run on JavaME (where generic is not allowed either), or in Microsoft J # (which has VERY poor Generic Support) .
Currently, I delete all generic files manually, which also means adding many castings.
Since generics are called time-only compilation, and each piece of shared code can be automatically converted to non-shared code, I wonder if there is any tool that can do this for me.
If there is no such tool, how else can I solve the problem? Should I completely stop using generics?
Already there are answers related to bytecode compatibility. What if I need to compile the source code for some reason?
source
share