summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/common/util/JogampVersion.java6
-rw-r--r--src/java/com/jogamp/common/util/VersionNumber.java6
2 files changed, 7 insertions, 5 deletions
diff --git a/src/java/com/jogamp/common/util/JogampVersion.java b/src/java/com/jogamp/common/util/JogampVersion.java
index 2c218ce..f7da413 100644
--- a/src/java/com/jogamp/common/util/JogampVersion.java
+++ b/src/java/com/jogamp/common/util/JogampVersion.java
@@ -48,9 +48,9 @@ public class JogampVersion {
protected JogampVersion(String packageName, Manifest mf) {
this.packageName = packageName;
- this.mf = mf;
- this.hash = mf.hashCode();
- mainAttributes = mf.getMainAttributes();
+ this.mf = ( null != mf ) ? mf : new Manifest();
+ this.hash = this.mf.hashCode();
+ mainAttributes = this.mf.getMainAttributes();
mainAttributeNames = mainAttributes.keySet();
}
diff --git a/src/java/com/jogamp/common/util/VersionNumber.java b/src/java/com/jogamp/common/util/VersionNumber.java
index 8c997e6..f0ba820 100644
--- a/src/java/com/jogamp/common/util/VersionNumber.java
+++ b/src/java/com/jogamp/common/util/VersionNumber.java
@@ -54,9 +54,11 @@ public class VersionNumber implements Comparable {
}
public final int compareTo(Object o) {
- if( ! ( o instanceof VersionNumber ) ) {
- return -1;
+ if ( ! ( o instanceof VersionNumber ) ) {
+ Class c = (null != o) ? o.getClass() : null ;
+ throw new ClassCastException("Not a Capabilities object: " + c);
}
+
VersionNumber vo = (VersionNumber) o;
if (major > vo.major) {
return 1;