aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main/java/org
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-03-24 20:26:11 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-03-24 20:26:11 +0100
commitf8090239d79037bd1d75a7576058c4da042c4070 (patch)
treec0aaae18a0fb03c5cb895f48dcf990bc24d69731 /sonar-plugin-api/src/main/java/org
parent891f9fe52635c0d9714d60fb99308c201bfa4108 (diff)
downloadsonarqube-f8090239d79037bd1d75a7576058c4da042c4070.tar.gz
sonarqube-f8090239d79037bd1d75a7576058c4da042c4070.zip
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api/src/main/java/org')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java
index f009dc61756..dcd96d9cbb4 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Version.java
@@ -109,13 +109,14 @@ public class Version implements Comparable<Version> {
int major = 0;
int minor = 0;
int patch = 0;
- if (split.size() > 0) {
+ int size = split.size();
+ if (size > 0) {
major = parseSequence(split.get(0));
- if (split.size() > 1) {
+ if (size > 1) {
minor = parseSequence(split.get(1));
- if (split.size() > 2) {
+ if (size > 2) {
patch = parseSequence(split.get(2));
- if (split.size() > 3) {
+ if (size > 3) {
throw new IllegalArgumentException("Only 3 sequences are accepted");
}
}