auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private PdpFeedFileBaseEntry buildPdpFeedFileBaseEntry(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile, ConcurStandardAccountingExtractBatchReportData reportData) { PdpFeedFileBaseEntry pdpFeedFileBaseEntry = new PdpFeedFileBaseEntry(); pdpFeedFileBaseEntry.setVersion(ConcurConstants.FEED_FILE_ENTRY_HEADER_VERSION); pdpFeedFileBaseEntry.setHeader(getConcurStandardAccountExtractPdpEntryService().buildPdpFeedHeaderEntry(concurStandardAccountingExtractFile.getBatchDate())); int totalReimbursementLineCount = 0; KualiDecimal totalReimbursementDollarAmount = KualiDecimal.ZERO; for (ConcurStandardAccountingExtractDetailLine line : concurStandardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) { if (shouldProcessSAELineToPDP(line)) { totalReimbursementLineCount++; totalReimbursementDollarAmount = totalReimbursementDollarAmount.add(line.getJournalAmount()); logJournalAccountCodeOverridden(line, reportData); if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountingExtractDetailLine(line, reportData)) { buildAndUpdateAccountingEntryFromLine(pdpFeedFileBaseEntry, line, concurStandardAccountingExtractFile); } } } reportData.getReimbursementsInExpenseReport().setRecordCount(totalReimbursementLineCount); reportData.getReimbursementsInExpenseReport().setDollarAmount(totalReimbursementDollarAmount); pdpFeedFileBaseEntry.setTrailer(getConcurStandardAccountExtractPdpEntryService().buildPdpFeedTrailerEntry(pdpFeedFileBaseEntry, reportData)); return pdpFeedFileBaseEntry; }

Target:
private PdpFeedFileBaseEntry buildPdpFeedFileBaseEntry(ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile, ConcurStandardAccountingExtractBatchReportData reportData) { PdpFeedFileBaseEntry pdpFeedFileBaseEntry = new PdpFeedFileBaseEntry(); pdpFeedFileBaseEntry.setVersion(ConcurConstants.FEED_FILE_ENTRY_HEADER_VERSION); pdpFeedFileBaseEntry.setHeader(getConcurStandardAccountExtractPdpEntryService().buildPdpFeedHeaderEntry(concurStandardAccountingExtractFile.getBatchDate())); int totalReimbursementLineCount = 0; KualiDecimal totalReimbursementDollarAmount = KualiDecimal.ZERO; for (ConcurStandardAccountingExtractDetailLine line : concurStandardAccountingExtractFile.getConcurStandardAccountingExtractDetailLines()) { if (shouldProcessSAELineToPDP(line)) { if (shouldLineTotalsBeAddedToReimbursementReportTotals(line)) { totalReimbursementLineCount++; totalReimbursementDollarAmount = totalReimbursementDollarAmount.add(line.getJournalAmount()); } logJournalAccountCodeOverridden(line, reportData); if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountingExtractDetailLine(line, reportData)) { buildAndUpdateAccountingEntryFromLine(pdpFeedFileBaseEntry, line, concurStandardAccountingExtractFile); } } } reportData.getReimbursementsInExpenseReport().setRecordCount(totalReimbursementLineCount); reportData.getReimbursementsInExpenseReport().setDollarAmount(totalReimbursementDollarAmount); pdpFeedFileBaseEntry.setTrailer(getConcurStandardAccountExtractPdpEntryService().buildPdpFeedTrailerEntry(pdpFeedFileBaseEntry, reportData)); return pdpFeedFileBaseEntry; }
Source:
private void deleteAlarmAssociations(int alarmId) { Map<Integer, AlarmAssociationAndFact> associationFacts = alarmAssociationById.remove(alarmId); if (associationFacts == null) { return; } for (Integer association : associationFacts.keySet()) { AlarmAssociationAndFact assocationFact = associationFacts.get(association); if (assocationFact != null) { LOG.debug("Deleting ack from session: {}", assocationFact.getAlarmAssociation()); getKieSession().delete(assocationFact.getFact()); } } }

Target:
private void deleteAlarmAssociations(int alarmId) { Map<Integer, AlarmAssociationAndFact> associationFacts = alarmAssociationById.remove(alarmId); if (associationFacts == null) { return; } for (Integer association : associationFacts.keySet()) { AlarmAssociationAndFact assocationFact = associationFacts.get(association); if (assocationFact != null) { LOG.debug("Deleting association from session: {}", assocationFact.getAlarmAssociation()); getKieSession().delete(assocationFact.getFact()); } } }
Source:
protected void innerMap( InputRow inputRow, Text text, Context context ) throws IOException, InterruptedException { final Map<String, Set<String>> dims = Maps.newTreeMap(); for(final String dim : inputRow.getDimensions()) { final Set<String> dimValues = ImmutableSortedSet.copyOf(inputRow.getDimension(dim)); if(dimValues.size() > 0) { dims.put(dim, dimValues); } } final List<Object> groupKey = ImmutableList.of( getConfig().getRollupSpec().getRollupGranularity().truncate(inputRow.getTimestampFromEpoch()), dims ); context.write(new Text(HadoopDruidIndexerConfig.jsonMapper.writeValueAsBytes(groupKey)), NullWritable.get()); }

Target:
protected void innerMap( InputRow inputRow, Text text, Context context ) throws IOException, InterruptedException { final Map<String, Set<String>> dims = Maps.newTreeMap(); for(final String dim : inputRow.getDimensions()) { final Set<String> dimValues = ImmutableSortedSet.copyOf(inputRow.getDimension(dim)); if(dimValues.size() > 0) { dims.put(dim, dimValues); } } final List<Object> groupKey = ImmutableList.of( rollupGranularity.truncate(inputRow.getTimestampFromEpoch()), dims ); context.write( new BytesWritable(HadoopDruidIndexerConfig.jsonMapper.writeValueAsBytes(groupKey)), NullWritable.get() ); }
Source:
private ForkliftConsumerI getGroupedTopic(GroupedTopicSource source) throws ConnectorException { if (!source.groupSpecified()) throw new ConnectorException("No consumer group specified"); final String groupName = source.getGroup().replaceAll("\\.", "_"); final String topicName = source.getName().replaceAll("\\.", "_"); return getConsumerForSource(new QueueSource("Consumer." + groupName + ".VirtualTopic." + topicName)); }

