reta commented on a change in pull request #721:
URL: https://github.com/apache/cxf/pull/721#discussion_r520969844
##########
File path:
rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
##########
@@ -559,44 +559,47 @@ private static Object createTypeReference(QName n,
Class<?> cls) {
private Object createFactory(Class<?> cls, Constructor<?> contructor) {
String newClassName = cls.getName() + "Factory";
ASMHelper helper = new ASMHelper();
- ClassWriter cw = helper.createClassWriter();
- MethodVisitor mv;
-
- cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,
- ASMHelper.periodToSlashes(newClassName), null,
"java/lang/Object", null);
-
- cw.visitSource(cls.getSimpleName() + "Factory" + ".java", null);
+ Class<?> factoryClass = helper.findClass(newClassName, cls);
Review comment:
I think we have to clearly distinguish the case when factory class
exists and does not (`createFactory`). Could you please extract the logic of
detecting the presence of factory class into dedicated method and modify
`addClass` method to try to find the factory class first and fallback to
`createFactory` if needed?
----------------------------------------------------------------
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]