auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testWikiExample() { final CacheManager cacheManager = newCacheManagerBuilder() .withCache("preConfigured", newCacheConfigurationBuilder().buildConfig(Long.class, String.class)) .build(); final Cache<Long, String> preConfigured = cacheManager.getCache("preConfigured", Long.class, String.class); final Cache<Long, String> myCache = cacheManager.createCache("myCache", newCacheConfigurationBuilder().buildConfig(Long.class, String.class)); myCache.put(1L, "da one!"); final String value = myCache.get(1L); cacheManager.removeCache("preConfigured"); final StandaloneCache<Long, String> standaloneCache = newCacheBuilder(Long.class, String.class, LoggerFactory.getLogger(Ehcache.class + "-" + "GettingStarted")) .build(); standaloneCache.init(); cacheManager.close(); standaloneCache.close(); PersistentCacheManager persistentCacheManager = newCacheManagerBuilder() .with(persistence(System.getProperty("javaio.tmp.dir"))) .build(); persistentCacheManager.close(); }

Target:
public void testWikiExample() { final CacheManager cacheManager = newCacheManagerBuilder() .withCache("preConfigured", newCacheConfigurationBuilder().buildConfig(Long.class, String.class)) .build(); final Cache<Long, String> preConfigured = cacheManager.getCache("preConfigured", Long.class, String.class); final Cache<Long, String> myCache = cacheManager.createCache("myCache", newCacheConfigurationBuilder().buildConfig(Long.class, String.class)); myCache.put(1L, "da one!"); final String value = myCache.get(1L); cacheManager.removeCache("preConfigured"); final StandaloneCache<Long, String> standaloneCache = newCacheBuilder(Long.class, String.class, LoggerFactory.getLogger(Ehcache.class + "-" + "GettingStarted")) .build(); standaloneCache.init(); cacheManager.close(); standaloneCache.close(); PersistentCacheManager persistentCacheManager = newCacheManagerBuilder() .with(persistence(System.getProperty("java.io.tmpdir") + "/myData")) .build(); persistentCacheManager.close(); }
Source:
public DlmsConnection connect(final DlmsDevice device, final DlmsMessageListener dlmsMessageListener) throws TechnicalException, FunctionalException { this.checkDevice(device); this.checkIpAddress(device); try { return this.createConnection(device, dlmsMessageListener); } catch (final UnknownHostException e) { LOGGER.warn("The IP address is not found: {}", device.getIpAddress(), e); throw new TechnicalException(ComponentType.PROTOCOL_DLMS, "The IP address is not found: " + device.getIpAddress()); } catch (final IOException e) { if (device.hasNewSecurityKey()) { this.recoverKeyProcessInitiator.initiate(device.getDeviceIdentification(), device.getIpAddress()); } final String errorMessage = String.format("Error creating connection for %s with IP adress: %s and with device port: %d", device.getDeviceIdentification(), device.getIpAddress(), device.getPort()); LOGGER.error(errorMessage); throw new FunctionalException(FunctionalExceptionType.CONNECTION_ERROR, ComponentType.PROTOCOL_DLMS, e); } catch (final EncrypterException e) { LOGGER.error("decryption on security keys went wrong for device: {}", device.getDeviceIdentification(), e); throw new FunctionalException(FunctionalExceptionType.INVALID_KEY_FORMAT, ComponentType.PROTOCOL_DLMS, e); } }

Target:
public DlmsConnection connect(final DlmsDevice device, final DlmsMessageListener dlmsMessageListener) throws TechnicalException, FunctionalException { this.checkDevice(device); this.checkIpAddress(device); try { return this.createConnection(device, dlmsMessageListener); } catch (final UnknownHostException e) { LOGGER.warn("The IP address is not found: {}", device.getIpAddress(), e); throw new TechnicalException(ComponentType.PROTOCOL_DLMS, "The IP address is not found: " + device.getIpAddress()); } catch (final IOException e) { if (device.hasNewSecurityKey()) { this.recoverKeyProcessInitiator.initiate(device.getDeviceIdentification(), device.getIpAddress()); } final String errorMessage = String.format("Error creating connection for %s with IP adress: %s and with device port: %d", device.getDeviceIdentification(), device.getIpAddress(), device.getPort()); LOGGER.error(errorMessage); throw new FunctionalException(FunctionalExceptionType.CONNECTION_ERROR, ComponentType.PROTOCOL_DLMS, e); } catch (final EncrypterException e) { LOGGER.error("decryption on security keys went wrong for device: {}", device.getDeviceIdentification(), e); throw new FunctionalException(FunctionalExceptionType.INVALID_DLMS_KEY_FORMAT, ComponentType.PROTOCOL_DLMS, e); } }
Source:
private <V> ELEMENT_ASSERT buildAssert(V value, String description, Class<?> clazz) { try { Constructor<?>[] declaredConstructors = assertClass.getDeclaredConstructors(); for (int i = 0; i < declaredConstructors.length; i++) { Constructor<?> constructor = declaredConstructors[i]; if (constructor.getParameterTypes().length == 1 && constructor.getParameterTypes()[0].isAssignableFrom(clazz)) { @SuppressWarnings("unchecked") ELEMENT_ASSERT newAssert = (ELEMENT_ASSERT) constructor.newInstance(value); return newAssert.as(description); } } throw new RuntimeException("Fail to find a constructor matching " + value + " class to build the expected Assert class"); } catch (Exception e) { throw new RuntimeException("Fail to build an assert object with " + value + ": " + e.getMessage()); } }

