auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public JobScheduler(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob, final JobConfiguration jobConfig, final TracingConfiguration<?> tracingConfig) { this.regCenter = regCenter; elasticJobType = null; final Collection<ElasticJobListener> elasticJobListeners = jobConfig.getJobListenerTypes().stream() .map(type -> ElasticJobListenerFactory.getListener(type)).collect(Collectors.toList()); setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), elasticJobListeners); schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName()); jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), elasticJobListeners, tracingConfig); jobExecutor = null == elasticJob ? new ElasticJobExecutor(elasticJobType, jobConfig, jobFacade) : new ElasticJobExecutor(elasticJob, jobConfig, jobFacade); String jobClassName = JobClassNameProviderFactory.getProvider().getJobClassName(elasticJob); this.jobConfig = setUpFacade.setUpJobConfiguration(jobClassName, jobConfig); setGuaranteeServiceForElasticJobListeners(regCenter, elasticJobListeners); jobScheduleController = createJobScheduleController(); }

Target:
public JobScheduler(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob, final JobConfiguration jobConfig, final TracingConfiguration<?> tracingConfig) { this.regCenter = regCenter; elasticJobType = null; final Collection<ElasticJobListener> elasticJobListeners = jobConfig.getJobListenerTypes().stream() .map(ElasticJobListenerFactory::getListener).collect(Collectors.toList()); setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), elasticJobListeners); schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName()); jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), elasticJobListeners, tracingConfig); jobExecutor = null == elasticJob ? new ElasticJobExecutor(elasticJobType, jobConfig, jobFacade) : new ElasticJobExecutor(elasticJob, jobConfig, jobFacade); String jobClassName = JobClassNameProviderFactory.getProvider().getJobClassName(elasticJob); this.jobConfig = setUpFacade.setUpJobConfiguration(jobClassName, jobConfig); setGuaranteeServiceForElasticJobListeners(regCenter, elasticJobListeners); jobScheduleController = createJobScheduleController(); }
Source:
public boolean process(final I_ESR_ImportLine line, final String message) { super.process(line, message); Check.assumeNotNull(line.getESR_Payment_Action(), "@" + ESRConstants.ERR_ESR_LINE_WITH_NO_PAYMENT_ACTION + "@"); final I_C_Invoice invoice = line.getC_Invoice(); if (invoice == null) { return true; } final PaymentId esrImportLinePaymentId = PaymentId.ofRepoIdOrNull(line.getC_Payment_ID()); final I_C_Payment payment = esrImportLinePaymentId == null ? null : paymentDAO.getById(esrImportLinePaymentId); final String trxName = trxManager.getThreadInheritedTrxName(OnTrxMissingPolicy.ReturnTrxNone); Check.assumeNotNull(payment, "Null payment for line {}", line.getESR_ImportLine_ID()); Check.errorIf(payment.getOverUnderAmt().signum() > 0, "Exces payment for line {}. Can't discount this", line.getESR_ImportLine_ID()); final Amount discount = invoiceDAO.retrieveOpenAmt(InvoiceId.ofRepoId(invoice.getC_Invoice_ID())); trxManager.run(trxName, new TrxRunnable() { @Override public void run(String trxName) throws Exception { InterfaceWrapperHelper.refresh(invoice, trxName); invoiceBL.discountInvoice(invoice, discount.getAsBigDecimal(), message); } }); return true; }

Target:
public boolean process(final I_ESR_ImportLine line, final String message) { super.process(line, message); Check.assumeNotNull(line.getESR_Payment_Action(), "@" + ESRConstants.ERR_ESR_LINE_WITH_NO_PAYMENT_ACTION + "@"); final I_C_Invoice invoice = line.getC_Invoice(); if (invoice == null) { return true; } final PaymentId esrImportLinePaymentId = PaymentId.ofRepoIdOrNull(line.getC_Payment_ID()); final I_C_Payment payment = esrImportLinePaymentId == null ? null : paymentDAO.getById(esrImportLinePaymentId); Check.assumeNotNull(payment, "Null payment for line {}", line.getESR_ImportLine_ID()); Check.errorIf(payment.getOverUnderAmt().signum() > 0, "Exces payment for line {}. Can't discount this", line.getESR_ImportLine_ID()); final Amount discount = invoiceDAO.retrieveOpenAmt(InvoiceId.ofRepoId(invoice.getC_Invoice_ID())); trxManager.runInThreadInheritedTrx(new TrxRunnable() { @Override public void run(String trxName) throws Exception { invoiceBL.discountInvoice(invoice, discount, payment.getDateAcct()); } }); return true; }
Source:
public void send(Message message) { org.apache.camel.Message camelMsg = extract(message); if (getPhase() == null) { _exchange.setProperty(PHASE, ExchangePhase.IN); _exchange.setIn(camelMsg); getContext().setProperty(Exchange.MESSAGE_ID, camelMsg.getMessageId()); initInContentType(); } else { _exchange.setProperty(PHASE, ExchangePhase.OUT); String id = getContext().getPropertyValue(MESSAGE_ID); _exchange.setIn(camelMsg); getContext().setProperty(Exchange.RELATES_TO, id); getContext().setProperty(Exchange.MESSAGE_ID, camelMsg.getMessageId()); initOutContentType(); } copyProperties(camelMsg); sendInternal(); }

Target:
public void send(Message message) { org.apache.camel.Message camelMsg = extract(message); if (getPhase() == null) { _exchange.setProperty(PHASE, ExchangePhase.IN); _exchange.setIn(camelMsg); getContext().setProperty(Exchange.MESSAGE_ID, camelMsg.getMessageId()); initInContentType(); } else { _exchange.setProperty(PHASE, ExchangePhase.OUT); String id = getContext().getPropertyValue(MESSAGE_ID); _exchange.setIn(camelMsg); getContext().setProperty(Exchange.RELATES_TO, id); getContext().setProperty(Exchange.MESSAGE_ID, camelMsg.getMessageId()); initOutContentType(); } sendInternal(); }
Source:
private void testRemindAllAction() { ______TS("Typical case: remind all"); resultsPage.clickRemindAllButton(); resultsPage.cancelRemindAllForm(); resultsPage.clickRemindAllButton(); resultsPage.waitForAjaxLoaderGifToDisappear(); resultsPage.deselectUsersInRemindAllForm(); resultsPage.clickRemindButtonInModal(); resultsPage.waitForAjaxLoaderGifToDisappear(); resultsPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSEMPTYRECIPIENT); resultsPage.clickRemindAllButton(); resultsPage.waitForAjaxLoaderGifToDisappear(); resultsPage.clickRemindButtonInModal(); resultsPage.waitForAjaxLoaderGifToDisappear(); resultsPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT); }

