auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Response updateOvfStore(Action action) { ProcessOvfUpdateForStorageDomainCommandParameters params = new ProcessOvfUpdateForStorageDomainCommandParameters(); params.setStorageDomainId(guid); org.ovirt.engine.core.common.businessentities.StoragePool storagePool = getEntity( org.ovirt.engine.core.common.businessentities.StoragePool.class, VdcQueryType.GetStoragePoolsByStorageDomainId, new IdQueryParameters(guid), guid.toString() ); params.setStoragePoolId(storagePool.getId()); return performAction(VdcActionType.ProcessOvfUpdateForStorageDomain, params); }

Target:
public Response updateOvfStore(Action action) { ProcessOvfUpdateForStorageDomainCommandParameters params = new ProcessOvfUpdateForStorageDomainCommandParameters(); params.setStorageDomainId(guid); return performAction(VdcActionType.ProcessOvfUpdateForStorageDomain, params); }
Source:
public Medication deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context){ Medication u = null; try { try { u = g.fromJson(json, Medication.class); return u; } catch (JsonSyntaxException e) { } if (json.getAsJsonObject().get("Patient") != null) { json.getAsJsonObject().get("Patient").getAsJsonObject().remove("Med"); } u = g.fromJson(json, Medication.class); logger.warn("json parsed successfully - by removing the 'Med' attribute"); return u; } catch (Exception e) { logger.error("unexpected json error", e); } return u; }

Target:
public Medication deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context){ Medication u = null; try { try { u = g.fromJson(json, Medication.class); return u; } catch (JsonSyntaxException e) { if (json.getAsJsonObject().get("Patient") != null) { json.getAsJsonObject().get("Patient").getAsJsonObject().remove("Med"); } u = g.fromJson(json, Medication.class); logger.warn("json parsed successfully - by removing the 'Med' attribute"); } } catch (Exception e) { logger.error("unexpected json error", e); } return u; }
Source:
private void recordHandlingError(Exception e) { logger.error("Message handling error for request - " + request.getUri() + " - " + e); nettyMetrics.handleRequestFailureCount.inc(); }

Target:
private void recordHandlingError(Exception e) { logger.error("Handling error for request - " + request.getUri(), e); nettyMetrics.handleRequestFailureCount.inc(); }
Source:
public String docs() { return "array Returns an array of command arrays in the format register_command expects." + " This does not include CommandHelper aliases, as they are not registered commands."; }

Target:
public String docs() { return "array Returns an array of command arrays in the format register_command expects." + " This does not include " + Implementation.GetServerType().getBranding() + " aliases, as they are not registered commands."; }
Source:
public static EnvironmentVariableConfig fromJSON(JsonObject jsonReader) { boolean secure = jsonReader.has("secure") && jsonReader.get("secure").getAsBoolean(); EnvironmentVariableConfig environmentVariableConfig = new EnvironmentVariableConfig(); environmentVariableConfig.setName(jsonReader.get("name").getAsString()); if (secure) { environmentVariableConfig.setEncryptedValue(jsonReader.get("encrypted_value").getAsString()); environmentVariableConfig.setIsSecure(secure); } else { environmentVariableConfig.setValue(new VariableValueConfig(jsonReader.get("value").getAsString())); } return environmentVariableConfig; }

Target:
public static EnvironmentVariableConfig fromJSON(JsonObject jsonReader) { EnvironmentVariableConfig environmentVariableConfig = new EnvironmentVariableConfig(); environmentVariableConfig.setName(jsonReader.get("name").getAsString()); environmentVariableConfig.setIsSecure(jsonReader.has("secure") && jsonReader.get("secure").getAsBoolean()); if (jsonReader.has("encrypted_value")) { environmentVariableConfig.setEncryptedValue(jsonReader.get("encrypted_value").getAsString()); } if (jsonReader.has("value")) { environmentVariableConfig.setValue(jsonReader.get("value").getAsString()); } return environmentVariableConfig; }
Source:
public synchronized boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed) { if (!(replicaId instanceof AmbryReplica)) { throw new IllegalArgumentException( "HelixParticipant only works with the AmbryReplica implementation of ReplicaId"); } List<String> sealedReplicas = getSealedReplicas(); if (sealedReplicas == null) { sealedReplicas = new ArrayList<>(); } String partitionId = replicaId.getPartitionId().toPathString(); boolean success = true; if (!isSealed && sealedReplicas.contains(partitionId)) { logger.trace("Removing the partition from sealedReplicas list", partitionId); sealedReplicas.remove(partitionId); success = setSealedReplicas(sealedReplicas); } else if (isSealed && !sealedReplicas.contains(partitionId)) { logger.trace("Adding the partition from sealedReplicas list", partitionId); sealedReplicas.add(partitionId); success = setSealedReplicas(sealedReplicas); } logger.trace("Set sealed state of partition is completed", partitionId); return success; }

Target:
public synchronized boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed) { if (!(replicaId instanceof AmbryReplica)) { throw new IllegalArgumentException( "HelixParticipant only works with the AmbryReplica implementation of ReplicaId"); } List<String> sealedReplicas = getSealedReplicas(); if (sealedReplicas == null) { sealedReplicas = new ArrayList<>(); } String partitionId = replicaId.getPartitionId().toPathString(); boolean success = true; if (!isSealed && sealedReplicas.contains(partitionId)) { logger.trace("Removing the partition from sealReplicas list", partitionId); sealedReplicas.remove(partitionId); success = setSealedReplicas(sealedReplicas); } else if (isSealed && !sealedReplicas.contains(partitionId)) { logger.trace("Adding the partition from sealReplicas list", partitionId); sealedReplicas.add(partitionId); success = setSealedReplicas(sealedReplicas); } logger.trace("Set sealed state of partition is completed", partitionId); return success; }
Source:
private BigintValuesUsingHashTable(long min, long max, long[] values, boolean nullAllowed) { super(true, nullAllowed); requireNonNull(values, "values is null"); checkArgument(min < max, "min must be less than max"); checkArgument(values.length > 1, "values must contain at least 2 entries"); this.min = min; this.max = max; this.values = values; this.size = Integer.highestOneBit(values.length * 3); this.hashTable = new long[size]; Arrays.fill(hashTable, EMPTY_MARKER); for (long value : values) { if (value == EMPTY_MARKER) { containsEmptyMarker = true; } else { int position = (int) ((value * M) & (size - 1)); for (int i = position; i < position + size; i++) { int index = i & (size - 1); if (hashTable[index] == EMPTY_MARKER) { hashTable[index] = value; break; } } } } }

