auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private IdJoinQuery populateBranchIdsJoinIdTable() throws OseeDataStoreException, OseeCoreException { IdJoinQuery branchJoin = JoinUtility.createIdJoinQuery(); BranchFilter branchFilter = new BranchFilter(BranchArchivedState.UNARCHIVED); branchFilter.setNegatedBranchStates(BranchState.PURGED); branchFilter.setNegatedBranchStates(BranchState.DELETED); for (Branch branch : BranchManager.getBranches(branchFilter)) { branchJoin.add(branch.getId()); } branchJoin.store(); return branchJoin; }

Target:
private IdJoinQuery populateBranchIdsJoinIdTable() throws OseeDataStoreException, OseeCoreException { IdJoinQuery branchJoin = JoinUtility.createIdJoinQuery(); BranchFilter branchFilter = new BranchFilter(BranchArchivedState.UNARCHIVED); branchFilter.setNegatedBranchStates(BranchState.PURGED, BranchState.DELETED); for (Branch branch : BranchManager.getBranches(branchFilter)) { branchJoin.add(branch.getId()); } branchJoin.store(); return branchJoin; }
Source:
public static void closeAll() throws IOException { if (LOGGER.isDebugEnabled()) { debugLogFileSystemClose("closeAll", null); } CACHE.closeAll(); }

Target:
public static void closeAll() throws IOException { debugLogFileSystemClose("closeAll", ""); CACHE.closeAll(); }
Source:
public DeepLinkUri getUri() { return deepLinkUri; }

Target:
DeepLinkUri getUri() { return deepLinkUri; }
Source:
private void handleException(final Entry<Optional<Executor>, List<ExecutableFlow>> entry, final Executor executor, final ExecutorManagerException e, final ArrayList<ExecutableFlow> finalizeFlows) { logger.error("Failed to get update from executor " + executor.getHost(), e); boolean sendUnresponsiveEmail = false; final boolean executorRemoved = executorRemoved(executor.getId()); for (final ExecutableFlow flow : entry.getValue()) { final Pair<ExecutionReference, ExecutableFlow> pair = this.runningExecutions.get().get(flow.getExecutionId()); this.updaterStage .set("Failed to get update for flow " + pair.getSecond().getExecutionId()); if (executorRemoved) { logger.warn("Finalizing execution " + flow.getExecutionId() + ". Executor id of this execution doesn't exist"); finalizeFlows.add(flow); } else { final ExecutionReference ref = pair.getFirst(); ref.setNextCheckTime(DateTime.now().getMillis() + this.errorThreshold); ref.setNumErrors(ref.getNumErrors() + 1); if (ref.getNumErrors() == this.numErrorsBeforeUnresponsiveEmail || ref.getNumErrors() % this.numErrorsBetweenUnresponsiveEmail == 0) { sendUnresponsiveEmail = true; } } } if (sendUnresponsiveEmail) { final Alerter mailAlerter = this.alerterHolder.get("email"); mailAlerter.alertOnFailedUpdate(executor, entry.getValue(), e); } }

Target:
private void handleException(final Entry<Optional<Executor>, List<ExecutableFlow>> entry, final Executor executor, final ExecutorManagerException e, final ArrayList<ExecutableFlow> finalizeFlows) { logger.error("Failed to get update from executor " + executor.getHost(), e); boolean sendUnresponsiveEmail = false; final boolean executorRemoved = isExecutorRemoved(executor.getId()); for (final ExecutableFlow flow : entry.getValue()) { final Pair<ExecutionReference, ExecutableFlow> pair = this.runningExecutions.get().get(flow.getExecutionId()); this.updaterStage .set("Failed to get update for flow " + pair.getSecond().getExecutionId()); if (executorRemoved) { logger.warn("Finalizing execution " + flow.getExecutionId() + ". Executor is removed"); finalizeFlows.add(flow); } else { final ExecutionReference ref = pair.getFirst(); ref.setNextCheckTime(DateTime.now().getMillis() + this.errorThreshold); ref.setNumErrors(ref.getNumErrors() + 1); if (ref.getNumErrors() == this.numErrorsBeforeUnresponsiveEmail || ref.getNumErrors() % this.numErrorsBetweenUnresponsiveEmail == 0) { sendUnresponsiveEmail = true; } } } if (sendUnresponsiveEmail) { final Alerter mailAlerter = this.alerterHolder.get("email"); mailAlerter.alertOnFailedUpdate(executor, entry.getValue(), e); } }
Source:
private void processComponentConfig(final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final ComponentDescription description, DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final Class<?> componentClass; try { componentClass = ClassLoadingUtils.loadClass(description.getComponentClassName(), deploymentUnit); handleAnnotations(applicationClasses, deploymentReflectionIndex, componentClass, description); } catch (Throwable e) { EeLogger.ROOT_LOGGER.debugf(e,"Ignoring failure to handle interceptor annotations for %s", description.getComponentClassName()); return; } }

Target:
private void processComponentConfig(final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final ComponentDescription description, DeploymentUnit deploymentUnit) { try { final Class<?> componentClass = ClassLoadingUtils.loadClass(description.getComponentClassName(), deploymentUnit); handleAnnotations(applicationClasses, deploymentReflectionIndex, componentClass, description); } catch (Throwable e) { EeLogger.ROOT_LOGGER.debugf(e,"Ignoring failure to handle interceptor annotations for %s", description.getComponentClassName()); } }
Source:
public static List<SimpleInterval> fixTargetSegmentStarts(final List<SimpleInterval> targetSegments, final TargetCollection<? extends Locatable> targets) { Utils.nonNull(targetSegments, "The list of target segments cannot be null."); Utils.nonNull(targets, "The collection of targets cannot be null."); final List<SimpleInterval> targetSegmentsFixed = new ArrayList<>(); for (final SimpleInterval segment : targetSegments) { try { final Locatable firstTarget = targets.targets(segment).get(0); if (firstTarget.getEnd() == segment.getStart()) { targetSegmentsFixed.add( new SimpleInterval(segment.getContig(), firstTarget.getStart(), segment.getEnd())); } } catch (final IndexOutOfBoundsException ex) { throw new IllegalArgumentException("List of targets and segments do not correspond."); } } return targetSegmentsFixed; }

