auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public URI resolve(final URI uri, final Sid accountSid) { <END> getHttpConnector(); String restcommAddress = null; if (accountSid != null && daoManager != null) { Sid organizationSid = daoManager.getAccountsDao().getAccount(accountSid).getOrganizationSid(); restcommAddress = daoManager.getOrganizationsDao().getOrganization(organizationSid).getDomainName(); } if (restcommAddress == null || restcommAddress.isEmpty()) { if (RestcommConfiguration.getInstance().getMain().isUseHostnameToResolveRelativeUrls()) { restcommAddress = RestcommConfiguration.getInstance().getMain().getHostname(); if (restcommAddress == null || restcommAddress.isEmpty()) { try { InetAddress addr = DNSUtils.getByName(selectedConnector.getAddress()); restcommAddress = addr.getCanonicalHostName(); } catch (UnknownHostException e) { logger.error("Unable to resolveWithBase: " + selectedConnector + " to hostname: " + e); restcommAddress = selectedConnector.getAddress(); } } } else { restcommAddress = selectedConnector.getAddress(); } } String base = selectedConnector.getScheme() + "://" + restcommAddress + ":" + selectedConnector.getPort(); try { return resolveWithBase(new URI(base), uri); } catch (URISyntaxException e) { throw new IllegalArgumentException("Badly formed URI: " + base, e); } }</code><technical_language>i removed UriUtilsTest, sense cover this method in unit test</technical_language>

Target:
public URI resolve(final URI uri, final Sid accountSid) { getHttpConnector(); String restcommAddress = null; if (accountSid != null && daoManager != null) { Sid organizationSid = daoManager.getAccountsDao().getAccount(accountSid).getOrganizationSid(); restcommAddress = daoManager.getOrganizationsDao().getOrganization(organizationSid).getDomainName(); } if (restcommAddress == null || restcommAddress.isEmpty()) { if (useHostnameToResolve) { restcommAddress = RestcommConfiguration.getInstance().getMain().getHostname(); if (restcommAddress == null || restcommAddress.isEmpty()) { try { InetAddress addr = DNSUtils.getByName(selectedConnector.getAddress()); restcommAddress = addr.getCanonicalHostName(); } catch (UnknownHostException e) { logger.error("Unable to resolveWithBase: " + selectedConnector + " to hostname: " + e); restcommAddress = selectedConnector.getAddress(); } } } else { restcommAddress = selectedConnector.getAddress(); } } String base = selectedConnector.getScheme() + "://" + restcommAddress + ":" + selectedConnector.getPort(); try { return resolveWithBase(new URI(base), uri); } catch (URISyntaxException e) { throw new IllegalArgumentException("Badly formed URI: " + base, e); } }
Source:
<code>public Response toResponse(TooManyRequestsException exception) { <START> return Response.status(429).build(); <END> }</code><technical_language>avoid magic number, HttpStatus.TOO_MANY_REQUESTS_429 here</technical_language>

Target:
public Response toResponse(TooManyRequestsException exception) { return Response.status(HttpStatus.TOO_MANY_REQUESTS_429).build(); }
Source:
<code>protected LevelsClass getListClass() { LevelsClass element = new LevelsClass(); element.fromString(Joiner.on(getSeparator()).join(FluentIterable.from(Arrays.asList( <START> enumType.getEnumConstants())).transform(GET_ACCESS_LEVEL_ENUM_IDENTIFIERS))); <END> return element; }</code><technical_language>element.fromString returns a BaseProperty, change LevelsClass. i guess method returns a new LevelsClass</technical_language>

Target:
protected LevelsClass getListClass() { return new LevelsClass(); }
Source:
<code>public void test() throws Exception { String projectKey = "tsproject"; SonarScanner build = SonarScanner.create() .setProjectKey(projectKey) .setSourceEncoding("UTF-8") .setSourceDirs(".") .setProjectDir(PROJECT_DIR); Tests.setProfile(projectKey, "eslint-based-rules-profile", "ts"); BuildResult result = orchestrator.executeBuild(build); List<Issues.Issue> issuesList = getIssues(projectKey); assertThat(issuesList).hasSize(1); assertThat(issuesList.get(0).getLine()).isEqualTo(2); <START> assertThat(result.getLogsLines(log -> log.contains("Found 1 tsconfig.json files"))).hasSize(1); <END> }</code><technical_language>I file(s)</technical_language>

Target:
public void test() throws Exception { String projectKey = "tsproject"; SonarScanner build = SonarScanner.create() .setProjectKey(projectKey) .setSourceEncoding("UTF-8") .setSourceDirs(".") .setProjectDir(PROJECT_DIR); Tests.setProfile(projectKey, "eslint-based-rules-profile", "ts"); BuildResult result = orchestrator.executeBuild(build); List<Issues.Issue> issuesList = getIssues(projectKey); assertThat(issuesList).hasSize(1); assertThat(issuesList.get(0).getLine()).isEqualTo(2); assertThat(result.getLogsLines(log -> log.contains("Found 1 tsconfig.json file(s)"))).hasSize(1); }
Source:
<code>private void disconnect() { if (zkHelixManager != null) { if (runningTasks.size() > 0) { for (int i = 0; i <= PARTICIPANT_SHUTDOWN_GRACE_RETRIES; i++) { logger.info("Shutting down gracefully [RETRY " + i + "]"); try { Thread.sleep(PARTICIPANT_SHUTDOWN_GRACE_PERIOD); } catch (InterruptedException e) { logger.warn("Waiting for running tasks failed [RETRY " + i + "]", e); } if (runningTasks.size() == 0) { break; } } synchronized (runningTasks) { for (AbstractTask runningTask : runningTasks) { logger.warn("Cancelling task with id: " + runningTask.getTaskId() + " forcefully"); <START> runningTask.cancel(); <END> } } } logger.info("Participant: " + participantName + ", has disconnected from cluster: " + clusterName); zkHelixManager.disconnect(); } }</code><technical_language>Calling cancel method this cancel task. do this task driver</technical_language>

