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

[MRESOLVER-465] Make room for alternate version scheme #407

Merged
merged 4 commits into from
Jan 17, 2024

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Jan 17, 2024

Since eons Resolver had the "generic" scheme implementing the Version, VersionRange and VersionConstraint API interfaces.

Interesting fact: GenericVersionRange and GenericVersionConstraint are NOT tied in any way to GenericVersion implementation, they are happy with plain Version interface as well, they are truly "generic".

This means, that a scheme needs really only to provide Version implementation (currently in form of GenericVersion) and a "factory" for it (currently in a form of GenericVersionScheme).

Refactor a bit, and make room for alternate Version implementations.

Fact: the change can be done in source and binary compatible way, and is enforced by japicmp.


https://issues.apache.org/jira/browse/MRESOLVER-465

@cstamas cstamas self-assigned this Jan 17, 2024
}

@Override
public boolean equals(final Object obj) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense at all ? This isn't a data object. If there's a need, they should be identified by a name imho.

}

@Override
public int hashCode() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Useless

@cstamas
Copy link
Member Author

cstamas commented Jan 17, 2024

@gnodet agreed with all, but I did not change any of these (all is same as it is in today code, recheck if you want), all I did is split the class (support + generic scheme). The idea is to have new version scheme provided by Resolver in this very same package (not by "third party" as that would open up a can of worms).

@gnodet
Copy link
Contributor

gnodet commented Jan 17, 2024

@gnodet agreed with all, but I did not change any of these, all I did is split the class (support + generic scheme). The idea is to have new version scheme provided by Resolver in this very same package (not by "third party" as that would open up a can of worms).

Then VersionSchemeSupport should not be public. That will remove almost all those problems.

New scheme should and can be delivered by Resolver ONLY in
this very same package.
@cstamas
Copy link
Member Author

cstamas commented Jan 17, 2024

Oh, yes, true, oversight on my part. Fixed

@gnodet
Copy link
Contributor

gnodet commented Jan 17, 2024

Oh, yes, true, oversight on my part. Fixed

Much better now. Do we need to keep the hashCode / equals on version scheme ? They really look weird on a pure service class.

@cstamas
Copy link
Member Author

cstamas commented Jan 17, 2024

Removed them.

@cstamas cstamas merged commit 42e1604 into apache:master Jan 17, 2024
4 checks passed
@cstamas cstamas deleted the MRESOLVER-465 branch January 17, 2024 15:34
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