[Patch][JDK10] Use Class.getPackageName() where possible