auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> static ProgrammaticConfigBuilder programmaticBuilder() { <END> return new DefaultProgrammaticConfigBuilder(); }</code><technical_language>1. users combine JAVA-2205 JAVA-2201, e.g. programmatic API _and_ loading a classpath resource name? Is idea new DefaultProgrammaticConfigBuilder(Supplier<Config>, String)? 2. follow similar patterns in code base call this interface DriverConfigLoaderBuilder (or ProgrammaticDriverConfigLoaderBuilder)? Similarly, this method called builder()</technical_language>

Target:
static ProgrammaticDriverConfigLoaderBuilder programmaticBuilder() { return new DefaultProgrammaticDriverConfigLoaderBuilder(); }
Source:
<code>public void addPage(Page page) { if (page.getPositionCount() == 0) { return; } positionCount += page.getPositionCount(); int pageIndex = (channels.length > 0) ? channels[0].size() : 0; for (int i = 0; i < channels.length; i++) { Block block = page.getBlock(i); channels[i].add(block); pagesMemorySize += block.getRetainedSizeInBytes(); } for (int position = 0; position < page.getPositionCount(); position++) { long sliceAddress = encodeSyntheticAddress(pageIndex, position); valueAddresses.add(sliceAddress); } if (eagerCompact) { <START> compact(); <END> } estimatedSize = calculateEstimatedSize(); }</code><technical_language>This results in calculateEstimatedSize called twice</technical_language>

Target:
public void addPage(Page page) { if (page.getPositionCount() == 0) { return; } positionCount += page.getPositionCount(); int pageIndex = (channels.length > 0) ? channels[0].size() : 0; for (int i = 0; i < channels.length; i++) { Block block = page.getBlock(i); if (eagerCompact) { block = block.copyRegion(0, block.getPositionCount()); } channels[i].add(block); pagesMemorySize += block.getRetainedSizeInBytes(); } for (int position = 0; position < page.getPositionCount(); position++) { long sliceAddress = encodeSyntheticAddress(pageIndex, position); valueAddresses.add(sliceAddress); } estimatedSize = calculateEstimatedSize(); }
Source:
<code><START> public MapLocation(float x, float y) { <END> this.x = x; this.y = y; }</code><technical_language>want enforce coordinate is NaN</technical_language>

Target:
public MapLocation(float x, float y) { this.x = x == Float.NaN ? 0 : x; this.y = y == Float.NaN ? 0 : y; }
Source:
<code>private JPanel getPanelMisc() { if (panelMisc == null) { panelMisc = new JPanel(); panelMisc.setLayout(new GridBagLayout()); panelMisc.add(getInMemoryStatsEnabledField(), LayoutHelper.getGBC(0, 0, 1, 0.5)); panelMisc.add(getStatsdStatsEnabledField(), LayoutHelper.getGBC(0, 1, 1, 0.5)); JPanel statsdPanel = new JPanel(); statsdPanel.setLayout(new GridBagLayout()); statsdPanel.setBorder( BorderFactory.createTitledBorder( null, Constant.messages.getString("stats.options.statsd.panel"), TitledBorder.DEFAULT_JUSTIFICATION, <START> javax.swing.border.TitledBorder.DEFAULT_POSITION, <END> FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black)); statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.host")), LayoutHelper.getGBC(0, 1, 1, 0.5)); statsdPanel.add(this.getStatsdHostField(), LayoutHelper.getGBC(1, 1, 1, 0.5)); statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.port")), LayoutHelper.getGBC(0, 2, 1, 0.5)); statsdPanel.add(this.getStatsdPortField(), LayoutHelper.getGBC(1, 2, 1, 0.5)); statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.prefix")), LayoutHelper.getGBC(0, 3, 1, 0.5)); statsdPanel.add(this.getStatsdPrefixField(), LayoutHelper.getGBC(1, 3, 1, 0.5)); panelMisc.add(statsdPanel, LayoutHelper.getGBC(0, 2, 1, 1.0D)); panelMisc.add(new JLabel(), LayoutHelper.getGBC(0, 10, 1, 0.5D, 1.0D)); } return panelMisc; }</code><technical_language>javax.swing.border.TitledBorder is imported, this TitledBorder.DEFAULT_POSITION for brevity/consistency (with L77)</technical_language>

Target:
private JPanel getPanelMisc() { if (panelMisc == null) { panelMisc = new JPanel(); panelMisc.setLayout(new GridBagLayout()); panelMisc.add(getInMemoryStatsEnabledField(), LayoutHelper.getGBC(0, 0, 1, 0.5)); panelMisc.add(getStatsdStatsEnabledField(), LayoutHelper.getGBC(0, 1, 1, 0.5)); JPanel statsdPanel = new JPanel(); statsdPanel.setLayout(new GridBagLayout()); statsdPanel.setBorder( BorderFactory.createTitledBorder( null, Constant.messages.getString("stats.options.statsd.panel"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, FontUtils.getFont(FontUtils.Size.standard), Color.black)); statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.host")), LayoutHelper.getGBC(0, 1, 1, 0.5)); statsdPanel.add(this.getStatsdHostField(), LayoutHelper.getGBC(1, 1, 1, 0.5)); statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.port")), LayoutHelper.getGBC(0, 2, 1, 0.5)); statsdPanel.add(this.getStatsdPortField(), LayoutHelper.getGBC(1, 2, 1, 0.5)); statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.prefix")), LayoutHelper.getGBC(0, 3, 1, 0.5)); statsdPanel.add(this.getStatsdPrefixField(), LayoutHelper.getGBC(1, 3, 1, 0.5)); panelMisc.add(statsdPanel, LayoutHelper.getGBC(0, 2, 1, 1.0D)); panelMisc.add(new JLabel(), LayoutHelper.getGBC(0, 10, 1, 0.5D, 1.0D)); } return panelMisc; }
Source:
<code>public static void main( String[] args ) { String url = args.length > 0 ? args[0] : "http://localhost:8000/"; e = Endpoint.publish( url, new WSTest() ); <START> System.out.println( "Local SOAP service started" ); <END> }</code><technical_language>Why</technical_language>

