auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private CertificateInfo createCertificateInfo(X509Certificate cert) throws GeneralSecurityException { MessageDigest sha1 = MessageDigest.getInstance("SHA1"); sha1.update(cert.getEncoded()); boolean selfSigned = false; try { cert.verify(cert.getPublicKey()); selfSigned = true; } catch (GeneralSecurityException e) { } StringBuilder sb = new StringBuilder(); if (selfSigned) { sb.append("Self signed certificate, "); } sb.append("subject name: "); sb.append(cert.getSubjectX500Principal()); if (!selfSigned) { sb.append(", issued by: "); sb.append(cert.getIssuerX500Principal()); } sb.append(". SHA1 hash: "); sb.append(Hex.encodeHexString(sha1.digest())); sb.append("."); return new CertificateInfo(new Base64(0).encodeToString(cert.getEncoded()), cert.getSubjectX500Principal().toString(), "desc"); }

Target:
private CertificateInfo createCertificateInfo(X509Certificate cert) throws GeneralSecurityException { MessageDigest sha1 = MessageDigest.getInstance("SHA1"); sha1.update(cert.getEncoded()); boolean selfSigned = false; try { cert.verify(cert.getPublicKey()); selfSigned = true; } catch (GeneralSecurityException e) { } StringBuilder sb = new StringBuilder(); if (selfSigned) { sb.append("Self signed certificate, "); } sb.append("subject name: "); sb.append(cert.getSubjectX500Principal()); if (!selfSigned) { sb.append(", issued by: "); sb.append(cert.getIssuerX500Principal()); } sb.append(". SHA1 hash: "); sb.append(Hex.encodeHexString(sha1.digest())); sb.append("."); return new CertificateInfo(new Base64(0).encodeToString(cert.getEncoded()), cert.getSubjectX500Principal().toString(), sb.toString()); }
Source:
public void testBooleanAliasesInvalidValues() { column.setFactField(FIELD_NAME); column.setFieldType(DataType.TYPE_BOOLEAN); column.setValueList("yes=Yes, no=No"); assertEquals(0, utilities.getValueList(column).length); }

Target:
public void testBooleanAliasesInvalidValues() { column.setFactField(FIELD_NAME); column.setFieldType(DataType.TYPE_BOOLEAN); column.setValueList("yes=Yes, no=No"); Assertions.assertThat(utilities.getValueList(column)).isEmpty(); }
Source:
private boolean usesUnwrapping(AnnotationMirror annotationMirror, TypeMirror typeMirror) { if ( constraintHelper.isSupportedForUnwrappingByDefault( getQualifiedName( typeMirror ) ) ) { return true; } return annotationApiHelper.getAnnotationArrayValue( annotationMirror, "payload" ).stream() .map( AnnotationValue::getValue ) .map( type -> (TypeMirror) type ) .map( typeUtils::asElement ) .map( elem -> ( (TypeElement) elem ).getQualifiedName() ) .filter( name -> name.toString().equals( "javax.validation.valueextraction.Unwrapping.Unwrap" ) ) .findAny().isPresent(); }

Target:
private boolean usesUnwrapping(AnnotationMirror annotationMirror, TypeMirror typeMirror) { UnwrapMode mode = annotationApiHelper.determineUnwrapMode( annotationMirror ); if ( UnwrapMode.SKIP.equals( mode ) ) { return false; } if ( constraintHelper.isSupportedForUnwrappingByDefault( getQualifiedName( typeMirror ) ) ) { return true; } return UnwrapMode.UNWRAP.equals( mode ); }
Source:
public String getSubtitle() { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()); return dateFormat.format(date); }

Target:
public String getSubtitle() { SimpleDateFormat dateFormat = new SimpleDateFormat(Constants.DATE_FORMAT, Locale.getDefault()); return dateFormat.format(date); }
Source:
private ICompletionProposal[] getAttributeValueProposals(String taskName, String attributeName, String prefix) { List<ICompletionProposal> proposals = new ArrayList<>(); IElement taskElement = getDtd().getElement(taskName); if (taskElement != null) { IAttribute attribute = taskElement.getAttributes().get(attributeName); if (attribute != null) { String[] items = attribute.getEnum(); if (items != null) { String item; for (String item2 : items) { item = item2; if (prefix.length() == 0 || item.toLowerCase().startsWith(prefix)) { proposals.add(new AntCompletionProposal(item, cursorPosition - prefix.length(), prefix.length(), item.length(), null, item, null, AntCompletionProposal.TASK_PROPOSAL)); } } } } } else { AntTypeDefinition taskClass = getTaskClass(taskName); if (taskClass != null) { IntrospectionHelper helper = getIntrospectionHelper(taskClass); if (helper != null) { addAttributeValueProposals(helper, attributeName, prefix, proposals); } } else { AntTypeDefinition nestedType = getNestedType(); if (nestedType != null) { IntrospectionHelper helper = getIntrospectionHelper(nestedType); if (helper != null) { addAttributeValueProposals(helper, attributeName, prefix, proposals); } } } } return proposals.toArray(new ICompletionProposal[proposals.size()]); }

