fix problem with extension of Java class with package-private
constructor reported in #728, and remove unnecessary check