diff --git a/README.md b/README.md
index c10f032..082f194 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ Pure Java (java.util), no dependencies, very small method count.
**Gradle:**
```
dependencies {
- implementation 'com.g00fy2:versioncompare:1.3.5'
+ implementation 'com.g00fy2:versioncompare:1.3.6'
}
```
**Maven:**
@@ -20,7 +20,7 @@ dependencies {
com.g00fy2
versioncompare
- 1.3.5
+ 1.3.6
```
@@ -89,7 +89,7 @@ suffix compare logic ||
## Sample App
![Image](https://raw.githubusercontent.com/G00fY2/version-compare/gh-pages/images/version_compare_sampleapp_framed.png)
-**Try out the sample app to compare your version inputs: [Download APK](https://github.com/G00fY2/version-compare/releases/download/1.3.5/version-compare-1.3.5-sample.apk)**
+**Try out the sample app to compare your version inputs: [Download APK](https://github.com/G00fY2/version-compare/releases/download/1.3.6/version-compare-1.3.6-sample.apk)**
## License
Copyright (C) 2018 Thomas Wirth
diff --git a/build.gradle b/build.gradle
index 0548cf5..6a6d234 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:4.0.2'
+ classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
}
}
diff --git a/versioncompare/deploy.gradle b/versioncompare/deploy.gradle
index 4419cdc..70bcfbc 100644
--- a/versioncompare/deploy.gradle
+++ b/versioncompare/deploy.gradle
@@ -11,7 +11,7 @@ ext {
issueUrl = 'https://github.com/G00fY2/version-compare/issues'
gitUrl = 'https://github.com/G00fY2/version-compare.git'
- libraryVersion = '1.3.5'
+ libraryVersion = '1.3.6'
developerId = 'g00fy2'
developerName = 'Thomas Wirth'
diff --git a/versioncompare/src/main/java/com/g00fy2/versioncompare/Version.java b/versioncompare/src/main/java/com/g00fy2/versioncompare/Version.java
index ef0f525..62d0514 100644
--- a/versioncompare/src/main/java/com/g00fy2/versioncompare/Version.java
+++ b/versioncompare/src/main/java/com/g00fy2/versioncompare/Version.java
@@ -276,7 +276,8 @@ private void initVersion() {
}
}
subversionNumbersWithoutTrailingZeros.addAll(subversionNumbers);
- while (subversionNumbersWithoutTrailingZeros.lastIndexOf(0) >= 0) {
+ while (!subversionNumbersWithoutTrailingZeros.isEmpty() &&
+ subversionNumbersWithoutTrailingZeros.lastIndexOf(0) == subversionNumbersWithoutTrailingZeros.size() -1) {
subversionNumbersWithoutTrailingZeros.remove(subversionNumbersWithoutTrailingZeros.lastIndexOf(0));
}
if (suffixSb != null) suffix = suffixSb.toString();
diff --git a/versioncompare/src/test/java/com/g00fy2/versioncompare/VersionTestHigherLower.java b/versioncompare/src/test/java/com/g00fy2/versioncompare/VersionTestHigherLower.java
index 7581eb5..a980719 100644
--- a/versioncompare/src/test/java/com/g00fy2/versioncompare/VersionTestHigherLower.java
+++ b/versioncompare/src/test/java/com/g00fy2/versioncompare/VersionTestHigherLower.java
@@ -14,6 +14,8 @@
@Parameters public static Collection