auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initProjectOptions() { projectOptionsPanel = new VerticalPanel(); projectOptionsPanel.add(new SmallHeading(Util.C.headingProjectOptions())); submitType = new ListBox(); for (final Project.SubmitType type : Project.SubmitType.values()) { submitType.addItem(Util.toLongString(type), type.name()); } submitType.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { if (SubmitType.FAST_FORWARD_ONLY.equals(Project.SubmitType .valueOf(submitType.getValue(submitType.getSelectedIndex())))) { useContentMerge.setEnabled(false); useContentMerge.setValue(false); } else { useContentMerge.setEnabled(true); } } }); saveEnabler.listenTo(submitType); projectOptionsPanel.add(submitType); useContentMerge = new CheckBox(Util.C.useContentMerge(), true); saveEnabler.listenTo(useContentMerge); projectOptionsPanel.add(useContentMerge); requireChangeID = new CheckBox(Util.C.requireChangeID(), true); saveEnabler.listenTo(requireChangeID); projectOptionsPanel.add(requireChangeID); add(projectOptionsPanel); }

Target:
private void initProjectOptions() { projectOptionsPanel = new VerticalPanel(); projectOptionsPanel.add(new SmallHeading(Util.C.headingProjectOptions())); submitType = new ListBox(); for (final Project.SubmitType type : Project.SubmitType.values()) { submitType.addItem(Util.toLongString(type), type.name()); } submitType.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { setEnableForUseContentMerge(); } }); saveEnabler.listenTo(submitType); projectOptionsPanel.add(submitType); useContentMerge = new CheckBox(Util.C.useContentMerge(), true); saveEnabler.listenTo(useContentMerge); projectOptionsPanel.add(useContentMerge); requireChangeID = new CheckBox(Util.C.requireChangeID(), true); saveEnabler.listenTo(requireChangeID); projectOptionsPanel.add(requireChangeID); add(projectOptionsPanel); }
Source:
long skipToNextSegmentIfBigger(long maxBytes) throws IOException { synchronized (PersistentBinaryDeque.this) { if (m_cursorClosed) { throw new IOException("PBD.ReadCursor.skipToNextSegmentIfBigger(): " + m_cursorId + " - Reader has been closed"); } long readerSize = sizeInBytes(); moveToValidSegment(); long segmentSize = m_segment.size(); long lastSegmentId = peekLastSegment().segmentIndex(); if (m_segment.segmentIndex() == lastSegmentId) { long needed = maxBytes - segmentSize; return (needed == 0) ? 1 : needed; } long diff = readerSize - segmentSize; if (diff < maxBytes) { return maxBytes - diff; } skipToNextSegment(); return 0; } }

Target:
long skipToNextSegmentIfBigger(long maxBytes) throws IOException { synchronized (PersistentBinaryDeque.this) { if (m_cursorClosed) { throw new IOException("PBD.ReadCursor.skipToNextSegmentIfBigger(): " + m_cursorId + " - Reader has been closed"); } moveToValidSegment(); long segmentSize = m_segment.getFileSize(); long lastSegmentId = peekLastSegment().segmentIndex(); if (m_segment.segmentIndex() == lastSegmentId) { long needed = maxBytes - segmentSize; return (needed == 0) ? 1 : needed; } long readerSize = readerFizeSize(); long diff = readerSize - segmentSize; if (diff < maxBytes) { return maxBytes - diff; } skipToNextSegment(); return 0; } }
Source:
private ComponentDto loadComponent(DbSession dbSession, ComponentWsRequest request) { String componentKey = request.getComponent(); String componentId = request.getComponentId(); String branch = request.getBranch(); checkArgument(componentId == null || branch == null, "'%s' and '%s' parameters cannot be used at the same time", DEPRECATED_PARAM_COMPONENT_ID, PARAM_BRANCH); return branch == null ? componentFinder.getByUuidOrKey(dbSession, componentId, componentKey, COMPONENT_ID_AND_KEY) : componentFinder.getByKeyAndBranch(dbSession, componentKey, branch); }

Target:
private ComponentDto loadComponent(DbSession dbSession, ComponentWsRequest request) { String componentKey = request.getComponent(); String componentId = request.getComponentId(); String branch = request.getBranch(); checkArgument(componentId == null || branch == null, "'%s' and '%s' parameters cannot be used at the same time", DEPRECATED_PARAM_COMPONENT_ID, PARAM_BRANCH); return branch == null ? componentFinder.getByUuidOrKey(dbSession, componentId, componentKey, COMPONENT_ID_AND_COMPONENT) : componentFinder.getByKeyAndBranch(dbSession, componentKey, branch); }
Source:
protected void configure() { ConfigBinder.of(binder()).bind(GraphiteConfig.class); bind(GraphiteReporterConfiguration.class); }

Target:
protected void configure() { ConfigBinder.of(binder()).bind(GraphiteConfig.class); bind(GraphiteReporter.class).asEagerSingleton(); }
Source:
public OutputStream readFile(String path) { ByteArrayOutputStream output = new ByteArrayOutputStream(); try { S3Object object = client.getObject(new GetObjectRequest(bucketName, path)); IOUtils.copy(object.getObjectContent(), output); } catch (IOException exception) { throw new RuntimeException("Could not read file " + path + " from S3", exception); } logger.debug("Loaded file from S3", path); return output; }

Target:
public InputStream readFile(String path) { return client.getObject(new GetObjectRequest(bucketName, path)) .getObjectContent(); }
Source:
public void testConnectionReplenishment() { AtomicInteger nextCorrelationId = new AtomicInteger(1); Function<Integer, List<RequestInfo>> requestGen = numRequests -> IntStream.range(0, numRequests) .mapToObj( i -> new RequestInfo(sslHost, sslPort, new MockSend(nextCorrelationId.getAndIncrement()), replicaOnSslNode)) .collect(Collectors.toList()); AtomicInteger expectedConnectCalls = new AtomicInteger(3); Runnable checkConnectCalls = () -> Assert.assertEquals(expectedConnectCalls.get(), selector.connectCallCount()); networkClient.warmUpConnections(Collections.singletonList(replicaOnSslNode.getDataNodeId()), 100, 2000, new ArrayList<>()); checkConnectCalls.run(); selector.setState(MockSelectorState.Good); List<ResponseInfo> responseInfoList = networkClient.sendAndPoll(requestGen.apply(3), 100); checkConnectCalls.run(); Assert.assertEquals(3, responseInfoList.size()); selector.setState(MockSelectorState.DisconnectOnSend); responseInfoList = networkClient.sendAndPoll(requestGen.apply(2), 100); checkConnectCalls.run(); Assert.assertEquals(2, responseInfoList.size()); selector.setState(MockSelectorState.Good); responseInfoList = networkClient.sendAndPoll(requestGen.apply(1), 100); expectedConnectCalls.addAndGet(2); checkConnectCalls.run(); Assert.assertEquals(1, responseInfoList.size()); selector.setState(MockSelectorState.Good); responseInfoList = networkClient.sendAndPoll(requestGen.apply(3), 100); checkConnectCalls.run(); Assert.assertEquals(3, responseInfoList.size()); }

Target:
public void testConnectionReplenishment() { AtomicInteger nextCorrelationId = new AtomicInteger(1); Function<Integer, List<RequestInfo>> requestGen = numRequests -> IntStream.range(0, numRequests) .mapToObj( i -> new RequestInfo(sslHost, sslPort, new MockSend(nextCorrelationId.getAndIncrement()), replicaOnSslNode)) .collect(Collectors.toList()); int warmUpPercentage = 100; AtomicInteger expectedConnectCalls = new AtomicInteger(warmUpPercentage * 3 /100); Runnable checkConnectCalls = () -> Assert.assertEquals(expectedConnectCalls.get(), selector.connectCallCount()); networkClient.warmUpConnections(Collections.singletonList(replicaOnSslNode.getDataNodeId()), warmUpPercentage, TIME_FOR_WARM_UP_MS, new ArrayList<>()); checkConnectCalls.run(); selector.setState(MockSelectorState.Good); List<ResponseInfo> responseInfoList = networkClient.sendAndPoll(requestGen.apply(3), POLL_TIMEOUT_MS); checkConnectCalls.run(); Assert.assertEquals(3, responseInfoList.size()); selector.setState(MockSelectorState.DisconnectOnSend); responseInfoList = networkClient.sendAndPoll(requestGen.apply(2), POLL_TIMEOUT_MS); checkConnectCalls.run(); Assert.assertEquals(2, responseInfoList.size()); selector.setState(MockSelectorState.Good); responseInfoList = networkClient.sendAndPoll(requestGen.apply(1), POLL_TIMEOUT_MS); expectedConnectCalls.addAndGet(2); checkConnectCalls.run(); Assert.assertEquals(1, responseInfoList.size()); selector.setState(MockSelectorState.Good); responseInfoList = networkClient.sendAndPoll(requestGen.apply(3), POLL_TIMEOUT_MS); checkConnectCalls.run(); Assert.assertEquals(3, responseInfoList.size()); }
Source:
public CreateDataCenterRequestBinder() { super("dataCenter"); this.requestBuilder = new StringBuilder(128); }

Target:
CreateDataCenterRequestBinder() { super("dataCenter"); this.requestBuilder = new StringBuilder(128); }
Source:
public Map<String, String> genLinks(Workspace workspace, ServiceContext serviceContext) throws ServerException { final UriBuilder uriBuilder = serviceContext.getServiceUriBuilder(); final LinkedHashMap<String, String> links = new LinkedHashMap<>(); links.put( LINK_REL_SELF, uriBuilder .clone() .path(WorkspaceService.class) .path(WorkspaceService.class, "getByKey") .build(workspace.getId()) .toString()); links.put( LINK_REL_IDE_URL, uriBuilder .clone() .replacePath("") .path(workspace.getNamespace()) .path(workspace.getConfig().getName()) .build() .toString()); if (workspace.getStatus() != WorkspaceStatus.STOPPED) { addRuntimeLinks(links, workspace.getId(), uriBuilder.clone().build().getHost()); } return links; }

Target:
public Map<String, String> genLinks(Workspace workspace, ServiceContext serviceContext) throws ServerException { final UriBuilder uriBuilder = serviceContext.getServiceUriBuilder(); final LinkedHashMap<String, String> links = new LinkedHashMap<>(); links.put( LINK_REL_SELF, uriBuilder .clone() .path(WorkspaceService.class) .path(WorkspaceService.class, "getByKey") .build(workspace.getId()) .toString()); links.put( LINK_REL_IDE_URL, uriBuilder .clone() .replacePath("") .path(workspace.getNamespace()) .path(workspace.getConfig().getName()) .build() .toString()); if (workspace.getStatus() != WorkspaceStatus.STOPPED) { addRuntimeLinks(links, workspace.getId(), serviceContext); } return links; }
Source:
public void saveEntityShouldWork() throws Exception { ArtifactEntry artifactEntry = new ArtifactEntry(); artifactEntry.setStorageId(storageId); artifactEntry.setRepositoryId(repositoryId); artifactEntry.setArtifactCoordinates(new NullArtifactCoordinates(String.format("%s/%s/%s/%s", groupId, artifactId + "123", "1.2.3", "jar"))); ArtifactEntry savedArtifactEntry = artifactEntryService.save(artifactEntry); assertThat(savedArtifactEntry.getCreated(), CoreMatchers.notNullValue()); }

Target:
public void saveEntityShouldWork() throws Exception { ArtifactEntry artifactEntry = new ArtifactEntry(); artifactEntry.setStorageId(storageId); artifactEntry.setRepositoryId(repositoryId); artifactEntry.setArtifactCoordinates(new NullArtifactCoordinates(String.format("%s/%s/%s/%s", groupId, artifactId + "123", "1.2.3", "jar"))); assertThat(artifactEntry.getCreated(), CoreMatchers.nullValue()); artifactEntry = artifactEntryService.save(artifactEntry); assertThat(artifactEntry.getCreated(), CoreMatchers.notNullValue()); Date creationDate = artifactEntry.getCreated(); artifactEntry.setDownloadCount(1); artifactEntry = artifactEntryService.save(artifactEntry); assertEquals(artifactEntry.getCreated(), creationDate); }
Source:
void collectMetrics() { if (enabled()) { for (Map.Entry<String, LlapManagementProtocolClientImpl> entry : llapClients.entrySet()) { String identity = entry.getKey(); LlapManagementProtocolClientImpl client = entry.getValue(); try { LlapDaemonProtocolProtos.GetDaemonMetricsResponseProto metrics = client.getDaemonMetrics(null, LlapDaemonProtocolProtos.GetDaemonMetricsRequestProto.newBuilder().build()); instanceStatisticsMap.put(identity, new LlapMetrics(metrics)); } catch (ServiceException ex) { LOG.error(ex.getMessage(), ex); } } } }

