auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public PollResponse<T> waitUntil(LongRunningOperationStatus statusToWaitFor) { <START> if (statusToWaitFor == null) { <END> throw logger.logExceptionAsWarning(new IllegalArgumentException("Null value for status is not allowed.")); } PollingContext<T> currentTerminalPollContext = this.terminalPollContext; if (currentTerminalPollContext != null && currentTerminalPollContext.getLatestResponse().getStatus() == statusToWaitFor) { return currentTerminalPollContext.getLatestResponse(); } else { PollingContext<T> context = this.pollingContext.clone(); AsyncPollResponse<T, U> asyncPollResponse = pollingLoop(context) .takeUntil(apr -> matchStatus(apr, statusToWaitFor)) .last() .switchIfEmpty(Mono.error(new NoSuchElementException("Polling completed without receiving the given" + "status '" + statusToWaitFor + "'."))) .block(); PollResponse<T> response = toPollResponse(asyncPollResponse); if (response.getStatus().isComplete()) { this.terminalPollContext = context; } return response; } }</code><technical_language>Objects.requireNonNull() instead</technical_language>

Target:
public PollResponse<T> waitUntil(LongRunningOperationStatus statusToWaitFor) { Objects.requireNonNull(statusToWaitFor, "'statusToWaitFor' cannot be null."); PollingContext<T> currentTerminalPollContext = this.terminalPollContext; if (currentTerminalPollContext != null && currentTerminalPollContext.getLatestResponse().getStatus() == statusToWaitFor) { return currentTerminalPollContext.getLatestResponse(); } else { PollingContext<T> context = this.pollingContext.copy(); AsyncPollResponse<T, U> asyncPollResponse = pollingLoop(context) .takeUntil(apr -> matchStatus(apr, statusToWaitFor)) .last() .switchIfEmpty(Mono.error(new NoSuchElementException("Polling completed without receiving the given" + "status '" + statusToWaitFor + "'."))) .block(); PollResponse<T> response = toPollResponse(asyncPollResponse); if (response.getStatus().isComplete()) { this.terminalPollContext = context; } return response; } }
Source:
<code>public static Deployment.ProvisioningState provisioningStateFromString(final String text) { if (text != null) { for (Deployment.ProvisioningState status : Deployment.ProvisioningState.values()) { if (text.equalsIgnoreCase(status.name())) { return status; } } <START> } <END> return Deployment.ProvisioningState.UNRECOGNIZED; }</code><technical_language>existing GetEnumValue helper</technical_language>

Target:
public static Deployment.ProvisioningState provisioningStateFromString(final String text) { return (Deployment.ProvisioningState) GetEnumValue.fromValueOrDefault(text, Deployment.ProvisioningState.UNRECOGNIZED); }
Source:
<code><START> String getBucketName(URI uri) <END> { if (uri.getHost() != null) { return uri.getHost(); } else if (uri.getUserInfo() == null) { return uri.getAuthority(); } throw new IllegalArgumentException("Unable to determine S3 bucket from URI."); }</code><technical_language>mark this method private this is in this class</technical_language>

Target:
public static String getBucketName(URI uri) { if (uri.getHost() != null) { return uri.getHost(); } if (uri.getUserInfo() == null) { return uri.getAuthority(); } throw new IllegalArgumentException("Unable to determine S3 bucket from URI."); }
Source:
<code>public void onClickCourseInfo(String pathId) { <START> if(pathId!=null && !pathId.isEmpty()){ <END> logger.debug("PathId" +pathId); Router.getInstance().showCourseInfo(this, pathId); } }</code><technical_language>create a StringUtil class provide String empty check</technical_language>

Target:
public void onClickCourseInfo(String pathId) { if(!StringUtil.isStringEmpty(pathId)){ logger.debug("PathId" +pathId); Router.getInstance().showCourseInfo(this, pathId); } }
Source:
<code>protected static boolean indexLimitReached(Index index, Map<String, Object> existingIndexes) { if (index.indexType.equalsIgnoreCase(Index.TEXT_TYPE)) { for (String name : existingIndexes.keySet()) { Map<String, Object> existingIndex = (Map<String, Object>) existingIndexes.get(name); String type = (String) existingIndex.get("type"); <START> if (type.equalsIgnoreCase("text") && !name.equalsIgnoreCase(index.indexName)) { <END> String msg = String.format("The text index %s already exists.", name); logger.log(Level.SEVERE, msg); return true; } } } return false; }</code><technical_language>Do need "text" constant</technical_language>

Target:
protected static boolean indexLimitReached(Index index, Map<String, Object> existingIndexes) { if (index.indexType.equalsIgnoreCase(Index.TEXT_TYPE)) { for (String name : existingIndexes.keySet()) { Map<String, Object> existingIndex = (Map<String, Object>) existingIndexes.get(name); String type = (String) existingIndex.get("type"); if (type.equalsIgnoreCase(Index.TEXT_TYPE) && !name.equalsIgnoreCase(index.indexName)) { logger.log(Level.SEVERE, String.format("The text index %s already exists. ", name) + "One text index per datastore permitted. " + String.format("Delete %s and recreate %s.", name, index.indexName)); return true; } } } return false; }
Source:
<code>synchronized GoConfigHolder forceLoad() throws Exception { File configFile = goConfigFileReader.fileLocation(); CruiseConfig cruiseConfig = this.magicalGoConfigXmlLoader.deserializeConfig(goConfigFileReader.configXml()); <START> if (LOGGER.isDebugEnabled()) { <END> LOGGER.debug(String.format("Reloading config file: %s",configFile.getAbsolutePath())); } GoConfigHolder goConfigHolder; try { try { goConfigHolder = fullConfigSaveNormalFlow.execute(new FullConfigUpdateCommand(cruiseConfig, null), cachedGoPartials.lastKnownPartials(), FILESYSTEM); } catch (GoConfigInvalidException e) { if (!canUpdateConfigWithLastValidPartials()) throw e; goConfigHolder = fullConfigSaveNormalFlow.execute(new FullConfigUpdateCommand(cruiseConfig, null), cachedGoPartials.lastValidPartials(), FILESYSTEM); } reloadStrategy.latestState(goConfigHolder.config); return goConfigHolder; } catch (Exception e) { LOGGER.error(String.format("Unable to load config file: %s %s", configFile.getAbsolutePath(), e.getMessage()), e); if (configFile.exists()) { LOGGER.warn(String.format("--- %s ---", configFile.getAbsolutePath())); LOGGER.warn(FileUtil.readContentFromFile(configFile)); LOGGER.warn("------"); } LOGGER.debug(e); throw e; } }</code><technical_language>move this slf4j logger</technical_language>

