auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SpatialJoinOperator( OperatorContext operatorContext, JoinNode.Type joinType, List<Type> probeTypes, List<Integer> probeOutputChannels, int probeGeometryChannel, PagesSpatialIndexFactory pagesSpatialIndexFactory) { this.operatorContext = operatorContext; this.localUserMemoryContext = operatorContext.localUserMemoryContext(); this.joinType = joinType; this.probeTypes = ImmutableList.copyOf(probeTypes); this.probeOutputChannels = ImmutableList.copyOf(probeOutputChannels); this.probeGeometryChannel = probeGeometryChannel; this.pagesSpatialIndexFactory = pagesSpatialIndexFactory; this.pagesSpatialIndexFuture = pagesSpatialIndexFactory.createPagesSpatialIndex(); this.pageBuilder = new PageBuilder(ImmutableList.<Type>builder() .addAll(probeOutputChannels.stream() .map(probeTypes::get) <START> .collect(toImmutableList())) <END> .addAll(pagesSpatialIndexFactory.getOutputTypes()) .build()); }</code><technical_language>nit: .iterator() do</technical_language>

Target:
public SpatialJoinOperator( OperatorContext operatorContext, JoinNode.Type joinType, List<Type> probeTypes, List<Integer> probeOutputChannels, int probeGeometryChannel, PagesSpatialIndexFactory pagesSpatialIndexFactory) { this.operatorContext = operatorContext; this.localUserMemoryContext = operatorContext.localUserMemoryContext(); this.joinType = joinType; this.probeTypes = ImmutableList.copyOf(probeTypes); this.probeOutputChannels = ImmutableList.copyOf(probeOutputChannels); this.probeGeometryChannel = probeGeometryChannel; this.pagesSpatialIndexFactory = pagesSpatialIndexFactory; this.pagesSpatialIndexFuture = pagesSpatialIndexFactory.createPagesSpatialIndex(); this.pageBuilder = new PageBuilder(ImmutableList.<Type>builder() .addAll(probeOutputChannels.stream() .map(probeTypes::get) .iterator()) .addAll(pagesSpatialIndexFactory.getOutputTypes()) .build()); }
Source:
<code><START> public Ds3NameMapperParserImpl() throws IOException { <END> this.objectMapper = initDs3NameMapper(); }</code><technical_language>Sure, function called in constructor throw IOException</technical_language>

Target:
public Ds3NameMapperParserImpl() { this.objectMapper = initDs3NameMapper(); }
Source:
<code>private void setupFocusHandling() { focusListener = new IWindowListener() { <START> void updateUiState() { <END> Display.getCurrent().asyncExec(new Runnable() { public void run() { uiIsActive = Display.getCurrent().getActiveShell() != null; } }); } public void windowOpened(IWorkbenchWindow window) { updateUiState(); } public void windowDeactivated(IWorkbenchWindow window) { updateUiState(); } public void windowClosed(IWorkbenchWindow window) { updateUiState(); } public void windowActivated(IWorkbenchWindow window) { updateUiState(); if (rcs.doReschedule) rcs.schedule(); refreshJob.triggerRefresh(); } }; Job job = new Job(UIText.Activator_setupFocusListener) { @Override protected IStatus run(IProgressMonitor monitor) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().addWindowListener(focusListener); else schedule(1000L); return Status.OK_STATUS; } }; job.schedule(); }</code><technical_language>this method declared private</technical_language>

Target:
private void setupFocusHandling() { focusListener = new IWindowListener() { private void updateUiState() { Display.getCurrent().asyncExec(new Runnable() { public void run() { uiIsActive = Display.getCurrent().getActiveShell() != null; } }); } public void windowOpened(IWorkbenchWindow window) { updateUiState(); } public void windowDeactivated(IWorkbenchWindow window) { updateUiState(); } public void windowClosed(IWorkbenchWindow window) { updateUiState(); } public void windowActivated(IWorkbenchWindow window) { updateUiState(); if (rcs.doReschedule) rcs.schedule(); refreshJob.triggerRefresh(); } }; Job job = new Job(UIText.Activator_setupFocusListener) { @Override protected IStatus run(IProgressMonitor monitor) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().addWindowListener(focusListener); else schedule(1000L); return Status.OK_STATUS; } }; job.schedule(); }
Source:
<code>public void migrationException_realmListChanged() throws IOException { RealmConfiguration config = configFactory.createConfiguration(); Realm.getInstance(configFactory.createConfiguration()).close(); DynamicRealm dynamicRealm = DynamicRealm.getInstance(config); dynamicRealm.beginTransaction(); RealmObjectSchema dogSchema = dynamicRealm.getSchema().get(Dog.CLASS_NAME); RealmObjectSchema ownerSchema = dynamicRealm.getSchema().get(CatOwner.CLASS_NAME); ownerSchema.removeField(CatOwner.FIELD_CATS); ownerSchema.addRealmListField(CatOwner.FIELD_CATS, dogSchema); dynamicRealm.commitTransaction(); dynamicRealm.close(); try { realm = Realm.getInstance(config); fail(); } catch (RealmMigrationNeededException ignored) { assertThat(ignored.getMessage(), <START> CoreMatchers.containsString("Property 'CatOwner.cats' has been changed from 'array' to 'array'")); <END> } }</code><technical_language>'array' 'array'</technical_language>

Target:
public void migrationException_realmListChanged() throws IOException { RealmConfiguration config = configFactory.createConfiguration(); Realm.getInstance(configFactory.createConfiguration()).close(); DynamicRealm dynamicRealm = DynamicRealm.getInstance(config); dynamicRealm.beginTransaction(); RealmObjectSchema dogSchema = dynamicRealm.getSchema().get(Dog.CLASS_NAME); RealmObjectSchema ownerSchema = dynamicRealm.getSchema().get(CatOwner.CLASS_NAME); ownerSchema.removeField(CatOwner.FIELD_CATS); ownerSchema.addRealmListField(CatOwner.FIELD_CATS, dogSchema); dynamicRealm.commitTransaction(); dynamicRealm.close(); try { realm = Realm.getInstance(config); fail(); } catch (RealmMigrationNeededException ignored) { assertThat(ignored.getMessage(), CoreMatchers.containsString("Property 'CatOwner.cats' has been changed from 'array<Dog>' to 'array<Cat>'")); } }
Source:
<code>public ContainerEntity findContainerByName(String name) { try { return entityManager.get().createQuery("SELECT c FROM " + entityClass.getName() + " c WHERE c.name = :name", entityClass) .setParameter("name", name) .getSingleResult(); } catch (PersistenceException e) { <START> return null; <END> } }</code><technical_language>catch NoResultException return null propagate exception otherwise</technical_language>

