Skip to content

Conditional Error Message Formatting #797

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

Closed
wants to merge 1 commit into from

Conversation

marschall
Copy link
Contributor

Create error message strings only if an actual error has happened. This
seems to be the common pattern in the code base base and saves both CPU
and memory. We found only very few places where unconditional error
message formatting happens.

  • fix unconditional error message formatting in
    AdviceModeImportSelector
  • fix unconditional error message formatting in AnnotationAttributes
  • fix unconditional error message formatting in
    ReadOnlySystemAttributesMap, this also fixes a potential
    NullPointerException

I did sign the CLA.

Issue: SPR-13007

Create error message strings only if an actual error has happened. This
seems to be the common pattern in the code base base and saves both CPU
and memory. We found only very few places where unconditional error
message formatting happens.

 - fix unconditional error message formatting in
   AdviceModeImportSelector

 - fix unconditional error message formatting in AnnotationAttributes

 - fix unconditional error message formatting in
   ReadOnlySystemAttributesMap, this also fixes a potential
   NullPointerException

I did sign the CLA.

Issue: SPR-13007
@sbrannen sbrannen self-assigned this May 10, 2015
sbrannen added a commit that referenced this pull request May 10, 2015
* SPR-13007:
  Avoid eager formatting in pre-condition checks
@sbrannen
Copy link
Member

This has been merged in master in commit 92c1751. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants