summaryrefslogtreecommitdiffstats
path: root/java/com/tigervnc/vncviewer
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2012-12-14 22:40:02 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2012-12-14 22:40:02 +0000
commitd93a26d665b18b0e779c524f54c7acdc18898b94 (patch)
tree54908596b5aff623723ce964e220549d7254dbd6 /java/com/tigervnc/vncviewer
parent32c46228f5e6d2e0c4bf1701bd36aeb0b89f4f32 (diff)
downloadtigervnc-d93a26d665b18b0e779c524f54c7acdc18898b94.tar.gz
tigervnc-d93a26d665b18b0e779c524f54c7acdc18898b94.zip
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
Diffstat (limited to 'java/com/tigervnc/vncviewer')
-rw-r--r--java/com/tigervnc/vncviewer/CConn.java8
-rw-r--r--java/com/tigervnc/vncviewer/MenuKey.java4
-rw-r--r--java/com/tigervnc/vncviewer/OptionsDialog.java2
-rw-r--r--java/com/tigervnc/vncviewer/ServerDialog.java11
-rw-r--r--java/com/tigervnc/vncviewer/Viewport.java2
-rw-r--r--java/com/tigervnc/vncviewer/VncViewer.java5
-rw-r--r--java/com/tigervnc/vncviewer/tunnel.java2
7 files changed, 19 insertions, 15 deletions
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<Screen> 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<Integer> secTypes = new ArrayList<Integer>();
secTypes = Security.GetEnabledSecTypes();
- for (Iterator i = secTypes.iterator(); i.hasNext();) {
+ for (Iterator<Integer> 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<Integer> secTypesExt = new ArrayList<Integer>();
secTypesExt = Security.GetEnabledExtSecTypes();
- for (Iterator iext = secTypesExt.iterator(); iext.hasNext();) {
+ for (Iterator<Integer> 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<Object> 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<File> privateKeys = new ArrayList<File>();
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<File> i = privateKeys.iterator(); i.hasNext();) {
File privateKey = (File)i.next();
if (privateKey.exists() && privateKey.canRead())
jsch.addIdentity(privateKey.getAbsolutePath());