Target:
private ICompletionProposal[] getAttributeValueProposals(String taskName, String attributeName, String prefix) { List<ICompletionProposal> proposals = new ArrayList<>(); IElement taskElement = getDtd().getElement(taskName); if (taskElement != null) { IAttribute attribute = taskElement.getAttributes().get(attributeName); if (attribute != null) { String[] items = attribute.getEnum(); if (items != null) { for (String item : items) { if (prefix.length() == 0 || item.toLowerCase().startsWith(prefix)) { proposals.add(new AntCompletionProposal(item, cursorPosition - prefix.length(), prefix.length(), item.length(), null, item, null, AntCompletionProposal.TASK_PROPOSAL)); } } } } } else { AntTypeDefinition taskClass = getTaskClass(taskName); if (taskClass != null) { IntrospectionHelper helper = getIntrospectionHelper(taskClass); if (helper != null) { addAttributeValueProposals(helper, attributeName, prefix, proposals); } } else { AntTypeDefinition nestedType = getNestedType(); if (nestedType != null) { IntrospectionHelper helper = getIntrospectionHelper(nestedType); if (helper != null) { addAttributeValueProposals(helper, attributeName, prefix, proposals); } } } } return proposals.toArray(new ICompletionProposal[proposals.size()]); }
Source:
private void checkIfFilesAreTheSame(List<String> generatedTestTables) { generatedTestTables.forEach(tableName -> { String generatedFilePath = String.format("com/palantir/atlasdb/table/description/generated/%s.java", tableName); File expectedFile = new File(EXPECTED_FILES_FOLDER_PATH, generatedFilePath); File actualFile = new File(testFolder.getRoot(), generatedFilePath); assertThat(expectedFile.length()).isEqualTo(actualFile.length()); try (Stream<String> expectedFileStream = java.nio.file.Files .lines(Paths.get(EXPECTED_FILES_FOLDER_PATH, generatedFilePath)); Stream<String> actualFileStream = java.nio.file.Files .lines(Paths.get(testFolder.getRoot().getPath(), generatedFilePath)); Stream<Boolean> zipped = Streams.zip( expectedFileStream, actualFileStream, (first, second) -> { if (first.equals(second)) return true; return first.contains("__CLASS_HASH") && second.contains("__CLASS_HASH"); })) { assertThat(zipped .anyMatch(elem -> !elem)) .isFalse(); } catch (IOException e) { Assertions.fail("Exception on stream creation", e); } }); }

Target:
private void checkIfFilesAreTheSame(List<String> generatedTestTables) { generatedTestTables.forEach(tableName -> { String generatedFilePath = String.format("com/palantir/atlasdb/table/description/generated/%s.java", tableName); File expectedFile = new File(EXPECTED_FILES_FOLDER_PATH, generatedFilePath); File actualFile = new File(testFolder.getRoot(), generatedFilePath); assertThat(expectedFile.length()).isEqualTo(actualFile.length()); try (Stream<String> expectedFileStream = java.nio.file.Files.lines(expectedFile.toPath()); Stream<String> actualFileStream = java.nio.file.Files.lines(actualFile.toPath()); Stream<Boolean> zipped = correspondingLinesMatchOrAreHashes(expectedFileStream, actualFileStream)) { assertThat(zipped).allMatch(elem -> elem); } catch (IOException e) { Assertions.fail("Exception on stream creation", e); } }); }
Source:
public void testLegoEv3MotorMove() { checkIfBrickAtPositionShowsString(0, R.string.brick_when_started); checkIfBrickAtPositionShowsString(brickPosition, R.string.ev3_motor_move); enterValueInFormulaTextFieldOnBrickAtPosition(newValue, R.id.ev3_motor_move_speed_edit_text, brickPosition); }

Target:
public void testLegoEv3MotorMove() { final int testMoveSpeedValue = 40; checkIfBrickAtPositionShowsString(0, R.string.brick_when_started); checkIfBrickAtPositionShowsString(brickPosition, R.string.ev3_motor_move); enterValueInFormulaTextFieldOnBrickAtPosition(testMoveSpeedValue, R.id.ev3_motor_move_speed_edit_text, brickPosition); }
Source:
public static ElixirCompilerError create(String rootPath, String elixircMessage){ Matcher matcher = COMPILER_MESSAGE_PATTERN.matcher(StringUtil.trimTrailing(elixircMessage)); if(!matcher.matches()) return null; String relativeFilePath = FileUtil.toSystemIndependentName(matcher.group(1)); String line = matcher.group(2); String warning = matcher.group(3); String details = matcher.group(4); String path = StringUtil.isEmpty(rootPath) ? relativeFilePath : new File(FileUtil.toSystemIndependentName(rootPath), relativeFilePath).getPath(); int lineNumber = StringUtil.parseInt(line, -1); CompilerMessageCategory category = warning != null ? CompilerMessageCategory.WARNING : CompilerMessageCategory.ERROR; assert path != null; return new ElixirCompilerError(details, VfsUtilCore.pathToUrl(path), lineNumber, category); }

Target:
public static ElixirCompilerError create(String rootPath, String elixircMessage){ Matcher matcher = COMPILER_MESSAGE_PATTERN.matcher(StringUtil.trimTrailing(elixircMessage)); if(!matcher.matches()) return null; String relativeFilePath = FileUtil.toSystemIndependentName(matcher.group(1)); String line = matcher.group(2); String warning = matcher.group(3); String details = matcher.group(4); String path = StringUtil.isEmpty(rootPath) ? relativeFilePath : new File(FileUtil.toSystemIndependentName(rootPath), relativeFilePath).getPath(); int lineNumber = StringUtil.parseInt(line, UNKNOWN_LINE_NUMBER); CompilerMessageCategory category = warning != null ? CompilerMessageCategory.WARNING : CompilerMessageCategory.ERROR; assert path != null; return new ElixirCompilerError(details, VfsUtilCore.pathToUrl(path), lineNumber, category); }
Source:
private static MultiPath create(final MultiPath path, final double w, final double h) { LienzoPaths.rectangle(path, w, h, 0.0); return path .setFillColor("#F9FAD2") .setStrokeColor(ColorName.BLACK); }

Target:
private static MultiPath create(final MultiPath path, final double w, final double h) { LienzoPaths.rectangle(path, w, h, 0.0); return path .setFillColor(ColorName.LIGHTGOLDENRODYELLOW) .setStrokeColor(ColorName.BLACK); }
Source:
private String getPreviousVcsRevision(ArtifactoryBuildInfoClientBuilder clientBuilder, String buildName) throws IOException { ArtifactoryBuildInfoClient client = clientBuilder.build(); Build previousBuildInfo = client.getBuildInfo(buildName, LATEST); if (previousBuildInfo == null) { return ""; } if (StringUtils.isNotEmpty(previousBuildInfo.getVcsRevision())) { return previousBuildInfo.getVcsRevision(); } List<Vcs> vcsList = previousBuildInfo.getVcs(); if (vcsList != null && vcsList.size() > 0) { for (Vcs curVcs : previousBuildInfo.getVcs()) { if (StringUtils.isNotEmpty(curVcs.getRevision())) { return curVcs.getRevision(); } } } return ""; }

