auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public SingleInputGate create( @Nonnull String owningTaskName, int gateIndex, @Nonnull InputGateDeploymentDescriptor igdd, @Nonnull PartitionProducerStateProvider partitionProducerStateProvider, @Nonnull InputChannelMetrics metrics) { SupplierWithException<BufferPool, IOException> bufferPoolFactory = createBufferPoolFactory( networkBufferPool, networkBuffersPerChannel, floatingNetworkBuffersPerGate, igdd.getShuffleDescriptors().length, igdd.getConsumedPartitionType()); BufferDecompressor bufferDecompressor = null; if (igdd.getConsumedPartitionType().isBlocking() && blockingShuffleCompressionEnabled) { bufferDecompressor = new BufferDecompressor(networkBufferSize, compressionCodec); } SingleInputGate inputGate = new SingleInputGateImpl( owningTaskName, gateIndex, igdd.getConsumedResultId(), igdd.getConsumedPartitionType(), igdd.getConsumedSubpartitionIndex(), igdd.getShuffleDescriptors().length, partitionProducerStateProvider, bufferPoolFactory, bufferDecompressor); createInputChannels(owningTaskName, igdd, inputGate, metrics); return inputGate; }

Target:
public SingleInputGate create( @Nonnull String owningTaskName, int gateIndex, @Nonnull InputGateDeploymentDescriptor igdd, @Nonnull PartitionProducerStateProvider partitionProducerStateProvider, @Nonnull InputChannelMetrics metrics) { SupplierWithException<BufferPool, IOException> bufferPoolFactory = createBufferPoolFactory( networkBufferPool, networkBuffersPerChannel, floatingNetworkBuffersPerGate, igdd.getShuffleDescriptors().length, igdd.getConsumedPartitionType()); BufferDecompressor bufferDecompressor = null; if (igdd.getConsumedPartitionType().isBlocking() && blockingShuffleCompressionEnabled) { bufferDecompressor = new BufferDecompressor(networkBufferSize, compressionCodec); } SingleInputGate inputGate = new SingleInputGate( owningTaskName, gateIndex, igdd.getConsumedResultId(), igdd.getConsumedPartitionType(), igdd.getConsumedSubpartitionIndex(), igdd.getShuffleDescriptors().length, partitionProducerStateProvider, bufferPoolFactory, bufferDecompressor, networkBufferPool); createInputChannels(owningTaskName, igdd, inputGate, metrics); return inputGate; }
Source:
public void checkPreviewUpdatedAfterDestroyRecreate() { IdlingRegistry.getInstance().register(mActivityRule.getActivity().getViewIdlingResource()); pressBackButton(); mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); mActivityRule.getActivity().startActivity(mIntent); onView(withId(R.id.textureView)).check(matches(isDisplayed())); IdlingRegistry.getInstance().unregister( mActivityRule.getActivity().getViewIdlingResource()); }

Target:
public void checkPreviewUpdatedAfterDestroyRecreate() { IdlingRegistry.getInstance().register(mActivityRule.getActivity().getViewIdlingResource()); onView(withId(R.id.textureView)).check(matches(isDisplayed())); IdlingRegistry.getInstance().unregister( mActivityRule.getActivity().getViewIdlingResource()); pressBackButton(); mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); mActivityRule.launchActivity(mIntent); IdlingRegistry.getInstance().register(mActivityRule.getActivity().getViewIdlingResource()); onView(withId(R.id.textureView)).check(matches(isDisplayed())); IdlingRegistry.getInstance().unregister( mActivityRule.getActivity().getViewIdlingResource()); }
Source:
private void hideQuickAccess( @Optional @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) Event event) { if (event == null) { return; } Object origin = event.getProperty(UIEvents.EventTags.ELEMENT); if (!(origin instanceof MToolControl)) { return; } MToolControl control = (MToolControl) origin; if (!QUICK_ACCESS_ID.equals(control.getElementId())) { return; } if (UIEvents.isADD(event)) { if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE, IPresentationEngine.HIDDEN_EXPLICITLY)) { if (!model.getTags().contains(QUICK_ACCESS_HIDDEN)) { model.getTags().add(QUICK_ACCESS_HIDDEN); } } } else { if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, IPresentationEngine.HIDDEN_EXPLICITLY)) { model.getTags().remove(QUICK_ACCESS_HIDDEN); } } }

Target:
private void hideQuickAccess( @Optional @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) Event event) { if (event == null) { return; } Object origin = event.getProperty(UIEvents.EventTags.ELEMENT); if (!(origin instanceof MToolControl)) { return; } MToolControl control = (MToolControl) origin; if (!QUICK_ACCESS_ID.equals(control.getElementId())) { return; } if (UIEvents.isADD(event)) { if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE, IPresentationEngine.HIDDEN_EXPLICITLY)) { if (!model.getTags().contains(QUICK_ACCESS_HIDDEN)) { model.getTags().add(QUICK_ACCESS_HIDDEN); } } } else if (UIEvents.isREMOVE(event)) { if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, IPresentationEngine.HIDDEN_EXPLICITLY)) { model.getTags().remove(QUICK_ACCESS_HIDDEN); } } }
Source:
public static String regionOfDomain(UserPreferences userPrefs, String domain) throws URISyntaxException, IOException { HttpUtility http = new HttpUtility(userPrefs, false); URI versionApiUri = new URI("https://" + DatasetUtils.getDomainWithoutScheme(domain) + VERSION_API_ENDPOINT); try(CloseableHttpResponse response = http.get(versionApiUri, ContentType.APPLICATION_JSON.getMimeType())) { Header[] headers = response.getHeaders(X_SOCRATA_REGION); if(headers.length == 0) return "development"; else return headers[0].getValue(); } }

