auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Stream<RDF4JTriple> stream(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) { Resource subj = (Resource) rdf4jTermFactory.asValue(subject); org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate); Value obj = rdf4jTermFactory.asValue(object); RepositoryConnection conn = getRepositoryConnection(); <START> RepositoryResult<Statement> statements = conn.getStatements(subj, pred, obj, includeInferred, contextFilter); <END> return Iterations.stream(statements).map(this::asTripleLike); }</code><technical_language>RepositoryResult closed consistently try-with-resources relying close-on-exhaust Iterations trigger below</technical_language>

Target:
public Stream<RDF4JTriple> stream(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) { Resource subj = (Resource) rdf4jTermFactory.asValue(subject); org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate); Value obj = rdf4jTermFactory.asValue(object); RepositoryConnection conn = getRepositoryConnection(); Stream<RDF4JTriple> stream = null; try { RepositoryResult<Statement> statements = conn.getStatements(subj, pred, obj, includeInferred, contextMask); stream = Iterations.stream(statements).map(this::asTripleLike); } finally { if (stream == null) { conn.close(); } } return stream.onClose(conn::close); }
Source:
<code>private void initFailedQueriesEventSubscribers() { String emailRecipients = prop.getProperty(NotificationProperties.FAILED_QUERIES_NOTIFICATION_RECIPIENTS, true); if (StringUtils.isEmpty(emailRecipients)) { return; } List<EventAuditLogSubscriber> failedQueriesEventSubscribers = new LinkedList<>(); for (String email:emailRecipients.split(",")){ EventAuditLogSubscriber eals = new EventAuditLogSubscriber(); <START> eals.setevent_type(1); <END> eals.setevent_up_name("DATABASE_UNREACHABLE"); eals.setmethod_id(EventNotificationMethods.EMAIL.getValue()); eals.setmethod_address(StringUtils.strip(email)); eals.setmessage("Failed to query for notifications. Database Connection refused."); eals.setseverity(AuditLogSeverity.ERROR.getValue()); failedQueriesEventSubscribers.add(eals); } this.failedQueriesEventSubscribers = failedQueriesEventSubscribers; }</code><technical_language>I specific MessageType.alertMessage.getEventType() clearer in this case modifying EventAuditLogSubscriber.event_type enum better, requires more work</technical_language>

Target:
private void initFailedQueriesEventSubscribers() { String emailRecipients = prop.getProperty(NotificationProperties.FAILED_QUERIES_NOTIFICATION_RECIPIENTS, true); if (StringUtils.isEmpty(emailRecipients)) { return; } List<EventAuditLogSubscriber> failedQueriesEventSubscribers = new LinkedList<>(); for (String email:emailRecipients.split(",")){ EventAuditLogSubscriber eals = new EventAuditLogSubscriber(); eals.setevent_type(MessageHelper.MessageType.alertMessage.getEventType()); eals.setevent_up_name("DATABASE_UNREACHABLE"); eals.setmethod_id(EventNotificationMethods.EMAIL.getValue()); eals.setmethod_address(StringUtils.strip(email)); eals.setmessage("Failed to query for notifications. Database Connection refused."); eals.setseverity(AuditLogSeverity.ERROR.getValue()); failedQueriesEventSubscribers.add(eals); } this.failedQueriesEventSubscribers = failedQueriesEventSubscribers; }
Source:
<code>public void verifySuggestVideoOrArticleButtonClickable() { waitForElementClickableByElement(submitButton); <START> PageObjectLogging.log("VerifySuggestVideoOrArticleButtonClickable", "Verify that Suggest Video or Article submit button is enabled", true); <END> }</code><technical_language>1. line shorter, 2. methods name changed, change parameter Verify verify</technical_language>

Target:
public void verifySuggestVideoOrArticleButtonClickable() { waitForElementClickableByElement(submitButton); PageObjectLogging.log( "verifySuggestVideoOrArticleButtonClickable", "Verify that Suggest Video or Article submit button is enabled", true ); }
Source:
<code>public void setCustomName(String name) { <START> throw new UnsupportedOperationException("Cannot set the custom name a player"); <END> }</code><technical_language>Missing 'of'</technical_language>

Target:
public void setCustomName(String name) { throw new UnsupportedOperationException("Cannot set the custom name of a player"); }
Source:
<code>public XmlEntry(int baseQuark, int displayQuark, @NonNull ITmfTrace trace, String name, long startTime, long endTime, EntryDisplayType type, @NonNull ITmfStateSystem ss, Element entryElement) { super(name, startTime, endTime); fTrace = trace; fType = type; fBaseQuark = baseQuark; fDisplayQuark = displayQuark; fSs = ss; fElement = entryElement; String displayText = entryElement.getAttribute(TmfXmlUiStrings.DISPLAY_TEXT); fShowText = (displayText.toLowerCase().equals("true") <START> ? true : false); <END> List<Element> elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.PARENT_ELEMENT); if (elements.size() > 0) { fParentId = getFirstValue(elements.get(0)); } else { fParentId = EMPTY_STRING; } elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.NAME_ELEMENT); if (elements.size() > 0) { String nameFromSs = getFirstValue(elements.get(0)); if (!nameFromSs.isEmpty()) { setName(nameFromSs); } } elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.ID_ELEMENT); if (elements.size() > 0) { fId = getFirstValue(elements.get(0)); } else { fId = name; } }</code><technical_language>remove this Boolean.valueOf(displayText) i</technical_language>

Target:
public XmlEntry(int baseQuark, int displayQuark, @NonNull ITmfTrace trace, String name, long startTime, long endTime, EntryDisplayType type, @NonNull ITmfStateSystem ss, Element entryElement) { super(name, startTime, endTime); fTrace = trace; fType = type; fBaseQuark = baseQuark; fDisplayQuark = displayQuark; fSs = ss; fElement = entryElement; String displayText = entryElement.getAttribute(TmfXmlUiStrings.DISPLAY_TEXT); fShowText = Boolean.valueOf(displayText); List<Element> elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.PARENT_ELEMENT); if (elements.size() > 0) { fParentId = getFirstValue(elements.get(0)); } else { fParentId = EMPTY_STRING; } elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.NAME_ELEMENT); if (elements.size() > 0) { String nameFromSs = getFirstValue(elements.get(0)); if (!nameFromSs.isEmpty()) { setName(nameFromSs); } } elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.ID_ELEMENT); if (elements.size() > 0) { fId = getFirstValue(elements.get(0)); } else { fId = name; } }
Source:
<code><START> private ArrayList<Ds3Object> getDs3Objects(final Iterable<Path> filteredObjects) throws IOException { <END> final ArrayList<Ds3Object> objects = new ArrayList<>(); for (final Path path : filteredObjects) { objects.add(new Ds3Object( SyncUtils.GetFileName(inputDirectory, path), SyncUtils.GetFileSize(path))); } return objects; }</code><technical_language>In general I ImmutableList, List instead of ArrayList</technical_language>