Target:
public ContainerEntity findContainerByName(String name) { try { return entityManager.get().createQuery("SELECT c FROM " + entityClass.getName() + " c WHERE c.name = :name", entityClass) .setParameter("name", name) .getSingleResult(); } catch (NoResultException e) { return null; } }
Source:
<code>public void testCreateEncounterPostActionParameter() throws InterruptedException { Task task = prepareCreateEncounterPostActionParameterTask(); getTriggerHandler().registerHandlerFor(task.getTrigger().getEffectiveListenerSubject()); activateTrigger(); assertTrue(waitForTaskExecution(task.getId())); <START> Encounter encounter = encounterService.getLatestEncounterByPatientMotechId(DEFAULT_CONFIG_NAME, "654", createdEncounterType.getName()); <END> String firstEncounterUuid = encounter.getUuid(); Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "Jacob Lee"); Person.Address address = patient.getPerson().getPreferredAddress(); assertEquals(firstEncounterUuid, address.getAddress1()); }</code><technical_language>I understand "654" is a motechId of createdPatient object, more readable pass this parameter getter</technical_language>

Target:
public void testCreateEncounterPostActionParameter() throws InterruptedException { Task task = prepareCreateEncounterPostActionParameterTask(); getTriggerHandler().registerHandlerFor(task.getTrigger().getEffectiveListenerSubject()); activateTrigger(); assertTrue(waitForTaskExecution(task.getId())); Encounter encounter = encounterService.getLatestEncounterByPatientMotechId(DEFAULT_CONFIG_NAME, createdPatient.getMotechId(), createdEncounterType.getName()); String firstEncounterUuid = encounter.getUuid(); Patient patient = patientService.getPatientByMotechId(DEFAULT_CONFIG_NAME, "Jacob Lee"); Person.Address address = patient.getPerson().getPreferredAddress(); assertEquals(firstEncounterUuid, address.getAddress1()); }
Source:
<code>public void validate(String name, List<String> objectIds) throws ParameterException { if (objectIds == null) { return; } <START> for (val id : objectIds) { <END> if (tryParse(id) == null) { parameterException(name, id, "is not a valid UUID"); } } }</code><technical_language>objectId</technical_language>

Target:
public void validate(String name, List<String> objectIds) throws ParameterException { if (objectIds == null) { return; } for (val objectId : objectIds) { if (tryParse(objectId) == null) { parameterException(name, objectId, "is not a valid UUID"); } } }
Source:
<code>private void validateGenotypes() { if ( this.genotypes == null ) throw new IllegalStateException("Genotypes is null"); for ( int i = 0; i < genotypes.size(); i++ ) { <START> if ( genotypes.get(i).isAvailable() ) { <END> for ( Allele gAllele : genotypes.get(i).getAlleles() ) { if ( ! hasAllele(gAllele) && gAllele.isCalled() ) throw new IllegalStateException("Allele in genotype " + gAllele + " not in the variant context " + alleles); } } } }</code><technical_language>pull out get(i) a variable if speed is essential here</technical_language>

Target:
private void validateGenotypes() { if ( this.genotypes == null ) throw new IllegalStateException("Genotypes is null"); for ( int i = 0; i < genotypes.size(); i++ ) { Genotype genotype = genotypes.get(i); if ( genotype.isAvailable() ) { final List<Allele> alleles = genotype.getAlleles(); for ( int j = 0, size = alleles.size(); j < size; j++ ) { final Allele gAllele = alleles.get(j); if ( ! hasAllele(gAllele) && gAllele.isCalled() ) throw new IllegalStateException("Allele in genotype " + gAllele + " not in the variant context " + alleles); } } } }
Source:
<code>public String postInBody(String restPath, String bodyContent){ HttpPost post = new HttpPost(prepareRequestURL(restPath)); try { StringEntity entity = new StringEntity(bodyContent); post.setEntity(entity); HttpResponse response = httpclient.execute(post); String result = EntityUtils.toString(response.getEntity()); return result; }catch (ClientProtocolException e) { <START> return null; <END> } catch (UnsupportedEncodingException e) { return null; } catch (IOException e) { return null; } }</code><technical_language>ignore exceptions</technical_language>

Target:
public String postInBody(String restPath, String bodyContent){ log.info("Posting request for " + this.serviceURL + restPath); HttpPost post = new HttpPost(prepareRequestURL(restPath)); String result = ""; try { StringEntity entity = new StringEntity(bodyContent); post.setEntity(entity); HttpResponse response = httpclient.execute(post); result = EntityUtils.toString(response.getEntity()); }catch (ClientProtocolException e) { log.error("ClientProtocolException", e); } catch (UnsupportedEncodingException e) { log.error("UnsupportedEncodingException", e); } catch (IOException e) { log.error("IOException", e); } return result; }
Source:
<code>public static String get() { <START> return getVersionFromStatic(); <END> }</code><technical_language>prefer this call getVersion(), deprecated getVersionFromStatic()</technical_language>

Target:
public static String get() { return INSTANCE.getVersion(); }
Source:
<code>public <T, U> InternalRemoteCache<T, U> withDataFormat(DataFormat dataFormat) { InternalRemoteCache<T, U> newCache = delegate.withDataFormat(dataFormat); if (newCache != delegate) { return newDelegatingCache(newCache); } <START> return (InternalRemoteCache) this; <END> }</code><technical_language>Remove warning IDE suggestion //noinspection unchecked return (InternalRemoteCache<T, U>) this;</technical_language>

Target:
public <T, U> InternalRemoteCache<T, U> withDataFormat(DataFormat dataFormat) { InternalRemoteCache<T, U> newCache = delegate.withDataFormat(dataFormat); if (newCache != delegate) { return newDelegatingCache(newCache); } return (InternalRemoteCache<T, U>) this; }
Source:
<code>public void deleteCollectionDefaultItemReadGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; Group role = createDefaultReadGroup(itemGroupString, defaultItemRead); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/itemReadGroup")) <START> .andExpect(status().isUnauthorized()); <END> }</code><technical_language>double check group is</technical_language>

