auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void verify() throws Exception { if (isMemberNode(targetInstance)) { MapStoreConfig mapStoreConfig = targetInstance.getConfig().getMapConfig(basename).getMapStoreConfig(); final int writeDelaySeconds = mapStoreConfig.getWriteDelaySeconds(); Thread.sleep(mapStoreMaxDelayMs * 2 + maxTTLExpireyMs * 2 + ((writeDelaySeconds * 2) * 1000)); final MapStoreWithCounter mapStore = (MapStoreWithCounter) mapStoreConfig.getImplementation(); final IMap map = targetInstance.getMap(basename); log.info(basename + ": map size =" + map.size()); log.info(basename + ": " + mapStore); TestUtils.assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { for (Object k : map.localKeySet()) { assertEquals(map.get(k), mapStore.store.get(k)); } assertEquals("sets should be equals", map.getAll(map.localKeySet()).entrySet(), mapStore.store.entrySet()); for (int k = putTTlKeyDomain; k < putTTlKeyDomain + putTTlKeyRange; k++) { assertNull(basename + ": TTL key should not be in the map", map.get(k)); } } <START> }, 120); <END> } }</code><technical_language>pull this out a property</technical_language>

Target:
public void verify() throws Exception { if (isMemberNode(targetInstance)) { MapStoreConfig mapStoreConfig = targetInstance.getConfig().getMapConfig(basename).getMapStoreConfig(); final int writeDelaySeconds = mapStoreConfig.getWriteDelaySeconds(); Thread.sleep(mapStoreMaxDelayMs * 2 + maxTTLExpireyMs * 2 + ((writeDelaySeconds * 2) * 1000)); final MapStoreWithCounter mapStore = (MapStoreWithCounter) mapStoreConfig.getImplementation(); final IMap map = targetInstance.getMap(basename); log.info(basename + ": map size =" + map.size()); log.info(basename + ": " + mapStore); TestUtils.assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { for (Object k : map.localKeySet()) { assertEquals(map.get(k), mapStore.store.get(k)); } assertEquals("sets should be equals", map.getAll(map.localKeySet()).entrySet(), mapStore.store.entrySet()); for (int k = putTTlKeyDomain; k < putTTlKeyDomain + putTTlKeyRange; k++) { assertNull(basename + ": TTL key should not be in the map", map.get(k)); } } }); } }
Source:
<code>public DebuggingContext enableDebugMode(IDeploymentConfig deploymentConfig, DebuggingContext debugContext, IProgressMonitor monitor) throws CoreException { <START> assert deploymentConfig != null; <END> assert debugContext != null; IDebugListener listener = debugContext.getDebugListener(); if (debugContext.isDebugEnabled() && listener != null) { IPod pod = getFirstPod(deploymentConfig); debugContext.setPod(pod); listener.onDebugChange(debugContext, monitor); } else { debugContext.setDebugEnabled(true); updateDebugConfig(deploymentConfig, debugContext, monitor); } return debugContext; }</code><technical_language>avoid asset keyword ? Eclipse is started -ea switch</technical_language>

Target:
public DebuggingContext enableDebugMode(IDeploymentConfig deploymentConfig, DebuggingContext debugContext, IProgressMonitor monitor) throws CoreException { Assert.isNotNull(deploymentConfig); Assert.isNotNull(debugContext); IDebugListener listener = debugContext.getDebugListener(); if (debugContext.isDebugEnabled() && listener != null) { IPod pod = getFirstPod(deploymentConfig); debugContext.setPod(pod); listener.onDebugChange(debugContext, monitor); } else { debugContext.setDebugEnabled(true); updateDebugConfig(deploymentConfig, debugContext, monitor); } return debugContext; }
Source:
<code>public String serialize() { StringBuilder builder = new StringBuilder(); if (getItems() == null) { return ""; } for (KeyValueLineModel keyValueLineModel : (List<KeyValueLineModel>) getItems()) { String key = keyValueLineModel.getKeys().getSelectedItem(); if (!isKeyValid(key)) { continue; } builder.append(key); builder.append(KEY_VALUE_DELIMETER); if (keyValueLineModel.getValue().getIsAvailable()) { builder.append(keyValueLineModel.getValue().getEntity()); } else if (keyValueLineModel.getValues().getIsAvailable()) { builder.append(keyValueLineModel.getValues().getSelectedItem()); } builder.append(PROPERTIES_DELIMETER); } <START> return builder.subSequence(0, builder.length() - 1).toString(); <END> }</code><technical_language>This fail if in cases: 1: if values added builder, this fails in index array out of bound... 2: if changes PROPERTIES_DELIMETER a more char this cut part. write this: if(builder.toString().endsWith(PROPERTIES_DELIMITER)) { return builder.subSequence(0, builder.length() - PROPERTIES_DELIMETER.lengt()).toString(); } return buildet.toString();</technical_language>

Target:
public String serialize() { StringBuilder builder = new StringBuilder(); if (getItems() == null) { return ""; } for (KeyValueLineModel keyValueLineModel : (List<KeyValueLineModel>) getItems()) { String key = keyValueLineModel.getKeys().getSelectedItem(); if (!isKeyValid(key)) { continue; } builder.append(key); builder.append(KEY_VALUE_DELIMETER); if (keyValueLineModel.getValue().getIsAvailable()) { builder.append(keyValueLineModel.getValue().getEntity()); } else if (keyValueLineModel.getValues().getIsAvailable()) { builder.append(keyValueLineModel.getValues().getSelectedItem()); } builder.append(PROPERTIES_DELIMETER); } if (builder.toString().endsWith(PROPERTIES_DELIMETER)) { return builder.subSequence(0, builder.length() - PROPERTIES_DELIMETER.length()).toString(); } return builder.toString(); }
Source:
<code>Object toSerializableValue(Object value) { return value == null ? null : udtMapper.toUDT((U) value); <START> } <END></code><technical_language>need override in NestedUDTMapper EnumMapper (using enum partition key, unlikely, is possible)</technical_language>