Target:
private ImmutableList<Ds3Object> getDs3Objects(final Iterable<Path> filteredObjects) throws IOException { final ImmutableList.Builder<Ds3Object> objectsBuilder = ImmutableList.builder(); for (final Path path : filteredObjects) { objectsBuilder.add(new Ds3Object( Utils.getFileName(inputDirectory, path), Utils.getFileSize(path))); } return objectsBuilder.build(); }
Source:
<code>protected Map<Integer, IVariableFacade> getVariableCache() { if(compositeVariableCache == null) { CompositeMap<Integer, IVariableFacade> compositeMap = new CompositeMap<>(); for(Iterator<DimPos> it = variableContainerPositions.iterator(); it.hasNext();) { DimPos dimPos = it.next(); IVariableContainer variableContainer = TileHelpers.getCapability(dimPos, null, VariableContainerConfig.CAPABILITY); if(variableContainer != null) { compositeMap.addElement(variableContainer.getVariableCache()); } else { IntegratedDynamics.clog(Level.ERROR, "The variable container at " + dimPos + " was invalid, skipping."); it.remove(); } } <START> for(PartPos partPos : partPositions.valueCollection()){ <END> IPartContainer partContainer = PartHelpers.getPartContainer(partPos.getPos(), partPos.getSide()); IVariableContainer variableContainer = partContainer.getCapability(VariableContainerConfig.CAPABILITY, partPos.getSide()); if (variableContainer != null) compositeMap.addElement(variableContainer.getVariableCache()); } compositeVariableCache = compositeMap; } return compositeVariableCache; }</code><technical_language>for(PartPos partPos : partPositions.valueCollection()) {</technical_language>

Target:
protected Map<Integer, IVariableFacade> getVariableCache() { if(compositeVariableCache == null) { CompositeMap<Integer, IVariableFacade> compositeMap = new CompositeMap<>(); for(Iterator<DimPos> it = variableContainerPositions.iterator(); it.hasNext();) { DimPos dimPos = it.next(); IVariableContainer variableContainer = TileHelpers.getCapability(dimPos, null, VariableContainerConfig.CAPABILITY); if(variableContainer != null) { compositeMap.addElement(variableContainer.getVariableCache()); } else { IntegratedDynamics.clog(Level.ERROR, "The variable container at " + dimPos + " was invalid, skipping."); it.remove(); } } for(PartPos partPos : partPositions.valueCollection()) { IPartContainer partContainer = PartHelpers.getPartContainer(partPos.getPos(), partPos.getSide()); IVariableContainer variableContainer = partContainer.getCapability(VariableContainerConfig.CAPABILITY, partPos.getSide()); if (variableContainer != null) { compositeMap.addElement(variableContainer.getVariableCache()); } } compositeVariableCache = compositeMap; } return compositeVariableCache; }
Source:
<code><START> public static JsonElement toGsonElement(JsonNode jsonNode) { <END> if (jsonNode.isArray()) { if (jsonNode instanceof GsonJsonArray) { return ((GsonJsonArray) jsonNode).getJsonArray(); } throw new IllegalArgumentException("JsonNode is an array but isn't GsonJsonArray."); } else if (jsonNode.isNull()) { if (jsonNode instanceof GsonJsonNull) { return ((GsonJsonNull) jsonNode).getJsonNull(); } throw new IllegalArgumentException("JsonNode is a null but isn't GsonJsonNull."); } else if (jsonNode.isObject()) { if (jsonNode instanceof GsonJsonObject) { return ((GsonJsonObject) jsonNode).getJsonObject(); } throw new IllegalArgumentException("JsonNode is an array but isn't GsonJsonObject."); } else if (jsonNode.isValue()) { if (jsonNode instanceof GsonJsonValue) { return ((GsonJsonValue) jsonNode).getJsonPrimitive(); } throw new IllegalArgumentException("JsonNode is a value but isn't GsonJsonValue."); } throw new IllegalArgumentException("Unknown JsonNode type."); }</code><technical_language>I wish is a good place convertor util methods more discoverable. sure, static in GsonJsonSerializer type, a thought</technical_language>

Target:
public static JsonElement toGsonElement(JsonNode jsonNode) { if (jsonNode.isArray()) { if (jsonNode instanceof GsonJsonArray) { return ((GsonJsonArray) jsonNode).getJsonArray(); } throw LOGGER.logExceptionAsError( new IllegalArgumentException("JsonNode is an array but isn't GsonJsonArray.")); } else if (jsonNode.isNull()) { if (jsonNode instanceof GsonJsonNull) { return ((GsonJsonNull) jsonNode).getJsonNull(); } throw LOGGER.logExceptionAsError( new IllegalArgumentException("JsonNode is a null but isn't GsonJsonNull.")); } else if (jsonNode.isObject()) { if (jsonNode instanceof GsonJsonObject) { return ((GsonJsonObject) jsonNode).getJsonObject(); } throw LOGGER.logExceptionAsError( new IllegalArgumentException("JsonNode is an array but isn't GsonJsonObject.")); } else if (jsonNode.isValue()) { if (jsonNode instanceof GsonJsonPrimitive) { return ((GsonJsonPrimitive) jsonNode).getJsonPrimitive(); } throw LOGGER.logExceptionAsError( new IllegalArgumentException("JsonNode is a value but isn't GsonJsonPrimitive.")); } throw LOGGER.logExceptionAsError(new IllegalArgumentException("Unknown JsonNode type.")); }
Source:
<code>public List<Long> getDownloadedVideoDmIdsForSection(String enrollmentId, String chapter, <START> String section , final DataCallback<List<Long>> callback ) { <END> DbOperationGetColumn<Long> op = new DbOperationGetColumn<Long>(true,DbStructure.Table.DOWNLOADS, new String[]{DbStructure.Column.DM_ID}, DbStructure.Column.DOWNLOADED + "=? AND "+ DbStructure.Column.EID + "=? AND " + DbStructure.Column.CHAPTER + "=? AND " + DbStructure.Column.SECTION + "=? AND " + DbStructure.Column.USERNAME + "=?", new String[] {String.valueOf(DownloadedState.DOWNLOADED.ordinal()), enrollmentId, chapter, section, username()}, null, Long.class); op.setCallback(callback); return enqueue(op); }</code><technical_language>a whitespace comma</technical_language>

Target:
public long[] getDownloadedVideoDmIdsForSection(String enrollmentId, String chapter, String section, final DataCallback<List<Long>> callback) { DbOperationGetColumn<Long> op = new DbOperationGetColumn<Long>(true, DbStructure.Table .DOWNLOADS, new String[]{DbStructure.Column.DM_ID}, DbStructure.Column.DOWNLOADED + "=? AND " + DbStructure.Column.EID + "=? AND " + DbStructure.Column.CHAPTER + "=? AND " + DbStructure.Column.SECTION + "=? AND " + DbStructure.Column.USERNAME + "=?", new String[]{String.valueOf(DownloadedState.DOWNLOADED.ordinal()), enrollmentId, chapter, section, username()}, null, Long.class); op.setCallback(callback); List<Long> downloadedList = enqueue(op); if (callback != null) { return null; } else { return ArrayUtils.toPrimitive(downloadedList.toArray(new Long[downloadedList.size()])); } }
Source:
<code>static void send(List<Event> events) { while (!events.isEmpty()) { List<Event> eventsList = new ArrayList<>(); String stream = events.get(0).getStream(); for (Event event : events) { if (event.getStream().equals(stream)) { eventsList.add(event); } } events.removeAll(eventsList); <START> postEvent(getStreamConfig(stream), eventsList); <END> } }</code><technical_language>a null check this line</technical_language>

Target:
static void send(List<Event> events) { Map<String, ArrayList<Event>> eventsByStream = new HashMap<>(); for (Event event : events) { String stream = event.getStream(); if (!eventsByStream.containsKey(stream) || eventsByStream.get(stream) == null) { eventsByStream.put(stream, new ArrayList<>()); } eventsByStream.get(stream).add(event); } for (String stream : eventsByStream.keySet()) { postEvents(getStreamConfig(stream), eventsByStream.get(stream)); } }
Source:
<code>protected HttpWebRequest validateAndEmitRequest() throws ServiceLocalException, Exception { this.validate(); HttpWebRequest request = this.buildEwsHttpWebRequest(); try { return this.getEwsHttpWebResponse(request); } catch (HttpErrorException e) { try { processWebException(e, request); <START> } finally { <END> request.close(); } throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } }</code><technical_language>request closed return? meaning moving finally outer catch-block</technical_language>

Target:
protected HttpWebRequest validateAndEmitRequest() throws ServiceLocalException, Exception { this.validate(); HttpWebRequest request = this.buildEwsHttpWebRequest(); try { try { return this.getEwsHttpWebResponse(request); } catch (HttpErrorException e) { processWebException(e, request); throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } } catch (Exception e) { try { request.close(); } catch (Exception e2) { } throw e; } }
Source:
<code>private double computeLoss(final List<LassoData> data) { <START> double loss = 0; <END> double reg = 0; for (final LassoData entry : data) { final Vector feature = entry.getFeature(); final double value = entry.getValue(); final double prediction = predict(feature); loss += (value - prediction) * (value - prediction); } for (int i = 0; i < numFeatures; ++i) { reg += newModel.get(i); } loss = 1.0 / (2 * data.size()) * loss + lambda * reg; return loss; }</code><technical_language>renaming this variable squaredErrorSum clear, especially for re-assignment below: loss = 1.0 / (2 * data.size()) * loss + lambda * reg;</technical_language>

Target:
private double computeLoss(final List<LassoData> data) { double squaredErrorSum = 0; double reg = 0; for (final LassoData entry : data) { final Vector feature = entry.getFeature(); final double value = entry.getValue(); final double prediction = predict(feature); squaredErrorSum += (value - prediction) * (value - prediction); } for (int i = 0; i < numFeatures; ++i) { reg += newModel.get(i); } final double loss = 1.0 / (2 * data.size()) * squaredErrorSum + lambda * reg; return loss; }
Source:
<code>public Object valueToBson(Object value) { if (value instanceof State) { return stateToBson((State) value); } else if (value instanceof List) { @SuppressWarnings("unchecked") List<Object> values = (List<Object>) value; return listToBson(values); } else if (value instanceof Object[]) { return listToBson(Arrays.asList((Object[]) value)); } else if (value instanceof Map) { if (((Map) value).size() == 1) { <START> Map<DBSQueryOperator, HashSet<String>> valueMap = (Map) value; <END> if (valueMap.containsKey(DBSQueryOperator.IN)) { value = Collections.singletonMap(IN, valueMap.get(DBSQueryOperator.IN)); } else if (valueMap.containsKey(DBSQueryOperator.NOT_IN)) { value = Collections.singletonMap(NIN, valueMap.get(DBSQueryOperator.NOT_IN)); } } } return serializableToBson(value); }</code><technical_language>this in MongoDBConverter, role is convert pure values. Put this filter creation logic in queryKeyValueWithOperator itself</technical_language>

Target:
public Object valueToBson(Object value) { if (value instanceof State) { return stateToBson((State) value); } else if (value instanceof List) { @SuppressWarnings("unchecked") List<Object> values = (List<Object>) value; return listToBson(values); } else if (value instanceof Object[]) { return listToBson(Arrays.asList((Object[]) value)); } else { return serializableToBson(value); } }
Source:
<code>public void deleteGoal(final Goal goal) { Log.d(TAG, "Deleting Goal: " + goal.getTitle()); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage("You are about to permanently remove this") .setTitle("Delete Goal?") <START> .setNegativeButton(R.string.picker_cancel, new DialogInterface.OnClickListener(){ <END> public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { removeGoal(goal); dialog.dismiss(); } }); AlertDialog dialog = builder.create(); dialog.show(); }</code><technical_language>Add strings.xml file</technical_language>

Target:
public void deleteGoal(final Goal goal) { Log.d(TAG, "Deleting Goal: " + goal.getTitle()); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(getText(R.string.goal_dialog_delete_message)) .setTitle(getText(R.string.goal_dialog_delete_title)) .setNegativeButton(R.string.picker_cancel, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { removeGoal(goal); dialog.dismiss(); } }); AlertDialog dialog = builder.create(); dialog.show(); }
Source:
<code>public StubbedInvocationMatcher addAnswer(Answer answer, boolean isConsecutive) { Invocation invocation = invocationForStubbing.getInvocation(); mockingProgress().stubbingCompleted(); if ((Answer<?>) answer instanceof ValidableAnswer) { <START> ((ValidableAnswer) (Answer<?>) answer).validateFor(invocation); <END> } synchronized (stubbed) { if (isConsecutive) { stubbed.getFirst().addAnswer(answer); } else { stubbed.addFirst(new StubbedInvocationMatcher(invocationForStubbing, answer)); } return stubbed.getFirst(); } }</code><technical_language>do need cast 2x</technical_language>

