auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean next(List<Cell> list) throws IOException { if (failure.get() != null) { timer.cancel(); throw failure.get(); } Entry entry; try { entry = queue.take(); int toRelease = entry.cells.size(); final boolean more = entry.more; List<TxnView> txns = waitFor(entry.txns); compactionState.mutate(entry.cells, txns, list, purgeConfig); if (!more) { timer.cancel(); context.close(); } permits.release(toRelease); return more; <START> } catch (Exception e) { <END> timer.cancel(); throw new IOException(e); } }</code><technical_language>permit release if exception thrown in catch block</technical_language>

Target:
public boolean next(List<Cell> list) throws IOException { if (failure.get() != null) { timer.cancel(); throw failure.get(); } Entry entry; try { entry = queue.take(); int toRelease = entry.cells.size(); final boolean more = entry.more; List<TxnView> txns = waitFor(entry.txns); compactionState.mutate(entry.cells, txns, list, purgeConfig); if (!more) { timer.cancel(); context.close(); } permits.release(toRelease); return more; } catch (Throwable t) { timer.cancel(); stop = true; permits.release(queue.size()); queue.clear(); throw new IOException(t); } }
Source:
<code>private Metacard buildMetacard() { <START> MetacardType metacardType = new MetacardTypeImpl("", new HashSet<>(ATTRIBUTE_DESCRIPTOR_LIST)); <END> Metacard metacard = new MetacardImpl(metacardType); for (Attribute a : metacardDataMap.values()) { metacard.setAttribute(a); } return metacard; }</code><technical_language>name of MetacardType null in this case</technical_language>

Target:
private Metacard buildMetacard() { MetacardType metacardType = new MetacardTypeImpl("", ATTRIBUTE_DESCRIPTORS); Metacard metacard = new MetacardImpl(metacardType); for (Attribute attribute : ATTRIBUTES) { metacard.setAttribute(attribute); } return metacard; }
Source:
<code>public void testCreateTabixIndexFromVCF( final File inputVCF, final Interval queryInterval) throws IOException { <START> final File tmpVCF = new File(IOUtil.createTempDir("testCreateTabixIndexFromVCF", null), inputVCF.getName()); <END> Files.copy(inputVCF, tmpVCF); final TabixIndex tabixIndexGz = IndexFactory.createTabixIndex(tmpVCF, new VCFCodec(), null); tabixIndexGz.writeBasedOnFeatureFile(tmpVCF); try(final VCFFileReader originalReader = new VCFFileReader(inputVCF,false); final VCFFileReader tmpReader = new VCFFileReader(tmpVCF, new File(tmpVCF.getAbsolutePath()+ ".tbi"),true)) { Iterator<VariantContext> originalIt = originalReader.iterator(); Iterator<VariantContext> tmpIt = tmpReader.query(queryInterval.getContig(), queryInterval.getStart(), queryInterval.getEnd()); while(originalIt.hasNext()) { Assert.assertTrue(tmpIt.hasNext(), "variants missing from gzip query"); VariantContext vcTmp = tmpIt.next(); VariantContext vcOrig = originalIt.next(); Assert.assertEquals(vcOrig.getContig(), vcTmp.getContig()); Assert.assertEquals(vcOrig.getStart(), vcTmp.getStart()); Assert.assertEquals(vcOrig.getEnd(), vcTmp.getEnd()); } } }</code><technical_language>cleanup this temp dir</technical_language>

Target:
public void testCreateTabixIndexFromVCF( final File inputVCF, final Interval queryInterval) throws IOException { final File tempDir = IOUtil.createTempDir("testCreateTabixIndexFromVCF", null); tempDir.deleteOnExit(); final File tmpVCF = new File(tempDir, inputVCF.getName()); Files.copy(inputVCF, tmpVCF); tmpVCF.deleteOnExit(); final TabixIndex tabixIndexGz = IndexFactory.createTabixIndex(tmpVCF, new VCFCodec(), null); tabixIndexGz.writeBasedOnFeatureFile(tmpVCF); final File tmpIndex = Tribble.tabixIndexFile(tmpVCF); tmpIndex.deleteOnExit(); try (final VCFFileReader originalReader = new VCFFileReader(inputVCF,false); final VCFFileReader tmpReader = new VCFFileReader(tmpVCF, tmpIndex,true)) { Iterator<VariantContext> originalIt = originalReader.iterator(); Iterator<VariantContext> tmpIt = tmpReader.query(queryInterval.getContig(), queryInterval.getStart(), queryInterval.getEnd()); while (originalIt.hasNext()) { Assert.assertTrue(tmpIt.hasNext(), "variants missing from gzip query"); VariantContext vcTmp = tmpIt.next(); VariantContext vcOrig = originalIt.next(); Assert.assertEquals(vcOrig.getContig(), vcTmp.getContig()); Assert.assertEquals(vcOrig.getStart(), vcTmp.getStart()); Assert.assertEquals(vcOrig.getEnd(), vcTmp.getEnd()); } } }
Source:
<code>public void spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws Throwable { blackboxSubscriberTest(new BlackboxTestStageTestRun() { @Override @SuppressWarnings("ThrowableResultOfMethodCallIgnored") public void run(BlackboxTestStage stage) throws Throwable { <START> stage.sub().onError(new Throwable("Test Exception: Boom!")); <END> stage.subProxy().expectError(Throwable.class); } }); }</code><technical_language>creating a custom exception type for it</technical_language>