Target:
private <V> ELEMENT_ASSERT buildAssert(V value, String description, Class<?> clazz) { try { Constructor<?>[] declaredConstructors = assertClass.getDeclaredConstructors(); for (int i = 0; i < declaredConstructors.length; i++) { Constructor<?> constructor = declaredConstructors[i]; if (constructor.getParameterTypes().length == 1 && constructor.getParameterTypes()[0].isAssignableFrom(clazz)) { @SuppressWarnings("unchecked") ELEMENT_ASSERT newAssert = (ELEMENT_ASSERT) constructor.newInstance(value); return newAssert.as(description); } } throw new RuntimeException("Fail to find a constructor matching " + value + " class to build the expected Assert class"); } catch (Exception e) { throw new RuntimeException("Fail to build an assert object with " + value + ": " + e.getMessage(), e); } }
Source:
public String sendEvalSubmissionConfirmationEmail(String userId, Long evaluationId) { String to = null; Boolean sendConfirmation = (Boolean) settings.get(EvalSettings.ENABLE_SUBMISSION_CONFIRMATION_EMAIL); if (sendConfirmation) { EvalEvaluation eval = getEvaluationOrFail(evaluationId); String from = getFromEmailOrFail(eval); EvalEmailTemplate emailTemplate = getEmailTemplateOrFail(EvalConstants.EMAIL_TEMPLATE_SUBMITTED, evaluationId); if (emailTemplate != null) { String subject = emailTemplate.getSubject(); if (!StringUtils.isNotBlank(subject)) { subject = rb.getString("submission.confirmation.email.title"); } String message = emailTemplate.getMessage(); if (!StringUtils.isNotBlank(message)) { message = rb.getString("submission.confirmation.email.message"); } EvalEmailMessage em = makeEmailMessage(message, subject, eval, null); String[] emailAddresses = sendUsersEmails(from, new String[]{userId}, em.subject, em.message); if (emailAddresses.length > 0){ LOG.info("Sent Submission Confirmation email to " + userId + ". (attempted to send to "+emailAddresses.length+")"); commonLogic.registerEntityEvent(EVENT_EMAIL_SUBMISSION, EvalEvaluation.class, eval.getId().toString()); } } } return to; }

Target:
public String sendEvalSubmissionConfirmationEmail(String userId, Long evaluationId) { String to = null; Boolean sendConfirmation = (Boolean) settings.get(EvalSettings.ENABLE_SUBMISSION_CONFIRMATION_EMAIL); if (sendConfirmation) { EvalEvaluation eval = getEvaluationOrFail(evaluationId); String from = getFromEmailOrFail(eval); EvalEmailTemplate emailTemplate = getEmailTemplateOrFail(EvalConstants.EMAIL_TEMPLATE_SUBMITTED, evaluationId); if (emailTemplate != null) { String subject = emailTemplate.getSubject(); if (StringUtils.isBlank(subject)) { subject = rb.getString("submission.confirmation.email.title"); } String message = emailTemplate.getMessage(); if (StringUtils.isBlank(message)) { message = rb.getString("submission.confirmation.email.message"); } EvalEmailMessage em = makeEmailMessage(message, subject, eval, null); String[] emailAddresses = sendUsersEmails(from, new String[]{userId}, em.subject, em.message); if (emailAddresses.length > 0){ LOG.info("Sent Submission Confirmation email to " + userId + ". (attempted to send to "+emailAddresses.length+")"); commonLogic.registerEntityEvent(EVENT_EMAIL_SUBMISSION, EvalEvaluation.class, eval.getId().toString()); } } } return to; }
Source:
private Map<String, List<MethodMappingInfo>> loadAnnotatedMethods() { Method[] methods = getClass().getDeclaredMethods(); MultiMap<String, MethodMappingInfo> mappedMethods = new MultiMap<String, MethodMappingInfo>(); boolean isUsingAuthAnnot = false; for (int i = 0; i < methods.length; i++) { Method method = methods[i]; MethodMapping methodMapped = method.getAnnotation(MethodMapping.class); AuthorizeInvocation authorizeInvocation = method.getAnnotation(AuthorizeInvocation.class); isUsingAuthAnnot = isUsingAuthAnnot || authorizeInvocation != null; if (methodMapped != null && !method.isBridge()) { HttpMethod httpMethod = methodMapped.httpMethod(); MethodMappingInfo methodMappingInfo = new MethodMappingInfo(methodMapped, method); if (!webSerialDeserial.isMimeTypeSupported(methodMappingInfo.getInputFormat()) || !webSerialDeserial.isMimeTypeSupported(methodMappingInfo.getOutputFormat())) throw new WicketRuntimeException( "Mapped methods use a MIME type not supported by obj serializer/deserializer!"); String key = methodMappingInfo.getSegmentsCount() + "_" + httpMethod.getMethod(); mappedMethods.addValue(key, methodMappingInfo); log.debug("Added mapped method: " + method + " with key: " + key); } } if (isUsingAuthAnnot && roleCheckingStrategy == null) throw new WicketRuntimeException( "Annotation AuthorizeInvocation is used but no role-checking strategy has been set for the controller!"); return CollectionUtils.makeListMapImmutable(mappedMethods); }

Target:
private Map<String, List<MethodMappingInfo>> loadAnnotatedMethods() { Method[] methods = getClass().getDeclaredMethods(); MultiMap<String, MethodMappingInfo> mappedMethods = new MultiMap<String, MethodMappingInfo>(); boolean isUsingAuthAnnot = false; for (int i = 0; i < methods.length; i++) { Method method = methods[i]; MethodMapping methodMapped = method.getAnnotation(MethodMapping.class); AuthorizeInvocation authorizeInvocation = method.getAnnotation(AuthorizeInvocation.class); isUsingAuthAnnot = isUsingAuthAnnot || authorizeInvocation != null; if (methodMapped != null && !method.isBridge()) { HttpMethod httpMethod = methodMapped.httpMethod(); MethodMappingInfo methodMappingInfo = new MethodMappingInfo(methodMapped, method); if (!webSerialDeserial.isMimeTypeSupported(methodMappingInfo.getInputFormat()) || !webSerialDeserial.isMimeTypeSupported(methodMappingInfo.getOutputFormat())) throw new WicketRuntimeException( "Mapped methods use a MIME type not supported by obj serializer/deserializer!"); String key = methodMappingInfo.getSegmentsCount() + "_" + httpMethod.getMethod(); mappedMethods.addValue(key, methodMappingInfo); log.debug("Added mapped method: with key: {}", method, key); } } if (isUsingAuthAnnot && roleCheckingStrategy == null) throw new WicketRuntimeException( "Annotation AuthorizeInvocation is used but no role-checking strategy has been set for the controller!"); return CollectionUtils.makeListMapImmutable(mappedMethods); }
Source:
public void setParameters(Map<String, Object> parameters) { super.setParameters(parameters); if (parameters != null && !parameters.isEmpty()) { Object o = parameters.get(MessageProcessorConstants.CRON_EXPRESSION); if (o != null) { cronExpression = o.toString(); } o = parameters.get(MessageProcessorConstants.INTERVAL); if (o != null) { interval = Integer.parseInt(o.toString()); } o = parameters.get(MessageProcessorConstants.MEMBER_COUNT); if (o != null) { memberCount = Integer.parseInt(o.toString()); } o = parameters.get(MessageProcessorConstants.IS_ACTIVATED); if (o != null) { setActivated(Boolean.valueOf(o.toString())); } o = parameters.get(ForwardingProcessorConstants.NON_RETRY_STATUS_CODES); if (o != null) { nonRetryStatusCodes = o.toString().split(","); } } }