Target:
public StubbedInvocationMatcher addAnswer(Answer answer, boolean isConsecutive) { Invocation invocation = invocationForStubbing.getInvocation(); mockingProgress().stubbingCompleted(); if (answer instanceof ValidableAnswer) { ((ValidableAnswer) answer).validateFor(invocation); } synchronized (stubbed) { if (isConsecutive) { stubbed.getFirst().addAnswer(answer); } else { stubbed.addFirst(new StubbedInvocationMatcher(invocationForStubbing, answer)); } return stubbed.getFirst(); } }
Source:
<code>public Attributes searchOne(String filter, Object... args) throws NamingException { NamingEnumeration<SearchResult> r = search(filter,args); try { if (r.hasMore()) { SearchResult searchResult = r.next(); Attributes attrs = searchResult.getAttributes(); <START> attrs.put("distinguishedNameFormatted", searchResult.getNameInNamespace()); <END> LOG.log(Level.FINER, "found {0}", attrs); return attrs; } else { LOG.finer("no result"); } return null; } finally { r.close(); } }</code><technical_language>naming this a bit official - string this a package scoped final variable</technical_language>

Target:
public Attributes searchOne(String filter, Object... args) throws NamingException { NamingEnumeration<SearchResult> r = search(filter,args); try { if (r.hasMore()) { SearchResult searchResult = r.next(); Attributes attrs = searchResult.getAttributes(); attrs.put(ActiveDirectoryUnixAuthenticationProvider.DN_FORMATTED, searchResult.getNameInNamespace()); LOG.log(Level.FINER, "found {0}", attrs); return attrs; } else { LOG.finer("no result"); } return null; } finally { r.close(); } }
Source:
<code>private void copyText(TaggedValuePointable tvp, NodeTreePointable ntp, IMutableValueStorage mvs) throws IOException { <START> TextNodeBuilder tnb = new TextNodeBuilder(); <END> VoidPointable vp = ppool.takeOne(VoidPointable.class); TextOrCommentNodePointable tcnp = ppool.takeOne(TextOrCommentNodePointable.class); tvp.getValue(tcnp); tcnp.getValue(ntp, vp); tnb.reset(mvs); tnb.setValue(vp); ppool.giveBack(vp); ppool.giveBack(tcnp); }</code><technical_language>builder a class level variable</technical_language>

