auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public QueryResult<Alert> queryAlerts(final AlertQuery query) { assertIsOpen(); final Predicate<Alert> containsPredicate = query.getContains() .map(c -> (Predicate<Alert>) a -> a.getDescription().contains(c)) .orElse(e -> true); final ImmutableList<Alert> alerts = _alerts.values().stream() .filter(containsPredicate) .skip(query.getOffset().orElse(0)) .limit(query.getOffset().orElse(1000)) .collect(ImmutableList.toImmutableList()); final long total = _alerts.values().stream() .filter(containsPredicate) .count(); return new DefaultQueryResult<>(alerts, total); }

Target:
public QueryResult<Alert> queryAlerts(final AlertQuery query) { assertIsOpen(); if (!query.getOrganization().equals(_organization)) { return new DefaultQueryResult<>(ImmutableList.of(), 0); } final Predicate<Alert> containsPredicate = query.getContains() .map(c -> (Predicate<Alert>) a -> a.getDescription().contains(c)) .orElse(e -> true); final ImmutableList<Alert> alerts = _alerts.values().stream() .filter(containsPredicate) .skip(query.getOffset().orElse(0)) .limit(query.getLimit()) .collect(ImmutableList.toImmutableList()); final long total = _alerts.values().stream() .filter(containsPredicate) .count(); return new DefaultQueryResult<>(alerts, total); }
Source:
public void run() { final Shell shell = getSite().getShell(); final ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell); try { dialog.run(true, false, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.setTaskName(Messages.DiscoveryViewer_waitingForDiscoveryCompletion); for (ConnectorDescriptorItemUi item : discoveryViewer.getAllConnectorsItemsUi()) { item.getConnectorUnits(); } } }); List<ConnectorDescriptor> toInstall = new ArrayList<ConnectorDescriptor>(discoveryViewer.getInstallableConnectors()); toInstall.addAll(discoveryViewer.getUpdatableConnectors()); JBossDiscoveryUi.install(toInstall, dialog); } catch (Exception ex) { JBossCentralActivator.getDefault().getLog().log(new Status(IStatus.ERROR, JBossCentralActivator.ID, ex.getMessage(), ex)); } }

Target:
public void run() { final Shell shell = getSite().getShell(); final ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell); try { dialog.run(true, false, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.setTaskName(Messages.DiscoveryViewer_waitingForDiscoveryCompletion); for (ConnectorDescriptorItemUi item : discoveryViewer.getAllConnectorsItemsUi()) { item.getConnectorUnits(); } } }); List<ConnectorDescriptor> toInstall = new ArrayList<ConnectorDescriptor>(discoveryViewer.getInstallableConnectors()); toInstall.addAll(discoveryViewer.getUpdatableConnectors()); JBossDiscoveryUi.install(toInstall, dialog); } catch (InterruptedException ex) { JBossCentralActivator.getDefault().getLog().log(new Status(IStatus.ERROR, JBossCentralActivator.ID, ex.getMessage(), ex)); } catch (InvocationTargetException ite) { JBossCentralActivator.getDefault().getLog().log(new Status(IStatus.ERROR, JBossCentralActivator.ID, ite.getMessage(), ite)); } }
Source:
public static Block parse(final mjson.Json blockJson) { final Block block = new Block(); final mjson.Json uri = blockJson.at("url"); if (uri == null) { throw new IllegalArgumentException("No URI found in Htsget data block"); } try { block.uri = new URI(uri.asString()); } catch (final URISyntaxException e) { throw new IllegalArgumentException("Failed to parse URI in Htsget data block", e); } final mjson.Json dataClass = blockJson.at("class"); if (dataClass != null) { block.dataClass = HtsgetClass.valueOf(dataClass.asString().toLowerCase()); } final mjson.Json headers = blockJson.at("headers"); if (headers != null) { block.headers = headers.asJsonMap().entrySet().stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> e.getValue().asString() )); } return block; }

Target:
public static Block parse(final mjson.Json blockJson) { final mjson.Json uriJson = blockJson.at("url"); if (uriJson == null) { throw new HtsgetMalformedResponseException("No URI found in Htsget data block: " + blockJson.toString().substring(0, Math.min(100, blockJson.toString().length()))); } final URI uri; try { uri = new URI(uriJson.asString()); } catch (final URISyntaxException e) { throw new HtsgetMalformedResponseException("Could not parse URI in Htsget data block: " + uriJson.asString(), e); } final mjson.Json dataClassJson = blockJson.at("class"); final HtsgetClass dataClass = dataClassJson == null ? null : HtsgetClass.valueOf(dataClassJson.asString().toLowerCase()); final mjson.Json headersJson = blockJson.at("headers"); final Map<String, String> headers = headersJson == null ? null : headersJson.asJsonMap().entrySet().stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> e.getValue().asString() )); return new Block(uri, headers, dataClass); }
Source:
public void setUpClass() throws Exception { log.info("setting up hive test driver"); }

Target:
public void setUpClass() throws Exception { log.info("setting up hive test driver"); if (testServer == null) { testServer = new HiveTestServer(); } testServer.start(); }
Source:
public Properties trackVideoPlaying(String videoId, Double currentTime, String courseId, String unitUrl){ try{ SegmentAnalyticsEvent aEvent = getCommonPropertiesWithCurrentTime(currentTime, videoId, Values.VIDEO_PLAYED); aEvent.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); tracker.track(Keys.PLAYED_VIDEO, aEvent.properties); return aEvent.properties; }catch(Exception e){ logger.error(e); } return null; }

Target:
public Properties trackVideoPlaying(String videoId, Double currentTime, String courseId, String unitUrl){ SegmentAnalyticsEvent aEvent = getCommonPropertiesWithCurrentTime(currentTime, videoId, Values.VIDEO_PLAYED); aEvent.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); tracker.track(Events.PLAYED_VIDEO, aEvent.properties); return aEvent.properties; }
Source:
public NodesByCommitTimeFilter(String filterText) { if (filterText != null) { Matcher matcher = FILTER_ACTIVE_PATTERN.matcher(filterText); active = matcher.matches(); if (active) { if (filterText.length() > 1) { maxCount = Integer.parseInt(filterText.substring(1)); } filtering = maxCount > 0; } } }