Target:
public static List<SimpleInterval> fixTargetSegmentStarts(final List<SimpleInterval> targetSegments, final TargetCollection<? extends Locatable> targets) { Utils.nonNull(targetSegments, "The list of target segments cannot be null."); Utils.nonNull(targets, "The collection of targets cannot be null."); final List<SimpleInterval> targetSegmentsFixed = new ArrayList<>(); for (final SimpleInterval segment : targetSegments) { try { final Locatable firstTarget = targets.targets(segment).get(0); if (firstTarget.getEnd() == segment.getStart()) { targetSegmentsFixed.add( new SimpleInterval(segment.getContig(), firstTarget.getStart(), segment.getEnd())); } else { throw new IllegalArgumentException("List of targets and segments do not correspond."); } } catch (final IndexOutOfBoundsException ex) { throw new IllegalArgumentException("List of targets and segments do not correspond."); } } return targetSegmentsFixed; }
Source:
public static List<Part> createParts(int numParts) { List<Part> result = new ArrayList<Part>(); for (int i = 0; i < numParts; i++) { Part p = new Part(); p.setMd5("md5"); p.setPartNumber(i + 1); p.setPartSize(1000); result.add(p); } return result; }

Target:
public static List<Part> createParts(int numParts) { ImmutableList.Builder<Part> builder = ImmutableList.builder(); for (int i = 0; i < numParts; i++) { val p = new Part(); p.setMd5("md5"); p.setPartNumber(i + 1); p.setPartSize(1000); builder.add(p); } return builder.build(); }
Source:
public void dispatch( DummyRequest dummyRequest, long commandIndex, Consumer<Result> callback ) { if ( benchmarkMachine != null ) { benchmarkMachine.applyCommand( dummyRequest, commandIndex, callback ); } }

Target:
public void dispatch( DummyRequest dummyRequest, long commandIndex, Consumer<Result> callback ) { benchmarkMachine.applyCommand( dummyRequest, commandIndex, callback ); }
Source:
protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) { WayKeyValueFilter wayKeyValueFilter; if (doesArgumentExist(taskConfig, ARG_KEY_VALUE_LIST)) { String keyValueList = getStringArgument(taskConfig, ARG_KEY_VALUE_LIST, "highway.motorway,highway.motorway_link,highway.trunk,highway.trunk_link"); wayKeyValueFilter = new WayKeyValueFilter(keyValueList); } else { String keyValueListFile = getStringArgument(taskConfig, ARG_KEY_VALUE_LIST_File); wayKeyValueFilter = new WayKeyValueFilter(new File(keyValueListFile)); } return new SinkSourceManager( taskConfig.getId(), wayKeyValueFilter, taskConfig.getPipeArgs() ); }

Target:
protected TaskManager createTaskManagerImpl(TaskConfiguration taskConfig) { WayKeyValueFilter wayKeyValueFilter; if (doesArgumentExist(taskConfig, ARG_KEY_VALUE_LIST)) { String keyValueList = getStringArgument(taskConfig, ARG_KEY_VALUE_LIST); wayKeyValueFilter = new WayKeyValueFilter(keyValueList); } else if (doesArgumentExist(taskConfig, ARG_KEY_VALUE_LIST_FILE)) { String keyValueListFile = getStringArgument(taskConfig, ARG_KEY_VALUE_LIST_FILE); wayKeyValueFilter = new WayKeyValueFilter(new File(keyValueListFile)); } else { String keyValueList = getDefaultStringArgument(taskConfig, "highway.motorway,highway.motorway_link,highway.trunk,highway.trunk_link"); wayKeyValueFilter = new WayKeyValueFilter(keyValueList); } return new SinkSourceManager( taskConfig.getId(), wayKeyValueFilter, taskConfig.getPipeArgs() ); }
Source:
public void setHeaderLevel(int headerLevel) { header.setHeaderLevel(headerLevel); }

Target:
public void setHeaderLevel(int headerLevel) { getLabel().setHeaderLevel(headerLevel); }
Source:
public void assertBadRequestResponseIfPatchingMerchantIdWithNoGatewayAccountCredentials() throws JsonProcessingException { String accountIdWithoutGatewayAccountCredentials = extractGatewayAccountId(createAGatewayAccountFor(testContext.getPort(), "worldpay")); String payload = new ObjectMapper().writeValueAsString(ImmutableMap.of("op", "add", "path", "credentials/gateway_merchant_id", "value", "1234abc")); given().port(testContext.getPort()).contentType(JSON) .body(payload) .patch("/v1/api/accounts/" + accountIdWithoutGatewayAccountCredentials) .then() .assertThat() .statusCode(HttpStatus.SC_BAD_REQUEST); }

Target:
public void assertBadRequestResponseIfPatchingMerchantIdWithNoGatewayAccountCredentials() throws JsonProcessingException { String accountIdWithoutGatewayAccountCredentials = extractGatewayAccountId(createAGatewayAccountFor(testContext.getPort(), "worldpay")); String payload = new ObjectMapper().writeValueAsString(ImmutableMap.of("op", "add", "path", "credentials/gateway_merchant_id", "value", "1234abc")); given().port(testContext.getPort()).contentType(JSON) .body(payload) .patch("/v1/api/accounts/" + accountIdWithoutGatewayAccountCredentials) .then() .body("message", is("Account Credentials are required to set a Gateway Merchant ID")) .and() .statusCode(HttpStatus.SC_BAD_REQUEST); }
Source:
private String formConflictsMessage(List<String> conflicts) { if (conflicts != null && conflicts.size() > 0) { StringBuilder conflictsMessage = new StringBuilder(constant.revertedConflicts()); for (String conflict : conflicts) { conflictsMessage.append(" " + conflict + "\n"); } return conflictsMessage.toString(); } return ""; }

Target:
private String formConflictsMessage(List<String> conflicts) { if (conflicts != null && conflicts.size() > 0) { StringBuilder conflictsMessage = new StringBuilder(constant.revertedConflicts()); for (String conflict : conflicts) { conflictsMessage.append(" ").append(conflict).append("\n"); } return conflictsMessage.toString(); } return ""; }
Source:
BugsnagException(@NonNull Throwable exc) { super(exc.getMessage()); if (exc instanceof BugsnagException) { this.message = ((BugsnagException) exc).getMessage(); this.name = ((BugsnagException) exc).getName(); this.type = ((BugsnagException) exc).getType(); } else if (exc instanceof JsonStream.Streamable) { this.streamable = (JsonStream.Streamable) exc; } else { this.name = exc.getClass().getName(); } setStackTrace(exc.getStackTrace()); initCause(exc.getCause()); this.customStackframes = null; }

