auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testSyncInOnly() throws Exception { String routeId = "testSyncInOnlyExceptionRoute"; RouteBuilder builder = new RouteBuilder() { @Override public void configure() throws Exception { from("direct:start").routeId(routeId) .setBody(simple("${body.getParameter(\"request\")}")) .to("mock:result"); } }; context.addRoutes(builder); try { <START> ServiceRegistry.get().register("GlobalCamelService", context); <END> String expectedBody = "helloRequest"; resultEndpoint.expectedBodiesReceived(expectedBody); WorkItemImpl workItem = new WorkItemImpl(); workItem.setParameter("camel-endpoint-id", "start"); workItem.setParameter("request", expectedBody); TestWorkItemManager manager = new TestWorkItemManager(); WorkItemHandler handler = new InOnlyCamelWorkItemHandler(); handler.executeWorkItem(workItem, manager); assertThat(manager.getResults().size(), equalTo(0)); resultEndpoint.assertIsSatisfied(); } finally { context.removeRoute(routeId); } }</code><technical_language>constant</technical_language>

Target:
public void testSyncInOnly() throws Exception { String routeId = "testSyncInOnlyExceptionRoute"; RouteBuilder builder = new RouteBuilder() { @Override public void configure() throws Exception { from("direct:start").routeId(routeId) .setBody(simple("${body.getParameter(\"Request\")}")) .to("mock:result"); } }; context.addRoutes(builder); try { ServiceRegistry.get().register(JBPMConstants.GLOBAL_CAMEL_CONTEXT_SERVICE_KEY, context); String expectedBody = "helloRequest"; resultEndpoint.expectedBodiesReceived(expectedBody); WorkItemImpl workItem = new WorkItemImpl(); workItem.setParameter(JBPMConstants.CAMEL_ENDPOINT_ID_WI_PARAM, "start"); workItem.setParameter("Request", expectedBody); TestWorkItemManager manager = new TestWorkItemManager(); WorkItemHandler handler = new InOnlyCamelWorkItemHandler(); handler.executeWorkItem(workItem, manager); assertThat(manager.getResults().size(), equalTo(0)); resultEndpoint.assertIsSatisfied(); } finally { context.removeRoute(routeId); } }
Source:
<code>public Request init(Request request) { String context = request.getContext(); <START> if (context == null || !context.toLowerCase().contains("gwc/service")) { <END> return null; } Map<String, String> kvp = new HashMap<>(); kvp.put("service", "gwc"); kvp.put("version", "1.0.0"); kvp.put("request", "dispatch"); WorkspaceInfo localWorkspace = LocalWorkspace.get(); if (localWorkspace != null) { String layerName = (String) request.getKvp().get("LAYER"); if (layerName == null) { layerName = (String) request.getKvp().get("layer"); } if (layerName != null) { layerName = CatalogConfiguration.removeWorkspacePrefix(layerName, catalog); layerName = localWorkspace.getName() + ":" + layerName; kvp.put("LAYER", layerName); } request.setHttpRequest(new VirtualServiceRequest(request.getHttpRequest(), localWorkspace.getName(), layerName)); } request.setKvp(kvp); request.setRawKvp(kvp); return request; }</code><technical_language>Is this needed a good idea</technical_language>

