auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initListeners(IContextService ctx) { PlatformUI.getWorkbench().getThemeManager() .addPropertyChangeListener(this.themeListener); getTextWidget().addLineBackgroundListener((event) -> { IDocument document = getDocument(); if (document instanceof DiffDocument) { try { int modelOffset = widgetOffset2ModelOffset( event.lineOffset); ITypedRegion partition = ((DiffDocument) document) .getPartition(modelOffset); if (partition != null) { Color color = backgroundColors.get(partition.getType()); if (color != null) { event.lineBackground = color; } } } catch (BadLocationException e) { } } }); if (ctx != null) { getTextWidget().addFocusListener(new FocusAdapter() { IContextActivation context; @Override public void focusGained(FocusEvent e) { context = ctx .activateContext("org.eclipse.egit.ui.DiffViewer"); } @Override public void focusLost(FocusEvent e) { if (context != null) { ctx.deactivateContext(context); context = null; } } }); } }

Target:
private void initListeners(IContextService ctx) { PlatformUI.getWorkbench().getThemeManager() .addPropertyChangeListener(this.themeListener); getTextWidget().addLineBackgroundListener((event) -> { IDocument document = getDocument(); if (document instanceof DiffDocument) { try { int modelOffset = widgetOffset2ModelOffset( event.lineOffset); ITypedRegion partition = ((DiffDocument) document) .getPartition(modelOffset); if (partition != null) { Color color = backgroundColors.get(partition.getType()); if (color != null) { event.lineBackground = color; } } } catch (BadLocationException e) { } } }); if (ctx != null) { getTextWidget().addFocusListener(new FocusAdapter() { IContextActivation context; @Override public void focusGained(FocusEvent e) { context = ctx .activateContext(DIFF_VIEWER_CONTEXT_ID); } @Override public void focusLost(FocusEvent e) { if (context != null) { ctx.deactivateContext(context); context = null; } } }); } }
Source:
public CassandraKeyValueServiceConfig getConfig() { try { return ProxySelector.getDefault() .select(new URI("tcp", name, null, null)).stream() .filter(proxy -> proxy.type() == Proxy.Type.SOCKS) .findFirst() .map(proxy -> (CassandraKeyValueServiceConfig) ImmutableCassandraKeyValueServiceConfig.builder() .from(config) .servers(ImmutableCqlCapableConfig.builder() .addHosts(name) .cqlPort(CASSANDRA_CQL_PORT) .thriftPort(CASSANDRA_THRIFT_PORT) .socksProxy(proxy.address()) .build()) .build()) .orElse(config); } catch (URISyntaxException e) { return config; } }

Target:
public CassandraKeyValueServiceConfig getConfig() { return config; }
Source:
public void setPropertyAccessors(PropertyAccessor... accessors) { for (PropertyAccessor accessor : accessors) { this.propertyAccessors.add(accessor); } }

Target:
public void setPropertyAccessors(PropertyAccessor... accessors) { Assert.noNullElements(accessors, "Cannot have null elements in accessors"); List<PropertyAccessor> propertyAccessors = new ArrayList<PropertyAccessor>(); loadDefaultPropertyAccessors(propertyAccessors); for (PropertyAccessor accessor : accessors) { propertyAccessors.add(accessor); } this.propertyAccessors = propertyAccessors; }
Source:
public void shouldPerformKeySelectOperationWhenRepartitionOperationIsUsedWithKeySelector() throws ExecutionException, InterruptedException { final String repartitionedName = "new-key"; final long timestamp = System.currentTimeMillis(); sendEvents( timestamp, Arrays.asList( new KeyValue<>(1, "A"), new KeyValue<>(2, "B") ) ); final StreamsBuilder builder = new StreamsBuilder(); final Repartitioned<String, String> repartitioned = Repartitioned.<String, String>as(repartitionedName) .withKeySerde(Serdes.String()); builder.stream(inputTopic, Consumed.with(Serdes.Integer(), Serdes.String())) .selectKey((key, value) -> key.toString(), Named.as(repartitionedName)) .repartition(repartitioned) .groupByKey() .count() .toStream() .to(outputTopic); startStreams(builder); validateReceivedMessages( new StringDeserializer(), new LongDeserializer(), Arrays.asList( new KeyValue<>("1", 1L), new KeyValue<>("2", 1L) ) ); final String topology = builder.build().describe().toString(); final String repartitionTopicName = toRepartitionTopicName(repartitionedName); assertTrue(topicExists(repartitionTopicName)); assertEquals(1, countOccurrencesInTopology(topology, "Sink: .*" + repartitionedName + "-repartition.*")); assertEquals(1, countOccurrencesInTopology(topology, "<-- " + repartitionedName + "\n")); }

Target:
public void shouldPerformKeySelectOperationWhenRepartitionOperationIsUsedWithKeySelector() throws Exception { final String repartitionedName = "new-key"; final long timestamp = System.currentTimeMillis(); sendEvents( timestamp, Arrays.asList( new KeyValue<>(1, "A"), new KeyValue<>(2, "B") ) ); final StreamsBuilder builder = new StreamsBuilder(); final Repartitioned<String, String> repartitioned = Repartitioned.<String, String>as(repartitionedName) .withKeySerde(Serdes.String()); builder.stream(inputTopic, Consumed.with(Serdes.Integer(), Serdes.String())) .selectKey((key, value) -> key.toString(), Named.as(repartitionedName)) .repartition(repartitioned) .groupByKey() .count() .toStream() .to(outputTopic); startStreams(builder); validateReceivedMessages( new StringDeserializer(), new LongDeserializer(), Arrays.asList( new KeyValue<>("1", 1L), new KeyValue<>("2", 1L) ) ); final String topology = builder.build().describe().toString(); final String repartitionTopicName = toRepartitionTopicName(repartitionedName); assertTrue(topicExists(repartitionTopicName)); assertEquals(1, countOccurrencesInTopology(topology, "Sink: .*" + repartitionedName + "-repartition.*")); assertEquals(1, countOccurrencesInTopology(topology, "<-- " + repartitionedName + "\n")); }
Source:
public static <T extends Enum<?>> List<T> getEnumList(final Config config, final String section, final String subsection, final String setting, final T[] all, final T defaultValue) { final List<T> list = new ArrayList<T>(); final String[] strings = config.getStringList(section, subsection, setting); for (final String string : strings) { if (string != null) { try { list.add(getEnum(section, subsection, setting, string, all)); } catch (IllegalArgumentException e) { } } } if (list.size() == 0) { list.add(defaultValue); } return list; }