Target:
public void setParameters(Map<String, Object> parameters) { super.setParameters(parameters); if (parameters != null && !parameters.isEmpty()) { Object param = parameters.get(MessageProcessorConstants.CRON_EXPRESSION); if (param != null) { cronExpression = param.toString(); } param = parameters.get(MessageProcessorConstants.INTERVAL); if (param != null) { interval = Integer.parseInt(param.toString()); } param = parameters.get(MessageProcessorConstants.MEMBER_COUNT); if (param != null) { memberCount = Integer.parseInt(param.toString()); } param = parameters.get(MessageProcessorConstants.IS_ACTIVATED); if (param != null) { setActivated(Boolean.valueOf(param.toString())); } param = parameters.get(ForwardingProcessorConstants.NON_RETRY_STATUS_CODES); if (param != null) { nonRetryStatusCodes = param.toString().split(","); } } }
Source:
public String marshal(AbstractId id) { return id.canonicalID(); }

Target:
public String marshal(AbstractId id) { if (id != null) return id.canonicalID(); else return null; }
Source:
private boolean updateBugzillaAsMerged(final Bug bug) { boolean result = false; try { result = helper.bzHelper.updateBugzillaStatus(bug.getId(), Bug.Status.MODIFIED); } catch (Exception e) { System.err.printf("Update of the status of bugzilla bz%d failed due to %s.\n", bug.getId(), e); System.err.printf("Retrying...\n"); try { result = helper.bzHelper.updateBugzillaStatus(bug.getId(), Bug.Status.MODIFIED); } catch (Exception ex) { System.err.printf("Update of the status of bugzilla bz%d failed again due to %s.\n", bug.getId(), ex); } } return result; }

Target:
private boolean updateBugzillaAsMerged(final Bug bug) { boolean result = false; try { result = helper.getBZHelper().updateBugzillaStatus(bug.getId(), Bug.Status.MODIFIED); } catch (Exception e) { System.err.printf("Update of the status of bugzilla bz%d failed due to %s.\n", bug.getId(), e); System.err.printf("Retrying...\n"); try { result = helper.getBZHelper().updateBugzillaStatus(bug.getId(), Bug.Status.MODIFIED); } catch (Exception ex) { System.err.printf("Update of the status of bugzilla bz%d failed again due to %s.\n", bug.getId(), ex); } } return result; }
Source:
public void testEvalPositive() { Mockito.when(mockNetwork.isExternal()).thenReturn(true); Assert.assertTrue(underTest.eval(mockNetwork)); }

Target:
public void testEvalPositive() { when(mockNetwork.isExternal()).thenReturn(true); assertTrue(underTest.eval(mockNetwork)); }
Source:
protected int poll() throws Exception { TelegramConfiguration config = endpoint.getConfiguration(); Long realOffset = offset != null ? offset : 0L; TelegramService service = TelegramServiceProvider.get().getService(); log.debug("Polling Telegram service to get updates"); UpdateResult updateResult = service.getUpdates(config.getAuthorizationToken(), offset, config.getLimit(), config.getTimeout()); if (updateResult.getUpdates() == null) { updateResult.setUpdates(Collections.emptyList()); } if (!updateResult.isOk()) { throw new IllegalStateException("The server was unable to process the request. Response was " + updateResult); } List<Update> updates = updateResult.getUpdates(); if (updates.size() > 0) { log.info("Received " + updates.size() + " updates from Telegram service"); } else { log.debug("No updates received from Telegram service"); } processUpdates(updates); updateOffset(updates); return updates.size(); }

Target:
protected int poll() throws Exception { TelegramConfiguration config = endpoint.getConfiguration(); Long realOffset = offset != null ? offset : 0L; TelegramService service = TelegramServiceProvider.get().getService(); log.debug("Polling Telegram service to get updates"); UpdateResult updateResult = service.getUpdates(config.getAuthorizationToken(), offset, config.getLimit(), config.getTimeout()); if (updateResult.getUpdates() == null) { updateResult.setUpdates(Collections.emptyList()); } if (!updateResult.isOk()) { throw new IllegalStateException("The server was unable to process the request. Response was " + updateResult); } List<Update> updates = updateResult.getUpdates(); if (updates.size() > 0) { log.debug("Received updates from Telegram service", updates.size()); } else { log.debug("No updates received from Telegram service"); } processUpdates(updates); updateOffset(updates); return updates.size(); }
Source:
private Collection<RowData> convertToRowData( Map<Map<String, String>, Collection<Row>> data, int[] projectedFields, DataStructureConverter converter) { List<RowData> result = new ArrayList<>(); List<Map<String, String>> keys = Collections.EMPTY_LIST.equals(allPartitions) ? Collections.singletonList(Collections.EMPTY_MAP) : allPartitions; for (Map<String, String> partition: keys) { for (Row value : data.get(partition)) { if (result.size() >= limit) { return result; } if (isRetainedAfterApplyingFilterPredicates(value)) { Row projectedRow; if (projectedFields == null) { projectedRow = value; } else { Object[] newValues = new Object[projectedFields.length]; for (int i = 0; i < projectedFields.length; ++i) { newValues[i] = value.getField(projectedFields[i]); } projectedRow = Row.of(newValues); } RowData rowData = (RowData) converter.toInternal(projectedRow); if (rowData != null) { rowData.setRowKind(value.getKind()); result.add(rowData); } } } } return result; }

