auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void OnInstall() { InstallModel model = (InstallModel) getWindow(); final boolean isOVirt = getEntity().getVdsType() == VDSType.oVirtNode; if (!model.Validate(isOVirt)) { return; } UpdateVdsActionParameters param = new UpdateVdsActionParameters(); param.setvds(getEntity()); param.setVdsId(getEntity().getId()); param.setRootPassword((String) model.getRootPassword().getEntity()); param.setIsReinstallOrUpgrade(true); param.setInstallVds(true); param.setoVirtIsoFile(isOVirt ? ((RpmVersion) model.getOVirtISO().getSelectedItem()).getRpmName() : null); param.setOverrideFirewall((Boolean) model.getOverrideIpTables().getEntity()); param.setRebootAfterInstallation(isOVirt); Frontend.RunAction( VdcActionType.UpdateVds, param, new IFrontendActionAsyncCallback() { @Override public void Executed(FrontendActionAsyncResult result) { VdcReturnValueBase returnValue = result.getReturnValue(); if (returnValue != null && returnValue.getSucceeded()) { Cancel(); } } } ); }

Target:
public void OnInstall() { InstallModel model = (InstallModel) getWindow(); final boolean isOVirt = getEntity().getVdsType() == VDSType.oVirtNode; if (!model.Validate(isOVirt)) { return; } UpdateVdsActionParameters param = new UpdateVdsActionParameters(); param.setvds(getEntity()); param.setVdsId(getEntity().getId()); param.setRootPassword((String) model.getRootPassword().getEntity()); param.setIsReinstallOrUpgrade(true); param.setInstallVds(true); param.setoVirtIsoFile(isOVirt ? ((RpmVersion) model.getOVirtISO().getSelectedItem()).getRpmName() : null); param.setOverrideFirewall((Boolean) model.getOverrideIpTables().getEntity()); AsyncDataProvider.GetClusterById(new AsyncQuery(param, new INewAsyncCallback() { @Override public void OnSuccess(Object model, Object returnValue) { VDSGroup cluster = (VDSGroup) returnValue; UpdateVdsActionParameters internalParam = (UpdateVdsActionParameters) model; internalParam.setRebootAfterInstallation(cluster.supportsVirtService()); Frontend.RunAction( VdcActionType.UpdateVds, internalParam, new IFrontendActionAsyncCallback() { @Override public void Executed(FrontendActionAsyncResult result) { VdcReturnValueBase returnValue = result.getReturnValue(); if (returnValue != null && returnValue.getSucceeded()) { Cancel(); } } } ); } }), getEntity().getVdsGroupId()); }
Source:
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof MyStringKey)) return false; return toString().equals(obj.toString()); }

Target:
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || MyStringKey.class != obj.getClass()) return false; MyStringKey key = (MyStringKey)obj; return Objects.equals(str, key.str); }
Source:
private boolean refinesMultiplicityChange(Diff input) { for (Diff refinedDiff : input.getRefines()) { if (refinedDiff instanceof MultiplicityElementChange) { return true; } } return false; }

Target:
private boolean refinesMultiplicityChange(Diff input) { return any(input.getRefines(), instanceOf(MultiplicityElementChange.class)); }
Source:
public void show(final EditorPartPresenter editorPartPresenter) { if (!(editorPartPresenter instanceof TextEditor)) { Log.error(getClass(), "Open Declaration support only TextEditor as editor"); return; } activeEditor = ((TextEditor) editorPartPresenter); final VirtualFile file = activeEditor.getEditorInput().getFile(); if (file instanceof Resource) { final Project project = ((Resource) file).getProject(); final Optional<Resource> srcFolder = ((Resource) file).getParentWithMarker(SourceFolderMarker.ID); if (project == null || !srcFolder.isPresent()) { return; } final String fqn = JavaUtil.resolveFQN((Container) srcFolder.get(), (Resource) file); service .findImplementations( new FindImplementationsCommandParametersDto( new FindImplementationsCommandParameters( project.getLocation().toString(), fqn, activeEditor.getCursorOffset()))) .then( impls -> { int overridingSize = impls.getImplementations().size(); String title = locale.openImplementationWindowTitle(impls.getMemberName(), overridingSize); NoImplementationWidget noImplementationWidget = new NoImplementationWidget( popupResources, javaResources, locale, OpenImplementationPresenter.this, title); if (overridingSize == 1) { actionPerformed(impls.getImplementations().get(0)); } else if (overridingSize > 1) { openOneImplementation( impls, noImplementationWidget, (TextEditor) editorPartPresenter); } else if (!isNullOrEmpty(impls.getMemberName()) && overridingSize == 0) { showNoImplementations(noImplementationWidget, (TextEditor) editorPartPresenter); } }); } }

Target:
public void show(final EditorPartPresenter editorPartPresenter) { if (!(editorPartPresenter instanceof TextEditor)) { Log.error(getClass(), "Open Declaration support only TextEditor as editor"); return; } activeEditor = ((TextEditor) editorPartPresenter); final VirtualFile file = activeEditor.getEditorInput().getFile(); javaLanguageExtensionServiceClient .findImplementations( new TextDocumentPositionParamsDto( new TextDocumentPositionParams( new TextDocumentIdentifier(file.getLocation().toString()), new Position( activeEditor.getCursorPosition().getLine(), activeEditor.getCursorPosition().getCharacter())))) .then( impls -> { int overridingSize = impls.getImplementers().size(); String title = locale.openImplementationWindowTitle(impls.getSearchedElement(), overridingSize); PositionConverter.PixelCoordinates coordinates = activeEditor.getPositionConverter().offsetToPixel(activeEditor.getCursorOffset()); if (overridingSize == 1) { openOneImplementation(impls.getImplementers().get(0)); } else if (!isNullOrEmpty(impls.getSearchedElement())) { openImplementations(impls, title, coordinates); } }); }
Source:
public Collection<?> getChildren(Object object) { Collection<Object> children = new ArrayList<Object>(); MatchResource matchResource = (MatchResource)object; Comparison comparison = matchResource.getComparison(); for (ResourceAttachmentChange rac : filter(comparison.getDifferences(), ResourceAttachmentChange.class)) { final String diffResourceURI = rac.getResourceURI(); if (diffResourceURI.equals(matchResource.getLeftURI()) || diffResourceURI.equals(matchResource.getRightURI())) { children.add(rac); } } return children; }

