[
https://issues.apache.org/jira/browse/SCB-1047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16708341#comment-16708341
]
ASF GitHub Bot commented on SCB-1047:
-------------------------------------
heyile commented on a change in pull request #1013: [SCB-1047]microservice.yaml
service_description.version support form…
URL:
https://github.com/apache/servicecomb-java-chassis/pull/1013#discussion_r238558539
##########
File path:
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/version/Version.java
##########
@@ -21,37 +21,41 @@
import org.apache.commons.lang.ArrayUtils;
+import com.google.common.annotations.VisibleForTesting;
+
// short version is enough
public class Version implements Comparable<Version> {
- private static final String[] ZERO = new String[] {"0", "0", "0"};
+ private static final String[] ZERO = new String[] {"0", "0", "0", "0"};
private final short major;
private final short minor;
private final short patch;
+ private final short build;
+
private final String version;
private final long numberVersion;
// 1
// 1.0
// 1.0.0
+ // 1.0.0.0
public Version(String version) {
Objects.requireNonNull(version);
String[] versions = version.split("\\.", -1);
- if (versions.length > 3) {
+ if (versions.length > 4) {
throw new IllegalStateException(String.format("Invalid version \"%s\".",
version));
}
- if (versions.length < 3) {
- versions = (String[]) ArrayUtils.addAll(versions, ZERO);
- }
+ versions = (String[]) ArrayUtils.addAll(versions, ZERO);
Review comment:
ok
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> microservice.yaml service_description.version support format xxx.xx.xxx.xxx
> ----------------------------------------------------------------------------
>
> Key: SCB-1047
> URL: https://issues.apache.org/jira/browse/SCB-1047
> Project: Apache ServiceComb
> Issue Type: Improvement
> Components: Java-Chassis
> Reporter: 何一乐
> Assignee: 何一乐
> Priority: Major
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)