Target:
private void disconnect() { if (zkHelixManager != null) { if (runningTasks.size() > 0) { for (int i = 0; i <= shutdownGraceRetries; i++) { logger.info("Shutting down gracefully [RETRY " + i + "]"); try { Thread.sleep(shutdownGracePeriod); } catch (InterruptedException e) { logger.warn("Waiting for running tasks failed [RETRY " + i + "]", e); } if (runningTasks.size() == 0) { break; } } } logger.info("Participant: " + participantName + ", has disconnected from cluster: " + clusterName); zkHelixManager.disconnect(); } }
Source:
<code>private Map<String, String> getAzureObjectIdMap(Map<String, List<CloudIdentity>> cloudIdentityMapping) { ImmutableMap.Builder<String, String> azureObjectIdMap = ImmutableMap.builder(); cloudIdentityMapping.forEach((key, cloudIdentities) -> { <START> Optional<String> azureObjectId = getOptionalAzureObjectId(cloudIdentities); <END> if (azureObjectId.isPresent()) { azureObjectIdMap.put(key, azureObjectId.get()); } }); return azureObjectIdMap.build(); }</code><technical_language>some log in getOptionalAzureObjectId useful investigate if is desired</technical_language>

Target:
private Map<String, String> getAzureObjectIdMap(Map<String, List<CloudIdentity>> cloudIdentityMapping) { LOGGER.debug("Exracting Azure Object ID mapping from {}", cloudIdentityMapping); ImmutableMap.Builder<String, String> azureObjectIdMap = ImmutableMap.builder(); cloudIdentityMapping.forEach((key, cloudIdentities) -> { Optional<String> azureObjectId = getOptionalAzureObjectId(cloudIdentities); if (azureObjectId.isPresent()) { azureObjectIdMap.put(key, azureObjectId.get()); } }); return azureObjectIdMap.build(); }
Source:
<code>public void testUDPtoHTTP() throws Exception { Axis2BackEndServerController axis2Server = getAxis2Server(); if (axis2Server == null) { fail("Failed to load the Axis2BackEndServerController"); } assertEquals(0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder")); String addUrl = "udp://localhost:9999?contentType=text/xml"; StockQuoteSampleClient client = getStockQuoteClient(); client.placeOrder(addUrl, null, null, "IBM"); <START> Thread.sleep(2000); <END> assertEquals(1, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder")); }</code><technical_language>sleep</technical_language>

Target:
public void testUDPtoHTTP() throws Exception { String trpUrl = "udp://localhost:9999?contentType=text/xml"; StockQuoteSampleClient client = getStockQuoteClient(); SampleClientResult result = client.placeOrder(null, trpUrl, null, "IBM"); assertResponseReceived(result); }
Source:
<code>public void waitForInitialRemoteData_readOnlyFalse_upgradeSchema() { SyncCredentials credentials = SyncCredentials.usernamePassword(UUID.randomUUID().toString(), "password", true); SyncUser user = SyncUser.login(credentials, Constants.AUTH_URL); final SyncConfiguration config = configurationFactory.createSyncConfigurationBuilder(user, Constants.USER_REALM) <START> .waitForInitialRemoteData(false) END> .schema(StringOnly.class) .schemaVersion(2) .build(); assertFalse(config.realmExists()); Realm realm = Realm.getInstance(config); try { assertEquals(0, realm.where(StringOnly.class).count()); } finally { realm.close(); user.logout(); } }</code><technical_language>"readonly" -> "read-only"</technical_language>

Target:
public void waitForInitialRemoteData_readOnlyFalse_upgradeSchema() { SyncCredentials credentials = SyncCredentials.usernamePassword(UUID.randomUUID().toString(), "password", true); SyncUser user = SyncUser.login(credentials, Constants.AUTH_URL); final SyncConfiguration config = configurationFactory.createSyncConfigurationBuilder(user, Constants.USER_REALM) .waitForInitialRemoteData() .schema(StringOnly.class) .schemaVersion(2) .build(); assertFalse(config.realmExists()); Realm realm = Realm.getInstance(config); try { assertEquals(0, realm.where(StringOnly.class).count()); } finally { realm.close(); user.logout(); } }
Source:
<code>private String[] getApiRecordPath() { <START> if (!API_BASEURL.equals(api2BaseUrl)) { <END> return new String[]{"api", "v2"}; } else { return new String[]{}; } }</code><technical_language>This check return false if api2BaseUrl is defined. Instead reading api2BaseUrl getApi2BaseUrl() method</technical_language>

Target:
private String[] getApiRecordPath() { if (!API_BASEURL.equals(getApi2BaseUrl())) { return new String[]{"api", "v2"}; } else { return new String[]{}; } }
Source:
<code>public void assertContainsExactly(AssertionInfo info, CharSequence actual, CharSequence[] values) { doCommonCheckForCharSequence(info, actual, values); List<String> actualAsList = splitCharSequencesToListOfElements(actual); List<String> valuesAsList = splitCharSequencesToListOfElements(values); if (actualAsList.size() != valuesAsList.size()) { throw failures.failure(info, shouldHaveSameSizeAs(actual, actualAsList.size(), valuesAsList.size())); } IterableDiff diff = diff(actualAsList, valuesAsList, comparisonStrategy); if (!diff.differencesFound()) { checkIdenticalElementsAreInSameOrder(info, actualAsList, valuesAsList); return; } <START> <END> throw failures .failure(info, shouldContainExactly(actual, asList(values), diff.missing, diff.unexpected, comparisonStrategy)); }</code><technical_language>algorithm is correct, error reported shouldContainExactly is user friendly shows array of missing/extra characters instead of missing/extra strings. splitting strings chars, loose users grouped chars strings parameters a collection of chars. I show diff missing/extra strings instead, for example java assertThat("Practice perfect!").containsExactly("Prac", "makes ", "!"); show java.lang.AssertionError: Expected: <java.lang.AssertionError: Expecting: <"Practice perfect!"> in order: <["Prac", "makes ", "!"]> elements expected: <["tice ", "perfect"]> > I thought of a nice of give a try</technical_language>

Target:
public void assertContainsExactly(AssertionInfo info, CharSequence actual, CharSequence[] values) { doCommonCheckForCharSequence(info, actual, values); List<String> actualAsList = splitCharSequencesToListOfElements(actual); List<String> valuesAsList = splitCharSequencesToListOfElements(values); IterableDiff diff = diff(actualAsList, valuesAsList, comparisonStrategy); if (!diff.differencesFound()) { checkIdenticalElementsAreInSameOrder(info, actualAsList, valuesAsList); return; } throw failures .failure(info, shouldContainExactly(actual, asList(values), diff.missing, diff.unexpected, comparisonStrategy)); }
Source:
<code>public String process(String markupContent) { StringBuilder processedMarkup = new StringBuilder(markupContent.length()); LocationTrackingReader reader = new LocationTrackingReader(new StringReader(markupContent)); String line; try { line = reader.readLine(); while (line != null) { Matcher matcher = ATTRIBUTE_PATTERN.matcher(line); if (matcher.matches()) { String key = matcher.group(1); String value = matcher.group(2); if (value != null) { value = value.trim(); } attributes.put(key, value); } else { <START> Matcher attrref = ATTRIBUTE_TOKEN_PATTERN.matcher(line); <END> int offset = 0; while (attrref.find()) { String postfix = line.substring(offset, attrref.start()); if (postfix.endsWith("\\")) { processedMarkup.append(postfix.substring(0, postfix.length()-1)); offset = attrref.start(); } else { processedMarkup.append(postfix); String key = attrref.group(1); String value = attributes.get(key); if (value == null) { value = attrref.group(0); } processedMarkup.append(value); offset = attrref.end(); } } if (offset < line.length()) { processedMarkup.append(line.substring(offset)); } processedMarkup.append("\n"); } line = reader.readLine(); } reader.close(); } catch (IOException e) { throw new IllegalStateException(e); } return processedMarkup.toString(); }</code><technical_language>consider renaming attrref for readability (camel-case)</technical_language>

Target:
public String process(String markupContent) { Map<String, String> attributes = new HashMap<String, String>(); StringBuilder processedMarkup = new StringBuilder(markupContent.length()); LocationTrackingReader reader = new LocationTrackingReader(new StringReader(markupContent)); String line; try { line = reader.readLine(); while (line != null) { Matcher matcher = ATTRIBUTE_PATTERN.matcher(line); if (matcher.matches()) { String key = matcher.group(1); String value = matcher.group(2); if (value != null) { value = value.trim(); } attributes.put(key, value); } else { Matcher attrref = ATTRIBUTE_TOKEN_PATTERN.matcher(line); int offset = 0; while (attrref.find()) { String postfix = line.substring(offset, attrref.start()); if (postfix.endsWith("\\")) { processedMarkup.append(postfix.substring(0, postfix.length() - 1)); offset = attrref.start(); } else { processedMarkup.append(postfix); String key = attrref.group(1); String value = attributes.get(key); if (value == null) { value = attrref.group(0); } processedMarkup.append(value); offset = attrref.end(); } } if (offset < line.length()) { processedMarkup.append(line.substring(offset)); } processedMarkup.append("\n"); } line = reader.readLine(); } reader.close(); } catch (IOException e) { throw new IllegalStateException(e); } return processedMarkup.toString(); }
Source:
<code>@Override public void setOnMarkerClickListener(final OnMapMarkerClickListener listener) { googleMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker marker) { AirMapMarker<?> airMarker = markers.get(marker); if (airMarker != null) { listener.onMapMarkerClick(airMarker); } <START> return listener.onMakerClickEventIsHandled(); <END> } }); }</code><technical_language>add a return onMapMarkerClick instead? more idiomatic</technical_language>