Target:
private void copyText(TaggedValuePointable tvp, NodeTreePointable ntp, IMutableValueStorage mvs) throws IOException { VoidPointable vp = ppool.takeOne(VoidPointable.class); TextOrCommentNodePointable tcnp = ppool.takeOne(TextOrCommentNodePointable.class); tvp.getValue(tcnp); tcnp.getValue(ntp, vp); tnb.reset(mvs); tnb.setValue(vp); ppool.giveBack(vp); ppool.giveBack(tcnp); }
Source:
<code>public void doLaunch(Context context, View v) { if (v == null) { if (togglesHandler == null) { togglesHandler = new TogglesHandler(context); } <START> togglesHandler.setState(togglePojo, !togglesHandler.getState(togglePojo)); <END> } else { final CompoundButton toggleButton = (CompoundButton) v .findViewById(R.id.item_toggle_action_toggle); if (toggleButton.isEnabled()) { toggleButton.performClick(); } } }</code><technical_language>clap:</technical_language>

Target:
public void doLaunch(Context context, View v) { if (v == null) { if (togglesHandler == null) { togglesHandler = new TogglesHandler(context); } String msg = context.getResources().getString(togglesHandler.getState(togglePojo) ? R.string.toggles_off : R.string.toggles_on); togglesHandler.setState(togglePojo, !togglesHandler.getState(togglePojo)); Toast.makeText(((MainActivity) context), String.format(msg, " " + this.pojo.displayName), Toast.LENGTH_SHORT).show(); } else { final CompoundButton toggleButton = (CompoundButton) v .findViewById(R.id.item_toggle_action_toggle); if (toggleButton.isEnabled()) { toggleButton.performClick(); } } }
Source:
<code>public Set<StoreKey> findMissingKeys(List<StoreKey> keys) throws StoreException { checkStarted(); Set<StoreKey> missingKeys = new HashSet<>(); try { for (StoreKey key : keys) { BlobId blobId = (BlobId) key; <START> if (cloudDestination.doesBlobExist(blobId) == false) { <END> missingKeys.add(key); } } } catch (Exception ex) { throw new StoreException(ex, StoreErrorCodes.IOError); } return missingKeys; }</code><technical_language>if (!cloudDestination.doesBlobExist(blobId))</technical_language>

