auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private CleanerTransformations getDefaultCleanerTransformations(HTMLCleanerConfiguration configuration) { CleanerTransformations defaultTransformations = new TrimAttributeCleanerTransformations(); TrimAttributeTagTransformation tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_B, HTMLConstants.TAG_STRONG, false); defaultTransformations.addTransformation(tt); tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_I, HTMLConstants.TAG_EM, false); defaultTransformations.addTransformation(tt); tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_U, HTMLConstants.TAG_INS, false); defaultTransformations.addTransformation(tt); tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_S, HTMLConstants.TAG_DEL, false); defaultTransformations.addTransformation(tt); tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_STRIKE, HTMLConstants.TAG_DEL, false); defaultTransformations.addTransformation(tt); tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_CENTER, HTMLConstants.TAG_P, false); tt.addAttributeTransformation(HTMLConstants.ATTRIBUTE_STYLE, "text-align:center"); defaultTransformations.addTransformation(tt); String restricted = configuration.getParameters().get(HTMLCleanerConfiguration.RESTRICTED); if ("true".equalsIgnoreCase(restricted)) { tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_SCRIPT, HTMLConstants.TAG_PRE, false); defaultTransformations.addTransformation(tt); tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_STYLE, HTMLConstants.TAG_PRE, false); defaultTransformations.addTransformation(tt); } return defaultTransformations; }

Target:
private CleanerTransformations getDefaultCleanerTransformations(HTMLCleanerConfiguration configuration) { CleanerTransformations defaultTransformations = new TrimAttributeCleanerTransformations(); TagTransformation tt = new TagTransformation(HTMLConstants.TAG_B, HTMLConstants.TAG_STRONG, false); defaultTransformations.addTransformation(tt); tt = new TagTransformation(HTMLConstants.TAG_I, HTMLConstants.TAG_EM, false); defaultTransformations.addTransformation(tt); tt = new TagTransformation(HTMLConstants.TAG_U, HTMLConstants.TAG_INS, false); defaultTransformations.addTransformation(tt); tt = new TagTransformation(HTMLConstants.TAG_S, HTMLConstants.TAG_DEL, false); defaultTransformations.addTransformation(tt); tt = new TagTransformation(HTMLConstants.TAG_STRIKE, HTMLConstants.TAG_DEL, false); defaultTransformations.addTransformation(tt); tt = new TagTransformation(HTMLConstants.TAG_CENTER, HTMLConstants.TAG_P, false); tt.addAttributeTransformation(HTMLConstants.ATTRIBUTE_STYLE, "text-align:center"); defaultTransformations.addTransformation(tt); String restricted = configuration.getParameters().get(HTMLCleanerConfiguration.RESTRICTED); if ("true".equalsIgnoreCase(restricted)) { tt = new TagTransformation(HTMLConstants.TAG_SCRIPT, HTMLConstants.TAG_PRE, false); defaultTransformations.addTransformation(tt); tt = new TagTransformation(HTMLConstants.TAG_STYLE, HTMLConstants.TAG_PRE, false); defaultTransformations.addTransformation(tt); } return defaultTransformations; }
Source:
private void createStack(AmazonCloudFormation cfn) throws IOException { String stackName = getStackName(); String cfnTemplateUrl = getCfnTemplateUrl(); File cfnTemplateFile = getCfnTemplateFile(); List<Parameter> cfnStackParams = getCfnStackParams(); List<Tag> cfnStackTags = getCfnStackTags(); String cfnStackPolicyUrl = getCfnStackPolicyUrl(); File cfnStackPolicyFile = getCfnStackPolicyFile(); String cfnOnFailure = getCfnOnFailure(); getLogger().info("create stack: {}", stackName); CreateStackRequest req = new CreateStackRequest() .withStackName(stackName) .withParameters(cfnStackParams) .withTags(cfnStackTags) .withOnFailure(cfnOnFailure); if (Strings.isNullOrEmpty(cfnTemplateUrl) == false) { req.setTemplateURL(cfnTemplateUrl); } else { req.setTemplateBody(FileUtils.readFileToString(cfnTemplateFile)); } if (isCapabilityIam()) { Capability selectedCapability = (useCapabilityIam == null) ? Capability.CAPABILITY_IAM : useCapabilityIam; getLogger().info("Using policy: " + selectedCapability); req.setCapabilities(Arrays.asList(selectedCapability.toString())); } if (!Strings.isNullOrEmpty(cfnStackPolicyUrl)) { req.setStackPolicyURL(cfnStackPolicyUrl); } else if (cfnStackPolicyFile != null) { req.setStackPolicyBody( FileUtils.readFileToString(cfnStackPolicyFile)); } CreateStackResult createStackResult = cfn.createStack(req); getLogger().info("create requested: {}", createStackResult.getStackId()); }

Target:
private void createStack(AmazonCloudFormation cfn) throws IOException { String stackName = getStackName(); String cfnTemplateUrl = getCfnTemplateUrl(); File cfnTemplateFile = getCfnTemplateFile(); List<Parameter> cfnStackParams = getCfnStackParams(); List<Tag> cfnStackTags = getCfnStackTags(); String cfnStackPolicyUrl = getCfnStackPolicyUrl(); File cfnStackPolicyFile = getCfnStackPolicyFile(); String cfnOnFailure = getCfnOnFailure(); getLogger().info("create stack: {}", stackName); CreateStackRequest req = new CreateStackRequest() .withStackName(stackName) .withParameters(cfnStackParams) .withTags(cfnStackTags) .withOnFailure(cfnOnFailure); if (Strings.isNullOrEmpty(cfnTemplateUrl) == false) { req.setTemplateURL(cfnTemplateUrl); } else { req.setTemplateBody(FileUtils.readFileToString(cfnTemplateFile)); } if (isCapabilityIam()) { Capability selectedCapability = (useCapabilityIam == null) ? Capability.CAPABILITY_IAM : useCapabilityIam; getLogger().info("Using policy: " + selectedCapability); req.setCapabilities(Arrays.asList(selectedCapability.toString())); } if (Strings.isNullOrEmpty(cfnStackPolicyUrl) == false) { req.setStackPolicyURL(cfnStackPolicyUrl); } else if (cfnStackPolicyFile != null) { req.setStackPolicyBody( FileUtils.readFileToString(cfnStackPolicyFile)); } CreateStackResult createStackResult = cfn.createStack(req); getLogger().info("create requested: {}", createStackResult.getStackId()); }
Source:
protected ITabDescriptor[] filterTabDescriptors( ITabDescriptor[] descriptors, IWorkbenchPart part, ISelection selection) { List result = new ArrayList(); for (ITabDescriptor descriptor2 : descriptors) { ITabDescriptor descriptor = adaptDescriptorFor(descriptor2, part, selection); if (!descriptor.getSectionDescriptors().isEmpty()) { result.add(descriptor); } } if (result.size() == 0) { return EMPTY_DESCRIPTOR_ARRAY; } return (ITabDescriptor[]) result.toArray(new ITabDescriptor[result .size()]); }

