auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Optional<String> getPath(String documentationOptions) { try { Properties docProps = new Properties(); docProps.load(new StringReader(documentationOptions)); String path = docProps.getProperty(PATH_PREFIX); if (path != null) { return Optional.of(path); } } catch (IOException e) { } return Optional.empty(); }

Target:
private Optional<String> getPath(String documentationOptions) { try { Properties docProps = new Properties(); StringReader docReader = new StringReader(documentationOptions); try { docProps.load(docReader); } finally { docReader.close(); } String path = docProps.getProperty(PATH_PREFIX); if (path != null) { return Optional.of(path); } } catch (IOException e) { } return Optional.empty(); }
Source:
public void shouldGetCohortQueryReportWithGivenParameters() throws Exception { CohortQueryReport cohortQueryReport = buildCohortQueryReport(); URI url = config.toInstancePathWithParams("/reportingrest/cohort/{uuid}", cohortQueryReport.getUuid()); Map<String, String> parameters = new HashMap<>(); parameters.put("param1", "value"); parameters.put("param2", "value"); url = addParametersToPath(url, parameters); doReturn(getResponseFromFile(GET_COHORT_QUERY_REPORT_RESPONSE_JSON)) .when(restOperations).exchange(eq(url), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class)); CohortQueryReport created = cohortResource.getCohortQueryReport(config, cohortQueryReport.getUuid(), parameters); verify(restOperations).exchange(eq(url), eq(HttpMethod.GET), requestCaptor.capture(), eq(String.class)); assertThat(created, equalTo(cohortQueryReport)); assertThat(requestCaptor.getValue().getHeaders(), equalTo(getHeadersForGet(config))); assertThat(JsonUtils.readJson(requestCaptor.getValue().getBody(), JsonObject.class), nullValue()); }

Target:
public void shouldGetCohortQueryReportWithGivenParameters() throws Exception { getCohortQueryReport(true); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof ACE) { ACE ace = (ACE) obj; boolean beginEqual = ace.begin == null && begin == null || !(ace.begin == null || begin == null) && ace.begin.getTimeInMillis() == begin.getTimeInMillis(); boolean endEqual = ace.end == null && end == null || !(ace.end == null || end == null) && ace.end.getTimeInMillis() == end.getTimeInMillis(); boolean creatorEqual = StringUtils.equals(ace.creator, creator); boolean usernameEqual = StringUtils.equals(ace.username, username); boolean permissionEqual = StringUtils.equals(ace.permission, permission); return ace.isGranted == isGranted && usernameEqual && permissionEqual && creatorEqual && beginEqual && endEqual; } return super.equals(obj); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof ACE) { ACE ace = (ACE) obj; boolean beginEqual = ace.begin == null && begin == null || !(ace.begin == null || begin == null) && ace.begin.getTimeInMillis() == begin.getTimeInMillis(); boolean endEqual = ace.end == null && end == null || !(ace.end == null || end == null) && ace.end.getTimeInMillis() == end.getTimeInMillis(); boolean creatorEqual = Objects.equals(ace.creator, creator); boolean usernameEqual = Objects.equals(ace.username, username); boolean permissionEqual = Objects.equals(ace.permission, permission); return ace.isGranted == isGranted && usernameEqual && permissionEqual && creatorEqual && beginEqual && endEqual; } return super.equals(obj); }
Source:
public void getProperties() { try { String response = solrCatalogSchemaClientFactory.getClient().getFieldTypes("json"); Map<String, Object> map = gson.fromJson(response, new TypeToken<Map<String, Object>>() {}.getType()); if (map != null) { fieldTypes = (ArrayList<Object>) map.get("fieldTypes"); } } catch (Exception e) { LOGGER.debug("Unable to getProperties from: {}", getSolrCatalogSchemaUrl(), e); } }

Target:
public void getProperties() { try { String response = solrCatalogSchemaClientFactory.getClient().getFieldTypes("json"); Map<String, Object> map = gson.fromJson(response, new TypeToken<Map<String, Object>>() {}.getType()); if (map != null) { fieldTypes = (ArrayList<Object>) map.get("fieldTypes"); } } catch (Exception e) { LOGGER.debug("Unable to getProperties from: {}", getSolrCatalogSchemaUrl()); } }
Source:
public void registerKfsPvenDisapprovalForExistingPaymentWorksVendor(String kfsVendorDocumentNumber, VendorDetail vendorDetail) { PaymentWorksVendor pmwVendor = getPaymentWorksVendorByDocumentNumber(kfsVendorDocumentNumber); if (ObjectUtils.isNotNull(pmwVendor)) { LOG.info("registerKfsPvenDisapprovalForExistingPaymentWorksVendor: Disapproving PaymentWorks originating Vendor with table ID '" + pmwVendor.getId() + "' and kfsVendorDocumentNumber '" + kfsVendorDocumentNumber + "' and pmwVendorRequestId '" + pmwVendor.getPmwVendorRequestId() + "'"); getPaymentWorksVendorDao().updateExistingPaymentWorksVendorInStagingTable(pmwVendor.getId(), PaymentWorksConstants.KFSVendorProcessingStatus.VENDOR_DISAPPROVED, vendorDetail.getVendorHeaderGeneratedIdentifier(), vendorDetail.getVendorDetailAssignedIdentifier(), PaymentWorksConstants.SupplierUploadStatus.INELIGIBLE_FOR_UPLOAD, getDateTimeService().getCurrentTimestamp()); } else { LOG.error("registerKfsPvenDisapprovalForExistingPaymentWorksVendor: Vendor retrieval by KFS document number '" + kfsVendorDocumentNumber + "' did not find vendor with pmwVendorRequestId '" + pmwVendor.getPmwVendorRequestId() + "'."); } }

Target:
public void registerKfsPvenDisapprovalForExistingPaymentWorksVendor(String kfsVendorDocumentNumber, VendorDetail vendorDetail) { PaymentWorksVendor pmwVendor = getPaymentWorksVendorByDocumentNumber(kfsVendorDocumentNumber); if (ObjectUtils.isNotNull(pmwVendor)) { LOG.info("registerKfsPvenDisapprovalForExistingPaymentWorksVendor: Disapproving PaymentWorks originating Vendor with table ID '" + pmwVendor.getId() + "' and kfsVendorDocumentNumber '" + kfsVendorDocumentNumber + "' and pmwVendorRequestId '" + pmwVendor.getPmwVendorRequestId() + "'"); getPaymentWorksVendorDao().updateExistingPaymentWorksVendorInStagingTable(pmwVendor.getId(), PaymentWorksConstants.KFSVendorProcessingStatus.VENDOR_DISAPPROVED, vendorDetail.getVendorHeaderGeneratedIdentifier(), vendorDetail.getVendorDetailAssignedIdentifier(), getDateTimeService().getCurrentTimestamp()); } else { LOG.error("registerKfsPvenDisapprovalForExistingPaymentWorksVendor: Vendor retrieval by KFS document number '" + kfsVendorDocumentNumber + "' did not find vendor with pmwVendorRequestId '" + pmwVendor.getPmwVendorRequestId() + "'."); } }
Source:
public void lunAlreadyPartOfStorageDomains() { LUNs lun1 = new LUNs(); lun1.setLUN_id(GUIDS[0].toString()); lun1.setStorageDomainId(Guid.newGuid()); LUNs lun2 = new LUNs(); lun2.setLUN_id(GUIDS[1].toString()); lun2.setStorageDomainId(Guid.newGuid()); doReturn(lunDAO).when(cmd).getLunDao(); when(lunDAO.getAll()).thenReturn(Arrays.asList(lun1, lun2)); List<String> specifiedLunIds = Collections.singletonList(GUIDS[0].toString()); assertTrue(cmd.isLunsAlreadyInUse(specifiedLunIds)); List<String> messages = cmd.getReturnValue().getCanDoActionMessages(); assertEquals(2, messages.size()); assertEquals(messages.get(0), VdcBllMessages.ACTION_TYPE_FAILED_LUNS_ALREADY_PART_OF_STORAGE_DOMAINS.toString()); assertEquals(messages.get(1), String.format("$lunIds %1$s", cmd.getFormattedLunId(lun1, lun1.getStorageDomainName()))); }

Target:
public void lunAlreadyPartOfStorageDomains() { LUNs lun1 = new LUNs(); lun1.setLUN_id(GUIDS[0].toString()); lun1.setStorageDomainId(Guid.newGuid()); LUNs lun2 = new LUNs(); lun2.setLUN_id(GUIDS[1].toString()); lun2.setStorageDomainId(Guid.newGuid()); doReturn(lunDAO).when(cmd).getLunDao(); when(lunDAO.getAll()).thenReturn(Arrays.asList(lun1, lun2)); List<String> specifiedLunIds = Collections.singletonList(GUIDS[0].toString()); assertTrue(cmd.isLunsAlreadyInUse(specifiedLunIds)); List<String> messages = cmd.getReturnValue().getCanDoActionMessages(); assertEquals(2, messages.size()); assertEquals(VdcBllMessages.ACTION_TYPE_FAILED_LUNS_ALREADY_PART_OF_STORAGE_DOMAINS.toString(), messages.get(0)); assertEquals(String.format("$lunIds %1$s", cmd.getFormattedLunId(lun1, lun1.getStorageDomainName())), messages.get(1)); }
Source:
private void ensureConceptIsSet(Order order) { boolean isDrugOrder = DrugOrder.class.isAssignableFrom(getActualType(order)); Concept concept = order.getConcept(); if (concept == null && isDrugOrder) { DrugOrder drugOrder = (DrugOrder) order; if (drugOrder.getDrug() != null) { concept = drugOrder.getDrug().getConcept(); drugOrder.setConcept(concept); } } if (isDrugOrder) { ((DrugOrder) order).setAutoExpireDateBasedOnDuration(); } if (concept == null) { throw new MissingRequiredPropertyException("Order.concept.required"); } }

Target:
private void ensureConceptIsSet(Order order) { Concept concept = order.getConcept(); if (concept == null && isDrugOrder(order)) { DrugOrder drugOrder = (DrugOrder) order; if (drugOrder.getDrug() != null) { concept = drugOrder.getDrug().getConcept(); drugOrder.setConcept(concept); } } if (concept == null) { throw new MissingRequiredPropertyException("Order.concept.required"); } }
Source:
public static boolean hasMergeRegions(Cell[] cells) { for (Cell cell : cells) { if (!isMergeQualifierPrefix(cell)) { continue; } return true; } return false; }

Target:
public static boolean hasMergeRegions(Cell[] cells) { for (Cell cell : cells) { if (isMergeQualifierPrefix(cell)) { return true; } } return false; }
Source:
public void testDifferentMessageRetentionDays() throws StoreException, InterruptedException { List<String> bestCandidates = null; int[] messageRetentionDayValues = new int[]{1, 2, 3, 6, 9}; for (int messageRetentionDays : messageRetentionDayValues) { time = new MockTime(); Pair<MockBlobStore, StoreConfig> initState = initializeBlobStore(properties, time, -1, messageRetentionDays, DEFAULT_MAX_BLOB_SIZE); if (type.equals(CompactionPolicyType.DEFAULT)) { bestCandidates = setUpStateForDefaultCompactionPolicy(blobStore, mockBlobStoreStats); compactionPolicy = new DefaultCompactionPolicy(initState.getSecond(), time); } else if (type.equals(CompactionPolicyType.COMPACT_ALL)) { blobStore.logSegmentsNotInJournal = generateRandomStrings(3); bestCandidates = blobStore.logSegmentsNotInJournal; compactionPolicy = new CompactAllPolicy(initState.getSecond(), time); } verifyCompactionDetails( new CompactionDetails(time.milliseconds() - (messageRetentionDays * Time.SecsPerDay * Time.MsPerSec), bestCandidates), blobStore, compactionPolicy); } }