Target:
public static <T extends Enum<?>> List<T> getEnumList(final Config config, final String section, final String subsection, final String setting, final T[] all, final T defaultValue) { final List<T> list = new ArrayList<T>(); final String[] values = config.getStringList(section, subsection, setting); if (values.length == 0) { list.add(defaultValue); } else { for (String string : values) { if (string != null) { list.add(getEnum(section, subsection, setting, string, all)); } } } return list; }
Source:
public boolean isV4( @NotBlank(message = "Id is missing and is required") final String id ) { log.debug("Requested to get v4 for job {}", id); final JobV4Projection projection = this.jobRepository .findByUniqueId(id, JobV4Projection.class) .orElseThrow( () -> { final String errorMessage = "No job with id " + id + "exists. Unable to get v4 flag."; log.error(errorMessage); return new GenieJobNotFoundException(errorMessage); } ); return projection.isV4(); }

Target:
public boolean isV4( @NotBlank(message = "Id is missing and is required") final String id ) { log.debug("Read v4 flag from db for job ", id); return this.jobRepository .findByUniqueId(id, IsV4JobProjection.class) .orElseThrow( () -> { final String errorMessage = "No job with id " + id + "exists. Unable to get v4 flag."; log.error(errorMessage); return new GenieJobNotFoundException(errorMessage); } ).isV4(); }
Source:
public void verifyWikiName(String expectedWikiName) { Assertion.assertEquals(expectedWikiName, wikiName.getAttribute("value")); PageObjectLogging.log("verifyWikiName", "Verifyimg wiki name equals: " + expectedWikiName, true, driver); }

Target:
public void verifyWikiName(String expectedWikiName) { Assertion.assertEquals(expectedWikiName, wikiName.getAttribute("value")); PageObjectLogging.log("verifyWikiName", "verified wiki name equals: " + expectedWikiName, true); }
Source:
public final int binarySearch(int fromIndex, int toIndex, int key) { if (fromIndex < 0 || toIndex < 0 || fromIndex > _size || toIndex > _size) { throw new IndexOutOfBoundsException(); } if (fromIndex > toIndex) throw new IllegalArgumentException(); return Arrays.binarySearch(_data, fromIndex, toIndex, key); }

Target:
public final int binarySearch(int fromIndex, int toIndex, int key) { if (fromIndex < 0 || toIndex < 0 || fromIndex > _size || toIndex > _size) { throw new IndexOutOfBoundsException(); } if (fromIndex > toIndex) { throw new IllegalArgumentException(); } return Arrays.binarySearch(_data, fromIndex, toIndex, key); }
Source:
public int getSize() { return rawlstat[9]; }

Target:
public long getSize() { return size; }
Source:
public void setUp() throws Exception { super.setUp(); repository = new RepositoryBuilder().setGitDir(gitDir).build(); repository.create(); file = new File(project.getProject().getLocation().toFile(), "a.txt"); final FileWriter fileWriter = new FileWriter(file); fileWriter.write("aaaaaaaaaaa"); fileWriter.close(); final ConnectProviderOperation operation = new ConnectProviderOperation( project.getProject(), gitDir); operation.execute(null); }

Target:
public void setUp() throws Exception { super.setUp(); repository = FileRepositoryBuilder.create(gitDir); repository.create(); file = new File(project.getProject().getLocation().toFile(), "a.txt"); final FileWriter fileWriter = new FileWriter(file); fileWriter.write("aaaaaaaaaaa"); fileWriter.close(); final ConnectProviderOperation operation = new ConnectProviderOperation( project.getProject(), gitDir); operation.execute(null); }
Source:
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) { rh.setBounds( 2, 2, 14, 14, 14, 16 ); rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), this.is.getIconIndex(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() ); rh.renderInventoryBox( renderer ); rh.setInvColor( this.getColor().whiteVariant ); rh.renderInventoryFace( this.getFrontBright().getIcon(), ForgeDirection.SOUTH, renderer ); rh.setInvColor( this.getColor().mediumVariant ); rh.renderInventoryFace( this.getFrontDark().getIcon(), ForgeDirection.SOUTH, renderer ); rh.setInvColor( this.getColor().blackVariant ); rh.renderInventoryFace( this.getFrontColored().getIcon(), ForgeDirection.SOUTH, renderer ); rh.setBounds( 4, 4, 13, 12, 12, 14 ); rh.renderInventoryBox( renderer ); }

Target:
public void renderInventory( IPartRenderHelper rh, RenderBlocks renderer ) { rh.setBounds( 2, 2, 14, 14, 14, 16 ); final IIcon sideTexture = CableBusTextures.PartMonitorSides.getIcon(); final IIcon backTexture = CableBusTextures.PartMonitorBack.getIcon(); rh.setTexture( sideTexture, sideTexture, backTexture, this.is.getIconIndex(), sideTexture, sideTexture ); rh.renderInventoryBox( renderer ); rh.setInvColor( this.getColor().whiteVariant ); rh.renderInventoryFace( this.getFrontBright().getIcon(), ForgeDirection.SOUTH, renderer ); rh.setInvColor( this.getColor().mediumVariant ); rh.renderInventoryFace( this.getFrontDark().getIcon(), ForgeDirection.SOUTH, renderer ); rh.setInvColor( this.getColor().blackVariant ); rh.renderInventoryFace( this.getFrontColored().getIcon(), ForgeDirection.SOUTH, renderer ); rh.setBounds( 4, 4, 13, 12, 12, 14 ); rh.renderInventoryBox( renderer ); }
Source:
protected XmlFile getConfigXml() { return new XmlFile(Jenkins.XSTREAM, new File(Jenkins.getInstance().getRootDir(), this.getXmlFileName())); }

Target:
protected XmlFile getConfigXml() { return new XmlFile(Jenkins.XSTREAM, new File(Jenkins.getActiveInstance().getRootDir(), this.getXmlFileName())); }
Source:
private String getJavaBeanPropertyName(JavaBeanProperty property) { String resolvedName = property.getName(); Field field = getField( resolvedName, property.getDeclaringClass() ); if ( field != null && field.isAnnotationPresent( annotationType ) ) { Annotation a = field.getAnnotation( annotationType ); try { resolvedName = (String) a.annotationType().getMethod( annotationMemberName ).invoke( a ); } catch (Exception e) { e.printStackTrace(); } } return resolvedName; }

