auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldThrowIntermediateMessageEvent() throws Exception{ securityUtil.logInAs("user"); ProcessInstance process = processRuntime.start(ProcessPayloadBuilder.start() .withBusinessKey("businessKey") .withProcessDefinitionKey(PROCESS_INTERMEDIATE_THROW_MESSAGE_EVENT) .build()); assertThat(MessageTestConfiguration.messageEvents) .isNotEmpty() .extracting(BPMNMessageEvent::getEventType, BPMNMessageEvent::getProcessDefinitionId, BPMNMessageEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> ((BPMNMessage)(event.getEntity())).getMessagePayload().getName(), event -> ((BPMNMessage)(event.getEntity())).getMessagePayload().getCorrelationKey(), event -> ((BPMNMessage)(event.getEntity())).getMessagePayload().getBusinessKey(), event -> ((BPMNMessage)(event.getEntity())).getMessagePayload().getVariables() ) .contains(Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_SENT, process.getProcessDefinitionId(), process.getId(), process.getProcessDefinitionId(), process.getId(), "Test Message", "value", "businessKey", Collections.singletonMap("message_payload_variable", "value"))); }

Target:
public void shouldThrowIntermediateMessageEvent() { securityUtil.logInAs("user"); ProcessInstance process = processRuntime.start(ProcessPayloadBuilder.start() .withBusinessKey("businessKey") .withProcessDefinitionKey(PROCESS_INTERMEDIATE_THROW_MESSAGE_EVENT) .build()); assertThat(MessageTestConfiguration.messageEvents) .isNotEmpty() .extracting(BPMNMessageEvent::getEventType, BPMNMessageEvent::getProcessDefinitionId, BPMNMessageEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getMessagePayload().getName(), event -> event.getEntity().getMessagePayload().getCorrelationKey(), event -> event.getEntity().getMessagePayload().getBusinessKey(), event -> event.getEntity().getMessagePayload().getVariables() ) .contains(Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_SENT, process.getProcessDefinitionId(), process.getId(), process.getProcessDefinitionId(), process.getId(), "Test Message", "value", "businessKey", Collections.singletonMap("message_payload_variable", "value"))); }
Source:
private void deleteExtendedDataForElement(Element element) { try { FilterBuilder filters[] = new FilterBuilder[1]; filters[0] = FilterBuilders.termFilter(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_ELEMENT_ID_FIELD_NAME, element.getId()); FilterBuilder filter = FilterBuilders.andFilter(filters); SearchRequestBuilder s = getClient().prepareSearch(getIndicesToQuery()) .setTypes(ElasticsearchSingleDocumentSearchIndex.ELEMENT_TYPE) .setQuery(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), filter)) .addField(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_ELEMENT_ID_FIELD_NAME) .addField(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME) .addField(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); for (SearchHit hit : s.execute().get().getHits()) { if (MUTATION_LOGGER.isTraceEnabled()) { LOGGER.trace("deleting extended data document %s", hit.getId()); } getClient().prepareDelete(hit.getIndex(), ELEMENT_TYPE, hit.getId()).execute().actionGet(); } } catch (Exception ex) { throw new VertexiumException("Could not delete extended data for element: " + element.getId()); } }

Target:
private void deleteExtendedDataForElement(Element element) { try { FilterBuilder filter = FilterBuilders.termFilter(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_ELEMENT_ID_FIELD_NAME, element.getId()); SearchRequestBuilder s = getClient().prepareSearch(getIndicesToQuery()) .setTypes(ElasticsearchSingleDocumentSearchIndex.ELEMENT_TYPE) .setQuery(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), filter)) .addField(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_ELEMENT_ID_FIELD_NAME) .addField(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_TABLE_NAME_FIELD_NAME) .addField(ElasticsearchSingleDocumentSearchIndex.EXTENDED_DATA_TABLE_ROW_ID_FIELD_NAME); for (SearchHit hit : s.execute().get().getHits()) { if (MUTATION_LOGGER.isTraceEnabled()) { LOGGER.trace("deleting extended data document %s", hit.getId()); } getClient().prepareDelete(hit.getIndex(), ELEMENT_TYPE, hit.getId()).execute().actionGet(); } } catch (Exception ex) { throw new VertexiumException("Could not delete extended data for element: " + element.getId()); } }
Source:
public static <T extends Resource> Flux<IDocumentQueryExecutionComponent<T>> createAsync( Function<String, Flux<IDocumentQueryExecutionComponent<T>>> createSourceComponentFunction, String continuationToken, Map<String, AggregateOperator> groupByAliasToAggregateType, List<String> orderedAliases, boolean hasSelectValue) { if (continuationToken != null) { CosmosException dce = new BadRequestException(CONTINUATION_TOKEN_NOT_SUPPORTED_WITH_GROUP_BY); return Flux.error(dce); } GroupingTable table = new GroupingTable(groupByAliasToAggregateType, orderedAliases, hasSelectValue); return createSourceComponentFunction.apply(null) .map(component -> new GroupByDocumentQueryExecutionContext<>(component, table)); }

Target:
public static <T extends Resource> Flux<IDocumentQueryExecutionComponent<T>> createAsync( Function<String, Flux<IDocumentQueryExecutionComponent<T>>> createSourceComponentFunction, String continuationToken, Map<String, AggregateOperator> groupByAliasToAggregateType, List<String> orderedAliases, boolean hasSelectValue) { if (continuationToken != null) { CosmosException dce = new BadRequestException(CONTINUATION_TOKEN_NOT_SUPPORTED_WITH_GROUP_BY); return Flux.error(dce); } if (groupByAliasToAggregateType == null) { throw new IllegalArgumentException("groupByAliasToAggregateType should not be null"); } if (orderedAliases == null) { throw new IllegalArgumentException("orderedAliases should not be null"); } GroupingTable table = new GroupingTable(groupByAliasToAggregateType, orderedAliases, hasSelectValue); return createSourceComponentFunction.apply(null) .map(component -> new GroupByDocumentQueryExecutionContext<>(component, table)); }
Source:
public void containsFileWithContent(String path, byte[] content) { assertThat(extractContentAsByte(path)).isEqualTo(content); }

