-
Notifications
You must be signed in to change notification settings - Fork 53
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
Introduced useUnmodifiableCollections option #154
Introduced useUnmodifiableCollections option #154
Conversation
@@ -298,7 +300,13 @@ private String disambiguateGeneratedMethodName(List<RecordClassType> recordCompo | |||
|
|||
private MethodSpec buildShimMethod(String name, TypeName mainType, Class<?> abstractType, | |||
ParameterizedTypeName parameterizedType, TypeVariableName... typeVariables) { | |||
var code = CodeBlock.of("return (o != null) ? $T.copyOf(o) : $T.of()", mainType, mainType); | |||
CodeBlock code; | |||
if (mainType.equals(setTypeName)) { |
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.
Are there backward compatibility concerns with this? We should probably put this behind an option. wdyt?
@pawellabaj tests are breaking which suggests to me this should be behind an option. |
@Randgalt option sounds OK How it should look like? |
You would add an option here: https://github.com/Randgalt/record-builder/blob/master/record-builder-core/src/main/java/io/soabase/recordbuilder/core/RecordBuilder.java#L68 - there are many examples in the code |
@Randgalt , what a timing? :-) Please, see at my proposed option and latest changes in a code |
I'll get to this this week. @pawellabaj can you merge the two commits please? |
5836199
to
f2fee19
Compare
@Randgalt , I squashed commits. I assumed you meant that, didn't you? |
Looks good. Please run |
f2fee19
to
b438676
Compare
@Randgalt , done |
Thanks for the PR |
Great, waiting for the new release |
done |
Introduced useUnmodifiableCollections option. Related to Randgalt/record-builder/#153