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

Dev Idea: compare object types using instanceof instead of class names #9021

Open
bencomp opened this issue Oct 4, 2022 · 1 comment
Open
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: None No user-facing feature in particular Type: Suggestion an idea User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc.

Comments

@bencomp
Copy link
Contributor

bencomp commented Oct 4, 2022

Overview of the Feature Request
This is a simple idea relating to code style and type safety: if you want to test whether an object is of a certain type, use the Java keyword instanceof.

What kind of user is the feature intended for?

Developers.

What inspired the request?

A TODO comment asking if there was a better way to compare types.

What existing behavior do you want changed?

No application behaviour should be changed; this is a small suggestion for refactoring. (I don't think this will be introduced again, though it's good to keep an eye out for developer behaviour.)

Any brand new behavior do you want to add to Dataverse?

No.

Any related open or closed issues to this feature request?

Well, #775 and #3950 are related to code style.

I already suggested changes in PRs #9010 and #9014.

@bencomp
Copy link
Contributor Author

bencomp commented Sep 7, 2023

SonarLint and Sonarcloud also suggest to compare types using instanceof, so this may be another reason for #9846

@pdurbin pdurbin added Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: None No user-facing feature in particular Type: Suggestion an idea User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc. labels Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: None No user-facing feature in particular Type: Suggestion an idea User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc.
Projects
None yet
Development

No branches or pull requests

2 participants