Minor code cleanup removing unused fields, fixing raw-type warnings.

cusax-fix
Lyubomir Marinov 17 years ago
parent 8805906417
commit a06b4d2dd0

@ -32,8 +32,7 @@
*/
public class GuiActivator implements BundleActivator
{
private static Logger logger
= Logger.getLogger(GuiActivator.class.getName());
private static final Logger logger = Logger.getLogger(GuiActivator.class);
private static UIServiceImpl uiService = null;

@ -6,8 +6,6 @@
*/
package net.java.sip.communicator.impl.gui.utils;
import java.util.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.notification.*;
@ -24,9 +22,7 @@ public class NotificationManager
public static final String BUSY_CALL = "BusyCall";
public static final String PROACTIVE_NOTIFICATION = "ProactiveNotification";
private static Hashtable soundHandlers = new Hashtable();
public static void registerGuiNotifications()
{
NotificationService notificationService
@ -64,8 +60,6 @@ public static void registerGuiNotifications()
NotificationService.ACTION_SOUND,
inCallSoundHandler);
soundHandlers.put(INCOMING_CALL, inCallSoundHandler);
// Register outgoing call notifications.
SoundNotificationHandler outCallSoundHandler
= (SoundNotificationHandler) notificationService
@ -75,8 +69,6 @@ public static void registerGuiNotifications()
OUTGOING_CALL,
NotificationService.ACTION_SOUND,
outCallSoundHandler);
soundHandlers.put(OUTGOING_CALL, outCallSoundHandler);
// Register busy call notifications.
SoundNotificationHandler busyCallSoundHandler
@ -87,8 +79,6 @@ public static void registerGuiNotifications()
BUSY_CALL,
NotificationService.ACTION_SOUND,
busyCallSoundHandler);
soundHandlers.put(OUTGOING_CALL, outCallSoundHandler);
// Register proactive notifications.
notificationService.registerDefaultNotificationForEvent(

@ -289,24 +289,20 @@ public Iterator getRegisteredEvents()
*/
public Map getEventNotifications(String eventType)
{
Hashtable actions = new Hashtable();
EventNotification notification = notificationsTable.get(eventType);
EventNotification notification
= (EventNotification) notificationsTable.get(eventType);
if(notification == null)
return null;
Iterator srcActions = notification.getActions().values().iterator();
while(srcActions.hasNext())
Hashtable actions = new Hashtable();
for (Object value : notification.getActions().values())
{
Action action = (Action) srcActions.next();
Action action = (Action) value;
NotificationActionHandler handler = action.getActionHandler();
if(action.getActionHandler() != null)
actions.put(action.getActionType(), action.getActionHandler());
else
actions.put(action.getActionType(), "");
actions.put(action.getActionType(), (handler == null) ? ""
: handler);
}
return actions;
@ -914,7 +910,7 @@ public void registerDefaultNotificationForEvent(
actionType, handler);
}
// now store this default events if we want to retore them
// now store this default events if we want to restore them
EventNotification notification = null;
if(defaultNotificationsTable.containsKey(eventType))

@ -31,8 +31,8 @@ public class SystrayActivator
private static ConfigurationService configService;
private static Logger logger = Logger.getLogger(
SystrayActivator.class.getName());
private static final Logger logger =
Logger.getLogger(SystrayActivator.class);
/**
* Called when this bundle is started.

@ -30,9 +30,10 @@
*
* @author Nicolas Chamouard
* @author Yana Stamcheva
* @author Lubomir Marinov
*/
public class SystrayServiceJdicImpl
implements SystrayService
implements SystrayService
{
/**
* The systray.
@ -52,12 +53,14 @@ public class SystrayServiceJdicImpl
/**
* The list of all added popup message listeners.
*/
private Vector popupMessageListeners = new Vector();
private final List<SystrayPopupMessageListener> popupMessageListeners =
new Vector<SystrayPopupMessageListener>();
/**
* List of all messages waiting to be shown.
*/
private ArrayList messageQueue = new ArrayList();
private final List<SystrayMessage> messageQueue =
new ArrayList<SystrayMessage>();
private Timer popupTimer = new Timer();
@ -324,16 +327,12 @@ public void saveStatusInformation(
{
String prefix = "net.java.sip.communicator.impl.gui.accounts";
List accounts = configService
List<String> accounts = configService
.getPropertyNamesByPrefix(prefix, true);
boolean savedAccount = false;
Iterator accountsIter = accounts.iterator();
while(accountsIter.hasNext()) {
String accountRootPropName
= (String) accountsIter.next();
for (String accountRootPropName : accounts) {
String accountUID
= configService.getString(accountRootPropName);
@ -439,17 +438,16 @@ private void firePopupMessageEvent(Object sourceObject)
logger.trace("Will dispatch the following systray msg event: " + evt);
Iterator listeners = null;
List<SystrayPopupMessageListener> listeners;
synchronized (popupMessageListeners)
{
listeners = new ArrayList(popupMessageListeners).iterator();
listeners =
new ArrayList<SystrayPopupMessageListener>(
popupMessageListeners);
}
while (listeners.hasNext())
for (SystrayPopupMessageListener listener : listeners)
{
SystrayPopupMessageListener listener
= (SystrayPopupMessageListener) listeners.next();
listener.popupMessageClicked(evt);
}
}
@ -576,7 +574,7 @@ public void run()
int messageNumber = messageQueue.size();
SystrayMessage msg = (SystrayMessage) messageQueue.get(0);
SystrayMessage msg = messageQueue.get(0);
if(messageNumber > maxMessageNumber)
{

Loading…
Cancel
Save