Target:
public static void main( String[] args ) { String url = args.length >0 ? args[0] : "http://localhost:14000/"; e = Endpoint.publish( url, new WSTest() ); }
Source:
<code>private ICommand buildResizeCommand(ChangeBoundsRequest request) { ICommand result; Command cmd = super.getResizeCommand(request); if (cmd == null) { result = null; <START> } else { <END> if (getHost() instanceof IGraphicalEditPart) { CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), cmd.getLabel()); ctc.add(new CommandProxy(cmd)); ctc.add(new ChildrenAdjustmentCommand((IGraphicalEditPart) getHost(), request)); result = ctc; } else { result = new CommandProxy(cmd); } } return result; }</code><technical_language>Laurent, put else if here. even: Command cmd = super.... ICommand result = null; if(getHost() instanceof.. ) { ... } else if (cmd != null) { result = new CommandProxy(cmd); } return result;</technical_language>

Target:
private ICommand buildResizeCommand(ChangeBoundsRequest request) { ICommand result; Command cmd = super.getResizeCommand(request); if (cmd == null) { result = null; } else if (getHost() instanceof IGraphicalEditPart) { CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), cmd.getLabel()); ctc.add(new CommandProxy(cmd)); ctc.add(new ChildrenAdjustmentCommand((IGraphicalEditPart) getHost(), request)); result = ctc; } else { result = new CommandProxy(cmd); } return result; }
Source:
<code>public void createNewLauncherApplicationProjectWithCustomizedSettings() { log.step("Import project start"); NewLauncherProjectWizard wizard = new NewLauncherProjectWizard(); NewLauncherProjectWizardPage wizardPage = new NewLauncherProjectWizardPage("New Launcher project"); wizard.openWizardFromShellMenu(); wizardPage.setTargetMission("rest-http"); wizardPage.setTargetRuntime("vert.x redhat"); wizardPage.setProjectName("project_2_customized_settings"); wizardPage.toggleUseDefaultLocationCheckBox(true); wizardPage.setCustomProjectLocation("/Users/zcervink/zc-custom-loc"); wizardPage.setArtifactId("my_customized_artifact_id"); wizardPage.setGroupId("my.customized.group.id"); wizardPage.setVersion("1.2.3-SNAPSHOT"); wizardPage.clickTheFinishButton(); <START> new WaitWhile(new JobIsRunning(), TimePeriod.getCustom(2500)); <END> log.step("Import project finished"); checkForErrors(); }</code><technical_language>wizardPage.finish(TimePeriod.getCustom(2500));</technical_language>

Target:
public void createNewLauncherApplicationProjectWithCustomizedSettings() { log.step("Import project start"); NewLauncherProjectWizard wizard = new NewLauncherProjectWizard(); NewLauncherProjectWizardPage wizardPage = new NewLauncherProjectWizardPage(wizard); wizard.openWizardFromShellMenu(); wizardPage.setTargetMission("rest-http"); wizardPage.setTargetRuntime("vert.x redhat"); wizardPage.setProjectName("project_2_customized_settings"); wizardPage.toggleUseDefaultLocationCheckBox(true); wizardPage.setCustomProjectLocation("/Users/zcervink/zc-custom-loc"); wizardPage.setArtifactId("my_customized_artifact_id"); wizardPage.setGroupId("my.customized.group.id"); wizardPage.setVersion("1.2.3-SNAPSHOT"); wizard.finish(TimePeriod.getCustom(2500)); log.step("Import project finished"); checkForErrors(); }
Source:
<code>public long getLastSchedulingCycleRuntimeDelayMs() { <START> return System.currentTimeMillis() - lastSchedulingCycleRunTimeMs.get(); <END> }</code><technical_language>nit: static import currentTimeMillis</technical_language>

Target:
public long getLastSchedulingCycleRuntimeDelayMs() { return currentTimeMillis() - lastSchedulingCycleRunTimeMs.get(); }
Source:
<code><START> public MockReplicaId(String storeId, long capacity, String filePath) { <END> this.storeId = storeId; this.capacity = capacity; this.filePath = filePath; partitionId = mock(PartitionId.class); when(partitionId.toString()).thenReturn(storeId); }</code><technical_language>public</technical_language>

Target:
MockReplicaId(String storeId, long capacity, String filePath) { this.storeId = storeId; this.capacity = capacity; this.filePath = filePath; partitionId = mock(PartitionId.class); when(partitionId.toString()).thenReturn(storeId); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; <START> GlusterGeoRepSession other = (GlusterGeoRepSession) obj; <END> if (masterVolumeId == null) { if (other.masterVolumeId != null) return false; } else if (!masterVolumeId.equals(other.masterVolumeId)) return false; if (sessionId == null) { if (other.sessionId != null) return false; } else if (!sessionId.equals(other.sessionId)) return false; if (sessionKey == null) { if (other.sessionKey != null) return false; } else if (!sessionKey.equals(other.sessionKey)) return false; if (slaveHostName == null) { if (other.slaveHostName != null) return false; } else if (!slaveHostName.equals(other.slaveHostName)) return false; if (slaveNodeUuid == null) { if (other.slaveNodeUuid != null) return false; } else if (!slaveNodeUuid.equals(other.slaveNodeUuid)) return false; if (slaveVolumeId == null) { if (other.slaveVolumeId != null) return false; } else if (!slaveVolumeId.equals(other.slaveVolumeId)) return false; if (slaveVolumeName == null) { if (other.slaveVolumeName != null) return false; } else if (!slaveVolumeName.equals(other.slaveVolumeName)) return false; if (status != other.status) return false; return true; }</code><technical_language>is this auto generated Eclipse of intelli-j? :) considered ObjectUtils.objctEquals? VmDynamic.java for example. IMHO, code cleaner</technical_language>