Target:
public void deleteCollectionDefaultItemReadGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); String itemGroupString = "ITEM"; int defaultItemRead = Constants.DEFAULT_ITEM_READ; Group role = collectionService.createDefaultReadGroup(context, collection, itemGroupString, defaultItemRead); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/itemReadGroup")) .andExpect(status().isUnauthorized()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/itemReadGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(role.getID(), role.getName()))); }
Source:
<code><START> @Override public SignInPage typeUsername(String username) { <END> fillInput(usernameField, username); return this; }</code><technical_language>I code style suggests annotations methods</technical_language>

Target:
public SignInPage typeUsername(String username) { fillInput(usernameField, username); return this; }
Source:
<code><START> void handleJobCompletion(final JobFinishedEvent event) throws GenieException { <END> final long start = System.nanoTime(); final String jobId = event.getId(); final Map<String, String> tags = Maps.newHashMap(); try { final Job job = retryTemplate.execute(context -> getJob(jobId)); final JobStatus status = job.getStatus(); if (status == JobStatus.INIT || status == JobStatus.RUNNING) { try { retryTemplate.execute(context -> updateJob(job, event, tags)); } catch (Exception e) { log.error("Failed updating for job: {}", jobId, e); tags.put(ERROR_TAG, "JOB_UPDATE_FAILURE"); finalStatusUpdateFailureRate.increment(); } try { retryTemplate.execute(context -> processJobDir(job)); } catch (Exception e) { log.error("Failed archiving directory for job: {}", jobId, e); tags.put(ERROR_TAG, "JOB_DIRECTORY_FAILURE"); archivalFailureRate.increment(); } try { retryTemplate.execute(context -> sendEmail(jobId)); } catch (Exception e) { log.error("Failed sending email for job: {}", jobId, e); tags.put(ERROR_TAG, "SEND_EMAIL_FAILURE"); emailFailureRate.increment(); } } } catch (Exception e) { log.error("Failed getting job with id: {}", jobId, e); tags.put(ERROR_TAG, "GET_JOB_FAILURE"); } final Id timerId = this.jobCompletionId.withTags(tags); this.registry.timer(timerId).record(System.nanoTime() - start, TimeUnit.NANOSECONDS); }</code><technical_language>public</technical_language>

Target:
void handleJobCompletion(final JobFinishedEvent event) throws GenieException { final long start = System.nanoTime(); final String jobId = event.getId(); final Map<String, String> tags = Maps.newHashMap(); try { final Job job = retryTemplate.execute(context -> getJob(jobId)); final JobStatus status = job.getStatus(); if (status.isActive()) { try { retryTemplate.execute(context -> updateJob(job, event, tags)); } catch (Exception e) { log.error("Failed updating for job: {}", jobId, e); tags.put(ERROR_TAG, "JOB_UPDATE_FAILURE"); finalStatusUpdateFailureRate.increment(); } try { retryTemplate.execute(context -> processJobDir(job)); } catch (Exception e) { log.error("Failed archiving directory for job: {}", jobId, e); tags.put(ERROR_TAG, "JOB_DIRECTORY_FAILURE"); archivalFailureRate.increment(); } try { retryTemplate.execute(context -> sendEmail(jobId)); } catch (Exception e) { log.error("Failed sending email for job: {}", jobId, e); tags.put(ERROR_TAG, "SEND_EMAIL_FAILURE"); emailFailureRate.increment(); } } } catch (Exception e) { log.error("Failed getting job with id: {}", jobId, e); tags.put(ERROR_TAG, "GET_JOB_FAILURE"); } finally { final Id timerId = this.jobCompletionId.withTags(tags); this.registry.timer(timerId).record(System.nanoTime() - start, TimeUnit.NANOSECONDS); } }
Source:
<code>private void makeWorkspaceManager() { JPanel workspaceBar = new JPanel(new BorderLayout()); JButton btnChangeWorkspace = new CustomButton(OrbisGISIcon.getIcon("application_go")); <START> btnChangeWorkspace.setToolTipText("Switch to another workspace"); <END> workspaceBar.add(btnChangeWorkspace); addComponent(workspaceBar,SwingConstants.LEFT); }</code><technical_language>internationalized</technical_language>

Target:
private void makeWorkspaceManager() { JPanel workspaceBar = new JPanel(new BorderLayout()); JButton btnChangeWorkspace = new CustomButton(OrbisGISIcon.getIcon("application_go")); btnChangeWorkspace.setToolTipText(I18N.tr("Switch to another workspace")); workspaceBar.add(btnChangeWorkspace); addComponent(workspaceBar, SwingConstants.LEFT); }
Source:
<code>public int estimateVcfNumberOfLines(String vcfFilePath) { logger.debug("Estimating the number of lines in the VCF file {}", vcfFilePath); int estimatedTotalNumberOfLines = 0; String vcfHead; String vcfSection; try { vcfHead = retrieveVcfHead(vcfFilePath); vcfSection = retrieveVcfSection(vcfFilePath); } catch (IOException e) { throw new RuntimeException("Error reading VCF " + vcfFilePath, e); } <START> if (!vcfSection.isEmpty()) { <END> File vcfHeadFile; File vcfSectionFile; try { vcfHeadFile = FileUtils.newGzipFile(vcfHead, "vcfHeadFile"); vcfSectionFile = FileUtils.newGzipFile(vcfSection, "vcfSectionFile"); } catch (IOException e) { throw new RuntimeException("Error while creating zip file", e); } double vcfFileSize = new File(vcfFilePath).length(); double singleVcfLineSize = (vcfSectionFile != null ? vcfSectionFile.length() : 0) / NUMBER_OF_LINES; double vcfHeadFileSize = vcfHeadFile != null ? vcfHeadFile.length() : 0; estimatedTotalNumberOfLines = (int) ((vcfFileSize - vcfHeadFileSize) / singleVcfLineSize); } logger.info("Estimated number of lines in VCF file: {}", estimatedTotalNumberOfLines); return estimatedTotalNumberOfLines; }</code><technical_language>is vcfHead checked</technical_language>