Target:
private ForkliftConsumerI getGroupedTopic(GroupedTopicSource source) throws ConnectorException { if (!source.groupSpecified()) throw new ConnectorException("No consumer group specified"); final String groupName = source.getGroup().replaceAll("\\.", "_"); final String topicName = source.getName(); return getConsumerForSource(new QueueSource("Consumer." + groupName + ".VirtualTopic." + topicName)); }
Source:
protected void loadLibs(Context context) { new SqliteLibraryLoader().loadSqlCipher(context); }

Target:
protected void loadLibs(Context context) { SqliteLibraryLoader.loadSqlCipher(context); }
Source:
public String sequenceValue() { return name(); }

Target:
public String sequenceValue() { return _sequenceValue; }
Source:
public void detectLanguagesBatchInputShowStatistics() { detectLanguageShowStatisticsRunner((inputs, options) -> { StepVerifier.create(client.detectBatchLanguagesWithResponse(inputs, options)) .assertNext(response -> validateBatchResult(response.getValue(), getExpectedBatchDetectedLanguages(), "Language")) .verifyComplete(); }); }

Target:
public void detectLanguagesBatchInputShowStatistics() { detectLanguageShowStatisticsRunner((inputs, options) -> { StepVerifier.create(client.detectBatchLanguagesWithResponse(inputs, options)) .assertNext(response -> validateBatchResult(response.getValue(), getExpectedBatchDetectedLanguages(), TestEndpoint.LANGUAGE)) .verifyComplete(); }); }
Source:
static synchronized ServiceContext getServiceContext() { if (serviceContext == null) { synchronized (Context.class) { if (serviceContext == null) { log.error("serviceContext is null. Creating new ServiceContext()"); serviceContext = ServiceContext.getInstance(); } } } log.trace("serviceContext: {}", serviceContext); return ServiceContext.getInstance(); }

Target:
static synchronized ServiceContext getServiceContext() { synchronized (Context.class) { if (serviceContext == null) { log.error("serviceContext is null. Creating new ServiceContext()"); serviceContext = ServiceContext.getInstance(); } } log.trace("serviceContext: {}", serviceContext); return ServiceContext.getInstance(); }
Source:
private HashMap<String, String> getCustomHeaders() { HashMap<String, String> customHeaders = new HashMap<>(); try { Set<String> allPropNames = getPropertyAccessor().getPropertyNames(NhincConstants.GATEWAY_PROPERTY_FILE); if (NullChecker.isNotNullish(allPropNames)) { addPropertiesToCustomHeaders(allPropNames, customHeaders); } } catch (PropertyAccessException ex) { LOG.warn("Unable to access properties for custom http headers.", ex); } for (CONNECTCustomHttpHeadersType header : assertion.getCONNECTCustomHttpHeaders()) { customHeaders.put(header.getHeaderName(), header.getHeaderValue()); } return customHeaders; }

Target:
private HashMap<String, String> getCustomHeaders() { HashMap<String, String> customHeaders = new HashMap<>(); try { Set<String> allPropNames = getPropertyAccessor().getPropertyNames(NhincConstants.GATEWAY_PROPERTY_FILE); if (NullChecker.isNotNullish(allPropNames)) { addPropertiesToCustomHeaders(allPropNames, customHeaders); } } catch (PropertyAccessException ex) { LOG.warn("Unable to access properties for custom http headers.{}", ex.getLocalizedMessage(),ex); } for (CONNECTCustomHttpHeadersType header : assertion.getCONNECTCustomHttpHeaders()) { customHeaders.put(header.getHeaderName(), header.getHeaderValue()); } return customHeaders; }
Source:
public List<Element> nextElementSiblings() { if (parentNode == null) { return null; } List<Element> siblings = parent().childElementsList(); int index = indexInList(this, siblings); Validate.notNull(index); if (siblings.size() > index + 1) { return siblings.subList(index + 1, siblings.size()); } return null; }

Target:
public List<Element> nextElementSiblings() { if (parentNode == null) { return Collections.emptyList(); } List<Element> siblings = parent().childElementsList(); int index = indexInList(this, siblings); Validate.notNull(index); if (siblings.size() > index + 1) { return siblings.subList(index + 1, siblings.size()); } return Collections.emptyList(); }
Source:
public boolean cleanDataBase() { close(); logger.info("Cleaning database"); File[] dbChannelFiles = statusFileDirectory.listFiles((dir, name) -> name.startsWith(DEFAULT_STORE_SESSION_NAME)); for (File file : dbChannelFiles) { try { logger.info("Deleting " + file); file.delete(); } catch (Exception e) { logger.info("Error while deleting file during database cleanup", e); } } return true; }

Target:
private void cleanDataBase() { close(); logger.info("Cleaning database"); File[] dbChannelFiles = statusFileDirectory.listFiles((dir, name) -> name.startsWith(DEFAULT_STORE_SESSION_NAME)); if (dbChannelFiles != null) { for (File file : dbChannelFiles) { try { logger.info("Deleting " + file); boolean result = file.delete(); if (!result) { logger.error("Could not delete file " + file + ". Synchronization service might not work properly. Please remove the file manually."); } } catch (Exception e) { logger.info("Error while deleting file during database cleanup", e); } } } }
Source:
void addPagesToList(@NonNull SQLiteDatabase db, @NonNull ReadingList list, @NonNull List<ReadingListPage> pages) { db.beginTransaction(); try { for (ReadingListPage page : pages) { insertPageInDb(db, list, page); } db.setTransactionSuccessful(); WikipediaApp.getInstance().getBus().post(new ArticleSavedOrDeletedEvent(pages.toArray(new ReadingListPage[]{}))); } finally { db.endTransaction(); } SavedPageSyncService.enqueue(); if (Prefs.getReadingListsPageSaveCount() < SAVE_COUNT_LIMIT) { WikipediaApp.getInstance().getBus().post(new SaveCountReachedEvent()); Prefs.setReadingListsPageSaveCount(Prefs.getReadingListsPageSaveCount() + 1); } }

Target:
void addPagesToList(@NonNull SQLiteDatabase db, @NonNull ReadingList list, @NonNull List<ReadingListPage> pages) { db.beginTransaction(); try { for (ReadingListPage page : pages) { insertPageInDb(db, list, page); } db.setTransactionSuccessful(); WikipediaApp.getInstance().getBus().post(new ArticleSavedOrDeletedEvent(true, pages.toArray(new ReadingListPage[]{}))); } finally { db.endTransaction(); } SavedPageSyncService.enqueue(); }
Source:
SolrClient createSolrHttpClient(String url, String coreName, String coreUrl) throws IOException, SolrServerException { final HttpClientBuilder builder = HttpClients.custom() .setDefaultCookieStore(new BasicCookieStore()) .setMaxConnTotal(128) .setMaxConnPerRoute(32); if (StringUtils.startsWith(url, "https")) { builder.setSSLSocketFactory( new SSLConnectionSocketFactory( getSslContext(), getProtocols(), getCipherSuites(), SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER)); } createSolrCore(url, coreName, null, builder.build()); try (final Closer closer = new Closer()) { final HttpSolrClient noRetryClient = closer.with(new HttpSolrClient(coreUrl, builder.build())); final HttpSolrClient retryClient = closer.with( new HttpSolrClient( coreUrl, builder.setRetryHandler(new SolrHttpRequestRetryHandler(coreName)).build())); return closer.returning(new PingAwareSolrClientProxy(retryClient, noRetryClient)); } }

Target:
SolrClient createSolrHttpClient(String url, String coreName, String coreUrl) throws IOException, SolrServerException { final HttpClientBuilder builder = HttpClients.custom() .setDefaultCookieStore(new BasicCookieStore()) .setMaxConnTotal(128) .setMaxConnPerRoute(32); if (StringUtils.startsWithIgnoreCase(url, "https")) { builder.setSSLSocketFactory( new SSLConnectionSocketFactory( getSslContext(), getProtocols(), getCipherSuites(), SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER)); } createSolrCore(url, coreName, null, builder.build()); try (final Closer closer = new Closer()) { final HttpSolrClient noRetryClient = closer.with(new HttpSolrClient(coreUrl, builder.build())); final HttpSolrClient retryClient = closer.with( new HttpSolrClient( coreUrl, builder.setRetryHandler(new SolrHttpRequestRetryHandler(coreName)).build())); return closer.returning(new PingAwareSolrClientProxy(retryClient, noRetryClient)); } }
Source:
void setState(State state) { this.state = state; if (zkShutdownHandler != null) { zkShutdownHandler.handle(state); } }

Target:
protected void setState(State state) { this.state = state; if (zkShutdownHandler != null) { zkShutdownHandler.handle(state); } else { LOG.error("ZKShutdownHandler is not registered, so ZooKeeper server " + "won't take any action on ERROR or SHUTDOWN server state changes"); } }
Source:
private Process setupAndLaunch(HashMap<String, String> env) throws IOException { Process process = null; ProcessBuilder pb = (mUseRoot) ? new ProcessBuilder("su") : new ProcessBuilder(mCommand); if (mUseRoot) { process = pb.start(); DataOutputStream suOut = new DataOutputStream(process.getOutputStream()); for (Map.Entry<String, String> entry : env.entrySet()) { suOut.writeBytes(String.format("export %s=\"%s\"\n", entry.getKey(), entry.getValue())); } suOut.flush(); suOut.writeBytes("exec " + TextUtils.join(" ", mCommand) + "\n"); suOut = null; } else { pb.environment().putAll(env); process = pb.start(); } return process; }

Target:
private Process setupAndLaunch(HashMap<String, String> env) throws IOException { Process process = null; if (mUseRoot) { ProcessBuilder pb = new ProcessBuilder("su"); process = pb.start(); DataOutputStream suOut = new DataOutputStream(process.getOutputStream()); for (Map.Entry<String, String> entry : env.entrySet()) { suOut.writeBytes(String.format("export %s=\"%s\"\n", entry.getKey(), entry.getValue())); } suOut.flush(); suOut.writeBytes("exec " + TextUtils.join(" ", mCommand) + "\n"); suOut = null; } else { ProcessBuilder pb = new ProcessBuilder(mCommand); pb.environment().putAll(env); process = pb.start(); } return process; }
Source:
public void test_example() { ComponentDto project = db.components().insertPrivateProject(p -> p.setDbKey("sonarqube")); ComponentDto longLivingBranch = db.components().insertProjectBranch(project, b -> b.setKey("feature/bar").setBranchType(BranchType.LONG)); db.components().insertProjectBranch(project, b -> b.setKey("feature/foo").setBranchType(BranchType.SHORT).setMergeBranchUuid(longLivingBranch.uuid())); userSession.logIn().addProjectPermission(UserRole.USER, project); String json = ws.newRequest() .setParam("project", project.getDbKey()) .execute() .getInput(); assertJson(json).ignoreFields("analysisDate").isSimilarTo(ws.getDef().responseExampleAsString()); }