Target:
private void testRemindAllAction() { ______TS("Typical case: remind all: click on cancel"); resultsPage.clickRemindAllButtonAndWaitForFormToLoad(); resultsPage.cancelRemindAllForm(); ______TS("Typical case: remind all: click on remind with no students selected"); resultsPage.clickRemindAllButtonAndWaitForFormToLoad(); resultsPage.deselectUsersInRemindAllForm(); resultsPage.clickRemindButtonInModal(); resultsPage.waitForAjaxLoaderGifToDisappear(); resultsPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSEMPTYRECIPIENT); ______TS("Typical case: remind all: click on remind with students selected"); resultsPage.clickRemindAllButtonAndWaitForFormToLoad(); resultsPage.clickRemindButtonInModal(); resultsPage.waitForAjaxLoaderGifToDisappear(); resultsPage.verifyStatus(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT); }
Source:
private String getTaskNameList(boolean showTags){ StringBuffer buf = new StringBuffer(); ArrayList<InternalTask> tasks = job.getITasks(); if(tasks.size() > 0){ buf.append(tasks.get(0).getName()); for(int i = 1; i < tasks.size(); i++){ InternalTask currentTask = tasks.get(i); buf.append(", "); buf.append(currentTask.getName()); if(showTags){ if(currentTask.getTag() != null){ buf.append("("); buf.append(currentTask.getTag()); buf.append(")"); } } } } return buf.toString(); }

