auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void setupStormCode(Map<String, Object> conf, String topoId, String tmpJarLocation, Map<String, Object> topoConf, StormTopology topology) throws Exception { Subject subject = getSubject(); IStormClusterState clusterState = stormClusterState; BlobStore store = blobStore; String jarKey = ConfigUtils.masterStormJarKey(topoId); String codeKey = ConfigUtils.masterStormCodeKey(topoId); String confKey = ConfigUtils.masterStormConfKey(topoId); NimbusInfo hostPortInfo = nimbusHostPortInfo; <START> CuratorFramework zkClient = null; <END> if (store instanceof LocalFsBlobStore) { zkClient = BlobStoreUtils.createZKClient(conf); } if (tmpJarLocation != null) { try (FileInputStream fin = new FileInputStream(tmpJarLocation)) { store.createBlob(jarKey, fin, new SettableBlobMeta(BlobStoreAclHandler.DEFAULT), subject); } if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(jarKey, hostPortInfo, getVersionForKey(jarKey, hostPortInfo, zkClient)); } } topoCache.addTopoConf(topoId, subject, topoConf); if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(confKey, hostPortInfo, getVersionForKey(confKey, hostPortInfo, zkClient)); } topoCache.addTopology(topoId, subject, topology); if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(codeKey, hostPortInfo, getVersionForKey(codeKey, hostPortInfo, zkClient)); } }</code><technical_language>**zkClient guaranteed closed.** Please ensure zkClient is closed end of method if zkClient is null</technical_language>

Target:
private void setupStormCode(Map<String, Object> conf, String topoId, String tmpJarLocation, Map<String, Object> topoConf, StormTopology topology) throws Exception { Subject subject = getSubject(); IStormClusterState clusterState = stormClusterState; BlobStore store = blobStore; String jarKey = ConfigUtils.masterStormJarKey(topoId); String codeKey = ConfigUtils.masterStormCodeKey(topoId); String confKey = ConfigUtils.masterStormConfKey(topoId); NimbusInfo hostPortInfo = nimbusHostPortInfo; if (tmpJarLocation != null) { try (FileInputStream fin = new FileInputStream(tmpJarLocation)) { store.createBlob(jarKey, fin, new SettableBlobMeta(BlobStoreAclHandler.DEFAULT), subject); } if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(jarKey, hostPortInfo, getVersionForKey(jarKey, hostPortInfo, conf, zkClient)); } } topoCache.addTopoConf(topoId, subject, topoConf); if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(confKey, hostPortInfo, getVersionForKey(confKey, hostPortInfo, conf, zkClient)); } topoCache.addTopology(topoId, subject, topology); if (store instanceof LocalFsBlobStore) { clusterState.setupBlobstore(codeKey, hostPortInfo, getVersionForKey(codeKey, hostPortInfo, conf, zkClient)); } }
Source:
<code><START> public URIList getUriList() throws GoGoDuckException { <END> return indexReader.getUriList(profile, TIME_FIELD, URL_FIELD, subset); }</code><technical_language>this belongs anymore - of hardcoded url's for CAR, index for files now. this class for sourcing collection specific aggegation metadata/config indexreader in gogoduck</technical_language>

Target:
public URIList getUriList() throws GoGoDuckException { return indexReader.getUriList(profile, goGoDuckConfig.getTimeField(), goGoDuckConfig.getFileUrlField(), subset); }
Source:
<code>public static Integer strcmp(String s0, String s1) { <START> return (int) Math.signum(s1.compareTo(s0)); <END> }</code><technical_language>IMO, return type int</technical_language>

Target:
public static int strcmp(String s0, String s1) { return (int) Math.signum(s1.compareTo(s0)); }
Source:
<code>public void testIncludeAbsolute() throws IOException, ConfigInvalidException { final File includedFile = createFile(CONTENT1.getBytes()); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); bos.write("[include]\npath=".getBytes()); bos.write(includedFile.getAbsolutePath() <START> .replace(File.separatorChar, '/').getBytes()); <END> final File file = createFile(bos.toByteArray()); final FileBasedConfig config = new FileBasedConfig(file, FS.DETECTED); config.load(); assertEquals(ALICE, config.getString(USER, null, NAME)); }</code><technical_language>'\\'</technical_language>

Target:
public void testIncludeAbsolute() throws IOException, ConfigInvalidException { final File includedFile = createFile(CONTENT1.getBytes()); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); bos.write("[include]\npath=".getBytes()); bos.write(ConfigTest.pathToString(includedFile).getBytes()); final File file = createFile(bos.toByteArray()); final FileBasedConfig config = new FileBasedConfig(file, FS.DETECTED); config.load(); assertEquals(ALICE, config.getString(USER, null, NAME)); }
Source:
<code>public Map<String, DbParameterAccessor> getAllColumns(String tableName) throws SQLException { <START> DatabaseTable t = new DatabaseTable(getConnection(), getConnection().getSchema(), tableName.toUpperCase()); <END> return t.getParams(); }</code><technical_language>temp variable is next line possibly skip call .getParams() directly</technical_language>

Target:
public Map<String, DbParameterAccessor> getAllColumns(String tableName) throws SQLException { return new DatabaseTable(buildDatabaseObjectName(tableName)).getParams(); }
Source:
<code>protected String buildPayeeName(String lastName, String firstName, String middleInitial) { <START> String seperator = KFSConstants.COMMA + KFSConstants.BLANK_SPACE; <END> String fullName = lastName + seperator + firstName; if (StringUtils.isNotBlank(middleInitial)) { fullName = fullName + seperator + middleInitial + KFSConstants.DELIMITER; } if(fullName.length() > getPayeeNameFieldSize()) { fullName = StringUtils.substring(fullName, 0, getPayeeNameFieldSize()); fullName = removeLastCharacterWhenComma(fullName); } return fullName; }</code><technical_language>Minor typo in variable name</technical_language>