Target:
Object toSerializableValue(Object value) { if (value == null) { return null; } else { @SuppressWarnings("unchecked") U mappedUdt = (U) value; return udtMapper.toUDT(mappedUdt); } }
Source:
<code>public void testDelegateIsLazyLoadedAndRequestIncludesEndpointFromCallee() throws InterruptedException, ExecutionException { Injector child = injectorForCaller(new HttpCommandExecutorService() { @Override public HttpResponse invoke(HttpCommand command) { assertEquals(command.getCurrentRequest().getRequestLine(), "GET http://localhost:1111/client/1 HTTP/1.1"); return HttpResponse.builder().build(); } }); try { child.getInstance(Callee.class); <START> fail("Callee shouldn't be bound yet"); <END> } catch (ConfigurationException e) { } child.getInstance(Caller.class).getCallee(URI.create("http://howdyboys")).testWithEndpoint(); }</code><technical_language>want assertj failBecauseExceptionWasNotThrown</technical_language>

Target:
public void testDelegateIsLazyLoadedAndRequestIncludesEndpointFromCallee() throws InterruptedException, ExecutionException { Injector child = injectorForCaller(new HttpCommandExecutorService() { @Override public HttpResponse invoke(HttpCommand command) { assertEquals(command.getCurrentRequest().getRequestLine(), "GET http://localhost:1111/client/1 HTTP/1.1"); return HttpResponse.builder().build(); } }); try { child.getInstance(Callee.class); failBecauseExceptionWasNotThrown(ConfigurationException.class); } catch (ConfigurationException e) { } child.getInstance(Caller.class).getCallee(URI.create("http://howdyboys")).testWithEndpoint(); }
Source:
<code>public void handleRowMove() { final List<GridRow> existingRowOrder = new ArrayList<>(uiModel.getRows()); final GridWidgetDnDProxy highlight = mock(GridWidgetDnDProxy.class); when(state.getEventColumnHighlight()).thenReturn(highlight); when(state.getOperation()).thenReturn(GridWidgetHandlersOperation.NONE); when(gridWidget.isVisible()).thenReturn(true); <START> when(layer.getGridWidgets()).thenReturn(new HashSet<GridWidget>() {{ add(gridWidget); }}); <END> final int eventX = (int) (gridWidget.getComputedLocation().getX() + uiColumn1.getWidth() / 2); final int eventY = (int) (gridWidget.getComputedLocation().getY() + renderer.getHeaderHeight() + uiModel.getRow(0).getHeight() / 2); when(event.getX()).thenReturn(eventX); when(event.getY()).thenReturn(eventY); handler.onNodeMouseMove(event); final int eventNewY = (int) (gridWidget.getComputedLocation().getY() + renderer.getHeaderHeight() + uiModel.getRow(0).getHeight() + uiModel.getRow(1).getHeight() / 2); when(state.getOperation()).thenReturn(GridWidgetHandlersOperation.ROW_MOVE); when(event.getY()).thenReturn(eventNewY); handler.onNodeMouseMove(event); verify(highlight).setY(gridWidget.getComputedLocation().getY() + renderer.getHeaderHeight()); verify(layer).batch(); assertEquals(existingRowOrder.get(0), uiModel.getRow(1)); assertEquals(existingRowOrder.get(1), uiModel.getRow(0)); assertEquals(existingRowOrder.get(2), uiModel.getRow(2)); }</code><technical_language>Please when(layer.getGridWidgets()).thenReturn(Collections.singleton(gridWidget));</technical_language>

Target:
public void handleRowMove() { final List<GridRow> existingRowOrder = new ArrayList<>(uiModel.getRows()); final GridWidgetDnDProxy highlight = mock(GridWidgetDnDProxy.class); when(state.getEventColumnHighlight()).thenReturn(highlight); when(state.getOperation()).thenReturn(GridWidgetHandlersOperation.NONE); when(gridWidget.isVisible()).thenReturn(true); when(layer.getGridWidgets()).thenReturn(Collections.singleton(gridWidget)); final int eventX = (int) (gridWidget.getComputedLocation().getX() + uiColumn1.getWidth() / 2); final int eventY = (int) (gridWidget.getComputedLocation().getY() + renderer.getHeaderHeight() + uiModel.getRow(0).getHeight() / 2); when(event.getX()).thenReturn(eventX); when(event.getY()).thenReturn(eventY); handler.onNodeMouseMove(event); final int eventNewY = (int) (gridWidget.getComputedLocation().getY() + renderer.getHeaderHeight() + uiModel.getRow(0).getHeight() + uiModel.getRow(1).getHeight() / 2); when(state.getOperation()).thenReturn(GridWidgetHandlersOperation.ROW_MOVE); when(event.getY()).thenReturn(eventNewY); handler.onNodeMouseMove(event); verify(highlight).setY(gridWidget.getComputedLocation().getY() + renderer.getHeaderHeight()); verify(layer).batch(); assertEquals(existingRowOrder.get(0), uiModel.getRow(1)); assertEquals(existingRowOrder.get(1), uiModel.getRow(0)); assertEquals(existingRowOrder.get(2), uiModel.getRow(2)); }
Source:
<code>protected void dispatchEvent(Message event, EventContext context) throws InvocationTargetException { checkNotNull(event, "event"); <START> checkNotNull(context, "event context"); <END> init(); final Class<? extends Message> eventClass = event.getClass(); final Method method = eventHandlers.get(eventClass); if (method == null) { throw missingEventHandler(eventClass); } final EventHandlerMethod handler = new EventHandlerMethod(this, method); handler.invoke(event, context); }</code><technical_language>Change string "context". shorter removes duality in reading (now strings start 'event')</technical_language>

Target:
protected void dispatchEvent(Message event, EventContext context) throws InvocationTargetException { checkNotNull(context, "context"); checkNotNull(event, "event"); init(); final Class<? extends Message> eventClass = event.getClass(); final Method method = eventHandlers.get(eventClass); if (method == null) { throw missingEventHandler(eventClass); } final EventHandlerMethod handler = new EventHandlerMethod(this, method); handler.invoke(event, context); }
Source:
<code>private double calculateTokenSimilarity(MatchableEntity citation, MatchableEntity document) { Set<String> srcTokens = JavaConversions.asJavaSet(misc.niceTokens(citation.toReferenceString())); <START> Set<String> dstTokens = JavaConversions.asJavaSet(misc.niceTokens(document.toReferenceString())); <END> long mutualTokensCount = srcTokens.stream().filter(x -> dstTokens.contains(x)).count(); double similarity = 2.0 * mutualTokensCount / (srcTokens.size() + dstTokens.size()); return similarity; }</code><technical_language>Thinking changing srcTokens citToken dstTokens docTokens</technical_language>