Target:
private String getPreviousVcsRevision(ArtifactoryBuildInfoClientBuilder clientBuilder, String buildName) throws IOException { try (ArtifactoryBuildInfoClient client = clientBuilder.build()) { Build previousBuildInfo = client.getBuildInfo(buildName, LATEST); if (previousBuildInfo == null) { return ""; } if (StringUtils.isNotEmpty(previousBuildInfo.getVcsRevision())) { return previousBuildInfo.getVcsRevision(); } List<Vcs> vcsList = previousBuildInfo.getVcs(); if (vcsList != null && vcsList.size() > 0) { for (Vcs curVcs : previousBuildInfo.getVcs()) { if (StringUtils.isNotEmpty(curVcs.getRevision())) { return curVcs.getRevision(); } } } return ""; } }
Source:
public LinkedList<FirmwareInfo> getFirmwareDeviceList(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @QueryParam("firmware_version") final Long firmwareVersion) { if(firmwareVersion == null) { LOGGER.error("Missing firmwareVersion parameter"); throw new WebApplicationException(Response.Status.BAD_REQUEST); } final Jedis jedis = jedisPool.getResource(); final String fwVersion = firmwareVersion.toString(); LinkedList<FirmwareInfo> deviceInfo = new LinkedList<>(); try { final Set<Tuple> allFWDevices = jedis.zrevrangeWithScores(fwVersion, 0, -1); for(Tuple device: allFWDevices){ deviceInfo.add(new FirmwareInfo(fwVersion, device.getElement(), (long)device.getScore())); } } catch (Exception e) { LOGGER.error("Failed retrieving firmware device list.", e.getMessage()); } finally { jedisPool.returnResource(jedis); } return deviceInfo; }

Target:
public List<FirmwareInfo> getFirmwareDeviceList(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @QueryParam("firmware_version") final Long firmwareVersion) { if(firmwareVersion == null) { LOGGER.error("Missing firmwareVersion parameter"); throw new WebApplicationException(Response.Status.BAD_REQUEST); } final Jedis jedis = jedisPool.getResource(); final String fwVersion = firmwareVersion.toString(); List<FirmwareInfo> deviceInfo = new ArrayList<>(); try { final Set<Tuple> allFWDevices = jedis.zrevrangeWithScores(fwVersion, 0, -1); for(final Tuple device: allFWDevices){ deviceInfo.add(new FirmwareInfo(fwVersion, device.getElement(), (long)device.getScore())); } } catch (Exception e) { LOGGER.error("Failed retrieving firmware device list.", e.getMessage()); } finally { jedisPool.returnResource(jedis); } return deviceInfo; }
Source:
public boolean handleRequest(MessageContext messageContext) { X509Certificate certificateFromMessageContext = null; org.apache.axis2.context.MessageContext axis2MsgContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); Map headers = (Map) (axis2MsgContext) .getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); Object sslCertObject = axis2MsgContext.getProperty(NhttpConstants.SSL_CLIENT_AUTH_CERT_X509); if (sslCertObject != null) { X509Certificate[] x509Certificates = (X509Certificate[]) sslCertObject; if (x509Certificates.length > 0) { certificateFromMessageContext = x509Certificates[0]; } } if (certificateFromMessageContext != null) { if (!headers.containsKey(Utils.getClientCertificateHeader())) { try { byte[] base64Encoded = Base64.encodeBase64(certificateFromMessageContext.getEncoded()); String base64EncodedString = APIMgtGatewayConstants.BEGIN_CERTIFICATE_STRING.concat(new String(base64Encoded)).concat( "\n").concat(APIMgtGatewayConstants.END_CERTIFICATE_STRING); base64EncodedString = Base64.encodeBase64URLSafeString(base64EncodedString.getBytes()); headers.put(Utils.getClientCertificateHeader(), base64EncodedString); } catch (javax.security.cert.CertificateEncodingException e) { log.error("Error while encoding certificate", e); } } } return true; }

Target:
public boolean handleRequest(MessageContext messageContext) { org.apache.axis2.context.MessageContext axis2MsgContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); Map headers = (Map) axis2MsgContext.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); try { X509Certificate clientCertificate = Utils.getClientCertificate(axis2MsgContext); headers.remove(Utils.getClientCertificateHeader()); if (clientCertificate != null) { byte[] encoded = Base64.encodeBase64(clientCertificate.getEncoded()); String base64EncodedString = APIMgtGatewayConstants.BEGIN_CERTIFICATE_STRING .concat(new String(encoded)).concat("\n") .concat(APIMgtGatewayConstants.END_CERTIFICATE_STRING); base64EncodedString = Base64.encodeBase64URLSafeString(base64EncodedString.getBytes()); headers.put(Utils.getClientCertificateHeader(), base64EncodedString); } } catch (APIManagementException | CertificateEncodingException e) { log.error("Error while converting client certificate", e); } return true; }
Source:
public void closeWithJS() { new JavascriptActions(driver).execute( "arguments[0].click();", driver.findElement(closeButtonSelector) ); }

Target:
public void closeWithJS() { clickByJS(closeButtonSelector); }
Source:
public void reportAction(Player reporter, Player reported, String report) { for (Player player : server.getOnlinePlayers()) { if (plugin.al.isAdmin(player)) { playerMsg(player, ChatColor.RED + "[REPORTS] " + ChatColor.GOLD + reporter.getName() + " has reported " + reported.getName() + " for " + report); } } public void adminHelp(Player sender, String message) { for (Player player : server.getOnlinePlayers()) { if (plugin.al.isAdmin(player)) { playerMsg(player, ChatColor.RED + "[ADMINHELP] " + ChatColor.GOLD + sender.getName() + ": " + message); } } } }

Target:
public void reportAction(Player reporter, Player reported, String report) { for (Player player : server.getOnlinePlayers()) { if (plugin.al.isAdmin(player)) { playerMsg(player, ChatColor.RED + "[REPORTS] " + ChatColor.GOLD + reporter.getName() + " has reported " + reported.getName() + " for " + report); } } }
Source:
void checkTier(Configured configuration, PluginExceptionConditionAccumulator accumulator, LocalizationContext localizationContext) { GoogleCredentials credentials = provider.getCredentials(); SQLAdmin sqlAdmin = credentials.getSQLAdmin(); String projectId = credentials.getProjectId(); String tierName = configuration.getConfigurationValue(TIER, localizationContext); try { List<Tier> tierList = sqlAdmin.tiers().list(projectId).execute().getItems(); if (tierList != null) { for (Tier tier : tierList) { if (tier.getTier().equals(tierName)) { return; } } } addError(accumulator, TIER, localizationContext, null, INVALID_TIER_MSG, tierName); } catch (IOException e) { throw new TransientProviderException(e); } }