Target:
public boolean equals(Object obj) { return ObjectUtils.checkEquals(obj, this); }
Source:
<code>public void testGenerateInitAmazonS3WithRequiredQueryParams() throws IOException, ParseException, TemplateModelException { final Map<String,Object> testMap = new HashMap<>(); final Request testRequest = RequestConverter.toRequest(new Ds3Request( "com.spectralogic.s3.server.handler.reqhandler.amazons3.InitiateMultiPartUploadRequestHandler", HttpVerb.POST, Classification.amazons3, Requirement.REQUIRED, Requirement.REQUIRED, null, null, null, null, false, null, ImmutableList.of( new Ds3Param("Job", "java.util.UUID", true), new Ds3Param("Offset", "long", false)), ImmutableList.of()), <START> new Ds3DocSpecImpl( <END> ImmutableMap.of(), ImmutableMap.of())); testMap.put("requestEntry", testRequest); final CCodeGenerator codeGenerator = new CCodeGenerator(); final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); codeGenerator.processTemplate(testMap, "request-templates/InitRequest.ftl", fileUtils.getOutputStream()); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); final String expectedOutput = "ds3_request* ds3_init_initiate_multi_part_upload(const char* bucket_name, const char* object_name, const uint64_t length) {" + "\n" + " struct _ds3_request* request = _common_request_init(HTTP_POST, _build_path(\"/\", bucket_name, object_name));" + "\n" + " request->length = length;" + "\n" + "\n" + " return (ds3_request*) request;" + "\n" + "}\n"; assertEquals(expectedOutput, output); }</code><technical_language>Again, Ds3DocSpecEmptyImpl instead</technical_language>

Target:
public void testGenerateInitAmazonS3WithRequiredQueryParams() throws IOException, ParseException, TemplateModelException { final Map<String,Object> testMap = new HashMap<>(); final Request testRequest = RequestConverter.toRequest(new Ds3Request( "com.spectralogic.s3.server.handler.reqhandler.amazons3.InitiateMultiPartUploadRequestHandler", HttpVerb.POST, Classification.amazons3, Requirement.REQUIRED, Requirement.REQUIRED, null, null, null, null, false, null, ImmutableList.of( new Ds3Param("Job", "java.util.UUID", true), new Ds3Param("Offset", "long", false)), ImmutableList.of()), new Ds3DocSpecEmptyImpl()); testMap.put("requestEntry", testRequest); final CCodeGenerator codeGenerator = new CCodeGenerator(); final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); codeGenerator.processTemplate(testMap, "request-templates/InitRequest.ftl", fileUtils.getOutputStream()); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); final String expectedOutput = "ds3_request* ds3_init_initiate_multi_part_upload(const char* bucket_name, const char* object_name, const uint64_t length) {" + "\n" + " struct _ds3_request* request = _common_request_init(HTTP_POST, _build_path(\"/\", bucket_name, object_name));" + "\n" + " request->length = length;" + "\n" + "\n" + " return (ds3_request*) request;" + "\n" + "}\n"; assertEquals(expectedOutput, output); }
Source:
<code>public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ApplicationEnvironmentPreparedEvent) { ApplicationEnvironmentPreparedEvent castEvent = (ApplicationEnvironmentPreparedEvent) event; <START> String serviceName = castEvent.getEnvironment().getProperty(COMPONENT_NAME_KEY); <END> if (StringUtils.isBlank(serviceName)) { serviceName = castEvent.getSpringApplication().getMainApplicationClass().getPackage().getImplementationTitle(); } LOG.info("Setting service name to {}", serviceName); CommonLogHolder.setServiceType(serviceName); } if (event instanceof ApplicationFailedEvent) { LOG.info("Terminating default logging context"); LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); loggerContext.reset(); new BasicConfigurator().configure(loggerContext); } }</code><technical_language>get set</technical_language>

Target:
public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ApplicationEnvironmentPreparedEvent) { ApplicationEnvironmentPreparedEvent castEvent = (ApplicationEnvironmentPreparedEvent) event; String serviceName = Optional.ofNullable(castEvent.getEnvironment().getProperty(OT_COMPONENT_NAME_KEY)) .orElse(Optional.ofNullable(castEvent.getEnvironment().getProperty(DMITRY_COMPONENT_NAME_KEY)) .orElse(castEvent.getSpringApplication().getMainApplicationClass().getPackage().getImplementationTitle()) ); LOG.info("Setting service name to {}", serviceName); CommonLogHolder.setServiceType(serviceName); } if (event instanceof ApplicationFailedEvent) { LOG.info("Terminating default logging context"); LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); loggerContext.reset(); new BasicConfigurator().configure(loggerContext); } }
Source:
<code>public static Any idOf(Object target) { if (target instanceof Entity) { Object entityId = ((Entity) target).getId(); return Identifier.pack(entityId); } if (target instanceof EventProducer) { return ((EventProducer) target).getProducerId(); } <START> return TypeConverter.toAny(target.toString()); <END> }</code><technical_language>Identifiers.pack(...). differences results of two, feels Identifiers for IDs</technical_language>

Target:
private static Any idOf(Object target) { if (target instanceof Entity) { Object entityId = ((Entity) target).getId(); return Identifier.pack(entityId); } if (target instanceof EventProducer) { return ((EventProducer) target).getProducerId(); } return Identifier.pack(target.toString()); }
Source:
<code>public static Event clearEnrichments(Event event) { final EventContext context = event.getContext(); final EventContext.Builder resultContext = context.toBuilder() .clearEnrichment(); final EventContext.OriginCase originCase = resultContext.getOriginCase(); switch (originCase) { case EVENT_CONTEXT: resultContext.setEventContext(context.getEventContext() .toBuilder() .clearEnrichment()); break; case REJECTION_CONTEXT: resultContext.setRejectionContext(context.getRejectionContext() .toBuilder() .clearEnrichment()); break; case COMMAND_CONTEXT: break; case ORIGIN_NOT_SET: break; default: throw newIllegalStateException("Unsupported origin case is encountered: %s", originCase); } <START> return event.toBuilder() <END> .setContext(resultContext) .build(); }</code><technical_language>Please extract a result variable</technical_language>

Target:
public static Event clearEnrichments(Event event) { final EventContext context = event.getContext(); final EventContext.Builder resultContext = context.toBuilder() .clearEnrichment(); final EventContext.OriginCase originCase = resultContext.getOriginCase(); switch (originCase) { case EVENT_CONTEXT: resultContext.setEventContext(context.getEventContext() .toBuilder() .clearEnrichment()); break; case REJECTION_CONTEXT: resultContext.setRejectionContext(context.getRejectionContext() .toBuilder() .clearEnrichment()); break; case COMMAND_CONTEXT: break; case ORIGIN_NOT_SET: break; default: throw newIllegalStateException("Unsupported origin case is encountered: %s", originCase); } final Event result = event.toBuilder() .setContext(resultContext) .build(); return result; }
Source:
<code>public <R extends HttpRequest> R bindToRequest(R request, Object input) { <START> Optional<CopyBlobOptions> optional = (Optional<CopyBlobOptions>) input; <END> if (!optional.isPresent()) { return request; } HttpRequest.Builder builder = request.toBuilder(); CopyBlobOptions options = optional.get(); Optional<Map<String, String>> userMetadata = options.getUserMetadata(); if (userMetadata.isPresent()) { for (Map.Entry<String, String> entry : userMetadata.get().entrySet()) { builder.addHeader(AzureStorageHeaders.USER_METADATA_PREFIX + entry.getKey(), entry.getValue()); } } return (R) builder.build(); }</code><technical_language>a checkArg checkState verify type here, I guess</technical_language>

