auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>static DriverConfigLoader fromUrl(@NonNull URL url) { return new DefaultDriverConfigLoader( () -> { ConfigFactory.invalidateCaches(); Config config = ConfigFactory.defaultOverrides() .withFallback(ConfigFactory.parseURL(url)) .withFallback(ConfigFactory.defaultReference()) .resolve(); <START> return config.getConfig("datastax-java-driver"); <END> }); }</code><technical_language>create a constant datastax-java-driver</technical_language>

Target:
static DriverConfigLoader fromUrl(@NonNull URL url) { return new DefaultDriverConfigLoader( () -> { ConfigFactory.invalidateCaches(); Config config = ConfigFactory.defaultOverrides() .withFallback(ConfigFactory.parseURL(url)) .withFallback(ConfigFactory.defaultReference()) .resolve(); return config.getConfig(DefaultDriverConfigLoader.DEFAULT_ROOT_PATH); }); }
Source:
<code>public static Object getMessageAnnotationProperty(AMQPMessage message, Symbol symbol) { <START> return message.getMessageAnnotationProperty(symbol); <END> }</code><technical_language>existing existing message getMessageAnnotation(Symbol annotation) method</technical_language>

Target:
public static Object getMessageAnnotationProperty(AMQPMessage message, Symbol symbol) { return message.getMessageAnnotation(symbol); }
Source:
<code><START> public static Set<Person> getCurrentDepartmentPresidents(Department department) { <END> Set<Person> departmentPresidents = new HashSet<Person>(); for (final Accountability accountability : department.getDepartmentUnit().getChildsSet()) { if (accountability instanceof PersonFunction && accountability.isActive()) { final PersonFunction personFunction = (PersonFunction) accountability; final Function function = personFunction.getFunction(); if (function != null && function.getFunctionType() == FunctionType.PRESIDENT) { final Party childParty = accountability.getChildParty(); if (childParty != null && childParty.isPerson()) { departmentPresidents.add((Person) childParty); } } } } return departmentPresidents; }</code><technical_language>This public. create a new public API if method is locally</technical_language>

Target:
private static Stream<Person> getCurrentDepartmentPresidents(Department department) { return department.getDepartmentUnit().getChildsSet().stream() .filter(a -> a instanceof PersonFunction && a.isActive() && ((PersonFunction) a).getFunction() != null && ((PersonFunction) a).getFunction().getFunctionType() == FunctionType.PRESIDENT && a.getChildParty() != null && a.getChildParty().isPerson()) .map(a -> (Person) a.getChildParty()); }
Source:
<code>public StateItem[] getStateTable() { StateItem[] stateItems = new <START> StateItem[1]; <END> stateItems[0] = new StateItem(new RGB(174, 174, 51), "Allocated"); return stateItems; }</code><technical_language>3 states</technical_language>

Target:
public StateItem[] getStateTable() { return THE_ONE_TRUE_STATE_TABLE; }
Source:
<code>protected String getFileName() { final String fileText = getFileText(); String[] extensions = getFileExtensions(); for (int i = 0; i < extensions.length; ++i) { String extension = extensions[i]; if (extension.isEmpty() || (!extension.isEmpty() && fileText.endsWith("." + extension))) { return fileText; } } <START> return fileText + "." + extensions[0]; END> }</code><technical_language>empty extension handled here? condition simpler</technical_language>

Target:
protected String getFileName() { final String fileText = getFileText(); String[] extensions = getFileExtensions(); for (int i = 0; i < extensions.length; ++i) { String extension = extensions[i]; if (!extension.isEmpty() && fileText.endsWith("." + extension)) { return fileText; } } if (extensions[0].isEmpty()) { return fileText; } return fileText + "." + extensions[0]; }
Source:
<code>public Map<Partition, List<Message>> getResourceMessages(String resourceName) { Map<Partition, List<Message>> map = _messagesMap.get(resourceName); if (map != null) { <START> return map; <END> } return Collections.emptyMap(); }</code><technical_language>return Collections.unmodifiablemap</technical_language>

Target:
public Map<Partition, List<Message>> getResourceMessages(String resourceName) { Map<Partition, List<Message>> map = _messagesMap.get(resourceName); if (map != null) { return Collections.unmodifiableMap(map); } return Collections.emptyMap(); }
Source:
<code><START> public void createTable(String tableName, KijiTableLayout tableLayout) <END> throws IOException { if (!tableName.equals(tableLayout.getName())) { throw new RuntimeException(String.format( "Table name from layout descriptor '%s' does match table name '%s'.", tableLayout.getName(), tableName)); } createTable(tableLayout.getDesc()); }</code><technical_language>of createTable deleteTable methods throw UnsupportedOperation permanently; table creation/deletion is scope of async-kiji</technical_language>

Target:
public void createTable(String tableName, KijiTableLayout tableLayout) throws IOException { throw new UnsupportedOperationException("Table creation is outside the scope of async-kiji"); }
Source:
<code>private List<StudentAttributes>[] separateStudents(List<StudentAttributes> students) { ArrayList<StudentAttributes>[] lists = new ArrayList[StudentAttributes.UpdateStatus.STATUS_COUNT]; for (int i = 0; i < StudentAttributes.UpdateStatus.STATUS_COUNT; i++) { lists[i] = new ArrayList<StudentAttributes>(); } for (StudentAttributes student : students) { lists[student.updateStatus.numericRepresentation].add(student); <START> } <END> return lists; }</code><technical_language>lost sorting in original code</technical_language>

Target:
private List<StudentAttributes>[] separateStudents(List<StudentAttributes> students) { ArrayList<StudentAttributes>[] lists = new ArrayList[StudentAttributes.UpdateStatus.STATUS_COUNT]; for (int i = 0; i < StudentAttributes.UpdateStatus.STATUS_COUNT; i++) { lists[i] = new ArrayList<StudentAttributes>(); } for (StudentAttributes student : students) { lists[student.updateStatus.numericRepresentation].add(student); } for (int i = 0; i < StudentAttributes.UpdateStatus.STATUS_COUNT; i++) { StudentAttributes.sortByNameAndThenByEmail(lists[i]); } return lists; }
Source:
<code>public DruidExpression toDruidExpression(final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode) { return OperatorConversions.convertCall(plannerContext, rowSignature, rexNode, inputExpressions -> { final DruidExpression arg = inputExpressions.get(0); final Expr digitsExpr = inputExpressions.size() > 1 ? inputExpressions.get(1).parse(plannerContext.getExprMacroTable()) : null; <START> if (digitsExpr == null) { <END> return DruidExpression.fromExpression(StringUtils.format("round(%s)", arg.getExpression())); } else { final int digits = ((Number) digitsExpr.getLiteralValue()).intValue(); String digitsString = DruidExpression.numberLiteral(digits); return DruidExpression.fromExpression(StringUtils.format("round(%s, %s)", arg.getExpression(), digitsString)); } }); }</code><technical_language>required, but, DruidExpression.fromFunctionCall allow write this more cleanly</technical_language>