Target:
protected ITabDescriptor[] filterTabDescriptors( ITabDescriptor[] descriptors, IWorkbenchPart part, ISelection selection) { List result = new ArrayList(); for (ITabDescriptor descriptor : descriptors) { ITabDescriptor filteredDescriptor = adaptDescriptorFor(descriptor, part, selection); if (!filteredDescriptor.getSectionDescriptors().isEmpty()) { result.add(filteredDescriptor); } } if (result.size() == 0) { return EMPTY_DESCRIPTOR_ARRAY; } return (ITabDescriptor[]) result.toArray(new ITabDescriptor[result .size()]); }
Source:
public ChannelFuture register(final Channel channel, final ChannelPromise promise) { ObjectUtil.checkNotNull(promise, "promise"); ObjectUtil.checkNotNull(channel, "channel"). unsafe(). register(this, promise); return promise; }

Target:
public ChannelFuture register(final Channel channel, final ChannelPromise promise) { ObjectUtil.checkNotNull(promise, "promise"); ObjectUtil.checkNotNull(channel, "channel"); channel.unsafe().register(this, promise); return promise; }
Source:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); context.record( TransformLineageRecorderUtils.oneToOneIn(new ArrayList<>(encryptFields), "encrypt", "Encrypt specified fields using given algorithm.")); }

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); encryptFields = conf.getEncryptFields(); if (context.getInputSchema() == null || context.getInputSchema().getFields() == null) { return; } List<String> encryptedFields = TransformLineageRecorderUtils.getFields(context.getInputSchema()).stream() .filter(encryptFields::contains) .collect(Collectors.toList()); List<String> identityFields = TransformLineageRecorderUtils.getFields(context.getInputSchema()); identityFields.removeAll(encryptedFields); List<FieldOperation> output = new ArrayList<>(); output.addAll(TransformLineageRecorderUtils.generateOneToOnes(encryptedFields, "encrypt", "Encrypted the requested fields.")); output.addAll(TransformLineageRecorderUtils.generateOneToOnes(identityFields, "identity", TransformLineageRecorderUtils.IDENTITY_TRANSFORM_DESCRIPTION)); context.record(output); }
Source:
public void validate(Object obj, Errors errors){ ValidationUtils.invokeValidator(validator, obj, errors); ComponentTypeBackingForm form = (ComponentTypeBackingForm) obj; ValidationUtils.rejectIfEmpty(errors, "productType.productTypeName", "productTypeName.empty", "The productTypeName is required"); ValidationUtils.rejectIfEmpty(errors, "productType.productTypeNameShort", "productTypeNameShort.empty", "The productTypeNameShort is required"); ValidationUtils.rejectIfEmpty(errors, "productType.expiresAfter", "expiresAfter.empty", "The expiresAfter value is required"); ValidationUtils.rejectIfEmpty(errors, "productType.expiresAfterUnits", "expiresAfterUnits.empty", "The expiresAfterUnits value is required"); ValidationUtils.rejectIfEmpty(errors, "productType.description", "description.empty", "The description is required"); }

Target:
public void validate(Object obj, Errors errors) { ValidationUtils.rejectIfEmpty(errors, "componentType.componentTypeName", "componentTypeName.empty", "The componentTypeName is required"); ValidationUtils.rejectIfEmpty(errors, "componentType.componentTypeNameShort", "componentTypeNameShort.empty", "The componentTypeNameShort is required"); ValidationUtils.rejectIfEmpty(errors, "componentType.expiresAfter", "expiresAfter.empty", "The expiresAfter value is required"); ValidationUtils.rejectIfEmpty(errors, "componentType.expiresAfterUnits", "expiresAfterUnits.empty", "The expiresAfterUnits value is required"); ValidationUtils.rejectIfEmpty(errors, "componentType.description", "description.empty", "The description is required"); ValidationUtils.rejectIfEmpty(errors, "componentType.hasBloodGroup", "hasBloodGroup.empty", "The Has Blood Group is required"); ValidationUtils.rejectIfEmpty(errors, "componentType.producedComponentTypeCombinations", "producedComponentTypeCombinations.empty", "The Produced Component Type Combinations is required"); }
Source:
public void testSetToNullWhenNVPMSSetToNull() { User target = new User(); target.setAddress( "address" ); target.setEmail( "email" ); target.setName( "name" ); target.setPhone( 12345 ); target.setSettings( new String[]{ "test" } ); UserDTO source = new UserDTO(); source.setContactDataDTO( new ContactDataDTO() ); source.getContactDataDTO().setAddress( "newAddress" ); source.getContactDataDTO().setEmail( null ); source.getContactDataDTO().setPhone( null ); source.setName( null ); UserMapper.INSTANCE.updateUserFromUserDTO( source, target ); assertThat( target.getAddress() ).isEqualTo( "newAddress" ); assertThat( target.getEmail() ).isNull(); assertThat( target.getPhone() ).isNull(); assertThat( target.getName() ).isNull(); assertThat( target.getPreferences() ).isEmpty(); assertThat( target.getSettings() ).isNull(); }