Target:
private String getJavaBeanPropertyName(JavaBeanProperty property) { Optional<Field> field = getField( property ); if ( field.isPresent() && field.get().isAnnotationPresent( annotationType ) ) { return getAnnotationMemberValue( field.get(), annotationMemberName ) .orElse( getDefaultName( property ) ); } else { return getDefaultName( property ); } }
Source:
public void setUp() throws NoSuchMethodException { mRootView = new TestView(this.getContext()); final List<PropertyDescription> props = new ArrayList<PropertyDescription>(); final PropertyCaller textGetter = new PropertyCaller(TextView.class, "getText", new Object[0], CharSequence.class); final PropertyDescription text = new PropertyDescription("text", TextView.class, textGetter, "setText"); props.add(text); final PropertyCaller customPropGetter = new PropertyCaller(TestView.CustomPropButton.class, "getCustomProperty", new Object[0], CharSequence.class); final PropertyDescription custom = new PropertyDescription( "custom", TestView.CustomPropButton.class, customPropGetter, "setCustomProperty" ); props.add(custom); final Map<String, Integer> idNamesToIds = new HashMap<String, Integer>(); idNamesToIds.put("ROOT_ID", TestView.ROOT_ID); idNamesToIds.put("TEXT_VIEW_ID", TestView.TEXT_VIEW_ID); idNamesToIds.put("CRAZYSAUCE ID", 1234567); final ResourceIds resourceIds = new TestUtils.TestResourceIds(idNamesToIds); mSnapshot = new ViewSnapshot(props, resourceIds); }

Target:
public void setUp() throws NoSuchMethodException { mRootView = new TestView(this.getContext()); final List<PropertyDescription> props = new ArrayList<PropertyDescription>(); final Caller textGetter = new Caller(TextView.class, "getText", new Object[0], CharSequence.class); final PropertyDescription text = new PropertyDescription("text", TextView.class, textGetter, "setText"); props.add(text); final Caller customPropGetter = new Caller(TestView.CustomPropButton.class, "getCustomProperty", new Object[0], CharSequence.class); final PropertyDescription custom = new PropertyDescription( "custom", TestView.CustomPropButton.class, customPropGetter, "setCustomProperty" ); props.add(custom); final Map<String, Integer> idNamesToIds = new HashMap<String, Integer>(); idNamesToIds.put("ROOT_ID", TestView.ROOT_ID); idNamesToIds.put("TEXT_VIEW_ID", TestView.TEXT_VIEW_ID); idNamesToIds.put("CRAZYSAUCE ID", 1234567); final ResourceIds resourceIds = new TestUtils.TestResourceIds(idNamesToIds); mSnapshot = new ViewSnapshot(props, resourceIds); }
Source:
createMutateRowsCall(MutateRowsRequest request) { expandPoolIfNecessary(this.bigtableOptions.getChannelCount()); return createRetryableCall(BigtableServiceGrpc.METHOD_MUTATE_ROWS, ARE_RETRYABLE_MUTATIONS, request); }

Target:
createMutateRowsCall(MutateRowsRequest request) { return createRetryableCall(BigtableServiceGrpc.METHOD_MUTATE_ROWS, ARE_RETRYABLE_MUTATIONS, request); }
Source:
private void decodeGh3000Parameter(Position position, int id, ChannelBuffer buf, int length) { switch (id) { case 1: position.set(Position.KEY_BATTERY_LEVEL, readValue(buf, length, false)); break; case 2: position.set("usbConnected", readValue(buf, length, false) == 1); break; case 5: position.set("uptime", readValue(buf, length, false)); break; case 20: position.set(Position.KEY_HDOP, readValue(buf, length, false) * 0.1); break; case 21: position.set(Position.KEY_VDOP, readValue(buf, length, false) * 0.1); break; case 22: position.set(Position.KEY_PDOP, readValue(buf, length, false) * 0.1); break; case 67: position.set(Position.KEY_BATTERY, readValue(buf, length, false) * 0.001); break; case 221: position.set("button", readValue(buf, length, false)); break; case 222: if (readValue(buf, length, false) == 1) { position.set(Position.KEY_ALARM, Position.ALARM_SOS); } break; case 240: position.set(Position.KEY_MOTION, readValue(buf, length, false) == 1); break; case 244: position.set("roaming", readValue(buf, length, false) == 1); break; default: position.set(Position.PREFIX_IO + id, readValue(buf, length, false)); break; } }

Target:
private void decodeGh3000Parameter(Position position, int id, ChannelBuffer buf, int length) { switch (id) { case 1: position.set(Position.KEY_BATTERY_LEVEL, readValue(buf, length, false)); break; case 2: position.set("usbConnected", readValue(buf, length, false) == 1); break; case 5: position.set("uptime", readValue(buf, length, false)); break; case 20: position.set(Position.KEY_HDOP, readValue(buf, length, false) * 0.1); break; case 21: position.set(Position.KEY_VDOP, readValue(buf, length, false) * 0.1); break; case 22: position.set(Position.KEY_PDOP, readValue(buf, length, false) * 0.1); break; case 67: position.set(Position.KEY_BATTERY, readValue(buf, length, false) * 0.001); break; case 221: position.set("button", readValue(buf, length, false)); break; case 222: if (readValue(buf, length, false) == 1) { position.set(Position.KEY_ALARM, Position.ALARM_SOS); } break; case 240: position.set(Position.KEY_MOTION, readValue(buf, length, false) == 1); break; case 244: position.set(Position.KEY_ROAMING, readValue(buf, length, false) == 1); break; default: position.set(Position.PREFIX_IO + id, readValue(buf, length, false)); break; } }
Source:
public void init(Presenter presenter) { this.presenter = presenter; nameLabel.setInnerText(ScenarioSimulationEditorConstants.INSTANCE.name()); typeLabel.setInnerText(ScenarioSimulationEditorConstants.INSTANCE.type()); statelessLabel.setInnerText(ScenarioSimulationEditorConstants.INSTANCE.statelessLabel()); dmnFileLabel.setInnerText(ScenarioSimulationEditorConstants.INSTANCE.dmnModelLabel()); dmnNamespaceLabel.setInnerText(ScenarioSimulationEditorConstants.INSTANCE.dmnNamespaceLabel()); dmnNameLabel.setInnerText(ScenarioSimulationEditorConstants.INSTANCE.dmnNameLabel()); }

