auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand() { if (!moveParametersList.isEmpty()) { vdcReturnValues.addAll(Backend.getInstance().RunMultipleActions(VdcActionType.MoveOrCopyDisk, new ArrayList<VdcActionParametersBase>(getMoveDisksParametersList()), false)); } if (!vmsLiveMigrateParametersMap.isEmpty()) { vdcReturnValues.addAll(Backend.getInstance().RunMultipleActions(VdcActionType.LiveMigrateVmDisks, new ArrayList<VdcActionParametersBase>(getLiveMigrateDisksParametersList()), false)); } handleChildReturnValue(); setSucceeded(true); }

Target:
protected void executeCommand() { if (!moveParametersList.isEmpty()) { vdcReturnValues.addAll(Backend.getInstance().RunMultipleActions(VdcActionType.MoveOrCopyDisk, getMoveDisksParametersList(), false)); } if (!vmsLiveMigrateParametersList.isEmpty()) { vdcReturnValues.addAll(Backend.getInstance().RunMultipleActions(VdcActionType.LiveMigrateVmDisks, getLiveMigrateDisksParametersList(), false)); } handleChildReturnValue(); setSucceeded(true); }
Source:
public static String parseGitHubReference(String gitReference) { Pattern pattern = Pattern.compile("^refs/(tags|heads)/([a-zA-Z0-9]+([./_-]?[a-zA-Z0-9]+)*)$"); Matcher matcher = pattern.matcher(gitReference); if (!matcher.find()) { String msg = "Reference " + gitReference + " is not of the valid form"; LOG.error(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } String gitBranchName = matcher.group(2); return gitBranchName; }

Target:
public static Optional<String> parseGitHubReference(String gitReference) { Pattern pattern = Pattern.compile("^refs/(tags|heads)/([a-zA-Z0-9]+([./_-]?[a-zA-Z0-9]+)*)$"); Matcher matcher = pattern.matcher(gitReference); if (!matcher.find()) { return Optional.empty(); } String gitBranchName = matcher.group(2); return Optional.of(gitBranchName); }
Source:
public static ImageFigureWithAlpha createImageFigure(final ContainerStyle containerStyle) { if (containerStyle instanceof FlatContainerStyle) { FlatContainerStyle style = (FlatContainerStyle) containerStyle; SVGWorkspaceImageFigure fig = new SVGWorkspaceImageFigure(); fig.refreshFigure(style); return fig; } return null; }

Target:
public static SVGWorkspaceImageFigure createImageFigure(final ContainerStyle containerStyle) { if (containerStyle instanceof FlatContainerStyle) { FlatContainerStyle style = (FlatContainerStyle) containerStyle; SVGWorkspaceImageFigure fig = new SVGWorkspaceImageFigure(); fig.refreshFigure(style); return fig; } return null; }
Source:
void handleQuery(@Nonnull RequestMsg req, @Nonnull ChannelHandlerContext ctx, @Nonnull IServerRouter r) { final UUID workflowId = getUUID(req.getPayload().getOrchestratorRequest().getQuery().getWorkflowId()); boolean isActive = false; if (activeWorkflows.containsKey(workflowId)) isActive = true; log.trace("handleQuery[{}]: isActive={} for workflowId={}", req.getHeader().getRequestId(), isActive, workflowId); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getQueriedWorkflowResponseMsg(isActive)); r.sendResponse(response, ctx); }

Target:
void handleQuery(@Nonnull RequestMsg req, @Nonnull ChannelHandlerContext ctx, @Nonnull IServerRouter r) { final UUID workflowId = getUUID(req.getPayload().getOrchestratorRequest().getQuery().getWorkflowId()); boolean isActive = false; if (activeWorkflows.containsKey(workflowId)) { isActive = true; } log.trace("handleQuery[{}]: isActive={} for workflowId={}", req.getHeader().getRequestId(), isActive, workflowId); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getQueriedWorkflowResponseMsg(isActive)); r.sendResponse(response, ctx); }
Source:
public void fetchAllDocuments(final KuzzleOptions options, @NonNull final KuzzleResponseListener<KuzzleDocumentList> listener) { if (listener == null) { throw new IllegalArgumentException("KuzzleDataCollection.fetchAllDocuments: listener required"); } this.advancedSearch(new JSONObject(), options, listener); }

Target:
public void fetchAllDocuments(final KuzzleOptions options, @NonNull final KuzzleResponseListener<KuzzleDocumentList> listener) { if (listener == null) { throw new IllegalArgumentException("KuzzleDataCollection.fetchAllDocuments: listener required"); } this.search(new JSONObject(), options, listener); }
Source:
public void onMessage(org.springframework.amqp.core.Message amqpMessage, Channel channel) throws Exception { Message<?> message = toMessagingMessage(amqpMessage); if (logger.isDebugEnabled()) { logger.debug("Processing [" + message + "]"); } InvocationResult result = null; try { result = invokeHandler(amqpMessage, channel, message); if (result.getReturnValue() != null) { handleResult(result, amqpMessage, channel, message); } else { logger.trace("No result object given - no result to handle"); } } catch (ListenerExecutionFailedException e) { if (this.errorHandler != null) { try { message = MessageBuilder.fromMessage(message) .setHeader(AmqpHeaders.CHANNEL, channel) .build(); Object errorResult = this.errorHandler.handleError(amqpMessage, message, e); if (errorResult != null) { handleResult(new InvocationResult(errorResult, this.handlerAdapter.getSendToForPayload(message.getPayload()), null), amqpMessage, channel, message); } else { logger.trace("Error handler returned no result"); } } catch (Exception ex) { returnOrThrow(amqpMessage, channel, message, ex, ex); } } else { returnOrThrow(amqpMessage, channel, message, e.getCause(), e); } } }