Target:
public void testDifferentMessageRetentionDays() throws StoreException, InterruptedException { List<String> bestCandidates = null; int[] messageRetentionDayValues = new int[]{1, 2, 3, 6, 9}; for (int messageRetentionDays : messageRetentionDayValues) { time = new MockTime(); Pair<MockBlobStore, StoreConfig> initState = initializeBlobStore(properties, time, -1, messageRetentionDays, DEFAULT_MAX_BLOB_SIZE); if (compactionPolicy instanceof DefaultCompactionPolicy) { bestCandidates = setUpStateForDefaultCompactionPolicy(blobStore, mockBlobStoreStats); compactionPolicy = new DefaultCompactionPolicy(initState.getSecond(), time); } else if (compactionPolicy instanceof CompactAllPolicy) { blobStore.logSegmentsNotInJournal = generateRandomStrings(3); bestCandidates = blobStore.logSegmentsNotInJournal; compactionPolicy = new CompactAllPolicy(initState.getSecond(), time); } verifyCompactionDetails( new CompactionDetails(time.milliseconds() - (messageRetentionDays * Time.SecsPerDay * Time.MsPerSec), bestCandidates), blobStore, compactionPolicy); } }
Source:
public void testMatrixJob() { jenkins.save(); MatrixProject job = jenkins.jobs.create(MatrixProject.class); job.configure(); LabelExpressionAxis a = job.addAxis(LabelExpressionAxis.class); a.values.set("label1"); job.addUserAxis("X", "1 2 3 4 5"); job.save(); MatrixBuild b = job.startBuild().as(MatrixBuild.class); jenkins.runScript("def items = Jenkins.getInstance().getQueue().getBuildableItems();\n" + "for (hudson.model.Queue$BuildableItem i: items) {\n" + " Label l = i.getAssignedLabel();\n" + " if (l != null) {\n" + " println('suggesting review of label ' + l.getName());\n" + " l.nodeProvisioner.suggestReviewNow();\n" + " }\n" + "}"); b.waitUntilFinished(EXTENDED_PROVISION_TIMEOUT); for (MatrixRun config: b.getConfigurations()) { config.shouldSucceed(); } }

Target:
public void testMatrixJob() { jenkins.save(); MatrixProject job = jenkins.jobs.create(MatrixProject.class); job.configure(); LabelExpressionAxis a = job.addAxis(LabelExpressionAxis.class); a.values.set("label1"); job.addUserAxis("X", "1 2 3 4 5"); job.save(); MatrixBuild b = job.startBuild().as(MatrixBuild.class); b.waitUntilFinished(EXTENDED_PROVISION_TIMEOUT); for (MatrixRun config: b.getConfigurations()) { config.shouldSucceed(); } }
Source:
public Assertion validate(String jsonWebToken, String service) throws TicketValidationException { JwtClaims claims = JWTUtils.parseJWT(jsonWebToken, jsonWebTokenSigned, jsonWebTokenSignatureKey, jsonWebTokenEncrypted, jsonWebTokenEncryptionKey, iamServerUrlPrefix, service); try { AttributePrincipal principal = new AttributePrincipalImpl(claims.getSubject()); Assertion assertion = new AssertionImpl(new AttributePrincipalImpl(principal.getName(), claims.getClaimsMap())); logger.debug("Assertion generated for principal " + principal.getName()); return assertion; } catch (MalformedClaimException e) { throw new IAMException("Malformed Json Web Token acquired from IAM [" + jsonWebToken + "]"); } }

Target:
public Assertion validate(String jsonWebToken, String service) throws TicketValidationException { JwtClaims claims = JWTUtils.parseJWT(jsonWebToken, jsonWebTokenSigned, jsonWebTokenSignatureKey, jsonWebTokenEncrypted, jsonWebTokenEncryptionKey, iamServerUrlPrefix, service); try { AttributePrincipal principal = new AttributePrincipalImpl(claims.getSubject()); Assertion assertion = new AssertionImpl(new AttributePrincipalImpl(principal.getName(), claims.getClaimsMap())); logger.debug("Assertion generated for principal " + principal.getName()); return assertion; } catch (MalformedClaimException e) { throw new IAMException("Malformed Json Web Token acquired from IAM [" + jsonWebToken + "]", e); } }
Source:
public void useRetry() { if (!canRetry()) { throw new IllegalStateException("No retries left"); } retriesDone++; firstRetry = false; }

Target:
public void useRetry() { if (!canRetry()) { throw new IllegalStateException("No retries left"); } retriesDone++; }
Source:
public void before() { spanCache = new InfinispanSpanCache(cacheManager.getCache("spans"), cacheManager.getCache("children")); }

Target:
public void before() { spanCache = new InfinispanSpanCache(cacheManager); }
Source:
private DeepLinkEntry findEntry(String uriString) { DeepLinkEntry entryRegExpMatch = null; List<DeepLinkEntry> entryIdxMatches = new ArrayList<>(); DeepLinkUri uri = DeepLinkUri.parse(uriString); for (BaseRegistry registry : registries) { DeepLinkEntry entryIdxMatch = registry.idxMatch(uri, configurablePathSegmentReplacements); if (entryIdxMatch != null) { entryIdxMatches.add(entryIdxMatch); } } if (entryIdxMatches.isEmpty()) { return null; } else if (entryIdxMatches.size() == 1) { return entryIdxMatches.get(0); } Collections.sort(entryIdxMatches, new Comparator<DeepLinkEntry>() { @Override public int compare(DeepLinkEntry a, DeepLinkEntry b) { return a.moreConcreteThan(b); } }); if (entryIdxMatches.get(0).moreConcreteThan(entryIdxMatches.get(1)) == 0) { Log.w(TAG, "More than one match with the same concreteness!! (" + entryIdxMatches.get(0).toString() + ") vs. (" + entryIdxMatches.get(1).toString() + ")"); } return entryIdxMatches.get(0); }

Target:
private DeepLinkEntry findEntry(String uriString) { DeepLinkEntry entryRegExpMatch = null; List<DeepLinkEntry> entryIdxMatches = new ArrayList<>(); DeepLinkUri uri = DeepLinkUri.parse(uriString); for (BaseRegistry registry : registries) { DeepLinkEntry entryIdxMatch = registry.idxMatch(uri, configurablePathSegmentReplacements); if (entryIdxMatch != null) { entryIdxMatches.add(entryIdxMatch); } } if (entryIdxMatches.isEmpty()) { return null; } else if (entryIdxMatches.size() == 1) { return entryIdxMatches.get(0); } Collections.sort(entryIdxMatches); if (entryIdxMatches.get(0).compareTo(entryIdxMatches.get(1)) == 0) { if (errorHandler != null) { errorHandler.duplicateMatch(uriString, entryIdxMatches.subList(0, 2)); } Log.w(TAG, "More than one match with the same concreteness!! (" + entryIdxMatches.get(0).toString() + ") vs. (" + entryIdxMatches.get(1).toString() + ")"); } return entryIdxMatches.get(0); }
Source:
public void testExecuteQueryCommand() { Guid roleId = Guid.NewGuid(); when(getQueryParameters().getRoleId()).thenReturn(roleId); ActionGroup group = RandomUtils.instance().pickRandom(ActionGroup.values()); List<ActionGroup> expected = Collections.singletonList(group); ActionGroupDAO actionGroupDAOMock = mock(ActionGroupDAO.class); when(actionGroupDAOMock.getAllForRole(roleId)).thenReturn(expected); when(getDbFacadeMockInstance().getActionGroupDAO()).thenReturn(actionGroupDAOMock); getQuery().executeQueryCommand(); assertEquals("Wrong query result", expected, getQuery().getQueryReturnValue().getReturnValue()); }

Target:
public void testExecuteQueryCommand() { Guid roleId = Guid.NewGuid(); when(getQueryParameters().getRoleId()).thenReturn(roleId); ActionGroup group = RandomUtils.instance().nextEnum(ActionGroup.class); List<ActionGroup> expected = Collections.singletonList(group); ActionGroupDAO actionGroupDAOMock = mock(ActionGroupDAO.class); when(actionGroupDAOMock.getAllForRole(roleId)).thenReturn(expected); when(getDbFacadeMockInstance().getActionGroupDAO()).thenReturn(actionGroupDAOMock); getQuery().executeQueryCommand(); assertEquals("Wrong query result", expected, getQuery().getQueryReturnValue().getReturnValue()); }
Source:
private void schedulePeriodicReload() { assert adminExecutor.inEventLoop(); if (periodicTaskHandle != null) { periodicTaskHandle.cancel(false); } if (reloadInterval.isZero()) { LOG.debug("[{}] Reload interval is 0, disabling periodic reloading", logPrefix); } else { LOG.debug("[{}] Scheduling periodic reloading with interval {}", logPrefix, reloadInterval); periodicTaskHandle = adminExecutor.scheduleAtFixedRate( () -> reload(null), reloadInterval.toNanos(), reloadInterval.toNanos(), TimeUnit.NANOSECONDS); } }

Target:
private void schedulePeriodicReload() { assert adminExecutor.inEventLoop(); if (periodicTaskHandle != null) { periodicTaskHandle.cancel(false); } if (reloadInterval.isZero()) { LOG.debug("[{}] Reload interval is 0, disabling periodic reloading", logPrefix); } else { LOG.debug("[{}] Scheduling periodic reloading with interval {}", logPrefix, reloadInterval); periodicTaskHandle = adminExecutor.scheduleAtFixedRate( this::reloadInBackground, reloadInterval.toNanos(), reloadInterval.toNanos(), TimeUnit.NANOSECONDS); } }
Source:
public int compareTo( Position other ) { if ( y < other.y ) { return -1; } else if( y > other.y ) { return 1; } else { if ( x < other.x ) { return -1; } else if( x > other.x ) { return 1; } else { return 0; } } }

Target:
public int compareTo( Position other ) { if ( y != other.y ) { return y - other.y ; } return x - other.x; }
Source:
private static void registerTransformersWildFly16(ResourceTransformationDescriptionBuilder subsystemBuilder) { subsystemBuilder.getAttributeBuilder() .addRejectCheck(RejectAttributeChecker.DEFINED, UUID_INSTANCE_ID) .setDiscard(DiscardAttributeChecker.ALWAYS, UUID_INSTANCE_ID) .end(); subsystemBuilder .addChildResource(UndertowExtension.SERVER_PATH) .addChildResource(UndertowExtension.HOST_PATH) .rejectChildResource(ConsoleAccessLogDefinition.INSTANCE.getPathElement()); }

Target:
private static void registerTransformersWildFly16(ResourceTransformationDescriptionBuilder subsystemBuilder) { subsystemBuilder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, OBFUSCATE_SESSION_ROUTE) .setDiscard(DiscardAttributeChecker.DEFAULT_VALUE, OBFUSCATE_SESSION_ROUTE) .end(); subsystemBuilder .addChildResource(UndertowExtension.SERVER_PATH) .addChildResource(UndertowExtension.HOST_PATH) .rejectChildResource(ConsoleAccessLogDefinition.INSTANCE.getPathElement()); }
Source:
private void buttonsEnablement() { if (findMaxDefined() != findMaxPermitted()) { fSubmit.setEnabled(false); } if (fChangeInfo.getLabels().get("Verified") != null && fChangeInfo.getLabels().get("Verified").isBlocking()) { fSubmit.setEnabled(false); } else if (fChangeInfo.getLabels().get("Verified") != null && fChangeInfo.getLabels().get("Verified").getValue() == null && fChangeInfo.getVerifiedTally() <= 0) { fSubmit.setEnabled(false); } else if (fChangeInfo.getLabels().get("Verified") != null && fChangeInfo.getLabels().get("Verified").getValue() != null && new Integer(fChangeInfo.getLabels().get("Verified").getValue()).intValue() <= 0) { fSubmit.setEnabled(false); } else if (fChangeInfo.getLabels().get("Code-Review") != null && fChangeInfo.getLabels().get("Code-Review").isBlocking()) { fSubmit.setEnabled(false); } else if (fChangeInfo.getLabels().get("Code-Review") != null && fChangeInfo.getLabels().get("Code-Review").getValue() == null && fChangeInfo.getCodeReviewedTally() <= 0) { fSubmit.setEnabled(false); } else if (fChangeInfo.getLabels().get("Code-Review") != null && fChangeInfo.getLabels().get("Code-Review").getValue() != null && new Integer(fChangeInfo.getLabels().get("Code-Review").getValue()).intValue() <= 0) { fSubmit.setEnabled(false); } }

Target:
private void buttonsEnablement() { submitButtonEnablement(); }
Source:
public MergedTrackingToken( @JsonProperty("lowerSegmentToken") TrackingToken lowerSegmentToken, @JsonProperty("upperSegmentToken") TrackingToken upperSegmentToken) { this.lowerSegmentToken = lowerSegmentToken; this.upperSegmentToken = upperSegmentToken; this.lowerSegmentAdvanced = false; this.upperSegmentAdvanced = false; }

