auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void operateServerState(String menuItem, final ServerState resultState) { log.debug("Operate server's state: '" + menuItem + "'"); select(); AbstractWaitCondition condition = new AbstractWaitCondition() { @Override public boolean test() { return resultState.equals(getLabel().getState()); } @Override public String description() { return "server's state is: " + resultState.getText(); } }; new ContextMenu(menuItem).select(); new WaitUntil(new JobIsRunning(), TIMEOUT); if (resultState == ServerState.STARTING || resultState == ServerState.STARTED) { confirmSSLCertificateDialog(); } new WaitUntil(condition, TIMEOUT); new WaitWhile(new JobIsRunning(), TIMEOUT); new WaitUntil(condition, TIMEOUT); log.debug("Operate server's state finished, the result server's state is: '" + getLabel().getState() + "'"); }

Target:
protected void operateServerState(String menuItem, final ServerState resultState) { log.debug("Operate server's state: '" + menuItem + "'"); select(); new ContextMenu(menuItem).select(); new WaitUntil(new JobIsRunning(), TIMEOUT); if (resultState == ServerState.STARTING || resultState == ServerState.STARTED) { confirmSSLCertificateDialog(); } new WaitUntil(new ServerHasState(this, resultState), TIMEOUT); new WaitWhile(new JobIsRunning(), TIMEOUT); log.debug("Operate server's state finished, the result server's state is: '" + getLabel().getState() + "'"); }
Source:
public Xid[] getXidsToRecoverForParentNode(boolean recoverInFlight, String parentNodeName, int recoveryFlags) throws XAException { final Set<Xid> xidsToRecover = new HashSet<Xid>(); if (recoverInFlight) { final TransactionImporter transactionImporter = SubordinationManager.getTransactionImporter(); if (transactionImporter instanceof com.arjuna.ats.internal.jta.transaction.jts.jca.TransactionImporterImple) { final Set<Xid> inFlightXids = ((com.arjuna.ats.internal.jta.transaction.jts.jca.TransactionImporterImple) transactionImporter).getInflightXids(parentNodeName); if (inFlightXids != null) { xidsToRecover.addAll(inFlightXids); } } } final javax.resource.spi.XATerminator xaTerminator = SubordinationManager.getXATerminator(); if (xaTerminator instanceof com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple) { final Xid[] inDoubtTransactions = ((com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple) xaTerminator).doRecover(null, parentNodeName); if (inDoubtTransactions != null) { xidsToRecover.addAll(Arrays.asList(inDoubtTransactions)); } } else { final Xid[] inDoubtTransactions = xaTerminator.recover(recoveryFlags); if (inDoubtTransactions != null) { xidsToRecover.addAll(Arrays.asList(inDoubtTransactions)); } } return xidsToRecover.toArray(NO_XIDS); }

Target:
public Xid[] getXidsToRecoverForParentNode(boolean recoverInFlight, String parentNodeName, int recoveryFlags) throws XAException { final Set<Xid> xidsToRecover = new HashSet<Xid>(); if (recoverInFlight) { final TransactionImporter transactionImporter = SubordinationManager.getTransactionImporter(); if (transactionImporter instanceof TransactionImporterImple) { throw new UnsupportedOperationException(jtaxLogger.i18NLogger.get_not_supported()); } } final javax.resource.spi.XATerminator xaTerminator = SubordinationManager.getXATerminator(); if (xaTerminator instanceof XATerminatorImple) { throw new UnsupportedOperationException(jtaxLogger.i18NLogger.get_not_supported()); } else { final Xid[] inDoubtTransactions = xaTerminator.recover(recoveryFlags); if (inDoubtTransactions != null) { xidsToRecover.addAll(Arrays.asList(inDoubtTransactions)); } } return xidsToRecover.toArray(NO_XIDS); }
Source:
public MongoFeedStatisticsStore build() { return new MongoFeedStatisticsStore(mongo, taskStore, clock, destinationType); }

