Program: 111578
Project: 111578
Buggy source:
public void getOptions(){
  autoSelect=options.autoSelect.isSelected();
  if (fullColour != options.fullColour.isSelected())   formatChange=true;
  fullColour=options.fullColour.isSelected();
  if (!fullColour) {
    int newLowColourLevel=(options.veryLowColour.isSelected() ? 0 : options.lowColour.isSelected() ? 1 : 2);
    if (newLowColourLevel != lowColourLevel) {
      lowColourLevel=newLowColourLevel;
      formatChange=true;
    }
  }
  int newEncoding=(options.zrle.isSelected() ? Encodings.encodingZRLE : options.hextile.isSelected() ? Encodings.encodingHextile : options.tight.isSelected() ? Encodings.encodingTight : Encodings.encodingRaw);
  if (newEncoding != currentEncoding) {
    currentEncoding=newEncoding;
    encodingChange=true;
  }
  viewer.customCompressLevel.setParam(options.customCompressLevel.isSelected());
  if (cp.customCompressLevel != viewer.customCompressLevel.getValue()) {
    cp.customCompressLevel=viewer.customCompressLevel.getValue();
    encodingChange=true;
  }
  if (Integer.parseInt(options.compressLevel.getSelectedItem().toString()) >= 0 && Integer.parseInt(options.compressLevel.getSelectedItem().toString()) <= 9) {
    viewer.compressLevel.setParam(options.compressLevel.getSelectedItem().toString());
  }
 else {
    viewer.compressLevel.setParam(viewer.compressLevel.getDefaultStr());
  }
  if (cp.compressLevel != viewer.compressLevel.getValue()) {
    cp.compressLevel=viewer.compressLevel.getValue();
    encodingChange=true;
  }
  viewer.noJpeg.setParam(!options.noJpeg.isSelected());
  if (cp.noJpeg != viewer.noJpeg.getValue()) {
    cp.noJpeg=viewer.noJpeg.getValue();
    encodingChange=true;
  }
  viewer.qualityLevel.setParam(options.qualityLevel.getSelectedItem().toString());
  if (cp.qualityLevel != viewer.qualityLevel.getValue()) {
    cp.qualityLevel=viewer.qualityLevel.getValue();
    encodingChange=true;
  }
  viewer.sendLocalUsername.setParam(options.sendLocalUsername.isSelected());
  viewer.viewOnly.setParam(options.viewOnly.isSelected());
  viewer.acceptClipboard.setParam(options.acceptClipboard.isSelected());
  viewer.sendClipboard.setParam(options.sendClipboard.isSelected());
  viewer.fastCopyRect.setParam(options.fastCopyRect.isSelected());
  viewer.acceptBell.setParam(options.acceptBell.isSelected());
  if (options.autoScale) {
    viewer.scalingFactor.setParam("String_Node_Str");
    scaleFactor=-1;
    if (desktop != null) {
      reconfigureViewport();
      viewport.update(viewport.g);
      if (desktop.cursor != null)       setCursor(desktop.cursor.width(),desktop.cursor.height(),desktop.cursor.hotspot,desktop.cursor.data,desktop.cursor.mask);
    }
  }
 else   if (options.fixedRatioScale) {
    viewer.scalingFactor.setParam("String_Node_Str");
    scaleFactor=-1;
    if (desktop != null) {
      reconfigureViewport();
      viewport.update(viewport.g);
      if (desktop.cursor != null)       setCursor(desktop.cursor.width(),desktop.cursor.height(),desktop.cursor.hotspot,desktop.cursor.data,desktop.cursor.mask);
    }
  }
 else {
    String scaleString=options.scalingFactor.getSelectedItem().toString();
    viewer.scalingFactor.setParam(scaleString.substring(0,scaleString.length() - 1));
    int oldScaleFactor=scaleFactor;
    scaleFactor=Integer.parseInt(scaleString.substring(0,scaleString.length() - 1));
    if (oldScaleFactor != scaleFactor && desktop != null) {
      reconfigureViewport();
      viewport.update(viewport.g);
      if (desktop.cursor != null)       setCursor(desktop.cursor.width(),desktop.cursor.height(),desktop.cursor.hotspot,desktop.cursor.data,desktop.cursor.mask);
    }
  }
  clipboardDialog.setSendingEnabled(viewer.sendClipboard.getValue());
  menuKey=(int)(options.menuKey.getSelectedIndex() + 0xFFBE);
  F8Menu.f8.setLabel("String_Node_Str" + (menuKey - Keysyms.F1 + 1));
  shared=options.shared.isSelected();
  setShared(shared);
  viewer.useLocalCursor.setParam(options.useLocalCursor.isSelected());
  if (cp.supportsLocalCursor != viewer.useLocalCursor.getValue()) {
    cp.supportsLocalCursor=viewer.useLocalCursor.getValue();
    encodingChange=true;
    if (desktop != null)     desktop.resetLocalCursor();
  }
  checkEncodings();
  if (state() != RFBSTATE_NORMAL) {
    if (options.encNone.isSelected()) {
      if (options.secNone.isSelected())       Security.EnableSecType(Security.secTypeNone);
      if (options.secVnc.isSelected())       Security.EnableSecType(Security.secTypeVncAuth);
      if (options.secPlain.isSelected())       Security.EnableSecType(Security.secTypePlain);
      if (options.secIdent.isSelected())       Security.EnableSecType(Security.secTypeIdent);
    }
 else {
      Security.DisableSecType(Security.secTypeNone);
      Security.DisableSecType(Security.secTypeVncAuth);
      Security.DisableSecType(Security.secTypePlain);
      Security.DisableSecType(Security.secTypeIdent);
    }
    if (options.encTLS.isSelected()) {
      if (options.secNone.isSelected())       Security.EnableSecType(Security.secTypeTLSNone);
      if (options.secVnc.isSelected())       Security.EnableSecType(Security.secTypeTLSVnc);
      if (options.secPlain.isSelected())       Security.EnableSecType(Security.secTypeTLSPlain);
      if (options.secIdent.isSelected())       Security.EnableSecType(Security.secTypeTLSIdent);
    }
 else {
      Security.DisableSecType(Security.secTypeTLSNone);
      Security.DisableSecType(Security.secTypeTLSVnc);
      Security.DisableSecType(Security.secTypeTLSPlain);
      Security.DisableSecType(Security.secTypeTLSIdent);
    }
    if (options.encX509.isSelected()) {
      if (options.secNone.isSelected())       Security.EnableSecType(Security.secTypeX509None);
      if (options.secVnc.isSelected())       Security.EnableSecType(Security.secTypeX509Vnc);
      if (options.secPlain.isSelected())       Security.EnableSecType(Security.secTypeX509Plain);
      if (options.secIdent.isSelected())       Security.EnableSecType(Security.secTypeX509Ident);
    }
 else {
      Security.DisableSecType(Security.secTypeX509None);
      Security.DisableSecType(Security.secTypeX509Vnc);
      Security.DisableSecType(Security.secTypeX509Plain);
      Security.DisableSecType(Security.secTypeX509Ident);
    }
    if (options.secNone.isSelected()) {
      if (options.encNone.isSelected())       Security.EnableSecType(Security.secTypeNone);
      if (options.encTLS.isSelected())       Security.EnableSecType(Security.secTypeTLSNone);
      if (options.encX509.isSelected())       Security.EnableSecType(Security.secTypeX509None);
    }
 else {
      Security.DisableSecType(Security.secTypeNone);
      Security.DisableSecType(Security.secTypeTLSNone);
      Security.DisableSecType(Security.secTypeX509None);
    }
    if (options.secVnc.isSelected()) {
      if (options.encNone.isSelected())       Security.EnableSecType(Security.secTypeVncAuth);
      if (options.encTLS.isSelected())       Security.EnableSecType(Security.secTypeTLSVnc);
      if (options.encX509.isSelected())       Security.EnableSecType(Security.secTypeX509Vnc);
    }
 else {
      Security.DisableSecType(Security.secTypeVncAuth);
      Security.DisableSecType(Security.secTypeTLSVnc);
      Security.DisableSecType(Security.secTypeX509Vnc);
    }
    if (options.secPlain.isSelected()) {
      if (options.encNone.isSelected())       Security.EnableSecType(Security.secTypePlain);
      if (options.encTLS.isSelected())       Security.EnableSecType(Security.secTypeTLSPlain);
      if (options.encX509.isSelected())       Security.EnableSecType(Security.secTypeX509Plain);
    }
 else {
      Security.DisableSecType(Security.secTypePlain);
      Security.DisableSecType(Security.secTypeTLSPlain);
      Security.DisableSecType(Security.secTypeX509Plain);
    }
    if (options.secIdent.isSelected()) {
      if (options.encNone.isSelected())       Security.EnableSecType(Security.secTypeIdent);
      if (options.encTLS.isSelected())       Security.EnableSecType(Security.secTypeTLSIdent);
      if (options.encX509.isSelected())       Security.EnableSecType(Security.secTypeX509Ident);
    }
 else {
      Security.DisableSecType(Security.secTypeIdent);
      Security.DisableSecType(Security.secTypeTLSIdent);
      Security.DisableSecType(Security.secTypeX509Ident);
    }
    CSecurityTLS.x509ca.setParam(options.ca.getText());
    CSecurityTLS.x509crl.setParam(options.crl.getText());
  }
}

