auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void reload(final Repository repository) { final IndexDiff[] results = new IndexDiff[1]; Job job = new Job(UIText.StagingView_IndexDiffReload) { @Override protected IStatus run(IProgressMonitor monitor) { IndexDiff indexDiff = doReload(repository); results[0] = indexDiff; return Status.OK_STATUS; } }; job.addJobChangeListener(new JobChangeAdapter() { public void done(final IJobChangeEvent event) { form.getDisplay().asyncExec(new Runnable() { public void run() { if (form.isDisposed()) return; IndexDiff indexDiff = results[0]; unstagedTableViewer.setInput(new Object[] { repository, indexDiff }); stagedTableViewer .setInput(new Object[] { repository, indexDiff }); commitAction.setEnabled(repository.getRepositoryState() .canCommit()); form.setText(StagingView.getRepositoryName(repository)); updateCommitMessageComponent(); clearCommitMessageToggles(); updateSectionText(); } }); } }); schedule(job); }

Target:
private void reload(final Repository repository) { final AtomicReference<IndexDiff> results = new AtomicReference<IndexDiff>(); final String jobTitle = MessageFormat.format(UIText.StagingView_IndexDiffReload, StagingView.getRepositoryName(repository)); Job job = new Job(jobTitle) { @Override protected IStatus run(IProgressMonitor monitor) { IndexDiff indexDiff = doReload(repository, monitor, jobTitle); results.set(indexDiff); return Status.OK_STATUS; } }; job.setUser(true); job.setRule(ResourcesPlugin.getWorkspace().getRoot()); job.addJobChangeListener(new JobChangeAdapter() { public void done(final IJobChangeEvent event) { form.getDisplay().asyncExec(new Runnable() { public void run() { if (form.isDisposed()) return; IndexDiff indexDiff = results.get(); unstagedTableViewer.setInput(new Object[] { repository, indexDiff }); stagedTableViewer .setInput(new Object[] { repository, indexDiff }); commitAction.setEnabled(repository.getRepositoryState() .canCommit()); form.setText(StagingView.getRepositoryName(repository)); updateCommitMessageComponent(); clearCommitMessageToggles(); updateSectionText(); } }); } }); schedule(job); }
Source:
public String toString() { return "VibrationElement" + Arrays.toString(channels); }

Target:
public String toString() { return "VibrationElement{duration=" + duration + ", channels=" + Arrays.toString(channels) + "}"; }
Source:
public final <R> R as(@NonNull CompletableConverter<? extends R> converter) { try { return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); throw ExceptionHelper.wrapOrThrow(ex); } }

Target:
public final <R> R as(@NonNull CompletableConverter<? extends R> converter) { return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); }
Source:
public void getCandidateApplicationsByCandidateIdShouldThrowIllegalArgumentExceptionWhenCandidateEntityIsNull() { given(candidateRepository.findOne(FIRST_ID)).willReturn(null); given(applicationsRepository.findByCandidateEntity(null)).willThrow(IllegalArgumentException.class); statesService.getCandidateApplicationsByCandidateId(FIRST_ID); }

Target:
public void getCandidateApplicationsByCandidateIdShouldThrowIllegalArgumentExceptionWhenCandidateEntityIsNull() { given(candidateRepository.findOne(FIRST_ID)).willReturn(null); statesService.getCandidateApplicationsByCandidateId(FIRST_ID); }
Source:
private DatastreamRuntimeException generateSendFailure(Exception exception) { _dynamicMetricsManager.createOrUpdateMeter(_metricsNamesPrefix, AGGREGATE, PRODUCER_ERROR, 1); if (exception instanceof IllegalStateException) { _log.warn("send failed transiently with exception: ", exception); return new DatastreamTransientException(exception); } else { _log.warn("send failed, restart producer, exception: ", exception); shutdownProducer(); return new DatastreamRuntimeException(exception); } }

Target:
private DatastreamRuntimeException generateSendFailure(Exception exception) { _dynamicMetricsManager.createOrUpdateMeter(_metricsNamesPrefix, AGGREGATE, PRODUCER_ERROR, 1); if (exception instanceof IllegalStateException) { _log.warn("Send failed transiently with exception: ", exception); return new DatastreamTransientException(exception); } else { _log.warn("Send failed with a non-transient exception. Shutting down producer, exception: ", exception); shutdownProducer(); return new DatastreamRuntimeException(exception); } }
Source:
public InitdServiceInstaller(Entity entity, Enricher enricher) { this.entity = entity; this.enricher = enricher; }

Target:
public InitdServiceInstaller(Entity entity, Enricher enricher) { this.entity = checkNotNull(entity, "entity"); this.enricher = checkNotNull(enricher, "enricher"); }
Source:
protected void unregisterVersioningRestriction(VersioningRestrictionDescriptor contrib) { versioningRestrictionsRegistry.removeContribution(contrib); log.info("Unregistered versioning policy: " + contrib.getType()); recompute(); }

Target:
protected void unregisterVersioningRestriction(VersioningRestrictionDescriptor contrib) { versioningRestrictionsRegistry.removeContribution(contrib); log.info("Unregistered versioning restriction: " + contrib.getType()); recompute(); }
Source:
HistogramMetricImpl createHistogram(String srvcName, Method method) { MetricRegistry metricRegistry = ctx.metric().registry(serviceMetricRegistryName(srvcName)); HistogramMetricImpl histogram = null; for (int i = 0; i <= MAX_ABBREVIATE_NAME_LVL; ++i) { String methodMetricName = methodMetricName(method, i); synchronized (metricRegistry) { if (metricRegistry.findMetric(methodMetricName) == null) { histogram = metricRegistry.histogram(methodMetricName, DEFAULT_INVOCATION_BOUNDS, DESCRIPTION_OF_INVOCATION_METRIC); break; } } } assert histogram != null; return histogram; }