Target:
public Request init(Request request) { String context = request.getContext(); if (context == null || !isGwcServiceTargeted(context)) { return null; } GWC_OPERATION.set((String) request.getKvp().get("REQUEST")); Map<String, String> kvp = new HashMap<>(); kvp.put("service", "gwc"); kvp.put("version", "1.0.0"); kvp.put("request", "dispatch"); WorkspaceInfo localWorkspace = LocalWorkspace.get(); if (localWorkspace != null) { String layerName = (String) request.getKvp().get("LAYER"); if (layerName == null) { layerName = (String) request.getKvp().get("layer"); } if (layerName != null) { layerName = CatalogConfiguration.removeWorkspacePrefix(layerName, catalog); layerName = localWorkspace.getName() + ":" + layerName; kvp.put("LAYER", layerName); } request.setHttpRequest(new VirtualServiceRequest(request.getHttpRequest(), localWorkspace.getName(), layerName)); } request.setKvp(kvp); request.setRawKvp(kvp); return request; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); blockDrawerFromOpening(); String screenName; String actionItem; Map<String, String> values = new HashMap<>(); if (searchQuery != null) { screenName = ISegment.Screens.FORUM_SEARCH_THREADS; values.put(ISegment.Keys.SEARCH_STRING, searchQuery); actionItem = searchQuery; } else { screenName = ISegment.Screens.FORUM_VIEW_TOPIC_THREADS; String topicId = discussionTopic.getIdentifier(); if (DiscussionTopic.ALL_TOPICS_ID.equals(topicId)) { topicId = ISegment.Values.POSTS_ALL; <START> actionItem = topicId.toLowerCase(); <END> } else if (DiscussionTopic.FOLLOWING_TOPICS_ID.equals(topicId)) { topicId = ISegment.Values.POSTS_FOLLOWING; actionItem = topicId.toLowerCase(); } else { actionItem = discussionTopic.getName(); } values.put(ISegment.Keys.TOPIC_ID, topicId); } environment.getSegment().trackScreenView(screenName, courseData.getCourse().getId(), actionItem, values); }</code><technical_language>Is a reason lowercase these</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); blockDrawerFromOpening(); String screenName; String actionItem; Map<String, String> values = new HashMap<>(); if (searchQuery != null) { screenName = ISegment.Screens.FORUM_SEARCH_THREADS; values.put(ISegment.Keys.SEARCH_STRING, searchQuery); actionItem = searchQuery; } else { screenName = ISegment.Screens.FORUM_VIEW_TOPIC_THREADS; String topicId = discussionTopic.getIdentifier(); if (DiscussionTopic.ALL_TOPICS_ID.equals(topicId)) { topicId = actionItem = ISegment.Values.POSTS_ALL; } else if (DiscussionTopic.FOLLOWING_TOPICS_ID.equals(topicId)) { topicId = actionItem = ISegment.Values.POSTS_FOLLOWING; } else { actionItem = discussionTopic.getName(); } values.put(ISegment.Keys.TOPIC_ID, topicId); } environment.getSegment().trackScreenView(screenName, courseData.getCourse().getId(), actionItem, values); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> AnalyticsTracker.track(AnalyticsTracker.Stat.READER_SEARCH_LOADED); <END> if (savedInstanceState != null) { AppLog.d(T.READER, "reader post list > restoring instance state"); if (savedInstanceState.containsKey(ReaderConstants.ARG_TAG)) { mCurrentTag = (ReaderTag) savedInstanceState.getSerializable(ReaderConstants.ARG_TAG); } if (savedInstanceState.containsKey(ReaderConstants.ARG_BLOG_ID)) { mCurrentBlogId = savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID); } if (savedInstanceState.containsKey(ReaderConstants.ARG_FEED_ID)) { mCurrentFeedId = savedInstanceState.getLong(ReaderConstants.ARG_FEED_ID); } if (savedInstanceState.containsKey(ReaderConstants.ARG_SEARCH_QUERY)) { mCurrentSearchQuery = savedInstanceState.getString(ReaderConstants.ARG_SEARCH_QUERY); } if (savedInstanceState.containsKey(ReaderConstants.ARG_POST_LIST_TYPE)) { mPostListType = (ReaderPostListType) savedInstanceState.getSerializable(ReaderConstants.ARG_POST_LIST_TYPE); } if (getPostListType() == ReaderPostListType.TAG_PREVIEW) { mTagPreviewHistory.restoreInstance(savedInstanceState); } mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION); mWasPaused = savedInstanceState.getBoolean(ReaderConstants.KEY_WAS_PAUSED); mHasUpdatedPosts = savedInstanceState.getBoolean(ReaderConstants.KEY_ALREADY_UPDATED); mFirstLoad = savedInstanceState.getBoolean(ReaderConstants.KEY_FIRST_LOAD); } }</code><technical_language>This fragment for search results, this tracked here</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) { AppLog.d(T.READER, "reader post list > restoring instance state"); if (savedInstanceState.containsKey(ReaderConstants.ARG_TAG)) { mCurrentTag = (ReaderTag) savedInstanceState.getSerializable(ReaderConstants.ARG_TAG); } if (savedInstanceState.containsKey(ReaderConstants.ARG_BLOG_ID)) { mCurrentBlogId = savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID); } if (savedInstanceState.containsKey(ReaderConstants.ARG_FEED_ID)) { mCurrentFeedId = savedInstanceState.getLong(ReaderConstants.ARG_FEED_ID); } if (savedInstanceState.containsKey(ReaderConstants.ARG_SEARCH_QUERY)) { mCurrentSearchQuery = savedInstanceState.getString(ReaderConstants.ARG_SEARCH_QUERY); } if (savedInstanceState.containsKey(ReaderConstants.ARG_POST_LIST_TYPE)) { mPostListType = (ReaderPostListType) savedInstanceState.getSerializable(ReaderConstants.ARG_POST_LIST_TYPE); } if (getPostListType() == ReaderPostListType.TAG_PREVIEW) { mTagPreviewHistory.restoreInstance(savedInstanceState); } mRestorePosition = savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION); mWasPaused = savedInstanceState.getBoolean(ReaderConstants.KEY_WAS_PAUSED); mHasUpdatedPosts = savedInstanceState.getBoolean(ReaderConstants.KEY_ALREADY_UPDATED); mFirstLoad = savedInstanceState.getBoolean(ReaderConstants.KEY_FIRST_LOAD); } }
Source:
<code>private void run() throws Exception { String output = null; OutputStream outputStream; this.validateArguments(); if (algorithm.equals(SHA256_ALGORITHM)) { output = passwordManager.createPBDKF2SHA256Password(password); } else if (algorithm.equals(SHA512_ALGORITHM)) { output = passwordManager.createPBDKF2SHA512Password(password); } if (!fileName.isEmpty()) { outputStream = new FileOutputStream(this.fileName, !created); } else { outputStream = System.out; } if (output != null) { try { outputStream.write(username.getBytes()); outputStream.write(":".getBytes()); outputStream.write(output.getBytes()); outputStream.write("\n".getBytes()); } catch (IOException e) { throw new RuntimeException(e.getMessage()); } } else { throw new RuntimeException("Invalid output from algorithm, this should not happens, could be a bug"); <START> } <END> }</code><technical_language>outputStream closed (unless System.out). a big problem, clean..</technical_language>

Target:
private void run() throws Exception { String output = null; OutputStream outputStream; this.validateArguments(); if (algorithm.equals(SHA256_ALGORITHM)) { output = passwordManager.createPBDKF2SHA256Password(password); } else if (algorithm.equals(SHA512_ALGORITHM)) { output = passwordManager.createPBDKF2SHA512Password(password); } if (!fileName.isEmpty()) { outputStream = new FileOutputStream(this.fileName, !overwrite); } else { outputStream = System.out; } if (output != null) { try { outputStream.write(username.getBytes()); outputStream.write(":".getBytes()); outputStream.write(output.getBytes()); outputStream.write("\n".getBytes()); } catch (IOException e) { throw new RuntimeException(e.getMessage()); } finally { outputStream.close(); } } else { throw new RuntimeException("Invalid output from algorithm, this should not happens, could be a bug"); } }
Source:
<code>public void testGetContentSummary() throws IOException { ContentSummary summaryBefore = fsView.getContentSummary(new Path("/internalDir")); String expected = "GET CONTENT SUMMARY"; Path filePath = new Path("/internalDir/internalDir2/linkToDir3", "foo"); try (FSDataOutputStream outputStream = fsView.create(filePath)) { <START> try (OutputStreamWriter writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)) { try (BufferedWriter buffer = new BufferedWriter(writer)) { buffer.write(expected); } <END> } } Path newDirPath = new Path("/internalDir/linkToDir2", "bar"); fsView.mkdirs(newDirPath); ContentSummary summaryAfter = fsView.getContentSummary(new Path("/internalDir")); Assert.assertEquals("The file count didn't match", summaryBefore.getFileCount() + 1, summaryAfter.getFileCount()); Assert.assertEquals("The size didn't match", summaryBefore.getLength() + expected.length(), summaryAfter.getLength()); Assert.assertEquals("The directory count didn't match", summaryBefore.getDirectoryCount() + 1, summaryAfter.getDirectoryCount()); }</code><technical_language>this work? outputStream.write(expected.getBytes());</technical_language>

Target:
public void testGetContentSummary() throws IOException { ContentSummary summaryBefore = fsView.getContentSummary(new Path("/internalDir")); String expected = "GET CONTENT SUMMARY"; Path filePath = new Path("/internalDir/internalDir2/linkToDir3", "foo"); try (FSDataOutputStream outputStream = fsView.create(filePath)) { outputStream.write(expected.getBytes()); } Path newDirPath = new Path("/internalDir/linkToDir2", "bar"); fsView.mkdirs(newDirPath); ContentSummary summaryAfter = fsView.getContentSummary(new Path("/internalDir")); assertEquals("The file count didn't match", summaryBefore.getFileCount() + 1, summaryAfter.getFileCount()); assertEquals("The size didn't match", summaryBefore.getLength() + expected.length(), summaryAfter.getLength()); assertEquals("The directory count didn't match", summaryBefore.getDirectoryCount() + 1, summaryAfter.getDirectoryCount()); }
Source:
<code>public ArrayOfDoublesSketchAggregatorFactory( @JsonProperty("name") final String name, @JsonProperty("fieldName") final String fieldName, @JsonProperty("nominalEntries") @Nullable final Integer nominalEntries, @JsonProperty("metricColumns") @Nullable final List<String> metricColumns, @JsonProperty("numberOfValues") @Nullable final Integer numberOfValues) { this.name = Preconditions.checkNotNull(name, "Must have a valid, non-null aggregator name"); this.fieldName = Preconditions.checkNotNull(fieldName, "Must have a valid, non-null fieldName"); this.nominalEntries = nominalEntries == null ? Util.DEFAULT_NOMINAL_ENTRIES : nominalEntries; Util.checkIfPowerOf2(this.nominalEntries, "nominalEntries"); this.metricColumns = metricColumns; this.numberOfValues = numberOfValues == null ? (metricColumns == null ? 1 : metricColumns.size()) : numberOfValues; if (metricColumns != null && metricColumns.size() != this.numberOfValues) { throw new IAE( <START> "Number of metricColumns (%d) must agree with numValues (%d)", <END> metricColumns.size(), this.numberOfValues ); } }</code><technical_language>In Druid square braces emphasize something: [%d]</technical_language>

Target:
public ArrayOfDoublesSketchAggregatorFactory( @JsonProperty("name") final String name, @JsonProperty("fieldName") final String fieldName, @JsonProperty("nominalEntries") @Nullable final Integer nominalEntries, @JsonProperty("metricColumns") @Nullable final List<String> metricColumns, @JsonProperty("numberOfValues") @Nullable final Integer numberOfValues ) { this.name = Preconditions.checkNotNull(name, "Must have a valid, non-null aggregator name"); this.fieldName = Preconditions.checkNotNull(fieldName, "Must have a valid, non-null fieldName"); this.nominalEntries = nominalEntries == null ? Util.DEFAULT_NOMINAL_ENTRIES : nominalEntries; Util.checkIfPowerOf2(this.nominalEntries, "nominalEntries"); this.metricColumns = metricColumns; this.numberOfValues = numberOfValues == null ? (metricColumns == null ? 1 : metricColumns.size()) : numberOfValues; if (metricColumns != null && metricColumns.size() != this.numberOfValues) { throw new IAE( "Number of metricColumns [%d] must agree with numValues [%d]", metricColumns.size(), this.numberOfValues ); } }
Source:
<code>public void listNetworkInterfaceCards() { final NetworkInterfaceCardApi nicApi = api.getNetworkInterfaceCardApi(resourcegroup); List<NetworkInterfaceCard> nicList = nicApi.list(); <START> assertTrue(nicList.size() > 0); <END> }</code><technical_language>Assert instead contains created nic</technical_language>

Target:
public void listNetworkInterfaceCards() { final NetworkInterfaceCardApi nicApi = api.getNetworkInterfaceCardApi(resourcegroup); List<NetworkInterfaceCard> nicList = nicApi.list(); assertTrue(nicList.contains(nicApi.get(NETWORKINTERFACECARD_NAME))); }
Source:
<code>private Collection createOrCheckCollection(final XmldbURI sourcePath) throws MessageReceiveException { Collection collection = null; try (DBBroker broker = brokerPool.get(Optional.of(securityManager.getSystemSubject())); Txn txn = txnManager.beginTransaction()) { setOrigin(txn); collection = broker.getOrCreateCollection(txn, sourcePath); if (collection == null) { throw new MessageReceiveException("Collection " + sourcePath.toString() + " does not exist"); } broker.saveCollection(txn, collection); txn.commit(); <START> broker.flush(); <END> } catch (final Throwable t) { if (LOG.isDebugEnabled()) { LOG.error(t.getMessage(), t); } else { LOG.error(t.getMessage()); } throw new MessageReceiveException(t.getMessage(), t); } return collection; }</code><technical_language>this is required slowdown</technical_language>

Target:
private Collection createOrCheckCollection(final XmldbURI sourcePath) throws MessageReceiveException { Collection collection = null; try (DBBroker broker = brokerPool.get(Optional.of(securityManager.getSystemSubject())); Txn txn = txnManager.beginTransaction()) { setOrigin(txn); collection = broker.getOrCreateCollection(txn, sourcePath); if (collection == null) { throw new MessageReceiveException("Collection " + sourcePath.toString() + " does not exist"); } broker.saveCollection(txn, collection); txn.commit(); } catch (final Throwable t) { if (LOG.isDebugEnabled()) { LOG.error(t.getMessage(), t); } else { LOG.error(t.getMessage()); } throw new MessageReceiveException(t.getMessage(), t); } return collection; }
Source:
<code>private void initializeThing(@Nullable ThingStatus bridgeStatus) { logger.debug("initializeThing thing bridge status {}", getThing().getUID(), bridgeStatus); final String configLightId = (String) getConfig().get(LIGHT_ID); if (configLightId != null) { lightId = configLightId; if (getHueClient() != null) { if (bridgeStatus == ThingStatus.ONLINE) { initializeProperties(); <START> if (colorModeChannelRequired()) { <END> addColorModeChannel(); } updateStatus(ThingStatus.ONLINE); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); } } else { updateStatus(ThingStatus.OFFLINE); } } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.conf-error-no-light-id"); } }</code><technical_language>is purpose of this logic? xml file I 0210 this channel, do this check addition logic here</technical_language>

Target:
private void initializeThing(@Nullable ThingStatus bridgeStatus) { logger.debug("initializeThing thing bridge status {}", getThing().getUID(), bridgeStatus); final String configLightId = (String) getConfig().get(LIGHT_ID); if (configLightId != null) { lightId = configLightId; if (getHueClient() != null) { if (bridgeStatus == ThingStatus.ONLINE) { initializeProperties(); updateStatus(ThingStatus.ONLINE); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); } } else { updateStatus(ThingStatus.OFFLINE); } } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.conf-error-no-light-id"); } }
Source:
<code>public boolean shutdownBlobStore(PartitionId id) { <START> CloudBlobStore blobStore = partitionToStore.getOrDefault(id, null); <END> if (blobStore == null) { return false; } blobStore.shutdown(); return true; }</code><technical_language>partitionToStore.get() return null if element is present</technical_language>

Target:
public boolean shutdownBlobStore(PartitionId id) { CloudBlobStore blobStore = partitionToStore.get(id); if (blobStore == null) { return false; } blobStore.shutdown(); return true; }
Source:
<code>protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { stderr.println("The Jenkins instance has not been started, or was already shut down!"); return -1; } final HashSet<String> hs = new HashSet<String>(); hs.addAll(nodes); List<String> names = null; for (String node_s : hs) { Computer item = null; try { item = jenkins.getComputer(node_s); if(item == null) { if(names == null) { names = new ArrayList<String>(); for (Computer c : jenkins.getComputers()) <START> if (c.getName().length() > 0) <END> names.add(c.getName()); } String adv = EditDistance.findNearest(node_s, names); stderr.println(adv == null ? hudson.model.Messages.Computer_NoSuchSlaveExistsWithoutAdvice(node_s) : hudson.model.Messages.Computer_NoSuchSlaveExists(node_s, adv)); errorOccurred = true; continue; } item.cliConnect(force); } catch (AccessDeniedException2 e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during deletion of item '%s': %s", item == null ? "(null)" : item.getName(), e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; continue; } } return errorOccurred ? 1 : 0; }</code><technical_language>prefer isEmpty() (appropriatly negated) a length check</technical_language>

Target:
protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getActiveInstance(); final HashSet<String> hs = new HashSet<String>(); hs.addAll(nodes); List<String> names = null; for (String node_s : hs) { Computer computer = null; try { computer = jenkins.getComputer(node_s); if(computer == null) { if(names == null) { names = new ArrayList<String>(); for (Computer c : jenkins.getComputers()) if (!c.getName().isEmpty()) names.add(c.getName()); } String adv = EditDistance.findNearest(node_s, names); throw new IllegalArgumentException(adv == null ? hudson.model.Messages.Computer_NoSuchSlaveExistsWithoutAdvice(node_s) : hudson.model.Messages.Computer_NoSuchSlaveExists(node_s, adv)); } computer.cliConnect(force); } catch (Exception e) { if (hs.size() == 1) { throw e; } final String errorMsg = String.format(node_s + ": " + e.getMessage()); stderr.println(errorMsg); errorOccurred = true; continue; } } if (errorOccurred) { throw new AbortException("Error occured while performing this command, see previous stderr output."); } return 0; }
Source:
<code>protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { setPoolBeingDestroyed(); setPrestartedToZero(); <START> return null; <END> } }); setSucceeded(stopVms() && removeVmsInPool() && removeVmPool()); }</code><technical_language>need compensation in case removal fails</technical_language>

Target:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(getVmPool()); setPoolBeingDestroyed(); setPrestartedToZero(); getCompensationContext().stateChanged(); return null; } }); setSucceeded(stopVms() && removeVmsInPool() && removeVmPool()); }
Source:
<code>public void handle(Event event, Context context) { try { runner.execute(context.getConnection(), getCommands(event, context)); } catch(Exception sqe) { <START> if (sqe instanceof BadSqlGrammarException && sqe.getMessage().contains("already exists")) { <END> throw new DataFlowSchemaMigrationException( "An exception occured during migration. This may indicate " + "that you have run Spring Batch Jobs or Spring Cloud " + "Tasks prior to running Spring Cloud Data Flow first", sqe); } throw sqe; } }</code><technical_language>if exists is returned database reliable is check sql error code</technical_language>

Target:
public void handle(Event event, Context context) { try { runner.execute(context.getConnection(), getCommands(event, context)); } catch(Exception sqe) { if (sqe instanceof BadSqlGrammarException) { throw new DataFlowSchemaMigrationException( "An exception occured during migration. This may indicate " + "that you have run Spring Batch Jobs or Spring Cloud " + "Tasks prior to running Spring Cloud Data Flow first. " + "Data Flow must create these tables.", sqe); } throw sqe; } }
Source:
<code>public void onDetach() { if (call == null) { <START> return; <END> } call.cancel(); super.onDetach(); }</code><technical_language>need call super's onDetatch(). I expect this error. arent calling first</technical_language>

Target:
public void onDetach() { if (call != null) { call.cancel(); } super.onDetach(); }
Source:
<code>AbstractFastaSequenceFile(final Path path) { this.path = path; this.source = path == null ? "unknown" : path.toAbsolutePath().toString(); <START> this.sequenceDictionary = findAndLoadSequenceDictionary(path); <END> }</code><technical_language>Putting a method call overridable method in a constructor means end calling a method in object constructor called yet. This lead some hard debug errors. avoid this kind of dependency is a field lazily initialized, e.g. in getter</technical_language>

