auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ColumnStatisticsAggregation createColumnAggregation(ColumnStatisticType statisticType, Symbol input, Type inputType) { switch (statisticType) { case MIN_VALUE: return createAggregation(QualifiedName.of("min"), input.toSymbolReference(), inputType, inputType); case MAX_VALUE: return createAggregation(QualifiedName.of("max"), input.toSymbolReference(), inputType, inputType); case NUMBER_OF_DISTINCT_VALUES: return createAggregation(QualifiedName.of("approx_distinct"), input.toSymbolReference(), inputType, BIGINT); case NUMBER_OF_NON_NULL_VALUES: return createAggregation(QualifiedName.of("count"), input.toSymbolReference(), inputType, BIGINT); case NUMBER_OF_TRUE_VALUES: return createAggregation(QualifiedName.of("count_if"), input.toSymbolReference(), BOOLEAN, BIGINT); case TOTAL_VALUES_SIZE_IN_BYTES: <START> return createAggregation(QualifiedName.of("$internal$sum_data_size_for_stats"), input.toSymbolReference(), inputType, BIGINT); <END> case MAX_VALUE_SIZE_IN_BYTES: return createAggregation(QualifiedName.of("$internal$max_data_size_for_stats"), input.toSymbolReference(), inputType, BIGINT); default: throw new IllegalArgumentException("Unsupported statistic type: " + statisticType); } }</code><technical_language>a separate refactor, nice introduce a constant for name: java @AggregationFunction(value = SumDataSizeForStats.NAME, hidden = true) public final class SumDataSizeForStats { public static final String NAME = "$internal$sum_data_size_for_stats"; ..</technical_language>

Target:
private ColumnStatisticsAggregation createColumnAggregation(ColumnStatisticType statisticType, Symbol input, Type inputType) { switch (statisticType) { case MIN_VALUE: return createAggregation(QualifiedName.of("min"), input.toSymbolReference(), inputType, inputType); case MAX_VALUE: return createAggregation(QualifiedName.of("max"), input.toSymbolReference(), inputType, inputType); case NUMBER_OF_DISTINCT_VALUES: return createAggregation(QualifiedName.of("approx_distinct"), input.toSymbolReference(), inputType, BIGINT); case NUMBER_OF_NON_NULL_VALUES: return createAggregation(QualifiedName.of("count"), input.toSymbolReference(), inputType, BIGINT); case NUMBER_OF_TRUE_VALUES: return createAggregation(QualifiedName.of("count_if"), input.toSymbolReference(), BOOLEAN, BIGINT); case TOTAL_SIZE_IN_BYTES: return createAggregation(QualifiedName.of(SumDataSizeForStats.NAME), input.toSymbolReference(), inputType, BIGINT); case MAX_VALUE_SIZE_IN_BYTES: return createAggregation(QualifiedName.of(MaxDataSizeForStats.NAME), input.toSymbolReference(), inputType, BIGINT); default: throw new IllegalArgumentException("Unsupported statistic type: " + statisticType); } }
Source:
<code>public void setUp() throws Exception { context = RuntimeEnvironment.application; <START> BinaryTempFileBody.setTempDirectory(context.getCacheDir()); <END> imapStore = mock(ImapStore.class); storeConfig = mock(StoreConfig.class); when(storeConfig.getInboxFolderName()).thenReturn("INBOX"); when(imapStore.getCombinedPrefix()).thenReturn(""); when(imapStore.getStoreConfig()).thenReturn(storeConfig); imapConnection = mock(ImapConnection.class); }</code><technical_language>BinaryTempFileBody.setTempDirectory(RuntimeEnvironment.application.getCacheDir());</technical_language>

Target:
public void setUp() throws Exception { BinaryTempFileBody.setTempDirectory(RuntimeEnvironment.application.getCacheDir()); imapStore = mock(ImapStore.class); storeConfig = mock(StoreConfig.class); when(storeConfig.getInboxFolderName()).thenReturn("INBOX"); when(imapStore.getCombinedPrefix()).thenReturn(""); when(imapStore.getStoreConfig()).thenReturn(storeConfig); imapConnection = mock(ImapConnection.class); }
Source:
<code>public String getSeedAmount() { if (this.getInventoryInfo() != null && this.getInventoryInfo().getTotalAvailableBalance() != null) { if (this.getInventoryInfo().getDistinctScaleCountForGermplsm() > 1) { return "MIXED"; } else { <START> if (!this.getInventoryInfo().getTotalAvailableBalance().equals(0D)) { <END> return Double.toString(this.getInventoryInfo().getTotalAvailableBalance()) + this.getInventoryInfo() .getScaleForGermplsm(); } } } return ""; }</code><technical_language>@clarysabel request, merge this if else</technical_language>

Target:
public String getSeedAmount() { if (this.getInventoryInfo() != null && this.getInventoryInfo().getTotalAvailableBalance() != null) { if (this.getInventoryInfo().getDistinctScaleCountForGermplsm() > 1) { return "MIXED"; } else if (!this.getInventoryInfo().getTotalAvailableBalance().equals(0D)) { return Double.toString(this.getInventoryInfo().getTotalAvailableBalance()) + this.getInventoryInfo().getScaleForGermplsm(); } } return ""; }
Source:
<code>protected boolean canDoAction() { boolean retValue = true; if (getVm() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); retValue = false; } if (retValue && !getVm().isRunningOrPaused()) { setSucceeded(false); retValue = false; addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM); <START> if (!StringUtils.isEmpty(cdImagePath)) { <END> addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CHANGE_CD); } else { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__EJECT_CD); } failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL, LocalizedVmStatus.from(getVm().getStatus())); } else if (retValue && !canRunActionOnNonManagedVm()) { retValue = false; } else if ((IsoDomainListSyncronizer.getInstance().findActiveISODomain(getVm().getStoragePoolId()) == null) && !StringUtils.isEmpty(cdImagePath)) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CHANGE_CD); addCanDoActionMessage(VdcBllMessages.VM_CANNOT_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO); setSucceeded(false); retValue = false; } else if (StringUtils.isNotEmpty(cdImagePath) && !cdImagePath.endsWith(ValidationUtils.ISO_SUFFIX)) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CHANGE_CD); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CDROM_DISK_FORMAT); setSucceeded(false); retValue = false; } else { cdImagePath = ImagesHandler.cdPathWindowsToLinux(getParameters().getCdImagePath(), getVm().getStoragePoolId(), getVm().getRunOnVds()); } return retValue; }</code><technical_language>cdImagePath set this line</technical_language>

