auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean itemIdProvided() { String id = request.getElement().element("pubsub").element("retract") .element("item").attributeValue("id"); <START> if ((id != null) && !id.equals("")) { <END> if (true == GlobalItemIDImpl.isGlobalId(id)) { itemId = GlobalItemIDImpl.fromBuddycloudString(id); } else { itemId = new GlobalItemIDImpl(new JID(this.getServerDomain()), node, id); } return true; } response.setType(IQ.Type.error); Element nodeIdRequired = new DOMElement("item-required", new Namespace( "", JabberPubsub.NS_PUBSUB_ERROR)); Element badRequest = new DOMElement( PacketError.Condition.bad_request.toXMPP(), new Namespace("", JabberPubsub.NS_XMPP_STANZAS)); Element error = new DOMElement("error"); error.addAttribute("type", PacketError.Type.modify.toXMPP()); error.add(badRequest); error.add(nodeIdRequired); response.setChildElement(error); return false; }</code><technical_language>isEmpty() instead of equals("")</technical_language>

Target:
private boolean itemIdProvided() { String id = request.getElement().element("pubsub").element("retract") .element("item").attributeValue("id"); if ((id != null) && !id.isEmpty()) { if (true == GlobalItemIDImpl.isGlobalId(id)) { itemId = GlobalItemIDImpl.fromBuddycloudString(id); } else { itemId = new GlobalItemIDImpl(new JID(this.getServerDomain()), node, id); } return true; } response.setType(IQ.Type.error); Element nodeIdRequired = new DOMElement("item-required", new Namespace( "", JabberPubsub.NS_PUBSUB_ERROR)); Element badRequest = new DOMElement( PacketError.Condition.bad_request.toXMPP(), new Namespace("", JabberPubsub.NS_XMPP_STANZAS)); Element error = new DOMElement("error"); error.addAttribute("type", PacketError.Type.modify.toXMPP()); error.add(badRequest); error.add(nodeIdRequired); response.setChildElement(error); return false; }
Source:
<code>private void loadConfigFromResource() { <START> if (configLoad) <END> return; try { Log.d(TAG, "Load config from assets"); InputStream stream = getInstrumentation().getContext().getAssets() .open("integration_tests.properties"); Properties p = new Properties(); p.load(stream); tenants.put(TenantType.AAD, TenantInfo.parseTenant(TenantType.AAD, p)); tenants.put(TenantType.ADFS30, TenantInfo.parseTenant(TenantType.ADFS30, p)); tenants.put(TenantType.ADFS20FEDERATED, TenantInfo.parseTenant(TenantType.ADFS20FEDERATED, p)); tenants.put(TenantType.ADFS30FEDERATED, TenantInfo.parseTenant(TenantType.ADFS30FEDERATED, p)); } catch (IOException e) { e.printStackTrace(); Log.d(TAG, e.getMessage()); } configLoad = true; }</code><technical_language>this code need thread-safe? Is chance loading config request a stress test other multi-threaded scenario</technical_language>

Target:
private void loadConfigFromResource() { if (configLoad) return; try { Log.d(TAG, "Load config from assets"); InputStream stream = getInstrumentation().getContext().getAssets() .open("integration_tests.properties"); Properties p = new Properties(); p.load(stream); tenants.put(TenantType.AAD, TenantInfo.parseTenant(TenantType.AAD, p)); tenants.put(TenantType.ADFS30, TenantInfo.parseTenant(TenantType.ADFS30, p)); tenants.put(TenantType.ADFS20FEDERATED, TenantInfo.parseTenant(TenantType.ADFS20FEDERATED, p)); tenants.put(TenantType.ADFS30FEDERATED, TenantInfo.parseTenant(TenantType.ADFS30FEDERATED, p)); } catch (IOException e) { e.printStackTrace(); Log.d(TAG, e.getMessage()); Assert.fail("Config is not loaded"); } configLoad = true; }
Source:
<code>private void checkMissingField(final Contentlet contentlet, final Language language, final String fieldName) { if (!contentlet.getMap().containsKey(fieldName)) { throw new DotContentletValidationException( <START> MessageFormat.format( <END> this.languageAPI.getStringKey(language, "missing.field"), fieldName) ); } }</code><technical_language>error message include contentlet's Identifier in order provide more information error</technical_language>

Target:
private void checkMissingField(final Contentlet contentlet, final Language language, final String fieldName) { final String identifier = contentlet.getIdentifier(); if (!contentlet.getMap().containsKey(fieldName)) { throw new DotContentletValidationException( MessageFormat.format( this.languageAPI.getStringKey(language, "missing.field"), fieldName, identifier) ); } }
Source:
<code>public void toExecute(JobExecutionContext context) throws JobExecutionException { JobDataMap map = context.getMergedJobDataMap(); String ownerId = map.getString(JobStatus.TARGET_ID); String ownerKey = map.getString(JobStatus.OWNER_ID); Owner owner = this.ownerCurator.lockAndLoad(ownerId); Principal principal = (Principal) map.get(PinsetterJobListener.PRINCIPAL_KEY); <START> log.info("GRABBED OWNER: {}", owner); <END> if (owner == null) { log.debug("Owner no longer exists: {}", ownerKey); context.setResult("Nothing to do; owner no longer exists: " + ownerKey); return; } String displayName = owner.getDisplayName(); ExporterMetadata metadata = this.exportCurator.getByTypeAndOwner( ExporterMetadata.TYPE_PER_USER, owner); if (metadata == null) { log.debug("No imports exist for owner {}", displayName); context.setResult("Nothing to do; imports no longer exist for owner: " + displayName); return; } log.info("Deleting all pools originating from manifests for owner/org: {}", displayName); List<Pool> pools = this.poolManager.listPoolsByOwner(owner).list(); for (Pool pool : pools) { if (this.poolManager.isManaged(pool)) { this.poolManager.deletePool(pool); } } UpstreamConsumer uc = owner.getUpstreamConsumer(); owner.setUpstreamConsumer(null); this.exportCurator.delete(metadata); this.recordManifestDeletion(owner, principal.getUsername(), uc); context.setResult("Imported pools removed for owner " + displayName); }</code><technical_language>Leftover debug statement</technical_language>

