auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public ContainerDropDescription createContainerDropDescription() { <END> ContainerDropDescriptionImpl containerDropDescription = new ContainerDropDescriptionImpl(); return containerDropDescription; }</code><technical_language>Lost @not-generated code</technical_language>

Target:
public ContainerDropDescription createContainerDropDescription() { ContainerDropDescriptionImpl containerDropDescription = new ContainerDropDescriptionSpec(); DropContainerVariable oldContainerVariable = createDropContainerVariable(); oldContainerVariable.setName("oldSemanticContainer"); DropContainerVariable newContainerVariable = createDropContainerVariable(); newContainerVariable.setName("newSemanticContainer"); ElementDropVariable elementDropVariable = createElementDropVariable(); elementDropVariable.setName("element"); ContainerViewVariable containerViewVariable = createContainerViewVariable(); containerViewVariable.setName("newContainerView"); containerDropDescription.setElement(elementDropVariable); containerDropDescription.setNewContainer(newContainerVariable); containerDropDescription.setNewViewContainer(containerViewVariable); containerDropDescription.setOldContainer(oldContainerVariable); InitialContainerDropOperation init = createInitialContainerDropOperation(); containerDropDescription.setInitialOperation(init); return containerDropDescription; }
Source:
<code>public void changeStudyForAdmin() throws Exception { doReturn(session).when(controller).getAuthenticatedSession(Roles.ADMIN); SignIn signIn = new SignIn.Builder().withStudy("nextStudy").build(); TestUtils.mockPlayContextWithJson(signIn); Study nextStudy = Study.create(); nextStudy.setIdentifier("nextStudy"); when(studyService.getStudy("nextStudy")).thenReturn(nextStudy); controller.changeStudyForAdmin(); assertEquals("nextStudy", session.getStudyIdentifier().getIdentifier()); <START> verify(cacheProvider).setUserSession(session); <END> }</code><technical_language>Do want verify sessionUpdateService called</technical_language>

Target:
public void changeStudyForAdmin() throws Exception { doReturn(session).when(controller).getAuthenticatedSession(Roles.ADMIN); SignIn signIn = new SignIn.Builder().withStudy("nextStudy").build(); Response response = TestUtils.mockPlayContextWithJson(signIn); Study nextStudy = Study.create(); nextStudy.setIdentifier("nextStudy"); when(studyService.getStudy("nextStudy")).thenReturn(nextStudy); controller.changeStudyForAdmin(); assertEquals("nextStudy", session.getStudyIdentifier().getIdentifier()); verify(cacheProvider).setUserSession(session); }
Source:
<code>private int readNoFilter(int[] positions, int positionCount) throws IOException { int streamPosition = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { values[i] = dictionaryBlock.getPositionCount() - 1; } else { boolean isInRowDictionary = inDictionaryStream != null && !inDictionaryStream.nextBit(); int index = toIntExact(dataStream.next()); values[i] = isInRowDictionary ? stripeDictionarySize + index : index; } streamPosition++; } <START> outputPositions = positions; <END> outputPositionCount = positionCount; return streamPosition; }</code><technical_language>in direct reader remove outputPositions = positions; add outputPositionsReadOnly = true;</technical_language>

Target:
private int readNoFilter(int[] positions, int positionCount) throws IOException { int streamPosition = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { values[i] = dictionaryBlock.getPositionCount() - 1; } else { boolean isInRowDictionary = inDictionaryStream != null && !inDictionaryStream.nextBit(); int index = toIntExact(dataStream.next()); values[i] = isInRowDictionary ? stripeDictionarySize + index : index; } streamPosition++; } outputPositionCount = positionCount; return streamPosition; }
Source:
<code>public Page getOutput() { if (!isBlocked().isDone()) { return null; } if (state != State.FINISHING) { return null; } state = State.FINISHED; List<ComputedStatistics> statistics = getComputedStatistics(); <START> System.out.println(statistics); <END> outputMetadata = tableFinisher.finishTable(fragmentBuilder.build()); PageBuilder page = new PageBuilder(1, TYPES); page.declarePosition(); BIGINT.writeLong(page.getBlockBuilder(0), rowCount); return page.build(); }</code><technical_language>leftover debugging line? statistics else. confused this works</technical_language>

Target:
public Page getOutput() { if (!isBlocked().isDone()) { return null; } if (state != State.FINISHING) { return null; } state = State.FINISHED; List<ComputedStatistics> statistics = getComputedStatistics(); outputMetadata = tableFinisher.finishTable(fragmentBuilder.build(), statistics); PageBuilder page = new PageBuilder(1, TYPES); page.declarePosition(); BIGINT.writeLong(page.getBlockBuilder(0), rowCount); return page.build(); }
Source:
<code>protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { if (fModules == null) { return; } double[] xAxis = getXAxis(start, end, nb); setXAxis(xAxis); for (CounterAnalysis analysis : fModules) { ITmfStateSystem ss = analysis.getStateSystem(); if (ss == null) { continue; } for (Integer quark : CounterAnalysisView.getQuarks()) { try { <START> double[] steps = new double[xAxis.length]; <END> ITmfStateValue prev = ss.querySingleState(Math.max(ss.getStartTime(), (long) (start - (xAxis[1]))), quark).getStateValue(); for (int i = 0; i < xAxis.length; i++) { ITmfStateValue next = ss.querySingleState(start + (long) xAxis[i] - 1, quark).getStateValue(); long stateValue = prev.isNull() ? next.unboxLong() : next.unboxLong() - prev.unboxLong(); steps[i] = next.isNull() ? 0 : stateValue; prev = next; } String seriesName = createSeriesName(ss, quark); setSeries(seriesName, steps); } catch (StateSystemDisposedException e) { e.printStackTrace(); } } } updateDisplay(); }</code><technical_language>changes belong in initial patch? this problem happen checkbox tree viewer</technical_language>

