From: Brian Hinz Date: Fri, 14 Dec 2012 22:40:02 +0000 (+0000) Subject: Cleanup linter warnings wherever possible and suppress all linter warnings from Jsch... X-Git-Tag: v1.2.90~65 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d93a26d665b18b0e779c524f54c7acdc18898b94;p=tigervnc.git Cleanup linter warnings wherever possible and suppress all linter warnings from Jsch code git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5020 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 86b96274..cf15c80d 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -7,7 +7,7 @@ endif() find_package(Java) -set(DEFAULT_JAVACFLAGS "-source 1.5 -target 1.5 -Xlint:all,-serial,-cast,-unchecked,-fallthrough,-dep-ann,-deprecation") +set(DEFAULT_JAVACFLAGS "-source 1.5 -target 1.5 -Xlint:all,-serial,-cast,-fallthrough,-dep-ann,-deprecation") set(JAVACFLAGS ${DEFAULT_JAVACFLAGS} CACHE STRING "Java compiler flags (Default: ${DEFAULT_JAVACFLAGS})") message(STATUS "Java compiler flags = ${JAVACFLAGS}") diff --git a/java/com/jcraft/jsch/Channel.java b/java/com/jcraft/jsch/Channel.java index 669b575d..73cc4dbf 100644 --- a/java/com/jcraft/jsch/Channel.java +++ b/java/com/jcraft/jsch/Channel.java @@ -35,7 +35,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; - +@SuppressWarnings({"rawtypes","unchecked"}) public abstract class Channel implements Runnable{ static final int SSH_MSG_CHANNEL_OPEN_CONFIRMATION= 91; diff --git a/java/com/jcraft/jsch/ChannelAgentForwarding.java b/java/com/jcraft/jsch/ChannelAgentForwarding.java index 9788d901..52e2db19 100644 --- a/java/com/jcraft/jsch/ChannelAgentForwarding.java +++ b/java/com/jcraft/jsch/ChannelAgentForwarding.java @@ -32,6 +32,7 @@ package com.jcraft.jsch; import java.net.*; import java.util.Vector; +@SuppressWarnings({"rawtypes"}) class ChannelAgentForwarding extends Channel{ static private final int LOCAL_WINDOW_SIZE_MAX=0x20000; diff --git a/java/com/jcraft/jsch/ChannelForwardedTCPIP.java b/java/com/jcraft/jsch/ChannelForwardedTCPIP.java index 912f1d80..39972e19 100644 --- a/java/com/jcraft/jsch/ChannelForwardedTCPIP.java +++ b/java/com/jcraft/jsch/ChannelForwardedTCPIP.java @@ -32,6 +32,7 @@ package com.jcraft.jsch; import java.net.*; import java.io.*; +@SuppressWarnings({"rawtypes","unchecked"}) public class ChannelForwardedTCPIP extends Channel{ static java.util.Vector pool=new java.util.Vector(); diff --git a/java/com/jcraft/jsch/ChannelSession.java b/java/com/jcraft/jsch/ChannelSession.java index ffe217ab..70dea2d2 100644 --- a/java/com/jcraft/jsch/ChannelSession.java +++ b/java/com/jcraft/jsch/ChannelSession.java @@ -31,6 +31,7 @@ package com.jcraft.jsch; import java.util.*; +@SuppressWarnings({"rawtypes","unchecked"}) class ChannelSession extends Channel{ private static byte[] _session=Util.str2byte("session"); diff --git a/java/com/jcraft/jsch/ChannelSftp.java b/java/com/jcraft/jsch/ChannelSftp.java index 66aec550..a278ed61 100644 --- a/java/com/jcraft/jsch/ChannelSftp.java +++ b/java/com/jcraft/jsch/ChannelSftp.java @@ -33,6 +33,7 @@ import java.io.*; import java.util.Vector; +@SuppressWarnings({"rawtypes","unchecked"}) public class ChannelSftp extends ChannelSession{ static private final int LOCAL_MAXIMUM_PACKET_SIZE=32*1024; diff --git a/java/com/jcraft/jsch/ChannelX11.java b/java/com/jcraft/jsch/ChannelX11.java index 393728c0..eb66bb66 100644 --- a/java/com/jcraft/jsch/ChannelX11.java +++ b/java/com/jcraft/jsch/ChannelX11.java @@ -31,6 +31,7 @@ package com.jcraft.jsch; import java.net.*; +@SuppressWarnings({"rawtypes","unchecked"}) class ChannelX11 extends Channel{ static private final int LOCAL_WINDOW_SIZE_MAX=0x20000; diff --git a/java/com/jcraft/jsch/DHG1.java b/java/com/jcraft/jsch/DHG1.java index 9b9a860e..655c196c 100644 --- a/java/com/jcraft/jsch/DHG1.java +++ b/java/com/jcraft/jsch/DHG1.java @@ -29,6 +29,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.jcraft.jsch; +@SuppressWarnings({"rawtypes"}) public class DHG1 extends KeyExchange{ static final byte[] g={ 2 }; diff --git a/java/com/jcraft/jsch/DHG14.java b/java/com/jcraft/jsch/DHG14.java index 8ef5fb79..e46fb6fd 100644 --- a/java/com/jcraft/jsch/DHG14.java +++ b/java/com/jcraft/jsch/DHG14.java @@ -29,6 +29,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.jcraft.jsch; +@SuppressWarnings({"rawtypes"}) public class DHG14 extends KeyExchange{ static final byte[] g={ 2 }; diff --git a/java/com/jcraft/jsch/DHGEX.java b/java/com/jcraft/jsch/DHGEX.java index 23fa9ebf..0f0da104 100644 --- a/java/com/jcraft/jsch/DHGEX.java +++ b/java/com/jcraft/jsch/DHGEX.java @@ -29,6 +29,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.jcraft.jsch; +@SuppressWarnings({"rawtypes"}) public class DHGEX extends KeyExchange{ private static final int SSH_MSG_KEX_DH_GEX_GROUP= 31; diff --git a/java/com/jcraft/jsch/HostKey.java b/java/com/jcraft/jsch/HostKey.java index 6401ad26..6ed420ad 100644 --- a/java/com/jcraft/jsch/HostKey.java +++ b/java/com/jcraft/jsch/HostKey.java @@ -29,6 +29,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.jcraft.jsch; +@SuppressWarnings({"rawtypes","static"}) public class HostKey{ private static final byte[] sshdss=Util.str2byte("ssh-dss"); private static final byte[] sshrsa=Util.str2byte("ssh-rsa"); diff --git a/java/com/jcraft/jsch/IdentityFile.java b/java/com/jcraft/jsch/IdentityFile.java index 0427dab4..cc66dfe2 100644 --- a/java/com/jcraft/jsch/IdentityFile.java +++ b/java/com/jcraft/jsch/IdentityFile.java @@ -31,6 +31,7 @@ package com.jcraft.jsch; import java.io.*; +@SuppressWarnings({"rawtypes","static"}) class IdentityFile implements Identity{ String identity; byte[] key; diff --git a/java/com/jcraft/jsch/IdentityRepository.java b/java/com/jcraft/jsch/IdentityRepository.java index 1f75a014..c6b60d1c 100644 --- a/java/com/jcraft/jsch/IdentityRepository.java +++ b/java/com/jcraft/jsch/IdentityRepository.java @@ -31,6 +31,7 @@ package com.jcraft.jsch; import java.util.Vector; +@SuppressWarnings({"rawtypes"}) public interface IdentityRepository { public Vector getIdentities(); public boolean add(byte[] identity); diff --git a/java/com/jcraft/jsch/JSch.java b/java/com/jcraft/jsch/JSch.java index 20c39e5c..47fa29ae 100644 --- a/java/com/jcraft/jsch/JSch.java +++ b/java/com/jcraft/jsch/JSch.java @@ -32,6 +32,7 @@ package com.jcraft.jsch; import java.io.InputStream; import java.util.Vector; +@SuppressWarnings({"rawtypes","unchecked"}) public class JSch{ public static final String VERSION = "0.1.46"; diff --git a/java/com/jcraft/jsch/KeyExchange.java b/java/com/jcraft/jsch/KeyExchange.java index ef089ba3..77e7b83b 100644 --- a/java/com/jcraft/jsch/KeyExchange.java +++ b/java/com/jcraft/jsch/KeyExchange.java @@ -29,6 +29,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.jcraft.jsch; +@SuppressWarnings({"rawtypes"}) public abstract class KeyExchange{ static final int PROPOSAL_KEX_ALGS=0; diff --git a/java/com/jcraft/jsch/KnownHosts.java b/java/com/jcraft/jsch/KnownHosts.java index ac76477e..342d7743 100644 --- a/java/com/jcraft/jsch/KnownHosts.java +++ b/java/com/jcraft/jsch/KnownHosts.java @@ -31,6 +31,7 @@ package com.jcraft.jsch; import java.io.*; +@SuppressWarnings({"rawtypes","unchecked","static"}) public class KnownHosts implements HostKeyRepository{ private static final String _known_hosts="known_hosts"; diff --git a/java/com/jcraft/jsch/LocalIdentityRepository.java b/java/com/jcraft/jsch/LocalIdentityRepository.java index be814152..7dde42e7 100644 --- a/java/com/jcraft/jsch/LocalIdentityRepository.java +++ b/java/com/jcraft/jsch/LocalIdentityRepository.java @@ -31,6 +31,7 @@ package com.jcraft.jsch; import java.util.Vector; +@SuppressWarnings({"rawtypes","unchecked"}) class LocalIdentityRepository implements IdentityRepository { private Vector identities = new Vector(); diff --git a/java/com/jcraft/jsch/PortWatcher.java b/java/com/jcraft/jsch/PortWatcher.java index 508e16bd..b5fc37bb 100644 --- a/java/com/jcraft/jsch/PortWatcher.java +++ b/java/com/jcraft/jsch/PortWatcher.java @@ -32,6 +32,7 @@ package com.jcraft.jsch; import java.net.*; import java.io.*; +@SuppressWarnings({"rawtypes","unchecked"}) class PortWatcher implements Runnable{ private static java.util.Vector pool=new java.util.Vector(); private static InetAddress anyLocalAddress=null; diff --git a/java/com/jcraft/jsch/Session.java b/java/com/jcraft/jsch/Session.java index 962f52fa..900d96d6 100644 --- a/java/com/jcraft/jsch/Session.java +++ b/java/com/jcraft/jsch/Session.java @@ -32,6 +32,7 @@ package com.jcraft.jsch; import java.io.*; import java.net.*; +@SuppressWarnings({"rawtypes","static","unchecked"}) public class Session implements Runnable{ // http://ietf.org/internet-drafts/draft-ietf-secsh-assignednumbers-01.txt diff --git a/java/com/jcraft/jsch/UserAuthPublicKey.java b/java/com/jcraft/jsch/UserAuthPublicKey.java index 64e8e720..234ad0ac 100644 --- a/java/com/jcraft/jsch/UserAuthPublicKey.java +++ b/java/com/jcraft/jsch/UserAuthPublicKey.java @@ -31,6 +31,7 @@ package com.jcraft.jsch; import java.util.Vector; +@SuppressWarnings({"rawtypes"}) class UserAuthPublicKey extends UserAuth{ public boolean start(Session session) throws Exception{ diff --git a/java/com/jcraft/jsch/Util.java b/java/com/jcraft/jsch/Util.java index df51b2da..8d51fc61 100644 --- a/java/com/jcraft/jsch/Util.java +++ b/java/com/jcraft/jsch/Util.java @@ -30,6 +30,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.jcraft.jsch; import java.net.Socket; +@SuppressWarnings({"rawtypes","unchecked"}) class Util{ private static final byte[] b64 =Util.str2byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="); diff --git a/java/com/jcraft/jsch/jcraft/Compression.java b/java/com/jcraft/jsch/jcraft/Compression.java index dddcaed4..cb1f3170 100644 --- a/java/com/jcraft/jsch/jcraft/Compression.java +++ b/java/com/jcraft/jsch/jcraft/Compression.java @@ -31,6 +31,7 @@ package com.jcraft.jsch.jcraft; import com.jcraft.jzlib.*; import com.jcraft.jsch.*; +@SuppressWarnings({"deprecation"}) public class Compression implements com.jcraft.jsch.Compression { static private final int BUF_SIZE=4096; private final int buffer_margin=32+20; // AES256 + HMACSHA1 diff --git a/java/com/tigervnc/network/TcpListener.java b/java/com/tigervnc/network/TcpListener.java index b7dc4384..d56cd065 100644 --- a/java/com/tigervnc/network/TcpListener.java +++ b/java/com/tigervnc/network/TcpListener.java @@ -98,8 +98,8 @@ public class TcpListener extends SocketListener { // Accept an incoming connection try { if (selector.select(0) > 0) { - Set keys = selector.selectedKeys(); - Iterator iter = keys.iterator(); + Set keys = selector.selectedKeys(); + Iterator iter = keys.iterator(); while (iter.hasNext()) { SelectionKey key = (SelectionKey)iter.next(); iter.remove(); diff --git a/java/com/tigervnc/rfb/CConnection.java b/java/com/tigervnc/rfb/CConnection.java index 959f8138..a9230285 100644 --- a/java/com/tigervnc/rfb/CConnection.java +++ b/java/com/tigervnc/rfb/CConnection.java @@ -122,7 +122,7 @@ abstract public class CConnection extends CMsgHandler { throwConnFailedException(); } else if (secType == Security.secTypeNone || secType == Security.secTypeVncAuth) { - Iterator i; + Iterator i; for (i = secTypes.iterator(); i.hasNext(); ) { int refType = (Integer)i.next(); if (refType == secType) { @@ -146,7 +146,7 @@ abstract public class CConnection extends CMsgHandler { if (nServerSecTypes == 0) throwConnFailedException(); - Iterator j; + Iterator j; for (int i = 0; i < nServerSecTypes; i++) { int serverSecType = is.readU8(); diff --git a/java/com/tigervnc/rfb/CMsgWriterV3.java b/java/com/tigervnc/rfb/CMsgWriterV3.java index 1ac583b3..a730698d 100644 --- a/java/com/tigervnc/rfb/CMsgWriterV3.java +++ b/java/com/tigervnc/rfb/CMsgWriterV3.java @@ -55,7 +55,7 @@ public class CMsgWriterV3 extends CMsgWriter { os.writeU8(layout.num_screens()); os.pad(1); - for (Iterator iter = layout.screens.iterator(); iter.hasNext(); ) { + for (Iterator iter = layout.screens.iterator(); iter.hasNext(); ) { Screen refScreen = (Screen)iter.next(); os.writeU32(refScreen.id); os.writeU16(refScreen.dimensions.tl.x); diff --git a/java/com/tigervnc/rfb/CSecurityVeNCrypt.java b/java/com/tigervnc/rfb/CSecurityVeNCrypt.java index a1f22314..528158c3 100644 --- a/java/com/tigervnc/rfb/CSecurityVeNCrypt.java +++ b/java/com/tigervnc/rfb/CSecurityVeNCrypt.java @@ -131,7 +131,7 @@ public class CSecurityVeNCrypt extends CSecurity { if (!haveChosenType) { chosenType = Security.secTypeInvalid; int i; - Iterator j; + Iterator j; List secTypes = new ArrayList(); secTypes = Security.GetEnabledExtSecTypes(); diff --git a/java/com/tigervnc/rfb/Configuration.java b/java/com/tigervnc/rfb/Configuration.java index aca8b536..fb635c7b 100644 --- a/java/com/tigervnc/rfb/Configuration.java +++ b/java/com/tigervnc/rfb/Configuration.java @@ -285,7 +285,7 @@ public class Configuration { return; } - for (Iterator i = props.stringPropertyNames().iterator(); i.hasNext();) { + for (Iterator i = props.stringPropertyNames().iterator(); i.hasNext();) { String name = (String)i.next(); if (name.startsWith("[")) { // skip the section delimiters diff --git a/java/com/tigervnc/rfb/ScreenSet.java b/java/com/tigervnc/rfb/ScreenSet.java index b848b132..d20374f6 100644 --- a/java/com/tigervnc/rfb/ScreenSet.java +++ b/java/com/tigervnc/rfb/ScreenSet.java @@ -35,7 +35,7 @@ public class ScreenSet { public final void add_screen(Screen screen) { screens.add(screen); } public final void remove_screen(int id) { - for (Iterator iter = screens.iterator(); iter.hasNext(); ) { + for (Iterator iter = screens.iterator(); iter.hasNext(); ) { Screen refScreen = (Screen)iter.next(); if (refScreen.id == id) iter.remove(); @@ -53,7 +53,7 @@ public class ScreenSet { fb_rect.setXYWH(0, 0, fb_width, fb_height); - for (Iterator iter = screens.iterator(); iter.hasNext(); ) { + for (Iterator iter = screens.iterator(); iter.hasNext(); ) { Screen refScreen = (Screen)iter.next(); if (refScreen.dimensions.is_empty()) return false; @@ -68,7 +68,7 @@ public class ScreenSet { } public final void debug_print() { - for (Iterator iter = screens.iterator(); iter.hasNext(); ) { + for (Iterator iter = screens.iterator(); iter.hasNext(); ) { Screen refScreen = (Screen)iter.next(); vlog.error(" "+refScreen.id+" (0x"+refScreen.id+"): "+ refScreen.dimensions.width()+"x"+refScreen.dimensions.height()+ diff --git a/java/com/tigervnc/rfb/Security.java b/java/com/tigervnc/rfb/Security.java index 6d52ede7..9df49951 100644 --- a/java/com/tigervnc/rfb/Security.java +++ b/java/com/tigervnc/rfb/Security.java @@ -77,7 +77,7 @@ public class Security { List result = new ArrayList(); result.add(secTypeVeNCrypt); - for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); ) { + for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); ) { int refType = (Integer)i.next(); if (refType < 0x100) result.add(refType); @@ -90,7 +90,7 @@ public class Security { { List result = new ArrayList(); - for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); ) { + for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); ) { int refType = (Integer)i.next(); if (refType != secTypeVeNCrypt) /* Do not include VeNCrypt to avoid loops */ result.add(refType); @@ -102,7 +102,7 @@ public class Security { public static final void EnableSecType(int secType) { - for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); ) + for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); ) if ((Integer)i.next() == secType) return; @@ -111,7 +111,7 @@ public class Security { public boolean IsSupported(int secType) { - Iterator i; + Iterator i; for (i = enabledSecTypes.iterator(); i.hasNext(); ) if ((Integer)i.next() == secType) diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java index 9adb9675..e51cb444 100644 --- a/java/com/tigervnc/vncviewer/CConn.java +++ b/java/com/tigervnc/vncviewer/CConn.java @@ -297,7 +297,7 @@ public class CConn extends CConnection setServerPort(port); sock = new TcpSocket(host, port); vlog.info("Redirected to "+host+":"+port); - viewer.newViewer(viewer, sock, true); + VncViewer.newViewer(viewer, sock, true); } catch (java.lang.Exception e) { throw new Exception(e.toString()); } @@ -355,7 +355,7 @@ public class CConn extends CConnection else if (layout.num_screens() != 1) { while (true) { - Iterator iter = layout.screens.iterator(); + Iterator iter = layout.screens.iterator(); Screen screen = (Screen)iter.next(); if (!iter.hasNext()) @@ -831,7 +831,7 @@ public class CConn extends CConnection /* Process non-VeNCrypt sectypes */ java.util.List secTypes = new ArrayList(); secTypes = Security.GetEnabledSecTypes(); - for (Iterator i = secTypes.iterator(); i.hasNext();) { + for (Iterator i = secTypes.iterator(); i.hasNext();) { switch ((Integer)i.next()) { case Security.secTypeVeNCrypt: options.secVeNCrypt.setSelected(UserPreferences.getBool("viewer", "secVeNCrypt", true)); @@ -851,7 +851,7 @@ public class CConn extends CConnection if (options.secVeNCrypt.isSelected()) { java.util.List secTypesExt = new ArrayList(); secTypesExt = Security.GetEnabledExtSecTypes(); - for (Iterator iext = secTypesExt.iterator(); iext.hasNext();) { + for (Iterator iext = secTypesExt.iterator(); iext.hasNext();) { switch ((Integer)iext.next()) { case Security.secTypePlain: options.encNone.setSelected(UserPreferences.getBool("viewer", "encNone", true)); diff --git a/java/com/tigervnc/vncviewer/MenuKey.java b/java/com/tigervnc/vncviewer/MenuKey.java index 0a240149..49677087 100644 --- a/java/com/tigervnc/vncviewer/MenuKey.java +++ b/java/com/tigervnc/vncviewer/MenuKey.java @@ -78,10 +78,10 @@ public class MenuKey } static int getMenuKeyCode() { - String menuKeyStr; int menuKeyCode = KeyEvent.VK_F8; - menuKeyStr = + @SuppressWarnings({"static"}) + String menuKeyStr = Configuration.global().getParam("menuKey").getValueStr(); for(int i = 0; i < getMenuKeySymbolCount(); i++) if (menuSymbols[i].name.equals(menuKeyStr)) diff --git a/java/com/tigervnc/vncviewer/OptionsDialog.java b/java/com/tigervnc/vncviewer/OptionsDialog.java index 80d9f40d..cd213410 100644 --- a/java/com/tigervnc/vncviewer/OptionsDialog.java +++ b/java/com/tigervnc/vncviewer/OptionsDialog.java @@ -39,6 +39,7 @@ class OptionsDialog extends Dialog implements OptionsDialogCallback cb; JPanel FormatPanel, InputsPanel, MiscPanel, DefaultsPanel, SecPanel; JCheckBox autoSelect, customCompressLevel, noJpeg; + @SuppressWarnings({"rawtypes"}) JComboBox menuKey, compressLevel, qualityLevel, scalingFactor; ButtonGroup encodingGroup, colourGroup; JRadioButton zrle, hextile, tight, raw; @@ -51,6 +52,7 @@ class OptionsDialog extends Dialog implements JButton ca, crl; JButton cfLoadButton, cfSaveAsButton, defSaveButton, defReloadButton, defClearButton; + @SuppressWarnings({"rawtypes","unchecked"}) public OptionsDialog(OptionsDialogCallback cb_) { super(true); cb = cb_; diff --git a/java/com/tigervnc/vncviewer/ServerDialog.java b/java/com/tigervnc/vncviewer/ServerDialog.java index 976dc7f2..a1345850 100644 --- a/java/com/tigervnc/vncviewer/ServerDialog.java +++ b/java/com/tigervnc/vncviewer/ServerDialog.java @@ -33,6 +33,7 @@ class ServerDialog extends Dialog implements ItemListener { + @SuppressWarnings({"unchecked","rawtypes"}) public ServerDialog(OptionsDialog options_, String defaultServerName, CConn cc_) { @@ -41,10 +42,10 @@ class ServerDialog extends Dialog implements setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); setResizable(false); setSize(new Dimension(340, 135)); - setTitle("VNC Viewer : Connection Details"); + setTitle("VNC Viewer: Connection Details"); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { - if (cc.viewer.nViewers == 1) { + if (VncViewer.nViewers == 1) { cc.viewer.exit(1); } else { ret = false; @@ -120,13 +121,14 @@ class ServerDialog extends Dialog implements return; } + @SuppressWarnings({"unchecked","rawtypes"}) public void actionPerformed(ActionEvent e) { Object s = e.getSource(); if (s instanceof JButton && (JButton)s == okButton) { commit(); endDialog(); } else if (s instanceof JButton && (JButton)s == cancelButton) { - if (cc.viewer.nViewers == 1) + if (VncViewer.nViewers == 1) cc.viewer.exit(1); ret = false; endDialog(); @@ -148,7 +150,7 @@ class ServerDialog extends Dialog implements String serverName = (String)server.getSelectedItem(); if (serverName == null || serverName.equals("")) { vlog.error("Invalid servername specified"); - if (cc.viewer.nViewers == 1) + if (VncViewer.nViewers == 1) cc.viewer.exit(1); ret = false; endDialog(); @@ -177,6 +179,7 @@ class ServerDialog extends Dialog implements } CConn cc; + @SuppressWarnings("rawtypes") JComboBox server; ComboBoxEditor editor; JButton aboutButton, optionsButton, okButton, cancelButton; diff --git a/java/com/tigervnc/vncviewer/Viewport.java b/java/com/tigervnc/vncviewer/Viewport.java index c148416b..95489fac 100644 --- a/java/com/tigervnc/vncviewer/Viewport.java +++ b/java/com/tigervnc/vncviewer/Viewport.java @@ -53,7 +53,7 @@ public class Viewport extends JFrame }); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { - if (cc.viewer.nViewers == 1) { + if (VncViewer.nViewers == 1) { cc.viewer.exit(1); } else { cc.close(); diff --git a/java/com/tigervnc/vncviewer/VncViewer.java b/java/com/tigervnc/vncviewer/VncViewer.java index 8cc9fc63..cf38760f 100644 --- a/java/com/tigervnc/vncviewer/VncViewer.java +++ b/java/com/tigervnc/vncviewer/VncViewer.java @@ -40,8 +40,7 @@ import java.io.File; import java.lang.Character; import java.util.jar.Attributes; import java.util.jar.Manifest; -import java.util.ArrayList; -import java.util.Iterator; +import java.util.*; import javax.swing.*; import javax.swing.plaf.FontUIResource; import javax.swing.UIManager.*; @@ -80,7 +79,7 @@ public class VncViewer extends java.applet.Applet implements Runnable UIManager.put("TitledBorder.titleColor",Color.blue); if (UIManager.getLookAndFeel().getName().equals("Metal")) { UIManager.put("swing.boldMetal", Boolean.FALSE); - java.util.Enumeration keys = UIManager.getDefaults().keys(); + Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); diff --git a/java/com/tigervnc/vncviewer/tunnel.java b/java/com/tigervnc/vncviewer/tunnel.java index 23da0a99..a66d83ae 100644 --- a/java/com/tigervnc/vncviewer/tunnel.java +++ b/java/com/tigervnc/vncviewer/tunnel.java @@ -287,7 +287,7 @@ public class tunnel ArrayList privateKeys = new ArrayList(); privateKeys.add(new File(homeDir+"/.ssh/id_rsa")); privateKeys.add(new File(homeDir+"/.ssh/id_dsa")); - for (Iterator i = privateKeys.iterator(); i.hasNext();) { + for (Iterator i = privateKeys.iterator(); i.hasNext();) { File privateKey = (File)i.next(); if (privateKey.exists() && privateKey.canRead()) jsch.addIdentity(privateKey.getAbsolutePath());