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}")
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;
import java.net.*;
import java.util.Vector;
+@SuppressWarnings({"rawtypes"})
class ChannelAgentForwarding extends Channel{
static private final int LOCAL_WINDOW_SIZE_MAX=0x20000;
import java.net.*;
import java.io.*;
+@SuppressWarnings({"rawtypes","unchecked"})
public class ChannelForwardedTCPIP extends Channel{
static java.util.Vector pool=new java.util.Vector();
import java.util.*;
+@SuppressWarnings({"rawtypes","unchecked"})
class ChannelSession extends Channel{
private static byte[] _session=Util.str2byte("session");
import java.util.Vector;
+@SuppressWarnings({"rawtypes","unchecked"})
public class ChannelSftp extends ChannelSession{
static private final int LOCAL_MAXIMUM_PACKET_SIZE=32*1024;
import java.net.*;
+@SuppressWarnings({"rawtypes","unchecked"})
class ChannelX11 extends Channel{
static private final int LOCAL_WINDOW_SIZE_MAX=0x20000;
package com.jcraft.jsch;
+@SuppressWarnings({"rawtypes"})
public class DHG1 extends KeyExchange{
static final byte[] g={ 2 };
package com.jcraft.jsch;
+@SuppressWarnings({"rawtypes"})
public class DHG14 extends KeyExchange{
static final byte[] g={ 2 };
package com.jcraft.jsch;
+@SuppressWarnings({"rawtypes"})
public class DHGEX extends KeyExchange{
private static final int SSH_MSG_KEX_DH_GEX_GROUP= 31;
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");
import java.io.*;
+@SuppressWarnings({"rawtypes","static"})
class IdentityFile implements Identity{
String identity;
byte[] key;
import java.util.Vector;
+@SuppressWarnings({"rawtypes"})
public interface IdentityRepository {
public Vector getIdentities();
public boolean add(byte[] identity);
import java.io.InputStream;
import java.util.Vector;
+@SuppressWarnings({"rawtypes","unchecked"})
public class JSch{
public static final String VERSION = "0.1.46";
package com.jcraft.jsch;
+@SuppressWarnings({"rawtypes"})
public abstract class KeyExchange{
static final int PROPOSAL_KEX_ALGS=0;
import java.io.*;
+@SuppressWarnings({"rawtypes","unchecked","static"})
public
class KnownHosts implements HostKeyRepository{
private static final String _known_hosts="known_hosts";
import java.util.Vector;
+@SuppressWarnings({"rawtypes","unchecked"})
class LocalIdentityRepository implements IdentityRepository {
private Vector identities = new Vector();
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;
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
import java.util.Vector;
+@SuppressWarnings({"rawtypes"})
class UserAuthPublicKey extends UserAuth{
public boolean start(Session session) throws Exception{
package com.jcraft.jsch;
import java.net.Socket;
+@SuppressWarnings({"rawtypes","unchecked"})
class Util{
private static final byte[] b64 =Util.str2byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");
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
// Accept an incoming connection
try {
if (selector.select(0) > 0) {
- Set keys = selector.selectedKeys();
- Iterator iter = keys.iterator();
+ Set<SelectionKey> keys = selector.selectedKeys();
+ Iterator<SelectionKey> iter = keys.iterator();
while (iter.hasNext()) {
SelectionKey key = (SelectionKey)iter.next();
iter.remove();
throwConnFailedException();
} else if (secType == Security.secTypeNone || secType == Security.secTypeVncAuth) {
- Iterator i;
+ Iterator<Integer> i;
for (i = secTypes.iterator(); i.hasNext(); ) {
int refType = (Integer)i.next();
if (refType == secType) {
if (nServerSecTypes == 0)
throwConnFailedException();
- Iterator j;
+ Iterator<Integer> j;
for (int i = 0; i < nServerSecTypes; i++) {
int serverSecType = is.readU8();
os.writeU8(layout.num_screens());
os.pad(1);
- for (Iterator iter = layout.screens.iterator(); iter.hasNext(); ) {
+ for (Iterator<Screen> iter = layout.screens.iterator(); iter.hasNext(); ) {
Screen refScreen = (Screen)iter.next();
os.writeU32(refScreen.id);
os.writeU16(refScreen.dimensions.tl.x);
if (!haveChosenType) {
chosenType = Security.secTypeInvalid;
int i;
- Iterator j;
+ Iterator<Integer> j;
List<Integer> secTypes = new ArrayList<Integer>();
secTypes = Security.GetEnabledExtSecTypes();
return;
}
- for (Iterator i = props.stringPropertyNames().iterator(); i.hasNext();) {
+ for (Iterator<String> i = props.stringPropertyNames().iterator(); i.hasNext();) {
String name = (String)i.next();
if (name.startsWith("[")) {
// skip the section delimiters
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<Screen> iter = screens.iterator(); iter.hasNext(); ) {
Screen refScreen = (Screen)iter.next();
if (refScreen.id == id)
iter.remove();
fb_rect.setXYWH(0, 0, fb_width, fb_height);
- for (Iterator iter = screens.iterator(); iter.hasNext(); ) {
+ for (Iterator<Screen> iter = screens.iterator(); iter.hasNext(); ) {
Screen refScreen = (Screen)iter.next();
if (refScreen.dimensions.is_empty())
return false;
}
public final void debug_print() {
- for (Iterator iter = screens.iterator(); iter.hasNext(); ) {
+ for (Iterator<Screen> iter = screens.iterator(); iter.hasNext(); ) {
Screen refScreen = (Screen)iter.next();
vlog.error(" "+refScreen.id+" (0x"+refScreen.id+"): "+
refScreen.dimensions.width()+"x"+refScreen.dimensions.height()+
List<Integer> result = new ArrayList<Integer>();
result.add(secTypeVeNCrypt);
- for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); ) {
+ for (Iterator<Integer> i = enabledSecTypes.iterator(); i.hasNext(); ) {
int refType = (Integer)i.next();
if (refType < 0x100)
result.add(refType);
{
List<Integer> result = new ArrayList<Integer>();
- for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); ) {
+ for (Iterator<Integer> i = enabledSecTypes.iterator(); i.hasNext(); ) {
int refType = (Integer)i.next();
if (refType != secTypeVeNCrypt) /* Do not include VeNCrypt to avoid loops */
result.add(refType);
public static final void EnableSecType(int secType)
{
- for (Iterator i = enabledSecTypes.iterator(); i.hasNext(); )
+ for (Iterator<Integer> i = enabledSecTypes.iterator(); i.hasNext(); )
if ((Integer)i.next() == secType)
return;
public boolean IsSupported(int secType)
{
- Iterator i;
+ Iterator<Integer> i;
for (i = enabledSecTypes.iterator(); i.hasNext(); )
if ((Integer)i.next() == secType)
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());
}
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())
/* 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));
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));
}
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))
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;
JButton ca, crl;
JButton cfLoadButton, cfSaveAsButton, defSaveButton, defReloadButton, defClearButton;
+ @SuppressWarnings({"rawtypes","unchecked"})
public OptionsDialog(OptionsDialogCallback cb_) {
super(true);
cb = cb_;
ItemListener
{
+ @SuppressWarnings({"unchecked","rawtypes"})
public ServerDialog(OptionsDialog options_,
String defaultServerName, CConn cc_) {
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;
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();
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();
}
CConn cc;
+ @SuppressWarnings("rawtypes")
JComboBox server;
ComboBoxEditor editor;
JButton aboutButton, optionsButton, okButton, cancelButton;
});
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
- if (cc.viewer.nViewers == 1) {
+ if (VncViewer.nViewers == 1) {
cc.viewer.exit(1);
} else {
cc.close();
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.*;
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);
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());