auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Toolbar createMainToolbar() { Toolbar toolbar = new Toolbar("Find Output Tab"); searchLabel_ = new Label(); toolbar.addLeftWidget(searchLabel_); stopSearch_ = new ToolbarButton( ToolbarButton.NoText, "Stop find in files", commands_.interruptR().getImageResource()); stopSearch_.setVisible(false); toolbar.addRightWidget(stopSearch_); showFindButton_ = new LeftRightToggleButton("Find", "Replace", false); showFindButton_.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (!replaceMode_) { showFindButton_.setVisible(false); showReplaceButton_.setVisible(true); setReplaceMode(true); setSecondaryToolbarVisible(true); if (displayPreview_ == null) createDisplayPreview(); if (!replaceTextBox_.getValue().isEmpty()) displayPreview_.nudge(); } } }); toolbar.addRightWidget(showFindButton_); showReplaceButton_ = new LeftRightToggleButton("Find", "Replace", true); showReplaceButton_.setVisible(false); showReplaceButton_.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (replaceMode_) { showFindButton_.setVisible(true); showReplaceButton_.setVisible(false); setSecondaryToolbarVisible(false); if (!replaceTextBox_.getValue().isEmpty()) { setRegexPreviewMode(false); addReplaceMatches(new String()); } setReplaceMode(false); } } }); toolbar.addRightWidget(showReplaceButton_); return toolbar; }

Target:
protected Toolbar createMainToolbar() { Toolbar toolbar = new Toolbar("Find Output Tab"); searchLabel_ = new Label(); toolbar.addLeftWidget(searchLabel_); stopSearch_ = new ToolbarButton( ToolbarButton.NoText, "Stop find in files", commands_.interruptR().getImageResource()); stopSearch_.setVisible(false); toolbar.addRightWidget(stopSearch_); showFindButton_ = new LeftRightToggleButton("Find", "Replace", true); showFindButton_.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (!replaceMode_) { showFindButton_.setVisible(false); showReplaceButton_.setVisible(true); setReplaceMode(true); setSecondaryToolbarVisible(true); if (displayPreview_ == null) createDisplayPreview(); if (!replaceTextBox_.getValue().isEmpty()) displayPreview_.nudge(); } } }); toolbar.addRightWidget(showFindButton_); showReplaceButton_ = new LeftRightToggleButton("Find", "Replace", false); showReplaceButton_.setVisible(false); showReplaceButton_.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (replaceMode_) { showFindButton_.setVisible(true); showReplaceButton_.setVisible(false); setSecondaryToolbarVisible(false); if (!replaceTextBox_.getValue().isEmpty()) { addReplaceMatches(new String()); } setReplaceMode(false); } } }); toolbar.addRightWidget(showReplaceButton_); return toolbar; }
Source:
private void closeScope() { if (openTracingService == null) { return; } Tracer tracer = openTracingService.getTracer(PAYARA_CORBA_RMI_TRACER_NAME); if (tracer == null) { return; } try (Scope activeScope = tracer.scopeManager().active()) { } }

Target:
private void closeScope() { if (!tracerAvailable()) { return; } try (Scope activeScope = tracer.scopeManager().active()) { } }
Source:
public C anyRequest() { if (this.anyRequestConfigured) { Assert.state(!anyRequestConfigured, "Can't configure anyRequest after itself"); } this.anyRequestConfigured = true; return requestMatchers(ANY_REQUEST); }

Target:
public C anyRequest() { Assert.state(!this.anyRequestConfigured, "Can't configure anyRequest after itself"); C configurer = requestMatchers(ANY_REQUEST); this.anyRequestConfigured = true; return configurer; }
Source:
private String applyUrlRewrites(String url) { for (String rewrite : urlRewrites) { if (!rewrite.contains(":") || rewrite.startsWith(":")) { continue; } String[] tokens = rewrite.split(":"); String path = tokens[0]; String replacement = tokens.length > 1 ? tokens[1] : ""; if (url.contains(path)) { url = url.replaceFirst(path, replacement); break; } } return url; }

Target:
private String applyUrlRewrites(String url) { try { String path = URI.create(url).getPath(); for (Map.Entry<String, String> rewrite : urlRewrites.entrySet()) { if (path.startsWith(rewrite.getKey())) { return url.replaceFirst(rewrite.getKey(), rewrite.getValue()); } } return url; } catch (IllegalArgumentException e) { return url; } }
Source:
public static Comment newComment(long issueId, int newCommentId, String comment) { DateTime now = DateTime.now(); Long id = Long.parseLong(issueId + "0" + newCommentId); URI selfUri = URI.create(TEST_JIRA_URL + "/rest/api/latest/issue/" + issueId + "/comment"); return new Comment(selfUri, comment, null, null, now, null, null, id); }

Target:
public static Comment newComment(long issueId, int newCommentId, String comment) { DateTime now = DateTime.now(); long id = Long.parseLong(issueId + "0" + newCommentId); URI selfUri = URI.create(TEST_JIRA_URL + "/rest/api/latest/issue/" + issueId + "/comment"); return new Comment(selfUri, comment, null, null, now, null, null, id); }
Source:
public List<Map.Entry<String, RubricRecipientStatistics>> getPerRecipientStatisticsSorted( List<FeedbackResponseAttributes> responses, FeedbackSessionResultsBundle bundle) { Map<String, RubricRecipientStatistics> recipientToRecipientStats = new HashMap<>(); for (FeedbackResponseAttributes response : responses) { recipientToRecipientStats.computeIfAbsent(response.recipient, (String recipient) -> { String recipientTeam = bundle.getTeamNameForEmail(recipient); String recipientName = bundle.getNameForEmail(recipient); return new RubricRecipientStatistics(recipient, recipientName, recipientTeam); }); recipientToRecipientStats.get(response.recipient).addResponseToRecipientStats(response); } List<Map.Entry<String, RubricRecipientStatistics>> recipientStatsList = new LinkedList<>(recipientToRecipientStats.entrySet()); Collections.sort(recipientStatsList, new Comparator<Map.Entry<String, RubricRecipientStatistics>>() { @Override public int compare(Entry<String, RubricRecipientStatistics> o1, Entry<String, RubricRecipientStatistics> o2) { RubricRecipientStatistics a = o1.getValue(); RubricRecipientStatistics b = o2.getValue(); if (a.recipientTeam.equalsIgnoreCase(b.recipientTeam)) { return a.recipientName.compareTo(b.recipientName); } else { return a.recipientTeam.compareTo(b.recipientTeam); } } }); return recipientStatsList; }