Target:
public void test_example() { ComponentDto project = db.components().insertPrivateProject(p -> p.setDbKey("sonarqube")); ComponentDto longLivingBranch = db.components().insertProjectBranch(project, b -> b.setKey("feature/bar").setBranchType(BranchType.LONG)); ComponentDto shortLivingBranch = db.components().insertProjectBranch(project, b -> b.setKey("feature/foo").setBranchType(BranchType.SHORT).setMergeBranchUuid(longLivingBranch.uuid())); userSession.logIn().addProjectPermission(UserRole.USER, project); db.getDbClient().snapshotDao().insert(db.getSession(), SnapshotTesting.newAnalysis(longLivingBranch).setLast(true).setCreatedAt(DateUtils.parseDateTime("2017-04-01T01:15:42+0100").getTime())); db.getDbClient().snapshotDao().insert(db.getSession(), SnapshotTesting.newAnalysis(shortLivingBranch).setLast(true).setCreatedAt(DateUtils.parseDateTime("2017-04-03T13:37:00+0100").getTime())); db.commit(); String json = ws.newRequest() .setParam("project", project.getDbKey()) .execute() .getInput(); assertJson(json).isSimilarTo(ws.getDef().responseExampleAsString()); }
Source:
public void channelActive(ChannelHandlerContext ctx) throws Exception { if (LOG.isTraceEnabled()) { LOG.trace("Channel active {}", ctx.channel()); } final Channel channel = ctx.channel(); if (limitTotalNumberOfCnxns()) { ServerMetrics.getMetrics().CONNECTION_REJECTED.add(1); channel.close(); return; } InetAddress addr = ((InetSocketAddress) channel.remoteAddress()).getAddress(); if (maxClientCnxns > 0 && getClientCnxnCount(addr) >= maxClientCnxns) { ServerMetrics.getMetrics().CONNECTION_REJECTED.add(1); LOG.warn("Too many connections from - max is {}", addr, maxClientCnxns); channel.close(); return; } NettyServerCnxn cnxn = new NettyServerCnxn(channel, zkServer, NettyServerCnxnFactory.this); ctx.channel().attr(CONNECTION_ATTRIBUTE).set(cnxn); if (!cnxn.isZKServerRunning()) { ServerMetrics.getMetrics().CNXN_CLOSED_WITHOUT_ZK_SERVER_RUNNING.add(1); channel.close(); return; } if (handshakeThrottlingEnabled) { int outstandingHandshakesNum = outstandingHandshake.addAndGet(1); if (outstandingHandshakesNum > outstandingHandshakeLimit) { outstandingHandshake.addAndGet(-1); channel.close(); ServerMetrics.getMetrics().TLS_HANDSHAKE_EXCEEDED.add(1); } else { cnxn.setHandshakeState(HandshakeState.STARTED); } } if (secure) { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); Future<Channel> handshakeFuture = sslHandler.handshakeFuture(); handshakeFuture.addListener(new CertificateVerifier(sslHandler, cnxn)); } else if (!shouldUsePortUnification) { allChannels.add(ctx.channel()); addCnxn(cnxn); } }

Target:
public void channelActive(ChannelHandlerContext ctx) throws Exception { if (LOG.isTraceEnabled()) { LOG.trace("Channel active {}", ctx.channel()); } final Channel channel = ctx.channel(); if (limitTotalNumberOfCnxns()) { ServerMetrics.getMetrics().CONNECTION_REJECTED.add(1); channel.close(); return; } InetAddress addr = ((InetSocketAddress) channel.remoteAddress()).getAddress(); if (maxClientCnxns > 0 && getClientCnxnCount(addr) >= maxClientCnxns) { ServerMetrics.getMetrics().CONNECTION_REJECTED.add(1); LOG.warn("Too many connections from - max is {}", addr, maxClientCnxns); channel.close(); return; } NettyServerCnxn cnxn = new NettyServerCnxn(channel, zkServer, NettyServerCnxnFactory.this); ctx.channel().attr(CONNECTION_ATTRIBUTE).set(cnxn); if (!cnxn.isZKServerRunning()) { LOG.warn("Zookeeper server is not running, close the connection before starting the TLS handshake"); ServerMetrics.getMetrics().CNXN_CLOSED_WITHOUT_ZK_SERVER_RUNNING.add(1); channel.close(); return; } if (handshakeThrottlingEnabled) { int outstandingHandshakesNum = outstandingHandshake.addAndGet(1); if (outstandingHandshakesNum > outstandingHandshakeLimit) { outstandingHandshake.addAndGet(-1); channel.close(); ServerMetrics.getMetrics().TLS_HANDSHAKE_EXCEEDED.add(1); } else { cnxn.setHandshakeState(HandshakeState.STARTED); } } if (secure) { SslHandler sslHandler = ctx.pipeline().get(SslHandler.class); Future<Channel> handshakeFuture = sslHandler.handshakeFuture(); handshakeFuture.addListener(new CertificateVerifier(sslHandler, cnxn)); } else if (!shouldUsePortUnification) { allChannels.add(ctx.channel()); addCnxn(cnxn); } }
Source:
public boolean isEmployeeGroupIdValid(String employeeGroupId) { if(StringUtils.isNotBlank(employeeGroupId)){ Collection<String> acceptedValuesForGroupId = parameterService.getParameterValuesAsString(CUKFSConstants.ParameterNamespaces.CONCUR, CUKFSParameterKeyConstants.ALL_COMPONENTS, ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID); return acceptedValuesForGroupId.stream().filter(acceptedValue -> acceptedValue.equalsIgnoreCase(employeeGroupId)).count() > 0; } return false; }

Target:
public boolean isEmployeeGroupIdValid(String employeeGroupId) { if(StringUtils.isNotBlank(employeeGroupId)){ Collection<String> acceptedValuesForGroupId = parameterService.getParameterValuesAsString(CUKFSConstants.ParameterNamespaces.CONCUR, CUKFSParameterKeyConstants.ALL_COMPONENTS, ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID); if(CollectionUtils.isNotEmpty(acceptedValuesForGroupId)){ return acceptedValuesForGroupId.stream().filter(acceptedValue -> acceptedValue.equalsIgnoreCase(employeeGroupId)).count() > 0; } } return false; }
Source:
private static List<Pair<String, String>> geopoint(XmlElement element) { String[] fields = Optional.ofNullable(element.getValue()) .map(v -> v.split(" ")) .orElseThrow(() -> new BriefcaseException("No value on geopoint field")); List<Pair<String, String>> values = new ArrayList<>(); values.add(Pair.of(element.fqn() + "-Latitude", Optional.ofNullable(fields[0]).orElse(null))); values.add(Pair.of(element.fqn() + "-Longitude", Optional.ofNullable(fields[1]).orElse(null))); values.add(Pair.of(element.fqn() + "-Altitude", Optional.ofNullable(fields[2]).orElse(null))); values.add(Pair.of(element.fqn() + "-Accuracy", Optional.ofNullable(fields[3]).orElse(null))); return values; }

Target:
private static List<Pair<String, String>> geopoint(XmlElement element) { String[] tags = new String[]{"Latitude", "Longitude", "Altitude", "Accuracy"}; String[] fields = element.maybeValue() .map(v -> v.split(" ", 4)) .orElse(new String[]{}); return IntStream.range(0, tags.length) .mapToObj(i -> Pair.of(element.fqn() + "-" + tags[i], i < fields.length ? fields[i] : null)) .collect(toList()); }
Source:
public CertificatesRotationV4Response rotateClusterCertificates(NameOrCrn nameOrCrn, Long workspaceId, CertificatesRotationV4Request certificatesRotationV4Request) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); MDCBuilder.buildMdcContext(stack); if (!stack.isAvailable()) { throw new BadRequestException(String.format( "Stack '%s' is currently in '%s' state. Certificates rotation can " + "only be made when the underlying stack is 'AVAILABLE'.", stack.getName(), stack.getStatus())); } return new CertificatesRotationV4Response(clusterOperationService.rotateClusterCertificates(stack, certificatesRotationV4Request)); }