Target:
@Override public void setOnMarkerClickListener(final OnMapMarkerClickListener listener) { googleMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker marker) { AirMapMarker<?> airMarker = markers.get(marker); if (airMarker != null) { return listener.onMapMarkerClick(airMarker); } return false; } }); }
Source:
<code>private void addHtmlHeaders(MultivaluedMap<String, Object> headers) { BrowserSecurityHeaders.headerAttributeMap.keySet().forEach(k -> addHeader(k, headers)); <START> if (options != null) { <END> if (options.isAllowAsIframe()) { headers.remove(BrowserSecurityHeaders.X_FRAME_OPTIONS); String value = BrowserSecurityHeaders.ContentSecurityPolicyBuilder.create().frameAncestors(null).build(); headers.putSingle(BrowserSecurityHeaders.CONTENT_SECURITY_POLICY, value); } String allowedFrameSrc = options.getAllowedFrameSrc(); if (allowedFrameSrc != null) { if (BrowserSecurityHeaders.CONTENT_SECURITY_POLICY_DEFAULT.equals(headers.getFirst(BrowserSecurityHeaders.CONTENT_SECURITY_POLICY))) { String value = BrowserSecurityHeaders.ContentSecurityPolicyBuilder.create().frameSrc(allowedFrameSrc).build(); headers.putSingle(BrowserSecurityHeaders.CONTENT_SECURITY_POLICY, value); } } } }</code><technical_language>I guess is expected options set null. obtain options method</technical_language>

Target:
private void addHtmlHeaders(MultivaluedMap<String, Object> headers) { BrowserSecurityHeaders.headerAttributeMap.keySet().forEach(k -> addHeader(k, headers)); if (options != null) { BrowserSecurityHeaders.ContentSecurityPolicyBuilder csp = BrowserSecurityHeaders.ContentSecurityPolicyBuilder.create(); if (options.isAllowAnyFrameAncestor()) { headers.remove(BrowserSecurityHeaders.X_FRAME_OPTIONS); csp.frameAncestors(null); } String allowedFrameSrc = options.getAllowedFrameSrc(); if (allowedFrameSrc != null) { csp.frameSrc(allowedFrameSrc); } if (BrowserSecurityHeaders.CONTENT_SECURITY_POLICY_DEFAULT.equals(headers.getFirst(BrowserSecurityHeaders.CONTENT_SECURITY_POLICY))) { headers.putSingle(BrowserSecurityHeaders.CONTENT_SECURITY_POLICY, csp.build()); } } }
Source:
<code>public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { final int n = walker.getTreeCount(); <START> if (n == 1) END> return true; final int m = walker.getRawMode(dirCacheIndex); for (int i = 0; i < n; i++) if (i != dirCacheIndex && i != workingTreeIndex && (walker.getRawMode(i) != m || !walker.idEqual( dirCacheIndex, i))) return true; if (m == FileMode.MISSING.getBits()) return true; int wm = walker.getRawMode(workingTreeIndex); if (wm == FileMode.MISSING.getBits()) return true; WorkingTreeIterator work = walker.getTree(workingTreeIndex, WorkingTreeIterator.class); DirCacheIterator dircache = walker.getTree(dirCacheIndex, DirCacheIterator.class); if (work.isModified(dircache.getDirCacheEntry(), false, false, false)) return true; return false; }</code><technical_language>I this is possible. If valid values for dirCacheIndex workingTreeIndex, n 2</technical_language>