Target:
synchronized GoConfigHolder forceLoad() throws Exception { File configFile = goConfigFileReader.fileLocation(); CruiseConfig cruiseConfig = this.magicalGoConfigXmlLoader.deserializeConfig(goConfigFileReader.configXml()); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Reloading config file: {}", configFile.getAbsolutePath()); } GoConfigHolder goConfigHolder; try { try { goConfigHolder = fullConfigSaveNormalFlow.execute(new FullConfigUpdateCommand(cruiseConfig, null), cachedGoPartials.lastKnownPartials(), FILESYSTEM); } catch (GoConfigInvalidException e) { if (!canUpdateConfigWithLastValidPartials()) throw e; goConfigHolder = fullConfigSaveNormalFlow.execute(new FullConfigUpdateCommand(cruiseConfig, null), cachedGoPartials.lastValidPartials(), FILESYSTEM); } reloadStrategy.latestState(goConfigHolder.config); return goConfigHolder; } catch (Exception e) { LOGGER.error("Unable to load config file: {}", configFile.getAbsolutePath(), e.getMessage(), e); if (configFile.exists()) { LOGGER.warn("--- ---", configFile.getAbsolutePath()); LOGGER.warn(FileUtil.readContentFromFile(configFile)); LOGGER.warn("------"); } LOGGER.debug("", e); throw e; } }
Source:
<code>private String translateRequest(@Nonnull final HttpServletRequest request) throws JsonProcessingException { final String text = request.getParameter(CONTENT_LABEL); final Map<String, String> params = new HashMap<>(); <START> params.put(TEXT_LABEL, StringUtils.isNotBlank(text) ? text : StringUtils.EMPTY); <END> return MAPPER.writeValueAsString(params); }</code><technical_language>StringUtils.defaultIfBlank(text, StringUtils.EMPTY)</technical_language>

Target:
private String translateRequest(@Nonnull final HttpServletRequest request) throws JsonProcessingException { final String text = request.getParameter(CONTENT_LABEL); final Map<String, String> params = new HashMap<>(); params.put(TEXT_LABEL, StringUtils.defaultIfBlank(text, StringUtils.EMPTY)); return MAPPER.writeValueAsString(params); }
Source:
<code>protected List<ExecutionStatus> getFilteredItems() { ProcessStatusTracker tracker = GeoServerApplication.get().getBeanOfType(ProcessStatusTracker.class); ProcessStatusStore store = tracker.getStore(); Query query = new Query("status", getFilter()); if (count > 0) { query.setStartIndex((int) first); query.setMaxFeatures((int) count); } SortParam sort = getSort(); if (sort != null) { SortByImpl[] sortBys = new SortByImpl[1]; final Property<?> property = getProperty(sort); if (property.isSearchable()) { <START> sortBys[0] = new SortByImpl(FF.property(property.getName()), SortOrder.ASCENDING); <END> FF.sort(property.getName(), SortOrder.ASCENDING); if (!sort.isAscending()) { sortBys[0].setSortOrder(SortOrder.DESCENDING); } query.setSortBy(sortBys); } } LOGGER.fine("built query " + query + " to filter statuses"); return store.list(query); }</code><technical_language>fix assign sortBy[0] result of invocation below, assigned anything, instead of creating manually a specific implementation of SortBy</technical_language>

Target:
protected List<ExecutionStatus> getFilteredItems() { ProcessStatusTracker tracker = GeoServerApplication.get().getBeanOfType(ProcessStatusTracker.class); ProcessStatusStore store = tracker.getStore(); Query query = new Query("status", getFilter()); if (count > 0) { query.setStartIndex((int) first); query.setMaxFeatures((int) count); } final SortParam sort = getSort(); SortBy sortOrder = null; if (sort != null) { final Property<?> property = getProperty(sort); if (property.isSearchable()) { final String sortProperty = ((BeanProperty<StoreInfo>) property).getPropertyPath(); sortOrder = sortBy(sortProperty, sort.isAscending()); query.setSortBy(new SortBy[] {sortOrder}); } } LOGGER.fine("built query " + query + " to filter statuses"); return store.list(query); }
Source:
<code>private String[] superTypes(ObjectType cmisType) { if (cmisType.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) { <START> return new String[] {"nt:folder"}; <END> } if (cmisType.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) { return new String[] {"nt:file"}; } return new String[]{cmisType.getParentType().getLocalName()}; }</code><technical_language>java return new String[]{JcrConstants.NT_FOLDER};</technical_language>

Target:
private String[] superTypes(ObjectType cmisType) { if (cmisType.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) { return new String[] {JcrConstants.NT_FOLDER}; } if (cmisType.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) { return new String[] {JcrConstants.NT_FILE}; } return new String[]{cmisType.getParentType().getId()}; }
Source:
<code>public boolean runTest() { Display display = mContext.getWindowManager().getDefaultDisplay(); <START> boolean passing = checkEqualsAndLog(R.string.tv_hdr_display_is_hdr, true, display.isHdr()); <END> passing &= hasExpectedHdrSupportedTypes(display); passing &= hasSaneLuminanceValues(display); return passing; }</code><technical_language>isHdr(display)? hide logging for readability</technical_language>

Target:
public void runTest() { Display display = mContext.getWindowManager().getDefaultDisplay(); getAsserter() .withFailureMessage("Display.isHdr()") .that(display.isHdr()) .isTrue(); Display.HdrCapabilities hdrCapabilities = display.getHdrCapabilities(); int[] supportedHdrTypes = hdrCapabilities.getSupportedHdrTypes(); Arrays.sort(supportedHdrTypes); getAsserter() .withFailureMessage("Display.getHdrCapabilities().getSupportedTypes()") .that(supportedHdrTypes) .isEqualTo(EXPECTED_SUPPORTED_HDR_TYPES_SORTED); float maxLuminance = hdrCapabilities.getDesiredMaxLuminance(); float maxAvgLuminance = hdrCapabilities.getDesiredMaxAverageLuminance(); float minLuminance = hdrCapabilities.getDesiredMinLuminance(); getAsserter() .withFailureMessage("Display.getHdrCapabilities().getDesiredMaxLuminance()") .that(maxLuminance) .isIn(Range.openClosed(0f, MAX_EXPECTED_LUMINANCE)); getAsserter() .withFailureMessage( "Display.getHdrCapabilities().getDesiredMaxAverageLuminance()") .that(maxLuminance) .isIn(Range.openClosed(0f, MAX_EXPECTED_LUMINANCE)); getAsserter() .withFailureMessage("MaxAvgLuminance is between min and max") .that(maxAvgLuminance) .isIn(Range.openClosed(minLuminance, maxLuminance)); }
Source:
<code>double <START> getMillisAtPercentile(double <END> percentile) { return current.getValueAtPercentile(percentile) / TimeValue.NSEC_PER_MSEC; }</code><technical_language>current Histogram threadsafe own, synchronization is needed here</technical_language>

Target:
synchronized double getMillisAtPercentile(double percentile) { return current.getValueAtPercentile(percentile) / TimeValue.NSEC_PER_MSEC; }
Source:
<code>public void serializationOrderTest() throws IOException { Project project = new Project("project"); Group apache = new Group("Apache", "test.*"); Group bsd = new Group("BSD", "test.*"); Group opensource = new Group("OpenSource", "test.*"); opensource.addGroup(apache); opensource.addGroup(bsd); bsd.addProject(project); opensource.addProject(project); project.getGroups().add(opensource); project.getGroups().add(bsd); Configuration cfg = new Configuration(); Configuration oldCfg = cfg; cfg.addGroup(apache); cfg.addGroup(bsd); cfg.addGroup(opensource); ByteArrayOutputStream out = new ByteArrayOutputStream(); try (XMLEncoder enc = new XMLEncoder(out)) { enc.writeObject(cfg); } final LinkedList<Exception> exceptions = new LinkedList<>(); try (ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); XMLDecoder dec = new XMLDecoder(in, null, (Exception e) -> { exceptions.addLast(e); })) { cfg = (Configuration) dec.readObject(); assertNotNull(cfg); <START> dec.close(); <END> if (!exceptions.isEmpty()) { AssertionFailedError afe = new AssertionFailedError( "Got " + exceptions.size() + " exception(s)"); afe.initCause(exceptions.getFirst()); throw afe; } assertEquals(oldCfg.getGroups(), cfg.getGroups()); } }</code><technical_language>is this necessary try-with-resources</technical_language>