Target:
void checkTier(Configured configuration, PluginExceptionConditionAccumulator accumulator, LocalizationContext localizationContext) { String tierName = configuration.getConfigurationValue(TIER, localizationContext); LOG.info(">> Querying tier'{}'", tierName); GoogleCredentials credentials = provider.getCredentials(); SQLAdmin sqlAdmin = credentials.getSQLAdmin(); String projectId = credentials.getProjectId(); try { List<Tier> tierList = sqlAdmin.tiers().list(projectId).execute().getItems(); if (tierList != null) { for (Tier tier : tierList) { if (tier.getTier().equals(tierName)) { return; } } } addError(accumulator, TIER, localizationContext, null, INVALID_TIER_MSG, tierName); } catch (IOException e) { throw new TransientProviderException(e); } }
Source:
public void run() { state = State.RUNNING; try { applicationProcess.pauseApplier( CoreStateDownloaderService.OPERATION_NAME ); while ( true ) { if ( Thread.interrupted() ) { break; } try { downloader.downloadSnapshot( leaderLocator.getLeader() ); applicationProcess.resumeApplier( CoreStateDownloaderService.OPERATION_NAME ); break; } catch ( StoreCopyFailedException e ) { log.error( "Failed to download snapshot. Retrying in ms.", timeout.getMillis(), e ); } catch ( NoLeaderFoundException e ) { log.warn( "No leader found. Retrying in ms.", timeout.getMillis() ); } LockSupport.parkNanos( TimeUnit.MILLISECONDS.toNanos( timeout.getMillis() ) ); timeout.increment(); } } finally { state = State.COMPLETED; } }

Target:
public void run() { if ( !moveToRunningState() ) { return; } try { applicationProcess.pauseApplier( OPERATION_NAME ); while ( keepRunning ) { try { downloader.downloadSnapshot( leaderLocator.getLeader() ); break; } catch ( StoreCopyFailedException e ) { log.error( "Failed to download snapshot. Retrying in ms.", timeout.getMillis(), e ); } catch ( NoLeaderFoundException e ) { log.warn( "No leader found. Retrying in ms.", timeout.getMillis() ); } Thread.sleep( timeout.getMillis() ); timeout.increment(); } } catch ( InterruptedException e ) { log.error( "Persistent snapshot downloader was interrupted" ); } finally { applicationProcess.resumeApplier( OPERATION_NAME ); state = State.COMPLETED; } }
Source:
protected void setDefaultLocale(Locale locale) throws Exception { assertThat(locale, is(notNullValue())); ConfigurationAdmin configAdmin = (ConfigurationAdmin) getService( Class.forName("org.osgi.service.cm.ConfigurationAdmin")); assertThat(configAdmin, is(notNullValue())); LocaleProvider localeProvider = (LocaleProvider) getService( Class.forName("org.eclipse.smarthome.core.i18n.LocaleProvider")); assertThat(localeProvider, is(notNullValue())); Configuration config = configAdmin.getConfiguration("org.eclipse.smarthome.core.i18nprovider", null); assertThat(config, is(notNullValue())); Dictionary<String, Object> properties = config.getProperties(); if (properties == null) { properties = new Hashtable<String, Object>(); } properties.put("language", locale.getLanguage()); properties.put("script", locale.getScript()); properties.put("region", locale.getCountry()); properties.put("variant", locale.getVariant()); config.update(properties); waitForAssert(new Closure<Object>(null) { private static final long serialVersionUID = -5083904877474902686L; public Object doCall() { assertThat(localeProvider.getLocale(), is(locale)); return null; } }); }

Target:
protected void setDefaultLocale(Locale locale) throws Exception { assertThat(locale, is(notNullValue())); ConfigurationAdmin configAdmin = (ConfigurationAdmin) getService( Class.forName("org.osgi.service.cm.ConfigurationAdmin")); assertThat(configAdmin, is(notNullValue())); LocaleProvider localeProvider = (LocaleProvider) getService( Class.forName("org.eclipse.smarthome.core.i18n.LocaleProvider")); assertThat(localeProvider, is(notNullValue())); Configuration config = configAdmin.getConfiguration("org.eclipse.smarthome.core.i18nprovider", null); assertThat(config, is(notNullValue())); Dictionary<String, Object> properties = config.getProperties(); if (properties == null) { properties = new Hashtable<>(); } properties.put("language", locale.getLanguage()); properties.put("script", locale.getScript()); properties.put("region", locale.getCountry()); properties.put("variant", locale.getVariant()); config.update(properties); waitForAssert(new Closure<Object>(null) { private static final long serialVersionUID = -5083904877474902686L; public Object doCall() { assertThat(localeProvider.getLocale(), is(locale)); return null; } }); }
Source:
public void encode(OutputStream stream, Map<String, String> headers) throws IOException { if (headers.isEmpty()) { return; } writeInt(stream, headers.size()); for (Entry<String, String> header : headers.entrySet()) { byte[] nameBytes = header.getKey().getBytes(UTF_8); byte[] valueBytes = header.getValue().getBytes(UTF_8); writeInt(stream, nameBytes.length); writeInt(stream, valueBytes.length); for (byte nameByte : nameBytes) { stream.write(nameByte); } for (byte valueByte : valueBytes) { stream.write(valueByte); } } }

Target:
public void encode(OutputStream stream, Map<String, String> headers) throws IOException { if (headers.isEmpty()) { return; } writeInt(stream, headers.size()); for (Entry<String, String> header : headers.entrySet()) { byte[] nameBytes = header.getKey().getBytes(UTF_8); writeInt(stream, nameBytes.length); stream.write(nameBytes); byte[] valueBytes = header.getValue().getBytes(UTF_8); writeInt(stream, valueBytes.length); stream.write(valueBytes); } }
Source:
public static void toJSON(OutputWriter outputWriter, Material material) { outputWriter.add("id", material.getId()) .add("name", material.getDisplayName()) .add("fingerprint", material.getFingerprint()) .add("type", material.getTypeForDisplay()) .add("description", material.getLongDescription()); }