Target:
public Set<StoreKey> findMissingKeys(List<StoreKey> keys) throws StoreException { checkStarted(); Set<StoreKey> missingKeys = new HashSet<>(); try { for (StoreKey key : keys) { BlobId blobId = (BlobId) key; if (!cloudDestination.doesBlobExist(blobId)) { missingKeys.add(key); } } } catch (CloudStorageException ex) { throw new StoreException(ex, StoreErrorCodes.IOError); } return missingKeys; }
Source:
<code>protected void executeQueryCommand() { java.util.ArrayList<storage_domains> result = new java.util.ArrayList<storage_domains>(); VmTemplate vmTemplate = DbFacade.getInstance().getVmTemplateDAO() .get(getParameters().getId()); if (vmTemplate != null && vmTemplate.getstorage_pool_id() != null) { List<DiskImage> templateDisks = GetTemplateDisks(); if (templateDisks.size() > 0) { List<Guid> domains = (List<Guid>) DbFacade.getInstance() .getStorageDomainDAO() .getAllStorageDomainsByImageGroup(templateDisks.get(0).getimage_group_id().getValue()); for (Guid domainId : domains) { storage_domains domain = DbFacade.getInstance().getStorageDomainDAO().getForStoragePool(domainId, vmTemplate.getstorage_pool_id().getValue()); if (domain != null) { result.add(domain); } } <START> <END> } } getQueryReturnValue().setReturnValue(result); }</code><technical_language>add newline</technical_language>

Target:
protected void executeQueryCommand() { java.util.ArrayList<storage_domains> result = new java.util.ArrayList<storage_domains>(); VmTemplate vmTemplate = DbFacade.getInstance().getVmTemplateDAO() .get(getParameters().getId()); if (vmTemplate != null && vmTemplate.getstorage_pool_id() != null) { List<DiskImage> templateDisks = getTemplateDisks(); if (templateDisks.size() > 0) { List<Guid> domains = (List<Guid>) DbFacade.getInstance() .getStorageDomainDAO() .getAllStorageDomainsByImageGroup(templateDisks.get(0).getimage_group_id().getValue()); for (Guid domainId : domains) { storage_domains domain = DbFacade.getInstance().getStorageDomainDAO().getForStoragePool(domainId, vmTemplate.getstorage_pool_id().getValue()); if (domain != null) { result.add(domain); } } } } getQueryReturnValue().setReturnValue(result); }
Source:
<code>public synchronized void put(ContentEvent event) { ThreadsProcessingItem pi; for (DestinationPIWrapper destination:listDestination) { pi = (ThreadsProcessingItem) destination.getProcessingItem(); counter++; if (counter >= maxCounter) counter = 0; switch (destination.getEventAllocationType()) { case SHUFFLE: pi.processEvent(event, counter%destination.getParallelism()); break; case GROUP_BY_KEY: <START> HashCodeBuilder hb = new HashCodeBuilder(); <END> hb.append(event.getKey()); int key = hb.build() % destination.getParallelism(); pi.processEvent(event, key); break; case BROADCAST: for (int p = 0; p < destination.getParallelism(); p++) { pi.processEvent(event, p); } break; } } }</code><technical_language>Do need create object for event? HashCodeBuilder reused</technical_language>

Target:
public synchronized void put(ContentEvent event) { this.put(event, this.getNextCounter()); }
Source:
<code>public Map<ObjectType, Optional<DslElementSyntax>> resolveSubTypes(ObjectType type) { ImmutableMap.Builder<ObjectType, Optional<DslElementSyntax>> mapBuilder = ImmutableMap.builder(); for (ObjectType subType : dslResolvingContext.getTypeCatalog().getSubTypes(type)) { subType.getAnnotation(TypeIdAnnotation.class).map(TypeIdAnnotation::getValue).ifPresent( <START> typeId -> dslResolvingContext <END> .getTypeCatalog() .getDeclaringExtension(typeId) .ifPresent(extensionName -> dslResolvingContext .getExtension(extensionName) .ifPresent(extensionModel -> mapBuilder .put(subType, dslSyntaxResolversByExtension .get(extensionModel) .resolve(subType))))); } return mapBuilder.build(); }</code><technical_language>this more readable? extract methods, for instance</technical_language>

Target:
public Map<ObjectType, Optional<DslElementSyntax>> resolveSubTypes(ObjectType type) { ImmutableMap.Builder<ObjectType, Optional<DslElementSyntax>> mapBuilder = ImmutableMap.builder(); for (ObjectType subType : dslResolvingContext.getTypeCatalog().getSubTypes(type)) { Optional<String> typeId = subType.getAnnotation(TypeIdAnnotation.class).map(TypeIdAnnotation::getValue); if (typeId.isPresent()) { Optional<String> declaringExtension = dslResolvingContext.getTypeCatalog().getDeclaringExtension(typeId.get()); if (declaringExtension.isPresent()) { dslResolvingContext.getExtension(declaringExtension.get()) .ifPresent(extensionModel -> mapBuilder.put(subType, dslSyntaxResolversByExtension.get(extensionModel).resolve(subType))); } } } return mapBuilder.build(); }
Source:
<code><START> public synchronized void subscribe(Subscription subscription) { <END> TenantsSubscriptionsHolder tenantSubscriptions = subscriptions.get(subscription.getMetric().getTenant()); if (tenantSubscriptions == null) { tenantSubscriptions = new TenantsSubscriptionsHolder(); subscriptions.put(subscription.getMetric().getTenant(), tenantSubscriptions); } if (tenantSubscriptions.getSubscriptions().get(subscription) != null) { throw new SubscriptionAlreadyExistsException(); } subscription.forecaster().setPredictionListener(predictionListener); List<DataPoint> points = restMetricsClient.loadPoints(subscription.getMetric().getMetricId(), subscription.getMetric().getTenant()); subscription.forecaster().learn(points); tenantSubscriptions.getSubscriptions().put(subscription.getMetric().getMetricId(), subscription); Logger.LOGGER.subscribe(subscription.getMetric().getMetricId(), subscription.getMetric().getTenant()); }</code><technical_language>synchronize subscriptions this. Synchronizing this opens a door a potential deadlock other code synchronize it. If synchronize subscriptions lock is private class other lock exist in unsubscribe</technical_language>