Target:
public void serializationOrderTest() throws IOException { Project project = new Project("project"); Group apache = new Group("Apache", "test.*"); Group bsd = new Group("BSD", "test.*"); Group opensource = new Group("OpenSource", "test.*"); opensource.addGroup(apache); opensource.addGroup(bsd); bsd.addProject(project); opensource.addProject(project); project.getGroups().add(opensource); project.getGroups().add(bsd); Configuration cfg = new Configuration(); Configuration oldCfg = cfg; cfg.addGroup(apache); cfg.addGroup(bsd); cfg.addGroup(opensource); ByteArrayOutputStream out = new ByteArrayOutputStream(); try (XMLEncoder enc = new XMLEncoder(out)) { enc.writeObject(cfg); } final LinkedList<Exception> exceptions = new LinkedList<>(); try (ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); XMLDecoder dec = new XMLDecoder(in, null, (Exception e) -> { exceptions.addLast(e); })) { cfg = (Configuration) dec.readObject(); assertNotNull(cfg); if (!exceptions.isEmpty()) { AssertionFailedError afe = new AssertionFailedError( "Got " + exceptions.size() + " exception(s)"); afe.initCause(exceptions.getFirst()); throw afe; } assertEquals(oldCfg.getGroups(), cfg.getGroups()); } }
Source:
<code>private static boolean isValid(@Nullable Object element) { if (element instanceof ITmfTrimmableTrace) { return true; } if (!(element instanceof ITmfTrace)) { return false; } ITmfTrace trace = (ITmfTrace) element; List<ITmfEventProvider> children = trace.getChildren(); if (children.isEmpty()) { return false; } for (ITmfEventProvider child : children) { if (!isValid(child)) { <START> return false; <END> } } return true; }</code><technical_language>refuse trimming if trace is non-trimmable, get subset of trimmable traces for operation... allowed if is trimmable? get !getValid().isEmpty()..</technical_language>

Target:
private static boolean isValid(@Nullable Object element) { if (element instanceof ITmfTrimmableTrace) { return true; } if (!(element instanceof ITmfTrace)) { return false; } ITmfTrace trace = (ITmfTrace) element; if (trace.getChildren().isEmpty()) { return false; } for (ITmfEventProvider child : trace.getChildren()) { if (!isValid(child)) { return false; } } return true; }
Source:
<code>private boolean doesLogExists(JobIdentifier jobIdentifier) { <START> return consoleService.doesLogExists(jobIdentifier); <END> }</code><technical_language>Replace occurrences of consoleService.consoleLogFile(jobIdentifier).exists() above</technical_language>

Target:
private boolean doesLogExists(JobIdentifier jobIdentifier) { return consoleService.doesLogExist(jobIdentifier); }
Source:
<code>public void testHelixNotifier() throws Exception { notifier.subscribe(refTopics.get(0), listeners.get(0)); latch0.set(new CountDownLatch(1)); notifier.sendMessage(refTopics.get(0), refMessages.get(0)); <START> awaitLatchOrTimeout(latch0.get(), latchTimeoutMs); <END> assertEquals("Received topic is different from expected", refTopics.get(0), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(0), receivedMessagesByListener0.get(0)); resetTopicListeners(); latch0.set(new CountDownLatch(1)); notifier.sendMessage(refTopics.get(0), refMessages.get(1)); awaitLatchOrTimeout(latch0.get(), latchTimeoutMs); assertEquals("Received topic is different from expected", refTopics.get(0), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(1), receivedMessagesByListener0.get(0)); resetTopicListeners(); notifier.subscribe(refTopics.get(1), listeners.get(0)); latch0.set(new CountDownLatch(1)); notifier.sendMessage(refTopics.get(1), refMessages.get(0)); awaitLatchOrTimeout(latch0.get(), latchTimeoutMs); assertEquals("Received topic is different from expected", refTopics.get(1), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(0), receivedMessagesByListener0.get(0)); }</code><technical_language>Do sense ensure a notification in once? countDownLatch.countDown() throw error if count is zero</technical_language>

