auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.search_users_groups_layout, container, false); SearchView searchView = (SearchView) view.findViewById(R.id.searchView); SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE); searchView.setSearchableInfo(searchManager.getSearchableInfo( getActivity().getComponentName()) ); searchView.setIconifiedByDefault(false); searchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { Log_OC.v(TAG, "onQueryTextSubmit intercepted, query: " + query); return true; } @Override public boolean onQueryTextChange(String newText) { return false; } }); <START> view.setMinimumWidth(R.dimen.share_user_groups_width); <END> return view; }</code><technical_language>curious, move this code? working fine declaration in res/layout/search_users_groups_layout.xml</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.search_users_groups_layout, container, false); SearchView searchView = (SearchView) view.findViewById(R.id.searchView); SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE); searchView.setSearchableInfo(searchManager.getSearchableInfo( getActivity().getComponentName()) ); searchView.setIconifiedByDefault(false); searchView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { Log_OC.v(TAG, "onQueryTextSubmit intercepted, query: " + query); return true; } @Override public boolean onQueryTextChange(String newText) { return false; } }); return view; }
Source:
<code>private void doTest(final String inputBed, final String header) throws IOException { final File outputFile = File.createTempFile("bed_to_interval_list_test.", ".interval_list"); final BedToIntervalList program = new BedToIntervalList(); final File inputBedFile = new File(TEST_DATA_DIR, inputBed); program.INPUT = inputBedFile; program.SEQUENCE_DICTIONARY = new File(TEST_DATA_DIR, header); program.OUTPUT = outputFile; program.doWork(); Assert.assertEquals(getFileContentsAsString(new File(inputBedFile.getAbsolutePath() + ".interval_list")), <START> getFileContentsAsString(outputFile)); <END> Assert.assertEquals(outputFile.delete(), true); }</code><technical_language>IOUtil.assertFilesEqual instead</technical_language>

Target:
private void doTest(final String inputBed, final String header) throws IOException { final File outputFile = File.createTempFile("bed_to_interval_list_test.", ".interval_list"); outputFile.deleteOnExit(); final BedToIntervalList program = new BedToIntervalList(); final File inputBedFile = new File(TEST_DATA_DIR, inputBed); program.INPUT = inputBedFile; program.SEQUENCE_DICTIONARY = new File(TEST_DATA_DIR, header); program.OUTPUT = outputFile; program.doWork(); SAMException unexpectedException = null; try { IOUtil.assertFilesEqual(new File(inputBedFile.getAbsolutePath() + ".interval_list"), outputFile); } catch (final SAMException e) { unexpectedException = e; } Assert.assertEquals(unexpectedException, null); }
Source:
<code>private List<Variable> evaluateVisibleMatches(IType expectedType, List<IBinding> suggestions) throws CModelException { Set<Variable> res = new HashSet<>(); int size = suggestions.size(); for (int i = 0; i < size; i++) { Variable variable = createVariable(suggestions.get(i), expectedType, i); if (variable != null) { if (fAlreadyMatchedNames.contains(variable.name)) { variable.alreadyMatched = true; } res.add(variable); } } return new <START> ArrayList<Variable>(res); <END> }</code><technical_language><> do</technical_language>

Target:
private Collection<Variable> evaluateVisibleMatches(IType expectedType, List<IBinding> suggestions) throws CModelException { Set<Variable> res = new HashSet<>(); int size = suggestions.size(); for (int i = 0; i < size; i++) { Variable variable = createVariable(suggestions.get(i), expectedType, i); if (variable != null) { if (fAlreadyMatchedNames.contains(variable.name)) { variable.alreadyMatched = true; } res.add(variable); } } return res; }
Source:
<code>private void initVmTemplate() { VmTemplate vmFromConfiguration = null; OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); } catch (OvfReaderException e) { <START> log.errorFormat("failed to parse a given ovf configuration: \n" + ovfEntityData.getOvfData(), e); <END> } vmFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmFromConfiguration); getParameters().setVmTemplate(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }</code><technical_language>add CDA return false, if fails end null vmTemplate NPE. happen i assume solve in opened bug</technical_language>

Target:
private void initVmTemplate() { VmTemplate vmFromConfiguration = null; OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); setVmTemplate(vmFromConfiguration); getParameters().setVmTemplate(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); } catch (OvfReaderException e) { log.errorFormat("failed to parse a given ovf configuration: \n" + ovfEntityData.getOvfData(), e); } } setVdsGroupId(getParameters().getVdsGroupId()); setStoragePoolId(getVdsGroup().getStoragePoolId()); }
Source:
<code>public void testMarkers() { QueueChannel outputChannel = new QueueChannel(); FileSplitter splitter = new FileSplitter(true, true); splitter.setOutputChannel(outputChannel); splitter.handleMessage(new GenericMessage<File>(file)); Message<?> received = outputChannel.receive(0); assertNull(received.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE)); <START> assertNotNull(received); <END> assertThat(received.getPayload(), Matchers.instanceOf(FileSplitter.FileMarker.class)); FileMarker fileMarker = (FileSplitter.FileMarker) received.getPayload(); assertEquals(FileSplitter.FileMarker.Mark.START, fileMarker.getMark()); assertEquals(file.getAbsolutePath(), fileMarker.getFilePath()); assertNotNull(outputChannel.receive(0)); assertNotNull(outputChannel.receive(0)); received = outputChannel.receive(0); assertNotNull(received); assertThat(received.getPayload(), Matchers.instanceOf(FileSplitter.FileMarker.class)); fileMarker = (FileSplitter.FileMarker) received.getPayload(); assertEquals(FileSplitter.FileMarker.Mark.END, fileMarker.getMark()); assertEquals(file.getAbsolutePath(), fileMarker.getFilePath()); }</code><technical_language>lines swapped</technical_language>