Target:
public void toExecute(JobExecutionContext context) throws JobExecutionException { JobDataMap map = context.getMergedJobDataMap(); String ownerId = map.getString(JobStatus.TARGET_ID); String ownerKey = map.getString(JobStatus.OWNER_ID); Owner owner = this.ownerCurator.lockAndLoad(ownerId); Principal principal = (Principal) map.get(PinsetterJobListener.PRINCIPAL_KEY); if (owner == null) { log.debug("Owner no longer exists: {}", ownerKey); context.setResult("Nothing to do; owner no longer exists: " + ownerKey); return; } String displayName = owner.getDisplayName(); ExporterMetadata metadata = this.exportCurator.getByTypeAndOwner( ExporterMetadata.TYPE_PER_USER, owner); if (metadata == null) { log.debug("No imports exist for owner {}", displayName); context.setResult("Nothing to do; imports no longer exist for owner: " + displayName); return; } log.info("Deleting all pools originating from manifests for owner/org: {}", displayName); List<Pool> pools = this.poolManager.listPoolsByOwner(owner).list(); for (Pool pool : pools) { if (this.poolManager.isManaged(pool)) { this.poolManager.deletePool(pool); } } UpstreamConsumer uc = owner.getUpstreamConsumer(); owner.setUpstreamConsumer(null); this.exportCurator.delete(metadata); this.recordManifestDeletion(owner, principal.getUsername(), uc); context.setResult("Imported pools removed for owner " + displayName); }
Source:
<code>public WebSocketBase pongHandler(Handler<Buffer> handler) { synchronized (conn) { checkClosed(); <START> if (frameHandler == null || frameHandler.getClass() != FrameAggregator.class) { <END> frameHandler = new FrameAggregator(); } ((FrameAggregator) frameHandler).pongHandler = handler; return this; } }</code><technical_language>pong frames final aggregated, I need a frame aggregator</technical_language>

Target:
public WebSocketBase pongHandler(Handler<Buffer> handler) { synchronized (conn) { checkClosed(); this.pongHandler = handler; return (S) this; } }
Source:
<code>public void testCustomProperties() throws IOException { DocumentModel file = session.createDocumentModel("/", "myFile", "File"); file = session.createDocument(file); txFeature.nextTransaction(); PageProvider<?> pp = pps.getPageProvider("DOCUMENT_HISTORY_PROVIDER", null, Long.valueOf(20), Long.valueOf(0), new HashMap<>(), file); @SuppressWarnings("unchecked") List<LogEntry> entries = (List<LogEntry>) pp.getCurrentPage(); if (entries.isEmpty()) { fail(); <END> } RenderingContext renderingCtx = RenderingContext.CtxBuilder.fetch(LogEntryCSVWriter.ENTITY_TYPE, "principalName", "docLifeCycle", "docPath", "docType").get(); for (LogEntry entry : entries) { CSVAssert csv = csvAssert(entry, renderingCtx); csv.has("principalName").isEquals("Administrator"); csv.has("docLifeCycle").isEquals("project"); csv.has("docPath").isEquals("/myFile"); csv.has("docType").isEquals("File"); <START> List<String> unwantedProps = List.of("category", "comment", "eventId", "eventDate", "logDate"); for (String property : unwantedProps) { try { csv.has(property); fail(); } catch (AssertionError e) { assertEquals("no field " + property, e.getMessage()); } } } }</code><technical_language>bad CSVAssert allow check column count..</technical_language>

Target:
public void testCustomProperties() throws IOException { RenderingContext renderingCtx = RenderingContext.CtxBuilder.fetch(ENTITY_TYPE, "principalName", "docLifeCycle", "docPath", "docType", "docUUID").get(); for (LogEntry entry : getLogEntries()) { CSVAssert csv = csvAssert(entry, renderingCtx); csv.has("principalName").isEquals("Administrator"); csv.has("docLifeCycle").isEquals("project"); csv.has("docPath").isEquals("/myFile"); csv.has("docType").isEquals("File"); csv.has("docUUID").isEquals(file.getId()); List<String> unwantedProps = List.of("category", "comment", "eventId", "eventDate", "logDate"); for (String property : unwantedProps) { try { csv.has(property); fail(); } catch (AssertionError e) { assertEquals("no field " + property, e.getMessage()); } } } }
Source:
<code>protected KafkaDynamicSinkBase( DataType consumedDataType, String topic, Properties properties, Optional<FlinkKafkaPartitioner<RowData>> partitioner, EncodingFormat<SerializationSchema<RowData>> encodingFormat) { this.consumedDataType = Preconditions.checkNotNull(consumedDataType, "Consumed data type must not be null."); this.topic = Preconditions.checkNotNull(topic, "Topic must not be null."); this.properties = Preconditions.checkNotNull(properties, "Properties must not be null."); this.partitioner = Preconditions.checkNotNull(partitioner, "Partitioner must not be null."); <START> this.encodingFormat = Preconditions.checkNotNull(encodingFormat, "Sink format must not be null."); <END> }</code><technical_language>update error message</technical_language>

Target:
protected KafkaDynamicSinkBase( DataType consumedDataType, String topic, Properties properties, Optional<FlinkKafkaPartitioner<RowData>> partitioner, EncodingFormat<SerializationSchema<RowData>> encodingFormat) { this.consumedDataType = Preconditions.checkNotNull(consumedDataType, "Consumed data type must not be null."); this.topic = Preconditions.checkNotNull(topic, "Topic must not be null."); this.properties = Preconditions.checkNotNull(properties, "Properties must not be null."); this.partitioner = Preconditions.checkNotNull(partitioner, "Partitioner must not be null."); this.encodingFormat = Preconditions.checkNotNull(encodingFormat, "Encoding format must not be null."); }
Source:
<code>public CommandResult runCommand(Integer id, String command) { <START> return null; <END> }</code><technical_language>Returning null avoided implementation is done yet. In opinion I solutions: - return a CommandResult object implementation is done - throw a RuntimeException a message implementation is missing</technical_language>

Target:
public CommandResult runCommand(Integer id, String command) { throw new RuntimeException("Not implemented, yet"); }
Source:
<code>public Response reliableRequest(final Request request, final int[] retryCodes, int retries, final long delayMillis) { Response response = null; while (retries > 0) { response = makeRequest(request); if (!shouldRetry(response, retryCodes)) { return response; } try { Thread.sleep(delayMillis); } catch (final InterruptedException e) { } retries--; } last_request = request; <START> last_response = response; <END> return response; }</code><technical_language>lastRequest lastResponse follow Java naming conventions</technical_language>

