-
Notifications
You must be signed in to change notification settings - Fork 127
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
Conversation
Refactor bits to make introduction of new scheme simpler. --- https://issues.apache.org/jira/browse/MRESOLVER-465
maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionConstraint.java
Show resolved
Hide resolved
maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionRange.java
Show resolved
Hide resolved
maven-resolver-util/src/main/java/org/eclipse/aether/util/version/VersionSchemeSupport.java
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
public boolean equals(final Object obj) { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless
@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). |
Then |
New scheme should and can be delivered by Resolver ONLY in this very same package.
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. |
Removed them. |
Since eons Resolver had the "generic" scheme implementing the
Version
,VersionRange
andVersionConstraint
API interfaces.Interesting fact:
GenericVersionRange
andGenericVersionConstraint
are NOT tied in any way toGenericVersion
implementation, they are happy with plainVersion
interface as well, they are truly "generic".This means, that a scheme needs really only to provide
Version
implementation (currently in form ofGenericVersion
) and a "factory" for it (currently in a form ofGenericVersionScheme
).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