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
Change CORSConfig to builder pattern #4827
Conversation
Hello, and thanks for your contribution. Needs a I would expect a builder to have a build, method or something that produces the final result. Since this builder is immutable, i guess that is not really a problem. Now we just really have the same as we did, but not able to do equality checks and other useful operations. Perhaps we should keep the old type around, but make it a non-case class, but with equals, hashCode and toString implemented. Not sure. |
I wasn't sure what to do with |
Yeah, we call this "the builder pattern", but maybe "the contraband pattern" is more accurate. I don't think it needs Function equality is hard. We'd like two functions |
We should cherry-pick this to series/0.22, if it's ready before we release it. |
I cherry-picked my latest commit and brought it over to |
Whoops, I just realized this isn't even merged properly when I was cherry-picking. Going to revert it and be more careful next time |
I've also realized I can't switch the source branch, only the target branch (which I don't think makes a difference now that I think about it). |
Don't worry about the targeting. I can cherry-pick it so it shows up as you and gets to the right place. 😄 |
Looks like that I can dig up an example of MurmurHash3 if we want to do it the way it's generated for Scala case classes. Or there are a few examples in our codebase. |
Ah that's unfortunate. I'll look into MurmurHash3 from the other examples |
I'm curious though, where does the error show up? I want to avoid running into these issues myself but there's no compiler error nor is there a failed test. Edit: Nevermind I think I know what you meant, since there's an implicit conversion, an incorrect hash is generated I think right? |
It hit this error in Scala 2.12. Something that was fine in 2.13 and 3:
|
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.
LGTM. I'm going to cherry-pick it all back to series/0.22, because there's no CE work to backport.
Thanks! Just wondering since I didn't see anything about this on the contribution guide, is there a limit to how many one can work on |
Nope, absolutely no limit! Just please leave a comment when you start to look at one, so we know we're not duplicating effort. And thanks for the great work on this one! |
Good to hear, thanks for helping me out with the issue. Looking forward to working on other issues! |
Fixes #1717. I wasn't sure how to use
Method
's generics so I left it as a String for now.