Target:
public List<Map.Entry<String, RubricRecipientStatistics>> getPerRecipientStatisticsSorted( List<FeedbackResponseAttributes> responses, FeedbackSessionResultsBundle bundle) { Map<String, RubricRecipientStatistics> recipientToRecipientStats = new HashMap<>(); for (FeedbackResponseAttributes response : responses) { recipientToRecipientStats.computeIfAbsent(response.recipient, recipient -> { String recipientTeam = bundle.getTeamNameForEmail(recipient); String recipientName = bundle.getNameForEmail(recipient); return new RubricRecipientStatistics(recipient, recipientName, recipientTeam); }) .addResponseToRecipientStats(response); } List<Map.Entry<String, RubricRecipientStatistics>> recipientStatsList = new LinkedList<>(recipientToRecipientStats.entrySet()); recipientStatsList.sort(Comparator.comparing((Map.Entry<String, RubricRecipientStatistics> obj) -> obj.getValue().recipientTeam.toLowerCase()) .thenComparing(obj -> obj.getValue().recipientName)); return recipientStatsList; }
Source:
private Block createAlternatingNullsBlock(Block testBlock) { BlockBuilder nullsBlockBuilder = type.createBlockBuilder(null, testBlock.getPositionCount()); for (int position = 0; position < testBlock.getPositionCount(); position++) { if (testBlock.isNull(position)) { nullsBlockBuilder.appendNull(); } else if (type.getJavaType() == boolean.class) { type.writeBoolean(nullsBlockBuilder, type.getBoolean(testBlock, position)); } else if (type.getJavaType() == long.class) { type.writeLong(nullsBlockBuilder, type.getLong(testBlock, position)); } else if (type.getJavaType() == double.class) { type.writeDouble(nullsBlockBuilder, type.getDouble(testBlock, position)); } else if (type.getJavaType() == Slice.class) { Slice slice = type.getSlice(testBlock, position); type.writeSlice(nullsBlockBuilder, slice, 0, slice.length()); } else { type.writeObject(nullsBlockBuilder, type.getObject(testBlock, position)); } nullsBlockBuilder.appendNull(); } return nullsBlockBuilder.build(); }

Target:
private Block createAlternatingNullsBlock(Block testBlock) { BlockBuilder nullsBlockBuilder = type.createBlockBuilder(null, testBlock.getPositionCount()); for (int position = 0; position < testBlock.getPositionCount(); position++) { if (testBlock.isNull(position)) { checkState(type instanceof UnknownType); nullsBlockBuilder.appendNull(); } else if (type.getJavaType() == boolean.class) { type.writeBoolean(nullsBlockBuilder, type.getBoolean(testBlock, position)); } else if (type.getJavaType() == long.class) { type.writeLong(nullsBlockBuilder, type.getLong(testBlock, position)); } else if (type.getJavaType() == double.class) { type.writeDouble(nullsBlockBuilder, type.getDouble(testBlock, position)); } else if (type.getJavaType() == Slice.class) { Slice slice = type.getSlice(testBlock, position); type.writeSlice(nullsBlockBuilder, slice, 0, slice.length()); } else { type.writeObject(nullsBlockBuilder, type.getObject(testBlock, position)); } nullsBlockBuilder.appendNull(); } return nullsBlockBuilder.build(); }
Source:
protected PartialList<String> doQuery(String query, String queryType, QueryFilter queryFilter, int countUpTo) { final Timer.Context timerContext = queryTimer.time(); try { Mutable<String> idKeyHolder = new MutableObject<>(); PartialList<Map<String, Serializable>> pl = doQueryAndFetch(query, queryType, queryFilter, false, countUpTo, idKeyHolder); String idKey = idKeyHolder.getValue(); List<String> ids = new ArrayList<>(pl.size()); for (Map<String, Serializable> map : pl) { Serializable id = map.get(idKey); if (id != null) ids.add(String.valueOf(id)); } return new PartialList<>(ids, pl.totalSize()); } finally { long duration = timerContext.stop(); if (LOG_MIN_DURATION_NS >= 0 && duration > LOG_MIN_DURATION_NS) { String msg = String.format("duration_ms:\t%.2f\t%s %s\tquery\t%s", duration / 1000000.0, queryFilter, countUpToAsString(countUpTo), query); if (log.isTraceEnabled()) { log.info(msg, new Throwable("Slow query stack trace")); } else { log.info(msg); } } } }

Target:
protected PartialList<String> doQuery(String query, String queryType, QueryFilter queryFilter, int countUpTo) { final Timer.Context timerContext = queryTimer.time(); try { Mutable<String> idKeyHolder = new MutableObject<>(); PartialList<Map<String, Serializable>> pl = doQueryAndFetch(query, queryType, queryFilter, false, countUpTo, idKeyHolder); String idKey = idKeyHolder.getValue(); List<String> ids = new ArrayList<>(pl.size()); for (Map<String, Serializable> map : pl) { String id = (String) map.get(idKey); ids.add(id); } return new PartialList<>(ids, pl.totalSize()); } finally { long duration = timerContext.stop(); if (LOG_MIN_DURATION_NS >= 0 && duration > LOG_MIN_DURATION_NS) { String msg = String.format("duration_ms:\t%.2f\t%s %s\tquery\t%s", duration / 1000000.0, queryFilter, countUpToAsString(countUpTo), query); if (log.isTraceEnabled()) { log.info(msg, new Throwable("Slow query stack trace")); } else { log.info(msg); } } } }
Source:
private int longEqual(Object actual, Object expected) { if (!(actual instanceof Number && expected instanceof Number)) { return -1; } Long actualLong = ((Number) actual).longValue(); Long expectedLong = ((Number) expected).longValue(); return actualLong.compareTo(expectedLong); }