Target:
public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { final int n = walker.getTreeCount(); final int m = walker.getRawMode(dirCacheIndex); for (int i = 0; i < n; i++) if (i != dirCacheIndex && i != workingTreeIndex && (walker.getRawMode(i) != m || !walker.idEqual( dirCacheIndex, i))) return true; if (m == 0) return true; final int wm = walker.getRawMode(workingTreeIndex); if (wm == 0) return true; WorkingTreeIterator work = walker.getTree(workingTreeIndex, WorkingTreeIterator.class); DirCacheIterator dircache = walker.getTree(dirCacheIndex, DirCacheIterator.class); return work.isModified(dircache.getDirCacheEntry(), false, false); }
Source:
<code>public static Long tryLong(@SqlType("function(T)") TryLongLambda function) { try { return function.apply(); } catch (PrestoException e) { <START> return (Long) tryFunctionExceptionHandler(e); <END> } }</code><technical_language>tryFunctionExceptionHandler return null, return null calling it: tryFunctionExceptionHandler(); return null; do for other function well</technical_language>

Target:
public static Long tryLong(@SqlType("function(T)") TryLongLambda function) { try { return function.apply(); } catch (PrestoException e) { propagateIfUnhandled(e); return null; } }
Source:
<code>public void doesNotHaveMimeType() throws MessagingException{ matcher.init(FakeMatcherConfig.builder() .matcherName("HasMimeType") .condition(NON_MATCHING_MIME_TYPES) .build()); <START> assertEquals(matcher.match(mail), Collections.emptyList()); <END> }</code><technical_language>do this assertJ : assertThat(matcher.match(mail)).isEmpty(); simplify imports</technical_language>