Target:
public static void toJSON(OutputWriter outputWriter, Material material) { outputWriter .add("name", material.getDisplayName()) .add("fingerprint", material.getFingerprint()) .add("type", material.getTypeForDisplay()) .add("description", material.getLongDescription()); }
Source:
private Map<String, String> getVmMapDetails(UserVm userVm) { List<UserVmDetailVO> userVmDetails = _userVmDetailsDao.listDetails(userVm.getId()); Map<String, String> details = new HashMap<String, String>(); for (UserVmDetailVO detail : userVmDetails) { details.put(detail.getName(), detail.getValue()); } return details; }

Target:
protected Map<String, String> getVmMapDetails(UserVm userVm) { List<UserVmDetailVO> userVmDetails = _userVmDetailsDao.listDetails(userVm.getId()); Map<String, String> details = new HashMap<String, String>(); for (UserVmDetailVO detail : userVmDetails) { details.put(detail.getName(), detail.getValue()); } return details; }
Source:
public QueryControlResult delete(final String queryId) { final QueryControlResult queryControlResult = new QueryControlResult(); queryControlResult.setQueryId(queryId); try { planStore.delete(queryId); } catch (final IOException e) { e.printStackTrace(); queryControlResult.setIsSuccess(false); queryControlResult.setMsg("Fail: cannot delete " + queryId + "'s logical plan."); return queryControlResult; } if (deleteQueryFromManager(queryId)) { queryControlResult.setIsSuccess(true); queryControlResult.setMsg("Success: " + queryId + " is deleted."); } else { queryControlResult.setIsSuccess(false); queryControlResult.setMsg("Fail: There is no " + queryId); } return queryControlResult; }

Target:
public QueryControlResult delete(final String queryId) { final QueryControlResult queryControlResult = new QueryControlResult(); queryControlResult.setQueryId(queryId); try { planStore.delete(queryId); } catch (final IOException e) { e.printStackTrace(); queryControlResult.setIsSuccess(false); queryControlResult.setMsg(ResultMessage.planDeletionFail(queryId)); return queryControlResult; } if (deleteQueryFromManager(queryId)) { queryControlResult.setIsSuccess(true); queryControlResult.setMsg(ResultMessage.deleteSuccess(queryId)); } else { queryControlResult.setIsSuccess(false); queryControlResult.setMsg(ResultMessage.noQueryId(queryId)); } return queryControlResult; }
Source:
private OnHeapValueHolder<V> newUpdateValueHolder(K key, V oldValue, V newValue, long now, long oldExpirationTime, StoreEventSink<K, V> eventSink) { if (newValue == null) { throw new NullPointerException(); } Duration duration = Duration.ZERO; try { duration = expiry.getExpiryForUpdate(key, oldValue, newValue); } catch (RuntimeException re) { LOG.error("Expiry computation caused an exception - Expiry duration will be 0 ", re); } if (Duration.ZERO.equals(duration)) { eventSink.removed(key, oldValue); return null; } long expirationTime; if (duration == null) { expirationTime = oldExpirationTime; } else { if (duration.isForever()) { expirationTime = ValueHolder.NO_EXPIRE; } else { expirationTime = safeExpireTime(now, duration); } } OnHeapValueHolder<V> holder = null; try { holder = makeValue(key, newValue, now, expirationTime, this.valueCopier); eventSink.updated(key, oldValue, newValue); } catch (LimitExceededException e) { LOG.warn(e.getMessage()); } return holder; }

Target:
private OnHeapValueHolder<V> newUpdateValueHolder(K key, V oldValue, V newValue, long now, long oldExpirationTime, StoreEventSink<K, V> eventSink) { if (newValue == null) { throw new NullPointerException(); } Duration duration = Duration.ZERO; try { duration = expiry.getExpiryForUpdate(key, oldValue, newValue); } catch (RuntimeException re) { LOG.error("Expiry computation caused an exception - Expiry duration will be 0 ", re); } if (Duration.ZERO.equals(duration)) { eventSink.removed(key, oldValue); return null; } long expirationTime; if (duration == null) { expirationTime = oldExpirationTime; } else { if (duration.isForever()) { expirationTime = ValueHolder.NO_EXPIRE; } else { expirationTime = safeExpireTime(now, duration); } } OnHeapValueHolder<V> holder = null; try { holder = makeValue(key, newValue, now, expirationTime, this.valueCopier); eventSink.updated(key, oldValue, newValue); } catch (LimitExceededException e) { LOG.warn(e.getMessage()); eventSink.removed(key, oldValue); } return holder; }
Source:
public Object getAdapter(Class required) { if (IContentOutlinePage.class.equals(required)) { return getOutlinePage(); } else if (required == IShowInTargetList.class) { return new IShowInTargetList() { @Override @SuppressWarnings("deprecation") public String[] getShowInTargetIds() { return new String[] { IPageLayout.ID_PROJECT_EXPLORER, IPageLayout.ID_OUTLINE, IPageLayout.ID_RES_NAV }; } }; } else if (required == IShowInSource.class) { ICElement ce= null; ce= getElementAt(getSourceViewer().getSelectedRange().x, false); if (ce instanceof ITranslationUnit) { ce = null; } final ISelection selection= ce != null ? new StructuredSelection(ce) : null; return new IShowInSource() { @Override public ShowInContext getShowInContext() { return new ShowInContext(getEditorInput(), selection); } }; } else if (ProjectionAnnotationModel.class.equals(required)) { if (fProjectionSupport != null) { Object adapter = fProjectionSupport.getAdapter(getSourceViewer(), required); if (adapter != null) return adapter; } } else if (IContextProvider.class.equals(required)) { return new CUIHelp.CUIHelpContextProvider(this); } else if (IGotoMarker.class.equals(required)) { IGotoMarker gotoMarker= new GotoMarkerAdapter(); return gotoMarker; } else if (ITemplatesPage.class.equals(required)) { if (fTemplatesPage == null) { fTemplatesPage = new CTemplatesPage(this); } return fTemplatesPage; } else if (ITranslationUnitProvider.class == required) return this; return super.getAdapter(required); }

