diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
commit | df9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch) | |
tree | 239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java | |
parent | eb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java')
-rw-r--r-- | src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java b/src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java index a3d3ac9..44a5d28 100644 --- a/src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java +++ b/src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java @@ -41,11 +41,11 @@ public class SingletonInstanceFileLock extends SingletonInstance { static { String s = null; try { - File tmpFile = File.createTempFile("TEST", "tst"); - String absTmpFile = tmpFile.getCanonicalPath(); + final File tmpFile = File.createTempFile("TEST", "tst"); + final String absTmpFile = tmpFile.getCanonicalPath(); tmpFile.delete(); s = absTmpFile.substring(0, absTmpFile.lastIndexOf(File.separator)); - } catch (IOException ex) { + } catch (final IOException ex) { ex.printStackTrace(); } temp_file_path = s; @@ -55,17 +55,17 @@ public class SingletonInstanceFileLock extends SingletonInstance { return temp_file_path; } - public static String getCanonicalTempLockFilePath(String basename) { + public static String getCanonicalTempLockFilePath(final String basename) { return getCanonicalTempPath() + File.separator + basename; } - public SingletonInstanceFileLock(long poll_ms, String lockFileBasename) { + public SingletonInstanceFileLock(final long poll_ms, final String lockFileBasename) { super(poll_ms); file = new File ( getCanonicalTempLockFilePath ( lockFileBasename ) ); setupFileCleanup(); } - public SingletonInstanceFileLock(long poll_ms, File lockFile) { + public SingletonInstanceFileLock(final long poll_ms, final File lockFile) { super(poll_ms); file = lockFile ; setupFileCleanup(); @@ -96,7 +96,7 @@ public class SingletonInstanceFileLock extends SingletonInstance { if (fileLock != null) { return true; } - } catch (Exception e) { + } catch (final Exception e) { System.err.println(infoPrefix()+" III "+getName()+" - Unable to create and/or lock file"); e.printStackTrace(); } @@ -118,7 +118,7 @@ public class SingletonInstanceFileLock extends SingletonInstance { file.delete(); } return true; - } catch (Exception e) { + } catch (final Exception e) { System.err.println(infoPrefix()+" EEE "+getName()+" - Unable to remove lock file"); e.printStackTrace(); } finally { |