Target:
public Response reliableRequest(final Request request, final int[] retryCodes, int retries, final long delayMillis) { lastRequest = request; Response response = null; while (retries > 0) { response = makeRequest(request); if (!shouldRetry(response, retryCodes)) { break; } try { Thread.sleep(delayMillis); } catch (final InterruptedException e) { } retries--; } lastResponse = response; return response; }
Source:
<code>private static ServiceName resolveDeploymentUnitServiceName(OperationContext context, ModelNode operation) { <START> PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)); <END> if (address.getElement(1).getKey().equals(ModelDescriptionConstants.SUBDEPLOYMENT)) { return Services.deploymentUnitName( resolveRuntimeName(context, address.getElement(0)), address.getElement(1).getValue() ); } else { return Services.deploymentUnitName( resolveRuntimeName(context, address.getElement(0)) ); } }</code><technical_language>This PathAddress address = context.getCurrentAddress(); result is ^^^ is more efficient is preferred idiom simpler</technical_language>

Target:
private static ServiceName resolveDeploymentUnitServiceName(OperationContext context, ModelNode operation) { PathAddress address = context.getCurrentAddress(); if (address.getElement(1).getKey().equals(ModelDescriptionConstants.SUBDEPLOYMENT)) { return Services.deploymentUnitName( resolveRuntimeName(context, address.getElement(0)), address.getElement(1).getValue() ); } else { return Services.deploymentUnitName( resolveRuntimeName(context, address.getElement(0)) ); } }
Source:
<code>public void add(Replica replica) { <START> assert begin == 0; <END> if (size == contents.length) { int newSize; if (size < 3) newSize = 3; else if (size < 9) newSize = 9; else newSize = size * 2; contents = Arrays.copyOf(contents, newSize); } contents[size++] = replica; }</code><technical_language>disable this check</technical_language>

Target:
public void add(Replica replica) { if (begin != 0) throw new IllegalStateException(); if (size == contents.length) { int newSize; if (size < 3) newSize = 3; else if (size < 9) newSize = 9; else newSize = size * 2; contents = Arrays.copyOf(contents, newSize); } contents[size++] = replica; }
Source:
<code>public void testRemoveForced() throws Exception { setUpGetEntityExpectations(); setUriInfo(setUpActionExpectations(VdcActionType.RemoveVds, RemoveVdsParameters.class, new String[] { "VdsId", "ForceAction" }, new Object[] { GUIDS[0], Boolean.TRUE }, true, true)); Action action = new Action(); action.setForce(true); <START> verifyRemove(collection.remove(GUIDS[0].toString(), new Action(){{setForce(true);}})); <END> }</code><technical_language>'actioin' line 115 creating new one</technical_language>

Target:
public void testRemoveForced() throws Exception { setUpGetEntityExpectations(); setUriInfo(setUpActionExpectations(VdcActionType.RemoveVds, RemoveVdsParameters.class, new String[] { "VdsId", "ForceAction" }, new Object[] { GUIDS[0], Boolean.TRUE }, true, true)); Action action = new Action(); action.setForce(true); verifyRemove(collection.remove(GUIDS[0].toString(), action)); }
Source:
<code>protected void stopping() { <START> if (mementos != null) { for (CacheMemento memento : mementos) { memento.restore(); } } <END> }</code><technical_language>I mementos null. suggest Arrays.stream(mementos).foreach(CacheMemento::restore)</technical_language>

Target:
protected void stopping() { Arrays.stream(mementos).forEach(CacheMemento::restore); }
Source:
<code>public void testDiscoverDevicesNoDevices() throws Exception { List<String> list = new ArrayList<String>(); list.add("id"); byte[] deviceTimeoutByteArray = new byte[]{0x01}; long deviceTimeout = ByteUtils.byteArrayToLong(deviceTimeoutByteArray) * 100; PowerMockito.when(deviceMock.getParameter("NT")).thenReturn(deviceTimeoutByteArray); long start = System.currentTimeMillis(); List<RemoteXBeeDevice> remotes = nd.discoverDevices(list); long end = System.currentTimeMillis(); assertThat("The 'discoverDevices' should block for " + deviceTimeout + " ms", end - start > deviceTimeout, is(equalTo(true))); assertThat("The discovered devices list should be empty", remotes.size(), is(equalTo(0))); PowerMockito.verifyPrivate(nd, Mockito.times(1)).invoke(SEND_NODE_DISCOVERY_COMMAND_METHOD, Mockito.anyString()); Mockito.verify(deviceMock, Mockito.times(1)).addPacketListener(packetListener); Mockito.verify(deviceMock, Mockito.times(1)).removePacketListener(packetListener); <START> PowerMockito.verifyPrivate(nd, Mockito.times(1)).invoke(DISCOVER_DEVICES_API_METHOD, null, null); <END> Mockito.verify(networkMock, Mockito.never()).addRemoteDevices(Mockito.anyListOf(RemoteXBeeDevice.class)); }</code><technical_language>Add line: java Mockito.verify(networkMock, Mockito.never()).addRemoteDevice(Mockito.any(RemoteXBeeDevice.class));</technical_language>