Target:
public void testMarkers() { QueueChannel outputChannel = new QueueChannel(); FileSplitter splitter = new FileSplitter(true, true); splitter.setOutputChannel(outputChannel); splitter.handleMessage(new GenericMessage<File>(file)); Message<?> received = outputChannel.receive(0); assertNotNull(received); assertNull(received.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE)); assertThat(received.getPayload(), Matchers.instanceOf(FileSplitter.FileMarker.class)); FileMarker fileMarker = (FileSplitter.FileMarker) received.getPayload(); assertEquals(FileSplitter.FileMarker.Mark.START, fileMarker.getMark()); assertEquals(file.getAbsolutePath(), fileMarker.getFilePath()); assertNotNull(outputChannel.receive(0)); assertNotNull(outputChannel.receive(0)); received = outputChannel.receive(0); assertNotNull(received); assertThat(received.getPayload(), Matchers.instanceOf(FileSplitter.FileMarker.class)); fileMarker = (FileSplitter.FileMarker) received.getPayload(); assertEquals(FileSplitter.FileMarker.Mark.END, fileMarker.getMark()); assertEquals(file.getAbsolutePath(), fileMarker.getFilePath()); }
Source:
<code>synchronized void stop() { handler.removeCallbacks(surveyRunner); <START> resetSurvey(); <END> if (surveySupportFragment != null) { surveySupportFragment.dismiss(); surveySupportFragment = null; } else if (surveyFragment != null) { surveyFragment.dismiss(); surveyFragment = null; } Log.d(Constants.TAG, "Survey stopped"); }</code><technical_language>resetSurvey() method settings surveySupportFragment surveyFragment attributes null, fragments get dismissed if / else if. If modify this code following: synchronized void stop() { handler.removeCallbacks(surveyRunner); if (surveySupportFragment != null) { surveySupportFragment.dismiss(); } else if (surveyFragment != null) { surveyFragment.dismiss(); } resetSurvey(); Log.d(Constants.TAG, "Survey stopped"); }</technical_language>

Target:
synchronized void stop() { handler.removeCallbacks(surveyRunner); if (surveySupportFragment != null) { surveySupportFragment.dismiss(); } else if (surveyFragment != null) { surveyFragment.dismiss(); } resetSurvey(); Log.d(Constants.TAG, "Survey stopped"); }
Source:
<code>public CallBatcherImpl<W, E> withdefaultArgs(CallArgs args) { if(args == null) throw new IllegalArgumentException("CallArgs cannot be null."); CallArgsImpl callArgsImpl = (CallArgsImpl) args; if(callArgsImpl == null || ! (callArgsImpl instanceof CallArgsImpl)) throw new IllegalArgumentException("Illegal Argument."); if(callArgsImpl.getEndpoint().getEndpointPath()!= caller.getEndpointPath()) throw new IllegalArgumentException("Endpoints are different."); List<CallField> callFieldList = callArgsImpl.getCallFields(); <START> callFieldList.forEach(p->p.toBuffered()); <END> this.defaultArgs = callFieldList; return this; }</code><technical_language>this line store buffered fields anywhere? create a new list existing list owned application CallArgs object is modified? If args a null empty field, withDefaultArgs() method return this anything</technical_language>

Target:
public CallBatcherImpl<W, E> withdefaultArgs(CallArgs args) { if(args == null) { this.defaultArgs = null; return this; } if(! (args instanceof CallArgsImpl)) throw new IllegalArgumentException("Illegal Argument."); CallArgsImpl callArgsImpl = (CallArgsImpl) args; if(callArgsImpl.getEndpoint().getEndpointPath()!= caller.getEndpointPath()) throw new IllegalArgumentException("Endpoints are different."); if(callArgsImpl.getCallFields() == null || callArgsImpl.getCallFields().size() == 0) { this.defaultArgs = null; return this; } List<CallField> callFieldList = callArgsImpl.getCallFields().stream().map(p->p.toBuffered()).collect(Collectors.toList()); this.defaultArgs = callFieldList; return this; }
Source:
<code>public static boolean isWater(final Material material) { <START> return material == Material.WATER || material == Material.SEAGRASS || material == Material.TALL_SEAGRASS || material == Material.KELP_PLANT; <END> }</code><technical_language>Interesting. fine</technical_language>

Target:
public static boolean isWater(final Material material) { return material == Material.WATER || material == Material.SEAGRASS || material == Material.TALL_SEAGRASS || material == Material.KELP_PLANT || material == Material.KELP || material == Material.BUBBLE_COLUMN; }
Source:
<code>private boolean isSucceededWithReasonGiven(){ return isSucceededWithHA() && <START> !StringUtils.isEmpty(getVds().getMaintenanceReason()); <END> }</code><technical_language>isNotEmpty</technical_language>

Target:
private boolean isSucceededWithReasonGiven(){ return isSucceededWithHA() && StringUtils.isNotEmpty(getVds().getMaintenanceReason()); }
Source:
<code>private int findPrefixIndex(String value, int offset) { int prefixIndex = value.indexOf(PLACEHOLDER_PREFIX); if (prefixIndex == -1) { return -1; } if (prefixIndex != 0 && value.charAt(prefixIndex - 1) == '\\') { <START> if (prefixIndex <= 1 || (prefixIndex > 1 && value.charAt(prefixIndex - 2) != '\\')) { <END> int relativeOffset = prefixIndex + PLACEHOLDER_PREFIX.length(); return findPrefixIndex(value.substring(relativeOffset), offset + relativeOffset); } } return prefixIndex + offset; }</code><technical_language>I set this in condition (only line) extract this a method</technical_language>

Target:
private int findPrefixIndex(String value, int offset) { int prefixIndex = value.indexOf(PLACEHOLDER_PREFIX); if (prefixIndex == -1) { return -1; } if (shouldResolvePlaceholder(value, prefixIndex)) { return prefixIndex + offset; } else { int relativeOffset = prefixIndex + PLACEHOLDER_PREFIX.length(); return findPrefixIndex(value.substring(relativeOffset), offset + relativeOffset); } }
Source:
<code>public String getMessage(Bundle bundle, String value) { String result = value; if (bundle != null && result != null && result.startsWith(PERCENT)) { if (bundle != null && result != null && result.startsWith(PERCENT + PERCENT)) { return result.replaceFirst(PERCENT, EMPTY); } try { result = Platform.getResourceBundle(bundle).getString(result.substring(PERCENT.length())); } catch (MissingResourceException mre) { DslCommonPlugin.INSTANCE.log(new Status(IStatus.WARNING, bundle.getSymbolicName(), 0, <START> "The key " + value + "has not been found in the properties file for label localization", mre)); <END> } } return result; }</code><technical_language>externalized in plugin.properties a @TranslatableMessage in Messages class :)</technical_language>