Target:
HistogramMetricImpl createHistogram(String srvcName, Method method) { MetricRegistry metricRegistry = ctx.metric().registry(serviceMetricRegistryName(srvcName)); HistogramMetricImpl histogram = null; for (int i = 0; i <= MAX_ABBREVIATE_NAME_LVL; ++i) { String methodMetricName = methodMetricName(method, i); if (metricRegistry.findMetric(methodMetricName) == null) { histogram = metricRegistry.histogram(methodMetricName, DEFAULT_INVOCATION_BOUNDS, DESCRIPTION_OF_INVOCATION_METRIC); break; } } assert histogram != null; return histogram; }
Source:
public void authenticateNotEnabledUserShouldFail() throws Exception { String password = "password"; String passwordHash = "5f4dcc3b5aa765d61d8327deb882cf99"; LoginUserDto loginUserDto = createDefaultLoginUserDto(); JCUser oldUser = prepareOldUser(loginUserDto.getUserName()); when(userDao.getByUsername(oldUser.getUsername())).thenReturn(oldUser); when(encryptionService.encryptPassword(password)).thenReturn(passwordHash); when(securityFacade.getContext()).thenReturn(securityContext); when(authenticationManager.authenticate(any(UsernamePasswordAuthenticationToken.class))) .thenThrow(new DisabledException(null)); preparePlugin(oldUser.getUsername(), passwordHash, Collections.EMPTY_MAP); AuthenticationStatus result = authenticator.authenticate(loginUserDto, httpRequest, httpResponse); assertEquals(result, AuthenticationStatus.NOT_ENABLED, "Authenticate user with bad credentials should fail."); }

Target:
public void authenticateNotEnabledUserShouldFail() throws Exception { LoginUserDto loginUserDto = createDefaultLoginUserDto(); prepareOldUser(loginUserDto.getUserName()); when(authenticationManager.authenticate(any(UsernamePasswordAuthenticationToken.class))) .thenThrow(new DisabledException(null)); AuthenticationStatus result = authenticator.authenticate(loginUserDto, httpRequest, httpResponse); assertEquals(result, AuthenticationStatus.NOT_ENABLED, "Authenticate user with bad credentials should fail."); }
Source:
public StatisticsResource getStatisticsResource() { GlusterTaskStatisticalQuery query = new GlusterTaskStatisticalQuery(new TaskQueryResolver<Guid>(), newModel(id)); return inject(new BackendStatisticsResource<Step, GlusterVolumeTaskStatusEntity>(GlusterVolumeTaskStatusEntity.class, guid, query)); }

Target:
public StatisticsResource getStatisticsResource() { StepStatisticalQuery query = new StepStatisticalQuery(new TaskQueryResolver<Guid>(), newModel(id)); return inject(new BackendStatisticsResource<Step, GlusterVolumeTaskStatusEntity>(GlusterVolumeTaskStatusEntity.class, guid, query)); }
Source:
private void checkCodeValidation() { final int expectedValueOfErrorMarkers = 9; editor.waitActive(); editor.goToPosition(13, 2); editor.typeTextIntoEditor(SPACE.toString()); final int actualValueErrorMarkers = editor.getMarkersQuantity(ERROR); assertEquals( actualValueErrorMarkers, expectedValueOfErrorMarkers, String.format( "The expected value of errors marker should be %d but actual %d", expectedValueOfErrorMarkers, actualValueErrorMarkers)); editor.waitMarkerInPositionAndMoveCursor(ERROR_OVERVIEW, 13); editor.waitTextInToolTipPopup("Cannot find name 'c'"); editor.goToPosition(13, 2); editor.typeTextIntoEditor(DELETE.toString()); editor.waitAllMarkersInvisibility(ERROR); }

Target:
private void checkCodeValidation() { final int expectedAmountOfErrorMarkers = 9; String tooltipWithErrorMessage = "Cannot find name 'c'"; editor.waitActive(); editor.goToPosition(13, 2); editor.typeTextIntoEditor(SPACE.toString()); final int actualValueErrorMarkers = editor.getMarkersQuantity(ERROR); assertEquals( actualValueErrorMarkers, expectedAmountOfErrorMarkers, String.format( "The expected value of errors marker should be %d but actual %d", expectedAmountOfErrorMarkers, actualValueErrorMarkers)); editor.moveToMarker(ERROR_OVERVIEW, 13); editor.waitTextInToolTipPopup(tooltipWithErrorMessage); editor.goToPosition(13, 2); editor.typeTextIntoEditor(DELETE.toString()); editor.waitAllMarkersInvisibility(ERROR); }
Source:
public static void setup() throws IOException, SolrServerException { author = new User("Leonardo", "leo@leo"); author.confirmEmail(); hibernateSession.save(author); eli5 = new Tag("eli5", "Explain Like I'm 5", author); hibernateSession.save(eli5); eli12 = new Tag("eli12", "Explain Like I'm 12", author); hibernateSession.save(eli12); science = new Tag("science", "Science!", author); hibernateSession.save(science); hobby = new Tag("hobby", "Hobbies and stuff", author); hibernateSession.save(hobby); tolstoy = new Tag("tolstoy", "Long-winded russian author", author); hibernateSession.save(tolstoy); sut = new QuestionIndex(solrServer); data(); }

Target:
public static void setup() throws IOException, SolrServerException { author = new User("Leonardo", "leo@leo"); author.confirmEmail(); hibernateSession.save(author); sut = new QuestionIndex(solrServer); data(); }
Source:
public boolean isLowerThan(Version other) { return Version.compare(other, this) > 0; }

Target:
public boolean isLowerThan(Version other) { return Version.compare(this, other) < 0; }
Source:
private void invalidateSession(String id) { SessionHandler[] tmp = (SessionHandler[]) _server.getChildHandlersByClass(SessionHandler.class); if (tmp != null && tmp.length > 0) { tmp[0].getSession(id).invalidate(); } }

Target:
private void invalidateSession(String id) { Iterator handlerIterator = this.getSessionHandlers().iterator(); while (handlerIterator.hasNext()) { SessionHandler currSessionHandler = (SessionHandler) handlerIterator.next(); Session session = currSessionHandler.getSession(id); if (session != null && session.isValid()) { session.invalidate(); break; } } }
Source:
public MonstrousStepEffect(Duration duration) { super(duration); staticText = "Target creature blocks target creature this turn if able"; }

