As we are now on Java 1.5, I would like to go forward with this issue as the first real patch using generics.
During development of generics, it is really important that you see all unchecked warnings, so this patch also adds <compilerarg line="-Xlint:unchecked"/> to the javac task. The problem is now, that all non-generics classes in Lucene generate tons of warnings. I would like to proceed like the following:
- Open a new issue that adds this compilerarg.
- Add a @SuppressWarnings("unchecked") in front of each class, that (currently) produces warnings (should not be so many, hopefully).
After that the compilation should run without warnings about unchecked casts and so on. When starting to add generics to some of the classes, the developer would remove the SuppressWarnings for the class he works on and start fixing the warnngs and adding generics.
What do you think? Without that, it is hard to add the generics 100% safe and consistent without be lost in tons of warnings and so on.
I will also update this patch to also remove the now unneeded casts in all addAttribute calls in Lucene (low priority).