-
Notifications
You must be signed in to change notification settings - Fork 331
[Java] improve readability of ProxyMethodMapper type #6497
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
[Java] improve readability of ProxyMethodMapper type #6497
Conversation
|
No changes needing a change description found. |
|
You can try these changes here
|
c89905a to
4f01318
Compare
weidongxu-microsoft
left a comment
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
Any logic change (other than refactor) that you want us pay attention to?
.../com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodParameterProcessor.java
Outdated
Show resolved
Hide resolved
.../com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodParameterProcessor.java
Outdated
Show resolved
Hide resolved
...com/microsoft/typespec/http/client/generator/core/mapper/UniqueProxyMethodNameGenerator.java
Show resolved
Hide resolved
...rc/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ExceptionSettings.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodMapper.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodMapper.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodMapper.java
Outdated
Show resolved
Hide resolved
…type take care of both sync and async Response return type
4f01318 to
5524def
Compare
Thanks, Weidong. There are a few conditions that have been inverted to improve readability, If you could skim over it.. the types are |
XiaofeiCao
left a comment
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, thanks!
This pull request focuses on enhancing the readability of
ProxyMethodMapperby refactoring but without altering overall behavior.ProxyMethod.newBuilder()to ensure immutability.CollectionUtil, with utility methods to create immutable list/set/map.ResponseTypeFactory, so this can be reused acrossProxyMethodMapperandClientMethodMapper.ExceptionSettingsUtilProxyMethodParameterProcessortype responsible for resolving allProxyMethodParameter, so we can simplify theProxyMethodMapperinternals.UniqueProxyMethodNameGeneratortype so we can isolate the logic that generate unique method names, which again simplifies theProxyMethodMapperinternals.The auto-rest.java test run for this commit passed the CI - CI run pr