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

Forbid constructor calls #5185

Closed
jcopenhop opened this issue Aug 5, 2022 · 2 comments · Fixed by #5195
Closed

Forbid constructor calls #5185

jcopenhop opened this issue Aug 5, 2022 · 2 comments · Fixed by #5195
Labels

Comments

@jcopenhop
Copy link

Expected Behavior of the rule

Forbid the usage of a constructor like the same way we have ForbiddenMethodCall.

Context

I'd like to prevent the usage of the java.math.BigDecimal(double) constructor. See https://stackoverflow.com/a/7186298 for explanation.

@jcopenhop jcopenhop added the rules label Aug 5, 2022
@cortinico
Copy link
Member

I'd like to prevent the usage of the java.math.BigDecimal(double) constructor

Out of curiosity: have you tried using ForbiddenMethodCall for this?

@BraisGabin
Copy link
Member

I checked, right now it's not possible. I just created #5195 to address it inside ForbiddenMethodCall.

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

Successfully merging a pull request may close this issue.

3 participants