Target:
private double calculateTokenSimilarity(MatchableEntity citation, MatchableEntity document) { Set<String> citTokens = JavaConversions.asJavaSet(misc.niceTokens(citation.toReferenceString())); Set<String> docTokens = JavaConversions.asJavaSet(misc.niceTokens(document.toReferenceString())); long mutualTokensCount = citTokens.stream().filter(x -> docTokens.contains(x)).count(); double similarity = 2.0 * mutualTokensCount / (citTokens.size() + docTokens.size()); return similarity; }
Source:
<code>public static PreparedStatement getPreparedStatementProxy(PreparedStatement delegate, QueryParameters queryParameters, int cteParameterCount) { try { return PROXY_CONSTRUCTOR.newInstance(new SubselectPreparedStatementProxyHandler(delegate, queryParameters, cteParameterCount)); } catch (Exception e) { <START> throw new IllegalStateException(e.getMessage(), e); <END> } }</code><technical_language>need for message wrap exception</technical_language>

Target:
public static PreparedStatement getPreparedStatementProxy(PreparedStatement delegate, QueryParameters queryParameters, int cteParameterCount) { try { return PROXY_CONSTRUCTOR.newInstance(new SubselectPreparedStatementProxyHandler(delegate, queryParameters, cteParameterCount)); } catch (Exception e) { throw new IllegalStateException(e); } }
Source:
<code>public DruidStatement execute() { synchronized (lock) { ensure(State.PREPARED); try { Callable<Sequence<Object[]>> opener = () -> plannerResult.run(); <START> Future<Sequence<Object[]>> future = yielderOpenCloseExecutor.submit(opener); <END> final Sequence<Object[]> baseSequence = future.get(); final Sequence<Object[]> retSequence = maxRowCount >= 0 && maxRowCount <= Integer.MAX_VALUE ? Sequences.limit(baseSequence, (int) maxRowCount) : baseSequence; yielder = Yielders.each(retSequence); state = State.RUNNING; } catch (Throwable t) { try { close(); } catch (Throwable t1) { t.addSuppressed(t1); } Throwables.propagate(t); } return this; } }</code><technical_language>final</technical_language>

Target:
public DruidStatement execute() { synchronized (lock) { ensure(State.PREPARED); try { final Sequence<Object[]> baseSequence = yielderOpenCloseExecutor.submit( () -> plannerResult.run() ).get(); final Sequence<Object[]> retSequence = maxRowCount >= 0 && maxRowCount <= Integer.MAX_VALUE ? Sequences.limit(baseSequence, (int) maxRowCount) : baseSequence; yielder = Yielders.each(retSequence); state = State.RUNNING; } catch (Throwable t) { try { close(); } catch (Throwable t1) { t.addSuppressed(t1); } throw Throwables.propagate(t); } return this; } }
Source:
<code>public void setJavaClassNameColumnInSysAliases(TransactionController tc) throws StandardException { SchemaDescriptor sd = getSystemSchemaDescriptor(); TabInfoImpl ti=getNonCoreTI(SYSALIASES_CATALOG_NUM); faultInTabInfo(ti); FormatableBitSet columnToReadSet=new FormatableBitSet(SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT); FormatableBitSet columnToUpdateSet=new FormatableBitSet(SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT); for(int i=0;i<SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT;i++){ if (i+1 == SYSALIASESRowFactory.SYSALIASES_JAVACLASSNAME) { columnToReadSet.set(i); } columnToUpdateSet.set(i); } DataValueDescriptor[] rowTemplate = new DataValueDescriptor[SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT]; DataValueDescriptor[] replaceRow= new DataValueDescriptor[SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT]; ScanController sc= tc.openScan( ti.getHeapConglomerate(), false, TransactionController.OPENMODE_FORUPDATE, TransactionController.MODE_TABLE, TransactionController.ISOLATION_REPEATABLE_READ, columnToReadSet, null, ScanController.NA, null, null, ScanController.NA); while(sc.fetchNext(rowTemplate)){ for (int i=0; i<rowTemplate.length; i++) { if (i+1 == SYSALIASESRowFactory.SYSALIASES_JAVACLASSNAME) <START> if(replaceRow[i] == null) { <END> replaceRow[i] = new SQLLongvarchar("NULL"); } } sc.replace(replaceRow,columnToUpdateSet); } sc.close(); }</code><technical_language>need check rowTemplate[I] == null fetched row content</technical_language>

Target:
public void setJavaClassNameColumnInSysAliases(TransactionController tc) throws StandardException { TabInfoImpl ti = getNonCoreTI(SYSALIASES_CATALOG_NUM); faultInTabInfo(ti); FormatableBitSet columnToReadSet = new FormatableBitSet(SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT); FormatableBitSet columnToUpdateSet = new FormatableBitSet(SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT); for (int i = 0; i < SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT; i++) { columnToReadSet.set(i); columnToUpdateSet.set(i); } DataValueDescriptor[] rowTemplate = new DataValueDescriptor[SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT]; DataValueDescriptor[] replaceRow = new DataValueDescriptor[SYSALIASESRowFactory.SYSALIASES_COLUMN_COUNT]; ScanController sc = tc.openScan( ti.getHeapConglomerate(), false, TransactionController.OPENMODE_FORUPDATE, TransactionController.MODE_TABLE, TransactionController.ISOLATION_REPEATABLE_READ, columnToReadSet, null, ScanController.NA, null, null, ScanController.NA); while (sc.fetchNext(rowTemplate)) { for (int i = 0; i < rowTemplate.length; i++) { replaceRow[i] = rowTemplate[i].cloneValue(false); if (i + 1 == SYSALIASESRowFactory.SYSALIASES_JAVACLASSNAME && rowTemplate[i].isNull()) { replaceRow[i] = new SQLLongvarchar("NULL"); } } sc.replace(replaceRow, columnToUpdateSet); } sc.close(); }
Source:
<code>public void beforeExecution(PreparedStatement stmt, StatementContext ctx) throws SQLException { this.context = ctx; if (!oraclePS.isAssignableFrom(stmt.getClass())) { try { final Method get_delegate = stmt.getClass().getMethod("getDelegate"); final Object candidate = get_delegate.invoke(stmt); if (!oraclePS.isAssignableFrom(candidate.getClass())) { throw new Exception("Obtained delegate, but it still wasn't an OraclePreparedStatement"); } else { this.stmt = candidate; } } catch (Exception e) { <START> throw new IllegalStateException("Statement is not an OraclePreparedStatement, nor" + <END> "one which we know how to find it from", e); } } else { this.stmt = stmt; } for (int[] bind : binds) { try { registerReturnParameter.invoke(this.stmt, bind[0], bind[1]); } catch (Exception e) { throw new RuntimeException(e); } } }</code><technical_language>"norone" is new favorite word</technical_language>