Target:
public void spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws Throwable { blackboxSubscriberTest(new BlackboxTestStageTestRun() { @Override @SuppressWarnings("ThrowableResultOfMethodCallIgnored") public void run(BlackboxTestStage stage) throws Throwable { stage.sub().onError(new TestException()); stage.subProxy().expectError(Throwable.class); } }); }
Source:
<code>private void performSlaRelatedLogging(DatastreamRecordMetadata metadata, long eventsSourceTimestamp, long sourceToDestinationLatencyMs) { if (_warnLogLatencyEnabled && (sourceToDestinationLatencyMs > _warnLogLatencyThresholdMs)) { _logger.warn("Source to destination latency ms is higher than ms, Source Timestamp: {}, Metadata: {}", <START> sourceToDestinationLatencyMs, _warnLogLatencyThresholdMs, eventsSourceTimestamp, metadata.toString()); <END> } if (_numEventsOutsideAltSlaLogEnabled) { if (sourceToDestinationLatencyMs > _availabilityThresholdAlternateSlaMs) { TopicPartition topicPartition = new TopicPartition(metadata.getTopic(), metadata.getPartition()); int numEvents = _trackEventsOutsideAltSlaMap.getOrDefault(topicPartition, 0); _trackEventsOutsideAltSlaMap.put(topicPartition, numEvents + 1); } long timeSinceLastLog = System.currentTimeMillis() - _lastEventsOutsideAltSlaLogTimeMs; if (timeSinceLastLog >= _numEventsOutsideAltSlaFrequencyMs) { _trackEventsOutsideAltSlaMap.forEach((topicPartition, numEvents) -> _logger.warn("{} had event(s) with latency greater than alternate SLA of ms in the last ms", topicPartition, numEvents, _availabilityThresholdAlternateSlaMs, timeSinceLastLog)); _trackEventsOutsideAltSlaMap.clear(); _lastEventsOutsideAltSlaLogTimeMs = System.currentTimeMillis(); } } }</code><technical_language>toString() is extraneous</technical_language>

Target:
private void performSlaRelatedLogging(DatastreamRecordMetadata metadata, long eventsSourceTimestamp, long sourceToDestinationLatencyMs) { if (_warnLogLatencyEnabled && (sourceToDestinationLatencyMs > _warnLogLatencyThresholdMs)) { _logger.warn("Source to destination latency ms is higher than ms, Source Timestamp: {}, Metadata: {}", sourceToDestinationLatencyMs, _warnLogLatencyThresholdMs, eventsSourceTimestamp, metadata); } if (_numEventsOutsideAltSlaLogEnabled) { if (sourceToDestinationLatencyMs > _availabilityThresholdAlternateSlaMs) { TopicPartition topicPartition = new TopicPartition(metadata.getTopic(), metadata.getPartition()); int numEvents = _trackEventsOutsideAltSlaMap.getOrDefault(topicPartition, 0); _trackEventsOutsideAltSlaMap.put(topicPartition, numEvents + 1); } long timeSinceLastLog = System.currentTimeMillis() - _lastEventsOutsideAltSlaLogTimeMs; if (timeSinceLastLog >= _numEventsOutsideAltSlaFrequencyMs) { _trackEventsOutsideAltSlaMap.forEach((topicPartition, numEvents) -> _logger.warn("{} had event(s) with latency greater than alternate SLA of ms in the last ms", topicPartition, numEvents, _availabilityThresholdAlternateSlaMs, timeSinceLastLog)); _trackEventsOutsideAltSlaMap.clear(); _lastEventsOutsideAltSlaLogTimeMs = System.currentTimeMillis(); } } }
Source:
<code>public void find(String packageName, final Class<?> parentType) { this.parentType = parentType; packageName = packageName.replace('.', '/'); final Enumeration<URL> urls; try { urls = loader.getResources(packageName); } catch (IOException ioe) { log.warn("Could not read package: " + packageName, ioe); return; } while (urls.hasMoreElements()) { try { String urlPath = urls.nextElement().getFile(); try { URI uri = new URI(urlPath); urlPath = uri.getPath(); } catch (URISyntaxException e) { log.warn("Cannot convert to URI the " + urlPath + " URL"); } if (urlPath.indexOf('!') > 0) { urlPath = urlPath.substring(0, urlPath.indexOf('!')); } if (jarPath != null && !jarPath.equals(urlPath)) { continue; } <START> final File file = new File(urlPath); <END> if ( file.isDirectory() ) { scanDir(file, packageName); } else { scanJar(file, packageName); } } catch (IOException ioe) { log.warn("could not read entries", ioe); } } }</code><technical_language>switch a log.debug instead</technical_language>

Target:
public void find(String packageName, final Class<?> parentType) { this.parentType = parentType; packageName = packageName.replace('.', '/'); final Enumeration<URL> urls; try { urls = loader.getResources(packageName); } catch (IOException ioe) { log.warn("Could not read package: " + packageName, ioe); return; } while (urls.hasMoreElements()) { try { String urlPath = urls.nextElement().getFile(); try { URI uri = new URI(urlPath); urlPath = uri.getPath(); } catch (URISyntaxException e) { log.warn("Cannot convert to URI the " + urlPath + " URL"); } if (urlPath.indexOf('!') > 0) { urlPath = urlPath.substring(0, urlPath.indexOf('!')); } if (jarPath != null && !jarPath.equals(urlPath)) { continue; } log.debug("Looking for classes in location: " + urlPath); final File file = new File(urlPath); if ( file.isDirectory() ) { scanDir(file, packageName); } else { scanJar(file, packageName); } } catch (IOException ioe) { log.warn("could not read entries", ioe); } } }
Source:
<code>private static <T> InputStream pageToStream(Page<T> page, ObjectMapper mapper) { PipedInputStream in = new PipedInputStream(); <START> new Thread(() -> { <END> try (PipedOutputStream out = new PipedOutputStream(in)) { while (page.hasNext()) { mapper.writeValue(out, page.next()); } } catch (IOException e) { throw new IllegalStateException("Unable to convert page to input stream.", e); } }).start(); return in; }</code><technical_language>a ThreadPoolExecutor more performant instead of starting a new thread time page</technical_language>

Target:
private static <T> InputStream pageToStream(Page<T> page, ObjectMapper mapper) throws IOException { final PipedOutputStream outs = new PipedOutputStream(); final PipedInputStream ins = new PipedInputStream() { @Override public void close() throws IOException { outs.close(); super.close(); } }; outs.connect(ins); mapper.disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET); PageToStreamThreadPool.getInstance().submit(() -> { try (Page<T> closeablePage = page; PipedOutputStream out = outs; SequenceWriter sequenceWriter = mapper.writer().writeValuesAsArray(out)) { for (T element : closeablePage) { sequenceWriter.write(element); sequenceWriter.flush(); } } catch (IOException e) { throw new IllegalStateException("Unable to convert page to input stream.", e); } }); return ins; }
Source:
<code>public void inspectRuntimeShape(final RuntimeShapeInspector inspector) { <START> inspector.visit("keyselector", keySelector); <END> inspector.visit("valueselectors", valueSelectors.toArray()); }</code><technical_language>lowercase, keys field names</technical_language>