Target:
public void doesNotHaveMimeType() throws MessagingException{ matcher.init(FakeMatcherConfig.builder() .matcherName("HasMimeType") .condition(NON_MATCHING_MIME_TYPES) .build()); assertThat(matcher.match(mail)).isEmpty(); }
Source:
<code>private boolean isCancelActivityEnabled(final String uuid) { ArrayList cancelActivityEnabledClasses = new ArrayList(); cancelActivityEnabledClasses.add(IntermediateSignalEventCatching.class); cancelActivityEnabledClasses.add(IntermediateTimerEvent.class); cancelActivityEnabledClasses.add(IntermediateConditionalEvent.class); cancelActivityEnabledClasses.add(IntermediateMessageEventCatching.class); cancelActivityEnabledClasses.add(IntermediateEscalationEvent.class); AbstractCanvasHandler canvasHandler = (AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(); Node<View<?>, Edge> node = canvasHandler.getGraphIndex().getNode(uuid); if (null != node && null != node.getContent() && node.getContent() instanceof View) { Class intermediateEventClass = ((Node<View<?>, Edge>) node) .getContent() .getDefinition() .getClass(); <START> <END> boolean result = cancelActivityEnabledClasses.contains(intermediateEventClass); return result; } return false; }</code><technical_language>result returned here</technical_language>

Target:
private boolean isCancelActivityEnabled(final String uuid) { AbstractCanvasHandler canvasHandler = (AbstractCanvasHandler) sessionManager.getCurrentSession().getCanvasHandler(); Node<View<?>, Edge> node = canvasHandler.getGraphIndex().getNode(uuid); if (null != node && null != node.getContent() && node.getContent() instanceof View) { Class intermediateEventClass = ((Node<View<?>, Edge>) node) .getContent() .getDefinition() .getClass(); return cancelActivityEnabledClasses.contains(intermediateEventClass); } return false; }
Source:
<code><START> private static String getStringValue(Node node) { <END> return node.getFirstChild().getNodeValue(); }</code><technical_language>If tag is empty NPE here. this impl safer</technical_language>

Target:
private static Optional<String> getStringValue(Node node) { Node firstChild = node.getFirstChild(); if (firstChild == null) { return Optional.empty(); } return Optional.of(firstChild.getNodeValue()); }
Source:
<code>public void init() throws IOException { inited = true; schemaColumns = schema.toArray(); if (fragment != null) { tableStats.setNumBytes(0); tableStats.setNumBlocks(1); } if (schema != null) { for(Column eachColumn: schema.getColumns()) { ColumnStats columnStats = new ColumnStats(eachColumn); tableStats.addColumnStat(columnStats); } } <START> scanFetchSize = Integer.parseInt(meta.getOption("hbase.scanner.fetch,size", "" + DEFAULT_FETCH_SIZE)); <END> if (targets == null) { targets = schema.toArray(); } columnMapping = new ColumnMapping(schema, meta); targetIndexes = new int[targets.length]; int index = 0; for (Column eachTargetColumn: targets) { targetIndexes[index++] = schema.getColumnId(eachTargetColumn.getQualifiedName()); } mappingColumnFamilies = columnMapping.getMappingColumns(); isRowKeyMappings = columnMapping.getIsRowKeyMappings(); isBinaryColumns = columnMapping.getIsBinaryColumns(); isColumnKeys = columnMapping.getIsColumnKeys(); isColumnValues = columnMapping.getIsColumnValues(); rowKeyDelimiter = columnMapping.getRowKeyDelimiter(); rowKeyFieldIndexes = columnMapping.getRowKeyFieldIndexes(); hbaseConf = HBaseStorageManager.getHBaseConfiguration(conf, meta); initScanner(); }</code><technical_language>if hbase.scanner.fetch,size is a constant instead of a string value</technical_language>

Target:
public void init() throws IOException { inited = true; schemaColumns = schema.toArray(); if (fragment != null) { tableStats.setNumBytes(0); tableStats.setNumBlocks(1); } if (schema != null) { for(Column eachColumn: schema.getColumns()) { ColumnStats columnStats = new ColumnStats(eachColumn); tableStats.addColumnStat(columnStats); } } scanFetchSize = Integer.parseInt(meta.getOption(HBaseStorageConstants.META_FETCH_ROWNUM_KEY, "" + DEFAULT_FETCH_SIZE)); if (targets == null) { targets = schema.toArray(); } columnMapping = new ColumnMapping(schema, meta); targetIndexes = new int[targets.length]; int index = 0; for (Column eachTargetColumn: targets) { targetIndexes[index++] = schema.getColumnId(eachTargetColumn.getQualifiedName()); } mappingColumnFamilies = columnMapping.getMappingColumns(); isRowKeyMappings = columnMapping.getIsRowKeyMappings(); isBinaryColumns = columnMapping.getIsBinaryColumns(); isColumnKeys = columnMapping.getIsColumnKeys(); isColumnValues = columnMapping.getIsColumnValues(); rowKeyDelimiter = columnMapping.getRowKeyDelimiter(); rowKeyFieldIndexes = columnMapping.getRowKeyFieldIndexes(); hbaseConf = HBaseStorageManager.getHBaseConfiguration(conf, meta); initScanner(); }
Source:
<code>public void hasNoRestrictionsTest() throws Exception { returnRepo = repository; <START> final SocialActivitiesEvent vsfEvent = new SocialActivitiesEvent(socialUser, <END> "type", new Date()); final SocialActivitiesEvent projectEvent = new SocialActivitiesEvent(socialUser, OrganizationalUnitEventType.NEW_ORGANIZATIONAL_UNIT, new Date()) .withLink("otherName", "otherName", SocialActivitiesEvent.LINK_TYPE.CUSTOM); this.socialEventRepositoryConstraint.init(); assertFalse(this.socialEventRepositoryConstraint.hasRestrictions(vsfEvent)); assertFalse(this.socialEventRepositoryConstraint.hasRestrictions(projectEvent)); }</code><technical_language>@ederign Typo, "vsf" "vfs"</technical_language>

Target:
public void hasNoRestrictionsTest() throws Exception { returnRepo = repository; final SocialActivitiesEvent vfsEvent = new SocialActivitiesEvent(socialUser, "type", new Date()); final SocialActivitiesEvent projectEvent = new SocialActivitiesEvent(socialUser, OrganizationalUnitEventType.NEW_ORGANIZATIONAL_UNIT, new Date()) .withLink("otherName", "otherName", SocialActivitiesEvent.LINK_TYPE.CUSTOM); this.socialEventRepositoryConstraint.init(); assertFalse(this.socialEventRepositoryConstraint.hasRestrictions(vfsEvent)); assertFalse(this.socialEventRepositoryConstraint.hasRestrictions(projectEvent)); }
Source:
<code>void testFailFilterBookByAuthorAddress() throws IOException { JsonNode result = getAsNode("book?filter[book.authors.homeAddress]=main&include=authors"); JsonNode data = result.get("data"); assertEquals(0, data.size(), result.toString()); result = getAsNode( String.format("book?filter[book]=authors.homeAddress=='main'", hemingwayId), <START> HttpStatus.SC_BAD_REQUEST); <END> assertEquals(0, data.size(), result.toString()); }</code><technical_language>this give a bad request tests returns empty data? I suspect RSQL filter is formatted incorrectly</technical_language>

Target:
void testFailFilterBookByAuthorAddress() throws IOException { JsonNode result = getAsNode("book?filter[book.authors.homeAddress]=main&include=authors"); JsonNode data = result.get("data"); assertEquals(0, data.size(), result.toString()); result = getAsNode("book?filter=authors.homeAddress=='main'"); data = result.get("data"); assertEquals(0, data.size(), result.toString()); }
Source:
<code>public int getVersion() { lazyDecoding(); <START> return tbsCert.getVersion() + 1; END> }</code><technical_language>Remove +1, version numbers zero-based, in section 4.1 of <LINK_0></technical_language>

Target:
public int getVersion() { lazyDecoding(); return tbsCert.getVersion(); }
Source:
<code>private AnnotatedConstructor buildAnnotatedConstructorForMapper(Mapper mapper) { List<AnnotationMapperReference> mapperReferencesForConstructor = new ArrayList<AnnotationMapperReference>( mapper.getReferencedMappers().size() ); for ( MapperReference mapperReference : mapper.getReferencedMappers() ) { <START> if ( !mapperReference.isUsed() ) { <END> continue; } mapperReferencesForConstructor.add( (AnnotationMapperReference) mapperReference ); } List<Annotation> mapperReferenceAnnotations = getMapperReferenceAnnotations(); removeDuplicateAnnotations( mapperReferencesForConstructor, mapperReferenceAnnotations ); return new AnnotatedConstructor( mapper.getName(), mapperReferencesForConstructor, mapperReferenceAnnotations, additionalPublicEmptyConstructor() ); }</code><technical_language>java if (mapperReference.isUsed() ) { mapperReferencesForConstructor.add( (AnnotationMapperReference) mapperReference ) }</technical_language>

Target:
private AnnotatedConstructor buildAnnotatedConstructorForMapper(Mapper mapper) { List<AnnotationMapperReference> mapperReferencesForConstructor = new ArrayList<AnnotationMapperReference>( mapper.getReferencedMappers().size() ); for ( MapperReference mapperReference : mapper.getReferencedMappers() ) { if ( mapperReference.isUsed() ) { mapperReferencesForConstructor.add( (AnnotationMapperReference) mapperReference ); } } List<Annotation> mapperReferenceAnnotations = getMapperReferenceAnnotations(); removeDuplicateAnnotations( mapperReferencesForConstructor, mapperReferenceAnnotations ); return new AnnotatedConstructor( mapper.getName(), mapperReferencesForConstructor, mapperReferenceAnnotations, additionalPublicEmptyConstructor() ); }
Source:
<code><START> public MergeStrategyRegistryListener(IExtensionRegistry registry) { <END> strategies = new LinkedHashMap<>(); IConfigurationElement[] elements = registry .getConfigurationElementsFor("org.eclipse.egit.core.mergeStrategy"); loadMergeStrategies(elements); }</code><technical_language>this constructor declared private</technical_language>

Target:
private MergeStrategyRegistryListener(IExtensionRegistry registry) { strategies = new LinkedHashMap<>(); IConfigurationElement[] elements = registry .getConfigurationElementsFor("org.eclipse.egit.core.mergeStrategy"); loadMergeStrategies(elements); }
Source:
<code>protected Image(String id, @Nullable String name, java.util.Set<Link> links, @Nullable Date updated, @Nullable Date created, String tenantId, @Nullable String userId, @Nullable Status status, int progress, int minDisk, int minRam, @Nullable List<BlockDeviceMapping> blockDeviceMapping, @Nullable Resource server, @Nullable Map<String, String> metadata) { super(id, name, links); this.updated = updated; this.created = created; this.tenantId = tenantId; this.userId = userId; this.status = status; this.progress = progress; this.minDisk = minDisk; this.minRam = minRam; <START> this.blockDeviceMapping = blockDeviceMapping; <END> this.server = server; this.metadata = metadata == null ? ImmutableMap.<String, String>of() : ImmutableMap.copyOf(metadata); }</code><technical_language>Init metadata</technical_language>

Target:
protected Image(String id, @Nullable String name, java.util.Set<Link> links, @Nullable Date updated, @Nullable Date created, String tenantId, @Nullable String userId, @Nullable Status status, int progress, int minDisk, int minRam, @Nullable List<BlockDeviceMapping> blockDeviceMapping, @Nullable Resource server, @Nullable Map<String, String> metadata) { super(id, name, links); this.updated = updated; this.created = created; this.tenantId = tenantId; this.userId = userId; this.status = status; this.progress = progress; this.minDisk = minDisk; this.minRam = minRam; this.blockDeviceMapping = blockDeviceMapping == null ? ImmutableList.<BlockDeviceMapping>of() : blockDeviceMapping; this.server = server; this.metadata = metadata == null ? ImmutableMap.<String, String>of() : ImmutableMap.copyOf(metadata); }
Source:
<code>public void testSeparated() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); checkConfig.addAttribute("groups", "java.awt, javax.swing, java.io, java.util"); checkConfig.addAttribute("separated", "true"); <START> checkConfig.addAttribute("separatedStaticGroups", "true"); <END> checkConfig.addAttribute("ordered", "false"); final String[] expected = { "9: " + getCheckMessage(MSG_SEPARATION, "javax.swing.JComponent"), "11: " + getCheckMessage(MSG_SEPARATION, "java.io.File"), "16: " + getCheckMessage(MSG_ORDERING, "javax.swing.WindowConstants.*"), }; verify(checkConfig, getNonCompilablePath("InputImportOrder.java"), expected); }</code><technical_language>@pbludov , please explain this update. "under" is default for option. statics types (no seprations them). defining separatedStaticGroups=true effect in mode. If yes, need mention this in xdoc. If .... please explain</technical_language>