Target:
public void onMessage(org.springframework.amqp.core.Message amqpMessage, Channel channel) throws Exception { Message<?> message = toMessagingMessage(amqpMessage); if (logger.isDebugEnabled()) { logger.debug("Processing [" + message + "]"); } InvocationResult result = null; try { result = invokeHandler(amqpMessage, channel, message); if (result.getReturnValue() != null) { handleResult(result, amqpMessage, channel, message); } else { logger.trace("No result object given - no result to handle"); } } catch (ListenerExecutionFailedException e) { if (this.errorHandler != null) { try { message = MessageBuilder.fromMessage(message) .setHeader(AmqpHeaders.CHANNEL, channel) .build(); Object errorResult = this.errorHandler.handleError(amqpMessage, message, e); if (errorResult != null) { handleResult(this.handlerAdapter.getInvocationResultFor(errorResult, message.getPayload()), amqpMessage, channel, message); } else { logger.trace("Error handler returned no result"); } } catch (Exception ex) { returnOrThrow(amqpMessage, channel, message, ex, ex); } } else { returnOrThrow(amqpMessage, channel, message, e.getCause(), e); } } }
Source:
public BlobStatus getStatus(ManagedBlob blob) throws IOException { String key = stripBlobKeyPrefix(blob.getKey()); String objectKey; String versionId; int seppos = key.indexOf(VER_SEP); if (seppos < 0) { objectKey = key; versionId = null; } else { objectKey = key.substring(0, seppos); versionId = key.substring(seppos + 1); } String bucketKey = config.bucketPrefix + objectKey; GetObjectMetadataRequest request = new GetObjectMetadataRequest(config.bucketName, bucketKey); request.setVersionId(versionId); ObjectMetadata metadata; try { metadata = config.amazonS3.getObjectMetadata(request); } catch (AmazonServiceException e) { if (S3BlobStore.isMissingKey(e)) { log.error("Failed to get information on blob: " + key, e); return new BlobStatus(); } throw e; } String storageClass = defaultIfEmpty(metadata.getStorageClass(), StorageClass.Standard.toString()); Boolean ongoingRestore = metadata.getOngoingRestore(); boolean downloadable = !TRUE.equals(ongoingRestore); Date date = metadata.getRestoreExpirationTime(); Instant downloadableUntil = date == null ? null : date.toInstant(); return new BlobStatus().withStorageClass(storageClass) .withDownloadable(downloadable) .withDownloadableUntil(downloadableUntil); }

Target:
public BlobStatus getStatus(ManagedBlob blob) throws IOException { String key = stripBlobKeyPrefix(blob.getKey()); String objectKey; String versionId; int seppos = key.indexOf(VER_SEP); if (seppos < 0) { objectKey = key; versionId = null; } else { objectKey = key.substring(0, seppos); versionId = key.substring(seppos + 1); } String bucketKey = config.bucketPrefix + objectKey; GetObjectMetadataRequest request = new GetObjectMetadataRequest(config.bucketName, bucketKey, versionId); ObjectMetadata metadata; try { metadata = config.amazonS3.getObjectMetadata(request); } catch (AmazonServiceException e) { if (S3BlobStore.isMissingKey(e)) { log.error("Failed to get information on blob: {}", key, e); return new BlobStatus().withDownloadable(false); } throw new IOException(e); } String storageClass = metadata.getStorageClass(); if (StorageClass.Standard.toString().equals(storageClass)) { storageClass = null; } Boolean ongoingRestore = metadata.getOngoingRestore(); boolean downloadable = !TRUE.equals(ongoingRestore); Date date = metadata.getRestoreExpirationTime(); Instant downloadableUntil = date == null ? null : date.toInstant(); return new BlobStatus().withStorageClass(storageClass) .withDownloadable(downloadable) .withDownloadableUntil(downloadableUntil); }
Source:
private static ImmutableList<Entry<Cell, byte[]>> mergeInLocalWrites( Iterator<Entry<Cell, byte[]>> postFilterIterator, Iterator<Entry<Cell, byte[]>> localWritesInRange, boolean isReverse) { Ordering<Entry<Cell, byte[]>> ordering = Ordering.natural().onResultOf(MapEntries.getKeyFunction()); ImmutableList<Entry<Cell, byte[]>> mergedList = ImmutableList.copyOf(IteratorUtils.mergeIterators( postFilterIterator, localWritesInRange, isReverse ? ordering.reverse() : ordering, from -> from.rhSide)); ImmutableList<Entry<Cell, byte[]>> mergedListWithoutEmptyValues = ImmutableList.copyOf(Iterators.filter( mergedList.iterator(), Predicates.compose(Predicates.not(Value.IS_EMPTY), MapEntries.getValueFunction()))); getEmptyValuesCountMeter().mark(mergedList.size() - mergedListWithoutEmptyValues.size()); return mergedListWithoutEmptyValues; }

Target:
private static List<Entry<Cell, byte[]>> mergeInLocalWrites( Iterator<Entry<Cell, byte[]>> postFilterIterator, Iterator<Entry<Cell, byte[]>> localWritesInRange, boolean isReverse) { Ordering<Entry<Cell, byte[]>> ordering = Ordering.natural().onResultOf(MapEntries.getKeyFunction()); Iterator<Entry<Cell, byte[]>> mergeIterators = IteratorUtils.mergeIterators( postFilterIterator, localWritesInRange, isReverse ? ordering.reverse() : ordering, from -> from.rhSide); return postFilterEmptyValues(mergeIterators); }
Source:
public void updateExtentsOnBlockItemBoxShape(OnAddedComponent event, EntityRef itemEntity, BlockItemComponent blockItemComponent, BoxShapeComponent boxShapeComponent) { BlockFamily blockFamily = blockItemComponent.blockFamily; if (blockFamily == null) { LOGGER.warn("Prefab " + itemEntity.getParentPrefab().getName() + " does not have a block family"); return; } if (blockFamily.getArchetypeBlock().getCollisionShape() instanceof BoxShape) { Vector3f extents = ((BoxShape) blockFamily.getArchetypeBlock().getCollisionShape()).getHalfExtentsWithoutMargin(new Vector3f()); extents.scale(2.0f); extents.x = Math.max(extents.x, 0.5f); extents.y = Math.max(extents.y, 0.5f); extents.z = Math.max(extents.z, 0.5f); boxShapeComponent.extents.set(extents); itemEntity.saveComponent(boxShapeComponent); } }

