-
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-7491] make Stax & XSLT interceptors Charset-aware #309
base: 3.1.x-fixes
Are you sure you want to change the base?
[CXF-7491] make Stax & XSLT interceptors Charset-aware #309
Conversation
Thanks for this effort. Can you consider modifying the existing interceptors to make them charset-aware instead of creating a new set of interceptors ? In reality some users will continue using the old ones, and we will face the problems with syncing the fixes across the 2 sets of interceptors |
Thanks for the feedback @sberyozkin As noted in the JIRA ticket, I hesitated between simply updating the existing interceptors and forking/deprecating. The reason why I went with the latter is in order to avoid making a breaking interface change for users of subclasses of these interceptors, which seemed to be an excessive surprise in a possible 3.1.(x+1) release. In the patch as it is now, the features are updated to use the new interceptors. Do you feel I overestimated the inconvenience to such subclassers, at the expense of leaving (effectively) dead/worse code around ? I'll gladly switch to the break-but-improve-in-place strategy if this is preferred. |
I'm not sure if users actually have ever tried to extend these classes, we can ask at the CXF users for example if someone has tried it...Can you please try to do another PR but based on updating the protected methods, or may be you can find a way to pass that extra parameter as a new message property, example, Message.PAYLOAD_ENCODING, or similar ? thanks |
56dd9e3
to
31514b5
Compare
@sberyozkin many apologies for not coming back earlier I've updated the PR to switch back to updating the protected methods, which bets hardly anyone extended the classes in question (+ some checkstyle tidying up) I'm not sure adding a message property would work, since the whole point of the patch is to read the existing property and add an "encoding" arguments to internal methods to pass it on, but I might misread. |
Np, sorry for a delay too. I see you check a message contextual property in many places and if it is not set - default to UTF-8 and finally pass it as a method parameter. What I suggested that, instead of updating all the methods which need this encoding property - set it as a new Message property and get the interceptors check the current Message. In fact, why don't interceptor methods which need this encoding property simply check as in may be also have this code encapsulated in MessageUtils ? |
* Unforks previous commit * warning, intentionally breaks the derivation interface (thought to be rarely overriden)
8e59039
to
58de618
Compare
Hi @sberyozkin — good advice. Now the inheritance interface is (almost) untouched. (almost) as there remains a corner case which according to IntelliJ should be private not protected anyway. All rebased up to current 3.1.x-fixes branch Thanks for the review! |
per https://issues.apache.org/jira/browse/CXF-7491
this implements "solution 3" described there; forking the Stax & XSLT transform interceptors to make them charset-aware, not blind "always UTF-8" as previously