Fixed version (ground truth):
public void getOptions(){
  autoSelect=options.autoSelect.isSelected();
  if (fullColour != options.fullColour.isSelected())   formatChange=true;
  fullColour=options.fullColour.isSelected();
  if (!fullColour) {
    int newLowColourLevel=(options.veryLowColour.isSelected() ? 0 : options.lowColour.isSelected() ? 1 : 2);
    if (newLowColourLevel != lowColourLevel) {
      lowColourLevel=newLowColourLevel;
      formatChange=true;
    }
  }
  int newEncoding=(options.zrle.isSelected() ? Encodings.encodingZRLE : options.hextile.isSelected() ? Encodings.encodingHextile : options.tight.isSelected() ? Encodings.encodingTight : Encodings.encodingRaw);
  if (newEncoding != currentEncoding) {
    currentEncoding=newEncoding;
    encodingChange=true;
  }
  viewer.customCompressLevel.setParam(options.customCompressLevel.isSelected());
  if (cp.customCompressLevel != viewer.customCompressLevel.getValue()) {
    cp.customCompressLevel=viewer.customCompressLevel.getValue();
    encodingChange=true;
  }
  if (Integer.parseInt(options.compressLevel.getSelectedItem().toString()) >= 0 && Integer.parseInt(options.compressLevel.getSelectedItem().toString()) <= 9) {
    viewer.compressLevel.setParam(options.compressLevel.getSelectedItem().toString());
  }
 else {
    viewer.compressLevel.setParam(viewer.compressLevel.getDefaultStr());
  }
  if (cp.compressLevel != viewer.compressLevel.getValue()) {
    cp.compressLevel=viewer.compressLevel.getValue();
    encodingChange=true;
  }
  viewer.noJpeg.setParam(!options.noJpeg.isSelected());
  if (cp.noJpeg != viewer.noJpeg.getValue()) {
    cp.noJpeg=viewer.noJpeg.getValue();
    encodingChange=true;
  }
  viewer.qualityLevel.setParam(options.qualityLevel.getSelectedItem().toString());
  if (cp.qualityLevel != viewer.qualityLevel.getValue()) {
    cp.qualityLevel=viewer.qualityLevel.getValue();
    encodingChange=true;
  }
  viewer.sendLocalUsername.setParam(options.sendLocalUsername.isSelected());
  viewer.viewOnly.setParam(options.viewOnly.isSelected());
  viewer.acceptClipboard.setParam(options.acceptClipboard.isSelected());
  viewer.sendClipboard.setParam(options.sendClipboard.isSelected());
  viewer.fastCopyRect.setParam(options.fastCopyRect.isSelected());
  viewer.acceptBell.setParam(options.acceptBell.isSelected());
  if (options.autoScale) {
    viewer.scalingFactor.setParam("String_Node_Str");
    scaleFactor=-1;
    if (desktop != null) {
      reconfigureViewport();
      viewport.update(viewport.g);
    }
  }
 else   if (options.fixedRatioScale) {
    viewer.scalingFactor.setParam("String_Node_Str");
    scaleFactor=-1;
    if (desktop != null) {
      reconfigureViewport();
      viewport.update(viewport.g);
    }
  }
 else {
    String scaleString=options.scalingFactor.getSelectedItem().toString();
    viewer.scalingFactor.setParam(scaleString.substring(0,scaleString.length() - 1));
    int oldScaleFactor=scaleFactor;
    scaleFactor=Integer.parseInt(scaleString.substring(0,scaleString.length() - 1));
    if (oldScaleFactor != scaleFactor && desktop != null) {
      reconfigureViewport();
      viewport.update(viewport.g);
    }
  }
  clipboardDialog.setSendingEnabled(viewer.sendClipboard.getValue());
  menuKey=(int)(options.menuKey.getSelectedIndex() + 0xFFBE);
  F8Menu.f8.setLabel("String_Node_Str" + (menuKey - Keysyms.F1 + 1));
  shared=options.shared.isSelected();
  setShared(shared);
  viewer.useLocalCursor.setParam(options.useLocalCursor.isSelected());
  if (cp.supportsLocalCursor != viewer.useLocalCursor.getValue()) {
    cp.supportsLocalCursor=viewer.useLocalCursor.getValue();
    encodingChange=true;
    if (desktop != null)     desktop.resetLocalCursor();
  }
  checkEncodings();
  if (state() != RFBSTATE_NORMAL) {
    if (options.encNone.isSelected()) {
      if (options.secNone.isSelected())       Security.EnableSecType(Security.secTypeNone);
      if (options.secVnc.isSelected())       Security.EnableSecType(Security.secTypeVncAuth);
      if (options.secPlain.isSelected())       Security.EnableSecType(Security.secTypePlain);
      if (options.secIdent.isSelected())       Security.EnableSecType(Security.secTypeIdent);
    }
 else {
      Security.DisableSecType(Security.secTypeNone);
      Security.DisableSecType(Security.secTypeVncAuth);
      Security.DisableSecType(Security.secTypePlain);
      Security.DisableSecType(Security.secTypeIdent);
    }
    if (options.encTLS.isSelected()) {
      if (options.secNone.isSelected())       Security.EnableSecType(Security.secTypeTLSNone);
      if (options.secVnc.isSelected())       Security.EnableSecType(Security.secTypeTLSVnc);
      if (options.secPlain.isSelected())       Security.EnableSecType(Security.secTypeTLSPlain);
      if (options.secIdent.isSelected())       Security.EnableSecType(Security.secTypeTLSIdent);
    }
 else {
      Security.DisableSecType(Security.secTypeTLSNone);
      Security.DisableSecType(Security.secTypeTLSVnc);
      Security.DisableSecType(Security.secTypeTLSPlain);
      Security.DisableSecType(Security.secTypeTLSIdent);
    }
    if (options.encX509.isSelected()) {
      if (options.secNone.isSelected())       Security.EnableSecType(Security.secTypeX509None);
      if (options.secVnc.isSelected())       Security.EnableSecType(Security.secTypeX509Vnc);
      if (options.secPlain.isSelected())       Security.EnableSecType(Security.secTypeX509Plain);
      if (options.secIdent.isSelected())       Security.EnableSecType(Security.secTypeX509Ident);
    }
 else {
      Security.DisableSecType(Security.secTypeX509None);
      Security.DisableSecType(Security.secTypeX509Vnc);
      Security.DisableSecType(Security.secTypeX509Plain);
      Security.DisableSecType(Security.secTypeX509Ident);
    }
    if (options.secNone.isSelected()) {
      if (options.encNone.isSelected())       Security.EnableSecType(Security.secTypeNone);
      if (options.encTLS.isSelected())       Security.EnableSecType(Security.secTypeTLSNone);
      if (options.encX509.isSelected())       Security.EnableSecType(Security.secTypeX509None);
    }
 else {
      Security.DisableSecType(Security.secTypeNone);
      Security.DisableSecType(Security.secTypeTLSNone);
      Security.DisableSecType(Security.secTypeX509None);
    }
    if (options.secVnc.isSelected()) {
      if (options.encNone.isSelected())       Security.EnableSecType(Security.secTypeVncAuth);
      if (options.encTLS.isSelected())       Security.EnableSecType(Security.secTypeTLSVnc);
      if (options.encX509.isSelected())       Security.EnableSecType(Security.secTypeX509Vnc);
    }
 else {
      Security.DisableSecType(Security.secTypeVncAuth);
      Security.DisableSecType(Security.secTypeTLSVnc);
      Security.DisableSecType(Security.secTypeX509Vnc);
    }
    if (options.secPlain.isSelected()) {
      if (options.encNone.isSelected())       Security.EnableSecType(Security.secTypePlain);
      if (options.encTLS.isSelected())       Security.EnableSecType(Security.secTypeTLSPlain);
      if (options.encX509.isSelected())       Security.EnableSecType(Security.secTypeX509Plain);
    }
 else {
      Security.DisableSecType(Security.secTypePlain);
      Security.DisableSecType(Security.secTypeTLSPlain);
      Security.DisableSecType(Security.secTypeX509Plain);
    }
    if (options.secIdent.isSelected()) {
      if (options.encNone.isSelected())       Security.EnableSecType(Security.secTypeIdent);
      if (options.encTLS.isSelected())       Security.EnableSecType(Security.secTypeTLSIdent);
      if (options.encX509.isSelected())       Security.EnableSecType(Security.secTypeX509Ident);
    }
 else {
      Security.DisableSecType(Security.secTypeIdent);
      Security.DisableSecType(Security.secTypeTLSIdent);
      Security.DisableSecType(Security.secTypeX509Ident);
    }
    CSecurityTLS.x509ca.setParam(options.ca.getText());
    CSecurityTLS.x509crl.setParam(options.crl.getText());
  }
}