auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateContentFiles(List<Process> processes) { for (Process process : processes) { try { FileformatInterface rdf = serviceManager.getProcessService().readMetadataFile(process); rdf.getDigitalDocument().addAllContentFiles(); serviceManager.getFileService().writeMetadataFile(rdf, process); Helper.setMeldung(KITODO_SCRIPT_FIELD, "ContentFiles updated: ", process.getTitle()); } catch (DocStructHasNoTypeException e) { <START> logger.error(e.getMessage(), e); <END> Helper.setFehlerMeldung("DocStructHasNoTypeException", e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while updating content files", e); } } Helper.setMeldung(KITODO_SCRIPT_FIELD, "", "updateContentFiles finished"); }</code><technical_language>setErrorMessage</technical_language>

Target:
private void updateContentFiles(List<Process> processes) { for (Process process : processes) { try { FileformatInterface rdf = serviceManager.getProcessService().readMetadataFile(process); rdf.getDigitalDocument().addAllContentFiles(); serviceManager.getFileService().writeMetadataFile(rdf, process); Helper.setMeldung(KITODO_SCRIPT_FIELD, "ContentFiles updated: ", process.getTitle()); } catch (PreferencesException | IOException | ReadException | WriteException | RuntimeException e) { Helper.setErrorMessage(KITODO_SCRIPT_FIELD, "Error while updating content files", logger, e); } } Helper.setMeldung(KITODO_SCRIPT_FIELD, "", "updateContentFiles finished"); }
Source:
<code>public void setUp() throws IOException { birthDate = Calendar.getInstance(); birthDate.set(1973, 4, 19, 22, 13, 0); UserProfileService ups = Framework.getLocalService(UserProfileService.class); DocumentModel up = ups.getUserProfileDocument(session); up.setPropertyValue(USER_PROFILE_PHONENUMBER_FIELD, "mynumber"); up.setPropertyValue(USER_PROFILE_BIRTHDATE_FIELD, birthDate.getTime()); Blob blob = Blobs.createBlob(FileUtils.getResourceFileFromContext("data/SmallAvatar.jpg")); up.setPropertyValue(USER_PROFILE_AVATAR_FIELD, (Serializable) blob); session.saveDocument(up); session.save(); <START> DownloadService downloadService = Framework.getService(DownloadService.class); <END> avatarURL = RenderingContext.DEFAULT_URL + downloadService.getDownloadUrl(up, USER_PROFILE_AVATAR_FIELD, blob.getFilename()); }</code><technical_language>Service injected</technical_language>

Target:
public void setUp() throws IOException { birthDate = Calendar.getInstance(); birthDate.set(1973, 4, 19, 22, 13, 0); DocumentModel up = userProfileService.getUserProfileDocument(session); up.setPropertyValue(USER_PROFILE_PHONENUMBER_FIELD, "mynumber"); up.setPropertyValue(USER_PROFILE_BIRTHDATE_FIELD, birthDate.getTime()); Blob blob = Blobs.createBlob(FileUtils.getResourceFileFromContext("data/SmallAvatar.jpg")); up.setPropertyValue(USER_PROFILE_AVATAR_FIELD, (Serializable) blob); session.saveDocument(up); session.save(); avatarURL = RenderingContext.DEFAULT_URL + downloadService.getDownloadUrl(up, USER_PROFILE_AVATAR_FIELD, blob.getFilename()); }
Source:
<code>public void testSLAonUserTaskUpdated() throws Exception { CountDownLatch latch = new CountDownLatch(1); TimerIdListener listener = new TimerIdListener(); KieBase kbase = createKnowledgeBase("BPMN2-UserTaskWithSLAOnTask.bpmn2"); KieSession ksession = createKnowledgeSession(kbase); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); ksession.addEventListener(listener); ProcessInstance processInstance = ksession.startProcess("UserTask"); assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE); WorkItem workItem = workItemHandler.getWorkItem(); assertNotNull(workItem); assertEquals("john", workItem.getParameter("ActorId")); processInstance = ksession.getProcessInstance(processInstance.getId()); assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE); Collection<NodeInstance> active = ((WorkflowProcessInstance)processInstance).getNodeInstances(); assertEquals(1, active.size()); long timerId = listener.getTimerId(); assertNotEquals(-1, timerId); ksession.execute(new UpdateTimerCommand(processInstance.getId(), (long) timerId, 10)); boolean slaViolated = latch.await(5, TimeUnit.SECONDS); <START> assertFalse("SLA should not violated by timer", slaViolated); <END> ksession.dispose(); }</code><technical_language>Test is working properly (passes timer is updated: 10, 2, etc.) slaViolated is false due count of latch reaches zero, countdown method is called</technical_language>

Target:
public void testSLAonUserTaskUpdated() throws Exception { CountDownLatch latch = new CountDownLatch(1); TimerIdListener listener = new TimerIdListener(latch); KieBase kbase = createKnowledgeBase("BPMN2-UserTaskWithSLAOnTask.bpmn2"); KieSession ksession = createKnowledgeSession(kbase); TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler); ksession.addEventListener(listener); ProcessInstance processInstance = ksession.startProcess("UserTask"); assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState()); WorkItem workItem = workItemHandler.getWorkItem(); assertNotNull(workItem); assertEquals("john", workItem.getParameter("ActorId")); processInstance = ksession.getProcessInstance(processInstance.getId()); assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState()); Collection<NodeInstance> active = ((WorkflowProcessInstance)processInstance).getNodeInstances(); assertEquals(1, active.size()); long timerId = listener.getTimerId(); assertNotEquals(-1, timerId); System.out.println(); ksession.execute(new UpdateTimerCommand(processInstance.getId(), (long) timerId, 7)); boolean slaViolated = latch.await(5, TimeUnit.SECONDS); assertFalse("SLA should not be violated by timer", slaViolated); slaViolated = latch.await(5, TimeUnit.SECONDS); assertTrue("SLA should be violated by timer", slaViolated); ksession.dispose(); }
Source:
<code>private void loadResourceXmlFile(FsFile fsFile, XmlLoader... xmlLoaders) { VTDNav vtdNav = parse(fsFile); for (XmlLoader xmlLoader : xmlLoaders) { <START> xmlLoader.processResourceXml(new XpathResourceXmlLoader.XmlNode(vtdNav), new XmlContext(packageName, fsFile)); <END> } }</code><technical_language>new XmlContext() happen for loop create objects</technical_language>

