auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void migrationRequired_throwsExceptionInTheMigrationBlock() { final RuntimeException exception = new RuntimeException("TEST"); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { throw exception; } }; RealmConfiguration config = configFactory.createConfigurationBuilder() .migration(migration) .schemaVersion(1) .assetFile("default0.realm") .build(); Realm realm = null; try { realm = Realm.getInstance(config); fail(); } catch (RuntimeException expected) { <START> assertEquals(exception, expected); <END> } finally { if (realm != null) { realm.close(); } } }</code><technical_language>I assertSame is assertEquals</technical_language>

Target:
public void migrationRequired_throwsExceptionInTheMigrationBlock() { final RuntimeException exception = new RuntimeException("TEST"); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { RealmObjectSchema objectSchema = realm.getSchema().create(StringOnly.CLASS_NAME); objectSchema.addField(StringOnly.FIELD_CHARS, String.class); throw exception; } }; RealmConfiguration config = configFactory.createConfigurationBuilder() .migration(migration) .schemaVersion(1) .schema(StringOnly.class) .build(); createEmptyRealmVersion0(config); Realm realm = null; try { realm = Realm.getInstance(config); fail(); } catch (RuntimeException expected) { assertSame(exception, expected); } finally { if (realm != null) { realm.close(); } } DynamicRealm dynamicRealm = DynamicRealm.getInstance(config); try { assertEquals(0, dynamicRealm.getVersion()); assertNull(dynamicRealm.getSchema().get(StringOnly.CLASS_NAME)); } finally { dynamicRealm.close(); } }
Source:
<code>public SegmentRelocator(PinotHelixResourceManager pinotHelixResourceManager, LeadControllerManager leadControllerManager, ControllerConf config, ControllerMetrics controllerMetrics, ExecutorService executorService) { <START> super(SegmentRelocator.class.getSimpleName(), 60, 30, pinotHelixResourceManager, leadControllerManager, <END> controllerMetrics); _executorService = executorService; }</code><technical_language>**CRITICAL** suggestion super(SegmentRelocator.class.getSimpleName(), config.getSegmentRelocatorFrequencyInSeconds(), config.getSegmentRelocatorInitialDelayInSeconds(), pinotHelixResourceManager, leadControllerManager, controllerMetrics);</technical_language>

Target:
public SegmentRelocator(PinotHelixResourceManager pinotHelixResourceManager, LeadControllerManager leadControllerManager, ControllerConf config, ControllerMetrics controllerMetrics, ExecutorService executorService) { super(SegmentRelocator.class.getSimpleName(), config.getSegmentRelocatorFrequencyInSeconds(), config.getSegmentRelocatorInitialDelayInSeconds(), pinotHelixResourceManager, leadControllerManager, controllerMetrics); _executorService = executorService; }
Source:
<code>public <T> List<T> getParentsOfType(Class<T> parentType) { List<T> parents = new ArrayList<>(); Node parentNode = jjtGetParent(); while (parentNode != null) { <START> if (parentType.isInstance(parentNode.getClass())) { <END> parents.add((T) parentNode); } parentNode = parentNode.jjtGetParent(); } return parents; }</code><technical_language>This is for unit test failures (wouldn't otherwise): parentType.isInstance(parentNode) (without getClass()) - parent nodes matched (since class is a class...)</technical_language>

Target:
public <T> List<T> getParentsOfType(Class<T> parentType) { List<T> parents = new ArrayList<>(); Node parentNode = jjtGetParent(); while (parentNode != null) { if (parentType.isInstance(parentNode)) { parents.add((T) parentNode); } parentNode = parentNode.jjtGetParent(); } return parents; }
Source:
<code>protected String fieldsToString() { return "topic='" + mTopic + '\'' + ", kafkaPartition=" + mKafkaPartition + ", offset=" + mOffset + ", kafkaKey=" + new String(mKafkaKey) + ", payload=" + new String(mPayload) + <START> ", mTimestamp=" + mTimestamp; <END> }</code><technical_language>I need 'mTimestamp' in printout, other internal variables (payload, kafkaKey) do either</technical_language>

Target:
protected String fieldsToString() { return "topic='" + mTopic + '\'' + ", kafkaPartition=" + mKafkaPartition + ", offset=" + mOffset + ", kafkaKey=" + new String(mKafkaKey) + ", payload=" + new String(mPayload) + ", timestamp=" + mTimestamp; }
Source:
<code>private void updateSavePageMenuItem(MenuItem menuItemSavePage) { if (refreshedIfSaved && isPageSaved(getTitle())) { menuItemSavePage.setEnabled(false); menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_page_saved)); <START> return; <END> } else if (isPageSaved(getTitle())) { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_refresh_saved_page)); return; } menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(WikipediaApp.getInstance().getString(R.string.menu_save_page)); }</code><technical_language>this is a small method, do of dropping returns adding else lines</technical_language>

Target:
private void updateSavePageMenuItem(MenuItem menuItemSavePage) { if (refreshedIfSaved) { menuItemSavePage.setEnabled(false); menuItemSavePage.setTitle(getString(R.string.menu_page_saved)); } else if (isPageSaved) { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(getString(R.string.menu_refresh_saved_page)); } else { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(getString(R.string.menu_page_save)); } }
Source:
<code>int countMetadata(String partitionPath, SqlQuerySpec querySpec, Timer timer) throws DocumentClientException { FeedOptions feedOptions = new FeedOptions(); feedOptions.setPartitionKey(new PartitionKey(partitionPath)); try { FeedResponse<Document> response = executeCosmosQuery(querySpec, feedOptions, timer).single(); <START> return ((Number) response.getResults().get(0).getHashMap().values().stream().findFirst().get()).intValue(); <END> } catch (RuntimeException rex) { if (rex.getCause() instanceof DocumentClientException) { throw (DocumentClientException) rex.getCause(); } throw rex; } }</code><technical_language>is format of results here? Instead of findFirst get relevant entry key</technical_language>