Target:
public void testSetToNullWhenNVPMSSetToNull() { User target = new User(); target.setAddress( "address" ); target.setEmail( "email" ); target.setName( "name" ); target.setPhone( 12345 ); target.addPreference( "preference" ); target.setSettings( new String[]{ "test" } ); UserDTO source = new UserDTO(); source.setContactDataDTO( new ContactDataDTO() ); source.getContactDataDTO().setAddress( "newAddress" ); source.getContactDataDTO().setEmail( null ); source.getContactDataDTO().setPhone( null ); source.setName( null ); UserMapper.INSTANCE.updateUserFromUserDTO( source, target ); assertThat( target.getAddress() ).isEqualTo( "newAddress" ); assertThat( target.getEmail() ).isNull(); assertThat( target.getPhone() ).isNull(); assertThat( target.getName() ).isNull(); assertThat( target.getPreferences() ).containsOnly( "preference" ); assertThat( target.getSettings() ).isNull(); }
Source:
public static void logStringToSign(ClientLogger logger, String stringToSign, Context context) { if (context != null && Boolean.TRUE.equals(context.getData(Constants.STORAGE_LOG_STRING_TO_SIGN).orElse(false))) { logger.info("The string to sign computed by the SDK is: {}{}", stringToSign, System.getProperty("line.separator")); logger.warning("Please remember to disable '{}' before going to production as this " + "string can potentially contain PII.", Constants.STORAGE_LOG_STRING_TO_SIGN); } }

Target:
public static void logStringToSign(ClientLogger logger, String stringToSign, Context context) { if (context != null && Boolean.TRUE.equals(context.getData(Constants.STORAGE_LOG_STRING_TO_SIGN).orElse(false))) { logger.info(STRING_TO_SIGN_LOG_INFO_MESSAGE, stringToSign, System.lineSeparator()); logger.warning(STRING_TO_SIGN_LOG_WARNING_MESSAGE, Constants.STORAGE_LOG_STRING_TO_SIGN); } }
Source:
public Long create(String type, long entityId, ChangeLog changeLog) { ChangeLogType changeLogType = ChangeLogType.get(type); ChangeLog result = changeLogType.create(); result.setColumnsChanged(changeLog.getColumnsChanged()); result.setId(changeLog.getId()); result.setSummary(changeLog.getSummary()); result.setTime(new Date()); result.setUser(changeLog.getUser()); return (Long) currentSession().save(result); }

Target:
public Long create(String type, long entityId, ChangeLog changeLog) { ChangeLogType changeLogType = ChangeLogType.get(type); ChangeLog result = changeLogType.create(); result.setColumnsChanged(changeLog.getColumnsChanged()); result.setId(entityId); result.setSummary(changeLog.getSummary()); result.setTime(new Date()); result.setUser(changeLog.getUser()); return (Long) currentSession().save(result); }
Source:
public ResourceWithType waitForResourceContaining(String feed, String rType, String containing, long sleep, int attempts) throws Throwable { for (int i = 0; i < attempts; i++) { Optional<ResourceWithType> resource = getResourceByType(feed, rType, 0) .stream() .filter(e -> containing == null || e.getId().contains(containing)) .findFirst(); if (resource.isPresent()) { return resource.get(); } Thread.sleep(sleep); } throw new AssertionError("Resource [type=" + rType + ", containing=" + containing + "] not found after " + attempts + " attempts."); }

Target:
public ResourceWithType waitForResourceContaining(String feed, String rType, String containing, long sleep, int attempts) throws Throwable { for (int i = 0; i < attempts; i++) { Optional<ResourceWithType> resource = getResourceByType(feed, rType, 0) .stream() .filter(e -> containing == null || e.getName().contains(containing)) .findFirst(); if (resource.isPresent()) { return resource.get(); } Thread.sleep(sleep); } throw new AssertionError("Resource [type=" + rType + ", containing=" + containing + "] not found after " + attempts + " attempts."); }
Source:
public static boolean zipDirectory(String inputDirectory, String absoluteFileName) throws FileNotFoundException, IOException { FileOutputStream outputStream = null; ZipOutputStream zipOutputStream = null; try { outputStream = new FileOutputStream(absoluteFileName); zipOutputStream = new ZipOutputStream(outputStream); Iterator<File> directoryContentsItr = FileUtils.iterateFiles(new File(inputDirectory), null, false); while(directoryContentsItr.hasNext()) { File file = directoryContentsItr.next(); if (!file.isDirectory()) { FileInputStream inputStream = null; boolean written = false; try { inputStream = new FileInputStream(file); ZipEntry zipEntry = new ZipEntry(file.getName()); zipOutputStream.putNextEntry(zipEntry); byte[] bytes = new byte[1024]; int length; while ((length = inputStream.read(bytes)) >= 0) { zipOutputStream.write(bytes, 0, length); } written = true; } finally { if(written) { zipOutputStream.closeEntry(); } if(inputStream != null) { inputStream.close(); } } } } } finally { if(zipOutputStream != null) { zipOutputStream.close(); } if(outputStream != null) { outputStream.close(); } } return true; }

Target:
public static boolean zipDirectory(String inputDirectory, String absoluteFileName) throws FileNotFoundException, IOException { try(FileOutputStream outputStream = new FileOutputStream(absoluteFileName); ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) { Iterator<File> directoryContentsItr = FileUtils.iterateFiles(new File(inputDirectory), null, false); while(directoryContentsItr.hasNext()) { File file = directoryContentsItr.next(); if (!file.isDirectory()) { FileInputStream inputStream = null; boolean written = false; try { inputStream = new FileInputStream(file); ZipEntry zipEntry = new ZipEntry(file.getName()); zipOutputStream.putNextEntry(zipEntry); IOUtils.copy(inputStream, zipOutputStream); written = true; } finally { if(written) { zipOutputStream.finish(); zipOutputStream.flush(); } if(inputStream != null) { inputStream.close(); } } } } } return true; }
Source:
public boolean containsAll(IntSet set) { throw new UnsupportedOperationException(); }