Target:
private void loadResourceXmlFile(FsFile fsFile, XmlLoader... xmlLoaders) { VTDNav vtdNav = parse(fsFile); XpathResourceXmlLoader.XmlNode xmlNode = new XpathResourceXmlLoader.XmlNode(vtdNav); XmlContext xmlContext = new XmlContext(packageName, fsFile); for (XmlLoader xmlLoader : xmlLoaders) { xmlLoader.processResourceXml(xmlNode, xmlContext); } }
Source:
<code>private void destroy() { AbstractChannelHandlerContext ctx = this.tail.prev; while (ctx != head) { synchronized (handlers) { handlers.remove(ctx); } remove0(ctx); <START> ctx = ctx.prev; <END> } }</code><technical_language>is this guaranteed called event loop? I double-check..</technical_language>

Target:
private void destroy() { EventExecutor executor = executor(); if (executor.inEventLoop()) { destroy0(); } else { executor.execute(this::destroy0); } }
Source:
<code>public void findConceptsByUUID_shouldGetCorrectConceptByUUID() { mDatabase.conceptRoomDAO().saveConcept(expectedConceptEntity1); mDatabase.conceptRoomDAO().saveConcept(expectedConceptEntity2); mDatabase.conceptRoomDAO().findConceptsByUUID(expectedConceptEntity1.getUuid()).subscribe(new SingleObserver<List<ConceptEntity>>() { @Override public void onSubscribe(Disposable d) { } @Override public void onSuccess(List<ConceptEntity> conceptEntities) { Assert.assertEquals(conceptEntities.get(0), expectedConceptEntity1); <START> Assert.assertEquals(conceptEntities.get(1), expectedConceptEntity2); <END> } @Override public void onError(Throwable e) { Log.i(TAG, e.getMessage()); } }); }</code><technical_language>expectedConceptEntity1's uuid matches, is expectedConceptEntity2 listed here</technical_language>

Target:
public void findConceptsByUUID_shouldGetCorrectConceptByUUID() { mDatabase.conceptRoomDAO().saveConcept(expectedConceptEntity1); mDatabase.conceptRoomDAO().saveConcept(expectedConceptEntity2); mDatabase.conceptRoomDAO().findConceptsByUUID(expectedConceptEntity1.getUuid()) .test() .assertValue(conceptEntities -> { ConceptEntity actualEntity = conceptEntities.get(0); return Objects.equals(actualEntity.getUuid(), expectedConceptEntity1.getUuid()) && Objects.equals(actualEntity.getName(), expectedConceptEntity1.getName()) && Objects.equals(actualEntity.getDisplay(), expectedConceptEntity1.getDisplay()); }); }
Source:
<code>private Type getType(Expression expression) { return asSymbol(expression) .map(symbol -> requireNonNull(types.get(symbol), () -> format("No type for symbol %s", symbol))) .orElseGet(() -> { ExpressionAnalyzer expressionAnalyzer = ExpressionAnalyzer.createWithoutSubqueries( metadata.getFunctionRegistry(), metadata.getTypeManager(), session, types, ImmutableList.of(), node -> new IllegalStateException("Unexpected Subquery"), <START> WarningCollector.NOOP, false); <END> Type type = expressionAnalyzer.analyze(expression, Scope.create()); return type; }); }</code><technical_language>New line</technical_language>

Target:
private Type getType(Expression expression) { if (expression instanceof SymbolReference) { Symbol symbol = Symbol.from(expression); return requireNonNull(types.get(symbol), () -> format("No type for symbol %s", symbol)); } ExpressionAnalyzer expressionAnalyzer = ExpressionAnalyzer.createWithoutSubqueries( metadata.getFunctionRegistry(), metadata.getTypeManager(), session, types, ImmutableList.of(), node -> new VerifyException("Unexpected subquery"), WarningCollector.NOOP, false); return expressionAnalyzer.analyze(expression, Scope.create()); }
Source:
<code>public void cacheManagerStarted(GlobalComponentRegistry gcr) { final EmbeddedCacheManager cacheManager = gcr.getComponent(EmbeddedCacheManager.class); final InternalCacheRegistry internalCacheRegistry = gcr.getComponent(InternalCacheRegistry.class); ClusteredLockManagerConfiguration config = extractConfiguration(gcr); GlobalConfiguration globalConfig = gcr.getGlobalConfiguration(); if (globalConfig.isClustered()) { internalCacheRegistry.registerInternalCache(CLUSTERED_LOCK_CACHE_NAME, createClusteredLockCacheConfiguration(config, globalConfig), EnumSet.of(InternalCacheRegistry.Flag.EXCLUSIVE)); CompletableFuture<CacheHolder> future = startCaches(cacheManager); registerClusteredLockManager(gcr, future, config); } else { <START> log.info("Clustered locks are necessary for clustered infinispan"); <END> } }</code><technical_language>INFO message is a bit confusing, "Configuration is clustered, clustered locks disabled" that</technical_language>

Target:
public void cacheManagerStarted(GlobalComponentRegistry gcr) { final EmbeddedCacheManager cacheManager = gcr.getComponent(EmbeddedCacheManager.class); final InternalCacheRegistry internalCacheRegistry = gcr.getComponent(InternalCacheRegistry.class); ClusteredLockManagerConfiguration config = extractConfiguration(gcr); GlobalConfiguration globalConfig = gcr.getGlobalConfiguration(); if (globalConfig.isClustered()) { internalCacheRegistry.registerInternalCache(CLUSTERED_LOCK_CACHE_NAME, createClusteredLockCacheConfiguration(config, globalConfig), EnumSet.of(InternalCacheRegistry.Flag.EXCLUSIVE)); CompletableFuture<CacheHolder> future = startCaches(cacheManager); registerClusteredLockManager(gcr, future, config); } else { log.configurationNotClustered(); } }
Source:
<code>public int getContentLength() { Header contentLength = resp.getFirstHeader("content-length"); if (contentLength == null) { return -1; <START> } else { <END> long l = Long.parseLong(contentLength.getValue()); if (l > Integer.MAX_VALUE) { return -1; } return (int) l; } }</code><technical_language>nit: decrease indentation avoiding this 'else'. if (contentLength == null) { return -1; }</technical_language>