Target:
public void updateExtentsOnBlockItemBoxShape(OnAddedComponent event, EntityRef itemEntity, BlockItemComponent blockItemComponent, BoxShapeComponent boxShapeComponent) { BlockFamily blockFamily = blockItemComponent.blockFamily; if (blockFamily == null) { LOGGER.warn("Prefab " + itemEntity.getParentPrefab().getName() + " does not have a block family"); return; } if (blockFamily.getArchetypeBlock().getCollisionShape() instanceof BoxShape) { BoxShape collisionShape = (BoxShape) blockFamily.getArchetypeBlock().getCollisionShape(); Vector3f extents = collisionShape.getHalfExtentsWithoutMargin(); extents.scale(2.0f); extents.x = Math.max(extents.x, 0.5f); extents.y = Math.max(extents.y, 0.5f); extents.z = Math.max(extents.z, 0.5f); boxShapeComponent.extents.set(extents); itemEntity.saveComponent(boxShapeComponent); } }
Source:
private void startMiniAccumulo() { try { MiniAccumuloConfig cfg = new MiniAccumuloConfig(new File(config.getMiniDataDir()), PASSWORD); cluster = new MiniAccumuloCluster(cfg); cluster.start(); log.info("Started MiniAccumulo(accumulo="+cluster.getInstanceName()+" zk="+cluster.getZooKeepers()+")"); config.setAccumuloInstance(cluster.getInstanceName()); config.setAccumuloUser(USER); config.setAccumuloPassword(PASSWORD); config.setAccumuloZookeepers(cluster.getZooKeepers()); config.setZookeepers(cluster.getZooKeepers()+"/fluo"); if ((config.containsKey(FluoConfiguration.ADMIN_ACCUMULO_TABLE_PROP) == false) || config.getAccumuloTable().trim().isEmpty()) { config.setAccumuloTable("fluo"); } FluoFactory.newAdmin(config).initialize(); log.info("Initialized Fluo for MiniAccumulo"); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
private void startMiniAccumulo() { try { MiniAccumuloConfig cfg = new MiniAccumuloConfig(new File(config.getMiniDataDir()), PASSWORD); cluster = new MiniAccumuloCluster(cfg); cluster.start(); log.debug("Started MiniAccumulo(accumulo="+cluster.getInstanceName()+" zk="+cluster.getZooKeepers()+")"); config.setAccumuloInstance(cluster.getInstanceName()); config.setAccumuloUser(USER); config.setAccumuloPassword(PASSWORD); config.setAccumuloZookeepers(cluster.getZooKeepers()); config.setZookeepers(cluster.getZooKeepers()+"/fluo"); if ((config.containsKey(FluoConfiguration.ADMIN_ACCUMULO_TABLE_PROP) == false) || config.getAccumuloTable().trim().isEmpty()) { config.setAccumuloTable("fluo"); } FluoFactory.newAdmin(config).initialize(); File miniProps = new File(config.getMiniDataDir()+"/client.properties"); PropertiesConfiguration connConfig = new PropertiesConfiguration(); connConfig.append(config.getClientConfiguration()); connConfig.save(miniProps); log.debug("Wrote MiniFluo client properties to {}", miniProps.getAbsolutePath()); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public static Repo repo() { final String key = System.getProperty("failsafe.github.key"); Assume.assumeThat(key, Matchers.notNullValue()); final String keyrepo = System.getProperty("failsafe.github.repo"); Assume.assumeThat(keyrepo, Matchers.notNullValue()); return new RtGithub(key).repos().get(new Coordinates.Simple(keyrepo)); }

Target:
private static Repo repo() { final String key = System.getProperty("failsafe.github.key"); Assume.assumeThat(key, Matchers.notNullValue()); final String keyrepo = System.getProperty("failsafe.github.repo"); Assume.assumeThat(keyrepo, Matchers.notNullValue()); return new RtGithub(key).repos().get(new Coordinates.Simple(keyrepo)); }
Source:
private Values<String> resolveValue(final String stringValue) { if (stringValue != null && !stringValue.isEmpty()) { if (conditionColumn.getOperator() != null && (conditionColumn.getOperator() .equals("in") || conditionColumn.getOperator() .equals("not in"))) { final Values values = new Values(); for (final String item : stringValue.split(",")) { values.add(item.trim()); } return values; } else { return new Values<>(stringValue); } } else { return new Values<>(); } }

Target:
private Values<String> resolveValue(final String stringValue) { if (stringValue != null && !stringValue.isEmpty()) { if (conditionColumn.getOperator() != null && isOperatorForList()) { final Values values = new Values(); for (final String item : stringValue.split(",")) { values.add(item.trim()); } return values; } else { return new Values<>(stringValue); } } else { return new Values<>(); } }
Source:
private void verifyServiceOfferingByUuid(String offeringUuid) { logger.debug("Verifying router service offering with uuid : " + offeringUuid); ServiceOfferingVO serviceOffering = serviceOfferingDao.findByUuid(offeringUuid); if (serviceOffering != null && serviceOffering.isSystemUse()) { boolean isLocalStorage = ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId()); if (isLocalStorage == serviceOffering.isUseLocalStorage()) { logger.debug("service offering " + serviceOffering.getId() + " will be used on virtual router"); serviceOfferingId = serviceOffering.getId(); } } }

Target:
private void verifyServiceOfferingByUuid(String offeringUuid) { logger.debug("Verifying router service offering with uuid : " + offeringUuid); ServiceOfferingVO serviceOffering = serviceOfferingDao.findByUuid(offeringUuid); if (serviceOffering != null && serviceOffering.isSystemUse()) { boolean isLocalStorage = ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId()); if (isLocalStorage == serviceOffering.isUseLocalStorage()) { logger.debug(String.format("Service offering %s (uuid: %s) will be used on virtual router", serviceOffering.getName(), serviceOffering.getUuid())); serviceOfferingId = serviceOffering.getId(); } } }
Source:
protected AbstractAttributeEditor createAttributeEditor(TaskAttribute attribute) { if (attribute == null) { return null; } String type = attribute.getMetaData().getType(); if (TaskAttribute.KIND_DEFAULT.equals(attribute.getMetaData().getKind())) { TaskRepository repository = taskEditorPage.getTaskRepository(); Map<String, String> properties = repository.getProperties(); String hiddenVar = properties.get(IRepositoryConstants.PROPERTY_HIDDEN); System.out.println(repository.getProperty(IRepositoryConstants.PROPERTY_HIDDEN)); } if (taskEditorPage.getTaskRepository().getProperties().get(IRepositoryConstants.PROPERTY_HIDDEN) != null) { if (taskEditorPage.getTaskRepository() .getProperties() .get(IRepositoryConstants.PROPERTY_HIDDEN) .indexOf(attribute.getId()) == -1) { if (type != null) { AttributeEditorFactory attributeEditorFactory = getTaskEditorPage().getAttributeEditorFactory(); AbstractAttributeEditor editor = attributeEditorFactory.createEditor(type, attribute); if (editor instanceof RichTextAttributeEditor) { boolean spellChecking = getTaskEditorPage().getAttributeEditorToolkit() .hasSpellChecking(attribute); ((RichTextAttributeEditor) editor).setSpellCheckingEnabled(spellChecking); } attributeIds.add(attribute.getId()); return editor; } } } return null; }

Target:
protected AbstractAttributeEditor createAttributeEditor(TaskAttribute attribute) { if (attribute == null) { return null; } String type = attribute.getMetaData().getType(); int index = taskEditorPage.getTaskRepository() .getProperties() .get(IRepositoryConstants.PROPERTY_HIDDEN) .indexOf(attribute.getId()); if (index == -1) { if (type != null) { AttributeEditorFactory attributeEditorFactory = getTaskEditorPage().getAttributeEditorFactory(); AbstractAttributeEditor editor = attributeEditorFactory.createEditor(type, attribute); if (editor instanceof RichTextAttributeEditor) { boolean spellChecking = getTaskEditorPage().getAttributeEditorToolkit().hasSpellChecking(attribute); ((RichTextAttributeEditor) editor).setSpellCheckingEnabled(spellChecking); } attributeIds.add(attribute.getId()); return editor; } } return null; }
Source:
public void setup() { catalogFramework = mock(CatalogFramework.class); workspaceTransformer = mock(WorkspaceTransformerImpl.class); securityService = mock(SecurityService.class); persistentStore = mock(PersistentStore.class); workspaceQueryBuilder = mock(WorkspaceQueryBuilder.class); WorkspaceMetacardFilter workspaceMetacardFilter = mock(WorkspaceMetacardFilter.class); when(workspaceMetacardFilter.filter(any())).thenReturn(true); workspaceService = new WorkspaceServiceImpl( catalogFramework, workspaceTransformer, workspaceQueryBuilder, securityService, persistentStore, MAX_SUBSCRIPTIONS); }

Target:
public void setup() { when(workspaceMetacardFilter.filter(any())).thenReturn(true); workspaceServiceImpl = new WorkspaceServiceImpl( catalogFramework, workspaceTransformer, workspaceQueryBuilder, securityService, persistentStore); workspaceServiceImpl.setMaxSubscriptions(100); }
Source:
public void testNullHeaderReferenceName() { SAMRecord sam = new SAMRecordSetBuilder().addFrag("test", 0, 1, false, false, "3S9M", null, 2); final SAMFileHeader samHeader = sam.getHeader(); Assert.assertTrue(null != samHeader); final String originalRefName = sam.getReferenceName(); int originalRefIndex = sam.getReferenceIndex(); sam.setHeader(null); Assert.assertTrue(originalRefName.equals(sam.getReferenceName())); sam.setHeader(samHeader); Assert.assertTrue(sam.getReferenceIndex().equals(originalRefIndex)); sam.setHeader(null); sam.setReferenceName(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME); Assert.assertTrue(sam.getReferenceName().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME)); Assert.assertTrue(sam.getReferenceIndex().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX)); final String unresolvableRefName = "unresolvable"; sam.setReferenceName(unresolvableRefName); Assert.assertTrue(unresolvableRefName.equals(sam.getReferenceName())); }