Target:
public boolean containsAll(IntSet set) { return this.set.containsAll(set); }
Source:
public static Uri getOptimizedMedia(Activity activity, SiteModel siteModel, String path, boolean isVideo) { if (isVideo) { return null; } SiteSettingsInterface siteSettings = SiteSettingsInterface.getInterface(activity, siteModel, null); if (siteSettings != null && siteSettings.init(false).getOptimizedImage()) { int resizeWidth = MediaUtils.getImageWidthSettingFromString(siteSettings.getMaxImageWidth()); int quality = siteSettings.getImageQuality(); if (resizeWidth == Integer.MAX_VALUE && quality == 100) { return null; } String optimizedPath = ImageUtils.optimizeImage(activity, path, resizeWidth, quality); if (optimizedPath == null) { AppLog.e(AppLog.T.EDITOR, "Optimized picture was null!"); AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZE_ERROR); } else { AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZED); return Uri.parse(optimizedPath); } } return null; }

Target:
public static Uri getOptimizedMedia(Activity activity, SiteModel siteModel, String path, boolean isVideo) { if (isVideo) { return null; } SiteSettingsInterface siteSettings = SiteSettingsInterface.getInterface(activity, siteModel, null); if (siteSettings != null && siteSettings.init(false).getOptimizedImage()) { int resizeWidth = siteSettings.getMaxImageWidth() > 0 ? siteSettings.getMaxImageWidth() : Integer.MAX_VALUE; int quality = siteSettings.getImageQuality(); if (resizeWidth == Integer.MAX_VALUE && quality == 100) { return null; } String optimizedPath = ImageUtils.optimizeImage(activity, path, resizeWidth, quality); if (optimizedPath == null) { AppLog.e(AppLog.T.EDITOR, "Optimized picture was null!"); AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZE_ERROR); } else { AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZED); return Uri.parse(optimizedPath); } } return null; }
Source:
public ISectionDescriptorProvider getSectionDescriptorProvider(String contributorId) { ISectionDescriptorProvider legacyPropertySectionDescriptorProvider = null; Collection<IItemDescriptor> values = this.id2descriptors.values(); for (IItemDescriptor itemDescriptor : values) { if (itemDescriptor instanceof LegacyPropertyContributorItemDescriptor) { if (contributorId != null && contributorId.equals(itemDescriptor.getId())) { legacyPropertySectionDescriptorProvider = ((LegacyPropertyContributorItemDescriptor) itemDescriptor) .getSectionDescriptorProvider(); } } } return legacyPropertySectionDescriptorProvider; }

Target:
public ISectionDescriptorProvider getSectionDescriptorProvider(String contributorId) { Collection<IItemDescriptor> values = this.id2descriptors.values(); for (IItemDescriptor itemDescriptor : values) { if (itemDescriptor instanceof LegacyPropertyContributorItemDescriptor) { if (contributorId != null && contributorId.equals(itemDescriptor.getId())) { return ((LegacyPropertyContributorItemDescriptor) itemDescriptor).getSectionDescriptorProvider(); } } } return null; }
Source:
public boolean run(CommandSender sender, Command cmd, String commandLabel, String[] args) { TFM_Util.adminAction(sender.getName() + "Requesting help"); if (TFM_AdminList.isSuperAdmin()) { player.sendMessage(sender.getName() + " has requested help."); } sender.sendMessage(ChatColor.RED + "You have requested help, a staff member will be with your shortly"); return true; }

Target:
public boolean run(CommandSender sender, Command cmd, String commandLabel, String[] args) { TFM_Util.adminAction(sender.getName() + "Requesting help"); if (TFM_AdminList.isSuperAdmin(player)) { player.sendMessage(sender.getName() + ChatColor.RED + " has requested help."); } sender.sendMessage(ChatColor.RED + "You have requested help, a staff member will be with your shortly"); return true; }
Source:
public String getJoinClassName(String modelName) { return ElideDynamicEntityCompiler.getStaticModelClassName(modelName, EMPTY_STRING, capitalizeFirstLetter(modelName)); }

Target:
public String getJoinClassName(String modelName) { return ElideDynamicEntityCompiler.getStaticModelClassName(modelName, NO_VERSION, capitalizeFirstLetter(modelName)); }
Source:
public void onConfigurationChanged(Configuration newConfig) { leadImagesHandler.beginLayout(new LeadImagesHandler.OnLeadImageLayoutListener() { @Override public void onLayoutComplete() { searchBarHideHandler.setFadeEnabled(leadImagesHandler.isLeadImageEnabled()); } }); }

Target:
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); leadImagesHandler.beginLayout(new LeadImagesHandler.OnLeadImageLayoutListener() { @Override public void onLayoutComplete() { searchBarHideHandler.setFadeEnabled(leadImagesHandler.isLeadImageEnabled()); } }); }
Source:
public ColumnCombinationBitset invert(int size) { return new ColumnCombinationBitset(getClearedBits(size)); }