Target:
public int getContentLength() { Header contentLength = resp.getFirstHeader("content-length"); if (contentLength == null) { return -1; } try { long l = Long.parseLong(contentLength.getValue()); if (l > Integer.MAX_VALUE) { return -1; } return (int) l; } catch (NumberFormatException e) { return -1; } }
Source:
<code>public void clickOk() { JButton okButton = robot.finder().find(target, new <START> GenericTypeMatcher<JButton>(JButton.class) <END> { @Override protected boolean isMatching(JButton component) { return "OK".equals(component.getText()); } }); Assert.assertNotNull(okButton); JButtonFixture okButtonFixture = new JButtonFixture(robot, okButton); okButtonFixture.click(); }</code><technical_language>is a matcher this: org.fest.swing.core.matcher.JButtonMatcher</technical_language>

Target:
public void clickOk() { JButton okButton = robot.finder().find(target, JButtonMatcher.withText("OK")); assertNotNull(okButton); JButtonFixture okButtonFixture = new JButtonFixture(robot, okButton); okButtonFixture.click(); }
Source:
<code>public abstract void executeTask(CronTaskConfigurationDto config) throws Throwable; @Override protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { String jobKey = jobExecutionContext.getJobDetail().getKey().getName(); CronTaskConfigurationDto configuration = cronTaskConfigurationService.getTaskConfigurationDto(jobKey); configuration = configuration == null ? (CronTaskConfigurationDto) jobExecutionContext.getJobDetail().getJobDataMap().get("config") : configuration; if (configuration == null) { logger.info(String.format("Configuration not found for [%s].", jobKey)); return; } if (!enabled(configuration, environment)) { logger.info(String.format("Cron job [%s] disabled, skip execution.", configuration.getName())); return; <START> } <END> logger.info(String.format("Cron job [%s] enabled, executing.", configuration.getName())); setStatus(CronJobStatusEnum.EXECUTING.getStatus()); cronTaskEventListenerRegistry.dispatchCronTaskExecutingEvent(configuration.getName()); try { executeTask(configuration); logger.info(String.format("Cron job task [%s] execution completed.", configuration.getName())); } catch (Throwable e) { logger.error(String.format("Failed to execute cron job task [%s].", configuration.getName()), e); } manager.addExecutedJob(configuration.getName(), true); cronTaskEventListenerRegistry.dispatchCronTaskExecutedEvent(configuration.getName()); setStatus(CronJobStatusEnum.SLEEPING.getStatus()); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Invoke method(s) conditionally. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public abstract void executeTask(CronTaskConfigurationDto config) throws Throwable; @Override protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { String jobKey = jobExecutionContext.getJobDetail().getKey().getName(); CronTaskConfigurationDto configuration = cronTaskConfigurationService.getTaskConfigurationDto(jobKey); if (configuration == null) { configuration = (CronTaskConfigurationDto) jobExecutionContext.getJobDetail().getJobDataMap().get("config"); } if (configuration == null) { logger.info(String.format("Configuration not found for [%s].", jobKey)); return; } if (!enabled(configuration, environment)) { logger.info(String.format("Cron job [%s] disabled, skip execution.", configuration.getName())); return; } logger.info(String.format("Cron job [%s] enabled, executing.", configuration.getName())); setStatus(CronJobStatusEnum.EXECUTING.getStatus()); cronTaskEventListenerRegistry.dispatchCronTaskExecutingEvent(configuration.getName()); try { executeTask(configuration); logger.info(String.format("Cron job task [%s] execution completed.", configuration.getName())); } catch (Throwable e) { logger.error(String.format("Failed to execute cron job task [%s].", configuration.getName()), e); } manager.addExecutedJob(configuration.getName(), true); cronTaskEventListenerRegistry.dispatchCronTaskExecutedEvent(configuration.getName()); setStatus(CronJobStatusEnum.SLEEPING.getStatus()); }
Source:
<code>public OAuthResponse onActivityResult(int requestCode, int resultCode, Intent data) { <START> if (requestCode == Shared.REQUEST_CODE) { <END> if (resultCode == Activity.RESULT_OK) { Bundle extras = data.getExtras(); String token = extras.getString(Shared.TOKEN, ""); String tokenSecret = extras.getString(Shared.TOKEN_SECRET, ""); if (callback != null) { callback.onSuccess(extras.getString(Shared.TOKEN, ""), extras.getString(Shared.TOKEN_SECRET, "")); } return OAuthResponse.success(token, tokenSecret); } if (callback != null) { callback.onError(); } return OAuthResponse.error("Aborted"); } return null; }</code><technical_language>I is clearer defensive approach: if (requestCode != Shared.REQUEST_CODE) { ... }</technical_language>

Target:
public OAuthResponse onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode != Shared.REQUEST_CODE) return null; if (resultCode == Activity.RESULT_OK) { Bundle extras = data.getExtras(); String token = extras.getString(Shared.TOKEN, ""); String tokenSecret = extras.getString(Shared.TOKEN_SECRET, ""); if (callback != null) { callback.onSuccess(extras.getString(Shared.TOKEN, ""), extras.getString(Shared.TOKEN_SECRET, "")); } return OAuthResponse.success(token, tokenSecret); } if (callback != null) { callback.onError(); } return OAuthResponse.error("Aborted"); }
Source:
<code>int expiryQueueSize() { <START> log.warn("The expiry queueSize attribute is deprecated and will be removed"); <END> return expiryQueueSize.get(); }</code><technical_language>@diegolovison warning logged setting queue size, reading it. This is I in mind: <LINK_0></technical_language>

Target:
int expiryQueueSize() { return expiryQueueSize.get(); }
Source:
<code>public String getWindowTitle() { <START> return "DataCloud Sign In"; <END> }</code><technical_language>Wording wise I more sense formulate like: "Sign in DataCloud"</technical_language>