Target:
public NodesByCommitTimeFilter(String filterText) { if (filterText != null) { Matcher matcher = FILTER_ACTIVE_PATTERN.matcher(filterText); active = matcher.matches(); if (active) { if (filterText.length() > 1) { try { maxCount = Integer.parseInt(filterText.substring(1)); } catch (NumberFormatException e) { } } } } }
Source:
public synchronized void aggregate(final ByteBuffer buffer, final int position) { final Object object = selector.getObject(); if (object == null) { return; } final DoublesUnion union = unions.get(buffer).get(position); if (object instanceof DoublesSketch) { union.update((DoublesSketch) object); } else { union.update(selector.getDouble()); } }

Target:
public synchronized void aggregate(final ByteBuffer buffer, final int position) { final DoublesUnion union = unions.get(buffer).get(position); DoublesSketchMergeAggregator.updateUnion(selector, union); }
Source:
public void testGetUnboundEndpoints() throws Exception { Trace trace1 = new Trace(); trace1.setId("1"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - 4000); Consumer c1 = new Consumer(); c1.setUri("testuri"); trace1.getNodes().add(c1); List<Trace> traces = new ArrayList<Trace>(); traces.add(trace1); tracePublisher.publish(null, traces); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 1); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<Trace> result = traceService.searchFragments(null, new Criteria()); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId()); List<EndpointInfo> endpoints = analyticsService.getUnboundEndpoints(null, 0, 0, true); assertNotNull(endpoints); assertEquals(1, endpoints.size()); assertEquals("testuri", endpoints.get(0).getEndpoint()); }

Target:
public void testGetUnboundEndpoints() throws Exception { Trace trace1 = new Trace(); trace1.setId("1"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - FOUR_MS_IN_MICRO_SEC); Consumer c1 = new Consumer(); c1.setUri("testuri"); trace1.getNodes().add(c1); List<Trace> traces = new ArrayList<Trace>(); traces.add(trace1); tracePublisher.publish(null, traces); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 1); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<Trace> result = traceService.searchFragments(null, new Criteria()); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId()); List<EndpointInfo> endpoints = analyticsService.getUnboundEndpoints(null, 0, 0, true); assertNotNull(endpoints); assertEquals(1, endpoints.size()); assertEquals("testuri", endpoints.get(0).getEndpoint()); }
Source:
public void executeSQL_shouldReturnNullGivenEmptyString() { adminService.executeSQL(" ", true); verify(adminDAO, never()).executeSQL("was never called",true); }

Target:
public void executeSQL_shouldReturnNullGivenEmptyString() { adminService.executeSQL(" ", true); verify(adminDAO, never()).executeSQL(anyString(), anyBoolean()); }
Source:
public final boolean shouldTraverse(NodeTraversal t, Node n, Node parent) { switch (n.getType()) { case Token.BLOCK: if (isLoneBlock(n)) { loneBlocks.push(n); } break; case Token.LET: case Token.CONST: allowLoneBlock(n); break; case Token.CLASS: if (NodeUtil.isClassDeclaration(n)) { allowLoneBlock(n); } break; case Token.FUNCTION: if (NodeUtil.isFunctionDeclaration(n)) { allowLoneBlock(n); } break; } return true; }

Target:
public final boolean shouldTraverse(NodeTraversal t, Node n, Node parent) { switch (n.getType()) { case Token.BLOCK: if (isLoneBlock(n)) { loneBlocks.push(n); } break; case Token.LET: case Token.CONST: allowLoneBlock(parent); break; case Token.CLASS: if (NodeUtil.isClassDeclaration(n)) { allowLoneBlock(parent); } break; case Token.FUNCTION: if (NodeUtil.isFunctionDeclaration(n)) { allowLoneBlock(parent); } break; } return true; }
Source:
public void onInteract(PlayerRightClickEvent e) { Player p = e.getPlayer(); if (openGuide(e, SlimefunGuideLayout.BOOK) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { SlimefunGuide.openGuide(p, SlimefunGuideLayout.BOOK); } } else if (openGuide(e, SlimefunGuideLayout.CHEST) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { SlimefunGuide.openGuide(p, SlimefunGuideLayout.CHEST); } } else if (openGuide(e, SlimefunGuideLayout.CHEAT_SHEET) == Result.ALLOW) { if (!p.isSneaking()) { p.chat("/sf cheat"); } else { SlimefunGuideSettings.openSettings(p, e.getItem()); } } }

