Runtime.Version
Robert Scholte
rfscholte at apache.org
Sat Jul 8 16:59:54 UTC 2017
Hi,
I'm kind of surprised by the number of methods of Runtime.Version:
http://download.java.net/java/jigsaw/docs/api/java/lang/Runtime.Version.html
Based on my experience with versions I would advice to reduce the number
of methods.
With Maven we had this interface:
http://maven.apache.org/ref/3.5.0/maven-artifact/apidocs/org/apache/maven/artifact/versioning/ArtifactVersion.html
However, in the end all those separate segments didn't add a thing and are
actually causing unnecessary complex code in case we were doing other
implementations with ArtifactVersion. ArtifactVersion is quite an
important interface in our code, so there's no simple solution to simplify
this mistake.
I'm really pleased that for Aether (which is now back at Maven as Artifact
Resolver) it is all reduced to this:
http://maven.apache.org/resolver/apidocs/org/eclipse/aether/version/Version.html
This is all we need: parsing + comparing (+ #toString()). If none of the
additional methods of Runtime.Version is used *yet*, you should consider
to remove them.
thanks,
Robert
More information about the jpms-spec-experts
mailing list