auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testGetChildrenList_Normal() throws IOException { GetChildrenListRequest getChildrenListRequest = new GetChildrenListRequest(); <START> getChildrenListRequest.setPathList(Arrays.asList("/testPath", "/testPath")); <END> ByteArrayOutputStream baos = new ByteArrayOutputStream(); BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos); getChildrenListRequest.serialize(boa, "request"); baos.close(); Request r = new Request(cnxn, 0, 0, ZooDefs.OpCode.getChildrenList, ByteBuffer.wrap(baos.toByteArray()), new ArrayList<Id>()); processor.processRequest(r); GetChildrenListResponse rsp = (GetChildrenListResponse)responseRecord[0]; assertThat(rsp.getChildren().size(), equalTo(2)); assertThat(rsp.getChildren().get(0), equalTo(Arrays.asList("child1", "child2", "child3"))); assertThat(rsp.getChildren().get(1), equalTo(Arrays.asList("child1", "child2", "child3"))); }</code><technical_language>do search for path twice? Is a test case validate results merged</technical_language>

Target:
public void testGetChildrenList_Normal() throws IOException, KeeperException.NoNodeException { when(db.getNode((any(String.class)))).thenReturn(new DataNode()); when(db.getChildren(eq("/path1"), any(Stat.class), any(Watcher.class))) .thenReturn(Arrays.asList("child1", "child2", "child3")); when(db.getChildren(eq("/path2"), any(Stat.class), any(Watcher.class))) .thenReturn(Arrays.asList("child4", "child5")); ByteBuffer bb = createGetChildrenListRequestByteBuffer(Arrays.asList("/path1", "/path2")); Request r = new Request(cnxn, 0, 0, ZooDefs.OpCode.getChildrenList, bb, new ArrayList<Id>()); processor.processRequest(r); GetChildrenListResponse rsp = (GetChildrenListResponse)responseRecord[0]; assertThat(rsp.getChildren().size(), equalTo(2)); assertThat(rsp.getChildren().get(0), equalTo(Arrays.asList("child1", "child2", "child3"))); assertThat(rsp.getChildren().get(1), equalTo(Arrays.asList("child4", "child5"))); }
Source:
<code>public void processAst(IASTTranslationUnit ast) { ast.accept(new ASTVisitor() { { shouldVisitDeclarations = true; } @Override public int visit(IASTDeclaration declaration) { if (declaration instanceof IASTSimpleDeclaration) { IASTSimpleDeclaration simple = (IASTSimpleDeclaration) declaration; IASTDeclarator decls[] = ((IASTSimpleDeclaration) declaration).getDeclarators(); if (simple.getDeclSpecifier().getStorageClass() == IASTDeclSpecifier.sc_static && declaration.getTranslationUnit().isHeaderUnit()) { for (IASTDeclarator d : decls) { IBinding binding = d.getName().resolveBinding(); if (binding != null && binding instanceof IVariable) { try { IScope scope = binding.getScope(); if (scope == null) return PROCESS_CONTINUE; if (scope.getKind() == EScopeKind.eGlobal || scope.getKind() == EScopeKind.eNamespace) reportProblem(STATIC_VAR_ID, declaration, d.getName()); } catch (DOMException e) { CodanCheckersActivator.log(e); } } } } if (declaration.getParent() instanceof IASTDeclarationStatement) { IASTNode node = declaration.getParent(); <START> if (node == null) <END> return PROCESS_CONTINUE; node = node.getParent(); if (node instanceof IASTForStatement || node instanceof IASTIfStatement || node instanceof IASTSwitchStatement) { return PROCESS_CONTINUE; } } if (decls.length == 0) return PROCESS_CONTINUE; if (decls.length != 1) reportProblem(VAR_MULTI_DEC_ID, declaration); } return PROCESS_CONTINUE; } }); }</code><technical_language>This true, checked node is instanceof IASTDeclarationStatement above</technical_language>

Target:
public void processAst(IASTTranslationUnit ast) { ast.accept(new ASTVisitor() { { shouldVisitDeclarations = true; } @Override public int visit(IASTDeclaration declaration) { if (declaration instanceof IASTSimpleDeclaration) { IASTSimpleDeclaration simple = (IASTSimpleDeclaration) declaration; IASTDeclarator decls[] = ((IASTSimpleDeclaration) declaration).getDeclarators(); if (simple.getDeclSpecifier().getStorageClass() == IASTDeclSpecifier.sc_static && declaration.getTranslationUnit().isHeaderUnit()) { for (IASTDeclarator d : decls) { IBinding binding = d.getName().resolveBinding(); if (binding != null && binding instanceof IVariable) { try { IScope scope = binding.getScope(); if (scope == null) return PROCESS_CONTINUE; if (scope.getKind() == EScopeKind.eGlobal || scope.getKind() == EScopeKind.eNamespace) reportProblem(STATIC_VAR_ID, declaration, d.getName()); } catch (DOMException e) { CodanCheckersActivator.log(e); } } } } if (declaration.getParent() instanceof IASTDeclarationStatement) { IASTNode node = declaration.getParent().getParent(); if (node instanceof IASTForStatement || node instanceof IASTIfStatement || node instanceof IASTSwitchStatement) { return PROCESS_CONTINUE; } } if (decls.length == 0) return PROCESS_CONTINUE; if (decls.length != 1) reportProblem(VAR_MULTI_DEC_ID, declaration); } return PROCESS_CONTINUE; } }); }
Source:
<code>protected boolean set(Entity entity, Boolean value) { <START> entity.getNBTTagCompound().setBoolean("NoGravity", !value); <END> return true; }</code><technical_language>This change actual value. need set actual field (or existing methods in Entity)</technical_language>