Target:
public void testHelixNotifier() throws Exception { notifier.subscribe(refTopics.get(0), listeners.get(0)); latch0.set(new CountDownLatch(1)); notifier.publish(refTopics.get(0), refMessages.get(0)); awaitLatchOrTimeout(latch0.get(), LATCH_TIMEOUT_MS); assertEquals("Received topic is different from expected", refTopics.get(0), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(0), receivedMessagesByListener0.get(0)); resetListeners(); latch0.set(new CountDownLatch(1)); notifier.publish(refTopics.get(0), refMessages.get(1)); awaitLatchOrTimeout(latch0.get(), LATCH_TIMEOUT_MS); assertEquals("Received topic is different from expected", refTopics.get(0), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(1), receivedMessagesByListener0.get(0)); resetListeners(); notifier.subscribe(refTopics.get(1), listeners.get(0)); latch0.set(new CountDownLatch(1)); notifier.publish(refTopics.get(1), refMessages.get(0)); awaitLatchOrTimeout(latch0.get(), LATCH_TIMEOUT_MS); assertEquals("Received topic is different from expected", refTopics.get(1), receivedTopicsByListener0.get(0)); assertEquals("Received message is different from expected", refMessages.get(0), receivedMessagesByListener0.get(0)); }
Source:
<code>public Map<String, CassandraHttpSession> findByIndexNameAndIndexValue(String indexName, String indexValue) { Select select = QueryBuilder.select("id") .from("session_by_name"); select.where(QueryBuilder.eq("principal_name", indexValue)); List<UUID> uuids = this.template.queryForList(select, UUID.class); Map<String, CassandraHttpSession> result = new HashMap<String, CassandraHttpSession>(); <START> for (UUID id : uuids) { <END> CassandraHttpSession session = getSession(id.toString()); if (session != null) { result.put(id.toString(), getSession(id.toString())); } } return result; }</code><technical_language>batch loading for multiple UUIDs</technical_language>

Target:
public Map<String, CassandraHttpSession> findByIndexNameAndIndexValue(String indexName, String indexValue) { Select select = QueryBuilder.select("id") .from(this.getIndexTableName()); select.where(QueryBuilder.eq("principal_name", indexValue)); select.setConsistencyLevel(this.consistencyLevel); List<UUID> uuids = this.cassandraOperations.queryForList(select, UUID.class); Map<String, CassandraHttpSession> result = new HashMap<String, CassandraHttpSession>(); for (UUID id : uuids) { CassandraHttpSession session = getSession(id.toString()); if (session != null) { result.put(id.toString(), getSession(id.toString())); } } return result; }
Source:
<code>public Map<Object, Object> getPatientProgramAttributeByAttributeName(List<Integer> patientIds, String attributeName) { Map<Object, Object> patientProgramAttributes = new HashMap<>(); if (patientIds.isEmpty() || attributeName == null) { return patientProgramAttributes; } String commaSeperatedPatientIds = StringUtils.join(patientIds, ","); List list = sessionFactory.getCurrentSession().createSQLQuery( "SELECT p.patient_id as person_id, " + " concat('{',group_concat(DISTINCT (coalesce(concat('\"',ppt.name,'\":\"', COALESCE (cn.name, ppa.value_reference),'\"'))) SEPARATOR ','),'}') AS patientProgramAttributeValue " + " from patient p " + " join patient_program pp on p.patient_id = pp.patient_id and p.patient_id in (" + commaSeperatedPatientIds + ")" + " join patient_program_attribute ppa on pp.patient_program_id = ppa.patient_program_id and ppa.voided=0" + <START> " join program_attribute_type ppt on ppa.attribute_type_id = ppt.program_attribute_type_id and ppt.name ='" + attributeName + "'"+ <END> " and ppt.datatype like '%ConceptDataType%' LEFT OUTER JOIN concept_name cn on ppa.value_reference = cn.concept_id and cn.concept_name_type= 'FULLY_SPECIFIED' and cn.voided=0" + " group by p.patient_id") .addScalar("person_id", StandardBasicTypes.INTEGER) .addScalar("patientProgramAttributeValue", StandardBasicTypes.STRING) .list(); for (Object o : list) { Object[] arr = (Object[]) o; patientProgramAttributes.put(arr[0], arr[1]); } return patientProgramAttributes; }</code><technical_language>@akshay-jha making this new change</technical_language>

Target:
public Map<Object, Object> getPatientProgramAttributeByAttributeName(List<Integer> patientIds, String attributeName) { Map<Object, Object> patientProgramAttributes = new HashMap<>(); if (patientIds.isEmpty() || attributeName == null) { return patientProgramAttributes; } List list = sessionFactory.getCurrentSession().createSQLQuery( "SELECT p.patient_id as person_id, " + " concat('{',group_concat(DISTINCT (coalesce(concat('\"',ppt.name,'\":\"', COALESCE (cn.name, ppa.value_reference),'\"'))) SEPARATOR ','),'}') AS patientProgramAttributeValue " + " from patient p " + " join patient_program pp on p.patient_id = pp.patient_id and p.patient_id in (:patientIds)" + " join patient_program_attribute ppa on pp.patient_program_id = ppa.patient_program_id and ppa.voided=0" + " join program_attribute_type ppt on ppa.attribute_type_id = ppt.program_attribute_type_id and ppt.name = :attributeName"+ " and ppt.datatype like '%ConceptDataType%' LEFT OUTER JOIN concept_name cn on ppa.value_reference = cn.concept_id and cn.concept_name_type= 'FULLY_SPECIFIED' and cn.voided=0" + " group by p.patient_id") .addScalar("person_id", StandardBasicTypes.INTEGER) .addScalar("patientProgramAttributeValue", StandardBasicTypes.STRING) .setParameter("attributeName", attributeName) .setParameterList("patientIds", patientIds) .list(); for (Object o : list) { Object[] arr = (Object[]) o; patientProgramAttributes.put(arr[0], arr[1]); } return patientProgramAttributes; }
Source:
<code>public EAttribute[] getImagePathAttributes() { <START> EAttribute[] attrs = {DescriptionPackage.eINSTANCE.getViewpoint_Icon(), DescriptionPackage.eINSTANCE.getDecorationDescription_DecoratorPath(), StylePackage.eINSTANCE.getBasicLabelStyleDescription_IconPath(), ToolPackage.eINSTANCE.getMenuItemDescription_Icon(), ToolPackage.eINSTANCE.getPaneBasedSelectionWizardDescription_IconPath(), ToolPackage.eINSTANCE.getPaneBasedSelectionWizardDescription_WindowImagePath(), ToolPackage.eINSTANCE.getSelectionWizardDescription_IconPath(), ToolPackage.eINSTANCE.getSelectionWizardDescription_WindowImagePath(), ToolPackage.eINSTANCE.getToolDescription_IconPath()}; <END> return attrs; }</code><technical_language>remark for other concrete class: this is constant defined in a "private static final" field</technical_language>

