Fixes Java 1.5 compatibility breakage reported by Heikki Lindholm. Fixes warnings.

cusax-fix
Lyubomir Marinov 13 years ago
parent 80b78f21b3
commit acfa70a192

@ -6,9 +6,18 @@
*/
package net.java.sip.communicator.impl.dns.dnsconfig;
import static net.java.sip.communicator.util.NetworkUtils.*;
import static net.java.sip.communicator.service.dns.CustomResolver.*;
import static net.java.sip.communicator.impl.dns.DnsUtilActivator.*;
import static net.java.sip.communicator.impl.dns.DnsUtilActivator.DEFAULT_BACKUP_RESOLVER;
import static net.java.sip.communicator.impl.dns.DnsUtilActivator.PDEFAULT_BACKUP_RESOLVER_ENABLED;
import static net.java.sip.communicator.impl.dns.DnsUtilActivator.PNAME_BACKUP_RESOLVER;
import static net.java.sip.communicator.impl.dns.DnsUtilActivator.PNAME_BACKUP_RESOLVER_ENABLED;
import static net.java.sip.communicator.impl.dns.DnsUtilActivator.PNAME_BACKUP_RESOLVER_FALLBACK_IP;
import static net.java.sip.communicator.impl.dns.DnsUtilActivator.PNAME_BACKUP_RESOLVER_PORT;
import static net.java.sip.communicator.service.dns.CustomResolver.DNS_PATIENCE;
import static net.java.sip.communicator.service.dns.CustomResolver.DNS_REDEMPTION;
import static net.java.sip.communicator.service.dns.CustomResolver.PNAME_DNS_PATIENCE;
import static net.java.sip.communicator.service.dns.CustomResolver.PNAME_DNS_REDEMPTION;
import static net.java.sip.communicator.util.NetworkUtils.isIPv4Address;
import static net.java.sip.communicator.util.NetworkUtils.isIPv6Address;
import java.awt.*;
import java.awt.event.*;
@ -19,7 +28,6 @@
import javax.swing.event.*;
import javax.swing.text.*;
import net.java.sip.communicator.impl.dns.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.dns.*;
import net.java.sip.communicator.util.*;

@ -9,7 +9,6 @@
import java.util.regex.*;
import net.java.sip.communicator.impl.googlecontacts.configform.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.contactsource.*;
import net.java.sip.communicator.service.googlecontacts.*;
import net.java.sip.communicator.util.*;