Target:
public void onInteract(PlayerRightClickEvent e) { Player p = e.getPlayer(); if (openGuide(e, SlimefunGuideLayout.BOOK) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { SlimefunGuide.openGuide(p, SlimefunGuideLayout.BOOK); } } else if (openGuide(e, SlimefunGuideLayout.CHEST) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { SlimefunGuide.openGuide(p, SlimefunGuideLayout.CHEST); } } else if (openGuide(e, SlimefunGuideLayout.CHEAT_SHEET) == Result.ALLOW) { if (p.isSneaking()) { SlimefunGuideSettings.openSettings(p, e.getItem()); } else { p.chat("/sf cheat"); } } }
Source:
public String getOption() { final Function<Path, FileTime> createTimeComp = path -> { try { return Files.readAttributes(path, BasicFileAttributes.class).creationTime(); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }; try (final Stream<Path> dirContents = Files.list(UNPACK_DIRECTORY.toPath())) { return dirContents .max(Comparator.comparing(createTimeComp)) .map(Path::toAbsolutePath) .map(Path::toString) .map( s -> { System.err.println(s); return s; }) .map(s -> StringUtils.replace(super.getOption(), KARAF_HOME, s)) .map(s -> s.replace(File.separator + "bin" + File.separator + "..", File.separator)) .map(s -> s + File.separator) .orElseGet(super::getOption); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }

Target:
public String getOption() { final Function<Path, FileTime> createTimeComp = path -> { try { return Files.readAttributes(path, BasicFileAttributes.class).creationTime(); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }; try (final Stream<Path> dirContents = Files.list(UNPACK_DIRECTORY.toPath())) { return dirContents .max(Comparator.comparing(createTimeComp)) .map(Path::toAbsolutePath) .map(Path::toString) .map( s -> { LOGGER.error(s); return s; }) .map(s -> StringUtils.replace(super.getOption(), KARAF_HOME, s)) .map(s -> s.replace(File.separator + "bin" + File.separator + "..", File.separator)) .map(s -> s + File.separator) .orElseGet(super::getOption); } catch (IOException e) { throw new RuntimeException(UNABLE_TO_DETERMINE_EXAM_DIR_ERROR, e); } }
Source:
private boolean isSra(final File sourceFile) { try { return SRAAccession.isValid(sourceFile.getPath()); } catch (Exception e) { return false; } }

Target:
private boolean isSra(final File sourceFile) { try { return SRAAccession.isValid(sourceFile.getPath()); } catch (final Exception e) { return false; } }
Source:
public ListenableFuture<Object> getEvent() { return future; }

Target:
public ListenableFuture<Object> getEvent() { return nonCancellationPropagating(future); }
Source:
public void testFulltext() throws Exception { createFileWithBlob(); String nxql = "SELECT * FROM Document WHERE ecm:fulltext='search'"; DocumentModelList esRet = ess.query(new NxQueryBuilder(session).nxql(nxql)); Assert.assertEquals(1, esRet.totalSize()); exception.expect(QueryParseException.class); session.query(nxql); }

Target:
public void testFulltext() throws Exception { createFileWithBlob(); String nxql = "SELECT * FROM Document WHERE ecm:fulltext = 'search'"; DocumentModelList esRet = ess.query(new NxQueryBuilder(session).nxql(nxql)); assertEquals(1, esRet.totalSize()); exception.expect(QueryParseException.class); session.query(nxql); }
Source:
public void waitForServerChanges() { if (!resultReceived) { try { waitForChanges.await(); } catch (InterruptedException e) { throw new ObjectServerError(ErrorCode.UNKNOWN, e); } } }

Target:
public void waitForServerChanges() throws InterruptedException { if (!resultReceived) { waitForChanges.await(); } }
Source:
private Optional<String> loadQualityGateDetails(DbSession dbSession, ProjectAndSnapshot projectAndSnapshot, boolean onAnalysis) { if (onAnalysis) { if (!projectAndSnapshot.snapshotDto.isPresent()) { return Optional.empty(); } String analysisUuid = projectAndSnapshot.snapshotDto.get().getUuid(); MeasureQuery measureQuery = MeasureQuery.builder() .setAnalysisUuid(analysisUuid) .setProjectUuids(Collections.singletonList(projectAndSnapshot.project.projectUuid())) .setMetricKey(CoreMetrics.QUALITY_GATE_DETAILS_KEY) .build(); List<MeasureDto> measures = dbClient.measureDao().selectByQuery(dbSession, measureQuery); return measures.isEmpty() ? Optional.empty() : Optional.ofNullable(measures.get(0).getData()); } Optional<LiveMeasureDto> measure = dbClient.liveMeasureDao().selectMeasure(dbSession, projectAndSnapshot.project.projectUuid(), CoreMetrics.QUALITY_GATE_DETAILS_KEY); return measure.map(LiveMeasureDto::getDataAsString); }

Target:
private Optional<String> loadQualityGateDetails(DbSession dbSession, ProjectAndSnapshot projectAndSnapshot, boolean onAnalysis) { if (onAnalysis) { if (!projectAndSnapshot.snapshotDto.isPresent()) { return Optional.empty(); } String analysisUuid = projectAndSnapshot.snapshotDto.get().getUuid(); return dbClient.measureDao().selectMeasure(dbSession, analysisUuid, projectAndSnapshot.project.projectUuid(), CoreMetrics.QUALITY_GATE_DETAILS_KEY) .map(MeasureDto::getData); } Optional<LiveMeasureDto> measure = dbClient.liveMeasureDao().selectMeasure(dbSession, projectAndSnapshot.project.projectUuid(), CoreMetrics.QUALITY_GATE_DETAILS_KEY); return measure.map(LiveMeasureDto::getDataAsString); }
Source:
public void syncStart() { if (_started) { throw new RuntimeException( "Helix Controller already started. Do not call syncStart() more than once."); } else { _started = true; } _watcher = new Thread(this); _watcher.setName(String .format("ClusterManager_Watcher_%s_%s_%s_%d", _clusterName, _instanceName, _type.name(), _uid)); LOG.info("ClusterManager_watcher_{}_{}_{}_{} started, stacktrace {}", _clusterName, _instanceName, _type.name(), _uid, Thread.currentThread().getStackTrace()); _watcher.start(); try { _startCountDown.await(); } catch (InterruptedException e) { LOG.error("Interrupted waiting for start", e); } }

Target:
public void syncStart() { if (_started) { throw new RuntimeException( "Helix Controller already started. Do not call syncStart() more than once."); } else { _started = true; } _watcher = new Thread(this); _watcher.setName(String .format("ClusterManager_Watcher_%s_%s_%s_%d", _clusterName, _instanceName, _type.name(), _uid)); LOG.debug("ClusterManager_watcher_{}_{}_{}_{} started, stacktrace {}", _clusterName, _instanceName, _type.name(), _uid, Thread.currentThread().getStackTrace()); _watcher.start(); try { _startCountDown.await(); } catch (InterruptedException e) { LOG.error("Interrupted waiting for start", e); } }
Source:
public ResponseEntity<Resources<Resource<License>>> getLicensesOfReleases(@PathVariable("id") String id, OAuth2Authentication oAuth2Authentication) { final User sw360User = this.restControllerHelper.getSw360UserFromAuthentication(oAuth2Authentication); final Project project = this.projectService.getProjectForUserById(id, sw360User); final List<Resource<License>> licenseResources = new ArrayList<>(); final Set<String> allLicenseIds = new HashSet<>(); final Map<String, ProjectReleaseRelationship> releaseIdToUsage = project.getReleaseIdToUsage(); for (final String releaseId : releaseIdToUsage.keySet()) { final Release release = this.releaseService.getReleaseForUserById(releaseId, sw360User); final Set<String> licenseIds = release.getMainLicenseIds(); allLicenseIds.addAll(licenseIds); } for (final String licenseId : allLicenseIds) { final License license = this.licenseService.getLicenseById(licenseId); license.setText(null); license.setShortname(null); final Resource<License> licenseResource = new Resource<>(license); licenseResources.add(licenseResource); } final Resources<Resource<License>> resources = new Resources<>(licenseResources); return new ResponseEntity<>(resources, HttpStatus.OK); }

Target:
public ResponseEntity<Resources<Resource<License>>> getLicensesOfReleases(@PathVariable("id") String id, OAuth2Authentication oAuth2Authentication) { final User sw360User = restControllerHelper.getSw360UserFromAuthentication(oAuth2Authentication); final Project project = projectService.getProjectForUserById(id, sw360User); final List<Resource<License>> licenseResources = new ArrayList<>(); final Set<String> allLicenseIds = new HashSet<>(); final Set<String> releaseIdToUsage = project.getReleaseIdToUsage().keySet(); for (final String releaseId : releaseIdToUsage) { final Release release = releaseService.getReleaseForUserById(releaseId, sw360User); final Set<String> licenseIds = release.getMainLicenseIds(); allLicenseIds.addAll(licenseIds); } for (final String licenseId : allLicenseIds) { final License license = licenseService.getLicenseById(licenseId); license.setText(null); license.setShortname(null); final Resource<License> licenseResource = new Resource<>(license); licenseResources.add(licenseResource); } final Resources<Resource<License>> resources = new Resources<>(licenseResources); return new ResponseEntity<>(resources, HttpStatus.OK); }
Source:
public Appendable write(Appendable appendable, Context context) throws IOException { context = createSubcontext(context); appendable.append("new ").append(name.simpleName()); Writables.Joiner.on(", ") .wrap("<", "> ") .appendTo(appendable, context, types) .append('('); if (arguments.isPresent()) { arguments.get().write(appendable, context); } appendable.append(") {"); if (!fieldWriters.isEmpty()) { appendable.append('\n'); } for (VariableWriter fieldWriter : fieldWriters.values()) { fieldWriter.write(new IndentingAppendable(appendable), context).append("\n"); } for (MethodWriter methodWriter : methodWriters) { appendable.append('\n'); methodWriter.write(new IndentingAppendable(appendable), context); } for (TypeWriter nestedTypeWriter : nestedTypeWriters) { appendable.append('\n'); nestedTypeWriter.write(new IndentingAppendable(appendable), context); } appendable.append("}"); return appendable; }

Target:
public Appendable write(Appendable appendable, Context context) throws IOException { context = createSubcontext(context); appendable.append("new ").append(name.simpleName()); Writables.Joiner.on(", ") .wrap("<", ">") .appendTo(appendable, context, typeVariables) .append('('); if (arguments.isPresent()) { arguments.get().write(appendable, context); } appendable.append(") {"); if (!fieldWriters.isEmpty()) { appendable.append('\n'); } for (VariableWriter fieldWriter : fieldWriters.values()) { fieldWriter.write(new IndentingAppendable(appendable), context).append("\n"); } for (MethodWriter methodWriter : methodWriters) { appendable.append('\n'); methodWriter.write(new IndentingAppendable(appendable), context); } for (TypeWriter nestedTypeWriter : nestedTypeWriters) { appendable.append('\n'); nestedTypeWriter.write(new IndentingAppendable(appendable), context); } appendable.append('}'); return appendable; }
Source:
protected String getFinalJdbcConnection(final String jdbc) { final Properties parsedProps = Driver.parseURL(jdbc, null); if (parsedProps == null) { return jdbc; } final boolean sslEnabled = PGProperty.SSL.getBoolean(parsedProps) || "".equals(PGProperty.SSL.get(parsedProps)); final String sslmode = PGProperty.SSL_MODE.get(parsedProps); if (sslEnabled && sslmode == null) { return jdbc.concat(LEGACY_DEFAULT_SSL_MODE); } return jdbc; }

Target:
protected String getFinalJdbcConnection(final String jdbc) { final Properties parsedProps = Driver.parseURL(jdbc, null); if (parsedProps == null) { return jdbc; } final boolean sslEnabled = PGProperty.SSL.getBoolean(parsedProps) || "".equals(PGProperty.SSL.get(parsedProps)); final String sslmode = PGProperty.SSL_MODE.get(parsedProps); if (sslEnabled && sslmode == null) { logger.trace("SSL enabled without SSL mode specified: \"require\" will be used by default, appended to JDBC URL"); return jdbc.concat(LEGACY_DEFAULT_SSL_MODE); } return jdbc; }
Source:
public CustomizedScanInfoBuilder(ScanInfo scanInfo) { this.scanInfo = scanInfo; try { this.scan = new ImmutableScan(new Scan()); } catch (IOException e) { throw new AssertionError("Scan should not throw IOException", e); } }

Target:
public CustomizedScanInfoBuilder(ScanInfo scanInfo) { this.scanInfo = scanInfo; this.scan = new ImmutableScan(new Scan()); }
Source:
public String largestNumber(int[] nums) { Queue<String> queue = new PriorityQueue<>(new Comparator<String>(){ public int compare(String num1, String num2){ return (num2 + num1).compareTo(num1 + num2); } }); for(int num : nums){ queue.offer(num + ""); } StringBuilder sb = new StringBuilder(); while(queue.size() > 0){ sb.append(queue.poll()); } int sLen = sb.length(); int i = 0 ; while(i < sLen && sb.charAt(i) == '0') { i++; } if(i == sLen) return "0"; return sb.substring(i); }

Target:
public String largestNumber(int[] nums) { Queue<String> queue = new PriorityQueue<>(new Comparator<String>(){ public int compare(String num1, String num2){ return (num2 + num1).compareTo(num1 + num2); } }); for(int num : nums){ queue.offer(num + ""); } StringBuilder sb = new StringBuilder(); while(queue.size() > 0){ sb.append(queue.poll()); } if(sb.toString().charAt(0) == '0') return "0"; return sb.toString(); }
Source:
protected void checkPermission(ProjectControl ctl) throws AuthException { if (!ctl.controlForRef(REF_CONFIG).canUpdate()) { throw new AuthException("You are not allowed to perform this operation." + " To submit into this reference you need 'Push' rights."); } }

Target:
protected void checkPermission(ProjectControl ctl) throws AuthException { if (!ctl.controlForRef(REF_CONFIG).canUpdate()) { throw new AuthException("You are not allowed to perform this operation." + " To save changes you need 'Push' rights on " + REF_CONFIG + "."); } }
Source:
public final List<CredentialsDescriptor> getCredentialsDescriptors() { CredentialsProvider provider = getProvider(); List<CredentialsDescriptor> result = DescriptorVisibilityFilter.apply(this, ExtensionList.lookup(CredentialsDescriptor.class)); if (provider != null && provider.isEnabled()) { if (!(result instanceof ArrayList)) { result = new ArrayList<>(result); } result.removeIf(d -> !_isApplicable(d) || !provider._isApplicable(d) || !d.isApplicable(provider)); } return result; }

Target:
public final List<CredentialsDescriptor> getCredentialsDescriptors() { CredentialsProvider provider = getProvider(); List<CredentialsDescriptor> result = DescriptorVisibilityFilter.apply(this, ExtensionList.lookup(CredentialsDescriptor.class)); if (provider != null && provider.isEnabled()) { result = result.stream() .filter(d -> _isApplicable(d) && provider._isApplicable(d) && d.isApplicable(provider)) .collect(Collectors.toList()); } return result; }
Source:
public TooEagerPollingException() { super("Polling for status updates was blocked because you recently retrieved a response indicating empty queue. " + "Next permitted poll time should be retrieved by querying 'getNextPermittedPollTime()' from the previous response. " + "Polling too close to an empty queue response is a programming error."); }

Target:
public TooEagerPollingException() { super("Polling for status updates was blocked because you recently retrieved a response indicating empty queue. " + "Next permitted poll time should be retrieved by querying 'getNextPermittedPollTime()' from the previous response. " + "Polling too soon after an empty queue response is a programming error."); }
Source:
private void initNetworksTable() { networksTable.enableColumnResizing(); AbstractTextColumn<Network> nameColumn = new AbstractTextColumn<Network>() { @Override public String getValue(Network network) { return network.getName(); } }; networksTable.addColumn(nameColumn, constants.name(), "40%"); AbstractTextColumn<Network> descriptionColumn = new AbstractTextColumn<Network>() { @Override public String getValue(Network network) { return network.getDescription(); } }; networksTable.addColumn(descriptionColumn, constants.description(), "60%"); networksTable.setWidth(100 + Style.Unit.PCT.getType()); }

Target:
private void initNetworksTable() { networksTable.enableColumnResizing(); AbstractTextColumn<Network> nameColumn = new AbstractTextColumn<Network>() { @Override public String getValue(Network network) { return network.getName(); } }; networksTable.addColumn(nameColumn, constants.name(), "40%"); AbstractTextColumn<Network> descriptionColumn = new AbstractTextColumn<Network>() { @Override public String getValue(Network network) { return network.getDescription(); } }; networksTable.addColumn(descriptionColumn, constants.description(), "60%"); networksTable.setWidth("100%"); }
Source:
private static String stringifyDate(Date date) { return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'").format(date); }

Target:
private static String stringifyDate(Date date) { return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(date); }
Source:
public static boolean containsAnnotation(DetailAST ast, List<String> annotations) { if (ast == null) { throw new IllegalArgumentException(THE_AST_IS_NULL); } boolean result = false; if (annotations != null && !annotations.isEmpty()) { result = getAnnotation(ast, (annotationNode) -> { DetailAST identNode = annotationNode.findFirstToken(TokenTypes.IDENT); if (identNode == null) { identNode = annotationNode.findFirstToken(TokenTypes.DOT) .findFirstToken(TokenTypes.IDENT); } return annotations.contains(identNode.getText()); }) != null; } return result; }

Target:
public static boolean containsAnnotation(DetailAST ast, List<String> annotations) { if (ast == null) { throw new IllegalArgumentException(THE_AST_IS_NULL); } if (annotations == null) { throw new IllegalArgumentException("annotations cannot be null"); } boolean result = false; if (!annotations.isEmpty()) { final DetailAST firstMatchingAnnotation = findFirstAnnotation(ast, annotationNode -> { DetailAST identNode = annotationNode.findFirstToken(TokenTypes.IDENT); if (identNode == null) { identNode = annotationNode.findFirstToken(TokenTypes.DOT) .findFirstToken(TokenTypes.IDENT); } return annotations.contains(identNode.getText()); }); result = firstMatchingAnnotation != null; } return result; }
Source:
public Version getVersion() throws IOException { @SuppressWarnings("resource") OpenShiftClient openShiftClient = new DefaultOpenShiftClient(); final OpenShiftClientExtension client = new OpenShiftClientExtension( openShiftClient.adapt(OkHttpClient.class), OpenShiftConfig.wrap(openShiftClient.getConfiguration())); String versionString = client.getVersion(); if (versionString == null || versionString.isEmpty()) { return null; } final Gson gson = new GsonBuilder().disableHtmlEscaping().create(); OpenShiftVersion openShiftVersion = gson.fromJson(versionString, OpenShiftVersion.class); Version version = openShiftVersion.getVersion(); version.setApiVersion(client.getApiVersion()); return version; }

Target:
public Version getVersion() throws IOException { OpenShiftClient openShiftClient = new DefaultOpenShiftClient(); final OpenShiftClientExtension client = new OpenShiftClientExtension( openShiftClient.adapt(OkHttpClient.class), OpenShiftConfig.wrap(openShiftClient.getConfiguration())); String versionString = client.getVersion(); if (isNullOrEmpty(versionString)) { return null; } final Gson gson = new GsonBuilder().disableHtmlEscaping().create(); OpenShiftVersion openShiftVersion = gson.fromJson(versionString, OpenShiftVersion.class); Version version = openShiftVersion.getVersion(); version.setApiVersion(client.getApiVersion()); return version; }
Source:
public void editLabel(AgentPrincipals agent, PID pid, String label) { FedoraTransaction tx = txManager.startTransaction(); try (Timer.Context context = timer.time()) { aclService.assertHasAccess( "User does not have permissions to edit filenames", pid, agent.getPrincipals(), Permission.editDescription); RepositoryObject obj = repoObjLoader.getRepositoryObject(pid); if (!(obj instanceof FileObject)) { throw new Exception("Failed to edit filename for " + obj.getPid()); } String oldLabel = getOldLabel(obj); repoObjFactory.createExclusiveRelationship(obj, DcElements.title, label); obj.getPremisLog() .buildEvent(Premis.FilenameChange) .addImplementorAgent(agent.getUsernameUri()) .addEventDetail("Object renamed from " + oldLabel + " to " + label) .writeAndClose(); } catch (Exception e) { tx.cancel(e); } finally { tx.close(); } operationsMessageSender.sendUpdateDescriptionOperation( agent.getUsername(), Arrays.asList(pid)); }

Target:
public void editLabel(AgentPrincipals agent, PID pid, String label) { FedoraTransaction tx = txManager.startTransaction(); try (Timer.Context context = timer.time()) { aclService.assertHasAccess( "User does not have permissions to edit filenames", pid, agent.getPrincipals(), Permission.editDescription); RepositoryObject obj = repoObjLoader.getRepositoryObject(pid); if (!(obj instanceof FileObject)) { throw new IllegalArgumentException("Failed to edit filename for " + obj.getPid()); } BinaryObject binaryObj = ((FileObject) obj).getOriginalFile(); String oldLabel = getOldLabel(binaryObj.getFilename()); repoObjFactory.createExclusiveRelationship(binaryObj, Ebucore.filename, label); obj.getPremisLog() .buildEvent(Premis.FilenameChange) .addImplementorAgent(agent.getUsernameUri()) .addEventDetail("Object renamed from " + oldLabel + " to " + label) .writeAndClose(); } catch (Exception e) { tx.cancel(e); } finally { tx.close(); } operationsMessageSender.sendUpdateDescriptionOperation( agent.getUsername(), Arrays.asList(pid)); }
Source:
public VCFIterator open(final InputStream in) throws IOException { if (in == null) { throw new IllegalArgumentException("input stream is null"); } final BufferedInputStream bufferedinput = new BufferedInputStream(in, 100); bufferedinput.mark(100); final BCFVersion bcfVersion = BCFVersion.readBCFVersion(bufferedinput); bufferedinput.reset(); if (bcfVersion != null) { return new BCFInputStreamIterator(bufferedinput); } else { return new VCFReaderIterator(IOUtil.gunZipIfNeeded(bufferedinput)); } }

Target:
public VCFIterator open(final InputStream in) throws IOException { if (in == null) { throw new IllegalArgumentException("input stream is null"); } BufferedInputStream bufferedinput = new BufferedInputStream(in, Math.max( BCF2Codec.SIZEOF_BCF_HEADER, IOUtil.GZIP_HEADER_READ_LENGTH )); if(IOUtil.isGZIPInputStream(bufferedinput)) { bufferedinput = new BufferedInputStream( new GZIPInputStream(bufferedinput), BCF2Codec.SIZEOF_BCF_HEADER ); } final BCFVersion bcfVersion = BCF2Codec.tryReadBCFVersion(bufferedinput); if (bcfVersion != null) { return new BCFInputStreamIterator(bufferedinput); } else { return new VCFReaderIterator(bufferedinput); } }
Source:
public void prepareStepMachine() { startupLogger.info("Prepare StepMachine"); StepIterator.Builder builder = new StepIterator.Builder(); try(InputStream s = this.getClass().getResourceAsStream("/steps.json")){ StepEngineConfiguration stepEngineConfig = JsonbBuilder.create().fromJson(s, StepEngineConfiguration.class); stepEngineConfig.steps.forEach(className -> builder.addStep(className)); } catch (IOException ex) { LogManager.getLogger(WordleSkin.class.getName()).error("IO Problem loading steps description file", ex); } StepIterator steps = builder.build(); StepEngine s = new StepEngine(steps); s.getContext().put("WordleSkin", this); tickTockExecutor.execute(new Runnable() { @Override public void run() { s.go(); } }); startupLogger.info("Prepare StepMachine done"); }

Target:
public void prepareStepMachine() { startupLogger.info("Prepare StepMachine"); StepIterator steps = StepIterator.ofDefaultConfiguration(); StepEngine s = new StepEngine(steps); s.getContext().put("WordleSkin", this); tickTockExecutor.execute(new Runnable() { @Override public void run() { s.go(); } }); startupLogger.info("Prepare StepMachine done"); }
Source:
private Object getTaskFactory(StreamApplication streamApp) { if (streamApp != null) { streamApp.init(streamGraph, config); return TaskFactoryUtil.createTaskFactory(config, streamGraph); } return TaskFactoryUtil.createTaskFactory(config, null); }

Target:
private Object getTaskFactory(StreamApplication streamApp) { if (streamApp != null) { streamApp.init(graphSpec, config); return TaskFactoryUtil.createTaskFactory(graphSpec.getOperatorSpecGraph(), graphSpec.getContextManager()); } return TaskFactoryUtil.createTaskFactory(config); }
Source:
protected final void publishWanRemove(Data dataKey) { wanEventPublisher.publishWanRemove(name, dataKey); }

Target:
protected final void publishWanRemove(Data dataKey) { if (!recordStore.isWanReplicationEnabled()) { return; } wanEventPublisher.publishWanRemove(name, toHeapData(dataKey)); }
Source:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean("hasTemporaryWikitextStored", true); outState.putParcelable("abusefilter", abusefilterEditResult); outState.putBoolean("sectionTextModified", sectionTextModified); captchaHandler.saveState(outState); }

Target:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean("hasTemporaryWikitextStored", true); outState.putParcelable("abusefilter", abusefilterEditResult); outState.putBoolean("sectionTextModified", sectionTextModified); captchaHandler.saveState(outState); Prefs.storeTemporaryWikitext(sectionWikitext); }
Source:
public static void setupDomain() { testSupport = DomainTestSuite.createSupport(EEConcurrencyExecutorShutdownTestCase.class.getSimpleName()); domainMasterLifecycleUtil = testSupport.getDomainMasterLifecycleUtil(); masterClient = domainMasterLifecycleUtil.getDomainClient(); }

Target:
public static void setupDomain() { testSupport = createAndStartDefaultEESupport(EEConcurrencyExecutorShutdownTestCase.class.getSimpleName()); domainMasterLifecycleUtil = testSupport.getDomainMasterLifecycleUtil(); masterClient = domainMasterLifecycleUtil.getDomainClient(); }
Source:
private void createDatasets(PipelineConfigurer pipelineConfigurer) { FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); try { if (!excelInputreaderConfig.containsMacro("errorDatasetName") && !Strings.isNullOrEmpty(excelInputreaderConfig.errorDatasetName)) { Map<String, String> properties = new HashMap<>(); properties.put(Properties.Table.PROPERTY_SCHEMA, errorRecordSchema.toString()); properties.put(Properties.Table.PROPERTY_SCHEMA_ROW_FIELD, KEY); DatasetProperties datasetProperties = DatasetProperties.builder().addAll(properties).build(); pipelineConfigurer.createDataset(excelInputreaderConfig.errorDatasetName, Table.class, datasetProperties); } else if (!excelInputreaderConfig.containsMacro("ifErrorRecord") && excelInputreaderConfig.ifErrorRecord.equalsIgnoreCase(WRITE_ERROR_DATASET)) { collector.addFailure("Error dataset name should not be empty if choosing write to error " + "dataset for 'On Error' input.", null) .withConfigProperty(IF_ERROR_RECORD).withConfigProperty(ERROR_DATASET_NAME); } if (!excelInputreaderConfig.containsMacro("memoryTableName") && !Strings.isNullOrEmpty(excelInputreaderConfig.memoryTableName)) { pipelineConfigurer.createDataset(excelInputreaderConfig.memoryTableName, KeyValueTable.class); } } catch (Exception e) { collector.addFailure(String.format("Exception while creating dataset: %s.", e.getMessage()), null); } }

Target:
private void createDatasets(PipelineConfigurer pipelineConfigurer) { FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); if (!excelInputreaderConfig.containsMacro("errorDatasetName") && !Strings.isNullOrEmpty(excelInputreaderConfig.errorDatasetName)) { Map<String, String> properties = new HashMap<>(); properties.put(Properties.Table.PROPERTY_SCHEMA, errorRecordSchema.toString()); properties.put(Properties.Table.PROPERTY_SCHEMA_ROW_FIELD, KEY); DatasetProperties datasetProperties = DatasetProperties.builder().addAll(properties).build(); pipelineConfigurer.createDataset(excelInputreaderConfig.errorDatasetName, Table.class, datasetProperties); } else if (!excelInputreaderConfig.containsMacro("ifErrorRecord") && excelInputreaderConfig.ifErrorRecord.equalsIgnoreCase(WRITE_ERROR_DATASET)) { collector.addFailure("Error dataset name should not be empty if choosing write to error " + "dataset for 'On Error' input.", null) .withConfigProperty(IF_ERROR_RECORD).withConfigProperty(ERROR_DATASET_NAME); } if (!excelInputreaderConfig.containsMacro("memoryTableName") && !Strings.isNullOrEmpty(excelInputreaderConfig.memoryTableName)) { pipelineConfigurer.createDataset(excelInputreaderConfig.memoryTableName, KeyValueTable.class); } }
Source:
private boolean tryLoadOrganizations(WizardPage currentPage) { currentPage.setMessage(null); try { getContainer().run(true, true, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { List<RemoteOrganization> userOrgs = ConnectedEngineFacade.listUserOrganizations(model.getServerUrl(), model.getUsername(), model.getPassword(), monitor); model.setUserOrgs(userOrgs); } catch (UnsupportedServerException e) { model.setUserOrgs(null); } finally { monitor.done(); } } }); } catch (InvocationTargetException e) { SonarLintLogger.get().debug("Unable to download organizations", e.getCause()); currentPage.setMessage(e.getCause().getMessage(), IMessageProvider.ERROR); model.setUserOrgs(null); return false; } catch (InterruptedException e) { model.setUserOrgs(null); Thread.currentThread().interrupt(); return false; } return true; }