Target:
public void containsFileWithContent(String path, byte[] content) { assertThat(extractContentAsByte(path)).named(path).isEqualTo(content); }
Source:
private void prepareChangesInfo(Change[] changes, List<ChangeInfo> changesInfo) { for (Change ch : changes) { if (ch instanceof DynamicValidationStateChange) { prepareChangesInfo(((DynamicValidationStateChange)ch).getChildren(), changesInfo); } else { ChangeInfo changeInfo = DtoFactory.newDto(ChangeInfo.class); String refactoringName = ch.getName(); if (ch instanceof UndoTextFileChange) { changeInfo.setName(ChangeInfo.ChangeName.UPDATE); changeInfo.setPath(((CompilationUnit)ch.getModifiedElement()).getPath().toString()); } if (refactoringName.startsWith("Rename")) { if (ch instanceof RenameCompilationUnitChange) { prepareRenameCompilationUnitChange(changeInfo, ch); } if (ch instanceof RenamePackageChange) { prepareRenamePackageChange(changesInfo, changeInfo, ch); } } if (refactoringName.startsWith("Move")) { prepareMoveChange(changeInfo, ch); } changesInfo.add(changeInfo); } } }

Target:
public void prepareChangesInfo(Change[] changes, List<ChangeInfo> changesInfo) { for (Change ch : changes) { if (ch instanceof DynamicValidationStateChange) { prepareChangesInfo(((DynamicValidationStateChange)ch).getChildren(), changesInfo); } else { ChangeInfo changeInfo = DtoFactory.newDto(ChangeInfo.class); String refactoringName = ch.getName(); if (ch instanceof UndoTextFileChange) { changeInfo.setName(ChangeInfo.ChangeName.UPDATE); changeInfo.setPath(((CompilationUnit)ch.getModifiedElement()).getPath().toString()); } if (refactoringName.startsWith("Rename")) { if (ch instanceof RenameCompilationUnitChange) { prepareRenameCompilationUnitChange(changeInfo, ch); } else if (ch instanceof RenamePackageChange) { prepareRenamePackageChange(changesInfo, changeInfo, ch); } } if (refactoringName.startsWith("Move")) { prepareMoveChange(changeInfo, ch); } changesInfo.add(changeInfo); } } }
Source:
protected void setUpTasksComboColumn(TableColumn column, final JTable table) { final JComboBox comboBox = new JComboBox(); Task[] tasks = myTaskManager.getTasks(); for (int i = 0; i < tasks.length; i++) { Task next = tasks[i]; comboBox.addItem(next); } comboBox.setEditable(false); column.setCellEditor(new DefaultCellEditor(comboBox)); }

Target:
private void setUpTasksComboColumn(TableColumn column, final JTable table) { final JComboBox comboBox = new JComboBox(); Task[] tasks = myTaskManager.getTasks(); for (Task next : tasks) { comboBox.addItem(next); } comboBox.setEditable(false); column.setCellEditor(new DefaultCellEditor(comboBox)); }
Source:
private void processTaskEvent(ITmfStateSystemBuilder ssb, TaskContainerEvent t) { if (!rootContainerInfoAdded) { throw new IllegalStateException("Error, cannot process task while root container info is not valid!"); } int rootContainerQuark = ContainerHelper.getRootContainerQuark(ssb); ContainerInfo rootContainerInfo = ContainerHelper.getContainerInfo(ssb, rootContainerQuark); if (rootContainerInfo == null) { throw new IllegalStateException("Error, root container seems added but container info is unavailable!"); } TaskContainerEvent parent = hmTasks.get(t.getPpid()); if (parent != null && t.getNsInode() != rootContainerInfo.getContainerInode()) { try{ int taskContainerINode = ContainerHelper.findContainerQuarkWithInode(ssb, t.getNsInode()); if (taskContainerINode != rootContainerQuark) { int containerQuark = ContainerHelper.findContainerQuarkWithInode(ssb, t.getNsInode()); ContainerHelper.addTaskToContainer(ssb, containerQuark, t.getTs(), t.getVtid(), t.getTid()); } } catch (AttributeNotFoundException e) { if (t.getNsInode() != parent.getNsInode()) { if (!isParentContainerAdded(ssb, t)) { throw new IllegalStateException("the parent container of the task does not exist!"); } ContainerInfo cInfo = new ContainerInfo(t.getNsInode(), parent.getTid(), "TODO_ADD_HOSTNAME"); ContainerHelper.addContainerAndTask(ssb, t.getTs(), parent.getNsInode(), t.getTid(), t.getVtid(), cInfo); } } } }

Target:
private void processTaskEvent(ITmfStateSystemBuilder ssb, TaskContainerEvent t) { int rootContainerQuark = ContainerHelper.getRootContainerQuark(ssb); ContainerInfo rootContainerInfo = ContainerHelper.getContainerInfo(ssb, rootContainerQuark); if (rootContainerInfo == null) { throw new IllegalStateException("Error, root container seems added but container info is unavailable!"); } TaskContainerEvent parent = fTasks.get(t.getPpid()); if (parent != null && t.getNsInode() != rootContainerInfo.getContainerInode()) { int taskContainerQuark = ContainerHelper.findContainerQuarkWithInode(ssb, t.getNsInode()); if (taskContainerQuark != ContainerHelper.fCONTAINER_QUARK_NOT_FOUND) { ContainerHelper.addTaskToContainer(ssb, taskContainerQuark, t.getTs(), t.getVtid(), t.getTid()); } else { if (t.getNsInode() != parent.getNsInode()) { if (!isParentContainerAdded(ssb, t)) { throw new IllegalStateException("the parent container of the task does not exist!"); } ContainerInfo cInfo = new ContainerInfo(t.getNsInode(), parent.getTid(), "TODO_ADD_HOSTNAME"); ContainerHelper.addContainerAndTask(ssb, t.getTs(), parent.getNsInode(), t.getTid(), t.getVtid(), cInfo); } } } }
Source:
private static Optional<URI> buildUri(String reportUri) { try { return Optional.of(URI.create(reportUri)); } catch (IllegalArgumentException ignored) { } return Optional.empty(); }