Target:
public String getWindowTitle() { return "Sign in to DataCloud"; }
Source:
<code>public void uniqueCorrelationIDs() throws MuleException { CoreEvent firstEvent = getEventBuilder().message(of("first")).build(); CoreEvent secondEvent = getEventBuilder().message(of("second")).build(); assertThat("Duplicated correlationID", firstEvent.getContext().getCorrelationId(), <START> not(Is.is(secondEvent.getContext().getCorrelationId()))); <END> }</code><technical_language>static import for is</technical_language>

Target:
public void uniqueCorrelationIDs() throws MuleException { CoreEvent firstEvent = getEventBuilder().message(of("first")).build(); CoreEvent secondEvent = getEventBuilder().message(of("second")).build(); assertThat("Duplicated correlationID", firstEvent.getContext().getCorrelationId(), not(is(secondEvent.getContext().getCorrelationId()))); }
Source:
<code>private static void migrate(MigrateCommand command, WritePType writeType, boolean deleteSource, FileSystem fileSystem) throws Exception { String source = command.getSource(); String destination = command.getDestination(); LOG.debug("Migrating to {}", source, destination); if (deleteSource && writeType.equals(WritePType.ASYNC_THROUGH)) { if (fileSystem.getStatus(new AlluxioURI(source)).isPersisted()) { <START> writeType = WritePType.THROUGH; <END> } } CreateFilePOptions createOptions = CreateFilePOptions.newBuilder().setWriteType(writeType).build(); OpenFilePOptions openFileOptions = OpenFilePOptions.newBuilder().setReadType(ReadPType.NO_CACHE).build(); try (FileOutStream out = fileSystem.createFile(new AlluxioURI(destination), createOptions); FileInStream in = fileSystem.openFile(new AlluxioURI(source), openFileOptions)) { try { IOUtils.copyLarge(in, out, new byte[8 * Constants.MB]); } catch (Throwable t) { try { out.cancel(); } catch (Throwable t2) { t.addSuppressed(t2); } throw t; } } if (deleteSource) { fileSystem.delete(new AlluxioURI(source), DeletePOptions.newBuilder().setUnchecked(true).build()); } }</code><technical_language>This means CACHE. Is want</technical_language>

Target:
private static void migrate(MigrateCommand command, WritePType writeType, boolean deleteSource, FileSystem fileSystem) throws Exception { String source = command.getSource(); String destination = command.getDestination(); LOG.debug("Migrating to {}", source, destination); if (deleteSource && writeType.equals(WritePType.ASYNC_THROUGH)) { if (fileSystem.getStatus(new AlluxioURI(source)).isPersisted()) { writeType = WritePType.CACHE_THROUGH; } } CreateFilePOptions createOptions = CreateFilePOptions.newBuilder().setWriteType(writeType).build(); OpenFilePOptions openFileOptions = OpenFilePOptions.newBuilder().setReadType(ReadPType.NO_CACHE).build(); try (FileOutStream out = fileSystem.createFile(new AlluxioURI(destination), createOptions); FileInStream in = fileSystem.openFile(new AlluxioURI(source), openFileOptions)) { try { IOUtils.copyLarge(in, out, new byte[8 * Constants.MB]); } catch (Throwable t) { try { out.cancel(); } catch (Throwable t2) { t.addSuppressed(t2); } throw t; } } if (deleteSource) { fileSystem.delete(new AlluxioURI(source), DeletePOptions.newBuilder().setUnchecked(true).build()); } }
Source:
<code>public CustomProcessorInfo removeCustomProcessorInfoAsBundle(String name) throws IOException { List<QueryParam> queryParams = new ArrayList<>(); queryParams.add(new QueryParam(CustomProcessorInfo.NAME, name)); Collection<TopologyComponentBundle> result = this.listCustomProcessorBundlesWithFilter(queryParams); if (result.isEmpty() || result.size() != 1) { throw new IOException("Failed to delete custom processor with name:" + name); } TopologyComponentBundle customProcessorBundle = result.iterator().next(); Collection<TopologyProcessor> processors = this.listTopologyProcessors(); if (processors != null && !processors.isEmpty()) { for (TopologyProcessor topologyProcessor: processors) { if (topologyProcessor.getTopologyComponentBundleId().equals(customProcessorBundle.getId())) { throw new IOException("Cannot delete custom processor as it is being used in one of the topologies."); } } } CustomProcessorInfo customProcessorInfo = new CustomProcessorInfo(); this.removeTopologyComponentBundle(customProcessorBundle.getId()); <START> return customProcessorInfo.fromTopologyComponentBundle(customProcessorBundle); <END> }</code><technical_language>this created instance is else where? new CustomProcessorInfo().fromTopologyComponentBundle(customProcessorBundle);</technical_language>

Target:
public CustomProcessorInfo removeCustomProcessorInfoAsBundle(String name) throws IOException { List<QueryParam> queryParams = new ArrayList<>(); queryParams.add(new QueryParam(CustomProcessorInfo.NAME, name)); Collection<TopologyComponentBundle> result = this.listCustomProcessorBundlesWithFilter(queryParams); if (result.isEmpty() || result.size() != 1) { throw new IOException("Failed to delete custom processor with name:" + name); } TopologyComponentBundle customProcessorBundle = result.iterator().next(); Collection<TopologyProcessor> processors = this.listTopologyProcessors(); if (processors != null && !processors.isEmpty()) { for (TopologyProcessor topologyProcessor: processors) { if (topologyProcessor.getTopologyComponentBundleId().equals(customProcessorBundle.getId())) { throw new IOException("Cannot delete custom processor as it is being used in one of the topologies."); } } } this.removeTopologyComponentBundle(customProcessorBundle.getId()); return new CustomProcessorInfo().fromTopologyComponentBundle(customProcessorBundle); }
Source:
<code>public DataSet createDataset(DataSetDTO dataset, String name, Integer userId) { Date date = new Date(); long time = date.getTime(); <START> Timestamp now = new Timestamp(time); <END> int lastAlias = dataSetDAO.findLastAlias(); int alias = lastAlias + 1; Integer id = dataSetDAO .insertDatasetV2(name, now, userId, dataset.getObjectId(), dataset.getActive(), alias); List<DataSetProperty> propertyList = processDatasetProperties(id, dataset.getProperties()); dataSetDAO.insertDataSetsProperties(propertyList); return getDatasetWithPropertiesById(id); }</code><technical_language>This a liner if need access date time again. Timestamp = new Timestamp(new Date().getTime());</technical_language>