Target:
public ColumnCombinationBitset invert(int size) { OpenBitSet invertedBitset = this.bitset.clone(); invertedBitset.flip(0, size); return new ColumnCombinationBitset().setColumns(invertedBitset); }
Source:
public boolean isCopyEmailPopoverVisible() { String xpath = " return isElementVisible(By.xpath(xpath)); }

Target:
public boolean isCopyEmailPopoverVisible() { String selector = "#copy-email-button + div.popover"; return isElementVisible(By.cssSelector(selector)); }
Source:
private void splitHostPort(String value, String defaultHost, int defaultPort) { String hostPortValue = value.trim(); if (hostPortValue.charAt(0) == '[') { extractIPv6(hostPortValue); return; } int portSeparator = hostPortValue.lastIndexOf(':'); if (portSeparator < 0) { throw new IllegalArgumentException("Invalid HOST:PORT value: " + value); } String hostValue = hostPortValue.substring(0, portSeparator).trim(); host = hostValue.length() > 0 ? hostValue : defaultHost; String portString = hostPortValue.substring(portSeparator + 1).trim(); if (portString.length() > 0) { port = Integer.parseInt(portString); if (port <= PORT_MIN || port > PORT_MAX) { throw new IllegalArgumentException("Invalid port value: " + value); } } else { port = defaultPort; } }

Target:
private void splitHostPort(String value, String defaultHost, int defaultPort) { String hostPortValue = value.trim(); if (hostPortValue.charAt(0) == '[') { extractIPv6(hostPortValue); return; } int portSeparator = hostPortValue.lastIndexOf(':'); if (portSeparator < 0) { throw new IllegalArgumentException("Invalid HOST:PORT value: " + value); } String hostValue = hostPortValue.substring(0, portSeparator).trim(); host = hostValue.length() > 0 ? hostValue : defaultHost; String portString = hostPortValue.substring(portSeparator + 1).trim(); if (portString.length() > 0) { port = Integer.parseInt(portString); if (port <= PORT_MIN || port > PORT_MAX) { throw new IllegalArgumentException("Port " + value + " out of valid range [" + PORT_MIN + ", " + PORT_MAX + ")"); } } else { port = defaultPort; } }
Source:
public Response shutdown( @QueryParam("shutoffTime") final String shutoffTimeMillis, @Context final HttpServletRequest req ) { Access accessResult = AuthorizationUtils.authorizeResourceAction( req, new ResourceAction( new Resource("STATE", ResourceType.STATE), Action.WRITE ), authorizerMapper ); if (!accessResult.isAllowed()) { return Response.status(403).build(); } try { DateTime shutoffAt = shutoffTimeMillis == null ? DateTimes.nowUtc() : DateTimes.of(shutoffTimeMillis); log.info("Setting Firehose shutoffTime to %s", shutoffTimeMillis); long shutoffTimeoutMillis = Math.max(shutoffAt.getMillis() - System.currentTimeMillis(), 0); requestedShutdownTimeNsHolder.set(System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(shutoffTimeoutMillis)); Thread delayedCloseExecutor = this.delayedCloseExecutor; boolean needToInterruptDelayedCloseExecutor = true; if (delayedCloseExecutor == null) { synchronized (this) { delayedCloseExecutor = this.delayedCloseExecutor; if (delayedCloseExecutor == null) { delayedCloseExecutor = createDelayedCloseExecutor(); needToInterruptDelayedCloseExecutor = false; } } } if (needToInterruptDelayedCloseExecutor) { delayedCloseExecutor.interrupt(); } return Response.ok().build(); } catch (IllegalArgumentException e) { return Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.<String, Object>of("error", e.getMessage())) .build(); } }

Target:
public Response shutdown( @QueryParam("shutoffTime") final String shutoffTimeMillis, @Context final HttpServletRequest req ) { Access accessResult = AuthorizationUtils.authorizeResourceAction( req, new ResourceAction( new Resource("STATE", ResourceType.STATE), Action.WRITE ), authorizerMapper ); if (!accessResult.isAllowed()) { return Response.status(403).build(); } try { DateTime shutoffAt = shutoffTimeMillis == null ? DateTimes.nowUtc() : DateTimes.of(shutoffTimeMillis); log.info("Setting Firehose shutoffTime to %s", shutoffTimeMillis); long shutoffTimeoutMillis = Math.max(shutoffAt.getMillis() - System.currentTimeMillis(), 0); requestedShutdownTimeNs = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(shutoffTimeoutMillis); Thread delayedCloseExecutor; boolean needToInterruptDelayedCloseExecutor = true; synchronized (this) { delayedCloseExecutor = this.delayedCloseExecutor; if (delayedCloseExecutor == null) { delayedCloseExecutor = createDelayedCloseExecutor(); needToInterruptDelayedCloseExecutor = false; } } if (needToInterruptDelayedCloseExecutor) { delayedCloseExecutor.interrupt(); } return Response.ok().build(); } catch (IllegalArgumentException e) { return Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.<String, Object>of("error", e.getMessage())) .build(); } }
Source:
private List<RemoteReplicaInfo> getRemoteStandbyReplicasTimedOutOnNoProgress( List<RemoteReplicaInfo> remoteReplicaInfos) { List<RemoteReplicaInfo> remoteReplicasTimedOut = new ArrayList<>(); if (replicatingFromRemoteColo && leaderBasedReplicationAdmin != null && replicationConfig.replicationStandbyWaitTimeoutToTriggerCrossColoFetchSeconds != -1) { for (RemoteReplicaInfo remoteReplicaInfo : remoteReplicaInfos) { ExchangeMetadataResponse exchangeMetadataResponse = remoteReplicaInfo.getExchangeMetadataResponse(); if (exchangeMetadataResponse.hasMissingStoreMessages() && (time.seconds() - exchangeMetadataResponse.metadataReceivedTimeSec) > replicationConfig.replicationStandbyWaitTimeoutToTriggerCrossColoFetchSeconds) { remoteReplicasTimedOut.add(remoteReplicaInfo); } } } return remoteReplicasTimedOut; }

Target:
List<RemoteReplicaInfo> getRemoteStandbyReplicasTimedOutOnNoProgress(List<RemoteReplicaInfo> remoteReplicaInfos) { List<RemoteReplicaInfo> remoteReplicasTimedOut = new ArrayList<>(); if (replicationConfig.replicationStandbyWaitTimeoutToTriggerCrossColoFetchSeconds != -1) { for (RemoteReplicaInfo remoteReplicaInfo : remoteReplicaInfos) { ReplicaId localReplica = remoteReplicaInfo.getLocalReplicaId(); ReplicaId remoteReplica = remoteReplicaInfo.getReplicaId(); ExchangeMetadataResponse exchangeMetadataResponse = remoteReplicaInfo.getExchangeMetadataResponse(); if (!leaderBasedReplicationAdmin.isLeaderPair(localReplica, remoteReplica) && exchangeMetadataResponse.hasMissingStoreMessages() && (time.seconds() - exchangeMetadataResponse.lastMissingMessageReceivedTimeSec) > replicationConfig.replicationStandbyWaitTimeoutToTriggerCrossColoFetchSeconds) { remoteReplicasTimedOut.add(remoteReplicaInfo); } } } return remoteReplicasTimedOut; }
Source:
public void emit(T tuple) { if (verifySameThread()) { getSink().put(tuple); } }