Target:
protected String buildPayeeName(String lastName, String firstName, String middleInitial) { String separator = KFSConstants.COMMA + KFSConstants.BLANK_SPACE; String fullName = lastName + separator + firstName; if (StringUtils.isNotBlank(middleInitial)) { fullName = fullName + KFSConstants.BLANK_SPACE + middleInitial + KFSConstants.DELIMITER; } if(fullName.length() > getPayeeNameFieldSize()) { fullName = StringUtils.substring(fullName, 0, getPayeeNameFieldSize().intValue()); fullName = removeLastCharacterWhenComma(fullName); } return fullName; }
Source:
<code>protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } Quota quota = getQuota(); if (quota == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } <START> if (getQuotaDAO().isQuotaInUse(quota) && !QuotaEnforcementTypeEnum.DISABLED.equals(quota.getQuotaEnforcementType())) { <END> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK); return false; } return true; }</code><technical_language>please switch clauses in operator. if quotaMode == disable, invoke dao</technical_language>

Target:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } Quota quota = getQuota(); if (quota == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } if (!QuotaEnforcementTypeEnum.DISABLED.equals(quota.getQuotaEnforcementType()) && getQuotaDAO().isQuotaInUse(quota)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK); return false; } return true; }
Source:
<code>private void setWidgetContent(GQuery inner) { <START> String oldDisplay = options.getWidget().getElement().getStyle().getDisplay(); <END> options.getWidget().getElement().getStyle().setProperty("display", "none"); RootPanel.get().add(options.getWidget()); RootPanel.get().getElement().removeChild(options.getWidget().getElement()); inner.get(0).appendChild(options.getWidget().getElement()); options.getWidget().getElement().getStyle().setProperty("display", oldDisplay); }</code><technical_language>in a GQuery plugin GQuery :) java Widget widget = options.getWidget(); String oldDisplay = $(widget).css("display");</technical_language>

Target:
private void setWidgetContent(GQuery inner) { Widget widget = options.getWidget(); String oldDisplay = $(widget).css("display"); $(widget).css("display", "none"); RootPanel.get().add(options.getWidget()); RootPanel.get().getElement().removeChild(options.getWidget().getElement()); $(widget).appendTo(inner).css("display", oldDisplay); }
Source:
<code>public int run() throws IOException { if (targets == null || targets.isEmpty()) { throw new IllegalArgumentException("No views or datasets were specified."); } for (String uriOrName : targets) { if (isViewUri(uriOrName)) { View view = Datasets.load(uriOrName); Preconditions.checkArgument(viewMatches(view.getUri(), uriOrName), "Resolved view does not match requested view: " + view.getUri()); if(console.isDebugEnabled()){ for(PartitionView<?> pv: (Iterable<PartitionView<?>>) view.getCoveringPartitions()){ console.debug("Deleting partition {}", pv.getLocation()); } } if(!dryRun) { view.deleteAll(); } } else if (isDatasetUri(uriOrName)) { if (!dryRun){ Datasets.delete(uriOrName); } } else { if(!dryRun) { getDatasetRepository().delete(namespace, uriOrName); } } <START> console.debug("Deleted {}", uriOrName); <END> } return 0; }</code><technical_language>I this change depending this is a dry run. If so, "Would deleted {}" similar signal action taken</technical_language>

Target:
public int run() throws IOException { if (targets == null || targets.isEmpty()) { throw new IllegalArgumentException("No views or datasets were specified."); } for (String uriOrName : targets) { if (isViewUri(uriOrName)) { View view = Datasets.load(uriOrName); Preconditions.checkArgument(viewMatches(view.getUri(), uriOrName), "Resolved view does not match requested view: " + view.getUri()); if(console.isDebugEnabled()){ for(PartitionView<?> pv: (Iterable<PartitionView<?>>) view.getCoveringPartitions()){ if(pv.canDelete()) { console.debug("Deleting partition {}", pv.getLocation()); }else{ console.debug("Deleting is not supported for partition {}", pv.getLocation()); } } } if(!dryRun) { view.deleteAll(); } } else if (isDatasetUri(uriOrName)) { if (!dryRun){ Datasets.delete(uriOrName); } } else { if(!dryRun) { getDatasetRepository().delete(namespace, uriOrName); } } console.debug(dryRun ? "Would have deleted {}" : "Deleted {}", uriOrName); } return 0; }
Source:
<code>public void addPartitions(String databaseName, String tableName, List<PartitionWithStatistics> partitionsWithStatistics) { List<Partition> partitions = partitionsWithStatistics.stream() .map(ThriftMetastoreUtil::toMetastoreApiPartition) .collect(toImmutableList()); addMetastorePartitions(databaseName, tableName, partitions); try { if (partitionsWithStatistics.stream().allMatch(p -> p.getStatistics().getColumnStatistics().isEmpty())) { return; } Table table = getTable(databaseName, tableName) <START> .orElseThrow(() -> new TableNotFoundException(new SchemaTableName(databaseName, tableName))); <END> List<String> partitionColumns = table.getPartitionKeys().stream() .map(FieldSchema::getName) .collect(toImmutableList()); for (PartitionWithStatistics partitionWithStatistics : partitionsWithStatistics) { String partitionName = makePartName(partitionColumns, partitionWithStatistics.getPartition().getValues()); storePartitionColumnStatistics(databaseName, tableName, partitionName, partitionWithStatistics); } } catch (Throwable t) { for (Partition partition : partitions) { try { dropPartition(databaseName, tableName, partition.getValues(), false); } catch (Throwable suppressed) { if (t != suppressed) { t.addSuppressed(suppressed); } } } throw t; } }</code><technical_language>In opinion, is bad API design hive metastore methods partition names. of partVals. anyways, ship sailed. this API, care needs taken. I acceptable extra getTable calls. * Based reading, pre-existing getPartitionStatistics need turn partVals partition names, do conversions other around. * For new addPartitions alterPartition, thinking right approach this is include partition column names in thrift-API-side (as opposed extended-side) PartitionWithStatistics. Otherwise, calls turn a significant number of getTable calls</technical_language>