Target:
private int longEqual(Object actual, Object expected) { if (!(isLongOrNarrower(actual) && isLongOrNarrower(expected))) { return -1; } Long actualLong = ((Number) actual).longValue(); Long expectedLong = ((Number) expected).longValue(); return actualLong.compareTo(expectedLong); }
Source:
public MistformUltimus(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.supertype.add("Legendary"); this.subtype.add("Illusion"); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(ChangelingAbility.getInstance()); }

Target:
public MistformUltimus(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.supertype.add("Legendary"); this.subtype.add("Illusion"); this.power = new MageInt(3); this.toughness = new MageInt(3); this.subtype.add(ChangelingAbility.ALL_CREATURE_TYPE); }
Source:
private ClassLoaderLookupPolicy getApplicationClassLoaderLookupPolicy(ArtifactClassLoader parent, ApplicationDescriptor descriptor) { final Map<String, LookupStrategy> pluginsLookupStrategies = new SmallMap<>(); for (ArtifactPluginDescriptor artifactPluginDescriptor : descriptor.getPlugins()) { artifactPluginDescriptor.getClassLoaderModel().getExportedPackages() .forEach(p -> pluginsLookupStrategies.put(p, PARENT_FIRST)); } return parent.getClassLoaderLookupPolicy().extend(pluginsLookupStrategies); }

Target:
private ClassLoaderLookupPolicy getApplicationClassLoaderLookupPolicy(ArtifactClassLoader parent, ApplicationDescriptor descriptor) { final Map<String, LookupStrategy> pluginsLookupStrategies = new HashMap<>(); for (ArtifactPluginDescriptor artifactPluginDescriptor : descriptor.getPlugins()) { artifactPluginDescriptor.getClassLoaderModel().getExportedPackages() .forEach(p -> pluginsLookupStrategies.put(p, PARENT_FIRST)); } return parent.getClassLoaderLookupPolicy().extend(pluginsLookupStrategies); }
Source:
public SyncLunsParameters(Guid storagePoolId) { super(storagePoolId); }

Target:
public SyncLunsParameters(Guid storagePoolId) { this(storagePoolId, null); }
Source:
private static void updateTimeoutLogableObject(AuditLogableBase auditLogable, AuditLogType logType) { int duplicateEventsIntrvalValue = (auditLogable.isExternal()) ? Math.max(auditLogable.getEventFloodInSec(), 30) : logType.getEventFloodRate(); if (duplicateEventsIntrvalValue > 0) { auditLogable.setEndTime(TimeUnit.SECONDS.toMillis(duplicateEventsIntrvalValue)); auditLogable.setTimeoutObjectId(composeObjectId(auditLogable, logType)); } }

Target:
private static void updateTimeoutLogableObject(AuditLogableBase auditLogable, AuditLogType logType) { int eventFloodRate = (auditLogable.isExternal()) ? Math.max(auditLogable.getEventFloodInSec(), 30) : logType.getEventFloodRate(); if (eventFloodRate > 0) { auditLogable.setEndTime(TimeUnit.SECONDS.toMillis(eventFloodRate)); auditLogable.setTimeoutObjectId(composeObjectId(auditLogable, logType)); } }
Source:
protected static boolean shouldServiceVersionBeTested(ConfigurationServiceVersion serviceVersion) { if (Configuration.getGlobalConfiguration().get(AZURE_TEST_SERVICE_VERSIONS) == null) { return ConfigurationServiceVersion.getLatest().equals(serviceVersion); } return true; }

Target:
private static boolean shouldServiceVersionBeTested(ConfigurationServiceVersion serviceVersion) { if (CoreUtils.isNullOrEmpty(SERVICE_VERSION_FROM_ENV)) { return ConfigurationServiceVersion.getLatest().equals(serviceVersion); } if (AZURE_TEST_SERVICE_VERSIONS_VALUE_ALL.equalsIgnoreCase(SERVICE_VERSION_FROM_ENV)) { return true; } String[] configuredServiceVersionList = SERVICE_VERSION_FROM_ENV.split(","); return Arrays.stream(configuredServiceVersionList).anyMatch(configuredServiceVersion -> serviceVersion.toString().equals(configuredServiceVersion.trim())); }
Source:
public SpiTransaction createQueryTransaction(Object tenantId) { SpiTransaction t = transactionManager.createQueryTransaction(tenantId); try { transactionScopeManager.set(t); } catch (PersistenceException existingTransactionError) { t.end(); throw existingTransactionError; } return t; }

Target:
public SpiTransaction createQueryTransaction(Object tenantId) { SpiTransaction t = transactionManager.createQueryTransaction(tenantId); return t; }
Source:
public Map<Integer, String> getExperimentSampleMap(final Integer studyDbId) { Map<Integer, String> samplesMap = new HashMap<>(); try { final SQLQuery query = this.getSession().createSQLQuery(SQL_SAMPLES_AND_EXPERIMENTS); query.setParameter("studyId", studyDbId); List results = query.list(); for (Object o : results) { Object[] result = (Object[]) o; if (result != null) { samplesMap.put((Integer) result[0], (String) result[1]); } } } catch (HibernateException he) { throw new MiddlewareException( "Unexpected error in executing getExperimentSampleMap(studyDbId = " + studyDbId + ") query: " + he.getMessage(), he); } return samplesMap; }

Target:
public Map<Integer, String> getExperimentSampleMap(final Integer studyDbId) { final Map<Integer, String> samplesMap = new HashMap<>(); try { final SQLQuery query = this.getSession().createSQLQuery(SQL_SAMPLES_AND_EXPERIMENTS); query.setParameter("studyId", studyDbId); final List results = query.list(); for (final Object o : results) { final Object[] result = (Object[]) o; if (result != null) { samplesMap.put((Integer) result[0], (String) result[1]); } } } catch (HibernateException he) { throw new MiddlewareException( "Unexpected error in executing getExperimentSampleMap(studyDbId = " + studyDbId + ") query: " + he.getMessage(), he); } return samplesMap; }
Source:
void peekWithSequenceOneMessage() { final int numberOfEvents = 1; final int fromSequenceNumber = 10; when(managementNode.peek(fromSequenceNumber)) .thenReturn(Mono.just(mock(ServiceBusReceivedMessage.class))); StepVerifier.create(consumer.peek(fromSequenceNumber)) .expectNextCount(numberOfEvents) .verifyComplete(); }