Target:
public String getMessage(Bundle bundle, String value) { String result = value; if (bundle != null && result != null && result.startsWith(PERCENT)) { if (bundle != null && result != null && result.startsWith(PERCENT + PERCENT)) { return result.replaceFirst(PERCENT, EMPTY); } try { result = Platform.getResourceBundle(bundle).getString(result.substring(PERCENT.length())); } catch (MissingResourceException mre) { String message = MessageFormat.format(Messages.MessageTranslator_missingResourceMessage1, value) + value + MessageFormat.format(Messages.MessageTranslator_missingResourceMessage2, value); DslCommonPlugin.INSTANCE.log(new Status(IStatus.WARNING, bundle.getSymbolicName(), 0, message, mre)); } } return result; }
Source:
<code>public void shouldBeEqualWhenBothObjectIdsAreTheSame() { Change c1 = new Change(); Change c2 = new Change(); <START> c1.objectId = c2.objectId = ZERO_ID; <END> boolean result = c1.equals(c2); assertTrue(result); assertTrue(c1.hashCode() == c2.hashCode()); }</code><technical_language>I ZERO_ID is a special ID</technical_language>

Target:
public void shouldBeEqualWhenBothObjectIdsAreTheSame() { Change c1 = new Change(); Change c2 = new Change(); c1.objectId = c2.objectId = MISC_ID; boolean result = c1.equals(c2); assertTrue(result); assertTrue(c1.hashCode() == c2.hashCode()); }
Source:
<code><START> protected void setQcowCompat(DiskImage diskImage) { diskImage.setQcowCompat(QcowCompat.QCOW2_V2); if (FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { QemuImageInfo qemuImageInfo = ImagesHandler.getQemuImageInfoFromVdsm(diskImage.getStoragePoolId(), diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId(), true); if (qemuImageInfo != null) { diskImage.setQcowCompat(qemuImageInfo.getQcowCompat()); } } } <END></code><technical_language>IIUC, this return compat version export domain, definition 0.10. want force proper compat version based target domain</technical_language>

Target:
protected void setQcowCompat(DiskImage diskImage) { diskImage.setQcowCompat(QcowCompat.QCOW2_V2); if (FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { QemuImageInfo qemuImageInfo = ImagesHandler.getQemuImageInfoFromVdsm(diskImage.getStoragePoolId(), diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId(), true); if (qemuImageInfo != null) { diskImage.setQcowCompat(qemuImageInfo.getQcowCompat()); } } imageDao.update(diskImage.getImage()); }
Source:
<code>private synchronized void executeTask(ProcessRecordsInput input) { taskExecutionListener.onTaskBegin(currentState, shardInfo); ConsumerTask task = currentState.createTask(shardConsumerArgument, ShardConsumer.this, input); if (task != null) { taskDispatchedAt = Instant.now(); currentTask = task; taskIsRunning = true; TaskResult result; try { result = task.call(); } finally { taskIsRunning = false; } taskOutcome = resultToOutcome(result); } <START> taskExecutionListener.onTaskEnd(currentState, shardInfo); <END> }</code><technical_language>* task.call() throws exception? call onTaskEnd? Is safe assume task is throw exception? * Is a scenario onTaskEnd/Begin() is called called out of order</technical_language>

Target:
private synchronized void executeTask(ProcessRecordsInput input) { TaskExecutionListenerInput taskExecutionListenerInput = TaskExecutionListenerInput.builder() .shardInfo(shardInfo) .taskType(currentState.taskType()) .build(); taskExecutionListener.beforeTaskExecution(taskExecutionListenerInput); ConsumerTask task = currentState.createTask(shardConsumerArgument, ShardConsumer.this, input); if (task != null) { taskDispatchedAt = Instant.now(); currentTask = task; taskIsRunning = true; TaskResult result; try { result = task.call(); } finally { taskIsRunning = false; } taskOutcome = resultToOutcome(result); taskExecutionListenerInput = taskExecutionListenerInput.toBuilder().taskOutcome(taskOutcome).build(); } taskExecutionListener.afterTaskExecution(taskExecutionListenerInput); }
Source:
<code>protected GenericDatabaseDialect( AbstractConfig config, IdentifierRules defaultIdentifierRules ) { this.config = config; this.defaultIdentifierRules = defaultIdentifierRules; this.jdbcUrl = config.getString(JdbcSourceConnectorConfig.CONNECTION_URL_CONFIG); if (!(config instanceof JdbcSinkConfig)) { mapNumerics = config.getBoolean(JdbcSourceTaskConfig.NUMERIC_PRECISION_MAPPING_CONFIG); catalogPattern = config.getString(JdbcSourceTaskConfig.CATALOG_PATTERN_CONFIG); schemaPattern = config.getString(JdbcSourceTaskConfig.SCHEMA_PATTERN_CONFIG); tableTypes = new HashSet<>(config.getList(JdbcSourceTaskConfig.TABLE_TYPE_CONFIG)); <START> } else { <END> mapNumerics = JdbcSourceTaskConfig.NUMERIC_PRECISION_MAPPING_DEFAULT; catalogPattern = JdbcSourceTaskConfig.CATALOG_PATTERN_DEFAULT; schemaPattern = JdbcSourceTaskConfig.SCHEMA_PATTERN_DEFAULT; tableTypes = new HashSet<>(Arrays.asList(JdbcSourceTaskConfig.TABLE_TYPE_DEFAULT)); } }</code><technical_language>switch blocks instanceof (instead of negation)</technical_language>

Target:
protected GenericDatabaseDialect( AbstractConfig config, IdentifierRules defaultIdentifierRules ) { this.config = config; this.defaultIdentifierRules = defaultIdentifierRules; this.jdbcUrl = config.getString(JdbcSourceConnectorConfig.CONNECTION_URL_CONFIG); if (config instanceof JdbcSinkConfig) { catalogPattern = JdbcSourceTaskConfig.CATALOG_PATTERN_DEFAULT; schemaPattern = JdbcSourceTaskConfig.SCHEMA_PATTERN_DEFAULT; tableTypes = new HashSet<>(Arrays.asList(JdbcSourceTaskConfig.TABLE_TYPE_DEFAULT)); } else { catalogPattern = config.getString(JdbcSourceTaskConfig.CATALOG_PATTERN_CONFIG); schemaPattern = config.getString(JdbcSourceTaskConfig.SCHEMA_PATTERN_CONFIG); tableTypes = new HashSet<>(config.getList(JdbcSourceTaskConfig.TABLE_TYPE_CONFIG)); } if (config instanceof JdbcSourceConnectorConfig) { mapNumerics = ((JdbcSourceConnectorConfig)config).numericMapping(); } else { mapNumerics = NumericMapping.NONE; } }
Source:
<code>public boolean isKeypairValid() { try { PrivateKey privateKeyObject = Utils.loadPrivateKey(getPrivateKey()); <START> PublicKey publicKeyObject = Utils.loadPublicKey(getPublicKey()); <END> return Utils.verifyKeyPair(privateKeyObject, publicKeyObject); } catch (Exception e) { return false; } }</code><technical_language>In this 2 lines, Utils methods more BouncyCastle is able do itself. I suggest replacing loadPrivateKey loadPublicKey KeyFactory.getInstance(String algorithm, Provider provider) instead of KeyFactory.getInstance(String algorithm, String providername) library</technical_language>

Target:
public boolean isKeypairValid() { try { PrivateKey privateKeyObject = KeyUtils.loadPrivateKey(getPrivateKey()); PublicKey publicKeyObject = KeyUtils.loadPublicKey(getPublicKey()); return Utils.verifyKeyPair(privateKeyObject, publicKeyObject); } catch (Exception e) { return false; } }
Source:
<code>@Test public void remoting() throws Exception { <START> Assume.assumeTrue(ProcessTree.get()!=ProcessTree.DEFAULT); <END> Tag t = channels.french.call(new MyCallable()); assertSame(t.p.getTree(), t.tree); t.p.getEnvironmentVariables(); assertEquals(t.id,t.p.getPid()); t.p.act(new ProcessCallableImpl()); }</code><technical_language>I find assumeThat(ProcessTree.get(), not(sameInstance(ProcessTree.DEFAULT))) is more readable a true a negative</technical_language>

Target:
@Test public void remoting() throws Exception { Assume.assumeFalse("on some platforms where we fail to list any processes", ProcessTree.get()==ProcessTree.DEFAULT); Tag t = channels.french.call(new MyCallable()); assertSame(t.p.getTree(), t.tree); t.p.getEnvironmentVariables(); assertEquals(t.id,t.p.getPid()); t.p.act(new ProcessCallableImpl()); }
Source:
<code>public Collection<UberfireDock> provideDocks(final String perspectiveIdentifier) { <START> placeManager.closePlace("org.kie.guvnor.TestResults"); <END> List<UberfireDock> result = new ArrayList<>(); toolsDock = new UberfireDock(UberfireDockPosition.EAST, "INFO_CIRCLE", new DefaultPlaceRequest(RightPanelPresenter.IDENTIFIER), perspectiveIdentifier); result.add(toolsDock.withSize(450).withLabel(ScenarioSimulationEditorConstants.INSTANCE.testTools())); reportDock = new UberfireDock(UberfireDockPosition.EAST, "PLAY_CIRCLE", new DefaultPlaceRequest("org.kie.guvnor.TestResults"), perspectiveIdentifier); result.add(reportDock.withSize(450).withLabel(DefaultWorkbenchConstants.INSTANCE.TestReport())); return result; }</code><technical_language>@Rikkola is this needed ? I feeling injecting PlaceManager hides managed - impression. Beside that, if technically is inject stuff (and works sort of "singleton") this creates a sort a complex coupling strive avoid, IMO</technical_language>

Target:
public Collection<UberfireDock> provideDocks(final String perspectiveIdentifier) { List<UberfireDock> result = new ArrayList<>(); settingsDock = new UberfireDock(UberfireDockPosition.EAST, "SLIDERS", new DefaultPlaceRequest(SettingsPresenter.IDENTIFIER), perspectiveIdentifier); result.add(settingsDock.withSize(450).withLabel(ScenarioSimulationEditorConstants.INSTANCE.settings())); toolsDock = new UberfireDock(UberfireDockPosition.EAST, "INFO_CIRCLE", new DefaultPlaceRequest(TestToolsPresenter.IDENTIFIER), perspectiveIdentifier); result.add(toolsDock.withSize(450).withLabel(ScenarioSimulationEditorConstants.INSTANCE.testTools())); cheatSheetDock = new UberfireDock(UberfireDockPosition.EAST, "FILE_TEXT", new DefaultPlaceRequest(CheatSheetPresenter.IDENTIFIER), perspectiveIdentifier); result.add(cheatSheetDock.withSize(450).withLabel(ScenarioSimulationEditorConstants.INSTANCE.scenarioCheatSheet())); reportDock = new UberfireDock(UberfireDockPosition.EAST, "PLAY_CIRCLE", new DockPlaceHolderPlace(TEST_RUNNER_REPORTING_PANEL), perspectiveIdentifier); result.add(reportDock.withSize(450).withLabel(DefaultWorkbenchConstants.INSTANCE.TestReport())); return result; }
Source:
<code>public Jackson2Annotator(GenerationConfig generationConfig) { super(generationConfig); <START> this.generationConfig = generationConfig; <END> }</code><technical_language>This removed</technical_language>

Target:
public Jackson2Annotator(GenerationConfig generationConfig) { super(generationConfig); }
Source:
<code>public void dispose() { myRefsChangedHandle.remove(); <START> planRegistry.remove(this.repository); <END> planList.clear(); planChangeListeners.clear(); }</code><technical_language>s/repository/repository.getDirectory()/</technical_language>

Target:
public void dispose() { myRefsChangedHandle.remove(); planRegistry.remove(this.repository.getDirectory()); planList.clear(); planChangeListeners.clear(); }
Source:
<code><START> protected void templateValidate() { <END> AsyncDataProvider.getAllVmTemplates(new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<VmTemplate> templates = (List<VmTemplate>) returnValue; if(templates.size() <= 1) { getModel().disableEditing(ConstantsManager.getInstance().getConstants().notAvailableWithNoTemplates()); } } }), false); }</code><technical_language>Simpler call this method overridden initialize() method this class. need templateValidate() method in upper class all</technical_language>