Target:
private BigintValuesUsingHashTable(long min, long max, long[] values, boolean nullAllowed) { super(true, nullAllowed); requireNonNull(values, "values is null"); checkArgument(min < max, "min must be less than max"); checkArgument(values.length > 1, "values must contain at least 2 entries"); this.min = min; this.max = max; this.size = Integer.highestOneBit(values.length * 3); this.hashTable = new long[size]; Arrays.fill(hashTable, EMPTY_MARKER); for (long value : values) { if (value == EMPTY_MARKER) { containsEmptyMarker = true; } else { int position = (int) ((value * M) & (size - 1)); for (int i = position; i < position + size; i++) { int index = i & (size - 1); if (hashTable[index] == EMPTY_MARKER) { hashTable[index] = value; break; } } } } }
Source:
private void registerMetrics() { long intervalTallies[] = new long[INTERVALS.length]; for (String platform : PLATFORMS) { long platformTallies[] = activeUserCache.getFinalTallies(platform, INTERVALS); for (int i = 0; i < INTERVALS.length; i++) { final long tally = platformTallies[i]; logger.info(metricKey(platform, INTERVALS[i]) + " " + tally); metricRegistry.register(metricKey(platform, INTERVALS[i]), new Gauge<Long>() { @Override public Long getValue() { return tally; } }); intervalTallies[i] += tally; } } for (int i = 0; i < INTERVALS.length; i++) { final long intervalTotal = intervalTallies[i]; logger.info(metricKey(INTERVALS[i]) + " " + intervalTotal); metricRegistry.register(metricKey(INTERVALS[i]), new Gauge<Long>() { @Override public Long getValue() { return intervalTotal; } }); } for (ReporterFactory reporterFactory : configuration.getMetricsFactory().getReporters()) { ScheduledReporter reporter = reporterFactory.build(metricRegistry); logger.info("Reporting via: " + reporter); reporter.report(); logger.info("Reporting finished..."); } }

Target:
private void registerMetrics() { MetricRegistry metrics = new MetricRegistry(); long intervalTallies[] = new long[INTERVALS.length]; for (String platform : PLATFORMS) { long platformTallies[] = activeUserCache.getFinalTallies(platform, INTERVALS); for (int i = 0; i < INTERVALS.length; i++) { final long tally = platformTallies[i]; logger.info(metricKey(platform, INTERVALS[i]) + " " + tally); metrics.register(metricKey(platform, INTERVALS[i]), new Gauge<Long>() { @Override public Long getValue() { return tally; } }); intervalTallies[i] += tally; } } for (int i = 0; i < INTERVALS.length; i++) { final long intervalTotal = intervalTallies[i]; logger.info(metricKey(INTERVALS[i]) + " " + intervalTotal); metrics.register(metricKey(INTERVALS[i]), new Gauge<Long>() { @Override public Long getValue() { return intervalTotal; } }); } for (ReporterFactory reporterFactory : metricsFactory.getReporters()) { reporterFactory.build(metrics).report(); } }
Source:
protected void subscribe() { eventService.subscribe( event -> { String id = event.getId(); Set<PathMatcher> pathMatchers = pathMatcherRegistry.getOrNull(id); registerConsumers(event.getLanguageServer(), pathMatchers); }, LanguageServerInitializedEvent.class); }

Target:
protected void subscribe() { eventService.subscribe(this::acceptEvent, LanguageServerInitializedEvent.class); }
Source:
public void testLinkUnwinderBadDomain() { LinkResolver resolver = new LinkResolver("http://nope@#$%"); resolver.run(); LinkDetails details = resolver.getLinkDetails(); assertEquals("Should be 404", LinkDetails.LinkStatus.MALFORMED_URL, details.getLinkStatus()); }

Target:
public void testLinkUnwinderBadDomain() { LinkResolver resolver = new LinkResolver("http://nope@#$%"); resolver.run(); LinkDetails details = resolver.getLinkDetails(); assertEquals("Should be 400", LinkDetails.LinkStatus.MALFORMED_URL, details.getLinkStatus()); }
Source:
private ByteBuffer parseCBPayLoad(ByteBuffer pcapPacketHeader, int blockLength) throws IOException, BadPcapFileException { ByteBuffer pcapPacketData; pcapPacketHeader.getInt(); long packetLength = ConversionHelper.unsignedIntToLong(blockLength); SeekableByteChannel fileChannel = getFileChannel(); if (fileChannel.size() - fileChannel.position() < packetLength) { throw new BadPcapFileException(String.format("0x%08x", packetLength) + " is causing buffer overrun."); } if (blockLength > Integer.MAX_VALUE) { throw new BadPcapFileException(String.format("0x%08x", blockLength) + " packet length is bigger than 2^31-1 bytes are not supported."); } pcapPacketData = ByteBuffer.allocate((int) packetLength - 12); pcapPacketData.clear(); ByteOrder byteOrder = getByteOrder(); pcapPacketHeader.order(byteOrder); int payLoad = fileChannel.read(pcapPacketData); if (payLoad == 0) { throw new BadPcapFileException(String.format("0x%08x", payLoad) + " is a bad payload."); } pcapPacketData.flip(); fileChannel.position(fileChannel.position() + blockLength - 12); return pcapPacketData; }