Target:
public MonstrousStepEffect(Duration duration) { super(duration); staticText = "Up to one target creature blocks it this turn if able."; }
Source:
private String[] getIndices(TransportClient client, GetIndexRequest request) { try { return retry() .maxAttempts(maxAttempts) .exponentialBackoff(maxRetryTime, 2.0) .run("getIndices", () -> { return client.admin() .indices() .getIndex(request) .actionGet(requestTimeout.toMillis()) .getIndices(); }); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
private String[] getIndices(TransportClient client, GetIndexRequest request) { try { return retry() .maxAttempts(maxAttempts) .exponentialBackoff(maxRetryTime) .run("getIndices", () -> client.admin() .indices() .getIndex(request) .actionGet(requestTimeout.toMillis()) .getIndices()); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public TemplateProfile prepare(RegisterIsoCmd cmd) throws ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); _accountMgr.checkAccess(caller, null, true, owner); List<Long> zoneList = null; Long zoneId = cmd.getZoneId(); List<ImageStoreVO> stores = _imgStoreDao.findRegionImageStores(); if (!(stores != null && stores.size() > 0) && zoneId != null && zoneId != -1L) { zoneList = new ArrayList<>(); zoneList.add(zoneId); } return prepare(true, CallContext.current().getCallingUserId(), cmd.getIsoName(), cmd.getDisplayText(), 64, false, true, cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(), cmd.isExtractable(), ImageFormat.ISO.toString(), cmd.getOsTypeId(), zoneList, HypervisorType.None, cmd.getChecksum(), cmd.isBootable(), null, owner, null, false, cmd.getImageStoreUuid(), cmd.isDynamicallyScalable(), TemplateType.USER, cmd.isDirectDownload()); }

Target:
public TemplateProfile prepare(RegisterIsoCmd cmd) throws ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); _accountMgr.checkAccess(caller, null, true, owner); List<Long> zoneList = null; Long zoneId = cmd.getZoneId(); List<ImageStoreVO> stores = _imgStoreDao.findRegionImageStores(); if (CollectionUtils.isEmpty(stores) && zoneId != null && zoneId > 0L) { zoneList = new ArrayList<>(); zoneList.add(zoneId); } return prepare(true, CallContext.current().getCallingUserId(), cmd.getIsoName(), cmd.getDisplayText(), 64, false, true, cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(), cmd.isExtractable(), ImageFormat.ISO.toString(), cmd.getOsTypeId(), zoneList, HypervisorType.None, cmd.getChecksum(), cmd.isBootable(), null, owner, null, false, cmd.getImageStoreUuid(), cmd.isDynamicallyScalable(), TemplateType.USER, cmd.isDirectDownload()); }
Source:
private MapWrapper(String category, Field field, Object instance) { super(category, field, instance); try { theMap = (Map<String, Object>) field.get(instance); } catch (ClassCastException cce) { throw new IllegalArgumentException(String.format("The map '%s' of class '%s' must have the key type String!", field.getName(), field.getDeclaringClass().getCanonicalName()), cce); } catch (Exception e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } ParameterizedType type = (ParameterizedType) field.getGenericType(); mType = type.getActualTypeArguments()[1]; this.adapter = ADAPTERS.get(mType); if (this.adapter == null && mType instanceof GenericArrayType) { this.adapter = ADAPTERS.get(ARRAY_REMAP.get(((GenericArrayType)mType).getGenericComponentType())); } if (mType instanceof Class && Enum.class.isAssignableFrom((Class<?>)mType)) { this.adapter = TypeAdapters.Str; } if (this.adapter == null) throw new IllegalArgumentException(String.format("The map '%s' of class '%s' has target values which are neither primitive nor an enum!", field.getName(), field.getDeclaringClass().getCanonicalName())); }

Target:
private MapWrapper(String category, Field field, Object instance) { super(category, field, instance); try { theMap = (Map<String, Object>) field.get(instance); } catch (ClassCastException cce) { throw new IllegalArgumentException(String.format("The map '%s' of class '%s' must have the key type String!", field.getName(), field.getDeclaringClass().getCanonicalName()), cce); } catch (IllegalAccessException e) { throw new RuntimeException(e); } ParameterizedType type = (ParameterizedType) field.getGenericType(); mType = type.getActualTypeArguments()[1]; this.adapter = ADAPTERS.get(mType); if (this.adapter == null && mType instanceof GenericArrayType) { this.adapter = ADAPTERS.get(ARRAY_REMAP.get(((GenericArrayType)mType).getGenericComponentType())); } if (mType instanceof Class && Enum.class.isAssignableFrom((Class<?>)mType)) { this.adapter = TypeAdapters.Str; } if (this.adapter == null) throw new IllegalArgumentException(String.format("The map '%s' of class '%s' has target values which are neither primitive nor an enum!", field.getName(), field.getDeclaringClass().getCanonicalName())); }
Source:
public void reset() { for (int i = 0; i < 2; i++) { offset[i] = encoders[i].get(); } }

Target:
public void reset() { offset[0] = encoders[0].get(); offset[1] = encoders[1].get(); }
Source:
public Iterator<TupleBatch> tupleBatchIteratorFromQuery(final String queryString, final Schema outputSchema) throws CatalogException { try { return queue.execute(new SQLiteJob<Iterator<TupleBatch>>() { @Override protected Iterator<TupleBatch> job(final SQLiteConnection sqliteConnection) throws CatalogException, SQLiteException { SQLiteStatement statement = sqliteConnection.prepare(queryString); List<TupleBatch> tuples = Lists.newLinkedList(); Iterator<TupleBatch> iter = new SQLiteTupleBatchIterator(statement, sqliteConnection, outputSchema); while (iter.hasNext()) { tuples.add(iter.next()); } return tuples.iterator(); } }).get(); } catch (InterruptedException | ExecutionException e) { throw new CatalogException(e); } }

