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

Purpose of class name comparison in compareTo? #39

Closed
dclements opened this issue Jan 14, 2013 · 1 comment
Closed

Purpose of class name comparison in compareTo? #39

dclements opened this issue Jan 14, 2013 · 1 comment

Comments

@dclements
Copy link
Contributor

At a few points in the code compareTo is implemented with the following pattern:

if (e instanceof SomeClass) {
    //Standard compareTo check.
} else {
    return getClass().getName().compareTo(e.getClass().getName());
}

What is this pattern supposed to be looking for?

@dclements
Copy link
Contributor Author

Marking as a duplicate of #40, since the underlying issue seems to be the mixing of different types of comparison.

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

No branches or pull requests

1 participant