Target:
public void init(Presenter presenter) { this.presenter = presenter; nameLabel.setInnerText(ScenarioSimulationEditorConstants.INSTANCE.name()); typeLabel.setInnerText(ScenarioSimulationEditorConstants.INSTANCE.type()); statelessLabel.setInnerText(STATELESS_LABEL); dmnFileLabel.setInnerText(DMN_MODEL_LABEL); dmnNamespaceLabel.setInnerText(DMN_NAMESPACE_LABEL); dmnNameLabel.setInnerText(DMN_NAME_LABEL); }
Source:
private void updateCurrentHeading() { double imuDeltaYaw = lastImuHeading.difference(imu.getYaw()); currentHeading.shiftValue(imuDeltaYaw); lastImuHeading = imu.getYaw(); currentHeadingProp.set(currentHeading.getValue()); currentPitch.set(getRobotPitch()); currentRoll.set(getRobotRoll()); }

Target:
private void updateCurrentHeading() { currentHeading.setValue(getRobotYaw().getValue() + headingOffset); currentHeadingProp.set(currentHeading.getValue()); currentPitch.set(getRobotPitch()); currentRoll.set(getRobotRoll()); }
Source:
public void setup() { windowStore = buildWindowStore(RETENTION_PERIOD, WINDOW_SIZE, false, Serdes.Integer(), Serdes.String()); final RecordCollector recordCollector = createRecordCollector(windowStore.name()); recordCollector.init(producer); final StreamsMetricsImpl streamsMetrics = niceMock(StreamsMetricsImpl.class); replay(streamsMetrics); context = new InternalMockProcessorContext( baseDir, Serdes.String(), Serdes.Integer(), recordCollector, new ThreadCache( new LogContext("testCache"), 0, streamsMetrics)); windowStore.init(context, windowStore); }

Target:
public void setup() { windowStore = buildWindowStore(RETENTION_PERIOD, WINDOW_SIZE, false, Serdes.Integer(), Serdes.String()); final RecordCollector recordCollector = createRecordCollector(windowStore.name()); recordCollector.init(producer); context = new InternalMockProcessorContext( baseDir, Serdes.String(), Serdes.Integer(), recordCollector, new ThreadCache( new LogContext("testCache"), 0, new StreamsMetricsImpl(new Metrics(), "test", StreamsConfig.METRICS_LATEST))); windowStore.init(context, windowStore); }
Source:
public ValueType typeCheck(TypeContext ctx) { if (Util.isDynamicType(getReceiverType(ctx))) return Util.dynType(); typeMethodDeclaration(ctx); return getExprType(); }