Target:
BugsnagException(@NonNull Throwable exc) { super(exc.getMessage()); if (exc instanceof JsonStream.Streamable) { this.streamable = (JsonStream.Streamable) exc; this.name = ""; } else { this.name = exc.getClass().getName(); } setStackTrace(exc.getStackTrace()); initCause(exc.getCause()); this.customStackframes = null; }
Source:
public String getReportFileNamePrefix() { if (ObjectUtils.isNull(reportFileNamePrefix)) { setReportFileNamePrefix(getPaymentWorksBatchUtilityService().retrievePaymentWorksParameterValue(PaymentWorksParameterConstants.PAYMENTWORKS_PAYEE_ACH_REPORT_FILE_NAME_PREFIX)); LOG.info("getReportFileNamePrefix just set reportFileNamePrefix to param value=" +getPaymentWorksBatchUtilityService().retrievePaymentWorksParameterValue(PaymentWorksParameterConstants.PAYMENTWORKS_PAYEE_ACH_REPORT_FILE_NAME_PREFIX)+ "="); } else { LOG.info("getReportFileNamePrefix sees reportFileNamePrefix as null =" + reportFileNamePrefix + "="); } return reportFileNamePrefix; }

Target:
public String getReportFileNamePrefix() { if (ObjectUtils.isNull(reportFileNamePrefix)) { setReportFileNamePrefix(getPaymentWorksBatchUtilityService().retrievePaymentWorksParameterValue(PaymentWorksParameterConstants.PAYMENTWORKS_PAYEE_ACH_REPORT_FILE_NAME_PREFIX)); LOG.info("getReportFileNamePrefix: just set reportFileNamePrefix to param value = " + getPaymentWorksBatchUtilityService().retrievePaymentWorksParameterValue(PaymentWorksParameterConstants.PAYMENTWORKS_PAYEE_ACH_REPORT_FILE_NAME_PREFIX)); } else { LOG.info("getReportFileNamePrefix: sees reportFileNamePrefix as = " + reportFileNamePrefix); } return reportFileNamePrefix; }
Source:
public WARCRecordInfo buildRecord(CrawlURI curi, URI concurrentTo) throws IOException { final String timestamp = ArchiveUtils.getLog14Date(curi.getFetchBeginTime()); WARCRecordInfo recordInfo = new WARCRecordInfo(); recordInfo.setRecordId(generateRecordID()); recordInfo.addExtraHeader(HEADER_KEY_CONCURRENT_TO, '<' + concurrentTo.toString() + '>'); recordInfo.setType(WARCRecordType.response); recordInfo.setUrl(curi.toString()); recordInfo.setCreate14DigitDate(timestamp); recordInfo.setMimetype(curi.getContentType()); recordInfo.setContentLength(curi.getRecorder().getRecordedInput().getSize()); recordInfo.setEnforceLength(true); String ip = (String)curi.getData().get(A_DNS_SERVER_IP_LABEL); if (ip != null && ip.length() > 0) { recordInfo.addExtraHeader(HEADER_KEY_IP, ip); } ReplayInputStream ris = curi.getRecorder().getRecordedInput().getReplayInputStream(); recordInfo.setContentStream(ris); return recordInfo; }

Target:
public WARCRecordInfo buildRecord(CrawlURI curi, URI concurrentTo) throws IOException { final String timestamp = ArchiveUtils.getLog14Date(curi.getFetchBeginTime()); WARCRecordInfo recordInfo = new WARCRecordInfo(); recordInfo.setRecordId(generateRecordID()); if (concurrentTo != null) { recordInfo.addExtraHeader(HEADER_KEY_CONCURRENT_TO, '<' + concurrentTo.toString() + '>'); } recordInfo.setType(WARCRecordType.response); recordInfo.setUrl(curi.toString()); recordInfo.setCreate14DigitDate(timestamp); recordInfo.setMimetype(curi.getContentType()); recordInfo.setContentLength(curi.getRecorder().getRecordedInput().getSize()); recordInfo.setEnforceLength(true); String ip = (String)curi.getData().get(A_DNS_SERVER_IP_LABEL); if (ip != null && ip.length() > 0) { recordInfo.addExtraHeader(HEADER_KEY_IP, ip); } ReplayInputStream ris = curi.getRecorder().getRecordedInput().getReplayInputStream(); recordInfo.setContentStream(ris); return recordInfo; }
Source:
private SweepResults runInternal( TableReference tableRef, SweepBatchConfig batchConfig, byte[] startRow, RunType runType) { Stopwatch watch = Stopwatch.createStarted(); Preconditions.checkNotNull(tableRef, "tableRef cannot be null"); Preconditions.checkState(!AtlasDbConstants.hiddenTables.contains(tableRef)); if (tableRef.getQualifiedName().startsWith(AtlasDbConstants.NAMESPACE_PREFIX)) { log.warn("The sweeper should not be run on tables passed through namespace mapping."); return SweepResults.createEmptySweepResult(); } if (keyValueService.getMetadataForTable(tableRef).length == 0) { log.warn("The sweeper tried to sweep table '{}', but the table does not exist. Skipping table.", LoggingArgs.tableRef("tableRef", tableRef)); return SweepResults.createEmptySweepResult(); } SweepStrategy sweepStrategy = sweepStrategyManager.get().getOrDefault(tableRef, SweepStrategy.CONSERVATIVE); Optional<Sweeper> sweeper = Sweeper.of(sweepStrategy); if (!sweeper.isPresent()) { return SweepResults.createEmptySweepResult(); } return doRun(tableRef, batchConfig, startRow, runType, sweeper.get(), watch); }