Target:
public Object getAdapter(Class required) { if (IContentOutlinePage.class.equals(required)) { return getOutlinePage(); } else if (required == IShowInTargetList.class) { return new IShowInTargetList() { @Override @SuppressWarnings("deprecation") public String[] getShowInTargetIds() { return new String[] { IPageLayout.ID_PROJECT_EXPLORER, IPageLayout.ID_OUTLINE, IPageLayout.ID_RES_NAV }; } }; } else if (required == IShowInSource.class) { ICElement ce= null; ce= getElementAt(getSourceViewer().getSelectedRange().x, false); if (ce instanceof ITranslationUnit) { ce = null; } final ISelection selection= ce != null ? new StructuredSelection(ce) : null; return new IShowInSource() { @Override public ShowInContext getShowInContext() { return new ShowInContext(getEditorInput(), selection); } }; } else if (ProjectionAnnotationModel.class.equals(required)) { if (fProjectionSupport != null) { Object adapter = fProjectionSupport.getAdapter(getSourceViewer(), required); if (adapter != null) return adapter; } } else if (IContextProvider.class.equals(required)) { return new CUIHelp.CUIHelpContextProvider(this); } else if (IGotoMarker.class.equals(required)) { IGotoMarker gotoMarker= new GotoMarkerAdapter(); return gotoMarker; } else if (ITemplatesPage.class.equals(required)) { if (fTemplatesPage == null) { fTemplatesPage = new CTemplatesPage(this); } return fTemplatesPage; } else if (ITranslationUnitHolder.class == required) return this; return super.getAdapter(required); }
Source:
DatanodeCommand cacheReport() throws IOException { if (dn.getFSDataset().getCacheCapacity() == 0) { return null; } DatanodeCommand cmd = null; final long startTime = monotonicNow(); if (startTime - lastCacheReport > dnConf.cacheReportInterval) { if (LOG.isDebugEnabled()) { LOG.debug("Sending cacheReport from service actor: " + this); } lastCacheReport = startTime; String bpid = bpos.getBlockPoolId(); List<Long> blockIds = dn.getFSDataset().getCacheReport(bpid); long createTime = monotonicNow(); cmd = bpNamenode.cacheReport(bpRegistration, bpid, blockIds); long sendTime = monotonicNow(); long sendCost = sendTime - createTime; dn.getMetrics().addCacheReport(sendCost); if (LOG.isDebugEnabled()) { LOG.debug("CacheReport of " + blockIds.size() + " block(s) took " + (createTime - startTime) + " msecs to generate and " + sendCost + " msecs for RPC and NN processing"); } } return cmd; }

Target:
DatanodeCommand cacheReport() throws IOException { if (dn.getFSDataset().getCacheCapacity() == 0) { return null; } DatanodeCommand cmd = null; final long startTime = monotonicNow(); if (startTime - lastCacheReport > dnConf.cacheReportInterval) { if (LOG.isDebugEnabled()) { LOG.debug("Sending cacheReport from service actor: " + this); } lastCacheReport = startTime; String bpid = bpos.getBlockPoolId(); List<Long> blockIds = dn.getFSDataset().getCacheReport(bpid); long createTime = monotonicNow(); cmd = bpNamenode.cacheReport(bpRegistration, bpid, blockIds); long sendTime = monotonicNow(); long createCost = createTime - startTime; long sendCost = sendTime - createTime; dn.getMetrics().addCacheReport(sendCost); if (LOG.isDebugEnabled()) { LOG.debug("CacheReport of " + blockIds.size() + " block(s) took " + createCost + " msecs to generate and " + sendCost + " msecs for RPC and NN processing"); } } return cmd; }
Source:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); listener = new SharedPreferences.OnSharedPreferenceChangeListener() { @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) { if(s.equals(getString(R.string.minimize_on_exit_key))){ String newSetting = sharedPreferences.getString(s,null); if(newSetting != null){ if(newSetting.equals(getString(R.string.minimize_on_exit_popup_key))){ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(getContext())){ Snackbar.make(getListView(),R.string.permission_display_over_apps,Snackbar.LENGTH_INDEFINITE) .setAction(R.string.settings, new View.OnClickListener() { @Override public void onClick(View view) { PermissionHelper.checkSystemAlertWindowPermission(getContext()); } }) .show(); } } } } } }; }

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); listener = (sharedPreferences, s) -> { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && s.equals(getString(R.string.minimize_on_exit_key))) { String newSetting = sharedPreferences.getString(s, null); if (newSetting != null && newSetting.equals(getString(R.string.minimize_on_exit_popup_key)) && !Settings.canDrawOverlays(getContext())) { Snackbar.make(getListView(), R.string.permission_display_over_apps, Snackbar.LENGTH_INDEFINITE) .setAction(R.string.settings, view -> PermissionHelper.checkSystemAlertWindowPermission(getContext())) .show(); } } }; }
Source:
private void assertTagExists(TableName table) throws IOException { List<Cell> values = new ArrayList<>(); for (HRegion region : UTIL.getHBaseCluster().getRegions(table)) { values.clear(); Scan scan = new Scan(); scan.setRaw(true); scan.readAllVersions(); scan.withStartRow(ROW1); RegionScanner scanner = region.getScanner(scan); scanner.next(values); if (!values.isEmpty()) { break; } } boolean deleteFound = false; for (Cell cell: values) { if (PrivateCellUtil.isDelete(cell.getType().getCode())) { deleteFound = true; List<Tag> tags = PrivateCellUtil.getTags(cell); Assert.assertEquals(1, tags.size()); for (Tag tag : tags) { Assert.assertEquals(TEST_TAG, Tag.getValueAsString(tag)); } } } Assert.assertTrue(deleteFound); }