Target:
public Iterator<TupleBatch> tupleBatchIteratorFromQuery(final String queryString, final Schema outputSchema) throws CatalogException { try { return queue.execute(new SQLiteJob<Iterator<TupleBatch>>() { @Override protected Iterator<TupleBatch> job(final SQLiteConnection sqliteConnection) throws CatalogException, SQLiteException { SQLiteStatement statement = sqliteConnection.prepare(queryString); List<TupleBatch> tuples = Lists.newLinkedList(); Iterators.addAll(tuples, new SQLiteTupleBatchIterator(statement, sqliteConnection, outputSchema)); return tuples.iterator(); } }).get(); } catch (InterruptedException | ExecutionException e) { throw new CatalogException(e); } }
Source:
public static void main(String[] args) throws InterruptedException { Semaphore semaphore = new Semaphore(1); String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};SharedAccessKey={sharedAccessKey};EntityPath={eventHubPath}"; EventHubClient client = new EventHubClientBuilder() .connectionString(connectionString) .build(); semaphore.acquire(); client.getPartitionIds().flatMap(partitionId -> client.getPartitionProperties(partitionId)) .subscribe(properties -> { System.out.println("The Event Hub has the following properties:"); System.out.println(String.format( "Event Hub Name: %s; Partition Id: %s; Is partition empty? %s; First Sequence Number: %s; " + "Last Enqueued Time: %s; Last Enqueued Sequence Number: %s; Last Enqueued Offset: %s", properties.eventHubPath(), properties.id(), properties.isEmpty(), properties.beginningSequenceNumber(), properties.lastEnqueuedTime(), properties.lastEnqueuedSequenceNumber(), properties.lastEnqueuedOffset())); }, error -> { System.err.println("Error occurred while fetching partition properties: " + error.toString()); }, () -> { semaphore.release(); }); System.out.println("Waiting for partition properties to complete..."); semaphore.acquire(); System.out.println("Finished."); }

Target:
public static void main(String[] args) throws InterruptedException { Semaphore semaphore = new Semaphore(1); String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};SharedAccessKey={sharedAccessKey};EntityPath={eventHubPath}"; EventHubClient client = new EventHubClientBuilder() .connectionString(connectionString) .buildAsyncClient(); semaphore.acquire(); client.getPartitionIds().flatMap(partitionId -> client.getPartitionProperties(partitionId)) .subscribe(properties -> { System.out.println("The Event Hub has the following properties:"); System.out.printf( "Event Hub Name: %s; Partition Id: %s; Is partition empty? %s; First Sequence Number: %s; " + "Last Enqueued Time: %s; Last Enqueued Sequence Number: %s; Last Enqueued Offset: %s \n", properties.eventHubPath(), properties.id(), properties.isEmpty(), properties.beginningSequenceNumber(), properties.lastEnqueuedTime(), properties.lastEnqueuedSequenceNumber(), properties.lastEnqueuedOffset()); }, error -> { System.err.println("Error occurred while fetching partition properties: " + error.toString()); }, () -> { semaphore.release(); }); System.out.println("Waiting for partition properties to complete..."); semaphore.acquire(); System.out.println("Finished."); }
Source:
public void releaseWhenMergeCumulateThrows() { final Error error = new Error(); ByteBuf cumulation = new UnpooledHeapByteBuf(UnpooledByteBufAllocator.DEFAULT, 0, 64) { @Override public ByteBuf writeBytes(ByteBuf src) { throw error; } }; cumulation.writeByte(1); ByteBuf in = Unpooled.buffer().writeZero(12); try { ByteToMessageDecoder.MERGE_CUMULATOR.cumulate(UnpooledByteBufAllocator.DEFAULT, cumulation, in); fail(); } catch (Error expected) { assertSame(error, expected); assertEquals(0, in.refCnt()); } }

Target:
public void releaseWhenMergeCumulateThrows() { final Error error = new Error(); ByteBuf cumulation = new UnpooledHeapByteBuf(UnpooledByteBufAllocator.DEFAULT, 0, 64) { @Override public ByteBuf writeBytes(ByteBuf src) { throw error; } }; cumulation.writeByte(1); ByteBuf in = Unpooled.buffer().writeZero(12); try { MERGE_CUMULATOR.cumulate(UnpooledByteBufAllocator.DEFAULT, cumulation, in); fail(); } catch (Error expected) { assertSame(error, expected); assertEquals(0, in.refCnt()); } }
Source:
public final void testLog() { File loggingFile = logger.getLoggingFile(); logger.log("log_write_test"); try { BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream( loggingFile), "UTF-8")); assertEquals("--------------------SCRUMBLEDORE LOGGING FILE", reader.readLine()); String lastLine = ""; String line; while ((line = reader.readLine()) != null) { lastLine = line; } assertEquals("log_write_test", lastLine); reader.close(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }

Target:
public final void testLog() { logger.log("log_write_test"); ArrayList<String> fetchedLog = logger.getLines(); assertEquals("--------------------SCRUMBLEDORE LOGGING FILE", fetchedLog.get(0)); assertEquals("log_write_test", fetchedLog.get(fetchedLog.size() - 1)); }
Source:
public String index(Request request, Response response) throws IOException { String pipelineName = request.params("pipeline_name"); Integer fromCounter = Integer.valueOf(request.params("from_counter")); Integer toCounter = Integer.valueOf(request.params("to_counter")); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); if (fromCounter < 1 || toCounter < 1) { throw new UnprocessableEntityException("The instance counters cannot be less than 1."); } boolean isBisect = pipelineService.isPipelineBisect(pipelineName, fromCounter, toCounter); List<MaterialRevision> materialRevisions = changesetService.revisionsBetween(pipelineName, fromCounter, toCounter, currentUsername(), result, true); if (result.isSuccessful()) { return writerForTopLevelObject(request, response, outputWriter -> ComparisonRepresenter.toJSON(outputWriter, pipelineName, fromCounter, toCounter, isBisect, materialRevisions)); } else { return renderHTTPOperationResult(result, request, response); } }

Target:
public String index(Request request, Response response) throws IOException { String pipelineName = request.params("pipeline_name"); Integer fromCounter = getCounterValue(request, "from_counter"); Integer toCounter = getCounterValue(request, "to_counter"); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); boolean isBisect = pipelineService.isPipelineBisect(pipelineName, fromCounter, toCounter); List<MaterialRevision> materialRevisions = changesetService.revisionsBetween(pipelineName, fromCounter, toCounter, currentUsername(), result, true); if (result.isSuccessful()) { return writerForTopLevelObject(request, response, outputWriter -> ComparisonRepresenter.toJSON(outputWriter, pipelineName, fromCounter, toCounter, isBisect, materialRevisions)); } else { return renderHTTPOperationResult(result, request, response); } }
Source:
public void scan(HttpMessage msg, String param, String value) { String newValue = value.trim(); newValue = JWTUtils.extractingJWTFromParamValue(newValue); if (!JWTUtils.isTokenValid(newValue)) { LOGGER.info("Token: " + newValue + " is not a valid JWT token."); return; } try { sendAndReceive(msg); } catch (IOException e) { LOGGER.error(e); return; } JWTTokenBean jwtTokenBean; try { jwtTokenBean = JWTTokenBean.parseJWTToken(newValue); } catch (JWTException e) { LOGGER.error("Unable to parse JWT Token", e); return; } if (!JWTConfiguration.getInstance().isIgnoreClientConfigurationScan()) { if (performAttackClientSideConfigurations(msg, param, jwtTokenBean, value)) { return; } this.decreaseRequestCount(); } performAttackServerSideConfigurations(msg, param, jwtTokenBean, value); }

