summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-12-12 17:35:35 +0100
committerSven Gothel <[email protected]>2014-12-13 16:02:46 +0100
commitf5be4f13bd54169f113f0494bae063c9895b5911 (patch)
tree08936e0a3accfc926640f0ca7ba5e151e89efc20
parent233521f56d23c4b5fef1b7f30252440e40dd1b86 (diff)
TempFileCache/TempJarCache: Fix NPE in DEBUG mode
-rw-r--r--src/java/com/jogamp/common/util/cache/TempFileCache.java5
-rw-r--r--src/java/com/jogamp/common/util/cache/TempJarCache.java4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/util/cache/TempFileCache.java b/src/java/com/jogamp/common/util/cache/TempFileCache.java
index b58ea28..24f0237 100644
--- a/src/java/com/jogamp/common/util/cache/TempFileCache.java
+++ b/src/java/com/jogamp/common/util/cache/TempFileCache.java
@@ -87,8 +87,11 @@ public class TempFileCache {
tmpBaseDir = _tmpBaseDir;
if (DEBUG) {
+ final String tmpBaseDirAbsPath = null != tmpBaseDir ? tmpBaseDir.getAbsolutePath() : null;
System.err.println("TempFileCache: Static Initialization ---------------------------------------------- OK: "+(!staticInitError));
- System.err.println("TempFileCache: Thread: "+Thread.currentThread().getName()+", CL 0x"+Integer.toHexString(TempFileCache.class.getClassLoader().hashCode())+", tempBaseDir "+tmpBaseDir.getAbsolutePath());
+ System.err.println("TempFileCache: Thread: "+Thread.currentThread().getName()+
+ ", CL 0x"+Integer.toHexString(TempFileCache.class.getClassLoader().hashCode())+
+ ", tempBaseDir "+tmpBaseDirAbsPath);
}
if(!staticInitError) {
diff --git a/src/java/com/jogamp/common/util/cache/TempJarCache.java b/src/java/com/jogamp/common/util/cache/TempJarCache.java
index 1b322d7..940cea2 100644
--- a/src/java/com/jogamp/common/util/cache/TempJarCache.java
+++ b/src/java/com/jogamp/common/util/cache/TempJarCache.java
@@ -101,7 +101,9 @@ public class TempJarCache {
resourceFileJars = new HashMap<URI, LoadState>();
}
if(DEBUG) {
- System.err.println("TempJarCache.initSingleton(): ok "+(false==staticInitError)+", "+ tmpFileCache.getTempDir());
+ final File tempDir = null != tmpFileCache ? tmpFileCache.getTempDir() : null;
+ final String tempDirAbsPath = null != tempDir ? tempDir.getAbsolutePath() : null;
+ System.err.println("TempJarCache.initSingleton(): ok "+(false==staticInitError)+", "+ tempDirAbsPath);
}
isInit = true;
}