Target:
public void emit(T tuple) { verifyOperatorThread(); sink.put(tuple); }
Source:
public static void closeAll(AutoCloseable... closeables) throws Exception { if (closeables == null) { return; } Exception rootCause = null; for (AutoCloseable closeable : closeables) { try { if (closeable != null) { closeable.close(); } } catch (Exception e) { if (rootCause == null) { rootCause = e; } else if (rootCause != e) { rootCause.addSuppressed(e); } } catch (Throwable e) { if (rootCause == null) { rootCause = new Exception(e); } else if (rootCause != e) { rootCause.addSuppressed(e); } } } if (rootCause != null) { throw rootCause; } }

Target:
public static void closeAll(AutoCloseable... closeables) throws Exception { if (closeables == null) { return; } ImmutableList.Builder<Throwable> exceptions = ImmutableList.builder(); for (AutoCloseable closeable : closeables) { try { if (closeable != null) { closeable.close(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); exceptions.add(e); } catch (Exception e) { exceptions.add(e); } catch (Throwable e) { exceptions.add(e); } } rethrow(exceptions.build()); }
Source:
private Request.Options createRequestOptions() { return new Request.Options( (int) config.connectTimeout().toMillis(), (int) config.readTimeout().toMillis()); }

Target:
private Request.Options createRequestOptions() { return new Request.Options( Math.toIntExact(config.connectTimeout().toMillis()), Math.toIntExact(config.readTimeout().toMillis())); }
Source:
public Object get(Object object) { try { if (method != null) { if (getter == null) { String methodName; if(Boolean.class.getSimpleName().toLowerCase().equals(getType().getName())){ methodName = "is" + method.getName().substring(3); } else { methodName = "g" + method.getName().substring(1); } getter = object.getClass() .getMethod(methodName); } return getter.invoke(object); } else { return field.get(object); } } catch (SecurityException | IllegalArgumentException | InvocationTargetException | IllegalAccessException e) { throw new ParameterException(e); } catch (NoSuchMethodException e) { String name = method.getName(); String fieldName = Character.toLowerCase(name.charAt(3)) + name.substring(4); Object result = null; try { Field field = method.getDeclaringClass().getDeclaredField(fieldName); if (field != null) { setFieldAccessible(field); result = field.get(object); } } catch(NoSuchFieldException | IllegalAccessException ex) { } return result; } }

Target:
public Object get(Object object) { try { if (method != null) { if (getter == null) { setGetter(object); } return getter.invoke(object); } else { return field.get(object); } } catch (SecurityException | IllegalArgumentException | InvocationTargetException | IllegalAccessException e) { throw new ParameterException(e); } catch (NoSuchMethodException e) { String name = method.getName(); String fieldName = Character.toLowerCase(name.charAt(3)) + name.substring(4); Object result = null; try { Field field = method.getDeclaringClass().getDeclaredField(fieldName); if (field != null) { setFieldAccessible(field); result = field.get(object); } } catch(NoSuchFieldException | IllegalAccessException ex) { } return result; } }
Source:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); Matcher matcher; try { response = urlopen.open(accountUrl); matcher = reAccounts.matcher(response); while (matcher.find()) { Account account = new Account(Html.fromHtml(matcher.group(1)).toString(), Helpers.parseBalance(matcher.group(4)), matcher.group(2), Long.parseLong(matcher.group(3))); balance = balance.add(Helpers.parseBalance(matcher.group(4))); accounts.add(account); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } } finally { super.updateComplete(); } }

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); response = urlopen.open(accountUrl); Matcher matcher = reAccounts.matcher(response); while (matcher.find()) { Account account = new Account(Html.fromHtml(matcher.group(1)).toString(), Helpers.parseBalance(matcher.group(4)), matcher.group(2), Long.parseLong(matcher.group(3))); balance = balance.add(Helpers.parseBalance(matcher.group(4))); accounts.add(account); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
protected int rwAnyNode(IASTNode node, int indirection) { final IASTNode parent= node.getParent(); if (parent instanceof ICASTFieldDesignator) { return WRITE; } else if (parent instanceof IASTIdExpression) { IASTNode grandparent = parent.getParent(); if (grandparent instanceof IASTArraySubscriptExpression) { return super.rwAnyNode(parent, 1); } else if (grandparent instanceof IASTUnaryExpression && ((CASTUnaryExpression) grandparent).getOperator() == IASTUnaryExpression.op_star) { return WRITE; } } return super.rwAnyNode(node, indirection); }

Target:
protected int rwAnyNode(IASTNode node, int indirection) { final IASTNode parent= node.getParent(); if (parent instanceof ICASTFieldDesignator) { return WRITE; } return super.rwAnyNode(node, indirection); }
Source:
protected boolean createDaemonThreads() { return false; }

Target:
protected boolean createDaemonThreads() { return true; }
Source:
private void processInParallel(final List<ISourceModule> modules, int buildType, IBuildState state, final IScriptProject project, final IProgressMonitor monitor) { final Queue<ISourceModule> queue = new ArrayBlockingQueue<ISourceModule>( modules.size(), true, modules); int maxThreads = Math.min(modules.size() / 2, Runtime.getRuntime().availableProcessors()); List<Job> jobs = new ArrayList<Job>(maxThreads); try { for (int i = 0; i < maxThreads; i++) { Job job = new BuildModulesJob(queue, buildType, state); job.schedule(); jobs.add(job); } int lastNumberOfScannedFiles = 0; for (Job job : jobs) { while (!job.join(100, null)) { if (monitor.isCanceled()) { job.cancel(); continue; } int numberOfScannedFiles = modules.size() - queue.size(); monitor.subTask(NLS.bind( Messages.ValidatorBuilder_buildModuleSubTask, (int) ((numberOfScannedFiles * 100f) / modules.size()), project.getElementName())); int steps = numberOfScannedFiles - lastNumberOfScannedFiles; monitor.worked(steps); lastNumberOfScannedFiles += steps; } } } catch (OperationCanceledException e) { DLTKCore.error(e); } catch (InterruptedException e) { DLTKCore.error(e); } }

Target:
private void processInParallel(final List<ISourceModule> modules, int buildType, IBuildState state, final IScriptProject project, final IProgressMonitor monitor) { final Queue<ISourceModule> queue = new ArrayBlockingQueue<ISourceModule>( modules.size(), true, modules); int maxThreads = Math.min(modules.size() / 2, Runtime.getRuntime().availableProcessors()); List<Job> jobs = new ArrayList<Job>(maxThreads); try { for (int i = 0; i < maxThreads; i++) { Job job = new BuildModulesJob(queue, buildType, state); job.schedule(); jobs.add(job); } int lastNumberOfScannedFiles = 0; for (Job job : jobs) { while (!job.join(100, null)) { if (monitor.isCanceled()) { for (Job tmpJob : jobs) { tmpJob.cancel(); } continue; } int numberOfScannedFiles = modules.size() - queue.size(); monitor.subTask(NLS.bind( Messages.ValidatorBuilder_buildModuleSubTask, (int) ((numberOfScannedFiles * 100f) / modules.size()), project.getElementName())); int steps = numberOfScannedFiles - lastNumberOfScannedFiles; monitor.worked(steps); lastNumberOfScannedFiles += steps; } } } catch (OperationCanceledException e) { DLTKCore.error(e); } catch (InterruptedException e) { DLTKCore.error(e); } }
Source:
public void checkErrorMarkersInEditor() { projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_POM_FILE)); editor.waitActive(); editor.waitAllMarkersInvisibility(ERROR); editor.typeTextIntoEditor("q"); editor.goToPosition(1, 1); editor.waitMarkerInPosition(ERROR, 1); editor.typeTextIntoEditor(DELETE.toString()); editor.waitMarkerInvisibility(ERROR, 1); projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_JAVA_FILE)); editor.waitActive(); editor.waitAllMarkersInvisibility(ERROR); editor.setCursorToLine(12); editor.typeTextIntoEditor("q"); editor.goToPosition(12, 1); editor.waitMarkerInPosition(ERROR, 12); editor.typeTextIntoEditor(DELETE.toString()); editor.waitMarkerInvisibility(ERROR, 12); projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_TS_FILE)); editor.waitActive(); editor.typeTextIntoEditor("q"); editor.waitMarkerInPosition(ERROR, 1); }