Target:
protected boolean set(Entity entity, Boolean value) { entity.setNoGravity(!value); return true; }
Source:
<code>protected void shutdown() { if (this.changeBus != null) { this.changeBus.shutdown(); } if (repositoryQueryManager != null) { repositoryQueryManager.stopReindexing(); } this.connectors.shutdown(); for (ScheduledFuture<?> future : backgroundProcesses) { future.cancel(true); } unbindFromJndi(); sequencers().shutdown(); if (!internalSessions.isEmpty()) { try { int counter = 200; while (counter > 0 && !internalSessions.isEmpty()) { Thread.sleep(50L); --counter; } } catch (InterruptedException e) { } } this.cache.startShutdown(); if (this.clusteringService != null) { this.clusteringService.shutdown(); } <START> <END> if (this.journal != null) { this.journal.shutdown(); } if (repositoryQueryManager != null) { repositoryQueryManager.shutdown(); } if (extractors != null) { extractors.shutdown(); } if (backupService != null) { backupService.shutdown(); } this.binaryStore.shutdown(); this.cache.completeShutdown(); if (statistics != null) { statistics.stop(); } if (mbean != null) { mbean.stop(); } this.context().terminateAllPools(30, TimeUnit.SECONDS); this.environment().shutdown(); }</code><technical_language>this effect? want shut bus _after_ disconnect cluster? shutting change bus first, lose some events other members of cluster</technical_language>

Target:
protected void shutdown() { if (repositoryQueryManager != null) { repositoryQueryManager.stopReindexing(); } this.connectors.shutdown(); for (ScheduledFuture<?> future : backgroundProcesses) { future.cancel(true); } unbindFromJndi(); sequencers().shutdown(); if (!internalSessions.isEmpty()) { try { int counter = 200; while (counter > 0 && !internalSessions.isEmpty()) { Thread.sleep(50L); --counter; } } catch (InterruptedException e) { } } this.cache.startShutdown(); if (this.clusteringService != null) { this.clusteringService.shutdown(); } if (this.changeBus != null) { this.changeBus.shutdown(); } if (this.journal != null) { this.journal.shutdown(); } if (repositoryQueryManager != null) { repositoryQueryManager.shutdown(); } if (extractors != null) { extractors.shutdown(); } if (backupService != null) { backupService.shutdown(); } this.binaryStore.shutdown(); this.cache.completeShutdown(); if (statistics != null) { statistics.stop(); } if (mbean != null) { mbean.stop(); } this.context().terminateAllPools(30, TimeUnit.SECONDS); this.environment().shutdown(); }
Source:
<code>protected FoursquareProfile extractUserProfile(String body) { FoursquareProfile profile = new FoursquareProfile(); JsonNode json = JsonHelper.getFirstNode(body); <START> if (json == null) { <END> } JsonNode response = (JsonNode) JsonHelper.get(json, "response"); if (response == null) { } JsonNode user = (JsonNode) JsonHelper.get(response, "user"); if (user != null) { profile.setId(JsonHelper.get(user, "id")); profile.addAttribute("first_name",JsonHelper.get(user,"firstName")); profile.addAttribute("family_name",JsonHelper.get(user,"lastName")); profile.addAttribute("location", JsonHelper.get(user,"homeCity")); JsonNode contact = (JsonNode) JsonHelper.get(user, "contact"); profile.addAttribute("email", JsonHelper.get(contact, "email")); JsonNode picture = (JsonNode) JsonHelper.get(user, "photo"); String pictureUrl = picture.get("prefix").asText()+"original"+picture.get("suffix").asText(); profile.addAttribute("picture_url", pictureUrl); for (final String attribute : OAuthAttributesDefinitions.foursquareDefenition.getAllAttributes()) { profile.addAttribute(attribute, JsonHelper.get(user, attribute)); } } return profile; }</code><technical_language>Is this test useful? I so..</technical_language>

Target:
protected FoursquareProfile extractUserProfile(String body) { FoursquareProfile profile = new FoursquareProfile(); JsonNode json = JsonHelper.getFirstNode(body); if (json == null) { return profile; } JsonNode response = (JsonNode) JsonHelper.get(json, "response"); if (response == null) { return profile; } JsonNode user = (JsonNode) JsonHelper.get(response, "user"); if (user != null) { profile.setId(JsonHelper.get(user, "id")); for (final String attribute : OAuthAttributesDefinitions.foursquareDefinition.getAllAttributes()) { profile.addAttribute(attribute, JsonHelper.get(user, attribute)); } } return profile; }
Source:
<code>public void actionPerformed(ActionEvent e) { if(e.getSource() == okButton){ <START> System.out.println(certControll); <END> if (certControll != null) { certControll.setAddToKeystore(true); } this.dispose(); }else if(e.getSource() == cancelButton){ if (certControll != null) { certControll.setAddToKeystore(false); } this.dispose(); } }</code><technical_language>System.out? Booh</technical_language>

Target:
public void actionPerformed(ActionEvent e) { if(e.getSource() == okButton){ if (certControll != null) { certControll.setAddToKeystore(true); } this.dispose(); }else if(e.getSource() == cancelButton){ if (certControll != null) { certControll.setAddToKeystore(false); } this.dispose(); } }
Source:
<code>public List<JobCommand> workerHeartbeat(JobWorkerHealth jobWorkerHealth, List<TaskInfo> taskInfoList) throws ResourceExhaustedException { long workerId = jobWorkerHealth.getWorkerId(); String hostname; try (LockResource workersLockShared = new LockResource(mWorkerRWLock.readLock())) { MasterWorkerInfo worker = mWorkers.getFirstByField(mIdIndex, workerId); if (worker == null) { return Collections.singletonList(JobCommand.newBuilder() .setRegisterCommand(RegisterCommand.getDefaultInstance()).build()); } hostname = worker.getWorkerAddress().getHost(); worker.updateLastUpdatedTimeMs(); } <START> jobWorkerHealth.setHostname(hostname); <END> mWorkerHealth.put(workerId, jobWorkerHealth); Map<Long, List<TaskInfo>> taskInfosPerJob = new HashMap<>(); for (TaskInfo taskInfo : taskInfoList) { taskInfo.setWorkerHost(hostname); if (!taskInfosPerJob.containsKey(taskInfo.getJobId())) { taskInfosPerJob.put(taskInfo.getJobId(), new ArrayList()); } taskInfosPerJob.get(taskInfo.getJobId()).add(taskInfo); } for (Map.Entry<Long, List<TaskInfo>> taskInfosPair : taskInfosPerJob.entrySet()) { PlanCoordinator planCoordinator = mPlanTracker.getCoordinator(taskInfosPair.getKey()); if (planCoordinator != null) { planCoordinator.updateTasks(taskInfosPair.getValue()); } } mWorkflowTracker.workerHeartbeat(taskInfoList); return mCommandManager.pollAllPendingCommands(workerId); }</code><technical_language>include/set hostname construct health object instead of setting here? I feel is more bug prone object immutable a single field able set this. If is good reason fine</technical_language>