Target:
public MergedTrackingToken( @JsonProperty("lowerSegmentToken") TrackingToken lowerSegmentToken, @JsonProperty("upperSegmentToken") TrackingToken upperSegmentToken) { this(lowerSegmentToken, upperSegmentToken, false, false); }
Source:
private boolean isValidNight(final Long accountId, final List<TrackerMotion> motionData){ if(!hasNewInvalidNightFilterEnabled(accountId)){ return motionData.size() >= MININIMUM_NUMBER_OF_TRACKER_MOTIIONS; } if(motionData.size() == 0){ return false; } if(motionData.get(motionData.size() - 1).timestamp - motionData.get(0).timestamp < 3 * DateTimeConstants.MILLIS_PER_HOUR) { return false; } return true; }

Target:
private boolean isValidNight(final Long accountId, final List<TrackerMotion> motionData){ if(!hasNewInvalidNightFilterEnabled(accountId)){ return motionData.size() >= MIN_TRACKER_MOTION_COUNT; } if(motionData.size() == 0){ return false; } if(motionData.get(motionData.size() - 1).timestamp - motionData.get(0).timestamp < 5 * DateTimeConstants.MILLIS_PER_HOUR) { return false; } return true; }
Source:
public static List<ChildNumber> parsePath(@Nonnull String path) { path = checkNotNull(path); String[] parsedNodes = path.split("/"); List<ChildNumber> nodes = new ArrayList<ChildNumber>(); for (String n : parsedNodes) { n = n.replaceAll(" ", ""); if (n.length() == 0) { continue; } boolean isHard = n.endsWith("'"); if (isHard) { n = n.substring(0, n.length() - 1); } int nodeNumber = Integer.parseInt(n); nodes.add(new ChildNumber(nodeNumber, isHard)); } return ImmutableList.copyOf(nodes); }

Target:
public static List<ChildNumber> parsePath(@Nonnull String path) { String[] parsedNodes = path.split("/"); List<ChildNumber> nodes = new ArrayList<ChildNumber>(); for (String n : parsedNodes) { n = n.replaceAll(" ", ""); if (n.length() == 0) continue; boolean isHard = n.endsWith("'"); if (isHard) n = n.substring(0, n.length() - 1); int nodeNumber = Integer.parseInt(n); nodes.add(new ChildNumber(nodeNumber, isHard)); } return nodes; }
Source:
public void refreshAnchorTypes() { String signature = "(Num a, Show b) => Signal a -> Signal b"; Type type = getPane().getEnvInstance().buildType(signature); inputAnchor.setFreshRequiredType(type, new TypeScope()); }

Target:
public void refreshAnchorTypes() { inputAnchor.setFreshRequiredType(funConstraint, new TypeScope()); }
Source:
public void testNullStringEquality() throws Exception { testQuery( "SELECT COUNT(*)\n" + "FROM druid.foo\n" + "WHERE NULLIF(dim2, 'a') = null", NullHandling.replaceWithDefault() ? ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .filters(selector("dim2", "a", null)) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ) : ImmutableList.of(), NullHandling.replaceWithDefault() ? ImmutableList.of(new Object[]{2L}) : ImmutableList.of(new Object[]{0L}) ); }

Target:
public void testNullStringEquality() throws Exception { testQuery( "SELECT COUNT(*)\n" + "FROM druid.foo\n" + "WHERE NULLIF(dim2, 'a') = null", NullHandling.replaceWithDefault() ? ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .filters( NullHandling.replaceWithDefault() ? new InDimFilter("dim2", ImmutableList.of("", "a"), null) : selector("dim2", "", null)) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ) : ImmutableList.of(), NullHandling.replaceWithDefault() ? ImmutableList.of(new Object[]{5L}) : ImmutableList.of(new Object[]{0L}) ); }
Source:
protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler context) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final int icIndex = uiColumnIndex - DecisionTableUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT; dtable.getInput().add(icIndex, inputClause); dtable.getRule().forEach(rule -> { final UnaryTests ut = new UnaryTests(); ut.setText(INPUT_CLAUSE_DEFAULT_VALUE); rule.getInputEntry().add(icIndex, ut); }); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final int clauseIndex = dtable.getInput().indexOf(inputClause); dtable.getRule().forEach(rule -> rule.getInputEntry().remove(clauseIndex)); dtable.getInput().remove(inputClause); return GraphCommandResultBuilder.SUCCESS; } }; }

Target:
protected Command<GraphCommandExecutionContext, RuleViolation> newGraphCommand(final AbstractCanvasHandler context) { return new AbstractGraphCommand() { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final int clauseIndex = uiColumnIndex - DecisionTableUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT; dtable.getInput().add(clauseIndex, inputClause); dtable.getRule().forEach(rule -> { final UnaryTests ut = new UnaryTests(); ut.setText(INPUT_CLAUSE_DEFAULT_VALUE); rule.getInputEntry().add(clauseIndex, ut); }); return GraphCommandResultBuilder.SUCCESS; } @Override public CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context) { final int clauseIndex = dtable.getInput().indexOf(inputClause); dtable.getRule().forEach(rule -> rule.getInputEntry().remove(clauseIndex)); dtable.getInput().remove(inputClause); return GraphCommandResultBuilder.SUCCESS; } }; }
Source:
private void nextUnalignedFragment() throws ErrorMsg { while (hasMoreUnalignedFragments == null || hasMoreUnalignedFragments) { hasMoreUnalignedFragments = unalignedIterator.nextFragment(); lastUnalignedFragmentIndex++; if (hasMoreUnalignedFragments && !unalignedIterator.isAligned()) { return; } } if (!hasMoreUnalignedReads) { throw new RuntimeException("Cannot get next unaligned read - already at last one"); } while (true) { hasMoreUnalignedReads = unalignedIterator.nextRead(); lastUnalignedFragmentIndex = -1; if (!hasMoreUnalignedReads) { break; } while (true) { hasMoreUnalignedFragments = unalignedIterator.nextFragment(); lastUnalignedFragmentIndex++; if (!hasMoreUnalignedFragments) { break; } if (!unalignedIterator.isAligned()) { break; } } if (hasMoreUnalignedFragments) { break; } } }