Target:
private void templateValidate() { AsyncDataProvider.getAllVmTemplates(new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<VmTemplate> templates = (List<VmTemplate>) returnValue; if(templates.size() <= 1) { getModel().disableEditing(ConstantsManager.getInstance().getConstants().notAvailableWithNoTemplates()); } } }), false); }
Source:
<code>public void testWaitForCompletionCancelled() { TestAnalysis module = setUpAnalysis(); ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace(); try { module.setTrace(trace); } catch (TmfAnalysisException e) { fail(e.getMessage()); } module.setParameter(TestAnalysis.PARAM_TEST, 0); IStatus status = module.schedule(); assertEquals(Status.OK_STATUS, status); boolean completed = module.waitForCompletion(); assertFalse(completed); <START> assertEquals(0, module.getAnalysisOutput()); <END> }</code><technical_language>module.dispose(). methods below..</technical_language>

Target:
public void testWaitForCompletionCancelled() { TestAnalysis module = setUpAnalysis(); ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace(); try { module.setTrace(trace); } catch (TmfAnalysisException e) { fail(e.getMessage()); } module.setParameter(TestAnalysis.PARAM_TEST, 0); IStatus status = module.schedule(); assertEquals(Status.OK_STATUS, status); boolean completed = module.waitForCompletion(); assertFalse(completed); assertEquals(0, module.getAnalysisOutput()); module.dispose(); }
Source:
<code>public void testBloomFilterNDVs(){ int ndv = 128 * 1024 * 1024 / 8; double fpp = 0.01; double numBits = -8 * ndv / Math.log(1 - Math.pow(0.01, 1.0 / 8)); int bytes = (int)numBits / 8; assertTrue(bytes < BlockSplitBloomFilter.UPPER_BOUND_BYTES); ndv = 128 * 1024 * 1024 / java.util.UUID.randomUUID().toString().length(); <START> numBits = -8 * ndv / Math.log(1 - Math.pow(fpp, 1.0 / 8)); <END> bytes = (int)numBits / 8; assertTrue(bytes < 5 * 1024 * 1024); }</code><technical_language>suggestion numBits = 8 * ndv / Math.log(1 - Math.pow(fpp, 1.0 / 8));</technical_language>