Target:
public void testSeparated() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); checkConfig.addAttribute("groups", "java.awt, javax.swing, java.io, java.util"); checkConfig.addAttribute("separated", "true"); checkConfig.addAttribute("ordered", "false"); final String[] expected = { "9: " + getCheckMessage(MSG_SEPARATION, "javax.swing.JComponent"), "11: " + getCheckMessage(MSG_SEPARATION, "java.io.File"), "16: " + getCheckMessage(MSG_ORDERING, "javax.swing.WindowConstants.*"), }; verify(checkConfig, getNonCompilablePath("InputImportOrder.java"), expected); }
Source:
<code>public int queryReplicationStatus() { if (ClusterRole.ACTIVE == localClusterDescriptor.getRole()) { return Integer.parseInt(logReplicationMetadataManager.getReplicationStatus()); <START> } <END> return Integer.parseInt(logReplicationMetadataManager.getDataConsistentOnStandby()); }</code><technical_language>Pankti, do test</technical_language>

Target:
public Map<String, LogReplicationMetadata.ReplicationStatusVal> queryReplicationStatus() { LogReplicationMetadata.ReplicationStatusVal status; if (ClusterRole.ACTIVE == localClusterDescriptor.getRole()) { return logReplicationMetadataManager.getReplicationRemainingPercent(); } else if (ClusterRole.STANDBY == localClusterDescriptor.getRole()) { return logReplicationMetadataManager.getDataConsistentOnStandby(); } log.error("Received Replication Status Query in Incorrect Role {}.", localClusterDescriptor.getRole()); return null; }
Source:
<code>public void setUp() throws InjectionException { final Configuration conf = Tang.Factory.getTang().newConfigurationBuilder() .bindImplementation(SpanReceiver.class, MockedSpanReceiver.class) .bindImplementation(MemoryStore.class, MemoryStoreImpl.class) <START> .bindNamedParameter(EMEvalId.class, new Integer(0).toString()) <END> .build(); final Injector injector = Tang.Factory.getTang().newInjector(conf); memoryStore = injector.getInstance(MemoryStore.class); }</code><technical_language>String.valueOf(0)</technical_language>

Target:
public void setUp() throws InjectionException { final Configuration conf = Tang.Factory.getTang().newConfigurationBuilder() .bindImplementation(SpanReceiver.class, MockedSpanReceiver.class) .bindImplementation(MemoryStore.class, MemoryStoreImpl.class) .bindNamedParameter(EMEvalId.class, String.valueOf(0)) .build(); final Injector injector = Tang.Factory.getTang().newInjector(conf); memoryStore = injector.getInstance(MemoryStore.class); }
Source:
<code><START> private void assignNewBatch(Collection<AssignableReplica> replicas) { <END> Map<String, Integer> totalPartitionCapacity = new HashMap<>(); for (AssignableReplica replica : replicas) { addToAssignmentRecord(replica, _currentAssignments); if (replica.isReplicaTopState()) { addToAssignmentRecord(replica, _currentTopStateAssignments); } for (Map.Entry<String, Integer> capacity : replica.getCapacity().entrySet()) { totalPartitionCapacity.compute(capacity.getKey(), (k, v) -> (v == null) ? capacity.getValue() : v + capacity.getValue()); } } _totalReplicaAssignmentCount += replicas.size(); for (String key : totalPartitionCapacity.keySet()) { updateCapacityAndUtilization(key, totalPartitionCapacity.get(key)); } }</code><technical_language>Is a deterministic order this set of replicas? this crystal clear stateful systems care order want flexibility assign priority new replicas</technical_language>

Target:
private void assignNewBatch(Collection<AssignableReplica> replicas) { Map<String, Integer> totalPartitionCapacity = new HashMap<>(); for (AssignableReplica replica : replicas) { addToAssignmentRecord(replica, _currentAssignments); if (replica.isReplicaTopState()) { addToAssignmentRecord(replica, _currentTopStateAssignments); } for (Map.Entry<String, Integer> capacity : replica.getCapacity().entrySet()) { totalPartitionCapacity.compute(capacity.getKey(), (key, totalValue) -> (totalValue == null) ? capacity.getValue() : totalValue + capacity.getValue()); } } for (String key : totalPartitionCapacity.keySet()) { updateCapacityAndUtilization(key, totalPartitionCapacity.get(key)); } }
Source:
<code>public List<Tuple> getTuples(EntityKey[] keys, TupleContext tupleContext) { if ( log.isTraceEnabled() ) { <START> log.tracef( "Reading tuple with keys %1$s and context %2$s", Arrays.toString( keys ), tupleContext ); <END> } return super.getTuples( keys, tupleContext ); }</code><technical_language>"tuples"</technical_language>