Target:
private Optional<URI> buildUri(String reportUri) { try { return Optional.of(URI.create(reportUri)); } catch (IllegalArgumentException ignored) { } return Optional.empty(); }
Source:
protected void processManyValuedFeatureByCopying(EStructuralFeature manyValuedFeature, SIRIUS processedDescription, SIRIUS currentDescription, TransformationCache cache) { Object processedValue = processedDescription.eGet(manyValuedFeature); Object currentValue = currentDescription.eGet(manyValuedFeature); if (currentValue instanceof Iterable<?> && processedValue instanceof Iterable<?>) { List<Object> newValue = new ArrayList<>(); Iterable<?> currentIterable = (Iterable<?>) currentValue; Iterable<?> processedIterable = (Iterable<?>) processedValue; for (Object object : currentIterable) { if (object instanceof EObject) { EObject newEObject = EcoreUtil.copy((EObject) object); cache.put(object, newEObject); newValue.add(newEObject); } } for (Object object : processedIterable) { newValue.add(object); } processedDescription.eSet(manyValuedFeature, newValue); } }

Target:
protected void processManyValuedFeatureByCopying(EStructuralFeature manyValuedFeature, SIRIUS processedDescription, SIRIUS currentDescription, TransformationCache cache) { Object processedValue = processedDescription.eGet(manyValuedFeature); Object currentValue = currentDescription.eGet(manyValuedFeature); if (currentValue instanceof Iterable<?> && processedValue instanceof Iterable<?>) { List<Object> newValue = new ArrayList<>(); Iterable<?> currentIterable = (Iterable<?>) currentValue; Iterable<?> processedIterable = (Iterable<?>) processedValue; StreamSupport.stream(currentIterable.spliterator(), false).filter(EObject.class::isInstance).map(EObject.class::cast).forEach(object -> { EObject newEObject = EcoreUtil.copy(object); cache.put(object, newEObject); newValue.add(newEObject); }); processedIterable.forEach(newValue::add); processedDescription.eSet(manyValuedFeature, newValue); } }
Source:
public void testFirstAndLastBothShape() { editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), getRepresentationDescriptionName(), "Distribute Action Package Diagram 2", DDiagram.class); Collection<SWTBotGefEditPart> editPartsToDistribute = getEditParts("CanvasPackageToDrop1", "RootPackage1", "RootPackage2", "CanvasPackageToDrop2", "AAPackage"); horizontallyOrderEditParts(editPartsToDistribute); PointList previousPoints = new PointList(); for (SWTBotGefEditPart editPart : editPartsToDistribute) { previousPoints.addPoint(editor.getLocation(editPart)); } editor.select(editPartsToDistribute); SWTBotUtils.waitAllUiEvents(); editor.clickContextMenu(HORIZONTALLY_GAPS_LABEL); SWTBotUtils.waitAllUiEvents(); PointList expectedPoints = new PointList(); for (int i = 0; i < editPartsToDistribute.size(); i++) { expectedPoints.addPoint(editor.getLocation((SWTBotGefEditPart) editPartsToDistribute.toArray()[i])); } assertEquals("Distribute Action should not move nodes when the first shape is the last one", previousPoints.getBounds(), expectedPoints.getBounds()); }

Target:
public void testFirstAndLastBothShape() { editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), getRepresentationDescriptionName(), "Distribute Action Package Diagram 2", DDiagram.class); List<SWTBotGefEditPart> editPartsToDistribute = getEditParts("CanvasPackageToDrop1", "RootPackage1", "RootPackage2", "CanvasPackageToDrop2", "AAPackage"); List<SWTBotGefEditPart> orderedEditPartsToDistribute = horizontallyOrderEditParts(editPartsToDistribute); PointList previousPoints = new PointList(); for (SWTBotGefEditPart editPart : orderedEditPartsToDistribute) { previousPoints.addPoint(editor.getLocation(editPart)); } editor.select(editPartsToDistribute); editor.clickContextMenu(HORIZONTALLY_GAPS_LABEL); PointList expectedPoints = new PointList(); for (int i = 0; i < orderedEditPartsToDistribute.size(); i++) { expectedPoints.addPoint(editor.getLocation((SWTBotGefEditPart) orderedEditPartsToDistribute.get(i))); } assertEquals("Distribute Action should not move nodes when the first shape is the last one", previousPoints.getBounds(), expectedPoints.getBounds()); }
Source:
@Override protected VisorEither<VisorQueryPingTaskResult> run(VisorQueryNextPageTaskArg arg) { String qryId = arg.getQueryId(); long start = U.currentTimeMillis(); if (debug) start = log(ignite.log(), "Ping of query started: " + qryId, getClass(), start); VisorQueryHolder holder = getQueryHolder(ignite, qryId); if (holder.getErr() != null) return new VisorEither<>(new VisorExceptionWrapper(holder.getErr())); holder.setAccessed(true); if (debug) log(ignite.log(), "Ping of query finished: " + qryId, getClass(), start); return new VisorEither<>(new VisorQueryPingTaskResult(true)); }

Target:
@Override protected VisorEither<VisorQueryPingTaskResult> run(VisorQueryNextPageTaskArg arg) { String qryId = arg.getQueryId(); long start = U.currentTimeMillis(); if (debug) start = log(ignite.log(), "Ping of query started: " + qryId, getClass(), start); VisorQueryHolder holder = getQueryHolder(ignite, qryId); if (holder.getErr() != null) return new VisorEither<>(new VisorExceptionWrapper(holder.getErr())); holder.setAccessed(true); if (debug) log(ignite.log(), "Ping of query finished: " + qryId, getClass(), start); return new VisorEither<>(new VisorQueryPingTaskResult()); }
Source:
public String toString() { return String.format("double@0x%x=%s", Pointer.nativeValue(getPointer()), Double.toString(getValue())); }

Target:
public String toString() { return String.format("double@0x%x=%s", Pointer.nativeValue(getPointer()), getValue()); }
Source:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); FailureCollector collector = context.getFailureCollector(); config.validate(collector); collector.getOrThrowException(); Schema inputSchema = context.getInputSchema(); if (inputSchema == null || inputSchema.getFields() == null || inputSchema.getFields().isEmpty()) { return; } Set<String> input = inputSchema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toSet()); List<FieldOperation> operationList = new ArrayList<>(); for (String inputField : input) { List<String> outputs = new ArrayList<>(); for (int i = 0; i < config.copies; i++) { outputs.add(inputField); } FieldTransformOperation operation = new FieldTransformOperation("clone" + inputField, "Clone field " + inputField, Collections.singletonList(inputField), outputs); operationList.add(operation); } context.record(operationList); }