Target:
private String getTaskNameList(boolean showTags){ StringBuilder builder = new StringBuilder(); ArrayList<InternalTask> tasks = job.getITasks(); if(tasks.size() > 0){ builder.append(tasks.get(0).getName()); for(int i = 1; i < tasks.size(); i++){ InternalTask currentTask = tasks.get(i); builder.append(", "); builder.append(currentTask.getName()); if(showTags){ if(currentTask.getTag() != null){ builder.append("("); builder.append(currentTask.getTag()); builder.append(")"); } } } } return builder.toString(); }
Source:
public Response setTxComment(long branchUuid, int txId, String comment) { TransactionReadable tx = getTxByBranchAndId(branchUuid, txId); boolean modified = false; if (Compare.isDifferent(tx.getComment(), comment)) { activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Set Tx Comment {branchUUID: %s prevComment: %s newComment: %s accountId: %s serverId: %s clientId: %s}", branchUuid, tx.getComment(), comment, accountId, serverId, clientId)); TransactionFactory txFactory = newTxFactory(); txFactory.setTransactionComment(tx, comment); modified = true; } return asResponse(modified); }

Target:
public Response setTxComment(long branchUuid, int txId, String comment) { TransactionReadable tx = getTxByBranchAndId(branchUuid, txId); boolean modified = false; if (Compare.isDifferent(tx.getComment(), comment)) { try { activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Set Tx Comment {branchUUID: %s prevComment: %s newComment: %s accountId: %s serverId: %s clientId: %s}", branchUuid, tx.getComment(), comment, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders))); } catch (OseeCoreException ex) { OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex); } TransactionFactory txFactory = newTxFactory(); txFactory.setTransactionComment(tx, comment); modified = true; } return asResponse(modified); }
Source:
public void testWriteAndRecovery() throws Exception { WriteHandle lh = result(bkc.newCreateLedgerOp() .withEnsembleSize(1) .withWriteQuorumSize(1) .withAckQuorumSize(1) .withWriteFlags(WriteFlag.DEFERRED_SYNC) .withDigestType(org.apache.bookkeeper.client.api.DigestType.CRC32C) .withPassword(new byte[0]) .execute()); int n = 10; long ledgerId = lh.getId(); for (int i = 0; i < n; i++) { lh.append(("entry-" + i).getBytes()); } restartBookies(); try (ReadHandle readLh = result(bkc.newOpenLedgerOp() .withLedgerId(ledgerId) .withRecovery(true) .withPassword(new byte[0]) .execute());) { try (LedgerEntries entries = readLh.read(0, n - 1)) { for (int i = 0; i < n; i++) { org.apache.bookkeeper.client.api.LedgerEntry entry = entries.getEntry(i); assertEquals("entry-" + i, new String(entry.getEntryBytes())); } } } }

Target:
public void testWriteAndRecovery() throws Exception { WriteHandle lh = result(bkc.newCreateLedgerOp() .withEnsembleSize(1) .withWriteQuorumSize(1) .withAckQuorumSize(1) .withWriteFlags(WriteFlag.DEFERRED_SYNC) .withDigestType(DigestType.CRC32C) .withPassword(new byte[0]) .execute()); int n = 10; long ledgerId = lh.getId(); for (int i = 0; i < n; i++) { lh.append(("entry-" + i).getBytes(UTF_8)); } try (ReadHandle readLh = result(bkc.newOpenLedgerOp() .withLedgerId(ledgerId) .withRecovery(true) .withPassword(new byte[0]) .execute());) { try (LedgerEntries entries = readLh.read(0, n - 1)) { for (int i = 0; i < n; i++) { org.apache.bookkeeper.client.api.LedgerEntry entry = entries.getEntry(i); assertEquals("entry-" + i, new String(entry.getEntryBytes())); } } } }
Source:
void setup(final ExecutableFlow flow) { File execDir = null; try { final ProjectVersion projectVersion = getProjectVersion(flow); synchronized (projectVersion) { setupProject(projectVersion); execDir = createExecDir(flow); copyCreateHardlinkDirectory(projectVersion.getInstalledDir(), execDir); } log.info(String.format("Flow Preparation complete. [execid: %d, path: %s]", flow.getExecutionId(), execDir.getPath())); } catch (final Exception e) { log.error("Error in setting up project directory: " + this.projectsDir + ", Exception: " + e); cleanup(execDir); throw new RuntimeException(e); } }

Target:
void setup(final ExecutableFlow flow) { File execDir = null; try { final ProjectVersion projectVersion = getProjectVersion(flow); synchronized (projectVersion) { setupProject(projectVersion); execDir = createExecDir(flow); copyCreateHardlinkDirectory(projectVersion.getInstalledDir(), execDir); log.info(String.format("Flow Preparation complete. [execid: %d, path: %s]", flow.getExecutionId(), execDir.getPath())); } } catch (final Exception e) { log.error("Error in setting up project directory: " + this.projectsDir + ", Exception: " + e); cleanup(execDir); throw new RuntimeException(e); } }
Source:
private void putForSingleHost(String kvsMethodName, final InetSocketAddress host, final TableReference tableRef, final Iterable<Map.Entry<Cell, Value>> values, boolean overwriteTimestamps) throws Exception { clientPool.runWithRetryOnHost(host, new FunctionCheckedException<CassandraClient, Void, Exception>() { @Override public Void apply(CassandraClient client) throws Exception { int mutationBatchCount = config.mutationBatchCount(); int mutationBatchSizeBytes = config.mutationBatchSizeBytes(); for (List<Map.Entry<Cell, Value>> partition : IterablePartitioner.partitionByCountAndBytes( values, mutationBatchCount, mutationBatchSizeBytes, tableRef, ENTRY_SIZING_FUNCTION)) { MutationMap map = new MutationMap(); for (Map.Entry<Cell, Value> e : partition) { Cell cell = e.getKey(); Column col = CassandraKeyValueServices.createColumn(cell, e.getValue()); if (overwriteTimestamps) { col = CassandraKeyValueServices.createColumnAndOverwriteTimestamp(cell, e.getValue()); } ColumnOrSuperColumn colOrSup = new ColumnOrSuperColumn(); colOrSup.setColumn(col); Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(colOrSup); map.addMutationForCell(cell, tableRef, mutation); } queryRunner.batchMutate(kvsMethodName, client, ImmutableSet.of(tableRef), map, writeConsistency); } return null; } @Override public String toString() { return "batch_mutate(" + host + ", " + tableRef.getQualifiedName() + ", " + Iterables.size(values) + " values)"; } }); }

Target:
private void putForSingleHost(String kvsMethodName, final InetSocketAddress host, final TableReference tableRef, final Iterable<Map.Entry<Cell, Value>> values, boolean overwriteTimestamps) throws Exception { clientPool.runWithRetryOnHost(host, new FunctionCheckedException<CassandraClient, Void, Exception>() { @Override public Void apply(CassandraClient client) throws Exception { int mutationBatchCount = config.mutationBatchCount(); int mutationBatchSizeBytes = config.mutationBatchSizeBytes(); for (List<Map.Entry<Cell, Value>> partition : IterablePartitioner.partitionByCountAndBytes( values, mutationBatchCount, mutationBatchSizeBytes, tableRef, ENTRY_SIZING_FUNCTION)) { MutationMap map = new MutationMap(); for (Map.Entry<Cell, Value> e : partition) { Cell cell = e.getKey(); Column col = overwriteTimestamps ? CassandraKeyValueServices.createColumn(cell, e.getValue()) : CassandraKeyValueServices.createColumn( cell, e.getValue(), freshTimestampSupplier.get()); ColumnOrSuperColumn colOrSup = new ColumnOrSuperColumn(); colOrSup.setColumn(col); Mutation mutation = new Mutation(); mutation.setColumn_or_supercolumn(colOrSup); map.addMutationForCell(cell, tableRef, mutation); } queryRunner.batchMutate(kvsMethodName, client, ImmutableSet.of(tableRef), map, writeConsistency); } return null; } @Override public String toString() { return "batch_mutate(" + host + ", " + tableRef.getQualifiedName() + ", " + Iterables.size(values) + " values)"; } }); }
Source:
public SAMLSSOReqValidationResponseDTO validateSPInitSSORequest(String samlReq, String queryString, String sessionId, String rpSessionId, String authnMode, boolean isPost) throws IdentityException { XMLObject request; if (isPost) { request = SAMLSSOUtil.unmarshall(SAMLSSOUtil.decodeForPost(samlReq)); } else { request = SAMLSSOUtil.unmarshall(SAMLSSOUtil.decode(samlReq)); } if (request instanceof AuthnRequest) { SPInitSSOAuthnRequestValidator authnRequestValidator = new SPInitSSOAuthnRequestValidator( (AuthnRequest) request); SAMLSSOReqValidationResponseDTO validationResp = authnRequestValidator.validate(); validationResp.setRequestMessageString(samlReq); validationResp.setQueryString(queryString); validationResp.setRpSessionId(rpSessionId); validationResp.setIdPInitSSO(false); Integer index = ((AuthnRequest) request).getAttributeConsumingServiceIndex(); if (index != null && index != 0) { validationResp.setAttributeConsumingServiceIndex(index.toString()); } return validationResp; } else if (request instanceof LogoutRequest) { SPInitLogoutRequestProcessor logoutReqProcessor = new SPInitLogoutRequestProcessor(); SAMLSSOReqValidationResponseDTO validationResponseDTO = logoutReqProcessor.process((LogoutRequest) request, sessionId, queryString); return validationResponseDTO; } return null; }

Target:
public SAMLSSOReqValidationResponseDTO validateSPInitSSORequest(String samlReq, String queryString, String sessionId, String rpSessionId, String authnMode, boolean isPost) throws IdentityException { XMLObject request; if (isPost) { request = SAMLSSOUtil.unmarshall(SAMLSSOUtil.decodeForPost(samlReq)); } else { request = SAMLSSOUtil.unmarshall(SAMLSSOUtil.decode(samlReq)); } if (request instanceof AuthnRequest) { SPInitSSOAuthnRequestValidator authnRequestValidator = new SPInitSSOAuthnRequestValidator( (AuthnRequest) request); SAMLSSOReqValidationResponseDTO validationResp = authnRequestValidator.validate(); validationResp.setRequestMessageString(samlReq); validationResp.setQueryString(queryString); validationResp.setRpSessionId(rpSessionId); validationResp.setIdPInitSSO(false); return validationResp; } else if (request instanceof LogoutRequest) { SPInitLogoutRequestProcessor logoutReqProcessor = new SPInitLogoutRequestProcessor(); SAMLSSOReqValidationResponseDTO validationResponseDTO = logoutReqProcessor.process((LogoutRequest) request, sessionId, queryString); return validationResponseDTO; } return null; }
Source:
private static double sortableLongToDouble(long value) { value = value ^ (value >> 63) & Long.MAX_VALUE; return Double.longBitsToDouble(value); }

Target:
private static double sortableLongToDouble(long value) { value = value ^ ((value >> 63) & Long.MAX_VALUE); return Double.longBitsToDouble(value); }
Source:
public boolean rangeCheck( ItemStack itm, final Entity player ) { ILocatable obj = null; try { final long encKey = Long.parseLong( this.getEncryptionKey( itm ) ); obj = AEApi.instance().registries().locatable().getLocatableBy( encKey ); } catch( final NumberFormatException err ) { } IGrid grid = null; IMEMonitor<IAEItemStack> inv = null; if( obj instanceof IGridHost ) { final IGridNode n = ( (IGridHost) obj ).getGridNode( ForgeDirection.UNKNOWN ); if( n != null ) { grid = n.getGrid(); if( grid != null ) { IStorageGrid sg = grid.getCache( IStorageGrid.class ); if( sg != null ) { inv = sg.getItemInventory(); } } } } if( grid != null && inv != null ) { final IMachineSet tw = grid.getMachines( TileWireless.class ); for( final IGridNode n : tw ) { final IWirelessAccessPoint wap = (IWirelessAccessPoint) n.getMachine(); if( this.testWap( wap, player ) ) { return true; } } } return false; }

Target:
public boolean rangeCheck( ItemStack itm, final Entity player ) { ILocatable obj = null; try { final long encKey = Long.parseLong( this.getEncryptionKey( itm ) ); obj = AEApi.instance().registries().locatable().getLocatableBy( encKey ); } catch( final NumberFormatException err ) { } IGrid grid = null; IMEMonitor<IAEItemStack> inv = null; if( obj instanceof IGridHost ) { final IGridNode n = ( (IGridHost) obj ).getGridNode( ForgeDirection.UNKNOWN ); if( n != null ) { grid = n.getGrid(); if( grid != null ) { final IStorageGrid sg = grid.getCache( IStorageGrid.class ); if( sg != null ) { inv = sg.getItemInventory(); } } } } if( grid != null && inv != null ) { final IMachineSet tw = grid.getMachines( TileWireless.class ); for( final IGridNode n : tw ) { final IWirelessAccessPoint wap = (IWirelessAccessPoint) n.getMachine(); if( this.testWap( wap, player ) ) { return true; } } } return false; }
Source:
public ResponseEntity<Problem> handleFeatureNotAvailable( final FeatureNotAvailableException ex, final NativeWebRequest request) { LOG.debug(ex.getMessage(), ex); return Responses.create(Problem.valueOf(NOT_IMPLEMENTED, "Feature is disabled"), request); }

Target:
public ResponseEntity<Problem> handleFeatureNotAvailable( final FeatureNotAvailableException ex, final NativeWebRequest request) { LOG.debug(ex.getMessage(), ex); return Responses.create(Problem.valueOf(NOT_IMPLEMENTED, ex.getMessage()), request); }
Source:
public boolean addBlobStore(ReplicaId replica) { CloudBlobStore cloudStore = partitionToStore.getOrDefault(replica.getPartitionId(), null); if (cloudStore == null) { cloudStore = new CloudBlobStore(properties, replica.getPartitionId(), cloudDestination, clusterMap, vcrMetrics); partitionToStore.put(replica.getPartitionId(), cloudStore); } return startBlobStore(replica.getPartitionId()); }

Target:
public boolean addBlobStore(ReplicaId replica) { CloudBlobStore cloudBlobStore = partitionToStore.computeIfAbsent(replica.getPartitionId(), store -> new CloudBlobStore(properties, replica.getPartitionId(), cloudDestination, clusterMap, vcrMetrics)); return startBlobStore(replica.getPartitionId()); }
Source:
public void onCalloutResult(String result, Intent intent) { boolean resultSet = false; if (result != null) { setSearchText(result); resultSet = true; } Callout callout = shortSelect.getCallout(); for (String key : callout.getResponses()) { result = intent.getExtras().getString(key); if (result != null && !resultSet) { resultSet = true; setSearchText(result); break; } } }

Target:
public void onCalloutResult(String result, Intent intent) { boolean resultSet = false; if (result != null) { setSearchText(result); resultSet = true; } for (String key : shortSelect.getCallout().getResponses()) { result = intent.getExtras().getString(key); if (result != null && !resultSet) { resultSet = true; setSearchText(result); break; } } }
Source:
public static OrganizationType findOrganizationTypeBy(List<OrganizationType> organizations, String hcid) { if (CollectionUtils.isEmpty(organizations)) { return null; } if (StringUtils.isBlank(hcid)) { return organizations.get(0); } for (OrganizationType organization : organizations) { if (equalsIgnoreCaseForHCID(hcid, organization.getHcid())) { return organization; } } return null; }

Target:
public static OrganizationType findOrganizationTypeBy(List<OrganizationType> organizations, String hcid) { if (CollectionUtils.isEmpty(organizations)) { return null; } if (StringUtils.isBlank(hcid)) { return null; } for (OrganizationType organization : organizations) { if (equalsIgnoreCaseForHCID(hcid, organization.getHcid())) { return organization; } } return null; }
Source:
protected DetailedModuleDefinitionResource instantiateResource(ModuleDefinition entity) { DetailedModuleDefinitionResource result = new DetailedModuleDefinitionResource(entity.getName(), entity.getResource().getDescription(), entity.getType().name()); ModuleOptions moduleOptions = entity.getModuleOptions(); if (moduleOptions.iterator() != null) { for (ModuleOption option : moduleOptions) { Object defaultValue = option.getDefaultValue(); Class<?> type = option.getType(); result.addOption(new DetailedModuleDefinitionResource.Option(option.getName(), type == null ? null : type.getSimpleName(), option.getDescription(), defaultValue == null ? null : defaultValue.toString())); } } return result; }

Target:
protected DetailedModuleDefinitionResource instantiateResource(ModuleDefinition entity) { DetailedModuleDefinitionResource result = new DetailedModuleDefinitionResource(entity.getName(), entity.getType().name()); ModuleOptionsMetadata moduleOptionsMetadata = entity.getModuleOptions(); if (moduleOptionsMetadata != null) { for (ModuleOption option : moduleOptionsMetadata) { Object defaultValue = option.getDefaultValue(); Class<?> type = option.getType(); result.addOption(new DetailedModuleDefinitionResource.Option(option.getName(), type == null ? null : type.getSimpleName(), option.getDescription(), defaultValue == null ? null : defaultValue.toString())); } } return result; }
Source:
public List<String> getIgnorePostProcessors() { String list = props.getProperty("ignorePostProcessors"); if (list == null) return Collections.emptyList(); else if (list.isEmpty()) return Collections.emptyList(); return Arrays.asList(list.split(",")); }

Target:
public Set<String> getIgnorePostProcessors() { String list = props.getProperty("ignorePostProcessors"); if (list == null || list.isEmpty()) return Collections.EMPTY_SET; return Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(list.split(",")))); }
Source:
public final Response send( final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read ) throws IOException { final Response rsp; boolean requestHasCmch = false; for (final Map.Entry<String, String> header : headers) { if (header.getKey().equals(this.cmch)) { requestHasCmch = true; break; } } if (method.equals(Request.GET) && !requestHasCmch) { rsp = this.consultCache( req, home, method, headers, content, connect, read ); } else { rsp = this.origin.send( req, home, method, headers, content, connect, read ); } return rsp; }

Target:
public final Response send( final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read ) throws IOException { final Response rsp; if (method.equals(Request.GET) && !this.requestHasCmcHeader(headers)) { rsp = this.consultCache( req, home, method, headers, content, connect, read ); } else { rsp = this.origin.send( req, home, method, headers, content, connect, read ); } return rsp; }
Source:
public DistStageAck executeOnSlave() { if (expectedLevel == null) { return errorResponse("No expected level set", null); } else if (!expectedLevel.equalsIgnoreCase(REPEATABLE_READ) && !expectedLevel.equalsIgnoreCase(READ_COMMITTED)) { return errorResponse("Expected level should be one of " + READ_COMMITTED + " and " + REPEATABLE_READ, null); } BasicOperations.Cache<Object, Object> cache = basicOperations.getCache(null); try { cache.put(ISOLATION_CHECK_KEY, new Long(0)); } catch (Exception e) { return errorResponse("Failed to insert first value", e); } List<ClientThread> threads = new ArrayList<ClientThread>(); for (int i = 0; i < writers; ++i) { ClientThread t = new WriterThread(); t.setName("Writer-" + i); t.start(); threads.add(t); } for (int i = 0; i < readers; ++i) { ClientThread t = new ReaderThread(); t.setName("Reader-" + i); t.start(); threads.add(t); } try { Thread.sleep(duration); } catch (InterruptedException e) { log.error("Thread has been interrupted", e); } finished = true; DistStageAck error = checkThreads(threads); if (error != null) return error; return new ChangeAck(slaveState, valueChangeDetected); }

Target:
public DistStageAck executeOnSlave() { if (expectedLevel == null) { return errorResponse("No expected level set", null); } else if (!expectedLevel.equalsIgnoreCase(REPEATABLE_READ) && !expectedLevel.equalsIgnoreCase(READ_COMMITTED)) { return errorResponse("Expected level should be one of " + READ_COMMITTED + " and " + REPEATABLE_READ, null); } BasicOperations.Cache<Object, Object> cache = basicOperations.getCache(null); try { cache.put(ISOLATION_CHECK_KEY, new Long(0)); } catch (Exception e) { return errorResponse("Failed to insert first value", e); } List<ClientThread> threads = new ArrayList<ClientThread>(); for (int i = 0; i < writers; ++i) { ClientThread t = new WriterThread(); t.setName("Writer-" + i); t.start(); threads.add(t); } for (int i = 0; i < readers; ++i) { ClientThread t = new ReaderThread(); t.setName("Reader-" + i); t.start(); threads.add(t); } try { Thread.sleep(duration); } catch (InterruptedException e) { log.error("Thread has been interrupted", e); Thread.currentThread().interrupt(); } finished = true; DistStageAck error = checkThreads(threads); if (error != null) return error; return new ChangeAck(slaveState, valueChangeDetected); }
Source:
protected void ProceedProxyReturnValue() { VdcBllErrors returnStatus = GetReturnValueFromStatus(getReturnStatus()); switch (returnStatus) { case Done: case StoragePoolMasterNotFound: case StoragePoolTooManyMasters: case StoragePoolWrongMaster: super.ProceedProxyReturnValue(); break; case ReleaseLockFailure: case AcquireHostIdFailure: case ReleaseHostIdFailure: VDSExceptionBase outEx = new VDSErrorException(String.format("Failed in vdscommand to %1$s, error = %2$s", getCommandName(), getReturnStatus().mMessage)); InitializeVdsError(returnStatus); getVDSReturnValue().setSucceeded(false); throw outEx; default: getVDSReturnValue().setSucceeded(false); InitializeVdsError(returnStatus); break; } }

Target:
protected void ProceedProxyReturnValue() { VdcBllErrors returnStatus = GetReturnValueFromStatus(getReturnStatus()); switch (returnStatus) { case Done: case StoragePoolMasterNotFound: case StoragePoolTooManyMasters: case StoragePoolWrongMaster: super.ProceedProxyReturnValue(); break; case ReleaseLockFailure: case AcquireHostIdFailure: case ReleaseHostIdFailure: VDSExceptionBase outEx = new VDSErrorException(String.format("Failed in vdscommand %1$s, error = %2$s", getCommandName(), getReturnStatus().mMessage)); InitializeVdsError(returnStatus); getVDSReturnValue().setSucceeded(false); throw outEx; default: getVDSReturnValue().setSucceeded(false); InitializeVdsError(returnStatus); break; } }
Source:
private String updateConfigScript(final String host, final String server, final int sport) { final ConcurrentHashMap<String, String> values = new ConcurrentHashMap<String, String>(); values.put("host", host); values.put("server", server); values.put("sport", new Integer(sport).toString()); values.put("binary", this.binary); values.put("config", this.config); values.put( "LoadBalancerDir", Manifests.read("Thindeck-LoadBalancer-Directory") ); final String template = Joiner.on(';').join( "cd ${LoadBalancerDir}", "if [ -f ${host}.hosts.conf ]", Joiner.on(' ').join( "then if [[ $(grep '${server}:${sport}'", "${host}.hosts.conf) != *${server}:${sport}* ]]" ), Joiner.on(' ').join( "then sed -i.bak -r 's/}/ server", "${server}:${sport};\\n}/' ${host}.hosts.conf" ), "fi", "rm ${host}.hosts.conf.bak", Joiner.on("\\n").join( "else printf 'upstream ${host}_servers {", " server ${server}:${sport};", "} > ${host}.hosts.conf" ), "if ! grep -q '${host}.hosts.conf' ${config}", Joiner.on(' ').join( "then sed -i.bak -r 's/http \\{/http \\{\\n ", "include ${host}.hosts.conf;/' ${config}" ), "rm ${config}.bak", "fi", "fi", "pkill -HUP -f ${binary}" ); final StrSubstitutor sub = new StrSubstitutor(values); return sub.replace(template); }

Target:
private String updateConfigScript(final String host, final String server, final int sport) { final ConcurrentHashMap<String, String> values = new ConcurrentHashMap<String, String>(); values.put("host", host); values.put("server", server); values.put("sport", Integer.toString(sport)); values.put("binary", this.binary); values.put("config", this.config); values.put( "LoadBalancerDir", Manifests.read("Thindeck-LoadBalancer-Directory") ); final String template = Joiner.on(';').join( "cd ${LoadBalancerDir}", "if [ -f ${host}.hosts.conf ]", Joiner.on(' ').join( "then if [[ $(grep '${server}:${sport}'", "${host}.hosts.conf) != *${server}:${sport}* ]]" ), Joiner.on(' ').join( "then sed -i.bak -r 's/}/ server", "${server}:${sport};\\n}/' ${host}.hosts.conf" ), "fi", "rm ${host}.hosts.conf.bak", Joiner.on("\\n").join( "else printf 'upstream ${host}_servers {", " server ${server}:${sport};", "} > ${host}.hosts.conf" ), "if ! grep -q '${host}.hosts.conf' ${config}", Joiner.on(' ').join( "then sed -i.bak -r 's/http \\{/http \\{\\n ", "include ${host}.hosts.conf;/' ${config}" ), "rm ${config}.bak", "fi", "fi", "pkill -HUP -f ${binary}" ); return new StrSubstitutor(values).replace(template); }
Source:
public int getMaxCapacity() { return maxCapacity; }

Target:
int getMaxCapacity() { return maxCapacity; }
Source:
public File getHeliumPackageBundleCache(String pkgName) { return new File(heliumBundleDirectory, pkgName + "/" + HELIUM_BUNDLE_CACHE); }

Target:
private File getHeliumPackageBundleCache(String pkgName) { return new File(heliumBundleDirectory, pkgName + "/" + HELIUM_BUNDLE_CACHE); }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); config.validate(collector); collector.getOrThrowException(); if (config.containsMacro(NAME_FORMAT)) { for (FileFormat f: FileFormat.values()) { pipelineConfigurer.usePlugin(ValidatingOutputFormat.PLUGIN_TYPE, f.name().toLowerCase(), f.name().toLowerCase(), config.getRawProperties()); } return; } FileFormat format = config.getFormat(); ValidatingOutputFormat validatingOutputFormat = pipelineConfigurer.usePlugin(ValidatingOutputFormat.PLUGIN_TYPE, format.name().toLowerCase(), format.name().toLowerCase(), config.getRawProperties()); FormatContext context = new FormatContext(collector, pipelineConfigurer.getStageConfigurer().getInputSchema()); validateOutputFormatProvider(context, format, validatingOutputFormat); }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); config.validate(collector); collector.getOrThrowException(); if (config.containsMacro(NAME_FORMAT)) { for (FileFormat f: FileFormat.values()) { try { pipelineConfigurer.usePlugin(ValidatingOutputFormat.PLUGIN_TYPE, f.name().toLowerCase(), f.name().toLowerCase(), config.getRawProperties()); } catch (InvalidPluginConfigException e) { LOG.warn("Failed to register format '{}', which means it cannot be used when the pipeline is run. " + "Missing properties: {}, invalid properties: {}", f.name(), e.getMissingProperties(), e.getInvalidProperties().stream().map(InvalidPluginProperty::getName).collect(Collectors.toList())); } } return; } FileFormat format = config.getFormat(); ValidatingOutputFormat validatingOutputFormat = pipelineConfigurer.usePlugin(ValidatingOutputFormat.PLUGIN_TYPE, format.name().toLowerCase(), format.name().toLowerCase(), config.getRawProperties()); FormatContext context = new FormatContext(collector, pipelineConfigurer.getStageConfigurer().getInputSchema()); validateOutputFormatProvider(context, format, validatingOutputFormat); }
Source:
public String getTopCommitAuthor() { loader.waitOnClosed(); return seleniumWebDriverHelper .waitVisibility(revertPanel, ELEMENT_TIMEOUT_SEC) .getText() .split("\n")[3]; }

