Skip to content
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

Merged

Conversation

pawellabaj
Copy link
Contributor

@pawellabaj pawellabaj commented Jun 8, 2023

Introduced useUnmodifiableCollections option. Related to Randgalt/record-builder/#153

@@ -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)) {
Copy link
Owner

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?

@Randgalt
Copy link
Owner

@pawellabaj tests are breaking which suggests to me this should be behind an option.

@pawellabaj
Copy link
Contributor Author

@Randgalt option sounds OK

How it should look like?

@Randgalt
Copy link
Owner

@pawellabaj
Copy link
Contributor Author

@Randgalt , what a timing? :-)

Please, see at my proposed option and latest changes in a code

@Randgalt
Copy link
Owner

I'll get to this this week. @pawellabaj can you merge the two commits please?

@pawellabaj pawellabaj force-pushed the preserve-order-in-set-if-needed branch from 5836199 to f2fee19 Compare June 26, 2023 12:14
@pawellabaj
Copy link
Contributor Author

can you merge the two commits please?

@Randgalt , I squashed commits. I assumed you meant that, didn't you?

@Randgalt Randgalt added this to the v37 milestone Jul 3, 2023
@Randgalt
Copy link
Owner

Randgalt commented Jul 3, 2023

Looks good. Please run mvn clean verify locally. The auto-formatter will make a few changes. Commit and push those changes before we merge this.

@pawellabaj pawellabaj force-pushed the preserve-order-in-set-if-needed branch from f2fee19 to b438676 Compare July 3, 2023 08:44
@pawellabaj
Copy link
Contributor Author

Looks good. Please run mvn clean verify locally. The auto-formatter will make a few changes. Commit and push those changes before we merge this.

@Randgalt , done

@Randgalt Randgalt merged commit c6cf239 into Randgalt:master Jul 3, 2023
@Randgalt
Copy link
Owner

Randgalt commented Jul 3, 2023

Thanks for the PR

@pawellabaj
Copy link
Contributor Author

Great, waiting for the new release

@Randgalt
Copy link
Owner

Randgalt commented Jul 3, 2023

done

@pawellabaj pawellabaj changed the title Fixes Randgalt/record-builder/#153 Introduced useUnmodifiableCollections option Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants