LPS-44579 Used Java 1.7 API; fix it to be compatible with Java 1.6

https://issues.liferay.com/browse/LPS-44579