Target:
void collectMetrics() { for (Map.Entry<String, LlapManagementProtocolClientImpl> entry : llapClients.entrySet()) { String identity = entry.getKey(); LlapManagementProtocolClientImpl client = entry.getValue(); try { LlapDaemonProtocolProtos.GetDaemonMetricsResponseProto metrics = client.getDaemonMetrics(null, LlapDaemonProtocolProtos.GetDaemonMetricsRequestProto.newBuilder().build()); instanceStatisticsMap.put(identity, new LlapMetrics(metrics)); } catch (ServiceException ex) { LOG.error(ex.getMessage(), ex); instanceStatisticsMap.remove(identity); } } }
Source:
LocalDiskRepositoryManager(SitePaths site, @GerritServerConfig Config cfg, NotesMigration notesMigration, RepositoryConfig repositoryCfg) { basePath = site.resolve(cfg.getString("gerrit", null, "basePath")); if (basePath == null) { throw new IllegalStateException("gerrit.basePath must be configured"); } if (notesMigration.enabled()) { noteDbPath = site.resolve(MoreObjects.firstNonNull( cfg.getString("gerrit", null, "noteDbPath"), "notedb")); } else { noteDbPath = null; } this.repositoryCfg = repositoryCfg; for (String alternateBasePath : repositoryCfg.getAllBasePaths()) { if (!new File(alternateBasePath).isAbsolute()) { throw new IllegalStateException( "repository.<name>.basePath must be absolute path"); } } namesUpdateLock = new ReentrantLock(true ); names = list(); }

Target:
LocalDiskRepositoryManager(SitePaths site, @GerritServerConfig Config cfg, NotesMigration notesMigration, RepositoryConfig repositoryCfg) { basePath = site.resolve(cfg.getString("gerrit", null, "basePath")); if (basePath == null) { throw new IllegalStateException("gerrit.basePath must be configured"); } if (notesMigration.enabled()) { noteDbPath = site.resolve(MoreObjects.firstNonNull( cfg.getString("gerrit", null, "noteDbPath"), "notedb")); } else { noteDbPath = null; } this.repositoryCfg = repositoryCfg; for (String alternateBasePath : repositoryCfg.getAllBasePaths()) { if(!new File(alternateBasePath).isAbsolute()){ throw new IllegalStateException("repository.<name>.basePath must be " + "absolute path, change the following path: " + alternateBasePath); } } namesUpdateLock = new ReentrantLock(true ); names = list(); }
Source:
public void setUp() throws Exception { Script script = BrickTestUtils.createProjectAndGetStartScript("LegoSensorPortConfigDialogTest"); script.addBrick(new ChangeSizeByNBrick(0)); legoNXTBrickSetting = getNXTBrickSetting(); setNXTBrickSetting(true); sensorMapping = SettingsFragment.getLegoNXTSensorMapping(InstrumentationRegistry.getTargetContext()); SettingsFragment.setLegoMindstormsNXTSensorMapping(InstrumentationRegistry.getTargetContext(), new NXTSensor.Sensor[] {NXTSensor.Sensor.NO_SENSOR, NXTSensor.Sensor.NO_SENSOR, NXTSensor.Sensor.NO_SENSOR, NXTSensor.Sensor.NO_SENSOR}); baseActivityTestRule.launchActivity(); onBrickAtPosition(1).onChildView(withId(R.id.brick_change_size_by_edit_text)).perform(click()); String formulaEditorSensorString = UiTestUtils.getResourcesString(R.string.formula_editor_sensor_lego_nxt_touch); onFormulaEditor().performOpenCategory(FormulaEditorWrapper.Category.DEVICE); onRecyclerView().performOnItemWithText(formulaEditorSensorString, click()); }

Target:
public void setUp() throws Exception { Script script = BrickTestUtils.createProjectAndGetStartScript("LegoSensorPortConfigDialogTest"); script.addBrick(new ChangeSizeByNBrick(0)); legoNXTBrickSetting = getNXTBrickSetting(); setNXTBrickSetting(true); sensorMapping = SettingsFragment.getLegoNXTSensorMapping(InstrumentationRegistry.getTargetContext()); SettingsFragment.setLegoMindstormsNXTSensorMapping(InstrumentationRegistry.getTargetContext(), new NXTSensor.Sensor[] {NXTSensor.Sensor.NO_SENSOR, NXTSensor.Sensor.NO_SENSOR, NXTSensor.Sensor.NO_SENSOR, NXTSensor.Sensor.NO_SENSOR}); baseActivityTestRule.launchActivity(); }
Source:
public void testRemoveFromNonOwner() { for (Cache<Object, String> c : caches) assert c.isEmpty(); Object retval = getFirstNonOwner("k1").put("k1", "value"); asyncWait("k1", PutKeyValueCommand.class); if (testRetVals) assert retval == null; retval = getOwners("k1")[0].remove("k1"); asyncWait("k1", RemoveCommand.class); if (testRetVals) assert "value".equals(retval); assertRemovedOnAllCaches("k1"); }

Target:
public void testRemoveFromNonOwner() { Object retval = getFirstNonOwner("k1").put("k1", "value"); asyncWait("k1", PutKeyValueCommand.class); if (testRetVals) assert retval == null; retval = getOwners("k1")[0].remove("k1"); asyncWait("k1", RemoveCommand.class); if (testRetVals) assert "value".equals(retval); assertRemovedOnAllCaches("k1"); }
Source:
protected IContributionItem[] getContributionItems() { List<IContributionItem> result = new ArrayList<>(); ISelection selection = serviceLocator .getService(ISelectionService.class).getSelection(); final List<File> selectedRepoDirectories = getDirectoriesOfSelectedRepositoryNodes( selection); if (!selectedRepoDirectories.isEmpty()) { final RepositoryGroups groupsUtil = RepositoryGroups.getInstance(); addStaticItems(groupsUtil, selectedRepoDirectories, result); List<RepositoryGroup> groups = groupsUtil.getGroups(); Collections.sort(groups, (g1, g2) -> CommonUtils.STRING_ASCENDING_COMPARATOR .compare(g1.getName(), g2.getName())); if (!groups.isEmpty()) { result.add(new Separator()); for (RepositoryGroup group : groups) { result.add(getAssignGroupItem(groupsUtil, group, selectedRepoDirectories)); } } } return result.toArray(new IContributionItem[0]); }