Target:
AbstractFastaSequenceFile(final Path path) { this.path = path; this.source = path == null ? "unknown" : path.toAbsolutePath().toString(); this.dictionary = new Lazy<>(() -> findAndLoadSequenceDictionary(path)); }
Source:
<code>public static void removeOverlay(final ManagementClient managementClient, final String deployment,final String overlayName, final Set<String> overlayPaths) throws Exception { try { for (String overlayPath: overlayPaths) { removeContentItem(managementClient, overlayName, overlayPath); } removeDeploymentItem(managementClient, overlayName, deployment); ModelNode op = new ModelNode(); op.get(ModelDescriptionConstants.OP_ADDR).set(ModelDescriptionConstants.DEPLOYMENT_OVERLAY, overlayName); op.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.REMOVE); ManagementOperations.executeOperation(managementClient.getControllerClient(), op); } catch (Exception e) { <START> e.printStackTrace(); <END> } }</code><technical_language>exception is swallowed</technical_language>

Target:
public static void removeOverlay(final ManagementClient managementClient, final String deployment,final String overlayName, final Set<String> overlayPaths) throws Exception { for (String overlayPath: overlayPaths) { removeContentItem(managementClient, overlayName, overlayPath); } removeDeploymentItem(managementClient, overlayName, deployment); ModelNode op = new ModelNode(); op.get(ModelDescriptionConstants.OP_ADDR).set(ModelDescriptionConstants.DEPLOYMENT_OVERLAY, overlayName); op.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.REMOVE); ManagementOperations.executeOperation(managementClient.getControllerClient(), op); }
Source:
<code>public RakdosFirewheeler(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}{R}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(4); this.toughness = new MageInt(3); Effect effect = new DamageTargetEffect(2); effect.setText("it deals 2 damage to target opponent and 2 damage to up to one target creature or planeswalker"); Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); ability.addTarget(new TargetOpponent()); <START> ability.addTarget(new TargetCreatureOrPlaneswalker()); <END> this.addAbility(ability); }</code><technical_language>This needs "up to" target creature planeswalker, need set minimum 0</technical_language>

Target:
public RakdosFirewheeler(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}{R}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(4); this.toughness = new MageInt(3); Effect effect = new DamageTargetEffect(2); effect.setText("it deals 2 damage to target opponent and 2 damage to up to one target creature or planeswalker"); Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); ability.addTarget(new TargetOpponent()); ability.addTarget(new TargetCreatureOrPlaneswalker(0, 1, new FilterCreatureOrPlaneswalkerPermanent(), false)); this.addAbility(ability); }
Source:
<code>public Map<String, Short> votes() throws RestApiException { String request = getRequestPath() + "/votes"; JsonElement jsonElement = gerritRestClient.getRequest(request); <START> return new Gson().fromJson(jsonElement,new TypeToken<Map<String, Short>>() {}.getType()); <END> }</code><technical_language>Gson rest client used. Also, space , is missing</technical_language>

Target:
public Map<String, Short> votes() throws RestApiException { String request = getRequestPath() + "/votes"; JsonElement jsonElement = gerritRestClient.getRequest(request); return gerritRestClient.getGson().fromJson(jsonElement, new TypeToken<Map<String, Short>>() {}.getType()); }
Source:
<code>public void testForceRefreshWithoutAutoRefresh() throws Exception { <START> genericSetUp(SEMANTIC_MODEL_PATH_FOR_NULL_VALUE, MODELER_DESCRIPTION_PATH_FOR_NULL_VALUE, SESSION_PATH_FOR_NULL_VALUE); <END> changeSiriusPreference(SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false); Iterator<DRepresentation> iterator = getRepresentations("PackageDiag").iterator(); DDiagram firstDiag = (DDiagram) iterator.next(); DiagramEditor diagramEditor = (DiagramEditor) DialectUIManager.INSTANCE.openEditor(session, firstDiag, new NullProgressMonitor()); DDiagram secondDiag = (DDiagram) iterator.next(); diagramEditor = (DiagramEditor) DialectUIManager.INSTANCE.openEditor(session, secondDiag, new NullProgressMonitor()); assertTrue("Diagram should be empty", firstDiag.getOwnedDiagramElements().isEmpty()); assertTrue("Diagram should be empty", secondDiag.getOwnedDiagramElements().isEmpty()); try { applyNodeCreationTool("createPackageWithRefresh", secondDiag, secondDiag); assertEquals("Diagram should not be empty", 1, secondDiag.getOwnedDiagramElements().size()); assertTrue("Diagram should be empty", firstDiag.getOwnedDiagramElements().isEmpty()); } catch (NullPointerException exception) { Assert.fail("No expcetion should have been raised during Node creation. This is a regression."); } }</code><technical_language>overload setUp method put this code</technical_language>

