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

Correct use of loggers with placeholders and remove some redundant operations #8842

Merged
merged 5 commits into from
Mar 2, 2021

Conversation

agilob
Copy link
Contributor

@agilob agilob commented Feb 25, 2021

  1. Removed some redundant operations from static{} blocks, unnecessary casts, object creation and a few more.
  2. Fixed use of loggers in DefaultCodegen to use object placeholders which are faster, decrease object allocation in String pool and adds nullsafety in loggers

@agilob
Copy link
Contributor Author

agilob commented Feb 25, 2021

@wing328 @jimschubert

compile pattern ahead of time to reduce object creation and optimize
method
@agilob
Copy link
Contributor Author

agilob commented Feb 25, 2021

Another commit replaces very frequently used string.replace() with pattern / matcher / replace where pattern is compiled ahead of time to reduce number of times of compiling pattern in java.lang.String.replaceAll. Method doing String.replace is called in loops.

@wing328
Copy link
Member

wing328 commented Feb 27, 2021

cc @OpenAPITools/generator-core-team

@agilob
Copy link
Contributor Author

agilob commented Mar 1, 2021

No one from this list ever responds

Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wing328 wing328 merged commit a34569f into OpenAPITools:master Mar 2, 2021
@wing328 wing328 added Enhancement: Code Cleanup General refactoring, removal of deprecated things, commenting, etc. Enhancement: General Feature: Generator labels Mar 2, 2021
@wing328 wing328 added this to the 5.1.0 milestone Mar 2, 2021
@agilob
Copy link
Contributor Author

agilob commented Mar 2, 2021

Thanks

@agilob agilob deleted the redundant-operations branch March 2, 2021 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement: Code Cleanup General refactoring, removal of deprecated things, commenting, etc. Enhancement: General Feature: Generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants