Skip to content

Fix issue #761 #920

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

Merged
merged 1 commit into from
Sep 7, 2019
Merged

Fix issue #761 #920

merged 1 commit into from
Sep 7, 2019

Conversation

Azureyjt
Copy link
Contributor

@Azureyjt Azureyjt commented Sep 5, 2019

This PR solves issue #761

  • Add a flag to record whether the constructor is invoked for the first time. If not, throw corresponding exception.
  • Add test case to test creating new instance by reflection.

…ing by Reflection call will be successful if you do that firstly
@iluwatar iluwatar self-assigned this Sep 7, 2019
@iluwatar iluwatar added this to the 1.21.0 milestone Sep 7, 2019
@iluwatar iluwatar merged commit f141033 into iluwatar:master Sep 7, 2019
@iluwatar
Copy link
Owner

iluwatar commented Sep 7, 2019

Thanks @Azureyjt for this fix 👍

@DeclanWang
Copy link

I think this just guarantee that the private constructor will only be invoked once but still can't prevent initiation via Reflection at the first time, right?

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

Successfully merging this pull request may close these issues.

3 participants