Target:
public long estimateVcfNumberOfLines(String vcfFilePath) { logger.debug("Estimating the number of lines in the VCF file {}", vcfFilePath); long estimatedTotalNumberOfLines = 0; String vcfHead; String vcfSection; try { vcfHead = retrieveVcfHead(vcfFilePath); vcfSection = retrieveVcfSection(vcfFilePath); } catch (IOException e) { throw new RuntimeException("Error reading VCF " + vcfFilePath, e); } if (!vcfSection.isEmpty()) { File vcfHeadFile; File vcfSectionFile; try { vcfHeadFile = FileUtils.newGzipFile(vcfHead, "vcfHeadFile"); vcfSectionFile = FileUtils.newGzipFile(vcfSection, "vcfSectionFile"); } catch (IOException e) { throw new RuntimeException("Error while creating zip file", e); } long vcfFileSize = new File(vcfFilePath).length(); long singleVcfLineSize = (vcfSectionFile.length() / NUMBER_OF_LINES); long vcfHeadFileSize = vcfHeadFile.length(); estimatedTotalNumberOfLines = ((vcfFileSize - vcfHeadFileSize) / singleVcfLineSize); } logger.info("Approximate number of lines in VCF file: {}", estimatedTotalNumberOfLines); return estimatedTotalNumberOfLines; }
Source:
<code>public void testNormalUsage() throws IOException { ResourceControllerDataProvider testCache = setupClusterDataCache(); Set<AssignableReplica> assignmentSet = generateReplicas(testCache); ClusterContext context = new ClusterContext(assignmentSet, 2); Assert.assertEquals(context.getEstimatedMaxPartitionCount(), 3); Assert.assertEquals(context.getEstimatedMaxTopStateCount(), 2); Assert.assertEquals(context.getAssignmentForFaultZoneMap(), Collections.emptyMap()); for (String resourceName : _resourceNames) { Assert.assertEquals(context.getEstimatedMaxPartitionByResource(resourceName), 2); Assert.assertEquals( context.getPartitionsForResourceAndFaultZone(_testFaultZoneId, resourceName), Collections.emptySet()); } Map<String, Map<String, Set<String>>> expectedFaultZoneMap = Collections .singletonMap(_testFaultZoneId, assignmentSet.stream().collect(Collectors .groupingBy(AssignableReplica::getResourceName, Collectors.mapping(AssignableReplica::getPartitionName, toSet())))); <START> assignmentSet.stream().forEach(r -> context <END> .addPartitionToFaultZone(_testFaultZoneId, r.getResourceName(), r.getPartitionName())); Assert.assertEquals(context.getAssignmentForFaultZoneMap(), expectedFaultZoneMap); Assert.assertTrue(expectedFaultZoneMap.get(_testFaultZoneId).get(_resourceNames.get(0)) .remove(_partitionNames.get(0))); context.removePartitionFromFaultZone(_testFaultZoneId, _resourceNames.get(0), _partitionNames.get(0)); Assert.assertEquals(context.getAssignmentForFaultZoneMap(), expectedFaultZoneMap); }</code><technical_language>Nit: spell out r -> assignableReplica for readability</technical_language>

Target:
public void testNormalUsage() throws IOException { ResourceControllerDataProvider testCache = setupClusterDataCache(); Set<AssignableReplica> assignmentSet = generateReplicas(testCache); ClusterContext context = new ClusterContext(assignmentSet, 2); Assert.assertEquals(context.getEstimatedMaxPartitionCount(), 3); Assert.assertEquals(context.getEstimatedMaxTopStateCount(), 2); Assert.assertEquals(context.getAssignmentForFaultZoneMap(), Collections.emptyMap()); for (String resourceName : _resourceNames) { Assert.assertEquals(context.getEstimatedMaxPartitionByResource(resourceName), 2); Assert.assertEquals( context.getPartitionsForResourceAndFaultZone(_testFaultZoneId, resourceName), Collections.emptySet()); } Map<String, Map<String, Set<String>>> expectedFaultZoneMap = Collections .singletonMap(_testFaultZoneId, assignmentSet.stream().collect(Collectors .groupingBy(AssignableReplica::getResourceName, Collectors.mapping(AssignableReplica::getPartitionName, Collectors.toSet())))); assignmentSet.stream().forEach(replica -> context .addPartitionToFaultZone(_testFaultZoneId, replica.getResourceName(), replica.getPartitionName())); Assert.assertEquals(context.getAssignmentForFaultZoneMap(), expectedFaultZoneMap); expectedFaultZoneMap.get(_testFaultZoneId).get(_resourceNames.get(0)) .remove(_partitionNames.get(0)); Assert.assertTrue(context.removePartitionFromFaultZone(_testFaultZoneId, _resourceNames.get(0), _partitionNames.get(0))); Assert.assertEquals(context.getAssignmentForFaultZoneMap(), expectedFaultZoneMap); }
Source:
<code>private void transferOut(String inetnum, final String overrideLine) { try { WhoisResources resp = RestTest.target(getPort(), "whois/transfer/inetnum/", "override=" + SyncUpdateUtils.encode(overrideLine), null) .path(URLEncoder.encode(inetnum, "UTF-8")) .request(MediaType.APPLICATION_JSON_TYPE) .delete(WhoisResources.class); printErrorMessage(resp); } catch (ClientErrorException exc) { printErrorMessage(exc.getResponse().readEntity(WhoisResources.class)); throw exc; } catch (WebApplicationException e) { System.out.println("-------------------------"); <START> System.out.println(e.getResponse().readEntity(String.class)); <END> System.out.println("-------------------------"); throw e; } catch (UnsupportedEncodingException e) { fail(e.getMessage()); } }</code><technical_language>remove sysout lines</technical_language>