Target:
void peekWithSequenceOneMessage() { final int numberOfEvents = 1; final int fromSequenceNumber = 10; when(managementNode.peek(fromSequenceNumber)) .thenReturn(just(mock(ServiceBusReceivedMessage.class))); StepVerifier.create(consumer.peek(fromSequenceNumber)) .expectNextCount(numberOfEvents) .verifyComplete(); }
Source:
private List<TestInfo> prioritizeTests(ClassName clazz, Collection<TestInfo> testsForMutant) { final List<TestInfo> sortedTis = FCollection.map(testsForMutant, x -> x); Collections.sort(sortedTis, new TestInfoPriorisationComparator(clazz, TIME_WEIGHTING_FOR_DIRECT_UNIT_TESTS)); return sortedTis; }

Target:
private List<TestInfo> prioritizeTests(ClassName clazz, Collection<TestInfo> testsForMutant) { final List<TestInfo> sortedTis = new ArrayList<>(testsForMutant); sortedTis.sort(new TestInfoPriorisationComparator(clazz, TIME_WEIGHTING_FOR_DIRECT_UNIT_TESTS)); return sortedTis; }
Source:
public static boolean isNoneEmpty(CharSequence... css) { if (ArrayUtils.isEmpty(css)) { return false; } for (CharSequence cs : css){ if (isEmpty(cs)) { return false; } } return true; }

Target:
public static boolean isNoneEmpty(CharSequence... css) { return !isAnyEmpty(css); }
Source:
public static void main(String[] args) { String classifierName = null; String labelerName = null; String parserName = null; String inputFile = null; try { classifierName = args[0]; labelerName = args[1]; parserName = args[2]; inputFile = args[3]; if (args.length > 4) throw new Exception(); } catch (Exception e) { logger.error( "usage: java edu.illinois.cs.cogcomp.lbjava.edu.illinois.cs.cogcomp.lbjava.nlp.seg.BIOTester <classifier> <labeler> <parser> <test file>"); System.exit(1); } Classifier classifier = ClassUtils.getClassifier(classifierName); Classifier labeler = ClassUtils.getClassifier(labelerName); Parser parser = ClassUtils.getParser(parserName, new Class[]{String.class}, new String[]{inputFile}); new BIOTester(classifier, labeler, parser) .test().printPerformance(System.out); }

Target:
public static void main(String[] args) { String classifierName = null; String labelerName = null; String parserName = null; String inputFile = null; try { classifierName = args[0]; labelerName = args[1]; parserName = args[2]; inputFile = args[3]; if (args.length > 4) throw new Exception(); } catch (Exception e) { System.err.println( "usage: java edu.illinois.cs.cogcomp.lbjava.edu.illinois.cs.cogcomp.lbjava.nlp.seg.BIOTester <classifier> <labeler> <parser> <test file>"); System.exit(1); } Classifier classifier = ClassUtils.getClassifier(classifierName); Classifier labeler = ClassUtils.getClassifier(labelerName); Parser parser = ClassUtils.getParser(parserName, new Class[]{String.class}, new String[]{inputFile}); new BIOTester(classifier, labeler, parser) .test().printPerformance(System.out); }
Source:
public void start() throws IOException, InterruptedException { logger.info("Starting processor threads", numProcessorThreads); for (int i = 0; i < numProcessorThreads; i++) { processors.add(i, new Processor(i, maxRequestSize, requestResponseChannel, metrics)); Utils.newThread("ambry-processor-" + port + " " + i, processors.get(i), false).start(); } requestResponseChannel.addResponseListener(new ResponseListener() { @Override public void onResponse(int processorId) { processors.get(processorId).wakeup(); } }); try { startAcceptors(); } catch (IOException e) { shutdown(); throw e; } for (Acceptor acceptor : acceptors) { acceptor.awaitStartup(); } logger.info("Started server"); }

Target:
public void start() throws IOException, InterruptedException { logger.info("Starting processor threads", numProcessorThreads); for (int i = 0; i < numProcessorThreads; i++) { processors.add(i, new Processor(i, maxRequestSize, requestResponseChannel, metrics)); Utils.newThread("ambry-processor-" + port + " " + i, processors.get(i), false).start(); } requestResponseChannel.addResponseListener(new ResponseListener() { @Override public void onResponse(int processorId) { processors.get(processorId).wakeup(); } }); logger.info("Starting acceptor threads"); Acceptor plainTextAcceptor = new Acceptor(host, port, processors, sendBufferSize, recvBufferSize, metrics); this.acceptors.add(plainTextAcceptor); Utils.newThread("ambry-acceptor", plainTextAcceptor, false).start(); Port sslPort = ports.get(PortType.SSL); if (sslPort != null) { SSLAcceptor sslAcceptor = new SSLAcceptor(host, sslPort.getPort(), processors, sendBufferSize, recvBufferSize, metrics); acceptors.add(sslAcceptor); Utils.newThread("ambry-sslacceptor", sslAcceptor, false).start(); } for (Acceptor acceptor : acceptors) { acceptor.awaitStartup(); } logger.info("Started server"); }
Source:
private void clearDestinationHost() { nicsMap.values().forEach(nic -> { if (nic.isPartOfBond()) { Guid bondId = calcDestinationInterfacesIdByName().get(nic.getBondName()); bondsToRemove.add(bondId); List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(bondId); attachmentsToRemove.addAll(destAttachmentIds); } List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(nic.getId()); attachmentsToRemove.addAll(destAttachmentIds); }); }

Target:
private void clearDestinationHost() { nicsMap.values().forEach(nic -> { Guid idToRemove = nic.getId(); if (nic.isPartOfBond()) { idToRemove = calcDestinationInterfacesIdByName().get(nic.getBondName()); bondsToRemove.add(idToRemove); } List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(idToRemove); attachmentsToRemove.addAll(destAttachmentIds); }); }
Source:
public static void setState(String state, boolean timestamp) { if (instance == null) { return; } RichPresence.Builder builder = new RichPresence.Builder(); if (state != null) { builder.setState(state); if (getInstance() == null || (getInstance().lastState != null && !getInstance().lastState.equals(state))) { getInstance().lastState = state; } } if (getInstance().config != null) { String playerName = getInstance().config.getPlayer().getName(); builder.setDetails("IGN | " + playerName); } if (timestamp) { builder.setStartTimestamp(OffsetDateTime.now()); } builder.setLargeImage("ss_6"); getInstance().sendRichPresence(builder.build()); }