Target:
public void testDiscoverDevicesNoDevices() throws Exception { List<String> list = new ArrayList<String>(); list.add("id"); byte[] deviceTimeoutByteArray = new byte[]{0x01}; long deviceTimeout = ByteUtils.byteArrayToLong(deviceTimeoutByteArray) * 100; PowerMockito.when(deviceMock.getParameter("NT")).thenReturn(deviceTimeoutByteArray); long start = System.currentTimeMillis(); List<RemoteXBeeDevice> remotes = nd.discoverDevices(list); long end = System.currentTimeMillis(); assertThat("The 'discoverDevices' should block for " + deviceTimeout + " ms", end - start > deviceTimeout, is(equalTo(true))); assertThat("The discovered devices list should be empty", remotes.size(), is(equalTo(0))); PowerMockito.verifyPrivate(nd, Mockito.times(1)).invoke(SEND_NODE_DISCOVERY_COMMAND_METHOD, Mockito.anyString()); Mockito.verify(deviceMock, Mockito.times(1)).addPacketListener(packetListener); Mockito.verify(deviceMock, Mockito.times(1)).removePacketListener(packetListener); PowerMockito.verifyPrivate(nd, Mockito.times(1)).invoke(DISCOVER_DEVICES_API_METHOD, null, null); Mockito.verify(networkMock, Mockito.never()).addRemoteDevices(Mockito.anyListOf(RemoteXBeeDevice.class)); Mockito.verify(networkMock, Mockito.never()).addRemoteDevice(Mockito.any(RemoteXBeeDevice.class)); }
Source:
<code>public void evaluate(Evaluation evaluation) { EvaluationContext context = evaluation.getContext(); String[] clientIds = getClients(this.policy); if (clientIds.length > 0) { for (String clientId : clientIds) { <START> if (context.getIdentity().getId().equals(clientId)) { <END> evaluation.grant(); return; } } } }</code><technical_language>Honestly, I kc.client.id instead. reason is policies built-in attributes possible, specially for common usual information</technical_language>

Target:
public void evaluate(Evaluation evaluation) { EvaluationContext context = evaluation.getContext(); String[] clients = getClients(this.policy); if (clients.length > 0) { for (String client : clients) { ClientModel clientModel = getCurrentRealm().getClientById(client); if (context.getAttributes().containsValue("kc.client.id", clientModel.getClientId())) { evaluation.grant(); return; } } } }
Source:
<code>private ActiveResourceManager<ResourceID> createAndStartResourceManager( Configuration configuration, ResourceManagerDriver<ResourceID> driver, SlotManager slotManager) throws Exception { final TestingRpcService rpcService = new TestingRpcService(configuration); <START> final MockResourceManagerRuntimeServices rmServices = new MockResourceManagerRuntimeServices(rpcService, TIMEOUT_TIME, slotManager); <END> final ActiveResourceManager<ResourceID> activeResourceManager = new ActiveResourceManager<>( driver, configuration, rpcService, ResourceID.generate(), rmServices.highAvailabilityServices, rmServices.heartbeatServices, rmServices.slotManager, NoOpResourceManagerPartitionTracker::get, rmServices.jobLeaderIdService, new ClusterInformation("localhost", 1234), fatalErrorHandler, UnregisteredMetricGroups.createUnregisteredResourceManagerMetricGroup()); activeResourceManager.start(); rmServices.grantLeadership(); return activeResourceManager; }</code><technical_language>nit: I a bit cheaper reuse TestingRpcService @ClassRule static final TestingRpcServiceResource testingRpcServiceResource = ....</technical_language>

Target:
private ActiveResourceManager<ResourceID> createAndStartResourceManager( Configuration configuration, ResourceManagerDriver<ResourceID> driver, SlotManager slotManager) throws Exception { final TestingRpcService rpcService = RPC_SERVICE_RESOURCE.getTestingRpcService(); final MockResourceManagerRuntimeServices rmServices = new MockResourceManagerRuntimeServices(rpcService, TIMEOUT_TIME, slotManager); final ActiveResourceManager<ResourceID> activeResourceManager = new ActiveResourceManager<>( driver, configuration, rpcService, ResourceID.generate(), rmServices.highAvailabilityServices, rmServices.heartbeatServices, rmServices.slotManager, NoOpResourceManagerPartitionTracker::get, rmServices.jobLeaderIdService, new ClusterInformation("localhost", 1234), fatalErrorHandler, UnregisteredMetricGroups.createUnregisteredResourceManagerMetricGroup()); activeResourceManager.start(); rmServices.grantLeadership(); return activeResourceManager; }
Source:
<code>private List<String> getFilesToAdd(Iterable<File> includeFiles, BuildToolInfo buildToolInfo, File outInputListFolder) throws IOException { List<String> filePathList = Lists.newArrayList(); for (File f : includeFiles) { if (f != null && f.exists()) { filePathList.add(f.getAbsolutePath()); } } if (filePathList.isEmpty()) { mLogger.verbose("No Dex inputs."); <START> return Lists.newArrayList(); <END> } FullRevision minBuildToolRevision = new FullRevision(21, 0, 0); if (buildToolInfo.getRevision().compareTo(minBuildToolRevision) >= 0) { if (!outInputListFolder.exists()) { outInputListFolder.mkdirs(); } File inputListFile = new File(outInputListFolder, "libraryList.txt"); Files.asCharSink(inputListFile, Charsets.UTF_8).writeLines(filePathList); mLogger.verbose("Dex inputs passed via --input-list: " + filePathList); return Lists.newArrayList("--input-list", inputListFile.getAbsolutePath()); } else { mLogger.verbose("Dex inputs passed as command line arguments: " + filePathList); return filePathList; } }</code><technical_language>throw exception</technical_language>

Target:
private List<String> getFilesToAdd(Iterable<File> includeFiles, BuildToolInfo buildToolInfo, File outInputListFolder) throws IOException { List<String> filePathList = Lists.newArrayList(); for (File f : includeFiles) { if (f != null && f.exists()) { filePathList.add(f.getAbsolutePath()); } } if (filePathList.isEmpty()) { throw new IOException("No files to pass to dex."); } if (buildToolInfo.getRevision().compareTo(MIN_BUILD_TOOLS_REVISION_FOR_DEX_INPUT_LIST) >= 0) { File inputListFile = new File(outInputListFolder, "libraryList.txt"); Files.asCharSink(inputListFile, Charsets.UTF_8).writeLines(filePathList); return Lists.newArrayList("--input-list=" + inputListFile.getAbsolutePath()); } else { return filePathList; } }
Source:
<code>public String toString() { <START> return String.format("The firmware update progress for thing %s changed. State: %s Progress: %d.", thingUID, <END> progressInfo.getProgressStep().name(), progressInfo.getProgress()); }</code><technical_language>I prefer step instead of state</technical_language>