Target:
private void transferOut(String inetnum, final String overrideLine) { try { WhoisResources resp = RestTest.target(getPort(), "whois/transfer/inetnum/", "override=" + SyncUpdateUtils.encode(overrideLine), null) .path(URLEncoder.encode(inetnum, "UTF-8")) .request(MediaType.APPLICATION_JSON_TYPE) .delete(WhoisResources.class); printErrorMessage(resp); } catch (ClientErrorException exc) { printErrorMessage(exc.getResponse().readEntity(WhoisResources.class)); throw exc; } catch (WebApplicationException e) { fail(e.getResponse().readEntity(String.class)); throw e; } catch (UnsupportedEncodingException e) { fail(e.getMessage()); } }
Source:
<code>public void updateMappedStrings() { if (_alreadyUpdating) { return; } <START> SwingUtilities.invokeLater(new Runnable() { <END> @Override public void run() { _alreadyUpdating = true; onConfigurationChanged(null); setMappedStrings(null); _mappedStringsPropertyWidget.fireValueChanged(); _alreadyUpdating = false; } }); }</code><technical_language>replaced lambda</technical_language>

Target:
public void updateMappedStrings() { if (_alreadyUpdating) { return; } SwingUtilities.invokeLater(() -> { _alreadyUpdating = true; onConfigurationChanged(null); setMappedStrings(null); _mappedStringsPropertyWidget.fireValueChanged(); _alreadyUpdating = false; }); }
Source:
<code>public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAccessingDbWithQueryBlocking() { final StorIOSQLite storIOSQLite = mock(StorIOSQLite.class); final StorIOSQLite.Internal internal = mock(StorIOSQLite.Internal.class); when(storIOSQLite.get()).thenReturn(new PreparedGet.Builder(storIOSQLite)); when(storIOSQLite.internal()).thenReturn(internal); final PreparedGet<TestItem> preparedGet = storIOSQLite .get() .object(TestItem.class) .withQuery(Query.builder().table("test_table").build()) .prepare(); try { preparedGet.executeAsBlocking(); failBecauseExceptionWasNotThrown(StorIOException.class); } catch (StorIOException expected) { assertThat(expected).hasCauseInstanceOf(IllegalStateException.class); <START> } <END> verify(storIOSQLite).get(); verify(storIOSQLite).internal(); verify(internal).typeMapping(TestItem.class); verify(internal, never()).query(any(Query.class)); verifyNoMoreInteractions(storIOSQLite, internal); }</code><technical_language>check exception message too</technical_language>

Target:
public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAccessingDbWithQueryBlocking() { final StorIOSQLite storIOSQLite = mock(StorIOSQLite.class); final StorIOSQLite.Internal internal = mock(StorIOSQLite.Internal.class); when(storIOSQLite.get()).thenReturn(new PreparedGet.Builder(storIOSQLite)); when(storIOSQLite.internal()).thenReturn(internal); final PreparedGet<TestItem> preparedGet = storIOSQLite .get() .object(TestItem.class) .withQuery(Query.builder().table("test_table").build()) .prepare(); try { preparedGet.executeAsBlocking(); failBecauseExceptionWasNotThrown(StorIOException.class); } catch (StorIOException expected) { assertThat(expected).hasCauseInstanceOf(IllegalStateException.class); assertThat(expected.getCause()).hasMessage("This type does not have type mapping: " + "type = " + TestItem.class + "," + "db was not touched by this operation, please add type mapping for this type"); } verify(storIOSQLite).get(); verify(storIOSQLite).internal(); verify(internal).typeMapping(TestItem.class); verify(internal, never()).query(any(Query.class)); verifyNoMoreInteractions(storIOSQLite, internal); }
Source:
<code>final public double calcOutput(Double in) { double c = 0.0; <START> <END> if (in == null) { log.warn("calcOutput(null)"); return c; } boolean willCalculate = (minX != null && maxX != null && minY != null && maxY != null); if (minInput != null && in < minInput) { log.warn("clipping input to {}", in, minInput); in = minInput; } if (maxInput != null && in > maxInput) { log.warn("clipping input to {}", in, maxInput); in = maxInput; } if (willCalculate) { if (maxX - minX == 0) { log.error("maxX - minX divide by zero error in calcOutput"); return 0.0; } if (!inverted) { c = minY + ((in - minX) * (maxY - minY)) / (maxX - minX); } else { c = minY + ((in - maxX) * (maxY - minY)) / (minX - maxX); } } else { log.error("mapping values are not set - will not calculate"); } if (minOutput != null && c < minOutput) { log.warn("clipping output to {}", c, minOutput); return minOutput; } if (maxOutput != null && c > maxOutput) { log.warn("clipping output to {}", c, maxOutput); return maxOutput; } return c; }</code><technical_language>alternative throw exception if input is null. Changing "double" prevent null input in java, (but protect do python.)</technical_language>