Target:
public List<Tuple> getTuples(EntityKey[] keys, TupleContext tupleContext) { if ( log.isTraceEnabled() ) { log.tracef( "Reading tuples with keys %1$s and context %2$s", Arrays.toString( keys ), tupleContext ); } return super.getTuples( keys, tupleContext ); }
Source:
<code>public Spanned getAboutText() { Resources res = aboutActivity.getResources(); String appName = res.getString(R.string.app_name); String versionName = BuildConfig.VERSION_NAME; <START> ((TextView)aboutActivity.findViewById(R.id.aboutTextView)).setMovementMethod(LinkMovementMethod.getInstance()); <END> String mergedAboutText = res.getString(R.string.about_text, appName, versionName); return Html.fromHtml(mergedAboutText); }</code><technical_language>able do this data binding</technical_language>

Target:
public Spanned getAboutText() { String appName = resources.getString(R.string.app_name); String versionName = BuildConfig.VERSION_NAME; String mergedAboutText = resources.getString(R.string.about_text, appName, versionName); return Html.fromHtml(mergedAboutText); }
Source:
<code>public void testProcessQuotaBalanceForAccount() { AccountVO accountVO = new AccountVO(); accountVO.setId(2L); accountVO.setDomainId(1L); accountVO.setType(Account.ACCOUNT_TYPE_NORMAL); QuotaUsageVO quotaUsageVO = new QuotaUsageVO(); quotaUsageVO.setAccountId(2L); quotaUsageVO.setStartDate(new Date()); quotaUsageVO.setEndDate(new Date()); List<QuotaUsageVO> quotaListForAccount = new ArrayList<>(); quotaListForAccount.add(quotaUsageVO); quotaManager.processQuotaBalanceForAccount(accountVO, quotaListForAccount); <START> Mockito.verify(quotaAcc, Mockito.times(1)).persistQuotaAccount(Mockito.any(QuotaAccountVO.class)); <END> }</code><technical_language>This test method contains asserts. do verify quota records aggregation is correct simply throwing exception</technical_language>

Target:
public void testProcessQuotaBalanceForAccount() { Date now = new Date(); AccountVO accountVO = new AccountVO(); accountVO.setId(2L); accountVO.setDomainId(1L); accountVO.setType(Account.ACCOUNT_TYPE_NORMAL); QuotaUsageVO quotaUsageVO = new QuotaUsageVO(); quotaUsageVO.setAccountId(2L); quotaUsageVO.setStartDate(new Date(now.getTime())); quotaUsageVO.setEndDate(new Date(now.getTime())); List<QuotaUsageVO> quotaListForAccount = new ArrayList<>(); quotaListForAccount.add(quotaUsageVO); quotaManager.processQuotaBalanceForAccount(accountVO, quotaListForAccount); Mockito.verify(quotaAcc, Mockito.times(1)).persistQuotaAccount(Mockito.any(QuotaAccountVO.class)); }
Source:
<code>public Server start() { mods.loadExternal(mods.getDefaultModLocation()); mods.loadExternal(Paths.get(config.getModsDirectory())); <START> if(mods.getAvailableMods().isEmpty()) { <END> logger.warn("No mods were loaded from the different folders. Please check your installation."); throw new IllegalStateException("No mod loaded"); } try { logger.info("Starting Server..."); server.addConnections(new ServerSock(server, config)); server.addConnections(new ServerWeb(server, config)); logger.info("Starting Console..."); CommandHandler commandHandler = server.getCommandHandler(); initializeCommands(commandHandler); ServerConsole console = new ServerConsole(server, commandHandler); consoleThread = new Thread(console, "Console-Thread"); consoleThread.start(); mods.getAIs().entrySet().forEach(entry -> { ClientIO tcgAI = new FakeAIClientTCG(server, entry.getValue()); server.newClient(tcgAI); server.getIncomingHandler().perform(new LoginMessage("AI " + entry.getKey()), tcgAI); }); final Supplier<ScheduledExecutorService> aiExecutor = () -> server.getScheduler(); mods.getAvailableMods().forEach(name -> server.addGameFactory(name, (serv, id) -> new TCGGame(aiExecutor, name, id, mods.getModFor(name)))); logger.info("Started"); } catch (Exception e) { logger.error("Initializing Error", e); } return server; }</code><technical_language>a space if</technical_language>

Target:
public Server start() { mods.loadExternal(mods.getDefaultModLocation()); mods.loadExternal(Paths.get(config.getModsDirectory())); if (mods.getAvailableMods().isEmpty()) { logger.warn(NoModsLoadedException.NO_MOD_MESSAGE); throw new NoModsLoadedException(); } try { logger.info("Starting Server..."); server.addConnections(new ServerSock(server, config)); server.addConnections(new ServerWeb(server, config)); logger.info("Starting Console..."); CommandHandler commandHandler = server.getCommandHandler(); initializeCommands(commandHandler); ServerConsole console = new ServerConsole(server, commandHandler); consoleThread = new Thread(console, "Console-Thread"); consoleThread.start(); mods.getAIs().entrySet().forEach(entry -> { ClientIO tcgAI = new FakeAIClientTCG(server, entry.getValue()); server.newClient(tcgAI); server.getIncomingHandler().perform(new LoginMessage("AI " + entry.getKey()), tcgAI); }); final Supplier<ScheduledExecutorService> aiExecutor = () -> server.getScheduler(); mods.getAvailableMods().forEach(name -> server.addGameFactory(name, (serv, id) -> new TCGGame(aiExecutor, name, id, mods.getModFor(name)))); logger.info("Started"); } catch (Exception e) { logger.error("Initializing Error", e); } return server; }
Source:
<code>protected void publishServerListeningEvent(int port) { if (getApplicationEventPublisher() != null) { TcpConnectionServerListeningEvent event = new TcpConnectionServerListeningEvent(this, port); TaskScheduler taskScheduler = this.getTaskScheduler(); if (taskScheduler != null) { try { taskScheduler.schedule(new Runnable() { @Override public void run() { getApplicationEventPublisher().publishEvent(event); } }, new Date()); } catch (TaskRejectedException e) { getApplicationEventPublisher().publishEvent(event); } } else { <START> getApplicationEventPublisher().publishEvent(event); <END> } } }</code><technical_language>started taskScheduler? I understand async wish, is time in code... I extract variable for getApplicationEventPublisher(). compiler do stuff for us</technical_language>

