-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add null check for BaseNCodec decodning #461
Conversation
Add null check for BaseNCodec decodning
Why? |
Becuase this code, for example : |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
So don't call |
It make sense to |
But guys, I am, as a framework user, expect that the framework will take care of this check. Do you really think I am doing the Indeed, fellows, I guess you have used Apache Commons. Take a look into its utility classes - they withdraw this boring responsibilities from the framework client. |
I agree with that, but it forces the client the be aware of the fact that string is not null. I am responsible to check it, as a Client - why? I genuinely do not understand the logic behind it |
The logic behind the current design is simple: Tomcat never calls that method with |
Ok, I am sorry, I will reference you directly :) I disagree with you, @markt-asf. The class Base64 is used directly by the clients. Just a couple of examples: this, and this, also this and e.t.c.) - and, as I already mentioned, Base64 delegates to BaseNCodec, which does not tolerate null. @markt-asf I really do not understand why it is so hard to apply this minor, non-breaking change :) As I mentioned above, people are using this API in thier code (it is public b.t.w), so why not make their life easier?) |
All those references you provided are for That the class is public is irrelevant. It has to be public as it is a utility class used by various Tomcat packages. Tomcat's public API is documented in the RELEASE-NOTES. The change won't be applied because it isn't necessary and there is no desire to add unnecessary code bloat to Tomcat. It your application wants to use Commons Codec then it should package it in WEB-INF/lib. |
Ok, that make sence. I will use the public API |
@mikhail2048 Your patch also doesn't even compile, so it wouldn't have been accepted, anyway. |
Add null check for BaseNCodec decodning