Target:
public EAttribute[] getImagePathAttributes() { return attrs; }
Source:
<code><START> public EventEmittingStepExecutionListener(MessageChannel output,int order) { <END> Assert.notNull(output, "An output channel is required"); this.messagePublisher = new MessagePublisher<>(output); this.order = order; }</code><technical_language>formatting: space comma. i.e. , int order</technical_language>

Target:
public EventEmittingStepExecutionListener(MessageChannel output, int order) { this(output); this.order = order; }
Source:
<code>public AccountAttributes build() { <START> return accountAttributes; <END> }</code><technical_language>I validateRequiredFields build method? me, Builder validate fields in step (This written in Effective Java)</technical_language>

Target:
public AccountAttributes build() { accountAttributes.googleId = SanitizationHelper.sanitizeGoogleId(accountAttributes.googleId); accountAttributes.name = SanitizationHelper.sanitizeName(accountAttributes.name); accountAttributes.email = SanitizationHelper.sanitizeEmail(accountAttributes.email); accountAttributes.institute = SanitizationHelper.sanitizeTitle(accountAttributes.institute); if (accountAttributes.studentProfile != null) { accountAttributes.studentProfile.sanitizeForSaving(); } return accountAttributes; }
Source:
<code>public void setLeftX(double x) { <START> double value = x * (xLeftInverted ? -1 : 1); <END> this.x = value; setRawAxis(0, value); }</code><technical_language>thinking inverting values passed in</technical_language>

Target:
public void setLeftX(double x) { leftJoystickAxis.x = x; }
Source:
<code>public void testLoadNewTemplateFile() throws Exception { CountDownLatch loadTemplate = new CountDownLatch(2); configureTemplateManager(loadTemplate, null); String expected = "<html><body>Hello John</body></html>"; Map<String, Object> parameters = new HashMap<>(); parameters.put("Name", "John"); String rendered = templateManager.render("basic-email", parameters); assertEquals(expected, rendered); String advancedTemplate = "<html><body>Hello ${Name}, welcome!</body></html>"; String expectedAdvanced = "<html><body>Hello John, welcome!</body></html>"; <START> <END> Thread.sleep(3000); Files.write(new File(templateDir, "advanced-email.html").toPath(), advancedTemplate.getBytes()); loadTemplate.await(); rendered = templateManager.render("advanced-email", parameters); assertEquals(expectedAdvanced, rendered); }</code><technical_language>I CountDownLatch is for sync of template loading. is this 3 seconds waiting required for</technical_language>

Target:
public void testLoadNewTemplateFile() throws Exception { CountDownLatch loadTemplate = new CountDownLatch(1); configureTemplateManager(loadTemplate, null); String expected = "<html><body>Hello John</body></html>"; Map<String, Object> parameters = new HashMap<>(); parameters.put("Name", "John"); String rendered = templateManager.render("basic-email", parameters); assertEquals(expected, rendered); String advancedTemplate = "<html><body>Hello ${Name}, welcome!</body></html>"; String expectedAdvanced = "<html><body>Hello John, welcome!</body></html>"; Thread.sleep(3000); Files.write(new File(templateDir, "advanced-email.html").toPath(), advancedTemplate.getBytes()); loadTemplate.await(); rendered = templateManager.render("advanced-email", parameters); assertEquals(expectedAdvanced, rendered); }
Source:
<code>public String build(String serverName, String machineName, String workspaceID) { StringJoiner joiner = new StringJoiner("."); if (serverName != null) { <START> joiner.add("server-" + serverName.replace('/', '-')); <END> } if (machineName != null) { joiner.add(machineName); } if (workspaceID != null) { joiner.add(workspaceID); } joiner.add( externalAddress != null ? getWildcardNipDomain(externalAddress) : getWildcardNipDomain(internalAddress)); return joiner.toString(); }</code><technical_language>if multiple dashes happen, is valid host works in single port case</technical_language>

Target:
public String build(String serverName, String machineName, String workspaceID) { StringJoiner joiner = new StringJoiner("."); if (serverName != null) { joiner.add(normalize(serverName)); } if (machineName != null) { joiner.add(normalize(machineName)); } if (workspaceID != null) { joiner.add(normalize(workspaceID)); } joiner.add(wildcardDomain); return joiner.toString(); }
Source:
<code>public Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { Object keys = super.visitKeySetCommand(ctx, command); <START> if (enabled && passivationEnabled && !shouldSkipCacheLoader(command)) { <END> Set<Object> set = loader.loadAllKeys(Collections.emptySet()); Set<Object> union = new HashSet<Object>(set); union.addAll((Set<Object>)keys); return Collections.unmodifiableSet(union); } return keys; }</code><technical_language>@wburns I handle correctly scenario in passivation is disabled. In this case entries in memory a subset of entries disk, I store instead of memory for operations</technical_language>

