Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTracker.java')
-rw-r--r--bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTracker.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTracker.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTracker.java
index 9a1b57568..a7fc758ff 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTracker.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTracker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2007, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2007, 2015). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package org.osgi.util.tracker;
import java.util.HashMap;
import java.util.Map;
+
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
@@ -217,6 +218,7 @@ public class BundleTracker<T> implements BundleTrackerCustomizer<T> {
* @return The specified bundle.
* @see BundleTrackerCustomizer#addingBundle(Bundle, BundleEvent)
*/
+ @Override
public T addingBundle(Bundle bundle, BundleEvent event) {
@SuppressWarnings("unchecked")
T result = (T) bundle;
@@ -241,6 +243,7 @@ public class BundleTracker<T> implements BundleTrackerCustomizer<T> {
* @param object The customized object for the specified Bundle.
* @see BundleTrackerCustomizer#modifiedBundle(Bundle, BundleEvent, Object)
*/
+ @Override
public void modifiedBundle(Bundle bundle, BundleEvent event, T object) {
/* do nothing */
}
@@ -263,6 +266,7 @@ public class BundleTracker<T> implements BundleTrackerCustomizer<T> {
* @param object The customized object for the specified bundle.
* @see BundleTrackerCustomizer#removedBundle(Bundle, BundleEvent, Object)
*/
+ @Override
public void removedBundle(Bundle bundle, BundleEvent event, T object) {
/* do nothing */
}
@@ -280,11 +284,10 @@ public class BundleTracker<T> implements BundleTrackerCustomizer<T> {
return null;
}
synchronized (t) {
- int length = t.size();
- if (length == 0) {
+ if (t.isEmpty()) {
return null;
}
- return t.copyKeys(new Bundle[length]);
+ return t.copyKeys(new Bundle[0]);
}
}
@@ -426,6 +429,7 @@ public class BundleTracker<T> implements BundleTrackerCustomizer<T> {
*
* @param event {@code BundleEvent} object from the framework.
*/
+ @Override
public void bundleChanged(final BundleEvent event) {
/*
* Check if we had a delayed call (which could happen when we

Back to the top