Target:
public List<JobCommand> workerHeartbeat(JobWorkerHealth jobWorkerHealth, List<TaskInfo> taskInfoList) throws ResourceExhaustedException { long workerId = jobWorkerHealth.getWorkerId(); String hostname; try (LockResource workersLockShared = new LockResource(mWorkerRWLock.readLock())) { MasterWorkerInfo worker = mWorkers.getFirstByField(mIdIndex, workerId); if (worker == null) { return Collections.singletonList(JobCommand.newBuilder() .setRegisterCommand(RegisterCommand.getDefaultInstance()).build()); } hostname = worker.getWorkerAddress().getHost(); worker.updateLastUpdatedTimeMs(); } mWorkerHealth.put(workerId, jobWorkerHealth); Map<Long, List<TaskInfo>> taskInfosPerJob = new HashMap<>(); for (TaskInfo taskInfo : taskInfoList) { taskInfo.setWorkerHost(hostname); if (!taskInfosPerJob.containsKey(taskInfo.getJobId())) { taskInfosPerJob.put(taskInfo.getJobId(), new ArrayList()); } taskInfosPerJob.get(taskInfo.getJobId()).add(taskInfo); } for (Map.Entry<Long, List<TaskInfo>> taskInfosPair : taskInfosPerJob.entrySet()) { PlanCoordinator planCoordinator = mPlanTracker.getCoordinator(taskInfosPair.getKey()); if (planCoordinator != null) { planCoordinator.updateTasks(taskInfosPair.getValue()); } } mWorkflowTracker.workerHeartbeat(taskInfoList); return mCommandManager.pollAllPendingCommands(workerId); }
Source:
<code>private void onAddExpenseResult(Intent data) { ExpenseClaim claim = (ExpenseClaim)data.getSerializableExtra(ExpenseClaimAddActivity.EXTRA_EXPENSE_CLAIM); listModel.add(claim); <START> if(checkFilteredTags()) { <END> setListAdapter(new ExpenseClaimArrayAdapter(this, filteredListModel.getItems())); } }</code><technical_language>Style inconsistency: space if</technical_language>

Target:
private void onAddExpenseResult(Intent data) { ExpenseClaim claim = (ExpenseClaim)data.getSerializableExtra(ExpenseClaimAddActivity.EXTRA_EXPENSE_CLAIM); listModel.add(claim); if (!filteredTagsList.isEmpty()) { setListAdapter(new ExpenseClaimArrayAdapter(this, filteredListModel.getItems())); } }
Source:
<code>public void init(FMLInitializationEvent evt) { try { Natura.logger.debug("[MFR] Registering Natura trees/plants/crops with MFR Farming Registry."); MRFRegistering.registerWithMFR(); } catch (Throwable t) { <START> Natura.logger.debug("Something went wrong in Natura plugin MineFactoryReloaded.", t); <END> } }</code><technical_language>this stay in warn</technical_language>

Target:
public void init(FMLInitializationEvent evt) { try { Natura.logger.debug("[MFR] Registering Natura trees/plants/crops with MFR Farming Registry."); MRFRegistering.registerWithMFR(); } catch (Throwable t) { Natura.logger.warn("Something went wrong in Natura plugin MineFactoryReloaded.", t); } }
Source:
<code>private void logon(MessageContext messageContext, JCoDestination destination, String escapeErrorHandling) throws AxisFault { JCoFunction logonFunction = getRFCfunction(destination, SAPConstants.BABI_XMI_LOGON); logonFunction.getImportParameterList().setValue(SAPConstants.EXTCOMPANY, (String) messageContext.getProperty(SAPConstants.TRANSPORT_SAP_EXTCOMPANY)); logonFunction.getImportParameterList().setValue(SAPConstants.EXTPRODUCT, (String) messageContext.getProperty(SAPConstants.TRANSPORT_SAP_EXTPRODUCT)); logonFunction.getImportParameterList().setValue(SAPConstants.INTERFACE, (String) messageContext.getProperty(SAPConstants.TRANSPORT_SAP_INTERFACE)); logonFunction.getImportParameterList().setValue(SAPConstants.VERSION, (String) messageContext.getProperty(SAPConstants.TRANSPORT_SAP_VERSION)); String logonResponse = evaluateRFCfunction(logonFunction, destination, escapeErrorHandling); if (log.isDebugEnabled()) { log.debug("BAPI XMI Logon response: " + logonResponse); } <START> log.info("logged in"); <END> }</code><technical_language>this info log? feels a debug log me</technical_language>

Target:
private void logon(MessageContext messageContext, JCoDestination destination, String escapeErrorHandling) throws AxisFault { JCoFunction logonFunction = getRFCfunction(destination, SAPConstants.BABI_XMI_LOGON); logonFunction.getImportParameterList().setValue(SAPConstants.EXTCOMPANY, (String) messageContext.getProperty(SAPConstants.TRANSPORT_SAP_EXTCOMPANY)); logonFunction.getImportParameterList().setValue(SAPConstants.EXTPRODUCT, (String) messageContext.getProperty(SAPConstants.TRANSPORT_SAP_EXTPRODUCT)); logonFunction.getImportParameterList().setValue(SAPConstants.INTERFACE, (String) messageContext.getProperty(SAPConstants.TRANSPORT_SAP_INTERFACE)); logonFunction.getImportParameterList().setValue(SAPConstants.VERSION, (String) messageContext.getProperty(SAPConstants.TRANSPORT_SAP_VERSION)); String logonResponse = evaluateRFCfunction(logonFunction, destination, escapeErrorHandling); if (log.isDebugEnabled()) { log.debug("BAPI XMI Logon response: " + logonResponse); } }
Source:
<code>public void testThreadPools() { assertEquals( 200L, registry.getSampleValue( "jvm_threads", <START> new String[]{"type"}, <END> new String[]{"daemon"}), .0000001); assertEquals( 100L, registry.getSampleValue( "jvm_threads", new String[]{"type"}, new String[]{"nondaemon"}), .0000001); assertEquals( 301L, registry.getSampleValue( "jvm_threads_peak", new String[]{"type"}, new String[]{"peak"}), .0000001); assertEquals( 503L, registry.getSampleValue( "jvm_threads_started", new String[]{"type"}, new String[]{"started"}), .0000001); }</code><technical_language>This is a times, benefit a const defined in set up. Depends if necessary</technical_language>