Target:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { HttpRequest.Builder builder = request.toBuilder(); CopyBlobOptions options = (CopyBlobOptions) input; Optional<Map<String, String>> userMetadata = options.getUserMetadata(); if (userMetadata.isPresent()) { for (Map.Entry<String, String> entry : userMetadata.get().entrySet()) { builder.addHeader(AzureStorageHeaders.USER_METADATA_PREFIX + entry.getKey(), entry.getValue()); } } Optional<Date> ifModifiedSince = options.getIfModifiedSince(); if (ifModifiedSince.isPresent()) { builder.addHeader(AzureStorageHeaders.COPY_SOURCE_IF_MODIFIED_SINCE, dateService.rfc822DateFormat(ifModifiedSince.get())); } Optional<Date> ifUnmodifiedSince = options.getIfUnmodifiedSince(); if (ifUnmodifiedSince.isPresent()) { builder.addHeader(AzureStorageHeaders.COPY_SOURCE_IF_UNMODIFIED_SINCE, dateService.rfc822DateFormat(ifUnmodifiedSince.get())); } Optional<String> ifMatch = options.getIfMatch(); if (ifMatch.isPresent()) { builder.addHeader(AzureStorageHeaders.COPY_SOURCE_IF_MATCH, ifMatch.get()); } Optional<String> ifNoneMatch = options.getIfNoneMatch(); if (ifNoneMatch.isPresent()) { builder.addHeader(AzureStorageHeaders.COPY_SOURCE_IF_NONE_MATCH, ifNoneMatch.get()); } return (R) builder.build(); }
Source:
<code>ConsumerResultReturner(Method method, int consumerIndex) { this.consumerIndex = consumerIndex; <START> elementType = GenericTypes.findGenericParameter(method.getParameters()[consumerIndex].getParameterizedType(), Consumer.class) <END> .orElseThrow(() -> new IllegalStateException("Couldn't find concrete type for Consumer<T>")); }</code><technical_language>Meh: method.getGenericParameterTypes()[consumerIndex]</technical_language>

Target:
ConsumerResultReturner(Method method, int consumerIndex) { this.consumerIndex = consumerIndex; elementType = method.getGenericParameterTypes()[consumerIndex]; }
Source:
<code>protected void acquireLockAndCheckIfIpv4IsFree(Network network, String requestedIpv4Address) { IPAddressVO ipVO = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), requestedIpv4Address); if (ipVO == null) { throw new CloudRuntimeException(String.format("Cannot find IPAddressVO for guest [IPv4 address='%s'] and [network id=%s]", requestedIpv4Address, network.getId())); } IPAddressVO lockedIpVO = _ipAddressDao.acquireInLockTable(ipVO.getId()); if (lockedIpVO.getState() != IPAddressVO.State.Free) { <START> String ipState = lockedIpVO.getState().toString(); <END> _ipAddressDao.releaseFromLockTable(lockedIpVO.getId()); throw new CloudRuntimeException(String.format("Cannot acquire guest [IPv4 address='%s']; The Ip address is in [state=%s]", requestedIpv4Address, ipState)); } lockedIpVO.setState(IPAddressVO.State.Allocated); _ipAddressDao.update(lockedIpVO.getId(), lockedIpVO); _ipAddressDao.releaseFromLockTable(lockedIpVO.getId()); }</code><technical_language>need a variable holding state, lockedIpVo.getState() in String.format() function, change releasing lock VO</technical_language>

Target:
protected void acquireLockAndCheckIfIpv4IsFree(Network network, String requestedIpv4Address) { IPAddressVO ipVO = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), requestedIpv4Address); if (ipVO == null) { throw new InvalidParameterValueException( String.format("Cannot find IPAddressVO for guest [IPv4 address='%s'] and [network id='%s']", requestedIpv4Address, network.getId())); } try { IPAddressVO lockedIpVO = _ipAddressDao.acquireInLockTable(ipVO.getId()); validateLockedRequestedIp(ipVO, lockedIpVO); lockedIpVO.setState(IPAddressVO.State.Allocated); _ipAddressDao.update(lockedIpVO.getId(), lockedIpVO); } finally { _ipAddressDao.releaseFromLockTable(ipVO.getId()); } }
Source:
<code>public void testCommaSeparatedStringWithValidList(){ <START> CrossSiteOriginFilter crossSiteOriginFilter = new CrossSiteOriginFilter(new ServerConfiguration()); <END> String commaSeparatedList = crossSiteOriginFilter.getAsCommaSeparatedList(Arrays.asList("origin", "authorization", "accept")); assertEquals("origin,authorization,accept",commaSeparatedList); }</code><technical_language>Add final keyword</technical_language>

Target:
public void testCommaSeparatedStringWithValidList(){ final CrossSiteOriginFilter crossSiteOriginFilter = new CrossSiteOriginFilter(new ServerConfiguration()); final String commaSeparatedList = crossSiteOriginFilter.getAsCommaSeparatedList(Arrays.asList("origin", "authorization", "accept")); assertEquals("origin,authorization,accept",commaSeparatedList); }
Source:
<code>protected void doRemoveItem(Pair<T, V> item, T value, V widget) { if (items.isEmpty()) { return; } boolean removalOfLastItem = item == lastItem(); boolean maxNumberOfItemsWasExceeded = <START> this.maxNumberOfItemsExceeded(); <END> removeEntry(item); onRemove(value, widget); boolean shouldAddPlusButton = this.showAddButton && (removalOfLastItem || maxNumberOfItemsWasExceeded); if (shouldAddPlusButton && !items.isEmpty()) { Pair<T, V> last = lastItem(); V lastItemWidget = last.getSecond(); getEntry(lastItemWidget).appendButton(createPlusButton(last)); } if (items.isEmpty() && this.showGhost) { Pair<T, V> ghostItem = addGhostEntry(); onAdd(ghostItem.getFirst(), ghostItem.getSecond()); } }</code><technical_language>I unusual prefix methods this in engine project</technical_language>