Target:
public DruidExpression toDruidExpression(final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode) { return OperatorConversions.convertCall(plannerContext, rowSignature, rexNode, inputExpressions -> { return DruidExpression.fromFunctionCall( "round", inputExpressions ); }); }
Source:
<code>public static void webSocketIdleTimeoutMillis(int timeoutMillis) { <START> webSocketIdleTimeoutMillis = Optional.of(timeoutMillis); <END> }</code><technical_language>if (initialized) check exception if initialized</technical_language>

Target:
public static void webSocketIdleTimeoutMillis(int timeoutMillis) { if (initialized) { throwBeforeRouteMappingException(); } if (runFromServlet) { throw new IllegalStateException("WebSockets are only supported in the embedded server"); } webSocketIdleTimeoutMillis = Optional.of(timeoutMillis); }
Source:
<code>public ParquetRecordReader(ReadSupport<T> readSupport) { <START> internalReader = new InternalParquetRecordReader<T>(readSupport, null, null); <END> }</code><technical_language>is a reason prefer setting explicitly instead of call this</technical_language>

Target:
public ParquetRecordReader(ReadSupport<T> readSupport) { this(readSupport, FilterCompat.NOOP); }
Source:
<code>protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.info("handeling error: for message type: {}", e.getMessage(), messageType); OsgpException osgpException = null; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { <START> osgpException = new TechnicalException(ComponentType.DOMAIN_CORE, "An unknown error occurred", e); <END> } this.webServiceResponseMessageSender.send(new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, ResponseMessageResultType.NOT_OK, osgpException, e)); }</code><technical_language>this DOMAIN_CORE, DOMAIN_TARIFF_SWITCHING</technical_language>

Target:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.info("handeling error: for message type: {}", e.getMessage(), messageType); OsgpException osgpException = null; if (e instanceof OsgpException) { osgpException = (OsgpException) e; } else { osgpException = new TechnicalException(ComponentType.DOMAIN_TARIFF_SWITCHING, "An unknown error occurred", e); } this.webServiceResponseMessageSender.send(new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, ResponseMessageResultType.NOT_OK, osgpException, e)); }
Source:
<code>private String reduceTopicPartitionStatsResponses(Map<String, String> responses) { Map<String, Map<String, Set<Integer>>> result = new HashMap<>(); responses.forEach((instance, json) -> { List<KafkaTopicPartitionStatsResponse> responseList; try { responseList = KafkaTopicPartitionStatsResponse.fromJson(json); } catch (Exception e) { _logger.error("Invalid response from instance {}", json, instance); return; } <START> if (responseList.size() >= 0) { <END> responseList.forEach(response -> { if (response.getTopicPartitions() == null || response.getConsumerGroupId().isEmpty()) { _logger.warn("Empty topic partition stats map from instance {}. Ignoring the result", instance); return; } result.putIfAbsent(response.getConsumerGroupId(), new HashMap<>()); Set<TopicPartition> topicPartitions = response.getTopicPartitions(); topicPartitions.forEach(topicPartition -> { Map<String, Set<Integer>> topicPartitionsMap = result.get(response.getConsumerGroupId()); topicPartitionsMap.putIfAbsent(topicPartition.topic(), new HashSet<>()); topicPartitionsMap.get(topicPartition.topic()).add(topicPartition.partition()); }); }); } }); return JsonUtils.toJson(result); }</code><technical_language>unnecessary check; prolly a custom List impl return a negative size :)</technical_language>

Target:
private String reduceTopicPartitionStatsResponses(Map<String, String> responses) { Map<String, KafkaTopicPartitionStatsResponse> result = new HashMap<>(); responses.forEach((instance, json) -> { List<KafkaTopicPartitionStatsResponse> responseList; try { responseList = JsonUtils.fromJson(json, new TypeReference<List<KafkaTopicPartitionStatsResponse>>() { }); } catch (Exception e) { _logger.error("Invalid response from instance {}", json, instance); return; } responseList.forEach(response -> { if (response.getTopicPartitions() == null || StringUtils.isBlank(response.getConsumerGroupId()) || response.getDatastreams() == null) { _logger.warn("Empty topic partition stats map from instance {}. Ignoring the result", instance); return; } KafkaTopicPartitionStatsResponse reducedResponse = result.computeIfAbsent(response.getConsumerGroupId(), k -> new KafkaTopicPartitionStatsResponse(response.getConsumerGroupId())); reducedResponse.getDatastreams().addAll(response.getDatastreams()); Map<String, Set<Integer>> topicPartitions = response.getTopicPartitions(); topicPartitions.forEach((topic, partitions) -> { Map<String, Set<Integer>> reducedTopicPartitions = reducedResponse.getTopicPartitions(); Set<Integer> reducedPartitions = reducedTopicPartitions.computeIfAbsent(topic, k -> new HashSet<>()); reducedPartitions.addAll(partitions); }); }); }); return JsonUtils.toJson(result.values()); }
Source:
<code>private void loadServer() { final String serverUrl = String.format("<LINK_0>", SERVER_PORT, DEPLOYMENT_NAME, InfiniteServlet.URL_PATTERN); try (CloseableHttpClient client = HttpClientBuilder.create().build()) { while (!Thread.currentThread().isInterrupted()) { Thread.sleep(100); HttpGet httpGet = new HttpGet(serverUrl); CloseableHttpResponse response = client.execute(httpGet); HttpEntity entity = response.getEntity(); <START> LOGGER.debug(EntityUtils.toString(entity)); <END> EntityUtils.consumeQuietly(entity); } } catch (IOException | InterruptedException e) { LOGGER.debug(e); } }</code><technical_language>more beneficial check/log response code? Instead of response? if reading entity, need consumeQuietly entity read it</technical_language>

