Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2016-11-14 14:11:36 +0000
committerThomas Watson2017-06-16 12:38:08 +0000
commitf919cea9a25f4b6e05a9e04397c3254c51f85780 (patch)
tree2b5c8a8defae9a2cee2749ad5ae602c5c73e2d6e /bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/BundleTracker.java
parent0af49fa8440cd17af48b6a54c5d52f6ea26267c9 (diff)
downloadrt.equinox.framework-f919cea9a25f4b6e05a9e04397c3254c51f85780.tar.gz
rt.equinox.framework-f919cea9a25f4b6e05a9e04397c3254c51f85780.tar.xz
rt.equinox.framework-f919cea9a25f4b6e05a9e04397c3254c51f85780.zip
Update framework API to the latest for R7.
Change-Id: I6c9d481175591949ba2791dc4000fb6be5639abb Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
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