aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolframhaussig <13997737+wolframhaussig@users.noreply.github.com>2021-06-13 11:30:07 +0200
committerGitHub <noreply@github.com>2021-06-13 12:30:07 +0300
commita6bcc3bb33f7aee51ae8d6108f4cd28cf468054f (patch)
treeb6adb275cb947f32cf294cd1466a6536f1343121
parentdac4edb5f3fbfd5e5aae81ae4eb3c4dad2e7f732 (diff)
downloadpf4j-a6bcc3bb33f7aee51ae8d6108f4cd28cf468054f.tar.gz
pf4j-a6bcc3bb33f7aee51ae8d6108f4cd28cf468054f.zip
Fixed Dependency version check fails even if required is * (#451)
-rw-r--r--pf4j/src/main/java/org/pf4j/DefaultVersionManager.java2
-rw-r--r--pf4j/src/test/java/org/pf4j/DefaultVersionManagerTest.java1
2 files changed, 2 insertions, 1 deletions
diff --git a/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java b/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java
index 8c60d08..fc9bc47 100644
--- a/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java
+++ b/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java
@@ -39,7 +39,7 @@ public class DefaultVersionManager implements VersionManager {
*/
@Override
public boolean checkVersionConstraint(String version, String constraint) {
- return StringUtils.isNullOrEmpty(constraint) || Version.valueOf(version).satisfies(constraint);
+ return StringUtils.isNullOrEmpty(constraint) || "*".equals(constraint) || Version.valueOf(version).satisfies(constraint);
}
@Override
diff --git a/pf4j/src/test/java/org/pf4j/DefaultVersionManagerTest.java b/pf4j/src/test/java/org/pf4j/DefaultVersionManagerTest.java
index 3a277db..a7a007e 100644
--- a/pf4j/src/test/java/org/pf4j/DefaultVersionManagerTest.java
+++ b/pf4j/src/test/java/org/pf4j/DefaultVersionManagerTest.java
@@ -39,6 +39,7 @@ public class DefaultVersionManagerTest {
public void checkVersionConstraint() {
assertFalse(versionManager.checkVersionConstraint("1.4.3", ">2.0.0")); // simple
assertTrue(versionManager.checkVersionConstraint("1.4.3", ">=1.4.0 & <1.6.0")); // range
+ assertTrue(versionManager.checkVersionConstraint("undefined", "*"));
}
@Test