Target:
public Collection<?> getChildren(Object object) { Collection<Object> children = new ArrayList<Object>(); MatchResource matchResource = (MatchResource)object; Comparison comparison = matchResource.getComparison(); for (ResourceAttachmentChange rac : filter(comparison.getDifferences(), ResourceAttachmentChange.class)) { final String diffResourceURI = rac.getResourceURI(); if (diffResourceURI != null && (diffResourceURI.equals(matchResource.getLeftURI()) || diffResourceURI.equals(matchResource.getRightURI()) || diffResourceURI .equals(matchResource.getOriginURI()))) { children.add(rac); } } return children; }
Source:
private void createMocksForStartVisit() { Observable observable = Observable.create((Observable.OnSubscribe<Location>) subscriber -> {}); PowerMockito.when(OpenMRS.getInstance()).thenReturn(openMRS); PowerMockito.when(LocationDAO.findLocationByName(anyString())).thenReturn(observable); when(openMRS.getLocation()).thenReturn("location"); when(openMRS.getVisitTypeUUID()).thenReturn("visitTypeUuid"); }

Target:
private void createMocksForStartVisit() { PowerMockito.when(OpenMRS.getInstance()).thenReturn(openMRS); PowerMockito.when(locationDAO.findLocationByName(anyString())).thenReturn(new Location()); when(openMRS.getLocation()).thenReturn("location"); when(openMRS.getVisitTypeUUID()).thenReturn("visitTypeUuid"); }
Source:
public ModelNode correctOperation(ModelNode operation) { ModelNode op = operation.clone(); for (String attr : attributes) { ModelNode value = op.get(attr); ModelNode checkOp = op.clone(); checkOp.protect(); if (checkValue(checkOp, attr, value, false)) { AttributesPathAddressConfig<?> complexChildConfig = complexAttributes.get(attr); if (complexChildConfig == null) { ModelNode resolved = correctValue(op.get(attr), false); op.get(attr).set(resolved); } else { op.get(attr).set(complexChildConfig.correctOperation(operation.get(attr))); } } } return op; }

Target:
public ModelNode correctOperation(ModelNode operation) { ModelNode op = operation.clone(); boolean corrected = false; for (String attr : attributes) { ModelNode value = op.get(attr); ModelNode checkOp = op.clone(); checkOp.protect(); if (checkValue(checkOp, attr, value, false)) { AttributesPathAddressConfig<?> complexChildConfig = complexAttributes.get(attr); if (complexChildConfig == null) { ModelNode resolved = correctValue(op.get(attr), false); op.get(attr).set(resolved); } else { op.get(attr).set(complexChildConfig.correctOperation(operation.get(attr))); } } corrected = true; } if (corrected) { return op; } else { return operation; } }
Source:
protected static ImmutableList<Ds3Property> convertAllProperties( final ImmutableList<Ds3Property> properties, final NameMapper nameMapper) { if (properties == null || properties.isEmpty()) { return properties; } ImmutableList.Builder<Ds3Property> builder = ImmutableList.builder(); for (final Ds3Property property : properties) { final Ds3Property convertedProperty = new Ds3Property( property.getName(), property.getValue(), convertName(property.getValueType(), nameMapper)); builder.add(convertedProperty); } return builder.build(); }

Target:
protected static ImmutableList<Ds3Property> convertAllProperties( final ImmutableList<Ds3Property> properties, final NameMapper nameMapper) { if (properties == null || properties.isEmpty()) { return properties; } final ImmutableList.Builder<Ds3Property> builder = ImmutableList.builder(); for (final Ds3Property property : properties) { final Ds3Property convertedProperty = new Ds3Property( property.getName(), property.getValue(), convertName(property.getValueType(), nameMapper)); builder.add(convertedProperty); } return builder.build(); }
Source:
private void verifySameCourseDataStudent(CourseData actualCourse, CourseAttributes expectedCourse) { assertEquals(actualCourse.getCourseId(), expectedCourse.getId()); assertEquals(actualCourse.getCourseName(), expectedCourse.getName()); assertEquals(actualCourse.getCreationTimestamp(), 0); if (expectedCourse.getDeletedAt() != null) { assertEquals(actualCourse.getDeletionTimestamp(), 0); } assertEquals(actualCourse.getTimeZone(), expectedCourse.getTimeZone().getId()); }

Target:
private void verifySameCourseDataStudent(CourseData actualCourse, CourseAttributes expectedCourse) { assertEquals(actualCourse.getCourseId(), expectedCourse.getId()); assertEquals(actualCourse.getCourseName(), expectedCourse.getName()); assertEquals(actualCourse.getCreationTimestamp(), 0); assertEquals(actualCourse.getDeletionTimestamp(), 0); assertEquals(actualCourse.getTimeZone(), expectedCourse.getTimeZone().getId()); }
Source:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus hookStatus, String template) { switch (hookStatus) { case DISABLED: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus.DISABLED.toString(); case ENABLED: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus.ENABLED.toString(); case MISSING: return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus.MISSING.toString(); default: return null; } }

Target:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus hookStatus, String template) { switch (hookStatus) { case DISABLED: return HookStatus.DISABLED.toString(); case ENABLED: return HookStatus.ENABLED.toString(); case MISSING: return HookStatus.MISSING.toString(); default: return null; } }
Source:
public List<VDS> getFiltered(String filter) { HttpMethod method = new GetMethod(hostProvider.getUrl() + "/api/hosts" + (filter.isEmpty()? StringUtils.EMPTY : "?&search=" + filter) + "&format=json"); return runHostListMethod(method); }

Target:
public List<VDS> getFiltered(String filter) { String url = hostProvider.getUrl() + HOSTS_ENTRY_POINT + String.format(SEARCH_QUERY_FORMAT, filter); HttpMethod method = new GetMethod(url); return runHostListMethod(method); }
Source:
public static synchronized void initialize(int myHostId, CatalogContext catalogContext, HostMessenger messenger) throws BundleException, IOException { ImporterStatsCollector statsCollector = new ImporterStatsCollector(myHostId); ImportManager em = new ImportManager(myHostId, messenger, statsCollector); VoltDB.instance().getStatsAgent().registerStatsSource( StatsSelector.IMPORTER, myHostId, statsCollector); m_self = em; em.initializeChannelDistributer(); em.applyCatalogToImporters(catalogContext, false); }

