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

Proposed fix for Issue #81 (deprecated constructor always throws an exception) #101

Conversation

JCgH4164838Gh792C124B5
Copy link
Contributor

Proposed fix for Issue #81:

  • Drops OgnlContext(Map values) constructor that always fails with an
    Exception.
  • Additional comments for remaining two constructors.
  • Changed constructor to ensure _values Map can no longer be null.
  • Added comments to setValues(Map value) and getValues() for clarity.
  • Added @OverRide annotations to Map interface methods.

- Drops OgnlContext(Map values) constructor that always fails with an
Exception.
- Additional comments for remaining two constructors.
- Changed constructor to ensure _values Map can no longer be null.
- Added comments to setValues(Map value) and getValues() for clarity.
- Added @OverRide annotations to Map interface methods.
@JCgH4164838Gh792C124B5
Copy link
Contributor Author

Hello OGNL Team.

This PR should address the concern raised in the issue with a little low-risk cleanup added as well.

Other than dropping the deprecated constructor, this PR also ensures the context's values Map cannot be initialized to null (given the usage in the rest of the class, allowing a null values Map does not seem to make sense). That could impact someone who intentionally set the values to null, but preventing this in 3.2.x seems worth that small risk (and the JavaDoc comments indicate null parameters will be set to defaults - except for MemberAccess which cannot be null).

Let me know what you think.

Copy link
Collaborator

@lukaszlenart lukaszlenart left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@lukaszlenart lukaszlenart merged commit e33791e into orphan-oss:master Feb 24, 2020
@lukaszlenart
Copy link
Collaborator

Struts build passed with a SNAPSHOT version, I will wait a bit before pushing a new release

@JCgH4164838Gh792C124B5 JCgH4164838Gh792C124B5 deleted the localOGNL_3_2_Issue81Fix branch March 22, 2020 17:48
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