Target:
private ByteBuffer parseCBPayLoad(ByteBuffer pcapPacketHeader, int blockLength) throws IOException, BadPcapFileException { ByteBuffer pcapPacketData; pcapPacketHeader.getInt(); long packetLength = ConversionHelper.unsignedIntToLong(blockLength); SeekableByteChannel fileChannel = getFileChannel(); if (fileChannel.size() - fileChannel.position() < packetLength) { throw new BadPcapFileException(String.format("0x%08x", packetLength) + " is causing buffer overrun."); } if (blockLength > Integer.MAX_VALUE) { throw new BadPcapFileException(String.format("0x%08x", blockLength) + " packet length is bigger than 2^31-1 bytes are not supported."); } pcapPacketData = ByteBuffer.allocate((int) packetLength); ByteOrder byteOrder = getByteOrder(); pcapPacketHeader.order(byteOrder); int payLoad = fileChannel.read(pcapPacketData); if (payLoad == 0) { throw new BadPcapFileException(String.format("0x%08x", payLoad) + " is a bad payload."); } pcapPacketData.flip(); fileChannel.position(fileChannel.position() + blockLength); return pcapPacketData; }
Source:
Mono<EncryptResult> encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Context context) { KeyOperationParameters parameters = new KeyOperationParameters().setAlgorithm(algorithm).setValue(plaintext); return service.encrypt(endpoint, keyName, version, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> logger.info("Encrypting content with algorithm - {}", algorithm.toString())) .doOnSuccess(response -> logger.info("Retrieved encrypted content with algorithm- {}", algorithm.toString())) .doOnError(error -> logger.warning("Failed to encrypt content with algorithm - {}", algorithm.toString(), error)) .flatMap(keyOperationResultResponse -> Mono.just(new EncryptResult(keyOperationResultResponse.getValue().getResult(), algorithm, keyId))); }

Target:
Mono<EncryptResult> encrypt(EncryptionAlgorithm algorithm, byte[] plaintext, Context context) { KeyOperationParameters parameters = new KeyOperationParameters().setAlgorithm(algorithm).setValue(plaintext); return service.encrypt(vaultUrl, keyName, version, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> logger.info("Encrypting content with algorithm - {}", algorithm.toString())) .doOnSuccess(response -> logger.info("Retrieved encrypted content with algorithm- {}", algorithm.toString())) .doOnError(error -> logger.warning("Failed to encrypt content with algorithm - {}", algorithm.toString(), error)) .flatMap(keyOperationResultResponse -> Mono.just(new EncryptResult(keyOperationResultResponse.getValue().getResult(), algorithm, keyId))); }
Source:
public void testGetAbsoluteRemotePath() throws Exception { Node nodeA = j.createOnlineSlave(); String path = ((DumbSlave) nodeA).getComputer().getAbsoluteRemotePath(); assert(path != null); setAsAnonymous(); nodeA = j.createOnlineSlave(); path = ((DumbSlave) nodeA).getComputer().getAbsoluteRemotePath(); assert(path == null); }

Target:
public void testGetAbsoluteRemotePath() throws Exception { Node nodeA = j.createOnlineSlave(); String path = ((DumbSlave) nodeA).getComputer().getAbsoluteRemotePath(); Assert.assertNotNull(path); Assert.assertEquals(getRemoteFS(nodeA, null), path); String userAlice = "alice"; MockAuthorizationStrategy authStrategy = new MockAuthorizationStrategy(); authStrategy.grant(Computer.CONFIGURE, Jenkins.READ).everywhere().to(userAlice); j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); j.jenkins.setAuthorizationStrategy(authStrategy); try(ACLContext context = ACL.as(User.getById(userAlice, true))) { nodeA = j.createOnlineSlave(); path = ((DumbSlave) nodeA).getComputer().getAbsoluteRemotePath(); Assert.assertNull(path); Assert.assertNull(getRemoteFS(nodeA, userAlice)); } }
Source:
private static MkSocket createMockSocket() throws IOException { return new MkSocket( new ByteArrayInputStream( new JoinedText( BkBasicTest.CRLF, "GET / HTTP/1.1", BkBasicTest.HOST, "Content-Length: 2", "", "hi" ).asString().getBytes() ) ); }

Target:
private static MkSocket createMockSocket() throws Exception { return new MkSocket( new ByteArrayInputStream( new BytesOf( new JoinedText( BkBasicTest.CRLF, "GET / HTTP/1.1", BkBasicTest.HOST, "Content-Length: 2", "", "hi" ) ).asBytes() ) ); }
Source:
public void testGetChangedAttributesMultipleKind() { TaskAttribute attributeCustom = newData.getRoot().createAttribute("custom"); attributeCustom.setValue("1"); attributeCustom.getMetaData().setKind("kind"); TaskAttribute attributeSummary = newData.getRoot().createAttribute(TaskAttribute.SUMMARY); attributeSummary.setValue("1"); TaskDataDiff diff = manager.createDiff(newData, oldData, new NullProgressMonitor()); List<TaskAttributeDiff> expected = Arrays.asList(new TaskAttributeDiff(null, attributeSummary), new TaskAttributeDiff(null, attributeCustom)); assertEquals(new LinkedHashSet<ITaskAttributeDiff>(expected), diff.getChangedAttributes()); assertTrue(diff.hasChanged()); }

Target:
public void testGetChangedAttributesMultipleKind() { TaskAttribute attributeCustom = newData.getRoot().createAttribute("custom"); attributeCustom.setValue("1"); attributeCustom.getMetaData().setKind("kind"); TaskAttribute attributeSummary = newData.getRoot().createAttribute(TaskAttribute.SUMMARY); attributeSummary.setValue("1"); TaskDataDiff diff = manager.createDiff(newData, oldData, new NullProgressMonitor()); assertEquals(ImmutableSet.of(new TaskAttributeDiff(null, attributeSummary), new TaskAttributeDiff(null, attributeCustom)), diff.getChangedAttributes()); assertTrue(diff.hasChanged()); }
Source:
private void processEvent(MessageDescription description) { Event event = new Event(); Map<String, Object> content = new HashMap<>(); Metadata details = new Metadata(); try { event.setPayload(objectMapper.readValue(description.getMessagePayload(), Map.class)); } catch (IOException e) { log.warn("Could not parse message payload as JSON", e); } content.put("messageDescription", description); details.setType(PubsubEventMonitor.PUBSUB_TRIGGER_TYPE); if (description.getMessageAttributes() != null) { details.setAttributes(description.getMessageAttributes()); } event.setContent(content); event.setDetails(details); pubsubEventMonitor.processEvent(event); }