Target:
public void beforeExecution(PreparedStatement stmt, StatementContext ctx) throws SQLException { this.context = ctx; if (!stmt.isWrapperFor(OraclePreparedStatement.class)) { throw new IllegalStateException("Statement is not an instance of, nor a wrapper of, OraclePreparedStatement"); } this.stmt = stmt.unwrap(OraclePreparedStatement.class); for (int[] bind : binds) { try { this.stmt.registerReturnParameter(bind[0], bind[1]); } catch (Exception e) { throw new RuntimeException(e); } } }
Source:
<code>public void replaceTitlesWithCaptions(String wikibaseIdentifier, int position) { compositeDisposable.add(mediaClient.getCaptionByWikibaseIdentifier(wikibaseIdentifier) .subscribeOn(ioScheduler) .observeOn(mainThreadScheduler) <START> .timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS) <END> .subscribe(subscriber -> { view.handleLabelforImage(subscriber, position); })); }</code><technical_language>consider replacing timeouts here, OKHTTP client timeout</technical_language>

Target:
public void replaceTitlesWithCaptions(String wikibaseIdentifier, int position) { compositeDisposable.add(mediaClient.getCaptionByWikibaseIdentifier(wikibaseIdentifier) .subscribeOn(ioScheduler) .observeOn(mainThreadScheduler) .subscribe(caption -> { view.handleLabelforImage(caption, position); })); }
Source:
<code>private String renderPopoverJs() { StringBuilder builder = new StringBuilder(); builder.append("var popup = " + getJsId() + ";"); builder.append("var element = popup.getElement();"); builder.append("$(element).popover('destroy');"); builder.append("popup.setPosition(" + position.renderJs() + ");"); builder.append("$(element).popover({"); if (titleModel != null) { builder.append("'title': '" + escapeQuoteJs(titleModel.getObject()) + "',"); } if (placement != null) { builder.append("'placement': '" + placement + "',"); } builder.append("'html': '" + html + "',"); if (html) { builder.append("'content': '" + escapeQuoteJs(model.getObject()) + "',"); } else { builder.append("'content': '" + Strings.escapeMarkup(model.getObject()) + "',"); } builder.append("});"); if(titleModel != null) { <START> builder.append("$(element).attr('data-original-title', '" + escapeQuoteJs(titleModel.getObject()) + "');" ); <END> } if (html) { builder.append("$(element).attr('data-content', '" + escapeQuoteJs(model.getObject()) + "');"); } else { builder.append("$(element).attr('data-content', '" + Strings.escapeMarkup(model.getObject()) + "');"); } return builder.toString(); }</code><technical_language>append() instead of concatenation</technical_language>

Target:
private String renderPopoverJs() { StringBuilder builder = new StringBuilder(); builder.append("var popup = " + getJsId() + ";"); builder.append("var element = popup.getElement();"); builder.append("$(element).popover('destroy');"); builder.append("popup.setPosition(" + position.renderJs() + ");"); builder.append("$(element).popover({"); if (titleModel != null) { builder.append("'title': '" + escapeQuoteJs(titleModel.getObject()) + "',"); } if (placement != null) { builder.append("'placement': '" + placement + "',"); } builder.append("'html': '" + html + "',"); if (html) { builder.append("'content': '" + escapeQuoteJs(model.getObject()) + "',"); } else { builder.append("'content': '" + Strings.escapeMarkup(model.getObject()) + "',"); } builder.append("});"); if(titleModel != null) { builder.append("$(element).data('original-title', '"); builder.append(escapeQuoteJs(titleModel.getObject())); builder.append("');"); } if (html) { builder.append("$(element).attr('data-content', '" + escapeQuoteJs(model.getObject()) + "');"); } else { builder.append("$(element).attr('data-content', '" + Strings.escapeMarkup(model.getObject()) + "');"); } return builder.toString(); }
Source:
<code>private Result<String> serviceExecution(ServiceEndPoint serviceEndPoint) { TimerContext totalTimeContext = _totalExecTimer.time(); try { TimerContext checkoutTimeContext = _checkoutTimer.time(); ServiceHandle<Service<String, String>> serviceHandle = _serviceCache.checkOut(serviceEndPoint); Service<String, String> service = serviceHandle.getService(); checkoutTimeContext.stop(); String work = serviceEndPoint.getPayload(); String result = service.process(work); TimerContext checkinTimeContext = _checkinTimer.time(); _serviceCache.checkIn(serviceHandle); checkinTimeContext.stop(); _serviceMeter.mark(); <START> totalTimeContext.stop(); <END> return _resultFactory.createResponse(result); } catch (Exception exception) { _serviceMeter.mark(); totalTimeContext.stop(); return _resultFactory.createResponse(exception); } }</code><technical_language>totalTimeContext.stop() in a finally</technical_language>

Target:
private Result<String> serviceExecution(ServiceEndPoint serviceEndPoint) { Timer.Context totalTimeContext = _totalExecTimer.time(); try { Timer.Context checkoutTimeContext = _checkoutTimer.time(); ServiceHandle<Service<String, String>> serviceHandle = _serviceCache.checkOut(serviceEndPoint); Service<String, String> service = serviceHandle.getService(); checkoutTimeContext.stop(); String work = serviceEndPoint.getPayload(); String result = service.process(work); Timer.Context checkinTimeContext = _checkinTimer.time(); _serviceCache.checkIn(serviceHandle); checkinTimeContext.stop(); return _resultFactory.createResponse(result); } catch (Exception exception) { return _resultFactory.createResponse(exception); } finally { _serviceMeter.mark(); totalTimeContext.stop(); } }
Source:
<code>public String getDescription() { final String description = translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerForm); <START> return description != null && !description.isEmpty() ? description : "Form (Preview)"; <END> }</code><technical_language>I internals, case "Form (Preview)" is returned is reached. i18n is appreciable in other case</technical_language>