Target:
protected boolean canDoAction() { if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } if (!getVm().isRunningOrPaused()) { setSucceeded(false); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM); if (!StringUtils.isEmpty(cdImagePath)) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CHANGE_CD); } else { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__EJECT_CD); } return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL, LocalizedVmStatus.from(getVm().getStatus())); } if (!canRunActionOnNonManagedVm()) { return false; } if ((IsoDomainListSyncronizer.getInstance().findActiveISODomain(getVm().getStoragePoolId()) == null) && !StringUtils.isEmpty(cdImagePath)) { setSucceeded(false); addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CHANGE_CD); return failCanDoAction(VdcBllMessages.VM_CANNOT_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO); } if (StringUtils.isNotEmpty(cdImagePath) && !cdImagePath.endsWith(ValidationUtils.ISO_SUFFIX)) { setSucceeded(false); addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CHANGE_CD); return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CDROM_DISK_FORMAT); } cdImagePath = ImagesHandler.cdPathWindowsToLinux(getParameters().getCdImagePath(), getVm().getStoragePoolId(), getVm().getRunOnVds()); return true; }
Source:
<code>@Override public BootstrappedDatasetPartition build(Iterator<UpstreamEntry<K, V>> upstreamData, long upstreamDataSize, EmptyContext ctx) { <START> BootstrappedVector[] dataset = (BootstrappedVector[]) Array.newInstance(BootstrappedVector.class, Math.toIntExact(upstreamDataSize)); <END> AtomicInteger ptr = new AtomicInteger(); PoissonDistribution poissonDistribution = new PoissonDistribution(subsampleSize); poissonDistribution.reseedRandomGenerator(seed); upstreamData.forEachRemaining(entry -> { Vector features = featureExtractor.apply(entry.getKey(), entry.getValue()); Double label = lbExtractor.apply(entry.getKey(), entry.getValue()); int[] repetitionCounters = new int[samplesCount]; Arrays.setAll(repetitionCounters, i -> poissonDistribution.sample()); dataset[ptr.getAndIncrement()] = new BootstrappedVector(features, label, repetitionCounters); }); return new BootstrappedDatasetPartition(dataset); }</code><technical_language>More 120 symbols. magic way? BootstrappedVector[] ds = new BootstrappedVector[Math.toIntExact(upstreamDataSize)];</technical_language>

Target:
@Override public BootstrappedDatasetPartition build(Iterator<UpstreamEntry<K, V>> upstreamData, long upstreamDataSize, EmptyContext ctx) { BootstrappedVector[] dataset = new BootstrappedVector[Math.toIntExact(upstreamDataSize)]; int cntr = 0; PoissonDistribution poissonDistribution = new PoissonDistribution(subsampleSize); while(upstreamData.hasNext()) { UpstreamEntry<K, V> nextRow = upstreamData.next(); Vector features = featureExtractor.apply(nextRow.getKey(), nextRow.getValue()); Double lb = lbExtractor.apply(nextRow.getKey(), nextRow.getValue()); int[] repetitionCounters = new int[samplesCnt]; Arrays.setAll(repetitionCounters, i -> poissonDistribution.sample()); dataset[cntr++] = new BootstrappedVector(features, lb, repetitionCounters); } return new BootstrappedDatasetPartition(dataset); }
Source:
<code>private List<StorageType> getStorageTypesList(String storageTypesString) { List<String> splitTypes = split(storageTypesString); if (splitTypes == null) { return null; } <START> List<StorageType> types = new ArrayList<>(splitTypes.size()); <END> for (String typeStr : splitTypes) { try { types.add(StorageType.forValue(Integer.parseInt(typeStr))); } catch (NumberFormatException e) { continue; } } return types; }</code><technical_language>need in passing size</technical_language>

Target:
private ArrayList<StorageType> getStorageTypesList(String storageTypesString) throws SQLException { List<String> splitTypes = split(storageTypesString); if (splitTypes == null) { return null; } ArrayList<StorageType> types = new ArrayList<>(splitTypes.size()); for (String typeStr : splitTypes) { try { types.add(StorageType.forValue(Integer.parseInt(typeStr))); } catch (NumberFormatException e) { throw new SQLException("Could not parse disk image storage domain type " + typeStr); } } return types; }
Source:
<code>private static boolean checkServiceEndpoint(Logger log, Element organization, String serviceName, String serviceUrl, String matchEndpointVersion) { boolean serviceNodeFound = false; NodeList endpointList = getElementsByTagNameOf(log, organization, "endpointList", "endpoint"); if (endpointList != null) { for (int epIndex = 0; epIndex < endpointList.getLength(); epIndex++) { Element endpoint = (Element) endpointList.item(epIndex); String endpointName = getFirstElementOf(endpoint, "name").getTextContent(); <START> if (endpointName.equals(serviceName)) { <END> log.info(MessageFormat.format("Found service: {0}", serviceName)); serviceNodeFound = true; Element epConfigurationLatestVersion = getEndpointConfigurationBy(log, endpoint, matchEndpointVersion); if (epConfigurationLatestVersion != null) { Element url = getFirstElementOf(epConfigurationLatestVersion, "url"); if (url != null) { if (!serviceUrl.equals(url.getTextContent())) { url.setTextContent(serviceUrl); log.info(MessageFormat.format("setting the endpoint-configuration-url: {0}", serviceUrl)); } } else { createElementBy(epConfigurationLatestVersion, "url", serviceUrl); log.info(MessageFormat.format("created the endpoint-configuration-url: {0}", serviceUrl)); } } log.debug(getCheckpoint(MessageFormat.format("checkServiceEndpoint-found: {0}", serviceName))); break; } } } return serviceNodeFound; }</code><technical_language>ignorecase</technical_language>

