diff options
author | Pepich <benedikt.abel@yahoo.de> | 2017-03-10 14:21:05 +0100 |
---|---|---|
committer | Pepich <benedikt.abel@yahoo.de> | 2017-03-10 14:21:05 +0100 |
commit | 1c9d972aa57df7287e02ba06c90aaf40a3e285c0 (patch) | |
tree | 6ac963affe09cef23e1bb9307fe19c2fb5723459 | |
parent | 39fa3e2122bf94ced564137a7322511a49dad202 (diff) |
Fixed compatibility check to no longer throw NPE
-rw-r--r-- | src/com/redstoner/misc/VersionHelper.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/redstoner/misc/VersionHelper.java b/src/com/redstoner/misc/VersionHelper.java index f815c7c..9e7bf35 100644 --- a/src/com/redstoner/misc/VersionHelper.java +++ b/src/com/redstoner/misc/VersionHelper.java @@ -8,7 +8,7 @@ import com.redstoner.exceptions.MissingVersionException; /** This class can be used to compare modules against the loader version or against each other to prevent dependency issues. * * @author Pepich */ -@Version(major = 2, minor = 1, revision = 0, compatible = 0) +@Version(major = 2, minor = 1, revision = 1, compatible = 0) public final class VersionHelper { private VersionHelper() @@ -26,8 +26,8 @@ public final class VersionHelper throw new MissingVersionException("The API is not annotated with a version."); if (!module.isAnnotationPresent(Version.class)) throw new MissingVersionException("The module is not annotated with a version."); - Version apiVersion = api.getClass().getAnnotation(Version.class); - Version moduleVersion = module.getClass().getAnnotation(Version.class); + Version apiVersion = api.getAnnotation(Version.class); + Version moduleVersion = module.getAnnotation(Version.class); return isCompatible(apiVersion, moduleVersion); } @@ -41,7 +41,7 @@ public final class VersionHelper { if (!module.isAnnotationPresent(Version.class)) throw new MissingVersionException("The module is not annotated with a version."); - Version moduleVersion = module.getClass().getAnnotation(Version.class); + Version moduleVersion = module.getAnnotation(Version.class); return isCompatible(apiVersion, moduleVersion); } @@ -55,7 +55,7 @@ public final class VersionHelper { if (!api.isAnnotationPresent(Version.class)) throw new MissingVersionException("The API is not annotated with a version."); - Version apiVersion = api.getClass().getAnnotation(Version.class); + Version apiVersion = api.getAnnotation(Version.class); return isCompatible(apiVersion, moduleVersion); } |