Target:
protected void doRemoveItem(Pair<T, V> item, T value, V widget) { if (items.isEmpty()) { return; } boolean removalOfLastItem = item == lastItem(); boolean maxNumberOfItemsWasExceeded = maxNumberOfItemsExceeded(); removeEntry(item); onRemove(value, widget); boolean shouldAddPlusButton = showAddButton && (removalOfLastItem || maxNumberOfItemsWasExceeded); if (shouldAddPlusButton && !items.isEmpty()) { Pair<T, V> last = lastItem(); V lastItemWidget = last.getSecond(); getEntry(lastItemWidget).appendButton(createPlusButton(last)); } if (items.isEmpty() && this.showGhost) { Pair<T, V> ghostItem = addGhostEntry(); onAdd(ghostItem.getFirst(), ghostItem.getSecond()); } }
Source:
<code>public int run(String[] args, PrintStream out) throws InterruptedException, IOException { List<String> paths = parseArgs(args); if (paths.isEmpty()) { out.println(USAGE); throw invalidArgs("no arguments"); } String s3Path = paths.get(0); try { initS3AFileSystem(s3Path); } catch (Exception e) { errorln("Failed to initialize S3AFileSystem from path: " + s3Path); throw e; } URI uri = toUri(s3Path); Path root; if (uri.getPath().isEmpty()) { root = new Path("/"); } else { root = new Path(uri.getPath()); } final S3AFileSystem fs = getFilesystem(); initMetadataStore(false); final MetadataStore ms = getStore(); if (ms == null || !(ms instanceof DynamoDBMetadataStore)) { errorln(s3Path + " path uses MS: " + ms); errorln(NAME + " can be only used with a DynamoDB backed s3a bucket."); errorln(USAGE); return ERROR; } final CommandFormat commandFormat = getCommandFormat(); if (commandFormat.getOpt(CHECK_FLAG)) { S3GuardFsck s3GuardFsck = new S3GuardFsck(fs, ms); try { s3GuardFsck.compareS3ToMs(fs.qualify(root)); } catch (IOException e) { <START> errorln("Error while running the check: compareS3ToMs"); <END> throw e; } } else { errorln("No supported operation is selected."); errorln(USAGE); return ERROR; } out.flush(); return SUCCESS; }</code><technical_language>Is this needed; runner logs anyway</technical_language>

Target:
public int run(String[] args, PrintStream out) throws InterruptedException, IOException { List<String> paths = parseArgs(args); if (paths.isEmpty()) { out.println(USAGE); throw invalidArgs("no arguments"); } int exitValue = EXIT_SUCCESS; String s3Path = paths.get(0); try { initS3AFileSystem(s3Path); } catch (Exception e) { errorln("Failed to initialize S3AFileSystem from path: " + s3Path); throw e; } URI uri = toUri(s3Path); Path root; if (uri.getPath().isEmpty()) { root = new Path("/"); } else { root = new Path(uri.getPath()); } final S3AFileSystem fs = getFilesystem(); initMetadataStore(false); final MetadataStore ms = getStore(); if (ms == null || !(ms instanceof DynamoDBMetadataStore)) { errorln(s3Path + " path uses MS: " + ms); errorln(NAME + " can be only used with a DynamoDB backed s3a bucket."); errorln(USAGE); return ERROR; } final CommandFormat commandFormat = getCommandFormat(); if (commandFormat.getOpt(CHECK_FLAG)) { S3GuardFsck s3GuardFsck = new S3GuardFsck(fs, ms); try { final List<S3GuardFsck.ComparePair> comparePairs = s3GuardFsck.compareS3ToMs(fs.qualify(root)); if (comparePairs.size() > 0) { exitValue = EXIT_FAIL; } } catch (IOException e) { throw e; } } else { errorln("No supported operation is selected."); errorln(USAGE); return ERROR; } out.flush(); return exitValue; }
Source:
<code>public static String computeLandingURL(String endpointURL, String devstudioOsioLandingPageSuffix) { try { URL url = new URL(endpointURL); <START> URL landingURL = new URL(url.getProtocol(), url.getHost(), url.getPort(), devstudioOsioLandingPageSuffix); <END> return landingURL.toExternalForm(); } catch (MalformedURLException e) { return null; } }</code><technical_language>this double usage of URL? Wouldnt URI instead of URL fully sufficient? (URL is severe flaws avoided if possible)</technical_language>

Target:
public static String computeLandingURL(String endpointURL, String devstudioOsioLandingPageSuffix) { try { URI uri = new URI(endpointURL); URI landingURI = new URI(uri.getScheme(), null, uri.getAuthority(), uri.getPort(), devstudioOsioLandingPageSuffix, null, null); return landingURI.toString(); } catch (URISyntaxException e) { return null; } }
Source:
<code>private void registerContextPhases(Iterable<? extends NodeOperation> nodeOperations, Context context) { for (NodeOperation nodeOperation : nodeOperations) { if (nodeOperation.downstreamExecutionPhaseId() == NodeOperation.NO_DOWNSTREAM) { LOGGER.trace("Building context for nodeOp without downstream: {}", nodeOperation); if (createContexts(nodeOperation.executionPhase(), context)) { context.opCtx.builtNodeOperations.set(nodeOperation.executionPhase().phaseId()); } } if (ExecutionPhases.hasDirectResponseDownstream(nodeOperation.downstreamNodes())) { var executionPhase = nodeOperation.executionPhase(); CircuitBreaker breaker = breaker(); int ramAccountingBlockSizeInBytes = BlockBasedRamAccounting.calculateBlockSizeInBytes( breaker.getLimit(), 1 ); <START> var ramAccounting = ConcurrentRamAccounting.forCircuitBreaker(executionPhase.label(), breaker); <END> Streamer<?>[] streamers = StreamerVisitor.streamersFromOutputs(executionPhase); SingleBucketBuilder bucketBuilder = new SingleBucketBuilder( streamers, new BlockBasedRamAccounting(ramAccounting::addBytes, ramAccountingBlockSizeInBytes)); context.directResponseFutures.add(bucketBuilder.completionFuture().whenComplete((res, err) -> ramAccounting.close())); context.registerBatchConsumer(nodeOperation.downstreamExecutionPhaseId(), bucketBuilder); } } }</code><technical_language>Do need ConcurrentRamAccounting here? I SingleBucketBuilder concurrently. (Yes, threads change, is concurrent multiple threads)</technical_language>

