private void writeRemappedClass ( URL classUrl , JarOutputStream jarStream , String targetPackage ) throws IOException { InputStream inputStream = classUrl . openStream ( ) ; String sourceInternalName = getClassInternalName ( classUrl ) ; String targetInternalName = getTargetInternalName ( sourceInternalName , targetPackage ) ; SimpleRemapper remapper = new SimpleRemapper ( sourceInternalName , targetInternalName ) ; ClassReader reader = new ClassReader ( inputStream ) ; ClassWriter writer = new ClassWriter ( reader , ClassWriter . COMPUTE_FRAMES ) ; ClassRemapper remappingVisitor = new ClassRemapper ( writer , remapper ) ; ClassVisitor versionVisitor = new AddVersionFieldClassAdapter ( remappingVisitor , VERSION_FIELD_NAME , getCurrentVersion ( ) ) ; reader . accept ( versionVisitor , ClassReader . EXPAND_FRAMES ) ; JarEntry jarEntry = new JarEntry ( targetInternalName + ".class" ) ; jarStream . putNextEntry ( jarEntry ) ; jarStream . write ( writer . toByteArray ( ) ) ; }
Transform the proxy template class that s in this package into a class that s in a package on the framework boot delegation package list .