Target:
final public Double calcOutput(Double in) { double c = 0.0; if (in == null) { log.warn("calcOutput(null)"); return c; } boolean willCalculate = (minX != null && maxX != null && minY != null && maxY != null); if (willCalculate) { if (maxX - minX == 0) { log.error("maxX - minX divide by zero error in calcOutput"); return 0.0; } if (!inverted) { c = minY + ((in - minX) * (maxY - minY)) / (maxX - minX); } else { c = minY + ((in - maxX) * (maxY - minY)) / (minX - maxX); } } else { log.error("mapping values are not set - will not calculate"); } if (this.min != null && c < this.min) { log.warn("clipping output to {}", c, this.min); return this.min; } if (this.max != null && c > this.max) { log.warn("clipping output to {}", c, this.max); return this.max; } return c; }
Source:
<code>public static boolean stIsValid(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { <START> return GeometryJtsUtils.deserialize(input).isValid(); <END> }</code><technical_language>deserialize return null</technical_language>

Target:
public static boolean stIsValid(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { return JtsGeometryUtils.deserialize(input).isValid(); }
Source:
<code>public Stand get(final String name) { try { return new RestStand( <START> new JdkRequest(UriBuilder.fromUri(this.home).build()) <END> .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath( String.format( "/page/stands/stand[name='%s']/links/link[@rel='edit']/@href", name ) ) .get(0), this.token ); } catch (IOException ex) { throw new IllegalStateException(ex); } }</code><technical_language>need UriBuilder</technical_language>

Target:
public Stand get(final String name) { try { return new RestStand( new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath( String.format( "/page/stands/stand[name='%s']/links/link[@rel='edit']/@href", name ) ) .get(0), this.token ); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
<code>public static InternalObjectNode fromObjectToInternalObjectNode(Object cosmosItem) { if (cosmosItem instanceof InternalObjectNode) { <START> return new InternalObjectNode(((InternalObjectNode) cosmosItem).toJson()); <END> } else if (cosmosItem instanceof byte[]) { return new InternalObjectNode((byte[]) cosmosItem); } else { try { return new InternalObjectNode(InternalObjectNode.MAPPER.writeValueAsString(cosmosItem)); } catch (IOException e) { throw new IllegalArgumentException("Can't serialize the object into the json string", e); } } }</code><technical_language>suggestion return cosmosItem; this if branch item is InternalObjectNode need serialze deserialize again</technical_language>

Target:
public static InternalObjectNode fromObjectToInternalObjectNode(Object cosmosItem) { if (cosmosItem instanceof InternalObjectNode) { return (InternalObjectNode) cosmosItem; } else if (cosmosItem instanceof byte[]) { return new InternalObjectNode((byte[]) cosmosItem); } else { try { return new InternalObjectNode(InternalObjectNode.MAPPER.writeValueAsString(cosmosItem)); } catch (IOException e) { throw new IllegalArgumentException("Can't serialize the object into the json string", e); } } }
Source:
<code>public static DeleteRecord deserializeDeleteRecord(CrcInputStream crcStream) throws IOException, MessageFormatException { DataInputStream dataStream = new DataInputStream(crcStream); short accountId = dataStream.readShort(); short containerId = dataStream.readShort(); int deletionTimeInSecs = dataStream.readInt(); long actualCRC = crcStream.getValue(); long expectedCRC = dataStream.readLong(); if (actualCRC != expectedCRC) { <START> logger.error( <END> "corrupt data while parsing delete record V2 Expected CRC " + expectedCRC + " Actual CRC " + actualCRC); throw new MessageFormatException("delete record data is corrupt", MessageFormatErrorCodes.Data_Corrupt); } return new DeleteRecord(accountId, containerId, deletionTimeInSecs); }</code><technical_language>is exception thrown, is need log error. Otherwise, double logging</technical_language>

Target:
public static DeleteRecord deserializeDeleteRecord(CrcInputStream crcStream) throws IOException, MessageFormatException { DataInputStream dataStream = new DataInputStream(crcStream); short accountId = dataStream.readShort(); short containerId = dataStream.readShort(); long deletionTimeInMs = dataStream.readLong(); long actualCRC = crcStream.getValue(); long expectedCRC = dataStream.readLong(); if (actualCRC != expectedCRC) { throw new MessageFormatException("delete record data is corrupt (mismatch in CRC) ", MessageFormatErrorCodes.Data_Corrupt); } return new DeleteRecord(accountId, containerId, deletionTimeInMs); }
Source:
<code><START> public boolean canTake(BuildableItem item) { <END> Node node = getNode(); if (node==null) return false; if(node.canTake(item)!=null) return false; for (QueueTaskDispatcher d : QueueTaskDispatcher.all()) if (d.canTake(node,item)!=null) return false; return isAvailable(); }</code><technical_language>logic replaced return getCauseOfBlockage (item) == null</technical_language>

Target:
public boolean canTake(BuildableItem item) { return getCauseOfBlockage(item) == null; }
Source:
<code>private boolean segmentsFilePredicate( String fileName ) { <START> return fileName.contains( "segments_" ); <END> }</code><technical_language>compare absolute paths I safer return new File(fileName).getName().startsWith( org.apache.lucene.index.IndexFileNames.SEGMENTS ); avoid false positives</technical_language>

Target:
private boolean segmentsFilePredicate( String fileName ) { return FilenameUtils.getName( fileName ).startsWith( IndexFileNames.SEGMENTS ); }
Source:
<code>public void processElement(ProcessContext c) { KV<KV<String, String>, KV<Double, Integer>> result = c.element(); String call1 = result.getKey().getKey(); String call2 = result.getKey().getValue(); Double sumOfRatios = result.getValue().getKey(); int numberOfRatios = result.getValue().getValue(); <START> c.output(call1 + "\t" + call2 + "\t" + sumOfRatios / numberOfRatios + "\t" + sumOfRatios + "\t" + numberOfRatios); <END> }</code><technical_language>consider a Joiner here: c.output(Joiner.on('\t').join(call1, call2, sumOfRatios / numberOfRatios, sumOfRatios, numberOfRatios));</technical_language>

Target:
public void processElement(ProcessContext c) { KV<KV<String, String>, KV<Double, Integer>> result = c.element(); String call1 = result.getKey().getKey(); String call2 = result.getKey().getValue(); Double sumOfRatios = result.getValue().getKey(); int numberOfRatios = result.getValue().getValue(); c.output(Joiner.on('\t').join(call1, call2, sumOfRatios / numberOfRatios, sumOfRatios, numberOfRatios)); }
Source:
<code>public void init(ServletConfig servletConfig) throws ServletException { CurrentInstance.clearAll(); <START> if (getServletConfig() == null) { <END> super.init(servletConfig); } ServletContext servletContext = getServletConfig().getServletContext(); if (new VaadinServletContext(servletContext) .getAttribute(Lookup.class) == null) { return; } if (servletService == null) { try { servletService = createServletService(); } catch (ServiceException e) { throw new ServletException("Could not initialize VaadinServlet", e); } servletService.setCurrentInstances(null, null); staticFileHandler = createStaticFileHandler(servletService); servletInitialized(); } CurrentInstance.clearAll(); }</code><technical_language>init is called container this called more once. I reason overriding init(ServletConfig) get config override init() get config getServletConfig() call super.init</technical_language>

Target:
public void init(ServletConfig servletConfig) throws ServletException { CurrentInstance.clearAll(); try { if (getServletConfig() == null) { super.init(servletConfig); } if (getServletConfig() != servletConfig) { throw new IllegalArgumentException( "Servlet config instance may not differ from the " + "instance which has been used for the initial method call"); } ServletContext servletContext = getServletConfig() .getServletContext(); if (servletService != null || new VaadinServletContext(servletContext) .getAttribute(Lookup.class) == null) { return; } try { servletService = createServletService(); } catch (ServiceException e) { throw new ServletException("Could not initialize VaadinServlet", e); } servletService.setCurrentInstances(null, null); staticFileHandler = createStaticFileHandler(servletService); servletInitialized(); } finally { CurrentInstance.clearAll(); } }
Source:
<code><START> public void testMaxContainerResource() { final TaskExecutorProcessSpecContainerResourcePriorityAdapter adapter = new TaskExecutorProcessSpecContainerResourcePriorityAdapter( 1, Resource.newInstance(100, 1), Collections.emptyMap()); assertThat(adapter.getResource(TASK_EXECUTOR_PROCESS_SPEC_2).isPresent(), is(false)); assertThat(adapter.getPriority(TASK_EXECUTOR_PROCESS_SPEC_2).isPresent(), is(false)); <END> }</code><technical_language>getAdapter here. need a TASK_EXECUTOR_PROCESS_SPEC_3 CPUResource 300</technical_language>

Target:
public void testMaxContainerResource() { final TaskExecutorProcessSpecContainerResourcePriorityAdapter adapter = getAdapter(); assertThat(adapter.getPriorityAndResource(TASK_EXECUTOR_PROCESS_SPEC_EXCEED_MAX).isPresent(), is(false)); }
Source:
<code>private void writeBatchRetryingUpToFiveTimes(PaxosStateLog<V> target, List<PaxosRound<V>> batch) { for (int retryCount = 0; retryCount < 5; retryCount++) { try { target.writeBatchOfRounds(batch); return; } catch (Exception e) { <START> Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS); <END> } } target.writeBatchOfRounds(batch); }</code><technical_language>For debugging: sense log exceptions here</technical_language>

Target:
private void writeBatchRetryingUpToFiveTimes(PaxosStateLog<V> target, List<PaxosRound<V>> batch) { for (int retryCount = 0; retryCount < 5; retryCount++) { try { target.writeBatchOfRounds(batch); return; } catch (Exception e) { log.info("Failed to write a migration batch. Retrying after backoff.", e); Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS); } } target.writeBatchOfRounds(batch); }
Source:
<code>public CloudDataNodeTest() { Properties props = new Properties(); props.setProperty("clustermap.host.name", "localhost"); props.setProperty("clustermap.cluster.name", "clusterName"); props.setProperty("clustermap.datacenter.name", "DC1"); props.setProperty("clustermap.ssl.enabled.datacenters", "DC0,DC1"); props.setProperty("clustermap.port", "12300"); clusterMapConfig = new ClusterMapConfig(new VerifiableProperties(props)); props = new Properties(); <START> props.setProperty("vcr.ssl.port", "12301"); <END> props.setProperty("vcr.cluster.name", "VCRCluster"); cloudConfig = new CloudConfig(new VerifiableProperties(props)); }</code><technical_language>static strings</technical_language>

Target:
public CloudDataNodeTest() { Properties props = new Properties(); props.setProperty("clustermap.host.name", "localhost"); props.setProperty("clustermap.cluster.name", "clusterName"); props.setProperty("clustermap.datacenter.name", "DC1"); props.setProperty("clustermap.ssl.enabled.datacenters", "DC0,DC1"); props.setProperty("clustermap.port", "12300"); clusterMapConfig = new ClusterMapConfig(new VerifiableProperties(props)); props = new Properties(); cloudConfig = new CloudConfig(new VerifiableProperties(props)); }
Source:
<code><START> public ChangeAssetOrder(final List<String> assetOrder) { <END> super("changeAssetOrder"); this.assetOrder = assetOrder; }</code><technical_language>Constructor private a static constructor (of method)</technical_language>

Target:
private ChangeAssetOrder(final List<String> assetOrder) { super("changeAssetOrder"); this.assetOrder = assetOrder; }
Source:
<code>private boolean showNotes(RevCommit c, NoteMap map, String label, boolean emptyLine) throws IOException { ObjectId blobId = map.get(c); if (blobId == null) return false; if (emptyLine) out.println(); out.print("Notes"); if (label != null) { out.print(" ("); out.print(label); out.print(")"); } out.println(":"); RawText rawText = new RawText(argWalk.getObjectReader().open(blobId) <START> .getBytes()); <END> for (int i = 0; i < rawText.size(); i++) { out.print(" "); out.println(rawText.getString(i)); } return true; }</code><technical_language>pass Integer.MAX_VALUE getBytes(). This is needed allow opening a note is large, 12 MiB worth of text. happen, if do a good effort displaying it. note is bigger default size passed here, throw LargeObjectException. want trap display a warning note is big display? getCachedBytes() avoid copying</technical_language>

Target:
private boolean showNotes(RevCommit c, NoteMap map, String label, boolean emptyLine) throws IOException { ObjectId blobId = map.get(c); if (blobId == null) return false; if (emptyLine) out.println(); out.print("Notes"); if (label != null) { out.print(" ("); out.print(label); out.print(")"); } out.println(":"); try { RawText rawText = new RawText(argWalk.getObjectReader() .open(blobId).getCachedBytes(Integer.MAX_VALUE)); for (int i = 0; i < rawText.size(); i++) { out.print(" "); out.println(rawText.getString(i)); } } catch (LargeObjectException e) { out.println(MessageFormat.format( CLIText.get().noteObjectTooLargeToPrint, blobId.name())); } return true; }
Source:
<code>public void assertContinue() throws StoreCopyFailedException { long currentTime = clock.millis(); if ( timeHasExpired( previousCheck, currentTime ) ) { tries++; } <START> previousCheck = currentTime; <END> if ( tries >= maxRetries ) { throw new StoreCopyFailedException( "Maximum allowed retries exceeded: " + maxRetries ); } }</code><technical_language>This mistakenly moved</technical_language>

Target:
public void assertContinue() throws StoreCopyFailedException { long currentTime = clock.millis(); if ( timeHasExpired( previousCheck, currentTime ) ) { tries++; previousCheck = currentTime; } if ( tries >= maxRetries ) { throw new StoreCopyFailedException( "Maximum allowed retries exceeded: " + maxRetries ); } }
Source:
<code>protected void doCall() { long locateTimeoutNs; if (operationTimeoutNs > 0) { locateTimeoutNs = remainingTimeNs(); if (locateTimeoutNs <= 0) { completeExceptionally(); return; } } else { locateTimeoutNs = -1L; } <START> if (loc == null) { <END> addListener(conn.getLocator() .getRegionLocation(tableName, row, replicaId, RegionLocateType.CURRENT, locateTimeoutNs), (loc, error) -> { if (error != null) { onError(error, () -> "Locate '" + Bytes.toStringBinary(row) + "' in " + tableName + " failed", err -> { }); return; } call(loc); }); } else { call(this.loc); } }</code><technical_language>Yeah, wondering mechanism apply here</technical_language>

Target:
protected void doCall() { long locateTimeoutNs; if (operationTimeoutNs > 0) { locateTimeoutNs = remainingTimeNs(); if (locateTimeoutNs <= 0) { completeExceptionally(); return; } } else { locateTimeoutNs = -1L; } addListener(conn.getLocator().getRegionLocation(tableName, row, replicaId, RegionLocateType.CURRENT, locateTimeoutNs), (loc, error) -> { if (error != null) { onError(error, () -> "Locate '" + Bytes.toStringBinary(row) + "' in " + tableName + " failed", err -> { }); return; } call(loc); }); }
Source:
<code>private <T> T getService(Class<T> clazz) { @SuppressWarnings("unchecked") <START> T service = (T) services.get(clazz); <END> return service; }</code><technical_language>remove unchecked warning doing: T service = clazz.cast(services.get(clazz));</technical_language>

Target:
private <T> T getService(Class<T> clazz) { T service = clazz.cast(services.get(clazz)); return service; }
Source:
<code>protected Map<String, String> getExclusiveLocks() { <START> if (!getParameters().isNested()) { <END> return Collections.singletonMap(getVdsGroupId().toString(), LockingGroup.GLUSTER.name()); } return super.getExclusiveLocks(); }</code><technical_language>Yair reminded do method isInternalExecution() is true command calls another, (should always) runInternalAction</technical_language>

Target:
protected Map<String, String> getExclusiveLocks() { if (!isInternalExecution()) { return Collections.singletonMap(getVdsGroupId().toString(), LockingGroup.GLUSTER.name()); } return super.getExclusiveLocks(); }
Source:
<code>protected String getTraceCannotExecuteHelpText(ITmfTrace trace) { <START> return "Cannot perform the analysis on this trace because the trace does not have the required characteristics"; END> }</code><technical_language>externalize string</technical_language>

Target:
protected String getTraceCannotExecuteHelpText(ITmfTrace trace) { return Messages.TmfAbstractAnalysisModule_AnalysisCannotExecute; }
Source:
<code>public DruidCoordinatorRuntimeParams run(DruidCoordinatorRuntimeParams params) { CoordinatorStats stats = new CoordinatorStats(); if (params.hasDeletionWaitTimeElapsed()) { DruidCluster cluster = params.getDruidCluster(); Map<String, VersionedIntervalTimeline<String, DataSegment>> timelines = Maps.newHashMap(); <START> for (NavigableSet<ServerHolder> serverHolders : cluster.getSortedHistoricalsByTier()) { <END> for (ServerHolder serverHolder : serverHolders) { ImmutableDruidServer server = serverHolder.getServer(); for (ImmutableDruidDataSource dataSource : server.getDataSources()) { VersionedIntervalTimeline<String, DataSegment> timeline = timelines.get(dataSource.getName()); if (timeline == null) { timeline = new VersionedIntervalTimeline<>(Comparators.comparable()); timelines.put(dataSource.getName(), timeline); } for (DataSegment segment : dataSource.getSegments()) { timeline.add( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(segment) ); } } } } for (DataSegment dataSegment : params.getAvailableSegments()) { VersionedIntervalTimeline<String, DataSegment> timeline = timelines.get(dataSegment.getDataSource()); if (timeline != null && timeline.isOvershadowed(dataSegment.getInterval(), dataSegment.getVersion())) { coordinator.removeSegment(dataSegment); stats.addToGlobalStat("overShadowedCount", 1); } } } return params.buildFromExisting() .withCoordinatorStats(stats) .build(); }</code><technical_language>(Optional) this need other Collection<ServerHolder></technical_language>

Target:
public DruidCoordinatorRuntimeParams run(DruidCoordinatorRuntimeParams params) { CoordinatorStats stats = new CoordinatorStats(); if (params.hasDeletionWaitTimeElapsed()) { DruidCluster cluster = params.getDruidCluster(); Map<String, VersionedIntervalTimeline<String, DataSegment>> timelines = Maps.newHashMap(); for (SortedSet<ServerHolder> serverHolders : cluster.getSortedHistoricalsByTier()) { for (ServerHolder serverHolder : serverHolders) { ImmutableDruidServer server = serverHolder.getServer(); for (ImmutableDruidDataSource dataSource : server.getDataSources()) { VersionedIntervalTimeline<String, DataSegment> timeline = timelines.get(dataSource.getName()); if (timeline == null) { timeline = new VersionedIntervalTimeline<>(Comparators.comparable()); timelines.put(dataSource.getName(), timeline); } for (DataSegment segment : dataSource.getSegments()) { timeline.add( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(segment) ); } } } } for (DataSegment dataSegment : params.getAvailableSegments()) { VersionedIntervalTimeline<String, DataSegment> timeline = timelines.get(dataSegment.getDataSource()); if (timeline != null && timeline.isOvershadowed(dataSegment.getInterval(), dataSegment.getVersion())) { coordinator.removeSegment(dataSegment); stats.addToGlobalStat("overShadowedCount", 1); } } } return params.buildFromExisting() .withCoordinatorStats(stats) .build(); }
Source:
<code>private IncrementalIndex makeIncIndex() { return new OnheapIncrementalIndex.Builder() .setIncrementalIndexSchema( new IncrementalIndexSchema.Builder() .withMinTimestamp(0) .withQueryGranularity(Granularities.NONE) .withMetrics(aggs) <START> .withRollup(IncrementalIndexSchema.DEFAULT_ROLLUP) <END> .build() ) .setDeserializeComplexMetrics(false) .setReportParseExceptions(false) .setMaxRowCount(maxRows) .build(); }</code><technical_language>DEFAULT_ROLLUP (true) is set default in builder, need explicitly</technical_language>

Target:
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(aggs) .setDeserializeComplexMetrics(false) .setReportParseExceptions(false) .setMaxRowCount(maxRows) .buildOnheap(); }