Target:
public void scan(HttpMessage msg, String param, String value) { String newValue = value.trim(); newValue = JWTUtils.extractingJWTFromParamValue(newValue); if (!JWTUtils.isTokenValid(newValue)) { LOGGER.info("Token: " + newValue + " is not a valid JWT token."); return; } try { sendAndReceive(msg); } catch (IOException e) { LOGGER.error(e); return; } JWTHolder jwtHolder; try { jwtHolder = JWTHolder.parseJWTToken(newValue); } catch (JWTException e) { LOGGER.error("Unable to parse JWT Token", e); return; } if (!JWTConfiguration.getInstance().isIgnoreClientConfigurationScan()) { if (performAttackClientSideConfigurations(msg, param)) { return; } this.decreaseRequestCount(); } performAttackServerSideConfigurations(msg, param, jwtHolder, value); }
Source:
private String getEndpoint() { String endpointValue = this.getOptionValue(ENDPOINT.getOpt()); if (Guard.isStringNullOrEmpty(endpointValue)) { endpointValue = System.getenv("DS3_ENDPOINT"); } if (ENDPOINT == null) { missingArgs.add(ENDPOINT.getOpt()); return ""; } return endpointValue; }

Target:
private String getEndpoint() { return this.getOptionValue(ENDPOINT.getOpt()); }
Source:
public void reset() { long endSegment = Math.max(logMetadata.getGlobalTail(), 0L) / RECORDS_PER_LOG_FILE; log.warn("Global Tail:{}, endSegment={}", logMetadata.getGlobalTail(), endSegment); closeSegmentHandlers(endSegment); deleteFilesMatchingFilter(file -> { try { String segmentStr = file.getName().split("\\.")[0]; return Long.parseLong(segmentStr) <= endSegment; } catch (Exception e) { log.warn("reset: ignoring file {}", file.getName()); return false; } }); dataStore.resetStartingAddress(); dataStore.resetTailSegment(); logMetadata = new LogMetadata(); writeChannels.clear(); logSizeQuota.release(Long.MIN_VALUE); log.info("reset: Completed, end segment {}", endSegment); }

Target:
public void reset() { long endSegment = Math.max(logMetadata.getGlobalTail(), 0L) / RECORDS_PER_LOG_FILE; log.warn("Global Tail:{}, endSegment={}", logMetadata.getGlobalTail(), endSegment); closeSegmentHandlers(endSegment); deleteFilesMatchingFilter(file -> { try { String segmentStr = file.getName().split("\\.")[0]; return Long.parseLong(segmentStr) <= endSegment; } catch (Exception e) { log.warn("reset: ignoring file {}", file.getName()); return false; } }); dataStore.resetStartingAddress(); dataStore.resetTailSegment(); logMetadata = new LogMetadata(); writeChannels.clear(); logSizeQuota.updateAndGet(resourceQuota -> new ResourceQuota("LogSizeQuota", estimateSize(logDir), logSizeLimit)); log.info("reset: Completed, end segment {}", endSegment); }
Source:
public PacketTransformer getRTPTransformer() { return this.retransmissionRequesterDelegate.getRTPTransformer(); }

Target:
public PacketTransformer getRTPTransformer() { return this; }
Source:
private void restoreCommandState() { setVmTemplateId(getParameters().getVmTemplateId()); setVmId(getVmIdFromImageParameters()); isVmInDb = !getVmId().equals(Guid.Empty) && getVm() != null; }

Target:
private void restoreCommandState() { setVmTemplateId(getParameters().getVmTemplateId()); setVmId(getVmIdFromImageParameters()); isVmInDb = getVm() != null; }
Source:
private void ensureAccessToken() { if(isMaterialized()) { try { JwsHeader header = Jwts.parser() .setSigningKey(getDataStore().getApiKey().getSecret().getBytes("UTF-8")) .parseClaimsJws(getString(JWT)).getHeader(); String tokenType = (String) header.get("stt"); Assert.isTrue(tokenType.equals("access")); } catch (RuntimeException e) { throw new InvalidJwtException(InvalidJwtException.JWT_INVALID_VALUE_ERROR, e); } catch (UnsupportedEncodingException e) { log.error("Unsupported encoding for API secret"); throw new RuntimeException(e); } } else { String href = getStringProperty(HREF_PROP_NAME); if (href != null) { Assert.isTrue(href.contains("/accessTokens/"), "href does not belong to an access token."); } } }