Target:
private Collection<RowData> convertToRowData( Map<Map<String, String>, Collection<Row>> data, int[] projectedFields, DataStructureConverter converter) { List<RowData> result = new ArrayList<>(); List<Map<String, String>> keys = allPartitions.isEmpty() ? Collections.singletonList(Collections.emptyMap()) : allPartitions; for (Map<String, String> partition: keys) { for (Row value : data.get(partition)) { if (result.size() >= limit) { return result; } boolean isRetained = FilterUtils.isRetainedAfterApplyingFilterPredicates( filterPredicates, getValueGetter(value)); if (isRetained) { Row projectedRow; if (projectedFields == null) { projectedRow = value; } else { Object[] newValues = new Object[projectedFields.length]; for (int i = 0; i < projectedFields.length; ++i) { newValues[i] = value.getField(projectedFields[i]); } projectedRow = Row.of(newValues); } RowData rowData = (RowData) converter.toInternal(projectedRow); if (rowData != null) { rowData.setRowKind(value.getKind()); result.add(rowData); } } } } return result; }
Source:
public String generate(TreeLogger treeLogger, GeneratorContext generatorContext, String typeName) throws UnableToCompleteException { setTypeOracle(generatorContext.getTypeOracle()); setPropertyOracle(generatorContext.getPropertyOracle()); setTreeLogger(treeLogger); setTypeClass(getType(typeName)); PrintWriter printWriter; printWriter = tryCreatePrintWriter(generatorContext, SUFFIX); if (printWriter == null) { return typeName + SUFFIX; } ClassSourceFileComposerFactory composer = initComposer(); SourceWriter sourceWriter = composer.createSourceWriter(generatorContext, printWriter); writeInit(sourceWriter, new GinjectorGenerator().generate(getTreeLogger(), generatorContext, GinjectorGenerator.DEFAULT_FQ_NAME)); closeDefinition(sourceWriter); return getPackageName() + "." + getClassName(); }

Target:
public String generate(TreeLogger treeLogger, GeneratorContext generatorContext, String typeName) throws UnableToCompleteException { setTypeOracle(generatorContext.getTypeOracle()); setPropertyOracle(generatorContext.getPropertyOracle()); setTreeLogger(treeLogger); setTypeClass(getType(typeName)); PrintWriter printWriter; printWriter = tryCreatePrintWriter(generatorContext, SUFFIX); if (printWriter == null) { return typeName + SUFFIX; } ClassSourceFileComposerFactory composer = initComposer(); SourceWriter sourceWriter = composer.createSourceWriter(generatorContext, printWriter); String ginjectorName = new GinjectorGenerator().generate(getTreeLogger(), generatorContext, GinjectorGenerator.DEFAULT_FQ_NAME); writeInit(sourceWriter, ginjectorName); closeDefinition(sourceWriter); return getPackageName() + "." + getClassName(); }
Source:
private void postJobAction(Executor executor){ EC2Computer computer = (EC2Computer) executor.getOwner(); EC2AbstractSlave slaveNode = computer.getNode(); int maxTotalUses = Integer.parseInt(slaveNode.maxTotalUses); if (maxTotalUses <= -1) { return; } else if (maxTotalUses <= 1) { computer.setAcceptingTasks(false); slaveNode.terminate(); } else { slaveNode.maxTotalUses = String.valueOf(Integer.parseInt(slaveNode.maxTotalUses) - 1); } }

Target:
private void postJobAction(Executor executor) { EC2Computer computer = (EC2Computer) executor.getOwner(); EC2AbstractSlave slaveNode = computer.getNode(); if (computer.countBusy() <= 1 && !computer.isAcceptingTasks()) { LOGGER.info("Agent " + slaveNode.instanceId + " is terminated due to maxTotalUses (" + slaveNode.maxTotalUses + ")"); slaveNode.terminate(); } else { if (slaveNode.maxTotalUses == 1) { LOGGER.info("Agent " + slaveNode.instanceId + " is still in use by more than one (" + computer.countBusy() + ") executers."); } } }
Source:
public void getReplicasTest() throws Exception { List<? extends PartitionId> partitionIds = CLUSTER_MAP.getWritablePartitionIds(); for (PartitionId partitionId : partitionIds) { String originalReplicaStr = partitionId.getReplicaIds().toString().replace(", ", ","); BlobId blobId = new BlobId(BlobId.DEFAULT_FLAG, ClusterMapUtils.LEGACY_DATACENTER_ID, Account.LEGACY_ACCOUNT_ID, Container.LEGACY_CONTAINER_ID, partitionId); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); ReadableStreamChannel channel = getReplicasHandler.getReplicas(blobId.getID(), restResponseChannel); assertEquals("Unexpected response status", ResponseStatus.Ok, restResponseChannel.getStatus()); assertEquals("Unexpected Content-Type", "application/json", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_TYPE)); String returnedReplicasStr = RestTestUtils.getJsonizedResponseBody(channel).getString(GetReplicasHandler.REPLICAS_KEY).replace("\"", ""); assertEquals("Replica IDs returned for the BlobId do no match with the replicas IDs of partition", originalReplicaStr, returnedReplicasStr); } }

Target:
public void getReplicasTest() throws Exception { List<? extends PartitionId> partitionIds = CLUSTER_MAP.getWritablePartitionIds(); for (PartitionId partitionId : partitionIds) { String originalReplicaStr = partitionId.getReplicaIds().toString().replace(", ", ","); BlobId blobId = new BlobId(BlobId.DEFAULT_FLAG, ClusterMapUtils.UNKNOWN_DATACENTER_ID, Account.UNKNOWN_ACCOUNT_ID, Container.UNKNOWN_CONTAINER_ID, partitionId); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); ReadableStreamChannel channel = getReplicasHandler.getReplicas(blobId.getID(), restResponseChannel); assertEquals("Unexpected response status", ResponseStatus.Ok, restResponseChannel.getStatus()); assertEquals("Unexpected Content-Type", "application/json", restResponseChannel.getHeader(RestUtils.Headers.CONTENT_TYPE)); String returnedReplicasStr = RestTestUtils.getJsonizedResponseBody(channel).getString(GetReplicasHandler.REPLICAS_KEY).replace("\"", ""); assertEquals("Replica IDs returned for the BlobId do no match with the replicas IDs of partition", originalReplicaStr, returnedReplicasStr); } }
Source:
protected KualiDecimal addTargetLinesToDocument(DefaultKfsAccountForAwsResultWrapper defaultAccountWrapper, AmazonBillResultsDTO resultsDTO, GroupLevel awsAccountGroup, AccountingXmlDocumentEntry document, String awsAccount) { DefaultKfsAccountForAws defaultKfsAccount = findDefaultKfsAccountForAws(awsAccount, defaultAccountWrapper, resultsDTO); KualiDecimal targetLineTotal = KualiDecimal.ZERO; for (GroupLevel costCenterGroup : awsAccountGroup.getNextLevel()) { if (KualiDecimal.ZERO.isLessThan(costCenterGroup.getCost())) { AccountingXmlDocumentAccountingLine targetLine = awsAccountingXmlDocumentAccountingLineService.createAccountingXmlDocumentAccountingLine(costCenterGroup, defaultKfsAccount); targetLineTotal = targetLineTotal.add(targetLine.getAmount()); document.getTargetAccountingLines().add(targetLine); } else { LOG.error("buildAccountingXmlDocumentListWrapper, found a group with a cost of zero: " + costCenterGroup); } } return targetLineTotal; }