Target:
public void testThreadPools() { assertEquals( 300L, registry.getSampleValue( "jvm_threads_current", EMPTY_LABEL, EMPTY_LABEL), .0000001); assertEquals( 200L, registry.getSampleValue( "jvm_threads_daemon", EMPTY_LABEL, EMPTY_LABEL), .0000001); assertEquals( 301L, registry.getSampleValue( "jvm_threads_peak", EMPTY_LABEL, EMPTY_LABEL), .0000001); assertEquals( 503L, registry.getSampleValue( "jvm_threads_started_total", EMPTY_LABEL, EMPTY_LABEL), .0000001); }
Source:
<code>protected IndentLevel getIndentImpl() { IndentLevel result; if (getLineStart(getMainAst()) == getMainAst().getColumnNo()) { result = super.getIndentImpl(); <START> if (getMainAst().getParent().getParent().getText().equals(ASSIGNMENT)) { <END> result = new IndentLevel(result, getIndentCheck().getLineWrappingIndentation()); } } else { result = new IndentLevel(getLineStart(getMainAst())); } return result; }</code><technical_language>getMainAst() I counted 4 invocations of this method, please extract variable</technical_language>

Target:
protected IndentLevel getIndentImpl() { IndentLevel result; if (getLineStart(mainAst) == mainAst.getColumnNo()) { result = super.getIndentImpl(); if (isNewKeywordFollowedByAssign()) { result = new IndentLevel(result, getLineWrappingIndent()); } } else { result = new IndentLevel(getLineStart(mainAst)); } return result; }
Source:
<code>public int updateDownloading(String filePath, boolean downloading) { ContentValues cv = new ContentValues(); cv.put(ProviderTableMeta.FILE_DOWNLOADING, downloading); <START> int result = getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, ProviderTableMeta.FILE_PATH + "=? AND "+ <END> ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?", new String[] { filePath, mAccount.name }); Log_OC.d(TAG, "updateDownloading, result=" + String.valueOf(result)); return result; }</code><technical_language>in updateUploading()</technical_language>

Target:
public int updateDownloading(String filePath, boolean downloading) { ContentValues cv = new ContentValues(); cv.put(ProviderTableMeta.FILE_DOWNLOADING, downloading); int result = -1; if (getContentResolver() != null) { result = getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, ProviderTableMeta.FILE_PATH + "=? AND "+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?", new String[] { filePath, mAccount.name }); } else { try { result = getContentProvider().update(ProviderTableMeta.CONTENT_URI, cv, ProviderTableMeta.FILE_PATH + "=? AND "+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?", new String[] { filePath, mAccount.name }); } catch (RemoteException e) { Log_OC.e(TAG, "Fail to update 'downloading' of " + filePath + " in database", e); } } return result; }
Source:
<code>public void dispose() { DiagramEventBroker broker = DiagramEventBroker.getInstance(graphicalEditPart.getEditingDomain()); if (broker != null) { DDiagramElement dDiagramElement = getDDiagramElement(graphicalEditPart); if (dDiagramElement != null) { broker.removeNotificationListener(dDiagramElement, ViewpointPackage.Literals.DREPRESENTATION_ELEMENT__SEMANTIC_ELEMENTS, this); if <START> (dDiagramElement.getSemanticElements() != <END> null) { for (EObject semanticElement : dDiagramElement.getSemanticElements()) { broker.removeNotificationListener(semanticElement, this); } } } } graphicalEditPart = null; }</code><technical_language>prefer a local variable this method called times LabelAndIconRefresher is created for AbstractNotSelectableShapeNodeEditPart</technical_language>

Target:
public void dispose() { DiagramEventBroker broker = DiagramEventBroker.getInstance(graphicalEditPart.getEditingDomain()); if (broker != null) { DDiagramElement dDiagramElement = getDDiagramElement(graphicalEditPart); if (dDiagramElement != null) { broker.removeNotificationListener(dDiagramElement, ViewpointPackage.Literals.DREPRESENTATION_ELEMENT__SEMANTIC_ELEMENTS, this); EList<EObject> semanticElements = dDiagramElement.getSemanticElements(); if (semanticElements != null) { for (EObject semanticElement : semanticElements) { broker.removeNotificationListener(semanticElement, this); } } } } graphicalEditPart = null; }
Source:
<code>public Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName) { <START> return metadata.getSystemTable(((FullConnectorSession) session).getSession(), new QualifiedObjectName(catalogName, tableName.getSchemaName(), tableName.getTableName())); <END> }</code><technical_language>Wrap add a variable</technical_language>