Target:
public String getDescription() { return translationService.getTranslation(FormEditorConstants.NewFormDefinitionlHandlerForm); }
Source:
<code>private String getUsername(HttpServletRequest request) { if (config.isUseAuditHttpHeaderName()) { return request.getHeader(config.getAuditHttpHeaderName()); } String user = request.getParameter("user"); String password = request.getParameter("password"); if (user != null && password != null) { <START> return null; <END> } return null; }</code><technical_language>return user;</technical_language>

Target:
private String getUsername(HttpServletRequest request) { if (config.isUseAuditHttpHeaderName()) { return request.getHeader(config.getAuditHttpHeaderName()); } String user = request.getParameter("user"); String password = request.getParameter("password"); if (user != null && password != null) { return user; } return null; }
Source:
<code>public Firmware getFirmware(FirmwareUID firmwareUID, Locale locale) { Preconditions.checkArgument(firmwareUID != null); if (locale == null) { locale = Locale.getDefault(); } String filename = firmwareFiles.get(firmwareUID); if (filename == null) { logger.debug("Cannot find firmware {}", firmwareUID); return null; } try { return getFirmware(firmwareUID, filename, locale); } catch (IOException e) { <START> logger.error("Cannot find firmware " + firmwareUID, e); <END> } return null; }</code><technical_language>log NoSuchFileException debug level</technical_language>

Target:
public Firmware getFirmware(FirmwareUID firmwareUID, Locale locale) { Preconditions.checkArgument(firmwareUID != null); if (locale == null) { locale = Locale.getDefault(); } String filename = firmwareFiles.get(firmwareUID); if (filename == null) { logger.debug("Cannot find firmware {}", firmwareUID); return null; } try { return getFirmware(firmwareUID, filename, locale); } catch (IOException e) { logger.debug("Cannot find firmware " + firmwareUID); } return null; }
Source:
<code>public SAMRecordDuplicateComparator(final List<SAMFileHeader> headers) { <START> for (SAMFileHeader header : headers) { <END> populateLibraryIds(header); } }</code><technical_language>final</technical_language>

Target:
public SAMRecordDuplicateComparator(final List<SAMFileHeader> headers) { populateLibraryIds(headers); }
Source:
<code>protected SecurityGroup findSecurityGroupWithName(SecurityGroupExtension sgExt, String name) { Set<SecurityGroup> groups = sgExt.listSecurityGroups(); for (SecurityGroup g: groups) { <START> if (name.equals(g.getName())) return g; <END> } return null; }</code><technical_language>check .endswith(g.getName())? I find Jclouds prepends 'jclouds#' names of security groups creates</technical_language>

Target:
protected SecurityGroup findSecurityGroupWithName(SecurityGroupExtension sgExt, String name) { Set<SecurityGroup> groups = sgExt.listSecurityGroups(); String nameAlt = name.startsWith("jclouds#") ? Strings.removeFromStart(name, "jclouds#") : "jclouds#"+name; for (SecurityGroup g: groups) { if (name.equals(g.getName())) return g; if (nameAlt.equals(g.getName())) return g; } return null; }
Source:
<code>public void installNode_NodeIsInstalledToTargetDirectory() throws FrontendUtils.UnknownVersionException { <START> String nodeExecutable = tools.installNode("v14.15.4", null); <END> Assert.assertNotNull(nodeExecutable); List<String> nodeVersionCommand = new ArrayList<>(); nodeVersionCommand.add(nodeExecutable); nodeVersionCommand.add("--version"); FrontendVersion node = FrontendUtils.getVersion("node", nodeVersionCommand); Assert.assertEquals("14.15.4", node.getFullVersion()); FrontendTools newTools = new FrontendTools(vaadinHomeDir, null); List<String> npmVersionCommand = new ArrayList<>( newTools.getNpmExecutable()); npmVersionCommand.add("--version"); FrontendVersion npm = FrontendUtils.getVersion("npm", npmVersionCommand); Assert.assertEquals("6.14.6", npm.getFullVersion()); }</code><technical_language>static DEFAULT_NODE_VERSION in tests for installation assertions, change tests time bump node is cumbersome error prone</technical_language>

Target:
public void installNode_NodeIsInstalledToTargetDirectory() throws FrontendUtils.UnknownVersionException { String nodeExecutable = tools.installNode("v12.18.3", null); Assert.assertNotNull(nodeExecutable); List<String> nodeVersionCommand = new ArrayList<>(); nodeVersionCommand.add(nodeExecutable); nodeVersionCommand.add("--version"); FrontendVersion node = FrontendUtils.getVersion("node", nodeVersionCommand); Assert.assertEquals("12.18.3", node.getFullVersion()); FrontendTools newTools = new FrontendTools(vaadinHomeDir, null); List<String> npmVersionCommand = new ArrayList<>( newTools.getNpmExecutable()); npmVersionCommand.add("--version"); FrontendVersion npm = FrontendUtils.getVersion("npm", npmVersionCommand); Assert.assertEquals("6.14.6", npm.getFullVersion()); }
Source:
<code>public long nodesGetCount( ) { long base = storeReadLayer.nodesGetCount(); <START> return ktx.hasTxStateWithChanges() ? base + ktx.txState().addedAndRemovedNodes().delta() : base; <END> }</code><technical_language>Do need a ktx.assertOpen() here</technical_language>

Target:
public long nodesGetCount( ) { ktx.assertOpen(); long base = storeReadLayer.nodesGetCount(); return ktx.hasTxStateWithChanges() ? base + ktx.txState().addedAndRemovedNodes().delta() : base; }
Source:
<code>public static ExportForms load(List<FormStatus> forms, BriefcasePreferences preferences) { Map<FormStatus, ExportConfiguration> configurations = new HashMap<>(); forms.forEach(form -> { <START> ExportConfiguration configuration = ExportConfiguration.load(preferences, "custom_" + form.getFormName() + "_"); <END> if (!configuration.isEmpty() && configuration.isValid()) configurations.put(form, configuration); }); return new ExportForms( forms, configurations ); }</code><technical_language>I considered Briefcase form name a lot (directory naming, etc). potentially dangerous uniqueness guarantee I suppose for form_id multiple servers, either. form name is consistent thought mention this in case run issues related some point</technical_language>