Target:
public void addPartitions(String databaseName, String tableName, List<PartitionWithStatistics> partitionsWithStatistics) { List<Partition> partitions = partitionsWithStatistics.stream() .map(ThriftMetastoreUtil::toMetastoreApiPartition) .collect(toImmutableList()); addPartitionsWithoutStatistics(databaseName, tableName, partitions); for (PartitionWithStatistics partitionWithStatistics : partitionsWithStatistics) { storePartitionColumnStatistics(databaseName, tableName, partitionWithStatistics.getPartitionName(), partitionWithStatistics); } }
Source:
<code>TaskData getTaskData(AbstractRepositoryConnector connector, IProgressMonitor monitor) throws CoreException { if (taskId != null && taskKey != null && connector.supportsSearchByTaskKey(repository)) { try { TaskData data = getTaskDataByKey(connector, monitor); if (data != null) { return data; } } catch (CoreException | RuntimeException e) { } <START> return connector.getTaskData(repository, taskId, monitor); <END> } else if (taskId != null) { return connector.getTaskData(repository, taskId, monitor); } else if (taskKey != null && connector.supportsSearchByTaskKey(repository)) { return getTaskDataByKey(connector, monitor); } return null; }</code><technical_language>I catch RuntimeException throw a CoreException message "Could find task ID taskId"</technical_language>

Target:
TaskData getTaskData(AbstractRepositoryConnector connector, IProgressMonitor monitor) throws CoreException { if (taskId != null && taskKey != null && connector.supportsSearchByTaskKey(repository)) { try { TaskData data = getTaskDataByKey(connector, monitor); if (data != null) { return data; } } catch (CoreException | RuntimeException e) { } try { return connector.getTaskData(repository, taskId, monitor); } catch (RuntimeException e) { throw new CoreException(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, String.format("Could not find task with ID %s", taskId), e)); } } else if (taskId != null) { return connector.getTaskData(repository, taskId, monitor); } else if (taskKey != null && connector.supportsSearchByTaskKey(repository)) { return getTaskDataByKey(connector, monitor); } return null; }
Source:
<code>public Map toMap() { <START> Map<String, Object> map = super.toMap(); <END> map.put(SCHEMA, this.parserSchema.toString()); return map; }</code><technical_language>reason for explicitly invoking super.toMap()</technical_language>

Target:
public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); map.put(SCHEMA, this.parserSchema.toString()); return map; }
Source:
<code>public Iterable<String> onTabComplete(CommandSender sender, String[] args) { final String lastArg = ( args.length > 0 ) ? args[args.length - 1].toLowerCase( Locale.ROOT ) : ""; return ProxyServer.getInstance().getPlayers().stream() <START> .map( player -> player.getName().toLowerCase( Locale.ROOT ) ) .filter( name -> name.startsWith( lastArg ) ) <END> .collect( Collectors.toList() ); }</code><technical_language>toLowerCase in .filter, player names suggested in case (this is original code do) suggestion .map( player -> player.getName() ) .filter( name -> name.toLowerCase( Locale.ROOT ).startsWith( lastArg ) )</technical_language>

Target:
public Iterable<String> onTabComplete(CommandSender sender, String[] args) { final String lastArg = ( args.length > 0 ) ? args[args.length - 1].toLowerCase( Locale.ROOT ) : ""; return ProxyServer.getInstance().getPlayers().stream() .map( player -> player.getName() ) .filter( name -> name.toLowerCase( Locale.ROOT ).startsWith( lastArg ) ) .collect( Collectors.toList() ); }
Source:
<code>private Rectangle getBounds(final Widget widget) { return syncExec(new Result<Rectangle>() { public Rectangle run() { Control parent; Rectangle widgetBounds; if (widget instanceof Control) { parent = ((Control) widget).getParent(); widgetBounds = ((Control) widget).getBounds(); } else if (widget instanceof TableItem) { parent = ((TableItem) widget).getParent(); <START> widgetBounds = ((TableItem) widget).getBounds(); <END> } else if (widget instanceof TreeItem) { parent = ((TreeItem) widget).getParent(); widgetBounds = ((TreeItem) widget).getBounds(); } else { return null; } Point location = new Point(widgetBounds.x, widgetBounds.y); if (parent != null) { location = parent.toDisplay(location); } Rectangle bounds = new Rectangle(location.x, location.y, widgetBounds.width, widgetBounds.height); return bounds; } }); }</code><technical_language>appears getBounds() parameter returns bounds of item's column, item's width</technical_language>

Target:
private Rectangle getBounds(final Widget widget) { return syncExec(new Result<Rectangle>() { public Rectangle run() { Control parent; Rectangle widgetBounds; if (widget instanceof Control) { parent = ((Control) widget).getParent(); widgetBounds = ((Control) widget).getBounds(); } else if (widget instanceof TableItem) { TableItem tableItem = (TableItem) widget; parent = tableItem.getParent(); widgetBounds = getTableItemBounds(tableItem); } else if (widget instanceof TreeItem) { TreeItem treeItem = (TreeItem) widget; parent = treeItem.getParent(); widgetBounds = getTreeItemBounds(treeItem); } else { return null; } Point location = new Point(widgetBounds.x, widgetBounds.y); if (parent != null) { location = parent.toDisplay(location); } return new Rectangle(location.x, location.y, widgetBounds.width, widgetBounds.height); } private Rectangle getTableItemBounds(TableItem tableItem) { Table table = tableItem.getParent(); int[] columnOrder = table.getColumnOrder(); Rectangle itemBounds; if (columnOrder.length > 0) { int lastColumnIndex = columnOrder[columnOrder.length - 1]; itemBounds = tableItem.getBounds(lastColumnIndex); } else { Rectangle tableBounds = table.getBounds(); itemBounds = tableItem.getBounds(); itemBounds.width = tableBounds.width; } return new Rectangle(0, itemBounds.y, itemBounds.x + itemBounds.width, itemBounds.height); } private Rectangle getTreeItemBounds(TreeItem treeItem) { Tree tree = treeItem.getParent(); int[] columnOrder = tree.getColumnOrder(); Rectangle itemBounds; if (columnOrder.length > 0) { int lastColumnIndex = columnOrder[columnOrder.length - 1]; itemBounds = treeItem.getBounds(lastColumnIndex); } else { Rectangle treeBounds = tree.getBounds(); itemBounds = treeItem.getBounds(); itemBounds.width = treeBounds.width; } return new Rectangle(0, itemBounds.y, itemBounds.x + itemBounds.width, itemBounds.height); } }); }
Source:
<code>public Collection<ViewPrototype> getAllPrototypes() { Collection<ViewPrototype> result = new ArrayList<ViewPrototype>(); for (MergedArchitectureViewpoint viewpoint : getViewpoints()) { for (RepresentationKind kind : viewpoint.getRepresentationKinds()) { PapyrusRepresentationKind view = (PapyrusRepresentationKind) kind; ViewPrototype proto = ViewPrototype.get(view); <START> if (!result.contains(proto) && null != proto) { <END> result.add(proto); } } } return result; }</code><technical_language>invert contains null condition please. necessary call contains if proto == null</technical_language>