Target:
private SweepResults runInternal( TableReference tableRef, SweepBatchConfig batchConfig, byte[] startRow, RunType runType) { Preconditions.checkNotNull(tableRef, "tableRef cannot be null"); Preconditions.checkState(!AtlasDbConstants.hiddenTables.contains(tableRef)); if (tableRef.getQualifiedName().startsWith(AtlasDbConstants.NAMESPACE_PREFIX)) { log.warn("The sweeper should not be run on tables passed through namespace mapping."); return SweepResults.createEmptySweepResultWithNoMoreToSweep(); } if (keyValueService.getMetadataForTable(tableRef).length == 0) { log.warn("The sweeper tried to sweep table '{}', but the table does not exist. Skipping table.", LoggingArgs.tableRef("tableRef", tableRef)); return SweepResults.createEmptySweepResultWithNoMoreToSweep(); } SweepStrategy sweepStrategy = sweepStrategyManager.get().getOrDefault(tableRef, SweepStrategy.CONSERVATIVE); Optional<Sweeper> sweeper = Sweeper.of(sweepStrategy); if (!sweeper.isPresent()) { return SweepResults.createEmptySweepResultWithNoMoreToSweep(); } return doRun(tableRef, batchConfig, startRow, runType, sweeper.get()); }
Source:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); mOptionsMenu = menu; if (!isAdded() || getPageActivity().isSearching()) { return; } MenuItem otherLangItem = menu.findItem(R.id.menu_page_other_languages); MenuItem findInPageItem = menu.findItem(R.id.menu_page_find_in_page); MenuItem contentIssues = menu.findItem(R.id.menu_page_content_issues); MenuItem similarTitles = menu.findItem(R.id.menu_page_similar_titles); MenuItem themeChooserItem = menu.findItem(R.id.menu_page_font_and_theme); if (otherLangItem == null) { L.logRemoteErrorIfProd(new RuntimeException("onPrepareOptionsMenu called with empty menu.")); return; } if (pageLoadStrategy.isLoading() || errorState) { otherLangItem.setEnabled(false); findInPageItem.setEnabled(false); contentIssues.setEnabled(false); similarTitles.setEnabled(false); themeChooserItem.setEnabled(false); } else { otherLangItem.setVisible(model.getPage() != null && model.getPage().getPageProperties().getLanguageCount() != 0); otherLangItem.setEnabled(true); findInPageItem.setEnabled(true); updateMenuPageInfo(menu); themeChooserItem.setEnabled(true); } }

Target:
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); if (!isAdded() || getPageActivity().isSearching()) { return; } MenuItem otherLangItem = menu.findItem(R.id.menu_page_other_languages); MenuItem findInPageItem = menu.findItem(R.id.menu_page_find_in_page); MenuItem contentIssues = menu.findItem(R.id.menu_page_content_issues); MenuItem similarTitles = menu.findItem(R.id.menu_page_similar_titles); MenuItem themeChooserItem = menu.findItem(R.id.menu_page_font_and_theme); if (otherLangItem == null) { L.logRemoteErrorIfProd(new RuntimeException("onPrepareOptionsMenu called with empty menu.")); return; } if (pageLoadStrategy.isLoading() || errorState) { otherLangItem.setEnabled(false); findInPageItem.setEnabled(false); contentIssues.setEnabled(false); similarTitles.setEnabled(false); themeChooserItem.setEnabled(false); } else { otherLangItem.setVisible(model.getPage() != null && model.getPage().getPageProperties().getLanguageCount() != 0); otherLangItem.setEnabled(true); findInPageItem.setEnabled(true); updateMenuPageInfo(menu); themeChooserItem.setEnabled(true); } }
Source:
void shouldFailOnDeleteByEntityWithWrongVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> { tx.run("CREATE (v:VersionedThingWithAssignedId {id:1, myVersion:2})").consume(); return null; }); } StepVerifier.create(repository.findById(1L) .flatMap(thing -> { thing.setMyVersion(3L); return repository.delete(thing); })).verifyError(OptimisticLockingFailureException.class); }

Target:
void shouldFailOnDeleteByEntityWithWrongVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1, myVersion:2})").consume()); } StepVerifier.create(repository.findById(1L) .flatMap(thing -> { thing.setMyVersion(3L); return repository.delete(thing); })).verifyError(OptimisticLockingFailureException.class); }
Source:
public Mono<String[]> getPartitionIds() { return getProperties().map(EventHubProperties::partitionIds); }

Target:
public Flux<String> getPartitionIds() { return getProperties().flatMapMany(properties -> Flux.fromArray(properties.partitionIds())); }
Source:
public static boolean matches(String refName, String refPattern) { return Pattern.matches(refPattern.replace("*", "(.*)"), refName); }

Target:
public static boolean matches(String refName, String refPattern) { if (refPattern.startsWith(RefRight.REGEX_PREFIX)) { return Pattern.matches(refPattern, refName); } if (refPattern.endsWith("/*")) { String prefix = refPattern.substring(0, refPattern.length() - 1); return refName.startsWith(prefix); } else { return refName.equals(refPattern); } }
Source:
public float getFloat() { return beNull.getAsBoolean() ? 0L : baseSelector.getFloat(); }

Target:
public float getFloat() { return beNull.getAsBoolean() ? NullHandling.ZERO_FLOAT : baseSelector.getFloat(); }
Source:
private void reset() { allHistograms.forEach(AbstractHistogram::reset); threadPool.reset(); start.set(0L); end.set(0L); responses.set(0L); messages.set(0L); minLatency.set(Long.MAX_VALUE); maxLatency.set(0L); totLatency.set(0L); maxTime.set(null, 0); sendTimes.clear(); arrivalTimes.clear(); }

Target:
private void reset() { allHistograms.forEach(Histogram::reset); threadPool.reset(); start.set(0L); end.set(0L); responses.set(0L); messages.set(0L); minLatency.set(Long.MAX_VALUE); maxLatency.set(0L); totLatency.set(0L); maxTime.set(null, 0); sendTimes.clear(); arrivalTimes.clear(); }
Source:
public Builder mergeFrom(io.netty.example.worldclock.WorldClockProtocol.LocalTimes other) { if (other == io.netty.example.worldclock.WorldClockProtocol.LocalTimes.getDefaultInstance()) { return this; } if (localTimeBuilder_ == null) { if (!other.localTime_.isEmpty()) { if (localTime_.isEmpty()) { localTime_ = other.localTime_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLocalTimeIsMutable(); localTime_.addAll(other.localTime_); } onChanged(); } } else { if (!other.localTime_.isEmpty()) { if (localTimeBuilder_.isEmpty()) { localTimeBuilder_.dispose(); localTimeBuilder_ = null; localTime_ = other.localTime_; bitField0_ = (bitField0_ & ~0x00000001); localTimeBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getLocalTimeFieldBuilder() : null; } else { localTimeBuilder_.addAllMessages(other.localTime_); } } } this.mergeUnknownFields(other.getUnknownFields()); return this; }