Target:
private static boolean checkServiceEndpoint(Logger log, Element organization, String serviceName, String serviceUrl, String matchEndpointVersion) { boolean serviceNodeFound = false; NodeList endpointList = getElementsByTagNameOf(log, organization, "endpointList", "endpoint"); if (endpointList != null) { for (int epIndex = 0; epIndex < endpointList.getLength(); epIndex++) { Element endpoint = (Element) endpointList.item(epIndex); String endpointName = getFirstElementOf(endpoint, "name").getTextContent(); if (endpointName.equalsIgnoreCase(serviceName)) { log.info(MessageFormat.format("Found service: {0}", serviceName)); serviceNodeFound = true; Element epConfigurationLatestVersion = getEndpointConfigurationBy(log, endpoint, matchEndpointVersion); if (epConfigurationLatestVersion != null) { Element url = getFirstElementOf(epConfigurationLatestVersion, "url"); if (url != null) { if (!serviceUrl.equalsIgnoreCase(url.getTextContent())) { url.setTextContent(serviceUrl); log.info( MessageFormat.format("setting the endpoint-configuration-url: {0}", serviceUrl)); } } else { createElementBy(epConfigurationLatestVersion, "url", serviceUrl); log.info(MessageFormat.format("created the endpoint-configuration-url: {0}", serviceUrl)); } } log.debug(getCheckpoint(MessageFormat.format("checkServiceEndpoint-found: {0}", serviceName))); break; } } } return serviceNodeFound; }
Source:
<code>public void stop() { newScript(STOPPING). body.append( <START> "${runDir}/bin/stop" <END> ).execute(); }</code><technical_language>${runDir} wrong</technical_language>

Target:
public void stop() { newScript(STOPPING). body.append( format("%s/bin/stop",getRunDir()) ).execute(); }
Source:
<code>protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String pathInfo = req.getPathInfo(); if (pathInfo == null) { resp.setStatus(HttpURLConnection.HTTP_NOT_FOUND); } URL resource = bundle.getResource(resourceDirPath + pathInfo); <START> if (resource == null) { resp.setStatus(HttpURLConnection.HTTP_NOT_FOUND); <END> } try (InputStream stream = resource.openStream()) { IOUtils.copy(stream, resp.getOutputStream()); } }</code><technical_language>a null resource return;</technical_language>

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String pathInfo = req.getPathInfo(); if (pathInfo == null) { resp.setStatus(HttpURLConnection.HTTP_NOT_FOUND); return; } URL resource = bundle.getResource(resourceDirPath + pathInfo); if (resource == null) { resp.setStatus(HttpURLConnection.HTTP_NOT_FOUND); return; } try (InputStream stream = resource.openStream()) { IOUtils.copy(stream, resp.getOutputStream()); } }
Source:
<code>private void storeNetwork() throws UnsupportedEncodingException { <START> if (sourceProtocol.equals(NetConfigSourceProtocol.OPENSTACK_METADATA)) { <END> networkData = new VmInitToOpenStackMetadata(vmInit).asMap(); } else { storeNetworkAsEni(); } }</code><technical_language>typically compare enum values '==' instead of 'equals'</technical_language>

Target:
private void storeNetwork() throws UnsupportedEncodingException { if (sourceProtocol == NetConfigSourceProtocol.OPENSTACK_METADATA) { networkData = new VmInitToOpenStackMetadata(vmInit).asMap(); } else { storeNetworkAsEni(); } }
Source:
<code>public EJBContainer createEJBContainer(Map<?, ?> map) { if (map == null) { <START> map = new HashMap<Object, Object>(); <END> } if (isOtherProvider(map)) { return null; } if (instance != null || OpenEJB.isInitialized()) { if (!isSingleClose()) { logger().info("EJBContainer already initialized. Call ejbContainer.close() to allow reinitialization"); } return instance; } try { this.resetUrlPackages(); final Properties properties = new Properties(); properties.putAll(map); this.doInitialize(properties); AppContext appContext = this.createAppContext(map); final OpenEjbContainer openEjbContainer = instance = new OpenEjbContainer(map, appContext); if (isSingleClose()) { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { if (instance != null) { instance.doClose(); } } }); } return openEjbContainer; } catch (final OpenEJBException | MalformedURLException e) { throw new EJBException(e); } catch (final ValidationException ve) { throw ve; } catch (final Exception e) { if (e instanceof EJBException) { throw (EJBException) e; } throw new InitializationException(e); } finally { if (instance == null && OpenEJB.isInitialized()) { try { OpenEJB.destroy(); } catch (final Exception e) { } } } }</code><technical_language>diamond operator only</technical_language>

Target:
public EJBContainer createEJBContainer(Map<?, ?> map) { if (map == null) { map = new HashMap<>(); } if (isOtherProvider(map)) { return null; } if (instance != null || OpenEJB.isInitialized()) { if (!isSingleClose()) { logger().info("EJBContainer already initialized. Call ejbContainer.close() to allow reinitialization"); } return instance; } try { this.resetUrlPackages(); final Properties properties = new Properties(); properties.putAll(map); this.doInitialize(properties); AppContext appContext = this.createAppContext(map); final OpenEjbContainer openEjbContainer = instance = new OpenEjbContainer(map, appContext); if (isSingleClose()) { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { if (instance != null) { instance.doClose(); } } }); } return openEjbContainer; } catch (final OpenEJBException | MalformedURLException e) { throw new EJBException(e); } catch (final ValidationException ve) { throw ve; } catch (final Exception e) { if (e instanceof EJBException) { throw (EJBException) e; } throw new InitializationException(e); } finally { if (instance == null && OpenEJB.isInitialized()) { try { OpenEJB.destroy(); } catch (final Exception e) { } } } }
Source:
<code><START> public BSONObject convert(EntityInfo info) { <END> Error.push("convert[info|bson]"); try { BSONObject doc = (BSONObject) super.convert(info); List<DBObject> indexes = (List<DBObject>) getMapProperty(doc, "indexes"); if (indexes != null) { for (DBObject index: indexes) { DBObject partialFilterExpression = (DBObject) index.get(MongoCRUDController.PARTIAL_FILTER_EXPRESSION_OPTION_NAME); if (partialFilterExpression != null) { index.put(MongoCRUDController.PARTIAL_FILTER_EXPRESSION_OPTION_NAME, partialFilterExpression.toString()); } } } putValue(doc, "_id", getStringProperty(doc, "name") + DELIMITER_ID); return doc; } catch (Error e) { throw e; } catch (Exception e) { LOGGER.error(e.getMessage(), e); throw Error.get(MetadataConstants.ERR_ILL_FORMED_METADATA, e.getMessage()); } finally { Error.pop(); } }</code><technical_language>override convert(Index) convert(Indexes)</technical_language>