Target:
private boolean tryLoadOrganizations(WizardPage currentPage) { currentPage.setMessage(null); try { getContainer().run(true, true, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { List<RemoteOrganization> userOrgs = ConnectedEngineFacade.listUserOrganizations(model.getServerUrl(), model.getUsername(), model.getPassword(), monitor); model.setUserOrgs(userOrgs); } catch (UnsupportedServerException e) { model.setUserOrgs(null); } finally { monitor.done(); } } }); } catch (InvocationTargetException e) { SonarLintLogger.get().debug("Unable to download organizations", e.getCause()); currentPage.setMessage(e.getCause().getMessage(), IMessageProvider.ERROR); model.setUserOrgs(null); return false; } catch (InterruptedException e) { model.setUserOrgs(null); return false; } return true; }
Source:
public ProgramState checkPreStatement(CheckerContext context, Tree syntaxNode) { final AbstractStatementVisitor visitor = new PreStatementVisitor(context); syntaxNode.accept(visitor); return visitor.programState; }

Target:
public ProgramState checkPreStatement(CheckerContext context, Tree syntaxNode) { AbstractStatementVisitor visitor = new PreStatementVisitor(context); syntaxNode.accept(visitor); return visitor.programState; }
Source:
public Object readFromRegistry(String resourcePath) { try { if (registry.resourceExists(resourcePath)) { resource = registry.get(resourcePath); byte[] content = (byte[]) resource.getContent(); try { obj = toObject(content); } catch (ClassNotFoundException e) { log.error(e.getMessage()); } catch (IOException e) { log.error(e.getMessage()); } } } catch (RegistryException e) { log.error(e.getMessage()); } return obj; }