Target:
private void loadServer() { final String serverUrl = String.format("<LINK_0>", SERVER_PORT, DEPLOYMENT_NAME, TextResponseServlet.URL_PATTERN); try (CloseableHttpClient client = HttpClientBuilder.create().build()) { while (!Thread.currentThread().isInterrupted()) { Thread.sleep(100); HttpGet httpGet = new HttpGet(serverUrl); CloseableHttpResponse response = client.execute(httpGet); LOGGER.debug(response.getStatusLine().getStatusCode()); } } catch (IOException | InterruptedException e) { LOGGER.debug(e); } }
Source:
<code>public boolean login() throws LoginException { if (super.login() == true) { log.debug("super.login()==true"); return true; } Object credential = getCredential(); if (credential instanceof RemotingConnectionCredential) { Connection con = ((RemotingConnectionCredential) credential).getConnection(); Principal up = null; UserInfo userInfo = con.getUserInfo(); if (userInfo instanceof SubjectUserInfo) { for (Principal current : ((SubjectUserInfo) userInfo).getPrincipals()) { if (current instanceof RealmUser) { up = current; break; } } } if (up == null) { for (Principal current : con.getPrincipals()) { if (current instanceof UserPrincipal) { up = current; break; } } } if (up != null) { identity = up; if (getUseFirstPass()) { String userName = identity.getName(); log.debugf("Storing username '%s'", userName); sharedState.put("javax.security.auth.login.name", identity); if (useClientCert) { SSLSession session = con.getSslSession(); if (session != null) { try { <START> credential = session.getPeerCertificates()[0]; <END> log.debug("Using certificate as credential."); } catch (SSLPeerUnverifiedException e) { log.debugf("No peer certificate available for '%s'", userName); } } } sharedState.put("javax.security.auth.login.password", credential); } loginOk = true; return true; } } return false; }</code><technical_language>I need a new configuration option - allow useClientCert another String e.g. new - a new option useNewClientCert switch new API</technical_language>

Target:
public boolean login() throws LoginException { if (super.login() == true) { log.debug("super.login()==true"); return true; } Object credential = getCredential(); if (credential instanceof RemotingConnectionCredential) { Connection con = ((RemotingConnectionCredential) credential).getConnection(); Principal up = null; UserInfo userInfo = con.getUserInfo(); if (userInfo instanceof SubjectUserInfo) { for (Principal current : ((SubjectUserInfo) userInfo).getPrincipals()) { if (current instanceof RealmUser) { up = current; break; } } } if (up == null) { for (Principal current : con.getPrincipals()) { if (current instanceof UserPrincipal) { up = current; break; } } } if (up != null) { identity = up; if (getUseFirstPass()) { String userName = identity.getName(); log.debugf("Storing username '%s'", userName); sharedState.put("javax.security.auth.login.name", identity); if (useNewClientCert) { SSLSession session = con.getSslSession(); if (session != null) { try { credential = session.getPeerCertificates()[0]; log.debug("Using new certificate as credential."); } catch (SSLPeerUnverifiedException e) { log.debugf("No peer certificate available for '%s'", userName); } } } else if (useClientCert) { SSLSession session = con.getSslSession(); if (session != null) { try { credential = session.getPeerCertificateChain()[0]; log.debug("Using certificate as credential."); } catch (SSLPeerUnverifiedException e) { log.debugf("No peer certificate available for '%s'", userName); } } } sharedState.put("javax.security.auth.login.password", credential); } loginOk = true; return true; } } return false; }
Source:
<code>public boolean equals(Object o) { Pair<?> pair = (Pair<?>) o; <START> return pair.a == a && pair.b == b || pair.a == b && pair.b == a; <END> }</code><technical_language>version displays a clear intention explicitly exhibits operator precedence. Please revert</technical_language>

Target:
public boolean equals(Object o) { Pair<?> pair = (Pair<?>) o; return (pair.a == a && pair.b == b) || (pair.a == b && pair.b == a); }
Source:
<code>private void updateMaterial(Material material) { try { if (!materialUpdateService.updateMaterial(material)) { retryQueue.add(material); } } catch (Exception e) { <START> retryQueue.add(material); <END> } }</code><technical_language>This is unexpected. add a log statement here</technical_language>

Target:
private void updateMaterial(Material material) { if(skipUpdate) return; try { if (!materialUpdateService.updateMaterial(material)) { retryQueue.add(material); } } catch (Exception e) { HealthStateScope scope = HealthStateScope.forMaterialUpdate(material); serverHealthService.update(error(format("Error updating Dependency Material %s", material.getUriForDisplay()), e.getMessage(), general(scope))); retryQueue.add(material); } }
Source:
<code>public void findAll() throws Exception { ServiceProvider provider = new ServiceProvider(new ID("id1"), "name", "desc"); final List<ServiceProvider> providers = Lists.newArrayList(provider); context.checking(new Expectations() {{ oneOf(repository).findAll(); will(returnValue(providers)); }}); Reply<?> reply = service.findAll(); <START> ServiceProviderDTO dto = new ServiceProviderDTO(provider.id, provider.name, provider.description); <END> List<ServiceProviderDTO> dtos = Lists.newArrayList(dto); assertThat(reply, containsValue(dtos)); assertThat(reply, isOk()); }</code><technical_language>please create this beginning of test</technical_language>

Target:
public void findAll() throws Exception { ServiceProvider provider = new ServiceProvider(new ID("id1"), "name", "desc"); ServiceProviderDTO dto = new ServiceProviderDTO(provider.id, provider.name, provider.description); List<ServiceProviderDTO> dtos = Lists.newArrayList(dto); final List<ServiceProvider> providers = Lists.newArrayList(provider); context.checking(new Expectations() {{ oneOf(repository).findAll(); will(returnValue(providers)); }}); Reply<?> reply = service.findAll(); assertThat(reply, containsValue(dtos)); assertThat(reply, isOk()); }
Source:
<code>public void close() throws IOException { <START> if (httpClient != null) { <END> httpClient.close(); } }</code><technical_language>httpClient null a final field get initialized in constructor</technical_language>

