Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2006-04-12 02:09:45 +0000
committerThomas Watson2006-04-12 02:09:45 +0000
commit99240864fd7aa8346bbed415bd8a0bcb549efeae (patch)
tree068454ae1634179f06a3f944e2b2809bb324bfa9
parentcf9cd81b1c2662ebb2dc2b038e904a4b16138c15 (diff)
downloadrt.equinox.bundles-99240864fd7aa8346bbed415bd8a0bcb549efeae.tar.gz
rt.equinox.bundles-99240864fd7aa8346bbed415bd8a0bcb549efeae.tar.xz
rt.equinox.bundles-99240864fd7aa8346bbed415bd8a0bcb549efeae.zip
Bug 125834 Warnings in build N20060131-0010 for org.eclipse.equinox.device
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/Activator.java31
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java31
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java1
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverSelectorTracker.java6
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java23
-rw-r--r--bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/LogTracker.java1
6 files changed, 51 insertions, 42 deletions
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/Activator.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/Activator.java
index ac4f9089f..ae139605b 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/Activator.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/Activator.java
@@ -12,6 +12,7 @@ package org.eclipse.equinox.device;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.*;
+import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
@@ -102,8 +103,8 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
* @param context The device manager's bundle context
*/
- public void start(BundleContext context) throws Exception {
- this.context = context;
+ public void start(BundleContext contxt) throws Exception {
+ this.context = contxt;
running = false;
log = new LogTracker(context, System.err);
@@ -114,7 +115,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
driverFilter = context.createFilter("(" + org.osgi.framework.Constants.OBJECTCLASS + "=" + DriverTracker.clazz + ")"); ////-1$ ////-2$ ////-3$ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} catch (InvalidSyntaxException e) {
- log.log(log.LOG_ERROR, NLS.bind(DeviceMsg.Unable_to_create_Filter_for_DeviceManager, e)); ////-1$
+ log.log(LogService.LOG_ERROR, NLS.bind(DeviceMsg.Unable_to_create_Filter_for_DeviceManager, e)); ////-1$
throw e;
}
@@ -126,18 +127,19 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
try {
updatewait = Long.parseLong(prop) * 1000L;
} catch (NumberFormatException e) {
+ //do nothing
}
}
Bundle systemBundle = context.getBundle(0);
- if ((systemBundle != null) && ((systemBundle.getState() & systemBundle.STARTING) != 0)) { /* if the system bundle is starting */
+ if ((systemBundle != null) && ((systemBundle.getState() & Bundle.STARTING) != 0)) { /* if the system bundle is starting */
context.addFrameworkListener(this);
} else {
startDeviceManager();
}
- log.log(log.LOG_INFO, DeviceMsg.DeviceManager_started);
+ log.log(LogService.LOG_INFO, DeviceMsg.DeviceManager_started);
}
/**
@@ -153,7 +155,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
try {
startDeviceManager();
} catch (Throwable t) {
- log.log(log.LOG_ERROR, NLS.bind(DeviceMsg.DeviceManager_has_thrown_an_error, t)); ////-1$
+ log.log(LogService.LOG_ERROR, NLS.bind(DeviceMsg.DeviceManager_has_thrown_an_error, t)); ////-1$
}
break;
@@ -193,7 +195,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
* @param context The device manager's bundle context
*/
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext contxt) throws Exception {
context.removeFrameworkListener(this);
if (running) {
@@ -210,6 +212,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
try {
t.wait(0);
} catch (InterruptedException e) {
+ // do nothing
}
}
}
@@ -262,7 +265,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
*/
public Object addingService(ServiceReference reference) {
if (Activator.DEBUG) {
- log.log(reference, log.LOG_DEBUG, "DeviceManager device service registered"); //$NON-NLS-1$
+ this.log.log(reference, LogService.LOG_DEBUG, "DeviceManager device service registered"); //$NON-NLS-1$
}
enqueue(new DeviceTracker(this, reference));
@@ -280,6 +283,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
* @param service The service object for the modified service.
*/
public void modifiedService(ServiceReference reference, Object service) {
+ // do nothing
}
/**
@@ -293,7 +297,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
*/
public void removedService(ServiceReference reference, Object object) {
if (Activator.DEBUG) {
- log.log(reference, log.LOG_DEBUG, "DeviceManager device service unregistered"); //$NON-NLS-1$
+ log.log(reference, LogService.LOG_DEBUG, "DeviceManager device service unregistered"); //$NON-NLS-1$
}
/* We do not implement optional driver reclamation.
@@ -303,7 +307,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
public void refineIdleDevices() {
if (Activator.DEBUG) {
- log.log(log.LOG_DEBUG, "DeviceManager refining idle device services"); //$NON-NLS-1$
+ log.log(LogService.LOG_DEBUG, "DeviceManager refining idle device services"); //$NON-NLS-1$
}
ServiceReference[] references = devices.getServiceReferences();
@@ -338,7 +342,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
try {
device.refine();
} catch (Throwable t) {
- log.log(log.LOG_ERROR, NLS.bind(DeviceMsg.DeviceManager_has_thrown_an_error, t)); ////-1$
+ log.log(LogService.LOG_ERROR, NLS.bind(DeviceMsg.DeviceManager_has_thrown_an_error, t)); ////-1$
}
}
}
@@ -352,7 +356,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
public synchronized void enqueue(DeviceTracker device) {
if (device != null) {
if (Activator.DEBUG) {
- log.log(log.LOG_DEBUG, "DeviceManager queuing DeviceTracker"); //$NON-NLS-1$
+ log.log(LogService.LOG_DEBUG, "DeviceManager queuing DeviceTracker"); //$NON-NLS-1$
}
DeviceService item = new DeviceService(device);
@@ -395,11 +399,12 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer, Fra
try {
if (Activator.DEBUG) {
- log.log(log.LOG_DEBUG, "DeviceManager waiting on queue"); //$NON-NLS-1$
+ log.log(LogService.LOG_DEBUG, "DeviceManager waiting on queue"); //$NON-NLS-1$
}
wait();
} catch (InterruptedException e) {
+ // do nothing
}
}
}
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java
index ee85a7f6d..c1e507f01 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DeviceTracker.java
@@ -55,7 +55,7 @@ public class DeviceTracker extends ServiceTracker {
log = manager.log;
if (Activator.DEBUG) {
- log.log(device, log.LOG_DEBUG, this + " constructor"); //$NON-NLS-1$
+ log.log(device, LogService.LOG_DEBUG, this + " constructor"); //$NON-NLS-1$
}
open();
@@ -68,7 +68,7 @@ public class DeviceTracker extends ServiceTracker {
public void close() {
if (device != null) {
if (Activator.DEBUG) {
- log.log(device, log.LOG_DEBUG, this + " closing"); //$NON-NLS-1$
+ log.log(device, LogService.LOG_DEBUG, this + " closing"); //$NON-NLS-1$
}
running = false; /* request thread to stop */
@@ -97,7 +97,7 @@ public class DeviceTracker extends ServiceTracker {
*/
public Object addingService(ServiceReference reference) {
if (Activator.DEBUG) {
- log.log(reference, log.LOG_DEBUG, this + " adding Device service"); //$NON-NLS-1$
+ log.log(reference, LogService.LOG_DEBUG, this + " adding Device service"); //$NON-NLS-1$
}
device = reference;
@@ -133,11 +133,11 @@ public class DeviceTracker extends ServiceTracker {
*/
public void removedService(ServiceReference reference, Object service) {
if (running) {
- log.log(reference, log.LOG_WARNING, DeviceMsg.Device_service_unregistered);
+ log.log(reference, LogService.LOG_WARNING, DeviceMsg.Device_service_unregistered);
running = false; /* request algorithm to stop */
} else {
if (Activator.DEBUG) {
- log.log(reference, log.LOG_DEBUG, this + " removing Device service"); //$NON-NLS-1$
+ log.log(reference, LogService.LOG_DEBUG, this + " removing Device service"); //$NON-NLS-1$
}
}
}
@@ -148,7 +148,7 @@ public class DeviceTracker extends ServiceTracker {
*/
public void refine() {
if (Activator.DEBUG) {
- log.log(device, log.LOG_DEBUG, this + " refining " + device); //$NON-NLS-1$
+ log.log(device, LogService.LOG_DEBUG, this + " refining " + device); //$NON-NLS-1$
}
if (running && isIdle()) {
@@ -194,10 +194,10 @@ public class DeviceTracker extends ServiceTracker {
*/
public boolean isIdle() {
if (Activator.DEBUG) {
- log.log(device, log.LOG_DEBUG, "Check device service idle: " + device); //$NON-NLS-1$
+ log.log(device, LogService.LOG_DEBUG, "Check device service idle: " + device); //$NON-NLS-1$
}
- Filter filter = manager.driverFilter;
+ Filter filter_ = manager.driverFilter;
Bundle[] users = device.getUsingBundles();
int userCount = (users == null) ? 0 : users.length;
@@ -208,9 +208,9 @@ public class DeviceTracker extends ServiceTracker {
int servicesCount = (services == null) ? 0 : services.length;
for (int j = 0; j < servicesCount; j++) {
- if (filter.match(services[j])) {
+ if (filter_.match(services[j])) {
if (Activator.DEBUG) {
- log.log(log.LOG_DEBUG, "Device " + device + " already in use by bundle " + users[i]); //$NON-NLS-1$ //$NON-NLS-2$
+ log.log(LogService.LOG_DEBUG, "Device " + device + " already in use by bundle " + users[i]); //$NON-NLS-1$ //$NON-NLS-2$
}
return (false);
@@ -231,24 +231,24 @@ public class DeviceTracker extends ServiceTracker {
*/
public void noDriverFound() {
- BundleContext context = manager.context;
+ BundleContext contxt = manager.context;
- Object service = context.getService(device);
+ Object service = contxt.getService(device);
try {
//It is possible that this is a Free Format Device that does not
//implement Device
if (service instanceof Device) {
- log.log(device, log.LOG_INFO, DeviceMsg.Device_noDriverFound_called);
+ log.log(device, LogService.LOG_INFO, DeviceMsg.Device_noDriverFound_called);
try {
((Device) service).noDriverFound();
} catch (Throwable t) {
- log.log(device, log.LOG_ERROR, NLS.bind(DeviceMsg.Device_noDriverFound_error, t));
+ log.log(device, LogService.LOG_ERROR, NLS.bind(DeviceMsg.Device_noDriverFound_error, t));
}
}
} finally {
- context.ungetService(device);
+ contxt.ungetService(device);
}
}
@@ -262,6 +262,7 @@ public class DeviceTracker extends ServiceTracker {
*
*/
static class Properties extends Hashtable {
+ private static final long serialVersionUID = -8489170394007899809L;
/**
* keys in original case.
*/
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java
index 329fd6738..f2ab27651 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverLocatorTracker.java
@@ -89,6 +89,7 @@ public class DriverLocatorTracker extends ServiceTracker {
* @param service The service object for the modified service.
*/
public void modifiedService(ServiceReference reference, Object service) {
+ //do nothing
}
/**
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverSelectorTracker.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverSelectorTracker.java
index cbd469a0f..157243859 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverSelectorTracker.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverSelectorTracker.java
@@ -43,7 +43,7 @@ public class DriverSelectorTracker extends ServiceTracker {
log = manager.log;
if (Activator.DEBUG) {
- log.log(log.LOG_DEBUG, "DriverSelectorTracker constructor"); //$NON-NLS-1$
+ log.log(LogService.LOG_DEBUG, "DriverSelectorTracker constructor"); //$NON-NLS-1$
}
open();
@@ -58,7 +58,7 @@ public class DriverSelectorTracker extends ServiceTracker {
*/
public ServiceReference select(ServiceReference device, Match[] matches) {
if (Activator.DEBUG) {
- log.log(device, log.LOG_DEBUG, "DriverSelector select called"); //$NON-NLS-1$
+ log.log(device, LogService.LOG_DEBUG, "DriverSelector select called"); //$NON-NLS-1$
}
//This should give us the highest ranking DriverSelector (if available)
@@ -76,7 +76,7 @@ public class DriverSelectorTracker extends ServiceTracker {
return matches[index].getDriver();
} catch (Throwable t) {
- log.log(selector, log.LOG_ERROR, DeviceMsg.DriverSelector_error_during_match, t);
+ log.log(selector, LogService.LOG_ERROR, DeviceMsg.DriverSelector_error_during_match, t);
}
}
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java
index a7026c401..f46a60a82 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/DriverTracker.java
@@ -414,9 +414,9 @@ public class DriverTracker extends ServiceTracker {
}
public class DriverUpdate implements Runnable, ServiceListener, BundleListener {
- private Activator manager;
+ private Activator manager_;
private Bundle bundle;
- private BundleContext context;
+ private BundleContext contxt;
/** if false the thread must terminate */
private volatile boolean running;
@@ -424,16 +424,16 @@ public class DriverTracker extends ServiceTracker {
private long updatewait;
DriverUpdate(Bundle bundle, Activator manager) {
- this.manager = manager;
+ this.manager_ = manager;
this.bundle = bundle;
- context = manager.context;
- updatewait = manager.updatewait;
+ contxt = manager_.context;
+ updatewait = manager_.updatewait;
running = true;
- context.addBundleListener(this);
+ contxt.addBundleListener(this);
try {
- context.addServiceListener(this, manager.driverFilter.toString());
+ contxt.addServiceListener(this, manager_.driverFilter.toString());
} catch (InvalidSyntaxException e) {
/* this should not happen */
}
@@ -452,10 +452,11 @@ public class DriverTracker extends ServiceTracker {
}
}
} catch (InterruptedException e) {
+ //do nothing
}
- context.removeServiceListener(this);
- context.removeBundleListener(this);
+ contxt.removeServiceListener(this);
+ contxt.removeBundleListener(this);
if (running) {
manager.refineIdleDevices();
@@ -464,7 +465,7 @@ public class DriverTracker extends ServiceTracker {
public void serviceChanged(ServiceEvent event) {
if ((event.getType() == ServiceEvent.REGISTERED) && bundle.equals(event.getServiceReference().getBundle())) {
- context.removeServiceListener(this);
+ contxt.removeServiceListener(this);
running = false; /* cancel */
@@ -474,7 +475,7 @@ public class DriverTracker extends ServiceTracker {
public void bundleChanged(BundleEvent event) {
if ((event.getType() == Bundle.UNINSTALLED) && bundle.equals(event.getBundle())) {
- context.removeBundleListener(this);
+ contxt.removeBundleListener(this);
updatewait = 0; /* avoid wait */
diff --git a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/LogTracker.java b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/LogTracker.java
index 25debd056..49f55c753 100644
--- a/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/LogTracker.java
+++ b/bundles/org.eclipse.equinox.device/src/org/eclipse/equinox/device/LogTracker.java
@@ -79,6 +79,7 @@ public class LogTracker extends ServiceTracker implements LogService {
try {
service.log(reference, level, message, exception);
} catch (Exception e) {
+ // do nothing
}
}
}

Back to the top