Target:
protected KualiDecimal addTargetLinesToDocument(DefaultKfsAccountForAwsResultWrapper defaultAccountWrapper, AmazonBillResultsDTO resultsDTO, GroupLevel awsAccountGroup, AccountingXmlDocumentEntry document, String awsAccount) { DefaultKfsAccountForAws defaultKfsAccount = findDefaultKfsAccountForAws(awsAccount, defaultAccountWrapper, resultsDTO); KualiDecimal targetLineTotal = KualiDecimal.ZERO; for (GroupLevel costCenterGroup : awsAccountGroup.getNextLevel()) { if (KualiDecimal.ZERO.isLessThan(costCenterGroup.getCost())) { AccountingXmlDocumentAccountingLine targetLine = awsAccountingXmlDocumentAccountingLineService.createAccountingXmlDocumentAccountingLine(costCenterGroup, defaultKfsAccount); targetLineTotal = targetLineTotal.add(targetLine.getAmount()); document.getTargetAccountingLines().add(targetLine); } else { LOG.error("addTargetLinesToDocument, found a group with a cost of zero: " + costCenterGroup); } } return targetLineTotal; }
Source:
private static int getLocationOfYAfterConsonantCluster(String word) { for (int i = 0; i < word.length() - 1; i++) { if (word.substring(i, i + 1).matches(VOWELS_REGEX)) { return -1; }else if ((i != 0) && word.substring(i, i + 1).equals("y")) { return i; } } return -1; }

Target:
private static int getLocationOfYAfterConsonantCluster(String word) { for (int i = 0; i < word.length() - 1; i++) { if ((Character.toString(word.charAt(i)).matches(VOWELS_REGEX))) { return -1; } else if ((i != 0) && word.charAt(i) == 'y') { return i; } } return -1; }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); if (gfRepo == null) { return null; } InputDialog inputDialog = new StartDialog( HandlerUtil.getActiveShell(event), UIText.HotfixStartHandler_provideHotfixName, UIText.HotfixStartHandler_pleaseProvideANameForTheNewHotfix, "", new HotfixNameValidator(gfRepo)); if (inputDialog.open() != Window.OK) { return null; } final String hotfixName = inputDialog.getValue(); HotfixStartOperation hotfixStartOperation = new HotfixStartOperation( gfRepo, hotfixName); JobUtil.scheduleUserWorkspaceJob(hotfixStartOperation, UIText.HotfixStartHandler_startingNewHotfix, JobFamilies.GITFLOW_FAMILY); BranchOperationUI.handleSingleRepositoryCheckoutOperationResult( gfRepo.getRepository(), hotfixStartOperation.getCheckoutResult(), gfRepo.getConfig().getFullHotfixBranchName(hotfixName)); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); if (gfRepo == null) { return null; } InputDialog inputDialog = new StartDialog( HandlerUtil.getActiveShell(event), UIText.HotfixStartHandler_provideHotfixName, UIText.HotfixStartHandler_pleaseProvideANameForTheNewHotfix, "", new HotfixNameValidator(gfRepo)); if (inputDialog.open() != Window.OK) { return null; } final String hotfixName = inputDialog.getValue(); HotfixStartOperation operation = new HotfixStartOperation( gfRepo, hotfixName); String fullBranchName = gfRepo.getConfig() .getFullHotfixBranchName(hotfixName); JobUtil.scheduleUserWorkspaceJob(operation, UIText.HotfixStartHandler_startingNewHotfix, JobFamilies.GITFLOW_FAMILY, new PostBranchCheckoutUiTask(gfRepo, fullBranchName, operation)); return null; }
Source:
public I_R_Request createRequestFromOrder(@NonNull final I_C_Order order) { final int requestTypeId = docTypeDAO.getById(order.getC_DocTypeTarget_ID()).getR_RequestType_ID(); final RequestCandidate requestCandidate = RequestCandidate.builder() .summary(order.getDescription() != null ? order.getDescription() : " ") .confidentialType(X_R_Request.CONFIDENTIALTYPE_Internal) .orgId(OrgId.ofRepoId(order.getAD_Org_ID())) .recordRef(TableRecordReference.of(order)) .requestTypeId(requestTypeId > 0 ? RequestTypeId.ofRepoId(requestTypeId) : getRequestTypeId(SOTrx.ofBoolean(order.isSOTrx()))) .partnerId(BPartnerId.ofRepoId(order.getC_BPartner_ID())) .userId(UserId.ofRepoIdOrNull(order.getAD_User_ID())) .dateDelivered(TimeUtil.asZonedDateTime(order.getDatePromised())) .build(); return createRequest(requestCandidate); }

Target:
public I_R_Request createRequestFromOrder(@NonNull final I_C_Order order) { final Optional<RequestTypeId> requestType = orderBL.getRequestTypeForCreatingNewRequestsAfterComplete(order); final RequestCandidate requestCandidate = RequestCandidate.builder() .summary(order.getDescription() != null ? order.getDescription() : " ") .confidentialType(X_R_Request.CONFIDENTIALTYPE_Internal) .orgId(OrgId.ofRepoId(order.getAD_Org_ID())) .recordRef(TableRecordReference.of(order)) .requestTypeId(requestType.orElseGet(() -> getRequestTypeId(SOTrx.ofBoolean(order.isSOTrx())))) .partnerId(BPartnerId.ofRepoId(order.getC_BPartner_ID())) .userId(UserId.ofRepoIdOrNull(order.getAD_User_ID())) .dateDelivered(TimeUtil.asZonedDateTime(order.getDatePromised())) .build(); return createRequest(requestCandidate); }
Source:
private void preDeleteProject(IProject project) { binaryParsersMap.remove(project); removeBinaryRunner(project); CCoreInternals.getPDOMManager().preDeleteProject(create(project)); }