Target:
public CertificatesRotationV4Response rotateClusterCertificates(NameOrCrn nameOrCrn, Long workspaceId, CertificatesRotationV4Request certificatesRotationV4Request) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); MDCBuilder.buildMdcContext(stack); validateOperationOnStack(stack, "Certificates rotation"); return new CertificatesRotationV4Response(clusterOperationService.rotateClusterCertificates(stack, certificatesRotationV4Request)); }
Source:
public SecurityGroupVO createSecurityGroup(CreateSecurityGroupCmd cmd) throws PermissionDeniedException, InvalidParameterValueException { String name = cmd.getSecurityGroupName(); Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.finalizeOwner(caller, cmd.getAccountName(), cmd.getDomainId(), cmd.getProjectId()); if (name.trim().equals("")) { throw new InvalidParameterValueException("Security group name cannot be empty"); } if (_securityGroupDao.isNameInUse(owner.getId(), owner.getDomainId(), cmd.getSecurityGroupName())) { throw new InvalidParameterValueException("Unable to create security group, a group with name " + name + " already exists."); } return createSecurityGroup(cmd.getSecurityGroupName(), cmd.getDescription(), owner.getDomainId(), owner.getAccountId(), owner.getAccountName()); }

Target:
public SecurityGroupVO createSecurityGroup(CreateSecurityGroupCmd cmd) throws PermissionDeniedException, InvalidParameterValueException { String name = cmd.getSecurityGroupName(); Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.finalizeOwner(caller, cmd.getAccountName(), cmd.getDomainId(), cmd.getProjectId()); if (StringUtils.isBlank(name)) { throw new InvalidParameterValueException("Security group name cannot be empty"); } if (_securityGroupDao.isNameInUse(owner.getId(), owner.getDomainId(), cmd.getSecurityGroupName())) { throw new InvalidParameterValueException("Unable to create security group, a group with name " + name + " already exists."); } return createSecurityGroup(cmd.getSecurityGroupName(), cmd.getDescription(), owner.getDomainId(), owner.getAccountId(), owner.getAccountName()); }
Source:
public InitializerWizardSelectionPage(Collection<IPatternProvider> collection) { super("PatternSelection"); setTitle("Pattern Selection"); setDescription("Select a pattern to init a representation."); setPageComplete(false); this.patterns = collection; }

Target:
public InitializerWizardSelectionPage(Collection<IPatternProvider> collection) { super("PatternSelection"); setTitle("Pattern Selection"); setDescription("Select a pattern to init a representation."); setPageComplete(false); patterns = Lists.newArrayList(collection); }
Source:
public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() { List<TmfAnalysisRequirement> requirements = new ArrayList<>(); AnalysisRequirementFactory factory = new AnalysisRequirementFactory(); switch (fModule) { case TEST: requirements.add(factory.getRequirement1()); requirements.add(factory.getRequirement3()); break; case TESTCTF: requirements.add(factory.getRequirement2()); requirements.add(factory.getRequirement3()); break; default: break; } return requirements; }

Target:
public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() { Set<TmfAnalysisRequirement> requirements = new HashSet<>(); AnalysisRequirementFactory factory = new AnalysisRequirementFactory(); switch (fModule) { case TEST: requirements.add(factory.getRequirement1()); requirements.add(factory.getRequirement3()); break; case TESTCTF: requirements.add(factory.getRequirement2()); requirements.add(factory.getRequirement3()); break; default: break; } return requirements; }
Source:
public void postProcessQuotaManagerTest() throws Exception { Properties props = new Properties(); props.setProperty(FrontendConfig.REST_REQUEST_QUOTA_STRING, "{\"PUT\": \"20\",\"GET\": \"20\",\"POST\": \"20\",\"HEAD\": \"20\",\"OPTIONS\": \"20\",\"UNKNOWN\": \"20\",\"DELETE\": \"20\"}"); FrontendConfig frontendConfig = new FrontendConfig(new VerifiableProperties(props)); RejectThrottlerTest.MockClock clock = new RejectThrottlerTest.MockClock(); AmbrySecurityService ambrySecurityService = new AmbrySecurityService(frontendConfig, new FrontendMetrics(new MetricRegistry()), URL_SIGNING_SERVICE_FACTORY.getUrlSigningService(), new QuotaManagerTest.MockQuotaManager(frontendConfig, clock)); for (int i = 0; i < 100; i++) { for (RestMethod resetMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(resetMethod, "/", null); ambrySecurityService.postProcessRequest(restRequest).get(); } } clock.tick(5); for (RestMethod resetMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(resetMethod, "/", null); try { ambrySecurityService.postProcessRequest(restRequest).get(); Assert.fail("Should have failed."); } catch (Exception e) { Assert.assertEquals("Exception should be TooManyRequests", RestServiceErrorCode.TooManyRequests, ((RestServiceException) e.getCause()).getErrorCode()); } } clock.tick(5); for (RestMethod resetMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(resetMethod, "/", null); ambrySecurityService.postProcessRequest(restRequest).get(); } }

