Skip to content

Fix constant name lookup for null name prefix #57

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
Closed

Fix constant name lookup for null name prefix #57

wants to merge 1 commit into from

Conversation

sslavic
Copy link
Contributor

@sslavic sslavic commented Mar 13, 2012

Even though javadoc fo Constants.toCode specifies that null value for
namePrefix parameter is allowed, before this change pasing null would
throw NullPointerException.

This change fixes constant name lookup for null name prefix as if empty
name prefix was used so that all names match, and lookup is performed
only by constant value. This way of handling null value for name prefix
is consistent with the rest of Constants class API.

Issue: SPR-8278

I have signed and agree to the terms in the SpringSource Individual Contributor License Agreement.

Even though javadoc fo Constants.toCode specifies that null value for
namePrefix parameter is allowed, before this change pasing null would
throw NullPointerException.

This change fixes constant name lookup for null name prefix as if empty
name prefix was used so that all names match, and lookup is performed
only by constant value. This way of handling null value for name prefix
is consistent with the rest of Constants class API.

Issue: SPR-8278
cbeams added a commit that referenced this pull request May 17, 2012
* SPR-8278:
  Fix compiler warnings in Constants/ConstantsTests
  Allow null params as advertised in Constants#toCode*
@cbeams
Copy link
Contributor

cbeams commented May 17, 2012

Thanks, Stevo, this is merged. Take a look at 6ffb043; you'll see I applied your fix to the #toCodeForSuffix method as well, and for the same reasons.

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