Target:
public Collection<ViewPrototype> getAllPrototypes() { Collection<ViewPrototype> result = new ArrayList<ViewPrototype>(); for (MergedArchitectureViewpoint viewpoint : getViewpoints()) { for (RepresentationKind kind : viewpoint.getRepresentationKinds()) { PapyrusRepresentationKind view = (PapyrusRepresentationKind) kind; ViewPrototype proto = ViewPrototype.get(view); if (null != proto && !result.contains(proto)) { result.add(proto); } } } return result; }
Source:
<code>public void cluster_state_dump() throws Exception { put(0, "pets", "pet1", "Cubitus"); Properties properties = new Properties(); properties.setProperty(ConnectionPropertyNames.CONNECTION_TIMEOUT, String.valueOf("5000")); properties.setProperty(ConnectionPropertyNames.CONNECTION_NAME, "diagnostic"); properties.setProperty(PROP_REQUEST_TIMEOUT, "5000"); properties.setProperty(PROP_REQUEST_TIMEOUTMESSAGE, "5000"); URI uri = URI.create("diagnostic://" + voltron.getConnectionURI().getAuthority()); try (Connection connection = ConnectionFactory.connect(uri, properties)) { EntityRef<Diagnostics, Object, Void> ref = connection.getEntityRef(Diagnostics.class, 1, "root"); Diagnostics diagnostics = ref.fetchEntity(null); String dump = diagnostics.getClusterState(); System.out.println("=================================="); System.out.println(dump); System.out.println("=================================="); <START> fail("Complete this test"); <END> } }</code><technical_language>hum, I expect pass :-) add assertions too, dump.contains("configurationCount = 5") others</technical_language>

Target:
public void cluster_state_dump() throws Exception { put(0, "pets", "pet1", "Cubitus"); Properties properties = new Properties(); properties.setProperty(ConnectionPropertyNames.CONNECTION_TIMEOUT, String.valueOf("5000")); properties.setProperty(ConnectionPropertyNames.CONNECTION_NAME, "diagnostic"); properties.setProperty(PROP_REQUEST_TIMEOUT, "5000"); properties.setProperty(PROP_REQUEST_TIMEOUTMESSAGE, "5000"); URI uri = URI.create("diagnostic://" + voltron.getConnectionURI().getAuthority()); try (Connection connection = ConnectionFactory.connect(uri, properties)) { EntityRef<Diagnostics, Object, Void> ref = connection.getEntityRef(Diagnostics.class, 1, "root"); Diagnostics diagnostics = ref.fetchEntity(null); String dump = diagnostics.getClusterState(); String cluster = nmsService.readTopology().toMap().toString(); assertThat(dump, containsString(cluster)); assertThat(dump, containsString("server=")); assertThat(dump, containsString("configurationCount=")); assertThat(dump, containsString("manageable=true")); assertThat(dump, containsString("cluster=")); assertThat(dump, containsString("consumerId=")); assertThat(dump, containsString("stripeName=")); assertThat(dump, containsString("messageQueueSize=")); assertThat(dump, containsString("capacity=")); assertThat(dump, containsString("available=")); assertThat(dump, containsString("cacheName=")); assertThat(dump, containsString("cacheSize=")); assertThat(dump, containsString(".caches")); assertThat(dump, containsString("instance=")); assertThat(dump, containsString("clientCount=")); assertThat(dump, containsString(".clients")); } }
Source:
<code>protected void abandonSegment(final long truncatedTime, final Sink sink) { try { segmentAnnouncer.unannounceSegment(sink.getSegment()); removeSegment(sink, computePersistDir(schema, sink.getInterval())); log.info("Removing sinkKey %d for segment %s", truncatedTime, sink.getSegment().getIdentifier()); sinks.remove(truncatedTime); sinkTimeline.remove( sink.getInterval(), sink.getVersion(), new SingleElementPartitionChunk<>(sink) ); Iterables.transform(sink, new Function<FireHydrant, Void>() { @Nullable @Override public Void apply(@Nullable FireHydrant input) { cache.close(input.getSegment().getIdentifier() + "_" + input.getCount()); return null; } <START> }); <END> synchronized (handoffCondition) { handoffCondition.notifyAll(); } } catch (Exception e) { log.makeAlert(e, "Unable to abandon old segment for dataSource[%s]", schema.getDataSource()) .addData("interval", sink.getInterval()) .emit(); } }</code><technical_language>do need iterate for close called ? simply replace a for loop. Also, abstract namespace creation method</technical_language>

Target:
protected void abandonSegment(final long truncatedTime, final Sink sink) { try { segmentAnnouncer.unannounceSegment(sink.getSegment()); removeSegment(sink, computePersistDir(schema, sink.getInterval())); log.info("Removing sinkKey %d for segment %s", truncatedTime, sink.getSegment().getIdentifier()); sinks.remove(truncatedTime); sinkTimeline.remove( sink.getInterval(), sink.getVersion(), new SingleElementPartitionChunk<>(sink) ); for (FireHydrant hydrant : sink) { cache.close(makeHydrantIdentifier(hydrant, hydrant.getSegment())); } synchronized (handoffCondition) { handoffCondition.notifyAll(); } } catch (Exception e) { log.makeAlert(e, "Unable to abandon old segment for dataSource[%s]", schema.getDataSource()) .addData("interval", sink.getInterval()) .emit(); } }
Source:
<code>private void insert( Collection<PropertyValue> data ) throws IOException { PropertyValue[] dataArray = data.toArray( new PropertyValue[data.size()] ); for ( int i = 0; i < dataArray.length; i++ ) { <START> Document doc = LuceneDocumentStructure.documentRepresentingProperties( (long) i, dataArray[i].value ); <END> index.getIndexWriter().addDocument( doc ); } index.maybeRefreshBlocking(); }</code><technical_language>this cast long? automatically coerce. Similarly in SimpleUniquenessVerifierTest. a big issue, though</technical_language>