Target:
public static synchronized void initialize(int myHostId, CatalogContext catalogContext, HostMessenger messenger) throws BundleException, IOException { ImporterStatsCollector statsCollector = new ImporterStatsCollector(myHostId); ImportManager em = new ImportManager(myHostId, messenger, statsCollector); VoltDB.instance().getStatsAgent().registerStatsSource( StatsSelector.IMPORTER, myHostId, statsCollector); m_self = em; em.create(catalogContext); }
Source:
private void discoverHostName_SelectedItemChanged() { ExternalDiscoveredHost dhost = (ExternalDiscoveredHost) getExternalDiscoveredHosts().getSelectedItem(); ExternalHostGroup dhg = (ExternalHostGroup) getExternalHostGroups().getSelectedItem(); VDS vds = new VDS(); if (dhost != null && dhg != null) { vds.setVdsName(dhost.getName()); vds.setHostName(dhost.getName() + "." + (dhg.getDomainName() != null ? dhg.getDomainName() : "")); } updateModelFromVds(vds, null, false, null); }

Target:
private void discoverHostName_SelectedItemChanged() { ExternalDiscoveredHost dhost = (ExternalDiscoveredHost) getExternalDiscoveredHosts().getSelectedItem(); ExternalHostGroup dhg = (ExternalHostGroup) getExternalHostGroups().getSelectedItem(); VDS vds = new VDS(); if (dhost != null && dhg != null) { vds.setVdsName(dhost.getName()); vds.setHostName(dhost.getName() + "." + (dhg.getDomainName() != null ? dhg.getDomainName() : constants.empty())); } updateModelFromVds(vds, null, false, null); }
Source:
public List<ERepositoryObjectType> getTypes() { List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>(); toReturn.add(ERepositoryObjectType.PROCESS_MR); toReturn.add(ERepositoryObjectType.PROCESS_STORM); return toReturn; }

Target:
public List<ERepositoryObjectType> getTypes() { return Arrays.asList(ERepositoryObjectType.PROCESS_MR, ERepositoryObjectType.PROCESS_STORM); }
Source:
public Decision shouldReject( ResourceRef subject, ImmutableSet<EquivalenceGraph> existingGraphs, EquivalenceGraphUpdate graphUpdate ) { Decision decision = Decision.OK; if (shouldWarn(subject, graphUpdate)) { decision = Decision.WARN; } if (shouldReject(existingGraphs, graphUpdate)) { decision = Decision.FAIL; } return decision; }

Target:
public Decision shouldReject( ResourceRef subject, ImmutableSet<EquivalenceGraph> existingGraphs, EquivalenceGraphUpdate graphUpdate ) { Decision decision = Decision.OK; ImmutableList<EquivalenceGraph> graphsOverWarningThreshold = getGraphsOverAlertingThreshold( subject, graphUpdate ); if (!graphsOverWarningThreshold.isEmpty()) { decision = Decision.WARN; } if (shouldReject(existingGraphs, graphUpdate)) { decision = Decision.FAIL; } return decision; }
Source:
public void makeBucket(String bucketName, String region) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, XmlParserException { this.makeBucket(MakeBucketArgs.newBuilder().bucket("my-bucketname").build()); this.makeBucket( MakeBucketArgs.newBuilder().bucket("my-bucketname").region("us-east-1").build()); this.makeBucket( MakeBucketArgs.newBuilder() .bucket("my-bucketname") .region("us-east-1") .objectLock(true) .build()); this.makeBucket(MakeBucketArgs.newBuilder().bucket(bucketName).region(region).build()); }

Target:
public void makeBucket(String bucketName, String region) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, XmlParserException { this.makeBucket(new MakeBucketArgs.Builder().bucket(bucketName).region(region).build()); }
Source:
public void tearDown() throws Exception { setFixture(null); }

Target:
public void tearDown(){ setFixture(null); }
Source:
protected Map<String, String> buildReplacements() throws ConfigException { ConfigPropertiesUtil configUtil = new ConfigPropertiesUtil(); Map<String, String> replacements = new HashMap<>(); Properties properties = configUtil.getConfigProperties(); Enumeration e = properties.propertyNames(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); replacements.put(key, properties.getProperty(key)); } return replacements; }

Target:
protected Map<String, String> buildReplacements() throws ConfigException { Map<String, String> replacements = new HashMap<>(); Properties properties = _service.getConfigProperties(); if ( properties != null ) { Enumeration e = properties.propertyNames(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); replacements.put(key, properties.getProperty(key)); } } return replacements; }
Source:
public final void initialize(final URL location, final ResourceBundle resources) { hide(); listItems = FXCollections.observableArrayList(); filteredItems = new FilteredList<AbstractBookmark>(listItems); bookmarkList.setItems(filteredItems); bookmarkList.setCellFactory(new Callback<ListView<AbstractBookmark>, ListCell<AbstractBookmark>>() { @Override public ListCell<AbstractBookmark> call( final ListView<AbstractBookmark> param) { final ListCell<AbstractBookmark> cell = new ListCell<AbstractBookmark>() { public void updateItem(final AbstractBookmark item, final boolean empty) { super.updateItem(item, empty); if (item != null) { setText(item.toCellString()); setOnMouseClicked(event -> { if (event.getClickCount() == 2) { shout(Message.GOTO, "" , Long.valueOf(item.getUnifiedPosition())); } }); } } }; return cell; } }); initListeners(); }

Target:
public final void initialize(final URL location, final ResourceBundle resources) { setVisibility(false); listItems = FXCollections.observableArrayList(); filteredItems = new FilteredList<AbstractBookmark>(listItems); bookmarkList.setItems(filteredItems); bookmarkList.setCellFactory(param -> { final ListCell<AbstractBookmark> cell = new ListCell<AbstractBookmark>() { public void updateItem(final AbstractBookmark item, final boolean empty) { super.updateItem(item, empty); if (item != null) { setText(item.toCellString()); setOnMouseClicked(event -> { if (event.getClickCount() == 2) { shout(Message.GOTO, "" , Long.valueOf(item.getUnifiedPosition())); } }); } } }; return cell; }); initListeners(); }
Source:
protected void readHeader(XmlNode header) { super.readHeader(header); version = header != null ? header.attributes.get("ovf:version").getValue() : ""; }