Target:
public Builder mergeFrom(io.netty.example.worldclock.WorldClockProtocol.LocalTimes other) { if (other == io.netty.example.worldclock.WorldClockProtocol.LocalTimes.getDefaultInstance()) return this; if (localTimeBuilder_ == null) { if (!other.localTime_.isEmpty()) { if (localTime_.isEmpty()) { localTime_ = other.localTime_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLocalTimeIsMutable(); localTime_.addAll(other.localTime_); } onChanged(); } } else { if (!other.localTime_.isEmpty()) { if (localTimeBuilder_.isEmpty()) { localTimeBuilder_.dispose(); localTimeBuilder_ = null; localTime_ = other.localTime_; bitField0_ = (bitField0_ & ~0x00000001); localTimeBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getLocalTimeFieldBuilder() : null; } else { localTimeBuilder_.addAllMessages(other.localTime_); } } } this.mergeUnknownFields(other.getUnknownFields()); return this; }
Source:
private ModuleMeta getModuleMeta(String moduleName, LogicalPlan dag) { ModuleMeta logicalModule = dag.getModuleMeta(moduleName); if (logicalModule != null) { return logicalModule; } for (ModuleMeta m : dag.getAllModules()) { return getModuleMeta(moduleName, m.getDag()); } return null; }

Target:
private ModuleMeta getModuleMeta(String moduleName, LogicalPlan dag) { for (ModuleMeta m : dag.getAllModules()) { if (m.getFullName().equals(moduleName)) { return m; } ModuleMeta res = getModuleMeta(moduleName, m.getDag()); if (res != null) return res; } return null; }
Source:
public void initialize() throws NotificationQueueAlreadyExists { retryQueue = notificationQueueService.createNotificationQueue(DefaultServerService.SERVER_SERVICE, QUEUE_NAME, new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationEvent notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { if (!(notificationKey instanceof PushNotificationKey)) { log.error("Push Notification service got an unexpected notification type {}", notificationKey.getClass().getName()); return; } final PushNotificationKey key = (PushNotificationKey) notificationKey; final InternalCallContext callContext = internalCallContextFactory.createInternalCallContext(tenantRecordId, accountRecordId, retryService, CallOrigin.INTERNAL, UserType.SYSTEM, userToken); try { pushNotificationListener.resendPushNotification(key, callContext); } catch (JsonProcessingException e) { log.error("Failed to push notification url='{}', tenantId='{}'", key.getUrl(), key.getTenantId(), e); } } } ); }

Target:
public void initialize() throws NotificationQueueAlreadyExists { retryQueue = notificationQueueService.createNotificationQueue(DefaultServerService.SERVER_SERVICE, QUEUE_NAME, new NotificationQueueHandler() { @Override public void handleReadyNotification(final NotificationEvent notificationKey, final DateTime eventDateTime, final UUID userToken, final Long accountRecordId, final Long tenantRecordId) { if (!(notificationKey instanceof PushNotificationKey)) { log.error("Push Notification service got an unexpected notification type {}", notificationKey.getClass().getName()); return; } final PushNotificationKey key = (PushNotificationKey) notificationKey; try { pushNotificationListener.resendPushNotification(key); } catch (JsonProcessingException e) { log.error("Failed to push notification url='{}', tenantId='{}'", key.getUrl(), key.getTenantId(), e); } } } ); }
Source:
public MoveDescription( final Collection<Unit> units, final Route route, final Map<Unit, Unit> unitsToTransports, final Map<Unit, Collection<Unit>> dependentUnits) { super(units); this.route = route; this.unitsToTransports = unitsToTransports; if (dependentUnits != null && !dependentUnits.isEmpty()) { this.dependentUnits = new HashMap<>(); for (final Entry<Unit, Collection<Unit>> entry : dependentUnits.entrySet()) { this.dependentUnits.put(entry.getKey(), new HashSet<>(entry.getValue())); } } else { this.dependentUnits = null; } }

Target:
public MoveDescription( final Collection<Unit> units, final Route route, final Map<Unit, Unit> unitsToTransports, final Map<Unit, Collection<Unit>> dependentUnits) { super(units); this.route = route; this.unitsToTransports = unitsToTransports; if (!dependentUnits.isEmpty()) { this.dependentUnits = new HashMap<>(); for (final Entry<Unit, Collection<Unit>> entry : dependentUnits.entrySet()) { this.dependentUnits.put(entry.getKey(), new HashSet<>(entry.getValue())); } } else { this.dependentUnits = Map.of(); } }
Source:
public HttpResponse setStatus(HttpResponseStatus status) { ObjectUtil.checkNotNull(status, "status"); this.status = status; return this; }

Target:
public HttpResponse setStatus(HttpResponseStatus status) { this.status = ObjectUtil.checkNotNull(status, "status"); return this; }
Source:
public void afterCommit(final Transaction tx) { for (MessageReference ref : refsToAck) { clearLingerRef(ref); synchronized (ref.getQueue()) { queue.postAcknowledge(ref, reason); } } if (pagedMessagesToPostACK != null) { for (MessageReference refmsg : pagedMessagesToPostACK) { ((PagedReference)refmsg).removePendingFlag(); if (((PagedReference) refmsg).isLargeMessage()) { decrementRefCount(refmsg); } } } }

Target:
public void afterCommit(final Transaction tx) { for (MessageReference ref : refsToAck) { clearLingerRef(ref); synchronized (ref.getQueue()) { ref.getQueue().postAcknowledge(ref, reason); } } if (pagedMessagesToPostACK != null) { for (MessageReference refmsg : pagedMessagesToPostACK) { ((PagedReference)refmsg).removePendingFlag(); if (((PagedReference) refmsg).isLargeMessage()) { decrementRefCount(refmsg); } } } }
Source:
protected void onOffline() { super.onOffline(); showOfflineBar(); invalidateOptionsMenu(); if(singleFragment!=null && singleFragment instanceof CourseHandoutFragment){ ((CourseHandoutFragment) singleFragment).showHandoutsOffline(); } }