Target:
public Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName) { Optional<SystemTable> systemTable = metadata.getSystemTable( ((FullConnectorSession) session).getSession(), new QualifiedObjectName(catalogName, tableName.getSchemaName(), tableName.getTableName())); if (systemTable.isPresent() && systemTable.get().getDistribution() != SINGLE_COORDINATOR) { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Distribution for dynamic system table must be " + SINGLE_COORDINATOR); } return systemTable; }
Source:
<code>public List<File> listFiles(File directory) throws IllegalArgumentException { FileListFilter<File> filter = getFilter(); boolean supportAcceptFilter = filter instanceof AbstractFileListFilter; try { <START> Stream<File> fileStream = Files.walk(directory.toPath()) <END> .skip(1) .map(Path::toFile) .filter(file -> !supportAcceptFilter || ((AbstractFileListFilter<File>) filter).accept(file)); if (supportAcceptFilter) { return fileStream.collect(Collectors.toList()); } else { return filter.filterFiles(fileStream.toArray(File[]::new)); } } catch (IOException e) { throw new IllegalArgumentException(e); } }</code><technical_language>support depth FileVisitOptions</technical_language>

Target:
public List<File> listFiles(File directory) throws IllegalArgumentException { FileListFilter<File> filter = getFilter(); boolean supportAcceptFilter = filter instanceof AbstractFileListFilter; try { Stream<File> fileStream = Files.walk(directory.toPath(), this.maxDepth, this.fileVisitOptions) .skip(1) .map(Path::toFile) .filter(file -> !supportAcceptFilter || ((AbstractFileListFilter<File>) filter).accept(file)); if (supportAcceptFilter) { return fileStream.collect(Collectors.toList()); } else { return filter.filterFiles(fileStream.toArray(File[]::new)); } } catch (IOException e) { throw new IllegalArgumentException(e); } }
Source:
<code>private void push(MarkupText text) { text.hide(0, COMMAND.length()); String head = "<div class=\"titleDiv\">"; text.addMarkup(COMMAND.length(), head); StringBuffer sb = new StringBuffer(); sb.append("<script>\n"); sb.append("function toggle(showHideDiv, switchTextDiv) {\n"); sb.append("\tvar tog = document.getElementById(showHideDiv);\n"); sb.append("\tvar text = document.getElementById(switchTextDiv);\n"); sb.append("\tif(tog.style.display == \"block\") {\n"); sb.append(" \ttog.style.display = \"none\";\n"); sb.append("\t\ttext.innerHTML = \"+\";\n"); sb.append(" \t}\n"); sb.append("\telse {\n"); sb.append("\t\ttog.style.display = \"block\";\n"); sb.append("\t\ttext.innerHTML = \"-\";\n"); sb.append("\t}\n"); sb.append("}\n"); sb.append("</script>"); <START> <END> sb.append(" <a class=\"linkDiv\" id=\""); sb.append("p4title" + id); sb.append("\" href=\"javascript:toggle('"); sb.append("p4content" + id); sb.append("','"); sb.append("p4title" + id); sb.append("');\">"); sb.append("+"); sb.append("</a>"); sb.append("</div>"); sb.append("<div class=\"contentDiv\">"); sb.append("<div id=\""); sb.append("p4content" + id); sb.append("\" style=\"display: none;\">"); text.addMarkup(text.length() - 1, sb.toString()); text.hide(text.length() - 1, text.length()); id++; depth++; }</code><technical_language>necessary move JS resources/org/jenkinsci/plugins/p4/console/P4ConsoleNote/script.js generated html</technical_language>

Target:
private void push(MarkupText text) { text.hide(0, COMMAND.length()); String head = "<div class=\"titleDiv\">"; text.addMarkup(COMMAND.length(), head); StringBuffer sb = new StringBuffer(); sb.append(" <a class=\"linkDiv\" id=\""); sb.append("p4title" + id); sb.append("\" href=\"javascript:toggle('"); sb.append("p4content" + id); sb.append("','"); sb.append("p4title" + id); sb.append("');\">"); sb.append("+"); sb.append("</a>"); sb.append("</div>"); sb.append("<div class=\"contentDiv\">"); sb.append("<div id=\""); sb.append("p4content" + id); sb.append("\" style=\"display: none;\">"); text.addMarkup(text.length() - 1, sb.toString()); text.hide(text.length() - 1, text.length()); id++; depth++; }
Source:
<code>public void setAlgorithm(final String alg) { if (StringUtils.isNotBlank(alg)) { if (ALGORITHM_BLACKLIST_SET.contains(alg)) { <START> LOGGER.warn("Configured Jasypt algorithm doesn't work for decryption due to Jasypt bug", alg); <END> } LOGGER.debug("Configured Jasypt algorithm [{}]", alg); jasyptInstance.setAlgorithm(alg); } }</code><technical_language>I error out here. A blacklisted algorithm allowed for use</technical_language>

Target:
public void setAlgorithm(final String alg) { if (StringUtils.isNotBlank(alg)) { if (ALGORITHM_BLACKLIST_SET.contains(alg)) { throw new IllegalArgumentException(String.format("Configured Jasypt algorithm [%s] doesn't work for decryption due to Jasypt bug", alg)); } LOGGER.debug("Configured Jasypt algorithm [{}]", alg); jasyptInstance.setAlgorithm(alg); } }
Source:
<code>public void playFile(String fileName, String sink) throws AudioException { <START> File file = new File(System.getProperty(ConfigConstants.CONFIG_DIR_PROG_ARGUMENT) + File.separator + SOUND_DIR <END> + File.separator + fileName); FileAudioStream is = new FileAudioStream(file); play(is, sink); }</code><technical_language>I prefer ConfigConstants.getConfigFolder()</technical_language>

Target:
public void playFile(String fileName, String sink) throws AudioException { File file = new File( ConfigConstants.getConfigFolder() + File.separator + SOUND_DIR + File.separator + fileName); FileAudioStream is = new FileAudioStream(file); play(is, sink); }
Source:
<code>public static void createDir(File dir) throws IOException { if (dir.isFile()) { <START> throw new IOException(dir.getAbsolutePath() + " exists but is not a is not a directory."); <END> } if (!dir.exists() && !dir.mkdir()) { throw new IOException("Could not create directory at: " + dir.getAbsolutePath()); } }</code><technical_language>Remove ~is a~</technical_language>

Target:
public static void createDir(File dir) throws IOException { if (dir.isFile()) { throw new IOException(dir.getAbsolutePath() + " exists, but is not a directory."); } if (!dir.exists() && !dir.mkdir()) { throw new IOException("Cannot create directory at: " + dir.getAbsolutePath()); } }
Source:
<code>protected Object doReceive() { Assert.state(this.running.get(), () -> getComponentName() + " is not running"); <START> AbstractFileInfo<F> file = poll(); <END> while (file != null) { if (this.filter != null && this.filter.supportsSingleFileFiltering() && !this.filter.accept(file.getFileInfo())) { file = poll(); } else { try { String remotePath = remotePath(file); Session<?> session = this.remoteFileTemplate.getSession(); try { return getMessageBuilderFactory() .withPayload(session.readRaw(remotePath)) .setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session) .setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory()) .setHeader(FileHeaders.REMOTE_FILE, file.getFilename()) .setHeader(FileHeaders.REMOTE_FILE_INFO, this.fileInfoJson ? file.toJson() : file); } catch (IOException e) { throw new UncheckedIOException("IOException when retrieving " + remotePath, e); } } catch (RuntimeException e) { resetFilterIfNecessary(file); throw e; } } } return null; }</code><technical_language>I this is wrong for this component contract. constantly poll source null. point of receive() is get file nothing</technical_language>