Target:
public void inspectRuntimeShape(final RuntimeShapeInspector inspector) { inspector.visit("keySelector", keySelector); inspector.visit("valueSelectors", valueSelectors); }
Source:
<code>public void cleanShutdown() { log.info("CleanShutdown: Starting Cleanup."); shutdownServer = true; <START> activeServer.close(); replicationDiscoveryService.shutdown(); clusterManagerAdapter.shutdown(); <END> }</code><technical_language>Need check variables initialized avoid NPE</technical_language>

Target:
public void cleanShutdown() { log.info("CleanShutdown: Starting Cleanup."); shutdownServer = true; activeServer.close(); if (replicationDiscoveryService != null) { replicationDiscoveryService.shutdown(); } }
Source:
<code>public void testWithFilledArrays() { final KeySet keySetOriginal = new KeySet(); final byte[] authenticationKey = { 1, 64, 127 }; keySetOriginal.setAuthenticationKey(authenticationKey); final byte[] encryptionKey = { 127, 63, 0 }; keySetOriginal.setEncryptionKey(encryptionKey); <START> final com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet keySetMapped = this.mapperFactory <END> .getMapperFacade().map(keySetOriginal, com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet.class); assertNotNull(keySetMapped); assertEquals(1, keySetMapped.getAuthenticationKey()[0]); assertEquals(64, keySetMapped.getAuthenticationKey()[1]); assertEquals(127, keySetMapped.getAuthenticationKey()[2]); assertEquals(127, keySetMapped.getEncryptionKey()[0]); assertEquals(63, keySetMapped.getEncryptionKey()[1]); assertEquals(0, keySetMapped.getEncryptionKey()[2]); }</code><technical_language>original mapper here</technical_language>

Target:
public void testWithFilledArrays() { final KeySet keySetOriginal = new KeySet(); final byte[] authenticationKey = BYTE_ARRAY; keySetOriginal.setAuthenticationKey(authenticationKey); final byte[] encryptionKey = BYTE_ARRAY; keySetOriginal.setEncryptionKey(encryptionKey); final com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet keySetMapped = this.configurationMapper .map(keySetOriginal, com.alliander.osgp.domain.core.valueobjects.smartmetering.KeySet.class); assertNotNull(keySetMapped); this.checkMappingFilledArray(keySetMapped.getAuthenticationKey()); this.checkMappingFilledArray(keySetMapped.getEncryptionKey()); }
Source:
<code>protected void addPages() { try { List<AbstractAirdEditorCustomPage> newOrderedPages = pageRegistry.getPagesOrdered(this, session, pages.stream().filter(AbstractAirdEditorCustomPage.class::isInstance).map(AbstractAirdEditorCustomPage.class::cast).collect(Collectors.toList())); updatePages(newOrderedPages); } catch (PartInitException e) { <START> ErrorDialog.openError(getSite().getShell(), <END> MessageFormat.format(Messages.UI_SessionEditor_page_loading_error_message, new Object[0]), e.getMessage(), e.getStatus()); } }</code><technical_language>logged in addition, error details lost dialog is closed</technical_language>

Target:
protected void addPages() { updatePages(); }
Source:
<code>public Optional<OutputStream> tryCreateOutputStream() { try { <START> if (outputStreamSupplier == null) { <END> return Optional.empty(); } return Optional.ofNullable(outputStreamSupplier.apply(this)); } catch (Exception e) { throw handleErrorInCallback(e, "outputStreamSupplier"); } }</code><technical_language>I inverting this if check improve readability/flow consistent other methods in this class</technical_language>

Target:
public Optional<OutputStream> tryCreateOutputStream() { try { if (!canCreateOutputStream()) { return Optional.empty(); } return Optional.ofNullable(outputStreamSupplier.apply(this)); } catch (Exception e) { throw handleErrorInCallback(e, "outputStreamSupplier"); } }
Source:
<code>private void updateStoragePoolFormatType() { final StoragePool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (oldSpVersion.equals(spVersion)) { return; } <START> StorageType spType = storagePool.getStorageType(); <END> final StorageFormatType targetFormat = VersionStorageFormatUtil.getPreferredForVersion(spVersion, spType); storagePool.setStoragePoolFormatType(targetFormat); TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getStoragePoolDAO().updatePartial(storagePool); updateMemberDomainsFormat(targetFormat); return null; } }); if (_oldStoragePool.getStatus() == StoragePoolStatus.Up) { try { runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat)); } catch (VdcBLLException e) { log.warnFormat("Upgrade procees of Storage Pool {0} has encountered a problem due to following reason: {1}", spId, e.getMessage()); AuditLogDirector.log(this, AuditLogType.UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS); } } }</code><technical_language>this line replaced</technical_language>

Target:
private void updateStoragePoolFormatType() { final StoragePool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (oldSpVersion.equals(spVersion)) { return; } final StorageFormatType targetFormat = VersionStorageFormatUtil.getPreferredForVersion(spVersion, getMasterDomain() == null ? null : getMasterDomain().getStorageType()); storagePool.setStoragePoolFormatType(targetFormat); TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getStoragePoolDAO().updatePartial(storagePool); updateMemberDomainsFormat(targetFormat); return null; } }); if (_oldStoragePool.getStatus() == StoragePoolStatus.Up) { try { runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat)); } catch (VdcBLLException e) { log.warnFormat("Upgrade procees of Storage Pool {0} has encountered a problem due to following reason: {1}", spId, e.getMessage()); AuditLogDirector.log(this, AuditLogType.UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS); } } }
Source:
<code>public void verifyFirstResult(String query) { <START> verifyFirstResultName(query); <END> verifyDescription(); verifyUrl(query); }</code><technical_language>encapsulation</technical_language>

Target:
public void verifyFirstResult(String query) { Assertion.assertStringContains(firstResult.getText(), query.replaceAll("_", " ")); for (WebElement elem:descriptions) { Assertion.assertTrue(!elem.getText().isEmpty()); } Assertion.assertEquals(titles.size(), urls.size()); }
Source:
<code>public String getParams() { <START> return "cell c or object value, string projectName (optional), string columnName (optional)"; <END> }</code><technical_language>I change object for in doc. a value, (even literals values accepted!). Also, of object is misleading, pertinent confusing</technical_language>

