-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CXF-9003: Name clash when two SEIs have a same name method in the same Java package #2237
base: main
Are you sure you want to change the base?
Conversation
Could you please review @reta or anybody else? |
rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/WrapperClassUtils.java
Show resolved
Hide resolved
|
||
/** | ||
* Returns a package name unique for the declaring class of the given {@code method} and {@code anonymous} | ||
* parameters suitable for generated classes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ppalaga thanks for javadoc, could you please document a few examples how package name is generated? For example (from tests):
org.apache.cxf.systest.jaxws.CXF9003Test$Hello1Service -> org.apache.cxf.systest.jaxws.jaxws_asm.cxf9003test_hello1service
Thank you.
Thanks a lot @ppalaga, but I believe this change could be considered a breaking one (please correct me if I am wrong): the previously generated classes would end up under different package. This could be disruptive, what do you think if we introduce the package generation extension (SimplePackageNameGenerator, the default / PerSeiPackageNameGenerator) so it would be picked from the Bus? |
Yes, you are right, the generated classes now end up in a different package. The classification of the change depends a bit from how CXF defines its public API. While I'd personally tend to see this as an implementation detail not exposed to CXF users, you may know of use cases where users rely on the package name. I'd let you decide because I do not think I am experienced enough with CXF. Another aspect is whether this is actually a bug in plain CXF. When writing the test, I found out that the issue is not happening in stock CXF where only
Thanks for the idea! That would certainly solve the problem. I'd be fine going that way, although, in the long term having less configuration knobs is better for maintenance and testing. Wouldn't suffice to introduce the extension only if there comes somebody really needing the old behavior? |
Hm... when thinking of it more, another possible solution strategy could be to pass the service name to |
Thanks for the contribution @ppalaga! And about the backward compatibility concerns, how about we maintain a cache in WrapperClassGenerator(or wherever more suitable), so if there's no conflict for the wrapper class names, we use the previous way to generate the package name, if we find the conflict to generate the same wrapper class in the same package(which didn't work previously), we use the new way to add SEI classname to generate the package name. This way, the scenarios which have been working are the same package name and same behaviour as before, but we also make it working for the scenarios that haven't been working(the cases described in CXF-9003). WDYT? Freeman |
Thanks @ppalaga
I think we could indeed pick the new strategy as default but provide the fallback to the old one if users run into issues.
I think that would be more disruptive change since
I think this would also work, thank you @ffang |
https://issues.apache.org/jira/browse/CXF-9003