Target:
public DataSet createDataset(DataSetDTO dataset, String name, Integer userId) { Timestamp now = new Timestamp(new Date().getTime()); int lastAlias = dataSetDAO.findLastAlias(); int alias = lastAlias + 1; Integer id = dataSetDAO .insertDatasetV2(name, now, userId, dataset.getObjectId(), dataset.getActive(), alias); List<DataSetProperty> propertyList = processDatasetProperties(id, dataset.getProperties()); dataSetDAO.insertDataSetsProperties(propertyList); return getDatasetWithPropertiesById(id); }
Source:
<code><START> protected boolean isExceedSize(long sizeToCheck) { <END> if (overallHregionFiles) { long sumSize = 0; for (HStore store : region.getStores()) { sumSize += store.getSize(); } if (sumSize > sizeToCheck) { LOG.debug("ShouldSplit because region size is big enough " + "size={}, sizeToCheck={}{}", StringUtils.humanSize(sumSize), StringUtils.humanSize(sizeToCheck)); return true; } } else { for (HStore store : region.getStores()) { long size = store.getSize(); if (size > sizeToCheck) { LOG.debug("ShouldSplit because size={}, sizeToCheck={}{}", store.getColumnFamilyName(), StringUtils.humanSize(size), StringUtils.humanSize(sizeToCheck)); return true; } } } return false; }</code><technical_language>this method final? I is called classes, overridden</technical_language>

Target:
protected final boolean isExceedSize(long sizeToCheck) { if (overallHRegionFiles) { long sumSize = 0; for (HStore store : region.getStores()) { sumSize += store.getSize(); } if (sumSize > sizeToCheck) { LOG.debug("ShouldSplit because region size is big enough " + "size={}, sizeToCheck={}{}", StringUtils.humanSize(sumSize), StringUtils.humanSize(sizeToCheck)); return true; } } else { for (HStore store : region.getStores()) { long size = store.getSize(); if (size > sizeToCheck) { LOG.debug("ShouldSplit because size={}, sizeToCheck={}{}", store.getColumnFamilyName(), StringUtils.humanSize(size), StringUtils.humanSize(sizeToCheck)); return true; } } } return false; }
Source:
<code>protected String scheduleJob() throws Exception { if (schedule.getExecutionTime() != null) { Time convertedTime = GlusterUtil.getInstance() .convertTime(schedule.getExecutionTime(), schedule.getTimeZone()); schedule.setExecutionTime(convertedTime); } Date convertedStartDate = getGlusterUtil().convertDate(schedule.getStartDate(), schedule.getTimeZone()); Date convertedEndByDate = getGlusterUtil().convertDate(schedule.getEndByDate(), schedule.getTimeZone()); String cronExpression = GlusterUtil.getInstance().getCronExpression(schedule); if (cronExpression == null) throw new <START> Exception("Unbale to <END> form cron expression for schedule. Invalid scheduling details."); return getDbSchedulUtil().scheduleACronJob(new GlusterSnapshotScheduleJob(), "onTimer", new Class[] { String.class, String.class, String.class, String.class, Boolean.class }, new Object[] { upServer.getId().toString(), getGlusterVolumeId().toString(), schedule.getSnapshotNamePrefix(), schedule.getSnapshotDescription(), force }, cronExpression, convertedStartDate, convertedEndByDate); }</code><technical_language>typo</technical_language>

Target:
protected String scheduleJob() { if (schedule.getExecutionTime() != null) { Time convertedTime = GlusterUtil.getInstance() .convertTime(schedule.getExecutionTime(), schedule.getTimeZone()); schedule.setExecutionTime(convertedTime); } Date convertedStartDate = getGlusterUtil().convertDate(schedule.getStartDate(), schedule.getTimeZone()); Date convertedEndByDate = getGlusterUtil().convertDate(schedule.getEndByDate(), schedule.getTimeZone()); String cronExpression = GlusterUtil.getInstance().getCronExpression(schedule); if (cronExpression == null) throw new RuntimeException("Unable to form cron expression for schedule. Invalid scheduling details."); return getDbSchedulUtil().scheduleACronJob(new GlusterSnapshotScheduleJob(), "onTimer", new Class[] { String.class, String.class, String.class, String.class, Boolean.class }, new Object[] { upServer.getId().toString(), getGlusterVolumeId().toString(), schedule.getSnapshotNamePrefix(), schedule.getSnapshotDescription(), force }, cronExpression, convertedStartDate, convertedEndByDate); }
Source:
<code>private SocketProtocol negotiateProtocol() throws IOException { logger.debug( "[HANDSHAKE] [1, 0, 0, 0]." ); ByteBuffer buf = ByteBuffer.wrap( new byte[]{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} ); while ( buf.remaining() > 0 ) { channel.write( buf ); logger.trace( "C: " + BytePrinter.hex( buf ) ); } buf.clear(); buf.limit( 4 ); while ( buf.remaining() > 0 ) { int start = buf.position(); channel.read( buf ); <START> logger.trace( "S: " + BytePrinter.hex( buf, start, buf.position() ) ); <END> } buf.flip(); final int proposal = buf.getInt(); switch ( proposal ) { case 1: logger.debug( "[HANDSHAKE] 1" ); return new SocketProtocolV1( channel, logger ); case 0: throw new ClientException( "The server does not support any of the protocol versions supported by " + "this driver. Ensure that you are using driver and server versions that " + "are compatible with one another." ); default: throw new ClientException( "Protocol error, server suggested unexpected protocol version: " + proposal ); } }</code><technical_language>do this - this convert bit of buffer a string, if trace is off, a big performance overhead. suggest do this Input/Output streams - introduce classes implement WritableByteChannel/ReadableByteChannel, wrap regular channels. Then, create real channels, do like: if( logger.isTraceEnabled() ) { input = new LoggingInputChannel( logger, input ); output = new LoggingOutputChannel( logger, output ); } way, intermingle log statements rest of code, zero overhead if trace logging is enabled</technical_language>