Target:
protected IContributionItem[] getContributionItems() { List<IContributionItem> result = new ArrayList<>(); ISelection selection = serviceLocator .getService(ISelectionService.class).getSelection(); List<RepositoryNode> selectedRepoNodes = getRepositoryNodes(selection); final List<File> selectedRepoDirectories = selectedRepoNodes.stream() .map(node -> node.getRepository().getDirectory()) .collect(Collectors.toList()); if (!selectedRepoDirectories.isEmpty()) { final RepositoryGroups groupsUtil = RepositoryGroups.getInstance(); addStaticItems(groupsUtil, selectedRepoDirectories, result); List<RepositoryGroup> groups = getMoveTargetGroups(groupsUtil, selectedRepoNodes); if (!groups.isEmpty()) { result.add(new Separator()); for (RepositoryGroup group : groups) { result.add(getAssignGroupItem(groupsUtil, group, selectedRepoDirectories)); } } } return result.toArray(new IContributionItem[0]); }
Source:
private static List<Attribute> parseAttributes(String attributesLine) { ArrayList<Attribute> result = new ArrayList<Attribute>(); for (String attribute : attributesLine.split(" ")) { attribute = attribute.trim(); if (attribute.length() == 0) continue; if (attribute.startsWith("-")) { result.add(new Attribute(attribute.substring(1), State.UNSET)); continue; } final int equalsIndex = attribute.indexOf("="); if (equalsIndex == -1) result.add(new Attribute(attribute, State.SET)); else result.add(new Attribute(attribute.substring(0, equalsIndex), attribute.substring(equalsIndex + 1))); } return result; }

Target:
private static List<Attribute> parseAttributes(String attributesLine) { ArrayList<Attribute> result = new ArrayList<Attribute>(); for (String attribute : attributesLine.split(ATTRIBUTES_SPLIT_REGEX)) { attribute = attribute.trim(); if (attribute.length() == 0) continue; if (attribute.startsWith("-")) { result.add(new Attribute(attribute.substring(1), State.UNSET)); continue; } final int equalsIndex = attribute.indexOf("="); if (equalsIndex == -1) result.add(new Attribute(attribute, State.SET)); else result.add(new Attribute(attribute.substring(0, equalsIndex), attribute.substring(equalsIndex + 1))); } return result; }
Source:
private Iterable<Resource> processSearchExpression(String expression, ResourceCriteria criteria, CriteriaQueryExecutor<Resource, ResourceCriteria> queryExecutor, PropertyOptionsSource.ExpressionScope expressionScope, Predicate<Resource> baseResourcePredicate) { Iterable<Resource> foundResources; criteria.setSearchExpression(expression); foundResources = new CriteriaQuery<Resource, ResourceCriteria>(criteria, queryExecutor); if (expressionScope == PropertyOptionsSource.ExpressionScope.BASE_RESOURCE && baseResourcePredicate != null) { foundResources = Iterables.filter(foundResources, baseResourcePredicate); } return foundResources; }

Target:
private Iterable<Resource> processSearchExpression(String expression, ResourceCriteria criteria, CriteriaQueryExecutor<Resource, ResourceCriteria> queryExecutor, PropertyOptionsSource.ExpressionScope expressionScope, Predicate<Resource> baseResourcePredicate) { criteria.setSearchExpression(expression); Iterable<Resource> foundResources = new CriteriaQuery<Resource, ResourceCriteria>(criteria, queryExecutor); if (expressionScope == PropertyOptionsSource.ExpressionScope.BASE_RESOURCE && baseResourcePredicate != null) { foundResources = Iterables.filter(foundResources, baseResourcePredicate); } return foundResources; }
Source:
public void rejectsInvalidCaseConversionFlags() throws Exception { SimpleAuthorityMapper mapper = new SimpleAuthorityMapper(); mapper.setConvertToLowerCase(true); mapper.setConvertToUpperCase(true); assertThatIllegalArgumentException().isThrownBy(mapper::afterPropertiesSet); }

Target:
public void rejectsInvalidCaseConversionFlags() { SimpleAuthorityMapper mapper = new SimpleAuthorityMapper(); mapper.setConvertToLowerCase(true); mapper.setConvertToUpperCase(true); assertThatIllegalArgumentException().isThrownBy(mapper::afterPropertiesSet); }
Source:
getQuestionResponseMapByRecipientTeam() { LinkedHashMap<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>> sortedMap = new LinkedHashMap<>(); Collections.sort(responses, compareByTeamQuestionRecipientTeamGiver); for (FeedbackResponseAttributes response : responses) { String recipientTeam = getTeamNameForEmail(response.recipient); if (recipientTeam.isEmpty()) { recipientTeam = getNameForEmail(response.recipient); } sortedMap.putIfAbsent(recipientTeam, new LinkedHashMap<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>()); Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> responsesForOneRecipient = sortedMap.get(recipientTeam); FeedbackQuestionAttributes question = questions.get(response.feedbackQuestionId); responsesForOneRecipient.putIfAbsent(question, new ArrayList<FeedbackResponseAttributes>()); List<FeedbackResponseAttributes> responsesForOneRecipientOneQuestion = responsesForOneRecipient.get(question); responsesForOneRecipientOneQuestion.add(response); } return sortedMap; }

Target:
getQuestionResponseMapByRecipientTeam() { LinkedHashMap<String, Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>>> sortedMap = new LinkedHashMap<>(); responses.sort(compareByTeamQuestionRecipientTeamGiver); for (FeedbackResponseAttributes response : responses) { String recipientTeam = getTeamNameForEmail(response.recipient); if (recipientTeam.isEmpty()) { recipientTeam = getNameForEmail(response.recipient); } Map<FeedbackQuestionAttributes, List<FeedbackResponseAttributes>> responsesForOneRecipient = sortedMap.computeIfAbsent(recipientTeam, key -> new LinkedHashMap<>()); FeedbackQuestionAttributes question = questions.get(response.feedbackQuestionId); List<FeedbackResponseAttributes> responsesForOneRecipientOneQuestion = responsesForOneRecipient.computeIfAbsent(question, key -> new ArrayList<>()); responsesForOneRecipientOneQuestion.add(response); } return sortedMap; }
Source:
private static void setupPortMargins(final NodeContext nodeContext, final PortSide portSide) { Collection<PortContext> portContexts = nodeContext.portContexts.get(portSide); boolean portLabelsOutside = nodeContext.portLabelsPlacement.contains(PortLabelPlacement.OUTSIDE); boolean spaceEfficientPortLabels = nodeContext.portLabelsPlacement.contains(PortLabelPlacement.SPACE_EFFICIENT) || portContexts.size() == 2; boolean uniformPortSpacing = nodeContext.sizeOptions.contains(SizeOptions.UNIFORM_PORT_SPACING); computeHorizontalPortMargins(nodeContext, portSide, portLabelsOutside); PortContext leftmostPortContext = null; PortContext rightmostPortContext = null; if (portLabelsOutside) { Iterator<PortContext> portContextIterator = portContexts.iterator(); leftmostPortContext = portContextIterator.next(); rightmostPortContext = leftmostPortContext; while (portContextIterator.hasNext()) { rightmostPortContext = portContextIterator.next(); } leftmostPortContext.portMargin.left = 0; rightmostPortContext.portMargin.right = 0; if (spaceEfficientPortLabels && !leftmostPortContext.labelsNextToPort) { leftmostPortContext.portMargin.right = 0; } } if (uniformPortSpacing) { unifyPortMargins(portContexts); if (portLabelsOutside) { leftmostPortContext.portMargin.left = 0; rightmostPortContext.portMargin.right = 0; } } }