Target:
protected void publishServerListeningEvent(int port) { final ApplicationEventPublisher eventPublisher = getApplicationEventPublisher(); if (eventPublisher != null) { final TcpConnectionServerListeningEvent event = new TcpConnectionServerListeningEvent(this, port); TaskScheduler taskScheduler = this.getTaskScheduler(); if (taskScheduler != null) { try { taskScheduler.schedule(new Runnable() { @Override public void run() { eventPublisher.publishEvent(event); } }, new Date()); } catch (TaskRejectedException e) { eventPublisher.publishEvent(event); } } else { eventPublisher.publishEvent(event); } } }
Source:
<code>public boolean onOptionsItemSelected(final MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { NavigationHelper.openSettings(requireContext()); return true; } if (isLoading.get()) { return true; } switch (id) { case R.id.menu_item_share: if (currentInfo != null) { ShareUtils.shareUrl(requireContext(), currentInfo.getName(), currentInfo.getOriginalUrl()); } return true; case R.id.menu_item_share_stream: if (currentInfo != null) { <START> Stream stream; <END> if (currentInfo.getVideoStreams().isEmpty() && currentInfo.getVideoOnlyStreams().isEmpty()) { stream = getDefaultAudioStream(); } else { stream = getSelectedVideoStream(); } ShareUtils.shareUrl(requireContext(), currentInfo.getName(), stream.getUrl()); } return true; case R.id.menu_item_openInBrowser: if (currentInfo != null) { ShareUtils.openUrlInBrowser(requireContext(), currentInfo.getOriginalUrl()); } return true; case R.id.action_play_with_kodi: try { NavigationHelper.playWithKore(activity, Uri.parse(currentInfo.getUrl())); } catch (Exception e) { if (DEBUG) { Log.i(TAG, "Failed to start kore", e); } KoreUtil.showInstallKoreDialog(activity); } return true; default: return super.onOptionsItemSelected(item); } }</code><technical_language>I this final</technical_language>

Target:
public boolean onOptionsItemSelected(final MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { NavigationHelper.openSettings(requireContext()); return true; } if (isLoading.get()) { return true; } switch (id) { case R.id.menu_item_share: if (currentInfo != null) { ShareUtils.shareUrl(requireContext(), currentInfo.getName(), currentInfo.getOriginalUrl()); } return true; case R.id.menu_item_share_stream: if (currentInfo != null) { final Stream stream; if (currentInfo.getVideoStreams().isEmpty() && currentInfo.getVideoOnlyStreams().isEmpty()) { stream = getDefaultAudioStream(); } else { stream = getSelectedVideoStream(); } ShareUtils.shareUrl(requireContext(), currentInfo.getName(), stream.getUrl()); } return true; case R.id.menu_item_openInBrowser: if (currentInfo != null) { ShareUtils.openUrlInBrowser(requireContext(), currentInfo.getOriginalUrl()); } return true; case R.id.action_play_with_kodi: try { NavigationHelper.playWithKore(activity, Uri.parse(currentInfo.getUrl())); } catch (Exception e) { if (DEBUG) { Log.i(TAG, "Failed to start kore", e); } KoreUtil.showInstallKoreDialog(activity); } return true; default: return super.onOptionsItemSelected(item); } }
Source:
<code>protected boolean isPage500(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.OK_200) || isCustomPage(msg, CustomPage.Type.NOTFOUND_404)) { return false; } return isCustomPage(msg, CustomPage.Type.ERROR_500) ? true <START> : msg.getResponseHeader().getStatusCode() == HttpStatusCode.INTERNAL_SERVER_ERROR; <END> }</code><technical_language>branch is covered</technical_language>

Target:
protected boolean isPage500(HttpMessage msg) { if (isCustomPage(msg, CustomPage.Type.OK_200) || isCustomPage(msg, CustomPage.Type.NOTFOUND_404)) { return false; } if (isCustomPage(msg, CustomPage.Type.ERROR_500)) { return true; } return msg.getResponseHeader().getStatusCode() == HttpStatusCode.INTERNAL_SERVER_ERROR; }
Source:
<code>public void testSTStartEndPoint() throws Exception { assertQuery("select ST_AsText(ST_StartPoint(ST_GeometryFromText('LineString(8 4, 4 8, 5 6)')))", "select 'POINT (8 4)'"); assertQuery("select ST_AsText(ST_EndPoint(ST_GeometryFromText('LineString(8 4, 4 8, 5 6)')))", "select 'POINT (5 6)'"); assertQueryFails("select ST_AsText(ST_StartPoint(ST_GeometryFromText('Polygon ((2 0, 2 1, 3 1))')))", "ST_StartPoint only applies to LineString. Input type is: Polygon"); assertQueryFails("select ST_AsText(ST_EndPoint(ST_GeometryFromText('Polygon ((2 0, 2 1, 3 1))')))", "ST_EndPoint only applies to LineString. Input type is: Polygon"); <START> assertQueryFails("select ST_AsText(ST_StartPoint(ST_GeometryFromText('LINESTRING EMPTY')))", "ST_StartPoint only applies to LineString. Input type is: MultiLineString"); <END> }</code><technical_language>ST_StartPoint of a empty line-string return null</technical_language>

Target:
public void testSTStartEndPoint() throws Exception { assertFunction("ST_AsText(ST_StartPoint(ST_GeometryFromText('LINESTRING (8 4, 4 8, 5 6)')))", VARCHAR, "POINT (8 4)"); assertFunction("ST_AsText(ST_EndPoint(ST_GeometryFromText('LINESTRING (8 4, 4 8, 5 6)')))", VARCHAR, "POINT (5 6)"); assertInvalidFunction("ST_AsText(ST_StartPoint(ST_GeometryFromText('POLYGON ((2 0, 2 1, 3 1))')))", "ST_StartPoint only applies to LINE_STRING. Input type is: POLYGON"); assertInvalidFunction("ST_AsText(ST_EndPoint(ST_GeometryFromText('POLYGON ((2 0, 2 1, 3 1))')))", "ST_EndPoint only applies to LINE_STRING. Input type is: POLYGON"); }