Target:
public String toString() { String stepName = progressInfo.getProgressStep() == null ? null : progressInfo.getProgressStep().name(); return String.format("The firmware update progress for thing %s changed. Step: %s Progress: %d.", thingUID, stepName, progressInfo.getProgress()); }
Source:
<code>public List<Task<? extends Serializable>> handle(Context context) throws SemanticException { OpenTxnMessage msg = deserializer.getOpenTxnMessage(context.dmd.getPayload()); Task<OpenTxnWork> openTxnTask = TaskFactory.get( <START> new OpenTxnWork(context.dbName, context.tableName, msg.getTxnId()), <END> context.hiveConf ); context.log.debug("Added Open txn task : {}", openTxnTask.getId()); return Collections.singletonList(openTxnTask); }</code><technical_language>context.dbName tableName null if REPL LOAD command arguments. So, need validate for null/empty else dbName tableName OpenTxnMessage</technical_language>

Target:
public List<Task<? extends Serializable>> handle(Context context) throws SemanticException { OpenTxnMessage msg = deserializer.getOpenTxnMessage(context.dmd.getPayload()); Task<ReplTxnWork> openTxnTask = TaskFactory.get( new ReplTxnWork(context.dbName, context.tableName, msg.getTxnIdItr(), ReplTxnWork.OperationType.REPL_OPEN_TXN), context.hiveConf ); updatedMetadata.set(context.dmd.getEventTo().toString(), context.dbName, context.tableName, null); context.log.debug("Added Open txn task : {}", openTxnTask.getId()); return Collections.singletonList(openTxnTask); }
Source:
<code>public String getJsonPlan(Session session, Statement statement, Type planType, List<Expression> parameters, WarningCollector warningCollector) { DataDefinitionTask<?> task = dataDefinitionTask.get(statement.getClass()); if (task != null) { return explainTask(statement, task, parameters); } Plan plan; switch (planType) { case IO: plan = getLogicalPlan(session, statement, parameters, warningCollector); return textIOPlan(plan.getRoot(), metadata, session); case LOGICAL: plan = getLogicalPlan(session, statement, parameters, warningCollector); return PlanPrinter.jsonLogicalPlan(plan.getRoot(), plan.getTypes(), metadata.getFunctionManager(), plan.getStatsAndCosts(), session); case DISTRIBUTED: SubPlan subPlan = getDistributedPlan(session, statement, parameters, warningCollector); <START> return PlanPrinter.jsonDistributedPlan(subPlan); <END> default: throw new PrestoException(NOT_SUPPORTED, format("Unsupported explain plan type %s for JSON format", planType)); } }</code><technical_language>static import</technical_language>

Target:
public String getJsonPlan(Session session, Statement statement, Type planType, List<Expression> parameters, WarningCollector warningCollector) { DataDefinitionTask<?> task = dataDefinitionTask.get(statement.getClass()); if (task != null) { return explainTask(statement, task, parameters); } Plan plan; switch (planType) { case IO: plan = getLogicalPlan(session, statement, parameters, warningCollector); return textIOPlan(plan.getRoot(), metadata, session); case LOGICAL: plan = getLogicalPlan(session, statement, parameters, warningCollector); return jsonLogicalPlan(plan.getRoot(), plan.getTypes(), metadata.getFunctionManager(), plan.getStatsAndCosts(), session); case DISTRIBUTED: SubPlan subPlan = getDistributedPlan(session, statement, parameters, warningCollector); return jsonDistributedPlan(subPlan); default: throw new PrestoException(NOT_SUPPORTED, format("Unsupported explain plan type %s for JSON format", planType)); } }
Source:
<code>public void run() { while (spaceUsed.running()) { try { long refreshInterval = spaceUsed.refreshInterval; if (spaceUsed.jitter > 0) { long jitter = spaceUsed.jitter; refreshInterval += ThreadLocalRandom.current() .nextLong(-jitter, jitter); } refreshInterval = Math.max(refreshInterval, 1); Thread.sleep(refreshInterval); spaceUsed.refresh(); } catch (InterruptedException e) { <START> LOG.warn("Thread Interrupted waiting to refresh disk information. " <END> + "Ignoring."); } } }</code><technical_language>retain message; include stack trace @ debug level</technical_language>

Target:
public void run() { while (spaceUsed.running()) { try { long refreshInterval = spaceUsed.refreshInterval; if (spaceUsed.jitter > 0) { long jitter = spaceUsed.jitter; refreshInterval += ThreadLocalRandom.current() .nextLong(-jitter, jitter); } refreshInterval = Math.max(refreshInterval, 1); Thread.sleep(refreshInterval); spaceUsed.refresh(); } catch (InterruptedException e) { LOG.warn("Thread Interrupted waiting to refresh disk information. " + "Ignoring."); LOG.debug("Thread interrupted", e); } } }
Source:
<code>private List<?> getRemoteChildrenList(Resource resource, ValueMap valueMap, Field field, String propertyName) { final Class<?> fieldType = field.getType(); Object value = valueMap.get(propertyName); if (value == null) { if (LOG.isDebugEnabled()) { LOG.debug( "the property [{}/{}] is undefined, assigning null value for [{}#{}]", new Object[] { resource.getPath(), propertyName, fieldType.getCanonicalName(), field.getName() }); } return Collections.EMPTY_LIST; } if (!(value instanceof String)) { if (LOG.isDebugEnabled()) { LOG.debug( "the property [{}/{}] annotated is not of String type as required by " + "@JcrProperty(..., follow = true) in the model, assigning null " + "value for [{}#{}]", new Object[] { resource.getPath(), propertyName, fieldType.getCanonicalName(), field.getName() }); } return Collections.EMPTY_LIST; } String nestedResourcePath = (String) value; Resource followUpResource = resource.getResourceResolver().getResource(nestedResourcePath); if (followUpResource == null) { if (LOG.isDebugEnabled()) { LOG.debug( "the nested resource [{}/{}] expected under path doesn't exist, " + "assigning null value for [{}#{}]", new Object[] { resource.getPath(), propertyName, nestedResourcePath, fieldType.getCanonicalName(), field.getName() }); } return Collections.EMPTY_LIST; <START> } <END> return getChildrenList(followUpResource, field); }</code><technical_language>logic of followUpResource is for ChildrenFieldProcessor SliceResourceFieldProcessor. Please extract some class reference in SRFP</technical_language>

