felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uiter...@apache.org
Subject svn commit: r1489374 - /felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java
Date Tue, 04 Jun 2013 10:29:49 GMT
Author: uiterlix
Date: Tue Jun  4 10:29:48 2013
New Revision: 1489374

URL: http://svn.apache.org/r1489374
Log:
removed use of AtomicLong in BundleContextInterceptor since it's a 1.5+ feature.

Modified:
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java?rev=1489374&r1=1489373&r2=1489374&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java
Tue Jun  4 10:29:48 2013
@@ -37,7 +37,7 @@ import org.osgi.framework.ServiceReferen
  */
 public class BundleContextInterceptor extends BundleContextInterceptorBase {
 	private static final String INDEX_LOG_BAD_PERFORMING_FILTERS = "org.apache.felix.dependencymanager.index.logbadperformingfilters";
-	private static AtomicLong maxLookupTime = new AtomicLong(0L);
+	private static long maxLookupTime = 0L;
     private final ServiceRegistryCache m_cache;
     private final boolean perfmon = "true".equals(System.getProperty(INDEX_LOG_BAD_PERFORMING_FILTERS));
 	private final Logger m_logger;
@@ -102,8 +102,8 @@ public class BundleContextInterceptor ex
             }
             if (perfmon) {
 	        	long duration = System.currentTimeMillis() - start;
-	        	if (maxLookupTime.get() < duration) {
-	        		maxLookupTime.set(duration);
+	        	if (maxLookupTime < duration) {
+	        		maxLookupTime = duration;
 	        		m_logger.log(org.apache.felix.dm.impl.Logger.LOG_DEBUG, "new worst performing
filter (" + duration + "ms.): " + clazz + " " + filter);
 	        	}
             }
@@ -117,8 +117,8 @@ public class BundleContextInterceptor ex
             ServiceReference[] serviceReferences = m_context.getServiceReferences(clazz,
filter);
             if (perfmon) {
 	        	long duration = System.currentTimeMillis() - start;
-	        	if (maxLookupTime.get() < duration) {
-	        		maxLookupTime.set(duration);
+	        	if (maxLookupTime < duration) {
+	        		maxLookupTime = duration;
 	        		System.out.println("new worst performing filter (" + duration + "ms.): " + clazz
+ " " + filter);
 	        	}
             }



Mime
View raw message