Target:
public void postProcessQuotaManagerTest() throws Exception { QuotaManager quotaManager = Mockito.mock(QuotaManager.class); AmbrySecurityService ambrySecurityService = new AmbrySecurityService(new FrontendConfig(new VerifiableProperties(new Properties())), new FrontendMetrics(new MetricRegistry()), URL_SIGNING_SERVICE_FACTORY.getUrlSigningService(), quotaManager); Mockito.when(quotaManager.shouldThrottle(any())).thenReturn(false); for (int i = 0; i < 100; i++) { for (RestMethod restMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(restMethod, "/", null); ambrySecurityService.postProcessRequest(restRequest).get(); } } Mockito.when(quotaManager.shouldThrottle(any())).thenReturn(true); for (RestMethod restMethod : RestMethod.values()) { RestRequest restRequest = createRestRequest(restMethod, "/", null); try { ambrySecurityService.postProcessRequest(restRequest).get(); Assert.fail("Should have failed."); } catch (Exception e) { Assert.assertEquals("Exception should be TooManyRequests", RestServiceErrorCode.TooManyRequests, ((RestServiceException) e.getCause()).getErrorCode()); } } }
Source:
public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { LttngUstTrace trace = getTrace(); ILttngUstEventLayout layout; if (trace == null) { layout = ILttngUstEventLayout.DEFAULT_LAYOUT; } else { layout = trace.getEventLayout(); } Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { @NonNull Set<@NonNull String> requiredEventsFields = checkNotNull(ImmutableSet.of( layout.contextProcname(), layout.contextVtid())); @NonNull TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement( checkNotNull(ImmutableSet.of(layout.eventCygProfileFuncEntry(), layout.eventCygProfileFastFuncEntry())), requiredEventsFields, ValuePriorityLevel.MANDATORY); @NonNull TmfAnalysisEventFieldRequirement exitReq = new TmfAnalysisEventFieldRequirement( checkNotNull(ImmutableSet.of(layout.eventCygProfileFuncExit(), layout.eventCygProfileFastFuncExit())), requiredEventsFields, ValuePriorityLevel.MANDATORY); exitReq.addInformation(nullToEmptyString(Messages.LttnUstCallStackAnalysisModule_EventsLoadingInformation)); requirements = checkNotNull(ImmutableSet.of(entryReq, exitReq)); fAnalysisRequirements = requirements; } return requirements; }

Target:
public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { LttngUstTrace trace = getTrace(); ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT; if (trace != null) { layout = trace.getEventLayout(); } @NonNull Set<@NonNull String> requiredEventsFields = ImmutableSet.of( layout.contextProcname(), layout.contextVtid()); @NonNull TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement( ImmutableSet.of(layout.eventCygProfileFuncEntry(), layout.eventCygProfileFastFuncEntry()), requiredEventsFields, ValuePriorityLevel.MANDATORY); @NonNull TmfAnalysisEventFieldRequirement exitReq = new TmfAnalysisEventFieldRequirement( ImmutableSet.of(layout.eventCygProfileFuncExit(), layout.eventCygProfileFastFuncExit()), requiredEventsFields, ValuePriorityLevel.MANDATORY); exitReq.addInformation(nullToEmptyString(Messages.LttnUstCallStackAnalysisModule_EventsLoadingInformation)); requirements = ImmutableSet.of(entryReq, exitReq); fAnalysisRequirements = requirements; } return requirements; }
Source:
public void reset(){ BadRecordsRecorder oldRecorder = this.badRecordsAccumulator.value(); BadRecordsRecorder badRecordsRecorder = new BadRecordsRecorder( oldRecorder.getStatusDirectory(), importFileName, badRecordThreshold); this.badRecordsAccumulator=SpliceSpark.getContext().accumulable(badRecordsRecorder, badRecordsRecorder.getUniqueName(), new BadRecordsAccumulator()); badRecordsSeen = 0; String baseName=""; if (op != null) { baseName = "(" + op.resultSetNumber() + ") " + op.getName() + " "; } this.rowsRead = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows read"); this.rowsFiltered = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows filtered"); this.rowsWritten = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows written"); this.rowsJoinedLeft = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows joined left"); this.rowsJoinedRight = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows joined right"); this.rowsProduced = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows produced"); initWritePipeline(); List<SpliceOperation> operations=getOperation().getSubOperations(); if(operations!=null){ for(SpliceOperation operation : operations){ if(operation.getOperationContext()!=null) operation.getOperationContext().reset(); } } }

Target:
public void reset(){ if (this.permissive) { BadRecordsRecorder oldRecorder = this.badRecordsAccumulator.value(); BadRecordsRecorder badRecordsRecorder = new BadRecordsRecorder( oldRecorder.getStatusDirectory(), importFileName, badRecordThreshold); this.badRecordsAccumulator = SpliceSpark.getContext().accumulable(badRecordsRecorder, badRecordsRecorder.getUniqueName(), new BadRecordsAccumulator()); } badRecordsSeen = 0; String baseName=""; if (op != null) { baseName = "(" + op.resultSetNumber() + ") " + op.getName() + " "; } this.rowsRead = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows read"); this.rowsFiltered = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows filtered"); this.rowsWritten = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows written"); this.rowsJoinedLeft = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows joined left"); this.rowsJoinedRight = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows joined right"); this.rowsProduced = SpliceSpark.getContext().sc().longAccumulator(baseName + "rows produced"); initWritePipeline(); List<SpliceOperation> operations=getOperation().getSubOperations(); if(operations!=null){ for(SpliceOperation operation : operations){ if(operation.getOperationContext()!=null) operation.getOperationContext().reset(); } } }
Source:
public static void main(String[] args) { TpchStatisticsRecorder tool = new TpchStatisticsRecorder(new TableStatisticsRecorder(), new TableStatisticsDataRepository(createObjectMapper())); ImmutableList.of("tiny", "sf1").forEach(schemaName -> { TpchTable.getTables() .forEach(table -> tool.computeAndOutputStatsFor(schemaName, table)); Stream.of("F", "O", "P").forEach(partitionValue -> tool.computeAndOutputStatsFor(schemaName, ORDERS, ORDER_STATUS, partitionValue)); }); }

Target:
public static void main(String[] args) { TpchStatisticsRecorder tool = new TpchStatisticsRecorder(new TableStatisticsRecorder(), new TableStatisticsDataRepository(createObjectMapper())); SUPPORTED_SCHEMAS.forEach(schemaName -> { TpchTable.getTables() .forEach(table -> tool.computeAndOutputStatsFor(schemaName, table)); Stream.of("F", "O", "P").forEach(partitionValue -> tool.computeAndOutputStatsFor(schemaName, ORDERS, ORDER_STATUS, partitionValue)); }); }
Source:
private List<ImapResponse> handlePermanentXoauth2Failure(NegativeImapResponseException e) throws AuthenticationFailedException { Log.v(LOG_TAG, "Permanent failure during XOAUTH2", e); throw new AuthenticationFailedException(e.getMessage(), e); }

