Source:
public void templateWithVersion_SelectedItemChanged() { buildModel(vm.getStaticData(), new BuilderExecutor.BuilderExecutionFinished<VmBase, UnitVmModel>() { @Override public void finished(VmBase source, UnitVmModel destination) { getModel().getIsStateless().setIsAvailable(vm.getVmPoolId() == null); getModel().getIsRunAndPause().setIsAvailable(vm.getVmPoolId() == null); getModel().getCpuSharesAmount().setEntity(vm.getCpuShares()); updateCpuSharesSelection(); updateRngDevice(getVm().getId()); updateTimeZone(vm.getTimeZone()); updateGraphics(); getModel().getHostCpu().setEntity(vm.isUseHostCpuFlags()); getModel().getStorageDomain().setIsChangeable(false); getModel().getProvisioning().setIsAvailable(false); getModel().getProvisioning().setEntity(Guid.Empty.equals(vm.getVmtGuid())); getModel().getCpuPinning().setEntity(vm.getCpuPinning()); getModel().getCustomPropertySheet().deserialize(vm.getCustomProperties()); if (isHotSetCpuSupported()) { getModel().getTotalCPUCores().getEntityChangedEvent().removeListener(getModel()); getModel().getCoresPerSocket().getSelectedItemChangedEvent().removeListener(getModel()); getModel().getNumOfSockets().getSelectedItemChangedEvent().removeListener(getModel()); AsyncDataProvider.getInstance().getHostById(new AsyncQuery(getModel().getBehavior(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ExistingVmModelBehavior existingVmModelBehavior = (ExistingVmModelBehavior) model; runningOnHost = (VDS) returnValue; hostCpu = calculateHostCpus(); existingVmModelBehavior.updateNumOfSockets(); } }), vm.getRunOnVds()); } updateCpuProfile(vm.getVdsGroupId(), vm.getVdsGroupCompatibilityVersion(), vm.getCpuProfileId()); } }); }

Target:
public void templateWithVersion_SelectedItemChanged() { buildModel(vm.getStaticData(), new BuilderExecutor.BuilderExecutionFinished<VmBase, UnitVmModel>() { @Override public void finished(VmBase source, UnitVmModel destination) { getModel().getIsStateless().setIsAvailable(vm.getVmPoolId() == null); getModel().getIsRunAndPause().setIsAvailable(vm.getVmPoolId() == null); getModel().getCpuSharesAmount().setEntity(vm.getCpuShares()); updateCpuSharesSelection(); updateRngDevice(getVm().getId()); updateTimeZone(vm.getTimeZone()); updateGraphics(); getModel().getHostCpu().setEntity(vm.isUseHostCpuFlags()); getModel().getStorageDomain().setIsChangeable(false); getModel().getProvisioning().setIsAvailable(false); getModel().getProvisioning().setEntity(Guid.Empty.equals(vm.getVmtGuid())); getModel().getCpuPinning().setEntity(vm.getCpuPinning()); getModel().getCustomPropertySheet().deserialize(vm.getCustomProperties()); if (isHotSetCpuSupported()) { getModel().getTotalCPUCores().getEntityChangedEvent().removeListener(getModel()); getModel().getCoresPerSocket().getSelectedItemChangedEvent().removeListener(getModel()); getModel().getNumOfSockets().getSelectedItemChangedEvent().removeListener(getModel()); AsyncDataProvider.getInstance().getHostById(new AsyncQuery(new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { runningOnHost = (VDS) returnValue; hostCpu = calculateHostCpus(); updateNumOfSockets(); } }), vm.getRunOnVds()); } updateCpuProfile(vm.getVdsGroupId(), vm.getVdsGroupCompatibilityVersion(), vm.getCpuProfileId()); } }); }