Target:
private void insert( Collection<PropertyValue> data ) throws IOException { PropertyValue[] dataArray = data.toArray( new PropertyValue[data.size()] ); for ( int i = 0; i < dataArray.length; i++ ) { Document doc = LuceneDocumentStructure.documentRepresentingProperties( i, dataArray[i].value ); index.getIndexWriter().addDocument( doc ); } index.maybeRefreshBlocking(); }
Source:
<code>public synchronized double getBPSAtoB() { <START> if (getDuration() == 0) { <END> return 0; } return fNbBytesAtoB / getDuration(); }</code><technical_language>comparing doubles == is risky, computer precision etc. Luckily, is Guava's DoubleMath.fuzzyEquals()</technical_language>

Target:
public synchronized double getBPSAtoB() { if (DoubleMath.fuzzyEquals(getDuration(), 0, Double.MIN_VALUE)) { return 0; } return fNbBytesAtoB / getDuration(); }
Source:
<code><START> public void collapseParent(ParentObject parentObject, int position) { <END> Object helperItem = mExpandableRecyclerAdapterHelper.getHelperItemAtPosition(position); if (helperItem instanceof ParentWrapper) { ParentWrapper parentWrapper = (ParentWrapper) helperItem; if (parentWrapper.getParentObject().equals(parentObject) && parentWrapper.isExpanded()) { expandParent(parentObject, position); } } }</code><technical_language>this meant public? if lets a expand equivalent (should rename current expandParent toggleExpansion instead expands collapses)</technical_language>

Target:
public void collapseParent(ParentObject parentObject, int position) { Object helperItem = mHelper.getHelperItemAtPosition(position); if (helperItem instanceof ParentWrapper) { ParentWrapper parentWrapper = (ParentWrapper) helperItem; if (parentWrapper.getParentObject().equals(parentObject) && parentWrapper.isExpanded()) { toggleParentExpansion(parentObject, position); } } }
Source:
<code>private void fetchRelatedEntities(GlusterVolumeEntity volume) { if (volume != null) { volume.setOptions(dbFacade.getGlusterOptionDao().getOptionsOfVolume(volume.getId())); volume.setAccessProtocols(new HashSet<AccessProtocol>(getAccessProtocolsOfVolume(volume.getId()))); volume.setTransportTypes(new HashSet<TransportType>(getTransportTypesOfVolume(volume.getId()))); volume.setAsyncTask(getAsyncTaskOfVolume(volume.getId())); List<GlusterBrickEntity> bricks = dbFacade.getGlusterBrickDao().getBricksOfVolume(volume.getId()); <START> if (volume.getAsyncTask()!=null && volume.getAsyncTask().getStepId() != null) { <END> for (GlusterBrickEntity brick: bricks) { if (brick.getAsyncTask() != null && brick.getAsyncTask().getTaskId().equals(volume.getAsyncTask().getTaskId())) { brick.setAsyncTask(volume.getAsyncTask()); } } } volume.setBricks(bricks); } }</code><technical_language>stepId is set while fetching task details db. need check null for taskId</technical_language>

Target:
private void fetchRelatedEntities(GlusterVolumeEntity volume) { if (volume != null) { volume.setOptions(dbFacade.getGlusterOptionDao().getOptionsOfVolume(volume.getId())); volume.setAccessProtocols(new HashSet<AccessProtocol>(getAccessProtocolsOfVolume(volume.getId()))); volume.setTransportTypes(new HashSet<TransportType>(getTransportTypesOfVolume(volume.getId()))); volume.setAsyncTask(getAsyncTaskOfVolume(volume.getId())); List<GlusterBrickEntity> bricks = dbFacade.getGlusterBrickDao().getBricksOfVolume(volume.getId()); if (volume.getAsyncTask()!=null && volume.getAsyncTask().getTaskId() != null) { for (GlusterBrickEntity brick: bricks) { if (brick.getAsyncTask() != null && brick.getAsyncTask().getTaskId().equals(volume.getAsyncTask().getTaskId())) { brick.setAsyncTask(volume.getAsyncTask()); } } } volume.setBricks(bricks); } }
Source:
<code>public PurchasedNumberCreatedResponse purchaseNumber(String number, String countryCode, int billingIntervalMonths) throws UnauthorizedException, GeneralException { final String url = String.format("%s/v1/phone-numbers", NUMBERS_CALLS_BASE_URL); final Map<String, Object> payload = new LinkedHashMap<String, Object>(); payload.put("number", number); payload.put("countryCode", countryCode); <START> payload.put("billingIntervalMonths", billingIntervalMonths); <END> return messageBirdService.sendPayLoad(url, payload, PurchasedNumberCreatedResponse.class); }</code><technical_language>check billingIntervalMonths return a meaningful exception. doc, Valid values: 1, 3, 6, 9, 12</technical_language>

Target:
public PurchasedNumberCreatedResponse purchaseNumber(String number, String countryCode, int billingIntervalMonths) throws UnauthorizedException, GeneralException, IllegalArgumentException { countryCodeIsValid(countryCode); final String url = String.format("%s/phone-numbers", NUMBERS_CALLS_BASE_URL); final Map<String, Object> payload = new LinkedHashMap<String, Object>(); payload.put("number", number); payload.put("countryCode", countryCode); if (!Arrays.asList(1, 3, 6, 9).contains(billingIntervalMonths)) { throw new IllegalArgumentException("Billing Interval Must Be Either 1, 3, 6, or 9."); } payload.put("billingIntervalMonths", billingIntervalMonths); return messageBirdService.sendPayLoad(url, payload, PurchasedNumberCreatedResponse.class); }
Source:
<code>private String toStringDescription() { if (Strings.isValid(getDescription())) { return " - " + getDescription(); } return ""; <START> } <END></code><technical_language>adhere coding style of this file multiple return statements</technical_language>

Target:
private String toStringDescription() { String description = ""; if (Strings.isValid(getDescription())) { description = " - " + getDescription(); } return description; }
Source:
<code>public XyrisTheWrithingStormDrawAbility() { <START> super(Zone.BATTLEFIELD, new XyrisTheWrithingStormTokenEffect(), false); <END> }</code><technical_language>CreateTokenEffect</technical_language>