Target:
public void checkErrorMarkersInEditor() { projectExplorer.openItemByPath(PATH_TO_POM_FILE); editor.waitActive(); editor.waitAllMarkersInvisibility(ERROR); editor.typeTextIntoEditor("q"); editor.goToPosition(1, 1); editor.waitMarkerInPosition(ERROR, 1); editor.typeTextIntoEditor(DELETE.toString()); editor.waitMarkerInvisibility(ERROR, 1); projectExplorer.openItemByPath(PATH_TO_JAVA_FILE); editor.waitActive(); editor.waitAllMarkersInvisibility(ERROR); editor.setCursorToLine(12); editor.typeTextIntoEditor("q"); editor.goToPosition(12, 1); editor.waitMarkerInPosition(ERROR, 12); editor.typeTextIntoEditor(DELETE.toString()); editor.waitMarkerInvisibility(ERROR, 12); projectExplorer.openItemByPath(PATH_TO_TS_FILE); editor.waitActive(); editor.typeTextIntoEditor("q"); editor.waitMarkerInPosition(ERROR, 1); }
Source:
protected void addItemFactory(ItemFactory itemFactory) { for (String itemTypeName : itemFactory.getSupportedItemTypes()) { Item item = itemFactory.createItem(itemTypeName, "tmp"); if (item != null) { acceptedCommandTypeMap.put(itemTypeName, item.getAcceptedCommandTypes()); acceptedStateTypeMap.put(itemTypeName, item.getAcceptedDataTypes()); } else { logger.error("Item factory suggested it can create items of type but returned null", itemFactory, itemTypeName); } } }

Target:
protected void addItemFactory(ItemFactory itemFactory) { itemFactories.add(itemFactory); calculateAcceptedTypes(); }
Source:
protected Optional<Fix> implicitToStringFix(ExpressionTree tree, VisitorState state) { return Optional.empty(); }

Target:
protected Optional<Fix> implicitToStringFix(ExpressionTree tree, VisitorState state) { return Optional.of(SuggestedFix.postfixWith(tree, ".get()")); }
Source:
private static String getLibraryResourcePath(@NonNull String libraryName) { String path = LIBS_RES_PATH; final String osName = System.getProperty("os.name"); if (osName.contains("Linux")) { path += "/linux"; } else if (osName.contains("Mac")) { path += "/osx"; } else { path += "/" + osName; } String archName = System.getProperty("os.arch"); archName = archName.replaceAll("\\W", ""); archName = archName.replace("-", "_"); if (osName.contains("Windows")) { archName = "x86_64"; } path += '/' + archName; path += '/' + System.mapLibraryName(libraryName); return path; }

Target:
private static String getLibraryResourcePath(@NonNull String libraryName) { String path = LIBS_RES_PATH; final String osName = System.getProperty("os.name"); if (osName.contains("Linux")) { path += "/linux"; } else if (osName.contains("Mac")) { path += "/osx"; } else { path += "/" + osName; } String archName = null; if (osName.contains("Windows")) { archName = "x86_64"; } else { archName = System.getProperty("os.arch"); archName = archName.replaceAll("\\W", ""); archName = archName.replace("-", "_"); } path += '/' + archName; path += '/' + System.mapLibraryName(libraryName); return path; }
Source:
private void logoutUserClick() { viewModel.onLogoutClick(); viewModel.getLogoutSuccess().observe(this, this::logoutSuccess); viewModel.getLogoutError().observe(this, this::logoutError); }