Target:
public void testNullHeaderReferenceName() { final SAMRecord sam = createTestRecordHelper(); final SAMFileHeader samHeader = sam.getHeader(); Assert.assertTrue(null != samHeader); final String originalRefName = sam.getReferenceName(); sam.setHeader(null); Assert.assertTrue(originalRefName.equals(sam.getReferenceName())); sam.setReferenceName(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME); Assert.assertTrue(sam.getReferenceName().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_NAME)); Assert.assertTrue(sam.getReferenceIndex().equals(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX)); sam.setReferenceName(originalRefName); Assert.assertTrue(sam.getReferenceName().equals(originalRefName)); }
Source:
KafkaSpoutConfig<String, String> createSpoutConfig() { return SingleTopicKafkaSpoutConfiguration.setCommonSpoutConfigNullTuples( KafkaSpoutConfig.builder("127.0.0.1:" + kafkaUnitRule.getKafkaUnit().getKafkaPort(), Pattern.compile(SingleTopicKafkaSpoutConfiguration.TOPIC))) .setOffsetCommitPeriodMs(commitOffsetPeriodMs) .setRetry(new KafkaSpoutRetryExponentialBackoff(KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0), KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0), maxRetries, KafkaSpoutRetryExponentialBackoff.TimeInterval.seconds(0))) .setProp(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, maxPollRecords) .build(); }

Target:
KafkaSpoutConfig<String, String> createSpoutConfig() { return KafkaSpoutConfig.builder("127.0.0.1:" + kafkaUnitRule.getKafkaUnit().getKafkaPort(), Pattern.compile(SingleTopicKafkaSpoutConfiguration.TOPIC)) .setOffsetCommitPeriodMs(commitOffsetPeriodMs) .setRecordTranslator(new NullRecordExtractor()) .build(); }
Source:
public ScheduledFuture scheduleTask() { return scheduler.scheduleWithFixedDelay(() -> { try { LOG.info("Updating heartbeat for processor ID: " + processorId + " and job model version: " + currentJMVersion.get()); table.updateHeartbeat(currentJMVersion.get(), processorId); } catch (Exception e) { errorHandler.accept("Exception in Heartbeat Scheduler. Stopping the processor..."); } }, HEARTBEAT_DELAY_SEC, HEARTBEAT_DELAY_SEC, TimeUnit.SECONDS); }