Target:
public XyrisTheWrithingStormDrawAbility() { super(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken(), 1), false); }
Source:
<code>public void testJsonContentsGettingElement() throws Exception { <START> assertEquals(HttpValueFunctions.jsonContents("mykey", String.class).apply(response), "myvalue"); <END> }</code><technical_language>above: eliminate magic literals</technical_language>

Target:
public void testJsonContentsGettingElement() throws Exception { assertEquals(HttpValueFunctions.jsonContents(bodyKey, String.class).apply(response), bodyVal); }
Source:
<code>protected Iterable<IAnalysisModule> getDependentAnalyses() { ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException(); } <START> IAnalysisModule module = trace.getAnalysisModule(TidAnalysisModule.ID); if (module == null) { return Collections.emptySet(); } return ImmutableSet.of(module); <END> }</code><technical_language>if run next, find TIDAnalysisModule, able reproduce analysis results. TmfAnalysisManager.getAnalysisModules instead of trace.get... throw IllegalStateException if find it</technical_language>

Target:
protected Iterable<IAnalysisModule> getDependentAnalyses() { ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException("Trace should not be null"); } IAnalysisModule module = TmfTraceUtils.getAnalysisModuleOfClass(trace, TidAnalysisModule.class, TidAnalysisModule.ID); if (module == null) { throw new IllegalStateException("Module should not be null"); } return ImmutableSet.of(module); }
Source:
<code>private void reportMTUDifferences(List<Network> ifaceNetworks) { List<String> mtuDiffNetworks = new ArrayList<String>(); for (Network net : ifaceNetworks) { <START> mtuDiffNetworks.add(String.format("%s(%d)", net.getName(), net.getMtu())); <END> } addViolation(VdcBllMessages.NETWORK_MTU_DIFFERENCES, String.format("[%s]", StringUtils.join(mtuDiffNetworks, ", "))); }</code><technical_language>MTU 0 logged differently (i.e. "default" similar)</technical_language>

Target:
private void reportMTUDifferences(List<Network> ifaceNetworks) { List<String> mtuDiffNetworks = new ArrayList<String>(); for (Network net : ifaceNetworks) { mtuDiffNetworks.add(String.format("%s(%s)", net.getName(), net.getMtu() == 0 ? "default" : String.valueOf(net.getMtu()))); } addViolation(VdcBllMessages.NETWORK_MTU_DIFFERENCES, String.format("[%s]", StringUtils.join(mtuDiffNetworks, ", "))); }
Source:
<code>public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); <START> return this; <END> }</code><technical_language>Is necessary remove this setLocation child? I this a regression docking palette</technical_language>

Target:
public WiresLayer dock(final WiresContainer parent, final WiresShape child) { final WiresDockingControl dockingControl = child.getControl().getDockingControl(); dockingControl.dock(parent); final Point2D candidateLocation = dockingControl.getCandidateLocation(); if (null != candidateLocation) { child.setLocation(candidateLocation); } return this; }
Source:
<code>private void captureTable(Table t) throws SQLException { int i = 0; infoSchemaStmt.setString(1, t.getDatabase()); infoSchemaStmt.setString(2, t.getName()); ResultSet r = infoSchemaStmt.executeQuery(); while(r.next()) { String[] enumValues = null; String colName = r.getString("COLUMN_NAME"); String colType = r.getString("DATA_TYPE"); String colEnc = r.getString("CHARACTER_SET_NAME"); int colPos = r.getInt("ORDINAL_POSITION") - 1; boolean colSigned = !r.getString("COLUMN_TYPE").matches(".* unsigned$"); Long columnLength; try { columnLength = r.getLong("DATETIME_PRECISION"); } catch ( java.sql.SQLException e ) { <START> columnLength = null; <END> } if ( r.getString("COLUMN_KEY").equals("PRI") ) t.pkIndex = i; if ( colType.equals("enum") || colType.equals("set")) { String expandedType = r.getString("COLUMN_TYPE"); enumValues = extractEnumValues(expandedType); } t.addColumn(ColumnDef.build(colName, colEnc, colType, colPos, colSigned, enumValues, columnLength)); i++; } captureTablePK(t); }</code><technical_language>right check for null. try: columnLength = ... if ( r.wasNull() ) columnLength = null;</technical_language>

Target:
private void captureTable(Table t) throws SQLException { int i = 0; infoSchemaStmt.setString(1, t.getDatabase()); infoSchemaStmt.setString(2, t.getName()); ResultSet r = infoSchemaStmt.executeQuery(); boolean hasDatetimePrecision = isMySQLAtLeast56(); while(r.next()) { String[] enumValues = null; String colName = r.getString("COLUMN_NAME"); String colType = r.getString("DATA_TYPE"); String colEnc = r.getString("CHARACTER_SET_NAME"); int colPos = r.getInt("ORDINAL_POSITION") - 1; boolean colSigned = !r.getString("COLUMN_TYPE").matches(".* unsigned$"); Long columnLength = null; if (hasDatetimePrecision) columnLength = r.getLong("DATETIME_PRECISION"); if ( r.getString("COLUMN_KEY").equals("PRI") ) t.pkIndex = i; if ( colType.equals("enum") || colType.equals("set")) { String expandedType = r.getString("COLUMN_TYPE"); enumValues = extractEnumValues(expandedType); } t.addColumn(ColumnDef.build(colName, colEnc, colType, colPos, colSigned, enumValues, columnLength)); i++; } captureTablePK(t); }
Source:
<code>public ActionResult execute() { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); List<FeedbackSessionAttributes> feedbackSessionAttributes; if (courseId == null) { <START> if (userInfo.isInstructor) { <END> boolean isInRecycleBin = getBooleanRequestParamValue(Const.ParamsNames.IS_IN_RECYCLE_BIN); List<InstructorAttributes> instructors = logic.getInstructorsForGoogleId(userInfo.getId(), true); if (isInRecycleBin) { feedbackSessionAttributes = logic.getSoftDeletedFeedbackSessionsListForInstructors(instructors); } else { feedbackSessionAttributes = logic.getFeedbackSessionsListForInstructor(instructors); } } else { List<StudentAttributes> students = logic.getStudentsForGoogleId(userInfo.getId()); feedbackSessionAttributes = new ArrayList<>(); for (StudentAttributes student : students) { feedbackSessionAttributes.addAll(logic.getFeedbackSessionsForCourse(student.getCourse())); } } } else { feedbackSessionAttributes = logic.getFeedbackSessionsForCourse(courseId); } return new JsonResult(new FeedbackSessionsData(feedbackSessionAttributes)); }</code><technical_language>If a login entity is a student instructor of course, able get courses involved a student. want presence of param IS_IN_RECYCLE_BIN distinguish request</technical_language>