Target:
public static void setState(String state, boolean timestamp) { if (instance == null) { return; } RichPresence.Builder builder = new RichPresence.Builder(); if (state != null) { builder.setState(state); if (getInstance().lastState == null || (getInstance().lastState != null && !getInstance().lastState.equals(state))) { getInstance().lastState = state; } } if (getInstance().config != null) { String playerName = getInstance().config.getPlayer().getName(); builder.setDetails("Name: " + playerName); } if (timestamp) { builder.setStartTimestamp(OffsetDateTime.now()); } builder.setLargeImage(DISCORD_APP_LARGE_IMAGE); getInstance().sendRichPresence(builder.build()); }
Source:
synchronized void processTimeouts() { long cur = System.currentTimeMillis(); for (TrieNodeRequest request : new ArrayList<>(pendingNodes.values())) { synchronized (request.requestSent) { for (Map.Entry<Long, Long> requestEntry : request.requestSent.entrySet()) { if (cur - requestEntry.getValue() > REQUEST_TIMEOUT) { request.requestSent.remove(requestEntry.getKey()); purgePending(request.nodeHash); nodesQueue.addFirst(request); } } } } }

Target:
synchronized void processTimeouts() { long cur = System.currentTimeMillis(); for (TrieNodeRequest request : new ArrayList<>(pendingNodes.values())) { Iterator<Map.Entry<Long, Long>> reqIterator = request.requestSent.entrySet().iterator(); while (reqIterator.hasNext()) { Map.Entry<Long, Long> requestEntry = reqIterator.next(); if (cur - requestEntry.getValue() > REQUEST_TIMEOUT) { reqIterator.remove(); purgePending(request.nodeHash); nodesQueue.addFirst(request); } } } }
Source:
private Executor selectExecutor(ExecutableFlow exflow, Set<Executor> availableExecutors) { Executor choosenExecutor = getUserSpecifiedExecutor(exflow); if (choosenExecutor == null) { logger.info("Using dispatcher for execution id :" + exflow.getExecutionId()); ExecutorSelector selector = new ExecutorSelector(filterList, comparatorWeightsMap); choosenExecutor = selector.getBest(activeExecutors, exflow); } return choosenExecutor; }

Target:
private Executor selectExecutor(ExecutableFlow exflow, Set<Executor> availableExecutors) { Executor choosenExecutor = getUserSpecifiedExecutor(exflow.getExecutionOptions(), exflow.getExecutionId()); if (choosenExecutor == null) { logger.info("Using dispatcher for execution id :" + exflow.getExecutionId()); ExecutorSelector selector = new ExecutorSelector(filterList, comparatorWeightsMap); choosenExecutor = selector.getBest(activeExecutors, exflow); } return choosenExecutor; }
Source:
public static void sendJobCompletionEvent(final JSONObject payload) { final List<TeamCollectionConfiguration> connectedCollections = TeamCollectionConfiguration.getConnectedCollections(); for (final TeamCollectionConfiguration c : connectedCollections) { try { final ConnectionParameters connectionParameters = c.getConnectionParameters(); if (connectionParameters == null || !connectionParameters.isSendJobCompletionEvents()) { continue; } final TeamRestClient client = new TeamRestClient(URI.create(c.getCollectionUrl())); payload.put("server", connectionParameters.getConnectionKey()); final String jsonPayload = payload.toString(); final JobCompletionEventArgs args = new JobCompletionEventArgs( connectionParameters.getConnectionKey(), jsonPayload, getPayloadSignature(connectionParameters, jsonPayload)); client.sendJobCompletionEvent(args); } catch (final Exception e) { log.info("ERROR: sendJobCompletionEvent: (collection=" + c.getCollectionUrl() + ") " + e.getMessage()); } } }

Target:
public static void sendJobCompletionEvent(final JSONObject payload) { final List<TeamCollectionConfiguration> connectedCollections = TeamCollectionConfiguration.getConnectedCollections(); for (final TeamCollectionConfiguration c : connectedCollections) { try { final ConnectionParameters connectionParameters = c.getConnectionParameters(); final TeamRestClient client = new TeamRestClient(URI.create(c.getCollectionUrl())); payload.put("server", connectionParameters.getConnectionKey()); final String jsonPayload = payload.toString(); final JobCompletionEventArgs args = new JobCompletionEventArgs( connectionParameters.getConnectionKey(), jsonPayload, getPayloadSignature(connectionParameters, jsonPayload)); client.sendJobCompletionEvent(args); } catch (final Exception e) { log.warning("ERROR: sendJobCompletionEvent: (collection=" + c.getCollectionUrl() + ") " + e.getMessage()); } } }
Source:
public void serialize( final Instant instant, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider ) throws IOException { if (instant != null) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); jsonGenerator.writeString(df.format(Date.from(instant))); } else { jsonGenerator.writeNull(); } }

Target:
public void serialize( final Instant instant, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider ) throws IOException { if (instant != null) { DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, Locale.ROOT); jsonGenerator.writeString(formatter.format(Date.from(instant))); } else { jsonGenerator.writeNull(); } }
Source:
public void recognizeContentResultWithBlankPdf(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); SyncPoller<OperationResult, List<FormPage>> syncPoller = client.beginRecognizeContent(getReplayableBufferData(BLANK_FORM_LOCAL_URL), BLANK_FORM_FILE_LENGTH, FormContentType.APPLICATION_PDF, null).getSyncPoller(); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }

Target:
public void recognizeContentResultWithBlankPdf(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); blankPdfDataRunner((data, dataLength) -> { SyncPoller<OperationResult, List<FormPage>> syncPoller = client.beginRecognizeContent( new RecognizeOptions(toFluxByteBuffer(data), dataLength) .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }); }
Source:
InternalMachineConfig(MachineConfig originalConfig, InstallerRegistry installerRegistry) throws InfrastructureException { this.installers = new ArrayList<>(); this.servers = new HashMap<>(originalConfig.getServers()); this.env = new HashMap<>(originalConfig.getEnv()); this.attributes = new HashMap<>(originalConfig.getAttributes()); initInstallers(originalConfig.getInstallers(), installerRegistry); }