Target:
private void registerContextPhases(Iterable<? extends NodeOperation> nodeOperations, Context context) { for (NodeOperation nodeOperation : nodeOperations) { if (nodeOperation.downstreamExecutionPhaseId() == NodeOperation.NO_DOWNSTREAM) { LOGGER.trace("Building context for nodeOp without downstream: {}", nodeOperation); if (createContexts(nodeOperation.executionPhase(), context)) { context.opCtx.builtNodeOperations.set(nodeOperation.executionPhase().phaseId()); } } if (ExecutionPhases.hasDirectResponseDownstream(nodeOperation.downstreamNodes())) { var executionPhase = nodeOperation.executionPhase(); CircuitBreaker breaker = breaker(); int ramAccountingBlockSizeInBytes = BlockBasedRamAccounting.calculateBlockSizeInBytes( breaker.getLimit(), 1 ); var ramAccounting = new BlockBasedRamAccounting( b -> breaker.addEstimateBytesAndMaybeBreak(b, executionPhase.label()), ramAccountingBlockSizeInBytes); Streamer<?>[] streamers = StreamerVisitor.streamersFromOutputs(executionPhase); SingleBucketBuilder bucketBuilder = new SingleBucketBuilder(streamers, ramAccounting); context.directResponseFutures.add(bucketBuilder.completionFuture().whenComplete((res, err) -> ramAccounting.close())); context.registerBatchConsumer(nodeOperation.downstreamExecutionPhaseId(), bucketBuilder); } } }
Source:
<code><START> public Optional<BigDecimal> getRateById(@NonNull final TaxId taxId) <END> { final I_C_Tax tax = queryBL.createQueryBuilder(I_C_Tax.class) .addEqualsFilter(I_C_Tax.COLUMNNAME_C_Tax_ID, taxId) .create() .first(); return Optional.ofNullable(tax).map(I_C_Tax::getRate); }</code><technical_language>i Optional is needed tax record exist for a ID. If not, a db inconsistency a missing rate. But, instead of BigDecimal, pls consider returning de.metas.util.lang.Percent</technical_language>

Target:
public Percent getRateById(@NonNull final TaxId taxId) { final I_C_Tax tax = getTaxById(taxId); return Percent.of(tax.getRate()); }
Source:
<code>private void checkSchemas() throws RestartBlockException { try { boolean newSchema = false; ExportRowSchema curSchema = getExportRowSchema(); if (m_curSchema == null || !m_curSchema.sameSchema(curSchema)) { if (m_logger.isDebugEnabled()) { StringBuilder sb = new StringBuilder("Detected new schema:\n"); sb.append("old: "); if (m_curSchema == null) { sb.append("(none)\n"); } else { sb.append(m_curSchema).append("\n"); } sb.append("new: "); if (curSchema == null) { sb.append("(none)\n"); } else { sb.append(curSchema).append("\n"); } m_logger.debug(sb.toString()); } m_curSchema = curSchema; newSchema = true; } if (newSchema) { if (pstmt != null) { try { pstmt.close(); } catch (Exception e) finally { pstmt = null; } } <START> m_preparedStmtStr = null; <END> m_createTableStr = null; } } catch (Exception e) { m_logger.warn("JDBC export unable to check schemas", e); throw new RestartBlockException(true); } }</code><technical_language>This block moved get rid of variable newSchema</technical_language>

Target:
private void checkSchemas() throws RestartBlockException { try { ExportRowSchema curSchema = getExportRowSchema(); assert(curSchema != null); if (m_curGenId != curSchema.generation && !(m_curSchema != null && m_curSchema.sameSchema(curSchema))) { if (m_logger.isDebugEnabled()) { StringBuilder sb = new StringBuilder("Detected new schema: ") .append("old = ") .append(m_curGenId) .append(", new = ") .append(curSchema.generation); m_logger.debug(sb); } m_curGenId = curSchema.generation; m_curSchema = curSchema; if (pstmt != null) { try { pstmt.close(); } catch (Exception e) finally { pstmt = null; } } m_preparedStmtStr = null; m_createTableStr = null; } } catch (Exception e) { m_logger.warn("JDBC export unable to check schemas", e); throw new RestartBlockException(true); } }
Source:
<code>public void endOfAnalysis() { if(!classesNotFound.isEmpty()) { String message = ""; if(classesNotFound.size() > 50) { message = ", ..."; } LOG.warn("Classes not found during the analysis : [{}{}]", classesNotFound.stream().limit(50).collect(Collectors.joining(", ")), message); } <START> scanners.stream() <END> .filter(s -> s instanceof CrossFileScanner) .map(s -> (CrossFileScanner)s) .forEach(CrossFileScanner::endOfAnalysis); classLoader.close(); }</code><technical_language>In fact I executableScanners scanners. (And line 215/16, do drop scanners field)</technical_language>

Target:
public void endOfAnalysis() { if(!classesNotFound.isEmpty()) { String message = ""; if(classesNotFound.size() > 50) { message = ", ..."; } LOG.warn("Classes not found during the analysis : [{}{}]", classesNotFound.stream().limit(50).collect(Collectors.joining(", ")), message); } executableScanners.stream() .filter(s -> s instanceof EndOfAnalysisCheck) .map(EndOfAnalysisCheck.class::cast) .forEach(EndOfAnalysisCheck::endOfAnalysis); classLoader.close(); }
Source:
<code>public boolean act(float delta) { if (userVariable == null) { return true; } if (firstStart) { firstStart = false; writeActionFinished = false; <START> new WriteVariableOnDeviceAction.WriteTask().execute(userVariable); <END> } return writeActionFinished; }</code><technical_language>in ReadVariableOnDeviceAction this point "new ReadTask().execute(userVariable);" consistent if write "new WriteTask().execute(userVariable);"</technical_language>