Target:
public ActionResult execute() { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); List<FeedbackSessionAttributes> feedbackSessionAttributes; if (courseId == null) { if (entityType.equals(Const.EntityType.STUDENT)) { List<StudentAttributes> students = logic.getStudentsForGoogleId(userInfo.getId()); feedbackSessionAttributes = new ArrayList<>(); for (StudentAttributes student : students) { feedbackSessionAttributes.addAll(logic.getFeedbackSessionsForCourse(student.getCourse())); } } else { boolean isInRecycleBin = getBooleanRequestParamValue(Const.ParamsNames.IS_IN_RECYCLE_BIN); List<InstructorAttributes> instructors = logic.getInstructorsForGoogleId(userInfo.getId(), true); if (isInRecycleBin) { feedbackSessionAttributes = logic.getSoftDeletedFeedbackSessionsListForInstructors(instructors); } else { feedbackSessionAttributes = logic.getFeedbackSessionsListForInstructor(instructors); } } } else { feedbackSessionAttributes = logic.getFeedbackSessionsForCourse(courseId); } if (entityType.equals(Const.EntityType.STUDENT)) { feedbackSessionAttributes = feedbackSessionAttributes.stream() .filter(FeedbackSessionAttributes::isVisible).collect(Collectors.toList()); } FeedbackSessionsData responseData = new FeedbackSessionsData(feedbackSessionAttributes); if (entityType.equals(Const.EntityType.STUDENT)) { responseData.getFeedbackSessions().forEach(FeedbackSessionData::hideInformationForStudent); } return new JsonResult(responseData); }
Source:
<code>private static List<String> getExpectedInputParams(final CSARID csarID, final QName typeID, final String interfaceName, final String operationName) { ParameterHandler.LOG.debug("Fetching expected input params of " + operationName + " in interface " + interfaceName); final List<String> inputParams = new ArrayList<>(); ParameterHandler.LOG.debug("Checking for params with Type: {}", typeID); if (ServiceHandler.toscaEngineService.hasOperationOfATypeSpecifiedInputParams(csarID, typeID, interfaceName, operationName)) { final Node definedInputParameters = ServiceHandler.toscaEngineService.getInputParametersOfATypeOperation(csarID, typeID, interfaceName, operationName); if (definedInputParameters != null) { final NodeList definedInputParameterList = definedInputParameters.getChildNodes(); for (int i = 0; i < definedInputParameterList.getLength(); i++) { final Node currentNode = definedInputParameterList.item(i); if (currentNode.getNodeType() == Node.ELEMENT_NODE) { final String name = ((Element) currentNode).getAttribute("name"); inputParams.add(name); } } } <START> } <END> return inputParams; }</code><technical_language>arrow code. fixing, consider replace early returns return Collections.emptyList() avoid extra List allocation</technical_language>

Target:
private static Set<String> getExpectedInputParams(final CSARID csarID, final QName typeID, final String interfaceName, final String operationName) { final Node definedInputParameters = ServiceHandler.toscaEngineService.getInputParametersOfATypeOperation(csarID, typeID, interfaceName, operationName); if (Objects.isNull(definedInputParameters)) { return Collections.emptySet(); } final Set<String> inputParams = new HashSet<>(); final NodeList definedInputParameterList = definedInputParameters.getChildNodes(); for (int i = 0; i < definedInputParameterList.getLength(); i++) { final Node currentNode = definedInputParameterList.item(i); if (currentNode.getNodeType() == Node.ELEMENT_NODE) { final String name = ((Element) currentNode).getAttribute("name"); inputParams.add(name); } } return inputParams; }
Source:
<code>public static void resetServerConfiguration() throws Exception { try (CLIWrapper cli = new CLIWrapper(true)) { <START> FileUtils.deleteQuietly(tempFolder); <END> cli.sendLine(String.format( "/core-service=management/management-interface=http-interface:undefine-attribute(name=http-authentication-factory)", MANAGEMENT_FILESYSTEM_NAME)); cli.sendLine(String.format( "/subsystem=elytron/http-authentication-factory=%s:remove()", MANAGEMENT_FILESYSTEM_NAME, PREDEFINED_HTTP_SERVER_MECHANISM_FACTORY)); cli.sendLine(String.format("/subsystem=elytron/security-domain=%s:remove()", MANAGEMENT_FILESYSTEM_NAME)); cli.sendLine(String.format("/subsystem=elytron/filesystem-realm=%s:remove()", MANAGEMENT_FILESYSTEM_NAME)); } FileUtils.deleteDirectory(tempFolder); }</code><technical_language>This needed deleted below</technical_language>

Target:
public static void resetServerConfiguration() throws Exception { try (CLIWrapper cli = new CLIWrapper(true)) { cli.sendLine(String.format( "/core-service=management/management-interface=http-interface:undefine-attribute(name=http-authentication-factory)", MANAGEMENT_FILESYSTEM_NAME), true); cli.sendLine(String.format( "/subsystem=elytron/http-authentication-factory=%s:remove()", MANAGEMENT_FILESYSTEM_NAME, PREDEFINED_HTTP_SERVER_MECHANISM_FACTORY), true); cli.sendLine(String.format("/subsystem=elytron/security-domain=%s:remove()", MANAGEMENT_FILESYSTEM_NAME), true); cli.sendLine(String.format("/subsystem=elytron/filesystem-realm=%s:remove()", MANAGEMENT_FILESYSTEM_NAME), true); cli.sendLine(String.format("/subsystem=elytron/custom-credential-security-factory=%s:remove()", CUSTOM_CRED_SEC_FACTORY_NAME), true); cli.sendLine("module remove --name=" + CUSTOM_CREDENTIAL_SECURITY_FACTORY_MODULE_NAME, true); } finally { FileUtils.deleteDirectory(tempFolder.toFile()); } }
Source:
<code>public void getBoolean() { <START> account.setNotifyByEmail(Boolean.TRUE); <END> assertTrue(service.getOptions(TestConstants.TEST_STUDY, HEALTH_CODE).getBoolean(EMAIL_NOTIFICATIONS)); }</code><technical_language>Minor: consolidate of "get" tests a single test of test is in a single place</technical_language>