Target:
public ScheduledFuture scheduleTask() { return scheduler.scheduleWithFixedDelay(() -> { try { String currJVM = currentJMVersion.get(); LOG.info("Updating heartbeat for processor ID: " + processorId + " and job model version: " + currJVM); table.updateHeartbeat(currJVM, processorId); } catch (Exception e) { errorHandler.accept("Exception in Heartbeat Scheduler. Stopping the processor..."); } }, HEARTBEAT_DELAY_SEC, HEARTBEAT_DELAY_SEC, TimeUnit.SECONDS); }
Source:
public void close() { try { if (channel != null) { channel.close(); } } catch (final IOException e) { } finally { channel = null; isClosed = true; } }

Target:
public void close() { try { if (channel != null) { channel.close(); } } catch (IOException e) { } finally { channel = null; isClosed = true; } }
Source:
static RuntimeException methodError(Method method, String message, Object... args) { if (args.length > 0) { message = String.format(message, args); } return new IllegalArgumentException( method.getDeclaringClass().getSimpleName() + "." + method.getName() + ": " + message); }

Target:
static RuntimeException methodError(Method method, String message, Object... args) { message = String.format(message, args); return new IllegalArgumentException(message + "\n for method " + method.getDeclaringClass().getSimpleName() + "." + method.getName()); }
Source:
public String bowlingPrep (@Sender EntityRef sender, @CommandParam("blockName") String blockName) { ClientComponent clientComponent = sender.getComponent(ClientComponent.class); LocationComponent characterLocation = clientComponent.character.getComponent(LocationComponent.class); Vector3f spawnPos = characterLocation.getWorldPosition(); Vector3f offset = characterLocation.getWorldDirection(); offset.scale(5); spawnPos.add(offset); BlockFamily block = blockManager.getBlockFamily(blockName); if (block == null) { return "Sorry, your block is not found"; } BlockItemFactory blockItemFactory = new BlockItemFactory(entityManager); Vector3f startPos = new Vector3f(spawnPos); float deltax = .2f; float deltaz = .3f; float vectorY = 1.0f; for (int rownumber = 0; rownumber < 4; rownumber++) { startPos.add(deltax * (4 - rownumber), vectorY, deltaz); for (int pinPosx = 0; pinPosx <= rownumber; pinPosx++) { EntityRef blockItem = blockItemFactory.newInstance(block); blockItem.send(new DropItemEvent(startPos)); if (pinPosx < rownumber) { startPos.add(2 * deltax, 0, 0); } } startPos.add(-deltax * (rownumber + 4), 0, 0); } return "prepared 10 " + blockName + " in a bowling pin pattern :)"; }

Target:
public String bowlingPrep(@Sender EntityRef sender, @CommandParam("blockName") String blockName) { ClientComponent clientComponent = sender.getComponent(ClientComponent.class); LocationComponent characterLocation = clientComponent.character.getComponent(LocationComponent.class); Vector3f spawnPos = characterLocation.getWorldPosition(); Vector3f offset = characterLocation.getWorldDirection(); offset.scale(5); spawnPos.add(offset); BlockFamily block = blockManager.getBlockFamily(blockName); if (block == null) { return "Sorry, your block is not found"; } BlockItemFactory blockItemFactory = new BlockItemFactory(entityManager); Vector3f startPos = new Vector3f(spawnPos); float deltax = 0.5f; float deltaz = 1.0f; float vectorY = 0.0f; for (int rownumber = 0; rownumber < 4; rownumber++) { startPos.add(deltax * (4 - rownumber), vectorY, deltaz); for (int pinPosx = 0; pinPosx <= rownumber; pinPosx++) { EntityRef blockItem = blockItemFactory.newInstance(block); blockItem.send(new DropItemEvent(startPos)); if (pinPosx < rownumber) { startPos.add(2 * deltax, 0, 0); } } startPos.add(-deltax * (rownumber + 4), 0, 0); } return "prepared 10 " + blockName + " in a bowling pin pattern :)"; }
Source:
public void testValidateCodeFoundByCodingWithUrlNotMatch() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-5").setSystem("http://url2"))); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: Coding.system 'http://url2' does not equal with CodeSystem.url '<LINK_0>'. Unable to validate.",e.getMessage()); } }

Target:
public void testValidateCodeFoundByCodingWithUrlNotMatch() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-5").setSystem("http://url2"))); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); fail(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: Coding.system 'http://url2' does not equal with CodeSystem.url '<LINK_0>'. Unable to validate.",e.getMessage()); } }
Source:
private void storeAll() { try { File temp = File.createTempFile("caches", null, new File(globalConfiguration.globalState().persistentLocation())); Map<String, Configuration> configurationMap = new HashMap<>(); for (String cacheName : persistentCaches) { configurationMap.put(cacheName, cacheManager.getCacheConfiguration(cacheName)); } try (FileOutputStream f = new FileOutputStream(temp)) { parserRegistry.serialize(f, null, configurationMap); } FileLock lock = null; try (FileOutputStream lockFile = new FileOutputStream(getPersistentFileLock())) { lock = lockFile.getChannel().lock(); temp.renameTo(getPersistentFile()); } finally { if (lock != null && lock.isValid()) lock.release(); getPersistentFileLock().delete(); } } catch (Exception e) { throw log.errorPersistingGlobalConfiguration(e); } }

Target:
private void storeAll() { try { File temp = File.createTempFile("caches", null, new File(globalConfiguration.globalState().persistentLocation())); Map<String, Configuration> configurationMap = new HashMap<>(); for (String cacheName : persistentCaches) { configurationMap.put(cacheName, cacheManager.getCacheConfiguration(cacheName)); } try (FileOutputStream f = new FileOutputStream(temp)) { parserRegistry.serialize(f, null, configurationMap); } FileLock lock = null; try (FileOutputStream lockFile = new FileOutputStream(getPersistentFileLock())) { lock = lockFile.getChannel().lock(); if (!temp.renameTo(getPersistentFile())) { throw log.cannotRenamePersistentFile(temp.getAbsolutePath(), getPersistentFile()); } } finally { if (lock != null && lock.isValid()) lock.release(); getPersistentFileLock().delete(); } } catch (Exception e) { throw log.errorPersistingGlobalConfiguration(e); } }
Source:
private void refreshSnapshotsInCluster(VDSGroup cluster) { if (!supportsGlusterSnapshotFeature(cluster)) { return; } final VDS upServer = getClusterUtils().getRandomUpServer(cluster.getId()); if (upServer == null) { return; } try { List<GlusterVolumeSnapshotEntity> snapshotsList = (ArrayList<GlusterVolumeSnapshotEntity>) runVdsCommand(VDSCommandType.GetGlusterVolumeSnapshotInfo, new GlusterVolumeSnapshotVDSParameters(upServer.getId(), null, cluster.getId())).getReturnValue(); addOrUpdateSnapshots(cluster.getId(), snapshotsList); } catch (VdcBLLException e) { throw e; } }