Target:
public static ExportForms load(List<FormStatus> forms, BriefcasePreferences preferences) { Map<FormStatus, ExportConfiguration> configurations = new HashMap<>(); forms.forEach(form -> configurations.put( form, ExportConfiguration.load(preferences, "custom_" + form.getFormName() + "_") )); return new ExportForms( forms, configurations ); }
Source:
<code>private boolean hasTaskExecuted(Long taskID) { Set<TaskActivityType> activityTypes = new HashSet<>(); activityTypes.add(TaskActivityType.SUCCESS); QueryParams queryParams = new QueryParams((Order) null); List<TaskActivity> taskActivities = taskActivitiesDataService.byTaskAndActivityTypes(taskID, activityTypes, queryParams); <START> return taskActivities.size() == 1 ? true : false; <END> }</code><technical_language>return taskActivities.size()</technical_language>

Target:
private boolean hasTaskExecuted(Long taskID) { Set<TaskActivityType> activityTypes = new HashSet<>(); activityTypes.add(TaskActivityType.SUCCESS); QueryParams queryParams = new QueryParams((Order) null); List<TaskActivity> taskActivities = taskActivitiesDataService.byTaskAndActivityTypes(taskID, activityTypes, queryParams); return taskActivities.size() == 1; }
Source:
<code>public int saveAnswer(IAnswerData answer, FormIndex index, boolean evaluateConstraints) { <START> ACRAUtil.addCustomData(ACRAUtil.LAST_ANSWER_DATA, (answer == null ? "null" : answer.getDisplayText())); <END> ACRAUtil.addCustomData(ACRAUtil.LAST_INDEX, index.toString()); try { if (evaluateConstraints) { return mFormController.answerQuestion(index, answer); } else { mFormController.saveAnswer(index, answer); return FormEntryController.ANSWER_OK; } } catch(XPathException e) { createErrorDialog("There is a bug in one of your form's XPath Expressions \n" + e.getMessage(), EXIT); return FormEntryController.ANSWER_OK; } }</code><technical_language>This is a super interesting idea. I this a lot. For debugging good get display data text in case data interesting on. Also: good wrapping call this is 100% execution safe. good check null here, case impossible for logging calls crash if (not cleanly wrap contexts in java, though)</technical_language>

Target:
public int saveAnswer(IAnswerData answer, FormIndex index, boolean evaluateConstraints) { try { if (evaluateConstraints) { return mFormController.answerQuestion(index, answer); } else { mFormController.saveAnswer(index, answer); return FormEntryController.ANSWER_OK; } } catch(XPathException e) { createErrorDialog("There is a bug in one of your form's XPath Expressions \n" + e.getMessage(), EXIT); return FormEntryController.ANSWER_OK; } }
Source:
<code>public void testChannelPromiseWithAutoReadClosed() { final List<Long> inboundMsgs = new ArrayList<Long>(); EmbeddedChannel channel = new EmbeddedChannel(new ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { inboundMsgs.add((Long) msg); } }); channel.config().setAutoRead(false); assertEquals(0, inboundMsgs.size()); ChannelFuture channelFuture = channel.writeOneInbound(1L, channel.newPromise()); assertFalse(channelFuture.isDone()); channel.config().setAutoRead(true); assertEquals(1, inboundMsgs.size()); assertTrue(channelFuture.isDone()); assertTrue(channelFuture.isSuccess()); <START> channel.finish(); <END> }</code><technical_language>assert return</technical_language>

Target:
public void testChannelPromiseWithAutoReadClosed() { final List<Long> inboundMsgs = new ArrayList<Long>(); EmbeddedChannel channel = new EmbeddedChannel(new ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { inboundMsgs.add((Long) msg); } }); channel.config().setAutoRead(false); assertEquals(0, inboundMsgs.size()); ChannelFuture channelFuture = channel.writeOneInbound(1L, channel.newPromise()); assertFalse(channelFuture.isDone()); channel.config().setAutoRead(true); assertEquals(1, inboundMsgs.size()); assertTrue(channelFuture.isDone()); assertTrue(channelFuture.isSuccess()); assertFalse(channel.finish()); }
Source:
<code>public void stop() { stopped = false; exec.shutdown(); for (ThreadPoolTaskRunnerWorkItem item : runningItems) { final Task task = item.getTask(); if (task.canRestore()) { final long start = System.currentTimeMillis(); log.info("Starting graceful shutdown of task[%s].", task.getId()); try { <START> task.stopGracefully(); <END> final TaskStatus taskStatus = item.getResult().get( new Interval(new DateTime(start), taskConfig.getGracefulShutdownTimeout()).toDurationMillis(), TimeUnit.MILLISECONDS ); log.info( "Graceful shutdown of task[%s] finished in %,dms with status[%s].", task.getId(), System.currentTimeMillis() - start, taskStatus.getStatusCode() ); } catch (Exception e) { log.warn(e, "Graceful shutdown of task[%s] aborted with exception."); } } } exec.shutdownNow(); }</code><technical_language>emit a metric this</technical_language>