Target:
private void ensureAccessToken() { if(isMaterialized()) { try { JwsHeader header = Jwts.parser() .setSigningKey(getDataStore().getApiKey().getSecret().getBytes("UTF-8")) .parseClaimsJws(getString(JWT)).getHeader(); if (header == null || !"access".equals(header.get("stt"))) { String message = "Missing 'stt' property in header. This jwt is not a valid access_token."; log.debug(message); throw new InvalidJwtException(message); } } catch (UnsupportedJwtException uje) { String message = InvalidJwtException.UNSUPPORTED_JWT_ERROR; log.debug(message); throw new InvalidJwtException(message, uje); } catch (MalformedJwtException mje) { String message = "The JWT was not correctly constructed and therefore was rejected (it is not a valid JWS)."; log.debug(message); throw new InvalidJwtException(message, mje); } catch (SignatureException se) { String message = InvalidJwtException.INVALID_JWT_SIGNATURE_ERROR; log.debug(message); throw new InvalidJwtException(message, se); } catch (ExpiredJwtException eje) { String message = InvalidJwtException.EXPIRED_JWT_ERROR; log.debug(message); throw new InvalidJwtException(message, eje); } catch (IllegalArgumentException iae) { String message = "The JWT is null, empty or only contains whitespaces."; log.debug(message); throw new InvalidJwtException(message, iae); } catch (UnsupportedEncodingException uee) { String message = "The character encoding for the API secret is not supported."; log.debug(message); throw new InvalidJwtException(message, uee); } catch (InvalidJwtException e) { log.debug(e.getMessage()); throw e; } catch (Exception e) { throw new JwtException("JWT failed validation; it cannot be trusted.", e); } } else { String href = getStringProperty(HREF_PROP_NAME); if (href != null) { Assert.isTrue(href.contains("/accessTokens/"), "href does not belong to an access token."); } } }
Source:
public void inputChanged(@Nullable Viewer viewer, @Nullable Object oldInput, @Nullable Object newInput) { fTableViewer = (TableViewer) viewer; if (newInput instanceof ISegmentStore<?>) { ISegmentStore<?> segmentStore = (ISegmentStore<?>) newInput; fSegmentArray = Iterables.toArray(segmentStore, ISegment.class); if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else if (newInput instanceof ISegment[]) { fSegmentArray = (ISegment[]) newInput; if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else { fSegmentArray = null; } }

Target:
public void inputChanged(@Nullable Viewer viewer, @Nullable Object oldInput, @Nullable Object newInput) { fTableViewer = (TableViewer) viewer; if (newInput instanceof ISegmentStore<?>) { ISegmentStore<?> segmentStore = (ISegmentStore<?>) newInput; fSegmentArray = Iterables.toArray(segmentStore, ISegment.class); if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else if (newInput instanceof ISegment[]) { fSegmentArray = ((ISegment[]) newInput).clone(); if (fComparator != null) { Arrays.sort(fSegmentArray, fComparator); } } else { fSegmentArray = null; } }
Source:
private boolean isConnectableByWkrdProtocol(String applicationIdentifier) { int attempts = 2; try { return checkForAvailabilityIn(applicationIdentifier, attempts) && getApplication(applicationIdentifier).isConnectableByWkrdProtocol(); } catch (InterruptedException e) { if (log.isLoggable(Level.FINE)) { log.log(Level.FINE, "InterruptedException while checking availability."); } } catch (IllegalStateException illegalStateException) { log.log(Level.WARNING, "Unknown error, application with identifier: " + applicationIdentifier + ", is not retrievable from list of registered applications"); } return false; }

Target:
private boolean isConnectableByWkrdProtocol(String applicationIdentifier) { int attempts = 2; try { return checkForAvailabilityIn(applicationIdentifier, attempts) && getApplication(applicationIdentifier).isConnectableByWkrdProtocol(); } catch (InterruptedException e) { if (log.isLoggable(Level.FINE)) { log.log(Level.FINE, "InterruptedException occured while checking availability of application in list of registered applications."); } } catch (IllegalStateException illegalStateException) { log.log(Level.WARNING, "Unknown error, application with identifier: " + applicationIdentifier + " is not retrievable from the list of registered applications"); } return false; }
Source:
public EhcacheDataSyncMessage(final String cacheId, final Map<Long, Chain> chainMap) { this.cacheId = cacheId; this.chainMap = chainMap; }

Target:
public EhcacheDataSyncMessage(final String cacheId, final Map<Long, Chain> chainMap) { this.cacheId = cacheId; this.chainMap = Collections.unmodifiableMap(chainMap); }
Source:
public boolean nextBatch(ObjectColumnVector<T> vector) throws IOException { boolean recordFound = false; while (!recordFound) { if (current >= total) { return false; } try { checkRead(); recordReader.readVector(vector, current, totalCountLoadedSoFar); current += vector.size(); recordFound = true; } catch (RuntimeException e) { throw new ParquetDecodingException(format("Can not read value at %d in block %d in file %s", current, currentBlock, file), e); } } return true; }

Target:
public boolean nextBatch(ObjectColumnVector<T> vector) throws IOException { boolean recordFound = false; while (!recordFound) { if (current >= total) { return false; } try { checkRead(); ((VectorizedRecordReader) recordReader).readVector(vector, current, totalCountLoadedSoFar); current += vector.size(); recordFound = true; } catch (RuntimeException e) { throw new ParquetDecodingException(format("Can not read value at %d in block %d in file %s", current, currentBlock, file), e); } } return true; }
Source:
@Override public int parseArguments(Parameters params) throws CmdLineException { final Jenkins j = Jenkins.get(); final String src = params.getParameter(0); T s = j.getItemByFullName(src, type()); if (s == null) { final Authentication who = Jenkins.getAuthentication(); try (ACLContext aclContext = ACL.as(ACL.SYSTEM)) { Item actual = j.getItemByFullName(src); if (actual == null) { LOGGER.log(Level.FINE, "really no item exists named {0}", src); } else { LOGGER.log(Level.WARNING, "running as {0} could not find {1} of {2}", new Object[] {who.getPrincipal(), actual, type()}); } } T nearest = Items.findNearest(type(), src, j); if (nearest != null) { throw new IllegalArgumentException("No such job '" + src + "'; perhaps you meant '" + nearest.getFullName() + "'?"); } else { throw new IllegalArgumentException("No such job '" + src + "'"); } } setter.addValue(s); return 1; }

Target:
@Override public int parseArguments(Parameters params) throws CmdLineException { final Jenkins j = Jenkins.get(); final String src = params.getParameter(0); T s = j.getItemByFullName(src, type()); if (s == null) { final Authentication who = Jenkins.getAuthentication(); try (ACLContext acl = ACL.as(ACL.SYSTEM)) { Item actual = j.getItemByFullName(src); if (actual == null) { LOGGER.log(Level.FINE, "really no item exists named {0}", src); } else { LOGGER.log(Level.WARNING, "running as {0} could not find {1} of {2}", new Object[] {who.getPrincipal(), actual, type()}); } } T nearest = Items.findNearest(type(), src, j); if (nearest != null) { throw new IllegalArgumentException("No such job '" + src + "'; perhaps you meant '" + nearest.getFullName() + "'?"); } else { throw new IllegalArgumentException("No such job '" + src + "'"); } } setter.addValue(s); return 1; }
Source:
private String dumpTaskResult(final RunTaskResult result) { final StringBuilder sb = new StringBuilder(); sb.append("["); for (Task task : result.getTasks()) { sb.append("{"); if (task.getTaskArn() != null) { sb.append("TaskArn: ").append(task.getTaskArn()).append(","); } if (task.getClusterArn() != null) { sb.append("ClusterArn: ").append(task.getClusterArn()).append(","); } if (task.getContainerInstanceArn() != null) { sb.append("ContainerInstanceArn: ").append(task.getContainerInstanceArn()).append(","); } if (task.getTaskDefinitionArn() != null) { sb.append("TaskDefinitionArn: ").append(task.getTaskDefinitionArn()).append(","); } if (task.getHealthStatus() != null) { sb.append("HealthStatus: ").append(task.getHealthStatus()).append(","); } if (task.getPlatformVersion() != null) { sb.append("PlatformVersion: ").append(task.getPlatformVersion()).append(","); } if (task.getCreatedAt() != null) { sb.append("CreatedAt: ").append(task.getCreatedAt()).append(","); } if (task.getStartedAt() != null) { sb.append("StartedAt: ").append(task.getStartedAt()); } sb.append("}"); sb.append(","); } sb.append("]"); return sb.toString(); }

Target:
private static String dumpTaskResult(final RunTaskResult result) { final StringBuilder sb = new StringBuilder(); sb.append("["); for (Task task : result.getTasks()) { sb.append("{"); if (task.getTaskArn() != null) { sb.append("TaskArn: ").append(task.getTaskArn()).append(","); } if (task.getClusterArn() != null) { sb.append("ClusterArn: ").append(task.getClusterArn()).append(","); } if (task.getContainerInstanceArn() != null) { sb.append("ContainerInstanceArn: ").append(task.getContainerInstanceArn()).append(","); } if (task.getTaskDefinitionArn() != null) { sb.append("TaskDefinitionArn: ").append(task.getTaskDefinitionArn()).append(","); } if (task.getHealthStatus() != null) { sb.append("HealthStatus: ").append(task.getHealthStatus()).append(","); } if (task.getPlatformVersion() != null) { sb.append("PlatformVersion: ").append(task.getPlatformVersion()).append(","); } if (task.getCreatedAt() != null) { sb.append("CreatedAt: ").append(task.getCreatedAt()).append(","); } if (task.getStartedAt() != null) { sb.append("StartedAt: ").append(task.getStartedAt()); } sb.append("}"); sb.append(","); } sb.append("]"); return sb.toString(); }
Source:
public Subscription loadGallery(final Section section, Observer<List<Image>> observer) { final List<Image> images = galleryCache.get(section); if (images != null) { observer.onNext(images); } PublishSubject<List<Image>> galleryRequest = galleryRequests.get(section); if (galleryRequest != null) { return galleryRequest.subscribe(observer); } galleryRequest = PublishSubject.create(); galleryRequests.put(section, galleryRequest); Subscription subscription = galleryRequest.subscribe(observer); galleryRequest.finallyDo(new Action0() { @Override public void call() { galleryRequests.remove(section); } }); galleryRequest.doOnEach(new Action1<Notification<? super List<Image>>>() { @Override public void call(Notification<? super List<Image>> notification) { galleryCache.put(section, images); } }); galleryService.listGallery(section, Sort.VIRAL, 1) .map(new GalleryToImageList()) .flatMap(new Func1<List<Image>, Observable<Image>>() { @Override public Observable<Image> call(List<Image> images) { return Observable.from(images); } }) .filter(new Func1<Image, Boolean>() { @Override public Boolean call(Image image) { return !image.is_album; } }) .toList() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(galleryRequest); return subscription; }

Target:
public Subscription loadGallery(final Section section, Observer<List<Image>> observer) { final List<Image> images = galleryCache.get(section); if (images != null) { observer.onNext(images); } PublishSubject<List<Image>> galleryRequest = galleryRequests.get(section); if (galleryRequest != null) { return galleryRequest.subscribe(observer); } galleryRequest = PublishSubject.create(); galleryRequests.put(section, galleryRequest); Subscription subscription = galleryRequest.subscribe(observer); galleryRequest.doOnTerminate(new Action0() { @Override public void call() { galleryRequests.remove(section); } }); galleryRequest.doOnEach(new Action1<Notification<? super List<Image>>>() { @Override public void call(Notification<? super List<Image>> notification) { galleryCache.put(section, images); } }); galleryService.listGallery(section, Sort.VIRAL, 1) .map(new GalleryToImageList()) .flatMap(new Func1<List<Image>, Observable<Image>>() { @Override public Observable<Image> call(List<Image> images) { return Observable.from(images); } }) .filter(new Func1<Image, Boolean>() { @Override public Boolean call(Image image) { return !image.is_album; } }) .toList() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(galleryRequest); return subscription; }
Source:
private boolean closeEnough(double left, double right) { return Math.abs(left - right) < 0.001; }

Target:
private boolean closeEnough(double left, double right) { return Math.abs(left - right) < CLOSE_ENOUGH; }
Source:
public static long getLeapYearsBefore(final long prolepticYear) { long yearBefore = prolepticYear - 1; return (yearBefore / 4) - (yearBefore / 100) + (yearBefore / 400); }

Target:
static long getLeapYearsBefore(final long prolepticYear) { long yearBefore = prolepticYear - 1; return (yearBefore / 4) - (yearBefore / 100) + (yearBefore / 400); }
Source:
public BaseDataCenterResponseHandler(DateCodecFactory dateCodecFactory) { super(dateCodecFactory); this.builder = DataCenter.builder(); }

Target:
BaseDataCenterResponseHandler(DateCodecFactory dateCodecFactory) { super(dateCodecFactory); this.builder = DataCenter.builder(); }
Source:
public void signInSilently(Promise promise) { if (_apiClient == null) { rejectWithNullClientError(promise); return; } if (promiseWrapper.setPromiseWithInProgressCheck(promise, "restorePreviousSignIn")) { UiThreadUtil.runOnUiThread(new Runnable() { @Override public void run() { Task<GoogleSignInAccount> result = _apiClient.silentSignIn(); if (result.isSuccessful()) { handleSignInTaskResult(result); } else { result.addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(Task task) { handleSignInTaskResult(task); } }); } } }); } }

Target:
public void signInSilently(Promise promise) { if (_apiClient == null) { rejectWithNullClientError(promise); return; } if (promiseWrapper.setPromiseWithInProgressCheck(promise, "signInSilently")) { UiThreadUtil.runOnUiThread(new Runnable() { @Override public void run() { Task<GoogleSignInAccount> result = _apiClient.silentSignIn(); if (result.isSuccessful()) { handleSignInTaskResult(result); } else { result.addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(Task task) { handleSignInTaskResult(task); } }); } } }); } }
Source:
public void byTriplet() throws Exception { TestRepository<InMemoryRepository> repo = createProject("repo"); Change change = newChange(repo, null, null, null, "branch").insert(); String k = change.getKey().get(); assertResultEquals(change, queryOne("repo~branch~" + k)); assertResultEquals(change, queryOne("change:repo~branch~" + k)); assertResultEquals(change, queryOne("repo~refs/heads/branch~" + k)); assertResultEquals(change, queryOne("change:repo~refs/heads/branch~" + k)); assertResultEquals(change, queryOne("repo~branch~" + k.substring(0, 10))); assertResultEquals(change, queryOne("change:repo~branch~" + k.substring(0, 10))); assertThat(query("foo~bar")).isEmpty(); assertBadQuery("change:foo~bar"); assertThat(query("change:otherrepo~branch~" + k)).isEmpty(); assertThat(query("change:otherrepo~branch~" + k)).isEmpty(); assertThat(query("change:repo~otherbranch~" + k)).isEmpty(); assertThat(query( "change:repo~branch~I0000000000000000000000000000000000000000")) .isEmpty(); }