Target:
public String getTopCommitAuthor() { loader.waitOnClosed(); int numberOfTopAuthorCell = 3; return getRevertCommitTableContent().split("\n")[numberOfTopAuthorCell]; }
Source:
public List<Account> getAwsAccountsByUser(final String userId) { Preconditions.checkArgument(StringUtils.hasText(userId), "userId must not be blank"); final ResponseEntity<List<Account>> typeAws = restOperations.exchange( get(URI.create(baseUrl + "/api/accounts/aws?member=" + userId)).build(), userTeamListType); Preconditions.checkState(typeAws.getStatusCode().is2xxSuccessful(), "getAwsAccountsByUser for type AWS failed: %s", typeAws); final ResponseEntity<List<Account>> typeK8s = restOperations.exchange( get(URI.create(baseUrl + "/api/accounts/kubernetes?role=PowerUser&member=" + userId)).build(), userTeamListType); Preconditions.checkState(typeAws.getStatusCode().is2xxSuccessful(), "getAwsAccountsByUser for type Kubernetes failed: %s", typeK8s); final List<Account> allAccounts = typeAws.getBody(); allAccounts.addAll(typeK8s.getBody()); return allAccounts; }

Target:
public List<Account> getAwsAccountsByUser(final String userId) { Preconditions.checkArgument(StringUtils.hasText(userId), "userId must not be blank"); final ResponseEntity<List<Account>> typeAws = restOperations.exchange( get(URI.create(baseUrl + "/api/accounts/aws?member=" + userId)).build(), userTeamListType); Preconditions.checkState(typeAws.getStatusCode().is2xxSuccessful(), "getAwsAccountsByUser for type AWS failed: %s", typeAws); final ResponseEntity<List<Account>> typeK8s = restOperations.exchange( get(URI.create(baseUrl + "/api/accounts/kubernetes?role=PowerUser&member=" + userId)).build(), userTeamListType); Preconditions.checkState(typeK8s.getStatusCode().is2xxSuccessful(), "getAwsAccountsByUser for type Kubernetes failed: %s", typeK8s); return Streams.concat(typeAws.getBody().stream(), typeK8s.getBody().stream()) .collect(Collectors.toList()); }
Source:
public void testFailures() throws IOException { CanaryTool.RegionStdOutSink regionStdOutSink = new CanaryTool.RegionStdOutSink(); ServerName serverName1 = ServerName.valueOf("staging-st04.server:22600", 1584180761635L); TableName fakeTableName1 = TableName.valueOf("fakeTableName1"); RegionInfo regionInfo1 = RegionInfoBuilder.newBuilder(fakeTableName1).build(); ServerName serverName2 = ServerName.valueOf("staging-st05.server:22600", 1584180761636L); TableName fakeTableName2 = TableName.valueOf("fakeTableName2"); RegionInfo regionInfo2 = RegionInfoBuilder.newBuilder(fakeTableName2).build(); regionStdOutSink.publishReadFailure(serverName1, regionInfo1, new IOException()); regionStdOutSink.publishWriteFailure(serverName2, regionInfo2, new IOException()); CanaryStatusTmpl tmpl = new CanaryStatusTmpl(); tmpl.render(new StringWriter(), regionStdOutSink); }

