auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void test_eviction_eviction_prioritizer_not_specified() throws Exception { UserManagedCache<Number, String> cache = UserManagedCacheBuilder.newUserManagedCacheBuilder(Number.class, String.class, LoggerFactory .getLogger(Ehcache.class + "-" + "StandaloneCacheEvictionTest1")) .withResourcePools(newResourcePoolsBuilder().heap(1, EntryUnit.ENTRIES).build()) .build(true); assertThat(cache.getRuntimeConfiguration().getResourcePools().getPoolForResource(ResourceType.Core.HEAP).getSize(), equalTo(1L)); for (int i = 0; i < 3; i++) { cache.putIfAbsent(i, "" + i); } int nullValuesFound = 0; for (int i = 0; i < 3; i++) { String retrievedValue = cache.get(i); if (retrievedValue == null) { nullValuesFound ++; } } assertThat("The capacity of the store is 1, and we found more than 1 non empty value in it !", nullValuesFound, is(2)); }

Target:
public void test_eviction_eviction_prioritizer_not_specified() throws Exception { UserManagedCache<Number, String> cache = UserManagedCacheBuilder.newUserManagedCacheBuilder(Number.class, String.class, LoggerFactory .getLogger(Ehcache.class + "-" + "UserManagedCacheEvictionTest1")) .withResourcePools(newResourcePoolsBuilder().heap(1, EntryUnit.ENTRIES).build()) .build(true); assertThat(cache.getRuntimeConfiguration().getResourcePools().getPoolForResource(ResourceType.Core.HEAP).getSize(), equalTo(1L)); for (int i = 0; i < 3; i++) { cache.putIfAbsent(i, "" + i); } int nullValuesFound = 0; for (int i = 0; i < 3; i++) { String retrievedValue = cache.get(i); if (retrievedValue == null) { nullValuesFound ++; } } assertThat("The capacity of the store is 1, and we found more than 1 non empty value in it !", nullValuesFound, is(2)); }
Source:
public ActionResult execute() { String studentId; String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); if (studentEmail == null || courseId == null) { studentId = userInfo.id; } else { StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail); studentId = student.getGoogleId(); } if (StringHelper.isEmpty(studentId)) { return new JsonResult(MESSAGE_STUDENT_NOT_REGISTERED, HttpStatus.SC_NOT_FOUND); } StudentProfileAttributes studentProfile = logic.getStudentProfile(studentId); String name = logic.getAccount(studentId).name; if (studentProfile == null) { studentProfile = StudentProfileAttributes.builder(studentId).build(); } if (userInfo.isStudent && studentId.equals(userInfo.id)) { studentProfile.email = null; studentProfile.shortName = null; } StudentProfileData output = new StudentProfileData(name, studentProfile); return new JsonResult(output); }

Target:
public ActionResult execute() { String studentId; String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); if (studentEmail == null || courseId == null) { studentId = userInfo.id; } else { StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail); studentId = student.getGoogleId(); } if (StringHelper.isEmpty(studentId)) { return new JsonResult(MESSAGE_STUDENT_NOT_REGISTERED, HttpStatus.SC_NOT_FOUND); } StudentProfileAttributes studentProfile = logic.getStudentProfile(studentId); String name = logic.getAccount(studentId).name; if (studentProfile == null) { studentProfile = StudentProfileAttributes.builder(studentId).build(); } StudentProfileData output = new StudentProfileData(name, studentProfile); if (userInfo.isStudent && !studentId.equals(userInfo.id)) { output.hideInformationWhenViewedByOtherStudent(); } return new JsonResult(output); }
Source:
public synchronized boolean assignFromUser(Set<TopicPartition> partitions) { setSubscriptionType(SubscriptionType.USER_ASSIGNED); if (this.assignment.partitionSet().equals(partitions)) return false; Map<TopicPartition, TopicPartitionState> assignedPartitionStates = partitionToStateMap(partitions); assignmentId++; Set<String> manualSubscribedTopics = new HashSet<>(); for (TopicPartition partition : partitions) { manualSubscribedTopics.add(partition.topic()); } this.assignment.set(assignedPartitionStates); return changeSubscription(manualSubscribedTopics); }

Target:
public synchronized boolean assignFromUser(Set<TopicPartition> partitions) { setSubscriptionType(SubscriptionType.USER_ASSIGNED); if (this.assignment.partitionSet().equals(partitions)) return false; assignmentId++; Set<String> manualSubscribedTopics = new HashSet<>(); Map<TopicPartition, TopicPartitionState> partitionToState = new HashMap<>(); for (TopicPartition partition : partitions) { TopicPartitionState state = assignment.stateValue(partition); if (state == null) state = new TopicPartitionState(); partitionToState.put(partition, state); manualSubscribedTopics.add(partition.topic()); } this.assignment.set(partitionToState); return changeSubscription(manualSubscribedTopics); }
Source:
public void setWorkDirTree(File workDirTree) { this.workDirTree = workDirTree; }

Target:
public void setWorkDirTree(File workDirTree) throws IOException { this.workDirTree = workDirTree; setGit(); }
Source:
public boolean isValueDependent() { return getValue().isTypeDependent(); }

Target:
public boolean isValueDependent() { return getTargetEvaluation().isValueDependent(); }
Source:
public <T> Gauge<T> gauge(String name, Gauge<T> gauge) { checkNotNullOrEmpty(name); checkNotNull(gauge); String fullName = name(name); Gauge<T> metric = (Gauge<T>) _metrics.get(fullName); if (metric == null) { metric = _registry.register(fullName, gauge); } return metric; }

Target:
public synchronized <T> Gauge<T> gauge(String name, Gauge<T> gauge) { checkNotNullOrEmpty(name); checkNotNull(gauge); String fullName = name(name); Gauge<T> metric = (Gauge<T>) _metrics.get(fullName); if (metric == null) { metric = _registry.register(fullName, gauge); } return metric; }
Source:
public EditorHandle openUrl(IWorkbenchPage page, String url, int customFlags) { for (TaskRepository repository : TasksUi.getRepositoryManager().getRepositories(GerritConnector.CONNECTOR_KIND)) { String taskId = getTaskId(repository, url); if (taskId != null) { int patchSetNumber = getPatchSetNumber(repository, url, taskId); IReview review = checkIfReviewIsOpen(page, taskId); if (patchSetNumber > 0 && review == null) { openWithCompareEditorForNewReview(page, taskId, patchSetNumber, getFilePath(repository, url, taskId, patchSetNumber)); } EditorHandle editorHandle = TasksUiUtil.openTaskWithResult(repository, taskId); if (patchSetNumber > 0) { if (review != null) { IFileItem file = getFileItemForReview(review, patchSetNumber, getFilePath(repository, url, taskId, patchSetNumber)); openWithCompareEditorForFile(file); } revealPatchSet(editorHandle, patchSetNumber); } return editorHandle; } } return null; }