Target:
public Object visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { Object keys = super.visitKeySetCommand(ctx, command); if (enabled && !shouldSkipCacheLoader(command)) { Set<Object> union = new HashSet<Object>((Set<Object>)keys); union.addAll(loader.loadAllKeys(union)); return Collections.unmodifiableSet(union); } return keys; }
Source:
<code>public BuildDiscarder getBuildDiscarder() { <START> BuildDiscarderProperty prop = getProperty(BuildDiscarderProperty.class); <END> return prop != null ? prop.getStrategy() : logRotator; }</code><technical_language>synchronized</technical_language>

Target:
public synchronized BuildDiscarder getBuildDiscarder() { BuildDiscarderProperty prop = getProperty(BuildDiscarderProperty.class); return prop != null ? prop.getStrategy() : logRotator; }
Source:
<code>private void addHandlers() { isUseFileMask.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { filesMask.setEnabled(event.getValue()); } }); isUseDirectory.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { directory.setEnabled(event.getValue()); selectPathButton.setEnabled(event.getValue()); } }); text.addKeyUpHandler( new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { acceptButton.setEnabled(!text.getValue().isEmpty()); } }); selectPathButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { showSelectPathDialog(); } }); <START> text.addKeyUpHandler( <END> new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { acceptButton.setEnabled(!text.getValue().isEmpty()); if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { if (!text.getValue().isEmpty()) { delegate.search(text.getText()); } } } }); }</code><technical_language>Hello, @hkolvenbach! Thank for PR, I a question. [this method](<LINK_0> change logic of [this method](<LINK_1> instead of adding new handler here</technical_language>

Target:
private void addHandlers() { isUseFileMask.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { filesMask.setEnabled(event.getValue()); } }); isUseDirectory.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { directory.setEnabled(event.getValue()); selectPathButton.setEnabled(event.getValue()); } }); text.addKeyUpHandler( new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { acceptButton.setEnabled(!text.getValue().isEmpty()); } }); selectPathButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { showSelectPathDialog(); } }); }
Source:
<code>public void testJournalScanIOException() throws Exception { File journalDir = createTempDir("bookie", "journal"); Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(journalDir)); File ledgerDir = createTempDir("bookie", "ledger"); Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(ledgerDir)); writeV4Journal(Bookie.getCurrentDirectory(journalDir), 100, "testPasswd".getBytes()); ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setJournalDirName(journalDir.getPath()) .setLedgerDirNames(new String[] { ledgerDir.getPath() }) .setMetadataServiceUri(null); Journal.JournalScanner journalScanner = new DummyJournalScan(); FileChannel fileChannel = PowerMockito.mock(FileChannel.class); PowerMockito.when(fileChannel.position(Mockito.anyLong())) .thenThrow(new IOException()); PowerMockito.mockStatic(JournalChannel.class); PowerMockito.when(JournalChannel.openFileChannel(Mockito.any(RandomAccessFile.class))).thenReturn(fileChannel); Bookie b = new Bookie(conf); for (Journal journal : b.journals) { List<Long> journalIds = journal.listJournalIds(journal.getJournalDirectory(), null); <START> assert journalIds.size() == 1; <END> journal.scanJournal(journalIds.get(0), Long.MAX_VALUE, journalScanner); } }</code><technical_language>assertEquals</technical_language>

Target:
public void testJournalScanIOException() throws Exception { File journalDir = createTempDir("bookie", "journal"); Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(journalDir)); File ledgerDir = createTempDir("bookie", "ledger"); Bookie.checkDirectoryStructure(Bookie.getCurrentDirectory(ledgerDir)); writeV4Journal(Bookie.getCurrentDirectory(journalDir), 100, "testPasswd".getBytes()); ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setJournalDirName(journalDir.getPath()) .setLedgerDirNames(new String[] { ledgerDir.getPath() }) .setMetadataServiceUri(null); Journal.JournalScanner journalScanner = new DummyJournalScan(); FileChannel fileChannel = PowerMockito.mock(FileChannel.class); PowerMockito.when(fileChannel.position(Mockito.anyLong())) .thenThrow(new IOException()); PowerMockito.mockStatic(JournalChannel.class); PowerMockito.when(JournalChannel.openFileChannel(Mockito.any(RandomAccessFile.class))).thenReturn(fileChannel); Bookie b = new Bookie(conf); for (Journal journal : b.journals) { List<Long> journalIds = journal.listJournalIds(journal.getJournalDirectory(), null); assertEquals(journalIds.size(), 1); try { journal.scanJournal(journalIds.get(0), Long.MAX_VALUE, journalScanner); fail("Should not have been able to scan the journal"); } catch (Exception e) { } } b.shutdown(); }
Source:
<code>public void onTraversalStart() { final CachingIndexedFastaSequenceFile referenceReader; final File reference = new File(referenceArguments.getReferenceFileName()); try { referenceReader = new CachingIndexedFastaSequenceFile(reference); } catch (FileNotFoundException e) { throw new UserException.CouldNotReadInputFile(reference, e); <START> } <END> hcEngine = new HaplotypeCallerEngine(hcArgs, getHeaderForReads(), referenceReader); vcfWriter = hcEngine.makeVCFWriter(outputVCF, getHeaderForReads().getSequenceDictionary()); hcEngine.writeHeader(vcfWriter); }</code><technical_language>extract this code a method returning CachingIndexedFastaSequenceFile</technical_language>

Target:
public void onTraversalStart() { final ReferenceSequenceFile referenceReader = getReferenceReader(referenceArguments); hcEngine = new HaplotypeCallerEngine(hcArgs, getHeaderForReads(), referenceReader); final SAMSequenceDictionary sequenceDictionary = getHeaderForReads().getSequenceDictionary(); vcfWriter = hcEngine.makeVCFWriter(outputVCF, sequenceDictionary); hcEngine.writeHeader(vcfWriter, sequenceDictionary); }
Source:
<code>@Override public SecurityContext authenticateNode(ClusterNode node, SecurityCredentials cred) throws IgniteCheckedException { SecurityContext res = secPrc.authenticateNode(node, cred); if (res != null) { Map<String, Object> attrs = new HashMap<>(node.attributes()); attrs.put(ATTR_SECURITY_SUBJECT_ID, res.subject().id()); <START> ((TcpDiscoveryNode)node).setAttributes(attrs); <END> } return res; }</code><technical_language>approach wrong. if ZK discovery SPI ? This trigger class cast exception</technical_language>