Target:
private void assertTagExists(TableName table) throws IOException { List<Cell> values = new ArrayList<>(); for (HRegion region : UTIL.getHBaseCluster().getRegions(table)) { Scan scan = new Scan(); scan.setRaw(true); scan.readAllVersions(); scan.withStartRow(ROW1); RegionScanner scanner = region.getScanner(scan); scanner.next(values); if (!values.isEmpty()) { break; } } boolean deleteFound = false; for (Cell cell: values) { if (PrivateCellUtil.isDelete(cell.getType().getCode())) { deleteFound = true; List<Tag> tags = PrivateCellUtil.getTags(cell); Assert.assertEquals(1, tags.size()); for (Tag tag : tags) { Assert.assertEquals(TEST_TAG, Tag.getValueAsString(tag)); } } } Assert.assertTrue(deleteFound); }
Source:
private String getLongleafScript(String outputPath) throws Exception { String scriptContent = "#!/usr/bin/env bash\necho $@ >> " + outputPath; File longleafScript = File.createTempFile("longleaf", ".sh"); FileUtils.write(longleafScript, scriptContent, "UTF-8"); longleafScript.deleteOnExit(); Runtime.getRuntime().exec("chmod u+x " + longleafScript.getAbsolutePath()); return longleafScript.getAbsolutePath(); }

Target:
private String getLongleafScript(String outputPath) throws Exception { String scriptContent = "#!/usr/bin/env bash\necho $@ >> " + outputPath; File longleafScript = File.createTempFile("longleaf", ".sh"); FileUtils.write(longleafScript, scriptContent, "UTF-8"); longleafScript.deleteOnExit(); Set<PosixFilePermission> ownerExecutable = PosixFilePermissions.fromString("r-x------"); Files.setPosixFilePermissions(longleafScript.toPath(), ownerExecutable); return longleafScript.getAbsolutePath(); }
Source:
public URI getWorkingDirectoryURI() { if (!fDirectoryStack.isEmpty()) return fDirectoryStack.lastElement(); return fBaseDirectoryURI; }

Target:
public URI getWorkingDirectoryURI() { if (!fDirectoryStack.isEmpty()) { return fDirectoryStack.lastElement(); } return fBaseDirectoryURI; }
Source:
public static Person toPerson(OpenMRSPerson person, boolean includeNames) { Person converted = new Person(); converted.setUuid(person.getPersonId()); if (person.getDateOfBirth() != null) { converted.setBirthdate(person.getDateOfBirth().toDate()); } if (person.getDeathDate() != null) { converted.setDeathDate(person.getDeathDate().toDate()); } converted.setBirthdateEstimated((Boolean) ObjectUtils.defaultIfNull(person.getBirthDateEstimated(), false)); converted.setDead((Boolean) ObjectUtils.defaultIfNull(person.getDead(), false)); converted.setCauseOfDeath(toConcept(person.getCauseOfDeath())); converted.setGender(person.getGender()); if (includeNames) { PreferredName name = new PreferredName(); name.setGivenName(person.getFirstName()); name.setMiddleName(person.getMiddleName()); name.setFamilyName(person.getLastName()); List<PreferredName> names = new ArrayList<PreferredName>(); names.add(name); converted.setNames(names); PreferredAddress address = new PreferredAddress(); address.setAddress1(person.getAddress()); List<PreferredAddress> addresses = new ArrayList<PreferredAddress>(); addresses.add(address); converted.setAddresses(addresses); } return converted; }

Target:
public static Person toPerson(OpenMRSPerson person, boolean includeNames) { Person converted = new Person(); converted.setUuid(person.getPersonId()); if (person.getDateOfBirth() != null) { converted.setBirthdate(person.getDateOfBirth().toDate()); } if (person.getDeathDate() != null) { converted.setDeathDate(person.getDeathDate().toDate()); } converted.setBirthdateEstimated((Boolean) ObjectUtils.defaultIfNull(person.getBirthDateEstimated(), false)); converted.setDead((Boolean) ObjectUtils.defaultIfNull(person.getDead(), false)); if (person.getCauseOfDeath() != null) { converted.setCauseOfDeath(toConcept(person.getCauseOfDeath())); } converted.setGender(person.getGender()); if (includeNames) { PreferredName name = new PreferredName(); name.setGivenName(person.getFirstName()); name.setMiddleName(person.getMiddleName()); name.setFamilyName(person.getLastName()); List<PreferredName> names = new ArrayList<PreferredName>(); names.add(name); converted.setNames(names); PreferredAddress address = new PreferredAddress(); address.setAddress1(person.getAddress()); List<PreferredAddress> addresses = new ArrayList<PreferredAddress>(); addresses.add(address); converted.setAddresses(addresses); } return converted; }
Source:
protected void setCallbackManager(final CallbackManager manager) { if (manager == null) { return; } callbackManager.shutdown(); callbackManager = manager; }

Target:
protected void setCallbackManager(final CallbackManager manager) { if (manager == null) { throw new NullPointerException("setCallbackManager can not be called with a null parameter."); } else if (callbackManager != null) { throw new IllegalStateException("setCallbackManager can only be called once."); } callbackManager = manager; }
Source:
@Override public final void start(GridCacheSharedContext<K, V> cctx) throws IgniteCheckedException { if (!starting.compareAndSet(false, true)) assert false : "Method start is called more than once for manager: " + this; assert cctx != null; this.cctx = cctx; log = cctx.logger(getClass()); diagnosticLog = cctx.logger(DIAGNOSTIC_LOG_CATEGORY); MetricRegistry sysreg = cctx.kernalContext().metric().registry(CACHE_METRICS); lastDataVer = sysreg.longMetric("LastDataVersion", "Node start time."); start0(); if (log.isDebugEnabled()) log.debug(startInfo()); }

Target:
@Override public final void start(GridCacheSharedContext<K, V> cctx) throws IgniteCheckedException { if (!starting.compareAndSet(false, true)) assert false : "Method start is called more than once for manager: " + this; assert cctx != null; this.cctx = cctx; log = cctx.logger(getClass()); diagnosticLog = cctx.logger(DIAGNOSTIC_LOG_CATEGORY); start0(); if (log.isDebugEnabled()) log.debug(startInfo()); }
Source:
public void setSymbolResolver(SymbolResolver symbolResolver) { this.symbolResolver = symbolResolver; }