Target:
protected void onOffline() { super.onOffline(); showOfflineBar(); invalidateOptionsMenu(); }
Source:
private void assertSavedContainer(String id) { long timeout = System.currentTimeMillis() + 15000; boolean foundContainer = false; while (!foundContainer && System.currentTimeMillis() < timeout) { try { Thread.sleep(200); if (containerRepository.findOne(id2) != null) { foundContainer = true; } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } assertTrue("Container repository is not updated with the test containers", foundContainer); }

Target:
private void assertSavedContainer(String id) { long timeout = System.currentTimeMillis() + 15000; boolean foundContainer = false; while (!foundContainer && System.currentTimeMillis() < timeout) { try { Thread.sleep(200); if (containerRepository.findOne(id) != null) { foundContainer = true; } } catch (InterruptedException e) { Thread.currentThread().interrupt(); break; } } assertTrue("Container repository is not updated with the test containers", foundContainer); }
Source:
public List<String> getPorts() { return EnvUtil.removeEmpties(ports); }

Target:
public List<String> getPorts() { return EnvUtil.removeEmptyEntries(ports); }
Source:
int getLineHeight(int lineIndex) { LineSizeInfo line = getLineSize(lineIndex); if (line.needsRecalculateHeight()) { if (isVariableHeight(lineIndex)) { return Math.round(averageLineHeight); } else { line.height = getLineHeight() + getLineSpacing(lineIndex); } } return line.height; }

Target:
int getLineHeight(int lineIndex) { return getLineHeight(lineIndex, true); }
Source:
List<URIish> getURIs(Project.NameKey project, String urlMatch) { List<URIish> r = Lists.newArrayListWithCapacity(remote.getURIs().size()); for (URIish uri : remote.getURIs()) { if (matches(uri, urlMatch)) { String name = project.get(); if (needsUrlEncoding(uri)) { name = encode(name); } if (remoteNameStyle.equals("dash")) { name = name.replace("/", "-"); } else if(remoteNameStyle.equals("underscore")) { name = name.replace("/", "_"); } else if (remoteNameStyle.equals("basenameOnly")) { int basenameStart = name.lastIndexOf("/") + 1; if (name.length() > basenameStart) { name = name.substring(basenameStart); } } else if (!remoteNameStyle.equals("slash")) { ReplicationQueue.log.debug(String.format( "Unknown remoteNameStyle: %s, falling back to slash", remoteNameStyle)); } String replacedPath = ReplicationQueue.replaceName(uri.getPath(), name, isSingleProjectMatch()); if (replacedPath != null) { uri = uri.setPath(replacedPath); r.add(uri); } } } return r; }

Target:
List<URIish> getURIs(Project.NameKey project, String urlMatch) { List<URIish> r = Lists.newArrayListWithCapacity(remote.getURIs().size()); for (URIish uri : remote.getURIs()) { if (matches(uri, urlMatch)) { String name = project.get(); if (needsUrlEncoding(uri)) { name = encode(name); } if (remoteNameStyle.equals("dash")) { name = name.replace("/", "-"); } else if(remoteNameStyle.equals("underscore")) { name = name.replace("/", "_"); } else if (remoteNameStyle.equals("basenameOnly")) { name = FilenameUtils.getBaseName(name); } else if (!remoteNameStyle.equals("slash")) { ReplicationQueue.log.debug(String.format( "Unknown remoteNameStyle: %s, falling back to slash", remoteNameStyle)); } String replacedPath = ReplicationQueue.replaceName(uri.getPath(), name, isSingleProjectMatch()); if (replacedPath != null) { uri = uri.setPath(replacedPath); r.add(uri); } } } return r; }
Source:
public void checkCommandMetadata() throws Exception { try (CommandController controller = uiTestHarness.createCommandController(JPANewEntityCommandImpl.class, project.getRoot())) { controller.initialize(); assertTrue(controller.getCommand() instanceof JPANewEntityCommandImpl); UICommandMetadata metadata = controller.getMetadata(); assertEquals("JPA: New Entity", metadata.getName()); assertEquals("Java EE", metadata.getCategory().getName()); assertEquals("JPA", metadata.getCategory().getSubCategory().getName()); assertFalse("Project is created, shouldn't have targetLocation", controller.hasInput("targetLocation")); assertEquals(7, controller.getInputs().size()); assertTrue(controller.hasInput("named")); assertTrue(controller.hasInput("targetPackage")); assertTrue(controller.hasInput("idStrategy")); assertTrue(controller.hasInput("tableName")); assertTrue(controller.hasInput("overwrite")); assertTrue(controller.hasInput("extends")); assertTrue(controller.hasInput("implements")); assertTrue(controller.getValueFor("targetPackage").toString().endsWith(DEFAULT_ENTITY_PACKAGE)); } }

Target:
public void checkCommandMetadata() throws Exception { try (CommandController controller = uiTestHarness.createCommandController(JPANewEntityCommand.class, project.getRoot())) { controller.initialize(); assertTrue(controller.getCommand() instanceof JPANewEntityCommand); UICommandMetadata metadata = controller.getMetadata(); assertEquals("JPA: New Entity", metadata.getName()); assertEquals("Java EE", metadata.getCategory().getName()); assertEquals("JPA", metadata.getCategory().getSubCategory().getName()); assertFalse("Project is created, shouldn't have targetLocation", controller.hasInput("targetLocation")); assertEquals(7, controller.getInputs().size()); assertTrue(controller.hasInput("named")); assertTrue(controller.hasInput("targetPackage")); assertTrue(controller.hasInput("idStrategy")); assertTrue(controller.hasInput("tableName")); assertTrue(controller.hasInput("overwrite")); assertTrue(controller.hasInput("extends")); assertTrue(controller.hasInput("implements")); assertTrue(controller.getValueFor("targetPackage").toString().endsWith(DEFAULT_ENTITY_PACKAGE)); } }
Source:
int process(String oid) { val entity = getEntity(oid); if (!entity.isPresent()) { throw new RuntimeException("That ain't no thang. Literally"); } val resource = createInputResource(entity); SamFileBuilder bob = new SamFileBuilder(). containedOnly(containedOnly). useOriginalHeader(useOriginalHeader). outputFormat(outputFormat). queries(query). outputDir(outputDir). outputIndex(outputIndex). entity(entity.get()). samInput(resource); if (headerOnly) { bob.buildHeaderOnly(); } else { switch (outputType) { case TRIMMED: bob.buildTrimmed(); break; case MINI: case CROSS: terminal.printError("Output type '%s' not implemented", outputType.toString()); break; } } return SUCCESS_STATUS; }

Target:
int process(String oid) { val entity = getEntity(oid); if (!entity.isPresent()) { val msg = String.format("Metadata not found for object id %s", oid); log.error(msg); session.info(msg); throw new RuntimeException(msg); } val resource = createInputResource(entity); val bob = new SamFileBuilder(). programName(ICGC_STORAGE_CLIENT). version(VersionUtils.getScmInfo().get("git.commit.id.describe")). programId(ICGC). commandLine(getCommandLine()). containedOnly(containedOnly). useOriginalHeader(useOriginalHeader). outputFormat(outputFormat). queries(query). outputDir(outputDir). bedFile(bedFile). outputIndex(outputIndex). entity(entity.get()). stdout(stdout). samInput(resource); log.info("Constructed SamFileBuilder: " + bob.toString()); if (headerOnly) { bob.buildHeaderOnly(); } else { switch (outputType) { case TRIMMED: bob.buildTrimmed(); break; case MERGED: terminal.printError("Output type '%s' not implemented", outputType.toString()); break; case CROSS: terminal.printError("Output type '%s' not implemented", outputType.toString()); break; } } return SUCCESS_STATUS; }
Source:
private void refreshHomeAndLogoutButtons() { if (startButton != null) { startButton.setText(Localization.get(homeMessageKey)); } if (logoutButton != null) { logoutButton.setText(Localization.get(logoutMessageKey)); } }

Target:
private void refreshHomeAndLogoutButtons() { if (startButton != null) { startButton.setText(Localization.get(homeMessageKey)); } else { Logger.log(AndroidLogger.SOFT_ASSERT, "startButton was null in refreshHomeAndLogoutButtons()"); } if (logoutButton != null) { logoutButton.setText(Localization.get(logoutMessageKey)); } else { Logger.log(AndroidLogger.SOFT_ASSERT, "logoutButton was null in refreshHomeAndLogoutButtons()"); } }
Source:
public void yacht() { int expected = 50; assertEquals(expected, new Yacht(new int[]{ 5, 5, 5, 5, 5 }, YachtCategory.YACHT).score()); }

Target:
public void yacht() { Yacht yacht = new Yacht(new int[]{ 5, 5, 5, 5, 5 }, YachtCategory.YACHT); assertEquals(50, yacht.score()); }
Source:
private int setEthernetTethering(boolean enable) { if (VDBG) Log.d(TAG, "setEthernetTethering(" + enable + ")"); if (mEthernetManager.isEthernetTethering()) { if (VDBG) Log.d(TAG, "Ethernet Tethering mode is on"); updateConfiguration(); synchronized (mPublicSync) { tetherMatchingInterfaces(enable ? IpServer.STATE_TETHERED : IpServer.STATE_AVAILABLE, TETHERING_ETHERNET); } } return TETHER_ERROR_NO_ERROR; }

Target:
private int setEthernetTethering(boolean enable) { if (VDBG) Log.d(TAG, "setEthernetTethering(" + enable + ")"); final ContentResolver cr = mContext.getContentResolver(); if (enable && mEthernetManager.isEthernetTethering()) { Log.d(TAG, "Ethernet Tethering mode is on"); synchronized (mPublicSync) { tetherMatchingInterfaces(IpServer.STATE_TETHERED, TETHERING_ETHERNET); } } else { synchronized (mPublicSync) { tetherMatchingInterfaces(IpServer.STATE_AVAILABLE, TETHERING_ETHERNET); } } return TETHER_ERROR_NO_ERROR; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_email_sign_up); findViewById(R.id.home).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(SignUpEmailActivity.this, LoginActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); } }); Bundle extras = getIntent().getExtras(); KeyBoardSupport.helperHideKeyboard(findViewById(R.id.signUp), this); if (extras != null) { userAns = extras.getString("userAns"); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_email_sign_up); Bundle extras = getIntent().getExtras(); KeyBoardSupport.helperHideKeyboard(findViewById(R.id.signUp), this); if (extras != null) { userAns = extras.getString("userAns"); } }
Source:
public void init(){ UI ui = TestController.getUI(); panelControl = ui.getPanelControl(); testPref = UI.prefs; }