Target:
private void processEvent(MessageDescription description) { log.debug("Processing pubsub event with payload {}", description.getMessagePayload()); Event event = new Event(); Map<String, Object> content = new HashMap<>(); Metadata details = new Metadata(); try { event.setPayload(objectMapper.readValue(description.getMessagePayload(), Map.class)); } catch (IOException e) { log.warn("Could not parse message payload as JSON", e); } content.put("messageDescription", description); details.setType(PubsubEventMonitor.PUBSUB_TRIGGER_TYPE); if (description.getMessageAttributes() != null) { details.setAttributes(description.getMessageAttributes()); } event.setContent(content); event.setDetails(details); pubsubEventMonitor.processEvent(event); }
Source:
public static BlockStateData parse(Material material, String state) throws InvalidBlockStateException { if (state == null || state.trim().isEmpty() || state.trim().equals("*")) { return new BlockStateData(); } BlockStateReader reader = getReader(material); if (material == null || reader == null) { throw new InvalidBlockStateException(material, state); } BlockStateData data = new BlockStateData(); String[] split = state.trim().split(","); for (String section : split) { if (!section.contains("=") || section.indexOf('=') != section.lastIndexOf('=')) { throw new InvalidBlockStateException(material, state); } String[] keyVal = section.split("="); keyVal[0] = keyVal[0].trim().toLowerCase(); keyVal[1] = keyVal[1].trim().toLowerCase(); if (keyVal[0].isEmpty() || keyVal[1].isEmpty()) { throw new InvalidBlockStateException(material, state); } if (!reader.getValidStates().contains(keyVal[0])) { throw new InvalidBlockStateException(material, state); } data.put(keyVal[0], keyVal[1]); } return data; }

Target:
public static BlockStateData parse(Material material, String state) throws InvalidBlockStateException { if (state == null || state.trim().isEmpty() || state.trim().equals("*")) { return new BlockStateData(); } BlockStateReader reader = getReader(material); if (material == null || reader == null) { throw new InvalidBlockStateException(material, state); } BlockStateData data = new BlockStateData(); String[] split = state.trim().split(","); for (String section : split) { if (!section.contains("=") || section.indexOf('=') != section.lastIndexOf('=')) { throw new InvalidBlockStateException(material, state); } String[] keyVal = section.split("="); if (keyVal.length < 2) { throw new InvalidBlockStateException(material, state); } keyVal[0] = keyVal[0].trim().toLowerCase(); keyVal[1] = keyVal[1].trim().toLowerCase(); if (keyVal[0].isEmpty() || keyVal[1].isEmpty()) { throw new InvalidBlockStateException(material, state); } if (!reader.getValidStates().contains(keyVal[0])) { throw new InvalidBlockStateException(material, state); } data.put(keyVal[0], keyVal[1]); } return data; }
Source:
public void beforeStageStarts() { UI.status = mock(StatusUI.class); UI.events = mock(EventDispatcher.class); Preferences prefs = Preferences.create(TestController.TEST_DIRECTORY, TestController.TEST_SESSION_CONFIG_FILENAME, TestController.TEST_USER_CONFIG_FILENAME); prefs.setLastLoginCredentials("test", "test"); prefs.setLastViewedRepository("test/test"); RepoIO testIO = TestController.createTestingRepoIO(Optional.empty()); testIO.setRepoOpControl(TestUtils.createRepoOpControlWithEmptyModels(testIO)); try { testIO.openRepository("test/test").get(); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } }

Target:
public void beforeStageStarts() { UI.status = mock(StatusUI.class); UI.events = mock(EventDispatcher.class); Preferences prefs = TestController.createTestPreferences(); prefs.setLastLoginCredentials("test", "test"); prefs.setLastViewedRepository("test/test"); RepoIO testIO = TestController.createTestingRepoIO(Optional.empty()); testIO.setRepoOpControl(TestUtils.createRepoOpControlWithEmptyModels(testIO)); try { testIO.openRepository("test/test").get(); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } }
Source:
public ConsumptionNotFoundException(Long consumptionId) { super("Can't find a consumption with id: " + consumptionId + " is unsupported."); }

Target:
public ConsumptionNotFoundException(Long consumptionId) { super("Can't find a consumption with id: " + consumptionId); }
Source:
public Map<String, String> getBuildVariables(AbstractBuild build, EnvInjectLogger logger) throws EnvInjectException { Map<String, String> result = new HashMap<String, String>(); result.putAll(build.getCharacteristicEnvVars()); try { EnvVars envVars = new EnvVars(); for (EnvironmentContributor ec : EnvironmentContributor.all()) { ec.buildEnvironmentFor(build, envVars, new LogTaskListener(LOG, Level.ALL)); result.putAll(envVars); } JDK jdk = build.getProject().getJDK(); if (jdk != null) { Node node = build.getBuiltOn(); if (node != null) { jdk = jdk.forNode(node, logger.getListener()); } jdk.buildEnvVars(result); } } catch (IOException ioe) { throw new EnvInjectException(ioe); } catch (InterruptedException ie) { throw new EnvInjectException(ie); } Executor e = build.getExecutor(); if (e != null) { result.put("EXECUTOR_NUMBER", String.valueOf(e.getNumber())); } String rootUrl = Hudson.getInstance().getRootUrl(); if (rootUrl != null) { result.put("BUILD_URL", rootUrl + build.getUrl()); result.put("JOB_URL", rootUrl + build.getParent().getUrl()); } result.putAll(build.getBuildVariables()); Map<String, String> triggerVariable = new BuildCauseRetriever().getTriggeredCause(build); result.putAll(triggerVariable); String userName = new BuildCauseRetriever().getCauseUserName(build); if (userName != null){ result.put("USER_NAME", userName); } String userId = new BuildCauseRetriever().getCauseUserId(build); if (userId != null){ result.put("USER_ID", userId); } return result; }