Target:
public Object readFromRegistry(String resourcePath) { try { if (registry.resourceExists(resourcePath)) { resource = registry.get(resourcePath); byte[] content = (byte[]) resource.getContent(); obj = toObject(content); } } catch (RegistryException e) { log.error("error while handle with registry", e); } return obj; }
Source:
public HttpResponse doStop() { lock.writeLock().lock(); try { if (executable != null) { final SubTask parentOf; try { parentOf = getParentOfOrFail(executable); } catch(InvocationTargetException ex) { return HttpResponses.error(500, ex); } Tasks.getOwnerTaskOf(parentOf).checkAbortPermission(); interrupt(); } } finally { lock.writeLock().unlock(); } return HttpResponses.forwardToPreviousPage(); }

Target:
public HttpResponse doStop() { lock.writeLock().lock(); try { if (executable != null) { Tasks.getOwnerTaskOf(getParentOf(executable)).checkAbortPermission(); interrupt(); } } finally { lock.writeLock().unlock(); } return HttpResponses.forwardToPreviousPage(); }
Source:
public PhysicalLocator createPhysicalLocator(IPv4Addr ip) throws Exception { Insert<GenericTableSchema> op = plTable.insert(ip); try { UUID newId = modify(client, plTable, op) .result(Duration.Inf()); if (newId == null) throw new VtepException(endPoint, "cannot create locator for tunnel endpoint ip: " + ip); Set<PhysicalLocator> locator = retrievePhysicalLocator( plTable.getUuidMatcher(newId)); if (locator.isEmpty()) throw new VtepException(endPoint, "cannot retrieve locator for tunnel endpoint ip: " + ip); return locator.iterator().next(); } catch (TimeoutException tOut) { throw new VtepException(endPoint, tOut); } }