Target:
public void testFailures() throws IOException { CanaryTool.RegionStdOutSink regionStdOutSink = new CanaryTool.RegionStdOutSink(); ServerName serverName1 = ServerName.valueOf("staging-st04.server:22600", 1584180761635L); TableName fakeTableName1 = TableName.valueOf("fakeTableName1"); RegionInfo regionInfo1 = RegionInfoBuilder.newBuilder(fakeTableName1).build(); ServerName serverName2 = ServerName.valueOf("staging-st05.server:22600", 1584180761636L); TableName fakeTableName2 = TableName.valueOf("fakeTableName2"); RegionInfo regionInfo2 = RegionInfoBuilder.newBuilder(fakeTableName2).build(); regionStdOutSink.publishReadFailure(serverName1, regionInfo1, new IOException()); regionStdOutSink.publishWriteFailure(serverName2, regionInfo2, new IOException()); CanaryStatusTmpl tmpl = new CanaryStatusTmpl(); StringWriter renderResultWriter = new StringWriter(); tmpl.render(renderResultWriter, regionStdOutSink); String renderResult = renderResultWriter.toString(); Assert.assertTrue(renderResult.contains("staging-st04.server,22600")); Assert.assertTrue(renderResult.contains("fakeTableName1")); Assert.assertTrue(renderResult.contains("staging-st05.server,22600")); Assert.assertTrue(renderResult.contains("fakeTableName2")); }
Source:
protected void initializeReportTitleAndFileName(ConcurStandardAccountingExtractBatchReportData reportData) { String concurFileName = reportData.getConcurFileName(); if (StringUtils.isEmpty(concurFileName)) { concurFileName = "UNKNOWN_SAE_FILENAME"; } getReportWriterService().setFileNamePrefix((getFileNamePrefixFirstPart() + concurFileName + getFileNamePrefixSecondPart())); getReportWriterService().setTitle(getReportTitle()); getReportWriterService().initialize(); getReportWriterService().writeNewLines(2); getReportWriterService().writeFormattedMessageLine(getReportConcurFileNameLabel() + concurFileName); getReportWriterService().writeNewLines(2); }