Target:
public void subscribe(Subscription subscription) { TenantsSubscriptionsHolder tenantSubscriptions = null; synchronized (subscriptions) { tenantSubscriptions = subscriptions.get(subscription.getMetric().getTenant()); if (tenantSubscriptions == null) { tenantSubscriptions = new TenantsSubscriptionsHolder(); subscriptions.put(subscription.getMetric().getTenant(), tenantSubscriptions); } if (tenantSubscriptions.getSubscriptions().get(subscription.getMetric().getMetricId()) != null) { throw new SubscriptionAlreadyExistsException(); } } subscription.forecaster().setPredictionListener(predictionListener); List<DataPoint> points = restMetricsClient.loadPoints(subscription.getMetric().getMetricId(), subscription.getMetric().getTenant()); subscription.forecaster().learn(points); tenantSubscriptions.getSubscriptions().put(subscription.getMetric().getMetricId(), subscription); Logger.LOGGER.subscribe(subscription.getMetric().getMetricId(), subscription.getMetric().getTenant()); }
Source:
<code>public Block copyPositions(int[] positions, int offset, int length) { checkValidPositionsArray(positions, offset, length); int[] newOffsets = new int[length + 1]; <START> boolean[] newRowIsNull = new boolean[length]; <END> List<Integer> fieldBlockPositions = new ArrayList<>(length); for (int i = 0; i < length; i++) { int position = positions[offset + i]; if (isNull(position)) { newRowIsNull[i] = true; newOffsets[i + 1] = newOffsets[i]; } else { newOffsets[i + 1] = newOffsets[i] + 1; fieldBlockPositions.add(getFieldBlockOffset(position)); } } Block[] newBlocks = new Block[numFields]; for (int i = 0; i < numFields; i++) { newBlocks[i] = getFieldBlocks()[i].copyPositions(fieldBlockPositions); } return new RowBlock(0, length, newRowIsNull, newOffsets, newBlocks); }</code><technical_language>Consistently use: for (int i = offset; i < offset + length; ++i) for (int i = 0; i < length; i++) { in copyPositions</technical_language>

Target:
public Block copyPositions(int[] positions, int offset, int length) { checkValidPositionsArray(positions, offset, length); int[] newOffsets = new int[length + 1]; boolean[] newRowIsNull = new boolean[length]; IntArrayList fieldBlockPositions = new IntArrayList(length); for (int i = 0; i < length; i++) { int position = positions[offset + i]; if (isNull(position)) { newRowIsNull[i] = true; newOffsets[i + 1] = newOffsets[i]; } else { newOffsets[i + 1] = newOffsets[i] + 1; fieldBlockPositions.add(getFieldBlockOffset(position)); } } Block[] newBlocks = new Block[numFields]; for (int i = 0; i < numFields; i++) { newBlocks[i] = getFieldBlocks()[i].copyPositions(fieldBlockPositions.elements(), 0, fieldBlockPositions.size()); } return new RowBlock(0, length, newRowIsNull, newOffsets, newBlocks); }
Source:
<code>private void showExportContentDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.export_your_content); String email = AccountHelper.getDefaultAccount().getEmail(); builder.setMessage(getString(R.string.export_your_content_message, email)); builder.setPositiveButton(R.string.site_settings_export_content_title, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { exportSite(); } }); <START> builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { <END> @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.show(); }</code><technical_language>Note builder.setNegativeButton(R.string.cancel, null); accomplish thing</technical_language>

Target:
private void showExportContentDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.export_your_content); String email = AccountHelper.getDefaultAccount().getEmail(); builder.setMessage(getString(R.string.export_your_content_message, email)); builder.setPositiveButton(R.string.site_settings_export_content_title, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { exportSite(); } }); builder.setNegativeButton(R.string.cancel, null); builder.show(); }
Source:
<code>public URL getDownloadLink() { try { <START> return new URL("<LINK_0>"); <END> } catch (Throwable t) { t.printStackTrace(); } return null; }</code><technical_language>Needs updated Configuration.LIBRARIES_DOWNLOAD + "/JPushBullet"</technical_language>

Target:
public URL getDownloadLink() { try { return new URL(Configuration.LIBRARIES_DOWNLOAD + "/JPushBullet"); } catch (Throwable t) { t.printStackTrace(); } return null; }
Source:
<code>private void revision(SafeHtmlBuilder sb, int index, RevisionInfo r) { CommitInfo c = r.commit(); sb.openTr(); if (revision.equals(r.name())) { sb.setStyleName(style.current()); } sb.openTd() .setStyleName(style.legacy_id()) .append(r._number()); if (r.has_draft_comments()) { <START> sb.append(" ..."); <END> } if (r.draft()) { sb.append(" ").append(Resources.C.draft()); } sb.closeTd(); sb.openTd() .setStyleName(style.commit()) .openAnchor() .setAttribute("href", "#" + url(r)) .setAttribute("onclick", OPEN + "(event," + index + ")") .append(r.name().substring(0, 10)) .closeAnchor() .closeTd(); sb.openTd() .append(FormatUtil.shortFormatDayTime(c.committer().date())) .closeTd(); String an = c.author() != null ? c.author().name() : null; String cn = c.committer() != null ? c.committer().name() : null; sb.openTd(); sb.append(an); if (!"".equals(an) && !"".equals(cn) && !an.equals(cn)) { sb.append(" / ").append(cn); } sb.closeTd(); sb.closeTr(); }</code><technical_language>if graphic change screen</technical_language>

Target:
private void revision(SafeHtmlBuilder sb, int index, RevisionInfo r) { CommitInfo c = r.commit(); sb.openTr(); if (revision.equals(r.name())) { sb.setStyleName(style.current()); } sb.openTd() .setStyleName(style.legacy_id()) .append(r._number()); if (r.draft()) { sb.append(" ").append(Resources.C.draft()); } if (r.has_draft_comments()) { sb.append(" ") .openSpan() .addStyleName(style.draft_comment()) .append(new ImageResourceRenderer() .render(Gerrit.RESOURCES.draftComments())) .closeSpan(); } sb.closeTd(); sb.openTd() .setStyleName(style.commit()) .openAnchor() .setAttribute("href", "#" + url(r)) .setAttribute("onclick", OPEN + "(event," + index + ")") .append(r.name().substring(0, 10)) .closeAnchor() .closeTd(); sb.openTd() .append(FormatUtil.shortFormatDayTime(c.committer().date())) .closeTd(); String an = c.author() != null ? c.author().name() : null; String cn = c.committer() != null ? c.committer().name() : null; sb.openTd(); sb.append(an); if (!"".equals(an) && !"".equals(cn) && !an.equals(cn)) { sb.append(" / ").append(cn); } sb.closeTd(); sb.closeTr(); }
Source:
<code>public void afterCompletion(int status) { try { manager.disposeRuntimeEngine(runtime); } catch (Throwable e) { <START> logger.warn("Could not dispose runtime engine", e); <END> } }</code><technical_language>debug instead, number of cases this logs bit scary while serious issue worth while running in debug, wdyt</technical_language>