Target:
public BSONObject convert(EntityInfo info) { Error.push("convert[info|bson]"); try { BSONObject doc = (BSONObject) super.convert(info); putValue(doc, "_id", getStringProperty(doc, "name") + DELIMITER_ID); return doc; } catch (Error e) { throw e; } catch (Exception e) { LOGGER.error(e.getMessage(), e); throw Error.get(MetadataConstants.ERR_ILL_FORMED_METADATA, e.getMessage()); } finally { Error.pop(); } }
Source:
<code>public void aclSetUser(final byte[] name, byte[][] parameters) { <START> final byte[][] cmdParams = new byte[2 + parameters.length][]; int index = 0; cmdParams[index++] = Keyword.SETUSER.raw; cmdParams[index++] = name; for (final byte[] key : parameters) { cmdParams[index++] = key; } <END> sendCommand(ACL, cmdParams); }</code><technical_language>Please joinParameters method</technical_language>

Target:
public void aclSetUser(final byte[] name, byte[][] parameters) { sendCommand(ACL, joinParameters(Keyword.SETUSER.raw,name, parameters)); }
Source:
<code>public void update(Config source) { for (Config config : configs) { if (StringUtils.equals(config.getName(), source.getName())) { config.setOpenMrsUrl(source.getOpenMrsUrl()); config.setUsername(source.getUsername()); config.setPassword(source.getPassword()); config.setMotechPatientIdentifierTypeName(source.getMotechPatientIdentifierTypeName()); config.getPatientIdentifierTypeNames().clear(); <START> config.getPatientIdentifierTypeNames().addAll(source.getPatientIdentifierTypeNames()); <END> return; } } throw new ConfigurationNotFoundException(source.getName()); }</code><technical_language>set method for PatientIdentifierTypeNames</technical_language>

Target:
public void update(Config source) { for (Config config : configs) { if (StringUtils.equals(config.getName(), source.getName())) { config.setOpenMrsUrl(source.getOpenMrsUrl()); config.setUsername(source.getUsername()); config.setPassword(source.getPassword()); config.setMotechPatientIdentifierTypeName(source.getMotechPatientIdentifierTypeName()); config.setPatientIdentifierTypeNames(source.getPatientIdentifierTypeNames()); return; } } throw new ConfigurationNotFoundException(source.getName()); }
Source:
<code>public void updateConsumer( @PathParam("consumer_uuid") @Verify(Consumer.class) String uuid, @ApiParam(name = "consumer", required = true) ConsumerDTO dto, @Context Principal principal) { Consumer toUpdate = consumerCurator.verifyAndLookupConsumer(uuid); dto.setUuid(uuid); this.sanitizeConsumerFacts(dto); ConsumerType toUpdateType = this.consumerTypeCurator.getConsumerType(toUpdate); <START> boolean isShare = dto.getType() != null && dto.getType().getLabel() != null && <END> dto.getType().getLabel().equals("share"); if (toUpdateType.isType(ConsumerTypeEnum.SHARE) || isShare) { validateShareConsumerUpdate(toUpdate, dto, principal); } GuestMigration guestMigration = migrationProvider.get(); guestMigration.buildMigrationManifest(dto, toUpdate); if (performConsumerUpdates(dto, toUpdate, guestMigration)) { try { if (guestMigration.isMigrationPending()) { guestMigration.migrate(); } else { consumerCurator.update(toUpdate); } } catch (CandlepinException ce) { throw ce; } catch (Exception e) { log.error("Problem updating unit:", e); throw new BadRequestException(i18n.tr("Problem updating unit {0}", dto)); } } }</code><technical_language>client update consumer type, do need type check DTO? source entity enough here</technical_language>

Target:
public void updateConsumer( @PathParam("consumer_uuid") @Verify(Consumer.class) String uuid, @ApiParam(name = "consumer", required = true) ConsumerDTO dto, @Context Principal principal) { Consumer toUpdate = consumerCurator.verifyAndLookupConsumer(uuid); dto.setUuid(uuid); this.sanitizeConsumerFacts(dto); ConsumerType toUpdateType = this.consumerTypeCurator.getConsumerType(toUpdate); if (toUpdateType.isType(ConsumerTypeEnum.SHARE)) { validateShareConsumerUpdate(toUpdate, dto, principal); } GuestMigration guestMigration = migrationProvider.get(); guestMigration.buildMigrationManifest(dto, toUpdate); if (performConsumerUpdates(dto, toUpdate, guestMigration)) { try { if (guestMigration.isMigrationPending()) { guestMigration.migrate(); } else { consumerCurator.update(toUpdate); } } catch (CandlepinException ce) { throw ce; } catch (Exception e) { log.error("Problem updating unit:", e); throw new BadRequestException(i18n.tr("Problem updating unit {0}", dto)); } } }
Source:
<code>public Statement createBootstrapScriptForGroup(String group, @Nullable String nodeName) { <START> return groupToBootScript.apply(group, null); <END> }</code><technical_language>Hmmm this is wrong now? methods, passing null other passing nodeName</technical_language>

