Add explicit type hints for Java 6.

+review REVIEW-5214