Target:
private void nextUnalignedFragment() throws ErrorMsg { while (hasMoreUnalignedFragments == null || hasMoreUnalignedFragments) { hasMoreUnalignedFragments = unalignedIterator.nextFragment(); lastUnalignedFragmentIndex++; if (hasMoreUnalignedFragments && !unalignedIterator.isAligned()) { return; } } if (!hasMoreUnalignedReads) { throw new RuntimeException("Cannot get next unaligned read - already at last one"); } while (true) { hasMoreUnalignedReads = unalignedIterator.nextRead(); lastUnalignedFragmentIndex = -1; if (!hasMoreUnalignedReads) { break; } do { hasMoreUnalignedFragments = unalignedIterator.nextFragment(); lastUnalignedFragmentIndex++; } while (hasMoreUnalignedFragments && unalignedIterator.isAligned()); if (hasMoreUnalignedFragments) { return; } } }
Source:
public void image(Attributes attributes, String url) { delegate.image(attributes, url); }

Target:
public void image(Attributes attributes, String url) { assertOpenBlock(); delegate.image(attributes, url); }
Source:
void markBlockAsMoved(final int blockId) { if (!blockIds.contains(blockId) || movedBlockIds.contains(blockId)) { LOG.log(Level.WARNING, "Block id {0} seems to have finished already.", blockId); } movedBlockIds.add(blockId); }

Target:
void markBlockAsMoved(final int blockId) { if (!blockIds.contains(blockId)) { LOG.log(Level.WARNING, "Block id {0} was not asked to move.", blockId); } else if (movedBlockIds.contains(blockId)) { LOG.log(Level.WARNING, "Block id {0} seems to have finished already.", blockId); } else { movedBlockIds.add(blockId); } }
Source:
private static Set<String> reducePVCSourcedVolumes(List<Volume> volumes) { Set<String> pvcSourcedVolumes = new HashSet<>(); Iterator<Volume> volumeIterator = volumes.iterator(); while (volumeIterator.hasNext()) { io.fabric8.kubernetes.api.model.Volume volume = volumeIterator.next(); if (volume.getPersistentVolumeClaim() != null) { pvcSourcedVolumes.add(volume.getName()); volumeIterator.remove(); } } return pvcSourcedVolumes; }

Target:
private static Set<String> reducePVCSourcedVolumes(List<Volume> volumes) { Set<String> pvcSourcedVolumes = new HashSet<>(); Iterator<Volume> volumeIterator = volumes.iterator(); while (volumeIterator.hasNext()) { Volume volume = volumeIterator.next(); if (volume.getPersistentVolumeClaim() != null) { pvcSourcedVolumes.add(volume.getName()); volumeIterator.remove(); } } return pvcSourcedVolumes; }
Source:
public QueryMetrics<Query<?>> makeMetrics(SegmentMetadataQuery query) { query.withAnalysisTypes(getFinalAnalysisTypes(query)); return queryMetricsFactory.makeMetrics(query); }

Target:
public QueryMetrics<Query<?>> makeMetrics(SegmentMetadataQuery query) { return queryMetricsFactory.makeMetrics(query); }
Source:
public void waitForInterstitialShowUp() { JavascriptActions javascriptActions = new JavascriptActions(driver); javascriptActions.waitForJavaScriptTruthy("document.querySelectorAll(\"" + INTERSTITIAL_AD_WRAPPER_SELECTOR + "\").length == 1"); }

Target:
public void waitForInterstitialShowUp() { JavascriptActions javascriptActions = new JavascriptActions(driver); String jsIsInterstitialPresent = String.format("document.querySelectorAll('%s').length == 1", INTERSTITIAL_AD_WRAPPER_SELECTOR); javascriptActions.waitForJavaScriptTruthy(jsIsInterstitialPresent); }
Source:
public List<UUID> getMessageIds() { return this.messageIds; }

Target:
public List<UUID> getMessageIds() { return Collections.unmodifiableList(this.messageIds); }
Source:
public void testCreateAndDeleteKeyPairWithPublicKey() throws Exception { for (String zoneId : api.getConfiguredZones()) { KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get(); KeyPair keyPair = null; try { keyPair = keyPairApi.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY); assertNotNull(keyPair); } finally { if (keyPair != null) { keyPairApi.delete(KEYPAIR_NAME); } } } }

Target:
public void testCreateAndDeleteKeyPairWithPublicKey() throws Exception { for (String zoneId : api.getConfiguredZones()) { KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get(); KeyPair createdKeyPair = null; try { createdKeyPair = keyPairApi.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY); assertNotNull(createdKeyPair); KeyPair keyPair = keyPairApi.get(KEYPAIR_NAME); assertEquals(keyPair.getName(), createdKeyPair.getName()); assertEquals(keyPair.getFingerprint(), createdKeyPair.getFingerprint()); assertEquals(keyPair.getPublicKey(), createdKeyPair.getPublicKey()); } finally { if (createdKeyPair != null) { keyPairApi.delete(KEYPAIR_NAME); } } } }
Source:
protected void executeCommand() { StoragePoolIsoMap map = loadStoragePoolIsoMap(); changeDomainStatusWithCompensation(map, StorageDomainStatus.Unknown, StorageDomainStatus.Locked, getCompensationContext()); if (shouldPerformOvfUpdate()) { ActionReturnValue returnValue = runInternalAction(ActionType.UpdateOvfStoreForStorageDomain, createUpdateOvfStoreParams(), cloneContext().withoutCompensationContext()); if (!returnValue.getSucceeded()) { getReturnValue().getValidationMessages().addAll(returnValue.getValidationMessages()); getReturnValue().getExecuteFailedMessages().addAll(returnValue.getExecuteFailedMessages()); return; } } if (noAsyncOperations()) { executeDeactivateCommand(); } setSucceeded(true); }

Target:
protected void executeCommand() { StoragePoolIsoMap map = loadStoragePoolIsoMap(); changeDomainStatusWithCompensation(map, StorageDomainStatus.Unknown, StorageDomainStatus.Locked, getCompensationContext()); if (shouldPerformOvfUpdate()) { ActionReturnValue returnValue = runInternalAction(ActionType.UpdateOvfStoreForStorageDomain, createUpdateOvfStoreParams(), cloneContext().withoutCompensationContext()); if (!returnValue.getSucceeded()) { propagateFailure(returnValue); return; } } if (noAsyncOperations()) { executeDeactivateCommand(); } setSucceeded(true); }
Source:
protected final boolean tryFailureInternal(Throwable cause) { boolean done = super.tryFailure(cause); return clearTaskAfterCompletion(done, FAILED); }