Target:
InternalMachineConfig(MachineConfig originalConfig, InstallerRegistry installerRegistry) throws InfrastructureException { this.servers = new HashMap<>(); if (originalConfig.getServers() != null) { this.servers.putAll(originalConfig.getServers()); } this.env = new HashMap<>(); if (originalConfig.getEnv() != null) { this.env.putAll(originalConfig.getEnv()); } this.attributes = new HashMap<>(); if (originalConfig.getAttributes() != null) { this.attributes.putAll(originalConfig.getAttributes()); } this.installers = new ArrayList<>(); initInstallers(originalConfig.getInstallers(), installerRegistry); }
Source:
public ResteasyUriInfo(final String absoluteUri, final String contextPath, final InitData initData) { initialize(absoluteUri, contextPath, InitData.canBeCached(absoluteUri) ? initData : null); }

Target:
public ResteasyUriInfo(final String absoluteUri, final String contextPath, final InitData initData) { initialize(absoluteUri, contextPath, initData != null && InitData.canBeCached(absoluteUri) ? initData : null); }
Source:
protected List<Workflow> githubWebhookDelete(String repository, String gitReference) { Pair<String, String> referencePair = parseGitHubReference(gitReference); List<Workflow> workflows = workflowDAO.findAllByPath("github.com/" + repository, false).stream().filter(workflow -> Objects.equals(workflow.getMode(), DOCKSTORE_YML)).collect( Collectors.toList()); workflows.forEach(workflow -> workflow.getWorkflowVersions().removeIf(workflowVersion -> Objects.equals(workflowVersion.getName(), referencePair.getRight()))); return workflows; }