Target:
public void prepareRun(StageSubmitterContext context) throws Exception { super.prepareRun(context); FailureCollector collector = context.getFailureCollector(); config.validate(collector); collector.getOrThrowException(); context.record( TransformLineageRecorderUtils.generateOneToOnes(TransformLineageRecorderUtils.getFields(context.getInputSchema()), "clone", "Copied the input record.")); }
Source:
private String getPartitionLeasePrefix() { return this.settings.getContainerNamePrefix() + ".."; }

Target:
private String getPartitionLeasePrefix() { return this.settings.getContainerNamePrefix() + LEASE_STORE_MANAGER_LEASE_SUFFIX; }
Source:
public Object getCredential() { return credential; }

Target:
public Credential getCredential() { return credential; }
Source:
static AlgorithmParameterSpec resolveSymmetricAlgorithmParameters(String symmetricAlgorithm) throws CryptoException { String errorMessage = String.format("'%s' symmetric algorithm is not supported.", symmetricAlgorithm); if (symmetricAlgorithm.contains("AES")) { byte[] iv = new byte[16]; random.nextBytes(iv); if (symmetricAlgorithm.contains("GCM")) { return new GCMParameterSpec(128, iv); } else if (symmetricAlgorithm.contains("OFB") || symmetricAlgorithm.contains("CBC") || symmetricAlgorithm.contains("CFB")) { return new IvParameterSpec(iv); } else { throw new CryptoException(errorMessage); } } else if (symmetricAlgorithm.contains("DES")) { byte[] iv = new byte[8]; random.nextBytes(iv); return new IvParameterSpec(iv); } else { throw new CryptoException(errorMessage); } }

Target:
static AlgorithmParameterSpec resolveSymmetricAlgorithmParameters(String symmetricAlgorithm) throws CryptoException { String errorMessage = String.format("'%s' symmetric algorithm is not supported.", symmetricAlgorithm); if (symmetricAlgorithm.contains(AlgorithmConstants.ENC_METHOD_AES)) { byte[] iv = new byte[AlgorithmConstants.AES.DEFAULT_IV_LENGTH]; random.nextBytes(iv); if (symmetricAlgorithm.contains(AlgorithmConstants.AES.GCM_MODE)) { return new GCMParameterSpec(AlgorithmConstants.AES.DEFAULT_GCM_TAG_LENGTH, iv); } else if (symmetricAlgorithm.contains(AlgorithmConstants.AES.CFB_MODE) || symmetricAlgorithm.contains( AlgorithmConstants.AES.CBC_MODE) || symmetricAlgorithm.contains(AlgorithmConstants.AES.OFB_MODE)) { return new IvParameterSpec(iv); } else { throw new CryptoException(errorMessage); } } else if (symmetricAlgorithm.contains(AlgorithmConstants.ENC_METHOD_DES)) { byte[] iv = new byte[AlgorithmConstants.DES.DEFAULT_IV_LENGTH]; random.nextBytes(iv); return new IvParameterSpec(iv); } else { throw new CryptoException(errorMessage); } }
Source:
protected final MultiConnectionState getStateFromId(final String key) { if (this.getParentServer() == null) { LOG.info("null parent"); return null; } return this.getParentServer().getIdToState().get(key); }

Target:
protected final MultiConnectionState getStateFromId(final String key) { if (this.getParentServer() == null) { LOG.info("parent server does not exist and is null"); return null; } return this.getParentServer().getIdToState().get(key); }
Source:
public String getRealElementName() { if (elementName.startsWith("get") && Character.isUpperCase(elementName.charAt(3))) { return elementName.substring(3).toLowerCase(); } else if (elementName.startsWith("is") && Character.isUpperCase(elementName.charAt(2))) { return elementName.substring(2).toLowerCase(); } else { return elementName; } }