Target:
private void preDeleteProject(IProject project) { CCoreInternals.getPDOMManager().preDeleteProject(create(project)); binaryParsersMap.remove(project); removeBinaryRunner(project); }
Source:
public Observable<Void> delete(final T entity) { return wrap(new Callable<Void>() { @Override public Void call() throws Exception { mDao.delete(entity); return null; } }); }

Target:
public Observable<Void> delete(final T entity) { return wrap(new Callable<Void>() { @Override public Void call() throws Exception { mDao.delete(entity); return Void.TYPE.newInstance(); } }); }
Source:
public void test_parsing_performance() throws IOException { String projectKey = "parsing-project"; ORCHESTRATOR.getServer().provisionProject(projectKey, projectKey); ORCHESTRATOR.getServer().associateProjectToQualityProfile(projectKey, "js", "no-rules"); build = getSonarScanner(projectKey); BuildResult result = ORCHESTRATOR.executeBuild(build); Assertions.assertThat(result.getLogs().contains("No new issue")).isTrue(); double expected = 141.0; double time = sensorTime(build.getProjectDir(), SENSOR, projectKey); Assertions.assertThat(time).isEqualTo(expected, offset(expected * 0.04)); }

Target:
public void test_parsing_performance() throws IOException { test_performance("parsing-project", "no-rules", false, 141.0); }
Source:
public void execute(PoolManager poolManager) { for (Pool pool : pools) { if (pool.isOverflowing()) { pool = poolCurator.lockAndLoad(pool); sharedPools.put(pool, poolCurator.listSharedPoolsOf(pool)); boolean needsToRevoke = reduceSharedPools(pool); if (needsToRevoke) { determineExcessEntitlements(pool); } } } poolManager.revokeEntitlements(new ArrayList<Entitlement>(entitlementsToRevoke)); for (Entitlement entitlement : entitlementsToAdjust.keySet()) { try { poolManager.adjustEntitlementQuantity(entitlement.getConsumer(), entitlement, entitlementsToAdjust.get(entitlement).intValue()); } catch (EntitlementRefusedException e) { throw new ForbiddenException(e.getResults().values().iterator().next().getErrors() .get(0).toString()); } } }

Target:
public void execute(PoolManager poolManager) { Collection<Pool> overflowing = new ArrayList<Pool>(); for (Pool pool : pools) { if (pool.isOverflowing()) { overflowing.add(pool); } } if (overflowing.isEmpty()) { return; } overflowing = poolCurator.lockAndLoad(overflowing); for (Pool pool : overflowing) { poolNewConsumed.put(pool, pool.getConsumed()); List<Pool> shared = poolCurator.listSharedPoolsOf(pool); if (!shared.isEmpty()) { sharedPools.put(pool, shared); reduceSharedPools(pool); } determineExcessEntitlements(pool); } poolManager.revokeEntitlements(new ArrayList<Entitlement>(entitlementsToRevoke)); for (Entitlement entitlement : shareEntitlementsToAdjust.keySet()) { try { poolManager.adjustEntitlementQuantity(entitlement.getConsumer(), entitlement, shareEntitlementsToAdjust.get(entitlement).intValue()); } catch (EntitlementRefusedException e) { throw new ForbiddenException(e.getResults().values().iterator().next().getErrors() .get(0).toString()); } } }
Source:
public List<InputField> getInputFields() { for (InputField field:inputFields) { RangeEditText ed=(RangeEditText) getActivity().findViewById(field.getId()); if(!isEmpty(ed)){ field.setValue(Double.parseDouble(ed.getText().toString())); boolean isRed=(ed.getCurrentTextColor()==ContextCompat.getColor(OpenMRS.getInstance(), R.color.red))?true:false ; field.setIsRed(isRed); } else{ field.setValue(-1.0); } } return inputFields; }

Target:
public List<InputField> getInputFields() { for (InputField field:inputFields) { RangeEditText ed=(RangeEditText) getActivity().findViewById(field.getId()); if(!isEmpty(ed)){ field.setValue(Double.parseDouble(ed.getText().toString())); boolean isRed = (ed.getCurrentTextColor()==ContextCompat.getColor(OpenMRS.getInstance(), R.color.red)); field.setIsRed(isRed); } else{ field.setValue(-1.0); } } return inputFields; }
Source:
protected boolean validateMacAddress(List<VmNic> ifaces) { int freeMacs = 0; for (VmNic iface : ifaces) { if (!StringUtils.isEmpty(iface.getMacAddress())) { if(!VALIDATE_MAC_ADDRESS.matcher(iface.getMacAddress()).matches()) { addCanDoActionMessageVariable("IfaceName ", iface.getName()); addCanDoActionMessageVariable("MacAddress ", iface.getMacAddress()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_INTERFACE_MAC_INVALID); return false; } } else { freeMacs++; } } final MacPoolManagerStrategy macPool = getMacPool(); if (freeMacs > 0 && !(macPool.getAvailableMacsCount() >= freeMacs)) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES); return false; } return true; }