Target:
public String getParams() { return "cell or value, string projectName (optional), string columnName (optional)"; }
Source:
<code>static final Predicate<IMatchEngine.Factory> isMatchEngineFactoryActivable(final IComparisonScope scope) { return new Predicate<IMatchEngine.Factory>() { <START> public boolean apply(IMatchEngine.Factory d) { <END> return d.isMatchEngineFactoryFor(scope); } }; }</code><technical_language>rename variable "d" "factory" "input"</technical_language>

Target:
private static Predicate<IMatchEngine.Factory> isMatchEngineFactoryActivable(final IComparisonScope scope) { return new Predicate<IMatchEngine.Factory>() { public boolean apply(IMatchEngine.Factory factory) { return factory.isMatchEngineFactoryFor(scope); } }; }
Source:
<code>private static List<ExceptionInfo> getThrowed(DetailAST methodAst) { final List<ExceptionInfo> returnValue = new ArrayList<>(); final DetailAST blockAst = methodAst.findFirstToken(TokenTypes.SLIST); if (blockAst != null) { final List<DetailAST> throwLiterals = findTokensInAstByType(blockAst, TokenTypes.LITERAL_THROW); for (DetailAST throwAst : throwLiterals) { if (!isInIgnoreBlock(blockAst, throwAst)) { final DetailAST newAst = throwAst.getFirstChild().getFirstChild(); if (newAst.getType() == TokenTypes.LITERAL_NEW) { DetailAST child = newAst.getFirstChild(); final FullIdent ident = FullIdent.createFullIdent(child); <START> while (child.getType() == TokenTypes.DOT) { child = child.getFirstChild(); } <END> final ExceptionInfo exceptionInfo = new ExceptionInfo(child, new ClassInfo(new Token(ident))); returnValue.add(exceptionInfo); } } } } return returnValue; }</code><technical_language>question above, purpose of this while</technical_language>

