Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfogell2006-02-07 18:45:48 -0500
committerjfogell2006-02-07 18:45:48 -0500
commitd77b5ed8e82ebbe9065efdc8f80411c96a743044 (patch)
treec522caddf76eb6bb0aad3e9bb663681249b3fdfa
parentcb5901660376eaf741687b0ea60465e1859872ab (diff)
downloadrt.equinox.bundles-d77b5ed8e82ebbe9065efdc8f80411c96a743044.tar.gz
rt.equinox.bundles-d77b5ed8e82ebbe9065efdc8f80411c96a743044.tar.xz
rt.equinox.bundles-d77b5ed8e82ebbe9065efdc8f80411c96a743044.zip
removed compile warnings per bug #125840
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java26
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Authorization.java10
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Group.java3
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/LogTracker.java2
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Role.java2
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/User.java3
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdmin.java23
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminEventProducer.java4
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminHashtable.java10
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminStore.java41
10 files changed, 67 insertions, 57 deletions
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java
index d50d1dba..5df8fab2 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java
@@ -33,17 +33,15 @@ public class Activator implements BundleActivator, ServiceFactory, ServiceTracke
protected BundleContext context;
protected ServiceTracker prefsTracker;
- /** Need to have a public default constructor so that the BundleActivator
- * can be instantiated by Class.newInstance().
- */
- public Activator() {
- }
-
+ public Activator() {
+ //a public constructor is required for a BundleActivator
+ }
+
/**
* Required by BundleActivator Interface.
*/
- public void start(BundleContext context) throws Exception {
- this.context = context;
+ public void start(BundleContext context_) throws Exception {
+ this.context = context_;
prefsTracker = new ServiceTracker(context, PreferencesService.class.getName(), this);
prefsTracker.open();
}
@@ -51,7 +49,7 @@ public class Activator implements BundleActivator, ServiceFactory, ServiceTracke
/**
* Required by BundleActivator Interface.
*/
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context_) throws Exception {
prefsTracker.close();
if(registration != null)
{
@@ -77,13 +75,13 @@ public class Activator implements BundleActivator, ServiceFactory, ServiceTracke
userAdmin.setServiceReference(registration.getReference());
}
- public Object getService(Bundle bundle, ServiceRegistration registration) {
- userAdmin.setServiceReference(registration.getReference());
-
+ public Object getService(Bundle bundle, ServiceRegistration registration_) {
+ userAdmin.setServiceReference(registration_.getReference());
return userAdmin;
}
- public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
+ public void ungetService(Bundle bundle, ServiceRegistration registration_, Object service) {
+ //do nothing
}
public Object addingService(ServiceReference reference) {
@@ -100,7 +98,7 @@ public class Activator implements BundleActivator, ServiceFactory, ServiceTracke
}
public void modifiedService(ServiceReference reference, Object service) {
-
+ // do nothing
}
public void removedService(ServiceReference reference, Object service) {
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Authorization.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Authorization.java
index 614db7d2..50e3a711 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Authorization.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Authorization.java
@@ -99,10 +99,10 @@ public class Authorization implements org.osgi.service.useradmin.Authorization {
* @return <code>true</code> if this Authorization context implies the
* specified role, otherwise <code>false</code>.
*/
- public boolean hasRole(String name) {
+ public boolean hasRole(String name_) {
useradmin.checkAlive();
synchronized (useradmin) {
- Role checkRole = (org.eclipse.equinox.useradmin.Role) useradmin.getRole(name);
+ Role checkRole = (org.eclipse.equinox.useradmin.Role) useradmin.getRole(name_);
if (checkRole == null) {
return (false);
}
@@ -128,11 +128,11 @@ public class Authorization implements org.osgi.service.useradmin.Authorization {
for (int i = 0; i < length; i++) {
Role role = (Role) useradmin.roles.elementAt(i);
if (role.isImpliedBy(user, new Vector())) {
- String name = role.getName();
+ String roleName = role.getName();
//exclude user.anyone from the list
- if (!name.equals(Role.anyoneString))
+ if (!roleName.equals(Role.anyoneString))
{
- result.addElement(name);
+ result.addElement(roleName);
}
}
}
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Group.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Group.java
index 224659f5..d744c96c 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Group.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Group.java
@@ -86,7 +86,6 @@ public class Group extends User implements org.osgi.service.useradmin.Group {
protected Vector requiredMembers;
protected Vector basicMembers;
- protected UserAdmin useradmin;
protected Group(String name, UserAdmin useradmin) {
super(name, useradmin);
@@ -256,7 +255,7 @@ public class Group extends User implements org.osgi.service.useradmin.Group {
*/
public int getType() {
useradmin.checkAlive();
- return (Role.GROUP);
+ return (org.osgi.service.useradmin.Role.GROUP);
}
protected boolean isImpliedBy(Role role, Vector checkLoop) {
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/LogTracker.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/LogTracker.java
index 74b43be5..8a801ef6 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/LogTracker.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/LogTracker.java
@@ -78,7 +78,7 @@ public class LogTracker extends ServiceTracker implements LogService {
if (service != null) {
try {
service.log(reference, level, message, exception);
- } catch (Exception e) {
+ } catch (Exception e) { // do nothing
}
}
}
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Role.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Role.java
index 195407bc..3c772d92 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Role.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Role.java
@@ -72,7 +72,7 @@ public class Role implements org.osgi.service.useradmin.Role {
*/
public int getType() {
useradmin.checkAlive();
- return (Role.ROLE);
+ return (org.osgi.service.useradmin.Role.ROLE);
}
/**
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/User.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/User.java
index 025773a9..a76e2542 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/User.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/User.java
@@ -36,7 +36,6 @@ import java.util.Vector;
public class User extends Role implements org.osgi.service.useradmin.User {
protected UserAdminHashtable credentials;
- protected UserAdmin useradmin;
protected User(String name, UserAdmin useradmin) {
super(name, useradmin);
@@ -128,7 +127,7 @@ public class User extends Role implements org.osgi.service.useradmin.User {
*/
public int getType() {
useradmin.checkAlive();
- return Role.USER;
+ return org.osgi.service.useradmin.Role.USER;
}
//A user always implies itself
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdmin.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdmin.java
index e0e07932..e8493d18 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdmin.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdmin.java
@@ -10,8 +10,15 @@
*******************************************************************************/
package org.eclipse.equinox.useradmin;
-import java.util.*;
-import org.osgi.framework.*;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Vector;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.PreferencesService;
import org.osgi.service.useradmin.UserAdminEvent;
@@ -64,7 +71,7 @@ public class UserAdmin implements org.osgi.service.useradmin.UserAdmin {
userAdminStore = new UserAdminStore(preferencesService, this, log);
userAdminStore.init();
} catch (Exception e) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Read_Exception, e);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Read_Exception, e);
throw e;
}
}
@@ -102,7 +109,7 @@ public class UserAdmin implements org.osgi.service.useradmin.UserAdmin {
if (name == null) {
throw (new IllegalArgumentException(UserAdminMsg.CREATE_NULL_ROLE_EXCEPTION));
}
- if ((type != Role.GROUP) && (type != Role.USER)) {
+ if ((type != org.osgi.service.useradmin.Role.GROUP) && (type != org.osgi.service.useradmin.Role.USER)) {
throw (new IllegalArgumentException(UserAdminMsg.CREATE_INVALID_TYPE_ROLE_EXCEPTION));
}
//if the role already exists, return null
@@ -117,11 +124,11 @@ public class UserAdmin implements org.osgi.service.useradmin.UserAdmin {
protected org.osgi.service.useradmin.Role createRole(String name, int type, boolean store) {
Role newRole = null;
- if (type == Role.ROLE) {
+ if (type == org.osgi.service.useradmin.Role.ROLE) {
newRole = new Role(name, this);
- } else if (type == Role.USER) {
+ } else if (type == org.osgi.service.useradmin.Role.USER) {
newRole = new User(name, this);
- } else if (type == Role.GROUP) {
+ } else if (type == org.osgi.service.useradmin.Role.GROUP) {
newRole = new Group(name, this);
} else //unknown type
{
@@ -137,7 +144,7 @@ public class UserAdmin implements org.osgi.service.useradmin.UserAdmin {
eventProducer.generateEvent(UserAdminEvent.ROLE_CREATED, newRole);
}
}
- if (type == Role.GROUP || type == Role.USER) {
+ if (type == org.osgi.service.useradmin.Role.GROUP || type == org.osgi.service.useradmin.Role.USER) {
users.addElement(newRole);
}
roles.addElement(newRole);
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminEventProducer.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminEventProducer.java
index 1fc2a8af..54562505 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminEventProducer.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminEventProducer.java
@@ -125,8 +125,6 @@ public class UserAdminEventProducer extends ServiceTracker implements EventDispa
* can complete the delivery of the event to the listener.
*/
public void dispatchEvent(Object listener, Object listenerObject, int eventAction, Object eventObject) {
- ServiceReference userAdmin = this.userAdmin;
-
if (userAdmin == null) {
return;
}
@@ -135,7 +133,7 @@ public class UserAdminEventProducer extends ServiceTracker implements EventDispa
try {
ual.roleChanged((UserAdminEvent) eventObject);
} catch (Throwable t) {
- log.log(userAdmin, log.LOG_WARNING, UserAdminMsg.Event_Delivery_Exception, t);
+ log.log(userAdmin, LogService.LOG_WARNING, UserAdminMsg.Event_Delivery_Exception, t);
}
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminHashtable.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminHashtable.java
index c1b124f0..9d89c456 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminHashtable.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminHashtable.java
@@ -22,6 +22,10 @@ import org.osgi.service.useradmin.UserAdminEvent;
public class UserAdminHashtable extends Hashtable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -397030865421289240L;
protected Role role;
protected int propertyType;
protected UserAdmin userAdmin;
@@ -120,10 +124,10 @@ public class UserAdminHashtable extends Hashtable {
}
public synchronized void clear() {
- Enumeration enum = keys();
+ Enumeration e = keys();
- while (enum.hasMoreElements()) {
- String name = (String) enum.nextElement();
+ while (e.hasMoreElements()) {
+ String name = (String) e.nextElement();
switch (propertyType) {
case PROPERTIES :
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminStore.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminStore.java
index 557aeca4..95c7929a 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminStore.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/UserAdminStore.java
@@ -10,12 +10,17 @@
*******************************************************************************/
package org.eclipse.equinox.useradmin;
-import java.security.*;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.log.LogService;
-import org.osgi.service.prefs.*;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+import org.osgi.service.prefs.PreferencesService;
/*
* UserAdminStore is responsible for managing the persistence data of the useradmin
@@ -72,7 +77,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -88,7 +93,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -104,7 +109,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -125,7 +130,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -141,7 +146,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -157,7 +162,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -179,7 +184,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, NLS.bind(UserAdminMsg.Backing_Store_Write_Exception, new Object[] {NLS.bind(UserAdminMsg.adding_Credential_to__15, role.getName())}), ex);
+ log.log(LogService.LOG_ERROR, NLS.bind(UserAdminMsg.Backing_Store_Write_Exception, new Object[] {NLS.bind(UserAdminMsg.adding_Credential_to__15, role.getName())}), ex);
throw ((BackingStoreException) ex.getException());
}
@@ -196,7 +201,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -212,7 +217,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, NLS.bind(UserAdminMsg.Backing_Store_Write_Exception, new Object[] {NLS.bind(UserAdminMsg.adding_member__18, role.getName(), group.getName())}), ex);
+ log.log(LogService.LOG_ERROR, NLS.bind(UserAdminMsg.Backing_Store_Write_Exception, new Object[] {NLS.bind(UserAdminMsg.adding_member__18, role.getName(), group.getName())}), ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -228,7 +233,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, NLS.bind(UserAdminMsg.Backing_Store_Write_Exception, new Object[] {NLS.bind(UserAdminMsg.adding_required_member__21, role.getName(), group.getName())}), ex);
+ log.log(LogService.LOG_ERROR, NLS.bind(UserAdminMsg.Backing_Store_Write_Exception, new Object[] {NLS.bind(UserAdminMsg.adding_required_member__21, role.getName(), group.getName())}), ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -244,7 +249,7 @@ public class UserAdminStore {
}
});
} catch (PrivilegedActionException ex) {
- log.log(log.LOG_ERROR, NLS.bind(UserAdminMsg.Backing_Store_Write_Exception, new Object[] {NLS.bind(UserAdminMsg.removing_member__24, role.getName(), group.getName())}), ex);
+ log.log(LogService.LOG_ERROR, NLS.bind(UserAdminMsg.Backing_Store_Write_Exception, new Object[] {NLS.bind(UserAdminMsg.removing_member__24, role.getName(), group.getName())}), ex);
throw ((BackingStoreException) ex.getException());
}
}
@@ -272,7 +277,7 @@ public class UserAdminStore {
if (type == Integer.MIN_VALUE) {
String errorString = NLS.bind(UserAdminMsg.Backing_Store_Read_Exception, new Object[] {NLS.bind(UserAdminMsg.Unable_to_load_role__27, node.name())});
BackingStoreException ex = new BackingStoreException(errorString);
- log.log(log.LOG_ERROR, errorString, ex);
+ log.log(LogService.LOG_ERROR, errorString, ex);
throw (ex);
}
if (role == null) {
@@ -290,7 +295,7 @@ public class UserAdminStore {
}
//load credentials
- if (type == Role.USER || type == Role.GROUP) {
+ if (type == org.osgi.service.useradmin.Role.USER || type == org.osgi.service.useradmin.Role.GROUP) {
Object credValue;
Preferences credNode = node.node(credentialsNode);
keys = credNode.keys();
@@ -302,7 +307,7 @@ public class UserAdminStore {
}
//load group members
- if (type == Role.GROUP) {
+ if (type == org.osgi.service.useradmin.Role.GROUP) {
Preferences memberNode = node.node(membersNode);
keys = memberNode.keys();
for (int i = 0; i < keys.length; i++) {
@@ -328,7 +333,7 @@ public class UserAdminStore {
rootNode = null;
preferencesService = null;
} catch (BackingStoreException ex) {
- log.log(log.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
+ log.log(LogService.LOG_ERROR, UserAdminMsg.Backing_Store_Write_Exception, ex);
}
}
@@ -336,7 +341,7 @@ public class UserAdminStore {
Role role = null;
if (!rootNode.nodeExists(Role.anyoneString)) {
//If the user.anyone role is not present, create it
- role = (Role) useradmin.createRole(Role.anyoneString, Role.ROLE, true);
+ role = (Role) useradmin.createRole(Role.anyoneString, org.osgi.service.useradmin.Role.ROLE, true);
}
/* modified to solve defect 95982 */
if (role != null)

Back to the top