Target:
public String getRealElementName() { if (elementName.startsWith("get") && Character.isUpperCase(elementName.charAt(3))) { return decapitalize(elementName.substring(3)); } else if (elementName.startsWith("is") && Character.isUpperCase(elementName.charAt(2))) { return decapitalize(elementName.substring(2)); } else { return elementName; } }
Source:
public void removeAllBucketNotification(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { setBucketNotification( SetBucketNotificationArgs.builder() .bucket(bucketName) .config(new NotificationConfiguration()) .build()); }

Target:
public void removeAllBucketNotification(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException { deleteBucketNotification(DeleteBucketNotificationArgs.builder().bucket(bucketName).build()); }
Source:
private ApiFuture<?> issueAsyncRequest(Row row) { try { if (row instanceof Get) { return bulkRead.add( ByteString.copyFrom(row.getRow()), Adapters.GET_ADAPTER.buildFilter((Get) row)); } else if (row instanceof Mutation) { return bufferedMutatorHelper.mutate((Mutation) row); } else if (row instanceof RowMutations) { return bufferedMutatorHelper.mutate((RowMutations) row); } } catch (Throwable e) { return ApiFutures.immediateFailedFuture(new IOException("Could not process the batch", e)); } LOG.error("Encountered unknown action type %s", row.getClass()); return ApiFutures.immediateFailedFuture( new IllegalArgumentException("Encountered unknown action type: " + row.getClass())); }

Target:
private ApiFuture<?> issueAsyncRequest(Row row) { try { if (row instanceof Get) { return bulkRead.add( ByteStringer.wrap(row.getRow()), Adapters.GET_ADAPTER.buildFilter((Get) row)); } else if (row instanceof Mutation) { return bufferedMutatorHelper.mutate((Mutation) row); } else if (row instanceof RowMutations) { return bufferedMutatorHelper.mutate((RowMutations) row); } } catch (Throwable e) { return ApiFutures.immediateFailedFuture(new IOException("Could not process the batch", e)); } LOG.error("Encountered unknown action type %s", row.getClass()); return ApiFutures.immediateFailedFuture( new IllegalArgumentException("Encountered unknown action type: " + row.getClass())); }
Source:
public void run(ToolingApiOperation runnable, CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { IProgressMonitor efficientMonitor = new RateLimitingProgressMonitor(monitor, 500, TimeUnit.MILLISECONDS); ResourcesPlugin.getWorkspace().run(new WorkspaceRunnableAdapter(runnable, tokenSource), runnable.getRule(), IWorkspace.AVOID_UPDATE, efficientMonitor); }

Target:
public void run(ToolingApiOperation runnable, CancellationTokenSource tokenSource, IProgressMonitor monitor) throws CoreException { IProgressMonitor efficientMonitor = new RateLimitingProgressMonitor(monitor, 500, TimeUnit.MILLISECONDS); ResourcesPlugin.getWorkspace().run(new WorkspaceRunnableAdapter(runnable, tokenSource), runnable.getRule(), 0, efficientMonitor); }
Source:
public int compare(final TimeZoneTransition x, final TimeZoneTransition y) { if (x == y) { return 0; } else if (x != null && y != null) { if (x instanceof AbsoluteDateTransition && y instanceof AbsoluteDateTransition) { final AbsoluteDateTransition firstTransition = (AbsoluteDateTransition) x; final AbsoluteDateTransition secondTransition = (AbsoluteDateTransition) y; final Date firstDateTime = firstTransition.getDateTime(); final Date secondDateTime = secondTransition.getDateTime(); return firstDateTime.compareTo(secondDateTime); } else if (x instanceof RelativeDayOfMonthTransition && y instanceof RelativeDayOfMonthTransition) { final RelativeDayOfMonthTransition firstTransition = (RelativeDayOfMonthTransition) x; final RelativeDayOfMonthTransition secondTransition = (RelativeDayOfMonthTransition) y; final DayOfTheWeek first = firstTransition.getDayOfTheWeek(); final DayOfTheWeek second = secondTransition.getDayOfTheWeek(); return first.compareTo(second); } else if (x instanceof AbsoluteDayOfMonthTransition && y instanceof AbsoluteDayOfMonthTransition) { final AbsoluteDayOfMonthTransition firstTransition = (AbsoluteDayOfMonthTransition) x; final AbsoluteDayOfMonthTransition secondTransition = (AbsoluteDayOfMonthTransition) y; final int first = firstTransition.getDayOfMonth(); final int second = secondTransition.getDayOfMonth(); return Integer.valueOf(first).compareTo(Integer.valueOf(second)); } } else if (y == null) { return 1; } return -1; }

Target:
public int compare(final TimeZoneTransition x, final TimeZoneTransition y) { if (x == y) { return 0; } else if (x != null && y != null) { if (x instanceof AbsoluteDateTransition && y instanceof AbsoluteDateTransition) { final AbsoluteDateTransition firstTransition = (AbsoluteDateTransition) x; final AbsoluteDateTransition secondTransition = (AbsoluteDateTransition) y; final Date firstDateTime = firstTransition.getDateTime(); final Date secondDateTime = secondTransition.getDateTime(); return firstDateTime.compareTo(secondDateTime); } else if (y instanceof TimeZoneTransition) { return 1; } } else if (y == null) { return 1; } return -1; }
Source:
public String toString() { return "LooseObjects[" + getDirectory() + "]"; }

Target:
public String toString() { return "LooseObjects[" + directory + "]"; }
Source:
public JSONObject toApiFormatJson() { try { JSONObject json = new JSONObject(); json.put("ld", this.direction.toString()); json.put("lc", this.code); json.put("ln", this.name); json.put("lr", this.region); return json; } catch (Exception e) { return null; } }

Target:
public JSONObject toApiFormatJson() { try { JSONObject json = new JSONObject(); json.put("ld", this.direction.toString()); json.put("lc", this.code); json.put("ln", this.name); json.put("lr", this.region); return json; } catch (Exception e) { e.printStackTrace(); } return null; }
Source:
private Optional<ByteBuffer> calculateDigest(final DivolteEvent e, final Map<String,Optional<?>> context) { final T messageDigest = digestFactory.get(); final Consumer<ByteBuffer> digestUpdater = digestUpdaterFactory.apply(messageDigest); final Supplier<byte[]> digestFinalizer = digestFinalizerFactory.apply(messageDigest); digestPieces.stream() .map(x -> x.produce(e, context)) .filter(Optional::isPresent) .map(Optional::get) .forEachOrdered(digestUpdater); return Optional.of(ByteBuffer.wrap(digestFinalizer.get())); }

Target:
private Optional<ByteBuffer> calculateDigest(final DivolteEvent e, final Map<String,Optional<?>> context) { final T messageDigest = digestFactory.get(); final Consumer<ByteBuffer> digestUpdater = digestUpdaterFactory.apply(messageDigest); final Supplier<byte[]> digestFinalizer = digestFinalizerFactory.apply(messageDigest); digestPieces.stream() .map(x -> x.produce(e, context)) .flatMap(Streams::stream) .forEachOrdered(digestUpdater); return Optional.of(ByteBuffer.wrap(digestFinalizer.get())); }
Source:
public TestAbfsInputStream() throws Exception { super(); }

Target:
public TestAbfsInputStream() throws Exception { super(); ReadBufferManager.getBufferManager().setThresholdAgeMilliseconds(REDUCED_READ_BUFFER_AGE_THRESHOLD); }
Source:
private static int getSqlType(String dataType) { String dataTypeOriginal = dataType; dataType = normaliseTypeName(dataType); if (stringTypes.contains(dataType)) return java.sql.Types.VARCHAR; if (decimalTypes.contains(dataType)) return java.sql.Types.NUMERIC; if (dateTypes.contains(dataType)) return java.sql.Types.DATE; if (refCursorTypes.contains(dataType)) return OracleTypes.CURSOR; if (timestampTypes.contains(dataType)) return java.sql.Types.TIMESTAMP; throw new UnsupportedOperationException("Type " + dataTypeOriginal + " is not supported"); }

Target:
private static int getSqlType(String dataType) { String dataTypeNormalised = normaliseTypeName(dataType); if (stringTypes.contains(dataTypeNormalised)) return java.sql.Types.VARCHAR; if (decimalTypes.contains(dataTypeNormalised)) return java.sql.Types.NUMERIC; if (dateTypes.contains(dataTypeNormalised)) return java.sql.Types.DATE; if (refCursorTypes.contains(dataTypeNormalised)) return OracleTypes.CURSOR; if (timestampTypes.contains(dataTypeNormalised)) return java.sql.Types.TIMESTAMP; throw new UnsupportedOperationException("Type " + dataType + " is not supported"); }
Source:
protected void commonExecution(final AbstractScenarioSimulationCommand command, final boolean focusGridAfterExecution) { final Optional<GridWidget> gridWidget = context.getSelectedScenarioGridModel().map(AbstractScesimGridModel::getGridWidget); gridWidget.ifPresent(grd -> context.getStatus().setCurrentGrid(grd)); final CommandResult<ScenarioSimulationViolation> status = scenarioCommandManager.execute(context, command); if (Objects.equals(CommandResult.Type.ERROR, status.getType())) { String operation = new StringBuilder() .append("Command ") .append(command.getClass().getSimpleName()) .append(" failure") .toString(); commonNotifyError(status, operation); } else if (Objects.equals(CommandResultBuilder.SUCCESS, status) && (command instanceof AbstractScenarioGridCommand)) { scenarioCommandRegistry.register(context, (AbstractScenarioGridCommand) command); if (focusGridAfterExecution && gridWidget.isPresent()) { context.getScenarioGridPanelByGridWidget(gridWidget.get()).setFocus(true); } } }

Target:
protected void commonExecution(final AbstractScenarioSimulationCommand command, final boolean focusGridAfterExecution) { final Optional<AbstractScesimGridModel> selectedScenarioGridModel = context.getSelectedScenarioGridModel(); final Optional<GridWidget> gridWidget = selectedScenarioGridModel.isPresent() ? Optional.of(selectedScenarioGridModel.get().getGridWidget()) : Optional.empty(); gridWidget.ifPresent(grd -> context.getStatus().setCurrentGrid(grd)); final CommandResult<ScenarioSimulationViolation> status = scenarioCommandManager.execute(context, command); if (Objects.equals(CommandResult.Type.ERROR, status.getType())) { String operation = new StringBuilder() .append("Command ") .append(command.getClass().getSimpleName()) .append(" failure") .toString(); commonNotifyError(status, operation); } else if (Objects.equals(CommandResultBuilder.SUCCESS, status) && (command instanceof AbstractScenarioGridCommand)) { scenarioCommandRegistry.register(context, (AbstractScenarioGridCommand) command); if (focusGridAfterExecution && gridWidget.isPresent()) { context.getScenarioGridPanelByGridWidget(gridWidget.get()).setFocus(true); } } }
Source:
public void fill(int stateInt, String startTs, String endTs, String targetDate) throws ParseException { int start; int end; SimpleDateFormat dmy = new SimpleDateFormat("yyy-MM-dd"); Date startDt = dmy.parse(startTs); Date endDt = dmy.parse(endTs); Date targetDt = dmy.parse(targetDate); if (startDt.before(targetDt) && !(( startTs.substring(0, startTs.indexOf("T")).equals(targetDate)))) { start = 0; } else { start = tsInt(startTs); } if (endDt.after(targetDt) && !(( endTs.substring(0, endTs.indexOf("T")).equals(targetDate)))){ end = this.samples.length; } else { end = tsInt(endTs); } for (int i=start;i<end;i++) { this.samples[i] = stateInt; } }

Target:
public void fill(int stateInt, String startTs, String endTs, String targetDate) throws ParseException { int start; int end; SimpleDateFormat dmy = new SimpleDateFormat("yyyy-MM-dd"); Date startDt = dmy.parse(startTs); Date endDt = dmy.parse(endTs); Date targetDt = dmy.parse(targetDate); if (startDt.before(targetDt) && !(( startTs.substring(0, startTs.indexOf("T")).equals(targetDate)))) { start = 0; } else { start = tsInt(startTs); } if (endDt.after(targetDt) && !(( endTs.substring(0, endTs.indexOf("T")).equals(targetDate)))){ end = this.samples.length; } else { end = tsInt(endTs); } for (int i=start;i<=end;i++) { this.samples[i] = stateInt; } }
Source:
public void enterWildcardTag( @NotNull final se.tre.freki.query.SelectParser.WildcardTagContext ctx) { super.enterWildcardTag(ctx); if (isKey) { isKey = false; futurePredicateList.add(immediateFuture(WildcardTimeSeriesIdPredicate.wildcard())); } else { isKey = true; futurePredicateList.add(immediateFuture(WildcardTimeSeriesIdPredicate.wildcard())); } }

Target:
public void enterWildcardTag( @NotNull final se.tre.freki.query.SelectParser.WildcardTagContext ctx) { super.enterWildcardTag(ctx); isKey = !isKey; futurePredicateList.add(immediateFuture(WildcardTimeSeriesIdPredicate.wildcard())); }
Source:
public String getUnmodifiedInstance() { return null; }

Target:
public String getUnmodifiedInstance() { return getInstance(); }
Source:
public List<ClientModel> getClients() { return session.realms().getClients(this, 0, session.realms().getClientsCount(this).intValue()); }

Target:
public List<ClientModel> getClients() { return session.realms().getClients(this); }
Source:
public static <T> T get(final Observable<T> observable) { final SingleResultFuture<T> future = new SingleResultFuture<T>(); final CountDownLatch latch = new CountDownLatch(1); observable.subscribe(new Observer<T>() { private T result; @Override public void onCompleted() { future.init(result, null); } @Override public void onError(final Throwable e) { future.init(null, new MongoException("Error from observable", e)); } @Override public void onNext(final T t) { result = t; } }); try { latch.await(1, SECONDS); } catch (InterruptedException e) { throw new RuntimeException(e); } return future.get(); }

Target:
public static <T> T get(final Observable<T> observable) { return observable.timeout(1, SECONDS).toBlockingObservable().last(); }
Source:
public void testGenerateTaskManagerResourceIDWithLocalRpcService() throws Exception { final Configuration configuration = createConfiguration(); final String rpcAddress = ""; final int rpcPort = -1; final String taskManagerResourceID = TaskManagerRunner.getTaskManagerResourceID(configuration, rpcAddress, rpcPort); assertThat(taskManagerResourceID, notNullValue()); assertThat(taskManagerResourceID.substring(0, taskManagerResourceID.length() - 7), equalTo(InetAddress.getLocalHost().getHostName())); }

Target:
public void testGenerateTaskManagerResourceIDWithLocalRpcService() throws Exception { final Configuration configuration = createConfiguration(); final String rpcAddress = ""; final int rpcPort = -1; final String taskManagerResourceID = TaskManagerRunner.getTaskManagerResourceID(configuration, rpcAddress, rpcPort); assertThat(taskManagerResourceID, notNullValue()); assertThat(taskManagerResourceID, containsString(InetAddress.getLocalHost().getHostName())); }
Source:
public long generateId(String sequence) { try { int retries = 25; while (retries-- > 0) { SequenceCounter result = oma.select(SequenceCounter.class).eq(SequenceCounter.NAME, sequence).queryFirst(); if (result == null) { try { result = new SequenceCounter(); result.setName(sequence); result.setNextValue(2); oma.update(result); return 1; } catch (HandledException e) { Exceptions.ignore(e); continue; } } int numRowsChanged = oma.getDatabase() .createQuery("UPDATE sequencecounter " + "SET nextValue = nextValue + 1 " + "WHERE name = ${name} " + " AND nextValue = ${value}") .set("name", sequence) .set("value", result.getNextValue()) .executeUpdate(); if (numRowsChanged == 1) { return result.getNextValue(); } Wait.randomMillis(50, 50); } throw Exceptions.handle() .to(LOG) .withSystemErrorMessage( "Failed to generate an unique sequence number for %s. Giving up after 25 retries.", sequence) .handle(); } catch (SQLException e) { throw Exceptions.handle() .to(LOG) .error(e) .withSystemErrorMessage( "Failed to generate an unique number for %s due to a database error: %s", sequence) .handle(); } }

Target:
public long generateId(String sequence) { try { int retries = 25; while (retries-- > 0) { SequenceCounter result = oma.select(SequenceCounter.class).eq(SequenceCounter.NAME, sequence).queryFirst(); if (result == null) { try { result = new SequenceCounter(); result.setName(sequence); result.setNextValue(2); oma.update(result); return 1; } catch (HandledException e) { Exceptions.ignore(e); continue; } } int numRowsChanged = oma.getDatabase() .createQuery("UPDATE sequencecounter " + "SET nextValue = nextValue + 1 " + "WHERE name = ${name} " + " AND nextValue = ${value}") .set("name", sequence) .set("value", result.getNextValue()) .executeUpdate(); if (numRowsChanged == 1) { return result.getNextValue(); } Wait.randomMillis(50, 100); } throw Exceptions.handle() .to(LOG) .withSystemErrorMessage( "Failed to generate an unique sequence number for %s. Giving up after 25 retries.", sequence) .handle(); } catch (SQLException e) { throw Exceptions.handle() .to(LOG) .error(e) .withSystemErrorMessage( "Failed to generate an unique number for %s due to a database error: %s", sequence) .handle(); } }
Source:
public static boolean isGenotypeInTransition(final Genotype g, final Transition transition) { Utils.nonNull(g, "Genotype cannot be null"); Utils.nonNull(transition, "Artifact mode cannot be null"); return IntStream.range(1,g.getAlleles().size()).anyMatch(i -> g.getAllele(0).getDisplayString().equals(String.valueOf(transition.ref())) && g.getAllele(i).getDisplayString().equals(String.valueOf(transition.call()))); }

Target:
public static boolean isGenotypeInTransition(final Genotype g, final Transition transition) { Utils.nonNull(g, "Genotype cannot be null"); Utils.nonNull(transition, "Artifact mode cannot be null"); return IntStream.range(1,g.getAlleles().size()).anyMatch(i -> g.getAllele(0).basesMatch(Allele.create((byte) transition.ref(), true)) && g.getAllele(i).basesMatch(Allele.create((byte) transition.call()))); }
Source:
StandardRotationPolicy(DelegatingSessionFactory<?> factory, List<KeyDirectory> keyDirectories, boolean fair) { Assert.notNull(factory, "factory cannot be null"); Assert.notNull(keyDirectories, "keyDirectories cannot be null"); Assert.isTrue(keyDirectories.size() > 0, "At least one KeyDirectory is required"); this.factory = factory; this.keyDirectories.addAll(keyDirectories); this.fair = fair; this.iterator = this.keyDirectories.iterator(); }

Target:
public StandardRotationPolicy(DelegatingSessionFactory<?> factory, List<KeyDirectory> keyDirectories, boolean fair) { Assert.notNull(factory, "factory cannot be null"); Assert.notNull(keyDirectories, "keyDirectories cannot be null"); Assert.isTrue(keyDirectories.size() > 0, "At least one KeyDirectory is required"); this.factory = factory; this.keyDirectories.addAll(keyDirectories); this.fair = fair; this.iterator = this.keyDirectories.iterator(); }
Source:
public Map<TableReference, TableReference> generateMapToFullTableNames(Set<TableReference> tableRefs) { Map<TableReference, TableReference> shortNameToFullTableName = Maps.newHashMapWithExpectedSize( tableRefs.size()); Set<TableReference> tablesToReload = Sets.newHashSet(); for (TableReference inputName : tableRefs) { if (inputName.isFullyQualifiedName()) { shortNameToFullTableName.put(inputName, inputName); } else { TableReference candidate = tableMap.get().inverse().get(inputName); if (candidate != null) { shortNameToFullTableName.put(inputName, candidate); } else if (unmappedTables.containsKey(inputName)) { shortNameToFullTableName.put(inputName, inputName); } else { tablesToReload.add(inputName); } } } if (!tablesToReload.isEmpty()) { updateTableMap(); Map<TableReference, TableReference> unmodifiableTableMap = ImmutableMap.copyOf(tableMap.get().inverse()); for (TableReference tableRef : tablesToReload) { if (unmodifiableTableMap.containsKey(tableRef)) { shortNameToFullTableName.put(tableRef, unmodifiableTableMap.get(tableRef)); } else { unmappedTables.put(tableRef, true); shortNameToFullTableName.put(tableRef, tableRef); } } } return shortNameToFullTableName; }

Target:
public Map<TableReference, TableReference> generateMapToFullTableNames(Set<TableReference> tableRefs) { Map<TableReference, TableReference> shortToFullTableName = Maps.newHashMapWithExpectedSize(tableRefs.size()); Set<TableReference> tablesToReload = Sets.newHashSet(); Map<TableReference, TableReference> reverseTableMapSnapshot = ImmutableMap.copyOf(tableMap.get().inverse()); for (TableReference inputName : tableRefs) { if (inputName.isFullyQualifiedName()) { shortToFullTableName.put(inputName, inputName); } else if (reverseTableMapSnapshot.containsKey(inputName)) { shortToFullTableName.put(inputName, reverseTableMapSnapshot.get(inputName)); } else if (unmappedTables.contains(inputName)) { shortToFullTableName.put(inputName, inputName); } else { tablesToReload.add(inputName); } } if (!tablesToReload.isEmpty()) { updateTableMap(); Map<TableReference, TableReference> unmodifiableTableMap = ImmutableMap.copyOf(tableMap.get().inverse()); for (TableReference tableRef : tablesToReload) { if (unmodifiableTableMap.containsKey(tableRef)) { shortToFullTableName.put(tableRef, unmodifiableTableMap.get(tableRef)); } else { unmappedTables.add(tableRef); shortToFullTableName.put(tableRef, tableRef); } } } return shortToFullTableName; }
Source:
public void buildVmVirtioScsi() { List<VmDevice> vmDevices = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice( vm.getId(), VmDeviceGeneralType.CONTROLLER, VmDeviceType.VIRTIOSCSI.getName()); Map<DiskInterface, Integer> controllerIndexMap = ArchStrategyFactory.getStrategy(vm.getClusterArch()).run(new GetControllerIndices()).returnValue(); int virtioScsiIndex = controllerIndexMap.get(DiskInterface.VirtIO_SCSI); for (VmDevice vmDevice : vmDevices) { Map<String, Object> struct = new HashMap<>(); struct.put(VdsProperties.Type, VmDeviceGeneralType.CONTROLLER.getValue()); struct.put(VdsProperties.Device, VdsProperties.Scsi); struct.put(VdsProperties.Model, VdsProperties.VirtioScsi); struct.put(VdsProperties.Index, Integer.toString(virtioScsiIndex)); if (vm.getNumOfIoThreads() > 0) { struct.put(VdsProperties.ioTrheadId, Integer.toString(virtioScsiIndex)); } vmInfoBuildUtils.addAddress(vmDevice, struct); virtioScsiIndex++; addDevice(struct, vmDevice, null); } }

Target:
public void buildVmVirtioScsi() { List<VmDevice> vmDevices = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice( vm.getId(), VmDeviceGeneralType.CONTROLLER, VmDeviceType.VIRTIOSCSI.getName()); Map<DiskInterface, Integer> controllerIndexMap = ArchStrategyFactory.getStrategy(vm.getClusterArch()).run(new GetControllerIndices()).returnValue(); int virtioScsiIndex = controllerIndexMap.get(DiskInterface.VirtIO_SCSI); for (VmDevice vmDevice : vmDevices) { Map<String, Object> struct = new HashMap<>(); struct.put(VdsProperties.Type, VmDeviceGeneralType.CONTROLLER.getValue()); struct.put(VdsProperties.Device, VdsProperties.Scsi); struct.put(VdsProperties.Model, VdsProperties.VirtioScsi); struct.put(VdsProperties.Index, Integer.toString(virtioScsiIndex)); vmInfoBuildUtils.addAddress(vmDevice, struct); virtioScsiIndex++; addDevice(struct, vmDevice, null); } }
Source:
protected void internalReceiveCommand(String pvItemName, Command pvCommand) { logger.debug("received command for item {}", pvCommand.toString(), pvItemName); OneWireBindingConfig lvBindigConfig = getBindingConfig(pvItemName); if (lvBindigConfig instanceof AbstractOneWireDevicePropertyWritableBindingConfig) { AbstractOneWireDevicePropertyWritableBindingConfig lvWritableBindingConfig = (AbstractOneWireDevicePropertyWritableBindingConfig) lvBindigConfig; String lvStringValue = lvWritableBindingConfig.convertTypeToString(pvCommand); OneWireConnection.writeToOneWire(lvWritableBindingConfig.getDevicePropertyPath(), lvStringValue); } else if (lvBindigConfig instanceof AbstractOneWireControlBindingConfig) { AbstractOneWireControlBindingConfig lvControlBindingConfig = (AbstractOneWireControlBindingConfig) lvBindigConfig; lvControlBindingConfig.executeControl(this, pvCommand); } else { logger.debug("received command for item which is not writable or executable", pvCommand.toString(), pvItemName); } }

Target:
protected void internalReceiveCommand(String pvItemName, Command pvCommand) { logger.debug("received command for item {}", pvCommand, pvItemName); OneWireBindingConfig lvBindigConfig = getBindingConfig(pvItemName); if (lvBindigConfig instanceof AbstractOneWireDevicePropertyWritableBindingConfig) { AbstractOneWireDevicePropertyWritableBindingConfig lvWritableBindingConfig = (AbstractOneWireDevicePropertyWritableBindingConfig) lvBindigConfig; String lvStringValue = lvWritableBindingConfig.convertTypeToString(pvCommand); OneWireConnection.writeToOneWire(lvWritableBindingConfig.getDevicePropertyPath(), lvStringValue); } else if (lvBindigConfig instanceof AbstractOneWireControlBindingConfig) { AbstractOneWireControlBindingConfig lvControlBindingConfig = (AbstractOneWireControlBindingConfig) lvBindigConfig; lvControlBindingConfig.executeControl(this, pvCommand); } else { logger.debug("received command for item which is not writable or executable", pvCommand, pvItemName); } }
Source:
public NodeMetadata apply(Deployment from) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.name()); builder.name(from.name()); builder.hostname(getHostname(from)); if (from.status() != null) { builder.status(serverStateToNodeStatus.get(from.status())); } Set<String> publicIpAddresses = Sets.newLinkedHashSet(); if (from.virtualIPs() != null) { for (Deployment.VirtualIP virtualIP : from.virtualIPs()) { publicIpAddresses.add(virtualIP.address()); } builder.publicAddresses(publicIpAddresses); } Set<String> privateIpAddresses = Sets.newLinkedHashSet(); if (from.roleInstanceList() != null) { for (Deployment.RoleInstance roleInstance : from.roleInstanceList()) { privateIpAddresses.add(roleInstance.ipAddress()); } builder.privateAddresses(privateIpAddresses); } return builder.build(); }

Target:
public NodeMetadata apply(Deployment from) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.id(from.name()); builder.providerId(from.name()); builder.name(from.name()); builder.hostname(getHostname(from)); if (from.status() != null) { builder.status(serverStateToNodeStatus.get(from.status())); } Set<String> publicIpAddresses = Sets.newLinkedHashSet(); if (from.virtualIPs() != null) { for (Deployment.VirtualIP virtualIP : from.virtualIPs()) { publicIpAddresses.add(virtualIP.address()); } builder.publicAddresses(publicIpAddresses); } Set<String> privateIpAddresses = Sets.newLinkedHashSet(); if (from.roleInstanceList() != null) { for (RoleInstance roleInstance : from.roleInstanceList()) { privateIpAddresses.add(roleInstance.ipAddress()); } builder.privateAddresses(privateIpAddresses); } return builder.build(); }