Target:
public MongoFeedStatisticsStore build() { return new MongoFeedStatisticsStore(this); }
Source:
public void commit_step_does_not_throw_reached_max_size_exception_when_two_phase() { String mapName = "map"; long maxWbqCapacity = 10; int keySpace = 100; Config config = getConfig(mapName, maxWbqCapacity); HazelcastInstance node = createHazelcastInstance(config); TransactionContext context = newTransactionContext(node, TWO_PHASE); context.beginTransaction(); TransactionalMap txMap = context.getMap(mapName); for (int i = 0; i < keySpace; i++) { txMap.remove("item-" + i); } try { context.commitTransaction(); } catch (TransactionException e) { context.rollbackTransaction(); } sleepSeconds(10); assertEquals(0, node.getMap(mapName).size()); assertWriteBehindQueuesEmpty(mapName, Collections.singletonList(node)); assertEquals(0, getTotalNumOfTxnReservedCapacity(mapName, node)); assertEquals(0, getNodeWideUsedCapacity(node)); }

Target:
public void commit_step_does_not_throw_reached_max_size_exception_when_two_phase() { String mapName = "map"; long maxWbqCapacity = 10; int keySpace = 10; Config config = getConfig(mapName, maxWbqCapacity); HazelcastInstance node = createHazelcastInstance(config); TransactionContext context = newTransactionContext(node, TWO_PHASE); context.beginTransaction(); TransactionalMap txMap = context.getMap(mapName); for (int i = 0; i < keySpace; i++) { txMap.remove("item-" + i); } try { context.commitTransaction(); } catch (TransactionException e) { fail("no txn exception is expected here..."); } assertEquals(0, node.getMap(mapName).size()); assertWriteBehindQueuesEmpty(mapName, Collections.singletonList(node)); assertEquals(0, getTotalNumOfTxnReservedCapacity(mapName, node)); assertEquals(0, getNodeWideUsedCapacity(node)); }
Source:
public void testGetChildrenList_Normal() throws IOException { GetChildrenListRequest getChildrenListRequest = new GetChildrenListRequest(); getChildrenListRequest.setPathList(Arrays.asList("/testPath", "/testPath")); 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"))); }

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:
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(); if (node == null) 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; } }); }

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:
protected boolean set(Entity entity, Boolean value) { entity.getNBTTagCompound().setBoolean("NoGravity", !value); return true; }