Target:
public void testForceRefreshWithoutAutoRefresh() throws Exception { changeSiriusPreference(SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false); assertTrue("Diagram should be empty", firstDiag.getOwnedDiagramElements().isEmpty()); assertTrue("Diagram should be empty", secondDiag.getOwnedDiagramElements().isEmpty()); applyNodeCreationTool("createPackageWithRefresh", secondDiag, secondDiag); assertEquals("Force refresh diagram has not been refreshed.", 1, secondDiag.getOwnedDiagramElements().size()); assertTrue("The non 'force refresh' diagram has been refreshed whereas 'automatic refresh' is false.", firstDiag.getOwnedDiagramElements().isEmpty()); }
Source:
<code>protected static Object invokeMethod(Class<?> definingClass, String methodName, Class<?>[] parameterTypes, Object invokingObject, Object[] args) <START> throws Exception { <END> Method method = definingClass.getDeclaredMethod(methodName, parameterTypes); method.setAccessible(true); return method.invoke(invokingObject, args); }</code><technical_language>Indentation deeper. easier eye (the break is jarring) java protected static Object invokeMethod(Class<?> definingClass, String methodName, Class<?>[] parameterTypes, Object invokingObject, Object[] args) throws Exception { java protected static Object invokeMethod(Class<?> definingClass, String methodName, Class<?>[] parameterTypes, Object invokingObject, Object[] args) throws Exception {</technical_language>

Target:
protected static Object invokeMethod(Class<?> definingClass, String methodName, Class<?>[] parameterTypes, Object invokingObject, Object[] args) throws ReflectiveOperationException { Method method = definingClass.getDeclaredMethod(methodName, parameterTypes); method.setAccessible(true); return method.invoke(invokingObject, args); }
Source:
<code>public IStatus run(IProgressMonitor monitor) { <START> monitor.beginTask(Messages.ExportToTextJob_Export_trace_to + destination, 100); <END> IStatus ret = saveImpl(monitor); monitor.done(); return ret; }</code><technical_language>a constant for 100</technical_language>

Target:
public IStatus run(IProgressMonitor monitor) { monitor.beginTask(Messages.ExportToTextJob_Export_trace_to + destination, TOTAL_WORK); IStatus ret = saveImpl(monitor); monitor.done(); return ret; }
Source:
<code>private String promptCommitMessage(final Shell shell, final String message) { final String[] msg = { message }; shell.getDisplay().syncExec(new Runnable() { @Override public void run() { CommitMessageEditorDialog dialog = new CommitMessageEditorDialog( shell, msg[0], <START> UIText.RebaseInteractiveHandler_EditMessageDialogOkButton, <END> UIText.SquashHandler_EditMessageDialogCancelButton); if (dialog.open() == Window.OK) msg[0] = dialog.getCommitMessage(); else msg[0] = message; } }); return msg[0]; }</code><technical_language>This is confusing, message key refactoring. create a new UIText entry name reflects real usage, please</technical_language>

Target:
private String promptCommitMessage(final Shell shell, final String message) { final String[] msg = { message }; shell.getDisplay().syncExec(new Runnable() { @Override public void run() { CommitMessageEditorDialog dialog = new CommitMessageEditorDialog( shell, msg[0], UIText.CommitMessageEditorDialog_OkButton, UIText.SquashHandler_EditMessageDialogCancelButton); if (dialog.open() == Window.OK) msg[0] = dialog.getCommitMessage(); else msg[0] = message; } }); return msg[0]; }
Source:
<code>public String getShortName() { <START> return "mailinglists" ; <END> }</code><technical_language>"mailingLists"</technical_language>

Target:
public String getShortName() { return "mailingLists" ; }
Source:
<code>public MVQueryRewriter(ParsedSelectStmt stmt) { m_stmt = stmt; if (m_stmt.m_tableList.size() == 1 && <START> !m_stmt.hasOrderByColumns() && m_stmt.isGrouped() && m_stmt.getHavingPredicate() == null) { END> final Optional<Pair<MaterializedViewInfo, Map<Pair<String, Integer>, Pair<String, Integer>>>> any = getMviAndViews(m_stmt.m_tableList).entrySet().stream() .flatMap(kv -> { final MaterializedViewInfo mv = kv.getKey(); final Map<Pair<String, Integer>, Pair<String, Integer>> rel = gbyMatches(mv); return rel != null ? Stream.of(new Pair<>(mv, rel)) : null; }).findFirst(); if (any.isPresent()) { final Pair<MaterializedViewInfo, Map<Pair<String, Integer>, Pair<String, Integer>>> entry = any.get(); m_rel = entry.getSecond(); m_mvi = entry.getFirst(); } } }</code><technical_language>I guess this is another follow optimization allow. If is ORDER clause materialization rewrite original statement</technical_language>

Target:
public MVQueryRewriter(ParsedSelectStmt stmt) { m_unionStmt = null; m_selectStmt = stmt; if (m_selectStmt.m_tableList.size() == 1 && !m_selectStmt.hasOrderByColumns() && m_selectStmt.getHavingPredicate() == null) { final Optional<Pair<MaterializedViewInfo, Map<Pair<String, Integer>, Pair<String, Integer>>>> any = getMviAndViews(m_selectStmt.m_tableList).entrySet().stream() .flatMap(kv -> { final MaterializedViewInfo mv = kv.getKey(); final Map<Pair<String, Integer>, Pair<String, Integer>> rel = gbyMatches(mv); return rel != null ? Stream.of(Pair.of(mv, rel)) : null; }).findFirst(); if (any.isPresent()) { final Pair<MaterializedViewInfo, Map<Pair<String, Integer>, Pair<String, Integer>>> entry = any.get(); m_QueryColumnNameAndIndx_to_MVColumnNameAndIndx = entry.getSecond(); m_mvi = entry.getFirst(); } } }
Source:
<code>public Setting getSetting(VDomainModelReference domainModelReference, EObject object) throws DatabindingFailedException { if (domainModelReference == null) { throw new IllegalArgumentException("The given VDomainModelReference must not be null."); } if (!VIndexDomainModelReference.class.isInstance(domainModelReference)) { throw new IllegalArgumentException( "DomainModelReference must be an instance of VIndexDomainModelReference."); } final VIndexDomainModelReference indexDMR = VIndexDomainModelReference.class .cast(domainModelReference); EList<EObject> eList; if (indexDMR.getPrefixDMR() == null) { if (indexDMR.getDomainModelEFeature() == null) { throw new DatabindingFailedException( "The field domainModelEFeature of the given VIndexDomainModelReference must not be null."); } checkListType(indexDMR.getDomainModelEFeature()); EObject currentObject = object; <START> for (final EReference eReference : indexDMR.getDomainModelEReferencePath()) { currentObject = (EObject) currentObject.eGet(eReference); } eList = (EList<EObject>) currentObject.eGet(indexDMR.getDomainModelEFeature()); <END> } else { final Setting setting = emfFormsDatabinding.getSetting(indexDMR.getPrefixDMR(), object); eList = (EList<EObject>) setting.get(true); } final EObject eObject = eList.get(indexDMR.getIndex()); return emfFormsDatabinding.getSetting(indexDMR.getTargetDMR(), eObject); }</code><technical_language>null checks</technical_language>

Target:
public Setting getSetting(VDomainModelReference domainModelReference, EObject object) throws DatabindingFailedException { if (domainModelReference == null) { throw new IllegalArgumentException("The given VDomainModelReference must not be null."); } if (!VIndexDomainModelReference.class.isInstance(domainModelReference)) { throw new IllegalArgumentException( "DomainModelReference must be an instance of VIndexDomainModelReference."); } final VIndexDomainModelReference indexDMR = VIndexDomainModelReference.class .cast(domainModelReference); EList<EObject> eList; if (indexDMR.getPrefixDMR() == null) { if (indexDMR.getDomainModelEFeature() == null) { throw new DatabindingFailedException( "The field domainModelEFeature of the given VIndexDomainModelReference must not be null."); } checkListType(indexDMR.getDomainModelEFeature()); EObject currentObject = object; for (final EReference eReference : indexDMR.getDomainModelEReferencePath()) { currentObject = (EObject) currentObject.eGet(eReference); if (currentObject == null) { throw new DatabindingFailedException("The path is not fully resolved."); } } eList = (EList<EObject>) currentObject.eGet(indexDMR.getDomainModelEFeature()); } else { final Setting setting = emfFormsDatabinding.getSetting(indexDMR.getPrefixDMR(), object); eList = (EList<EObject>) setting.get(true); } final EObject eObject = eList.get(indexDMR.getIndex()); return emfFormsDatabinding.getSetting(indexDMR.getTargetDMR(), eObject); }
Source:
<code>public void testRepeatableReadWithNullRemoval() throws Exception { LockTestData tl = lockTestData; Cache<String, String> cache = tl.cache; TransactionManager tm = tl.tm; tm.begin(); cache.get("a"); Transaction tx = tm.suspend(); cache.put("a", "v2"); assertEquals(cache.get("a"), "v2"); tm.resume(tx); assertNull("expected null but received " + cache.get("a"), cache.get("a")); cache.remove("a"); try { tm.commit(); } catch (RollbackException e) { <START> LogFactory.getLog(RepeatableReadLockTest.class).trace("Expected exception", e); <END> } assertEquals(cache.get("a"), "v2"); }</code><technical_language>Exceptions.expectException(RollbackException.class, () -> tm.commit()) cleaner</technical_language>

Target:
public void testRepeatableReadWithNullRemoval() throws Exception { LockTestData tl = lockTestData; Cache<String, String> cache = tl.cache; TransactionManager tm = tl.tm; tm.begin(); cache.get("a"); Transaction tx = tm.suspend(); cache.put("a", "v2"); assertEquals(cache.get("a"), "v2"); tm.resume(tx); assertEquals(null, cache.get("a")); cache.remove("a"); Exceptions.expectException(RollbackException.class, tm::commit); assertEquals(cache.get("a"), "v2"); }
Source:
<code>private void getShuyookhData() { if (disposable != null) { disposable.dispose(); <START> mOnDownloadInfo = <END> new DisposableSingleObserver<List<QariDownloadInfo>>() { @Override public void onSuccess(List<QariDownloadInfo> downloadInfo) { progressBar.setVisibility(View.GONE); surahAdapter.setDownloadInfo(downloadInfo); surahAdapter.notifyDataSetChanged(); } @Override public void onError(Throwable e) { } }; } disposable = AudioManagerUtils.shuyookhDownloadObservable(quranInfo, basePath, qariItems) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(mOnDownloadInfo); }</code><technical_language>rename this variable m start</technical_language>

Target:
private void getShuyookhData() { if (disposable != null) { disposable.dispose(); } downloadInfoObserver = new DisposableSingleObserver<List<QariDownloadInfo>>() { @Override public void onSuccess(List<QariDownloadInfo> downloadInfo) { progressBar.setVisibility(View.GONE); surahAdapter.setDownloadInfo(downloadInfo); surahAdapter.notifyDataSetChanged(); } @Override public void onError(Throwable e) { } }; disposable = AudioManagerUtils.shuyookhDownloadObservable(quranInfo, basePath, qariItems) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(downloadInfoObserver); }
Source:
<code>protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); Guid volumeId = getParameters().getVolumeId(); if (volumeId != null) { volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(String.format("Invalid volume id %s", volumeId)); } asyncTask = volume.getAsyncTask(); if(asyncTask == null) { throw new RuntimeException(String.format("No async task available for volume id %s", volumeId)); <START> } <END> getQueryReturnValue().setReturnValue(fetchTaskStatusDetails()); } }</code><technical_language>need fail query if volume task</technical_language>