Target:
private static void setupPortMargins(final NodeContext nodeContext, final PortSide portSide) { Collection<PortContext> portContexts = nodeContext.portContexts.get(portSide); boolean portLabelsOutside = nodeContext.portLabelsPlacement.contains(PortLabelPlacement.OUTSIDE); boolean alwaysSameSide = nodeContext.portLabelsPlacement.contains(PortLabelPlacement.ALWAYS_SAME_SIDE); boolean spaceEfficient = nodeContext.portLabelsPlacement.contains(PortLabelPlacement.SPACE_EFFICIENT); boolean uniformPortSpacing = nodeContext.sizeOptions.contains(SizeOptions.UNIFORM_PORT_SPACING); boolean spaceEfficientPortLabels = !alwaysSameSide && (spaceEfficient || portContexts.size() == 2); computeHorizontalPortMargins(nodeContext, portSide, portLabelsOutside); PortContext leftmostPortContext = null; PortContext rightmostPortContext = null; if (portLabelsOutside) { Iterator<PortContext> portContextIterator = portContexts.iterator(); leftmostPortContext = portContextIterator.next(); rightmostPortContext = leftmostPortContext; while (portContextIterator.hasNext()) { rightmostPortContext = portContextIterator.next(); } leftmostPortContext.portMargin.left = 0; rightmostPortContext.portMargin.right = 0; if (spaceEfficientPortLabels && !leftmostPortContext.labelsNextToPort) { leftmostPortContext.portMargin.right = 0; } } if (uniformPortSpacing) { unifyPortMargins(portContexts); if (portLabelsOutside) { leftmostPortContext.portMargin.left = 0; rightmostPortContext.portMargin.right = 0; } } }
Source:
private Rectangle computeShellBounds() { Rectangle result = new Rectangle( 0, 0, 0, 0 ); Point preferredSize = shell.computeSize( SWT.DEFAULT, SWT.DEFAULT ); Rectangle parentSize = parent.getDisplay().getBounds(); result.x = ( parentSize.width - preferredSize.x ) / 2 + parentSize.x; result.y = ( parentSize.height - preferredSize.y ) / 2 + parentSize.y; result.width = Math.min( preferredSize.x, MAX_WIDTH ); result.height = preferredSize.y; return result; }

Target:
private Rectangle computeShellBounds() { Rectangle result = new Rectangle( 0, 0, 0, 0 ); Point preferredSize = shell.computeSize( SWT.DEFAULT, SWT.DEFAULT ); Rectangle displaySize = parent.getDisplay().getBounds(); result.x = ( displaySize.width - preferredSize.x ) / 2 + displaySize.x; result.y = ( displaySize.height - preferredSize.y ) / 2 + displaySize.y; result.width = Math.min( preferredSize.x, MAX_WIDTH ); result.height = preferredSize.y; return result; }
Source:
public boolean enableWagedRebalance(String clusterName, List<String> resourceNames) { if (clusterName == null || clusterName.isEmpty()) { throw new HelixException("Cluster name is invalid!"); } if (resourceNames == null || resourceNames.isEmpty()) { throw new HelixException("Resource name list is invalid!"); } HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<>(_zkClient)); PropertyKey.Builder keyBuilder = accessor.keyBuilder(); List<IdealState> idealStates = new ArrayList<>(); List<PropertyKey> idealStateKeys = new ArrayList<>(); List<String> nullIdealStates = new ArrayList<>(); for (String resourceName : resourceNames) { PropertyKey key = keyBuilder.idealStates(resourceName); IdealState idealState = accessor.getProperty(key); if (idealState == null) { nullIdealStates.add(resourceName); } else { idealState.setRebalancerClassName(WagedRebalancer.class.getName()); idealState.setRebalanceMode(RebalanceMode.FULL_AUTO); idealStates.add(idealState); idealStateKeys.add(key); } } if (!nullIdealStates.isEmpty()) { throw new HelixException( String.format("Not all IdealStates exist in the cluster: %s", nullIdealStates)); } boolean[] success = accessor.setChildren(idealStateKeys, idealStates); for (boolean s : success) { if (!s) { return false; } } return true; }

Target:
public boolean enableWagedRebalance(String clusterName, List<String> resourceNames) { if (clusterName == null || clusterName.isEmpty()) { throw new HelixException("Cluster name is invalid!"); } if (resourceNames == null || resourceNames.isEmpty()) { throw new HelixException("Resource name list is invalid!"); } HelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<>(_zkClient)); PropertyKey.Builder keyBuilder = accessor.keyBuilder(); List<IdealState> enabledIdealStates = new ArrayList<>(); List<PropertyKey> enabledIdealStateKeys = new ArrayList<>(); Set<String> enabledResourceNames = new HashSet<>(); List<IdealState> idealStates = accessor.getChildValues(keyBuilder.idealStates(), true); for (IdealState idealState : idealStates) { if (idealState != null && resourceNames.contains(idealState.getResourceName())) { idealState.setRebalancerClassName(WagedRebalancer.class.getName()); idealState.setRebalanceMode(RebalanceMode.FULL_AUTO); enabledIdealStates.add(idealState); enabledIdealStateKeys.add(keyBuilder.idealStates(idealState.getResourceName())); enabledResourceNames.add(idealState.getResourceName()); } } List<String> resourcesNotFound = resourceNames.stream().filter(resourceName -> !enabledResourceNames.contains(resourceName)) .collect(Collectors.toList()); if (!resourcesNotFound.isEmpty()) { throw new HelixException( String.format("Some resources do not have IdealStates: %s", resourcesNotFound)); } boolean[] success = accessor.setChildren(enabledIdealStateKeys, enabledIdealStates); for (boolean s : success) { if (!s) { return false; } } return true; }
Source:
public void onClose(int statusCode, String reason) { session = null; connected = false; logger.debug("Closing a WebSocket due to {}", reason); scheduler.submit(new Runnable() { @Override public void run() { try { eventHandler.onConnectionClosed(); } catch (Exception e) { logger.error("Error handling onConnectionClosed()", e); } } }); }