Target:
public void afterCompletion(int status) { try { manager.disposeRuntimeEngine(runtime); } catch (Throwable e) { logger.debug("Could not dispose runtime engine", e); } }
Source:
<code>public void updateKeyWithResponseSnippets() { KeyClient keyClient = createClient(); Key key = keyClient.getKey("keyName"); key.getProperties().setExpires(OffsetDateTime.now().plusDays(60)); Key updatedKey = keyClient.updateKeyPropertiesWithResponse(key.getProperties(), new Context(key1, value1), KeyOperation.ENCRYPT, KeyOperation.DECRYPT).getValue(); <START> System.out.printf("Key is getUpdated with name %s and id %s %n", updatedKey.getName(), updatedKey.getId()); <END> END: com.azure.keyvault.keys.keyclient.updateKeyPropertiesWithResponse#KeyProperties-keyOperations-Context }</code><technical_language>typo getUpdated</technical_language>

Target:
public void updateKeyWithResponseSnippets() { KeyClient keyClient = createClient(); Key key = keyClient.getKey("keyName"); key.getProperties().setExpires(OffsetDateTime.now().plusDays(60)); Key updatedKey = keyClient.updateKeyPropertiesWithResponse(key.getProperties(), new Context(key1, value1), KeyOperation.ENCRYPT, KeyOperation.DECRYPT).getValue(); System.out.printf("Key is updated with name %s and id %s %n", updatedKey.getName(), updatedKey.getId()); END: com.azure.keyvault.keys.keyclient.updateKeyPropertiesWithResponse#KeyProperties-keyOperations-Context }
Source:
<code>public HashAggregator(GroupbyNode groupbyNode, Schema schema) throws IOException { hashTable = new TupleMap<>(context.getQueryContext().getInt(SessionVars.AGG_HASH_TABLE_SIZE)); List<Column> groupingKeyColumnList = new ArrayList<>(distinctGroupingKeyColumnSet); Column[] keyColumns = groupbyNode.getGroupingColumns(); Column col; for (Column keyColumn : keyColumns) { <START> col = keyColumn; <END> if (!distinctGroupingKeyColumnSet.contains(col)) { groupingKeyColumnList.add(col); } } Column[] groupingKeyColumns = groupingKeyColumnList.toArray(new Column[groupingKeyColumnList.size()]); if (groupbyNode.hasAggFunctions()) { aggFunctions = groupbyNode.getAggFunctions(); aggFunctionsNum = aggFunctions.size(); } else { aggFunctions = new ArrayList<>(); aggFunctionsNum = 0; } for (EvalNode aggFunction : aggFunctions) { aggFunction.bind(context.getEvalContext(), schema); } tupleSize = groupingKeyColumns.length + aggFunctionsNum; aggregatedTuple = new VTuple(groupingKeyColumns.length + aggFunctionsNum); innerKeyProjector = new KeyProjector(inSchema, groupingKeyColumns); }</code><technical_language>col is redundant</technical_language>

Target:
public HashAggregator(GroupbyNode groupbyNode, Schema schema) throws IOException { hashTable = new TupleMap<>(context.getQueryContext().getInt(SessionVars.AGG_HASH_TABLE_SIZE)); List<Column> groupingKeyColumnList = new ArrayList<>(distinctGroupingKeyColumnSet); Column[] keyColumns = groupbyNode.getGroupingColumns(); for (Column keyColumn : keyColumns) { if (!distinctGroupingKeyColumnSet.contains(keyColumn)) { groupingKeyColumnList.add(keyColumn); } } Column[] groupingKeyColumns = groupingKeyColumnList.toArray(new Column[groupingKeyColumnList.size()]); if (groupbyNode.hasAggFunctions()) { aggFunctions = groupbyNode.getAggFunctions(); aggFunctionsNum = aggFunctions.size(); } else { aggFunctions = new ArrayList<>(); aggFunctionsNum = 0; } for (EvalNode aggFunction : aggFunctions) { aggFunction.bind(context.getEvalContext(), schema); } tupleSize = groupingKeyColumns.length + aggFunctionsNum; aggregatedTuple = new VTuple(groupingKeyColumns.length + aggFunctionsNum); innerKeyProjector = new KeyProjector(inSchema, groupingKeyColumns); }
Source:
<code><START> public CheckAndMutateResult[] checkAndMutate(List<CheckAndMutate> checkAndMutates) <END> throws IOException { List<CheckAndMutateResult> checkAndMutateResults = FutureUtils.get(table.checkAndMutateAll(checkAndMutates)); return checkAndMutateResults.toArray(new CheckAndMutateResult[0]); }</code><technical_language>return a List</technical_language>

Target:
public List<CheckAndMutateResult> checkAndMutate(List<CheckAndMutate> checkAndMutates) throws IOException { return FutureUtils.get(table.checkAndMutateAll(checkAndMutates)); }
Source:
<code>void disableCompactionForBlobStore(BlobStore store) { if (store.isStarted()) { <START> storesToSkip.add(store); <END> } }</code><technical_language>storesToSkip is a hashset, is thread safe. If planning calling this AmbryRequests, switch a thread safe collection</technical_language>

Target:
boolean disableCompactionForBlobStore(BlobStore store) { storesDisabledCompaction.add(store); return true; }
Source:
<code>public void drawButton(Minecraft minecraft, int mouseX, int mouseY) { if (!visible) { return; } FontRenderer fontrenderer = minecraft.fontRenderer; bindButtonTextures(minecraft); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int xOffset = texture.getX(); int yOffset = texture.getY(); int h = texture.getHeight(); int w = texture.getWidth(); boolean mouseOver = isMouseOver(); int buttonState = getButtonState(); drawTexturedModalRect(xPosition, yPosition, xOffset, yOffset + buttonState * h, width / 2, h); <START> drawTexturedModalRect(xPosition + width / 2, yPosition, xOffset + w - width / 2, yOffset + buttonState * h, width / 2, h); <END> mouseDragged(minecraft, mouseX, mouseY); drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (h - 8) / 2, getTextColor(mouseOver)); }</code><technical_language>wrong getHoverState()? put getButtonState() it</technical_language>

Target:
public void drawButton(Minecraft minecraft, int mouseX, int mouseY) { if (!visible) { return; } FontRenderer fontrenderer = minecraft.fontRenderer; bindButtonTextures(minecraft); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int xOffset = texture.getX(); int yOffset = texture.getY(); int h = texture.getHeight(); int w = texture.getWidth(); boolean mouseOver = isMouseOver(); int hoverState = getHoverState(mouseOver); drawTexturedModalRect(xPosition, yPosition, xOffset, yOffset + hoverState * h, width / 2, h); drawTexturedModalRect(xPosition + width / 2, yPosition, xOffset + w - width / 2, yOffset + hoverState * h, width / 2, h); mouseDragged(minecraft, mouseX, mouseY); drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (h - 8) / 2, getTextColor(mouseOver)); }
Source:
<code>private TestRunningOptions getTestRunningOptions(CommandRunnerParams params) { TestRunningOptions.Builder builder = TestRunningOptions.builder() .setCodeCoverageEnabled(isCodeCoverageEnabled) .setRunAllTests(isRunAllTests()) .setTestSelectorList(testSelectorOptions.getTestSelectorList()) .setShouldExplainTestSelectorList(testSelectorOptions.shouldExplain()) .setShufflingTests(isShufflingTests) .setPathToXmlTestOutput(Optional.ofNullable(pathToXmlTestOutput)) .setPathToJavaAgent(Optional.ofNullable(pathToJavaAgent)) <START> .setCoverageReportFormats(EnumSet.copyOf(Arrays.asList(coverageReportFormats))) <END> .setCoverageReportTitle(coverageReportTitle) .setEnvironmentOverrides(environmentOverrides); Optional<ImmutableList<String>> coverageIncludes = params.getBuckConfig().getOptionalListWithoutComments("test", "coverageIncludes", ','); Optional<ImmutableList<String>> coverageExcludes = params.getBuckConfig().getOptionalListWithoutComments("test", "coverageExcludes", ','); coverageIncludes.ifPresent( strings -> builder.setCoverageIncludes(strings.stream().collect(Collectors.joining(",")))); coverageExcludes.ifPresent( strings -> builder.setCoverageExcludes(strings.stream().collect(Collectors.joining(",")))); return builder.build(); }</code><technical_language>this blow if coverageReportFormats is empty array. refer <LINK_0> for examples of avoid it</technical_language>