Target:
protected void initializeReportTitleAndFileName(ConcurStandardAccountingExtractBatchReportData reportData) { String concurFileName = reportData.getConcurFileName(); if (StringUtils.isEmpty(concurFileName)) { concurFileName = ConcurConstants.StandardAccountingExtractReport.UNKNOWN_SAE_FILENAME; } getReportWriterService().setFileNamePrefix((getFileNamePrefixFirstPart() + concurFileName + getFileNamePrefixSecondPart())); getReportWriterService().setTitle(getReportTitle()); getReportWriterService().initialize(); getReportWriterService().writeNewLines(2); getReportWriterService().writeFormattedMessageLine(getReportConcurFileNameLabel() + concurFileName); getReportWriterService().writeNewLines(2); }
Source:
public UpstreamTransformerChain<K, V> addUpstreamTransformer(IgniteFunction<Stream<UpstreamEntry<K, V>>, Stream<UpstreamEntry<K, V>>> transformer) { return addUpstreamTransformer(new SimpleUpstreamTransformer<>(transformer)); }

Target:
public UpstreamTransformerChain<K, V> addUpstreamTransformer(IgniteFunction<Stream<UpstreamEntry<K, V>>, Stream<UpstreamEntry<K, V>>> transformer) { return addUpstreamTransformer((rnd, upstream) -> transformer.apply(upstream)); }
Source:
public RetrieveDocumentSetResponseType sendToAdapter(InboundDocRetrieveOrchestratable message) { RetrieveDocumentSetResponseType adapterResponse = proxy.retrieveDocumentSet(message.getRequest(), message.getAssertion()); try { DocRetrieveFileUtils.getInstance().convertFileLocationToDataIfEnabled(adapterResponse); } catch (Exception e) { LOG.error("Failed to retrieve data from the file uri in the payload.", e); adapterResponse = MessageGenerator.getInstance().createRegistryResponseError( "Adapter Document Retrieve Processing"); } return adapterResponse; }

