Source:
protected void doUpdateContract(Object source) { removeAllListeners(); boolean needUpdatePayment = false; AtBContract contract = (AtBContract)this.contract; if (cbPlanets.equals(source) && null != cbPlanets.getSelectedItem()) { contract.setPlanetName((String)cbPlanets.getSelectedItem()); contract.setStartDate(null); needUpdatePayment = true; } else if (source.equals(cbEmployer)) { System.out.println("Setting employer code to " + getCurrentEmployerCode()); long time = System.currentTimeMillis(); contract.setEmployerCode(getCurrentEmployerCode(), campaign.getGameYear()); System.out.println("to set employer code: " + (System.currentTimeMillis() - time)); time = System.currentTimeMillis(); updateEnemies(); System.out.println("to update enemies: " + (System.currentTimeMillis() - time)); time = System.currentTimeMillis(); updatePlanets(); System.out.println("to update planets: " + (System.currentTimeMillis() - time)); needUpdatePayment = true; } else if (source.equals(cbEnemy)) { contract.setEnemyCode(getCurrentEnemyCode()); updatePlanets(); needUpdatePayment = true; } else if (source.equals(cbMissionType)) { contract.setMissionType(cbMissionType.getSelectedIndex()); contract.calculateLength(campaign.getCampaignOptions().getVariableContractLength()); spnLength.setValue(contract.getLength()); updatePlanets(); needUpdatePayment = true; } else if (source.equals(cbAllySkill)) { contract.setAllySkill(cbAllySkill.getSelectedIndex()); } else if (source.equals(cbAllyQuality)) { contract.setAllyQuality(cbAllyQuality.getSelectedIndex()); } else if (source.equals(cbEnemySkill)) { contract.setEnemySkill(cbEnemySkill.getSelectedIndex()); } else if (source.equals(cbEnemyQuality)) { contract.setEnemyQuality(cbEnemyQuality.getSelectedIndex()); } if (needUpdatePayment) { updatePaymentMultiplier(); } super.doUpdateContract(source); addAllListeners(); }

Target:
protected void doUpdateContract(Object source) { removeAllListeners(); boolean needUpdatePayment = false; AtBContract contract = (AtBContract)this.contract; if (cbPlanets.equals(source) && null != cbPlanets.getSelectedItem()) { contract.setPlanetId((Planets.getInstance().getPlanetByName((String) cbPlanets.getSelectedItem(), Utilities.getDateTimeDay(campaign.getCalendar()))).getId()); contract.setStartDate(null); needUpdatePayment = true; } else if (source.equals(cbEmployer)) { System.out.println("Setting employer code to " + getCurrentEmployerCode()); long time = System.currentTimeMillis(); contract.setEmployerCode(getCurrentEmployerCode(), campaign.getGameYear()); System.out.println("to set employer code: " + (System.currentTimeMillis() - time)); time = System.currentTimeMillis(); updateEnemies(); System.out.println("to update enemies: " + (System.currentTimeMillis() - time)); time = System.currentTimeMillis(); updatePlanets(); System.out.println("to update planets: " + (System.currentTimeMillis() - time)); needUpdatePayment = true; } else if (source.equals(cbEnemy)) { contract.setEnemyCode(getCurrentEnemyCode()); updatePlanets(); needUpdatePayment = true; } else if (source.equals(cbMissionType)) { contract.setMissionType(cbMissionType.getSelectedIndex()); contract.calculateLength(campaign.getCampaignOptions().getVariableContractLength()); spnLength.setValue(contract.getLength()); updatePlanets(); needUpdatePayment = true; } else if (source.equals(cbAllySkill)) { contract.setAllySkill(cbAllySkill.getSelectedIndex()); } else if (source.equals(cbAllyQuality)) { contract.setAllyQuality(cbAllyQuality.getSelectedIndex()); } else if (source.equals(cbEnemySkill)) { contract.setEnemySkill(cbEnemySkill.getSelectedIndex()); } else if (source.equals(cbEnemyQuality)) { contract.setEnemyQuality(cbEnemyQuality.getSelectedIndex()); } if (needUpdatePayment) { updatePaymentMultiplier(); } super.doUpdateContract(source); addAllListeners(); }