Target:
private void refreshSnapshotsInCluster(VDSGroup cluster) { if (!supportsGlusterSnapshotFeature(cluster)) { return; } final VDS upServer = getClusterUtils().getRandomUpServer(cluster.getId()); if (upServer == null) { log.info("No UP server found in cluster '{}' for snapshot monitoring", cluster.getName()); return; } VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeSnapshotInfo, new GlusterVolumeSnapshotVDSParameters(upServer.getId(), cluster.getId(), null)); if (returnValue.getSucceeded()) { addOrUpdateSnapshots(cluster.getId(), (ArrayList<GlusterVolumeSnapshotEntity>) returnValue.getReturnValue()); } else { log.error("VDS Error {}", returnValue.getVdsError().getMessage()); log.debug("VDS Error {}", returnValue.getVdsError()); } }
Source:
private boolean isIdentifierDerivationNecessary(Object value) { return value != null && value.getClass().isAnnotationPresent(Entity.class); }

Target:
private boolean isIdentifierDerivationNecessary(Object value) { if (value == null) { return false; } try { ManagedType<? extends Object> managedType = this.metamodel.managedType(value.getClass()); return managedType != null && managedType.getPersistenceType() == PersistenceType.ENTITY; } catch (IllegalArgumentException iae) { return false; } }
Source:
public void execute(TaskListener listener) { for (JCloudsCloud cloud : JCloudsCloud.getClouds()) { for (JCloudsSlaveTemplate template : cloud.getTemplates()) { SlaveOptions slaveOptions = template.getEffectiveSlaveOptions(); int instancesMin = slaveOptions.getInstancesMin(); int retentionTime = slaveOptions.getRetentionTime(); if (instancesMin > 0) { int globalMaxInstances = cloud.getEffectiveSlaveOptions().getInstanceCap(); int templateMaxInstances = slaveOptions.getInstanceCap(); int maxNodes = Math.min(templateMaxInstances, globalMaxInstances); int runningNodeTotal = template.getActiveNodesTotal(retentionTime == 0); int desiredNewInstances = Math.min(instancesMin, maxNodes) - runningNodeTotal; if (desiredNewInstances > 0) { LOGGER.log(Level.INFO, "Pre-creating " + desiredNewInstances + " instance(s) for template " + template.name + " in cloud " + cloud.name); for (int i = 0; i < desiredNewInstances; i++) { try { cloud.doProvisionSlave(template); } catch (Throwable ex) { LOGGER.log(Level.SEVERE, "Failed to pre-create instance from template " + template.name, ex); } } } } } } }

Target:
public void execute(TaskListener listener) { for (JCloudsCloud cloud : JCloudsCloud.getClouds()) { for (JCloudsSlaveTemplate template : cloud.getTemplates()) { SlaveOptions slaveOptions = template.getEffectiveSlaveOptions(); int instancesMin = slaveOptions.getInstancesMin(); int retentionTime = slaveOptions.getRetentionTime(); if (instancesMin > 0) { int globalMaxInstances = cloud.getEffectiveSlaveOptions().getInstanceCap(); int templateMaxInstances = slaveOptions.getInstanceCap(); int maxNodes = Math.min(templateMaxInstances, globalMaxInstances); int reusableRunningNodeTotal = template.getActiveNodesTotal(retentionTime == 0); int runningNodeTotal = template.getActiveNodesTotal(false); int desiredNewInstances = Math.min(instancesMin - reusableRunningNodeTotal, maxNodes - runningNodeTotal); if (desiredNewInstances > 0) { LOGGER.log(Level.INFO, "Pre-creating " + desiredNewInstances + " instance(s) for template " + template.name + " in cloud " + cloud.name); for (int i = 0; i < desiredNewInstances; i++) { try { cloud.provisionSlave(template); } catch (Throwable ex) { LOGGER.log(Level.SEVERE, "Failed to pre-create instance from template " + template.name, ex); } } } } } } }
Source:
private boolean migrateSyncthingOptions () { boolean changed = false; int iConfigVersion = Integer.parseInt(mConfig.getDocumentElement().getAttribute("version")); Log.i(TAG, "Found existing config version " + Integer.toString(iConfigVersion)); if (iConfigVersion == 27) { Log.i(TAG, "Migrating config version " + Integer.toString(iConfigVersion) + " to 28 ..."); NodeList folders = mConfig.getDocumentElement().getElementsByTagName("folder"); for (int i = 0; i < folders.getLength(); i++) { Element r = (Element) folders.item(i); Log.i(TAG, "Set 'fsWatcherEnabled' on folder " + r.getAttribute("id")); r.setAttribute("fsWatcherEnabled", Boolean.toString(true)); changed = true; } iConfigVersion = 28; mConfig.getDocumentElement().setAttribute("version", Integer.toString(iConfigVersion)); Log.i(TAG, "Config version " + Integer.toString(iConfigVersion) + " reached."); } return changed; }

