remove java 6 api usage
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1492982 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
index fc6e08d..ce3e49f 100644
--- a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
+++ b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/util/DependencyModel.java
@@ -576,25 +576,23 @@
/**
* Acquires the read lock only and only if no read lock is already held by the current thread.
+ *
+ * As the introspection methods provided by this method are java 6+, we just take a read lock.
* @return {@literal true} if the lock was acquired within the method, {@literal false} otherwise.
*/
public boolean acquireReadLockIfNotHeld() {
- if (m_lock.getReadHoldCount() == 0) {
- m_lock.readLock().lock();
- return true;
- }
- return false;
+ m_lock.readLock().lock();
+ return true;
}
/**
* Releases the read lock only and only if the read lock is held by the current thread.
+ * * As the introspection methods provided by this method are java 6+, we just unlock the read lock.
* @return {@literal true} if the lock has no more holders, {@literal false} otherwise.
*/
public boolean releaseReadLockIfHeld() {
- if (m_lock.getReadHoldCount() > 0) {
- m_lock.readLock().unlock();
- }
- return m_lock.getWriteHoldCount() == 0;
+ m_lock.readLock().unlock();
+ return true;
}
/**