Target:
private SocketProtocol negotiateProtocol() throws IOException { logger.debug( "~~ [HANDSHAKE] [1, 0, 0, 0]." ); ByteBuffer buf = ByteBuffer.wrap( new byte[]{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} ); channel.write( buf ); buf.clear(); buf.limit( 4 ); channel.read( buf ); buf.flip(); final int proposal = buf.getInt(); switch ( proposal ) { case 1: logger.debug( "~~ [HANDSHAKE] 1" ); return new SocketProtocolV1( channel ); case 0: throw new ClientException( "The server does not support any of the protocol versions supported by " + "this driver. Ensure that you are using driver and server versions that " + "are compatible with one another." ); default: throw new ClientException( "Protocol error, server suggested unexpected protocol version: " + proposal ); } }
Source:
<code>static ChannelStateByteBuffer wrap(byte[] bytes) { <START> int written = 0; <END> return new ChannelStateByteBuffer() { @Override public boolean isWritable() { return written < bytes.length; } @Override public int writableBytes() { return bytes.length - written; } @Override public int writeBytes(InputStream input, int bytesToRead) throws IOException { return input.read(bytes, written, writableBytes()); } }; }</code><technical_language>redundant for defining this variable</technical_language>

Target:
static ChannelStateByteBuffer wrap(byte[] bytes) { return new ChannelStateByteBuffer() { private int written = 0; @Override public boolean isWritable() { return written < bytes.length; } @Override public int writeBytes(InputStream input, int bytesToRead) throws IOException { final int bytesRead = input.read(bytes, written, bytes.length - written); written += bytesRead; return bytesRead; } }; }
Source:
<code>LocalDateTime extractExpiryDate(Map<String, String> args, ZoneId effectiveTimeZone) { LocalDateTime expiry = null; if (args.containsKey(HttpHeaders.EXPIRES.toLowerCase())) { expiry = extractV2ExpiryDate(args, effectiveTimeZone); } else if (args.containsKey(SignerConstants.X_AMZ_EXPIRES.toLowerCase()) && (args.containsKey(SignerConstants.X_AMZ_DATE.toLowerCase()))) { expiry = extractV4ExpiryDate(args, effectiveTimeZone); } else { log.error("Could not identify expected date parameters in request: {}", flattenMap(args)); throw new IllegalArgumentException( String.format("Could not parse presigned URL - missing expected expiry date parameters")); } <START> System.out.printf("Expiry DateTime (Local): %s%n", expiry); <END> return expiry; }</code><technical_language>log debug</technical_language>

Target:
LocalDateTime extractExpiryDate(Map<String, String> args, ZoneId effectiveTimeZone) { LocalDateTime expiry = null; if (args.containsKey(HttpHeaders.EXPIRES.toLowerCase())) { expiry = extractV2ExpiryDate(args, effectiveTimeZone); } else if (args.containsKey(SignerConstants.X_AMZ_EXPIRES.toLowerCase()) && (args.containsKey(SignerConstants.X_AMZ_DATE.toLowerCase()))) { expiry = extractV4ExpiryDate(args, effectiveTimeZone); } else { log.error("Could not identify expected date parameters in request: {}", flattenMap(args)); throw new IllegalArgumentException("Could not parse presigned URL - missing expected expiry date parameters"); } log.debug("Expiry DateTime (Local): {}\n", expiry); return expiry; }
Source:
<code>public static File writeOffsetFile(File storeBaseDir, String storeName, TaskName taskName, Map<SystemStreamPartition, String> offsets) throws IOException { File offsetFile = new File(getStorePartitionDir(storeBaseDir, storeName, taskName), OFFSET_FILE_NAME); String fileContents = OBJECT_WRITER.writeValueAsString(offsets); FileUtil.writeWithChecksum(offsetFile, fileContents); <START> return offsetFile; <END> }</code><technical_language>this return file</technical_language>

Target:
public static void writeOffsetFile(File storeBaseDir, String storeName, TaskName taskName, Map<SystemStreamPartition, String> offsets) throws IOException { File offsetFile = new File(getStorePartitionDir(storeBaseDir, storeName, taskName), OFFSET_FILE_NAME); String fileContents = OBJECT_WRITER.writeValueAsString(offsets); FileUtil.writeWithChecksum(offsetFile, fileContents); }
Source:
<code>protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length > 0 && (args[0].contains("rem") || args[0].contains("off") || args[0].equalsIgnoreCase("0"))) { final PlayerInventory inv = user.getBase().getInventory(); final ItemStack head = inv.getHelmet(); if (head == null || head.getType() == Material.AIR) { user.sendMessage(tl("hatEmpty")); } else { final ItemStack air = new ItemStack(Material.AIR); inv.setHelmet(air); InventoryWorkaround.addItems(user.getBase().getInventory(), head); user.sendMessage(tl("hatRemoved")); } } else { final ItemStack hand = user.getItemInHand(); if (hand != null && hand.getType() != Material.AIR) { <START> if (user.isAuthorized("essentials.hat.exempt." + hand.getType().name())) { <END> user.sendMessage(tl("hatFail")); return; } if (hand.getType().getMaxDurability() == 0) { final PlayerInventory inv = user.getBase().getInventory(); final ItemStack head = inv.getHelmet(); inv.setHelmet(hand); inv.setItemInHand(head); user.sendMessage(tl("hatPlaced")); } else { user.sendMessage(tl("hatArmor")); } } else { user.sendMessage(tl("hatFail")); } } }</code><technical_language>toLowerCase material name</technical_language>

Target:
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length > 0 && (args[0].contains("rem") || args[0].contains("off") || args[0].equalsIgnoreCase("0"))) { final PlayerInventory inv = user.getBase().getInventory(); final ItemStack head = inv.getHelmet(); if (head == null || head.getType() == Material.AIR) { user.sendMessage(tl("hatEmpty")); } else { final ItemStack air = new ItemStack(Material.AIR); inv.setHelmet(air); InventoryWorkaround.addItems(user.getBase().getInventory(), head); user.sendMessage(tl("hatRemoved")); } } else { final ItemStack hand = user.getItemInHand(); if (hand != null && hand.getType() != Material.AIR) { if (user.isAuthorized("essentials.hat.prevent-type." + hand.getType().name().toLowerCase())) { user.sendMessage(tl("hatFail")); return; } if (hand.getType().getMaxDurability() == 0) { final PlayerInventory inv = user.getBase().getInventory(); final ItemStack head = inv.getHelmet(); inv.setHelmet(hand); inv.setItemInHand(head); user.sendMessage(tl("hatPlaced")); } else { user.sendMessage(tl("hatArmor")); } } else { user.sendMessage(tl("hatFail")); } } }
Source:
<code>private static boolean isLookExist(String lookName) { try { String selectedLook = lookSettings.getString(lookName); SettingBundle look = ResourceLocator.getSettingBundle(selectedLook); return look.exists(); <START> } catch (MissingResourceException e) { <END> return false; } }</code><technical_language>exception is caught, is expected of behaviors: - log exception (in this case: SilverLogger.error("Look named '"+lookName+" found", e), exception e logged end of error method) - rethrow exception throw another exception this rules need applied, add exception this rule for incriminated code in SonarQube. For case, in order determine handle that, method isLookExist is called a name argument, name exist in settings</technical_language>