Target:
public static String regionOfDomain(UserPreferences userPrefs, String domain) throws URISyntaxException, IOException { HttpUtility http = new HttpUtility(userPrefs, false); URI versionApiUri = new URI("https://" + DatasetUtils.getDomainWithoutScheme(domain) + VERSION_API_ENDPOINT); try(CloseableHttpResponse response = http.get(versionApiUri, ContentType.APPLICATION_JSON.getMimeType())) { Header[] headers = response.getHeaders(X_SOCRATA_REGION); if(headers.length == 0) { return "development"; } else { return headers[0].getValue(); } } }
Source:
public void testOrderResourceFields() throws HTTPError { Order order = createOrder(); assertNotNull(order.buyers); assertNotNull(order.credits); assertNotNull(order.debits); assertNotNull(order.merchant); assertNotNull(order.refunds); assertNotNull(order.reversals); assertNotNull(order.amount_escrowed); assertNotNull(order.amount); assertNotNull(order.created_at); assertNotNull(order.currency); assertNotNull(order.delivery_address); assertNull(order.description); assertNotNull(order.href); assertNotNull(order.id); assertNotNull(order.meta); assertNotNull(order.updated_at); }

Target:
public void testOrderResourceFields() throws HTTPError { Order order = createOrder(); Map<String, String> meta = new HashMap<String, String>(); meta.put("facebook", "0192837465"); order.description = "New description for order"; order.meta = meta; order.save(); assertTrue(order.buyers instanceof Customer.Collection); assertTrue(order.credits instanceof Credit.Collection); assertTrue(order.debits instanceof Debit.Collection); assertTrue(order.merchant instanceof Customer); assertTrue(order.refunds instanceof Refund.Collection); assertTrue(order.reversals instanceof Reversal.Collection); assertTrue(order.href.contains("/orders/OR")); assertTrue(order.id.startsWith("OR")); assertEquals(order.delivery_address.toString(), "{city=null, line2=null, " + "line1=null, state=null, postal_code=null, country_code=null}"); assertNotNull(order.created_at); assertNotNull(order.updated_at); assertEquals(order.currency, "USD"); assertEquals(order.description, "New description for order"); assertEquals(order.meta.get("facebook"), "0192837465"); assertEquals(order.amount_escrowed.intValue(), 0); assertEquals(order.amount.intValue(), 5000); }
Source:
private void copyTextureIntoArrayTexture (Texture texture, int slot) { copyFramebuffer.bind(); Gdx.gl30.glFramebufferTexture2D(GL30.GL_READ_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL30.GL_TEXTURE_2D, texture.getTextureObjectHandle(), 0); Gdx.gl30.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0); Gdx.gl30.glBindTexture(GL30.GL_TEXTURE_2D_ARRAY, arrayTextureHandle); Gdx.gl30.glCopyTexSubImage3D(GL30.GL_TEXTURE_2D_ARRAY, 0, 0, 0, slot, 0, 0, copyFramebuffer.getWidth(), copyFramebuffer.getHeight()); FrameBuffer.unbind(); if (useMipMaps) { mipMapsDirty = true; } }

Target:
private void copyTextureIntoArrayTexture (Texture texture, int slot) { int previousFrameBufferHandle = 0; if (!isWebGL) { Gdx.gl30.glGetIntegerv(GL30.GL_FRAMEBUFFER_BINDING, FBO_READ_INTBUFF); previousFrameBufferHandle = FBO_READ_INTBUFF.get(0); } copyFramebuffer.bind(); Gdx.gl30.glFramebufferTexture2D(GL30.GL_READ_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL30.GL_TEXTURE_2D, texture.getTextureObjectHandle(), 0); Gdx.gl30.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0); Gdx.gl30.glBindTexture(GL30.GL_TEXTURE_2D_ARRAY, arrayTextureHandle); Gdx.gl30.glCopyTexSubImage3D(GL30.GL_TEXTURE_2D_ARRAY, 0, 0, 0, slot, 0, 0, copyFramebuffer.getWidth(), copyFramebuffer.getHeight()); if (!isWebGL) { Gdx.gl30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, previousFrameBufferHandle); } if (useMipMaps) { mipMapsDirty = true; } }
Source:
public Constituent getCanonicalEntityViaRelation(Constituent c) { List<Relation> incomingRelations = getFilteredIncomingRelations(c); if (incomingRelations.isEmpty()) return c; if (incomingRelations.size() > 1) logger.info("Warning: constituent belongs to more than one cluster; we returned only one of them.\n" + "If you are deadline with overlapping clusters, and want to get all of the canonical elements, " + "\"getCanonicalEntitySetViaRelation\" function. "); return incomingRelations.get(0).source; }

Target:
public Constituent getCanonicalEntityViaRelation(Constituent c) { List<Relation> incomingRelations = getFilteredIncomingRelations(c); if (incomingRelations.isEmpty()) return c; if (incomingRelations.size() > 1) logger.warn("Warning: constituent belongs to more than one cluster; we returned only one of them.\n" + "If you are deadline with overlapping clusters, and want to get all of the canonical elements, " + "\"getCanonicalEntitySetViaRelation\" function. "); return incomingRelations.get(0).source; }
Source:
public static ProtobufMetadataManagerImpl getProtobufMetadataManager(EmbeddedCacheManager cacheManager) { if (cacheManager == null) { throw new IllegalArgumentException("cacheManager cannot be null"); } ProtobufMetadataManagerImpl metadataManager = (ProtobufMetadataManagerImpl) cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class); if (metadataManager == null) { throw new IllegalStateException("ProtobufMetadataManager not initialised yet!"); } return metadataManager; }

Target:
private static ProtobufMetadataManagerImpl getProtobufMetadataManager(EmbeddedCacheManager cacheManager) { if (cacheManager == null) { throw new IllegalArgumentException("cacheManager cannot be null"); } ProtobufMetadataManagerImpl metadataManager = (ProtobufMetadataManagerImpl) cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class); if (metadataManager == null) { throw new IllegalStateException("ProtobufMetadataManager not initialised yet!"); } return metadataManager; }
Source:
public void testJoinCourseForInstructor_invalidInstituteMac_shouldFail() throws EntityDoesNotExistException { InstructorAttributes instructor = dataBundle.instructors.get("instructorNotYetJoinCourse"); String loggedInGoogleId = "AccLogicT.instr.id"; String institute = "National University of Singapore"; String[] encryptedKey = new String[] { instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email), }; ______TS("failure: institute signature does not match institute provided"); InvalidParametersException ipe = assertThrows(InvalidParametersException.class, () -> accountsLogic.joinCourseForInstructor( encryptedKey[0], loggedInGoogleId, institute, StringHelper.generateSignature("NUS"))); assertEquals("Institute authentication failed.", ipe.getMessage()); }

Target:
public void testJoinCourseForInstructor_invalidInstituteMac_shouldFail() throws EntityDoesNotExistException { InstructorAttributes instructor = dataBundle.instructors.get("instructorNotYetJoinCourse"); String loggedInGoogleId = "AccLogicT.instr.id"; String institute = "National University of Singapore"; String[] encryptedKey = new String[] { instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email), }; ______TS("failure: institute signature does not match institute provided"); InvalidParametersException ipe = assertThrows(InvalidParametersException.class, () -> accountsLogic.joinCourseForInstructor( encryptedKey[0], loggedInGoogleId, institute, StringHelper.generateSignature("NUS"))); assertEquals("Institute authentication failed.", ipe.getMessage()); AccountAttributes accountCreated = accountsLogic.getAccount(loggedInGoogleId); assertNull(accountCreated); }
Source:
protected long resolveIterationValue() { if (iterationAttribute != null) { Object result = Utils.getField(StressTestStage.class, iterationAttribute, this); if (result != null && result instanceof Number) { return ((Number) result).longValue(); } else { throw new IllegalStateException("Unable to resolve iteration value from " + getClass().getName() + "." + iterationAttribute); } } return -1; }

Target:
protected String resolveIterationValue() { if (iterationProperty != null) { Map<String, Path> properties = PropertyHelper.getProperties(getClass(), true, false); String propertyString = PropertyHelper.getPropertyString(properties.get(iterationProperty), this); if (propertyString == null) { throw new IllegalStateException("Unable to resolve iteration property '" + iterationProperty + "'."); } return propertyString; } return null; }
Source:
private ITestNGMethod[] clone(ITestNGMethod[] sources) { return Arrays.stream(sources) .map(ITestNGMethod::clone) .toArray(ITestNGMethod[]::new); }

Target:
private static ITestNGMethod[] clone(ITestNGMethod[] sources) { return Arrays.stream(sources) .map(ITestNGMethod::clone) .toArray(ITestNGMethod[]::new); }
Source:
public static String buildConjunctiveClause(String fieldName, Collection<String> values){ String orQuery = fieldName+":("; for(String value: values){ orQuery = orQuery + value + " OR "; } return orQuery.substring(0, orQuery.length()-4)+")"; }

Target:
public static String buildConjunctiveClause(String fieldName, Collection<String> values){ Joiner conjunctiveJoiner = Joiner.on(" OR ").skipNulls(); return fieldName + ":(" + conjunctiveJoiner.join(values) + ")"; }
Source:
void updateSwitches(JSONObject nodeRoot) { synchronized (switchMap) { removeAllSwitches(); JSONArray sPoints = nodeRoot.getJSONArray("switchPoints"); logger.debug("sPoints: {}", nodeRoot.toString()); for (int i = 0; i < sPoints.length(); i++) { JSONObject subJSON = sPoints.getJSONObject(i); String day = subJSON.getString("dayOfWeek"); String setpoint = subJSON.getString("setpoint"); Integer time = subJSON.getInt("time"); if (positiveSwitch == null) { positiveSwitch = setpoint; logger.debug("positiveSwitch: {}", positiveSwitch); setpoints.add(positiveSwitch); } else if (negativeSwitch == null && !setpoint.equals(positiveSwitch)) { negativeSwitch = setpoint; logger.debug("negativeSwitch: {}", negativeSwitch); setpoints.add(negativeSwitch); } addSwitch(day, setpoint, time); } } }

Target:
void updateSwitches(JSONObject nodeRoot) { synchronized (switchMap) { removeAllSwitches(); JSONArray sPoints = nodeRoot.getJSONArray("switchPoints"); logger.debug("sPoints: {}", nodeRoot); for (int i = 0; i < sPoints.length(); i++) { JSONObject subJSON = sPoints.getJSONObject(i); String day = subJSON.getString("dayOfWeek"); String setpoint = subJSON.getString("setpoint"); Integer time = subJSON.getInt("time"); if (positiveSwitch == null) { positiveSwitch = setpoint; logger.debug("positiveSwitch: {}", positiveSwitch); setpoints.add(positiveSwitch); } else if (negativeSwitch == null && !setpoint.equals(positiveSwitch)) { negativeSwitch = setpoint; logger.debug("negativeSwitch: {}", negativeSwitch); setpoints.add(negativeSwitch); } addSwitch(day, setpoint, time); } } }
Source:
protected java.util.logging.Level toJulLevel() { return java.util.logging.Level.OFF; }

Target:
public java.util.logging.Level toJulLevel() { return julLevel; }
Source:
public void setLevel(String loggerName, String newLevel) { getLogger(loggerName).setLevel(Level.valueOf(newLevel.toUpperCase(Locale.US)).toJulLevel()); }

Target:
public void setLevel(String loggerName, String newLevel) { logging.setLevel(loggerName, Level.valueOf(newLevel.toUpperCase(Locale.US))); }
Source:
final void refreshStablePartitionList(Map<String, IdealState> idealStateMap) { _stablePartitionListCache.keySet().retainAll(idealStateMap.keySet()); for (String resourceName : idealStateMap.keySet()) { Set<String> newPartitionSet = idealStateMap.get(resourceName).getPartitionSet(); List<String> cachedPartitionList = getStablePartitionList(resourceName); if (cachedPartitionList.size() != newPartitionSet.size() || !newPartitionSet .containsAll(cachedPartitionList)) { _stablePartitionListCache.put(resourceName, new ArrayList<>(newPartitionSet)); } } }

Target:
final void refreshStablePartitionList(Map<String, IdealState> idealStateMap) { _stablePartitionListCache.keySet().retainAll(idealStateMap.keySet()); for (String resourceName : idealStateMap.keySet()) { Set<String> newPartitionSet = idealStateMap.get(resourceName).getPartitionSet(); List<String> cachedPartitionList = getStablePartitionList(resourceName); if (cachedPartitionList == null || cachedPartitionList.size() != newPartitionSet.size() || !newPartitionSet.containsAll(cachedPartitionList)) { _stablePartitionListCache.put(resourceName, new ArrayList<>(newPartitionSet)); } } }
Source:
public WarningEntry(Throwable throwable) { requireNonNull(throwable, "warning is null"); assertTrue(throwable instanceof SQLWarning); SQLWarning warning = (SQLWarning) throwable; this.vendorCode = warning.getErrorCode(); this.sqlState = requireNonNull(warning.getSQLState(), "SQLState is null"); this.message = requireNonNull(warning.getMessage(), "message is null"); }

Target:
public WarningEntry(Throwable throwable) { requireNonNull(throwable, "throwable is null"); assertTrue(throwable instanceof SQLWarning); SQLWarning warning = (SQLWarning) throwable; this.vendorCode = warning.getErrorCode(); this.sqlState = requireNonNull(warning.getSQLState(), "SQLState is null"); this.message = requireNonNull(warning.getMessage(), "message is null"); }
Source:
protected void executeQueryCommand() { String suggestedDiskName = null; if (getParameters().getVmId() == null) { getQueryReturnValue().setReturnValue(suggestedDiskName); } else { VM vm = DbFacade.getInstance().getVmDAO().getById(getParameters().getVmId()); suggestedDiskName = ImagesHandler.getDefaultDiskAlias(vm.getvm_name(), VmHandler.getCorrectDriveForDisk(vm)); } getQueryReturnValue().setReturnValue(suggestedDiskName); }

Target:
protected void executeQueryCommand() { String suggestedDiskName = null; if (getParameters().getVmId() == null) { getQueryReturnValue().setReturnValue(suggestedDiskName); } else { VM vm = DbFacade.getInstance().getVmDAO().getById(getParameters().getVmId()); if (vm != null) { suggestedDiskName = ImagesHandler.getDefaultDiskAlias(vm.getvm_name(), VmHandler.getCorrectDriveForDisk(vm)); } getQueryReturnValue().setReturnValue(suggestedDiskName); } }
Source:
public List<KijiRegion> getRegions() throws IOException { throw new UnsupportedOperationException("Not yet implemented to work with AsyncHBase"); }

Target:
public List<KijiRegion> getRegions() throws IOException { throw new UnsupportedOperationException("Not supported by AsyncKijiTable"); }
Source:
public synchronized void setCapacity(int newNumExecutors, int newWaitQueueSize) { if (newNumExecutors > configuredMaxExecutors) { throw new IllegalArgumentException("Requested newNumExecutors=" + newNumExecutors + " is greater than the configured maximum=" + configuredMaxExecutors); } if (newWaitQueueSize > configuredWaitingQueueSize) { throw new IllegalArgumentException("Requested newWaitQueueSize=" + newWaitQueueSize + " is greater than the configured maximum=" + configuredWaitingQueueSize); } if (newNumExecutors < 0) { throw new IllegalArgumentException("Negative numExecutors is not allowed. Requested " + "newNumExecutors=" + newNumExecutors); } if (newWaitQueueSize < 0) { throw new IllegalArgumentException("Negative waitQueueSize is not allowed. Requested " + "newWaitQueueSize=" + newWaitQueueSize); } numSlotsAvailable.addAndGet(newNumExecutors - maxParallelExecutors); maxParallelExecutors = newNumExecutors; waitQueue.setWaitQueueSize(newWaitQueueSize); if (metrics != null) { metrics.setNumExecutorsEnabled(newNumExecutors); metrics.setWaitQueueSizeEnabled(newWaitQueueSize); } LOG.info("TaskExecutorService is setting capacity to: numExecutors=" + newNumExecutors + ", waitQueueSize=" + newWaitQueueSize); }

Target:
public synchronized void setCapacity(int newNumExecutors, int newWaitQueueSize) { if (newNumExecutors > configuredMaxExecutors) { throw new IllegalArgumentException("Requested newNumExecutors=" + newNumExecutors + " is greater than the configured maximum=" + configuredMaxExecutors); } if (newWaitQueueSize > configuredWaitingQueueSize) { throw new IllegalArgumentException("Requested newWaitQueueSize=" + newWaitQueueSize + " is greater than the configured maximum=" + configuredWaitingQueueSize); } if (newNumExecutors < 0) { throw new IllegalArgumentException("Negative numExecutors is not allowed. Requested " + "newNumExecutors=" + newNumExecutors); } if (newWaitQueueSize < 0) { throw new IllegalArgumentException("Negative waitQueueSize is not allowed. Requested " + "newWaitQueueSize=" + newWaitQueueSize); } numSlotsAvailable.addAndGet(newNumExecutors - maxParallelExecutors); maxParallelExecutors = newNumExecutors; waitQueue.setWaitQueueSize(newWaitQueueSize); metrics.setNumExecutors(newNumExecutors); metrics.setWaitQueueSize(newWaitQueueSize); LOG.info("TaskExecutorService is setting capacity to: numExecutors=" + newNumExecutors + ", waitQueueSize=" + newWaitQueueSize); }
Source:
protected AuthorityValidationMetadataCache() { }

Target:
private AuthorityValidationMetadataCache() { }
Source:
public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException { Integer cpu = KernelEventHandlerUtils.getCpu(event); if (cpu == null) { return; } Integer softIrqId = ((Long) event.getContent().getField(getLayout().fieldVec()).getValue()).intValue(); int currentThreadNode = KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss); int quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeSoftIRQs(cpu, ss), softIrqId.toString()); long timestamp = KernelEventHandlerUtils.getTimestamp(event); if (!isSoftIrqRaised(ss.queryOngoingState(quark))) { ss.modifyAttribute(timestamp, TmfStateValue.nullValue(), quark); } else { ss.modifyAttribute(timestamp, StateValues.SOFT_IRQ_RAISED_VALUE, quark); } List<@NonNull Integer> softIrqs = ss.getSubAttributes(ss.getQuarkAbsolute(Attributes.CPUS, Integer.toString(cpu), Attributes.SOFT_IRQS), false); boolean nestedSoftIrqs = false; for (Integer softIrq : softIrqs) { if (!ss.queryOngoingState(softIrq).isNull()) { nestedSoftIrqs = true; break; } } if (!nestedSoftIrqs) { KernelEventHandlerUtils.setProcessToRunning(timestamp, currentThreadNode, ss); KernelEventHandlerUtils.cpuExitInterrupt(timestamp, cpu, ss); } }

Target:
public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException { Integer cpu = KernelEventHandlerUtils.getCpu(event); if (cpu == null) { return; } Integer softIrqId = ((Long) event.getContent().getField(getLayout().fieldVec()).getValue()).intValue(); int currentThreadNode = KernelEventHandlerUtils.getCurrentThreadNode(cpu, ss); int quark = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeSoftIRQs(cpu, ss), softIrqId.toString()); long timestamp = KernelEventHandlerUtils.getTimestamp(event); if (isSoftIrqRaised(ss.queryOngoingState(quark))) { ss.modifyAttribute(timestamp, StateValues.SOFT_IRQ_RAISED_VALUE, quark); } else { ss.modifyAttribute(timestamp, TmfStateValue.nullValue(), quark); } List<Integer> softIrqs = ss.getSubAttributes(ss.getParentAttributeQuark(quark), false); for (Integer softIrq : softIrqs) { if (!ss.queryOngoingState(softIrq).isNull()) { return; } } KernelEventHandlerUtils.setProcessToRunning(timestamp, currentThreadNode, ss); KernelEventHandlerUtils.cpuExitInterrupt(timestamp, cpu, ss); }
Source:
public RelOptPredicateList getAllPredicates(Calc calc, RelMetadataQuery mq) { final RexProgram rexProgram = calc.getProgram(); List<RexNode> condition = new ArrayList<>(); if (rexProgram.getCondition() != null) { condition = Util.transform(ImmutableList.of(rexProgram.getCondition()), rexProgram::expandLocalRef); } else { return mq.getAllPredicates(calc.getInput()); } assert condition.size() == 1; return getAllFilterPredicates(calc, mq, condition.get(0)); }

Target:
public RelOptPredicateList getAllPredicates(Calc calc, RelMetadataQuery mq) { final RexProgram rexProgram = calc.getProgram(); if (rexProgram.getCondition() != null) { final RexNode condition = rexProgram.expandLocalRef(rexProgram.getCondition()); return getAllFilterPredicates(calc.getInput(), mq, condition); } else { return mq.getAllPredicates(calc.getInput()); } }
Source:
public void dispose() { if (treeViewer.getTree() != null && !treeViewer.getTree().isDisposed()) { treeViewer.getTree().removeFocusListener(this.focusListener); } treeViewer.removeTreeListener(tableViewerListener); tableViewerListener = null; descriptionFileChangedNotifier.dispose(); descriptionFileChangedNotifier = null; tableUIUpdater.dispose(); tableUIUpdater = null; selectTableElementsListener.dispose(); selectTableElementsListener = null; dTableContentProvider.dispose(); dTableContentProvider = null; super.dispose(); createLineMenu.dispose(); createLineMenu = null; createTargetColumnMenu.dispose(); createTargetColumnMenu = null; }

Target:
public void dispose() { if (treeViewer.getTree() != null && !treeViewer.getTree().isDisposed() && this.focusListener != null) { treeViewer.getTree().removeFocusListener(this.focusListener); this.focusListener = null; } treeViewer.removeTreeListener(tableViewerListener); tableViewerListener = null; descriptionFileChangedNotifier.dispose(); descriptionFileChangedNotifier = null; tableUIUpdater.dispose(); tableUIUpdater = null; selectTableElementsListener.dispose(); selectTableElementsListener = null; dTableContentProvider.dispose(); dTableContentProvider = null; super.dispose(); createLineMenu.dispose(); createLineMenu = null; createTargetColumnMenu.dispose(); createTargetColumnMenu = null; }
Source:
private synchronized void broadcastMsg(final RoutingTableUpdateMsg routingTableUpdateMsg, final TraceInfo parentTraceInfo) { for (final String workerId : activeWorkerIds) { Span detached = null; try (final TraceScope traceScope = Trace.startSpan("send_routing_table_update_msg. workerId: " + workerId, parentTraceInfo)) { detached = traceScope.detach(); final TraceInfo traceInfo = TraceInfo.fromSpan(detached); final AvroPSMsg updateMsg = AvroPSMsg.newBuilder() .setType(Type.RoutingTableUpdateMsg) .setRoutingTableUpdateMsg(routingTableUpdateMsg) .setTraceInfo(HTraceUtils.toAvro(traceInfo)) .build(); sender.get().send(workerId, updateMsg); } finally { Trace.continueSpan(detached).close(); } } }

Target:
private synchronized void broadcastMsg(final RoutingTableUpdateMsg routingTableUpdateMsg, final TraceInfo parentTraceInfo) { for (final String workerId : activeWorkerIds) { Span detached = null; try (final TraceScope traceScope = Trace.startSpan("send_routing_table_update_msg. worker_id: " + workerId, parentTraceInfo)) { detached = traceScope.detach(); final TraceInfo traceInfo = TraceInfo.fromSpan(detached); final AvroPSMsg updateMsg = AvroPSMsg.newBuilder() .setType(Type.RoutingTableUpdateMsg) .setRoutingTableUpdateMsg(routingTableUpdateMsg) .setTraceInfo(HTraceUtils.toAvro(traceInfo)) .build(); sender.get().send(workerId, updateMsg); } finally { Trace.continueSpan(detached).close(); } } }
Source:
public void shutdown() { fsWatchServices.keySet().forEach(jGitFileSystemWatchServices -> this.close(jGitFileSystemWatchServices)); if (jGitEventsBroadcast != null) { jGitEventsBroadcast.close(); } }

Target:
public void shutdown() { if (jGitEventsBroadcast != null) { jGitEventsBroadcast.close(); } }
Source:
public boolean appliesTo(final Object selection) { boolean appliedConstraint = false; if (selection instanceof EStructuralFeature && UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(selection)) { appliedConstraint = true; } else if (selection instanceof ValueSpecification) { final ValueSpecification valueSpecification = (ValueSpecification) selection; if (null != valueSpecification.eContainer() && valueSpecification.eContainer() instanceof MultiplicityElement) { final EObject parent = valueSpecification.eContainer(); final Object upperValue = parent.eGet(UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue()); appliedConstraint = upperValue.equals(valueSpecification); } } return appliedConstraint; }

Target:
public boolean appliesTo(final Object selection) { boolean appliedConstraint = false; if (selection instanceof EStructuralFeature && UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(selection)) { appliedConstraint = true; } else if (selection instanceof ValueSpecification) { final ValueSpecification valueSpecification = (ValueSpecification) selection; if (valueSpecification.eContainer() instanceof MultiplicityElement) { final EObject parent = valueSpecification.eContainer(); final Object upperValue = parent.eGet(UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue()); appliedConstraint = upperValue.equals(valueSpecification); } } return appliedConstraint; }
Source:
private static CompletableFuture<Exception> publishItem( final Producer<String, String> producer, final String topicId, final BatchItem item) throws EventPublishingException { try { final CompletableFuture<Exception> result = new CompletableFuture<>(); final ProducerRecord<String, String> kafkaRecord = new ProducerRecord<>( topicId, toKafkaPartition(item.getPartition()), item.getPartition(), item.getEvent().toString()); producer.send(kafkaRecord, ((metadata, exception) -> { if (null != exception) { LOG.warn("Failed to publish to kafka topic " + topicId, exception); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); result.complete(exception); } else { item.updateStatusAndDetail(EventPublishingStatus.SUBMITTED, ""); result.complete(null); } })); return result; } catch (final InterruptException e) { Thread.currentThread().interrupt(); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } catch (final RuntimeException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } }

Target:
private static CompletableFuture<Exception> publishItem( final Producer<String, String> producer, final String topicId, final BatchItem item) throws EventPublishingException { try { final CompletableFuture<Exception> result = new CompletableFuture<>(); final ProducerRecord<String, String> kafkaRecord = new ProducerRecord<>( topicId, toKafkaPartition(item.getPartition()), item.getPartition(), item.getEvent().toString()); producer.send(kafkaRecord, ((metadata, exception) -> { if (null != exception) { LOG.warn("Failed to publish to kafka topic {}", topicId, exception); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); result.complete(exception); } else { item.updateStatusAndDetail(EventPublishingStatus.SUBMITTED, ""); result.complete(null); } })); return result; } catch (final InterruptException e) { Thread.currentThread().interrupt(); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } catch (final RuntimeException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } }
Source:
public String getTmpString() { return this.tmp; }

Target:
public static String getTmpString() { return tmp; }
Source:
private void deleteObject(String path) { boolean folder = path.substring(path.length() - 1).equals("/"); if (!exists(path)) { if (folder) { throw new RuntimeException("Folder does not exist - could not remove folder: " + path); } else { throw new RuntimeException("File does not exist - could not remove file: " + path); } } client.deleteObject(bucketName, path); }

Target:
private void deleteObject(String path) { client.deleteObject(bucketName, path); }
Source:
private static TimeType convertToTimeType(Duration duration) { return Stream.of(DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS, MICROSECONDS, NANOSECONDS) .filter(unit -> duration.equals(Duration.of(unit.convert(duration.toNanos(), NANOSECONDS), jucTimeUnitToTemporalUnit(unit)))) .findFirst() .map(unit -> new TimeType() .withValue(BigInteger.valueOf(unit.convert(duration.toNanos(), NANOSECONDS))) .withUnit(convertToXmlTimeUnit(unit)) ).orElseThrow(AssertionError::new); }

Target:
private static TimeType convertToTimeType(Duration duration) { return Stream.of(java.util.concurrent.TimeUnit.values()) .sorted(comparing(unit -> unit.convert(duration.toNanos(), NANOSECONDS))) .filter(unit -> duration.equals(Duration.of(unit.convert(duration.toNanos(), NANOSECONDS), jucTimeUnitToTemporalUnit(unit)))) .findFirst() .map(unit -> new TimeType() .withValue(BigInteger.valueOf(unit.convert(duration.toNanos(), NANOSECONDS))) .withUnit(convertToXmlTimeUnit(unit)) ).orElseThrow(AssertionError::new); }
Source:
public static List<String> getClaimValues(Map<ClaimMapping, List<String>> attributeMap, String claimUri, String userStoreDomainName) { List<String> claimValues = new ArrayList<>(); for (Map.Entry<ClaimMapping, List<String>> entry : attributeMap.entrySet()) { ClaimMapping mapping = entry.getKey(); if (mapping.getLocalClaim() != null && claimUri.equals(mapping.getLocalClaim().getClaimUri())) { claimValues = entry.getValue(); break; } } if (userStoreDomainName != null) { List<String> modifiedClaimValues = new ArrayList<>(); for (Iterator<String> iterator = claimValues.iterator(); iterator.hasNext(); ) { String claimValue = iterator.next(); if (claimValue != null && claimValue.contains("/")) { claimValue = claimValue.substring(claimValue.indexOf("/") + 1); } claimValue = userStoreDomainName + "/" + claimValue; modifiedClaimValues.add(claimValue); } claimValues = modifiedClaimValues; } return claimValues; }

Target:
public static List<String> getClaimValues(Map<ClaimMapping, List<String>> attributeMap, String claimUri, String userStoreDomainName) { List<String> claimValues = new ArrayList<>(); for (Map.Entry<ClaimMapping, List<String>> entry : attributeMap.entrySet()) { ClaimMapping mapping = entry.getKey(); if (mapping.getLocalClaim() != null && claimUri.equals(mapping.getLocalClaim().getClaimUri())) { claimValues = entry.getValue(); break; } } if (userStoreDomainName != null) { List<String> modifiedClaimValues = new ArrayList<>(); for (Iterator<String> iterator = claimValues.iterator(); iterator.hasNext(); ) { String claimValue = iterator.next(); if (StringUtils.contains(claimValue, "/")) { claimValue = claimValue.substring(claimValue.indexOf("/") + 1); } claimValue = userStoreDomainName + "/" + claimValue; modifiedClaimValues.add(claimValue); } claimValues = modifiedClaimValues; } return claimValues; }
Source:
private boolean checkForJournalFlush() { if ( QueueBatchSize == 0 ) return true ; if ( queue.size() >= QueueBatchSize ) return true ; boolean journalSizeFlush = (JournalThresholdSize > 0 && journal.size() > JournalThresholdSize ) ; if ( journalSizeFlush ) return true ; return false ; }

Target:
private boolean checkForJournalFlush() { if ( queue.size() >= QueueBatchSize ) return true ; boolean journalSizeFlush = (JournalThresholdSize > 0 && journal.size() > JournalThresholdSize ) ; if ( journalSizeFlush ) return true ; return false ; }
Source:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, BeanDefinitionParserDelegate.SCOPE_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "host"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "port"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "scheme"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "app"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "owner"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "username"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "password"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "timeout"); IntegrationNamespaceUtils.setValueIfAttributeDefined( builder, element, "testOnBorrow" ); }

Target:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, BeanDefinitionParserDelegate.SCOPE_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "host"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "port"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "scheme"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "app"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "owner"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "username"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "password"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "timeout"); IntegrationNamespaceUtils.setValueIfAttributeDefined( builder, element, "checkServiceOnBorrow" ); }
Source:
public void setAbsolutePath(String absolutePath) { this.absolutePath = ZipSourceFileHelper.addLeadingSlashIfNecessary((absolutePath)); if (this.absolutePath.equals(absolutePath)) { LOG.warn("Absolute path workaround used, this should be fixed at some point"); } }

Target:
public void setAbsolutePath(String absolutePath) { this.absolutePath = ZipSourceFileHelper.addLeadingSlashIfNecessary((absolutePath)); if (!this.absolutePath.equals(absolutePath)) { LOG.warn("Absolute path workaround used, this should be fixed at some point"); } }
Source:
void writeColumnChunk(ColumnDescriptor descriptor, long valueCount, CompressionCodecName compressionCodecName, DictionaryPage dictionaryPage, BytesInput bytes, long uncompressedTotalPageSize, long compressedTotalPageSize, Statistics<?> totalStats, ColumnIndexBuilder columnIndexBuilder, OffsetIndexBuilder offsetIndexBuilder, BloomFilter bloomFilter, Set<Encoding> rlEncodings, Set<Encoding> dlEncodings, List<Encoding> dataEncodings) throws IOException { startColumn(descriptor, valueCount, compressionCodecName); state = state.write(); if (dictionaryPage != null) { writeDictionaryPage(dictionaryPage); } else if (bloomFilter != null) { currentBloomFilters.add(bloomFilter); } LOG.debug("{}: write data pages", out.getPos()); long headersSize = bytes.size() - compressedTotalPageSize; this.uncompressedLength += uncompressedTotalPageSize + headersSize; this.compressedLength += compressedTotalPageSize + headersSize; LOG.debug("{}: write data pages content", out.getPos()); firstPageOffset = out.getPos(); bytes.writeAllTo(out); encodingStatsBuilder.addDataEncodings(dataEncodings); if (rlEncodings.isEmpty()) { encodingStatsBuilder.withV2Pages(); } currentEncodings.addAll(rlEncodings); currentEncodings.addAll(dlEncodings); currentEncodings.addAll(dataEncodings); currentStatistics = totalStats; this.columnIndexBuilder = columnIndexBuilder; this.offsetIndexBuilder = offsetIndexBuilder; endColumn(); }

Target:
void writeColumnChunk(ColumnDescriptor descriptor, long valueCount, CompressionCodecName compressionCodecName, DictionaryPage dictionaryPage, BytesInput bytes, long uncompressedTotalPageSize, long compressedTotalPageSize, Statistics<?> totalStats, ColumnIndexBuilder columnIndexBuilder, OffsetIndexBuilder offsetIndexBuilder, BloomFilter bloomFilter, Set<Encoding> rlEncodings, Set<Encoding> dlEncodings, List<Encoding> dataEncodings) throws IOException { startColumn(descriptor, valueCount, compressionCodecName); state = state.write(); if (dictionaryPage != null) { writeDictionaryPage(dictionaryPage); } if (bloomFilter != null) { boolean isWriteBloomFilter = false; for (Encoding encoding : dataEncodings) { if (encoding != Encoding.RLE_DICTIONARY) { isWriteBloomFilter = true; break; } } if (isWriteBloomFilter) { currentBloomFilters.put(String.join(".", descriptor.getPath()), bloomFilter); } } LOG.debug("{}: write data pages", out.getPos()); long headersSize = bytes.size() - compressedTotalPageSize; this.uncompressedLength += uncompressedTotalPageSize + headersSize; this.compressedLength += compressedTotalPageSize + headersSize; LOG.debug("{}: write data pages content", out.getPos()); firstPageOffset = out.getPos(); bytes.writeAllTo(out); encodingStatsBuilder.addDataEncodings(dataEncodings); if (rlEncodings.isEmpty()) { encodingStatsBuilder.withV2Pages(); } currentEncodings.addAll(rlEncodings); currentEncodings.addAll(dlEncodings); currentEncodings.addAll(dataEncodings); currentStatistics = totalStats; this.columnIndexBuilder = columnIndexBuilder; this.offsetIndexBuilder = offsetIndexBuilder; endColumn(); }
Source:
public void verifyMapOpenedForDeleteMapTests() { waitForElementVisibleByElement(mapFrame); driver.switchTo().frame(mapFrame); driver.switchTo().defaultContent(); PageObjectLogging.log("verifyMapOpenedForDeleteMapTests", "Map was opened", true); }

Target:
public void verifyMapOpenedForDeleteMapTests() { waitForElementVisibleByElement(mapFrame); PageObjectLogging.log("verifyMapOpenedForDeleteMapTests", "Map was opened", true); }
Source:
public void deleteUnauthorized() throws Exception { context.turnOffAuthorisationSystem(); MetadataSchema metadataSchema = MetadataSchemaBuilder.createMetadataSchema(context, TEST_NAME, TEST_NAMESPACE) .build(); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())).andExpect(status().isOk()); getClient() .perform(delete("/api/core/metadataschemas/" + metadataSchema.getID())) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())).andExpect(status().isOk()); }

Target:
public void deleteUnauthorized() throws Exception { context.turnOffAuthorisationSystem(); MetadataSchema metadataSchema = MetadataSchemaBuilder.createMetadataSchema(context, TEST_NAME, TEST_NAMESPACE) .build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())).andExpect(status().isOk()); getClient() .perform(delete("/api/core/metadataschemas/" + metadataSchema.getID())) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())).andExpect(status().isOk()); }
Source:
private void startEslintBridgeServerProcess() { port = findOpenPort(); ProcessBuilder processBuilder = new ProcessBuilder(nodeExecutable, startServerScript, String.valueOf(port)); try { LOG.debug("Starting node process to start eslint-bridge server at port " + port); process = processBuilder.start(); setProcessStreamConsumers(); if (!waitServerToStart("localhost", port, timeoutSec * 1000)) { LOG.error("Timeout error: failed to start server"); clean(); return; } LOG.debug("Server is started"); } catch (IOException e) { String command = String.join(" ", processBuilder.command()); LOG.error("Failed to start eslint-bridge server process: " + command, e); } }

Target:
private void startEslintBridgeServerProcess() { try { port = findOpenPort(); } catch (IOException e) { LOG.error("Failed to find open port", e); return; } ProcessBuilder processBuilder = new ProcessBuilder(nodeExecutable, startServerScript, String.valueOf(port)); try { LOG.debug("Starting node process to start eslint-bridge server at port " + port); process = processBuilder.start(); setProcessStreamConsumers(); if (!waitServerToStart("localhost", port, timeoutSec * 1000)) { LOG.error("Timeout error: failed to start server"); clean(); return; } LOG.debug("Server is started"); } catch (IOException e) { String command = String.join(" ", processBuilder.command()); LOG.error("Failed to start eslint-bridge server process: " + command, e); } }
Source:
private void computeClusters(List<Cluster> clusters) { Cluster current = new Cluster(); long prevSendTime = -1; long prevRecvTime = -1; for (Probe probe : probes_) { if (prevSendTime >= 0) { long sendDeltaMs = probe.sendTimeMs - prevSendTime; long recvDeltaMs = probe.recvTimeMs - prevRecvTime; if (sendDeltaMs >= 1 && recvDeltaMs >= 1) { ++current.numAboveMinDelta; } if (!IsWithinClusterBounds(sendDeltaMs, current)) { if (current.count >= kMinClusterSize) { addCluster(clusters, current); } current = new Cluster(); } current.sendMeanMs += sendDeltaMs; current.recvMeanMs += recvDeltaMs; current.meanSize += probe.payloadSize; ++current.count; } prevSendTime = probe.sendTimeMs; prevRecvTime = probe.recvTimeMs; } if (current.count >= kMinClusterSize) addCluster(clusters, current); }

Target:
private void computeClusters(List<Cluster> clusters) { Cluster current = new Cluster(); long prevSendTime = -1; long prevRecvTime = -1; for (Probe probe : probes) { if (prevSendTime >= 0) { long sendDeltaMs = probe.sendTimeMs - prevSendTime; long recvDeltaMs = probe.recvTimeMs - prevRecvTime; if (sendDeltaMs >= 1 && recvDeltaMs >= 1) { ++current.numAboveMinDelta; } if (!IsWithinClusterBounds(sendDeltaMs, current)) { if (current.count >= kMinClusterSize) { addCluster(clusters, current); } current = new Cluster(); } current.sendMeanMs += sendDeltaMs; current.recvMeanMs += recvDeltaMs; current.meanSize += probe.payloadSize; ++current.count; } prevSendTime = probe.sendTimeMs; prevRecvTime = probe.recvTimeMs; } if (current.count >= kMinClusterSize) addCluster(clusters, current); }
Source:
public void testCompartmentCreationInHorizontalStack() { compartmentCreationTest(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME, new Point(400, 400)); }

Target:
public void testCompartmentCreationInHorizontalStack() { compartmentCreationTest(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME, new Point(400, 350)); }
Source:
public void keyspaceStats_sunionstoreCommand_existingKey() { jedis.sunionstore("New_Set", EXISTING_SET_KEY_1, EXISTING_SET_KEY_2, "Nonexistent_Set"); jedis.close(); GeodeAwaitility.await().atMost(5, TimeUnit.SECONDS).untilAsserted( () -> { assertThat(server.getServer().getStats().getKeyspaceHits()) .isEqualTo(initialKeyspaceHits + 2); assertThat(server.getServer().getStats().getKeyspaceMisses()) .isEqualTo(initialKeyspaceMisses + 1); }); }

Target:
public void keyspaceStats_sunionstoreCommand_existingKey() { jedis.sunionstore( "New_Set", EXISTING_SET_KEY_1, EXISTING_SET_KEY_2, "Nonexistent_Set"); assertThat(redisStats.getKeyspaceHits()) .isEqualTo(0 + 2); assertThat(redisStats.getKeyspaceMisses()) .isEqualTo(1); }