Target:
public Map<String, String> getBuildVariables(AbstractBuild build, EnvInjectLogger logger) throws EnvInjectException { Map<String, String> result = new HashMap<String, String>(); result.putAll(build.getCharacteristicEnvVars()); try { EnvVars envVars = new EnvVars(); for (EnvironmentContributor ec : EnvironmentContributor.all()) { ec.buildEnvironmentFor(build, envVars, new LogTaskListener(LOG, Level.ALL)); result.putAll(envVars); } JDK jdk = build.getProject().getJDK(); if (jdk != null) { Node node = build.getBuiltOn(); if (node != null) { jdk = jdk.forNode(node, logger.getListener()); } jdk.buildEnvVars(result); } } catch (IOException ioe) { throw new EnvInjectException(ioe); } catch (InterruptedException ie) { throw new EnvInjectException(ie); } Executor e = build.getExecutor(); if (e != null) { result.put("EXECUTOR_NUMBER", String.valueOf(e.getNumber())); } String rootUrl = Hudson.getInstance().getRootUrl(); if (rootUrl != null) { result.put("BUILD_URL", rootUrl + build.getUrl()); result.put("JOB_URL", rootUrl + build.getParent().getUrl()); } result.putAll(build.getBuildVariables()); Map<String, String> triggerVariable = new BuildCauseRetriever().getTriggeredCause(build); result.putAll(triggerVariable); return result; }
Source:
private static void refreshFeed(Context context, Feed feed, boolean loadAllPages, boolean force) throws DownloadRequestException { Feed f; String lastUpdate = feed.hasLastUpdateFailed() ? null : feed.getLastUpdate(); if (feed.getPreferences() == null) { f = new Feed(feed.getDownload_url(), lastUpdate, feed.getTitle()); } else { f = new Feed(feed.getDownload_url(), lastUpdate, feed.getTitle(), feed.getPreferences().getUsername(), feed.getPreferences().getPassword()); } f.setId(feed.getId()); if (f.isLocalFeed()) { String path = f.getDownload_url().substring("file:".length()); Uri uri = new Uri.Builder().scheme("file").path(path).build(); f.setItems(feed.getItems()); LocalFeedUpdater.updateFeed(f, context); } else { DownloadRequester.getInstance().downloadFeed(context, f, loadAllPages, force); } }