Target:
private static List<ExceptionInfo> getThrowed(DetailAST methodAst) { final List<ExceptionInfo> returnValue = new ArrayList<>(); final DetailAST blockAst = methodAst.findFirstToken(TokenTypes.SLIST); if (blockAst != null) { final List<DetailAST> throwLiterals = findTokensInAstByType(blockAst, TokenTypes.LITERAL_THROW); for (DetailAST throwAst : throwLiterals) { if (!isInIgnoreBlock(blockAst, throwAst)) { final DetailAST newAst = throwAst.getFirstChild().getFirstChild(); if (newAst.getType() == TokenTypes.LITERAL_NEW) { final DetailAST child = newAst.getFirstChild(); returnValue.add(getExceptionInfo(child)); } } } } return returnValue; }
Source:
<code>protected void parseTickerFromJsonObject(int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { String pairId = checkerInfo.getCurrencyPairId(); <START> String currencyCode = checkerInfo.getCurrencyCounterLowerCase() + "btc"; <END> final JSONObject tickerJsonObject = jsonObject.getJSONObject("data"); final JSONObject buyObject = tickerJsonObject.getJSONObject("compra"); final JSONObject sellObject = tickerJsonObject.getJSONObject("venta"); ticker.ask = buyObject.getDouble(currencyCode); ticker.bid = sellObject.getDouble(currencyCode); ticker.last = ticker.ask; }</code><technical_language>Please change this hardcoded "btc" checkerInfo.getCurrencyBaseLowerCase()</technical_language>

Target:
protected void parseTickerFromJsonObject(int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { String currencyCode = checkerInfo.getCurrencyCounterLowerCase() + checkerInfo.getCurrencyBaseLowerCase(); final JSONObject tickerJsonObject = jsonObject.getJSONObject("data"); final JSONObject buyObject = tickerJsonObject.getJSONObject("compra"); final JSONObject sellObject = tickerJsonObject.getJSONObject("venta"); ticker.ask = buyObject.getDouble(currencyCode); ticker.bid = sellObject.getDouble(currencyCode); ticker.last = ticker.ask; }
Source:
<code>public static final ByteSizeStrings java() { ByteSizeStrings strings = new ByteSizeStrings(); <START> strings.setBytesPerMetricUnit(1024); <END> strings.setPrecision(0); strings.setMaxLen(6); strings.setSuffixBytes(""); strings.setSuffixKilo("k"); strings.setSuffixMega("m"); strings.setSuffixGiga("g"); return strings; }</code><technical_language>nicer if this a fluent API - overload setters ByteSizeStrings bytesPerMetricUnit(int val)? deprecate setters</technical_language>

Target:
public static final ByteSizeStrings java() { return JAVA; }
Source:
<code>public HostLocation getHostLocation() { String dataCenter = "Unknown"; String rack = "Unknown"; String physicalHost = "Unknown"; try { Config config = ConfigFactory.parseFile(file); if (config.hasPath("dataCenter")) { dataCenter = config.getString("dataCenter"); } if (config.hasPath("rack")) { rack = config.getString("rack"); } if (config.hasPath("physicalHost")) { physicalHost = config.getString("physicalHost"); } } catch (Exception e) { <START> log.warn("error getting host location from {}: {}", file.getName(), e); <END> } return new HostLocation(dataCenter, rack, physicalHost); }</code><technical_language>errors a string interpolation in log methods, pass interpolation do right thing. explain in depth if needed</technical_language>

Target:
public HostLocation getHostLocation() { String dataCenter = "Unknown"; String rack = "Unknown"; String physicalHost = "Unknown"; try { Config config = ConfigFactory.parseFile(file); if (config.hasPath("dataCenter")) { dataCenter = config.getString("dataCenter"); } if (config.hasPath("rack")) { rack = config.getString("rack"); } if (config.hasPath("physicalHost")) { physicalHost = config.getString("physicalHost"); } } catch (Exception e) { log.warn("error getting host location from {}: ", file.getName(), e); } return new HostLocation(dataCenter, rack, physicalHost); }
Source:
<code>public boolean doTruncate(StorageBroker sb, TileBreeder breeder) throws StorageException, GeoWebCacheException { Iterator<TileLayer> iterator = breeder.getLayers().iterator(); TileLayer toTruncate; boolean truncated = false; while (iterator.hasNext()) { toTruncate = iterator.next(); truncated = sb.delete(toTruncate.getName()); if (!truncated) { try { breeder.findTileLayer(toTruncate.getName()); } catch (GeoWebCacheException e) { <START> throw new IllegalArgumentException( <END> "Could not find layer " + toTruncate.getName()); } } else { log.info("Truncate All Job: Finished deleting layer " + toTruncate.getName()); if (getTrucatedLayers().length() > 0) getTrucatedLayers().append(","); getTrucatedLayers().append(toTruncate.getName()); } } return true; }</code><technical_language>user layer name, asked for a "clean all", reason throw exception, log a warning move instead</technical_language>

Target:
public boolean doTruncate(StorageBroker sb, TileBreeder breeder) throws StorageException, GeoWebCacheException { Iterator<TileLayer> iterator = breeder.getLayers().iterator(); TileLayer toTruncate; Iterator<String> gridSetIterator; String gridSetId = ""; boolean truncated = false; while (iterator.hasNext()) { toTruncate = iterator.next(); gridSetIterator = toTruncate.getGridSubsets().iterator(); while (gridSetIterator.hasNext()) { gridSetId = gridSetIterator.next(); truncated = sb.deleteByGridSetId(toTruncate.getName(), gridSetId); log.info("Layer: " + toTruncate.getName() + ",Truncated Gridset :" + gridSetId); } if (truncated) { if (getTrucatedLayers().length() > 0) trucatedLayers.append(","); getTrucatedLayers().append(toTruncate.getName()); } } return true; }
Source:
<code>private boolean initializeOpenVRLibrary() throws Exception { if (initialized) return true; <START> System.out.println("Adding OpenVR search path: " + OSValidator.getLibPath()); <END> NativeLibrary.addSearchPath("openvr_api", OSValidator.getLibPath()); if (jopenvr.JOpenVRLibrary.VR_IsHmdPresent() == 1) { System.out.println("VR Headset detected."); } else { System.out.println("VR Headset not detected."); return false; } return true; }</code><technical_language>want convert logger style, if :-)</technical_language>

Target:
private boolean initializeOpenVRLibrary() { if (initialized) { return true; } logger.info("Adding OpenVR search path: " + NativeHelper.getOpenVRLibPath()); NativeLibrary.addSearchPath("openvr_api", NativeHelper.getOpenVRLibPath()); if (jopenvr.JOpenVRLibrary.VR_IsHmdPresent() != 1) { logger.info("VR Headset not detected."); return false; } logger.info("VR Headset detected."); return true; }
Source:
<code>public ChainBuilder add(final ByteBuffer payload) { List<Element> newList = new ArrayList<Element>(); newList.addAll(this.elements); <START> newList.add(new Element() { <END> @Override public ByteBuffer getPayload() { return payload.duplicate(); } }); return new ChainBuilder(newList); }</code><technical_language>copying rebuilding list everytime element is added chain? chains long adverse impact of this now. long chains build this inefficient. in future refactorings</technical_language>

Target:
public ChainBuilder add(final ByteBuffer payload) { List<ByteBuffer> newList = new ArrayList<ByteBuffer>(); newList.addAll(this.buffers); newList.add(payload); return new ChainBuilder(newList); }
Source:
<code><START> protected boolean updateGalleryElements(Controller controller, <END> final Array<SceneButton> elements, final Vector2 viewport, final I18N i18n, final Skin skin) { if (this.needsUpdate) { this.needsUpdate = false; elements.clear(); Map<String, Scene> map = controller.getModel().getScenes(); for (Entry<String, Scene> entry : map.entrySet()) { final SceneButton sceneWidget = new SceneButton(viewport, i18n, entry.getValue(), skin); sceneWidget.setUserObject(entry.getKey()); elements.add(sceneWidget); } return true; } return false; }</code><technical_language>OK then, a big deal. ahead</technical_language>

Target:
protected boolean updateGalleryElements(Controller controller, final Array<SceneButton> elements, final Vector2 viewport, final I18N i18n, final Skin skin) { if (this.needsUpdate) { this.needsUpdate = false; elements.clear(); Map<String, Scene> map = controller.getModel().getScenes(); for (Entry<String, Scene> entry : map.entrySet()) { final SceneButton sceneWidget = new SceneButton(viewport, i18n, entry.getKey(), entry.getValue(), skin); elements.add(sceneWidget); } return true; } return false; }
Source:
<code>private static Predicate<ViolationEntity> applicationIdIsEqual(String applicationId) { <START> return v -> applicationId.equals(v.getApplication().getName()); <END> }</code><technical_language>NullPointerException: violations application. Optionals java return v -> applicationId.equals(Optional.ofNullable(v.getApplication()).map(ApplicationEntity::getName).orElse(null));</technical_language>

Target:
private static Predicate<ViolationEntity> applicationIdIsEqual(String applicationId) { return v -> applicationId.equals( Optional.ofNullable( v.getApplication()). map(ApplicationEntity::getName). orElse(null)); }
Source:
<code>public static SequencerReference to(SequencerDto dto) { SequencerReference to = new SequencerReferenceImpl(); to.setId(dto.getId()); to.setDateCommissioned(extractDateOrNull(dto.getDateCommissioned())); to.setDateDecommissioned(extractDateOrNull(dto.getDateDecommissioned())); to.setIpAddress(dto.getIp()); to.setName(dto.getName()); to.setSerialNumber(dto.getSerialNumber()); <START> to.setPlatform(to(dto.getPlatform())); <END> to.setSerialNumber(dto.getSerialNumber()); return to; }</code><technical_language>set</technical_language>

Target:
public static SequencerReference to(SequencerDto dto) { SequencerReference to = new SequencerReferenceImpl(); to.setId(dto.getId()); to.setDateCommissioned(extractDateOrNull(dto.getDateCommissioned())); to.setDateDecommissioned(extractDateOrNull(dto.getDateDecommissioned())); to.setIpAddress(dto.getIp()); to.setName(dto.getName()); to.setPlatform(to(dto.getPlatform())); to.setSerialNumber(dto.getSerialNumber()); return to; }
Source:
<code><START> public void testEventMessageToJobData( <END> Serializer serializer, Function<Class, String> expectedSerializedClassType, Predicate<Object> revisionMatcher ) { QuartzEventScheduler.DirectEventJobDataBinder testSubject = new QuartzEventScheduler.DirectEventJobDataBinder(serializer); JobDataMap result = testSubject.toJobData(testEventMessage); assertEquals(testEventMessage.getIdentifier(), result.get(MESSAGE_ID)); assertEquals(testEventMessage.getTimestamp().toEpochMilli(), result.get(MESSAGE_TIMESTAMP)); String expectedPayloadType = expectedSerializedClassType.apply(testEventMessage.getPayloadType()); assertEquals(expectedPayloadType, result.get(MESSAGE_TYPE)); Object resultRevision = result.get(MESSAGE_REVISION); assertTrue(revisionMatcher.test(resultRevision)); assertNotNull(result.get(SERIALIZED_MESSAGE_PAYLOAD)); assertNotNull(result.get(MESSAGE_METADATA)); verify(serializer).serialize(TEST_EVENT_PAYLOAD, byte[].class); verify(serializer).serialize(testMetaData, byte[].class); }</code><technical_language>Curious: Do ParameterizedTests need public methods JUnit 5</technical_language>

Target:
void testEventMessageToJobData( Serializer serializer, Function<Class, String> expectedSerializedClassType, Predicate<Object> revisionMatcher ) { QuartzEventScheduler.DirectEventJobDataBinder testSubject = new QuartzEventScheduler.DirectEventJobDataBinder(serializer); JobDataMap result = testSubject.toJobData(testEventMessage); assertEquals(testEventMessage.getIdentifier(), result.get(MESSAGE_ID)); assertEquals(testEventMessage.getTimestamp().toEpochMilli(), result.get(MESSAGE_TIMESTAMP)); String expectedPayloadType = expectedSerializedClassType.apply(testEventMessage.getPayloadType()); assertEquals(expectedPayloadType, result.get(MESSAGE_TYPE)); Object resultRevision = result.get(MESSAGE_REVISION); assertTrue(revisionMatcher.test(resultRevision)); assertNotNull(result.get(SERIALIZED_MESSAGE_PAYLOAD)); assertNotNull(result.get(MESSAGE_METADATA)); verify(serializer).serialize(TEST_EVENT_PAYLOAD, byte[].class); verify(serializer).serialize(testMetaData, byte[].class); }
Source:
<code>public PartialTableCache() { cache = new ConcurrentHashMap<>(); epochEntries = new TreeSet<>(); <START> executorService = Executors.newSingleThreadExecutor(); <END> }</code><technical_language>ThreadFactory give executor thread a descriptive name</technical_language>

Target:
public PartialTableCache() { cache = new ConcurrentHashMap<>(); epochEntries = new TreeSet<>(); ThreadFactory build = new ThreadFactoryBuilder().setDaemon(true) .setNameFormat("PartialTableCache Cleanup Thread - %d").build(); executorService = Executors.newSingleThreadExecutor(build); }
Source:
<code>public void onRefresh() { super.onRefresh(); if (mFile != null) { mFile = mContainerActivity.getStorageManager().getFileById(mFile.getFileId()); listDirectory(mFile); ((FileDisplayActivity)mContainerActivity).startSyncFolderOperation(mFile); <START> Log_OC.d(TAG, "Parent etag= |" + mFile.getEtag() + "|"); <END> } }</code><technical_language>Remove this Log, please</technical_language>

Target:
public void onRefresh() { super.onRefresh(); if (mFile != null) { mFile = mContainerActivity.getStorageManager().getFileById(mFile.getFileId()); listDirectory(mFile); ((FileDisplayActivity)mContainerActivity).startSyncFolderOperation(mFile); } }
Source:
<code>public void bindTo(MeterRegistry registry) { startingCounter = Counter.builder(workspaceMetric("starting_attempts.total")) .description("The count of workspaces start attempts") .register(registry); startingDebugCounter = Counter.builder(workspaceMetric("starting_attempts.total")) .tags(withStandardTags("debug")) .description("The count of workspaces start attempts in debug mode") .register(registry); eventService.subscribe( event -> { if (event.getPrevStatus() == WorkspaceStatus.STOPPED && event.getStatus() == WorkspaceStatus.STARTING) { <START> startingCounter.increment(); <END> if (event.getOptions() != null && event.getOptions() .containsKey(DEBUG_WORKSPACE_START)) { startingDebugCounter.increment(); } } }, WorkspaceStatusEvent.class); }</code><technical_language>increment of counters. total is produced prometheus automagically. basically, have: starting_attempts.total#debug=false starting_attempts.total#debug=true increment of here. untagged counter all</technical_language>

Target:
public void bindTo(MeterRegistry registry) { startingCounter = Counter.builder(workspaceMetric("starting_attempts.total")) .tags(withStandardTags("debug", "false")) .description("The count of workspaces start attempts") .register(registry); startingDebugCounter = Counter.builder(workspaceMetric("starting_attempts.total")) .tags(withStandardTags("debug", "true")) .description("The count of workspaces start attempts in debug mode") .register(registry); eventService.subscribe( event -> { if (event.getPrevStatus() == WorkspaceStatus.STOPPED && event.getStatus() == WorkspaceStatus.STARTING) { if (event.getOptions() != null && Boolean.parseBoolean( event.getOptions().getOrDefault(DEBUG_WORKSPACE_START, FALSE.toString()))) { startingDebugCounter.increment(); } else { startingCounter.increment(); } } }, WorkspaceStatusEvent.class); }
Source:
<code>private void loadPluginSections(Config rc) { pluginConfigs = Maps.newHashMap(); Set<String> pluginSubsections = rc.getSubsections(PLUGIN); <START> for (String plugin : pluginSubsections) { <END> LinkedListMultimap<String, String> pluginConfig = LinkedListMultimap.create(); pluginConfigs.put(plugin, pluginConfig); for (String name : rc.getNames(PLUGIN, plugin)) { pluginConfig.putAll(name, Arrays.asList(rc.getStringList(PLUGIN, plugin, name))); } } }</code><technical_language>pluginsSubsections inlined</technical_language>

Target:
private void loadPluginSections(Config rc) { pluginConfigs = Maps.newHashMap(); for (String plugin : rc.getSubsections(PLUGIN)) { LinkedListMultimap<String, String> pluginConfig = LinkedListMultimap.create(); pluginConfigs.put(plugin, pluginConfig); for (String name : rc.getNames(PLUGIN, plugin)) { pluginConfig.putAll(name, Arrays.asList(rc.getStringList(PLUGIN, plugin, name))); } } }
Source:
<code>public void buildProjNoCmdLineArgumentsTest() { FreeStyleJob job = msBuildJob("/msbuild_plugin/projProject/", "project.proj", null); Build b = job.scheduleBuild(); b.shouldSucceed(); <START> assertThat(b.getConsole(), Matchers.containsString("Build succeeded.")); <END> assertThat(b.getConsole(), Matchers.not(Matchers.containsString("Done building project \"project.proj\"."))); }</code><technical_language>build.shouldSucceed();</technical_language>

Target:
public void buildProjNoCmdLineArgumentsTest() { FreeStyleJob job = msBuildJob("/msbuild_plugin/projProject/", "project.proj", null); Build b = job.scheduleBuild(); b.shouldSucceed(); assertThat(b.getConsole(), containsString("Build succeeded.")); assertThat(b.getConsole(), not(containsString("Done building project \"project.proj\"."))); }
Source:
<code>public void publish(Object message, Map<String, String> dynamicProperties) { try { if (session == null) { throw new ConnectionUnavailableException("Connection was not available when trying to publish a message via the adapter: " + eventAdapterConfiguration.getName() + ", for tenant ID: " + tenantId <START> + " as the session was null. \n Message: \n" + message); <END> } else if (!session.isOpen()) { throw new ConnectionUnavailableException("Connection was not available when trying to publish a message via the adapter: " + eventAdapterConfiguration.getName() + ", for tenant ID: " + tenantId + " as the session was not open. Session ID:" + session.getId() + " \n Message: \n" + message); } else { executorService.execute(new WebSocketSender(message.toString())); } } catch (RejectedExecutionException e) { EventAdapterUtil.logAndDrop(eventAdapterConfiguration.getName(), message, "Job queue is full", e, log, tenantId); } }</code><technical_language>@dilini-muthumala Dilini, error message a bit shorter a bit more explanatory for user? provide failing event adapter/publisher name tenant id + message. is throwing a 'ConnectionUnavailableException', including complete sentence a bit redundant log lines grow IMHO. Also, I more explanatory user if log 'no session is available' instead of session is 'null'. Additionally, term 'event' CEP adapters, I term 'Event' instead of 'Message' for consistency. WDYT</technical_language>

Target:
public void publish(Object message, Map<String, String> dynamicProperties) { try { if (session == null) { throw new ConnectionUnavailableException("Session was not available when trying to publish via adapter: " + eventAdapterConfiguration.getName() + ", tenant ID: " + tenantId + "\n Event: \n" + message); } else if (!session.isOpen()) { throw new ConnectionUnavailableException("Session was not open when trying to publish via adapter: " + eventAdapterConfiguration.getName() + ", for tenant ID: " + tenantId + ". Session ID: " + session.getId() + " \n Event: \n" + message); } else { executorService.execute(new WebSocketSender(message.toString())); } } catch (RejectedExecutionException e) { EventAdapterUtil.logAndDrop(eventAdapterConfiguration.getName(), message, "Job queue is full", e, log, tenantId); } }
Source:
<code>public Container apply(HttpResponse from) { String bytesUsed = from.getFirstHeaderOrNull(CONTAINER_BYTES_USED); <START> String objectCount = from.getFirstHeaderOrNull(CONTAINER_OBJECT_COUNT); <END> Container c = Container.builder() .name(name) .bytesUsed(bytesUsed==null?0:Long.parseLong(bytesUsed)) .objectCount(objectCount==null?0:Long.parseLong(objectCount)) .anybodyRead(CONTAINER_ACL_ANYBODY_READ.equals(from.getFirstHeaderOrNull(CONTAINER_READ))) .metadata(EntriesWithoutMetaPrefix.INSTANCE.apply(from.getHeaders())).build(); return c; }</code><technical_language>[minor] formatting</technical_language>

Target:
public Container apply(HttpResponse from) { String bytesUsed = from.getFirstHeaderOrNull(CONTAINER_BYTES_USED); String objectCount = from.getFirstHeaderOrNull(CONTAINER_OBJECT_COUNT); Container c = Container.builder() .name(name) .bytesUsed(bytesUsed != null ? Long.valueOf(bytesUsed) : null) .objectCount(objectCount != null ? Long.valueOf(objectCount) : null) .anybodyRead(CONTAINER_ACL_ANYBODY_READ.equals(from.getFirstHeaderOrNull(CONTAINER_READ))) .metadata(EntriesWithoutMetaPrefix.INSTANCE.apply(from.getHeaders())).build(); return c; }
Source:
<code>public static int getSkyBlendColour(World world, BlockPos center) { if (center.getX() == skyX && center.getZ() == skyZ && skyInit) { return skyRGBMultiplier; } skyInit = true; GameSettings settings = Minecraft.getMinecraft().gameSettings; int[] ranges = ForgeModContainer.blendRanges; int distance = 0; if (settings.fancyGraphics && settings.renderDistanceChunks >= 0 && settings.renderDistanceChunks < ranges.length) { distance = ranges[settings.renderDistanceChunks]; } int r = 0; int g = 0; int b = 0; int divider = 0; for (int x = -distance; x <= distance; ++x) { for (int z = -distance; z <= distance; ++z) { BlockPos pos = center.add(x, 0, z); <START> Biome biome = world.getBiome(pos); <END> int colour = biome.getSkyColorByTemp(biome.getFloatTemperature(pos)); r += (colour & 0xFF0000) >> 16; g += (colour & 0x00FF00) >> 8; b += colour & 0x0000FF; divider++; } } int multiplier = (r / divider & 255) << 16 | (g / divider & 255) << 8 | b / divider & 255; skyX = center.getX(); skyZ = center.getY(); skyRGBMultiplier = multiplier; return skyRGBMultiplier; }</code><technical_language>This change unrelated fluids? belongs a separate PR ;P</technical_language>

Target:
public static int getSkyBlendColour(World world, BlockPos center) { if (center.getX() == skyX && center.getZ() == skyZ && skyInit) { return skyRGBMultiplier; } skyInit = true; GameSettings settings = Minecraft.getMinecraft().gameSettings; int[] ranges = ForgeModContainer.blendRanges; int distance = 0; if (settings.fancyGraphics && settings.renderDistanceChunks >= 0 && settings.renderDistanceChunks < ranges.length) { distance = ranges[settings.renderDistanceChunks]; } int r = 0; int g = 0; int b = 0; int divider = 0; for (int x = -distance; x <= distance; ++x) { for (int z = -distance; z <= distance; ++z) { BlockPos pos = center.add(x, 0, z); Biome biome = world.getBiomeGenForCoords(pos); int colour = biome.getSkyColorByTemp(biome.getFloatTemperature(pos)); r += (colour & 0xFF0000) >> 16; g += (colour & 0x00FF00) >> 8; b += colour & 0x0000FF; divider++; } } int multiplier = (r / divider & 255) << 16 | (g / divider & 255) << 8 | b / divider & 255; skyX = center.getX(); skyZ = center.getY(); skyRGBMultiplier = multiplier; return skyRGBMultiplier; }
Source:
<code><START> public boolean completed() { <END> return produceFuture.completed(); }</code><technical_language>This function is in unit test, expose</technical_language>

Target:
boolean completed() { return produceFuture.completed(); }
Source:
<code>private TranslationResult buildTranslationResult(List<TermConceptMapGroupElementTarget> theTargets) { TranslationResult retVal = new TranslationResult(); if (theTargets.isEmpty()) { retVal.setResult(new BooleanType(false)); <START> retVal.setMessage(new StringType("No matches found!")); <END> } else { retVal.setResult(new BooleanType(true)); retVal.setMessage(new StringType("Matches found!")); TranslationMatch translationMatch; Set<TermConceptMapGroupElementTarget> targetsToReturn = new HashSet<>(); for (TermConceptMapGroupElementTarget target : theTargets) { if (targetsToReturn.add(target)) { translationMatch = new TranslationMatch(); translationMatch.setEquivalence(new CodeType(target.getEquivalence().toCode())); translationMatch.setConcept( new Coding() .setCode(target.getCode()) .setSystem(target.getSystem()) .setVersion(target.getSystemVersion()) .setDisplay(target.getDisplay()) .setUserSelected(false) ); translationMatch.setSource(new UriType(target.getConceptMapUrl())); retVal.addMatch(translationMatch); } } } return retVal; }</code><technical_language>This externalized</technical_language>

Target:
private TranslationResult buildTranslationResult(List<TermConceptMapGroupElementTarget> theTargets) { TranslationResult retVal = new TranslationResult(); String msg; if (theTargets.isEmpty()) { retVal.setResult(new BooleanType(false)); msg = getContext().getLocalizer().getMessage( FhirResourceDaoConceptMapDstu3.class, "noMatchesFound"); retVal.setMessage(new StringType(msg)); } else { retVal.setResult(new BooleanType(true)); msg = getContext().getLocalizer().getMessage( FhirResourceDaoConceptMapDstu3.class, "matchesFound"); retVal.setMessage(new StringType(msg)); TranslationMatch translationMatch; Set<TermConceptMapGroupElementTarget> targetsToReturn = new HashSet<>(); for (TermConceptMapGroupElementTarget target : theTargets) { if (targetsToReturn.add(target)) { translationMatch = new TranslationMatch(); translationMatch.setEquivalence(new CodeType(target.getEquivalence().toCode())); translationMatch.setConcept( new Coding() .setCode(target.getCode()) .setSystem(target.getSystem()) .setVersion(target.getSystemVersion()) .setDisplay(target.getDisplay()) ); translationMatch.setSource(new UriType(target.getConceptMapUrl())); retVal.addMatch(translationMatch); } } } return retVal; }
Source:
<code>private void runJob(long transactionId, boolean tableSupportsDeltaDelete, OptionalInt bucketNumber, long tableId, Map<UUID, Optional<UUID>> shardUuidsMap) throws IOException { log.info("Start compacting shards %s for table: %s", shardUuidsMap, tableId); TableMetadata metadata = getTableMetadata(tableId); List<ShardInfo> newShards = performCompaction(transactionId, tableSupportsDeltaDelete, bucketNumber, shardUuidsMap, metadata); log.info("Compacted shards %s into %s for table: %s", shardUuidsMap, newShards.stream().map(ShardInfo::getShardUuid).collect(toList()), tableId); if (tableSupportsDeltaDelete) { <START> shardManager.replaceShardUuids(transactionId, tableId, metadata.getColumns(), shardUuidsMap, newShards, OptionalLong.empty(), tableSupportsDeltaDelete); <END> } else { shardManager.replaceShardUuids(transactionId, tableId, metadata.getColumns(), shardUuidsMap.keySet(), newShards, OptionalLong.empty()); } }</code><technical_language>nit: rename delta version of replaceShardUuids() another name. IntelliJ is complaining tableSupportsDeltaDelete is true passing this function</technical_language>

Target:
private void runJob(long transactionId, boolean tableSupportsDeltaDelete, OptionalInt bucketNumber, long tableId, Map<UUID, Optional<UUID>> shardUuidsMap) throws IOException { TableMetadata metadata = getTableMetadata(tableId); List<ShardInfo> newShards = performCompaction(transactionId, tableSupportsDeltaDelete, bucketNumber, shardUuidsMap, metadata); log.info("Compacted shards %s into %s for table: %s", shardUuidsMap, newShards.stream().map(ShardInfo::getShardUuid).collect(toList()), tableId); if (tableSupportsDeltaDelete) { shardManager.replaceShardUuids(transactionId, tableId, metadata.getColumns(), shardUuidsMap, newShards, OptionalLong.empty(), true); } else { shardManager.replaceShardUuids(transactionId, tableId, metadata.getColumns(), shardUuidsMap.keySet(), newShards, OptionalLong.empty()); } }