Target:
private TestRunningOptions getTestRunningOptions(CommandRunnerParams params) { EnumSet<CoverageReportFormat> coverageFormats = EnumSet.noneOf(CoverageReportFormat.class); coverageFormats.addAll(Arrays.asList(this.coverageReportFormats)); TestRunningOptions.Builder builder = TestRunningOptions.builder() .setCodeCoverageEnabled(isCodeCoverageEnabled) .setRunAllTests(isRunAllTests()) .setTestSelectorList(testSelectorOptions.getTestSelectorList()) .setShouldExplainTestSelectorList(testSelectorOptions.shouldExplain()) .setShufflingTests(isShufflingTests) .setPathToXmlTestOutput(Optional.ofNullable(pathToXmlTestOutput)) .setPathToJavaAgent(Optional.ofNullable(pathToJavaAgent)) .setCoverageReportFormats(coverageFormats) .setCoverageReportTitle(coverageReportTitle) .setEnvironmentOverrides(environmentOverrides); Optional<ImmutableList<String>> coverageIncludes = params.getBuckConfig().getOptionalListWithoutComments("test", "coverageIncludes", ','); Optional<ImmutableList<String>> coverageExcludes = params.getBuckConfig().getOptionalListWithoutComments("test", "coverageExcludes", ','); coverageIncludes.ifPresent( strings -> builder.setCoverageIncludes(strings.stream().collect(Collectors.joining(",")))); coverageExcludes.ifPresent( strings -> builder.setCoverageExcludes(strings.stream().collect(Collectors.joining(",")))); return builder.build(); }
Source:
<code>public void testDateComparisons() { <START> statisticsAssertion.check("SELECT * FROM orders WHERE o_orderdate >= DATE '1993-10-01'", <END> checks -> checks.estimate(OUTPUT_ROW_COUNT, defaultTolerance())); statisticsAssertion.check("SELECT * FROM orders WHERE o_orderdate < DATE '1993-10-01' + INTERVAL '3' MONTH", checks -> checks.estimate(OUTPUT_ROW_COUNT, defaultTolerance())); }</code><technical_language>=, != symbol symbol</technical_language>

Target:
public void testDateComparisons() { statisticsAssertion.check("SELECT * FROM orders WHERE o_orderdate >= DATE '1993-10-01'", checks -> checks.estimate(OUTPUT_ROW_COUNT, defaultTolerance())); statisticsAssertion.check("SELECT * FROM orders WHERE o_orderdate < DATE '1993-10-01' + INTERVAL '3' MONTH", checks -> checks.estimate(OUTPUT_ROW_COUNT, defaultTolerance())); statisticsAssertion.check("SELECT * FROM orders WHERE o_orderdate >= DATE '1993-10-01' AND o_orderdate < DATE '1993-10-01' + INTERVAL '3' MONTH", checks -> checks.estimate(OUTPUT_ROW_COUNT, defaultTolerance())); statisticsAssertion.check("SELECT * FROM orders WHERE o_orderdate >= DATE '1993-10-01' OR o_orderdate < DATE '1993-10-01' + INTERVAL '3' MONTH", checks -> checks.estimate(OUTPUT_ROW_COUNT, defaultTolerance())); statisticsAssertion.check("SELECT * FROM orders WHERE NOT (o_orderdate >= DATE '1993-10-01' AND o_orderdate < DATE '1993-10-01' + INTERVAL '3' MONTH)", checks -> checks.estimate(OUTPUT_ROW_COUNT, defaultTolerance())); }