Target:
public void close() throws IOException { httpClient.close(); }
Source:
<code>public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof WindowSpec) { WindowSpec another = (WindowSpec) obj; return TUtil.checkEquals(windowName, another.windowName) && TUtil.checkEquals(partitionKeys, another.partitionKeys) && <START> TUtil.checkEquals(sortSpecs, another.sortSpecs); <END> } else { return false; } }</code><technical_language>windowFrame compared</technical_language>

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof WindowSpec) { WindowSpec another = (WindowSpec) obj; return TUtil.checkEquals(windowName, another.windowName) && TUtil.checkEquals(partitionKeys, another.partitionKeys) && TUtil.checkEquals(sortSpecs, another.sortSpecs) && TUtil.checkEquals(windowFrame, another.windowFrame); } else { return false; } }
Source:
<code>public void addForcibly(DelayedEntry delayedEntry) { <START> <END> }</code><technical_language>IllegalStateException</technical_language>

Target:
public void addForcibly(DelayedEntry delayedEntry) { throw new IllegalStateException("No addForcibly call is expected from a write-through store!"); }
Source:
<code>void buildLock() { String studySubjectLabel = studySubject.getLabel(); html.table(0).border("0").cellpadding("0").cellspacing("0").close(); html.tr(0).valign("top").close().td(0).close(); html.div().id("Lock_" + studySubjectLabel + "_" + crf.getId() + "_" + rowCount) .style("position: absolute; visibility: hidden; z-index: 3; width: 50px; height: 30px; top: 0px;").close(); <START> if ((eventCrfBean.getRemoved()!=null && eventCrfBean.getRemoved()) || (eventCrfBean.getArchived()!=null && eventCrfBean.getArchived())) { <END> lockLinkBuilder(html, studySubjectLabel, rowCount, crf, "images/CRF_status_icon_Invalid_collapse.gif", "images/CRF_status_icon_Invalid.gif"); } else if (eventCrfBean.getWorkflowStatus() == EventCrfWorkflowStatusEnum.COMPLETED) { lockLinkBuilder(html, studySubjectLabel, rowCount, crf, "images/CRF_status_icon_Complete_collapse.gif", "images/CRF_status_icon_Complete.gif"); } else if (eventCrfBean.getWorkflowStatus() == EventCrfWorkflowStatusEnum.NOT_STARTED) { lockLinkBuilder(html, studySubjectLabel, rowCount, crf, "images/CRF_status_icon_Scheduled.gif", "images/CRF_status_icon_Scheduled.gif"); } else if (eventCrfBean.getWorkflowStatus() == EventCrfWorkflowStatusEnum.INITIAL_DATA_ENTRY) { lockLinkBuilder(html, studySubjectLabel, rowCount, crf, "images/CRF_status_icon_Started.gif", "images/CRF_status_icon_Started.gif"); } html.divEnd(); }</code><technical_language>BooleanUtils</technical_language>

Target:
void buildLock() { String studySubjectLabel = studySubject.getLabel(); html.table(0).border("0").cellpadding("0").cellspacing("0").close(); html.tr(0).valign("top").close().td(0).close(); html.div().id("Lock_" + studySubjectLabel + "_" + crf.getId() + "_" + rowCount) .style("position: absolute; visibility: hidden; z-index: 3; width: 50px; height: 30px; top: 0px;").close(); if (BooleanUtils.isTrue(eventCrfBean.getRemoved()) || BooleanUtils.isTrue(eventCrfBean.getArchived())) { lockLinkBuilder(html, studySubjectLabel, rowCount, crf, "images/CRF_status_icon_Invalid_collapse.gif", "images/CRF_status_icon_Invalid.gif"); } else if (eventCrfBean.getWorkflowStatus() == EventCrfWorkflowStatusEnum.COMPLETED) { lockLinkBuilder(html, studySubjectLabel, rowCount, crf, "images/CRF_status_icon_Complete_collapse.gif", "images/CRF_status_icon_Complete.gif"); } else if (eventCrfBean.getWorkflowStatus() == EventCrfWorkflowStatusEnum.NOT_STARTED) { lockLinkBuilder(html, studySubjectLabel, rowCount, crf, "images/CRF_status_icon_Scheduled.gif", "images/CRF_status_icon_Scheduled.gif"); } else if (eventCrfBean.getWorkflowStatus() == EventCrfWorkflowStatusEnum.INITIAL_DATA_ENTRY) { lockLinkBuilder(html, studySubjectLabel, rowCount, crf, "images/CRF_status_icon_Started.gif", "images/CRF_status_icon_Started.gif"); } html.divEnd(); }
Source:
<code>public Vector3 getCurrentTangent() { <START> Vector3 start_portion = mControlPoint.clone().subtract(mPoint1).multiply(1-mCurrent); <END> Vector3 end_portion = mPoint2.clone().subtract(mControlPoint).multiply(mCurrent); Vector3 result = start_portion.clone().add(end_portion); result.normalize(); return result; }</code><technical_language>Calling clone time this animation this method generate a good deal of garbage. scratch members instead</technical_language>

Target:
public Vector3 getCurrentTangent() { Vector3 startPortion = new Vector3(mStartTangent).multiply(1-mCurrent); Vector3 endPortion = new Vector3(mEndTangent).multiply(mCurrent); return startPortion.add(endPortion); }
Source:
<code>public void search() { OrmUtils.withinSession( sessionFactory, session -> { FullTextSession ftSession = Search.getFullTextSession( session ); FullTextQuery<ParentIndexedEntity> query = ftSession.search( Arrays.asList( IndexedEntity.class, YetAnotherIndexedEntity.class ) ) .query() .asEntity() .predicate( f -> f.matchAll().toPredicate() ) .build(); query.setFirstResult( 3 ); query.setMaxResults( 2 ); backendMock.expectSearchObjects( Arrays.asList( IndexedEntity.INDEX, YetAnotherIndexedEntity.INDEX ), b -> b .firstResultIndex( 3L ) .maxResultsCount( 2L ), StubSearchWorkBehavior.of( 6L, reference( IndexedEntity.INDEX, "0" ), reference( YetAnotherIndexedEntity.INDEX, "1" ) ) ); List<ParentIndexedEntity> result = query.list(); backendMock.verifyExpectationsMet(); Assertions.assertThat( result ) .containsExactly( session.get( IndexedEntity.class, 0 ), session.get( YetAnotherIndexedEntity.class, 1 ) ); <START> backendMock.resetExpectations(); <END> backendMock.expectSearchObjects( Arrays.asList( IndexedEntity.INDEX, YetAnotherIndexedEntity.INDEX ), b -> b .firstResultIndex( 3L ) .maxResultsCount( 2L ), StubSearchWorkBehavior.of( 6L ) ); long resultSize = query.getResultSize(); backendMock.verifyExpectationsMet(); Assertions.assertThat( resultSize ).isEqualTo( 6L ); } ); }</code><technical_language>This necessary, called "verifyExpectationsMet" fail. necessary</technical_language>

