Use java hints API instead of JavaSourceTaskFactory (#12897).

Change-Id: I30c52b409488424f050fea0a9b7d9e05358893b0