Target:
public EditorHandle openUrl(IWorkbenchPage page, String url, int customFlags) { for (TaskRepository repository : TasksUi.getRepositoryManager().getRepositories(GerritConnector.CONNECTOR_KIND)) { String taskId = getTaskId(repository, url); if (taskId != null) { int patchSetNumber = getPatchSetNumber(repository, url, taskId); EditorHandle editorHandle = TasksUiUtil.openTaskWithResult(repository, taskId); if (patchSetNumber > 0) { IReview review = checkIfReviewIsOpen(page, taskId, repository.getUrl()); IFileItem file = getFileItem(review, patchSetNumber, getFilePath(repository, url, taskId, patchSetNumber)); openCompareEditor(file); revealPatchSet(editorHandle, patchSetNumber); } return editorHandle; } } return null; }
Source:
void addCallback(ListenableFuture<List<MutateRowsResponse>> bulkFuture) { Futures.addCallback( bulkFuture, new FutureCallback<List<MutateRowsResponse>>() { @Override public void onSuccess(List<MutateRowsResponse> result) { handleResult(result); } @Override public void onFailure(Throwable t) { perfromFullRetry(new AtomicReference<Long>(), t); } }); }

Target:
void addCallback(ListenableFuture<List<MutateRowsResponse>> bulkFuture) { Futures.addCallback( bulkFuture, new FutureCallback<List<MutateRowsResponse>>() { @Override public void onSuccess(List<MutateRowsResponse> result) { handleResult(result); } @Override public void onFailure(Throwable t) { performFullRetry(new AtomicReference<Long>(), t); } }); }
Source:
protected void AddStoragePoolToDb() { getStoragePool().setId(Guid.NewGuid()); getStoragePool().setstatus(StoragePoolStatus.Uninitialized); getStoragePool().setQuotaEnforcementType(QuotaEnforcmentTypeEnum.DISABLED); DbFacade.getInstance().getStoragePoolDAO().save(getStoragePool()); Quota defaultStoragePoolQuota = QuotaHelper.getInstance().addDefaultQuota(getStoragePool()); DbFacade.getInstance().getQuotaDAO().save(defaultStoragePoolQuota); }

Target:
protected void AddStoragePoolToDb() { getStoragePool().setId(Guid.NewGuid()); getStoragePool().setstatus(StoragePoolStatus.Uninitialized); Quota defaultStoragePoolQuota = generateQuotaForNewStoragePool(); DbFacade.getInstance().getStoragePoolDAO().save(getStoragePool()); createUnlimitedQuotaForEveryUser(defaultStoragePoolQuota); }
Source:
public void writeTo(JsonWriter writer, ReplicationSpec additionalPropertiesProvider) throws SemanticException, IOException { String pksString, fksString, uksString, nnsString; pksString = fksString = uksString = nnsString = ""; if (pks != null) { pksString = MessageFactory.getInstance().buildAddPrimaryKeyMessage(pks).toString(); } if (fks != null) { fksString = MessageFactory.getInstance().buildAddForeignKeyMessage(fks).toString(); } if (uks != null) { uksString = MessageFactory.getInstance().buildAddUniqueConstraintMessage(uks).toString(); } if (uks != null) { nnsString = MessageFactory.getInstance().buildAddNotNullConstraintMessage(nns).toString(); } writer.jsonGenerator.writeStringField("pks", pksString); writer.jsonGenerator.writeStringField("fks", fksString); writer.jsonGenerator.writeStringField("uks", uksString); writer.jsonGenerator.writeStringField("nns", nnsString); }

Target:
public void writeTo(JsonWriter writer, ReplicationSpec additionalPropertiesProvider) throws SemanticException, IOException { String pksString, fksString, uksString, nnsString; pksString = fksString = uksString = nnsString = ""; if (pks != null) { pksString = MessageFactory.getInstance().buildAddPrimaryKeyMessage(pks).toString(); } if (fks != null) { fksString = MessageFactory.getInstance().buildAddForeignKeyMessage(fks).toString(); } if (uks != null) { uksString = MessageFactory.getInstance().buildAddUniqueConstraintMessage(uks).toString(); } if (nns != null) { nnsString = MessageFactory.getInstance().buildAddNotNullConstraintMessage(nns).toString(); } writer.jsonGenerator.writeStringField("pks", pksString); writer.jsonGenerator.writeStringField("fks", fksString); writer.jsonGenerator.writeStringField("uks", uksString); writer.jsonGenerator.writeStringField("nns", nnsString); }
Source:
public void endElement(String uri, String localName, String qName) { if (qName.equals("XPrivacy")) { if (mListRestrictionUid.size() > 0) { int lastUid = mListRestrictionUid.get(mListRestrictionUid.size() - 1); mAppAdapter.setState(lastUid, STATE_SUCCESS, null); } for (int uid : mListRestartUid) mAppAdapter.setMessage(uid, getString(R.string.msg_restart)); mAppAdapter.notifyDataSetChanged(); mAppAdapter.setMessage(mListAbortedUid.get(0), getString(R.string.msg_aborted)); } }

Target:
public void endElement(String uri, String localName, String qName) { if (qName.equals("XPrivacy")) { if (mListRestrictionUid.size() > 0) { int lastUid = mListRestrictionUid.get(mListRestrictionUid.size() - 1); mAppAdapter.setState(lastUid, STATE_SUCCESS, null); } for (int uid : mListRestartUid) mAppAdapter.setMessage(uid, getString(R.string.msg_restart)); if (mListAbortedUid.size() > 0) mAppAdapter.setMessage(mListAbortedUid.get(0), getString(R.string.msg_aborted)); mAppAdapter.notifyDataSetChanged(); } }
Source:
private void addAll(Collection<?> collection) { for (Object o: collection){ this.myArrayList.add(JSONObject.wrap(o)); } }