Target:
public void onClose(int statusCode, String reason) { session = null; connected = false; logger.debug("Closing a WebSocket due to {}", reason); scheduler.submit(() -> { try { eventHandler.onConnectionClosed(); } catch (Exception e) { logger.error("Error handling onConnectionClosed()", e); } }); }
Source:
protected ModelAndView generateRevocationResponse(final String token, final String clientId, final HttpServletResponse response) { val registryToken = getOAuthConfigurationContext().getTicketRegistry().getTicket(token, OAuth20Token.class); if (registryToken == null) { LOGGER.error("Provided token has not been found in the ticket registry", token); } else if (isRefreshToken(registryToken) || isAccessToken(registryToken)) { if (!StringUtils.equals(clientId, registryToken.getClientId())) { LOGGER.error("Provided token has not been issued for the service [{}]", token, clientId); return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST); } if (isRefreshToken(registryToken)) { revokeToken((OAuth20RefreshToken) registryToken); } else { revokeToken(registryToken.getId()); } } else { LOGGER.error("Provided token is either not a refresh token or not an access token", token); return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST); } val mv = new ModelAndView(new MappingJackson2JsonView()); mv.setStatus(HttpStatus.OK); return mv; }

Target:
protected ModelAndView generateRevocationResponse(final String token, final String clientId, final HttpServletResponse response) { val registryToken = getOAuthConfigurationContext().getTicketRegistry().getTicket(token, OAuth20Token.class); if (registryToken == null) { LOGGER.error("Provided token has not been found in the ticket registry", token); } else if (isRefreshToken(registryToken) || isAccessToken(registryToken)) { if (!StringUtils.equals(clientId, registryToken.getClientId())) { LOGGER.warn("Provided token has not been issued for the service [{}]", token, clientId); return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST); } if (isRefreshToken(registryToken)) { revokeToken((OAuth20RefreshToken) registryToken); } else { revokeToken(registryToken.getId()); } } else { LOGGER.error("Provided token is either not a refresh token or not an access token", token); return OAuth20Utils.writeError(response, OAuth20Constants.INVALID_REQUEST); } val mv = new ModelAndView(new MappingJackson2JsonView()); mv.setStatus(HttpStatus.OK); return mv; }
Source:
private void setParentContext(final XQueryContext parentContext) { this.parentContext = parentContext; if (parentContext != null) { this.db = parentContext.db; this.baseURI = parentContext.baseURI; try { if (location.startsWith(XmldbURI.XMLDB_URI_PREFIX) || (location.indexOf(':') < 0 && parentContext.getModuleLoadPath().startsWith(XmldbURI.XMLDB_URI_PREFIX))) { final XmldbURI locationUri = XmldbURI.xmldbUriFor(FileUtils.dirname(location)); if (".".equals(parentContext.getModuleLoadPath())) { setModuleLoadPath(locationUri.toString()); } else { try { final XmldbURI parentLoadUri = XmldbURI.xmldbUriFor(parentContext.getModuleLoadPath()); final XmldbURI moduleLoadUri = parentLoadUri.resolveCollectionPath(locationUri); setModuleLoadPath(moduleLoadUri.toString()); } catch (final URISyntaxException e) { setModuleLoadPath(locationUri.toString()); } } } else { final String dir = FileUtils.dirname(location); if (dir.matches("^[a-z]+:.*")) { moduleLoadPath = dir; } else if (".".equals(parentContext.moduleLoadPath)) { if (!".".equals(dir)) { if (dir.startsWith("/")) { setModuleLoadPath(dir); } else { setModuleLoadPath("./" + dir); } } } else { if (dir.startsWith("/")) { setModuleLoadPath(dir); } else { setModuleLoadPath(FileUtils.addPaths(parentContext.getModuleLoadPath(), dir)); } } } } catch (final URISyntaxException e) { e.printStackTrace(); } } }

Target:
private void setParentContext(final XQueryContext parentContext) { this.parentContext = parentContext; if (parentContext != null) { this.db = parentContext.db; this.baseURI = parentContext.baseURI; try { if (location.startsWith(XmldbURI.XMLDB_URI_PREFIX) || (location.indexOf(':') < 0 && parentContext.getModuleLoadPath().startsWith(XmldbURI.XMLDB_URI_PREFIX))) { final XmldbURI locationUri = XmldbURI.xmldbUriFor(FileUtils.dirname(location)); if (".".equals(parentContext.getModuleLoadPath())) { setModuleLoadPath(locationUri.toString()); } else { try { final XmldbURI parentLoadUri = XmldbURI.xmldbUriFor(parentContext.getModuleLoadPath()); final XmldbURI moduleLoadUri = parentLoadUri.resolveCollectionPath(locationUri); setModuleLoadPath(moduleLoadUri.toString()); } catch (final URISyntaxException e) { setModuleLoadPath(locationUri.toString()); } } } else { final String dir = FileUtils.dirname(location); if (dir.matches("^[A-Za-z]+:.*")) { setModuleLoadPath(dir); } else if (".".equals(parentContext.moduleLoadPath)) { if (!".".equals(dir)) { if (dir.matches("(?:\\/.*)|(?:[a-zA-Z]:\\\\.*)")) { setModuleLoadPath(dir); } else { setModuleLoadPath("./" + dir); } } } else { if (dir.startsWith("/")) { setModuleLoadPath(dir); } else { setModuleLoadPath(FileUtils.addPaths(parentContext.getModuleLoadPath(), dir)); } } } } catch (final URISyntaxException e) { e.printStackTrace(); } } }
Source:
public CompletableFuture<Void> putAsync(K key, V value) { Preconditions.checkNotNull(key); if (value == null) { return deleteAsync(key); } writeMetrics.numPuts.inc(); return asyncHelper.execute(key, value, writeFn::putAsync, writeMetrics.putNs) .exceptionally(e -> { throw new SamzaException(String.format("Failed to put a record, key=%s, value=%s", key, value), e); }); }