Target:
private boolean migrateSyncthingOptions () { int iConfigVersion = Integer.parseInt(mConfig.getDocumentElement().getAttribute("version")); int iOldConfigVersion = iConfigVersion; Log.i(TAG, "Found existing config version " + Integer.toString(iConfigVersion)); if (iConfigVersion == 27) { Log.i(TAG, "Migrating config version " + Integer.toString(iConfigVersion) + " to 28 ..."); NodeList folders = mConfig.getDocumentElement().getElementsByTagName("folder"); for (int i = 0; i < folders.getLength(); i++) { Element r = (Element) folders.item(i); Log.i(TAG, "Set 'fsWatcherEnabled', 'fsWatcherDelayS' on folder " + r.getAttribute("id")); r.setAttribute("fsWatcherEnabled", "true"); r.setAttribute("fsWatcherDelayS", "10"); } iConfigVersion = 28; } if (iConfigVersion != iOldConfigVersion) { mConfig.getDocumentElement().setAttribute("version", Integer.toString(iConfigVersion)); Log.i(TAG, "New config version is " + Integer.toString(iConfigVersion)); return true; } else { return false; } }
Source:
public int compare(Object o1, Object o2) { if (o1 == null && o2 == null) { return 0; } if (o1 == null) { return -1; } if (o2 == null) { return 1; } if (o1.equals(o2)) { return 0; } Class<?> inf = findSpi(o1.getClass()); ActivateInfo a1 = parseActivate(o1.getClass()); ActivateInfo a2 = parseActivate(o2.getClass()); if ((a1.before.length > 0 || a1.after.length > 0 || a2.before.length > 0 || a2.after.length > 0) && inf != null) { ExtensionLoader<?> extensionLoader = ExtensionLoader.getExtensionLoader(inf); if (a1.before.length > 0 || a1.after.length > 0) { String n2 = extensionLoader.getExtensionName(o2.getClass()); for (String before : a1.before) { if (before.equals(n2)) { return -1; } } for (String after : a1.after) { if (after.equals(n2)) { return 1; } } } if (a2.before.length > 0 || a2.after.length > 0) { String n1 = extensionLoader.getExtensionName(o1.getClass()); for (String before : a2.before) { if (before.equals(n1)) { return 1; } } for (String after : a2.after) { if (after.equals(n1)) { return -1; } } } } int n1 = a1 == null ? 0 : a1.order; int n2 = a2 == null ? 0 : a2.order; return n1 > n2 ? 1 : -1; }

Target:
public int compare(Object o1, Object o2) { if (o1 == null && o2 == null) { return 0; } if (o1 == null) { return -1; } if (o2 == null) { return 1; } if (o1.equals(o2)) { return 0; } Class<?> inf = findSpi(o1.getClass()); ActivateInfo a1 = parseActivate(o1.getClass()); ActivateInfo a2 = parseActivate(o2.getClass()); if ((a1.applicableToCompare() || a2.applicableToCompare()) && inf != null) { ExtensionLoader<?> extensionLoader = ExtensionLoader.getExtensionLoader(inf); if (a1.applicableToCompare()) { String n2 = extensionLoader.getExtensionName(o2.getClass()); if (a1.isLess(n2)) { return -1; } if (a1.isMore(n2)) { return 1; } } if (a2.applicableToCompare()) { String n1 = extensionLoader.getExtensionName(o1.getClass()); if (a2.isLess(n1)) { return 1; } if (a2.isMore(n1)) { return -1; } } } int n1 = a1 == null ? 0 : a1.order; int n2 = a2 == null ? 0 : a2.order; return n1 > n2 ? 1 : -1; }
Source:
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException { RefactoringStatus refactoringStatus = RefactoringStatus.create(Resources.checkInSync(fResource)); if (!refactoringStatus.isOK()) { boolean autoRefresh= Platform.getPreferencesService().getBoolean(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH, false, null); if (autoRefresh) { fResource.refreshLocal(IResource.DEPTH_INFINITE, pm); refactoringStatus= RefactoringStatus.create(Resources.checkInSync(fResource)); } } return refactoringStatus; }

Target:
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException { RefactoringStatus refactoringStatus = RefactoringStatus.create(Resources.checkInSync(fResource)); if (refactoringStatus != null && !refactoringStatus.isOK()) { boolean autoRefresh= Platform.getPreferencesService().getBoolean(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH, false, null); if (autoRefresh) { fResource.refreshLocal(IResource.DEPTH_INFINITE, pm); refactoringStatus= RefactoringStatus.create(Resources.checkInSync(fResource)); } } return refactoringStatus; }
Source:
public void addServer(String serverName, String url, String username, String password) { RemoteServerData serverData = new RemoteServerDataImpl(url, serverName, username, password); addRemoteData(serverData); if(RemoteDescriptorProvider.DATACLOUD_SERVER_NAME.equals(serverName)){ configWriter.addRemoteServer(serverName, null, username, password); }else{ configWriter.addRemoteServer(serverName, url, username, password); } }

Target:
public void addServer(String serverName, String url, String username, String password) { final RemoteServerData serverData = new RemoteServerDataImpl(url, serverName, username, password); addRemoteData(serverData); if(RemoteDescriptorProvider.DATACLOUD_SERVER_NAME.equals(serverName)){ configWriter.addRemoteServer(serverName, null, username, password); }else{ configWriter.addRemoteServer(serverName, url, username, password); } }
Source:
private void registerCompositeDataStore() { if (delegateDataStores.isEmpty()) { log.info("Composite Data Store registration is deferred until there is an active delegate data store"); return; } if (null == dataStore) { Properties properties = new Properties(); if (null != config) { properties.putAll(config); } dataStore = new CompositeDataStore(properties); } for (CompositeDataStoreDelegate delegate : delegateDataStores) { dataStore.addDelegate(delegate); } if (isRegistered) { return; } BundleContext bundleContext = context.getBundleContext(); Dictionary<String, Object> props = new Hashtable<>(); props.put(Constants.SERVICE_PID, dataStore.getClass().getName()); props.put(DESCRIPTION, getDescription()); closer.register(asCloseable(bundleContext.registerService( new String[] { DataStore.class.getName(), CompositeDataStore.class.getName() }, dataStore, props ))); isRegistered = true; }