Target:
int countMetadata(String partitionPath, SqlQuerySpec querySpec, Timer timer) throws DocumentClientException { FeedOptions feedOptions = new FeedOptions(); feedOptions.setPartitionKey(new PartitionKey(partitionPath)); try { FeedResponse<Document> response = executeCosmosQuery(querySpec, feedOptions, timer).single(); return response.getResults().get(0).getLong(Constants.Properties.AGGREGATE).intValue(); } catch (RuntimeException rex) { if (rex.getCause() instanceof DocumentClientException) { throw (DocumentClientException) rex.getCause(); } throw rex; } }
Source:
<code>public GenericRow extract(GenericRecord from, GenericRow to) { <START> if (_fields == null || _fields.isEmpty()) { END> Map<String, Object> jsonMap = JsonUtils.genericRecordToJson(from); jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, RecordReaderUtils.convert(value))); } else { for (String fieldName : _fields) { Object value = from.get(fieldName); Object convertedValue = AvroUtils.convert(value); to.putValue(fieldName, convertedValue); } } return to; }</code><technical_language>this in init, set a final boolean _extractAll? jvm able optimize it</technical_language>

Target:
public GenericRow extract(GenericRecord from, GenericRow to) { if (_extractAll) { Map<String, Object> jsonMap = JsonUtils.genericRecordToJson(from); jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, RecordReaderUtils.convert(value))); } else { for (String fieldName : _fields) { Object value = from.get(fieldName); Object convertedValue = AvroUtils.convert(value); to.putValue(fieldName, convertedValue); } } return to; }
Source:
<code>private String setupState(Response response) { String sessionId = UUID.randomUUID().toString(); byte[] secret = new byte[20]; random.nextBytes(secret); <START> String state = java.util.Base64.getEncoder().encodeToString(secret); <END> CookieSetting cs = new CookieSetting("_state", sessionId); response.getCookieSettings().add(cs); getContext().getAttributes().put(sessionId, state); return state; }</code><technical_language>fully qualified class name</technical_language>

Target:
private String setupState(Response response) { String sessionId = UUID.randomUUID().toString(); byte[] secret = new byte[20]; random.nextBytes(secret); String state = Base64.getEncoder().encodeToString(secret); CookieSetting cs = new CookieSetting("_state", sessionId); response.getCookieSettings().add(cs); getContext().getAttributes().put(sessionId, state); return state; }
Source:
<code>private <T> List<GenericRecord> testGenericDatumRead(String testType, byte[] bytes, T... entityObjs) throws IOException { GenericDatumReader<GenericRecord> datumReader = new GenericDatumReader<>(); SeekableByteArrayInput avroInputStream = new SeekableByteArrayInput(bytes); DataFileReader<GenericRecord> fileReader = new DataFileReader<>(avroInputStream, datumReader); Schema schema = fileReader.getSchema(); assertNotNull("Unable to get schema for " + testType, schema); GenericRecord record = null; List<GenericRecord> records = new ArrayList<>(); while (fileReader.hasNext()) { try { records.add(fileReader.next(record)); } catch (Exception e) { fail("Fail with schema: " + schema); } } <START> fileReader.close(); <END> return records; }</code><technical_language>a try-with-resource pattern here</technical_language>

Target:
private <T> List<GenericRecord> testGenericDatumRead(String testType, byte[] bytes, T... entityObjs) throws IOException { GenericDatumReader<GenericRecord> datumReader = new GenericDatumReader<>(); SeekableByteArrayInput avroInputStream = new SeekableByteArrayInput(bytes); List<GenericRecord> records = new ArrayList<>(); try (DataFileReader<GenericRecord> fileReader = new DataFileReader<>(avroInputStream, datumReader)) { Schema schema = fileReader.getSchema(); assertNotNull("Unable to get schema for " + testType, schema); GenericRecord record = null; while (fileReader.hasNext()) { try { records.add(fileReader.next(record)); } catch (Exception e) { fail("Fail with schema: " + schema); } } } return records; }
Source:
<code>public SetTemperatureMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType+" Payload Len -> "+this.payload.length); if (this.payload.length == SET_TEMPERATURE_PAYLOAD_LEN) { desiredTemperature = (this.payload[0] & 0x3f) / 2.0; ctrlMode = ThermostatControlMode.values()[(this.payload[0]>>6)]; } <START> else logger.error("Got "+this.msgType+" message with incorrect length!"); <END> }</code><technical_language>please add curly braces</technical_language>

Target:
public SetTemperatureMsg(String rawMsg) { super(rawMsg); logger.debug(this.msgType + " Payload Len -> " + this.payload.length); if (this.payload.length == SET_TEMPERATURE_PAYLOAD_LEN) { desiredTemperature = (this.payload[0] & 0x3f) / 2.0; ctrlMode = ThermostatControlMode.values()[(this.payload[0] >> 6)]; } else { logger.error("Got " + this.msgType + " message with incorrect length!"); } }
Source:
<code><START> void handleBody(InputStream payload) <END> throws IOException, MessageFormatException { if (blobInfo == null) { blobInfo = new BlobInfo(MessageFormatRecord.deserializeBlobProperties(payload), MessageFormatRecord.deserializeUserMetadata(payload).array()); } else { } }</code><technical_language>placements of this method here, called</technical_language>

Target:
private void handleBody(InputStream payload) throws IOException, MessageFormatException { if (operationResult == null) { operationResult = new BlobInfo(MessageFormatRecord.deserializeBlobProperties(payload), MessageFormatRecord.deserializeUserMetadata(payload).array()); } else { } }
Source:
<code>private void verifyLowerCamelCase(String constructType, ParserRuleContext ctx) { <START> verifyLowerCamelCase(constructType, ctx, false); <END> }</code><technical_language>escape function enum names</technical_language>

Target:
private void verifyLowerCamelCase(String constructType, ParserRuleContext ctx) { String constructName = CharFormatUtil.unescapeIdentifier(ctx.getText()); if (!CharFormatUtil.isLowerCamelCaseOrAcronym(constructName)) { Location location = ListenerUtil.getIdentifierStartLocation(ctx); this.printer.error(Rules.LOWER_CAMEL_CASE, constructType + Messages.LOWER_CAMEL_CASE, location); } }
Source:
<code>private boolean addImageTicketToProxy(Guid imagedTicketId, String hostUri) { String <START> imagePath = <END> String.format( "%s%s/%s", hostUri, IMAGES_PATH, imagedTicketId); ImageTicket imageTicket = buildImageTicket(imagedTicketId, imagePath); log.info("Adding image ticket to ovirt-imageio-proxy, id {}", imagedTicketId); try { getProxyClient().putTicket(imageTicket); } catch (RuntimeException e) { log.error("Failed to add image ticket to ovirt-imageio-proxy: {}", e.getMessage(), e); return false; } return true; }</code><technical_language>This is a URL (.e.g "file:///path/to/image" "nbd:unix:/path/to/socket:exportname=vda"). String url = ..</technical_language>