Target:
public void search() { OrmUtils.withinSession( sessionFactory, session -> { FullTextSession ftSession = Search.getFullTextSession( session ); FullTextQuery<ParentIndexedEntity> query = ftSession.search( Arrays.asList( IndexedEntity.class, YetAnotherIndexedEntity.class ) ) .query() .asEntity() .predicate( f -> f.matchAll().toPredicate() ) .build(); query.setFirstResult( 3 ); query.setMaxResults( 2 ); backendMock.expectSearchObjects( Arrays.asList( IndexedEntity.INDEX, YetAnotherIndexedEntity.INDEX ), b -> b .firstResultIndex( 3L ) .maxResultsCount( 2L ), StubSearchWorkBehavior.of( 6L, reference( IndexedEntity.INDEX, "0" ), reference( YetAnotherIndexedEntity.INDEX, "1" ) ) ); List<ParentIndexedEntity> result = query.list(); backendMock.verifyExpectationsMet(); Assertions.assertThat( result ) .containsExactly( session.get( IndexedEntity.class, 0 ), session.get( YetAnotherIndexedEntity.class, 1 ) ); backendMock.expectCount( Arrays.asList( IndexedEntity.INDEX, YetAnotherIndexedEntity.INDEX ), 6L ); long resultSize = query.getResultSize(); backendMock.verifyExpectationsMet(); Assertions.assertThat( resultSize ).isEqualTo( 6L ); } ); }
Source:
<code>public Tuple exec(Tuple input) throws IOException { Tuple t = mTupleFactory.newTuple(2); try{ DataBag bg = (DataBag) input.get(0); Long cxl = null; if(bg.iterator().hasNext()) { Tuple tp = bg.iterator().next(); cxl = getFreq(tp); } if(cxl == null || cxl.longValue() < 0) { <START> t.set(0, null); <END> t.set(1, null); warn("Non-positive input frequency number: " + cxl, PigWarning.UDF_WARNING_1); } else { long cx = cxl.longValue(); double logcx = (cx > 0 ? Math.log(cx) : 0); double cxlogcx = cx * logcx; t.set(0, cxlogcx); t.set(1, cxl); } return t; } catch (NumberFormatException nfe) { warn("Caught invalid format input number, exception: " + nfe, PigWarning.UDF_WARNING_2); try { t.set(0, null); t.set(1, null); } catch(ExecException e) { throw e; } return t; } catch (ExecException ee) { throw ee; } catch(Exception e) { int errCode = 10080; String msg = "Error while computing entropy in " + this.getClass().getSimpleName(); throw new ExecException(msg, errCode, PigException.BUG, e); } }</code><technical_language>i if throw exception instead. people notice is a problem</technical_language>

Target:
public Tuple exec(Tuple input) throws IOException { Tuple t = mTupleFactory.newTuple(2); try{ DataBag bg = (DataBag) input.get(0); Long cxl = null; if(bg.iterator().hasNext()) { Tuple tp = bg.iterator().next(); cxl = ((Number)(tp.get(0))).longValue(); } if(cxl == null || cxl.longValue() < 0) { t.set(0, null); t.set(1, null); warn("Non-positive input frequency number: " + cxl, PigWarning.UDF_WARNING_1); } else { long cx = cxl.longValue(); double logcx = (cx > 0 ? Math.log(cx) : 0); double cxlogcx = cx * logcx; t.set(0, cxlogcx); t.set(1, cxl); } return t; } catch (ExecException ee) { throw ee; } catch(Exception e) { int errCode = 10080; String msg = "Error while computing entropy in " + this.getClass().getSimpleName(); throw new ExecException(msg, errCode, PigException.BUG, e); } }
Source:
<code>private void computeUsedNames() { <START> fUsedGetterNames= new ArrayList<>(0); <END> fUsedSetterNames= new ArrayList<>(0); IVariableBinding binding= fFieldDeclaration.resolveBinding(); ITypeBinding type= binding.getType(); IMethodBinding[] methods= binding.getDeclaringClass().getDeclaredMethods(); for (int i= 0; i < methods.length; i++) { IMethodBinding method= methods[i]; ITypeBinding[] parameters= methods[i].getParameterTypes(); if (parameters == null || parameters.length == 0) { fUsedGetterNames.add(method); } else if (parameters.length == 1 && parameters[0] == type) { fUsedSetterNames.add(method); } } }</code><technical_language>Again, unnecessary change for fix</technical_language>

Target:
private void computeUsedNames() { fUsedReadNames= new ArrayList<>(0); fUsedModifyNames= new ArrayList<>(0); IVariableBinding binding= fFieldDeclaration.resolveBinding(); ITypeBinding type= binding.getType(); IMethodBinding[] methods= binding.getDeclaringClass().getDeclaredMethods(); for (int i= 0; i < methods.length; i++) { IMethodBinding method= methods[i]; ITypeBinding[] parameters= methods[i].getParameterTypes(); if (parameters == null || parameters.length == 0) { fUsedReadNames.add(method); } else if (parameters.length == 1 && parameters[0] == type) { fUsedModifyNames.add(method); } } }
Source:
<code><START> public boolean bridge$allowsBlockBulkCapture() { <END> return this.entityType.allowsBlockBulkCapture; }</code><technical_language>Is EntityTypeBridge? add is inherited TimingsHolder (or interface is)</technical_language>

Target:
public boolean bridge$allowsBlockBulkCapture() { return this.type.allowsBlockBulkCapture; }
Source:
<code>protected void onSaveInstanceState(Bundle outState) { outState = mExpandableAdapter.onSaveInstanceState(outState); <START> super.onSaveInstanceState(outState); <END> }</code><technical_language>generally super call methods a need switch</technical_language>

