diff options
author | Sven Gothel <[email protected]> | 2014-12-12 17:35:35 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-12-12 17:35:35 +0100 |
commit | f26fcc971dc95ffb7033ac9e539a3c0ebb43025a (patch) | |
tree | 5105eae0cf7efb853329ed088dc0161462b7c3f6 /src | |
parent | 235a64d1f2354fa15805d1759ff0b46c71338b4f (diff) |
TempFileCache/TempJarCache: Fix NPE in DEBUG mode
Diffstat (limited to 'src')
-rw-r--r-- | src/java/com/jogamp/common/util/cache/TempFileCache.java | 5 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/cache/TempJarCache.java | 4 |
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 05d92e1..ed69ddc 100644 --- a/src/java/com/jogamp/common/util/cache/TempJarCache.java +++ b/src/java/com/jogamp/common/util/cache/TempJarCache.java @@ -100,7 +100,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; } |