Target:
private boolean addImageTicketToProxy(Guid imagedTicketId, String hostUri) { String url = String.format( "%s%s/%s", hostUri, IMAGES_PATH, imagedTicketId); ImageTicket imageTicket = buildImageTicket(imagedTicketId, url); log.info("Adding image ticket to ovirt-imageio-proxy, id {}", imagedTicketId); try { getProxyClient().putTicket(imageTicket); } catch (RuntimeException e) { log.error("Failed to add image ticket to ovirt-imageio-proxy: {}", e.getMessage(), e); return false; } return true; }
Source:
<code><START> public static <T> TSpliterator<T> spliterator(Object[] array, int additionalCharacteristics) { <END> TArrayList<T> list = new TArrayList<T>(); for (Object element : array) { list.add((T) element); } return list.spliterator(); }</code><technical_language>implement Spliterator for this case</technical_language>

Target:
public static <T> TSpliterator<T> spliterator(Object[] array, int additionalCharacteristics) { return new TSpliterator<T>() { private int index; @Override public boolean tryAdvance(Consumer<? super T> action) { if (index >= array.length) { return false; } action.accept((T) array[index]); index++; return true; } @Override public TSpliterator<T> trySplit() { return null; } @Override public long estimateSize() { return array.length; } @Override public int characteristics() { return additionalCharacteristics | TSpliterator.SIZED; } }; }
Source:
<code>private PublicKey decodePublicKey(String key) throws Exception { InputStream stream = new ClassPathResource(key).getInputStream(); byte[] keyBytes = StreamUtils.copyToByteArray(stream); <START> while (keyBytes[keyBytes.length - 1] == 0x0a || keyBytes[keyBytes.length - 1] == 0x0c) { <END> keyBytes = Arrays.copyOf(keyBytes, keyBytes.length - 1); } byte[] decodeBuffer = Base64Utils.decode(keyBytes); ByteBuffer bb = ByteBuffer.wrap(decodeBuffer); int len = bb.getInt(); byte[] type = new byte[len]; bb.get(type); if ("ssh-rsa".equals(new String(type))) { BigInteger e = decodeBigInt(bb); BigInteger m = decodeBigInt(bb); RSAPublicKeySpec spec = new RSAPublicKeySpec(m, e); return KeyFactory.getInstance("RSA").generatePublic(spec); } else { throw new IllegalArgumentException("Only supports RSA"); } }</code><technical_language>ideas failed sporadically? Thanks Merging BTW</technical_language>

Target:
private PublicKey decodePublicKey(String key) throws Exception { InputStream stream = new ClassPathResource(key).getInputStream(); byte[] keyBytes = StreamUtils.copyToByteArray(stream); while (keyBytes[keyBytes.length - 1] == 0x0a || keyBytes[keyBytes.length - 1] == 0x0d) { keyBytes = Arrays.copyOf(keyBytes, keyBytes.length - 1); } byte[] decodeBuffer = Base64Utils.decode(keyBytes); ByteBuffer bb = ByteBuffer.wrap(decodeBuffer); int len = bb.getInt(); byte[] type = new byte[len]; bb.get(type); if ("ssh-rsa".equals(new String(type))) { BigInteger e = decodeBigInt(bb); BigInteger m = decodeBigInt(bb); RSAPublicKeySpec spec = new RSAPublicKeySpec(m, e); return KeyFactory.getInstance("RSA").generatePublic(spec); } else { throw new IllegalArgumentException("Only supports RSA"); } }
Source:
<code>private void addCommandsToResponse(final String deviceName, final Integer firmwareVersion, final OutputProtos.SyncResponse.Builder responseBuilder) { LOGGER.info("Response commands allowed for DeviceId: {}", deviceName); final List<ResponseCommand> respCommandsToFetch = new ArrayList<>(); respCommandsToFetch.add(ResponseCommand.RESET_TO_FACTORY_FW); respCommandsToFetch.add(ResponseCommand.RESET_MCU); <START> respCommandsToFetch.add(ResponseCommand.SET_LOG_LEVEL); <END> Map<ResponseCommand,String> commandMap = responseCommandsDAODynamoDB.getResponseCommands(deviceName, firmwareVersion, respCommandsToFetch); if (!commandMap.isEmpty()) { for (final ResponseCommand cmd : respCommandsToFetch) { if (commandMap.containsKey(cmd)) { final String cmdValue = commandMap.get(cmd); switch(cmd) { case RESET_TO_FACTORY_FW: responseBuilder.setResetToFactoryFw(Boolean.parseBoolean(cmdValue)); break; case RESET_MCU: responseBuilder.setResetMcu(Boolean.parseBoolean(cmdValue)); break; case SET_LOG_LEVEL: responseBuilder.setUploadLogLevel(Integer.parseInt(cmdValue)); break; } } } } }</code><technical_language>Style suggestion: java final List<ResponseCommand> respCommandsToFetch = Lists.newArrayList( ResponseCommand.RESET_TO_FACTORY_FW, ResponseCommand.RESET_MCU, ResponseCommand.SET_LOG_LEVEL );</technical_language>