Target:
public void testBloomFilterNDVs(){ int ndv = 128 * 1024 * 1024 / 8; double fpp = 0.01; double numBits = -8 * ndv / Math.log(1 - Math.pow(0.01, 1.0 / 8)); int bytes = (int)numBits / 8; assertTrue(bytes < 20 * 1024 * 1024); ndv = 128 * 1024 * 1024 / java.util.UUID.randomUUID().toString().length(); numBits = -8 * ndv / Math.log(1 - Math.pow(fpp, 1.0 / 8)); bytes = (int)numBits / 8; assertTrue(bytes < 5 * 1024 * 1024); }
Source:
<code>public BsmAdminPageEditWindow addAttribute(String key, String value) throws InterruptedException { newAttributeWindow() .key(key) .value(value) .confirm(); <START> wait.until(ExpectedConditions.elementToBeClickable(By.id("addAttributeButton"))); <END> return this; }</code><technical_language>This is kinda a duplicate, wait in confirm() method is a reason wait for another element</technical_language>

Target:
public BsmAdminPageEditWindow addAttribute(String key, String value) throws InterruptedException { newAttributeWindow() .key(key) .value(value) .confirm(); return this; }
Source:
<code>@Override public void setup(Context.OperatorContext context) { super.setup(context); try { <START> loader = new FileLoader(filePath); <END> reloadData(); lastScanTimeStamp = System.currentTimeMillis(); if (updateKeys != null) keyList = Lists.newArrayList(updateKeys.split(",")); } catch (IOException ex) { throw new RuntimeException("Failed to load mappings from the file."); } }</code><technical_language>Provide default file contents if file loaded. original products.json</technical_language>

Target:
public void setup(Context.OperatorContext context) { super.setup(context); try { loader = new FileLoader(filePath, backupResource); reloadData(); lastScanTimeStamp = System.currentTimeMillis(); if (updateKeys != null) { keyList = Lists.newArrayList(updateKeys.split(",")); } } catch (IOException ex) { throw new RuntimeException("Failed to load mappings from the file."); } }
Source:
<code>public LgtvConnection(String ip, int port, int localport, String pkey, String xmldf, int checkalive) { this.ip = ip; this.port = port; this.localport = port; this.checkalive = checkalive; try { connection = new LgTvInteractor(ip, port, localport, xmldf); connection.setpairkey(pkey); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } if (localport != 0 && reader == null) { reader = new LgTvMessageReader(localport); } if (connection != null) addEventListener(connection); if (reader != null) { connection.associatereader(reader); } }</code><technical_language>please remove TODO - please propper logging instead of printStackTrace()</technical_language>