Target:
private static void refreshFeed(Context context, Feed feed, boolean loadAllPages, boolean force) throws DownloadRequestException { Feed f; String lastUpdate = feed.hasLastUpdateFailed() ? null : feed.getLastUpdate(); if (feed.getPreferences() == null) { f = new Feed(feed.getDownload_url(), lastUpdate, feed.getTitle()); } else { f = new Feed(feed.getDownload_url(), lastUpdate, feed.getTitle(), feed.getPreferences().getUsername(), feed.getPreferences().getPassword()); } f.setId(feed.getId()); if (f.isLocalFeed()) { f.setItems(feed.getItems()); new Thread(() -> LocalFeedUpdater.updateFeed(f, context)).start(); } else { DownloadRequester.getInstance().downloadFeed(context, f, loadAllPages, force); } }
Source:
public void writeMutationAsync(Mutation m) { try { MutationBatch mb = new MutationBatch(m); mb.isAsync = true; asyncBatchesAdded.incrementAndGet(); mQueue.put(mb); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public void writeMutationAsync(Mutation m) { writeMutationsAsync(Collections.singletonList(m)); }
Source:
public static File makeNumericDimFile(File dir, String dimension, ByteOrder order) { return new File(dir, StringUtils.safeFormat("numeric_dim_%s_%s.drd", dimension, order)); }

Target:
public static File makeNumericDimFile(File dir, String dimension, ByteOrder order) { return new File(dir, StringUtils.format("numeric_dim_%s_%s.drd", dimension, order)); }
Source:
private void createTempFeatureXMLFile() throws IOException, MSDKException { final Logger logger = LoggerFactory.getLogger(this.getClass()); logger.info(execShellCommand(OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME + " -in " + mzMLFile.getAbsolutePath() + " -out " + FEATURE_XML_FILE.getAbsolutePath())); if (!FEATURE_XML_FILE.exists()) throw new MSDKException("Could not create featureXML File"); FEATURE_XML_FILE.deleteOnExit(); }

Target:
private void createTempFeatureXMLFile() throws IOException, MSDKException { final Logger logger = LoggerFactory.getLogger(this.getClass()); if (Strings.isNullOrEmpty(OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME)) { throw new MSDKException("FeatureFinderMetabo not found. Please install OpenMS on your machine."); } final String cmdOutput = execShellCommand( OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME + " -in " + mzMLFILE_PATH + " -out " + FEATURE_XML_FILE_PATH); logger.info(cmdOutput); if (!FEATURE_XML_FILE.exists()) { String error = ""; Scanner cmdOutputParser = new Scanner(cmdOutput); while (cmdOutputParser.hasNext()) { String curLine = cmdOutputParser.nextLine(); if (curLine.toLowerCase().contains("error")) error += curLine; } cmdOutputParser.close(); throw new MSDKException("The input mzML could not be processed.\n" + error); } FEATURE_XML_FILE.deleteOnExit(); }
Source:
private ResourceBundle getResourceBundle(Locale locale) { try { if (!resourceBundlesByLocale.containsKey(locale)) { resourceBundlesByLocale.put(locale, ResourceBundle.getBundle(messageSource, locale)); } } catch (RuntimeException e) { log.error("File: '{}' could not be loaded: {}", messageSource, e.getMessage()); log.debug("Exception", e); } return resourceBundlesByLocale.get(locale); }

Target:
private synchronized ResourceBundle getResourceBundle(Locale locale) { try { if (!resourceBundlesByLocale.containsKey(locale)) { resourceBundlesByLocale.put(locale, ResourceBundle.getBundle(messageSource, locale)); } } catch (RuntimeException e) { log.error("File: '{}' could not be loaded: {}", messageSource, e.getMessage()); log.debug("Exception", e); } return resourceBundlesByLocale.get(locale); }
Source:
private PushButton createButton(final Pair<T, V> item) { boolean ghostItem = isGhost(item.getFirst()); final PushButton button = new PushButton(new Image(ghostItem ? resources.increaseIcon() : resources.decreaseIcon())); button.addStyleName(style.buttonStyle()); button.setEnabled(!ghostItem); button.addClickHandler(ghostItem ? new ClickHandler() { @Override public void onClick(ClickEvent event) { swapAddButton(item, button); addGhostEntry(); } } : new ClickHandler() { @Override public void onClick(ClickEvent event) { removeEntry(item); } }); return button; }

Target:
private PushButton createButton(final Pair<T, V> item) { boolean ghostItem = isGhost(item.getFirst()); final PushButton button = new PushButton(new Image(ghostItem ? resources.increaseIcon() : resources.decreaseIcon())); button.addStyleName(style.buttonStyle()); button.setEnabled(!ghostItem); button.addClickHandler(ghostItem ? new ClickHandler() { @Override public void onClick(ClickEvent event) { ((AddRemoveRowPanel) item.getSecond().getParent()).swapButton(createButton(item)); addGhostEntry(); } } : new ClickHandler() { @Override public void onClick(ClickEvent event) { removeEntry(item); } }); return button; }
Source:
private void newStream(HeadersFrame frame, Promise<Stream> promise, Stream.Listener listener) { Slot slot = new Slot(); try { int streamId = frame.getStreamId(); if (streamId <= 0) { synchronized (this) { streamId = localStreamIds.getAndAdd(2); slots.offer(slot); } PriorityFrame priority = frame.getPriority(); priority = priority == null ? null : new PriorityFrame(streamId, priority); frame = new HeadersFrame(streamId, priority, frame); } else { synchronized (this) { slots.offer(slot); } } fillSlotWithNewLocalStream(slot, frame, promise, listener, streamId); } catch (Throwable x) { removeSlotAndFailPromise(slot, promise, x); } }

Target:
private void newStream(HeadersFrame frame, Promise<Stream> promise, Stream.Listener listener) { Slot slot = new Slot(); int currentStreamId = frame.getStreamId(); int streamId = reserveSlot(slot, currentStreamId); if (currentStreamId <= 0) { PriorityFrame priority = frame.getPriority(); priority = priority == null ? null : new PriorityFrame(streamId, priority.getParentStreamId(), priority.getWeight(), priority.isExclusive()); frame = new HeadersFrame(streamId, frame.getMetaData(), priority, frame.isEndStream()); } try { createLocalStream(slot, frame, promise, listener, streamId); } catch (Throwable x) { freeSlotAndFailPromise(slot, promise, x); } }
Source:
private void loadMetadata(AlluxioURI path, boolean recursive) throws IOException { LoadMetadataPOptions options; try { if (recursive) { options = LoadMetadataPOptions.newBuilder() .setLoadDescendantType(LoadDescendantPType.ALL) .build(); } else { options = LoadMetadataPOptions.newBuilder() .setLoadDescendantType(LoadDescendantPType.ONE) .build(); } mFileSystem.loadMetadata(path, options); } catch (AlluxioException e) { throw new IOException(e.getMessage()); } }

Target:
private void loadMetadata(AlluxioURI path, boolean recursive) throws IOException { try { ListStatusPOptions options = ListStatusPOptions.newBuilder() .setRecursive(recursive).build(); mFileSystem.loadMetadata(path, options); } catch (AlluxioException e) { throw new IOException(e.getMessage()); } }
Source:
public void checkCanCreateViewWithSelectFromColumns(TransactionId transactionId, Identity identity, QualifiedObjectName tableName, Set<String> columnNames) { if (shouldDenyPrivilege(identity.getUser(), tableName.getObjectName(), CREATE_VIEW_WITH_SELECT_COLUMNS)) { denyCreateViewWithSelect(tableName.toString()); } if (denyPrivileges.isEmpty()) { super.checkCanCreateViewWithSelectFromColumns(transactionId, identity, tableName, columnNames); } }

Target:
public void checkCanCreateViewWithSelectFromColumns(TransactionId transactionId, Identity identity, QualifiedObjectName tableName, Set<String> columnNames) { if (shouldDenyPrivilege(identity.getUser(), tableName.getObjectName(), CREATE_VIEW_WITH_SELECT_COLUMNS)) { denyCreateViewWithSelect(tableName.toString(), identity); } if (denyPrivileges.isEmpty()) { super.checkCanCreateViewWithSelectFromColumns(transactionId, identity, tableName, columnNames); } }
Source:
public void readNodesFromXML() { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder; try { dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(nodeXMLfile); doc.getDocumentElement().normalize(); nodes = new ArrayList<ArrayList<String>>(); NodeList nList = doc.getElementsByTagName("node"); for (int temp = 0; temp < nList.getLength(); temp++) { Node nNode = nList.item(temp); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; ArrayList<String> info = new ArrayList<String>(); info.add(eElement.getElementsByTagName("id").item(0).getTextContent()); info.add(eElement.getElementsByTagName("cluster_ip").item(0).getTextContent()); nodes.add(info); } } } catch (ParserConfigurationException e) { System.err.println(e); } catch (SAXException e) { System.err.println(e); } catch (IOException e) { System.err.println(e); } }

Target:
public void readNodesFromXML() throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder; dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(nodeXMLfile); doc.getDocumentElement().normalize(); nodes = new ArrayList<ArrayList<String>>(); NodeList nList = doc.getElementsByTagName("node"); for (int temp = 0; temp < nList.getLength(); temp++) { Node nNode = nList.item(temp); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; ArrayList<String> info = new ArrayList<String>(); info.add(eElement.getElementsByTagName("id").item(0).getTextContent()); info.add(eElement.getElementsByTagName("cluster_ip").item(0).getTextContent()); nodes.add(info); } } }
Source:
public WorkspaceCache( ExecutionContext context, String repositoryKey, String workspaceName, WorkspaceCache systemWorkspace, DocumentStore documentStore, DocumentTranslator translator, NodeKey rootKey, ConcurrentMap<NodeKey, CachedNode> cache, ChangeBus changeBus ) { this.context = context; this.documentStore = documentStore; this.changeBus = changeBus; this.translator = translator; this.rootKey = rootKey; this.childReferenceForRoot = new ChildReference(rootKey, Path.ROOT_NAME, 1); this.repositoryKey = repositoryKey; this.workspaceName = workspaceName; this.workspaceKey = rootKey.getWorkspaceKey(); this.sourceKey = rootKey.getSourceKey(); this.pathFactory = context.getValueFactories().getPathFactory(); this.nameFactory = context.getValueFactories().getNameFactory(); this.nodesByKey = cache; if (systemWorkspace != null) { this.systemChangeNotifier = new SystemChangeNotifier(systemWorkspace.getWorkspaceName()); this.nonSystemChangeNotifier = new NonSystemChangeNotifier(systemWorkspace.getWorkspaceName()); this.changeBus.registerInThread(this.systemChangeNotifier); this.changeBus.register(this.nonSystemChangeNotifier); } else if (this.changeBus != null) { this.nonSystemChangeNotifier = null; this.systemChangeNotifier = new SystemChangeNotifier(this.workspaceName); this.changeBus.registerInThread(this.systemChangeNotifier); } else { this.systemChangeNotifier = null; this.nonSystemChangeNotifier = null; } }