Target:
protected Object doReceive() { Assert.state(this.running.get(), () -> getComponentName() + " is not running"); AbstractFileInfo<F> file = poll(); while (file != null) { if (this.filter != null && this.filter.supportsSingleFileFiltering() && !this.filter.accept(file.getFileInfo())) { if (this.toBeReceived.size() > 0) { file = poll(); } else { file = null; } } if (file != null) { try { String remotePath = remotePath(file); Session<?> session = this.remoteFileTemplate.getSession(); try { return getMessageBuilderFactory() .withPayload(session.readRaw(remotePath)) .setHeader(IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE, session) .setHeader(FileHeaders.REMOTE_DIRECTORY, file.getRemoteDirectory()) .setHeader(FileHeaders.REMOTE_FILE, file.getFilename()) .setHeader(FileHeaders.REMOTE_FILE_INFO, this.fileInfoJson ? file.toJson() : file); } catch (IOException e) { throw new UncheckedIOException("IOException when retrieving " + remotePath, e); } } catch (RuntimeException e) { resetFilterIfNecessary(file); throw e; } } } return null; }
Source:
<code>public JSONObject listRunsDataTable(HttpSession session, JSONObject json) { try { JSONObject j = new JSONObject(); JSONArray jsonArray = new JSONArray(); for (Run run : requestManager.listAllRuns()) { JSONArray inner = new JSONArray(); inner.add(TableHelper.hyperLinkify("/miso/run/" + run.getId(), run.getName())); inner.add(TableHelper.hyperLinkify("/miso/run/" + run.getId(), run.getAlias())); inner.add((run.getHealth() != null ? run.getHealth().getKey() : "")); inner.add((run.getStartDate() != null ? LimsUtils.getDateAsString(run.getStartDate()) : "")); <START> inner.add((run.getCompletionDate() != null && run.getCompletionDate() != null <END> ? LimsUtils.getDateAsString(run.getCompletionDate()) : "")); inner.add((run.getSequencerReference().getPlatform().getPlatformType() != null ? run.getSequencerReference().getPlatform().getPlatformType().getKey() : "")); jsonArray.add(inner); } j.put("runsArray", jsonArray); return j; } catch (IOException e) { log.debug("Failed", e); return JSONUtils.SimpleJSONError("Failed: " + e.getMessage()); } }</code><technical_language>checking condition</technical_language>

Target:
public JSONObject listRunsDataTable(HttpSession session, JSONObject json) { try { JSONObject j = new JSONObject(); JSONArray jsonArray = new JSONArray(); for (Run run : requestManager.listAllRuns()) { JSONArray inner = new JSONArray(); inner.add(TableHelper.hyperLinkify("/miso/run/" + run.getId(), run.getName())); inner.add(TableHelper.hyperLinkify("/miso/run/" + run.getId(), run.getAlias())); inner.add((run.getHealth() != null ? run.getHealth().getKey() : "")); inner.add((run.getStartDate() != null ? LimsUtils.getDateAsString(run.getStartDate()) : "")); inner.add((run.getCompletionDate() != null ? LimsUtils.getDateAsString(run.getCompletionDate()) : "")); inner.add((run.getSequencerReference().getPlatform().getPlatformType() != null ? run.getSequencerReference().getPlatform().getPlatformType().getKey() : "")); jsonArray.add(inner); } j.put("runsArray", jsonArray); return j; } catch (IOException e) { log.debug("Failed", e); return JSONUtils.SimpleJSONError("Failed: " + e.getMessage()); } }
Source:
<code>public static void smite(final Player player, final String reason) { TFM_Util.bcastMsg(String.format("%s has been a naughty, naughty boy. \n" + ChatColor.YELLOW + "Reason: %s", player.getName(), reason), ChatColor.RED); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); <START> player.getInventory().clear(); <END> final Location targetPos = player.getLocation(); final World world = player.getWorld(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); world.strikeLightning(strike_pos); } } player.setHealth(0.0); }</code><technical_language>clearing inventory? I dont remember a thing..</technical_language>

Target:
public static void smite(final Player player, final String reason) { if (reason == null) { TFM_Util.bcastMsg(player.getName() + " has been naughty, naughty boy.", ChatColor.RED); } else { TFM_Util.bcastMsg(player.getName() + " has been a naughty, naughty boy.\n" + ChatColor.YELLOW + "Reason: " + reason, ChatColor.RED); } player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); final World world = player.getWorld(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); world.strikeLightning(strike_pos); } } player.setHealth(0.0); }
Source:
<code>private List<InternalHiveSplit> getVirtuallyBucketedSplits(Path path, FileSystem fileSystem, InternalHiveSplitFactory splitFactory, int bucketCount) { List<InternalHiveSplit> splitList = new ArrayList<>(); try { <START> new HiveFileIterator(path, fileSystem, directoryLister, namenodeStats, FAIL).forEachRemaining(file -> splitFactory.createInternalHiveSplit(file, getVirtualBucket(bucketCount, file.getPath())) <END> .ifPresent(splitList::add)); } catch (NestedDirectoryNotAllowedException e) { throw new PrestoException( HIVE_INVALID_BUCKET_FILES, format("Hive table '%s' is corrupt. Found sub-directory in bucket directory for partition: %s", new SchemaTableName(table.getDatabaseName(), table.getTableName()), splitFactory.getPartitionName())); } return splitList; }</code><technical_language>This wrapping is hard read ifPresent() is part of lambda above. write java new HiveFileIterator(path, fileSystem, directoryLister, namenodeStats, FAIL).forEachRemaining(file -> splitFactory.createInternalHiveSplit(file, getVirtualBucket(bucketCount, file.getPath())) .ifPresent(splitList::add));</technical_language>

Target:
private List<InternalHiveSplit> getVirtuallyBucketedSplits(Path path, FileSystem fileSystem, InternalHiveSplitFactory splitFactory, int bucketCount) { return stream(new HiveFileIterator(path, fileSystem, directoryLister, namenodeStats, RECURSE)) .map(file -> splitFactory.createInternalHiveSplit(file, getVirtualBucket(bucketCount, file.getPath()))) .filter(Optional::isPresent) .map(Optional::get) .collect(toImmutableList()); }
Source:
<code>private List<ContentProposal> getEmptyExpressionProposals(String context) { List<ContentProposal> proposals = Lists.newArrayList(); final List<IProposalProvider> proposalProviders = ProposalProviderRegistry.getAllProviders(); for (IProposalProvider provider : proposalProviders) { ContentProposal proposal = provider.getNewEmtpyExpression(); <START> if (context == null || proposal.getProposal().startsWith(context)) { <END> proposals.add(proposal); } } return proposals; }</code><technical_language>StringUtil.isEmpty</technical_language>