Target:
public void stop() { exec.shutdown(); for (ThreadPoolTaskRunnerWorkItem item : runningItems) { final Task task = item.getTask(); final long start = System.currentTimeMillis(); final boolean graceful; final long elapsed; boolean error = false; if (task.canRestore()) { graceful = true; log.info("Starting graceful shutdown of task[%s].", task.getId()); try { task.stopGracefully(); final TaskStatus taskStatus = item.getResult().get( new Interval(new DateTime(start), taskConfig.getGracefulShutdownTimeout()).toDurationMillis(), TimeUnit.MILLISECONDS ); log.info( "Graceful shutdown of task[%s] finished in %,dms with status[%s].", task.getId(), System.currentTimeMillis() - start, taskStatus.getStatusCode() ); } catch (Exception e) { log.makeAlert(e, "Graceful task shutdown failed: %s", task.getDataSource()) .addData("taskId", task.getId()) .addData("dataSource", task.getDataSource()) .emit(); log.warn(e, "Graceful shutdown of task[%s] aborted with exception."); error = true; } } else { graceful = false; } elapsed = System.currentTimeMillis() - start; final ServiceMetricEvent.Builder metricBuilder = ServiceMetricEvent .builder() .setDimension("task", task.getId()) .setDimension("dataSource", task.getDataSource()) .setDimension("graceful", String.valueOf(graceful)) .setDimension("error", String.valueOf(error)); emitter.emit(metricBuilder.build("task/interrupt/count", 1L)); emitter.emit(metricBuilder.build("task/interrupt/elapsed", elapsed)); } exec.shutdownNow(); }
Source:
<code>boolean computeIsJarBatchArchive(File jarFile) { try { Indexer indexer = new Indexer(); <START> Index index = JandexUtil.createJarIndex(jarFile, indexer); <END> for (BatchArtifactType t: BatchArtifactType.values()) { String className = t.getClassName(); if(className != null && !index.getAllKnownSubclasses(JandexUtil.toDotName(className)).isEmpty()) { return true; } className = t.getInterfaceName(); if(className != null && !index.getAllKnownImplementors(JandexUtil.toDotName(className)).isEmpty()) { return true; } } } catch (IOException e) { BatchCorePlugin.pluginLog().logError(e); } return false; }</code><technical_language>index files get stored</technical_language>

Target:
boolean computeIsJarBatchArchive(File jarFile) { try { Indexer indexer = new Indexer(); Index index = JandexUtil.createJarIndex(jarFile, indexer); for (BatchArtifactType t: BatchArtifactType.values()) { String className = t.getClassName(); if(className != null && !index.getAllKnownSubclasses(DotName.createSimple(className)).isEmpty()) { return true; } className = t.getInterfaceName(); if(className != null && !index.getAllKnownImplementors(DotName.createSimple(className)).isEmpty()) { return true; } } } catch (IOException e) { BatchCorePlugin.pluginLog().logError(e); } return false; }
Source:
<code><START> long getOsFreePhysicalMemorySize() { <END> return getAggregatedFreeMemorySize(PHYSICAL_MEM_KEYS); }</code><technical_language>is reason for checking physical memory instead of total memory</technical_language>

Target:
long getOsFreePhysicalMemorySize() { return getAggregatedFreeMemorySize(MEM_AVAILABLE_KEYS); }
Source:
<code>public void testBatchJobSubmitsAndRuns() throws Exception { createResources(); IBulkDataExportSvc.JobInfo jobDetails = myBulkDataExportSvc.submitJob(null, Sets.newHashSet("Patient", "Observation"), null, null); JobParametersBuilder paramBuilder = new JobParametersBuilder().addString("jobUUID", jobDetails.getJobId()); myBatchJobSubmitter.runJob(myBulkJob, paramBuilder.toJobParameters()); <START> <END> IBulkDataExportSvc.JobInfo jobInfo = awaitJobCompletion(jobDetails.getJobId()); assertThat(jobInfo.getStatus(), equalTo(BulkJobStatusEnum.COMPLETE)); }</code><technical_language>This is a nice test. Demonstrates simple clean is create submit a job</technical_language>

Target:
public void testBatchJobSubmitsAndRuns() throws Exception { createResources(); IBulkDataExportSvc.JobInfo jobDetails = myBulkDataExportSvc.submitJob(null, Sets.newHashSet("Patient", "Observation"), null, null); BulkExportJobParametersBuilder paramBuilder = new BulkExportJobParametersBuilder() .setJobUUID(jobDetails.getJobId()) .setReadChunkSize(10L); JobExecution jobExecution = myBatchJobSubmitter.runJob(myBulkJob, paramBuilder.toJobParameters()); awaitJobCompletion(jobExecution); IBulkDataExportSvc.JobInfo jobInfo = myBulkDataExportSvc.getJobInfoOrThrowResourceNotFound(jobDetails.getJobId()); assertThat(jobInfo.getStatus(), equalTo(BulkJobStatusEnum.COMPLETE)); assertThat(jobInfo.getFiles().size(), equalTo(2)); }
Source:
<code>public static String executeUrl(String httpMethod, String url, Properties httpHeaders, InputStream content, String contentType, int timeout, String proxyHost, Integer proxyPort, String proxyUser, String proxyPassword, String nonProxyHosts) throws IOException { ContentResponse response = executeUrlAndGetReponse(httpMethod, url, httpHeaders, content, contentType, timeout, proxyHost, proxyPort, proxyUser, proxyPassword, nonProxyHosts); String encoding = response.getEncoding() != null ? response.getEncoding().replaceAll("\"", "").trim() : "UTF-8"; String responseBody; try { responseBody = new String(response.getContent(), encoding); if (!responseBody.isEmpty()) { <START> logger.trace(responseBody); <END> } } catch (UnsupportedEncodingException e) { responseBody = null; } return responseBody; }</code><technical_language>Quality tools complain statement string is constant</technical_language>

Target:
public static String executeUrl(String httpMethod, String url, Properties httpHeaders, InputStream content, String contentType, int timeout, String proxyHost, Integer proxyPort, String proxyUser, String proxyPassword, String nonProxyHosts) throws IOException { ContentResponse response = executeUrlAndGetReponse(httpMethod, url, httpHeaders, content, contentType, timeout, proxyHost, proxyPort, proxyUser, proxyPassword, nonProxyHosts); String encoding = response.getEncoding() != null ? response.getEncoding().replaceAll("\"", "").trim() : "UTF-8"; String responseBody; try { responseBody = new String(response.getContent(), encoding); } catch (UnsupportedEncodingException e) { responseBody = null; } return responseBody; }
Source:
<code>public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { <START> FittingOrgWordsMatchVoter fitOrgWordsMatchVoter = new FittingOrgWordsMatchVoter(ImmutableList.of(','), 2, 0.7f, 0.9f); <END> fitOrgWordsMatchVoter.setMatchStrength(0.979f); FittingAffOrgSectionWordsMatchVoter fitAffOrgSectionWordsMatchVoter = new FittingAffOrgSectionWordsMatchVoter(ImmutableList.of(','), 1, 0.8f, 0.85f); fitAffOrgSectionWordsMatchVoter.setMatchStrength(1f); return ImmutableList.of( createNameCountryStrictMatchVoter(1f), createNameStrictCountryLooseMatchVoter(1f), createSectionedNameStrictCountryLooseMatchVoter(1f), createSectionedNameLevenshteinCountryLooseMatchVoter(1f), createSectionedShortNameStrictCountryLooseMatchVoter(1f), fitOrgWordsMatchVoter, fitAffOrgSectionWordsMatchVoter); }</code><technical_language>add ; semicolon charsToFilter. (see OrganizationNameNormalizer)</technical_language>

