Fix StubGen compatibility with JDK8