Target:
protected boolean set(Entity entity, Boolean value) { entity.setNoGravity(!value); return true; }
Source:
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(); } 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(); }

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:
protected FoursquareProfile extractUserProfile(String body) { FoursquareProfile profile = new FoursquareProfile(); JsonNode json = JsonHelper.getFirstNode(body); if (json == null) { } 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; }

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:
public void actionPerformed(ActionEvent e) { if(e.getSource() == okButton){ System.out.println(certControll); if (certControll != null) { certControll.setAddToKeystore(true); } this.dispose(); }else if(e.getSource() == cancelButton){ if (certControll != null) { certControll.setAddToKeystore(false); } this.dispose(); } }

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:
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(); } jobWorkerHealth.setHostname(hostname); 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); }

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:
private void onAddExpenseResult(Intent data) { ExpenseClaim claim = (ExpenseClaim)data.getSerializableExtra(ExpenseClaimAddActivity.EXTRA_EXPENSE_CLAIM); listModel.add(claim); if(checkFilteredTags()) { setListAdapter(new ExpenseClaimArrayAdapter(this, filteredListModel.getItems())); } }

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:
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.debug("Something went wrong in Natura plugin MineFactoryReloaded.", t); } }

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:
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); } log.info("logged in"); }

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:
public void testThreadPools() { assertEquals( 200L, registry.getSampleValue( "jvm_threads", new String[]{"type"}, 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); }

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:
protected IndentLevel getIndentImpl() { IndentLevel result; if (getLineStart(getMainAst()) == getMainAst().getColumnNo()) { result = super.getIndentImpl(); if (getMainAst().getParent().getParent().getText().equals(ASSIGNMENT)) { result = new IndentLevel(result, getIndentCheck().getLineWrappingIndentation()); } } else { result = new IndentLevel(getLineStart(getMainAst())); } return result; }

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:
public int updateDownloading(String filePath, boolean downloading) { ContentValues cv = new ContentValues(); cv.put(ProviderTableMeta.FILE_DOWNLOADING, downloading); int result = getContentResolver().update(ProviderTableMeta.CONTENT_URI, cv, ProviderTableMeta.FILE_PATH + "=? AND "+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?", new String[] { filePath, mAccount.name }); Log_OC.d(TAG, "updateDownloading, result=" + String.valueOf(result)); return result; }

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:
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 (dDiagramElement.getSemanticElements() != null) { for (EObject semanticElement : dDiagramElement.getSemanticElements()) { broker.removeNotificationListener(semanticElement, this); } } } } graphicalEditPart = null; }

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:
public Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName) { return metadata.getSystemTable(((FullConnectorSession) session).getSession(), new QualifiedObjectName(catalogName, tableName.getSchemaName(), tableName.getTableName())); }

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

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:
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>"); 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++; }

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:
public void setAlgorithm(final String alg) { if (StringUtils.isNotBlank(alg)) { if (ALGORITHM_BLACKLIST_SET.contains(alg)) { LOGGER.warn("Configured Jasypt algorithm doesn't work for decryption due to Jasypt bug", alg); } LOGGER.debug("Configured Jasypt algorithm [{}]", alg); jasyptInstance.setAlgorithm(alg); } }

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:
public void playFile(String fileName, String sink) throws AudioException { File file = new File(System.getProperty(ConfigConstants.CONFIG_DIR_PROG_ARGUMENT) + File.separator + SOUND_DIR + File.separator + fileName); FileAudioStream is = new FileAudioStream(file); play(is, sink); }

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:
public static void createDir(File dir) throws IOException { if (dir.isFile()) { throw new IOException(dir.getAbsolutePath() + " exists but is not a is not a directory."); } if (!dir.exists() && !dir.mkdir()) { throw new IOException("Could not create directory at: " + dir.getAbsolutePath()); } }

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

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

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

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:
private List<InternalHiveSplit> getVirtuallyBucketedSplits(Path path, FileSystem fileSystem, InternalHiveSplitFactory splitFactory, int bucketCount) { List<InternalHiveSplit> splitList = new ArrayList<>(); try { new HiveFileIterator(path, fileSystem, directoryLister, namenodeStats, FAIL).forEachRemaining(file -> splitFactory.createInternalHiveSplit(file, getVirtualBucket(bucketCount, file.getPath())) .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; }

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:
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(); if (context == null || proposal.getProposal().startsWith(context)) { proposals.add(proposal); } } return proposals; }

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:
Annotation annotate(File file, String revision) throws IOException { ArrayList<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(); }

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:
static public <M extends Externalizable> KafkaLogAppender<M> open(String topic, String name, Properties producerProperties, Properties consumerProperties) { return new KafkaLogAppender<>(topic, name, producerProperties, consumerProperties); }

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:
@Test public void getWithQueryNameParamPrimitiveArray() { 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(); }

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

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:
public RouteTarget getRouteTarget(Class<? extends Component> target, RouteParameters parameters) { return iterateUrlTemplates(target, urlTemplate -> { try { return getRouteModel().getRouteTarget(urlTemplate, parameters); } catch (IllegalArgumentException e) { return null; } }); }

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:
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) { log.debug("channel closed - exception", cause); if (null != session && session.getSessionListener() != null) { ((SessionListener) session.getSessionListener()).onDisconnect(session); } }

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:
static CsvParser createParserFor(CsvFileSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, annotation.lineSeparator(), DOUBLE_QUOTE, annotation.emptyValue(), annotation.maxCharsPerColumn(), false); }

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:
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.info(String.format("Tried to create index for profiling logs: %s", e.getMessage())); } }

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:
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 percentLongLines = (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; }

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

Target:
private void onDeactivateSnapshot() { runAction(VdcActionType.DeactivateGlusterVolumeSnapshot, new GlusterVolumeSnapshotActionParameters(getEntity().getId(), ((GlusterVolumeSnapshotEntity) getSelectedItem()).getSnapshotName(), true)); }
Source:
public int hashCode() { return Objects.hash(this.getClass().getName(), sourceVariableDescriptor); }

Target:
public int hashCode() { return Objects.hash(AnchorVariableDemand.class.getName(), sourceVariableDescriptor); }
Source:
public boolean equals( Object other ) { return false; }

Target:
public boolean equals( Object other ) { return this == other; }