@ -25,7 +25,7 @@
* @author Adam Netocny
*/
public class SIPCommSmartComboBox<E>
extends JComboBox<E>
extends JComboBox
{
private static final long serialVersionUID = 0L;
@ -34,7 +34,7 @@ public class SIPCommSmartComboBox<E>
*/
public SIPCommSmartComboBox()
{
setModel(new FilterableComboBoxModel<E>());
setModel(new FilterableComboBoxModel());
setEditor(new CallComboEditor());
setEditable(true);
setFocusable(true);
@ -44,22 +44,22 @@ public SIPCommSmartComboBox()
* The data model used for this combo box. Filters the contents of the
* combo box popup according to the user input.
*/
public static class FilterableComboBoxModel<E>
extends AbstractListModel<E>
implements MutableComboBoxModel<E>
public static class FilterableComboBoxModel
extends AbstractListModel
implements MutableComboBoxModel
{
private Filter filter;
private final List<E> filteredItems;
private final List<Object> filteredItems;
private final List<E> items;
private final List<Object> items;
private Object selectedItem;
public FilterableComboBoxModel()
{
items = new ArrayList<E>();
filteredItems = new ArrayList<E>(items.size());
items = new ArrayList<Object>();
filteredItems = new ArrayList<Object>(items.size());
updateFilteredItems();
}
@ -69,7 +69,7 @@ public boolean contains(Object obj)
return items.contains(obj);
}
public void addElement(E obj)
public void addElement(Object obj)
{
items.add(obj);
updateFilteredItems();
@ -87,7 +87,7 @@ public void removeElementAt(int index)
updateFilteredItems();
}
public void insertElementAt(E obj, int index)
public void insertElementAt(Object obj, int index)
{
items.add(index, obj);
updateFilteredItems();
@ -110,7 +110,7 @@ protected void updateFilteredItems()
}
else
{
for (E item : items)
for (Object item : items)
if (filter.accept(item))
filteredItems.add(item);
}
@ -122,7 +122,7 @@ public int getSize()
return filteredItems.size();
}
public E getElementAt(int index)
public Object getElementAt(int index)
{
return filteredItems.get(index);
}
@ -254,7 +254,7 @@ protected void handleChange()
Filter filter
= (prefix.length() > 0) ? new StartsWithFilter(prefix) : null;
((FilterableComboBoxModel<?>) getModel()).setFilter(filter);
((FilterableComboBoxModel) getModel()).setFilter(filter);
setPopupVisible(false);

@ -18,7 +18,7 @@
* @author Yana Stamcheva
*/
public class AccountListModel
extends DefaultListModel<Account>
extends DefaultListModel
{
/**
* Indicates that the data model content has changed.
@ -59,12 +59,12 @@ public void run()
}
boolean isAccountAdded = false;
Enumeration<Account> accounts = elements();
Enumeration<?> accounts = elements();
// If we already have other accounts.
while (accounts.hasMoreElements())
{
Account a = accounts.nextElement();
Account a = (Account) accounts.nextElement();
int accountIndex = indexOf(a);
@ -130,12 +130,12 @@ public void run()
*/
public Account getAccount(AccountID accountID)
{
Enumeration<Account> accounts = elements();
Enumeration<?> accounts = elements();
// If we already have other accounts.
while (accounts.hasMoreElements())
{
Account account = accounts.nextElement();
Account account = (Account) accounts.nextElement();
if (account.getAccountID().equals(accountID))
return account;

@ -93,7 +93,7 @@ public abstract class PreCallDialog
/**
* The combo box containing a list of accounts to choose from.
*/
private JComboBox<Account> accountsCombo;
private JComboBox accountsCombo;
/**
* The window handling received calls.
@ -204,7 +204,7 @@ private Window createPreCallWindow( String title,
{
accountsCombo
= HudWidgetFactory.createHudComboBox(
new DefaultComboBoxModel<Account>(accounts));
new DefaultComboBoxModel(accounts));
}
}
else
@ -220,7 +220,7 @@ private Window createPreCallWindow( String title,
callLabelImage = new JLabel();
if (accounts != null)
accountsCombo = new JComboBox<Account>(accounts);
accountsCombo = new JComboBox(accounts);
}
if (text != null)
@ -388,7 +388,7 @@ public JLabel[] getCallLabels()
*
* @return the accounts combo box contained in this dialog
*/
public JComboBox<Account> getAccountsCombo()
public JComboBox getAccountsCombo()
{
return accountsCombo;
}

@ -17,7 +17,6 @@
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
import org.jitsi.service.neomedia.*;

@ -22,7 +22,7 @@
* @author Lyubomir Marinov
*/
public class ChatContactListModel
extends AbstractListModel<ChatContact<?>>
extends AbstractListModel
{
/**

@ -18,7 +18,7 @@
* @author Yana Stamcheva
*/
public class ChatRoomListModel
extends AbstractListModel<Object>
extends AbstractListModel
{
private final ChatRoomList chatRoomList;

@ -16,7 +16,6 @@
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
/**

@ -22,7 +22,7 @@
* @author Lyubomir Marinov
*/
public class ContactListModel
extends AbstractListModel<Object>
extends AbstractListModel
{
private final MetaContactListService contactList;

@ -16,8 +16,6 @@
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
/**
* A generic full implementation of the <tt>UIContact</tt> interface.
*

@ -14,7 +14,6 @@
import javax.swing.text.html.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.plugin.desktoputil.presence.*;

@ -15,7 +15,6 @@
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.util.*;
/**
* The <tt>EditPanel</tt> manage the image size and the clipper component

@ -16,7 +16,6 @@
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.util.*;
/**
* Dialog in which we can load an image from file or take new one by using

@ -60,7 +60,7 @@ public class CallRecordingConfigForm
* Directory choose dialog.
*/
private final SipCommFileChooser dirChooser;
private JComboBox<String> formatsComboBox;
private JComboBox formatsComboBox;
private JCheckBox saveCallsToCheckBox;
/**
* Directory where calls are stored. Default is SC_HOME/calls.
@ -184,10 +184,10 @@ public void changedUpdate(DocumentEvent e){}
*/
private Component createFormatsComboBox()
{
ComboBoxModel<String> formatsComboBoxModel
= new DefaultComboBoxModel<String>(RecorderImpl.SUPPORTED_FORMATS);
ComboBoxModel formatsComboBoxModel
= new DefaultComboBoxModel(RecorderImpl.SUPPORTED_FORMATS);
formatsComboBox = new JComboBox<String>();
formatsComboBox = new JComboBox();
formatsComboBox.setPreferredSize(new Dimension(200, 30));
formatsComboBox.setModel(formatsComboBoxModel);

@ -27,7 +27,7 @@
* @author Damian Minkov
*/
public class DeviceConfigurationComboBoxModel
implements ComboBoxModel<Object>,
implements ComboBoxModel,
PropertyChangeListener
{
/**

@ -56,8 +56,7 @@ public ConfigurationPanel()
gridBagConstraints.gridy = 0;
contentPanel.add(defaultProfileLabel, gridBagConstraints);
JComboBox<NameValuePair> defaultProfileComboBox
= new JComboBox<NameValuePair>();
JComboBox defaultProfileComboBox = new JComboBox();
defaultProfileComboBox.setEditable(false);
defaultProfileComboBox.addItem(
new NameValuePair(
@ -86,8 +85,7 @@ public ConfigurationPanel()
gridBagConstraints.gridy = 1;
contentPanel.add(preferredKeyFrameRequesterLabel, gridBagConstraints);
JComboBox<NameValuePair> preferredKeyFrameRequesterComboBox
= new JComboBox<NameValuePair>();
JComboBox preferredKeyFrameRequesterComboBox = new JComboBox();
preferredKeyFrameRequesterComboBox.setEditable(false);
preferredKeyFrameRequesterComboBox.addItem(
new NameValuePair(
@ -118,8 +116,7 @@ public ConfigurationPanel()
gridBagConstraints.gridy = 2;
contentPanel.add(presetLabel, gridBagConstraints);
JComboBox<NameValuePair> presetComboBox
= new JComboBox<NameValuePair>();
JComboBox presetComboBox = new JComboBox();
presetComboBox.setEditable(false);
for(String presetSetting : JNIEncoder.AVAILABLE_PRESETS)
{
@ -176,7 +173,7 @@ public ConfigurationPanel()
* to set the value of
*/
private void addActionListener(
final JComboBox<NameValuePair> comboBox,
final JComboBox comboBox,
final String property)
{
comboBox.addActionListener(
@ -204,15 +201,14 @@ public void actionPerformed(ActionEvent e)
* @param value the value of the <tt>NameValuePair</tt> to set as the
* selected item of <tt>comboBox</tt>
*/
private void setSelectedNameValuePair(
JComboBox<NameValuePair> comboBox,
String value)
private void setSelectedNameValuePair(JComboBox comboBox, String value)
{
int itemCount = comboBox.getItemCount();
for (int itemIndex = 0; itemIndex < itemCount; itemIndex++)
{
NameValuePair nameValuePair = comboBox.getItemAt(itemIndex);
NameValuePair nameValuePair
= (NameValuePair) comboBox.getItemAt(itemIndex);
if (nameValuePair.value.equals(value))
{

@ -11,7 +11,6 @@
import net.java.sip.communicator.impl.protocol.jabber.extensions.gtalk.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;

@ -8,7 +8,6 @@
import java.util.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;

@ -13,7 +13,6 @@
import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension.CreatorEnum;
import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension.SendersEnum;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.protocol.media.*;
import net.java.sip.communicator.util.*;

@ -14,7 +14,6 @@
import javax.sip.*;
import javax.sip.address.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.util.*;
/**

@ -18,7 +18,6 @@
import javax.sip.header.*;
import javax.sip.message.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.netaddr.event.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;

@ -14,7 +14,6 @@
import javax.sip.address.*;
import net.java.sip.communicator.impl.protocol.sip.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.certificate.*;
import net.java.sip.communicator.util.*;

@ -15,7 +15,6 @@
import javax.sip.header.*;
import net.java.sip.communicator.impl.protocol.sip.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.media.*;
import net.java.sip.communicator.util.*;

@ -10,7 +10,6 @@
import net.java.sip.communicator.service.contactsource.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;

@ -29,7 +29,6 @@
import net.java.sip.communicator.service.protocol.ServerStoredDetails.MiddleNameDetail;
import net.java.sip.communicator.service.protocol.ServerStoredDetails.PhoneNumberDetail;
import net.java.sip.communicator.service.protocol.ServerStoredDetails.TimeZoneDetail;
import net.java.sip.communicator.util.*;
/**
* The right side panel of ContactInfoDialog. Shows one tab of a summary of

@ -20,7 +20,7 @@
* @author ROTH Damien
*/
public class StrategiesList
extends JList<Strategy>
extends JList
{
/**
* Serial version UID.
@ -114,7 +114,7 @@ public void autoSelectStrategy(String initStrategy)
* @author ROTH Damien
*/
static class ListModel
extends AbstractListModel<Strategy>
extends AbstractListModel
{
/**
* Serial version UID.
@ -189,7 +189,7 @@ public int indexOf(String strategyCode)
*/
static class CellRenderer
extends JLabel
implements ListCellRenderer<Strategy>
implements ListCellRenderer
{
/**
* Serial version UID.
@ -200,13 +200,13 @@ static class CellRenderer
* implements <tt>ListCellRenderer.getListCellRendererComponent</tt>
*/
public Component getListCellRendererComponent(
JList<? extends Strategy> list,
Strategy value,
JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
{
setText(value.getName());
setText(((Strategy) value).getName());
if (isSelected)
{

@ -448,14 +448,14 @@ private Component createSendMessagePanel()
sendMessageLabel.setText(
Resources.getString("plugin.generalconfig.SEND_MESSAGES_WITH"));
ComboBoxModel<String> sendMessageComboBoxModel
= new DefaultComboBoxModel<String>(
ComboBoxModel sendMessageComboBoxModel
= new DefaultComboBoxModel(
new String[]
{
ConfigurationUtils.ENTER_COMMAND,
ConfigurationUtils.CTRL_ENTER_COMMAND
});
final JComboBox<String> sendMessageComboBox = new JComboBox<String>();
final JComboBox sendMessageComboBox = new JComboBox();
sendMessagePanel.add(sendMessageComboBox);
sendMessageComboBox.setModel(sendMessageComboBoxModel);
sendMessageComboBox.setSelectedItem(

@ -48,19 +48,18 @@ public class ConnectionPanel
private final JCheckBox proxyAutoCheckBox;
private final JComboBox<Object> certificate = new JComboBox<Object>();
private final JComboBox certificate = new JComboBox();
private JComboBox<String> transportCombo
= new JComboBox<String>(new String[] { "UDP", "TCP", "TLS" });
private JComboBox transportCombo
= new JComboBox(new String[] { "UDP", "TCP", "TLS" });
private JComboBox<String> keepAliveMethodBox
= new JComboBox<String>(
new String[] { "NONE", "REGISTER", "OPTIONS" });
private JComboBox keepAliveMethodBox
= new JComboBox(new String[] { "NONE", "REGISTER", "OPTIONS" });
private JTextField keepAliveIntervalValue = new JTextField();
private JComboBox<String> dtmfMethodBox
= new JComboBox<String>(
private JComboBox dtmfMethodBox
= new JComboBox(
new String[]
{
Resources.getString(

@ -75,7 +75,7 @@ public class LanguageMenuBar
private final SIPCommTextButton removeItem = new SIPCommTextButton(
Resources.getString("plugin.spellcheck.UNINSTALL_DICTIONARY"));
public final JList<Parameters.Locale> list;
public final JList list;
/**
* Provides instance of this class associated with a spell checker. If ones
@ -122,9 +122,8 @@ private LanguageMenuBar(SpellChecker checker)
this.menu.setOpaque(false);
this.setOpaque(false);
final DefaultListModel<Parameters.Locale> model
= new DefaultListModel<Parameters.Locale>();
list = new JList<Parameters.Locale>(model);
final DefaultListModel model = new DefaultListModel();
list = new JList(model);
this.languageSelectionRenderer = new LanguageListRenderer();
@ -467,7 +466,7 @@ public void stateChanged(ChangeEvent evt)
*
* @param model the model whose elements are to be set
*/
private void setModelElements(DefaultListModel<Parameters.Locale> model)
private void setModelElements(DefaultListModel model)
{
synchronized (model)
{
@ -511,12 +510,11 @@ public class SetSpellChecker extends SwingWorker
{
private final Parameters.Locale locale;
private final JList<Parameters.Locale> sourceList;
private final JList sourceList;
private boolean skipFiring = false;
public SetSpellChecker( Parameters.Locale locale,
JList<Parameters.Locale> sourceList)
public SetSpellChecker(Parameters.Locale locale, JList sourceList)
{
this.locale = locale;
this.sourceList = sourceList;
@ -569,9 +567,7 @@ public void finished()
sourceList.removeListSelectionListener(sourceList
.getListSelectionListeners()[0]);
setModelElements(
(DefaultListModel<Parameters.Locale>)
sourceList.getModel());
setModelElements((DefaultListModel) sourceList.getModel());
sourceList.setSelectedValue(locale, true);
removeItem.setEnabled(!spellChecker.getLocale().getIsoCode()
.equals(Parameters.getDefault(Parameters.Default.LOCALE)));
@ -642,7 +638,7 @@ private class LanguageListRenderer
*/
private static final long serialVersionUID = 0L;
public Component getListCellRendererComponent(JList<?> list,
public Component getListCellRendererComponent(JList list,
Object value, int index, boolean isSelected,
boolean cellHasFocus)
{
@ -678,10 +674,9 @@ public void valueChanged(ListSelectionEvent e)
{
if (!e.getValueIsAdjusting())
{
@SuppressWarnings("unchecked")
JList<Parameters.Locale> source
= (JList<Parameters.Locale>) e.getSource();
Parameters.Locale locale = source.getSelectedValue();
JList source = (JList) e.getSource();
Parameters.Locale locale
= (Parameters.Locale) source.getSelectedValue();
source.setEnabled(false);

Loading…
Cancel
Save