Target:
private List<?> getRemoteChildrenList(Resource resource, ValueMap valueMap, Field field, String propertyName) { Resource followUpResource = FollowUpProcessorUtil.getFollowUpResource(resource, valueMap, field, propertyName); if (followUpResource == null) { return Collections.EMPTY_LIST; } return getChildrenList(followUpResource, field); }
Source:
<code>public void testStringChannelTimeZoneUpdate() { final String expectedTimeZonePDT = "PDT"; final String expectedTimeZonePST = "PST"; Configuration configuration = new Configuration(); configuration.put(NtpBindingConstants.PROPERTY_TIMEZONE, TEST_TIME_ZONE_ID); configuration.put(NtpBindingConstants.PROPERTY_NTP_SERVER_HOST, TEST_HOSTNAME); <START> configuration.put(NtpBindingConstants.PROPERTY_NTP_SERVER_PORT, TEST_PORT); <END> Configuration channelConfig = new Configuration(); channelConfig.put(NtpBindingConstants.PROPERTY_DATE_TIME_FORMAT, TEST_DATE_TIME_FORMAT); initialize(configuration, NtpBindingConstants.CHANNEL_STRING, ACCEPTED_ITEM_TYPE_STRING, channelConfig); String timeZoneFromItemRegistry = getStringChannelTimeZoneFromItemRegistry(); assertThat("The string channel was not updated with the right timezone", timeZoneFromItemRegistry, is(anyOf(equalTo(expectedTimeZonePDT), equalTo(expectedTimeZonePST)))); }</code><technical_language>If pass 2 properties initialize method in test method, setting **inside** initialize method remove duplicate code test methods? server port change for testmethod, right</technical_language>

Target:
public void testStringChannelTimeZoneUpdate() { final String expectedTimeZonePDT = "PDT"; final String expectedTimeZonePST = "PST"; Configuration configuration = new Configuration(); configuration.put(NtpBindingConstants.PROPERTY_TIMEZONE, TEST_TIME_ZONE_ID); Configuration channelConfig = new Configuration(); channelConfig.put(NtpBindingConstants.PROPERTY_DATE_TIME_FORMAT, TEST_DATE_TIME_FORMAT); initialize(configuration, NtpBindingConstants.CHANNEL_STRING, ACCEPTED_ITEM_TYPE_STRING, channelConfig, null); String timeZoneFromItemRegistry = getStringChannelTimeZoneFromItemRegistry(); assertThat("The string channel was not updated with the right timezone", timeZoneFromItemRegistry, is(anyOf(equalTo(expectedTimeZonePDT), equalTo(expectedTimeZonePST)))); }
Source:
<code>public boolean shouldExecute() { <START> if (this.runDelay < 0) { <END> this.hasDrone = hasBeeType(EnumBeeType.DRONE); this.hasPrincess = hasBeeType(EnumBeeType.PRINCESS); } return super.shouldExecute(); }</code><technical_language>this.runDelay is 0 this is true. Please test this more carefully</technical_language>

Target:
public boolean shouldExecute() { if (this.runDelay <= 0) { this.hasDrone = hasBeeType(EnumBeeType.DRONE); this.hasPrincess = hasBeeType(EnumBeeType.PRINCESS); } return super.shouldExecute(); }
Source:
<code>public void required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest() throws Throwable { blackboxSubscriberTest(new BlackboxTestStageTestRun() { @Override public void run(BlackboxTestStage stage) throws InterruptedException { triggerRequest(stage.subProxy().sub()); final long requested = stage.expectRequest(); final long signalsToEmit = Math.min(requested, 512); <START> for (int i = 0; i < signalsToEmit; i++) <END> stage.signalNext(); stage.sendCompletion(); } }); }</code><technical_language>This check if Subscriber signalled cancel loop unnecessarily</technical_language>

Target:
public void required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest() throws Throwable { blackboxSubscriberTest(new BlackboxTestStageTestRun() { @Override public void run(BlackboxTestStage stage) throws InterruptedException { triggerRequest(stage.subProxy().sub()); final long requested = stage.expectRequest(); final long signalsToEmit = Math.min(requested, 512); for (int i = 0; i < signalsToEmit && sampleIsCancelled(stage, i, 10); i++) stage.signalNext(); stage.sendCompletion(); } private boolean sampleIsCancelled(BlackboxTestStage stage, int i, int checkInterval) throws InterruptedException { if (i % checkInterval == 0) return stage.isCancelled(); else return false; } }); }
Source:
<code>protected void run() throws Exception { if (localName != null && gitdir != null) throw die(CLIText.get().conflictingUsageOf_git_dir_andArguments); final URIish uri = new URIish(sourceUri); if (localName == null) { try { localName = uri.getHumanishName(); } catch (IllegalArgumentException e) { throw die(MessageFormat.format(CLIText.get().cannotGuessLocalNameFrom, sourceUri)); } } if (gitdir == null) gitdir = new File(localName, Constants.DOT_GIT).getAbsolutePath(); dst = new FileRepository(gitdir); dst.create(); final FileBasedConfig dstcfg = dst.getConfig(); dstcfg.setBoolean("core", null, "bare", false); dstcfg.save(); db = dst; outw.print(MessageFormat.format( CLIText.get().initializedEmptyGitRepositoryIn, gitdir)); outw.println(); outw.flush(); saveRemote(uri); final FetchResult r = runFetch(); final Ref checkoutRef; if (branch == null) checkoutRef = guessHEAD(r); else <START> checkoutRef = r.getAdvertisedRef(Constants.R_HEADS + branch); <END> doCheckout(checkoutRef); }</code><technical_language>If branch "-b" exist, this null, doCheckout() die fatal: checkout; HEAD advertised remote this fatal: remote branch 'foo' instead</technical_language>