Target:
private List<ContentProposal> getEmptyExpressionProposals(String context) { List<ContentProposal> proposals = Lists.newArrayList(); final List<IProposalProvider> proposalProviders = ProposalProviderRegistry.getAllProviders(); for (IProposalProvider provider : proposalProviders) { ContentProposal emptyExpression = provider.getNewEmtpyExpression(); if (StringUtil.isEmpty(context) || ContentContextHelper.matchEmptyExpression(context, emptyExpression)) { proposals.add(emptyExpression); } } return proposals; }
Source:
<code>Annotation annotate(File file, String revision) throws IOException { <START> ArrayList<String> argv = new ArrayList<>(); <END> ensureCommand(CMD_BLAME_PROPERTY_KEY, CMD_BLAME_FALLBACK); argv.add(RepoCommand); if (revision != null) { argv.add("-r"); argv.add(revision); } argv.add(file.getName()); Executor executor = new Executor(argv, file.getParentFile(), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); RCSAnnotationParser annotator = new RCSAnnotationParser(file); executor.exec(true, annotator); return annotator.getAnnotation(); }</code><technical_language>List interface</technical_language>

Target:
Annotation annotate(File file, String revision) throws IOException { List<String> argv = new ArrayList<>(); ensureCommand(CMD_BLAME_PROPERTY_KEY, CMD_BLAME_FALLBACK); argv.add(RepoCommand); if (revision != null) { argv.add("-r"); argv.add(revision); } argv.add(file.getName()); Executor executor = new Executor(argv, file.getParentFile(), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); RCSAnnotationParser annotator = new RCSAnnotationParser(file); executor.exec(true, annotator); return annotator.getAnnotation(); }
Source:
<code><START> static public <M extends Externalizable> KafkaLogAppender<M> open(String topic, String name, Properties producerProperties, Properties consumerProperties) { <END> return new KafkaLogAppender<>(topic, name, producerProperties, consumerProperties); }</code><technical_language>Correct keyword order</technical_language>

Target:
public static <M extends Externalizable> KafkaLogAppender<M> open(String topic, String name, Properties producerProperties, Properties consumerProperties) { return new KafkaLogAppender<>(topic, name, producerProperties, consumerProperties); }
Source:
<code><START> @Test public void getWithQueryNameParamPrimitiveArray() { <END> class Example { @GET("/foo/bar/") Call<ResponseBody> method(@QueryName int[] keys) { return null; } } int[] values = { 1, 2, 3 }; Request request = buildRequest(Example.class, new Object[] { values }); assertThat(request.method()).isEqualTo("GET"); assertThat(request.headers().size()).isZero(); assertThat(request.url().toString()).isEqualTo("<LINK_0>"); assertThat(request.body()).isNull(); }</code><technical_language>test a repeated key? Work</technical_language>

Target:
@Test public void getWithQueryNameParamPrimitiveArray() { class Example { @GET("/foo/bar/") Call<ResponseBody> method(@QueryName int[] keys) { return null; } } int[] values = { 1, 2, 3, 1 }; Request request = buildRequest(Example.class, new Object[] { values }); assertThat(request.method()).isEqualTo("GET"); assertThat(request.headers().size()).isZero(); assertThat(request.url().toString()).isEqualTo("<LINK_0>&1"); assertThat(request.body()).isNull(); }
Source:
<code>public void testGetViewName() throws Exception { <START> String uri = "file:/ END> String viewName = "Browse_items_Product"; ViewValidator viewValidator = new ViewValidator(); Method getViewNameMethod = viewValidator.getClass().getDeclaredMethod("getViewName", String.class); getViewNameMethod.setAccessible(true); String name = (String) getViewNameMethod.invoke(viewValidator, uri); assertEquals(viewName, name); }</code><technical_language>Do support other kinds of view names? as: Browse_items_Product$AndFamily_0.1.item</technical_language>

Target:
public void testGetViewName() throws Exception { String uri = "file:/ String viewName = "Browse_items_Product"; ViewValidator viewValidator = new ViewValidator(); Method getViewNameMethod = viewValidator.getClass().getDeclaredMethod("getViewName", String.class); getViewNameMethod.setAccessible(true); String name = (String) getViewNameMethod.invoke(viewValidator, uri); assertEquals(viewName, name); uri = "file:/ viewName = "Browse_items_Product#Stores"; name = (String) getViewNameMethod.invoke(viewValidator, uri); assertEquals(viewName, name); }
Source:
<code>public RouteTarget getRouteTarget(Class<? extends Component> target, RouteParameters parameters) { return iterateUrlTemplates(target, urlTemplate -> { try { return getRouteModel().getRouteTarget(urlTemplate, parameters); <START> } catch (IllegalArgumentException e) { <END> return null; } }); }</code><technical_language>![CRITICAL](<LINK_1> 'Severity: CRITICAL') log rethrow this exception. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public RouteTarget getRouteTarget(Class<? extends Component> target, RouteParameters parameters) { return iterateTemplates(target, template -> { try { return getRouteModel().getRouteTarget(template, parameters); } catch (IllegalArgumentException e) { return null; } }); }
Source:
<code>public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) { <START> log.debug("channel closed - exception", cause); <END> if (null != session && session.getSessionListener() != null) { ((SessionListener) session.getSessionListener()).onDisconnect(session); } }</code><technical_language>Add if debug</technical_language>

Target:
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) { if (log.isDebugEnabled()) { log.debug("channel closed - exception", cause); } if (null != session && session.getSessionListener() != null) { ((SessionListener) session.getSessionListener()).onDisconnect(session); } }
Source:
<code>static CsvParser createParserFor(CsvFileSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, annotation.lineSeparator(), DOUBLE_QUOTE, annotation.emptyValue(), <START> annotation.maxCharsPerColumn(), false); <END> }</code><technical_language>suggestion annotation.maxCharsPerColumn(), annotation.ignoreTrailingAndLeadingWhitespace());</technical_language>

