Avoid Java 7 API

+review REVIEW-5329