Target:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState = mExpandableAdapter.onSaveInstanceState(outState); }
Source:
<code>void setDictionary(Dictionary dictionary) { dictionaryResults = new BitSet(dictionary.getMaxId()+1); <START> for (int i = 0, end = dictionary.getMaxId()+1; i < end; i++) { <END> dictionaryResults.set(i, update(dictionary, i)); } }</code><technical_language>following? for (int i = 0; i <= dictionary.getMaxId(); i++) {</technical_language>

Target:
void setDictionary(Dictionary dictionary) { dictionaryResults = new BitSet(dictionary.getMaxId()+1); for (int i = 0; i <= dictionary.getMaxId(); i++) { dictionaryResults.set(i, evaluateFilterForDictionaryElement(dictionary, i)); } }
Source:
<code>public void addOfficial(Official official) { <START> if(official == null || this.officials.contains(official)) { <END> return; } this.officials.add(official); }</code><technical_language>Again. if game official added</technical_language>

Target:
public int addOfficial(Official official) { if(official == null || this.officials.contains(official)) { return -1; } if(this.officials.size() == tournament.OFFICIALS_PER_GAME) { return 0; } this.officials.add(official); return 1; }
Source:
<code>public void purge(OrderType orderType, RequestContext context) throws ResponseException { <START> throw new ResourceDoesNotSupportOperationException(); <END> }</code><technical_language>This is supported, please implement</technical_language>

Target:
public void purge(OrderType orderType, RequestContext context) throws ResponseException { if (orderType == null) return; Context.getOrderService().purgeOrderType(orderType); }
Source:
<code>public void regression() { <START> PROVIDER.discountFactors(USD); <END> double price = PRICER.price(FUTURE, PROVIDER); assertEquals(price, 1.022245377054993, TOL); }</code><technical_language>used</technical_language>

Target:
public void regression() { double price = PRICER.price(FUTURE, PROVIDER); assertEquals(price, 1.022245377054993, TOL); }
Source:
<code><START> public @Nullable CatchupServer resolveIfBackupEnabled( Config config ) <END> { if ( config.get( OnlineBackupSettings.online_backup_enabled ) ) { return new CatchupServer( logProvider, userLogProvider, localDatabaseStoreIdSupplier, platformModule.dependencies.provideDependency( TransactionIdStore.class ), platformModule.dependencies.provideDependency( LogicalTransactionStore.class ), localDatabaseDataSourceSupplier, localDatabaseIsAvailable, coreSnapshotService, platformModule.monitors, new CheckpointerSupplier( platformModule.dependencies ), fileSystem, platformModule.pageCache, backupAddressForTxProtocol( config ), platformModule.storeCopyCheckPointMutex, serverPipelineWrapper ); } else { return null; } }</code><technical_language>return Optional? wrapping result in anyway</technical_language>

Target:
public Optional<CatchupServer> resolveIfBackupEnabled( Config config ) { if ( config.get( OnlineBackupSettings.online_backup_enabled ) ) { return Optional.of( new CatchupServer( logProvider, userLogProvider, localDatabaseStoreIdSupplier, platformModule.dependencies.provideDependency( TransactionIdStore.class ), platformModule.dependencies.provideDependency( LogicalTransactionStore.class ), localDatabaseDataSourceSupplier, localDatabaseIsAvailable, coreSnapshotService, platformModule.monitors, new CheckpointerSupplier( platformModule.dependencies ), fileSystem, platformModule.pageCache, backupAddressForTxProtocol( config ), platformModule.storeCopyCheckPointMutex, serverPipelineWrapper ) ); } else { return Optional.empty(); } }
Source:
<code>private static SymbolStatsEstimate addColumnStats(SymbolStatsEstimate leftStats, double leftRows, SymbolStatsEstimate rightStats, double rightRows, double newRowCount, RangeAdditionStrategy strategy) { StatisticRange leftRange = StatisticRange.from(leftStats); StatisticRange rightRange = StatisticRange.from(rightStats); StatisticRange sum = strategy.add(leftRange, rightRange); double nullsCountRight = rightStats.getNullsFraction() * rightRows; double nullsCountLeft = leftStats.getNullsFraction() * leftRows; double totalSizeLeft = (leftRows - nullsCountLeft) * leftStats.getAverageRowSize(); double totalSizeRight = (rightRows - nullsCountRight) * rightStats.getAverageRowSize(); <START> <END> return SymbolStatsEstimate.builder() .setStatisticsRange(sum) .setAverageRowSize((totalSizeLeft + totalSizeRight) / newRowCount) .setNullsFraction((nullsCountLeft + nullsCountRight) / newRowCount) .build(); }</code><technical_language>I do for subtractColumnStats</technical_language>

Target:
private static SymbolStatsEstimate addColumnStats(SymbolStatsEstimate leftStats, double leftRows, SymbolStatsEstimate rightStats, double rightRows, double newRowCount, RangeAdditionStrategy strategy) { StatisticRange leftRange = StatisticRange.from(leftStats); StatisticRange rightRange = StatisticRange.from(rightStats); StatisticRange sum = strategy.add(leftRange, rightRange); double nullsCountRight = rightStats.getNullsFraction() * rightRows; double nullsCountLeft = leftStats.getNullsFraction() * leftRows; double totalSizeLeft = (leftRows - nullsCountLeft) * leftStats.getAverageRowSize(); double totalSizeRight = (rightRows - nullsCountRight) * rightStats.getAverageRowSize(); double newNullsFraction = (nullsCountLeft + nullsCountRight) / newRowCount; double newNonNullsRowCount = newRowCount * (1.0 - newNullsFraction); return SymbolStatsEstimate.builder() .setStatisticsRange(sum) .setAverageRowSize((totalSizeLeft + totalSizeRight) / newNonNullsRowCount) .setNullsFraction(newNullsFraction) .build(); }
Source:
<code>public Long getId() throws IdGenerationException { final Long count = counter.getAndIncrement(); final int numPartitionsInEval = numPartitions / numInitialEvals + <START> ((numPartitions % numInitialEvals >= memoryStoreId) ? 1 : 0); <END> final long partitionSize = Long.MAX_VALUE / numPartitions; final long offset = count / numPartitionsInEval; if (offset >= partitionSize) { throw new IdGenerationException("The number of ids in one partition has exceeded its limit."); } final int partitionId = memoryStoreId + numInitialEvals * (count.intValue() % numPartitionsInEval); return partitionId * partitionSize + offset; }</code><technical_language>'>=' '>'. memoryStoreId starts 0 (by registerEvaluator() of PartitionManager)</technical_language>

Target:
public Long getId() throws IdGenerationException { final Long count = counter.getAndIncrement(); final int numPartitionsInEval = numPartitions / numInitialEvals + ((numPartitions % numInitialEvals > memoryStoreId) ? 1 : 0); final int partitionId = memoryStoreId + numInitialEvals * (count.intValue() % numPartitionsInEval); final long partitionSize = Long.MAX_VALUE / numPartitions; final long offset = count / numPartitionsInEval; if (offset >= partitionSize) { throw new IdGenerationException("The number of ids in one partition has exceeded its limit."); } return partitionId * partitionSize + offset; }
Source:
<code>protected synchronized void assertLocationInitialized() throws IllegalStateException { if (location != null && initialized) return; Activator activator = Activator.getDefault(); if (activator == null) throw new IllegalStateException(CommonMessages.activator_not_available); Location service = activator.getInstanceLocation(); if (service == null) throw new IllegalStateException(CommonMessages.meta_noDataModeSpecified); boolean explicitInitRequired = <START> Boolean.getBoolean(REQUIRES_EXPLICIT_INIT); <END> if (explicitInitRequired && !service.isSet()) { throw new IllegalStateException(CommonMessages.meta_instanceDataUnspecified); } try { URL url = service.getURL(); if (url == null) throw new IllegalStateException(CommonMessages.meta_instanceDataUnspecified); location = new Path(new File(url.getFile()).toString()); initializeLocation(); } catch (CoreException e) { throw new IllegalStateException(e.getMessage()); } }</code><technical_language>This configuration system properties, intead get configuration BundleContext. like: boolean explicitInitRequired = Boolean.valueOf(Activator.getContext().getProperty(REQUIRES_EXPLICIT_INIT)); This is important if multiple equinox instances embedded in a single VM. ability configured independently</technical_language>

Target:
protected synchronized void assertLocationInitialized() throws IllegalStateException { if (location != null && initialized) return; Activator activator = Activator.getDefault(); if (activator == null) throw new IllegalStateException(CommonMessages.activator_not_available); Location service = activator.getInstanceLocation(); if (service == null) throw new IllegalStateException(CommonMessages.meta_noDataModeSpecified); boolean explicitInitRequired = Boolean.valueOf(Activator.getContext().getProperty(REQUIRES_EXPLICIT_INIT)); if (explicitInitRequired && !service.isSet()) { throw new IllegalStateException(CommonMessages.meta_instanceDataUnspecified); } try { URL url = service.getURL(); if (url == null) throw new IllegalStateException(CommonMessages.meta_instanceDataUnspecified); location = new Path(new File(url.getFile()).toString()); initializeLocation(); } catch (CoreException e) { throw new IllegalStateException(e.getMessage()); } }
Source:
<code><START> public static boolean selectorsOverlap(Map<String, String> source, Map<String, String> target) { <END> if(!target.keySet().containsAll(source.keySet())) { return false; } for (String key : source.keySet()) { if(!target.get(key).equals(source.get(key))) { return false; } } return true; }</code><technical_language>this is a public method perform some null checks, assert statements</technical_language>

Target:
public static boolean selectorsOverlap(Map<String, String> source, Map<String, String> target) { if(source == null || target == null) return false; if(!target.keySet().containsAll(source.keySet())) { return false; } for (String key : source.keySet()) { if(!Objects.deepEquals(target.get(key),source.get(key))) { return false; } } return true; }
Source:
<code><START> @Override public void onCreate(Bundle savedInstanceState) { <END> super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null) { mIsSignupFromLoginEnabled = args.getBoolean(ARG_SIGNUP_FROM_LOGIN_ENABLED, false); } }</code><technical_language>Overrides generally separate lines (I styles set correctly check rest of this file)</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null) { mIsSignupFromLoginEnabled = args.getBoolean(ARG_SIGNUP_FROM_LOGIN_ENABLED, false); } }
Source:
<code>public void removeListener(String listenerName) { if (this.listenersByEvent == null) { initializeListeners(); <START> } <END> synchronized (this.listenersByEvent) { getListenersByName().remove(listenerName); for (Map.Entry<Class<? extends Event>, Map<String, RegisteredListener>> entry : this.listenersByEvent .entrySet()) { entry.getValue().remove(listenerName); if (entry.getValue().isEmpty()) { this.listenersByEvent.remove(entry.getKey()); } } } }</code><technical_language>good change runtime code for tests. justification is good enough IMO</technical_language>