Target:
public ValueType typeCheck(TypeContext ctx) { if (Util.isDynamicType(getReceiverType(ctx))) { for (IExpr arg : args) { arg.typeCheck(ctx); } return Util.dynType(); } typeMethodDeclaration(ctx); return getExprType(); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryTreeNode> selectedNodes = getSelectedNodes(event); if (selectedNodes == null || selectedNodes.isEmpty()) { MessageDialog.openError(Display.getDefault().getActiveShell(), UIText.ImportProjectsWrongSelection, UIText.ImportProjectsSelectionInRepositoryRequired); return null; } for (Object node : selectedNodes) { List<File> files = null; Repository repo = null; if (node instanceof PlotCommit) { PlotCommit pt = (PlotCommit) node; repo = getRepository(event); files = getFilesForPlotCommit(pt, repo); } else if (node instanceof RefNode) { RefNode rn = (RefNode) node; repo = getRepository(rn); files = getFilesForRefNode(rn, repo); } if (repo != null) { Set<File> dotProjectFiles = findDotProjectFiles(files, repo); importProjects(dotProjectFiles); } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryTreeNode> selectedNodes = getSelectedNodes(event); if (selectedNodes == null || selectedNodes.isEmpty()) { MessageDialog.openError(Display.getDefault().getActiveShell(), UIText.ImportProjectsWrongSelection, UIText.ImportProjectsSelectionInRepositoryRequired); return null; } for (Object node : selectedNodes) { List<File> files = null; Repository repo = getRepository(event); if (repo == null || !(node instanceof PlotCommit<?>)) return null; files = getFilesChangedInCommit((RevCommit) node, repo); Set<File> dotProjectFiles = findDotProjectFiles(files, repo); importProjects(dotProjectFiles); } return null; }
Source:
private void deleteArtifactIFPresent() throws ArtifactResolutionException { ArtifactRequest artifactRequest = new ArtifactRequest(); artifactRequest.setArtifact(getArtifact()); ArtifactResult result = Aether.getAether().getSystem().resolveArtifact(newSession(newRepositorySystem()), artifactRequest); if (!result.isMissing()) { File artifactFile = result.getArtifact().getFile(); assertThat(artifactFile.delete()); } }

Target:
private void deleteArtifactIFPresent() throws ArtifactResolutionException { ArtifactRequest artifactRequest = new ArtifactRequest(); artifactRequest.setArtifact(getArtifact()); ArtifactResult result = Aether.getAether().getSystem().resolveArtifact(newSession(newRepositorySystem()), artifactRequest); if (!result.isMissing()) { File artifactFile = result.getArtifact().getFile(); assertThat(artifactFile.delete()).isTrue(); } }
Source:
public String generate(String columnAlias, List<FilterPredicate.FilterParameter> params) { if (Strings.isNullOrEmpty(columnAlias)) { throw new InvalidValueException(FILTER_PATH_NOT_NULL); } if (argumentCount == ArgumentCount.MANY) { Preconditions.checkState(!params.isEmpty()); } else if (argumentCount == ArgumentCount.ONE) { Preconditions.checkArgument(params.size() == 1); if (Strings.isNullOrEmpty(params.get(0).getPlaceholder())) { throw new IllegalStateException(FILTER_ALIAS_NOT_NULL); } } return String.format(jpqlTemplate, upperOrLower.wrap(columnAlias), params.stream() .map(upperOrLower::wrap) .collect(Collectors.joining(COMMA))); }

Target:
public String generate(String columnAlias, List<FilterPredicate.FilterParameter> params) { if (Strings.isNullOrEmpty(columnAlias)) { log.error("columnAlias cannot be NULL or empty"); throw new InvalidValueException(FILTER_PATH_NOT_NULL); } if (argumentCount == ArgumentCount.MANY) { Preconditions.checkState(!params.isEmpty()); } else if (argumentCount == ArgumentCount.ONE) { Preconditions.checkArgument(params.size() == 1); if (Strings.isNullOrEmpty(params.get(0).getPlaceholder())) { log.error("One non-null, non-empty argument was expected."); throw new IllegalStateException(FILTER_ALIAS_NOT_NULL); } } return String.format(jpqlTemplate, upperOrLower.wrap(columnAlias), params.stream() .map(upperOrLower::wrap) .collect(Collectors.joining(COMMA))); }
Source:
public void loginShouldNotReturnDetailedUserDto() throws UserNotFoundException { given(userRepository.findByUserNameAndUserPassword(USER_NAME, USER_PASSWORD)).willReturn(NULL_USER_ENTITY); UserDTO result = userService.login(userDTO); assertNull(result); }

Target:
public void loginShouldNotReturnDetailedUserDto() throws UserNotFoundException { given(userRepository.findByUserNameAndUserPassword(USER_NAME, USER_PASSWORD)).willReturn(NULL_USER_ENTITY); UserDTO result = userService.login(userDTO); }
Source:
public ByteBufferInputStream(ByteBuffer buffer, int offset, int count) { buffer.position(offset); byteBuf = buffer.slice(); byteBuf.limit(count); }

Target:
public ByteBufferInputStream(ByteBuffer buffer, int offset, int count) { ByteBuffer temp = buffer.duplicate(); temp.position(offset); byteBuf = temp.slice(); byteBuf.limit(count); }
Source:
private <K, V> ImmutableBiMap<K, V> newImmutableBiMapRemovingKeys(ImmutableBiMap<K, V> original, Set<K> keysToRemove) { ImmutableBiMap.Builder<K, V> builder = ImmutableBiMap.builder(); for (Map.Entry<K, V> property : original.entrySet()) { if (!keysToRemove.contains(property.getKey())) { builder.put(property); } } return builder.build(); }

Target:
private static <K, V> ImmutableBiMap<K, V> newImmutableBiMapRemovingKeys(ImmutableBiMap<K, V> original, Set<K> keysToRemove) { ImmutableBiMap.Builder<K, V> builder = ImmutableBiMap.builder(); for (Map.Entry<K, V> property : original.entrySet()) { if (!keysToRemove.contains(property.getKey())) { builder.put(property); } } return builder.build(); }
Source:
checkFound(Optional<? extends AggregateRepository<?, ?>> rawRepo) { if (!rawRepo.isPresent()) { final String errMsg = String.format("Unable to find repository for the state class: %s", stateClass); throw new IllegalStateException(errMsg); } else { return rawRepo.get(); } }

Target:
checkFound(Optional<? extends AggregateRepository<?, ?>> rawRepo) { if (!rawRepo.isPresent()) { final String errMsg = format("Unable to find repository for the state class: %s", stateClass); throw new IllegalStateException(errMsg); } else { return rawRepo.get(); } }
Source:
public static void main(String[] args) { String endpoint = "{endpoint_value}"; TokenCredential tokenCredential = null; final ConfigurationClient client = new ConfigurationClientBuilder() .credential(tokenCredential) .endpoint(endpoint) .buildClient(); final String key = "hello"; final String value = "world"; System.out.println("Beginning of synchronous sample..."); ConfigurationSetting setting = client.setConfigurationSetting(key, null, value); System.out.printf(String.format("[SetConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); setting = client.getConfigurationSetting(key, null, null); System.out.printf(String.format("[GetConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); setting = client.deleteConfigurationSetting(key, null); System.out.printf(String.format("[DeleteConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); System.out.println("End of synchronous sample."); }

Target:
public static void main(String[] args) { String endpoint = "{endpoint_value}"; TokenCredential tokenCredential = new DefaultAzureCredentialBuilder().build(); final ConfigurationClient client = new ConfigurationClientBuilder() .credential(tokenCredential) .endpoint(endpoint) .buildClient(); final String key = "hello"; final String value = "world"; System.out.println("Beginning of synchronous sample..."); ConfigurationSetting setting = client.setConfigurationSetting(key, null, value); System.out.printf(String.format("[SetConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); setting = client.getConfigurationSetting(key, null, null); System.out.printf(String.format("[GetConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); setting = client.deleteConfigurationSetting(key, null); System.out.printf(String.format("[DeleteConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); System.out.println("End of synchronous sample."); }
Source:
private boolean blockHandshakeOnce(UUID nodeId) { if (blockedNodeId == null || blockedNodeId.equals(nodeId)) { blockedNodeId = nodeId; return true; } return false; }

Target:
private boolean blockHandshakeOnce(UUID nodeId) { if (isBlocking && (blockedNodeId == null || blockedNodeId.equals(nodeId))) { blockedNodeId = nodeId; return true; } return false; }
Source:
protected ITmfStateValue getEventFieldValue(ITmfEvent event, String fieldName) { ITmfStateValue value = TmfStateValue.nullValue(); final ITmfEventField field = event.getContent().getField(fieldName); Object fieldValue = null; if (field == null) { if (fieldName.equalsIgnoreCase(TmfXmlStrings.CPU)) { Integer cpu = TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpu != null) { return TmfStateValue.newValueInt(cpu.intValue()); } } else if (fieldName.equalsIgnoreCase(TmfXmlStrings.TIMESTAMP)) { return TmfStateValue.newValueLong(event.getTimestamp().getValue()); } else if (fieldName.equalsIgnoreCase(TmfXmlStrings.HOSTID)) { return TmfStateValue.newValueString(event.getTrace().getHostId()); } fieldValue = TmfTraceUtils.resolveAspectOfNameForEvent(event.getTrace(), fieldName, event); if (fieldValue == null) { return value; } } else { fieldValue = field.getValue(); } value = TmfStateValue.newValueObjectWithForcedType(fieldValue, fForcedType); return value; }

Target:
protected ITmfStateValue getEventFieldValue(ITmfEvent event, String fieldName) { ITmfStateValue value = TmfStateValue.nullValue(); final ITmfEventField field = event.getContent().getField(fieldName); Object fieldValue = null; if (field == null) { if (fieldName.equalsIgnoreCase(TmfXmlStrings.CPU)) { Integer cpu = TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpu != null) { return TmfStateValue.newValueInt(cpu.intValue()); } } else if (fieldName.equalsIgnoreCase(TmfXmlStrings.TIMESTAMP)) { return TmfStateValue.newValueLong(event.getTimestamp().getValue()); } else if (fieldName.equalsIgnoreCase(TmfXmlStrings.HOSTID)) { return TmfStateValue.newValueString(event.getTrace().getHostId()); } fieldValue = TmfTraceUtils.resolveAspectOfNameForEvent(event.getTrace(), fieldName, event); if (fieldValue == null) { return value; } } else { fieldValue = field.getValue(); } value = TmfXmlUtils.newTmfStateValueFromObjectWithForcedType(fieldValue, fForcedType); return value; }
Source:
private static void setupPreferences() { final Map<String, String> preferences = new HashMap<String, String>() {{ put(ApplicationPreferences.DATE_FORMAT, DATE_FORMAT); }}; ApplicationPreferences.setUp(preferences); }

Target:
private static void setupPreferences() { final Map<String, String> preferences = Collections.singletonMap(ApplicationPreferences.DATE_FORMAT, DATE_FORMAT); ApplicationPreferences.setUp(preferences); }
Source:
protected AbstractProject(ItemGroup parent, String name) { super(parent,name); buildMixIn = createBuildMixIn(); builds = buildMixIn.getRunMap(); final Jenkins j = Jenkins.get(); final List<Node> nodes = j.getNodes(); if(nodes!=null && !nodes.isEmpty()) { canRoam = true; } }

Target:
protected AbstractProject(ItemGroup parent, String name) { super(parent,name); buildMixIn = createBuildMixIn(); builds = buildMixIn.getRunMap(); Jenkins j = Jenkins.getInstanceOrNull(); if (j != null && !j.getNodes().isEmpty()) { canRoam = true; } }
Source:
public @Nonnull Set<Entry<K, V>> entrySet() { return mainMap.entryStream().map(entry -> new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue())) .collect(ImmutableSet.toImmutableSet()); }

Target:
public @Nonnull Set<Entry<K, V>> entrySet() { return new ImmuableListSetWrapper(mainMap.entryStream().map(entry -> new AbstractMap.SimpleImmutableEntry<>(entry.getKey(), entry.getValue())) .collect(ImmutableList.toImmutableList())); }
Source:
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (adaptableObject instanceof Exif) { if (IFile.class.equals(adapterType)) { URI uri = ((Exif) adaptableObject).getUri(); if (uri != null) { IFile[] files = workspace.getRoot() .findFilesForLocationURI(uri); if (files.length == 1) { IFile file = files[0]; if (file.exists()) { @SuppressWarnings("unchecked") T iFile = (T) file; return iFile; } } } } } return null; }

Target:
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (adaptableObject instanceof Exif) { if (IFile.class.equals(adapterType)) { URI uri = ((Exif) adaptableObject).getUri(); if (uri != null) { IFile[] files = workspace.getRoot() .findFilesForLocationURI(uri); if (files.length == 1) { IFile file = files[0]; if (file.exists()) { return adapterType.cast(file); } } } } } return null; }
Source:
public T call() throws Exception { running.inc(); Timer.Context context = duration.time(); try { return callable.call(); } finally { context.stop(); running.dec(); completed.mark(); } }

Target:
public T call() throws Exception { running.inc(); final Timer.Context context = duration.time(); try { return callable.call(); } finally { context.stop(); running.dec(); completed.mark(); } }
Source:
private Set<String> getCurrentValues(final String value, final boolean isMultipleSelect) { final Set<String> result = new HashSet<String>(); if (isMultipleSelect && value != null) { final String[] split = ListSplitter.split("\"", true, removeBrackets(value)); for (String val : Arrays.asList(split)) { result.add(val.trim()); } } else { result.add(value); } return result; }

Target:
private Set<String> getCurrentValues(final String value, final boolean isMultipleSelect) { final Set<String> result = new HashSet<String>(); if (value != null) { if (isMultipleSelect) { Arrays.stream(ListSplitter.split("\"", true, removeBrackets(value))) .forEach(enumItem -> result.add(enumItem.trim())); } else { result.add(value); } } return result; }
Source:
protected void configure() { bind(CookieManager.class).to(DefaultCookieManager.class).in(Singleton.class); }

Target:
protected void configure() { bind(BodyFactory.class).to(builder.getBodyFactory()).in(Singleton.class); bind(CookieManager.class).to(builder.getCookieManager()).in(Singleton.class); bind(HeaderFactory.class).to(builder.getHeaderFactory()).in(Singleton.class); bind(UriFactory.class).to(builder.getUriFactory()).in(Singleton.class); bind(DispatchCallFactory.class).to(builder.getDispatchCallFactory()).in(Singleton.class); bind(RequestBuilderFactory.class).to(builder.getRequestBuilderFactory()).in(Singleton.class); bind(ResponseDeserializer.class).to(builder.getResponseDeserializer()).in(Singleton.class); bind(HttpParameterFactory.class).to(builder.getHttpParameterFactory()).in(Singleton.class); bind(RestDispatch.class).to(builder.getRestDispatch()).in(Singleton.class); }
Source:
public CreatePromisePairPrim(final boolean eagerWrapper, final SourceSection source) { super(eagerWrapper, source); if (VmSettings.TRUFFLE_DEBUGGER_ENABLED) { Breakpoints breakpointCatalog = VM.getWebDebugger().getBreakpoints(); FullSourceCoordinate sourceCoord = SourceCoordinate.create(source); this.promiseResolverBreakpoint = insert(BreakpointNodeGen.create(breakpointCatalog.getPromiseResolverBreakpoint(sourceCoord))); this.promiseResolutionBreakpoint = insert(BreakpointNodeGen.create(breakpointCatalog.getPromiseResolutionBreakpoint(sourceCoord))); } else { this.promiseResolverBreakpoint = insert(new DisabledBreakpointNode()); this.promiseResolutionBreakpoint = insert(new DisabledBreakpointNode()); } }

Target:
public CreatePromisePairPrim(final boolean eagerWrapper, final SourceSection source) { super(eagerWrapper, source); this.promiseResolverBreakpoint = insert(Breakpoints.createPromiseResolver(source)); this.promiseResolutionBreakpoint = insert(Breakpoints.createPromiseResolution(source)); }
Source:
private HolidayCalendar maturityDateCalendar() { HolidayCalendar cal = maturityDateOffset.getEffectiveResultCalendar(); if (cal == HolidayCalendars.NO_HOLIDAYS) { cal = fixingCalendar; } return cal; }

Target:
private HolidayCalendar maturityDateCalendar() { HolidayCalendar cal = maturityDateOffset.getEffectiveResultCalendar(); return (cal == HolidayCalendars.NO_HOLIDAYS ? fixingCalendar : cal); }
Source:
private static List<IFile> calculateMembers(final FileList list, final IProject project) throws IOException { List<IResource> resources = project.members(); if (resources.size() == 0) return Collections.emptyList(); Deque<IResource> stack = new LinkedList<>(resources); List<IFile> files = new LinkedList<>(); while (!stack.isEmpty()) { IResource resource = stack.pop(); if (resource.isIgnored() || !resource.exists()) continue; String path = resource.getProjectRelativePath().toPortableString(); if (list.contains(path)) continue; switch (resource.getType()) { case FILE: files.add((IFile) resource); MetaData data = new MetaData(); list.addPath(path, data, false); list.addEncoding(((IFile) resource).getCharset()); break; case FOLDER: stack.addAll(((IFolder) resource).members()); list.addPath(path, null, true); break; } } return files; }

Target:
private static List<IFile> calculateMembers(final FileList list, final IProject project) throws IOException { List<IResource> resources = project.members(); if (resources.isEmpty()) return Collections.emptyList(); Deque<IResource> stack = new LinkedList<>(resources); List<IFile> files = new LinkedList<>(); while (!stack.isEmpty()) { IResource resource = stack.pop(); if (resource.isIgnored() || !resource.exists()) continue; String path = resource.getProjectRelativePath().toPortableString(); if (list.contains(path)) continue; switch (resource.getType()) { case FILE: files.add((IFile) resource); MetaData data = new MetaData(); list.addPath(path, data, false); list.addEncoding(((IFile) resource).getCharset()); break; case FOLDER: stack.addAll(((IFolder) resource).members()); list.addPath(path, null, true); break; } } return files; }
Source:
public void beginRecognizeReceiptsFromUrl() { String receiptUrl = "{file_source_url}"; formRecognizerAsyncClient.beginRecognizeReceiptsFromUrl(receiptUrl).subscribe(trainingOperationResponse -> { System.out.println("Polling completed successfully"); trainingOperationResponse.getFinalResult().subscribe(recognizedReceipts -> recognizedReceipts.forEach(recognizedReceipt -> { USReceipt usReceipt = ReceiptExtensions.asUSReceipt(recognizedReceipt); System.out.printf("Page Number: %s%n", usReceipt.getMerchantName().getPageNumber()); System.out.printf("Merchant Name %s%n", usReceipt.getMerchantName().getName()); System.out.printf("Merchant Name Value: %s%n", usReceipt.getMerchantName().getFieldValue()); System.out.printf("Merchant Address %s%n", usReceipt.getMerchantAddress().getName()); System.out.printf("Merchant Address Value: %s%n", usReceipt.getMerchantAddress().getFieldValue()); System.out.printf("Total: %s%n", usReceipt.getTotal().getName()); System.out.printf("Total Value: %s%n", usReceipt.getTotal().getFieldValue()); })); }); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string }

Target:
public void beginRecognizeReceiptsFromUrl() { String receiptUrl = "{file_source_url}"; formRecognizerAsyncClient.beginRecognizeReceiptsFromUrl(receiptUrl).subscribe(recognizePollingOperation -> { recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> recognizedReceipts.forEach(recognizedReceipt -> { USReceipt usReceipt = ReceiptExtensions.asUSReceipt(recognizedReceipt); System.out.printf("Page Number: %s%n", usReceipt.getMerchantName().getPageNumber()); System.out.printf("Merchant Name: %s, confidence: %.2f%n", usReceipt.getMerchantName().getFieldValue(), usReceipt.getMerchantName().getConfidence()); System.out.printf("Merchant Address: %s, confidence: %.2f%n", usReceipt.getMerchantAddress().getFieldValue(), usReceipt.getMerchantAddress().getConfidence()); System.out.printf("Merchant Phone Number %s, confidence: %.2f%n", usReceipt.getMerchantPhoneNumber().getFieldValue(), usReceipt.getMerchantPhoneNumber().getConfidence()); System.out.printf("Total: %.2f, confidence: %.2f%n", usReceipt.getTotal().getFieldValue(), usReceipt.getTotal().getConfidence()); })); }); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string }
Source:
public Response apiPoliciesGet(String xWSO2Tenant, String policyName, MessageContext messageContext) { SubscriptionValidationDAO subscriptionValidationDAO = new SubscriptionValidationDAO(); xWSO2Tenant = InternalServiceDataUtil.validateTenantDomain(xWSO2Tenant); if (InternalServiceDataUtil.isUserAuthorizedToTenant(xWSO2Tenant)) { if (StringUtils.isNotEmpty(xWSO2Tenant)) { if (StringUtils.isNotEmpty(policyName)) { List<APIPolicy> model = new ArrayList<>(); APIPolicy apiPolicy = subscriptionValidationDAO. getApiPolicyByNameForTenant(policyName, xWSO2Tenant); if (apiPolicy != null) { model.add(apiPolicy); } return Response.ok().entity(InternalServiceDataUtil. fromApiPolicyToApiPolicyListDTO(model)).build(); } else { return Response.ok().entity(InternalServiceDataUtil. fromApiPolicyToApiPolicyListDTO(subscriptionValidationDAO. getAllApiPolicies(xWSO2Tenant))).build(); } } else { if (StringUtils.isNotEmpty(policyName)) { return Response.status(Response.Status.BAD_REQUEST.getStatusCode(), "X-WSo2-Tenant header is missing.").build(); } } return Response.ok().entity(InternalServiceDataUtil. fromApiPolicyToApiPolicyListDTO(subscriptionValidationDAO. getAllApiPolicies())).build(); } return null; }

Target:
public Response apiPoliciesGet(String xWSO2Tenant, String policyName, MessageContext messageContext) { SubscriptionValidationDAO subscriptionValidationDAO = new SubscriptionValidationDAO(); xWSO2Tenant = InternalServiceDataUtil.validateTenantDomain(xWSO2Tenant); if (InternalServiceDataUtil.isUserAuthorizedToTenant(xWSO2Tenant)) { if (StringUtils.isNotEmpty(xWSO2Tenant)) { if (StringUtils.isNotEmpty(policyName)) { List<APIPolicy> model = new ArrayList<>(); APIPolicy apiPolicy = subscriptionValidationDAO. getApiPolicyByNameForTenant(policyName, xWSO2Tenant); if (apiPolicy != null) { model.add(apiPolicy); } return Response.ok().entity(InternalServiceDataUtil. fromApiPolicyToApiPolicyListDTO(model)).build(); } else { return Response.ok().entity(InternalServiceDataUtil. fromApiPolicyToApiPolicyListDTO(subscriptionValidationDAO. getAllApiPolicies(xWSO2Tenant))).build(); } } else { if (StringUtils.isNotEmpty(policyName)) { return Response.status(Response.Status.BAD_REQUEST.getStatusCode(), "X-WSO2-Tenant header is missing.").build(); } } return Response.ok().entity(InternalServiceDataUtil. fromApiPolicyToApiPolicyListDTO(subscriptionValidationDAO. getAllApiPolicies())).build(); } return null; }
Source:
cancelSearchOperation() { return (pollingContext, firstResponse) -> { cancelSearch(pollingContext.getActivationResponse().getValue().getSearchId()); return Mono.just(new PhoneNumberSearch()); }; }

Target:
cancelSearchOperation() { return (pollingContext, firstResponse) -> { cancelSearch(pollingContext.getLatestResponse().getValue().getSearchId()); return Mono.just(pollingContext.getLatestResponse().getValue()); }; }
Source:
public abstract void update(UV value) throws Exception; public abstract GV get() throws Exception; public abstract Object getOriginal() throws Exception; public boolean isOriginalEmptyValue() throws Exception { return getOriginal() == emptyValue || getOriginal().equals(emptyValue); }

Target:
public abstract void update(UV value) throws Exception; public abstract GV get() throws Exception; public abstract Object getOriginal() throws Exception; public boolean isOriginalEmptyValue() throws Exception { return Objects.equals(emptyValue, getOriginal()); }
Source:
private List<DeveloperEntity> getAllEntitiesIncludingDeleted() { List<DeveloperEntity> result = entityManager.createQuery( "SELECT v from " + "DeveloperEntity v " + "LEFT OUTER JOIN FETCH v.address " + "LEFT OUTER JOIN FETCH v.contact " + "LEFT OUTER JOIN FETCH v.developerCertificationStatuses ", DeveloperEntity.class).getResultList(); return result; }

Target:
private List<DeveloperEntity> getAllEntitiesIncludingDeleted() { List<DeveloperEntity> result = entityManager.createQuery( "SELECT v from " + "DeveloperEntity v " + "LEFT OUTER JOIN FETCH v.address " + "LEFT OUTER JOIN FETCH v.contact ", DeveloperEntity.class).getResultList(); return result; }
Source:
public final boolean addEdge(final V source, final V destination) { try { internalGraph.addEdge(source, destination); sources.remove(destination); sinks.remove(source); return true; } catch (IllegalArgumentException e) { return false; } }

Target:
public final boolean addEdge(final V source, final V destination) { if (internalGraph.containsVertex(source) && internalGraph.containsVertex(destination)) { internalGraph.addEdge(source, destination); sources.remove(destination); sinks.remove(source); return true; } else { throw new IllegalArgumentException( "Source or destination not in graph."); } }
Source:
public void testCreate() throws InterruptedException { server.enqueue( new MockResponse().setBody(stringFromResource("/publicip/get.json")) ); PublicIp response = publicIpApi().create(PublicIp.CreatePublicIp.create("reverseDns", "datacentarId", Types.IPType.IPV4)); assertNotNull(response); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/public_ips"); }

Target:
public void testCreate() throws InterruptedException { server.enqueue( new MockResponse().setBody(stringFromResource("/publicip/get.json")) ); PublicIp response = publicIpApi().create(PublicIp.CreatePublicIp.create("reverseDns", "datacentarId", Types.IPType.IPV4)); assertNotNull(response); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/public_ips", "{\"reverse_dns\":\"reverseDns\",\"datacenter_id\":\"datacentarId\",\"type\":\"IPV4\"}"); }
Source:
private void extendModelWithCcmConnectivity(InstanceGroupType type, CcmConnectivityParameters ccmConnectivityParameters, Map<String, Object> model) { if (CcmConnectivityMode.CCMV1.equals(ccmConnectivityParameters.getConnectivityMode())) { CcmParameters.addToTemplateModel(type, ccmConnectivityParameters.getCcmParameters(), model); } else if (CcmConnectivityMode.CCMV2.equals(ccmConnectivityParameters.getConnectivityMode())) { CcmV2Parameters.addToTemplateModel(type, ccmConnectivityParameters.getCcmV2Parameters(), model); } }

Target:
private void extendModelWithCcmConnectivity(InstanceGroupType type, CcmConnectivityParameters ccmConnectivityParameters, Map<String, Object> model) { if (CcmConnectivityMode.CCMV1.equals(ccmConnectivityParameters.getConnectivityMode())) { CcmParameters.addToTemplateModel(type, ccmConnectivityParameters.getCcmParameters(), model); } else if (CcmConnectivityMode.CCMV2.equals(ccmConnectivityParameters.getConnectivityMode())) { CcmV2Parameters.addToTemplateModel(type, ccmConnectivityParameters.getCcmV2Parameters(), model); } else { model.put(CcmParameterConstants.CCM_ENABLED_KEY, Boolean.FALSE); model.put(CcmV2ParameterConstants.CCM_V2_ENABLED_KEY, Boolean.FALSE); } }