Target:
public Statement createBootstrapScriptForGroup(String group, @Nullable String nodeName) { return groupToBootScript.apply(group, nodeName); }
Source:
<code>public ChangeAttribute asChangeAttribute(final Change change) { ChangeAttribute a = new ChangeAttribute(); a.project = change.getProject().get(); a.branch = change.getDest().getShortName(); a.topic = change.getTopic(); a.id = change.getKey().get(); a.number = change.getId().toString(); a.subject = change.getSubject(); try { ChangeData cd = new ChangeData(change); a.commitMessage = cd.commitMessage(repoManager, db); <START> } catch (OrmException e) { <END> } catch (IOException e) { } a.url = getChangeUrl(change); a.owner = asAccountAttribute(change.getOwner()); a.status = change.getStatus(); return a; }</code><technical_language>logged admin investigate commitMessage field in a stream</technical_language>

Target:
public ChangeAttribute asChangeAttribute(final Change change) { ChangeAttribute a = new ChangeAttribute(); a.project = change.getProject().get(); a.branch = change.getDest().getShortName(); a.topic = change.getTopic(); a.id = change.getKey().get(); a.number = change.getId().toString(); a.subject = change.getSubject(); try { a.commitMessage = new ChangeData(change).commitMessage(repoManager, db); } catch (Exception e) { log.error("Error while getting full commit message for" + " change " + a.number); } a.url = getChangeUrl(change); a.owner = asAccountAttribute(change.getOwner()); a.status = change.getStatus(); return a; }
Source:
<code>protected void clean(IProgressMonitor monitor) throws CoreException { try { IProject myProject = getProject(); <START> BuilderPlugin.clearComponentMarkers(myProject); <END> final Project model; try { model = Central.getProject(myProject); } catch (Exception e) { MarkerSupport markers = new MarkerSupport(myProject); markers.deleteMarkers("*"); markers.createMarker(null, IMarker.SEVERITY_ERROR, "Cannot find bnd project", BndtoolsConstants.MARKER_BND_PATH_PROBLEM); return; } if (model == null) return; try { Central.bndCall(new Callable<Void>() { @Override public Void call() throws Exception { model.clean(); return null; } }, monitor); } catch (TimeoutException | InterruptedException e) { logger.logWarning("Unable to clean project " + myProject.getName(), e); return; } IFolder targetFolder = myProject.getFolder(calculateTargetDirPath(model)); targetFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor); } catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, 0, "Build Error!", e)); } }</code><technical_language>ComponentMarker handle related componentmarkers? class update clear component markers</technical_language>

Target:
protected void clean(IProgressMonitor monitor) throws CoreException { try { IProject myProject = getProject(); final Project model; try { model = Central.getProject(myProject); } catch (Exception e) { MarkerSupport markers = new MarkerSupport(myProject); markers.deleteMarkers("*"); markers.createMarker(null, IMarker.SEVERITY_ERROR, "Cannot find bnd project", BndtoolsConstants.MARKER_BND_PATH_PROBLEM); return; } if (model == null) return; try { Central.bndCall(new Callable<Void>() { @Override public Void call() throws Exception { model.clean(); return null; } }, monitor); } catch (TimeoutException | InterruptedException e) { logger.logWarning("Unable to clean project " + myProject.getName(), e); return; } IFolder targetFolder = myProject.getFolder(calculateTargetDirPath(model)); targetFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor); } catch (Exception e) { throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, 0, "Build Error!", e)); } }
Source:
<code>public BuildTrigger(IBuild build, IClient client) { this.resource = build; this.client = client; this.subresource = BUILD_SUBRESOURCE; <START> this.causes = new ArrayList<String>(); <END> }</code><technical_language>this actuall be: this.causes = new ArrayList<>();</technical_language>

Target:
public BuildTrigger(IBuild build, IClient client) { this.resource = build; this.client = client; this.subresource = BUILD_SUBRESOURCE; this.causes = new ArrayList<>(); }
Source:
<code>private LogReplicationConfig getLogReplicationConfiguration(CorfuRuntime runtime) { LogReplicationStreamNameTableManager replicationStreamNameTableManager = new LogReplicationStreamNameTableManager(runtime, serverContext.getPluginConfigFilePath()); Set<String> streamsToReplicate = replicationStreamNameTableManager.getStreamsToReplicate(); boolean upgraded = replicationStreamNameTableManager .isUpgraded(); if (upgraded) { input(new DiscoveryServiceEvent(DiscoveryServiceEvent.DiscoveryServiceEventType.UPGRADE)); } <START> return new LogReplicationConfig(streamsToReplicate, serverContext.getMaxNumSnapshotDataMsgPerCycle(), serverContext.getLogReplicationMaxDataMessageSize()); <END> }</code><technical_language>mmm name is a bit convoluted. rename getMaxSnapshotSyncMsgCount()</technical_language>