Target:
private void addCommandsToResponse(final String deviceName, final Integer firmwareVersion, final OutputProtos.SyncResponse.Builder responseBuilder) { LOGGER.info("Response commands allowed for DeviceId: {}", deviceName); final List<ResponseCommand> respCommandsToFetch = Lists.newArrayList( ResponseCommand.RESET_TO_FACTORY_FW, ResponseCommand.RESET_MCU, ResponseCommand.SET_LOG_LEVEL ); final Map<ResponseCommand, String> commandMap = responseCommandsDAODynamoDB.getResponseCommands(deviceName, firmwareVersion, respCommandsToFetch); if (commandMap.isEmpty()) { return; } for (final ResponseCommand cmd : respCommandsToFetch) { if (!commandMap.containsKey(cmd)) { continue; } final String cmdValue = commandMap.get(cmd); switch (cmd) { case RESET_TO_FACTORY_FW: responseBuilder.setResetToFactoryFw(Boolean.parseBoolean(cmdValue)); break; case RESET_MCU: responseBuilder.setResetMcu(Boolean.parseBoolean(cmdValue)); break; case SET_LOG_LEVEL: try { final Integer logLevel = Integer.parseInt(cmdValue); if (!SenseLogLevelUtil.isAllowedLogLevel(logLevel)) { LOGGER.warn("Log level value '%03X' not allowed.", logLevel); continue; } responseBuilder.setUploadLogLevel(logLevel); } catch (NumberFormatException nfe) { LOGGER.warn("Bad log level value passed with 'set_log_level' response command."); return; } break; } } }
Source:
<code>private List<String> getLatestDirectoryNames() throws IOException { String inputLine; List<String> currentDirectories = Lists.newArrayList(); Pattern itunesPattern = Pattern.compile("itunes\\d{8}"); Pattern pricingPattern = Pattern.compile("pricing\\d{8}"); URL currentUrl = new URL(feedPath); URLConnection urlConnection = currentUrl.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader( urlConnection.getInputStream() )); while ((inputLine = in.readLine()) != null) { Matcher itunesMatcher = itunesPattern.matcher(inputLine); Matcher pricingMatcher = pricingPattern.matcher(inputLine); if (itunesMatcher.find()) { currentDirectories.add(itunesMatcher.group(0)); } else if (pricingMatcher.find()) { currentDirectories.add(pricingMatcher.group(0)); } } <START> in.close(); <END> return currentDirectories; }</code><technical_language>BufferedReader implements AutoClosable. [try-with-resources](<LINK_0> pattern instead</technical_language>

Target:
private void getLatestDirectoryNames() throws IOException { String inputLine; List<String> currentDirectories = Lists.newArrayList(); Pattern itunesPattern = Pattern.compile("itunes\\d{8}"); Pattern pricingPattern = Pattern.compile("pricing\\d{8}"); URL currentUrl = new URL(feedPath); URLConnection urlConnection = currentUrl.openConnection(); try (BufferedReader in = new BufferedReader( new InputStreamReader(urlConnection.getInputStream()) )) { while ((inputLine = in.readLine()) != null) { Matcher itunesMatcher = itunesPattern.matcher(inputLine); Matcher pricingMatcher = pricingPattern.matcher(inputLine); if (itunesMatcher.find()) { currentDirectories.add(itunesMatcher.group(0)); } else if (pricingMatcher.find()) { currentDirectories.add(pricingMatcher.group(0)); } } } itunesDirectory = currentDirectories.get(0); pricingDirectory = currentDirectories.get(1); }
Source:
<code>private List<WireRecord> buildWireRecord(final KuraPayload payload) throws IOException { requireNonNull(payload, wireMessages.payloadNonNull()); Map<String, Object> kuraPayloadProperties = payload.metrics(); Map<String, TypedValue<?>> wireProperties = new HashMap<>(); for (Entry<String, Object> entry : kuraPayloadProperties.entrySet()) { String entryKey = entry.getKey(); Object entryValue = entry.getValue(); TypedValue<?> convertedValue; if (entryValue instanceof Boolean) { final boolean value = Boolean.parseBoolean(String.valueOf(entryValue)); convertedValue = TypedValues.newBooleanValue(value); } else if (entryValue instanceof Byte) { final byte value = Byte.parseByte(String.valueOf(entryValue)); convertedValue = TypedValues.newByteValue(value); } else if (entryValue instanceof Long) { final long value = Long.parseLong(String.valueOf(entryValue)); convertedValue = TypedValues.newLongValue(value); } else if (entryValue instanceof Double) { final double value = Double.parseDouble(String.valueOf(entryValue)); convertedValue = TypedValues.newDoubleValue(value); } else if (entryValue instanceof Integer) { final int value = Integer.parseInt(String.valueOf(entryValue)); convertedValue = TypedValues.newIntegerValue(value); } else if (entryValue instanceof Short) { final short value = Short.parseShort(String.valueOf(entryValue)); convertedValue = TypedValues.newShortValue(value); } else if (entryValue instanceof String) { final String value = String.valueOf(entryValue); convertedValue = TypedValues.newStringValue(value); } else if (entryValue instanceof byte[]) { final byte[] value = TypeUtil.objectToByteArray(entryValue); convertedValue = TypedValues.newByteArrayValue(value); } else { <START> throw new IllegalArgumentException("Unknown metric type"); <END> } wireProperties.put(entryKey, convertedValue); } final WireRecord wireRecord = new WireRecord(wireProperties); return Arrays.asList(wireRecord); }</code><technical_language>Add this literal localization resource</technical_language>

Target:
private List<WireRecord> buildWireRecord(final KuraPayload payload) throws IOException { requireNonNull(payload, wireMessages.payloadNonNull()); final Map<String, Object> kuraPayloadProperties = payload.metrics(); final Map<String, TypedValue<?>> wireProperties = new HashMap<>(); for (Entry<String, Object> entry : kuraPayloadProperties.entrySet()) { final String entryKey = entry.getKey(); final Object entryValue = entry.getValue(); final TypedValue<?> convertedValue = TypedValues.newTypedValue(entryValue); wireProperties.put(entryKey, convertedValue); } final WireRecord wireRecord = new WireRecord(wireProperties); return Arrays.asList(wireRecord); }
Source:
<code>private ResourceId(final String id) { if (id == null) { this.subscriptionId = null; this.resourceGroupName = null; this.name = null; this.providerNamespace = null; this.resourceType = null; this.id = null; this.parentId = null; return; } else { String[] splits = (id.startsWith("/")) ? id.substring(1).split("/") : id.split("/"); if (splits.length % 2 == 1) { throw new InvalidParameterException(badIdErrorText(id)); } this.id = id; if (splits.length < 2) { throw new InvalidParameterException(badIdErrorText(id)); } else { this.name = splits[splits.length - 1]; this.resourceType = splits[splits.length - 2]; } if (splits.length < 10) { this.parentId = null; } else { String[] parentSplits = new String[splits.length - 2]; System.arraycopy(splits, 0, parentSplits, 0, splits.length - 2); this.parentId = "/" + String.join("/", parentSplits); } <START> if (!splits[0].equalsIgnoreCase("subscriptions")) { <END> throw new InvalidParameterException(badIdErrorText(id)); } this.subscriptionId = splits[1]; if (!splits[2].equalsIgnoreCase("resourceGroups")) { throw new InvalidParameterException(badIdErrorText(id)); } this.resourceGroupName = splits[3]; if (!splits[4].equalsIgnoreCase("providers")) { throw new InvalidParameterException(badIdErrorText(id)); } this.providerNamespace = splits[5]; } }</code><technical_language>I need check length for of these? this.subscriptionId = splits.length > 1 ? splits[1] : null</technical_language>

Target:
private ResourceId(final String id) { if (id == null) { this.subscriptionId = null; this.resourceGroupName = null; this.name = null; this.providerNamespace = null; this.resourceType = null; this.id = null; this.parentId = null; return; } else { String[] splits = (id.startsWith("/")) ? id.substring(1).split("/") : id.split("/"); if (splits.length % 2 == 1) { throw new InvalidParameterException(badIdErrorText(id)); } this.id = id; if (splits.length < 2) { throw new InvalidParameterException(badIdErrorText(id)); } else { this.name = splits[splits.length - 1]; this.resourceType = splits[splits.length - 2]; } if (splits.length < 10) { this.parentId = null; } else { String[] parentSplits = new String[splits.length - 2]; System.arraycopy(splits, 0, parentSplits, 0, splits.length - 2); this.parentId = "/" + String.join("/", parentSplits); } if (splits.length > 0 && !splits[0].equalsIgnoreCase("subscriptions")) { throw new InvalidParameterException(badIdErrorText(id)); } this.subscriptionId = splits.length > 1 ? splits[1] : null; if (splits.length > 2 && !splits[2].equalsIgnoreCase("resourceGroups")) { throw new InvalidParameterException(badIdErrorText(id)); } this.resourceGroupName = splits.length > 3 ? splits[3] : null; if (splits.length > 4 && !splits[4].equalsIgnoreCase("providers")) { throw new InvalidParameterException(badIdErrorText(id)); } this.providerNamespace = splits.length > 5 ? splits[5] : null; } }
Source:
<code>public LongObjectHashMap<Long> measureGroupingOnLongArray() { LongObjectHashMap<Long> sumByKey = new LongObjectHashMap<>(); for (long number : numbers) { sumByKey.compute(number, (key, oldValue) -> { if (oldValue == null) { <START> return 0L; <END> } else { return oldValue + number; } }); } return sumByKey; }</code><technical_language>this number? (adding for a key right? )</technical_language>

Target:
public LongObjectHashMap<Long> measureGroupingOnLongArray() { LongObjectHashMap<Long> sumByKey = new LongObjectHashMap<>(); for (long number : numbers) { sumByKey.compute(number, (key, oldValue) -> { if (oldValue == null) { return number; } else { return oldValue + number; } }); } return sumByKey; }
Source:
<code><START> public Work addPage(Page page) <END> { Work work = new AddPageWork(page.getBlock(hashChannel)); work.process(); return work; }</code><technical_language>Work is generic, add <?></technical_language>

Target:
public Work<?> addPage(Page page) { currentPageSizeInBytes = page.getRetainedSizeInBytes(); return new AddPageWork(page.getBlock(hashChannel)); }
Source:
<code>public void resetClearsInitMainThreadHandler() throws Exception { RxAndroidPlugins .setInitMainThreadSchedulerHandler(new Function<Callable<Scheduler>, Scheduler>() { @Override public Scheduler apply(Callable<Scheduler> scheduler) { <START> throw new RuntimeException(); <END> } }); final Scheduler scheduler = new EmptyScheduler(); Callable<Scheduler> schedulerCallable = new Callable<Scheduler>() { @Override public Scheduler call() throws Exception { return scheduler; } }; RxAndroidPlugins.reset(); Scheduler actual = RxAndroidPlugins.initMainThreadScheduler(schedulerCallable); assertSame(schedulerCallable.call(), actual); }</code><technical_language>AssertionError for semantics</technical_language>

Target:
public void resetClearsInitMainThreadHandler() throws Exception { RxAndroidPlugins .setInitMainThreadSchedulerHandler(new Function<Callable<Scheduler>, Scheduler>() { @Override public Scheduler apply(Callable<Scheduler> scheduler) { throw new AssertionError(); } }); final Scheduler scheduler = new EmptyScheduler(); Callable<Scheduler> schedulerCallable = new Callable<Scheduler>() { @Override public Scheduler call() throws Exception { return scheduler; } }; RxAndroidPlugins.reset(); Scheduler actual = RxAndroidPlugins.initMainThreadScheduler(schedulerCallable); assertSame(schedulerCallable.call(), actual); }
Source:
<code>SessionCreationPolicy getSessionCreationPolicy() { if (this.sessionPolicy != null) { return this.sessionPolicy; } <START> SessionCreationPolicy shared = getBuilder().getSharedObject(SessionCreationPolicy.class); <END> return shared == null ? SessionCreationPolicy.IF_REQUIRED : shared; }</code><technical_language>Rename variable shared sessionCreationPolicy</technical_language>

Target:
SessionCreationPolicy getSessionCreationPolicy() { if (this.sessionPolicy != null) { return this.sessionPolicy; } SessionCreationPolicy sessionPolicy = getBuilder().getSharedObject(SessionCreationPolicy.class); return sessionPolicy == null ? SessionCreationPolicy.IF_REQUIRED : sessionPolicy; }
Source:
<code>private List<String> getCurrentCycle(Node start) { List<String> cycle = new ArrayList<String>(); boolean inCycle = false; for ( Node n : currentPath ) { <START> if ( n.getName().equals( start.getName() ) ) { <END> inCycle = true; } if ( inCycle ) { cycle.add( n.getName() ); } } return cycle; }</code><technical_language>check for n == start, right? n.equals( start ), equals-implementation in Node checks for reference equality first</technical_language>

Target:
private List<String> getCurrentCycle(Node start) { List<String> cycle = new ArrayList<String>(); boolean inCycle = false; for ( Node n : currentPath ) { if ( !inCycle && n.equals( start ) ) { inCycle = true; } if ( inCycle ) { cycle.add( n.getName() ); } } return cycle; }
Source:
<code>public SimulatedRead getNextRead() throws IOException { SimulatedRead read; final String nameLine = fastqBr.readLine(); if (nameLine == null) { return null; } if (nameLine.trim().length() < 1) { <START> log.warning("got empty string at FASTQ line " + fastqBr.getLineNumber()); <END> return null; } ArtAlnRecord alnRecord; if ((alnRecord = artAlnR.getNextAln()) == null) { return null; } final String nameFields[] = nameLine.trim().substring(1).split("[-/]"); if (nameFields.length < 2) { log.warning("expect at least 2 fields at fastq line " + fastqBr.getLineNumber() + ": " + nameLine); return null; } read = new SimulatedRead(); read.fragment = Integer.parseInt(nameFields[nameFields.length - 1]); read.setReadId(nameFields[nameFields.length - 2]); read.sequence = fastqBr.readLine().trim(); if (forceFiveBaseEncoding) { read.sequence = nonACGTPattern.matcher(read.sequence).replaceAll("N"); } fastqBr.readLine(); read.quality = fastqBr.readLine().trim(); if (read.fragment == 1) { read.locs1.add(new GenomeLocation(alnRecord.chromosome, alnRecord.location, alnRecord.direction)); read.origLocs1.add(new GenomeLocation(alnRecord.chromosome, alnRecord.location, alnRecord.direction)); read.alignedBases1 = alnRecord.alignedBases; } else { read.locs2.add(new GenomeLocation(alnRecord.chromosome, alnRecord.location, alnRecord.direction)); read.origLocs2.add(new GenomeLocation(alnRecord.chromosome, alnRecord.location, alnRecord.direction)); read.alignedBases2 = alnRecord.alignedBases; } return read; }</code><technical_language>print out actual line line number. this error instead of a warning</technical_language>

Target:
public SimulatedRead getNextRead() throws IOException { SimulatedRead read; final String nameLine = fastqBr.readLine(); if (nameLine == null) { return null; } if (nameLine.trim().length() < 1) { log.error("got empty name string at FASTQ line " + fastqBr.getLineNumber()); return null; } ArtAlnRecord alnRecord; if ((alnRecord = artAlnR.getNextAln()) == null) { return null; } final String nameFields[] = nameLine.trim().substring(1).split("[-/]"); if (nameFields.length < 2) { log.warn("expect at least 2 fields at fastq line " + fastqBr.getLineNumber() + ": " + nameLine); return null; } read = new SimulatedRead(); read.fragment = Integer.parseInt(nameFields[nameFields.length - 1]); read.setReadId(nameFields[nameFields.length - 2]); read.sequence = fastqBr.readLine().trim(); if (forceFiveBaseEncoding) { read.sequence = nonACGTPattern.matcher(read.sequence).replaceAll("N"); } fastqBr.readLine(); read.quality = fastqBr.readLine().trim(); if (read.fragment == 1) { read.locs1.add(new GenomeLocation(alnRecord.chromosome, alnRecord.location, alnRecord.direction)); read.origLocs1.add(new GenomeLocation(alnRecord.chromosome, alnRecord.location, alnRecord.direction)); read.alignedBases1 = alnRecord.alignedBases; } else { read.locs2.add(new GenomeLocation(alnRecord.chromosome, alnRecord.location, alnRecord.direction)); read.origLocs2.add(new GenomeLocation(alnRecord.chromosome, alnRecord.location, alnRecord.direction)); read.alignedBases2 = alnRecord.alignedBases; } return read; }
Source:
<code>private static void resolveMetadata(Properties props) { try { DatabaseType dbType = DatabaseType.valueOf( props.getProperty(JdbcStorageConfig.DATABASE_TYPE.getPropertyName())); LOGGER.debug("Resolving db type: {}", dbType.toString()); if (dbType == DatabaseType.METASTORE) { HiveConf hconf = Hive.get().getConf(); props.setProperty(JdbcStorageConfig.JDBC_URL.getPropertyName(), getMetastoreConnectionURL(hconf)); props.setProperty(JdbcStorageConfig.JDBC_DRIVER_CLASS.getPropertyName(), getMetastoreDriver(hconf)); String user = getMetastoreJdbcUser(hconf); if (user != null) { <START> props.setProperty("hive.sql.dbcp.username", user); <END> } String pwd = getMetastoreJdbcPasswd(hconf); if (pwd != null) { props.setProperty(CONFIG_PWD, pwd); } props.setProperty(JdbcStorageConfig.DATABASE_TYPE.getPropertyName(), getMetastoreDatabaseType(hconf)); } } catch (Exception e) }</code><technical_language>is this a table property? find this is used/read. nit: static final string</technical_language>

Target:
private static void resolveMetadata(Properties props) throws HiveException, IOException { DatabaseType dbType = DatabaseType.valueOf( props.getProperty(JdbcStorageConfig.DATABASE_TYPE.getPropertyName())); LOGGER.debug("Resolving db type: {}", dbType.toString()); if (dbType == DatabaseType.METASTORE) { HiveConf hconf = Hive.get().getConf(); props.setProperty(JdbcStorageConfig.JDBC_URL.getPropertyName(), getMetastoreConnectionURL(hconf)); props.setProperty(JdbcStorageConfig.JDBC_DRIVER_CLASS.getPropertyName(), getMetastoreDriver(hconf)); String user = getMetastoreJdbcUser(hconf); if (user != null) { props.setProperty(CONFIG_USERNAME, user); } String pwd = getMetastoreJdbcPasswd(hconf); if (pwd != null) { props.setProperty(CONFIG_PWD, pwd); } props.setProperty(JdbcStorageConfig.DATABASE_TYPE.getPropertyName(), getMetastoreDatabaseType(hconf)); } }
Source:
<code>public TestObject() { <START> id = UUID.randomUUID().toString(); <END> }</code><technical_language>FWIW tend Identifiers.makeRandomId(/* length */ 8) instead of UUID -- big reason for more easily distinguishable identifiers, shorter more chars</technical_language>

Target:
public TestObject() { id = Identifiers.makeRandomId(8); }
Source:
<code>public Response moveDataset(@PathParam("id") String id, @PathParam("targetDataverseAlias") String targetDataverseAlias, @QueryParam("forceMove") Boolean force) { try{ User u = findUserOrDie(); Dataset ds = findDatasetOrDie(id); Dataverse target = dataverseService.findByAlias(targetDataverseAlias); if (target == null){ return error(Response.Status.BAD_REQUEST, "Target Dataverse not found."); } execCommand(new MoveDatasetCommand( createDataverseRequest(u), ds, target, force )); return ok("Dataset moved successfully"); } catch (WrappedResponse ex) { if (ex.getCause() instanceof UnforcedCommandException) { <START> return ex.refineResponse("Use the query parameter forceMove=true to complete the move."); <END> } else { return ex.getResponse(); } } }</code><technical_language>add this response text Bundle></technical_language>

Target:
public Response moveDataset(@PathParam("id") String id, @PathParam("targetDataverseAlias") String targetDataverseAlias, @QueryParam("forceMove") Boolean force) { try { User u = findUserOrDie(); Dataset ds = findDatasetOrDie(id); Dataverse target = dataverseService.findByAlias(targetDataverseAlias); if (target == null) { return error(Response.Status.BAD_REQUEST, BundleUtil.getStringFromBundle("datasets.api.moveDataset.error.targetDataverseNotFound")); } execCommand(new MoveDatasetCommand( createDataverseRequest(u), ds, target, force )); return ok(BundleUtil.getStringFromBundle("datasets.api.moveDataset.success")); } catch (WrappedResponse ex) { if (ex.getCause() instanceof UnforcedCommandException) { return ex.refineResponse(BundleUtil.getStringFromBundle("datasets.api.moveDataset.error.suggestForce")); } else { return ex.getResponse(); } } }
Source:
<code>public Embedding deserialize(JsonNode rootNode, Configuration configuration) { String data = rootNode.get("data").asText(); String mimeType = findMimeType(rootNode); <START> Pattern base64Pattern = Pattern.compile("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"); <END> Embedding embedding; if (base64Pattern.matcher(data).matches()) { embedding = new Embedding(mimeType, data); } else { embedding = new Embedding(mimeType, new String(Base64.encodeBase64(data.getBytes(UTF_8)), UTF_8)); } storeEmbedding(embedding, configuration.getEmbeddingDirectory()); return embedding; }</code><technical_language>magic number if this is proper implementation</technical_language>

Target:
public Embedding deserialize(JsonNode rootNode, Configuration configuration) { String data = rootNode.get("data").asText(); String mimeType = findMimeType(rootNode); String encodedData = getBase64EncodedData(data); Embedding embedding; String nameField = "name"; if (rootNode.has(nameField)) { String name = rootNode.get(nameField).asText(); embedding = new Embedding(mimeType, encodedData, name); } else { embedding = new Embedding(mimeType, encodedData); } storeEmbedding(embedding, configuration.getEmbeddingDirectory()); return embedding; }
Source:
<code>public CompletableFuture<ArchivedExecutionGraph> requestJob(JobID jobId, Time timeout) { Function<Throwable, ArchivedExecutionGraph> checkExecutionGraphStoreeOnException = throwable -> { final ArchivedExecutionGraph archivedExecutionGraph = archivedExecutionGraphStore.get(jobId); if (archivedExecutionGraph == null) { throw new CompletionException(ExceptionUtils.stripCompletionException(throwable)); } else { return archivedExecutionGraph; } }; <START> Optional<DispatcherJob> maybeJob = getDispatcherJob(jobId); if (maybeJob.isPresent()) { DispatcherJob job = maybeJob.get(); return job.requestJob(timeout).exceptionally(checkExecutionGraphStoreeOnException); } else { return CompletableFuture.completedFuture(checkExecutionGraphStoreeOnException.apply(new FlinkJobNotFoundException(jobId))); } <END> }</code><technical_language>I express this logic be: return maybeJob.map(job -> job.requestJob(timeout)) .orElse(FutureUtils.completedExceptionally(new FlinkJobNotFoundException(jobId))) .exceptionally(checkExecutionGraphStoreOnException);</technical_language>

Target:
public CompletableFuture<ArchivedExecutionGraph> requestJob(JobID jobId, Time timeout) { Function<Throwable, ArchivedExecutionGraph> checkExecutionGraphStoreOnException = throwable -> { final ArchivedExecutionGraph archivedExecutionGraph = archivedExecutionGraphStore.get(jobId); if (archivedExecutionGraph == null) { throw new CompletionException(ExceptionUtils.stripCompletionException(throwable)); } else { return archivedExecutionGraph; } }; Optional<DispatcherJob> maybeJob = getDispatcherJob(jobId); return maybeJob.map(job -> job.requestJob(timeout)) .orElse(FutureUtils.completedExceptionally(new FlinkJobNotFoundException(jobId))) .exceptionally(checkExecutionGraphStoreOnException); }
Source:
<code>public void prepareRun(BatchAggregatorContext context) throws Exception { super.prepareRun(context); validate(context.getInputSchema(), conf.getFields(), context.getFailureCollector()); context.getFailureCollector().getOrThrowException(); <START> if (SchemaValidator.canRecordLineage(context.getOutputSchema(), "output")) { <END> List<String> fields = conf.getFields() == null ? TransformLineageRecorderUtils.getFields(context.getInputSchema()) : Lists.newArrayList(conf.getFields()); context.record(TransformLineageRecorderUtils.generateOneToOnes(fields, "distinctAggregator", "Removed duplicates in input records.")); } }</code><technical_language>context.getStageName()</technical_language>

Target:
public void prepareRun(BatchAggregatorContext context) throws Exception { super.prepareRun(context); validate(context.getInputSchema(), conf.getFields(), context.getFailureCollector()); context.getFailureCollector().getOrThrowException(); if (SchemaValidator.canRecordLineage(context.getOutputSchema(), context.getStageName())) { List<String> fields = conf.getFields() == null ? TransformLineageRecorderUtils.getFields(context.getInputSchema()) : Lists.newArrayList(conf.getFields()); context.record(TransformLineageRecorderUtils.generateOneToOnes(fields, "distinctAggregator", "Removed duplicates in input records.")); } }
Source:
<code>private void notifyListeners(XMPPContact contact, UpdateType updateType) { log.debug("updated " + contact + " - " + updateType); Optional<XMPPContact> optionalContact = Optional.ofNullable(contact); <START> updateListeners.forEach(listener -> listener.update(optionalContact, updateType)); <END> }</code><technical_language>for (listener : updateListeners) {try { listener.update(...)}catch(RuntimeException e){...}} Common pattern for notifications call alien stuff</technical_language>

Target:
private void notifyListeners(XMPPContact contact, UpdateType updateType) { log.debug("updated " + contact + " - " + updateType); Optional<XMPPContact> optionalContact = Optional.ofNullable(contact); for (IContactsUpdate listener : updateListeners) { try { listener.update(optionalContact, updateType); } catch (RuntimeException e) { log.error("invoking listener: " + listener + " failed", e); } } }
Source:
<code><START> public void commit() throws IOException <END> { commit((RepositoryStreamWriteContext) getContext()); }</code><technical_language>public</technical_language>

Target:
protected void commit() throws IOException { commit((RepositoryStreamWriteContext) getContext()); }
Source:
<code>public Response buildResponse(final UriInfo uriInfo, final Class<? extends JaxrsResource> theClass, final String getMethodName, final Object objectId) { final URI location = buildLocation(uriInfo, theClass, getMethodName, objectId); <START> return !jaxrsConfig.isJaxrsLocationFullUrl() ? Response.ok().header("Location", location.getPath()).build() : Response.created(location).build(); <END> }</code><technical_language>want return '201' status Status.CREATED, Response.ok() set status Status.OK. need set status hand calling status(Status.CREATED).location(.....) suggest enhance tests verify status returned</technical_language>

Target:
public Response buildResponse(final UriInfo uriInfo, final Class<? extends JaxrsResource> theClass, final String getMethodName, final Object objectId) { final URI location = buildLocation(uriInfo, theClass, getMethodName, objectId); return !jaxrsConfig.isJaxrsLocationFullUrl() ? Response.status(Response.Status.CREATED).header("Location", location.getPath()).build() : Response.created(location).build(); }
Source:
<code>public void showChangePattern(ClickEvent w) { final ListBox pats = this.loadPatterns(); if (pats.getItemCount() == 0) { showNewPatternDialog(); return; } final FormStylePopup pop = new FormStylePopup(GuidedDecisionTableConstants.INSTANCE.FactType()); pop.addAttribute(GuidedDecisionTableConstants.INSTANCE.ChooseExistingPatternToAddColumnTo(), pats); pop.add(new ModalFooterChangePattern(new Command() { @Override public void execute() { <START> String[] val = pats.getValue(pats.getSelectedIndex()).split("\\s"); <END> final Optional<Pattern52> p = extractEditingPattern(val); editingPattern = p.orElseThrow(IllegalStateException::new); editingCol.setFactField(null); editingCol.setOperator(null); view.setEntryPointName(editingPattern.getEntryPointName()); view.selectOperator(editingPattern.getWindow().getOperator()); makeLimitedValueWidget(); makeDefaultValueWidget(); displayCEPOperators(); doPatternLabel(); doValueList(); doCalculationType(); doImageButtons(); pop.hide(); view.enableFooter(true); } }, new Command() { @Override public void execute() { pop.hide(); showNewPatternDialog(); } }, new Command() { @Override public void execute() { pop.hide(); view.enableFooter(true); } } )); view.enableFooter(false); pop.show(); }</code><technical_language>Ok, learning new optional. This in handy</technical_language>

Target:
public void showChangePattern(ClickEvent w) { final ListBox pats = this.loadPatterns(); if (pats.getItemCount() == 0) { showNewPatternDialog(); return; } final FormStylePopup pop = new FormStylePopup(GuidedDecisionTableConstants.INSTANCE.FactType()); pop.addAttribute(GuidedDecisionTableConstants.INSTANCE.ChooseExistingPatternToAddColumnTo(), pats); pop.add(new ModalFooterChangePattern(getShowPatternOKCommand(pats, pop), () -> { pop.hide(); showNewPatternDialog(); }, () -> { pop.hide(); view.enableFooter(true); } )); view.enableFooter(false); pop.show(); }
Source:
<code>private static void registerTransactionsSchemaVersionMetrics(MetricsManager metricsManager, CoordinationService<InternalSchemaMetadata> metadataCoordinationService, TimestampService timestampService) { <START> Supplier<ValueAndBound<TimestampPartitioningMap<Integer>>> timestampMapSupplier = () -> { <END> Optional<ValueAndBound<InternalSchemaMetadata>> latestValue = metadataCoordinationService.getLastKnownLocalValue(); return latestValue .map(ValueAndBound::value) .flatMap(Function.identity()) .map(InternalSchemaMetadata::timestampToTransactionsTableSchemaVersion) .map(partitioningMap -> ValueAndBound.of(partitioningMap, latestValue.get().bound())) .orElse(null); }; registerMetricForTransactionsSchemaVersionAtTimestamp(metricsManager, AtlasDbMetricNames.COORDINATION_EVENTUAL_TRANSACTIONS_SCHEMA_VERSION, timestampMapSupplier, ValueAndBound::bound); registerMetricForTransactionsSchemaVersionAtTimestamp(metricsManager, AtlasDbMetricNames.COORDINATION_CURRENT_TRANSACTIONS_SCHEMA_VERSION, timestampMapSupplier, unused -> timestampService.getFreshTimestamp()); }</code><technical_language>Extract a method inline method reference</technical_language>

Target:
private static void registerTransactionsSchemaVersionMetrics(MetricsManager metricsManager, CoordinationService<InternalSchemaMetadata> metadataCoordinationService, TimestampService timestampService) { Supplier<ValueAndBound<TimestampPartitioningMap<Integer>>> valueAndBoundSupplier = () -> MetadataCoordinationServiceMetrics.getTimestampToTransactionsTableSchemaVersionMap( metadataCoordinationService); registerMetricForTransactionsSchemaVersionAtTimestamp(metricsManager, AtlasDbMetricNames.COORDINATION_EVENTUAL_TRANSACTIONS_SCHEMA_VERSION, valueAndBoundSupplier, ValueAndBound::bound); registerMetricForTransactionsSchemaVersionAtTimestamp(metricsManager, AtlasDbMetricNames.COORDINATION_CURRENT_TRANSACTIONS_SCHEMA_VERSION, valueAndBoundSupplier, unused -> timestampService.getFreshTimestamp()); }