Target:
public LgtvConnection(String ip, int port, int localport, String pkey, String xmldf, int checkalive) { this.ip = ip; this.port = port; this.localport = port; this.checkalive = checkalive; bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext(); try { connection = new LgTvInteractor(ip, port, localport, xmldf); connection.setpairkey(pkey); } catch (InterruptedException e) { logger.error("cannot create Interactor", e); } if (localport != 0 && reader == null) { reader = new LgTvMessageReader(localport); HttpService h=null; if (bundleContext!=null) { ServiceReference<?> serviceReference = bundleContext.getServiceReference(HttpService.class.getName()); if (serviceReference!=null) { h = (HttpService) bundleContext.getService(serviceReference); reader.setHttpService(h); }else logger.error("serviceRefeerence=null"); }else logger.error("bundleContext=null"); } if (connection != null) addEventListener(connection); if (reader != null) { connection.associatereader(reader); } }
Source:
<code>public void register() { <START> getChart().getPlotArea().addMouseTrackListener(this); <END> fToolTipHandler.activateHoverHelp(getChart().getPlotArea()); }</code><technical_language>remove</technical_language>

Target:
public void register() { fToolTipHandler.activateHoverHelp(getChart().getPlotArea()); }
Source:
<code>public String convert(ObjectValue source) { try { Map<String, Object> value = objectMapper.convertValue(source, Map.class); <START> if (Map.class.isInstance(value.get("object"))) { <END> Map<String, Object> object = objectMapper.convertValue(source.getObject(), Map.class); if (object.containsKey("@class")) { Map.class.cast(value.get("object")).put("@class", object.get("@class")); } } return objectMapper.writeValueAsString(value); } catch (Exception cause) { throw new RuntimeException(cause); } }</code><technical_language>extract a constant for "object"</technical_language>

Target:
public String convert(ObjectValue source) { try { Map<String, Object> value = objectMapper.convertValue(source, Map.class); if (Map.class.isInstance(value.get(OBJECT_TYPE_KEY))) { Map<String, Object> object = objectMapper.convertValue(source.getObject(), Map.class); if (object.containsKey(CLASS)) { Map.class.cast(value.get(OBJECT_TYPE_KEY)).put(CLASS, object.get(CLASS)); } } return objectMapper.writeValueAsString(value); } catch (Exception cause) { throw new RuntimeException(cause); } }
Source:
<code>protected List<OvfEntityData> getEntitiesFromStorageOvfDisk() { <START> List<OvfEntityData> ovfEntitiesFromTar = new ArrayList<>(); <END> List<Disk> unregisteredDisks = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisks, new GetUnregisteredDisksQueryParameters(getParameters().getStorageDomainId(), getVds().getStoragePoolId())).getReturnValue(); Pair<DiskImage, Long> ovfDiskAndSize = getLatestOVFDisk(unregisteredDisks); DiskImage ovfDisk = ovfDiskAndSize.getFirst(); if (ovfDisk != null) { VDSReturnValue retrievedByteData = runVdsCommand(VDSCommandType.RetrieveImageData, new ImageHttpAccessVDSCommandParameters(getVdsId(), getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), ovfDisk.getId(), ovfDisk.getImage().getId(), ovfDiskAndSize.getSecond())); if (retrievedByteData.getSucceeded()) { ovfEntitiesFromTar = OvfUtils.getOvfEntities((byte[]) retrievedByteData.getReturnValue(), getParameters().getStorageDomainId()); } } return ovfEntitiesFromTar; }</code><technical_language>initialize Collections.emptyList()</technical_language>

Target:
protected List<OvfEntityData> getEntitiesFromStorageOvfDisk() { List<OvfEntityData> ovfEntitiesFromTar = Collections.emptyList(); List<Disk> unregisteredDisks = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisks, new GetUnregisteredDisksQueryParameters(getParameters().getStorageDomainId(), getVds().getStoragePoolId())).getReturnValue(); Pair<DiskImage, Long> ovfDiskAndSize = getLatestOVFDisk(unregisteredDisks); DiskImage ovfDisk = ovfDiskAndSize.getFirst(); if (ovfDisk != null) { VDSReturnValue retrievedByteData = runVdsCommand(VDSCommandType.RetrieveImageData, new ImageHttpAccessVDSCommandParameters(getVdsId(), getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), ovfDisk.getId(), ovfDisk.getImage().getId(), ovfDiskAndSize.getSecond())); if (retrievedByteData.getSucceeded()) { ovfEntitiesFromTar = OvfUtils.getOvfEntities((byte[]) retrievedByteData.getReturnValue(), getParameters().getStorageDomainId()); } } return ovfEntitiesFromTar; }
Source:
<code>public String getDisplayName() { <START> return "Update all Environment Stacks configuration"; <END> }</code><technical_language>I cluster, customer recognize better</technical_language>

Target:
public String getDisplayName() { return "Update all Environment Clusters configuration"; }
Source:
<code>public void processOutput(Iterable<ConfiguredTarget> partialResult) { for (ConfiguredTarget configuredTarget : partialResult) { BuildConfiguration config = skyframeExecutor.getConfiguration(eventHandler, configuredTarget.getConfigurationKey()); StringBuilder output = new StringBuilder(); <START> if(showKind){ <END> Target actualTarget = accessor.getTargetFromConfiguredTarget(configuredTarget); output = output .append(actualTarget.getTargetKind()) .append(" (") .append(config != null && config.isHostConfiguration() ? "HOST" : config) .append(")"); } else if(!showKind){ output = output .append(configuredTarget.getLabel()) .append(" (") .append(config != null && config.isHostConfiguration() ? "HOST" : config) .append(")"); } if (options.showRequiredConfigFragments != IncludeConfigFragmentsEnum.OFF) { RequiredConfigFragmentsProvider configFragmentsProvider = configuredTarget.getProvider(RequiredConfigFragmentsProvider.class); if (configFragmentsProvider != null) { output .append(" [") .append(String.join(", ", configFragmentsProvider.getRequiredConfigFragments())) .append("]"); } } addResult(output.toString()); } }</code><technical_language>of lines in other branch repeated, if if (showKind) sets some string result (or some similar name)? write: ... append(result) other lines once</technical_language>