Target:
public void byTriplet() throws Exception { TestRepository<InMemoryRepository> repo = createProject("repo"); Change change = newChange(repo, null, null, null, "branch").insert(); String k = change.getKey().get(); assertResultEquals(change, queryOne("repo~branch~" + k)); assertResultEquals(change, queryOne("change:repo~branch~" + k)); assertResultEquals(change, queryOne("repo~refs/heads/branch~" + k)); assertResultEquals(change, queryOne("change:repo~refs/heads/branch~" + k)); assertResultEquals(change, queryOne("repo~branch~" + k.substring(0, 10))); assertResultEquals(change, queryOne("change:repo~branch~" + k.substring(0, 10))); assertThat(query("foo~bar")).isEmpty(); assertBadQuery("change:foo~bar"); assertThat(query("otherrepo~branch~" + k)).isEmpty(); assertThat(query("change:otherrepo~branch~" + k)).isEmpty(); assertThat(query("repo~otherbranch~" + k)).isEmpty(); assertThat(query("change:repo~otherbranch~" + k)).isEmpty(); assertThat(query("repo~branch~I0000000000000000000000000000000000000000")) .isEmpty(); assertThat(query( "change:repo~branch~I0000000000000000000000000000000000000000")) .isEmpty(); }
Source:
private void findForgottenFiles(File snapshotDir) { try { Collection<File> snapshotFiles = FileUtils.listFiles(snapshotDir, FileFilterUtils.fileFileFilter(), null); File columnfamilyDir = snapshotDir.getParentFile().getParentFile(); Collection<File> columnfamilyFiles = FileUtils.listFiles(columnfamilyDir, FileFilterUtils.fileFileFilter(), null); for (File file : snapshotFiles) { File originalFile = new File(columnfamilyDir, file.getName()); columnfamilyFiles.remove(originalFile); } if (columnfamilyFiles.size() == 0) return; Collection<File> forgottenFiles = columnfamilyFiles.stream().filter(file -> file.isFile()).filter(file -> { Instant fileModification = Instant.ofEpochMilli(file.lastModified()); return fileModification.isBefore(snapshotInstant); }).collect(Collectors.toList()); forgottenFiles.parallelStream().forEach(file -> logger.info("Forgotten file: for CF: {}", file.getAbsolutePath(), columnfamilyDir.getName())); if (forgottenFiles == null || forgottenFiles.size() == 0) return; backupMetrics.incrementForgottenFiles(forgottenFiles.size()); logger.warn("Forgotten files: found for CF: {}", forgottenFiles.size(), columnfamilyDir.getName()); }catch (Exception e) { logger.error("Exception occurred while trying to find forgottenFile. Ignoring the error and continue with backup.", e); } }