Target:
public void init(){ panelControl = TestController.getUI().getPanelControl(); }
Source:
private ASTRewrite doInitField() { FieldDeclaration field= getFieldDeclaration(fVariableBinding.getName()); if (field == null) { return null; } AST ast= fAstNode.getAST(); ASTRewrite rewrite= ASTRewrite.create(ast); ITypeBinding type= fVariableBinding.getType(); String variableTypeName= type.getName(); VariableDeclarationFragment newFragment= ast.newVariableDeclarationFragment(); newFragment.setName(ast.newSimpleName(fVariableBinding.getName())); FieldDeclaration declaration= ast.newFieldDeclaration(newFragment); declaration.modifiers().addAll(ast.newModifiers(fVariableBinding.getModifiers())); Expression expression= null; if (type.isPrimitive()) { declaration.setType(ast.newPrimitiveType(PrimitiveType.toCode(variableTypeName))); expression= ast.newNumberLiteral(); } else if ("String".equals(variableTypeName)) { declaration.setType(ast.newSimpleType(ast.newName(variableTypeName))); expression= ast.newStringLiteral(); } else { if (type.isParameterizedType()) { Type newType= createParameterizedType(ast, type); declaration.setType(newType); } else { SimpleType newSimpleType= ast.newSimpleType(ast.newName(variableTypeName)); declaration.setType(newSimpleType); } if (hasDefaultConstructor()) { ClassInstanceCreation cic= ast.newClassInstanceCreation(); cic.setType(ast.newSimpleType(ast.newName(variableTypeName))); expression= cic; } else { expression= ast.newNullLiteral(); } } newFragment.setInitializer(expression); rewrite.replace(field, declaration, null); setEndPosition(rewrite.track(expression)); return rewrite; }

Target:
private ASTRewrite doInitField() { FieldDeclaration field= getFieldDeclaration(fVariableBinding.getName()); if (field == null) { return null; } AST ast= fAstNode.getAST(); ITypeBinding type= fVariableBinding.getType(); String variableTypeName= type.getName(); VariableDeclarationFragment newFragment= ast.newVariableDeclarationFragment(); newFragment.setName(ast.newSimpleName(fVariableBinding.getName())); FieldDeclaration declaration= ast.newFieldDeclaration(newFragment); declaration.modifiers().addAll(ast.newModifiers(fVariableBinding.getModifiers())); Expression expression= null; if (type.isPrimitive()) { declaration.setType(ast.newPrimitiveType(PrimitiveType.toCode(variableTypeName))); expression= ast.newNumberLiteral(); } else if ("String".equals(variableTypeName)) { declaration.setType(ast.newSimpleType(ast.newName(variableTypeName))); expression= ast.newStringLiteral(); } else { if (type.isParameterizedType()) { Type newType= createParameterizedType(ast, type); declaration.setType(newType); } else { SimpleType newSimpleType= ast.newSimpleType(ast.newName(variableTypeName)); declaration.setType(newSimpleType); } if (hasDefaultConstructor()) { ClassInstanceCreation cic= ast.newClassInstanceCreation(); cic.setType(ast.newSimpleType(ast.newName(variableTypeName))); expression= cic; } else { expression= ast.newNullLiteral(); } } newFragment.setInitializer(expression); ASTRewrite rewrite= ASTRewrite.create(ast); rewrite.replace(field, declaration, null); setEndPosition(rewrite.track(expression)); return rewrite; }
Source:
public void test_findAllPortlets() throws LanguageException, DotDataException, SystemException { Portlet portlet = null; try { Collection<Portlet> portlets = portletApi.findAllPortlets(); portlet = createCustomPortlet("testCustomPortlet", "testCustomPortlet", "Persona", ""); Assert.assertNotEquals(portlets.size(),portletApi.findAllPortlets().size()); Assert.assertEquals(portlets.size()+1,portletApi.findAllPortlets().size()); }finally { if(portlet!=null){ portletApi.deletePortlet(portlet.getPortletId()); } } }