Target:
public WorkspaceCache( ExecutionContext context, String repositoryKey, String workspaceName, WorkspaceCache systemWorkspace, DocumentStore documentStore, DocumentTranslator translator, NodeKey rootKey, ConcurrentMap<NodeKey, CachedNode> cache, ChangeBus changeBus ) { assert context != null; assert repositoryKey != null; assert workspaceName != null; assert documentStore != null; assert translator != null; assert rootKey != null; assert cache != null; assert changeBus != null; this.context = context; this.documentStore = documentStore; this.changeBus = changeBus; this.translator = translator; this.rootKey = rootKey; this.childReferenceForRoot = new ChildReference(rootKey, Path.ROOT_NAME, 1); this.repositoryKey = repositoryKey; this.workspaceName = workspaceName; this.workspaceKey = rootKey.getWorkspaceKey(); this.sourceKey = rootKey.getSourceKey(); this.pathFactory = context.getValueFactories().getPathFactory(); this.nameFactory = context.getValueFactories().getNameFactory(); this.nodesByKey = cache; if (systemWorkspace != null) { this.systemChangeNotifier = new SystemChangeNotifier(systemWorkspace.getWorkspaceName()); this.nonSystemChangeNotifier = new NonSystemChangeNotifier(systemWorkspace.getWorkspaceName()); this.changeBus.registerInThread(this.systemChangeNotifier); this.changeBus.register(this.nonSystemChangeNotifier); } else { this.nonSystemChangeNotifier = null; this.systemChangeNotifier = new SystemChangeNotifier(this.workspaceName); this.changeBus.registerInThread(this.systemChangeNotifier); } }
Source:
public void addToList(File directory) { try { File[] allfiles = directory.listFiles(); for (int i = 0; i < allfiles.length; i++) { if (allfiles[i].length() >= 4 && allfiles[i].toString().endsWith(".mp3")) { list.add(allfiles[i].toString()); } else if (allfiles[i].isDirectory()) { FolderLoader loader = new FolderLoader(allfiles[i].toString()); File submap = new File(allfiles[i].toString()); loader.addToList(submap); list.addAll(loader.getList()); } } } catch (NullPointerException e) { System.out.println("No such directory"); } }

Target:
private void addToList(File directory) { try { for (File file : directory.listFiles()) { if (file.length() >= 4 && file.toString().endsWith(".mp3")) { list.add(file.toString()); } else if (file.isDirectory()) { this.addToList(file); } } } catch (NullPointerException e) { System.out.println("No such directory"); } }
Source:
protected void execute(Context context) throws SQLException { long sonarUsersGroupId = selectSonarUsersGroup(context); MassUpdate massUpdate = context.prepareMassUpdate().rowPluralName("users"); massUpdate.select("SELECT u.id FROM users u " + "WHERE u.active=? AND NOT EXISTS " + "(SELECT 1 FROM groups_users gu " + "INNER JOIN groups g on g.id=gu.group_id AND g.name=? " + "WHERE gu.user_id=u.id)") .setBoolean(1, true) .setString(2, SONAR_USERS_NAME); massUpdate.update("INSERT INTO groups_users (user_id, group_id) values (?, ?)"); massUpdate.execute((row, update) -> { update.setLong(1, row.getLong(1)); update.setLong(2, sonarUsersGroupId); return true; }); }

Target:
protected void execute(Context context) throws SQLException { long sonarUsersGroupId = selectSonarUsersGroup(context); MassUpdate massUpdate = context.prepareMassUpdate().rowPluralName("users"); massUpdate.select("SELECT u.id FROM users u " + "WHERE u.active=? AND NOT EXISTS " + "(SELECT 1 FROM groups_users gu WHERE gu.user_id=u.id AND gu.group_id=?)") .setBoolean(1, true) .setLong(2, sonarUsersGroupId); massUpdate.update("INSERT INTO groups_users (user_id, group_id) values (?, ?)"); massUpdate.execute((row, update) -> { update.setLong(1, row.getLong(1)); update.setLong(2, sonarUsersGroupId); return true; }); }
Source:
public void testValidateNameSizeImportAsCloned() { checkVmName(true, StringUtils.repeat("A", 300)); }

Target:
public void testValidateNameSizeImportAsCloned() { checkVmName(true, StringUtils.repeat("aA0._", 60)); }
Source:
void partialBinaryOperator() { assertThat(parseErrorFromParsing("& foo")).contains("& at <0> missing lhs operand"); assertThat(parseErrorFromParsing("foo |")).contains("| at <1> missing rhs operand"); }

Target:
void partialBinaryOperator() { assertThat(parseErrorFromParsing("& foo")).contains("& at <0> missing lhs operand"); assertThat(parseErrorFromParsing("foo |")).contains("| at <4> missing rhs operand"); }
Source:
private static void setParameterTypes(Symbol symbol, FunctionDef functionDef) { if (symbol.is(Symbol.Kind.FUNCTION)) { FunctionSymbolImpl functionSymbol = (FunctionSymbolImpl) symbol; ParameterList parameters = functionDef.parameters(); if (parameters != null) { functionSymbol.parameters().clear(); functionSymbol.addParameters(parameters); } } else if (symbol.is(Symbol.Kind.AMBIGUOUS)) { ((AmbiguousSymbol) symbol).alternatives().stream().filter(s -> s.equals(functionDef.name().symbol())).findFirst().ifPresent(s -> setParameterTypes(s, functionDef)); } }