Target:
public void removeListener(String listenerName) { getListenersByName().remove(listenerName); for (Map.Entry<Class<? extends Event>, Map<String, RegisteredListener>> entry : this.listenersByEvent .entrySet()) { entry.getValue().remove(listenerName); if (entry.getValue().isEmpty()) { this.listenersByEvent.remove(entry.getKey()); } } }
Source:
<code>public void testRuntime() throws Exception { setProperty(); <START> KernelServicesBuilder builder = createKernelServicesBuilder(UndertowSubsystem100TestCase.RUNTIME) <END> .setSubsystemXml(getSubsystemXml()); KernelServices mainServices = builder.build(); testRuntime(mainServices, virtualHostName, flag); }</code><technical_language>Access static fields directly, e.g. AbstractUndertowSubsystemTestCase.RUNTIME</technical_language>

Target:
public void testRuntime() throws Exception { setProperty(); KernelServicesBuilder builder = createKernelServicesBuilder(AbstractUndertowSubsystemTestCase.RUNTIME) .setSubsystemXml(getSubsystemXml()); KernelServices mainServices = builder.build(); testRuntime(mainServices, virtualHostName, flag); }
Source:
<code>public String toString() { <START> return "" + invoke(); <END> }</code><technical_language>![Oh Hell No!](<LINK_0></technical_language>

Target:
public String toString() { return format("%s", value()); }
Source:
<code><START> public int getTabsPaddingLeft() { <END> return tabsPaddingLeft; }</code><technical_language>client point of view this getPaddingLeft() (and ..Right())? is this padding applied individual tab</technical_language>

Target:
int getTabsPaddingLeft() { return tabsPaddingLeft; }
Source:
<code>public CompressionHeaderFactory() { <START> baosForTagValues = new ByteArrayOutputStream(1024 * 1024); <END> }</code><technical_language>Magic number -> symbolic constant</technical_language>

Target:
public CompressionHeaderFactory() { baosForTagValues = new ByteArrayOutputStream(TAG_VALUE_BUFFER_SIZE); }
Source:
<code>public int getRandomWeight(Random random) { <START> return Math.abs(random.nextInt()%this.totalWeight); <END> }</code><technical_language>random.nextInt(this.totalWeight)</technical_language>

Target:
public int getRandomWeight(Random random) { return random.nextInt(this.totalWeight); }
Source:
<code>public synchronized void handleMessageLayoutCommit( @NonNull CorfuPayloadMsg<LayoutCommittedRequest> msg, ChannelHandlerContext ctx, @NonNull IServerRouter r) { if (msg.getPayload().getForce()) { forceLayout(msg, ctx, r); return; } if (!isBootstrapped(msg, ctx, r)) { return; } final long msgEpoch = msg.getPayload().getEpoch(); final long serverEpoch = getServerEpoch(); final Layout msgLayout = msg.getPayload().getLayout(); if (msgEpoch < serverEpoch) { r.sendResponse(ctx, msg, new CorfuPayloadMsg<>(CorfuMsgType.WRONG_EPOCH, serverEpoch)); return; } <START> setCurrentLayout(msgLayout); <END> serverContext.setServerEpoch(msgEpoch, r); log.info("New layout committed: {}", msgLayout); r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.ACK)); }</code><technical_language>I original name commitLayout is more descriptive, change back</technical_language>