Target:
public CompletableFuture<Void> putAsync(K key, V value) { Preconditions.checkNotNull(key); if (value == null) { return deleteAsync(key); } writeMetrics.numPuts.inc(); return execute(writeRateLimiter, key, value, writeFn::putAsync, writeMetrics.putNs) .exceptionally(e -> { throw new SamzaException("Failed to put a record with key=" + key, (Throwable) e); }); }
Source:
public void detachView() { super.detachView(); if (mSubscriptions != null) mSubscriptions.unsubscribe(); }

Target:
public void detachView() { super.detachView(); mSubscriptions.clear(); }
Source:
public void setNull_changePrimaryKeyThrows() { final String[] primaryKeyClasses = {PrimaryKeyAsBoxedByte.CLASS_NAME, PrimaryKeyAsBoxedShort.CLASS_NAME, PrimaryKeyAsBoxedInteger.CLASS_NAME, PrimaryKeyAsBoxedLong.CLASS_NAME, PrimaryKeyAsString.CLASS_NAME}; for (String pkClass : primaryKeyClasses) { dynamicRealm.beginTransaction(); DynamicRealmObject object; try { if (pkClass.equals(PrimaryKeyAsString.CLASS_NAME)) { object = dynamicRealm.createObject(pkClass, ""); object.setNull(PrimaryKeyAsString.FIELD_PRIMARY_KEY); } else { object = dynamicRealm.createObject(pkClass, 0); object.setNull("id"); } fail(); } catch (IllegalArgumentException ignored) { } dynamicRealm.cancelTransaction(); } }

Target:
public void setNull_changePrimaryKeyThrows() { final String[] primaryKeyClasses = {PrimaryKeyAsBoxedByte.CLASS_NAME, PrimaryKeyAsBoxedShort.CLASS_NAME, PrimaryKeyAsBoxedInteger.CLASS_NAME, PrimaryKeyAsBoxedLong.CLASS_NAME, PrimaryKeyAsString.CLASS_NAME}; for (String pkClass : primaryKeyClasses) { dynamicRealm.beginTransaction(); DynamicRealmObject object; boolean isStringPK = pkClass.equals(PrimaryKeyAsString.CLASS_NAME); if (isStringPK) { object = dynamicRealm.createObject(pkClass, ""); } else { object = dynamicRealm.createObject(pkClass, 0); } try { object.setNull(isStringPK ? PrimaryKeyAsString.FIELD_PRIMARY_KEY : "id"); fail(); } catch (IllegalArgumentException ignored) { } dynamicRealm.cancelTransaction(); } }
Source:
private static String canonicalizeForPath(String input, boolean alreadyEncoded) { int codePoint; for (int i = 0, limit = input.length(); i < limit; i += Character.charCount(codePoint)) { codePoint = input.codePointAt(i); if (codePoint < 0x20 || codePoint >= 0x7f || (!alreadyEncoded && (PATH_SEGMENT_ENCODE_SET.indexOf(codePoint) != -1 || codePoint == '%'))) { Buffer out = new Buffer(); out.writeUtf8(input, 0, i); canonicalizeForPath(out, input, i, limit, alreadyEncoded); return out.readUtf8(); } } return input; }

Target:
private static String canonicalizeForPath(String input, boolean alreadyEncoded) { int codePoint; for (int i = 0, limit = input.length(); i < limit; i += Character.charCount(codePoint)) { codePoint = input.codePointAt(i); if (codePoint < 0x20 || codePoint >= 0x7f || PATH_SEGMENT_ALWAYS_ENCODE_SET.indexOf(codePoint) != -1 || (!alreadyEncoded && (codePoint == '/' || codePoint == '%'))) { Buffer out = new Buffer(); out.writeUtf8(input, 0, i); canonicalizeForPath(out, input, i, limit, alreadyEncoded); return out.readUtf8(); } } return input; }
Source:
public static SharedResourceManager create() { return create(() -> Executors.newSingleThreadScheduledExecutor( ExecutorUtils.getThreadFactory("zstream-shared-destroyer-%d", true))); }

Target:
public static SharedResourceManager create() { return create(() -> Executors.newSingleThreadScheduledExecutor( ExecutorUtils.getThreadFactory("bookkeeper-shared-destroyer-%d", true))); }
Source:
public static TimelockService create(TimelockService timelockService, MetricsManager metricsManager) { metricsManager.addMetricFilter( MetricName.builder().safeName(AtlasDbMetricNames.TIMELOCK_SUCCESSFUL_REQUEST).build(), () -> false); metricsManager.addMetricFilter( MetricName.builder().safeName(AtlasDbMetricNames.TIMELOCK_FAILED_REQUEST).build(), () -> false); return new InstrumentedTimelockService(timelockService, metricsManager); }

Target:
public static TimelockService create(TimelockService timelockService, MetricsManager metricsManager) { metricsManager.doNotPublish(SUCCESSFUL_REQUEST_METRIC_NAME); metricsManager.doNotPublish(FAILED_REQUEST_METRIC_NAME); return new InstrumentedTimelockService(timelockService, metricsManager); }
Source:
static double calculateDoubleGaussian(final double val, final double credibleMode, final double credibleLow, final double credibleHigh) { double hiDist = credibleHigh - credibleMode; if (credibleMode >= credibleHigh) { hiDist = MIN_DIST_FROM_MODE; } double loDist = credibleMode - credibleLow; if (credibleMode <= credibleLow) { loDist = MIN_DIST_FROM_MODE; } if (val >= credibleMode) { return new NormalDistribution(credibleMode, hiDist / 1.96).density(val); } else { return new NormalDistribution(credibleMode, loDist / 1.96).density(val); } }

Target:
static double calculateDoubleGaussian(final double val, final double credibleMode, final double credibleLow, final double credibleHigh) { final double hiDist = Math.max(credibleHigh - credibleMode, MIN_DIST_FROM_MODE); final double loDist = Math.max(credibleMode - credibleLow, MIN_DIST_FROM_MODE); return new NormalDistribution(null, credibleMode, ( val >= credibleMode ? hiDist : loDist)/NUM_STD_95_CONF_INTERVAL_GAUSSIAN).density(val); }
Source:
public Context startSpan(Context context, ProcessKind processKind) { Context local = context; String spanName = "Azure.eventhubs." + processKind.getProcessKind(); for (Tracer tracer : tracers) { local = tracer.start(spanName, local, processKind); } return local; }

Target:
public Context startSpan(Context context, ProcessKind processKind) { Context local = Objects.requireNonNull(context, "'context' cannot be null"); Objects.requireNonNull(processKind, "'processKind' cannot be null"); String spanName = getSpanName(processKind); for (Tracer tracer : tracers) { local = tracer.start(spanName, local, processKind); } return local; }
Source:
public SystemCheck(String name, double timeout, SendableBase... systems) { super(name, timeout, Arrays.asList(systems).stream().map(system -> system.getName()).collect(Collectors.toList()) .toArray(String[]::new)); this.systems = systems; }