Target:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); Guid volumeId = getParameters().getVolumeId(); if (volumeId != null) { volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(String.format("Invalid volume id %s", volumeId)); } asyncTask = volume.getAsyncTask(); if(asyncTask == null) { getQueryReturnValue().setReturnValue(null); return; } getQueryReturnValue().setReturnValue(fetchTaskStatusDetails()); } }
Source:
<code>private void <START> createShowSourceNotFoundAllTime(Composite parent) <END> { fshowSourceNotFoundAllTime = createRadioButton(fbuttonGroupForSourceNotFound, PreferenceMessages.getString("CDebugPreferencePage.22")); fshowSourceNotFoundOnlyCaseSourceNotFound = createRadioButton(fbuttonGroupForSourceNotFound, PreferenceMessages.getString("CDebugPreferencePage.23")); if (!Platform.getPreferencesService().getBoolean(CCorePlugin.PLUGIN_ID, CCorePreferenceConstants.SHOW_SOURCE_NOT_FOUND_EDITOR, true, null)) { fshowSourceNotFoundAllTime.setEnabled(false); fshowSourceNotFoundOnlyCaseSourceNotFound.setEnabled(false); } }</code><technical_language>this parent is used. Structure methods layouts. means creating a group passing group parent composite other functions. Recall Group extends Composite, methods receive parent of type Composite still</technical_language>

