aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2024-06-24 16:47:55 +0300
committerDecebal Suiu <decebal.suiu@gmail.com>2024-06-24 16:47:55 +0300
commitbee79a6902e188b95b3d1f28ac9a5a1c39464aa9 (patch)
tree56b8d0dc5395b5da6026fd5136afcefd80c31b76
parent7da511c29819802a9caef25580f9fac98edf6b78 (diff)
downloadpf4j-bee79a6902e188b95b3d1f28ac9a5a1c39464aa9.tar.gz
pf4j-bee79a6902e188b95b3d1f28ac9a5a1c39464aa9.zip
Replace Version#valueOf deprecated method
-rw-r--r--pf4j/src/main/java/org/pf4j/DefaultVersionManager.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java b/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java
index fc9bc47..518f54c 100644
--- a/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java
+++ b/pf4j/src/main/java/org/pf4j/DefaultVersionManager.java
@@ -31,20 +31,20 @@ public class DefaultVersionManager implements VersionManager {
* Checks if a version satisfies the specified SemVer {@link Expression} string.
* If the constraint is empty or null then the method returns true.
* Constraint examples: {@code >2.0.0} (simple), {@code ">=1.4.0 & <1.6.0"} (range).
- * See https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges for more info.
+ * See <a href="https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges">semver-expressions-api-ranges</a> for more info.
*
- * @param version
- * @param constraint
- * @return
+ * @param version the version to check
+ * @param constraint the constraint to check
+ * @return {@code true} if the version satisfies the constraint, {@code false} otherwise
*/
@Override
public boolean checkVersionConstraint(String version, String constraint) {
- return StringUtils.isNullOrEmpty(constraint) || "*".equals(constraint) || Version.valueOf(version).satisfies(constraint);
+ return StringUtils.isNullOrEmpty(constraint) || "*".equals(constraint) || Version.parse(version).satisfies(constraint);
}
@Override
public int compareVersions(String v1, String v2) {
- return Version.valueOf(v1).compareTo(Version.valueOf(v2));
+ return Version.parse(v1).compareTo(Version.parse(v2));
}
}