Target:
public RetrieveDocumentSetResponseType sendToAdapter(InboundDocRetrieveOrchestratable message) { RetrieveDocumentSetResponseType adapterResponse = proxy.retrieveDocumentSet(message.getRequest(), message.getAssertion()); try { DocRetrieveFileUtils.getInstance().convertFileLocationToDataIfEnabled(adapterResponse); } catch (Exception e) { LOG.error("Failed to retrieve data from the file uri in the payload." + e.getLocalizedMessage(), e); adapterResponse = MessageGenerator.getInstance().createRegistryResponseError( "Adapter Document Retrieve Processing"); } return adapterResponse; }
Source:
public SuggestedQuantity getSuggestedQuantity(Pool p, Consumer c, Date date) { JsonJsContext args = new JsonJsContext(mapper); Stream<EntitlementDTO> entStream = c.getEntitlements() == null ? Stream.empty() : c.getEntitlements().stream() .filter(ent -> ent.isValidOnDate(date)) .map(this.translator.getStreamMapper(Entitlement.class, EntitlementDTO.class)); Stream<GuestIdDTO> guestIdStream = c.getGuestIds() == null ? Stream.empty() : c.getGuestIds().stream() .map(this.translator.getStreamMapper(GuestId.class, GuestIdDTO.class)); args.put("consumer", this.translator.translate(c, ConsumerDTO.class)); args.put("pool", this.translator.translate(p, PoolDTO.class)); args.put("validEntitlements", entStream.collect(Collectors.toSet())); args.put("log", log, false); args.put("guestIds", guestIdStream.collect(Collectors.toList())); String json = jsRules.runJsFunction(String.class, "get_suggested_quantity", args); SuggestedQuantity dto = mapper.toObject(json, SuggestedQuantity.class); return dto; }