Target:
protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { if (fModule == null) { return; } ITmfStateSystem ss = fModule.getStateSystem(); if (ss == null) { return; } double[] xAxis = getXAxis(start, end, nb); if (xAxis.length == 1) { return; } setXAxis(xAxis); for (Integer quark : fQuarks) { try { double[] steps = new double[xAxis.length]; ITmfStateValue prev = ss.querySingleState(Math.max(ss.getStartTime(), (long) (start - (xAxis[1]))), quark).getStateValue(); for (int i = 0; i < xAxis.length; i++) { ITmfStateValue next = ss.querySingleState(start + (long) xAxis[i] - 1, quark).getStateValue(); long stateValue = prev.isNull() ? next.unboxLong() : next.unboxLong() - prev.unboxLong(); steps[i] = next.isNull() ? 0 : stateValue; prev = next; } setSeries(createSeriesName(ss, quark), steps); } catch (StateSystemDisposedException e) { } } updateDisplay(); }
Source:
<code>private void storeInputConnectors(final Model model, final Instance widget) { final List<Instance> connectors = widget.get("inputConnectors"); if (!connectors.isEmpty()) { final Instance instance = connectors.get(0); initialValueConnectors.put(widget.getUuid(), instance.copy()); <START> if (connectors.size() > 1) { <END> for (int i = 1; i < connectors.size(); i++) { final Instance connectorInstance = connectors.get(i); addReportChange((String) connectorInstance.get("name"), connectorInstance.getType().getEClass().getName(), connectorInstance.getUuid(), Messages.widgetDataInputMigrationDescription, Messages.connectorProperty, IStatus.ERROR); model.delete(connectorInstance); } } } }</code><technical_language>I I extract a method removeExtraConnectors in order understanding</technical_language>

Target:
private void storeInputConnectors(final Model model, final Instance widget) { final List<Instance> connectors = widget.get("inputConnectors"); if (!connectors.isEmpty()) { final Instance instance = connectors.get(0); initialValueConnectors.put(widget.getUuid(), instance.copy()); removeExtraConnectors(model, connectors, Messages.widgetDataInputMigrationDescription); } }
Source:
<code>public void synchronize() throws FormAPIError { ServerFormsDetailsFetcher listDownloader = new ServerFormsDetailsFetcher(formRepository, mediaFileRepository, formAPI); List<FormDetails> formList = listDownloader.fetchFormDetails(); List<Form> formsOnDevice = formRepository.getAll(); <START> formsOnDevice.stream().forEach(form -> { <END> if (formList.stream().noneMatch(f -> form.getJrFormId().equals(f.getFormId()))) { formRepository.delete(form.getId()); } }); for (FormDetails form : formList) { boolean onDevice = formsOnDevice.stream().anyMatch(f -> f.getJrFormId().equals(form.getFormId())); if (!onDevice || form.isNewerFormVersionAvailable() || form.areNewerMediaFilesAvailable()) { formDownloader.downloadForm(form); } } }</code><technical_language>This is n^2, right? lists small in this case I ok careful if similar e.g. instances some point. I feel streams hide complexity in a kind of scary sometimes</technical_language>

Target:
public void synchronize() throws FormApiException { ServerFormsDetailsFetcher listDownloader = new ServerFormsDetailsFetcher(formRepository, mediaFileRepository, formListAPI); List<ServerFormDetails> formList = listDownloader.fetchFormDetails(); List<Form> formsOnDevice = formRepository.getAll(); formsOnDevice.stream().forEach(form -> { if (formList.stream().noneMatch(f -> form.getJrFormId().equals(f.getFormId()))) { formRepository.delete(form.getId()); } }); for (ServerFormDetails form : formList) { boolean onDevice = formsOnDevice.stream().anyMatch(f -> f.getJrFormId().equals(form.getFormId())); if (!onDevice || form.isNewerFormVersionAvailable() || form.areNewerMediaFilesAvailable()) { formDownloader.downloadForm(form); } } }
Source:
<code>public void schedule(Topologies topologies, Cluster cluster) { Map<String, User> userMap = getUsers(cluster); List<TopologyDetails> orderedTopologies = new ArrayList<>(schedulingPriorityStrategy.getOrderedTopologies(cluster, userMap)); evictedTopologies.clear(); if (LOG.isDebugEnabled()) { LOG.debug("Ordered list of topologies is: {}", orderedTopologies.stream().map((t) -> t.getId()).collect(Collectors.toList())); } for (TopologyDetails td : orderedTopologies) { if (!cluster.needsSchedulingRas(td)) { cluster.setStatusIfAbsent(td.getId(), "Fully Scheduled"); } else { User submitter = userMap.get(td.getTopologySubmitter()); scheduleTopology(td, cluster, submitter, orderedTopologies); if (!evictedTopologies.isEmpty()) { <START> LOG.warn("Evicted Topologies when scheduling topology: {}", evictedTopologies, td.getId()); <END> } } } }</code><technical_language>evictedTopologies is cumulated scheduling topologies clears evictedTopologies Line 111. evictedTopologies include evictedTopologies evicted scheduling this topology td.getId()</technical_language>

Target:
public void schedule(Topologies topologies, Cluster cluster) { Map<String, User> userMap = getUsers(cluster); List<TopologyDetails> orderedTopologies = new ArrayList<>(schedulingPriorityStrategy.getOrderedTopologies(cluster, userMap)); if (LOG.isDebugEnabled()) { LOG.debug("Ordered list of topologies is: {}", orderedTopologies.stream().map((t) -> t.getId()).collect(Collectors.toList())); } Map<String, Set<String>> tmpEvictedTopologiesMap = new HashMap<>(); for (TopologyDetails td : orderedTopologies) { if (!cluster.needsSchedulingRas(td)) { cluster.setStatusIfAbsent(td.getId(), "Fully Scheduled"); } else { User submitter = userMap.get(td.getTopologySubmitter()); scheduleTopology(td, cluster, submitter, orderedTopologies, tmpEvictedTopologiesMap); } } evictedTopologiesMap = tmpEvictedTopologiesMap; }
Source:
<code>protected static ImmutableList<Ds3AnnotationElement> convertAllAnnotationElements( final ImmutableList<Ds3AnnotationElement> annotationElements, final NameMapper nameMapper) { if (annotationElements == null || annotationElements.isEmpty()) { return annotationElements; } <START> ImmutableList.Builder<Ds3AnnotationElement> builder = ImmutableList.builder(); <END> for (final Ds3AnnotationElement annotationElement : annotationElements) { final Ds3AnnotationElement convertedElement = new Ds3AnnotationElement( annotationElement.getName(), convertName(annotationElement.getValue(), nameMapper), convertNameWithDollarSign(annotationElement.getValueType(), nameMapper)); builder.add(convertedElement); } return builder.build(); }</code><technical_language>Missing final</technical_language>

Target:
protected static ImmutableList<Ds3AnnotationElement> convertAllAnnotationElements( final ImmutableList<Ds3AnnotationElement> annotationElements, final NameMapper nameMapper) { if (annotationElements == null || annotationElements.isEmpty()) { return annotationElements; } final ImmutableList.Builder<Ds3AnnotationElement> builder = ImmutableList.builder(); for (final Ds3AnnotationElement annotationElement : annotationElements) { final Ds3AnnotationElement convertedElement = new Ds3AnnotationElement( annotationElement.getName(), convertName(annotationElement.getValue(), nameMapper), convertNameWithDollarSign(annotationElement.getValueType(), nameMapper)); builder.add(convertedElement); } return builder.build(); }
Source:
<code>public void testParameterCollectionSingletonParenthesesAndPositional() { final Item item = new Item( "Mouse", "Micro$oft mouse" ); final Item item2 = new Item( "Computer", "Dell computer" ); EntityManager em = getOrCreateEntityManager(); em.getTransaction().begin(); try { em.persist( item ); em.persist( item2 ); assertTrue( em.contains( item ) ); em.getTransaction().commit(); em.getTransaction().begin(); Query q = em.createQuery( "select item from Item item where item.name in (?1) and item.descr = ?2" ); q.setHint( "org.hibernate.fetchSize", 10 ); <START> q.setHint( "org.hibernate.fetchSize", "10" ); <END> List params = new ArrayList(); params.add( item2.getName() ); q.setParameter( 1, params ); q.setParameter( 2, item2.getDescr() ); List result = q.getResultList(); assertNotNull( result ); assertEquals( 1, result.size() ); } catch (Exception e){ if ( em.getTransaction() != null && em.getTransaction().isActive() ) { em.getTransaction().rollback(); } throw e; } finally { em.close(); } }</code><technical_language>remark hints</technical_language>

Target:
public void testParameterCollectionSingletonParenthesesAndPositional() { final Item item = new Item( "Mouse", "Microsoft mouse" ); final Item item2 = new Item( "Computer", "Dell computer" ); EntityManager em = getOrCreateEntityManager(); em.getTransaction().begin(); try { em.persist( item ); em.persist( item2 ); assertTrue( em.contains( item ) ); em.getTransaction().commit(); em.getTransaction().begin(); Query q = em.createQuery( "select item from Item item where item.name in (?1) and item.descr = ?2" ); List params = new ArrayList(); params.add( item2.getName() ); q.setParameter( 1, params ); q.setParameter( 2, item2.getDescr() ); List result = q.getResultList(); assertNotNull( result ); assertEquals( 1, result.size() ); } catch (Exception e){ if ( em.getTransaction() != null && em.getTransaction().isActive() ) { em.getTransaction().rollback(); } throw e; } finally { em.close(); } }
Source:
<code>public void release() throws IOException { final int counter = mRetainCount.decrementAndGet(); <START> Preconditions.checkState(counter >= 0, "Cannot release resource: retain counter is 0."); <END> if (counter == 0) { close(); } }</code><technical_language>include actual counter in message</technical_language>

Target:
public void release() throws IOException { final int counter = mRetainCount.decrementAndGet(); Preconditions.checkState(counter >= 0, String.format("Cannot release resource: retain counter is %s.", mRetainCount.get())); if (counter == 0) { close(); } }
Source:
<code>public void createAndAddTaskMultisetParam(String queueName, String workerUrl, Map<String, String[]> paramMap) { Queue requiredQueue = QueueFactory.getQueue(queueName); TaskOptions taskToBeAdded = TaskOptions.Builder.withUrl(workerUrl); for (Map.Entry<String, String[]> entry : paramMap.entrySet()) { String name = entry.getKey(); String[] value = entry.getValue(); <START> for (String element : value) { <END> taskToBeAdded = taskToBeAdded.param(name, element); } } requiredQueue.add(taskToBeAdded); }</code><technical_language>naming</technical_language>

Target:
public void createAndAddTaskMultisetParam(String queueName, String workerUrl, Map<String, String[]> paramMap) { Queue requiredQueue = QueueFactory.getQueue(queueName); TaskOptions taskToBeAdded = TaskOptions.Builder.withUrl(workerUrl); for (Map.Entry<String, String[]> entry : paramMap.entrySet()) { String name = entry.getKey(); String[] values = entry.getValue(); for (String value : values) { taskToBeAdded = taskToBeAdded.param(name, value); } } requiredQueue.add(taskToBeAdded); }
Source:
<code>public void serializeThenLoad() throws IOException { final ObjectMapper objectMapper = new ObjectMapper(); <START> final JobKillReasonFile orignalJobKillReasonFile = new JobKillReasonFile("Test"); <END> final byte[] bytes = objectMapper.writeValueAsBytes(orignalJobKillReasonFile); final JobKillReasonFile loadedJobKillReasonFile = objectMapper.readValue(bytes, JobKillReasonFile.class); Assert.assertEquals(orignalJobKillReasonFile.getKillReason(), loadedJobKillReasonFile.getKillReason()); }</code><technical_language>Break actual reason out a String reference variable in assertion getter in places this leads test is succeeding due some weird behavior in getter. Minor silly still</technical_language>

Target:
public void serializeThenLoad() throws IOException { final ObjectMapper objectMapper = new ObjectMapper(); final JobKillReasonFile orignalJobKillReasonFile = new JobKillReasonFile(KILL_REASON_STRING); Assert.assertEquals(KILL_REASON_STRING, orignalJobKillReasonFile.getKillReason()); final byte[] bytes = objectMapper.writeValueAsBytes(orignalJobKillReasonFile); final JobKillReasonFile loadedJobKillReasonFile = objectMapper.readValue(bytes, JobKillReasonFile.class); Assert.assertEquals(KILL_REASON_STRING, loadedJobKillReasonFile.getKillReason()); }
Source:
<code>public synchronized boolean tryToCommit(Proposal p, long zxid, SocketAddress followerAddr) { if (outstandingProposals.containsKey(zxid - 1)) { return false; } if (!p.hasAllQuorums()) { return false; } if (zxid != lastCommitted + 1) { LOG.warn( "Commiting zxid 0x{} from noy first!", Long.toHexString(zxid), followerAddr); LOG.warn("First is {}", (lastCommitted + 1)); } outstandingProposals.remove(zxid); if (p.request != null) { toBeApplied.add(p); } if (p.request == null) { LOG.warn("Going to commit null: {}", p); } else if (p.request.getHdr().getType() == OpCode.reconfig) { LOG.debug("Committing a reconfiguration! {}", outstandingProposals.size()); Long designatedLeader = getDesignatedLeader(p, zxid); QuorumVerifier newQV = p.qvAcksetPairs.get(p.qvAcksetPairs.size() - 1).getQuorumVerifier(); self.processReconfig(newQV, designatedLeader, zk.getZxid(), true); if (designatedLeader != self.getId()) { <START> LOG.info("Committing a reconfiguration; this leader is not the designated leader anymore, setting allowedToCommit = false"); <END> allowedToCommit = false; } commitAndActivate(zxid, designatedLeader); informAndActivate(p, designatedLeader); } else { p.request.logLatency(ServerMetrics.getMetrics().QUORUM_ACK_LATENCY); commit(zxid); inform(p); } zk.commitProcessor.commit(p.request); if (pendingSyncs.containsKey(zxid)) { for (LearnerSyncRequest r : pendingSyncs.remove(zxid)) { sendSync(r); } } return true; }</code><technical_language>print out reconfigEnabled flag in this message, in case</technical_language>

Target:
public synchronized boolean tryToCommit(Proposal p, long zxid, SocketAddress followerAddr) { if (outstandingProposals.containsKey(zxid - 1)) { return false; } if (!p.hasAllQuorums()) { return false; } if (zxid != lastCommitted + 1) { LOG.warn( "Commiting zxid 0x{} from noy first!", Long.toHexString(zxid), followerAddr); LOG.warn("First is {}", (lastCommitted + 1)); } outstandingProposals.remove(zxid); if (p.request != null) { toBeApplied.add(p); } if (p.request == null) { LOG.warn("Going to commit null: {}", p); } else if (p.request.getHdr().getType() == OpCode.reconfig) { LOG.debug("Committing a reconfiguration! {}", outstandingProposals.size()); Long designatedLeader = getDesignatedLeader(p, zxid); QuorumVerifier newQV = p.qvAcksetPairs.get(p.qvAcksetPairs.size() - 1).getQuorumVerifier(); self.processReconfig(newQV, designatedLeader, zk.getZxid(), true); if (designatedLeader != self.getId()) { LOG.info(String.format("Committing a reconfiguration (reconfigEnabled=%s); this leader is not the designated " + "leader anymore, setting allowedToCommit=false", self.isReconfigEnabled())); allowedToCommit = false; } commitAndActivate(zxid, designatedLeader); informAndActivate(p, designatedLeader); } else { p.request.logLatency(ServerMetrics.getMetrics().QUORUM_ACK_LATENCY); commit(zxid); inform(p); } zk.commitProcessor.commit(p.request); if (pendingSyncs.containsKey(zxid)) { for (LearnerSyncRequest r : pendingSyncs.remove(zxid)) { sendSync(r); } } return true; }
Source:
<code>protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider statsProvider, Lookup lookup, Session session, Map<Symbol, Type> types) { AggregationNode aggregationNode = (AggregationNode) node; if (aggregationNode.getGroupingSets().size() != 1) { return Optional.empty(); } PlanNodeStatsEstimate sourceStats = statsProvider.getStats(aggregationNode.getSource()); List<Symbol> groupBySymbols = getOnlyElement(aggregationNode.getGroupingSets()); PlanNodeStatsEstimate.Builder result = PlanNodeStatsEstimate.builder(); for (Symbol groupBySymbol : groupBySymbols) { SymbolStatsEstimate symbolStatistics = sourceStats.getSymbolStatistics(groupBySymbol); result.addSymbolStatistics(groupBySymbol, symbolStatistics.mapNullsFraction(nullsFraction -> { <START> if (isPositiveOrNan(nullsFraction)) { <END> double distinctValuesCount = symbolStatistics.getDistinctValuesCount(); return 1.0 / (distinctValuesCount + 1); } return 0.0; })); } double rowsCount = 1; for (Symbol groupBySymbol : groupBySymbols) { SymbolStatsEstimate symbolStatistics = sourceStats.getSymbolStatistics(groupBySymbol); int nullRow = isPositiveOrNan(symbolStatistics.getNullsFraction()) ? 1 : 0; rowsCount *= symbolStatistics.getDistinctValuesCount() + nullRow; } result.setOutputRowCount(min(rowsCount, sourceStats.getOutputRowCount())); for (Map.Entry<Symbol, Aggregation> aggregationEntry : aggregationNode.getAggregations().entrySet()) { result.addSymbolStatistics(aggregationEntry.getKey(), estimateAggregationStats(aggregationEntry.getValue(), sourceStats)); } return Optional.of(result.build()); }</code><technical_language>if(nullsFraction == 0){ return 0 } return 1.0 / (symbolStatistics.getDistinctValuesCount() + 1)</technical_language>

Target:
protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider statsProvider, Lookup lookup, Session session, Map<Symbol, Type> types) { AggregationNode aggregationNode = (AggregationNode) node; if (aggregationNode.getGroupingSets().size() != 1) { return Optional.empty(); } return Optional.of(groupBy( statsProvider.getStats(aggregationNode.getSource()), getOnlyElement(aggregationNode.getGroupingSets()), aggregationNode.getAggregations())); }
Source:
<code>public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {1L, emptyList()}, {2L, singletonList(2L)}, <START> {3L, singletonList(3L)}, <END> {4L, Arrays.asList(2L, 2L)}, {6L, Arrays.asList(2L, 3L)}, {8L, Arrays.asList(2L, 2L, 2L)}, {9L, Arrays.asList(3L, 3L)}, {27L, Arrays.asList(3L, 3L, 3L)}, {625L, Arrays.asList(5L, 5L, 5L, 5L)}, {901255L, Arrays.asList(5L, 17L, 23L, 461L)}, {93819012551L, Arrays.asList(11L, 9539L, 894119L)} }); }</code><technical_language>more this Collections.emptyList() Collections.singletonList() static import. more clear encountered before</technical_language>

Target:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {1L, Collections.emptyList()}, {2L, Collections.singletonList(2L)}, {3L, Collections.singletonList(3L)}, {4L, Arrays.asList(2L, 2L)}, {6L, Arrays.asList(2L, 3L)}, {8L, Arrays.asList(2L, 2L, 2L)}, {9L, Arrays.asList(3L, 3L)}, {27L, Arrays.asList(3L, 3L, 3L)}, {625L, Arrays.asList(5L, 5L, 5L, 5L)}, {901255L, Arrays.asList(5L, 17L, 23L, 461L)}, {93819012551L, Arrays.asList(11L, 9539L, 894119L)} }); }
Source:
<code><START> private org.apache.synapse.MessageContext createMessageContext() { <END> org.apache.synapse.MessageContext messageContext = synapseEnvironment.createMessageContext(); MessageContext axis2MsgCtx = ((org.apache.synapse.core.axis2.Axis2MessageContext) messageContext).getAxis2MessageContext(); axis2MsgCtx.setServerSide(true); axis2MsgCtx.setMessageID(UUIDGenerator.getUUID()); messageContext.setProperty(MessageContext.CLIENT_API_NON_BLOCKING, true); PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); axis2MsgCtx.setProperty(MultitenantConstants.TENANT_DOMAIN, carbonContext.getTenantDomain()); return messageContext; }</code><technical_language>Change return type MessageContext</technical_language>

Target:
private MessageContext createMessageContext() { org.apache.synapse.MessageContext messageContext = synapseEnvironment.createMessageContext(); MessageContext axis2MsgCtx = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); axis2MsgCtx.setServerSide(true); axis2MsgCtx.setMessageID(UUIDGenerator.getUUID()); messageContext.setProperty(MessageContext.CLIENT_API_NON_BLOCKING, true); PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); axis2MsgCtx.setProperty(MultitenantConstants.TENANT_DOMAIN, carbonContext.getTenantDomain()); return (MessageContext) messageContext; }
Source:
<code>public void run() { if (shutdown) { return; } try { initialize(); <START> log.info("Initialization complete. Scheduling periodicShardSync.."); <END> periodicShardSyncManager.start(); log.info("Scheduled periodicShardSync tasks. Starting worker loop."); } catch (RuntimeException e) { log.error("Unable to initialize after attempts. Shutting down.", maxInitializationAttempts, e); workerStateChangeListener.onAllInitializationAttemptsFailed(e); shutdown(); } while (!shouldShutdown()) { runProcessLoop(); } finalShutdown(); log.info("Worker loop is complete. Exiting from worker."); }</code><technical_language>move periodicShardSyncManager.start() initialize()</technical_language>

Target:
public void run() { if (shutdown) { return; } try { initialize(); log.info("Initialization complete. Starting worker loop."); } catch (RuntimeException e) { log.error("Unable to initialize after attempts. Shutting down.", maxInitializationAttempts, e); workerStateChangeListener.onAllInitializationAttemptsFailed(e); shutdown(); } while (!shouldShutdown()) { runProcessLoop(); } finalShutdown(); log.info("Worker loop is complete. Exiting from worker."); }
Source:
<code>protected void addExtensionRecord(Term rowType, Map<Term, String> row, boolean detatched) throws IOException { if (!terms.containsKey(rowType)) { addRowType(rowType, detatched); } List<Term> knownTerms = terms.get(rowType); final boolean isFirst = knownTerms.isEmpty(); for (Term term : row.keySet()) { if (!knownTerms.contains(term)) { if (useHeaders && !isFirst){ <START> throw new IllegalStateException("You cannot add new terms after the first row when headers are enabled"); <END> } knownTerms.add(term); } } writeRow(row, rowType, detatched); }</code><technical_language>New terms allowed row of file, complicates processing CSV libraries (understandably) complain row lengths different</technical_language>

Target:
protected void addExtensionRecord(Term rowType, Map<Term, String> row, boolean detatched) throws IOException { if (!terms.containsKey(rowType)) { addRowType(rowType, detatched); } List<Term> knownTerms = terms.get(rowType); final boolean isFirst = knownTerms.isEmpty(); for (Term term : row.keySet()) { if (!knownTerms.contains(term)) { if (!isFirst){ throw new IllegalStateException("You cannot add new terms after the first row when headers are enabled"); } knownTerms.add(term); } } writeRow(row, rowType, detatched); }
Source:
<code>public void setZoomPercentage_cropWidthChangedLinearly() throws InterruptedException { Rect prevCropRegion = getSensorRect(); float prevWidthDelta = 0; for (float percentage = 0.1f; percentage < 1.0f; percentage += 0.1f) { mZoomControl.setZoomPercentage(percentage); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegion = getSessionCropRegion(mControlUpdateListener); if (prevWidthDelta == 0) { prevWidthDelta = prevCropRegion.width() - cropRegion.width(); } else { float widthDelta = prevCropRegion.width() - cropRegion.width(); Assert.assertEquals(prevWidthDelta, widthDelta, <START> 10); <END> } prevCropRegion = cropRegion; } }</code><technical_language>explain is 10 here? If getSessionCropRegion is precise enough, deviation 1 pixel most</technical_language>

Target:
public void setZoomPercentage_cropWidthChangedLinearly() throws InterruptedException { Rect prevCropRegion = getSensorRect(); float prevWidthDelta = 0; for (float percentage = 0.1f; percentage < 1.0f; percentage += 0.1f) { mZoomControl.setZoomPercentage(percentage); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegion = getSessionCropRegion(mControlUpdateListener); if (prevWidthDelta == 0) { prevWidthDelta = prevCropRegion.width() - cropRegion.width(); } else { float widthDelta = prevCropRegion.width() - cropRegion.width(); Assert.assertEquals(prevWidthDelta, widthDelta, TOLERANCE); } prevCropRegion = cropRegion; } }
Source:
<code>public Object evaluate(DeferredObject[] arguments) throws HiveException { ret.clear(); UserAgent browser = null; Device device = null; OS os = null; try { if (arguments.length > 0 && argumentOIs.length > 0 && argumentOIs[0] != null && arguments[0] != null) { Client c; String pattern = ((StringObjectInspector) argumentOIs[0]) .getPrimitiveJavaObject(arguments[0].get()); c = p.parse(pattern); if (c != null) { browser = c.userAgent; device = c.device; os = c.os; } } } catch (Exception e) { <START> e.printStackTrace(); <END> } if (browser != null) { ret.put("browser_family", replaceNA(browser.family)); ret.put("browser_major", replaceNA(browser.major)); } else { ret.put("browser_family", NA); ret.put("browser_major", NA); } if (device != null) { ret.put("device_family", replaceNA(device.family)); } else { ret.put("device_family", NA); } if (os != null) { ret.put("os_family", replaceNA(os.family)); ret.put("os_major", replaceNA(os.major)); ret.put("os_minor", replaceNA(os.minor)); } else { ret.put("os_family", NA); ret.put("os_major", NA); ret.put("os_minor", NA); } return ret; }</code><technical_language>I performant this is running a HUGE dataset, if print stack trace in debug mode that..</technical_language>

Target:
public Object evaluate(DeferredObject[] arguments) throws HiveException { result.clear(); UserAgent browser = null; Device device = null; OS os = null; try { if (arguments.length > 0 && argumentOIs.length > 0 && argumentOIs[0] != null && arguments[0] != null) { Client c; String pattern = ((StringObjectInspector) argumentOIs[0]) .getPrimitiveJavaObject(arguments[0].get()); c = p.parse(pattern); if (c != null) { browser = c.userAgent; device = c.device; os = c.os; } } } catch (Exception e) { e.printStackTrace(); } if (browser != null) { result.put("browser_family", replaceNA(browser.family)); result.put("browser_major", replaceNA(browser.major)); } else { result.put("browser_family", NA); result.put("browser_major", NA); } if (device != null) { result.put("device_family", replaceNA(device.family)); } else { result.put("device_family", NA); } if (os != null) { result.put("os_family", replaceNA(os.family)); result.put("os_major", replaceNA(os.major)); result.put("os_minor", replaceNA(os.minor)); } else { result.put("os_family", NA); result.put("os_major", NA); result.put("os_minor", NA); } return result; }
Source:
<code>protected Boolean _hasPermission(@Nonnull Authentication a, Permission permission) { PrincipalSid principalSid; try { principalSid = principalSidCache.get(a, () -> {return new PrincipalSid(a);}); } catch (ExecutionException e) { LOGGER.log(WARNING, "Failed to populate Principal Sid Cache", e); <START> principalSid = new PrincipalSid(a); <END> } Boolean b = hasPermission(principalSid, permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission(PrincipalSID:"+a.getPrincipal()+","+permission+")=>"+b); if(b!=null) return b; for(GrantedAuthority ga : a.getAuthorities()) { b = hasPermission(new GrantedAuthoritySid(ga),permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission(GroupSID:"+ga.getAuthority()+","+permission+")=>"+b); if(b!=null) return b; } for (Sid sid : AUTOMATIC_SIDS) { b = hasPermission(sid,permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission("+sid+","+permission+")=>"+b); if(b!=null) return b; } return null; }</code><technical_language>is passes exception</technical_language>

Target:
protected Boolean _hasPermission(@Nonnull Authentication a, Permission permission) { PrincipalSid principalSid = principalSidCache.get(a); if (principalSid == null) { principalSid = new PrincipalSid(a); principalSidCache.put(a, principalSid); } Boolean b = hasPermission(principalSid, permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission(PrincipalSID:"+a.getPrincipal()+","+permission+")=>"+b); if(b!=null) return b; for(GrantedAuthority ga : a.getAuthorities()) { b = hasPermission(new GrantedAuthoritySid(ga),permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission(GroupSID:"+ga.getAuthority()+","+permission+")=>"+b); if(b!=null) return b; } for (Sid sid : AUTOMATIC_SIDS) { b = hasPermission(sid,permission); if(LOGGER.isLoggable(FINER)) LOGGER.finer("hasPermission("+sid+","+permission+")=>"+b); if(b!=null) return b; } return null; }
Source:
<code>public void createRequest(@NonNull final de.metas.adempiere.model.I_C_Order order) { <START> if (order.getC_DocTypeTarget_ID() == X_C_DocType.DOCTYPE_TEST_APPLIANCE) <END> { R_Request_CreateFromOrder_Async.createWorkpackage(order.getC_Order_ID()); } }</code><technical_language>use/check C_DocType.R_RequestType_ID decide if generate a request</technical_language>

Target:
public void createRequest(@NonNull final de.metas.adempiere.model.I_C_Order order) { final Optional<RequestTypeId> requestType = orderBL.getRequestTypeForCreatingNewRequestsAfterComplete(order); if (requestType.isPresent()) { R_Request_CreateFromOrder_Async.createWorkpackage(order); } }
Source:
<code>public Optional<KeyBinding> mapToKeyBinding(KeyEvent keyEvent) { for (KeyBinding binding : KeyBinding.values()) { <START> if (!binding.getDefaultKeyBinding().isEmpty()){ <END> if (checkKeyCombinationEquality(binding, keyEvent)) { return Optional.of(binding); } } } return Optional.empty(); }</code><technical_language>this works? I gess getDefaultKeyBinding is empty for NEW_INBOOK user overwritten it. glance, I suggest change getKeyCombination method public Optional<KeyCombination> getKeyCombination(KeyBinding bindName) return empty optional if binding is empty. Moreover, get return en empty string instead of "Not associated" consistent</technical_language>

Target:
public Optional<KeyBinding> mapToKeyBinding(KeyEvent keyEvent) { for (KeyBinding binding : KeyBinding.values()) { if (checkKeyCombinationEquality(binding, keyEvent)) { return Optional.of(binding); } } return Optional.empty(); }
Source:
<code>public void before() { indexOperations = operations.indexOps(SampleEntity.class); deleteIndices(); indexOperations.create(); indexOperations.putMapping(SampleEntity.class); IndexOperations indexOpsSampleEntityUUIDKeyed = operations.indexOps(SampleEntityUUIDKeyed.class); indexOpsSampleEntityUUIDKeyed.create(); indexOpsSampleEntityUUIDKeyed.putMapping(SampleEntityUUIDKeyed.class); IndexOperations indexOpsSearchHitsEntity = operations.indexOps(SearchHitsEntity.class); indexOpsSearchHitsEntity.create(); indexOpsSearchHitsEntity.putMapping(SearchHitsEntity.class); if (this instanceof ElasticsearchRestTemplateTests) { IndexOperations indexOpsJoinEntity = operations.indexOps(ElasticsearchRestTemplateTests.SampleJoinEntity.class); indexOpsJoinEntity.create(); <START> indexOpsJoinEntity.putMapping(ElasticsearchRestTemplateTests.SampleJoinEntity.class); <END> } }</code><technical_language>calls in moved base class</technical_language>

Target:
public void before() { indexOperations = operations.indexOps(SampleEntity.class); deleteIndices(); indexOperations.create(); indexOperations.putMapping(SampleEntity.class); IndexOperations indexOpsSampleEntityUUIDKeyed = operations.indexOps(SampleEntityUUIDKeyed.class); indexOpsSampleEntityUUIDKeyed.create(); indexOpsSampleEntityUUIDKeyed.putMapping(SampleEntityUUIDKeyed.class); IndexOperations indexOpsSearchHitsEntity = operations.indexOps(SearchHitsEntity.class); indexOpsSearchHitsEntity.create(); indexOpsSearchHitsEntity.putMapping(SearchHitsEntity.class); IndexOperations indexOpsJoinEntity = operations.indexOps(ElasticsearchRestTemplateTests.SampleJoinEntity.class); indexOpsJoinEntity.create(); indexOpsJoinEntity.putMapping(ElasticsearchRestTemplateTests.SampleJoinEntity.class); }
Source:
<code>private void calculateUsage() { try { List<String> usernames = core.getUsernames("").get() .stream() <START> .filter(usage::containsKey) <END> .collect(Collectors.toList()); for (String username : usernames) { Optional<PublicKeyHash> publicKeyHash = core.getPublicKeyHash(username).get(); publicKeyHash.ifPresent(keyHash -> processCorenodeEvent(username, keyHash)); } } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>filter? This work</technical_language>

Target:
public void calculateUsage() { try { List<String> usernames = core.getUsernames("") .get() .stream() .filter(e -> !state.usage.containsKey(e)) .collect(Collectors.toList()); long t1 = System.currentTimeMillis(); for (String username : usernames) { System.out.printf("Processing %s\n", username); Optional<PublicKeyHash> publicKeyHash = core.getPublicKeyHash(username).get(); publicKeyHash.ifPresent(keyHash -> processCorenodeEvent(username, keyHash)); } long t2 = System.currentTimeMillis(); System.out.println(LocalDateTime.now() + " Finished loading space usage for all usernames in " + (t2 - t1)/1000 + " s"); } catch (Exception e) { LOG.log(Level.WARNING, e.getMessage(), e); } }
Source:
<code>public ConnectDocumentToLanguageServerSetupParticipant() { ITextFileBufferManager.DEFAULT.addFileBufferListener(new FileBufferListenerAdapter() { @Override public void bufferDisposed(IFileBuffer buffer) { <START> Job job = locationMap.get(buffer.getLocation()); <END> if (job != null) { job.cancel(); } locationMap.remove(buffer.getLocation()); } }); }</code><technical_language>invoke Job job = locationMap.remove(buffer.getLocation()); if (job != null) { job.cancel(); }</technical_language>

Target:
public ConnectDocumentToLanguageServerSetupParticipant() { ITextFileBufferManager.DEFAULT.addFileBufferListener(new FileBufferListenerAdapter() { @Override public void bufferDisposed(IFileBuffer buffer) { Job job = locationMap.remove(buffer.getLocation()); if (job != null) { job.cancel(); } } }); }
Source:
<code>public void testSuccess() { Mockito.when(schemaService.getSchemas("et_test_name", 0, 1)).thenReturn(Result.ok(null)); final ResponseEntity<?> result = <START> new SchemaController(schemaService, eventTypeService) <END> .getSchemas("et_test_name", 0, 1, nativeWebRequest); Assert.assertEquals(HttpStatus.OK, result.getStatusCode()); }</code><technical_language>@lmontrieux I realised something. MockMVC for testing controllers. do tests some other functionality is left interacting controller directly. Please a some other controller class for examples it</technical_language>

Target:
public void testSuccess() { Mockito.when(schemaService.getSchemas("et_test", 0, 1)).thenReturn(Result.ok(null)); Mockito.when(eventTypeService.get("et_test")).thenReturn(Result.ok(EventTypeTestBuilder.builder().build())); final ResponseEntity<?> result = new SchemaController(schemaService, eventTypeService) .getSchemas("et_test", 0, 1, nativeWebRequest); Assert.assertEquals(HttpStatus.OK, result.getStatusCode()); }
Source:
<code><START> private static DelegateRelationship buildApiParentRelationship(File apiLibDirectory, ClassLoader apiClassLoader) { <END> DelegateRelationshipBuilder apiParentRelationshipBuilder = DelegateRelationshipBuilder.builder() .withDelegateClassLoader(apiClassLoader) .withIsolationLevel(IsolationLevel.FULL); apiParentRelationshipBuilder.addDelegatePreferredClassPredicate(new BootstrapClassPredicate()); getApiClasses(apiLibDirectory).forEach( apiClassName -> apiParentRelationshipBuilder.addDelegatePreferredClassPredicate(new GlobMatcher(apiClassName))); return apiParentRelationshipBuilder.build(); }</code><technical_language>for buildApplicationClassLoader method buildInfrastructureClassLoader method. good explain a parentRelationship entails, e.g., is parent of whom, implications for preference loading classes. API naming clear enough</technical_language>

Target:
private static DelegateRelationship buildApiParentRelationship(File apiLibDirectory, ClassLoader apiClassLoader) { DelegateRelationshipBuilder apiParentRelationshipBuilder = DelegateRelationshipBuilder.builder() .withDelegateClassLoader(apiClassLoader) .withIsolationLevel(IsolationLevel.FULL); apiParentRelationshipBuilder.addDelegatePreferredClassPredicate(new BootstrapClassPredicate()); getFrameworkApiClassGlobs(apiLibDirectory).forEach( apiClassName -> apiParentRelationshipBuilder.addDelegatePreferredClassPredicate(new GlobMatcher(apiClassName))); return apiParentRelationshipBuilder.build(); }
Source:
<code>public boolean addStateTransition(final ActivationState from, final EventType event, final ActivationState to) { <START> Objects.requireNonNull(from, "From state cannot be null!"); <END> Objects.requireNonNull(event, "Event cannot be null!"); Objects.requireNonNull(to, "To state cannot be null!"); Transition transition = new Transition(from, event, to); return addStateTransition(transition); }</code><technical_language>Duplicate non-null check (also done in Transition)</technical_language>

Target:
public boolean addStateTransition(final ActivationState from, final EventType event, final ActivationState to) { return addStateTransition(new Transition(from, event, to)); }
Source:
<code><START> private AsyncScheduler() { <END> super(ScheduledTask.TaskSynchroncity.ASYNCHRONOUS); Thread thread = new Thread(new Runnable() { @Override public void run() { mainLoop(); } }); thread.setName("Sponge Async Scheduler Thread"); thread.setDaemon(true); thread.start(); }</code><technical_language>this need private? is async matter instances create time, it? Sponge needs is a difference enforcing a singleton</technical_language>

Target:
AsyncScheduler() { super(ScheduledTask.TaskSynchronicity.ASYNCHRONOUS); Thread thread = new Thread(new Runnable() { @Override public void run() { mainLoop(); } }); thread.setName("Sponge Async Scheduler Thread"); thread.setDaemon(true); thread.start(); }
Source:
<code>public AddElementComponent(final EditionWindow parent, Controller controller, Skin skin) { super(parent, controller, skin); this.eraser = new EraserComponent(parent, controller, skin); this.paint = new PaintComponent(parent, controller, skin); createTopToolbar(parent, controller); Button draw = new TextButton( this.i18n.m("edition.tool.add-paint-element"), skin); this.add(draw).fillX().expandX(); this.row(); this.add( new TextButton(this.i18n.m("edition.tool.add-recent-element"), skin)).fillX().expandX(); this.row(); this.add( new TextButton(this.i18n.m("edition.tool.add-photo-element"), skin)).fillX().expandX(); this.row(); final Button addFromGalleryButton = new TextButton( this.i18n.m("edition.tool.add-gallery-element"), skin); addFromGalleryButton.addListener(new ActionOnDownListener(controller, AddSceneElementFromResource.class)); this.add(addFromGalleryButton).fillX().expandX(); draw.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { if (!AddElementComponent.this.topToolbar.isVisible()) { AddElementComponent.this.hide(); AddElementComponent.this.topToolbar.setVisible(true); AddElementComponent.this.painting.setVisible(true); parent.getTop().setVisible(false); } else { parent.getTop().setVisible(true); AddElementComponent.this.painting.setVisible(false); <START> AddElementComponent.this.painting.flush(); <END> } } }); }</code><technical_language>In cases, a colliding variable, omitting complete qualifier (AddElementComponent.this) code more readable</technical_language>

Target:
public AddElementComponent(final EditionWindow parent, Controller controller, Skin skin) { super(parent, controller, skin); this.eraser = new EraserComponent(parent, controller, skin); this.paint = new PaintComponent(parent, controller, skin); createTopToolbar(parent, controller); Button draw = new TextButton( this.i18n.m("edition.tool.add-paint-element"), skin); this.add(draw).fillX().expandX(); this.row(); this.add( new TextButton(this.i18n.m("edition.tool.add-recent-element"), skin)).fillX().expandX(); this.row(); this.add( new TextButton(this.i18n.m("edition.tool.add-photo-element"), skin)).fillX().expandX(); this.row(); final Button addFromGalleryButton = new TextButton( this.i18n.m("edition.tool.add-gallery-element"), skin); addFromGalleryButton.addListener(new ActionOnDownListener(controller, AddSceneElementFromResource.class)); this.add(addFromGalleryButton).fillX().expandX(); draw.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { if (!topToolbar.isVisible()) { hide(); topToolbar.setVisible(true); brushStrokes.setVisible(true); parent.getTop().setVisible(false); } else { parent.getTop().setVisible(true); brushStrokes.setVisible(false); brushStrokes.release(); brushStrokes.clearMesh(); } } }); }
Source:
<code>private void initMetricCollector() { try { Path dbDumpPath = currentDatabaseIterator.dbLevelPath(); FileSystem fs = dbDumpPath.getFileSystem(hiveConf); long numTables = getNumTables(dbDumpPath, fs); long numFunctions = getNumFunctions(dbDumpPath, fs); Map<String, Long> metricMap = new HashMap<>(); metricMap.put(ReplUtils.MetricName.TABLES.name(), (long) numTables); <START> metricMap.put(ReplUtils.MetricName.FUNCTIONS.name(), (long) numFunctions); <END> metricCollector.reportStageStart("REPL_LOAD", metricMap); } catch (IOException e) { } catch (SemanticException e) { throw new RuntimeException("Failed to collect Metrics ", e); } }</code><technical_language>need typecast, long</technical_language>

Target:
private void initMetricCollector() { try { Path dbDumpPath = currentDatabaseIterator.dbLevelPath(); FileSystem fs = dbDumpPath.getFileSystem(hiveConf); long numTables = getNumTables(dbDumpPath, fs); long numFunctions = getNumFunctions(dbDumpPath, fs); Map<String, Long> metricMap = new HashMap<>(); metricMap.put(ReplUtils.MetricName.TABLES.name(), numTables); metricMap.put(ReplUtils.MetricName.FUNCTIONS.name(), numFunctions); metricCollector.reportStageStart("REPL_LOAD", metricMap); } catch (Exception e) { throw new RuntimeException("Failed to collect Metrics ", e); } }