Target:
@Override public SecurityContext authenticateNode(ClusterNode node, SecurityCredentials cred) throws IgniteCheckedException { SecurityContext res = secPrc.authenticateNode(node, cred); if (res != null) { Map<String, Object> attrs = new HashMap<>(node.attributes()); attrs.put(ATTR_SECURITY_SUBJECT_ID, res.subject().id()); if (node instanceof IgniteClusterNode) ((IgniteClusterNode)node).setAttributes(attrs); else throw new IgniteCheckedException("Node must implement interface IgniteClusterNode."); } return res; }
Source:
<code>public void testDropsExcessRequests() throws Exception { AsyncSpanObserver asyncObserver = createAsyncObserver(2); asyncObserver.consume(span(1)); asyncObserver.consume(span(2)); asyncObserver.consume(span(3)); verify(observer, never()).consume(any(Span.class)); scheduler.runNextPendingCommand(); verify(observer).consume(span(1)); scheduler.runNextPendingCommand(); verify(observer).consume(span(2)); scheduler.runUntilIdle(); <START> Mockito.verifyNoMoreInteractions(observer); <END> }</code><technical_language>static import match other static imports</technical_language>

Target:
public void testDropsExcessRequests() throws Exception { AsyncSpanObserver asyncObserver = createAsyncObserver(2); asyncObserver.consume(span(1)); asyncObserver.consume(span(2)); asyncObserver.consume(span(3)); verify(observer, never()).consume(any(Span.class)); scheduler.runNextPendingCommand(); verify(observer).consume(span(1)); scheduler.runNextPendingCommand(); verify(observer).consume(span(2)); scheduler.runUntilIdle(); verifyNoMoreInteractions(observer); }
Source:
<code>public void testBucketCount() { String regionName = "testCreateRegion"; gfsh.executeAndAssertThat("create region" + " --name=" + regionName + " --type=PARTITION_PERSISTENT" + " --total-num-buckets=1000").statusIsSuccess(); server1.invoke(() -> createBuckets(regionName)); server2.invoke(() -> createBuckets(regionName)); server3.invoke(() -> createBuckets(regionName)); server4.invoke(() -> createBuckets(regionName)); await().untilAsserted(() -> { final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) + server2.invoke(() -> getBucketsInitialized()) + server3.invoke(() -> getBucketsInitialized()) + server4.invoke(() -> getBucketsInitialized()); assertEquals("Expected bucket count is 1000, and actual count is " + sumOfBuckets, sumOfBuckets, 1000); }); for (int i = 1; i < 4; i++) { gfsh.executeAndAssertThat("create region" + " --name=" + regionName + i + " --type=PARTITION_PERSISTENT" + " --total-num-buckets=1000" + " --colocated-with=" + regionName).statusIsSuccess(); } await().untilAsserted(() -> { final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) + server2.invoke(() -> getBucketsInitialized()) + server3.invoke(() -> getBucketsInitialized()) + server4.invoke(() -> getBucketsInitialized()); <START> assertTrue("Expected bucket count is greather than 3500, and actual count is " + sumOfBuckets, sumOfBuckets > 3500); <END> }); }</code><technical_language>I this change "hides" flakiness. If expecting a deterministic bucket count members, find a wait for condition true assert before</technical_language>

Target:
public void testBucketCount() { String regionName = "testCreateRegion"; gfsh.executeAndAssertThat("create region" + " --name=" + regionName + " --type=PARTITION_PERSISTENT" + " --total-num-buckets=1000").statusIsSuccess(); server1.invoke(() -> createBuckets(regionName)); server2.invoke(() -> createBuckets(regionName)); server3.invoke(() -> createBuckets(regionName)); server4.invoke(() -> createBuckets(regionName)); for (int i = 1; i < 4; i++) { final int index = i; await().untilAsserted(() -> { final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) + server2.invoke(() -> getBucketsInitialized()) + server3.invoke(() -> getBucketsInitialized()) + server4.invoke(() -> getBucketsInitialized()); final int expectedBuckets = index * 1000; assertThat(sumOfBuckets).isEqualTo(expectedBuckets); }); final String tempRegioName = regionName + i; gfsh.executeAndAssertThat("create region" + " --name=" + tempRegioName + " --type=PARTITION_PERSISTENT" + " --total-num-buckets=1000" + " --colocated-with=" + regionName).statusIsSuccess(); server1.invoke(() -> createBuckets(tempRegioName)); server2.invoke(() -> createBuckets(tempRegioName)); server3.invoke(() -> createBuckets(tempRegioName)); server4.invoke(() -> createBuckets(tempRegioName)); } await().untilAsserted(() -> { final int sumOfBuckets = server1.invoke(() -> getBucketsInitialized()) + server2.invoke(() -> getBucketsInitialized()) + server3.invoke(() -> getBucketsInitialized()) + server4.invoke(() -> getBucketsInitialized()); assertThat(sumOfBuckets).isEqualTo(4000); }); }
Source:
<code>private KernelTransaction safeAcquireTransaction() { KernelTransaction transaction = actions.kernelTransaction(); <START> Optional<Status> terminationReason = transaction.getReasonIfTerminated(); <END> if ( terminationReason.isPresent() ) { throw new TransactionTerminatedException( terminationReason.get() ); } return transaction; }</code><technical_language>Checking transaction.isTerminated first, reason if true is faster in happy path</technical_language>

Target:
private KernelTransaction safeAcquireTransaction() { KernelTransaction transaction = actions.kernelTransaction(); if ( transaction.isTerminated() ) { Status terminationReason = transaction.getReasonIfTerminated().orElse( Status.Transaction.Terminated ); throw new TransactionTerminatedException( terminationReason ); } return transaction; }
Source:
<code>protected void sendDmxData() { if (this.thing.getStatus().equals(ThingStatus.ONLINE)) { long now = System.currentTimeMillis(); universe.calculateBuffer(now); for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if (socket.isConnected()) { try { socket.getOutputStream().write(universe.getBuffer()); } catch (IOException e) { <START> logger.debug("Could not send to in {}: ", receiverNode, this.thing.getUID(), e); <END> closeConnection(ThingStatusDetail.COMMUNICATION_ERROR, "could not send DMX data"); return; } } else { closeConnection(ThingStatusDetail.NONE, "reconnect"); return; } } } else { openConnection(); } }</code><technical_language>this is debug logging provide e.getMessage() instead re-add placeholder</technical_language>