Target:
private void logoutUserClick() { viewModel.getLogoutSuccess().observe(this, this::logoutSuccess); viewModel.getLogoutError().observe(this, this::logoutError); viewModel.onLogoutClick(); }
Source:
private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) { StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size()); streamEvent.setType(ComplexEvent.Type.RESET); StateEvent stateEvent = stateEventPool.borrowEvent(); if (eventType == MetaStreamEvent.EventType.AGGREGATE) { stateEvent.addEvent(1, streamEvent); } else { stateEvent.addEvent(0, streamEvent); } stateEvent.setType(ComplexEvent.Type.RESET); ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>(true); complexEventChunk.add(stateEvent); return complexEventChunk; }

Target:
private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) { StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size()); streamEvent.setType(ComplexEvent.Type.RESET); StateEvent stateEvent = stateEventPool.borrowEvent(); stateEvent.addEvent(0, streamEvent); stateEvent.setType(ComplexEvent.Type.RESET); ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>(true); complexEventChunk.add(stateEvent); return complexEventChunk; }
Source:
public static String getModelFileWithGAV(ReleaseId releaseId) { ReleaseIdImpl releaseIdImpl = (ReleaseIdImpl) releaseId; return Paths.get(MODEL_FILE_DIRECTORY, releaseIdImpl.getGroupId(), releaseIdImpl.getArtifactId(), releaseIdImpl.getVersion(), MODEL_FILE_NAME).toString(); }

Target:
public static String getModelFileWithGAV(ReleaseId releaseId) { return Paths.get(MODEL_FILE_DIRECTORY, releaseId.getGroupId(), releaseId.getArtifactId(), MODEL_FILE_NAME).toString(); }
Source:
public static Map<String, Serializable> mapOfBase64StringToSerializable(Map<String, String> input) throws IOException, ClassNotFoundException { if (input == null) { return null; } HashMap<String, Serializable> answer = new HashMap<>(input.size()); for (Map.Entry<String, String> entry : input.entrySet()) { answer.put(entry.getKey(), base64StringToSerializable(entry.getValue())); } return answer; }

Target:
public static Map<String, Serializable> mapOfBase64StringToSerializable(Map<String, String> input) { if (input == null) { return null; } HashMap<String, Serializable> answer = new HashMap<>(input.size()); input.forEach((key, value) -> { answer.put(key, base64StringToSerializable(value)); }); return answer; }
Source:
public void close() throws SQLException { if (isClosed) { return; } try { clearMetrics(); try { if (traceScope != null) { traceScope.close(); } closeStatements(); if(childConnections != null) { SQLCloseables.closeAllQuietly(childConnections); } } finally { services.removeConnection(this); } } finally { isClosed = true; if(isInternalConnection()){ GLOBAL_OPEN_INTERNAL_PHOENIX_CONNECTIONS.decrement(); } else { GLOBAL_OPEN_PHOENIX_CONNECTIONS.decrement(); } } }

Target:
public void close() throws SQLException { if (isClosed) { return; } try { clearMetrics(); try { if (traceScope != null) { traceScope.close(); } closeStatements(); synchronized (queueCreationLock) { if (childConnections != null) { SQLCloseables.closeAllQuietly(childConnections); } } } finally { services.removeConnection(this); } } finally { isClosed = true; if(isInternalConnection()){ GLOBAL_OPEN_INTERNAL_PHOENIX_CONNECTIONS.decrement(); } else { GLOBAL_OPEN_PHOENIX_CONNECTIONS.decrement(); } } }
Source:
public void testLogEntrySyncWithTrim() throws Exception { final int RX_MESSAGES_LIMIT = 2; final int TRIM_RATIO = NUM_KEYS_LARGE - 20; setupEnv(); log.info("Have setutEnv Done"); openStreams(srcCorfuTables, srcDataRuntime, 1); openStreams(dstCorfuTables, dstDataRuntime, 1); generateTXData(srcCorfuTables, srcDataForVerification, NUM_KEYS_LARGE, srcDataRuntime, 0); expectedSinkReceivedMessages = RX_MESSAGES_LIMIT; LogReplicationFSM fsm = startLogEntrySync(srcCorfuTables.keySet(), WAIT.ON_SINK_RECEIVE, false); System.out.println("****** Trim log, will trigger a full snapshot sync"); Token toke = ckStreamsAndTrim(srcDataRuntime, srcCorfuTables); while (srcDataRuntime.getAddressSpaceView().getTrimMark().getSequence() < toke.getSequence()) { } System.out.println("****** Wait till IN_SNAPSHOT_SYNC"); checkStateChange(fsm, LogReplicationStateType.IN_SNAPSHOT_SYNC, true); System.out.println("Block untill full snapshot transfer complete"); checkStateChange(fsm, LogReplicationStateType.IN_LOG_ENTRY_SYNC, true); verifyData(dstCorfuTables, dstDataForVerification); cleanEnv(); }

Target:
public void testLogEntrySyncWithTrim() throws Exception { final int RX_MESSAGES_LIMIT = 2; final int TRIM_RATIO = NUM_KEYS_LARGE - 20; setupEnv(); log.trace("Have setutEnv Done"); openStreams(srcCorfuTables, srcDataRuntime, 1); openStreams(dstCorfuTables, dstDataRuntime, 1); generateTXData(srcCorfuTables, srcDataForVerification, NUM_KEYS_LARGE, srcDataRuntime, 0); expectedSinkReceivedMessages = RX_MESSAGES_LIMIT; LogReplicationFSM fsm = startLogEntrySync(srcCorfuTables.keySet(), WAIT.ON_SINK_RECEIVE, false); System.out.println("****** Trim log, will trigger a full snapshot sync"); Token toke = ckStreamsAndTrim(srcDataRuntime, srcCorfuTables); while (srcDataRuntime.getAddressSpaceView().getTrimMark().getSequence() < toke.getSequence()) { } System.out.println("****** Wait till IN_SNAPSHOT_SYNC"); checkStateChange(fsm, LogReplicationStateType.IN_SNAPSHOT_SYNC, true); System.out.println("Block untill full snapshot transfer complete"); checkStateChange(fsm, LogReplicationStateType.IN_LOG_ENTRY_SYNC, true); verifyData(dstCorfuTables, dstDataForVerification); cleanEnv(); }