Target:
protected final boolean tryFailureInternal(Throwable cause) { return clearTaskAfterCompletion(super.tryFailure(cause), FAILED); }
Source:
public static Properties getDefaultConfigFromProps(String fileName) { Properties config = new Properties(); InputStream in = null; try { in = Config.class.getClassLoader().getResourceAsStream(fileName); } catch (Exception e) { logger.info(e.getMessage()); } finally { try { config.load(in); if(in != null){ in.close(); } } catch (IOException ioe) { logger.error(ioe.getMessage(), ioe); } } if(config.get(BOOTSTRAP_SERVERS_KEY)== null){ config.put(BOOTSTRAP_SERVERS_KEY, getBootStrapServers()); } return config; }

Target:
public static Properties getDefaultConfigFromProps(String fileName) { Properties config = new Properties(); try (InputStream in = Config.class.getClassLoader().getResourceAsStream(fileName);) { config.load(in); } catch (Exception ex) { logger.error(ex.getMessage(), ex); } config.put(BOOTSTRAP_SERVERS_KEY, config.getOrDefault(BOOTSTRAP_SERVERS_KEY, getBootStrapServers())); return config; }
Source:
public String generateFullPath(OperationModel operationModel) { String queryString = "?"; if (operationModel.getOperation().getParameters() != null) for (Parameter parameter : operationModel.getOperation().getParameters()) { if (parameter == null) { continue; } String parameterType = parameter.getIn(); String value = dataGenerator.generate(parameter.getName(), parameter); if ("query".equals(parameterType)) { queryString += parameter.getName() + "=" + value + "&"; } else if ("path".equals(parameterType)) { String newPath = operationModel .getPath() .replace("{" + parameter.getName() + "}", value); operationModel.setPath(newPath); } } return operationModel.getPath() + queryString.substring(0, queryString.length() - 1); }

Target:
public String generateFullPath(OperationModel operationModel) { String queryString = "?"; if (operationModel.getOperation().getParameters() != null) for (Parameter parameter : operationModel.getOperation().getParameters()) { if (parameter == null) { continue; } String parameterType = parameter.getIn(); if ("query".equals(parameterType)) { String value = dataGenerator.generate(parameter.getName(), parameter); queryString += parameter.getName() + "=" + value + "&"; } else if ("path".equals(parameterType)) { String value = dataGenerator.generate(parameter.getName(), parameter); String newPath = operationModel .getPath() .replace("{" + parameter.getName() + "}", value); operationModel.setPath(newPath); } } return operationModel.getPath() + queryString.substring(0, queryString.length() - 1); }
Source:
private void loadPropertiesFile() { String filePath = System.getProperty(FILE_PROPERTY_PATH); if ( null == filePath || filePath.isEmpty()) { throw new ResolverException(FILE_PROPERTY_PATH + " is empty or null"); } if (("default").equals(filePath)) { filePath = System.getProperty(CONF_LOCATION) + File.separator + "file.properties"; } File file = new File(filePath); boolean isFileExists = file.exists(); if (isFileExists) { try (InputStream in = new FileInputStream(filePath)) { Properties rawProps = new Properties(); propertyMap = new HashMap(); rawProps.load(in); for (Map.Entry<Object, Object> propertyEntry : rawProps.entrySet()) { String strValue = (String) propertyEntry.getValue(); propertyMap.put(propertyEntry.getKey(), strValue); } if (LOG.isDebugEnabled()) { LOG.debug("Loaded factory properties from " + filePath + ": " + propertyMap); } } catch (IOException ex) { throw new ResolverException("Failed to read " + filePath, ex); } } else { throw new ResolverException(filePath + " file cannot found in " + filePath); } }

Target:
private void loadPropertiesFile() { String filePath = System.getProperty(FILE_PROPERTY_PATH); if ( null == filePath || filePath.isEmpty()) { throw new ResolverException(FILE_PROPERTY_PATH + " is empty or null"); } if (("default").equals(filePath)) { filePath = System.getProperty(CONF_LOCATION) + File.separator + "file.properties"; } File file = new File(filePath); boolean isFileExists = file.exists(); if (isFileExists) { try (InputStream in = new FileInputStream(filePath)) { Properties rawProps = new Properties(); propertyMap = new HashMap(); rawProps.load(in); for (Map.Entry<Object, Object> propertyEntry : rawProps.entrySet()) { String strValue = (String) propertyEntry.getValue(); propertyMap.put(propertyEntry.getKey(), strValue); } if (LOG.isDebugEnabled()) { LOG.debug("Loaded factory properties from " + filePath + ": " + propertyMap); } } catch (IOException ex) { throw new ResolverException("Failed to read " + filePath, ex); } } else { throw new ResolverException("File cannot found in " + filePath); } }
Source:
Stream<SequencedRecordedMessage<M, R>> getTrackedValues() { Stream<SequencedRecordedMessage<M, R>> base = Stream.empty(); for (Entry<ClientSourceId, TrackerImpl<M, R>> t : objectTrackers.entrySet()) { base = Stream.concat(base, t.getValue().getTrackedValues().stream().map(e->convert(t.getKey(), e))); } return base; }

Target:
Stream<SequencedRecordedMessage<M, R>> getTrackedValues() { return objectTrackers.entrySet().stream().flatMap(t->t.getValue().getTrackedValues().stream().map(e->convert(t.getKey(), e))); }
Source:
public void run() { Case currentCase; try { currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, String.format("Failed to start AddImageTask, no current case"), ex); return; } progressMonitor.setIndeterminate(true); progressMonitor.setProgress(0); String imageWriterPath = ""; if (imageDetails.imageWriterSettings != null) { imageWriterPath = imageDetails.imageWriterSettings.getPath(); } List<String> errorMessages = new ArrayList<>(); List<Content> newDataSources = new ArrayList<>(); try { synchronized (tskAddImageProcessLock) { if (!tskAddImageProcessStopped) { tskAddImageProcess = currentCase.getSleuthkitCase().makeAddImageProcess(imageDetails.timeZone, true, imageDetails.ignoreFatOrphanFiles, imageWriterPath); } else { return; } } Thread progressUpdateThread = new Thread(new ProgressUpdater(progressMonitor, tskAddImageProcess)); progressUpdateThread.start(); runAddImageProcess(errorMessages); progressUpdateThread.interrupt(); commitOrRevertAddImageProcess(currentCase, errorMessages, newDataSources); progressMonitor.setProgress(100); } finally { DataSourceProcessorCallback.DataSourceProcessorResult result; if (criticalErrorOccurred) { result = DataSourceProcessorResult.CRITICAL_ERRORS; } else if (!errorMessages.isEmpty()) { result = DataSourceProcessorResult.NONCRITICAL_ERRORS; } else { result = DataSourceProcessorResult.NO_ERRORS; } addImageTaskCallback.onCompleted(result, errorMessages, newDataSources); } }