Target:
public SuggestedQuantity getSuggestedQuantity(Pool p, Consumer c, Date date) { JsonJsContext args = new JsonJsContext(mapper); Stream<EntitlementDTO> entStream = c.getEntitlements() == null ? Stream.empty() : c.getEntitlements().stream() .filter(ent -> ent.isValidOnDate(date)) .map(this.translator.getStreamMapper(Entitlement.class, EntitlementDTO.class)); Stream<GuestIdDTO> guestIdStream = c.getGuestIds() == null ? Stream.empty() : c.getGuestIds().stream() .map(this.translator.getStreamMapper(GuestId.class, GuestIdDTO.class)); args.put("consumer", this.translator.translate(c, ConsumerDTO.class)); args.put("pool", this.translator.translate(p, PoolDTO.class)); args.put("validEntitlements", entStream); args.put("log", log, false); args.put("guestIds", guestIdStream); String json = jsRules.runJsFunction(String.class, "get_suggested_quantity", args); SuggestedQuantity dto = mapper.toObject(json, SuggestedQuantity.class); return dto; }
Source:
void showWorkingDirectoryFileDiff(final FileDiff d) { final String p = d.getPath(); final RevCommit commit = d.getCommit(); final ObjectId[] blobs = d.getBlobs(); IFile file = ResourceUtil.getFileForLocation(getRepository(), p); try { if (file != null && commit != null) { if (!CompareUtils.canDirectlyOpenInCompare(file)) { GitModelSynchronize.synchronizeModelWithWorkspace(file, getRepository(), commit.getName()); } else { CompareUtils.compareWorkspaceWithRef(getRepository(), file, commit.getName(), null); } } else { ITypedElement base = new LocalNonWorkspaceTypedElement( new Path(getRepository().getWorkTree() .getAbsolutePath()).append(p)); final ITypedElement right; if (d.getChange().equals(ChangeType.DELETE)) right = new GitCompareFileRevisionEditorInput.EmptyTypedElement( ""); else right = CompareUtils.getFileRevisionTypedElement(p, commit, getRepository(), blobs[blobs.length - 1]); final ITypedElement commonAncestor; if (commit != null) { final ObjectId headCommitId = getRepository().resolve( Constants.HEAD); commonAncestor = CompareUtils .getFileRevisionTypedElementForCommonAncestor(p, headCommitId, commit, getRepository()); } else { commonAncestor = null; } GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput( base, right, commonAncestor, null); CompareUtils.openInCompare(site.getWorkbenchWindow() .getActivePage(), in); } } catch (IOException e) { Activator.logError(UIText.GitHistoryPage_openFailed, e); Activator.showError(UIText.GitHistoryPage_openFailed, null); } }

Target:
void showWorkingDirectoryFileDiff(final FileDiff d) { final String p = d.getPath(); final RevCommit commit = d.getCommit(); if (commit == null) { Activator.showError(UIText.GitHistoryPage_openFailed, null); return; } IWorkbenchPage activePage = site.getWorkbenchWindow().getActivePage(); IFile file = ResourceUtil.getFileForLocation(getRepository(), p); try { if (file != null) { if (!CompareUtils.canDirectlyOpenInCompare(file)) { GitModelSynchronize.synchronizeModelWithWorkspace(file, getRepository(), commit.getName()); } else { CompareUtils.compareWorkspaceWithRef(getRepository(), file, commit.getName(), null); } } else { IPath path = new Path(getRepository().getWorkTree() .getAbsolutePath()).append(p); File ioFile = path.toFile(); if (ioFile.exists()) { CompareUtils.compareLocalWithRef(getRepository(), ioFile, commit.getName(), activePage); } } } catch (IOException e) { Activator.logError(UIText.GitHistoryPage_openFailed, e); Activator.showError(UIText.GitHistoryPage_openFailed, null); } }
Source:
public void testTrimLongSuffix() throws Exception { String longValue = "12345"; assertThat(LiteralUtils.trimLongSuffix(longValue)).isEqualTo(longValue); assertThat(LiteralUtils.trimLongSuffix(longValue + "l")).isEqualTo(longValue); assertThat(LiteralUtils.trimLongSuffix(longValue + "L")).isEqualTo(longValue); }

Target:
public void testTrimLongSuffix() throws Exception { assertThat(LiteralUtils.trimLongSuffix(null)).isEqualTo(null); assertThat(LiteralUtils.trimLongSuffix("")).isEqualTo(""); String longValue = "12345"; assertThat(LiteralUtils.trimLongSuffix(longValue)).isEqualTo(longValue); assertThat(LiteralUtils.trimLongSuffix(longValue + "l")).isEqualTo(longValue); assertThat(LiteralUtils.trimLongSuffix(longValue + "L")).isEqualTo(longValue); }
Source:
private void processClazz(Analyzer analyzer, Clazz c, Map<Annotation, Clazz> consumerTypes, Map<Annotation, Clazz> providerTypes) { c.annotations(SERVICE_CONSUMERS) .flatMap(a -> Arrays.stream((Object[]) a.get("value"))) .map(Annotation.class::cast) .forEach(a -> consumerTypes.put(a, c)); c.annotations(SERVICE_CONSUMER) .forEach(a -> consumerTypes.put(a, c)); c.methods() .flatMap(m -> m.annotations(SERVICE_CONSUMERS)) .flatMap(a -> Arrays.stream((Object[]) a.get("value"))) .map(Annotation.class::cast) .forEach(a -> consumerTypes.put(a, c)); c.methods() .flatMap(m -> m.annotations(SERVICE_CONSUMER)) .forEach(a -> consumerTypes.put(a, c)); c.annotations(SERVICE_PROVIDERS) .flatMap(a -> Arrays.stream((Object[]) a.get("value"))) .map(Annotation.class::cast) .forEach(a -> providerTypes.put(a, c)); c.annotations(SERVICE_PROVIDER) .forEach(a -> providerTypes.put(a, c)); }

Target:
private void processClazz(Analyzer analyzer, Clazz c, Map<Annotation, Clazz> consumerTypes, Map<Annotation, Clazz> providerTypes) { c.annotations(SERVICE_CONSUMERS) .flatMap(a -> Arrays.stream((Object[]) a.get("value"))) .map(Annotation.class::cast) .forEach(a -> consumerTypes.put(a, c)); c.annotations(SERVICE_CONSUMER) .forEach(a -> consumerTypes.put(a, c)); c.annotations(SERVICE_PROVIDERS) .flatMap(a -> Arrays.stream((Object[]) a.get("value"))) .map(Annotation.class::cast) .forEach(a -> providerTypes.put(a, c)); c.annotations(SERVICE_PROVIDER) .forEach(a -> providerTypes.put(a, c)); }