Source:
<code>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 <START> AsyncQuery(getModel().getBehavior(), new <END> 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()); } }); }</code><technical_language>I this parameter is C# relict necessary. null. work well, feel free ignore</technical_language>

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()); } }); }