Target:
public synchronized void handleMessageLayoutCommit( @NonNull CorfuPayloadMsg<LayoutCommittedRequest> msg, ChannelHandlerContext ctx, @NonNull IServerRouter r) { if (msg.getPayload().getForce()) { forceLayout(msg, ctx, r); return; } if (!isBootstrapped(msg, ctx, r)) { return; } final long payloadEpoch = msg.getPayload().getEpoch(); final long serverEpoch = getServerEpoch(); final Layout msgLayout = msg.getPayload().getLayout(); if (payloadEpoch < serverEpoch) { r.sendResponse(ctx, msg, new CorfuPayloadMsg<>(CorfuMsgType.WRONG_EPOCH, serverEpoch)); return; } setCurrentLayout(msgLayout); serverContext.setServerEpoch(payloadEpoch, r); log.info("New layout committed: {}", msgLayout); r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.ACK)); }
Source:
<code>public static void main(String[] args) throws Exception { EnvironmentInformation.logEnvironmentInfo(LOG, "TaskManager", args); SignalHandler.register(LOG); JvmShutdownSafeguard.installAsShutdownHook(LOG); long maxOpenFileHandles = EnvironmentInformation.getOpenFileHandlesLimit(); if (maxOpenFileHandles != -1L) { LOG.info("Maximum number of open file descriptors is {}.", maxOpenFileHandles); } else { LOG.info("Cannot determine the maximum number of open file descriptors"); } final Configuration config = loadConfiguration(args); final String resourceIDPrefix = config.get(TaskManagerOptions.TASK_MANAGER_RESOURCE_ID_PREFIX); <START> ResourceID taskManagerResourceID; <END> if (resourceIDPrefix == null) { taskManagerResourceID = new ResourceID(new AbstractID().toString()); } else { taskManagerResourceID = new ResourceID(resourceIDPrefix + "-" + UUID.randomUUID().toString().substring(0, 6)); } runTaskManagerSecurely(config, taskManagerResourceID); }</code><technical_language>Add final for taskManagerResourceID here</technical_language>

Target:
public static void main(String[] args) throws Exception { EnvironmentInformation.logEnvironmentInfo(LOG, "TaskManager", args); SignalHandler.register(LOG); JvmShutdownSafeguard.installAsShutdownHook(LOG); long maxOpenFileHandles = EnvironmentInformation.getOpenFileHandlesLimit(); if (maxOpenFileHandles != -1L) { LOG.info("Maximum number of open file descriptors is {}.", maxOpenFileHandles); } else { LOG.info("Cannot determine the maximum number of open file descriptors"); } runTaskManagerSecurely(args); }
Source:
<code>public MethodCallExpr buildBinding(DrlxParseSuccess drlxParseResult) { MethodCallExpr bindDSL = new MethodCallExpr(null, BIND_CALL); if (drlxParseResult.hasUnificationVariable()) { bindDSL.addArgument(context.getVarExpr(drlxParseResult.getUnificationVariable())); } else { bindDSL.addArgument(context.getVarExpr(drlxParseResult.getExprBinding())); } final Expression constraintExpression = getConstraintExpression(drlxParseResult); <START> drlxParseResult.getUsedDeclarationsOnLeft().forEach(d -> bindDSL.addArgument(toVar(d))); <END> bindDSL.addArgument(constraintExpression); final Optional<MethodCallExpr> methodCallExpr = buildReactOn(drlxParseResult); methodCallExpr.ifPresent(bindDSL::addArgument); return bindDSL; }</code><technical_language>(almost) call static toVar directly, context.getVar() care of managing scope of variable</technical_language>

Target:
public MethodCallExpr buildBinding(DrlxParseSuccess drlxParseResult) { MethodCallExpr bindDSL = new MethodCallExpr(null, BIND_CALL); if (drlxParseResult.hasUnificationVariable()) { bindDSL.addArgument(context.getVarExpr(drlxParseResult.getUnificationVariable())); } else { bindDSL.addArgument(context.getVarExpr(drlxParseResult.getExprBinding())); } final Expression constraintExpression = getConstraintExpression(drlxParseResult); drlxParseResult.getUsedDeclarationsOnLeft().forEach(d -> bindDSL.addArgument(context.getVar(d))); bindDSL.addArgument(constraintExpression); final Optional<MethodCallExpr> methodCallExpr = buildReactOn(drlxParseResult); methodCallExpr.ifPresent(bindDSL::addArgument); return bindDSL; }