Target:
private void addAll(Collection<?> collection) { this.myArrayList.ensureCapacity(this.myArrayList.size() + collection.size()); for (Object o: collection){ this.myArrayList.add(JSONObject.wrap(o)); } }
Source:
public boolean equals(Object obj) { if (obj == this) { return true; } else if (getClass().equals(obj.getClass()) && obj instanceof CommonProcessMemorySpec<?> ) { CommonProcessMemorySpec<?> that = (CommonProcessMemorySpec<?>) obj; return Objects.equals(this.flinkMemory, that.flinkMemory) && Objects.equals(this.jvmMetaspaceAndOverhead, that.jvmMetaspaceAndOverhead); } return false; }

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && getClass().equals(obj.getClass())) { CommonProcessMemorySpec<?> that = (CommonProcessMemorySpec<?>) obj; return Objects.equals(this.flinkMemory, that.flinkMemory) && Objects.equals(this.jvmMetaspaceAndOverhead, that.jvmMetaspaceAndOverhead); } return false; }
Source:
public WagoBindingConfig(Item item, String conf) { this.item = item; try { String attributes[] = conf.split(":"); couplerName = attributes[0]; module = Integer.parseInt(attributes[1]) - 1; channel = Integer.parseInt(attributes[2]) - 1; } catch (Exception e) { e.printStackTrace(); } }

Target:
public WagoBindingConfig(Item item, String conf) { this.item = item; String attributes[] = conf.split(":"); couplerName = attributes[0]; try { module = Integer.parseInt(attributes[1]) - 1; channel = Integer.parseInt(attributes[2]) - 1; } catch (NumberFormatException e) { logger.error("wago binding configuration invalid. Module or channel is not a number."); } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof CommandSpec)) { return false; } CommandSpec that = (CommandSpec) o; if (!this.args.equals(that.args)) { return false; } if (!this.argumentParser.equals(that.argumentParser)) { return false; } if (this.description != null ? !this.description.equals(that.description) : that.description != null) { return false; } if (!this.executor.equals(that.executor)) { return false; } if (this.extendedDescription != null ? !this.extendedDescription.equals(that.extendedDescription) : that.extendedDescription != null) { return false; } if (this.permission != null ? !this.permission.equals(that.permission) : that.permission != null) { return false; } return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CommandSpec that = (CommandSpec) o; return Objects.equal(this.args, that.args) && Objects.equal(this.executor, that.executor) && Objects.equal(this.description, that.description) && Objects.equal(this.extendedDescription, that.extendedDescription) && Objects.equal(this.permission, that.permission) && Objects.equal(this.argumentParser, that.argumentParser); }
Source:
public void checkCertificationValidity() { try { if (!checkCertificate(EngineEncryptionUtils.getCertificate(EngineLocalConfig.getInstance().getPKICACert()), AuditLogType.ENGINE_CA_CERTIFICATION_HAS_EXPIRED, AuditLogType.ENGINE_CA_CERTIFICATION_IS_ABOUT_TO_EXPIRE_ALERT, AuditLogType.ENGINE_CA_CERTIFICATION_IS_ABOUT_TO_EXPIRE, null) ^ !checkCertificate((X509Certificate) EngineEncryptionUtils.getCertificate(), AuditLogType.ENGINE_CERTIFICATION_HAS_EXPIRED, AuditLogType.ENGINE_CERTIFICATION_IS_ABOUT_TO_EXPIRE_ALERT, AuditLogType.ENGINE_CERTIFICATION_IS_ABOUT_TO_EXPIRE, null)) { return; } if (!Config.<Boolean>getValue(ConfigValues.EncryptHostCommunication)) { return; } hostDao.getAll() .stream() .filter(host -> host.getStatus() == VDSStatus.Up || host.getStatus() == VDSStatus.NonOperational) .forEach(host -> checkHostCertificateValidity(host)); } catch (Exception e) { log.error("Failed to check certification validity: {}", e.getMessage()); log.error("Exception", e); } }

Target:
public void checkCertificationValidity() { try { if (!checkCertificate(EngineEncryptionUtils.getCertificate(EngineLocalConfig.getInstance().getPKICACert()), AuditLogType.ENGINE_CA_CERTIFICATION_HAS_EXPIRED, AuditLogType.ENGINE_CA_CERTIFICATION_IS_ABOUT_TO_EXPIRE_ALERT, AuditLogType.ENGINE_CA_CERTIFICATION_IS_ABOUT_TO_EXPIRE, null) ^ !checkCertificate((X509Certificate) EngineEncryptionUtils.getCertificate(), AuditLogType.ENGINE_CERTIFICATION_HAS_EXPIRED, AuditLogType.ENGINE_CERTIFICATION_IS_ABOUT_TO_EXPIRE_ALERT, AuditLogType.ENGINE_CERTIFICATION_IS_ABOUT_TO_EXPIRE, null)) { return; } if (!Config.<Boolean>getValue(ConfigValues.EncryptHostCommunication)) { return; } hostDao.getAll() .stream() .filter(host -> host.getStatus() == VDSStatus.Up || host.getStatus() == VDSStatus.NonOperational) .forEach(this::checkHostCertificateValidity); } catch (Exception e) { log.error("Failed to check certification validity: {}", e.getMessage()); log.error("Exception", e); } }
Source:
public boolean removeQueues(Queue... queues) { removeQueues(Arrays.asList(queues) .stream() .map(Queue::getName)); return super.removeQueues(queues); }