Target:
protected void sendDmxData() { if (this.thing.getStatus().equals(ThingStatus.ONLINE)) { long now = System.currentTimeMillis(); universe.calculateBuffer(now); for (IpNode receiverNode : receiverNodes.keySet()) { Socket socket = receiverNodes.get(receiverNode); if (socket.isConnected()) { try { socket.getOutputStream().write(universe.getBuffer()); } catch (IOException e) { logger.debug("Could not send to in {}: {}", receiverNode, this.thing.getUID(), e.getMessage()); closeConnection(ThingStatusDetail.COMMUNICATION_ERROR, "could not send DMX data"); return; } } else { closeConnection(ThingStatusDetail.NONE, "reconnect"); return; } } } else { openConnection(); } }
Source:
<code>char sendIMKeyEvent (int type, long event, char chars) { int index = 0, count = 0, state = 0; long ptr = 0; if (event == 0) { ptr = GTK.gtk_get_current_event (); if (ptr != 0) { int eventType = GDK.gdk_event_get_event_type(ptr); eventType = Control.fixGdkEventTypeValues(eventType); switch (eventType) { case GDK.GDK_KEY_PRESS: case GDK.GDK_KEY_RELEASE: int eventState = new int[1]; GDK.gdk_event_get_state(ptr, eventState); state = eventState[0]; break; default: event = 0; break; } } else { int buffer = new int [1]; GTK.gtk_get_current_event_state (buffer); state = buffer [0]; } } else { ptr = event; } while (index < chars.length) { Event javaEvent = new Event (); if (ptr != 0 && chars.length <= 1) { setKeyState (javaEvent, ptr); } else { setInputState (javaEvent, state); } javaEvent.character = chars [index]; sendEvent (type, javaEvent); if (isDisposed ()) { if (ptr != 0) gdk_event_free (ptr); return null; } if (javaEvent.doit) chars [count++] = chars [index]; index++; } <START> if (ptr != 0) gdk_event_free (ptr); <END> if (count == 0) return null; if (index != count) { char result = new char [count]; System.arraycopy (chars, 0, result, 0, count); return result; } return chars; }</code><technical_language>potentially free event pointer caller. Is this in contract of this method? Other code paths of sendKeyEvent() free event</technical_language>

Target:
char sendIMKeyEvent (int type, long event, char chars) { int index = 0, count = 0, state = 0; long ptr = 0; if (event == 0) { ptr = GTK.gtk_get_current_event (); if (ptr != 0) { int eventType = GDK.gdk_event_get_event_type(ptr); eventType = Control.fixGdkEventTypeValues(eventType); switch (eventType) { case GDK.GDK_KEY_PRESS: case GDK.GDK_KEY_RELEASE: int eventState = new int[1]; GDK.gdk_event_get_state(ptr, eventState); state = eventState[0]; break; default: event = 0; break; } } else { int buffer = new int [1]; GTK.gtk_get_current_event_state (buffer); state = buffer [0]; } } else { ptr = event; } while (index < chars.length) { Event javaEvent = new Event (); if (ptr != 0 && chars.length <= 1) { setKeyState (javaEvent, ptr); } else { setInputState (javaEvent, state); } javaEvent.character = chars [index]; sendEvent (type, javaEvent); if (isDisposed ()) { if (ptr != 0 && ptr != event) gdk_event_free (ptr); return null; } if (javaEvent.doit) chars [count++] = chars [index]; index++; } if (ptr != 0 && ptr != event) gdk_event_free (ptr); if (count == 0) return null; if (index != count) { char result = new char [count]; System.arraycopy (chars, 0, result, 0, count); return result; } return chars; }
Source:
<code>public void initialise() { infoArea = find("infoArea", UIText.class); updateInfoButton = find("updateInfoButton", UIButton.class); Calendar c = Calendar.getInstance(); c.setTimeInMillis(System.currentTimeMillis()); String date = c.get(Calendar.YEAR)+"-"+c.get(Calendar.MONTH)+"-"+c.get(Calendar.DAY_OF_MONTH); String time = c.get(Calendar.HOUR_OF_DAY)+":"+c.get(Calendar.MINUTE)+":"+c.get(Calendar.SECOND); <START> <END> infoArea.setText("Real Time: "+date + " " + time+"\nPress ESC to exit"); if (updateInfoButton != null) { updateInfoButton.subscribe(button -> { Calendar d = Calendar.getInstance(); d.setTimeInMillis(System.currentTimeMillis()); String date2 = d.get(Calendar.YEAR)+"-"+d.get(Calendar.MONTH)+"-"+d.get(Calendar.DAY_OF_MONTH); String time2 = d.get(Calendar.HOUR_OF_DAY)+":"+d.get(Calendar.MINUTE)+":"+d.get(Calendar.SECOND); infoArea.setText("Real Time: "+date2 + " " + time2+"\nPress ESC to exit"); }); } }</code><technical_language>Again, newlines</technical_language>

Target:
public void initialise() { infoArea = find("infoArea", UIText.class); updateInfoButton = find("updateInfoButton", UIButton.class); setInfoAreaText(); if (updateInfoButton != null) { updateInfoButton.subscribe((UIWidget button) -> setInfoAreaText()); } }
Source:
<code>public static boolean isIdentity(ProjectNode projectNode) { for (Map.Entry<Symbol, Expression> entry : projectNode.getAssignments().entrySet()) { Expression expression = entry.getValue(); Symbol symbol = entry.getKey(); if (!(expression instanceof SymbolReference && ((SymbolReference) expression).getName().equals(symbol.getName()))) { return false; } <START> } <END> return true; }</code><technical_language>reuse this function for above</technical_language>

Target:
public static boolean isIdentity(ProjectNode projectNode) { for (Symbol symbol : projectNode.getAssignments().getSymbols()) { if (!isIdentity(projectNode, symbol)) { return false; } } return true; }
Source:
<code><START> public ArrayInterface setString(int index, String value) { <END> return setObject(index, value); }</code><technical_language>I return Array here</technical_language>

Target:
public Array setString(int index, String value) { return setObject(index, value); }