Target:
static CsvParser createParserFor(CsvFileSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, annotation.lineSeparator(), DOUBLE_QUOTE, annotation.emptyValue(), annotation.maxCharsPerColumn(), annotation.ignoreTrailingAndLeadingWhitespace()); }
Source:
<code>private void createProfilingIndexes() throws DbException { List<String> columnNames = MyriaConstants.PROFILING_SCHEMA.getColumnNames(); ImmutableList.Builder<List<IndexRef>> index = ImmutableList.builder(); index.add(ImmutableList.of(IndexRef.of(columnNames.indexOf("queryId")), IndexRef.of(columnNames .indexOf("fragmentId")))); index.add(ImmutableList.of(IndexRef.of(columnNames.indexOf("opName")))); try { accessMethod.createIndexes(MyriaConstants.PROFILING_RELATION, MyriaConstants.PROFILING_SCHEMA, index.build()); } catch (DbException e) { <START> LOGGER.info(String.format("Tried to create index for profiling logs: %s", e.getMessage())); <END> } }</code><technical_language>Gotcha. want create table worker is run time, mechanism for that</technical_language>

Target:
private void createProfilingIndexes() throws DbException { List<String> columnNames = MyriaConstants.PROFILING_SCHEMA.getColumnNames(); ImmutableList.Builder<List<IndexRef>> index = ImmutableList.builder(); index.add(ImmutableList.of(IndexRef.of(columnNames.indexOf("queryId")), IndexRef.of(columnNames .indexOf("fragmentId")))); index.add(ImmutableList.of(IndexRef.of(columnNames.indexOf("opName")))); try { accessMethod.createIndexes(MyriaConstants.PROFILING_RELATION, MyriaConstants.PROFILING_SCHEMA, index.build()); } catch (DbException e) { LOGGER.error("Couldn't create index for profiling logs:", e); } }
Source:
<code>public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent) throws CommitValidationException { final RevCommit commit = receiveEvent.commit; final AbbreviatedObjectId id = commit.abbreviate(7); List<CommitValidationMessage> messages = new ArrayList<CommitValidationMessage>(); if (this.maxSubjectLength < commit.getShortMessage().length()) { onLineTooLong(id, messages, new String("commit subject >" + this.maxSubjectLength + " characters; use shorter first paragraph")); } int longLineCnt = 0, nonEmptyCnt = 0; for (String line : commit.getFullMessage().split("\n")) { if (!line.trim().isEmpty()) { nonEmptyCnt++; } if (this.maxLineLength < line.length()) { longLineCnt++; } } int <START> percentLongLines = <END> (longLineCnt * 100) / nonEmptyCnt; if (0 < longLineCnt && ((longLinesThreshold < 1 && longLineCnt > 0) || (percentLongLines > longLinesThreshold))) { onLineTooLong(id, messages, new String("too many commit message lines longer than " + this.maxLineLength + " characters; manually wrap lines")); } return messages; }</code><technical_language>test boiled to: if (longLineCnt > (longLinesThreshold * nonEmptyCnt) / 100) { This work threshold is 0</technical_language>

Target:
public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent) throws CommitValidationException { final RevCommit commit = receiveEvent.commit; final AbbreviatedObjectId id = commit.abbreviate(7); List<CommitValidationMessage> messages = new ArrayList<CommitValidationMessage>(); if (this.maxSubjectLength < commit.getShortMessage().length()) { onLineTooLong(id, messages, new String("commit subject >" + this.maxSubjectLength + " characters; use shorter first paragraph")); } int longLineCnt = 0, nonEmptyCnt = 0; for (String line : commit.getFullMessage().split("\n")) { if (!line.trim().isEmpty()) { nonEmptyCnt++; } if (this.maxLineLength < line.length()) { longLineCnt++; } } if (longLineCnt > (longLinesThreshold * nonEmptyCnt) / 100) { onLineTooLong(id, messages, new String("too many commit message lines longer than " + this.maxLineLength + " characters; manually wrap lines")); } return messages; }
Source:
<code>private void onDeactivateSnapshot() { if (getConfirmWindow() == null) { return; } ConfirmationModel model = (ConfirmationModel) getConfirmWindow(); if (model.getProgress() != null) { return; } if (getSelectedItems().size() != 1) { return; } model.startProgress(null); Frontend.getInstance().runAction(VdcActionType.DeactivateGlusterVolumeSnapshot, new GlusterVolumeSnapshotActionParameters(getEntity().getId(), ((GlusterVolumeSnapshotEntity) getSelectedItem()).getSnapshotName(), true), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { ConfirmationModel localModel = (ConfirmationModel) getConfirmWindow(); localModel.stopProgress(); <START> setConfirmWindow(null); <END> } }); }</code><technical_language>a thought. please extract out common portions of on<Actions> I gain code size reduction. for window displaying functions also</technical_language>

Target:
private void onDeactivateSnapshot() { runAction(VdcActionType.DeactivateGlusterVolumeSnapshot, new GlusterVolumeSnapshotActionParameters(getEntity().getId(), ((GlusterVolumeSnapshotEntity) getSelectedItem()).getSnapshotName(), true)); }
Source:
<code>public int hashCode() { <START> return Objects.hash(this.getClass().getName(), sourceVariableDescriptor); <END> }</code><technical_language>Change breaks equals contract, equality account subclass names this new hashCode does. avoid that, Objects.hash(AnchorVariableDemand.class.getName(), ...)</technical_language>

Target:
public int hashCode() { return Objects.hash(AnchorVariableDemand.class.getName(), sourceVariableDescriptor); }
Source:
<code>public boolean equals( Object other ) { <START> return false; <END> }</code><technical_language>replace return this == other;</technical_language>

Target:
public boolean equals( Object other ) { return this == other; }
Source:
<code>public boolean isGetRepositoryCall(PsiElement e) { return isCallTo(e, new Method[] { <START> getInterfaceMethod(e.getProject(), "\\Doctrine\\Common\\Persistence\\ManagerRegistry", "getRepository"), <END> }); }</code><technical_language>support \\Doctrine\\Common\\Persistence\\ObjectManager::getRepository for people repository EntityManager</technical_language>

Target:
public boolean isGetRepositoryCall(PsiElement e) { return isCallTo(e, new Method[] { getInterfaceMethod(e.getProject(), "\\Doctrine\\Common\\Persistence\\ManagerRegistry", "getRepository"), getInterfaceMethod(e.getProject(), "\\Doctrine\\Common\\Persistence\\ObjectManager", "getRepository"), }); }