Target:
protected void run() throws Exception { if (localName != null && gitdir != null) throw die(CLIText.get().conflictingUsageOf_git_dir_andArguments); final URIish uri = new URIish(sourceUri); if (localName == null) { try { localName = uri.getHumanishName(); } catch (IllegalArgumentException e) { throw die(MessageFormat.format(CLIText.get().cannotGuessLocalNameFrom, sourceUri)); } } if (gitdir == null) gitdir = new File(localName, Constants.DOT_GIT).getAbsolutePath(); dst = new FileRepository(gitdir); dst.create(); final FileBasedConfig dstcfg = dst.getConfig(); dstcfg.setBoolean("core", null, "bare", false); dstcfg.save(); db = dst; outw.print(MessageFormat.format( CLIText.get().initializedEmptyGitRepositoryIn, gitdir)); outw.println(); outw.flush(); saveRemote(uri); final FetchResult r = runFetch(); final Ref checkoutRef; if (branch == null) checkoutRef = guessHEAD(r); else { checkoutRef = r.getAdvertisedRef(Constants.R_HEADS + branch); if (checkoutRef == null) throw die(MessageFormat.format(CLIText.get().noSuchRemoteRef, branch)); } doCheckout(checkoutRef); }
Source:
<code>private void releaseSavePoint(boolean autosave, int flags) throws SQLException { if (autosave <START> && (flags & QueryExecutor.QUERY_SUPPRESS_BEGIN) == 1 <END> && getAutoSave() == AutoSave.ALWAYS && getTransactionState() == TransactionState.OPEN) { try { sendOneQuery(releaseAutoSave, SimpleQuery.NO_PARAMETERS, 1, 0, QUERY_NO_RESULTS | QUERY_NO_METADATA | QUERY_EXECUTE_AS_SIMPLE); } catch (IOException ex) { throw new PSQLException(GT.tr("Error releasing savepoint"), PSQLState.IO_ERROR); } } }</code><technical_language>changing check for QUERY_SUPPRESS_BEGIN 0 changes fix issue. savepoint is released</technical_language>

Target:
private void releaseSavePoint(boolean autosave, int flags) throws SQLException { if ( autosave && getAutoSave() == AutoSave.ALWAYS && getTransactionState() == TransactionState.OPEN) { try { sendOneQuery(releaseAutoSave, SimpleQuery.NO_PARAMETERS, 1, 0, QUERY_NO_RESULTS | QUERY_NO_METADATA | QUERY_EXECUTE_AS_SIMPLE); } catch (IOException ex) { throw new PSQLException(GT.tr("Error releasing savepoint"), PSQLState.IO_ERROR); } } }
Source:
<code>public static void start(String key) { MeasurementSeries measurementSeries = SERIES_MAP.get(key); if (measurementSeries == null) { measurementSeries = new MeasurementSeries(); SERIES_MAP.put(key, measurementSeries); } if (measurementSeries.currentStart > 0) { L.w("Overwriting currentStart of " + measurementSeries.currentStart); } L.v("Start(" + key + ")"); <START> measurementSeries.currentStart = System.nanoTime(); <END> }</code><technical_language>I if this is applicable Android consider millis: <LINK_0></technical_language>

Target:
public static void start(String key) { MeasurementSeries measurementSeries = SERIES_MAP.get(key); if (measurementSeries == null) { measurementSeries = new MeasurementSeries(); SERIES_MAP.put(key, measurementSeries); } if (measurementSeries.currentStart > 0) { L.w("Overwriting currentStart of " + measurementSeries.currentStart); } L.v("Start(" + key + ")"); measurementSeries.currentStart = SystemClock.elapsedRealtime(); }
Source:
<code>public BlockRegion union(int x, int y, int z, BlockRegion dest) { <START> dest.aabb.minX = this.aabb.minX < x ? this.aabb.minX : x; <END> dest.aabb.minY = this.aabb.minY < y ? this.aabb.minY : y; dest.aabb.minZ = this.aabb.minZ < z ? this.aabb.minZ : z; dest.aabb.maxX = this.aabb.maxX > (x + 1) ? this.aabb.maxX : (x + 1); dest.aabb.maxY = this.aabb.maxY > (y + 1) ? this.aabb.maxY : (y + 1); dest.aabb.maxZ = this.aabb.maxZ > (z + 1) ? this.aabb.maxZ : (z + 1); return dest; }</code><technical_language>I guess Joml-object do calculation due "Max + 1"-circumstance. rational Math.min()/max()? Is supposed faster function call? This implementation surely is more error-prone</technical_language>

Target:
public BlockRegion union(int x, int y, int z, BlockRegion dest) { dest.aabb.minX = Math.min(this.aabb.minX, x); dest.aabb.minY = Math.min(this.aabb.minY, y); dest.aabb.minZ = Math.min(this.aabb.minZ, z); dest.aabb.maxX = Math.max(this.aabb.maxX, (x + 1)); dest.aabb.maxY = Math.max(this.aabb.maxY, (y + 1)); dest.aabb.maxZ = Math.max(this.aabb.maxZ, (z + 1)); return dest; }
Source:
<code>public String toString() { <START> return code() + " " + reasonText(); <END> }</code><technical_language>final field computed for all, values constants</technical_language>

Target:
public String toString() { String text = this.text; if (text == null) { this.text = text = code() + " " + reasonText(); } return text; }
Source:
<code>private void createSynchronizationBehaviorContent(Composite parent) { Group synchronizationGroup = new Group(parent, SWT.NONE); GridData layoutData = new GridData(SWT.FILL, SWT.BOTTOM, true, false); RowLayout layout = new RowLayout(SWT.HORIZONTAL); layout.marginTop = 10; layout.marginBottom = 10; synchronizationGroup.setLayout(layout); synchronizationGroup.setLayoutData(layoutData); synchronizationGroup.setText(EMFCompareRCPUIMessages .getString("InteractiveFilterUIContent.SYNC_BEHAVIOR_GROUP_LABEL")); Label label = new Label(synchronizationGroup, SWT.WRAP); label.setText(EMFCompareRCPUIMessages.getString("InteractiveFilterUIContent.SYNC_BEHAVIOR_LABEL")); <START> combo = new Combo(synchronizationGroup, SWT.WRAP); <END> for (String comboLabel : comboLabels) { combo.add(comboLabel); } combo.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { if (combo.equals(e.getSource())) { synchronizationBehaviorValue = comboValues[combo.getSelectionIndex()]; } } public void widgetDefaultSelected(SelectionEvent e) { } }); }</code><technical_language>Style bits of this SWT.DROP_DOWN | SWT.READ_ONLY , WRAP is useless a combo</technical_language>