Target:
protected void readHeader(XmlNode header) { super.readHeader(header); setVersion(header != null ? header.attributes.get("ovf:version").getValue() : ""); }
Source:
public void dispose() { mDestroyed.set(true); auth_rsp = new IccIoResult(0x6F, 0, (byte[]) null); synchronized (mLock) { mLock.notifyAll(); } mParentApp = null; mFh = null; mCi = null; mContext = null; }

Target:
public void dispose() { mDestroyed.set(true); auth_rsp = null; synchronized (mLock) { mLock.notifyAll(); } mParentApp = null; mFh = null; mCi = null; mContext = null; }
Source:
public String checkIPythonPrerequisite(String pythonExec) { ProcessBuilder processBuilder = new ProcessBuilder(pythonExec, "-m", "pip", "freeze"); try { File stderrFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectError(stderrFile); File stdoutFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectOutput(stdoutFile); Process proc = processBuilder.start(); int ret = proc.waitFor(); if (ret != 0) { return "Fail to run pip freeze.\n" + IOUtils.toString(new FileInputStream(stderrFile)); } String freezeOutput = IOUtils.toString(new FileInputStream(stdoutFile)); if (!freezeOutput.contains("jupyter-client=")) { return "jupyter-client is not installed."; } if (!freezeOutput.contains("ipykernel=")) { return "ipkernel is not installed"; } if (!freezeOutput.contains("ipython=")) { return "ipython is not installed"; } if (!freezeOutput.contains("grpcio=")) { return "grpcio is not installed"; } LOGGER.info("IPython prerequisite is meet"); } catch (Exception e) { LOGGER.warn("Fail to checkIPythonPrerequisite", e); } return ""; }

Target:
public String checkIPythonPrerequisite(String pythonExec) { ProcessBuilder processBuilder = new ProcessBuilder(pythonExec, "-m", "pip", "freeze"); try { File stderrFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectError(stderrFile); File stdoutFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectOutput(stdoutFile); Process proc = processBuilder.start(); int ret = proc.waitFor(); if (ret != 0) { return "Fail to run pip freeze.\n" + IOUtils.toString(new FileInputStream(stderrFile)); } String freezeOutput = IOUtils.toString(new FileInputStream(stdoutFile)); if (!freezeOutput.contains("jupyter-client=")) { return "jupyter-client is not installed."; } if (!freezeOutput.contains("ipykernel=")) { return "ipkernel is not installed"; } if (!freezeOutput.contains("ipython=")) { return "ipython is not installed"; } if (!freezeOutput.contains("grpcio=")) { return "grpcio is not installed"; } LOGGER.info("IPython prerequisite is meet"); } catch (Exception e) { LOGGER.warn("Fail to checkIPythonPrerequisite", e); return "Fail to checkIPythonPrerequisite: " + ExceptionUtils.getStackTrace(e); } return ""; }
Source:
public String getQuestionWithExistingResponseSubmissionFormHtml(boolean sessionIsOpen, int qnIdx, int responseIdx, String courseId, int totalNumRecipients, FeedbackResponseDetails existingResponseDetails) { FeedbackContributionResponseDetails frd = (FeedbackContributionResponseDetails) existingResponseDetails; int points = frd.getAnswer(); String optionSelectFragmentsHtml = getContributionOptionsHtml(points); return Templates.populateTemplate( FormTemplates.CONTRIB_SUBMISSION_FORM, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.DISABLED, sessionIsOpen ? "" : "disabled", Slots.CONTRIB_SELECT_FRAGMENTS_HTML, optionSelectFragmentsHtml, "${equalShareHelp}", responseIdx == 0 ? "<span class=\"glyphicon glyphicon-info-sign\"></span>" + " More info about the equal share scale" : ""); }

Target:
public String getQuestionWithExistingResponseSubmissionFormHtml(boolean sessionIsOpen, int qnIdx, int responseIdx, String courseId, int totalNumRecipients, FeedbackResponseDetails existingResponseDetails) { FeedbackContributionResponseDetails frd = (FeedbackContributionResponseDetails) existingResponseDetails; int points = frd.getAnswer(); String optionSelectFragmentsHtml = getContributionOptionsHtml(points); return Templates.populateTemplate( FormTemplates.CONTRIB_SUBMISSION_FORM, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.DISABLED, sessionIsOpen ? "" : "disabled", Slots.CONTRIB_SELECT_FRAGMENTS_HTML, optionSelectFragmentsHtml, Slots.CONTRIB_EQUAL_SHARE_HELP, getEqualShareHelpLinkIfNeeded(responseIdx)); }
Source:
public boolean isOrderDeterministic(boolean orderIsDeterministic) { CompiledPlan plan = getBestCostPlan(); if (plan != null) { return orderIsDeterministic && plan.isOrderDeterministic(); } else { return orderIsDeterministic; } }