Target:
private LogReplicationConfig getLogReplicationConfiguration(CorfuRuntime runtime) { LogReplicationStreamNameTableManager replicationStreamNameTableManager = new LogReplicationStreamNameTableManager(runtime, serverContext.getPluginConfigFilePath()); Set<String> streamsToReplicate = replicationStreamNameTableManager.getStreamsToReplicate(); boolean upgraded = replicationStreamNameTableManager .isUpgraded(); if (upgraded) { input(new DiscoveryServiceEvent(DiscoveryServiceEvent.DiscoveryServiceEventType.UPGRADE)); } return new LogReplicationConfig(streamsToReplicate, serverContext.getMaxNumMsgPerBatch(), serverContext.getLogReplicationMaxDataMessageSize()); }
Source:
<code>private ContentTypeConvertingInterceptor(String contentType, boolean input) { this.contentType = contentType; this.mimeType = MessageConverterUtils.getMimeType(contentType); this.input = input; <START> if (MessageConverterUtils.X_JAVA_OBJECT.includes(this.mimeType)) { <END> this.klazz = MessageConverterUtils .getJavaTypeForJavaObjectContentType(this.mimeType); } else if (this.mimeType.equals(MessageConverterUtils.X_SPRING_TUPLE)) { this.klazz = Tuple.class; } else if (this.mimeType.getType().equals("text") || this.mimeType.getSubtype().equals( "json") || this.mimeType.getSubtype().equals("xml")) { this.klazz = String.class; } else { this.klazz = byte[].class; } this.messageConverter = MessageConverterConfigurer.this.compositeMessageConverterFactory .getMessageConverterForType(this.mimeType); }</code><technical_language>is this backwards? i.e. be: if (this.mimeType.includes(MessageConverterUtils.X_JAVA_OBJECT)) {...</technical_language>

Target:
private ContentTypeConvertingInterceptor(String contentType, boolean input) { this.contentType = contentType; this.mimeType = MessageConverterUtils.getMimeType(contentType); this.input = input; if (MessageConverterUtils.X_JAVA_OBJECT.equals(this.mimeType)) { this.klazz = MessageConverterUtils .getJavaTypeForJavaObjectContentType(this.mimeType); } else if (this.mimeType.equals(MessageConverterUtils.X_SPRING_TUPLE)) { this.klazz = Tuple.class; } else if (this.mimeType.getType().equals("text") || this.mimeType.getSubtype().equals( "json") || this.mimeType.getSubtype().equals("xml")) { this.klazz = String.class; } else { this.klazz = byte[].class; } this.messageConverter = MessageConverterConfigurer.this.compositeMessageConverterFactory .getMessageConverterForType(this.mimeType); }
Source:
<code>public SetupTemplateContributionItem() { super(new SetupTemplateAction()); editor = (JSPMultiPageEditor) PlatformUI .getWorkbench().getActiveWorkbenchWindow().getActivePage() .getActiveEditor(); this.sourceEditor = editor.getSourceEditor(); IVisualEditor visualEditor = editor.getVisualEditor(); IVisualController controller = visualEditor != null ? visualEditor.getController() : null; <START> if (controller != null && controller instanceof VpeController) { <END> this.vpeController = (VpeController) controller; this.pageContext = (VpePageContext) vpeController.getPageContext(); } else { this.vpeController = null; this.pageContext = null; } getAction().setPageContext(pageContext); }</code><technical_language>Null check is required</technical_language>

Target:
public SetupTemplateContributionItem() { super(new SetupTemplateAction()); editor = (JSPMultiPageEditor) PlatformUI .getWorkbench().getActiveWorkbenchWindow().getActivePage() .getActiveEditor(); this.sourceEditor = editor.getSourceEditor(); IVisualEditor visualEditor = editor.getVisualEditor(); IVisualController controller = visualEditor != null ? visualEditor.getController() : null; if (controller instanceof VpeController) { this.vpeController = (VpeController) controller; this.pageContext = (VpePageContext) vpeController.getPageContext(); } else { this.vpeController = null; this.pageContext = null; } getAction().setPageContext(pageContext); }
Source:
<code>protected Election createElectionAlgorithm(int electionAlgorithm) { Election le = null; <START> switch (electionAlgorithm) { <END> case 3: QuorumCnxManager qcm = createCnxnManager(); QuorumCnxManager oldQcm = qcmRef.getAndSet(qcm); if (oldQcm != null) { LOG.warn("Clobbering already-set QuorumCnxManager (restarting leader election?)"); oldQcm.halt(); } QuorumCnxManager.Listener listener = qcm.listener; if (listener != null) { listener.start(); FastLeaderElection fle = new FastLeaderElection(this, qcm); fle.start(); le = fle; } else { LOG.error("Null listener when initializing cnx manager"); } break; default: assert false; } return le; }</code><technical_language>remove this TODO - need this switch-case structure, support Algorithm3</technical_language>

Target:
protected Election createElectionAlgorithm(int electionAlgorithm) { Election le = null; switch (electionAlgorithm) { case 1: throw new UnsupportedOperationException("Election Algorithm 1 is not supported."); case 2: throw new UnsupportedOperationException("Election Algorithm 2 is not supported."); case 3: QuorumCnxManager qcm = createCnxnManager(); QuorumCnxManager oldQcm = qcmRef.getAndSet(qcm); if (oldQcm != null) { LOG.warn("Clobbering already-set QuorumCnxManager (restarting leader election?)"); oldQcm.halt(); } QuorumCnxManager.Listener listener = qcm.listener; if (listener != null) { listener.start(); FastLeaderElection fle = new FastLeaderElection(this, qcm); fle.start(); le = fle; } else { LOG.error("Null listener when initializing cnx manager"); } break; default: assert false; } return le; }
Source:
<code>public void afterPhase(PhaseEvent event) { FacesContext facesContext = event.getFacesContext(); String currentPage = facesContext.getViewRoot().getViewId(); LOG.debug("current page: ".concat(currentPage)); HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false); UserLogin currentUser = null; if (session != null) { currentUser = (UserLogin) session.getAttribute(USER_INFO_SESSION_ATTRIBUTE); } <START> validateCSRFToken(event); <END> if (!noLoginRequiredPages.contains(currentPage) && currentUser == null) { LOG.debug("login required and current user is null, redirecting to login page."); NavigationHandler nh = facesContext.getApplication().getNavigationHandler(); nh.handleNavigation(facesContext, null, NavigationConstant.LOGIN_PAGE); } else { boolean hasRolePermission = roleService.checkRole(formatPageName(currentPage), currentUser); boolean isConfigured = checkConfiguredDisplay(formatPageName(currentPage)); if (currentUser != null && (hasRolePermission == false || isConfigured == false)) { LOG.debug("User, " + currentUser.getUserName() + " can not access given page: " + currentPage); NavigationHandler nh = facesContext.getApplication().getNavigationHandler(); nh.handleNavigation(facesContext, null, NavigationConstant.STATUS_PAGE); } } }</code><technical_language>switch "csrf" "CSRF" in a couple places in this PR; (but camel case "Csrf" appropriate)</technical_language>