Target:
private void createSynchronizationBehaviorContent(Composite parent) { Group synchronizationGroup = new Group(parent, SWT.NONE); GridData layoutData = new GridData(SWT.FILL, SWT.BOTTOM, true, false); RowLayout layout = new RowLayout(SWT.HORIZONTAL); layout.marginTop = 10; layout.marginBottom = 10; synchronizationGroup.setLayout(layout); synchronizationGroup.setLayoutData(layoutData); synchronizationGroup.setText(EMFCompareRCPUIMessages .getString("InteractiveFilterUIContent.sync.behavior.group.label")); Label label = new Label(synchronizationGroup, SWT.WRAP); label.setText(EMFCompareRCPUIMessages.getString("InteractiveFilterUIContent.sync.behavior.label")); combo = new Combo(synchronizationGroup, SWT.DROP_DOWN | SWT.READ_ONLY); for (String comboLabel : comboValues) { combo.add(comboLabel); } combo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (combo.equals(e.getSource())) { synchronizationBehaviorValue = combo.getItem(combo.getSelectionIndex()); } } }); }
Source:
<code><START> public String getFormattedValue() { <END> if (formattedValue == null) { List<String> strings = new ArrayList<String>(); for (CtfTmfEventField element : getValue()) { strings.add(element.getFormattedValue()); } formattedValue = strings.toString(); } return formattedValue; }</code><technical_language>Method marked 'synchronized' (to ensure caller build array). Minor issue, work way, out for ;) I guess fix IntegerArrayField too</technical_language>

Target:
public synchronized String getFormattedValue() { if (formattedValue == null) { List<String> strings = new ArrayList<String>(); for (CtfTmfEventField element : getValue()) { strings.add(element.getFormattedValue()); } formattedValue = strings.toString(); } return formattedValue; }
Source:
<code>public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { <START> channel.write(ByteBuffer.wrap(Ints.toByteArray((int) writer.getSerializedSize()))); <END> writer.writeTo(channel, smoosher); if (!nullRowsBitmap.isEmpty()) { nullValueBitmapWriter.writeTo(channel, smoosher); } }</code><technical_language>SerializerUtils.writeInt()</technical_language>

Target:
public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { SerializerUtils.writeInt(channel, Ints.checkedCast(writer.getSerializedSize())); writer.writeTo(channel, smoosher); if (!nullRowsBitmap.isEmpty()) { nullValueBitmapWriter.writeTo(channel, smoosher); } }
Source:
<code>public List<Folder> findSubFolders(final Host host, final User user, final boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { if (!permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read Host " + host.getHostname()); } final List<Folder> allFolders = folderFactory.findFoldersByHost(host); final List<Folder> subFolders = new ArrayList<Folder>(allFolders.size()); <START> for(Folder folder : allFolders) <END> if(permissionAPI.doesUserHavePermission(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) subFolders.add(folder); return subFolders; }</code><technical_language>a stream here, as: return allFolder.stream().filter (folder -> permissionAPI.doesUserHavePermission(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)).collect(CollectionsUtils.toImmutableList());</technical_language>

Target:
public List<Folder> findSubFolders(final Host host, final User user, final boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { if (!this.permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + user.getUserId() != null?user.getUserId():"" + " does not have permission to read Host " + host.getHostname()); } final List<Folder> allFolders = folderFactory.findFoldersByHost(host); return allFolders.stream().filter ((Folder folder) -> doesUserHavePermissions(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions) ).collect(CollectionsUtils.toImmutableList()); }
Source:
<code><START> public AccountAttributes() { <END> }</code><technical_language>If Builder Pattern, I is necessary constructor private (as initializations done in Builder)</technical_language>

Target:
AccountAttributes() { }
Source:
<code>public void handleDataValue(MotechEvent event) { Map<String, Object> params = event.getParameters(); DataElement dataElement = dataElementService.findByName((String) params.get(EventParams.DATA_ELEMENT)); if (dataElement == null) { throw new DataElementNotFoundException("The data element that was sent did not " + <START> "match any values imported from DHIS2. Please make sure that the data element field matches " + <END> "a data element name in the DHIS2 module"); } String orgUnitId = (String) params.get(EventParams.LOCATION); String period = (String) params.get(EventParams.PERIOD); String value = (String) params.get(EventParams.VALUE); String categoryOptionCombo = (String) params.get(EventParams.CATEGORY_OPTION_COMBO); String comment = (String) params.get(EventParams.COMMENT); DataValueDto dataValueDto = new DataValueDto(); dataValueDto.setDataElement(dataElement.getUuid()); dataValueDto.setValue(value); dataValueDto.setOrgUnit(orgUnitId); dataValueDto.setPeriod(period); dataValueDto.setCategoryOptionCombo(categoryOptionCombo); dataValueDto.setComment(comment); DataValueSetDto dataValueSetDto = new DataValueSetDto(); List<DataValueDto> dataValueDtos = new ArrayList<>(); dataValueDtos.add(dataValueDto); dataValueSetDto.setDataValues(dataValueDtos); dhisWebService.sendDataValueSet(dataValueSetDto); }</code><technical_language>Include params.get(EvenParams.DATA_ELEMENT) in exception message</technical_language>

Target:
public void handleDataValue(MotechEvent event) { Map<String, Object> params = event.getParameters(); DataElement dataElement = dataElementService.findByName((String) params.get(EventParams.DATA_ELEMENT)); if (dataElement == null) { throw new DataElementNotFoundException("The data element " + params.get(EventParams.DATA_ELEMENT) + " that was sent did not match any values imported from DHIS2. Please make sure that the " + "data element field matches a data element name in the DHIS2 module"); } String orgUnitId = (String) params.get(EventParams.LOCATION); String period = (String) params.get(EventParams.PERIOD); String value = (String) params.get(EventParams.VALUE); String categoryOptionCombo = (String) params.get(EventParams.CATEGORY_OPTION_COMBO); String comment = (String) params.get(EventParams.COMMENT); DataValueDto dataValueDto = new DataValueDto(); dataValueDto.setDataElement(dataElement.getUuid()); dataValueDto.setValue(value); dataValueDto.setOrgUnit(orgUnitId); dataValueDto.setPeriod(period); dataValueDto.setCategoryOptionCombo(categoryOptionCombo); dataValueDto.setComment(comment); DataValueSetDto dataValueSetDto = new DataValueSetDto(); List<DataValueDto> dataValueDtos = new ArrayList<>(); dataValueDtos.add(dataValueDto); dataValueSetDto.setDataValues(dataValueDtos); dhisWebService.sendDataValueSet(dataValueSetDto); }