Target:
public void processOutput(Iterable<ConfiguredTarget> partialResult) { for (ConfiguredTarget configuredTarget : partialResult) { BuildConfiguration config = skyframeExecutor.getConfiguration(eventHandler, configuredTarget.getConfigurationKey()); StringBuilder output = new StringBuilder(); if(showKind){ Target actualTarget = accessor.getTargetFromConfiguredTarget(configuredTarget); output = output .append(actualTarget.getTargetKind()); } else if(!showKind){ output = output .append(configuredTarget.getLabel()); } output = output .append(" (") .append(config != null && config.isHostConfiguration() ? "HOST" : config) .append(")"); if (options.showRequiredConfigFragments != IncludeConfigFragmentsEnum.OFF) { RequiredConfigFragmentsProvider configFragmentsProvider = configuredTarget.getProvider(RequiredConfigFragmentsProvider.class); if (configFragmentsProvider != null) { output .append(" [") .append(String.join(", ", configFragmentsProvider.getRequiredConfigFragments())) .append("]"); } } addResult(output.toString()); } }
Source:
<code>private static boolean hasWrapper(final Ds3Element ds3Element) { <START> System.out.println(ds3Element.getName()); <END> if (ds3Element.getName().endsWith("Jobs")) { return false; } return Ds3ElementUtil.hasWrapperAnnotations(ds3Element.getDs3Annotations()); }</code><technical_language>println changed a logging message</technical_language>

Target:
private static boolean hasWrapper(final Ds3Element ds3Element) { if (ds3Element.getName().endsWith("Jobs")) { return false; } return Ds3ElementUtil.hasWrapperAnnotations(ds3Element.getDs3Annotations()); }
Source:
<code>private List<ICommitMessageProvider> getCommitMessageProviders() throws CoreException { List<ICommitMessageProvider> providers = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] configs = registry .getConfigurationElementsFor(COMMIT_MESSAGE_PROVIDER_ID); for (IConfigurationElement config : configs) { Object provider; String contributorName = <START> "<unknown"; <END> try { contributorName = config.getDeclaringExtension() .getContributor().getName(); provider = config.createExecutableExtension("class"); if (provider instanceof ICommitMessageProvider) { providers.add((ICommitMessageProvider) provider); } else { Activator.logError( UIText.CommitDialog_WrongTypeOfCommitMessageProvider, null); } } catch (CoreException | InvalidRegistryObjectException e) { Activator.logError( MessageFormat.format( UIText.CommitDialog_ErrorCreatingCommitMessageProvider, contributorName), e); } } return providers; }</code><technical_language><>, completely without</technical_language>

Target:
List<ICommitMessageProvider> getCommitMessageProviders() throws CoreException { List<ICommitMessageProvider> providers = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] configs = registry .getConfigurationElementsFor(COMMIT_MESSAGE_PROVIDER_ID); for (IConfigurationElement config : configs) { Object provider; String contributorName = "<unknown"; try { contributorName = config.getDeclaringExtension() .getContributor().getName(); provider = config.createExecutableExtension("class"); if (provider instanceof ICommitMessageProvider) { providers.add((ICommitMessageProvider) provider); } else { Activator.logError( UIText.CommitDialog_WrongTypeOfCommitMessageProvider, null); } } catch (CoreException | InvalidRegistryObjectException e) { Activator.logError( MessageFormat.format( UIText.CommitDialog_ErrorCreatingCommitMessageProvider, contributorName), e); } } return providers; }
Source:
<code><START> public String getToken() throws Exception { <END> if (!hasToken()) { token = flow.getToken(); } return token; }</code><technical_language>Is throw a more specific exception</technical_language>

Target:
public String getToken() throws OAuthSystemException, OAuthProblemException { if (flow == null) { throw new OAuthSystemException("Oauth flow is null"); } if (!hasToken()) { token = flow.getToken(); } return token; }
Source:
<code>public Future<Map<String, Object>> setupNetworks(Map networks, Map bonding, Map options, final boolean isPolicyReset) { final JsonRpcRequest request = new RequestBuilder("Host.setupNetworks").withParameter("networks", networks) .withParameter("bondings", bonding) .withParameter("options", options) .build(); <START> final ClientPolicy policy = client.getClientRetryPolicy(); <END> final FutureCallable callable = new FutureCallable(new Callable<Map<String, Object>>() { @Override public Map<String, Object> call() throws Exception { if (isPolicyReset) { updateHeartbeatPolicy(policy.clone(), false); } return new FutureMap(client, request).withResponseKey("status"); } }); FutureTask<Map<String, Object>> future = new FutureTask<Map<String, Object>>(callable) { @Override public boolean isDone() { if (callable.isDone()) { if (isPolicyReset) { updateHeartbeatPolicy(policy, true); } return true; } return false; } }; ThreadPoolUtil.execute(future); return future; }</code><technical_language>ignore this line isPolicyReset is true</technical_language>

Target:
public Future<Map<String, Object>> setupNetworks(Map networks, Map bonding, Map options, final boolean isPolicyReset) { final JsonRpcRequest request = new RequestBuilder("Host.setupNetworks").withParameter("networks", networks) .withParameter("bondings", bonding) .withParameter("options", options) .build(); final FutureCallable callable = new FutureCallable(new Callable<Map<String, Object>>() { @Override public Map<String, Object> call() throws Exception { if (isPolicyReset) { updateHeartbeatPolicy(client.getClientRetryPolicy().clone(), false); } return new FutureMap(client, request).withResponseKey("status"); } }); FutureTask<Map<String, Object>> future = new FutureTask<Map<String, Object>>(callable) { @Override public boolean isDone() { if (callable.isDone()) { if (isPolicyReset) { updateHeartbeatPolicy(client.getClientRetryPolicy(), true); } return true; } return false; } }; ThreadPoolUtil.execute(future); return future; }
Source:
<code>public void shouldCreateACombinedListenerForAllChildFactories() { final MutationResultListener listenerOne = mock(MutationResultListener.class); final MutationResultListener listenerTwo = mock(MutationResultListener.class); <START> when(this.firstChild.getListener(isNull(), isNull())).thenReturn(listenerOne); <END> when(this.secondChild.getListener(isNull(), isNull())).thenReturn(listenerTwo); this.testee.getListener(null, null).runStart(); verify(listenerOne, times(1)).runStart(); verify(listenerTwo, times(1)).runStart(); }</code><technical_language>isNull is rarely right matcher. If null is passed is artefact of tests, part of contract. Generally, stubs general accepting (so any(Class) restricting null values). Verifications precise necessary (so rarely any, isNull)</technical_language>