Target:
protected boolean validateMacAddress(List<VmNic> ifaces) { int freeMacs = 0; for (VmNic iface : ifaces) { if (!StringUtils.isEmpty(iface.getMacAddress())) { if(!VALIDATE_MAC_ADDRESS.matcher(iface.getMacAddress()).matches()) { addCanDoActionMessageVariable("IfaceName ", iface.getName()); addCanDoActionMessageVariable("MacAddress ", iface.getMacAddress()); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_INTERFACE_MAC_INVALID); return false; } } else { freeMacs++; } } if (freeMacs > 0 && !(getMacPool().getAvailableMacsCount() >= freeMacs)) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES); return false; } return true; }
Source:
protected void executeQueryCommand() { VDSBrokerFrontend vdsBroker = getVdsBroker(); VDSReturnValue imagesListResult = vdsBroker.RunVdsCommand(VDSCommandType.GetImagesList, new GetImagesListVDSCommandParameters(getStorageDomainId(), getStoragePoolId())); @SuppressWarnings("unchecked") List<Guid> imagesList = (List<Guid>) imagesListResult.getReturnValue(); List<DiskImage> fromDao = getDbFacade().getDiskImageDao().getAllSnapshotsForStorageDomain(getStorageDomainId()); for (DiskImage image : fromDao) { imagesList.remove(image.getId()); } List<Disk> unregisteredDisks = new ArrayList<Disk>(); for (Guid unregisteredDiskId : imagesList) { String sessionId = getParameters().getSessionId(); if (sessionId == null) { sessionId = ThreadLocalParamsContainer.getHttpSessionId(); } GetUnregisteredDiskQueryParameters unregQueryParams = new GetUnregisteredDiskQueryParameters( unregisteredDiskId, getStorageDomainId()); VdcQueryReturnValue unregQueryReturn = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisk, unregQueryParams); if (unregQueryReturn.getSucceeded()) { unregisteredDisks.add((Disk) unregQueryReturn.getReturnValue()); } else { System.out.println("Could not get populated disk, reason: " + unregQueryReturn.getExceptionString()); } } getQueryReturnValue().setReturnValue(unregisteredDisks); }

Target:
protected void executeQueryCommand() { VDSBrokerFrontend vdsBroker = getVdsBroker(); VDSReturnValue imagesListResult = vdsBroker.RunVdsCommand(VDSCommandType.GetImagesList, new GetImagesListVDSCommandParameters(getStorageDomainId(), getStoragePoolId())); @SuppressWarnings("unchecked") List<Guid> imagesList = (List<Guid>) imagesListResult.getReturnValue(); List<DiskImage> fromDao = getDbFacade().getDiskImageDao().getAllSnapshotsForStorageDomain(getStorageDomainId()); for (DiskImage image : fromDao) { imagesList.remove(image.getId()); } List<Disk> unregisteredDisks = new ArrayList<Disk>(); for (Guid unregisteredDiskId : imagesList) { GetUnregisteredDiskQueryParameters unregQueryParams = new GetUnregisteredDiskQueryParameters( unregisteredDiskId, getStorageDomainId(), getStoragePoolId()); VdcQueryReturnValue unregQueryReturn = getBackend().runInternalQuery(VdcQueryType.GetUnregisteredDisk, unregQueryParams); if (unregQueryReturn.getSucceeded()) { unregisteredDisks.add((Disk) unregQueryReturn.getReturnValue()); } else { log.error("Could not get populated disk, reason: " + unregQueryReturn.getExceptionString()); } } getQueryReturnValue().setReturnValue(unregisteredDisks); }
Source:
private static String getHostAddress(final int port) { if (port < 0) { return ""; } String hostAddress = ""; try { final Enumeration e = NetworkInterface.getNetworkInterfaces(); while (e.hasMoreElements()) { final NetworkInterface n = (NetworkInterface) e.nextElement(); if (n.isLoopback() || n.isVirtual() || !n.isUp()) { continue; } final Enumeration ee = n.getInetAddresses(); while (ee.hasMoreElements()) { final InetAddress i = (InetAddress) ee.nextElement(); if (i.isLinkLocalAddress()) { continue; } hostAddress = i.getHostAddress(); break; } } } catch (Exception e) { throw new RuntimeException("Network Error", e); } if (hostAddress.isEmpty()) { LOG.log(Level.WARNING, "Fail to find local host address"); return ""; } try { (new Socket(hostAddress, port)).close(); LOG.log(Level.WARNING, "Port number already in use"); return ""; } catch (ConnectException connectException) { LOG.log(Level.INFO, "URL found: " + hostAddress + ":" + port); return hostAddress; } catch (Exception e) { LOG.log(Level.INFO, "Invalid port number"); return ""; } }

Target:
private static String getHostAddress(final int port) throws IOException { String hostAddress = ""; final Enumeration e = NetworkInterface.getNetworkInterfaces(); while (e.hasMoreElements()) { final NetworkInterface n = (NetworkInterface) e.nextElement(); if (n.isLoopback() || n.isVirtual() || !n.isUp()) { continue; } final Enumeration ee = n.getInetAddresses(); while (ee.hasMoreElements()) { final InetAddress i = (InetAddress) ee.nextElement(); if (i.isLinkLocalAddress()) { continue; } hostAddress = i.getHostAddress(); break; } } try { (new Socket(hostAddress, port)).close(); LOG.log(Level.WARNING, "Port number already in use."); throw new IOException("Port number already in use."); } catch (ConnectException connectException) { LOG.log(Level.INFO, "URL found: {0}:{1}", new Object[]{hostAddress, port}); return hostAddress; } }
Source:
public SystemData scheduleAndLog() { log.trace("runTestConnection()..."); boolean result = false; try { result = testConnection(); } catch (RuntimeException e) { log.debug("Could not connect to Cache" + e.getMessage()); } cache.setConnectionTested(result); log.debug("Testing Couchbase connection: {}", result); return null; }

Target:
public SystemData scheduleAndLog() { log.trace("runTestConnection()..."); boolean result = false; try { result = testConnection(); } catch (RuntimeException e) { log.error("Could not connect to Cache" + e.getMessage()); } cache.setConnectionTested(result); log.debug("Testing Couchbase connection: {}", result); return null; }
Source:
public void testAddConfigFields() throws IOException { System.out.println("Start test :" + TestHelper.getTestMethodName()); String cluster = _clusters.iterator().next(); ClusterConfig oldConfig = getClusterConfigFromRest(cluster); ClusterConfig configDelta = new ClusterConfig(cluster); configDelta.getRecord().setSimpleField("newField", "newValue"); configDelta.getRecord().setListField("newList", Arrays.asList("newValue1", "newValue2")); configDelta.getRecord().setMapField("newMap", new HashMap<String, String>() { { put("newkey1", "newvalue1"); put("newkey2", "newvalue2"); } }); updateClusterConfigFromRest(cluster, configDelta, Command.update); ClusterConfig newConfig = getClusterConfigFromRest(cluster); oldConfig.getRecord().update(configDelta.getRecord()); Assert.assertEquals(newConfig, oldConfig, "cluster config from response: " + newConfig + " vs cluster config actually: " + oldConfig); System.out.println("new config:" + newConfig.toString()); System.out.println("End test :" + TestHelper.getTestMethodName()); }