Target:
public void afterPhase(PhaseEvent event) { FacesContext facesContext = event.getFacesContext(); String currentPage = facesContext.getViewRoot().getViewId(); LOG.debug("current page: ".concat(currentPage)); HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false); UserLogin currentUser = null; if (session != null) { currentUser = (UserLogin) session.getAttribute(USER_INFO_SESSION_ATTRIBUTE); } validateCsrfToken(event); if (!noLoginRequiredPages.contains(currentPage) && currentUser == null) { LOG.debug("login required and current user is null, redirecting to login page."); NavigationHandler nh = facesContext.getApplication().getNavigationHandler(); nh.handleNavigation(facesContext, null, NavigationConstant.LOGIN_PAGE); } else { boolean hasRolePermission = roleService.checkRole(formatPageName(currentPage), currentUser); boolean isConfigured = checkConfiguredDisplay(formatPageName(currentPage)); if (currentUser != null && (hasRolePermission == false || isConfigured == false)) { LOG.debug("User, " + currentUser.getUserName() + " can not access given page: " + currentPage); NavigationHandler nh = facesContext.getApplication().getNavigationHandler(); nh.handleNavigation(facesContext, null, NavigationConstant.STATUS_PAGE); } } }
Source:
<code>public void testLatchSizeN() { final int latchSize = 1; final String latchId = "testLatchSizeN"; ExecutorService pool = Executors.newFixedThreadPool(3); <START> Future f1 = pool.submit(getParticipantRunnable(latchSize, latchId, "participant1")); <END> Future f2 = pool.submit(getParticipantRunnable(latchSize, latchId, "participant2")); Future f3 = pool.submit(getParticipantRunnable(latchSize, latchId, "participant3")); try { f1.get(30, TimeUnit.SECONDS); f2.get(30, TimeUnit.SECONDS); f3.get(30, TimeUnit.SECONDS); } catch (Exception e) { Assert.fail("failed to get future." + e.getLocalizedMessage()); } finally { pool.shutdownNow(); } try { List<String> latchParticipants = testZkUtils.getZkClient().getChildren( String.format("%s/%s_%s", KEY_BUILDER.getRootPath(), ZkProcessorLatch.LATCH_PATH, latchId)); Assert.assertNotNull(latchParticipants); Assert.assertEquals(3, latchParticipants.size()); } catch (Exception e) { Assert.fail("Failed to read the latch status from ZK directly" + e.getLocalizedMessage()); } }</code><technical_language>I confused of test names now. :/ testLatchSizeN testLatchSizeOneWithNParticipants, is more accurate here</technical_language>

Target:
public void testLatchSizeN() { final int latchSize = 3; final String latchId = "testLatchSizeN"; ExecutorService pool = Executors.newFixedThreadPool(3); Future f1 = pool.submit(getParticipantRunnable(latchSize, latchId, "participant1")); Future f2 = pool.submit(getParticipantRunnable(latchSize, latchId, "participant2")); Future f3 = pool.submit(getParticipantRunnable(latchSize, latchId, "participant3")); try { f1.get(30, TimeUnit.SECONDS); f2.get(30, TimeUnit.SECONDS); f3.get(30, TimeUnit.SECONDS); } catch (Exception e) { Assert.fail("failed to get future." + e.getLocalizedMessage()); } finally { pool.shutdownNow(); } try { List<String> latchParticipants = testZkUtils.getZkClient().getChildren( String.format("%s/%s_%s", KEY_BUILDER.getRootPath(), ZkProcessorLatch.LATCH_PATH, latchId)); Assert.assertNotNull(latchParticipants); Assert.assertEquals(3, latchParticipants.size()); } catch (Exception e) { Assert.fail("Failed to read the latch status from ZK directly" + e.getLocalizedMessage()); } }
Source:
<code><START> public Repository getRepository(final IResource resource) { <END> Repository[] repositories = org.eclipse.egit.core.Activator .getDefault().getRepositoryCache().getAllRepositories(); Repository repository = null; int segmentCount = 0; for (Repository r : repositories) { if (!r.isBare()) { try { IPath repoPath = new Path(r.getWorkTree() .getCanonicalPath()); IPath location = resource.getLocation(); if (location != null && repoPath.isPrefixOf(resource.getLocation())) { if (repository == null || repoPath.segmentCount() > segmentCount) { repository = r; segmentCount = repoPath.segmentCount(); } } } catch (IOException e) { Activator .error("looking up working tree path of git repository failed", e); } } } return repository; }</code><technical_language>I noticed, this need @since</technical_language>

Target:
public Repository getRepository(final IResource resource) { Repository[] repositories = org.eclipse.egit.core.Activator .getDefault().getRepositoryCache().getAllRepositories(); Repository repository = null; int largestSegmentCount = 0; for (Repository r : repositories) { if (!r.isBare()) { try { IPath repoPath = new Path(r.getWorkTree() .getCanonicalPath()); IPath location = resource.getLocation(); if (location != null && repoPath.isPrefixOf(location)) { if (repository == null || repoPath.segmentCount() > largestSegmentCount) { repository = r; largestSegmentCount = repoPath.segmentCount(); } } } catch (IOException e) { Activator .error("looking up working tree path of git repository failed", e); } } } return repository; }
Source:
<code>public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { CurrentUser user = userProvider.get(); if (user != null && user.isIdentifiedUser()) { IdentifiedUser who = (IdentifiedUser) user; if (who.getUserName() != null && !who.getUserName().isEmpty()) { req.setAttribute(REQ_ATTR_KEY, who.getUserName()); } else { req.setAttribute(REQ_ATTR_KEY, <START> who.getAccountId()); <END> } } chain.doFilter(req, resp); }</code><technical_language>"a/" + who.getAccountId()</technical_language>