Target:
public void shouldCreateACombinedListenerForAllChildFactories() { final MutationResultListener listenerOne = mock(MutationResultListener.class); final MutationResultListener listenerTwo = mock(MutationResultListener.class); when( this.firstChild.getListener(any(Properties.class), any(ListenerArguments.class))).thenReturn(listenerOne); when( this.secondChild.getListener(any(Properties.class), any(ListenerArguments.class))).thenReturn(listenerTwo); this.testee.getListener(new Properties(), someArgs()).runStart(); verify(listenerOne, times(1)).runStart(); verify(listenerTwo, times(1)).runStart(); }
Source:
<code><START> private static Integer validateValueIsPowerOfTwo(Object value, String property) <END> { int intValue = ((Number) value).intValue(); if (Integer.bitCount(intValue) != 1) { throw new PrestoException( StandardErrorCode.INVALID_SESSION_PROPERTY, format("%s must be a power of 2: %s", property, intValue)); } return intValue; }</code><technical_language>return type int</technical_language>

Target:
private static int validateValueIsPowerOfTwo(Object value, String property) { int intValue = ((Number) requireNonNull(value, "value is null")).intValue(); if (Integer.bitCount(intValue) != 1) { throw new PrestoException( StandardErrorCode.INVALID_SESSION_PROPERTY, format("%s must be a power of 2: %s", property, intValue)); } return intValue; }
Source:
<code>public SetOp add(ByteArrayWrapper element) { <START> this.adds.add(element); <END> this.removes.remove(element); return this; }</code><technical_language>This is I struggled with. semantics of observed-remove not-so-obvious user _means_ add shipped in operation a remove. In Erlang client, decided sending _all_ recorded operations surprising solution, caveat removes applied adds</technical_language>

Target:
public SetOp add(ByteArrayWrapper element) { this.adds.add(element); return this; }
Source:
<code>private static ResultSet<Change> scanChanges(ReviewDb db, Repository repo) throws OrmException, IOException { Map<String, Ref> refs = repo.getRefDatabase().getRefs(RefNames.REFS_CHANGES); Set<Change.Id> ids = Sets.newHashSetWithExpectedSize(refs.size()); for (Ref r : refs.values()) { Change.Id id = Change.Id.fromRef(r.getName()); if (id != null) { ids.add(id); } } return <START> db.changes().get(ids); <END> }</code><technical_language>This feels wrong me. this translated SQL? * change_id = 1 change_id = 2 ... * change_id in (1,2,3,4,5, 1024) (1024, 1025, ...) ... byProject index predicate here, reindexing. want database here, this change is about. leave is for add a TODO? verified site reindexing this method implementation for *very* big repository (0,5 million changes)</technical_language>

Target:
private static List<Change> scanChanges(ReviewDb db, Repository repo) throws OrmException, IOException { Map<String, Ref> refs = repo.getRefDatabase().getRefs(RefNames.REFS_CHANGES); Set<Change.Id> ids = new LinkedHashSet<>(); for (Ref r : refs.values()) { Change.Id id = Change.Id.fromRef(r.getName()); if (id != null) { ids.add(id); } } List<Change> changes = new ArrayList<>(ids.size()); for (Change.Id id : ids) { changes.add(db.changes().get(id)); } return changes; }
Source:
<code>public TestHiveClientGlueMetastore() { <START> super("test_glue_" + new Random().nextInt(100000000)); <END> }</code><technical_language>If want guarantee collisions: java randomUUID().toString().toLowerCase(ENGLISH).replace("-", ""); do this for other Hive tests</technical_language>

Target:
public TestHiveClientGlueMetastore() { super("test_glue" + randomUUID().toString().toLowerCase(ENGLISH).replace("-", "")); }
Source:
<code>protected void executeCommand() { final VDS vds = getVds(); try (EngineLock monitoringLock = acquireMonitorLock()) { ExecutionHandler.updateSpecificActionJobCompleted(vds.getId(), VdcActionType.MaintenanceVds, false); setSucceeded(setVdsStatus(VDSStatus.Unassigned).getSucceeded()); if (getSucceeded()) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { List<Network> networks = getNetworkDao().getAllForCluster(vds.getVdsGroupId()); for (Network net : networks) { NetworkClusterHelper.setStatus(vds.getVdsGroupId(), net); } return null; } }); if (vds.getHighlyAvailableIsConfigured()) { SetHaMaintenanceModeVDSCommandParameters param = new SetHaMaintenanceModeVDSCommandParameters(vds, HaMaintenanceMode.LOCAL, false); if (!runVdsCommand(VDSCommandType.SetHaMaintenanceMode, param).getSucceeded()) { haMaintenanceFailed = true; } } } } logMonitorLockReleased("Activate"); <START> <END> }</code><technical_language>pls remove this patch</technical_language>

Target:
protected void executeCommand() { final VDS vds = getVds(); try (EngineLock monitoringLock = acquireMonitorLock()) { ExecutionHandler.updateSpecificActionJobCompleted(vds.getId(), VdcActionType.MaintenanceVds, false); setSucceeded(setVdsStatus(VDSStatus.Unassigned).getSucceeded()); if (getSucceeded()) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { List<Network> networks = getNetworkDao().getAllForCluster(vds.getVdsGroupId()); for (Network net : networks) { NetworkClusterHelper.setStatus(vds.getVdsGroupId(), net); } return null; } }); if (vds.getHighlyAvailableIsConfigured()) { SetHaMaintenanceModeVDSCommandParameters param = new SetHaMaintenanceModeVDSCommandParameters(vds, HaMaintenanceMode.LOCAL, false); if (!runVdsCommand(VDSCommandType.SetHaMaintenanceMode, param).getSucceeded()) { haMaintenanceFailed = true; } } if (vds.getVdsGroupSupportsGlusterService()) { runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("glusterd"), "restart")); } } } logMonitorLockReleased("Activate"); }