Target:
public boolean act(float delta) { if (userVariable == null) { return true; } if (firstStart) { firstStart = false; writeActionFinished = false; new WriteTask().execute(userVariable); } return writeActionFinished; }
Source:
<code>public int read() throws IOException { byte[] buffer = new byte[1]; int bytesRead = ((FSDataInputStream) in).read(mPos, buffer, 0, buffer.length); if (bytesRead > 0) { mPos += bytesRead; } <START> return bytesRead < 0 ? bytesRead : (int) buffer[0]; <END> }</code><technical_language>BufferUtils.byteToInt</technical_language>

Target:
public int read() throws IOException { byte[] buffer = new byte[1]; int bytesRead = read(buffer); if (bytesRead > 0) { return BufferUtils.byteToInt(buffer[0]); } Preconditions.checkArgument(bytesRead != 0, "Expected a non-zero value if end of stream has not been reached"); return bytesRead; }
Source:
<code>public static String readFile(String filePath) throws IOException { try (BufferedReader br = new BufferedReader(new FileReader(filePath)); <START> Scanner sc = new Scanner(br)) { <END> return sc.useDelimiter("\\Z").next(); } }</code><technical_language>This more compact</technical_language>

Target:
public static String readFile(String filePath) throws IOException { try (Scanner sc = new Scanner(new BufferedReader(new FileReader(filePath)))) { return sc.useDelimiter("\\Z").next(); } }
Source:
<code>final Point getCheckSize() { Point result = new Point( 0, 0 ); if( ( style & SWT.CHECK ) != 0 ) { <START> CssImage check = getThemeAdapter().getCheckBoxImage( this ); <END> CssBoxDimensions margin = getCheckBoxMargin(); result.x = check.width + margin.getWidth(); result.y = check.height + margin.getHeight(); } return result; }</code><technical_language>if a bit longer, I checkImage clearer a variable name. immediately clear checkImage.width is width of image, of check box anything</technical_language>

Target:
final Point getCheckSize() { Point result = new Point( 0, 0 ); if( ( style & SWT.CHECK ) != 0 ) { CssImage checkImage = getThemeAdapter().getCheckBoxImage( this ); CssBoxDimensions margin = getCheckBoxMargin(); result.x = checkImage.width + margin.getWidth(); result.y = checkImage.height + margin.getHeight(); } return result; }
Source:
<code>public static void represent(OutputWriter childWriter, UserToRepresent user) { childWriter.add("login_name", user.getUsername().getUsername().toString()) .add("display_name", user.getDisplayName()) .add("enabled", user.isEnabled()) .add("email", user.getEmail()) .add("email_me", user.isEmailMe()) .add("is_admin", user.isAdmin()) <START> .add("is_individual_admin", user.isIndividualAdmin()) <END> .addChildList("roles", listWriter -> user.getRoles().forEach(role -> listWriter.addChild(propertyWriter -> RoleRepresenter.toJSON(propertyWriter, role)))) .addChildList("checkin_aliases", user.getMatchers()); }</code><technical_language>@vrushaliwaykole -- implementation perspective of SPA, sense add this field user response, if Users API consumer perspective if adds value. A consumer of API want user is admin not, user is admin a role. --- check if user is admin a role, rely super admin's API client (browser) side. ##### Implementation details: page load, a call users API roles API construct Users Model based responses of both</technical_language>

Target:
public static void represent(OutputWriter childWriter, UserToRepresent user) { childWriter.add("login_name", user.getUsername().getUsername().toString()) .add("display_name", user.getDisplayName()) .add("enabled", user.isEnabled()) .add("email", user.getEmail()) .add("email_me", user.isEmailMe()) .add("is_admin", user.isAdmin()) .addChildList("roles", listWriter -> user.getRoles().forEach(role -> listWriter.addChild(propertyWriter -> RoleRepresenter.toJSON(propertyWriter, role)))) .addChildList("checkin_aliases", user.getMatchers()); }
Source:
<code><START> protected Node parseInline(Node previous) { <END> char c = peek(); if (c == '\0') { return null; } Node node; switch (c) { case '\n': node = parseNewline(previous); break; case '\\': node = parseBackslash(); break; case '`': node = parseBackticks(); break; case '[': node = parseOpenBracket(); break; case '!': node = parseBang(); break; case ']': node = parseCloseBracket(); break; case '<': node = parseAutolink(); if (node == null) { node = parseHtmlInline(); } break; case '&': node = parseEntity(); break; default: boolean isDelimiter = delimiterCharacters.get(c); if (isDelimiter) { DelimiterProcessor delimiterProcessor = delimiterProcessors.get(c); node = parseDelimiters(delimiterProcessor, c); } else { node = parseString(); } break; } if (node != null) { return node; } else { index++; String literal = String.valueOf(c); return text(literal); } }</code><technical_language>change visibility of methods? Please undo for this PR</technical_language>

Target:
private Node parseInline(Node previous) { char c = peek(); if (c == '\0') { return null; } Node node; switch (c) { case '\n': node = parseNewline(previous); break; case '\\': node = parseBackslash(); break; case '`': node = parseBackticks(); break; case '[': node = parseOpenBracket(); break; case '!': node = parseBang(); break; case ']': node = parseCloseBracket(); break; case '<': node = parseAutolink(); if (node == null) { node = parseHtmlInline(); } break; case '&': node = parseEntity(); break; default: boolean isDelimiter = delimiterCharacters.get(c); if (isDelimiter) { DelimiterProcessor delimiterProcessor = delimiterProcessors.get(c); node = parseDelimiters(delimiterProcessor, c); } else { node = parseString(); } break; } if (node != null) { return node; } else { index++; String literal = String.valueOf(c); return text(literal); } }
Source:
<code>public void canRetrieveBusinessServices() throws Exception { BusinessService bs = new BusinessService(); bs.setName("Application Servers"); String reductionKey = "MyReductionKey"; bs.addReductionKey(reductionKey); Long id = m_businessServiceDao.save(bs); m_businessServiceDao.flush(); String url = "/business-services"; JAXBContext context = JAXBContext.newInstance(BusinessServiceListDTO.class, BusinessServiceDTO.class); List<BusinessServiceDTO> businessServices = getXmlObject(context, url, 200, JaxbListWrapper.class).getObjects(); assertEquals(1, businessServices.size()); BusinessServiceDTO bsDTO = new BusinessServiceDTO(); bsDTO.setName(bs.getName()); bsDTO.setId(id); assertEquals(bsDTO, businessServices.get(0)); <START> assertTrue("canRetrieveReductionKey", businessServices.get(0).getReductionKeys().contains(reductionKey)); <END> }</code><technical_language>If assertTrue/assertFalse please add a meaningful description if condition is met, e.g.: assertTrue("It expected reductionkey " + reductionKey + " is contained in reduction key set of business service " + businessService.get(0).getName() + " not", businessServices.get(0).getReductionKeys().contains(reductionKey))</technical_language>

