updating java files to remove compiler warnings and raw generics (where possible)