Target:
private void findForgottenFiles(File snapshotDir) { try { Collection<File> snapshotFiles = FileUtils.listFiles(snapshotDir, FileFilterUtils.fileFileFilter(), null); File columnfamilyDir = snapshotDir.getParentFile().getParentFile(); IOFileFilter tmpFileFilter1 = FileFilterUtils.suffixFileFilter(TMP_EXT); IOFileFilter tmpFileFilter2 = FileFilterUtils.asFileFilter(pathname -> tmpFilePattern.matcher(pathname.getName()).matches()); IOFileFilter tmpFileFilter = FileFilterUtils.or(tmpFileFilter1, tmpFileFilter2); IOFileFilter ageFilter = FileFilterUtils.ageFileFilter(snapshotInstant.minus(config.getForgottenFileGracePeriodDays(), ChronoUnit.DAYS).toEpochMilli()); IOFileFilter fileFilter = FileFilterUtils.and(FileFilterUtils.notFileFilter(tmpFileFilter), FileFilterUtils.fileFileFilter(), ageFilter); Collection<File> columnfamilyFiles = FileUtils.listFiles(columnfamilyDir, fileFilter, null); for (File file : snapshotFiles) { File originalFile = new File(columnfamilyDir, file.getName()); columnfamilyFiles.remove(originalFile); } if (columnfamilyFiles.size() == 0) return; columnfamilyFiles.parallelStream().forEach(file -> logger.info("Forgotten file: found for CF: {}", file.getAbsolutePath(), columnfamilyDir.getName())); backupMetrics.incrementForgottenFiles(columnfamilyFiles.size()); logger.warn("# of forgotten files: found for CF: {}", columnfamilyFiles.size(), columnfamilyDir.getName()); } catch (Exception e) { logger.error("Exception occurred while trying to find forgottenFile. Ignoring the error and continuing with remaining backup", e); } }