Target:
private void createShowSourceNotFoundAllTime(Composite parent) { fShowSourceNotFoundAllTime = createRadioButton(parent, PreferenceMessages.getString("CDebugPreferencePage.22")); fShowSourceNotFoundOnlyCaseSourceNotFound = createRadioButton(parent, PreferenceMessages.getString("CDebugPreferencePage.23")); if (!Platform.getPreferencesService().getBoolean(CCorePlugin.PLUGIN_ID, CCorePreferenceConstants.SHOW_SOURCE_NOT_FOUND_EDITOR, true, null)) { fShowSourceNotFoundAllTime.setEnabled(false); fShowSourceNotFoundOnlyCaseSourceNotFound.setEnabled(false); } }
Source:
<code>private void createOreoShortcut(Context context, Intent intent) { DataHandler dh = KissApplication.getApplication(context).getDataHandler(); ShortcutsProvider sp = dh.getShortcutsProvider(); if (sp == null) { <START> Log.e(TAG, "Shortcuts disabled."); <END> return; } final LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); assert launcherApps != null; final LauncherApps.PinItemRequest pinItemRequest = intent.getParcelableExtra(LauncherApps.EXTRA_PIN_ITEM_REQUEST); final ShortcutInfo shortcutInfo = pinItemRequest.getShortcutInfo(); assert shortcutInfo != null; Log.d(TAG, "Shortcut: " + shortcutInfo.getPackage() + " " + shortcutInfo.getId()); ShortcutsPojo pojo = new ShortcutsPojo(); pojo.id = ShortcutsPojo.SCHEME + ShortcutsPojo.OREO_PREFIX + shortcutInfo.getId(); pojo.packageName = shortcutInfo.getPackage(); if (shortcutInfo.getShortLabel() != null) { pojo.setName(shortcutInfo.getShortLabel().toString()); } else if (shortcutInfo.getLongLabel() != null) { pojo.setName(shortcutInfo.getLongLabel().toString()); } else { Log.d(TAG, "Invalid shortcut " + pojo.id + ", ignoring"); return; } final Drawable iconDrawable = launcherApps.getShortcutIconDrawable(shortcutInfo, 0); pojo.icon = drawableToBitmap(iconDrawable); pojo.setOreoId(shortcutInfo.getId()); dh.addShortcut(pojo); pinItemRequest.accept(); }</code><technical_language>show a toast instead? this happen user add a shortcut? If do actual "action" of adding shortcut worth add it. Also, variable sp is check that</technical_language>

Target:
private void createOreoShortcut(Context context, Intent intent) { DataHandler dh = KissApplication.getApplication(context).getDataHandler(); ShortcutsProvider sp = dh.getShortcutsProvider(); if (sp == null) { Log.e(TAG, "Shortcuts disabled."); Toast.makeText(mainActivity, R.string.unable_add_shortcut, Toast.LENGTH_LONG).show(); return; } final LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); assert launcherApps != null; final LauncherApps.PinItemRequest pinItemRequest = intent.getParcelableExtra(LauncherApps.EXTRA_PIN_ITEM_REQUEST); final ShortcutInfo shortcutInfo = pinItemRequest.getShortcutInfo(); assert shortcutInfo != null; Log.d(TAG, "Shortcut: " + shortcutInfo.getPackage() + " " + shortcutInfo.getId()); ShortcutsPojo pojo = new ShortcutsPojo(); pojo.id = ShortcutsPojo.SCHEME + ShortcutsPojo.OREO_PREFIX + shortcutInfo.getId(); pojo.packageName = shortcutInfo.getPackage(); if (shortcutInfo.getShortLabel() != null) { pojo.setName(shortcutInfo.getShortLabel().toString()); } else if (shortcutInfo.getLongLabel() != null) { pojo.setName(shortcutInfo.getLongLabel().toString()); } else { Log.d(TAG, "Invalid shortcut " + pojo.id + ", ignoring"); return; } final Drawable iconDrawable = launcherApps.getShortcutIconDrawable(shortcutInfo, 0); pojo.icon = drawableToBitmap(iconDrawable); pojo.setOreoId(shortcutInfo.getId()); dh.addShortcut(pojo); pinItemRequest.accept(); }
Source:
<code><START> public static void showRateDialog(final FragmentActivity activity) { <END> final RateDialogSupportFragment fragment = RateDialogSupportFragment .newInstance(sIsShoWNeutralButton); fragment.show(activity.getSupportFragmentManager(), TAG); }</code><technical_language>I want method accessor package private :eyes:</technical_language>

Target:
private static void showRateDialog(final FragmentActivity activity) { final RateDialogSupportFragment fragment = RateDialogSupportFragment .newInstance(sIsShoWNeutralButton); fragment.show(activity.getSupportFragmentManager(), TAG); }
Source:
<code>public static PrimitiveLongIterator exactIndexMatches( PropertyAccessor accessor, PrimitiveLongIterator indexedNodeIds, IndexQuery... predicates ) { if ( !indexedNodeIds.hasNext() ) { return indexedNodeIds; } IndexQuery[] numericPredicates = Arrays.stream( predicates ) .filter( LookupFilter::isNumericPredicate ) .toArray( IndexQuery[]::new ); if ( numericPredicates.length > 0 ) { <START> LongPredicate combinedPredicate = nodeId -> <END> { try { for ( IndexQuery predicate : numericPredicates ) { int propertyKeyId = predicate.propertyKeyId(); Object value = accessor.getProperty( nodeId, propertyKeyId ); if ( !predicate.test( value ) ) { return false; } } return true; } catch ( EntityNotFoundException ignored ) { return false; } }; return PrimitiveLongCollections.filter( indexedNodeIds, combinedPredicate ); } return indexedNodeIds; }</code><technical_language>in other place in this class</technical_language>

Target:
public static PrimitiveLongIterator exactIndexMatches( PropertyAccessor accessor, PrimitiveLongIterator indexedNodeIds, IndexQuery... predicates ) { if ( !indexedNodeIds.hasNext() ) { return indexedNodeIds; } IndexQuery[] numericPredicates = Arrays.stream( predicates ) .filter( LookupFilter::isNumericPredicate ) .toArray( IndexQuery[]::new ); if ( numericPredicates.length > 0 ) { LongPredicate combinedPredicate = nodeId -> { try { for ( IndexQuery predicate : numericPredicates ) { int propertyKeyId = predicate.propertyKeyId(); Object value = accessor.getProperty( nodeId, propertyKeyId ).value( null ); if ( !predicate.test( value ) ) { return false; } } return true; } catch ( EntityNotFoundException ignored ) { return false; } }; return PrimitiveLongCollections.filter( indexedNodeIds, combinedPredicate ); } return indexedNodeIds; }