Target:
public ParserConfiguration setSymbolResolver(SymbolResolver symbolResolver) { this.symbolResolver = symbolResolver; return this; }
Source:
public synchronized void onJobFinish(final int numReleasedResources) { numAvailableResources += numReleasedResources; while (!jobWaitingQueue.isEmpty()) { final JobEntity jobEntity = jobWaitingQueue.peek(); final int numResourcesToUse = jobEntity.getNumWorkers() + jobEntity.getNumServers(); if (numAvailableResources >= numResourcesToUse) { LOG.log(Level.INFO, "Start job {0} with {1} resources. Remaining free resources: {2}", new Object[]{jobEntity.getJobId(), numAvailableResources, numAvailableResources - numResourcesToUse}); numAvailableResources -= numResourcesToUse; jobServerDriverFuture.get().executeJob(jobEntity); jobWaitingQueue.poll(); } else { break; } } }

Target:
public synchronized void onJobFinish(final int numReleasedResources) { numAvailableResources += numReleasedResources; while (!jobWaitingQueue.isEmpty()) { final JobEntity jobEntity = jobWaitingQueue.peek(); if (tryExecute(jobEntity)) { jobWaitingQueue.poll(); } else { break; } } }
Source:
public String getLinkAt(int offset) { for (int i = 0; i < linkRanges.size(); i++) { if (linkRanges.get(i).isOffsetInRange(offset)) { return hrefs.get(i); } } return null; }

Target:
public Optional<String> getLinkAt(int offset) { for (int i = 0; i < linkRanges.size(); i++) { if (linkRanges.get(i).contains(offset)) { return Optional.of(hrefs.get(i)); } } return Optional.empty(); }
Source:
public void setValue(String value, boolean fireEvents) { clearSelections(); for (String valueInProcess : Arrays.asList(value.split(","))) { int selectedIndex = getIndexFromDate(valueInProcess); if (clickedList.get(selectedIndex) != null) { clickedList.set(selectedIndex, true); onSelectedItemsChange(selectedIndex + 1, true); } } if (fireEvents) { ValueChangeEvent.fire(this, value); } }

Target:
public void setValue(String value, boolean fireEvents) { clearSelections(); if (value != null && !value.isEmpty()) { for (String valueInProcess : Arrays.asList(value.split(","))) { int selectedIndex = getIndexFromDate(valueInProcess); if (clickedList.get(selectedIndex) != null) { clickedList.set(selectedIndex, true); onSelectedItemsChange(selectedIndex + 1, true); } } if (fireEvents) { ValueChangeEvent.fire(this, value); } } }
Source:
public void setActive(boolean isActive) { this.isActive = isActive; }

Target:
public void setActive(boolean isActive) { this.isActive = isActive; logger.info("QueueProcessorThread active turned " + this.isActive); }
Source:
public void obtain_date_from_year_month_day_values() { final int year = 1976; final int month = 3; final int day = 1; final LocalDate birthday = LocalDates.of(1976, MonthOfYear.APRIL, 1); final Calendar calendar = Calendar.getInstance(); calendar.set(year, month, day); assertEquals(calendar.get(Calendar.YEAR), birthday.getYear()); assertEquals(calendar.get(Calendar.MONTH) + 1, birthday.getMonthValue()); assertEquals(calendar.get(Calendar.DAY_OF_MONTH), birthday.getDay()); }

Target:
public void obtain_date_from_year_month_day_values() { final LocalDate localDate = LocalDates.of(year, month, day); assertTrue(year == localDate.getYear()); assertTrue(month == localDate.getMonth()); assertTrue(day == localDate.getDay()); }
Source:
void clearShadowTables() { CorfuStoreMetadata.Timestamp timestamp = logReplicationMetadataManager.getTimestamp(); long persistSiteConfigID = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); long persistSnapStart = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_STARTED); long persistSnapTransferred = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_TRANSFERRED); long persitSeqNum = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_SEQ_NUM); if (siteConfigID != persistSiteConfigID || srcGlobalSnapshot != persistSnapStart || srcGlobalSnapshot <= persistSnapTransferred || persitSeqNum != Address.NON_ADDRESS) { log.warn("Skip current processing as the persistent metadata shows the current operation is out of date " + "current siteConfigID srcGlobalSnapshot {}", logReplicationMetadataManager, siteConfigID, srcGlobalSnapshot); return; } TxBuilder txBuilder = logReplicationMetadataManager.getTxBuilder(); logReplicationMetadataManager.appendUpdate(txBuilder, LogReplicationMetadataManager.LogReplicationMetadataType.TOPOLOGY_CONFIG_ID, siteConfigID); for (UUID streamID : streamViewMap.keySet()) { UUID usedStreamID = uuidMap.get(streamID); SMREntry entry = new SMREntry("clear", new Array[0], Serializers.PRIMITIVE); txBuilder.logUpdate(usedStreamID, entry); } txBuilder.commit(timestamp); }

Target:
void clearShadowTables() { CorfuStoreMetadata.Timestamp timestamp = logReplicationMetadataManager.getTimestamp(); long persistSiteConfigID = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); long persistSnapStart = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_STARTED); long persistSnapTransferred = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_TRANSFERRED); long persitSeqNum = logReplicationMetadataManager.query(timestamp, LogReplicationMetadataManager.LogReplicationMetadataType.LAST_SNAPSHOT_SEQ_NUM); if (topologyConfigID != persistSiteConfigID || srcGlobalSnapshot != persistSnapStart || srcGlobalSnapshot <= persistSnapTransferred || persitSeqNum != Address.NON_ADDRESS) { log.warn("Skip current processing as the persistent metadata shows the current operation is out of date " + "current topologyConfigID srcGlobalSnapshot {}", logReplicationMetadataManager, topologyConfigID, srcGlobalSnapshot); return; } TxBuilder txBuilder = logReplicationMetadataManager.getTxBuilder(); logReplicationMetadataManager.appendUpdate(txBuilder, LogReplicationMetadataManager.LogReplicationMetadataType.TOPOLOGY_CONFIG_ID, topologyConfigID); for (UUID streamID : streamViewMap.keySet()) { UUID usedStreamID = uuidMap.get(streamID); SMREntry entry = new SMREntry("clear", new Array[0], Serializers.PRIMITIVE); txBuilder.logUpdate(usedStreamID, entry); } txBuilder.commit(timestamp); }