Target:
public void run() { Case currentCase; try { currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, String.format("Failed to start AddImageTask for %s, no current case", imageDetails.getImagePath()), ex); return; } progressMonitor.setIndeterminate(true); progressMonitor.setProgress(0); String imageWriterPath = ""; if (imageDetails.imageWriterSettings != null) { imageWriterPath = imageDetails.imageWriterSettings.getPath(); } List<String> errorMessages = new ArrayList<>(); List<Content> newDataSources = new ArrayList<>(); try { synchronized (tskAddImageProcessLock) { if (!tskAddImageProcessStopped) { tskAddImageProcess = currentCase.getSleuthkitCase().makeAddImageProcess(imageDetails.timeZone, true, imageDetails.ignoreFatOrphanFiles, imageWriterPath); } else { return; } } Thread progressUpdateThread = new Thread(new ProgressUpdater(progressMonitor, tskAddImageProcess)); progressUpdateThread.start(); runAddImageProcess(errorMessages); progressUpdateThread.interrupt(); finishAddImageProcess(errorMessages, newDataSources); progressMonitor.setProgress(100); } finally { DataSourceProcessorCallback.DataSourceProcessorResult result; if (criticalErrorOccurred) { result = DataSourceProcessorResult.CRITICAL_ERRORS; } else if (!errorMessages.isEmpty()) { result = DataSourceProcessorResult.NONCRITICAL_ERRORS; } else { result = DataSourceProcessorResult.NO_ERRORS; } addImageTaskCallback.onCompleted(result, errorMessages, newDataSources); } }
Source:
public JSONWebKeySet getKeysFromStorage() { ExpiredObject expiredObject = persistenceService.getExpiredObject(ExpiredObjectType.JWKS.getValue()); if (expiredObject != null && !Strings.isNullOrEmpty(expiredObject.getValue())) { JSONObject keys = new JSONObject(expiredObject.getValue()); return JSONWebKeySet.fromJSONObject(keys); } return null; }

Target:
public JSONWebKeySet getKeysFromStorage() { ExpiredObject expiredObject = persistenceService.getExpiredObject(ExpiredObjectType.JWKS.getValue()); if (expiredObject == null || Strings.isNullOrEmpty(expiredObject.getValue())) { return null; } JSONObject keysInJson = new JSONObject(expiredObject.getValue()); JSONWebKeySet keys = JSONWebKeySet.fromJSONObject(keysInJson); try { if (hasKeysExpired(expiredObject)) { LOG.trace("The keys in storage got expired. Deleting the expired keys from storage."); deleteKeysFromStorage(); return null; } } catch (Exception e) { LOG.error("Error in reading expiry date or deleting expired keys from storage. Trying to delete the keys from storage.", e); deleteKeysFromStorage(); return null; } return keys; }
Source:
public LogicalPlanner(Functions functions, TableStats tableStats, Supplier<Version> minNodeVersionInCluster) { this.optimizer = new Optimizer( List.of( new RemoveRedundantFetchOrEval(), new MergeAggregateAndCollectToCount(), new MergeFilters(), new MoveFilterBeneathBoundary(), new MoveFilterBeneathFetchOrEval(), new MoveFilterBeneathOrder(), new MoveFilterBeneathProjectSet(), new MoveFilterBeneathHashJoin(), new MoveFilterBeneathNestedLoop(), new MoveFilterBeneathUnion(), new MoveFilterBeneathGroupBy(), new MoveFilterBeneathWindowAgg(), new MergeFilterAndCollect(), new RewriteFilterOnOuterJoinToInnerJoin(functions), new MoveOrderBeneathUnion(), new MoveOrderBeneathNestedLoop(), new MoveOrderBeneathBoundary(), new MoveOrderBeneathFetchOrEval(), new DeduplicateOrder(), new RewriteCollectToGet(functions), new RewriteGroupByKeysLimitToTopNDistinct() ), minNodeVersionInCluster ); this.writeOptimizer = new Optimizer( List.of(new RewriteInsertToInsertFromValues()), minNodeVersionInCluster ); this.tableStats = tableStats; this.functions = functions; this.relationNormalizer = new RelationNormalizer(functions); }

Target:
public LogicalPlanner(Functions functions, TableStats tableStats, Supplier<Version> minNodeVersionInCluster) { this.optimizer = new Optimizer( List.of( new RemoveRedundantFetchOrEval(), new MergeAggregateAndCollectToCount(), new MergeFilters(), new MoveFilterBeneathBoundary(), new MoveFilterBeneathFetchOrEval(), new MoveFilterBeneathOrder(), new MoveFilterBeneathProjectSet(), new MoveFilterBeneathHashJoin(), new MoveFilterBeneathNestedLoop(), new MoveFilterBeneathUnion(), new MoveFilterBeneathGroupBy(), new MoveFilterBeneathWindowAgg(), new MergeFilterAndCollect(), new RewriteFilterOnOuterJoinToInnerJoin(functions), new MoveOrderBeneathUnion(), new MoveOrderBeneathNestedLoop(), new MoveOrderBeneathBoundary(), new MoveOrderBeneathFetchOrEval(), new DeduplicateOrder(), new RewriteCollectToGet(functions), new RewriteGroupByKeysLimitToTopNDistinct() ), minNodeVersionInCluster ); this.writeOptimizer = new Optimizer( List.of(new RewriteInsertFromSubQueryToInsertFromValues()), minNodeVersionInCluster ); this.tableStats = tableStats; this.functions = functions; this.relationNormalizer = new RelationNormalizer(functions); }