Target:
public PhysicalLocator createPhysicalLocator(IPv4Addr ip) throws Exception { Insert<GenericTableSchema> op = plTable.insert(ip); try { UUID newId = modify(client, plTable, op).result(Duration.Inf()); if (newId == null) throw new VtepException(endPoint, "cannot create locator for tunnel endpoint ip: " + ip); Set<PhysicalLocator> locator = retrievePhysicalLocator( plTable.getUuidMatcher(newId)); if (locator.isEmpty()) throw new VtepRetrievalException("locator for ip " + ip); return locator.iterator().next(); } catch (TimeoutException tOut) { throw new VtepException(endPoint, tOut); } }
Source:
private static void updateV2VJobs(VDS vds, Map<String, Object> xmlRpcStruct) { if (!xmlRpcStruct.containsKey(VdsProperties.v2vJobs)) { return; } List<V2VJobInfo> v2vJobs = new ArrayList<>(); ((Map<String, Object>) xmlRpcStruct.get(VdsProperties.v2vJobs)).entrySet() .stream() .forEach(job -> v2vJobs.add(buildV2VJobData(job.getKey(), (Map<String, Object>) job.getValue()))); vds.getStatisticsData().setV2VJobs(v2vJobs); }

Target:
private static void updateV2VJobs(VDS vds, Map<String, Object> xmlRpcStruct) { if (!xmlRpcStruct.containsKey(VdsProperties.v2vJobs)) { return; } List<V2VJobInfo> v2vJobs = ((Map<String, Object>) xmlRpcStruct.get(VdsProperties.v2vJobs)).entrySet() .stream() .map(job -> buildV2VJobData(job.getKey(), (Map<String, Object>) job.getValue())).collect(Collectors.toList()); vds.getStatisticsData().setV2VJobs(v2vJobs); }
Source:
protected void write(ByteBuffer header, ByteBuffer data) throws IOException { sendBinary(header); sendBinary(data); }