Target:
public void test_findAllPortlets() throws LanguageException, DotDataException, SystemException { Portlet portlet = null; try { Collection<Portlet> portlets = portletApi.findAllPortlets(); portlet = createCustomPortlet("testCustomPortlet", "testCustomPortlet", "Persona", ""); Assert.assertEquals(portlets.size()+1,portletApi.findAllPortlets().size()); }finally { if(portlet!=null){ portletApi.deletePortlet(portlet.getPortletId()); } } }
Source:
public synchronized List<TableId> tables() { final long timeout = 10000L; long started = System.currentTimeMillis(); long now = started; while (tables == null && now - started < timeout) { try { wait(timeout - (now - started)); } catch (InterruptedException e) { } now = System.currentTimeMillis(); } if (tables == null) { throw new ConnectException("Tables could not be updated quickly enough."); } if (!duplicates.isEmpty()) { log.info("The filtered tables are ", tables); throw new ConnectException(configErrorMsg + duplicates); } return tables; }

Target:
public synchronized List<TableId> tables() { final long timeout = 10000L; long started = System.currentTimeMillis(); long now = started; while (tables == null && now - started < timeout) { try { wait(timeout - (now - started)); } catch (InterruptedException e) { } now = System.currentTimeMillis(); } if (tables == null) { throw new ConnectException("Tables could not be updated quickly enough."); } if (!duplicates.isEmpty()) { String configText; if (whitelist != null) { configText = "'" + JdbcSourceConnectorConfig.TABLE_WHITELIST_CONFIG + "'"; } else if (blacklist != null) { configText = "'" + JdbcSourceConnectorConfig.TABLE_BLACKLIST_CONFIG + "'"; } else { configText = "'" + JdbcSourceConnectorConfig.TABLE_WHITELIST_CONFIG + "' or '" + JdbcSourceConnectorConfig.TABLE_BLACKLIST_CONFIG + "'"; } String msg = "The connector uses the unqualified table name as the topic name and has " + "detected duplicate unqualified table names. This could lead to mixed data types in " + "the topic and downstream processing errors. To prevent such processing errors, the " + "JDBC Source connector fails to start when it detects duplicate table name " + "configurations. Update the connector's " + configText + " config to include exactly " + "one table in each of the tables listed below.\n\t"; throw new ConnectException(msg + duplicates.values()); } return tables; }
Source:
public KubernetesResourceManagerDriver( Configuration flinkConfig, FlinkKubeClient kubeClient, KubernetesResourceManagerDriverConfiguration configuration) { super(flinkConfig, GlobalConfiguration.loadConfiguration()); this.clusterId = configuration.getClusterId(); this.podCreationRetryInterval = configuration.getPodCreationRetryInterval(); this.kubeClient = kubeClient; requestResourceFutures = new HashMap<>(); podCreationCoolDown = FutureUtils.completedVoidFuture(); }

Target:
public KubernetesResourceManagerDriver( Configuration flinkConfig, FlinkKubeClient kubeClient, KubernetesResourceManagerDriverConfiguration configuration) { super(flinkConfig, GlobalConfiguration.loadConfiguration()); this.clusterId = Preconditions.checkNotNull(configuration.getClusterId()); this.podCreationRetryInterval = Preconditions.checkNotNull(configuration.getPodCreationRetryInterval()); this.kubeClient = Preconditions.checkNotNull(kubeClient); this.requestResourceFutures = new HashMap<>(); this.podCreationCoolDown = FutureUtils.completedVoidFuture(); }
Source:
void dumpTable(String dbName, String tblName, String validTxnList, Path dbRoot, long lastReplId, Hive hiveDb, HiveWrapper.Tuple<Table> tuple) throws Exception { TableSpec tableSpec = new TableSpec(tuple.object); TableExport.Paths exportPaths = new TableExport.Paths(work.astRepresentationForErrorMsg, dbRoot, tblName, conf, true); String distCpDoAsUser = conf.getVar(HiveConf.ConfVars.HIVE_DISTCP_DOAS_USER); tuple.replicationSpec.setIsReplace(true); if (AcidUtils.isTransactionalTable(tableSpec.tableHandle)) { tuple.replicationSpec.setValidWriteIdList(getValidWriteIdList(dbName, tblName, validTxnList)); tuple.replicationSpec.setCurrentReplicationState(String.valueOf(lastReplId)); } MmContext mmCtx = MmContext.createIfNeeded(tableSpec.tableHandle); new TableExport( exportPaths, tableSpec, tuple.replicationSpec, hiveDb, distCpDoAsUser, conf, mmCtx).write(); replLogger.tableLog(tblName, tableSpec.tableHandle.getTableType()); }

Target:
void dumpTable(String dbName, String tblName, String validTxnList, Path dbRoot, long lastReplId, Hive hiveDb, HiveWrapper.Tuple<Table> tuple) throws Exception { TableSpec tableSpec = new TableSpec(tuple.object); TableExport.Paths exportPaths = new TableExport.Paths(work.astRepresentationForErrorMsg, dbRoot, tblName, conf, true); String distCpDoAsUser = conf.getVar(HiveConf.ConfVars.HIVE_DISTCP_DOAS_USER); tuple.replicationSpec.setIsReplace(true); if (AcidUtils.isTransactionalTable(tableSpec.tableHandle)) { tuple.replicationSpec.setValidTxnList(validTxnList); tuple.replicationSpec.setValidWriteIdList(getValidWriteIdList(dbName, tblName, validTxnList)); tuple.replicationSpec.setCurrentReplicationState(String.valueOf(lastReplId)); } MmContext mmCtx = MmContext.createIfNeeded(tableSpec.tableHandle); new TableExport( exportPaths, tableSpec, tuple.replicationSpec, hiveDb, distCpDoAsUser, conf, mmCtx).write(); replLogger.tableLog(tblName, tableSpec.tableHandle.getTableType()); }