Target:
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { CurrentUser user = userProvider.get(); if (user != null && user.isIdentifiedUser()) { IdentifiedUser who = (IdentifiedUser) user; if (who.getUserName() != null && !who.getUserName().isEmpty()) { req.setAttribute(REQ_ATTR_KEY, who.getUserName()); } else { req.setAttribute(REQ_ATTR_KEY, "a/" + who.getAccountId()); } } chain.doFilter(req, resp); }
Source:
<code>void shouldNotFailOnDeleteByIdWithAnyVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> { <START> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1, myVersion:3})").consume(); return null; <END> }); } StepVerifier.create(repository.deleteById(1L)) .verifyComplete(); try (Session session = driver.session()) { long count = session.readTransaction(tx -> tx.run("MATCH (v:VersionedThingWithAssignedId) return count(v) as vCount").next() .get("vCount").asLong()); assertThat(count).isEqualTo(0); } }</code><technical_language>suggestion return tx.run("CREATE (v:VersionedThingWithAssignedId {id:1, myVersion:3})").consume();</technical_language>

Target:
void shouldNotFailOnDeleteByIdWithAnyVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1, myVersion:3})").consume()); } StepVerifier.create(repository.deleteById(1L)) .verifyComplete(); try (Session session = driver.session()) { long count = session.readTransaction(tx -> tx.run("MATCH (v:VersionedThingWithAssignedId) return count(v) as vCount").next() .get("vCount").asLong()); assertThat(count).isEqualTo(0); } }
Source:
<code>protected boolean canDoAction() { <START> <END> setGlusterVolumeId(getParameters().getVolumeId() == null ? getGeoRepSession().getMasterVolumeId() : getParameters().getVolumeId()); if (!super.canDoAction()) { return false; } if (getGeoRepSession().getStatus().equals(GeoRepSessionStatus.ACTIVE)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_STARTED); } return true; }</code><technical_language>I this change belong in this patch</technical_language>

Target:
protected boolean canDoAction() { setGlusterVolumeId(getGeoRepSession().getMasterVolumeId()); if (!super.canDoAction()) { return false; } if (getGeoRepSession().getStatus().equals(GeoRepSessionStatus.ACTIVE)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_STARTED); } return true; }
Source:
<code>public void processPresign( Response response, AuthnRequest authnRequest, List<String> spMetadata, Set<SamlProtocol.Binding> supportedBindings) { <START> response.getIssuer().setNameQualifier(NAME_QUALIFIER); <END> for (Assertion assertion : response.getAssertions()) { assertion.getSubject().getNameID().setNameQualifier(NAME_QUALIFIER); } }</code><technical_language>I this is specifically for Persistent IDs check format is urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</technical_language>

Target:
public void processPresign( Response response, AuthnRequest authnRequest, List<String> spMetadata, Set<SamlProtocol.Binding> supportedBindings) { if (response.getIssuer() != null) { setNameQualifierIfPersistent(response.getIssuer()); } for (Assertion assertion : response.getAssertions()) { if (assertion.getSubject() != null && assertion.getSubject().getNameID() != null) { setNameQualifierIfPersistent(assertion.getSubject().getNameID()); } setNameQualifierIfPersistent(assertion.getIssuer()); } }
Source:
<code>abstract void start(PluginGuiceEnvironment env) throws Exception; abstract void stop(PluginGuiceEnvironment env); public abstract <START> JarFile getJarFile(); <END> public abstract PluginContentScanner getContentScanner(); public abstract Injector getSysInjector(); @Nullable public abstract Injector getSshInjector(); @Nullable public abstract Injector getHttpInjector(); public void add(RegistrationHandle handle) { if (manager != null) { if (handle instanceof ReloadableRegistrationHandle) { if (reloadableHandles == null) { reloadableHandles = Lists.newArrayList(); } reloadableHandles.add((ReloadableRegistrationHandle<?>) handle); } manager.add(handle); } }</code><technical_language>is this method here? exist in ServerPlugin? I thought idea of this change is Plugin class independent of form in plugin is stored (jar-file else)</technical_language>

Target:
abstract void start(PluginGuiceEnvironment env) throws Exception; abstract void stop(PluginGuiceEnvironment env); @Deprecated public abstract JarFile getJarFile(); public abstract PluginContentScanner getContentScanner(); public abstract Injector getSysInjector(); @Nullable public abstract Injector getSshInjector(); @Nullable public abstract Injector getHttpInjector(); public void add(RegistrationHandle handle) { if (manager != null) { if (handle instanceof ReloadableRegistrationHandle) { if (reloadableHandles == null) { reloadableHandles = Lists.newArrayList(); } reloadableHandles.add((ReloadableRegistrationHandle<?>) handle); } manager.add(handle); } }
Source:
<code><START> private Optional<String> maybeChooseUncompactedTable( <END> Map<String, Long> tableToLastTimeSwept, Map<String, Long> tableToLastTimeCompacted) { List<String> uncompactedTables = tableToLastTimeSwept.keySet().stream() .filter(table -> !tableToLastTimeCompacted.keySet().contains(table)) .collect(Collectors.toList()); if (uncompactedTables.size() > 0) { int randomTableIndex = ThreadLocalRandom.current().nextInt(uncompactedTables.size()); String randomlyChosenTable = uncompactedTables.get(randomTableIndex); log.info("There are some tables which have been swept, but not compacted. Choosing at random.", safeTableRef(randomlyChosenTable)); return Optional.of(randomlyChosenTable); } return Optional.empty(); }</code><technical_language>Thanks for refactoring selection method! I this a lot clearer. In general internal selection methods static I feel strongly this</technical_language>

Target:
private static Optional<String> maybeChooseUncompactedTable( Map<String, Long> tableToLastTimeSwept, Map<String, Long> tableToLastTimeCompacted) { List<String> uncompactedTables = tableToLastTimeSwept.keySet().stream() .filter(table -> !tableToLastTimeCompacted.keySet().contains(table)) .collect(Collectors.toList()); if (uncompactedTables.size() > 0) { int randomTableIndex = ThreadLocalRandom.current().nextInt(uncompactedTables.size()); String randomlyChosenTable = uncompactedTables.get(randomTableIndex); log.info("There are some tables which have been swept, but not compacted. Choosing at random.", safeTableRef(randomlyChosenTable)); return Optional.of(randomlyChosenTable); } return Optional.empty(); }