Target:
protected void write(ByteBuffer header, ByteBuffer data) throws IOException { LOGGER.finest(() -> "sending message of length " + ChunkHeader.length(ChunkHeader.peek(header))); sendBinary(header, false); sendBinary(data, true); }
Source:
public CompilationOptionsCustomizerProvider(final Long expectedCompilationTime) { this.expectedCompilationTime = expectedCompilationTime.intValue(); }

Target:
public CompilationOptionsCustomizerProvider(final Long expectedCompilationTime) { this.expectedCompilationTime = expectedCompilationTime; }
Source:
public synchronized static List<IngestProfile> getIngestProfiles() { File dir = Paths.get(PlatformUtil.getUserConfigDirectory(), PROFILE_FOLDER).toFile(); File[] directoryListing = dir.listFiles(); List<IngestProfile> profileList = new ArrayList<>(); if (directoryListing != null) { for (File child : directoryListing) { String name = child.getName().replace(PROFILE_FILE_EXT, ""); String context = PROFILE_FOLDER + File.separator + name; String desc = ModuleSettings.getConfigSetting(context, PROFILE_DESC_KEY); String fileIngestFilter = ModuleSettings.getConfigSetting(context, PROFILE_FILTER_KEY); profileList.add(new IngestProfile(name, desc, fileIngestFilter)); } } return profileList; }