Target:
private AuthenticationFailedException handlePermanentXoauth2Failure(NegativeImapResponseException e) { Timber.v(e, "Permanent failure during XOAUTH2"); return new AuthenticationFailedException(e.getMessage(), e); }
Source:
default boolean supports(Class<? extends ProjectFacet> facet) { return getBundledFacets() .stream() .anyMatch((includedFacet) -> facet.isAssignableFrom(includedFacet)); }

Target:
default boolean supports(Class<? extends ProjectFacet> facet) { Set<Class<? extends ProjectFacet>> excludedFacets = getExcludedFacets(); return getIncludedFacets() .stream() .anyMatch((includedFacet) -> facet.isAssignableFrom(includedFacet) && !excludedFacets.contains(includedFacet)); }
Source:
private void createStore(boolean slow) throws PersistenceException { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); DummyInMemoryStoreConfigurationBuilder dummyCfg = builder .persistence() .addStore(DummyInMemoryStoreConfigurationBuilder.class) .storeName(AsyncStoreTest.class.getName()); dummyCfg .async() .enable() .threadPoolSize(10); dummyCfg.slow(slow); InitializationContext ctx = PersistenceMockUtil.createContext(getClass().getSimpleName(), builder.build(), marshaller); DummyInMemoryStore underlying = new DummyInMemoryStore(); underlying.init(ctx); underlying.start(); writer = new SlowAdvancedAsyncCacheWriter(underlying); writer.init(ctx); loader = new AdvancedAsyncCacheLoader(underlying, writer.getState()); loader.init(ctx); writer.start(); loader.start(); eventually(writer::isAvailable); }

Target:
private void createStore(boolean slow) throws PersistenceException { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); DummyInMemoryStoreConfigurationBuilder dummyCfg = builder .persistence() .addStore(DummyInMemoryStoreConfigurationBuilder.class) .storeName(AsyncStoreTest.class.getName()); dummyCfg .async() .enable() .threadPoolSize(10); dummyCfg.slow(slow); InitializationContext ctx = PersistenceMockUtil.createContext(getClass().getSimpleName(), builder.build(), marshaller); DummyInMemoryStore underlying = new DummyInMemoryStore(); underlying.init(ctx); underlying.start(); writer = new SlowAdvancedAsyncCacheWriter(underlying); writer.init(ctx); writer.start(); loader = new AdvancedAsyncCacheLoader(underlying, writer.getState()); loader.init(ctx); loader.start(); eventually(writer::isAvailable); }
Source:
protected boolean isAutoClaim(KieSession session, WorkItem workItem, Task task) { if(Boolean.parseBoolean((String)session.getEnvironment().get("Autoclaim"))) { String swimlaneUser = (String) workItem.getParameter("SwimlaneActorId"); if (swimlaneUser != null && !"".equals(swimlaneUser) && task.getTaskData().getStatus() == Status.Ready) { return true; } } return false; }

Target:
protected boolean isAutoClaim(KieSession session, WorkItem workItem, Task task) { String autoclaim = (String) session.getEnvironment().get("Autoclaim"); if(autoclaim != null && !Boolean.parseBoolean(autoclaim.trim())) { return false; } else { String swimlaneUser = (String) workItem.getParameter("SwimlaneActorId"); if (swimlaneUser != null && !"".equals(swimlaneUser) && task.getTaskData().getStatus() == Status.Ready) { return true; } } return false; }
Source:
public void stop() { metricsRepoter.close(); }

Target:
public void stop() { if (metricsReporter != null) { metricsReporter.close(); } }
Source:
private Comparator<Schedulable> createComparator(int clusterMem, int clusterCpu) { DominantResourceFairnessPolicy policy = new DominantResourceFairnessPolicy(); FSContext fsContext = mock(FSContext.class); when(fsContext.getClusterResource()). thenReturn(BuilderUtils.newResource(clusterMem, clusterCpu)); policy.initialize(fsContext); return policy.getComparator(); }

Target:
private Comparator<Schedulable> createComparator(int clusterMem, int clusterCpu) { DominantResourceFairnessPolicy policy = new DominantResourceFairnessPolicy(); FSContext fsContext = mock(FSContext.class); when(fsContext.getClusterResource()). thenReturn(Resources.createResource(clusterMem, clusterCpu)); policy.initialize(fsContext); return policy.getComparator(); }
Source:
public void listenForResponses(String topic, Message requestMessage) { this.topic = topic; this.requestMessage = requestMessage; collectorSubscriber.registerCollector(topic, this); channelManager.subscribe(this.topic, collectorSubscriber); }

Target:
public void listenForResponses(String topic, Message requestMessage) { this.requestMessage = requestMessage; collectorManager = findOrCreateCollectorManager(topic); collectorManager.registerCollector(this); }
Source:
public String getUrlWithMethod(String url, String method) { url = url.toLowerCase() .replaceAll("https://", "") .replaceAll("http://", ""); return (method + "://" + getPiwigoBaseFor(url)); }

Target:
public String getUrlWithMethod(String url, String method) { url = url .replaceAll("(?i)https://", "") .replaceAll("(?i)http://", ""); return (method + "://" + getPiwigoBaseFor(url)); }
Source:
protected void checkObjectTypeDefinition(Set<SwaggerError> errors, AbstractNode node) { if (node instanceof ObjectNode) { JsonPointer ptr = node.getPointer(); if (ptr != null && ptr.toString().startsWith("/definitions")) { checkMissingType(errors, node); checkMissingRequiredProperties(errors, node); } } }

Target:
protected void checkObjectTypeDefinition(Set<SwaggerError> errors, AbstractNode node) { if (node instanceof ObjectNode) { JsonPointer ptr = node.getPointer(); if (ptr != null) { if (ptr.toString().startsWith("/definitions")) { checkMissingType(errors, node); checkMissingRequiredProperties(errors, node); } else if (ptr.toString().endsWith("/schema")) { checkMissingType(errors, node); checkMissingRequiredProperties(errors, node); } } } }
Source:
public boolean requestPipeExtension(World world, BlockPos pos, EnumFacing dir, IStripesActivator stripes, ItemStack stack) { if (world.isRemote || stack.isEmpty() || !(stack.getItem() instanceof IItemPipe)) { return false; } return requests.computeIfAbsent(world.provider.getDimension(), i -> new LinkedHashSet<>()) .add(new PipeExtensionRequest(pos, dir, stripes, ((IItemPipe) stack.getItem()).getDefinition(), stack.copy())); }