Target:
private static void setParameterTypes(Symbol symbol, FunctionDef functionDef) { if (symbol.is(Symbol.Kind.FUNCTION)) { FunctionSymbolImpl functionSymbol = (FunctionSymbolImpl) symbol; ParameterList parameters = functionDef.parameters(); if (parameters != null) { functionSymbol.setParametersWithType(parameters); } } else if (symbol.is(Symbol.Kind.AMBIGUOUS)) { FunctionSymbol funcDefSymbol = ((FunctionDefImpl) functionDef).functionSymbol(); if (funcDefSymbol != null) { setParameterTypes(funcDefSymbol, functionDef); } } }
Source:
public static boolean hasPostConstruct(Class<?> clazz, Function<Method, Boolean> validateParameterCount) { for (Method m : clazz.getDeclaredMethods()) { if (m.getAnnotation(PostConstruct.class) != null) { if (validatePostConstructMethod(m, validateParameterCount)) { return true; } } } return false; }

Target:
public static boolean hasPostConstruct(Class<?> clazz, Function<Method, Boolean> validateParameterCount) { for (Method m : clazz.getDeclaredMethods()) { if (m.getAnnotation(PostConstruct.class) != null) { if (validatePostConstructMethod(m, validateParameterCount)) { return true; } } } Class<?> parent = clazz.getSuperclass(); if (parent != null && parent != Object.class) { return hasPostConstruct(parent, validateParameterCount); } return false; }
Source:
public void testRemoveValueNoStoreEntryUnequalCacheWriterEntry() throws Exception { final MockStore realStore = new MockStore(Collections.<String, String>emptyMap()); this.store = spy(realStore); final MockCacheWriter realCache = new MockCacheWriter(Collections.singletonMap("key", "unequalValue")); final Ehcache<String, String> ehcache = this.getEhcache(realCache); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(realStore.getMap().containsKey("key"), is(false)); assertThat(realCache.getEntries().get("key"), is(equalTo("unequalValue"))); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }

Target:
public void testRemoveValueNoStoreEntryUnequalCacheWriterEntry() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); final FakeCacheWriter fakeWriter = new FakeCacheWriter(Collections.singletonMap("key", "unequalValue")); final Ehcache<String, String> ehcache = this.getEhcache(fakeWriter); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(fakeStore.getEntryMap().containsKey("key"), is(false)); assertThat(fakeWriter.getEntryMap().get("key"), is(equalTo("unequalValue"))); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }
Source:
private boolean validateKeyFromKeyStore(KeyStore store, String alias) throws KeyStoreException { Certificate[] certifChain = null; logger.debug("Testing " + alias); Certificate cert = store.getCertificate(alias); if (cert != null) { certifChain = new Certificate[]{cert}; } else { certifChain = store.getCertificateChain(alias); } if(certifChain == null) { logger.warn("Alias \"" + alias + "\" not found"); return false; } int len = certifChain.length; boolean res = true; Date nextMonth = new Date(); nextMonth.setMonth((nextMonth.getMonth()%12) + 1); for (int i = 0; i < len; i++) { if(certifChain[i].getType().equals("X.509")) { res = res && validateCertificate((X509Certificate) certifChain[i], nextMonth); } } logger.debug(alias + " is valid: " + res); return res; }

Target:
private void validateKeyFromKeyStore(KeyStore store, String alias) throws KeyStoreException, CertificateExpiredException, CertificateNotYetValidException { Certificate[] certifChain = null; Certificate cert = store.getCertificate(alias); if (cert != null) { certifChain = new Certificate[]{cert}; } else { certifChain = store.getCertificateChain(alias); } if(certifChain == null) { throw new KeyStoreException("Alias not found: " + alias); } int len = certifChain.length; Date nextMonth = new Date(); nextMonth.setMonth((nextMonth.getMonth()%12) + 1); for (int i = 0; i < len; i++) { if(certifChain[i].getType().equals("X.509")) { X509Certificate xCertif = (X509Certificate)certifChain[i]; boolean valid = false; try { xCertif.checkValidity(); valid = true; xCertif.checkValidity(nextMonth); } catch (CertificateExpiredException e) { if(!valid) { throw new CertificateExpiredException("Alias: " + alias + ". The folowing certificate has expired\n" + xCertif); } logger.warn("Alias: " + alias + ". The following certificate will expire soon\n" + xCertif); } catch (CertificateNotYetValidException e) { throw new CertificateNotYetValidException("Alias: " + alias + ". The following certificate is not yet valid\n" + xCertif); } } } return; }
Source:
public void testDataSyncToPassiveCustomBatchSize() throws Exception { System.setProperty(ClusterTierActiveEntity.SYNC_DATA_SIZE_PROP, "512"); try { prepareAndRunActiveEntityForPassiveSync((activeEntity, concurrencyKey) -> { @SuppressWarnings("unchecked") PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel = mock(PassiveSynchronizationChannel.class); activeEntity.synchronizeKeyToPassive(syncChannel, concurrencyKey); verify(syncChannel, atLeast(1)).synchronizeToPassive(any(EhcacheDataSyncMessage.class)); }); } finally { System.clearProperty(ClusterTierActiveEntity.SYNC_DATA_SIZE_PROP); } }

Target:
public void testDataSyncToPassiveCustomBatchSize() throws Exception { System.setProperty(ClusterTierActiveEntity.SYNC_DATA_SIZE_PROP, "512"); try { prepareAndRunActiveEntityForPassiveSync((activeEntity, concurrencyKey) -> { @SuppressWarnings("unchecked") PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel = mock(PassiveSynchronizationChannel.class); activeEntity.synchronizeKeyToPassive(syncChannel, concurrencyKey); verify(syncChannel, atLeast(2)).synchronizeToPassive(any(EhcacheDataSyncMessage.class)); }); } finally { System.clearProperty(ClusterTierActiveEntity.SYNC_DATA_SIZE_PROP); } }