Target:
protected List<Workflow> githubWebhookDelete(String repository, String gitReference) { Optional<String> gitReferenceName = GitHelper.parseGitHubReference(gitReference); if (gitReferenceName.isEmpty()) { String msg = "Reference " + gitReference + " is not of the valid form"; LOG.error(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } List<Workflow> workflows = workflowDAO.findAllByPath("github.com/" + repository, false).stream().filter(workflow -> Objects.equals(workflow.getMode(), DOCKSTORE_YML)).collect( Collectors.toList()); workflows.forEach(workflow -> workflow.getWorkflowVersions().removeIf(workflowVersion -> Objects.equals(workflowVersion.getName(), gitReferenceName.get()) && !workflowVersion.isFrozen())); return workflows; }
Source:
private boolean isDoNotDisturb() { try { if (sessionDoNotDisturb) { return true; } String clientDnd = clientStorage.getLocalItem(DO_NOT_DISTURB); if (clientDnd != null && !clientDnd.isEmpty()) { Double clientDndExpires = Double.parseDouble(clientDnd); JsDate now = JsDate.create(); if (clientDndExpires > now.getTime()) { return true; } } } catch (NumberFormatException e) { } return false; }

Target:
private boolean isDoNotDisturb() { try { if (sessionDoNotDisturb) { return true; } String clientDoNotDisturb = clientStorage.getLocalItem(DO_NOT_DISTURB); if (clientDoNotDisturb != null && !clientDoNotDisturb.isEmpty()) { Double clientDoNotDisturbExpires = Double.parseDouble(clientDoNotDisturb); JsDate now = JsDate.create(); if (clientDoNotDisturbExpires > now.getTime()) { return true; } } } catch (NumberFormatException e) { } return false; }
Source:
private void decodeDistribution(DBObject dbObject, Described entity) { entity.setDistributions(TranslatorUtils.toIterable(dbObject, DISTRIBUTION_KEY, new Function<DBObject, Distribution>() { @Override public Distribution apply(DBObject input) { return distributionTranslator.fromDBObject(input, new Distribution()); } }).or(ImmutableSet.<Distribution>of())); }

Target:
private void decodeDistribution(DBObject dbObject, Described entity) { entity.setDistributions(TranslatorUtils.toIterable(dbObject, DISTRIBUTION_KEY, input -> distributionTranslator.fromDBObject(input) ).or(ImmutableSet.<Distribution>of())); }
Source:
public <V> DataSet<V> readAvroFile(int[] baseColumnMap, int[] partitionColumnMap, String location, OperationContext context, Qualifier[][] qualifiers, DataValueDescriptor probeValue, ExecRow execRow, boolean useSample, double sampleFraction) throws StandardException { try { Dataset<Row> table = null; try { SparkSession spark = SparkSession.builder().master("local").getOrCreate(); table = spark.read().format("com.databricks.spark.avro").load(location); } catch (Exception e) { return handleExceptionInCaseOfEmptySet(e,location); } table = processExternalDataset(table,baseColumnMap,qualifiers,probeValue); if (useSample) { return new SparkDataSet(table .rdd().toJavaRDD() .sample(false, sampleFraction) .map(new RowToLocatedRowFunction(context, execRow))); } else { return new SparkDataSet(table .rdd().toJavaRDD() .map(new RowToLocatedRowFunction(context, execRow))); } } catch (Exception e) { throw StandardException.newException( SQLState.EXTERNAL_TABLES_READ_FAILURE,e.getMessage()); } }

Target:
public <V> DataSet<V> readAvroFile(int[] baseColumnMap, int[] partitionColumnMap, String location, OperationContext context, Qualifier[][] qualifiers, DataValueDescriptor probeValue, ExecRow execRow, boolean useSample, double sampleFraction) throws StandardException { try { Dataset<Row> table = null; try { SparkSession spark = SpliceSpark.getSession(); table = spark.read().format("com.databricks.spark.avro").load(location); } catch (Exception e) { return handleExceptionInCaseOfEmptySet(e,location); } table = processExternalDataset(table,baseColumnMap,qualifiers,probeValue); if (useSample) { return new SparkDataSet(table .rdd().toJavaRDD() .sample(false, sampleFraction) .map(new RowToLocatedRowFunction(context, execRow))); } else { return new SparkDataSet(table .rdd().toJavaRDD() .map(new RowToLocatedRowFunction(context, execRow))); } } catch (Exception e) { throw StandardException.newException( SQLState.EXTERNAL_TABLES_READ_FAILURE,e.getMessage()); } }
Source:
public boolean rename(ByteArrayWrapper oldKey, ByteArrayWrapper newKey) { Object value = localRegion.get(oldKey); localRegion.put(newKey, value); del(oldKey); return true; }

Target:
public boolean rename(ByteArrayWrapper oldKey, ByteArrayWrapper newKey) { RedisData value = getRedisData(oldKey); if (value == null) { return false; } region.put(newKey, value); region.remove(oldKey); return true; }
Source:
public int hashCode() { return delegate.hashCode(); }

Target:
public int hashCode() { return TODO(); }
Source:
public void fireResourcesRemoved(List<Resource<L>> resources) { if (!resources.isEmpty()) { try { inventoryListenerRWLock.readLock().lock(); LOG.debugf("Firing inventory event for [%d] removed resources", resources.size()); InventoryEvent<L> event = new InventoryEvent<L>(EndpointService.this, resources); for (InventoryListener inventoryListener : inventoryListeners) { inventoryListener.resourcesRemoved(event); } } finally { inventoryListenerRWLock.readLock().unlock(); } } }

Target:
public void fireResourcesRemoved(List<Resource<L>> resources) { if (!resources.isEmpty()) { inventoryListenerRWLock.readLock().lock(); try { LOG.debugf("Firing inventory event for [%d] removed resources", resources.size()); InventoryEvent<L> event = new InventoryEvent<L>(EndpointService.this, resources); for (InventoryListener inventoryListener : inventoryListeners) { inventoryListener.resourcesRemoved(event); } } finally { inventoryListenerRWLock.readLock().unlock(); } } }
Source:
public Image getImage(Object element) { if (element instanceof TmfCommonProjectElement) { TmfCommonProjectElement trace = (TmfCommonProjectElement) element; try { if (trace.getResource().getPersistentProperty(TmfCommonConstants.TRACETYPE) == null) { return fUnknownTraceIcon; } String name = trace.getResource().getPersistentProperty(TmfCommonConstants.TRACEBUNDLE); String icon = trace.getResource().getPersistentProperty(TmfCommonConstants.TRACEICON); if (name != null && icon != null) { Bundle bundle = Platform.getBundle(name); if (bundle != null) { Image image = loadIcon(bundle, icon); if (image != null) { return image; } } return fUnknownTraceIcon; } } catch (CoreException e) { } if (element instanceof TmfTraceElement) { return fDefaultTraceIcon; } return fExperimentIcon; } if (element instanceof TmfExperimentFolder) { return fExperimentFolderIcon; } if (element instanceof TmfTraceFolder) { return fTraceFolderIcon; } return null; }

Target:
public Image getImage(Object element) { if (element instanceof TmfCommonProjectElement) { TmfCommonProjectElement trace = (TmfCommonProjectElement) element; try { if (trace.getResource().getPersistentProperty(TmfCommonConstants.TRACETYPE) == null) { return fUnknownTraceIcon; } String name = trace.getResource().getPersistentProperty(TmfCommonConstants.TRACEBUNDLE); String icon = trace.getResource().getPersistentProperty(TmfCommonConstants.TRACEICON); if (name != null && icon != null) { Bundle bundle = Platform.getBundle(name); if (bundle != null) { Image image = loadIcon(bundle, icon); if (image != null) { return image; } } return fUnknownTraceIcon; } } catch (CoreException e) { } if (element instanceof TmfTraceElement) { return fDefaultTraceIcon; } return fExperimentIcon; } if (element instanceof TmfExperimentFolder) { return fExperimentFolderIcon; } if (element instanceof TmfTraceFolder) { return fTraceFolderIcon; } if (element instanceof TmfAnalysisOutputElement) { TmfAnalysisOutputElement output = (TmfAnalysisOutputElement) element; Image icon = output.getIcon(); if (icon == null) { return fDefaultViewIcon; } return icon; } if (element instanceof TmfAnalysisElement) { TmfAnalysisElement analysis = (TmfAnalysisElement) element; String iconFile = analysis.getIconFile(); if (iconFile != null) { Bundle bundle = analysis.getBundle(); if (bundle != null) { Image icon = loadIcon(bundle, iconFile); return icon; } } return fDefaultAnalysisIcon; } return null; }
Source:
public boolean contentEquals(byte[] bytes, int offset, int len) { if (length != len) { return false; } return compareTo(bytes, offset, len) == 0; }

Target:
public boolean contentEquals(byte[] bytes, int offset, int len) { Preconditions.checkArgument(len >= 0 && offset >= 0 && offset + len <= bytes.length); return contentEqualsUnchecked(bytes, offset, len); }
Source:
public void testIterationWithSingleLastBatchIsBroken() { try (CacheManager cacheManager = createTestCacheManager()) { Cache<Long, byte[]> cache = cacheManager.getCache(testName.getMethodName(), Long.class, byte[].class); byte[] data = new byte[101 * 1024]; cache.put(1L, data); cache.put(2L, data); for (Cache.Entry<Long, byte[]> entry : cache) { assertThat(entry, notNullValue()); } } }

Target:
public void testIterationWithSingleLastBatchIsBroken() { try (CacheManager cacheManager = createTestCacheManager()) { Cache<Long, byte[]> cache = cacheManager.getCache(testName.getMethodName(), Long.class, byte[].class); byte[] data = new byte[101 * 1024]; cache.put(1L, data); cache.put(2L, data); assertThat(cache, containsInAnyOrder( isEntry(is(1L), any(byte[].class)), isEntry(is(2L), any(byte[].class)) )); } }
Source:
public void consume(final Span span) { if (numInflights.incrementAndGet() <= maxInflights) { ListenableFuture<Span> future = executorService.submit(new Callable<Span>() { @Override public Span call() throws Exception { observer.consume(span); return span; } }); Futures.addCallback(future, new FutureCallback<Span>() { @Override public void onSuccess(Span result) { numInflights.decrementAndGet(); } @Override public void onFailure(Throwable error) { log.trace("Failed to notify observer", error); numInflights.decrementAndGet(); } }); } else { log.trace("Failed to notify span observer since the maximum number of allowed concurrent observations was " + "exceeded: " + maxInflights); numInflights.decrementAndGet(); } }

Target:
public void consume(final Span span) { if (numInflights.incrementAndGet() <= maxInflights) { ListenableFuture<Span> future = executorService.submit(new Callable<Span>() { @Override public Span call() throws Exception { observer.consume(span); return span; } }); Futures.addCallback(future, new FutureCallback<Span>() { @Override public void onSuccess(Span result) { numInflights.decrementAndGet(); } @Override public void onFailure(Throwable error) { log.trace("Failed to notify observer", error); numInflights.decrementAndGet(); } }); } else { log.trace("Failed to notify span observer since the maximum number of allowed concurrent observations was " + "exceeded: {}", maxInflights); numInflights.decrementAndGet(); } }
Source:
private int getDimension(RandomAccessInputStream stream) throws IOException { String dim = stream.readString(6).trim(); try { return Integer.parseInt(dim); } catch (NumberFormatException e) { } return 0; }

Target:
private int getDimension(RandomAccessInputStream stream) throws IOException { String dim = stream.readString(6).trim(); Integer dimension = DataTools.parseInteger(dim); return dimension == null ? 0 : dimension; }
Source:
public abstract void add(T entry) throws IOException; public abstract T peek() throws IOException; public final List<T> peek(int max) throws IOException { int end = Math.min(max, size()); List<T> subList = new ArrayList<T>(end); Iterator<T> iterator = iterator(); for (int i = 0; i < end; i++) { subList.add(iterator.next()); } return Collections.unmodifiableList(subList); }

Target:
public abstract void add(T entry) throws IOException; public abstract T peek() throws IOException; public List<T> peek(int max) throws IOException { int end = Math.min(max, size()); List<T> subList = new ArrayList<T>(end); Iterator<T> iterator = iterator(); for (int i = 0; i < end; i++) { subList.add(iterator.next()); } return Collections.unmodifiableList(subList); }
Source:
HttpRequestBuilder(boolean preserveHeadersCase) { headers = new LazyValue<>(() -> new CaseInsensitiveMultiMap(!preserveHeadersCase)); }

Target:
HttpRequestBuilder(boolean preserveHeadersCase) { headers = new CaseInsensitiveMultiMap(!preserveHeadersCase); }
Source:
public void addCloudConfig(String clusterName, CloudConfig cloudConfig) { }

Target:
public void addCloudConfig(String clusterName, CloudConfig cloudConfig) { throw new IllegalStateException("Not implemented"); }
Source:
public static Schema extractValues(Schema inputSchema, List<String> keyPaths) { if (inputSchema == null) { return AvroUtils.createEmptySchema(); } Schema schema = extractValues(inputSchema, keyPaths, ""); if (schema == null) { return Schema.createRecord("value_" + inputSchema.getName(), inputSchema.getDoc(), inputSchema.getNamespace(), inputSchema.isError(), new ArrayList<Schema.Field>()); } if (schema.getName() == null) { schema = Schema.createRecord(RECORD_VALUE_PREFIX, schema.getDoc(), schema.getNamespace(), schema.isError(), schema.getFields()); } return schema; }

Target:
public static Schema extractValues(Schema inputSchema, List<String> keyPaths) { if (inputSchema == null) { return AvroUtils.createEmptySchema(); } Schema schema = extractValues(inputSchema, keyPaths, ""); if (schema == null) { return AvroUtils.createEmptySchema(); } if (schema.getName() == null) { schema = Schema.createRecord(RECORD_VALUE_PREFIX, schema.getDoc(), schema.getNamespace(), schema.isError(), schema.getFields()); } return schema; }
Source:
protected abstract void setupDrivers() throws Exception; protected abstract void deployDataSource( DataSourceDef dataSourceDef ) throws Exception; @Test public void testUnDeployDataSource() { try { setupDrivers(); deployDataSource( dataSourceDef ); DataSourceDeploymentInfo deploymentInfo = dataSourceProvider.getDeploymentInfo( dataSourceDef.getUuid() ); assertNotNull( deploymentInfo ); unDeployDataSource( deploymentInfo ); deploymentInfo = dataSourceProvider.getDeploymentInfo( dataSourceDef.getUuid() ); assertNull( deploymentInfo ); } catch ( Exception e ) { fail ( e.getMessage() ); } }

Target:
protected abstract void setupDrivers( ) throws Exception; protected abstract void deployDataSource( DataSourceDef dataSourceDef ) throws Exception; @Test public void testUnDeployDataSource( ) throws Exception { setupDrivers( ); deployDataSource( dataSourceDef ); DataSourceDeploymentInfo initialDeploymentInfo = dataSourceProvider.getDeploymentInfo( dataSourceDef.getUuid( ) ); assertNotNull( initialDeploymentInfo ); unDeployDataSource( initialDeploymentInfo ); DataSourceDeploymentInfo currentDeploymentInfo = dataSourceProvider.getDeploymentInfo( dataSourceDef.getUuid( ) ); assertNull( currentDeploymentInfo ); expectedException.expectMessage( "DataSource: " + initialDeploymentInfo.getUuid( ) + " is not deployed" ); dataSourceProvider.undeploy( initialDeploymentInfo ); }
Source:
private void markHeadsAsUninteresting(final RevWalk walk, Set<ObjectId> existing) { for (Ref ref : repo.getAllRefs().values()) { if (ref.getObjectId() == null) { continue; } else if (ref.getName().startsWith("refs/changes/")) { if (existing != null) existing.add(ref.getObjectId()); } else if (ref.getName().startsWith(R_HEADS) || (destBranchCtl!=null && ref.getName().equals(destBranchCtl.getRefName()))) { try { walk.markUninteresting(walk.parseCommit(ref.getObjectId())); } catch (IOException e) { log.warn(String.format("Invalid ref %s in %s", ref.getName(), project.getName()), e); continue; } } } }

Target:
private void markHeadsAsUninteresting(final RevWalk walk, Set<ObjectId> existing) { for (Ref ref : repo.getAllRefs().values()) { if (ref.getObjectId() == null) { continue; } else if (ref.getName().startsWith("refs/changes/")) { existing.add(ref.getObjectId()); } else if (ref.getName().startsWith(R_HEADS) || (destBranchCtl != null && ref.getName().equals(destBranchCtl.getRefName()))) { try { walk.markUninteresting(walk.parseCommit(ref.getObjectId())); } catch (IOException e) { log.warn(String.format("Invalid ref %s in %s", ref.getName(), project.getName()), e); continue; } } } }