Target:
public boolean requestPipeExtension(World world, BlockPos pos, EnumFacing dir, IStripesActivator stripes, ItemStack stack) { if (world.isRemote || stack.isEmpty() || !(stack.getItem() instanceof IItemPipe)) { return false; } int id = world.provider.getDimension(); List<PipeExtensionRequest> rList = requests.get(id); if (rList == null) { requests.put(id, rList = new ArrayList<>()); } return rList.add(new PipeExtensionRequest(pos, dir, stripes, ((IItemPipe) stack.getItem()).getDefinition(), stack.copy())); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View layout = inflater.inflate(R.layout.fragment_settings, container, false); wifiSwitch = (Switch) layout.findViewById(R.id.wifi_setting); mSDCardSwitch = (Switch) layout.findViewById(R.id.download_location_switch); updateWifiSwitch(); updateSDCardSwitch(); final LinearLayout settingsLayout = (LinearLayout) layout.findViewById(R.id.settings_layout); for (SettingsExtension extension : extensionRegistry.forType(SettingsExtension.class)) { extension.onCreateSettingsView(settingsLayout); } return layout; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View layout = inflater.inflate(R.layout.fragment_settings, container, false); wifiSwitch = (Switch) layout.findViewById(R.id.wifi_setting); sdCardSwitch = (Switch) layout.findViewById(R.id.download_location_switch); sdCardSettinglayout = (LinearLayout) layout.findViewById(R.id.sd_card_setting_layout); updateWifiSwitch(); updateSDCardSwitch(); final LinearLayout settingsLayout = (LinearLayout) layout.findViewById(R.id.settings_layout); for (SettingsExtension extension : extensionRegistry.forType(SettingsExtension.class)) { extension.onCreateSettingsView(settingsLayout); } return layout; }
Source:
public StateDescription getStateDescription(Locale locale) { StateDescription fullStateDescription = null; if (stateDescriptionProviders != null) { BigDecimal minimum = null; BigDecimal maximum = null; BigDecimal step = null; String pattern = null; boolean readOnly = false; List<StateOption> options = null; boolean found = false; for (StateDescriptionProvider stateDescriptionProvider : stateDescriptionProviders) { StateDescription stateDescription = stateDescriptionProvider.getStateDescription(this.name, locale); if (stateDescription != null) { found = true; if (minimum == null) { minimum = stateDescription.getMinimum(); } if (maximum == null) { maximum = stateDescription.getMaximum(); } if (step == null) { step = stateDescription.getStep(); } if (pattern == null) { pattern = stateDescription.getPattern(); } if (stateDescription.isReadOnly()) { readOnly = true; } if (options == null) { options = stateDescription.getOptions(); } } } if (found) { fullStateDescription = new StateDescription(minimum, maximum, step, pattern, readOnly, options); } } return fullStateDescription; }

Target:
public StateDescription getStateDescription(Locale locale) { if (stateDescriptionProviders != null) { for (StateDescriptionProvider stateDescriptionProvider : stateDescriptionProviders) { StateDescription stateDescription = stateDescriptionProvider.getStateDescription(this.name, locale); if (stateDescription != null) { return stateDescription; } } } return null; }
Source:
private void createHeadLink(final Repository repository, Composite composite) throws IOException { ObjectId objectId = null; String fullBranch = repository.getFullBranch(); if (fullBranch != null) { objectId = repository.resolve(fullBranch); } if (objectId == null) { Text headLabel = createLabeledReadOnlyText(composite, UIText.GitProjectPropertyPage_LabelId); if (repository.getRefDatabase().getRefsByPrefix(RefDatabase.ALL) .isEmpty()) headLabel.setText(UIText.GitProjectPropertyPage_ValueEmptyRepository); else headLabel.setText(UIText.GitProjectPropertyPage_ValueUnbornBranch); } else { Hyperlink headLink = createHeadHyperLink(composite, UIText.GitProjectPropertyPage_LabelId); headLink.setText(objectId.name()); headLink.setUnderlined(true); headLink.setFont(JFaceResources.getDialogFont()); headLink.setForeground(JFaceColors.getHyperlinkText(headLink .getDisplay())); ObjectId linkObjectId = objectId; headLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { RepositoryCommit commit = getCommit(repository, linkObjectId); if(commit != null) CommitEditor.openQuiet(commit); } }); } }

Target:
private void createHeadLink(final Repository repository, Composite composite) throws IOException { String fullBranch = repository.getFullBranch(); final ObjectId objectId = (fullBranch != null) ? repository.resolve(fullBranch) : null; if (objectId == null) { Text headLabel = createLabeledReadOnlyText(composite, UIText.GitProjectPropertyPage_LabelId); if (repository.getRefDatabase().getRefsByPrefix(RefDatabase.ALL) .isEmpty()) headLabel.setText(UIText.GitProjectPropertyPage_ValueEmptyRepository); else headLabel.setText(UIText.GitProjectPropertyPage_ValueUnbornBranch); } else { Hyperlink headLink = createHeadHyperLink(composite, UIText.GitProjectPropertyPage_LabelId); headLink.setText(objectId.name()); headLink.setUnderlined(true); headLink.setFont(JFaceResources.getDialogFont()); headLink.setForeground(JFaceColors.getHyperlinkText(headLink .getDisplay())); headLink.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { RepositoryCommit commit = getCommit(repository, objectId); if(commit != null) CommitEditor.openQuiet(commit); } }); } }
Source:
public CompletableFuture<?> getAvailableFuture() { if (inputSelectionHandler.areAllInputsSelected() || (inputSelectionHandler.isInputUnavailable(0) && !inputSelectionHandler.isInputUnavailable(1))) { return isAnyInputAvailable(); } else { StreamOneInputProcessor<?> input = (inputSelectionHandler.isFirstInputSelected()) ? processor1 : processor2; return input.getAvailableFuture(); } }

Target:
public CompletableFuture<?> getAvailableFuture() { if (inputSelectionHandler.areAllInputsSelected()) { return isAnyInputAvailable(); } else { StreamOneInputProcessor<?> input = (inputSelectionHandler.isFirstInputSelected()) ? processor1 : processor2; return input.getAvailableFuture(); } }