Target:
private void registerCompositeDataStore() { if (null == dataStore) { Properties properties = null; new Properties(); if (null != config) { properties = new Properties(); properties.putAll(config); } if (null == properties) { log.error("Composite Data Store configuration missing"); return; } Set<String> configuredRoles = CompositeDataStore.getRolesFromConfig(properties); if (0 == configuredRoles.size()) { log.error("No roles configured for Composite Data Store"); return; } if (registeredRoles.size() != configuredRoles.size() || ! configuredRoles.containsAll(registeredRoles)) { log.info("Composite Data Store registration is deferred until all delegate data stores are active"); return; } dataStore = new CompositeDataStore(properties, configuredRoles); } else { if (delegateDataStores.size() != dataStore.getRoles().size()) { log.info("Composite Data Store registration is deferred until all delegate data stores are active"); return; } } for (DataStoreProvider dsp : delegateDataStores) { dataStore.addDelegate(dsp); } if (! isServiceRegistered) { log.info("Registering Composite Data Store"); BundleContext bundleContext = context.getBundleContext(); Dictionary<String, Object> props = new Hashtable<>(); props.put(Constants.SERVICE_PID, dataStore.getClass().getName()); props.put(DESCRIPTION, getDescription()); closer.register(asCloseable(bundleContext.registerService( new String[] { DataStore.class.getName(), CompositeDataStore.class.getName() }, dataStore, props ))); isServiceRegistered = true; } try { initializeDataStore(context, config, dataStore); registerDataStore(context, config, dataStore, getStatisticsProvider(), getDescription(), closer); } catch (RepositoryException e) { log.error("Unable to register CompositeDataStore as a data store", e); } }
Source:
private List<Edit> adaptDiffContent(DiffInfo diffInfo, PatchScriptX patchScriptX, IProgressMonitor monitor) throws GerritException { List<DiffContent> diffContent = diffInfo.getContent(); List<Edit> editsInFile = new ArrayList<>(); int contentSize = 0; for (int i = 0; i < diffContent.size(); i++) { if (diffContent.get(i).getAb() != null) { contentSize += diffContent.get(i).getAb().size(); } else if (diffContent.get(i).getA() != null && diffContent.get(i).getB() != null) { Edit edit = new Edit(contentSize, contentSize + diffContent.get(i).getA().size() - 1, contentSize, contentSize + diffContent.get(i).getB().size() - 1); editsInFile.add(edit); contentSize += diffContent.get(i).getA().size(); patchScriptX.setIntralineDifference(true); } else if (diffContent.get(i).getA() != null) { Edit edit = new Edit(contentSize, contentSize + diffContent.get(i).getA().size() - 1, contentSize, contentSize); editsInFile.add(edit); contentSize += diffContent.get(i).getA().size(); } else if (diffContent.get(i).getB() != null) { Edit edit = new Edit(contentSize, contentSize, contentSize, contentSize + diffContent.get(i).getB().size() - 1); editsInFile.add(edit); contentSize += diffContent.get(i).getB().size(); } } return editsInFile; }

Target:
private List<Edit> adaptDiffContent(DiffInfo diffInfo, PatchScriptX patchScriptX, IProgressMonitor monitor) throws GerritException { List<DiffContent> diffContent = diffInfo.getContent(); List<Edit> editsInFile = new ArrayList<>(); int contentSize = 0; for (DiffContent diff : diffContent) { if (diff.getAb() != null) { contentSize += diff.getAb().size(); } else if (diff.getA() != null && diff.getB() != null) { Edit edit = new Edit(contentSize, contentSize + diff.getA().size() - 1, contentSize, contentSize + diff.getB().size() - 1); editsInFile.add(edit); contentSize += diff.getA().size(); patchScriptX.setIntralineDifference(true); } else if (diff.getA() != null) { Edit edit = new Edit(contentSize, contentSize + diff.getA().size() - 1, contentSize, contentSize); editsInFile.add(edit); contentSize += diff.getA().size(); } else if (diff.getB() != null) { Edit edit = new Edit(contentSize, contentSize, contentSize, contentSize + diff.getB().size() - 1); editsInFile.add(edit); contentSize += diff.getB().size(); } } return editsInFile; }
Source:
public void saveModifications(MaterialInstance materialInstance, List<Modification> newChanges) { ArrayList<Modification> list = new ArrayList<Modification>(newChanges); Collections.reverse(list); for (Modification modification : list) { modification.setMaterialInstance(materialInstance); } try { getHibernateTemplate().saveOrUpdateAll(list); } catch (Exception e) { String message = "Cannot save modification"; LOGGER.error(message, e); throw new RuntimeException(message, e); } for (Modification modification : list) { removeLatestCachedModification(materialInstance, modification); removeCachedModificationCountFor(materialInstance); removeCachedModificationsFor(materialInstance); } }

Target:
public void saveModifications(MaterialInstance materialInstance, List<Modification> newChanges) { ArrayList<Modification> list = new ArrayList<Modification>(newChanges); Collections.reverse(list); for (Modification modification : list) { modification.setMaterialInstance(materialInstance); } try { getHibernateTemplate().saveOrUpdateAll(list); } catch (Exception e) { String message = "Cannot save modification"; LOGGER.error(message, e); throw new RuntimeException(message, e); } for (Modification modification : list) { removeLatestCachedModification(materialInstance, modification); } removeCachedModificationCountFor(materialInstance); removeCachedModificationsFor(materialInstance); }
Source:
public String getDescription() { return "Create an ISO surface contouring of the provided spatial table, use Z value of triangles if you not provide the name of vertices level columns."; }

Target:
public String getDescription() { return "Create an ISO surface contouring of the provided spatial table, use Z value of triangles if you do not provide the name of vertices level columns."; }
Source:
public void testRemoveValueUnequalStoreEntryCacheAccessExceptionNoCacheWriter() throws Exception { final MockStore realStore = new MockStore(Collections.singletonMap("key", "unequalValue")); this.store = spy(realStore); doThrow(new CacheAccessException("")).when(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); final Ehcache<String, String> ehcache = this.getEhcache(null); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verify(this.spiedResilienceStrategy) .removeFailure(eq("key"), eq("value"), any(CacheAccessException.class), eq(false)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }

Target:
public void testRemoveValueUnequalStoreEntryCacheAccessExceptionNoCacheWriter() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.singletonMap("key", "unequalValue")); this.store = spy(fakeStore); doThrow(new CacheAccessException("")).when(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); final Ehcache<String, String> ehcache = this.getEhcache(null); ehcache.remove("key", "value"); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verify(this.spiedResilienceStrategy) .removeFailure(eq("key"), eq("value"), any(CacheAccessException.class), eq(false)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }