From df9ff7f340a5ab4e07efc613f5f264eeae63d4c7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 3 Jul 2014 16:06:47 +0200 Subject: 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 --- .../jogamp/common/util/locks/RecursiveLockImplJava5.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java') diff --git a/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java b/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java index f3dfa42..badaa72 100644 --- a/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java +++ b/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java @@ -10,7 +10,7 @@ public class RecursiveLockImplJava5 implements RecursiveLock { volatile Thread owner = null; ReentrantLock lock; - public RecursiveLockImplJava5(boolean fair) { + public RecursiveLockImplJava5(final boolean fair) { lock = new ReentrantLock(fair); } @@ -20,14 +20,14 @@ public class RecursiveLockImplJava5 implements RecursiveLock { if(!tryLock(TIMEOUT)) { throw new RuntimeException("Waited "+TIMEOUT+"ms for: "+threadName(owner)+" - "+threadName(Thread.currentThread())+", with count "+getHoldCount()+", lock: "+this); } - } catch (InterruptedException e) { + } catch (final InterruptedException e) { throw new RuntimeException("Interrupted", e); } owner = Thread.currentThread(); } @Override - public boolean tryLock(long timeout) throws InterruptedException { + public boolean tryLock(final long timeout) throws InterruptedException { if(lock.tryLock(timeout, TimeUnit.MILLISECONDS)) { owner = Thread.currentThread(); return true; @@ -41,7 +41,7 @@ public class RecursiveLockImplJava5 implements RecursiveLock { } @Override - public void unlock(Runnable taskAfterUnlockBeforeNotify) { + public void unlock(final Runnable taskAfterUnlockBeforeNotify) { validateLocked(); owner = null; if(null!=taskAfterUnlockBeforeNotify) { @@ -66,7 +66,7 @@ public class RecursiveLockImplJava5 implements RecursiveLock { } @Override - public boolean isOwner(Thread thread) { + public boolean isOwner(final Thread thread) { return lock.isLocked() && owner == thread; } @@ -91,5 +91,5 @@ public class RecursiveLockImplJava5 implements RecursiveLock { return lock.getQueueLength(); } - private String threadName(Thread t) { return null!=t ? "<"+t.getName()+">" : "" ; } + private String threadName(final Thread t) { return null!=t ? "<"+t.getName()+">" : "" ; } } -- cgit v1.2.3