Target:
public void testAddConfigFields() throws IOException { System.out.println("Start test :" + TestHelper.getTestMethodName()); String cluster = _clusters.iterator().next(); ClusterConfig oldConfig = getClusterConfigFromRest(cluster); ClusterConfig configDelta = new ClusterConfig(cluster); configDelta.getRecord().setSimpleField("newField", "newValue"); configDelta.getRecord().setListField("newList", Arrays.asList("newValue1", "newValue2")); configDelta.getRecord().setMapField("newMap", new HashMap<String, String>() { { put("newkey1", "newvalue1"); put("newkey2", "newvalue2"); } }); updateClusterConfigFromRest(cluster, configDelta, Command.update); ClusterConfig newConfig = getClusterConfigFromRest(cluster); oldConfig.getRecord().update(configDelta.getRecord()); Assert.assertEquals(newConfig, oldConfig, "cluster config from response: " + newConfig + " vs cluster config actually: " + oldConfig); System.out.println("End test :" + TestHelper.getTestMethodName()); }
Source:
public Iterable<TokenCacheItem> getAll() { argumentCheck(); @SuppressWarnings("unchecked") Map<String, String> results = (Map<String, String>)mPrefs.getAll(); ArrayList<TokenCacheItem> tokens = new ArrayList<TokenCacheItem>(results.values().size()); Iterator<Entry<String, String>> tokenResultEntrySet = results.entrySet().iterator(); while (tokenResultEntrySet.hasNext()) { final Entry<String, String> tokenEntry = tokenResultEntrySet.next(); final String tokenKey = tokenEntry.getKey(); final String tokenValue = tokenEntry.getValue(); final String decryptedValue = decrypt(tokenKey, tokenValue); if (decryptedValue != null) { final TokenCacheItem tokenCacheItem = mGson.fromJson(decryptedValue, TokenCacheItem.class); tokens.add(tokenCacheItem); } } return tokens; }

Target:
public Iterator<TokenCacheItem> getAll() { @SuppressWarnings("unchecked") Map<String, String> results = (Map<String, String>)mPrefs.getAll(); ArrayList<TokenCacheItem> tokens = new ArrayList<TokenCacheItem>(results.values().size()); Iterator<Entry<String, String>> tokenResultEntrySet = results.entrySet().iterator(); while (tokenResultEntrySet.hasNext()) { final Entry<String, String> tokenEntry = tokenResultEntrySet.next(); final String tokenKey = tokenEntry.getKey(); final String tokenValue = tokenEntry.getValue(); final String decryptedValue = decrypt(tokenKey, tokenValue); if (decryptedValue != null) { final TokenCacheItem tokenCacheItem = mGson.fromJson(decryptedValue, TokenCacheItem.class); tokens.add(tokenCacheItem); } } return tokens.iterator(); }
Source:
public void testParameterizedBuildSelector() throws Exception { WorkflowJob copiee = createWorkflow( "copiee", "writeFile text: 'foobar', file: 'artifact.txt';" + "archive includes: 'artifact.txt';" ); jenkinsRule.assertBuildStatusSuccess(copiee.scheduleBuild2(0)); WorkflowJob copier = createWorkflow( "copier", "step(copyArtifacts(projectName: 'copiee', selector: buildParameter('<StatusBuildSelector/>')));" + "echo readFile('artifact.txt');" ); jenkinsRule.assertLogContains("foobar", jenkinsRule.assertBuildStatusSuccess(copier.scheduleBuild2(0))); }

Target:
public void testParameterizedBuildSelector() throws Exception { WorkflowJob copiee = jenkinsRule.createWorkflow( "copiee", "writeFile text: 'foobar', file: 'artifact.txt';" + "archive includes: 'artifact.txt';" ); jenkinsRule.assertBuildStatusSuccess(copiee.scheduleBuild2(0)); WorkflowJob copier = jenkinsRule.createWorkflow( "copier", "copyArtifacts(projectName: 'copiee', selector: buildParameter(\"${SELECTOR}\"));" + "echo readFile('artifact.txt');" ); copier.addProperty(new ParametersDefinitionProperty( new BuildSelectorParameter( "SELECTOR", new StatusBuildSelector(), "" ) )); JenkinsRule.WebClient wc = jenkinsRule.createAllow405WebClient(); jenkinsRule.submit(wc.getPage(copier, "build").getFormByName("parameters")); jenkinsRule.waitUntilNoActivity(); jenkinsRule.assertLogContains("foobar", jenkinsRule.assertBuildStatusSuccess(copier.getLastBuild())); }
Source:
public boolean isEnabled() { Repository repo = getRepository(); if (repo == null) return false; RepositoryState state = repo.getRepositoryState(); return state == RepositoryState.SAFE || isRebasing(state); }

Target:
public boolean isEnabled() { Repository repo = getRepository(); if (repo == null) return false; RepositoryState state = repo.getRepositoryState(); return state.isRebasing() || RebaseCurrentRefCommand.isEnabledForState(repo, state); }
Source:
private void applyMcastAddition(MacLocation ml) { log.debug("Adding MCAST remote MAC to the VTEP: " + ml); Status st; vtepDataClient.deleteAllMcastMacRemote(ml.logicalSwitchName(), VtepMAC.UNKNOWN_DST()); st = vtepDataClient.addMcastMacRemote(ml.logicalSwitchName(), ml.mac(), ml.vxlanTunnelEndpoint()); if (!st.isSuccess() ) { if (st.getCode().equals(StatusCode.CONFLICT)) { log.info("Conflict writing {}, not expected", ml); } else { throw new VxLanPeerSyncException("OVSDB error: " + st.getCode() + ", " + st.getDescription(), ml, st.getCode()); } } }

Target:
private void applyMcastAddition(MacLocation ml) { log.debug("Adding MCAST remote MAC to the VTEP: " + ml); Status st; vtepDataClient.deleteAllMcastMacRemote(ml.logicalSwitchName(), ml.mac()); st = vtepDataClient.addMcastMacRemote(ml.logicalSwitchName(), ml.mac(), ml.vxlanTunnelEndpoint()); if (!st.isSuccess() ) { if (st.getCode().equals(StatusCode.CONFLICT)) { log.info("Conflict writing {}, not expected", ml); } else { throw new VxLanPeerSyncException("OVSDB error: " + st.getCode() + ", " + st.getDescription(), ml, st.getCode()); } } }