Target:
public SystemCheck(String name, double timeout, SendableBase... systems) { super(name, timeout, Arrays.asList(systems).stream().map(system -> system.getName()).collect(Collectors.toList()) .toArray(String[]::new)); }
Source:
private void setJoinToSearchingState(){ joinView.setEnabled(false); joinView.findViewById(R.id.searching).setVisibility(View.VISIBLE); joinView.setBackgroundColor(getResources().getColor(R.color.gray)); }

Target:
private void setJoinToSearchingState(){ setJoinState(false, View.VISIBLE, R.color.gray); }
Source:
public static void processProcessChildren(Process mainProcess, LinkedList<TempProcess> childProcesses, Template template, RulesetManagementInterface managementInterface, String acquisitionStage, List<Locale.LanguageRange> priorityList) throws DataException, InvalidMetadataValueException, NoSuchMetadataFieldException, ProcessGenerationException { for (int i = 0; i < childProcesses.size(); i++) { TempProcess tempProcess = childProcesses.get(i); if (Objects.isNull(tempProcess) || Objects.isNull(tempProcess.getProcess())) { logger.error("Child process " + i + " is null => Skip!"); continue; } processTempProcess(tempProcess, template, managementInterface, acquisitionStage, priorityList); Process childProcess = tempProcess.getProcess(); ServiceManager.getProcessService().save(childProcess); ProcessService.setParentRelations(mainProcess, childProcess); } }

Target:
public static void processProcessChildren(Process mainProcess, LinkedList<TempProcess> childProcesses, Template template, RulesetManagementInterface managementInterface, String acquisitionStage, List<Locale.LanguageRange> priorityList) throws DataException, InvalidMetadataValueException, NoSuchMetadataFieldException, ProcessGenerationException { for (TempProcess tempProcess : childProcesses) { if (Objects.isNull(tempProcess) || Objects.isNull(tempProcess.getProcess())) { logger.error("Child process " + (childProcesses.indexOf(tempProcess) + 1) + " is null => Skip!"); continue; } processTempProcess(tempProcess, template, managementInterface, acquisitionStage, priorityList); Process childProcess = tempProcess.getProcess(); ServiceManager.getProcessService().save(childProcess); ProcessService.setParentRelations(mainProcess, childProcess); } }
Source:
public static List<LocatedFileStatus> toListThroughNextCallsAlone( RemoteIterator<LocatedFileStatus> iterator) throws IOException { ArrayList<LocatedFileStatus> list = new ArrayList<>(); try { while (true) { list.add(iterator.next()); } } catch (NoSuchElementException | IllegalStateException expected) { } return list; }

Target:
public static List<LocatedFileStatus> toListThroughNextCallsAlone( RemoteIterator<LocatedFileStatus> iterator) throws IOException { ArrayList<LocatedFileStatus> list = new ArrayList<>(); try { while (true) { list.add(iterator.next()); } } catch (NoSuchElementException expected) { } return list; }
Source:
public void testCsvParserApp() throws IOException, Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties.xml")); lma.prepareDAG(new FileToJdbcCsvParser(), conf); LocalMode.Controller lc = lma.getController(); lc.run(50000); } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }

Target:
public void testCsvParserApp() throws IOException, Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(new File("src/test/resources/test.xml").toURI().toURL()); lma.prepareDAG(new FileToJdbcCsvParser(), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); Thread.sleep(5000); Assert.assertEquals("Events in store", 10, getNumOfEventsInStore()); cleanTable(); } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }
Source:
public RealmEventStreamTaskImpl(final String name, final Executor<T> executor) { Util.checkNull(executor, "executor"); Util.checkNull(executor, "documentClass"); Util.checkNull(executor, "codecRegistry"); this.lock = new ReentrantLock(); this.executor = executor; this.name = name; }

Target:
public RealmEventStreamTaskImpl(final String name, final Executor<T> executor) { Util.checkNull(executor, "name"); Util.checkNull(executor, "executor"); this.lock = new ReentrantLock(); this.executor = executor; this.name = name; }
Source:
public void testNotificationActionBuilder_copiesIcon() { NotificationCompat.Action a = new NotificationCompat.Action.Builder( R.drawable.notification_action_background, "title", null).build(); NotificationCompat.Action aCopy = new NotificationCompat.Action.Builder(a).build(); assertEquals(a.getIconCompat().getResId(), aCopy.getIconCompat().getResId()); }

Target:
public void testNotificationActionBuilder_copiesIcon() { NotificationCompat.Action a = new NotificationCompat.Action.Builder( R.drawable.notification_action_background, "title", null).build(); assertEquals(R.drawable.notification_action_background, a.getIconCompat().getResId()); NotificationCompat.Action aCopy = new NotificationCompat.Action.Builder(a).build(); assertEquals(R.drawable.notification_action_background, aCopy.getIconCompat().getResId()); }
Source:
private void updateIteration() { if (refreshIteration.equals(NUMBER_HOST_REFRESHES_BEFORE_SAVE)) { refreshIteration.set(1); } else { refreshIteration.incrementAndGet(); } }

Target:
private void updateIteration() { if (isTimeToRefreshStatistics()) { refreshIteration.set(1); } else { refreshIteration.incrementAndGet(); } }
Source:
private static SSLContext buildContext(final ConfigContext config) { if (config.tlsInsecure()) { try { LOG.warn("Configuration: tlsInsecure is true. ALL TLS VERIFICATION IS DISABLED!"); return SSLContextBuilder.create() .loadTrustMaterial(new TrustAllStrategy()) .build(); } catch (KeyManagementException | KeyStoreException | NoSuchAlgorithmException e) { LOG.error("error while disabling TLS security", e); throw new RuntimeException(e); } } else { return SSLContexts.createDefault(); } }

Target:
private static SSLContext buildContext(final ConfigContext config) { if (config.tlsInsecure()) { try { LOG.warn("Configuration: tlsInsecure is true. ALL TLS VERIFICATION IS DISABLED!"); return SSLContextBuilder.create() .loadTrustMaterial(new TrustAllStrategy()) .build(); } catch (KeyManagementException | KeyStoreException | NoSuchAlgorithmException e) { final String msg = "error while disabling TLS security"; LOG.error(msg, e); throw new MantaException(msg, e); } } else { return SSLContexts.createDefault(); } }