Target:
public synchronized static List<IngestProfile> getIngestProfiles() { File dir = Paths.get(PlatformUtil.getUserConfigDirectory(), PROFILE_FOLDER).toFile(); File[] directoryListing = dir.listFiles(); List<IngestProfile> profileList = new ArrayList<>(); if (directoryListing != null) { for (File child : directoryListing) { String name = FilenameUtils.removeExtension(child.getName()); String context = PROFILE_FOLDER + File.separator + name; String desc = ModuleSettings.getConfigSetting(context, PROFILE_DESC_KEY); String fileIngestFilter = ModuleSettings.getConfigSetting(context, PROFILE_FILTER_KEY); profileList.add(new IngestProfile(name, desc, fileIngestFilter)); } } return profileList; }
Source:
public void addReceiver(String endpointId, VideoConstraints newVideoConstraints) { VideoConstraints oldVideoConstraints = receiverVideoConstraintsMap.put(endpointId, newVideoConstraints); if (oldVideoConstraints == null || !oldVideoConstraints.equals(newVideoConstraints)) { setReceiverVideoConstraints(ImmutableMap.copyOf(receiverVideoConstraintsMap)); } }

Target:
public void addReceiver(String endpointId, VideoConstraints newVideoConstraints) { VideoConstraints oldVideoConstraints = receiverVideoConstraintsMap.put(endpointId, newVideoConstraints); if (oldVideoConstraints == null || !oldVideoConstraints.equals(newVideoConstraints)) { receiverVideoConstraintsChanged(ImmutableMap.copyOf(receiverVideoConstraintsMap)); } }