Target:
private static boolean isLookExist(String lookName) { try { String selectedLook = lookSettings.getString(lookName); SettingBundle look = ResourceLocator.getSettingBundle(selectedLook); return look.exists(); } catch (MissingResourceException e) { SilverLogger.getLogger(GraphicElementFactory.class) .warn("Look named '"+lookName+" not found", e); return false; } }
Source:
<code>protected void updateParametersVmFromInstanceType() { InstanceType instanceType = getInstanceType(); VmStatic vmStatic = getParameters().getVmStaticData(); <START> if (instanceType != null && vmStatic != null) { <END> vmStatic.setMemSizeMb(instanceType.getMemSizeMb()); vmStatic.setNumOfSockets(instanceType.getNumOfSockets()); vmStatic.setCpuPerSocket(instanceType.getCpuPerSocket()); vmStatic.setDefaultBootSequence(instanceType.getDefaultBootSequence()); vmStatic.setDefaultDisplayType(instanceType.getDefaultDisplayType()); vmStatic.setPriority(instanceType.getPriority()); vmStatic.setMinAllocatedMem(instanceType.getMinAllocatedMem()); vmStatic.setTunnelMigration(instanceType.getTunnelMigration()); getParameters().setSoundDeviceEnabled(!VmDeviceUtils.getSoundDevices(instanceType.getId()).isEmpty()); getParameters().setVirtioScsiEnabled(!VmDeviceUtils.getVirtioScsiControllers(instanceType.getId()).isEmpty()); getParameters().setUpdateWatchdog(true); List<VmDevice> vmDevices = VmDeviceUtils.getWatchdogs(instanceType.getId()); if (!vmDevices.isEmpty()) { vmDevices.get(0).setVmId(getVmId()); getParameters().setWatchdog(new VmWatchdog(vmDevices.get(0))); } getParameters().setUpdateRngDevice(true); vmDevices = getVmDeviceDao().getVmDeviceByVmIdAndType(instanceType.getId(), VmDeviceGeneralType.RNG); if (!vmDevices.isEmpty()) { vmDevices.get(0).setVmId(getVmId()); getParameters().setRngDevice(new VmRngDevice(vmDevices.get(0))); } } }</code><technical_language>removing setInstanceTypeId(..) (and class member maybe) drop part (vmStatic != null)</technical_language>

Target:
protected void updateParametersVmFromInstanceType() { InstanceType instanceType = getInstanceType(); VmStatic vmStatic = getParameters().getVmStaticData(); if (instanceType != null) { vmStatic.setMemSizeMb(instanceType.getMemSizeMb()); vmStatic.setNumOfSockets(instanceType.getNumOfSockets()); vmStatic.setCpuPerSocket(instanceType.getCpuPerSocket()); vmStatic.setDefaultBootSequence(instanceType.getDefaultBootSequence()); vmStatic.setDefaultDisplayType(instanceType.getDefaultDisplayType()); vmStatic.setPriority(instanceType.getPriority()); vmStatic.setMinAllocatedMem(instanceType.getMinAllocatedMem()); vmStatic.setTunnelMigration(instanceType.getTunnelMigration()); getParameters().setSoundDeviceEnabled(!VmDeviceUtils.getSoundDevices(instanceType.getId()).isEmpty()); getParameters().setVirtioScsiEnabled(!VmDeviceUtils.getVirtioScsiControllers(instanceType.getId()).isEmpty()); getParameters().setUpdateWatchdog(true); List<VmDevice> vmDevices = VmDeviceUtils.getWatchdogs(instanceType.getId()); if (!vmDevices.isEmpty()) { vmDevices.get(0).setVmId(getVmId()); getParameters().setWatchdog(new VmWatchdog(vmDevices.get(0))); } getParameters().setUpdateRngDevice(true); vmDevices = getVmDeviceDao().getVmDeviceByVmIdAndType(instanceType.getId(), VmDeviceGeneralType.RNG); if (!vmDevices.isEmpty()) { vmDevices.get(0).setVmId(getVmId()); getParameters().setRngDevice(new VmRngDevice(vmDevices.get(0))); } } }
Source:
<code>public static Collection<CidrAddress> getAllInterfaceAddresses() { Collection<CidrAddress> interfaceIPs = new ArrayList<>(); Enumeration<NetworkInterface> en; try { en = NetworkInterface.getNetworkInterfaces(); } catch (SocketException ex) { LOGGER.error("Could not find interface IP addresses: {}", ex.getMessage(), ex); return interfaceIPs; } while (en.hasMoreElements()) { NetworkInterface networkInterface = en.nextElement(); try { if (!networkInterface.isUp() || networkInterface.isLoopback()) { continue; } } catch (SocketException ignored) { continue; } for (InterfaceAddress cidr : networkInterface.getInterfaceAddresses()) { <START> interfaceIPs.add(new CidrAddress(cidr.getAddress(), cidr.getNetworkPrefixLength())); <END> } } return interfaceIPs; }</code><technical_language>remote @SuppressWarnings("null") for method implementation e.g. Java final InetAddress address = cidr.getAddress(); assert address != null; // NetworkInterface.getInterfaceAddresses() return non-null addresses interfaceIPs.add(new CidrAddress(address, cidr.getNetworkPrefixLength())); WDYT? I a friend of supress warnings for function. assert change runtime default deactivated</technical_language>