Target:
public boolean isOrderDeterministic(boolean orderIsDeterministic) { CompiledPlan plan = getBestCostPlan(); if (plan != null) { return orderIsDeterministic && plan.isOrderDeterministic(); } return orderIsDeterministic; }
Source:
public void testMultilineSupport() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(RegexpMultilineCheck.class); checkConfig.addAttribute("format", "abc.*def"); checkConfig.addAttribute("matchAcrossLines", "true"); final String[] expected = { "5: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "abc.*def"), }; verify(checkConfig, getPath("InputRegexpMultilineMultilineSupport.java"), expected); }

Target:
public void testMultilineSupport() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(RegexpMultilineCheck.class); checkConfig.addAttribute("format", "abc.*def"); checkConfig.addAttribute("matchAcrossLines", "true"); final String[] expected = { "9: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "abc.*def"), }; verify(checkConfig, getPath("InputRegexpMultilineMultilineSupport.java"), expected); }
Source:
public void throwIfNonAdminOrMatchingOwner(User owner) throws IOException, AuthorizationException { User currentUser = getCurrentUser(); if (owner == null) return; if (!(currentUser.isAdmin() || currentUser.getUserId().equals(owner.getUserId()))) { throw new AuthorizationException("Current user is not admin or owner"); } }

Target:
public void throwIfNonAdminOrMatchingOwner(User owner) throws IOException, AuthorizationException { if (owner == null) { throwIfNonAdmin(); } else { User currentUser = getCurrentUser(); if (!(currentUser.isAdmin() || currentUser.getUserId().equals(owner.getUserId()))) { throw new AuthorizationException("Current user is not admin or owner"); } } }
Source:
public void setValues() { fontOverrideProperty.setValue(initialAppearancePreferences.shouldOverrideDefaultFontSize()); fontSizeProperty.setValue(String.valueOf(initialAppearancePreferences.getMainFontSize())); String currentTheme = initialAppearancePreferences.getPathToTheme(); if (ThemeLoader.DARK_CSS.equals(currentTheme)) { themeLightProperty.setValue(false); themeDarkProperty.setValue(true); themeCustomProperty.setValue(false); } else if (ThemeLoader.MAIN_CSS.equals(currentTheme) || currentTheme.isBlank()) { themeLightProperty.setValue(true); themeDarkProperty.setValue(false); themeCustomProperty.setValue(false); } else { themeLightProperty.setValue(false); themeDarkProperty.setValue(false); themeCustomProperty.setValue(true); customPathToThemeProperty.setValue(initialAppearancePreferences.getPathToTheme()); } }

Target:
public void setValues() { fontOverrideProperty.setValue(initialAppearancePreferences.shouldOverrideDefaultFontSize()); fontSizeProperty.setValue(String.valueOf(initialAppearancePreferences.getMainFontSize())); Theme currentTheme = initialAppearancePreferences.getTheme(); if (currentTheme.getType() == Theme.Type.LIGHT) { themeLightProperty.setValue(true); themeDarkProperty.setValue(false); themeCustomProperty.setValue(false); } else if (currentTheme.getType() == Theme.Type.DARK) { themeLightProperty.setValue(false); themeDarkProperty.setValue(true); themeCustomProperty.setValue(false); } else { themeLightProperty.setValue(false); themeDarkProperty.setValue(false); themeCustomProperty.setValue(true); customPathToThemeProperty.setValue(currentTheme.getPath().toString()); } }
Source:
public static void start(Properties conf) { System.setProperty("java.awt.headless", "true"); configProxy(conf); ConsoleProxyServerFactory factory = getHttpServerFactory(); if (factory == null) { s_logger.error("Unable to load console proxy server factory"); System.exit(1); } if (httpListenPort != 0) { startServerForNoVNC(); } else { s_logger.error("A valid HTTP server port is required to be specified, please check your consoleproxy.httpListenPort settings"); System.exit(1); } if (httpCmdListenPort > 0) { startupHttpCmdPort(); } else { s_logger.info("HTTP command port is disabled"); } ConsoleProxyGCThread cthread = new ConsoleProxyGCThread(connectionMap); cthread.setName("Console Proxy GC Thread"); cthread.start(); }

Target:
public static void start(Properties conf) { System.setProperty("java.awt.headless", "true"); configProxy(conf); ConsoleProxyServerFactory factory = getHttpServerFactory(); if (factory == null) { s_logger.error("Unable to load console proxy server factory"); System.exit(1); } if (httpListenPort != 0) { startupHttpMain(); } else { s_logger.error("A valid HTTP server port is required to be specified, please check your consoleproxy.httpListenPort settings"); System.exit(1); } if (httpCmdListenPort > 0) { startupHttpCmdPort(); } else { s_logger.info("HTTP command port is disabled"); } ConsoleProxyGCThread cthread = new ConsoleProxyGCThread(connectionMap); cthread.setName("Console Proxy GC Thread"); cthread.start(); }
Source:
BaseClass getPageLayoutPropertiesClass() throws XWikiException { XWikiDocument doc; boolean needsUpdate = false; DocumentReference pageLayoutPropertiesClassRef = cellsClassConfig.getPageLayoutPropertiesClassRef( getContext().getDatabase()); doc = modelAccess.getOrCreateDocument(pageLayoutPropertiesClassRef); BaseClass bclass = doc.getXClass(); bclass.setDocumentReference(pageLayoutPropertiesClassRef); needsUpdate |= bclass.addTextField("prettyname", "Layout Pretty Name", 30); needsUpdate |= bclass.addBooleanField("isActive", "is active", "yesno"); needsUpdate |= bclass.addTextField("authors", "Authors", 30); needsUpdate |= bclass.addTextAreaField("license", "License", 15, 30); needsUpdate |= bclass.addTextField("version", "Version", 30); needsUpdate |= bclass.addStaticListField("doctype", "Doctype", 1, false, ICellsClassConfig.DOCTYPE_XHTML_VALUE + "|" + ICellsClassConfig.DOCTYPE_HTML_5_VALUE, "select"); needsUpdate |= bclass.addStaticListField(ICellsClassConfig.LAYOUT_TYPE_FIELD, "Layout Type", 1, false, ICellsClassConfig.PAGE_LAYOUT_VALUE + "|" + ICellsClassConfig.EDITOR_LAYOUT_VALUE, "select"); if (!"internal".equals(bclass.getCustomMapping())) { needsUpdate = true; bclass.setCustomMapping("internal"); } LOGGER.debug("getPageLayoutPropertiesClass for db '" + getContext().getDatabase() + "' needs update '" + needsUpdate + "'."); setContentAndSaveClassDocument(doc, needsUpdate); return bclass; }

Target:
BaseClass getPageLayoutPropertiesClass() throws XWikiException { XWikiDocument doc; boolean needsUpdate = false; DocumentReference pageLayoutPropertiesClassRef = cellsClassConfig.getPageLayoutPropertiesClassRef( getContext().getDatabase()); doc = modelAccess.getOrCreateDocument(pageLayoutPropertiesClassRef); BaseClass bclass = doc.getXClass(); bclass.setDocumentReference(pageLayoutPropertiesClassRef); needsUpdate |= bclass.addTextField("prettyname", "Layout Pretty Name", 30); needsUpdate |= bclass.addBooleanField("isActive", "is active", "yesno"); needsUpdate |= bclass.addTextField("authors", "Authors", 30); needsUpdate |= bclass.addTextAreaField("license", "License", 15, 30); needsUpdate |= bclass.addTextField("version", "Version", 30); needsUpdate |= bclass.addStaticListField(ICellsClassConfig.LAYOUT_DOCTYPE_FIELD, "Doctype", 1, false, HtmlDoctype.XHTML + "|" + HtmlDoctype.HTML5, "select"); needsUpdate |= bclass.addStaticListField(ICellsClassConfig.LAYOUT_TYPE_FIELD, "Layout Type", 1, false, ICellsClassConfig.PAGE_LAYOUT_VALUE + "|" + ICellsClassConfig.EDITOR_LAYOUT_VALUE, "select"); if (!"internal".equals(bclass.getCustomMapping())) { needsUpdate = true; bclass.setCustomMapping("internal"); } LOGGER.debug("getPageLayoutPropertiesClass for db '" + getContext().getDatabase() + "' needs update '" + needsUpdate + "'."); setContentAndSaveClassDocument(doc, needsUpdate); return bclass; }
Source:
public void setup(OperatorContext context) { super.setup(context); spinMillis = context.getValue(Context.OperatorContext.SPIN_MILLIS); execute = true; cause = new AtomicReference<Throwable>(); emitQueue = new ArrayBlockingQueue<List<T>>(queueCapacity); this.context = context; operatorId = context.getId(); try { if (ps == null) { if (getRangeQueryPair().getValue() != null) { ps = store.getConnection().prepareStatement( JdbcMetaDataUtility.buildRangeQuery(getTableName(), getKey(), rangeQueryPair.getKey(), rangeQueryPair.getValue()), java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); } else { ps = store.getConnection().prepareStatement( JdbcMetaDataUtility.buildPollableQuery(getTableName(), getKey(), rangeQueryPair.getKey()), java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); isPollable = true; } } } catch (SQLException e) { LOG.error("Exception in initializing the range query for a given partition", e); } windowManager.setup(context); LOG.debug("super setup done..."); }

Target:
public void setup(OperatorContext context) { super.setup(context); spinMillis = context.getValue(Context.OperatorContext.SPIN_MILLIS); execute = true; cause = new AtomicReference<Throwable>(); emitQueue = new ArrayBlockingQueue<List<T>>(queueCapacity); this.context = context; operatorId = context.getId(); try { if (getRangeQueryPair().getValue() != null) { ps = store.getConnection() .prepareStatement( JdbcMetaDataUtility.buildRangeQuery(getTableName(), getKey(), rangeQueryPair.getKey(), rangeQueryPair.getValue()), java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); } else { ps = store.getConnection().prepareStatement( JdbcMetaDataUtility.buildPollableQuery(getTableName(), getKey(), rangeQueryPair.getKey()), java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); isPollable = true; } } catch (SQLException e) { LOG.error("Exception in initializing the range query for a given partition", e); throw new RuntimeException(e); } windowManager.setup(context); LOG.debug("super setup done..."); }
Source:
private Set<Privileges> immuteRepositoryPrivileges(final Set<Privileges> set) { return set != null ? Collections.unmodifiableSet(set) : Collections.emptySet(); }

Target:
private Set<Privileges> immuteRepositoryPrivileges(final Set<Privileges> set) { return set != null ? ImmutableSet.copyOf(set) : Collections.emptySet(); }
Source:
public Integer size() { ensureSearchEntityLoaded(); SearchCoordinatorSvcImpl.verifySearchHasntFailedOrThrowInternalErrorException(mySearchEntity); Integer size = mySearchEntity.getTotalCount(); if (size != null) { return Math.max(0, size); } if (mySearchEntity.getSearchType() == SearchTypeEnum.HISTORY) { return null; } else { return mySearchCoordinatorSvc.getSearchTotalFromRunningSearchIfExists(myUuid).orElse(null); } }

Target:
public Integer size() { ensureSearchEntityLoaded(); SearchCoordinatorSvcImpl.verifySearchHasntFailedOrThrowInternalErrorException(mySearchEntity); Integer size = mySearchEntity.getTotalCount(); if (size != null) { return Math.max(0, size); } if (mySearchEntity.getSearchType() == SearchTypeEnum.HISTORY) { return null; } else { return mySearchCoordinatorSvc.getSearchTotal(myUuid).orElse(null); } }
Source:
public void deleteDraft() throws RestApiException { try { deleteDraftPatchSet.get().apply(revision, null); } catch (OrmException e) { throw new RestApiException("Cannot delete draft ps", e); } catch (IOException e) { throw new RestApiException("Cannot delete draft ps", e); } }

Target:
public void deleteDraft() throws RestApiException { try { deleteDraft.get().apply(revision, null); } catch (OrmException e) { throw new RestApiException("Cannot delete draft ps", e); } catch (IOException e) { throw new RestApiException("Cannot delete draft ps", e); } }
Source:
public boolean check() { final Method[] accessibleMethods = getAccessibleMethods(); for (Method method : accessibleMethods) { final Class[] parameterTypes = method.getParameterTypes(); final String methodName = method.getName(); final boolean isExcluded = excludedMethods.contains(methodName); final boolean arePrimitives = primitiveValues.containsAll(Arrays.asList(parameterTypes)); final boolean skipIteration = isExcluded || parameterTypes.length == 0 || arePrimitives; if (skipIteration) { continue; } final Object[] parameterValues = getParameterValues(parameterTypes); final boolean isCorrect = invokeAndCheck(method, parameterValues, parameterTypes); if (!isCorrect) { return false; } } return true; }

Target:
public boolean check() { final DefaultValueProvider valuesProvider = new DefaultValueProvider(defaultValues); final Iterable<Method> accessibleMethods = getAccessibleMethods(targetClass); final String targetClassName = targetClass.getName(); for (Method method : accessibleMethods) { final Class[] parameterTypes = method.getParameterTypes(); final String methodName = method.getName(); final boolean excluded = excludedMethods.contains(methodName); final boolean primitivesOnly = allPrimitiveTypes().containsAll(Arrays.asList(parameterTypes)); final boolean skipMethod = excluded || parameterTypes.length == 0 || primitivesOnly; if (skipMethod) { continue; } final MethodChecker methodChecker = new MethodChecker(method, targetClassName, valuesProvider); final boolean passed = methodChecker.check(); if (!passed) { return false; } } return true; }
Source:
public void simpleOnHeapToString() throws Exception { File root = new File("build/tmp/EhcacheManagerToStringTest"); root.mkdirs(); cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .with(new CacheManagerPersistenceConfiguration(root)) .withCache("cache-1", CacheConfigurationBuilder.newCacheConfigurationBuilder( String.class, String.class, newResourcePoolsBuilder() .heap(10, EntryUnit.ENTRIES) .offheap(1, MemoryUnit.MB) .disk(2, MemoryUnit.MB, true)) .withLoaderWriter(new SampleLoaderWriter<String, String>()) .add(WriteBehindConfigurationBuilder .newBatchedWriteBehindConfiguration(1, TimeUnit.SECONDS, 3) .queueSize(3) .concurrencyLevel(1) .enableCoalescing()) .withEvictionAdvisor(new EvictionAdvisor<String, String>() { @Override public boolean adviseAgainstEviction(String key, String value) { return false; } }) .build()) .build(true); String readableString = ((HumanReadable) cacheManager.getRuntimeConfiguration()).readableString(); System.out.println(readableString); Yaml yaml = new Yaml(); Object actual = yaml.load(readableString); Object expected = yaml.load(this.getClass().getResourceAsStream("/simpleConfiguration.yml")); applySortingOnLists(actual); applySortingOnLists(expected); Assert.assertThat(actual, equalTo(expected)); }

Target:
public void simpleOnHeapToString() throws Exception { File root = new File("build/tmp/EhcacheManagerToStringTest"); root.mkdirs(); cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .with(new CacheManagerPersistenceConfiguration(root)) .withCache("cache-1", CacheConfigurationBuilder.newCacheConfigurationBuilder( String.class, String.class, newResourcePoolsBuilder() .heap(10, EntryUnit.ENTRIES) .offheap(1, MemoryUnit.MB) .disk(2, MemoryUnit.MB, true)) .withLoaderWriter(new SampleLoaderWriter<String, String>()) .add(WriteBehindConfigurationBuilder .newBatchedWriteBehindConfiguration(1, TimeUnit.SECONDS, 3) .queueSize(3) .concurrencyLevel(1) .enableCoalescing()) .withEvictionAdvisor(new EvictionAdvisor<String, String>() { @Override public boolean adviseAgainstEviction(String key, String value) { return false; } }) .build()) .build(true); String actual = ((HumanReadable) cacheManager.getRuntimeConfiguration()).readableString(); String expected = read("/simpleConfiguration.txt"); Assert.assertThat( actual.substring(actual.indexOf("resourcePools")).replace(" ", "").replace("\n", ""), equalTo( expected.substring(expected.indexOf("resourcePools")).replace(" ", "").replace("\n", "") ) ); }
Source:
public void checkCallsForWellFormedness() throws AvroRemoteException { final long start = 50; final long end = 100; final SearchVariantSetsRequest req = SearchVariantSetsRequest.newBuilder() .setDatasetId(TestData.getDatasetId()) .build(); final SearchVariantSetsResponse resp = client.variants.searchVariantSets(req); final List<VariantSet> variantSets = resp.getVariantSets(); assertThat(variantSets).isNotEmpty(); final String id = variantSets.get(0).getId(); final SearchVariantsRequest vReq = SearchVariantsRequest.newBuilder() .setVariantSetId(id) .setReferenceName(TestData.REFERENCE_NAME) .setStart(start).setEnd(end) .build(); final SearchVariantsResponse vResp = client.variants.searchVariants(vReq); final List<Variant> searchVariants = vResp.getVariants(); searchVariants.stream().forEach(v -> v.getCalls().stream() .forEach(c -> assertThat(c.getGenotype()).isNotNull() .isNotEmpty())); searchVariants.stream().forEach(v -> v.getCalls().stream() .forEach(c -> assertThat(c.getGenotypeLikelihood()) .isNotNull())); searchVariants.stream().forEach(v -> v.getCalls().stream().forEach(c -> { assertThat(c.getInfo()).isNotNull(); c.getInfo().keySet().stream().forEach(key -> { assertThat(key).isNotNull(); assertThat(c.getInfo().get(key)).isNotNull(); }); })); }

Target:
public void checkCallsForWellFormedness() throws AvroRemoteException { final long start = 50; final long end = 100; final SearchVariantSetsRequest req = SearchVariantSetsRequest.newBuilder() .setDatasetId(TestData.getDatasetId()) .build(); final SearchVariantSetsResponse resp = client.variants.searchVariantSets(req); final List<VariantSet> variantSets = resp.getVariantSets(); assertThat(variantSets).isNotEmpty(); final String id = variantSets.get(0).getId(); final SearchVariantsRequest vReq = SearchVariantsRequest.newBuilder() .setVariantSetId(id) .setReferenceName(TestData.REFERENCE_NAME) .setStart(start).setEnd(end) .build(); final SearchVariantsResponse vResp = client.variants.searchVariants(vReq); final List<Variant> searchVariants = vResp.getVariants(); checkAllCalls(searchVariants, c -> assertThat(c.getGenotype()).isNotNull().isNotEmpty()); checkAllCalls(searchVariants, c -> assertThat(c.getGenotypeLikelihood()).isNotNull()); checkAllCalls(searchVariants, c -> { assertThat(c.getInfo()).isNotNull(); c.getInfo().keySet().stream().forEach(key -> { assertThat(key).isNotNull(); assertThat(c.getInfo().get(key)).isNotNull(); }); }); }
Source:
public void findCapabilities() throws Exception { CapabilityList capabilities = new CapabilityList(Lists.newArrayList(new Capability(256, "ANQP Query List"), new Capability(257, "ANQP Capability list"))); Venue venue = newVenueBuilder().names(new VenueName("Info", new Language("en"))).build(); GeoLocation location = new GeoLocation(24.3456789, 45.5678934); Object operatorId = operatorRepository.create(new NewOperator("name1", ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1", PUBLIC)); NewAccessPoint ap = new NewAccessPoint(new ID(operatorId), "ip1", new MacAddress("aa:bb:cc:dd:ee:ff"), "sn1", "model1", venue, location, capabilities); Object id = repository.create(ap); CapabilityList actual = repository.findCapabilityList(new ID(id)); CapabilityList expected = new CapabilityList(Lists.newArrayList(new Capability(256, "ANQP Query List"), new Capability(257, "ANQP Capability list"))); assertThat(actual, deepEquals(expected)); }

Target:
public void findCapabilities() throws Exception { CapabilityList capabilities = new CapabilityList(Lists.newArrayList(new Capability(256, "ANQP Query List"), new Capability(257, "ANQP Capability list"))); CivicLocation civic = new CivicLocation("country", "city", "street", "number", "postCode"); GeoLocation geo = new GeoLocation(22.22222, 33.333333); Venue venue = newVenueBuilder().names(new VenueName("Info", new Language("en"))).build(); NewOperator operator = newOperator().build(); Object operatorId = operatorRepository.create(operator); NewAccessPoint ap = new NewAccessPoint(new ID(operatorId), "ip1", new MacAddress("aa:bb:cc:dd:ee:ff"), "sn1", "model1", venue, geo, civic, capabilities); Object id = repository.create(ap); CapabilityList actual = repository.findCapabilityList(new ID(id)); assertThat(actual, deepEquals(capabilities)); }
Source:
public void makeOnCreationCallbackListBoxSingleSelect() { setupMultipleSelectTest(CallbackFactory.MAX_VISIBLE_ROWS, false); final Callback callback = CallbackFactory.makeOnCreationCallback(factory, cell, enumLookups); callback.callback(multiValueDOMElement); verifyMultipleSelectTest(CallbackFactory.MAX_VISIBLE_ROWS); }

Target:
public void makeOnCreationCallbackListBoxSingleSelect() { setupMultipleSelectTest(CallbackFactory.MAX_VISIBLE_ROWS, false); final Callback callback = CallbackFactory.makeOnCreationCallback(factory, cell, enumLookups); callback.callback(multiValueDOMElement); verifyMultipleSelectTest(CallbackFactory.MAX_VISIBLE_ROWS); verify(multiValueWidget, never()).setVisibleItemCount(anyInt()); }
Source:
public void testHeaderAmountAndHeaderRowCountsMatch() { LOG.info("testHeaderAmountAndHeaderRowCountsMatch"); ConcurRequestExtractFile testFile = ConcurRequestExtractFileFixture.GOOD_FILE.createConcurRequestExtractFile(); ConcurRequestExtractBatchReportData reportData = new ConcurRequestExtractBatchReportData(); assertTrue("Expected Result: Header amount SHOULD match sum of row amounts from file.", concurRequestExtractFileValidationService.requestExtractHeaderRowValidatesToFileContents(testFile, reportData)); LOG.info(reportData.getHeaderValidationErrors()); System.out.println(""); reportData = null; }

Target:
public void testHeaderAmountAndHeaderRowCountsMatch() { LOG.info("testHeaderAmountAndHeaderRowCountsMatch"); ConcurRequestExtractFile testFile = ConcurRequestExtractFileFixture.GOOD_FILE.createConcurRequestExtractFile(); ConcurRequestExtractBatchReportData reportData = new ConcurRequestExtractBatchReportData(); assertTrue("Expected Result: Header amount SHOULD match sum of row amounts from file.", concurRequestExtractFileValidationService.requestExtractHeaderRowValidatesToFileContents(testFile, reportData)); LOG.info(reportData.getHeaderValidationErrors()); LOG.info(KFSConstants.NEWLINE); reportData = null; }
Source:
protected void executeVmCommand() { vmHandler.warnMemorySizeLegal(getParameters().getVm().getStaticData(), getEffectiveCompatibilityVersion()); if (!canAddVm(destStorages.values())) { log.error("Failed to add VM. The reasons are: {}", String.join(",", getReturnValue().getValidationMessages())); return; } if (!setEmptyLeaseToBootableSD()) { return; } TransactionSupport.executeInNewTransaction(() -> { addVmStatic(); addVmDynamic(); addVmNetwork(); addVmNumaNodes(); addVmStatistics(); addActiveSnapshot(); addVmPermission(); addVmInit(); addVmRngDevice(); addAffinityLabels(); getCompensationContext().stateChanged(); return null; }); if (addVmImages()) { TransactionSupport.executeInNewTransaction(() -> { copyDiskVmElements(); copyVmDevices(); addDiskPermissions(); addVmPayload(); updateSmartCardDevices(); addVmWatchdog(); addGraphicsDevice(); getVmDeviceUtils().updateVirtioScsiController(getVm().getStaticData(), getParameters().isVirtioScsiEnabled()); setActionReturnValue(getVm().getId()); setSucceeded(true); return null; }); } if (getParameters().getPoolId() != null) { addVmToPool(); } discardHelper.logIfDisksWithIllegalPassDiscardExist(getVmId()); }

Target:
protected void executeVmCommand() { vmHandler.warnMemorySizeLegal(getParameters().getVm().getStaticData(), getEffectiveCompatibilityVersion()); if (!canAddVm(destStorages.values())) { log.error("Failed to add VM. The reasons are: {}", String.join(",", getReturnValue().getValidationMessages())); return; } if (!addDefaultVmLease()) { return; } TransactionSupport.executeInNewTransaction(() -> { addVmStatic(); addVmDynamic(); addVmNetwork(); addVmNumaNodes(); addVmStatistics(); addActiveSnapshot(); addVmPermission(); addVmInit(); addVmRngDevice(); addAffinityLabels(); getCompensationContext().stateChanged(); return null; }); if (addVmImages()) { TransactionSupport.executeInNewTransaction(() -> { copyDiskVmElements(); copyVmDevices(); addDiskPermissions(); addVmPayload(); updateSmartCardDevices(); addVmWatchdog(); addGraphicsDevice(); getVmDeviceUtils().updateVirtioScsiController(getVm().getStaticData(), getParameters().isVirtioScsiEnabled()); setActionReturnValue(getVm().getId()); setSucceeded(true); return null; }); } if (getParameters().getPoolId() != null) { addVmToPool(); } discardHelper.logIfDisksWithIllegalPassDiscardExist(getVmId()); }