dufoli commented on a change in pull request #721:
URL: https://github.com/apache/cxf/pull/721#discussion_r537118904
##########
File path:
rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
##########
@@ -24,78 +24,56 @@
import javax.xml.bind.JAXBElement;
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.spi.ClassGeneratorClassLoader;
import org.apache.cxf.common.util.ASMHelper;
+import org.apache.cxf.common.util.OpcodesProxy;
+import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.databinding.WrapperHelper;
-final class WrapperHelperCompiler extends ASMHelper {
-
-
- final Class<?> wrapperType;
- final Method[] setMethods;
- final Method[] getMethods;
- final Method[] jaxbMethods;
- final Field[] fields;
- final Object objectFactory;
- final ClassWriter cw;
-
- private WrapperHelperCompiler(Class<?> wrapperType,
- Method[] setMethods,
- Method[] getMethods,
- Method[] jaxbMethods,
- Field[] fields,
- Object objectFactory) {
- this.wrapperType = wrapperType;
- this.setMethods = setMethods;
- this.getMethods = getMethods;
- this.jaxbMethods = jaxbMethods;
- this.fields = fields;
- this.objectFactory = objectFactory;
- cw = createClassWriter();
- }
-
- static WrapperHelper compileWrapperHelper(Class<?> wrapperType,
- Method[] setMethods,
- Method[] getMethods,
- Method[] jaxbMethods,
- Field[] fields,
- Object objectFactory) {
- try {
- return new WrapperHelperCompiler(wrapperType,
- setMethods,
- getMethods,
- jaxbMethods,
- fields,
- objectFactory).compile();
-
- } catch (Throwable t) {
- // Some error - probably a bad version of ASM or similar
- }
- return null;
- }
-
+public final class WrapperHelperCompiler extends ClassGeneratorClassLoader
implements WrapperHelperCreator {
+ private Class<?> wrapperType;
+ private Method[] setMethods;
+ private Method[] getMethods;
+ private Method[] jaxbMethods;
+ private Field[] fields;
+ private ASMHelper.ClassWriter cw;
+ private ASMHelper asmhelper;
+ WrapperHelperCompiler(Bus bus) {
+ super(bus);
+ }
+ public WrapperHelper compile(Class<?> wt, Method[] setters,
+ Method[] getters, Method[] jms,
+ Field[] fs, Object objectFactory) {
+ this.wrapperType = wt;
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]