Target:
public void getBoolean() { account.setNotifyByEmail(Boolean.FALSE); assertFalse(service.getOptions(TestConstants.TEST_STUDY, HEALTH_CODE).getBoolean(EMAIL_NOTIFICATIONS)); account.setNotifyByEmail(Boolean.TRUE); assertTrue(service.getOptions(TestConstants.TEST_STUDY, HEALTH_CODE).getBoolean(EMAIL_NOTIFICATIONS)); }
Source:
<code>public LeaderAndIsrRequest build(short version) { List<LeaderAndIsrLiveLeader> leaders = liveLeaders.stream().map(n -> new LeaderAndIsrLiveLeader() .setBrokerId(n.id()) .setHostName(n.host()) .setPort(n.port()) ).collect(Collectors.toList()); LeaderAndIsrRequestData data = new LeaderAndIsrRequestData() .setControllerId(controllerId) .setControllerEpoch(controllerEpoch) .setBrokerEpoch(brokerEpoch) .setLiveLeaders(leaders); if (version >= 2) { <START> Map<String, List<LeaderAndIsrPartitionState>> groupedMap = groupByTopic(partitionStates); <END> List<LeaderAndIsrTopicState> topicStates = groupedMap.entrySet().stream().map(entry -> new LeaderAndIsrTopicState() .setTopicName(entry.getKey()) .setPartitionStates(entry.getValue()) ).collect(Collectors.toList()); data.setTopicStates(topicStates); } else { data.setUngroupedPartitionStates(partitionStates); } return new LeaderAndIsrRequest(data, version); }</code><technical_language>hmm. groupByTopic iterate partitionState, build a Map<String, LeaderAndIsrTopicState> do data.setTopicStates(map.values()), right</technical_language>

Target:
public LeaderAndIsrRequest build(short version) { List<LeaderAndIsrLiveLeader> leaders = liveLeaders.stream().map(n -> new LeaderAndIsrLiveLeader() .setBrokerId(n.id()) .setHostName(n.host()) .setPort(n.port()) ).collect(Collectors.toList()); LeaderAndIsrRequestData data = new LeaderAndIsrRequestData() .setControllerId(controllerId) .setControllerEpoch(controllerEpoch) .setBrokerEpoch(brokerEpoch) .setLiveLeaders(leaders); if (version >= 2) { Map<String, LeaderAndIsrTopicState> topicStatesMap = groupByTopic(partitionStates); data.setTopicStates(new ArrayList<>(topicStatesMap.values())); } else { data.setUngroupedPartitionStates(partitionStates); } return new LeaderAndIsrRequest(data, version); }
Source:
<code>public Board() { <START> Buttons(); <END> createScore(); createGrid(); initGameProperties(); }</code><technical_language>name of method doSomething, initButtons. fix this</technical_language>

Target:
public Board() { CreateButtons(); createScore(); createGrid(); initGameProperties(); }
Source:
<code>public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { if (cachedTraversals == null) { try { cachedTraversals = convertCompareTraversal(resolveEMFTraversal(context, monitor)); } catch (InterruptedException e) { <START> final ResourceTraversal singletonTraversal = new ResourceTraversal(new IResource[] {file, }, <END> IResource.DEPTH_ONE, IResource.NONE); return new ResourceTraversal[] {singletonTraversal, }; } } return cachedTraversals; }</code><technical_language>Thread.currentThread().interrupt()</technical_language>

Target:
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { if (cachedTraversals == null) { try { cachedTraversals = convertCompareTraversal(resolveEMFTraversal(context, monitor)); } catch (InterruptedException e) { Thread.currentThread().interrupt(); final ResourceTraversal singletonTraversal = new ResourceTraversal(new IResource[] {file, }, IResource.DEPTH_ONE, IResource.NONE); return new ResourceTraversal[] {singletonTraversal, }; } } return cachedTraversals; }
Source:
<code>T perform() throws Exception; } <START> public interface OnFailure <END> { void perform() throws Exception; }</code><technical_language>sense more specific call CleanupAfterFailure, method cleanupAfterFailure()</technical_language>

Target:
T perform() throws Exception; } public interface CleanupAfterFailure { void cleanup() throws Exception; }
Source:
<code><START> private boolean hasPropertiesWithValues() <END> { int targetCount = queries.length; read.singleNode( nodeLabelCursor.nodeReference(), nodeCursor ); if ( nodeCursor.next() ) { nodeCursor.properties( propertyCursor ); while ( propertyCursor.next() ) { for ( IndexQuery query : queries ) { if ( propertyCursor.propertyKey() == query.propertyKeyId() && query.acceptsValueAt( propertyCursor ) ) { targetCount--; if ( targetCount == 0 ) { return true; } } } } } return false; }</code><technical_language>this simpler: private boolean hasPropertiesWithValues() { read.singleNode( nodeLabelCursor.nodeReference(), nodeCursor ); if ( nodeCursor.next() ) { nodeCursor.properties( propertyCursor ); while ( propertyCursor.next() ) { for ( IndexQuery query : queries ) { if ( propertyCursor.propertyKey() != query.propertyKeyId() || !query.acceptsValueAt( propertyCursor ) ) { return false; } } } return true; } return false; }</technical_language>

Target:
private boolean hasPropertiesWithValues() { int targetCount = queries.length; read.singleNode( nodeLabelCursor.nodeReference(), nodeCursor ); if ( nodeCursor.next() ) { nodeCursor.properties( propertyCursor ); while ( propertyCursor.next() ) { for ( IndexQuery query : queries ) { if ( propertyCursor.propertyKey() == query.propertyKeyId() ) { if ( query.acceptsValueAt( propertyCursor ) ) { targetCount--; if ( targetCount == 0 ) { return true; } } else { return false; } } } } } return false; }