Target:
public boolean removeQueues(Queue... queues) { removeQueues(Arrays.stream(queues) .map(Queue::getName)); return super.removeQueues(queues); }
Source:
public void testTrackingUpdate() throws Exception { Repository db2 = createBareRepository(); String remote = "origin"; String branch = "refs/heads/master"; String trackingBranch = "refs/remotes/" + remote + "/master"; RefUpdate trackingBranchRefUpdate = db.updateRef(trackingBranch); trackingBranchRefUpdate.setNewObjectId(db.resolve(branch)); trackingBranchRefUpdate.update(); final StoredConfig config = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(config, remote); URIish uri = new URIish(db2.getDirectory().toURI().toURL()); remoteConfig.addURI(uri); remoteConfig.addFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/" + remote + "/*")); remoteConfig.update(config); config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, "master", ConfigConstants.CONFIG_KEY_REMOTE, remote); config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, "master", ConfigConstants.CONFIG_KEY_MERGE, branch); config.save(); Git git = new Git(db); RevCommit commit = git.commit().setMessage("Commit to push").call(); RefSpec spec = new RefSpec(branch + ":" + branch); git.push().setRemote(remote).setRefSpecs(spec).call(); assertEquals(commit.getId(), db2.resolve(branch)); assertEquals(commit.getId(), db.resolve(trackingBranch)); }

Target:
public void testTrackingUpdate() throws Exception { Repository db2 = createBareRepository(); String remote = "origin"; String branch = "refs/heads/master"; String trackingBranch = "refs/remotes/" + remote + "/master"; Git git = new Git(db); RevCommit commit1 = git.commit().setMessage("Initial commit") .call(); RefUpdate branchRefUpdate = db.updateRef(branch); branchRefUpdate.setNewObjectId(commit1.getId()); branchRefUpdate.update(); RefUpdate trackingBranchRefUpdate = db.updateRef(trackingBranch); trackingBranchRefUpdate.setNewObjectId(commit1.getId()); trackingBranchRefUpdate.update(); final StoredConfig config = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(config, remote); URIish uri = new URIish(db2.getDirectory().toURI().toURL()); remoteConfig.addURI(uri); remoteConfig.addFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/" + remote + "/*")); remoteConfig.update(config); config.save(); RevCommit commit2 = git.commit().setMessage("Commit to push").call(); RefSpec spec = new RefSpec(branch + ":" + branch); Iterable<PushResult> resultIterable = git.push().setRemote(remote) .setRefSpecs(spec).call(); PushResult result = resultIterable.iterator().next(); TrackingRefUpdate trackingRefUpdate = result .getTrackingRefUpdate(trackingBranch); assertNotNull(trackingRefUpdate); assertEquals(trackingBranch, trackingRefUpdate.getLocalName()); assertEquals(branch, trackingRefUpdate.getRemoteName()); assertEquals(commit2.getId(), trackingRefUpdate.getNewObjectId()); assertEquals(commit2.getId(), db.resolve(trackingBranch)); assertEquals(commit2.getId(), db2.resolve(branch)); }
Source:
private boolean shouldRetryMethod(final Class<? extends Throwable> thrownClass, final Retryable retryable, final int attempts) { if (attempts == retryable.maxAttempts()) { return false; } final HashSet<Class<? extends Throwable>> failClasses = new HashSet<>(Arrays.asList(retryable .failImmediatelyOn())); failClasses.addAll(alwaysImmediateFailureExceptionClasses); for (final Class<? extends Throwable> failClass : failClasses) { if (failClass.isAssignableFrom(thrownClass)) { return false; } } return true; }

Target:
private boolean shouldRetryMethod(final Class<? extends Throwable> thrownClass, final Retryable retryable, final int attempts) { if (attempts >= retryable.maxAttempts()) { return false; } final HashSet<Class<? extends Throwable>> failClasses = new HashSet<>(Arrays.asList(retryable .failImmediatelyOn())); failClasses.addAll(alwaysImmediateFailureExceptionClasses); for (final Class<? extends Throwable> failClass : failClasses) { if (failClass.isAssignableFrom(thrownClass)) { return false; } } return true; }
Source:
public SubversionCredentialsDialogViewImpl(SubversionExtensionLocalizationConstants locale) { this.locale = locale; Widget widget = uiBinder.createAndBindUi(this); this.setWidget(widget); this.setTitle(locale.credentialsDialogTitle()); authenticateButton = createPrimaryButton(locale.credentialsDialogAuthenticateButton(), "svn-authentication-username", new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onAuthenticateClicked(); } }); Button cancelButton = createButton(locale.credentialsDialogCancelButton(), "svn-authentication-password", new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onCancelClicked(); } }); addButtonToFooter(authenticateButton); addButtonToFooter(cancelButton); }

Target:
public SubversionCredentialsDialogViewImpl(SubversionExtensionLocalizationConstants locale) { this.locale = locale; this.setWidget(uiBinder.createAndBindUi(this)); this.setTitle(locale.credentialsDialogTitle()); authenticateButton = createPrimaryButton(locale.credentialsDialogAuthenticateButton(), "svn-authentication-username", new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onAuthenticateClicked(); } }); Button cancelButton = createButton(locale.credentialsDialogCancelButton(), "svn-authentication-password", new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onCancelClicked(); } }); addButtonToFooter(authenticateButton); addButtonToFooter(cancelButton); }
Source:
public void emptyMapCausesException() { Map<Class<? extends AuthenticationException>, Class<? extends AbstractAuthenticationFailureEvent>> mappings = new HashMap<>(); publisher = new DefaultAuthenticationEventPublisher(); publisher.setAdditionalExceptionMappings(mappings); ApplicationEventPublisher appPublisher = mock(ApplicationEventPublisher.class); publisher.setApplicationEventPublisher(appPublisher); }

Target:
public void emptyMapCausesException() { Map<Class<? extends AuthenticationException>, Class<? extends AbstractAuthenticationFailureEvent>> mappings = new HashMap<>(); publisher = new DefaultAuthenticationEventPublisher(); publisher.setAdditionalExceptionMappings(mappings); }
Source:
private void lruRemove(final Slot e) { Slot p = e.lruPrev; Slot n = e.lruNext; if (p != null) p.lruNext = n; else lruHead = n; if (n != null) n.lruPrev = p; else lruTail = p; }

Target:
private void lruRemove(final Slot e) { Slot p = e.lruPrev; Slot n = e.lruNext; if (p != null) { p.lruNext = n; } else { lruHead = n; } if (n != null) { n.lruPrev = p; } else { lruTail = p; } }
Source:
private void updateCountOfExaminedCellTsPairsInCurrentRow(List<CellTsPairInfo> results) { byte[] currentRow = startRowInclusive; for (CellTsPairInfo cellTs : results) { if (!Arrays.equals(currentRow, cellTs.rowName)) { currentRow = cellTs.rowName; cellTsPairsAlreadyExaminedInCurrentRow = 0L; } cellTsPairsAlreadyExaminedInCurrentRow += 1; } }

Target:
private void updateCountOfExaminedCellTsPairsInCurrentRow(List<CellTsPairInfo> results) { byte[] currentRow = token.startRowInclusive(); for (CellTsPairInfo cellTs : results) { if (!Arrays.equals(currentRow, cellTs.rowName)) { currentRow = cellTs.rowName; cellTsPairsAlreadyExaminedInCurrentRow = 0L; } cellTsPairsAlreadyExaminedInCurrentRow += 1; } }
Source:
public boolean undo() { final StorageObject previousObject = gcsController.getObject(previousTopologyObjectName); if (previousObject != null) { try { gcsController.copyObject(previousTopologyObjectName, topologyObjectName, previousObject); } catch (IOException ioe) { LOG.log(Level.SEVERE, "Reverting to previous topology version failed", ioe); return false; } } return true; }

Target:
public boolean undo() { final StorageObject previousObject = gcsController.getStorageObject(previousTopologyObjectName); if (previousObject != null) { try { gcsController.copyStorageObject(previousTopologyObjectName, topologyObjectName, previousObject); } catch (IOException ioe) { LOG.log(Level.SEVERE, "Reverting to previous topology failed", ioe); return false; } } return true; }
Source:
public void forget(Xid xid) throws XAException { log.infof("forget xid:[%s]", xid); }

Target:
public void forget(Xid xid) throws XAException { log.tracef("forget xid:[%s]", xid); }
Source:
public boolean equals(Object o) { if (o == this) { return true; } if (o == null || o.getClass() != getClass()) { return false; } IntervalBroadcastDistributionRule that = (IntervalBroadcastDistributionRule) o; return interval.equals(that.interval) && colocatedDatasource.equals(that.colocatedDatasource); }

Target:
public boolean equals(Object o) { if (o == this) { return true; } if (o == null || o.getClass() != getClass()) { return false; } IntervalBroadcastDistributionRule that = (IntervalBroadcastDistributionRule) o; if (!Objects.equals(interval, that.interval)) { return false; } return Objects.equals(colocatedDataSources, that.colocatedDataSources); }
Source:
private void readTokens() { int nRead; String tags = null; try { char[] buff = new char[1 * 1024]; StringBuilder buffer = new StringBuilder(); while ((nRead = input.read(buff, 0, buff.length)) != -1) { buffer.append(buff, 0, nRead); } tags = buffer.toString(); } catch (IOException e) { e.printStackTrace(); } if (tags != null && !tags.isEmpty()) { int iValue = tags.indexOf(TagsBridge.VALUE); if (iValue > 0) { String tag = tags.substring(0, iValue); String value = tags.substring(iValue + TagsBridge.VALUE.length()); String token = tag + SEPARATOR + value; tokens = new String[2]; tokens[0] = tag; tokens[1] = token; } else { tokens = new String[1]; tokens[0] = tags; } } }

Target:
private void readTokens() { int nRead; String tags = null; try { char[] buff = new char[1 * 1024]; StringBuilder buffer = new StringBuilder(); while ((nRead = input.read(buff, 0, buff.length)) != -1) { buffer.append(buff, 0, nRead); } tags = buffer.toString(); } catch (IOException e) { log.error(e); } if (tags != null && !tags.isEmpty()) { int iValue = tags.indexOf(TagsBridge.VALUE); if (iValue > 0) { String tag = tags.substring(0, iValue); String value = tags.substring(iValue + TagsBridge.VALUE.length()); String token = tag + SEPARATOR + value; tokens = new String[2]; tokens[0] = tag; tokens[1] = token; } else { tokens = new String[1]; tokens[0] = tags; } } }
Source:
private void UpdateDatacenters() { Boolean isInVm = (Boolean) getIsInVm().getEntity(); Boolean isInternal = (Boolean) getIsInternal().getEntity(); getDataCenter().setIsAvailable(!isInVm && !isInternal); if (isInternal || isInVm) { AsyncDataProvider.GetDataCenterById((new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { DiskModel diskModel = (DiskModel) target; storage_pool dataCenter = (storage_pool) returnValue; ArrayList<storage_pool> dataCenters = new ArrayList<storage_pool>(); dataCenters.add(dataCenter); diskModel.getDataCenter().setItems(dataCenters); } })), getDatacenterId()); } else { AsyncDataProvider.GetDataCentersWithPermittedActionOnClusters(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { DiskModel diskModel = (DiskModel) target; ArrayList<storage_pool> dataCenters = (ArrayList<storage_pool>) returnValue; diskModel.getDataCenter().setItems(dataCenters); } }), ActionGroup.CREATE_DISK); } }

Target:
private void UpdateDatacenters() { Boolean isInVm = (Boolean) getIsInVm().getEntity(); Boolean isInternal = (Boolean) getIsInternal().getEntity(); getDataCenter().setIsAvailable(!isInVm); if (isInternal || isInVm) { AsyncDataProvider.GetDataCenterById((new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { DiskModel diskModel = (DiskModel) target; storage_pool dataCenter = (storage_pool) returnValue; ArrayList<storage_pool> dataCenters = new ArrayList<storage_pool>(); dataCenters.add(dataCenter); diskModel.getDataCenter().setItems(dataCenters); } })), getDatacenterId()); } else { AsyncDataProvider.GetDataCentersWithPermittedActionOnClusters(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { DiskModel diskModel = (DiskModel) target; ArrayList<storage_pool> dataCenters = (ArrayList<storage_pool>) returnValue; diskModel.getDataCenter().setItems(dataCenters); } }), ActionGroup.CREATE_DISK); } }
Source:
public void shouldMoveBlobDocumentToColdStorage() throws IOException { DocumentModel documentModel = createDocument(true); documentModel = moveContentToColdStorage(session, documentModel.getRef()); documentModel = session.getDocument(documentModel.getRef()); assertTrue(documentModel.hasFacet(COLD_STORAGE)); checkBlobContent(documentModel, FILE_CONTENT_PROPERTY, DUMMY_THUMBNAIL_CONTENT); checkBlobContent(documentModel, COLD_STORAGE_CONTENT_PROPERTY, FILE_CONTENT); }

Target:
public void shouldMoveBlobDocumentToColdStorage() throws IOException { DocumentModel documentModel = createDocument(true); documentModel = moveContentToColdStorage(session, documentModel.getRef()); session.save(); assertTrue(documentModel.hasFacet(COLD_STORAGE)); checkBlobContent(documentModel, FILE_CONTENT_PROPERTY, DUMMY_THUMBNAIL_CONTENT); checkBlobContent(documentModel, COLD_STORAGE_CONTENT_PROPERTY, FILE_CONTENT); }
Source:
public void activate() { if (!isActive()) { final IPermissionAuthority auth = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(getEditingDomain().getResourceSet()); auth.addAuthorityListener(this.getEditPartAuthorityListener()); super.activate(); DiagramElementEditPartOperation.activate(this); } EditPartAuthorityListener editModeUpdater = getEditPartAuthorityListener(); if (editModeUpdater.shouldRefresh()) { editModeUpdater.refreshEditMode(); } }

Target:
public void activate() { if (!isActive()) { final IPermissionAuthority auth = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(getEditingDomain().getResourceSet()); auth.addAuthorityListener(this.getEditPartAuthorityListener()); super.activate(); DiagramElementEditPartOperation.activate(this); } }
Source:
public void testNormalizerCannotMergeNonAdjacentRegions() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster m = cluster.getMaster(); final byte[][] keys = { Bytes.toBytes("aa"), Bytes.toBytes("aa1"), Bytes.toBytes("aa1!"), Bytes.toBytes("aa2") }; try (Table ht = TEST_UTIL.createMultiRegionTable(tableName, new byte[][]{FAMILYNAME}, keys)) { List<HRegion> generatedRegions = TEST_UTIL.getHBaseCluster().getRegions(tableName); Collections.sort(generatedRegions, Comparator.comparing(HRegion::getRegionInfo, RegionInfo.COMPARATOR)); HRegion region = generatedRegions.get(0); generateTestData(region, 3); region.flush(true); region = generatedRegions.get(1); generateTestData(region, 1); region.flush(true); region = generatedRegions.get(2); generateTestData(region, 3); region.flush(true); region = generatedRegions.get(3); generateTestData(region, 1); region.flush(true); region = generatedRegions.get(4); generateTestData(region, 5); region.flush(true); ModifyableTableDescriptor htd = new ModifyableTableDescriptor(tableName, admin.getDescriptor(tableName)); htd.setNormalizationEnabled(true); admin.modifyTable(htd); admin.flush(tableName); assertEquals(5, MetaTableAccessor.getRegionCount(TEST_UTIL.getConnection(), tableName)); Thread.sleep(5000); final List<NormalizationPlan> plans = m.getRegionNormalizer().computePlanForTable(tableName); assertNull(plans); } finally { admin.disableTable(tableName); admin.deleteTable(tableName); } }

Target:
public void testNormalizerCannotMergeNonAdjacentRegions() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster(); HMaster m = cluster.getMaster(); final byte[][] keys = { Bytes.toBytes("aa"), Bytes.toBytes("aa1"), Bytes.toBytes("aa1!"), Bytes.toBytes("aa2") }; try (Table ht = TEST_UTIL.createTable(tableName, FAMILYNAME, keys)) { List<HRegion> generatedRegions = TEST_UTIL.getHBaseCluster().getRegions(tableName); generatedRegions.sort(Comparator.comparing(HRegion::getRegionInfo, RegionInfo.COMPARATOR)); HRegion region = generatedRegions.get(0); generateTestData(region, 3); region.flush(true); region = generatedRegions.get(1); generateTestData(region, 1); region.flush(true); region = generatedRegions.get(2); generateTestData(region, 3); region.flush(true); region = generatedRegions.get(3); generateTestData(region, 1); region.flush(true); region = generatedRegions.get(4); generateTestData(region, 5); region.flush(true); final TableDescriptor td = TableDescriptorBuilder.newBuilder(admin.getDescriptor(tableName)) .setNormalizationEnabled(true) .build(); admin.modifyTable(td); admin.flush(tableName); assertEquals(5, MetaTableAccessor.getRegionCount(TEST_UTIL.getConnection(), tableName)); Thread.sleep(5000); final List<NormalizationPlan> plans = m.getRegionNormalizer().computePlanForTable(tableName); assertNull(plans); } finally { if (admin.tableExists(tableName)) { admin.disableTable(tableName); admin.deleteTable(tableName); } } }
Source:
private QuestionWidget getPendingWidget() { QuestionWidget bestMatch = null; for (QuestionWidget q : ((ODKView)mCurrentView).getWidgets()) { if (q.getFormId().equals(mFormController.getPendingCalloutFormIndex())) { bestMatch = q; } } return bestMatch; }

Target:
private QuestionWidget getPendingWidget() { FormIndex pendingIndex = mFormController.getPendingCalloutFormIndex(); if (pendingIndex == null) { return null; } for (QuestionWidget q : ((ODKView)mCurrentView).getWidgets()) { if (q.getFormId().equals(pendingIndex)) { return q; } } return null; }
Source:
public void accept(Event<EnvironmentDto> environmentDtoEvent) { EnvironmentDto environmentDto = environmentDtoEvent.getData(); environmentService.findEnvironmentById(environmentDto.getId()) .ifPresentOrElse(environment -> { try { if (AZURE.name().equals(environmentDto.getCloudPlatform())) { deleteResourceGroupIfEmpty(environmentDto, environment); } else { LOGGER.debug("Cloudplatform not azure, not creating resource group."); } goToFinishedState(environmentDtoEvent); } catch (Exception e) { goToFailedState(environmentDtoEvent, e.getMessage()); } }, () -> goToFailedState(environmentDtoEvent, String.format("Environment was not found with id '%s'.", environmentDto.getId())) ); }

Target:
public void accept(Event<EnvironmentDto> environmentDtoEvent) { EnvironmentDto environmentDto = environmentDtoEvent.getData(); environmentService.findEnvironmentById(environmentDto.getId()) .ifPresentOrElse(environment -> { try { deletePrerequisites(environmentDto, environment); goToFinishedState(environmentDtoEvent); } catch (Exception e) { goToFailedState(environmentDtoEvent, e.getMessage()); } }, () -> goToFailedState(environmentDtoEvent, String.format("Environment was not found with id '%s'.", environmentDto.getId())) ); }
Source:
public KeyValueFileReader(final File keyValueFile) { try { this.reader = new BufferedReader(new FileReader(keyValueFile)); this.fileName = keyValueFile.getName(); } catch (FileNotFoundException ex) { throw new OsmosisRuntimeException("Unable to read from key.value file " + fileName + ".", ex); } }

Target:
public KeyValueFileReader(final File keyValueFile) throws FileNotFoundException { this.reader = new BufferedReader(new FileReader(keyValueFile)); }
Source:
protected org.uberfire.java.nio.file.Path parseCriteriaPath( DiagramLookupRequest request ) { String criteria = request.getCriteria(); if ( isEmpty( criteria ) ) { return getServiceImpl().getDiagramsPath(); } else { Map<String, String> criteriaMap = AbstractCriteriaLookupManager.parseCriteria( criteria ); String name = criteriaMap.get( "name" ); if ( !isEmpty( name) ) { Collection<Diagram> diagrams = getItemsByPath( getServiceImpl().getDiagramsPath() ); if ( null != diagrams && !diagrams.isEmpty() ) { for ( final Diagram diagram : diagrams ) { if ( diagram.getName().equals( name ) ) { return Paths.convert( diagram.getMetadata().getPath() ); } } } LOG.error( "Diagram with name [" + name + "] not found." ); return null; } } String m = "Criteria [" + criteria + "] not supported."; LOG.error( m ); throw new UnsupportedOperationException( m ); }

Target:
protected org.uberfire.java.nio.file.Path parseCriteriaPath( DiagramLookupRequest request ) { String criteria = request.getCriteria(); if ( StringUtils.isEmpty( criteria ) ) { return getServiceImpl().getDiagramsPath(); } else { Map<String, String> criteriaMap = AbstractCriteriaLookupManager.parseCriteria( criteria ); String name = criteriaMap.get( "name" ); if ( !StringUtils.isEmpty( name ) ) { Collection<Diagram> diagrams = getItemsByPath( getServiceImpl().getDiagramsPath() ); if ( null != diagrams ) { final Diagram d = diagrams .stream() .filter( diagram -> name.equals( diagram.getName() ) ) .findFirst() .orElse( null ); if ( null != d ) { return Paths.convert( d.getMetadata().getPath() ); } } LOG.error( "Diagram with name [" + name + "] not found." ); return null; } } String m = "Criteria [" + criteria + "] not supported."; LOG.error( m ); throw new IllegalArgumentException( m ); }
Source:
private <V> V winrmCallRetryConnFailure(CallableFunction<V> winrmCall) throws SOAPFaultException { int retries = retriesForConnectionFailures != null ? retriesForConnectionFailures : 10; List<Throwable> exceptions = new ArrayList<>(); for (int i = 0; i < retries; i++) { try { return winrmCall.call(); } catch (SOAPFaultException soapFault) { throw soapFault; } catch (javax.xml.ws.WebServiceException wsException) { if (wsException.getCause() instanceof ConnectException) { if (i == (retries + 1)) { LOG.info("Propagating Connection RM exception (attempt " + (i + 1) + " of " + retries + ") {}", wsException); } else if (i == 0) { LOG.warn("Ignoring exception and retrying (attempt " + (i + 1) + " of " + retries + ") {}", wsException); } else { LOG.debug("Ignoring exception and retrying (attempt " + (i + 1) + " of " + retries + ") {}", wsException); } } exceptions.add(wsException); } } throw new RuntimeException("failed task "+winrmCall, exceptions.get(exceptions.size()-1)); }

Target:
private <V> V winrmCallRetryConnFailure(CallableFunction<V> winrmCall) throws SOAPFaultException { int retries = retriesForConnectionFailures != null ? retriesForConnectionFailures : 5; List<Throwable> exceptions = new ArrayList<>(); for (int i = 0; i < retries + 1; i++) { try { return winrmCall.call(); } catch (SOAPFaultException soapFault) { throw soapFault; } catch (javax.xml.ws.WebServiceException wsException) { if (!(wsException.getCause() instanceof ConnectException || wsException.getCause() instanceof SocketTimeoutException)) { throw new RuntimeException("Exception occured while making winrm call", wsException); } LOG.debug("Ignoring exception and retrying (attempt " + (i + 1) + " of " + retries + ") {}", wsException); try { Thread.sleep(5 * 1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("Exception occured while making winrm call", e.initCause(wsException)); } exceptions.add(wsException); } } throw new RuntimeException("failed task " + winrmCall, exceptions.get(0)); }
Source:
public ProphecyEffect() { super(Outcome.GainLife); this.staticText = "Reveal the top card of target opponent's library. If it's a land, you gain 1 life. Then that player shuffles his or her library"; }

Target:
public ProphecyEffect() { super(Outcome.GainLife); this.staticText = "Reveal the top card of target opponent's library. If it's a land, you gain 1 life. Then that player shuffles their library"; }
Source:
public void updateExternalExecutionId(long taskExecutionId, String externalExecutionId) { if(!this.taskExecutions.containsKey(taskExecutionId)) { throw new IllegalStateException("Invalid TaskExecution, ID " + taskExecutionId + " not found."); } TaskExecution taskExecution = taskExecutions.get(taskExecutionId); taskExecution.setExternalExecutionId(externalExecutionId); }

Target:
public void updateExternalExecutionId(long taskExecutionId, String externalExecutionId) { TaskExecution taskExecution = taskExecutions.get(taskExecutionId); Assert.notNull(taskExecution, "Invalid TaskExecution, ID " + taskExecutionId + " not found."); taskExecution.setExternalExecutionId(externalExecutionId); }
Source:
private boolean isManagerForListedProjects() { return projectService.isManager(projectListChoice.getModelObject().get(), userRepository.getCurrentUser()) || projects.getObject().stream().anyMatch( p -> projectService.isManager(p.get(), userRepository.getCurrentUser())); }

Target:
private boolean isManagerForListedProjects() { User currentUser = userRepository.getCurrentUser(); return projectService.isManager(projectListChoice.getModelObject().get(), currentUser) || projects.getObject().stream().anyMatch( p -> projectService.isManager(p.get(), currentUser)); }
Source:
protected void run() throws UnloggedFailure, Failure, Exception { if (regex == null) { regex = "^*.*$"; } switch (level.toLowerCase()) { case RESET: reset(); break; case LEVEL_ALL: setLoggingLevel(Level.ALL); break; case LEVEL_TRACE: setLoggingLevel(Level.TRACE); break; case LEVEL_DEBUG: setLoggingLevel(Level.DEBUG); break; case LEVEL_INFO: setLoggingLevel(Level.INFO); break; case LEVEL_WARN: setLoggingLevel(Level.WARN); break; case LEVEL_ERROR: setLoggingLevel(Level.ERROR); break; case LEVEL_FATAL: setLoggingLevel(Level.FATAL); break; case LEVEL_OFF: setLoggingLevel(Level.OFF); break; default: stdout.println("Invalid argument"); break; } }

Target:
protected void run() { if (regex == null) { regex = "^*.*$"; } switch (level) { case RESET: reset(); break; default: setLoggingLevel(Level.toLevel(level.name())); break; } }
Source:
protected void writeRecord(AggregateStateId id, EntityStorageRecord record) { final TypeUrl recordType = TypeUrl.of(record.getState() .getTypeUrl()); final TypeUrl recordTypeFromId = id.getStateType(); checkState( recordTypeFromId.equals(recordType), String.format("The typeUrl of the record (%s) does not correspond to id (for type %s)", recordType, recordTypeFromId)); recordStorage.write(id, record); }

Target:
protected void writeRecord(AggregateStateId id, EntityStorageRecord record) { final TypeUrl recordType = TypeUrl.of(record.getState() .getTypeUrl()); final TypeUrl recordTypeFromId = id.getStateType(); checkState( recordTypeFromId.equals(recordType), String.format(TYPE_URL_MISMATCH_MESSAGE_PATTERN, recordType, recordTypeFromId)); recordStorage.write(id, record); }
Source:
private void loginCczDemoUser(OfflineUserRestore offlineUserRestore) { String username = offlineUserRestore.getUsername(); String password = offlineUserRestore.getPassword(); performingCczDemoUserLogin = true; tryLocalLogin(username, password, false, false, LoginMode.PASSWORD, true); }

Target:
private void loginCczDemoUser(OfflineUserRestore offlineUserRestore) { String username = offlineUserRestore.getUsername(); String password = offlineUserRestore.getPassword(); tryLocalLogin(username, password, false, false, LoginMode.PASSWORD, true); }
Source:
protected void executeCommand() { addVmToDb(); VM vm = getVm(); if (vm.getImages().isEmpty()) { endVmRelatedOps(); } else { processImages(); } setSucceeded(true); }

Target:
protected void executeCommand() { addVmToDb(); VM vm = getVm(); if (!hasSnappableDisks(vm)) { endVmRelatedOps(); } else { processImages(); } setSucceeded(true); }
Source:
public String getMethodName() { return "mcGetCPMembers"; }

Target:
public String getMethodName() { return "getCPMembers"; }
Source:
public LocalOrRemoteNitroFetcher(ContentResolver resolver, NitroContentAdapter contentAdapter, ContentMerger contentMerger, Predicate<Broadcast> fullFetchPermitted) { this.resolver = resolver; this.contentAdapter = contentAdapter; this.fullFetchPermitted = fullFetchPermitted; this.contentMerger = contentMerger; }

Target:
public LocalOrRemoteNitroFetcher(ContentResolver resolver, NitroContentAdapter contentAdapter, ContentMerger contentMerger, Predicate<Broadcast> fullFetchPermitted) { this.resolver = checkNotNull(resolver); this.contentAdapter = checkNotNull(contentAdapter); this.fullFetchPermitted = checkNotNull(fullFetchPermitted); this.contentMerger = checkNotNull(contentMerger); }
Source:
private void handleResult( SourceResponse response, ExecutorService executorService, File dumpDir, AtomicLong resultCount) { if (StringUtils.isNotBlank(zipFileName)) { try { Optional<QueryResponseTransformer> zipCompressionTransformer = getZipCompression(); if (zipCompressionTransformer.isPresent()) { BinaryContent binaryContent = zipCompressionTransformer.get().transform(response, zipArgs); if (binaryContent != null) { IOUtils.closeQuietly(binaryContent.getInputStream()); } Long resultSize = (long) response.getResults().size(); printStatus(resultCount.addAndGet(resultSize)); } } catch (InvalidSyntaxException e) { LOGGER.info("No Zip Transformer found. Unable export metacards to a zip file."); } catch (CatalogTransformerException e) { LOGGER.info("zipCompression transform failed"); } } else if (multithreaded > 1) { final List<Result> results = new ArrayList<>(response.getResults()); executorService.submit( () -> { for (final Result result : results) { Metacard metacard = result.getMetacard(); try { exportMetacard(dumpDir, metacard, resultCount); } catch (IOException e) { LOGGER.debug("Failed to dump metacard {}", metacard.getId(), e); } } }); } else { for (final Result result : response.getResults()) { Metacard metacard = result.getMetacard(); try { exportMetacard(dumpDir, metacard, resultCount); } catch (IOException e) { LOGGER.debug( "Unable to export metacard: [{}]", metacard.getId(), metacard.getTitle(), e); } } } }

Target:
private void handleResult( SourceResponse response, ExecutorService executorService, File dumpDir, AtomicLong resultCount) { final List<Result> results = response.getResults(); if (StringUtils.isNotBlank(zipFileName)) { try { Optional<QueryResponseTransformer> zipCompressionTransformer = getZipCompression(); if (zipCompressionTransformer.isPresent()) { BinaryContent binaryContent = zipCompressionTransformer.get().transform(response, zipArgs); if (binaryContent != null) { IOUtils.closeQuietly(binaryContent.getInputStream()); } Long resultSize = (long) results.size(); printStatus(resultCount.addAndGet(resultSize)); } } catch (InvalidSyntaxException e) { LOGGER.info("No Zip Transformer found. Unable export metacards to a zip file."); } catch (CatalogTransformerException e) { LOGGER.info("zipCompression transform failed"); } } else if (multithreaded > 1) { executorService.submit(() -> processResults(results, dumpDir, resultCount)); } else { processResults(results, dumpDir, resultCount); } }
Source:
public static URLConnection openURLConnection(URL url) throws IOException, ConnectException { return openURLConnection(url,DEFAULT_CONNECTION_TIMEOUT); }

Target:
public static URLConnection openURLConnection(URL url) throws IOException { return openURLConnection(url,DEFAULT_CONNECTION_TIMEOUT); }