Target:
public void canRetrieveBusinessServices() throws Exception { BusinessService bs = new BusinessService(); bs.setName("Application Servers"); String reductionKey = "MyReductionKey"; bs.addReductionKey(reductionKey); Long id = m_businessServiceDao.save(bs); m_businessServiceDao.flush(); String url = "/business-services"; JAXBContext context = JAXBContext.newInstance(BusinessServiceListDTO.class, BusinessServiceDTO.class); List<BusinessServiceDTO> businessServices = getXmlObject(context, url, 200, JaxbListWrapper.class).getObjects(); assertEquals(1, businessServices.size()); BusinessServiceDTO bsDTO = new BusinessServiceDTO(); bsDTO.setName(bs.getName()); bsDTO.setId(id); assertEquals(bsDTO, businessServices.get(0)); assertTrue("Expect reductionkey '" + reductionKey + "' to be present in retrieved BusinessService.", businessServices.get(0).getReductionKeys().contains(reductionKey)); }
Source:
<code>private void batchWriteDocuments(List<String> keys, BackupDocumentWriter contentWriter) { <START> final NodeKey metadataKey = repositoryCache.getRepositoryMetadataDocumentKey(); <END> for (String key : keys) { if (key == null) break; if (!key.equals(metadataKey.toString())) { SchematicEntry entry = documentStore.get(key); if (entry != null) { writeToContentArea(entry, contentWriter); } } } }</code><technical_language>logic of excluding metadataKey is correct, done method call. Instead, done in keys list keys loaded</technical_language>

Target:
private void batchWriteDocuments(List<String> keys, BackupDocumentWriter contentWriter) { for (String key : keys) { if (key == null) break; SchematicEntry entry = documentStore.get(key); if (entry != null) { writeToContentArea(entry, contentWriter); } } }
Source:
<code>public void handleUnableToConnectDeviceResponse(final DeviceResponse deviceResponse, final Throwable t, final Serializable messageData, final DeviceResponseMessageSender responseMessageSender, final DeviceResponse deviceResponse2, final String domain, final String domainVersion, final String messageType, final boolean isScheduled, final int retryCount) { final ResponseMessageResultType result = ResponseMessageResultType.NOT_OK; <START> final OsgpException ex = new TechnicalException(ComponentType.PROTOCOL_OSLP, t.getMessage() == null ? <END> UNEXPECTED_EXCEPTION : t.getMessage(), t); final ProtocolResponseMessage responseMessage = new ProtocolResponseMessage(domain, domainVersion, messageType, deviceResponse.getCorrelationUid(), deviceResponse.getOrganisationIdentification(), deviceResponse.getDeviceIdentification(), result, ex, messageData, isScheduled, retryCount); this.responseMessageSender.send(responseMessage); }</code><technical_language>check for null empty? StringUtils.isBlank</technical_language>

Target:
public void handleUnableToConnectDeviceResponse(final DeviceResponse deviceResponse, final Throwable t, final Serializable messageData, final DeviceResponseMessageSender responseMessageSender, final DeviceResponse deviceResponse2, final String domain, final String domainVersion, final String messageType, final boolean isScheduled, final int retryCount) { final ResponseMessageResultType result = ResponseMessageResultType.NOT_OK; final OsgpException ex = new TechnicalException(ComponentType.PROTOCOL_OSLP, StringUtils.isBlank(t.getMessage()) ? UNEXPECTED_EXCEPTION : t.getMessage(), t); final ProtocolResponseMessage responseMessage = new ProtocolResponseMessage(domain, domainVersion, messageType, deviceResponse.getCorrelationUid(), deviceResponse.getOrganisationIdentification(), deviceResponse.getDeviceIdentification(), result, ex, messageData, isScheduled, retryCount); this.responseMessageSender.send(responseMessage); }
Source:
<code>public void testEquals() { assertTrue(fRequest1.equals(fRequest1)); assertFalse(fRequest1.equals(fRequest2)); assertFalse(fRequest1.equals(fRequest3)); <START> assertFalse(fRequest1.equals(fRequest4)); <END> }</code><technical_language>equality test for identical requests dependency levels</technical_language>

Target:
public void testEquals() { assertTrue(fRequest1.equals(fRequest1)); assertFalse(fRequest1.equals(fRequest2)); assertFalse(fRequest1.equals(fRequest3)); assertFalse(fRequest1.equals(fRequest4)); assertFalse(fRequest4.equals(fRequest5)); }
Source:
<code>protected CreateVmVDSCommandParameters initCreateVmParams() { CreateVmVDSCommandParameters createVmParams = super.initCreateVmParams(); <START> getVm().setRunOnce(true); <END> RunVmOnceParams runOnceParams = getParameters(); SysPrepParams sysPrepParams = new SysPrepParams(); sysPrepParams.setSysPrepDomainName(runOnceParams.getSysPrepDomainName()); sysPrepParams.setSysPrepUserName(runOnceParams.getSysPrepUserName()); sysPrepParams.setSysPrepPassword(runOnceParams.getSysPrepPassword()); createVmParams.setSysPrepParams(sysPrepParams); createVmParams.setCloudInitParameters(runOnceParams.getCloudInitParameters()); return createVmParams; }</code><technical_language>getVm() replaced createVmParams</technical_language>

Target:
protected CreateVmVDSCommandParameters initCreateVmParams() { CreateVmVDSCommandParameters createVmParams = super.initCreateVmParams(); createVmParams.getVm().setRunOnce(true); RunVmOnceParams runOnceParams = getParameters(); SysPrepParams sysPrepParams = new SysPrepParams(); sysPrepParams.setSysPrepDomainName(runOnceParams.getSysPrepDomainName()); sysPrepParams.setSysPrepUserName(runOnceParams.getSysPrepUserName()); sysPrepParams.setSysPrepPassword(runOnceParams.getSysPrepPassword()); createVmParams.setSysPrepParams(sysPrepParams); createVmParams.setCloudInitParameters(runOnceParams.getCloudInitParameters()); return createVmParams; }