aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util/locks/SingletonInstance.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
committerSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
commitdf9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch)
tree239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/common/util/locks/SingletonInstance.java
parenteb47aaba63e3b1bf55f274a0f338f1010a017ae4 (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/com/jogamp/common/util/locks/SingletonInstance.java')
-rw-r--r--src/java/com/jogamp/common/util/locks/SingletonInstance.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/java/com/jogamp/common/util/locks/SingletonInstance.java b/src/java/com/jogamp/common/util/locks/SingletonInstance.java
index f016d4b..ee703cd 100644
--- a/src/java/com/jogamp/common/util/locks/SingletonInstance.java
+++ b/src/java/com/jogamp/common/util/locks/SingletonInstance.java
@@ -37,11 +37,11 @@ public abstract class SingletonInstance implements Lock {
protected static final boolean DEBUG = true;
- public static SingletonInstance createFileLock(long poll_ms, String lockFileBasename) {
+ public static SingletonInstance createFileLock(final long poll_ms, final String lockFileBasename) {
return new SingletonInstanceFileLock(poll_ms, lockFileBasename);
}
- public static SingletonInstance createFileLock(long poll_ms, File lockFile) {
+ public static SingletonInstance createFileLock(final long poll_ms, final File lockFile) {
return new SingletonInstanceFileLock(poll_ms, lockFile);
}
@@ -58,11 +58,11 @@ public abstract class SingletonInstance implements Lock {
* @param pollPeriod
* @param portNumber to be used for this single instance server socket.
*/
- public static SingletonInstance createServerSocket(long poll_ms, int portNumber) {
+ public static SingletonInstance createServerSocket(final long poll_ms, final int portNumber) {
return new SingletonInstanceServerSocket(poll_ms, portNumber);
}
- protected SingletonInstance(long poll_ms) {
+ protected SingletonInstance(final long poll_ms) {
this.poll_ms = Math.max(10, poll_ms);
}
@@ -79,7 +79,7 @@ public abstract class SingletonInstance implements Lock {
return;
}
} while ( true ) ;
- } catch ( RuntimeException ie ) {
+ } catch ( final RuntimeException ie ) {
throw new RuntimeException(ie);
}
}
@@ -109,7 +109,7 @@ public abstract class SingletonInstance implements Lock {
maxwait -= System.currentTimeMillis()-t1;
i++;
} while ( 0 < maxwait ) ;
- } catch ( InterruptedException ie ) {
+ } catch ( final InterruptedException ie ) {
final long t2 = System.currentTimeMillis();
throw new RuntimeException(infoPrefix(t2)+" EEE (1) "+getName()+" - couldn't get lock within "+(t2-t0)+" ms, "+i+" attempts", ie);
}
@@ -139,7 +139,7 @@ public abstract class SingletonInstance implements Lock {
return locked;
}
- protected String infoPrefix(long currentMillis) {
+ protected String infoPrefix(final long currentMillis) {
return "SLOCK [T "+Thread.currentThread().getName()+" @ "+currentMillis+" ms";
}
protected String infoPrefix() {