Target:
public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { FittingOrgWordsMatchVoter fitOrgWordsMatchVoter = new FittingOrgWordsMatchVoter(ImmutableList.of(',', ';'), 2, 0.7f, 0.9f); fitOrgWordsMatchVoter.setMatchStrength(0.979f); FittingAffOrgSectionWordsMatchVoter fitAffOrgSectionWordsMatchVoter = new FittingAffOrgSectionWordsMatchVoter(ImmutableList.of(',', ';'), 1, 0.8f, 0.85f); fitAffOrgSectionWordsMatchVoter.setMatchStrength(1f); return ImmutableList.of( createNameCountryStrictMatchVoter(1f), createNameStrictCountryLooseMatchVoter(1f), createSectionedNameStrictCountryLooseMatchVoter(1f), createSectionedNameLevenshteinCountryLooseMatchVoter(1f), createSectionedShortNameStrictCountryLooseMatchVoter(1f), fitOrgWordsMatchVoter, fitAffOrgSectionWordsMatchVoter); }
Source:
<code>public IBinder onBind(Intent intent) { this.audioPlayer = new SingleFileAudioPlayer( new OnCompletionListener(){ @Override public void onCompletion(MediaPlayer mp) { new BroadcastIntent(SingleFileAudioPlayer.ACTION_SONG_FINISHED).send(PlaylistService.this); } }); this.queue = new Playlist(); <START> queue.add((new MediaStoreWrapper(this)).list().get(0)); <END> return new PlaylistServiceBinder(); }</code><technical_language>out test code</technical_language>

Target:
public IBinder onBind(Intent intent) { this.audioPlayer = new SingleFileAudioPlayer(this); this.mPlaylist = new Playlist(); registerReceivers(); return new PlaylistServiceBinder(); }
Source:
<code>DefaultExtendedDnsCacheEntry(String hostname, InetAddress address) { this.hostname = hostname; this.address = address; <START> cause = null; <END> hostnameFromPtrRecord = null; }</code><technical_language>Nit: this consistency</technical_language>

Target:
DefaultExtendedDnsCacheEntry(String hostname, InetAddress address) { this.hostname = hostname; this.address = address; this.cause = null; this.hostnameFromPtrRecord = null; }
Source:
<code>public Void call() throws IOException { String inputPaths = this.props.getProperty(CamusHourlySweeper.INPUT_PATHS); String outputPathStr = this.props.getProperty(CamusHourlySweeper.DEST_PATH); <START> long destinationModTime = getDestinationModTime(this.fs, outputPathStr, true); <END> Path outputPath = new Path(outputPathStr, "outlier"); fs.mkdirs(outputPath); for (String inputPathStr : inputPaths.split(",")) { Path inputPath = new Path(inputPathStr); long outlierMaxTimestamp = Long.MIN_VALUE; for (FileStatus status : fs.globStatus(new Path(inputPath, "*"), new HiddenFilter())) { if (status.getModificationTime() > destinationModTime) { if (outlierMaxTimestamp < status.getModificationTime()) { outlierMaxTimestamp = status.getModificationTime(); } LOG.info("copying outlier file " + status.getPath() + " to " + outputPath); FileUtil.copy(fs, status.getPath(), fs, outputPath, false, true, new Configuration()); fs.rename(status.getPath(), new Path(outputPath, status.getPath().getName())); } } if (outlierMaxTimestamp != Long.MIN_VALUE) { CamusHourlySweeper.createStateFileInFolder(fs, new Path(outputPathStr), outlierMaxTimestamp); } } return null; }</code><technical_language>do need remove file read</technical_language>

Target:
public Void call() throws IOException { String inputPaths = this.props.getProperty(CamusHourlySweeper.INPUT_PATHS); String outputPathStr = this.props.getProperty(CamusHourlySweeper.DEST_PATH); long destinationModTime = getDestinationModTime(this.fs, outputPathStr); Path outputPath = new Path(outputPathStr, "outlier"); fs.mkdirs(outputPath); for (String inputPathStr : inputPaths.split(",")) { Path inputPath = new Path(inputPathStr); long outlierMaxTimestamp = Long.MIN_VALUE; for (FileStatus status : fs.globStatus(new Path(inputPath, "*"), new HiddenFilter())) { if (status.getModificationTime() > destinationModTime) { if (outlierMaxTimestamp < status.getModificationTime()) { outlierMaxTimestamp = status.getModificationTime(); } LOG.info("copying outlier file " + status.getPath() + " to " + outputPath); FileUtil.copy(fs, status.getPath(), fs, outputPath, false, true, new Configuration()); fs.rename(status.getPath(), new Path(outputPath, status.getPath().getName())); } } if (outlierMaxTimestamp != Long.MIN_VALUE) { CamusHourlySweeper.createStateFileInFolder(fs, new Path(outputPathStr), outlierMaxTimestamp); } } return null; }
Source:
<code>public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionManager functionManager) { Type type = boundVariables.getTypeVariable("E"); MethodHandle compareMethodHandle = functionManager.getScalarFunctionImplementation( <START> functionManager.resolveOperator(operatorType, TypeSignatureProvider.fromTypes(ImmutableList.of(type, type)))).getMethodHandle(); <END> return generateAggregation(type, compareMethodHandle); }</code><technical_language>Static import fromTypes</technical_language>

Target:
public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionManager functionManager) { Type type = boundVariables.getTypeVariable("E"); MethodHandle compareMethodHandle = functionManager.getScalarFunctionImplementation( functionManager.resolveOperator(operatorType, fromTypes(ImmutableList.of(type, type)))).getMethodHandle(); return generateAggregation(type, compareMethodHandle); }