Target:
public static Collection<CidrAddress> getAllInterfaceAddresses() { Collection<CidrAddress> interfaceIPs = new ArrayList<>(); Enumeration<NetworkInterface> en; try { en = NetworkInterface.getNetworkInterfaces(); } catch (SocketException ex) { LOGGER.error("Could not find interface IP addresses: {}", ex.getMessage(), ex); return interfaceIPs; } while (en.hasMoreElements()) { NetworkInterface networkInterface = en.nextElement(); try { if (!networkInterface.isUp() || networkInterface.isLoopback()) { continue; } } catch (SocketException ignored) { continue; } for (InterfaceAddress cidr : networkInterface.getInterfaceAddresses()) { final InetAddress address = cidr.getAddress(); assert address != null; interfaceIPs.add(new CidrAddress(address, cidr.getNetworkPrefixLength())); } } return interfaceIPs; }
Source:
<code>public String getFirstIndexForAlias(String aliasName) { ImmutableOpenMap<String, List<AliasMetaData>> aliases = client.admin().indices().prepareGetAliases(aliasName).get().getAliases(); for(Iterator<String> it = aliases.keysIt(); it.hasNext(); ) { String indexName = it.next(); <START> if (aliases.get(indexName).isEmpty()) { <END> continue; } return indexName; } return null; }</code><technical_language>stream api a return line</technical_language>

Target:
public String getFirstIndexForAlias(String aliasName) { ImmutableOpenMap<String, List<AliasMetaData>> aliases = client.admin() .indices() .prepareGetAliases(aliasName) .get() .getAliases(); for (Iterator<String> it = aliases.keysIt(); it.hasNext();) { String indexName = it.next(); if (!aliases.get(indexName).isEmpty()) { return indexName; } } return null; }
Source:
<code>private void syncFromStorage() { giant.lock(); try { if (active) { final List<Task> newTasks = taskStorage.getActiveTasks(); <START> List<Task> addedTasks = Lists.newArrayList(Sets.difference(Sets.newHashSet(newTasks), Sets.newHashSet(tasks))); <END> List<Task> removedTasks = Lists.newArrayList(Sets.difference(Sets.newHashSet(tasks), Sets.newHashSet(newTasks))); for(Task task : removedTasks){ shutdown(task.getId()); } for(Task task : addedTasks){ addTaskInternal(task); } log.info( "Synced %d tasks from storage (%d tasks added, %d tasks removed).", newTasks.size(), addedTasks.size(), removedTasks.size() ); managementMayBeNecessary.signalAll(); } else { log.info("Not active. Skipping storage sync."); } } catch (Exception e) { log.warn(e, "Failed to sync tasks from storage!"); throw Throwables.propagate(e); } finally { giant.unlock(); } }</code><technical_language>need do difference taskId instead of task object well, Task a proper hash equals</technical_language>

Target:
private void syncFromStorage() { giant.lock(); try { if (active) { final Map<String,Task> newTasks = toTaskIDMap(taskStorage.getActiveTasks()); final int tasksSynced = newTasks.size(); final Map<String,Task> oldTasks = toTaskIDMap(tasks); Set<String> commonIds = Sets.newHashSet(Sets.intersection(newTasks.keySet(), oldTasks.keySet())); for(String taskID : commonIds){ newTasks.remove(taskID); oldTasks.remove(taskID); } Collection<Task> addedTasks = newTasks.values(); Collection<Task> removedTasks = oldTasks.values(); for(Task task : removedTasks){ removeTaskInternal(task); } for(Task task : addedTasks){ addTaskInternal(task); } log.info( "Synced %d tasks from storage (%d tasks added, %d tasks removed).", tasksSynced, addedTasks.size(), removedTasks.size() ); managementMayBeNecessary.signalAll(); } else { log.info("Not active. Skipping storage sync."); } } catch (Exception e) { log.warn(e, "Failed to sync tasks from storage!"); throw Throwables.propagate(e); } finally { giant.unlock(); } }
Source:
<code>private void edit(ListModel model, final boolean topTableIsEdited) { EntityModelCellTable<ListModel> table = getTable(topTableIsEdited); IEventListener listener = topTableIsEdited ? topItemsChangedListener : bottomItemsChangedListener; if (listener != null) { table.asEditor().flush().getItemsChangedEvent().removeListener(listener); } listener = new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { getSelectionModel(topTableIsEdited).clear(); } }; <START> if (topTableIsEdited) { <END> topItemsChangedListener = listener; } else { bottomItemsChangedListener = listener; } model.getItemsChangedEvent().addListener(listener); table.asEditor().edit(model); }</code><technical_language>simpler/nicer create static listeners in advance accordingly</technical_language>

Target:
private void edit(ListModel model, final boolean topTableIsEdited) { EntityModelCellTable<ListModel> table = getTable(topTableIsEdited); IEventListener listener = topTableIsEdited ? topItemsChangedListener : bottomItemsChangedListener; if (listener != null) { table.asEditor().flush().getItemsChangedEvent().removeListener(listener); } model.getItemsChangedEvent().addListener(listener); table.asEditor().edit(model); }
Source:
<code>public void shouldGenerateIdentifiers() throws Exception { <START> MockHttpServletRequest getRequest = newGetRequest(getURI()); <END> getRequest.addParameter("generateIdentifiers", "true"); getRequest.addParameter("comment", "new seq ids"); getRequest.addParameter("numberToGenerate", "5"); getRequest.addParameter("sourceUuid", SEQUENTIAL_IDENTIFIER_SOURCE_UUID); SimpleObject getResult = deserialize(handle(getRequest)); System.out.println(getResult); assertEquals("[G-0, H-8, I-5, J-3, K-1]", getResult.toString()); }</code><technical_language>a GET request generate identifiers</technical_language>

Target:
public void shouldGenerateIdentifiers() throws Exception { String generateIdentifiers = "{"+ "\"generateIdentifiers\": \"true\"," + "\"comment\": \"new seq ids\"," + "\"numberToGenerate\": \"5\"," + "\"sourceUuid\": \""+SEQUENTIAL_IDENTIFIER_SOURCE_UUID+"\"" + "}"; MockHttpServletRequest getRequest = newPostRequest(getURI(), generateIdentifiers); SimpleObject getResult = deserialize(handle(getRequest)); assertEquals("[G-0, H-8, I-5, J-3, K-1]", getResult.get("identifiers").toString()); }