auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldFindUserByUsernameUsingOptionalSearchParameterForMockedHandler() throws Exception { SimpleObject response = deserialize(handle(newGetRequest(getURI(), new Parameter("username", "bruno")))); List<Object> results = Util.getResultsList(response); Object next = results.iterator().next(); assertEquals(1, results.size()); assertEquals(MOCKED_USER_NAME_FOR_OPTIONAL_PARAM, PropertyUtils.getProperty(next, "display")); }

Target:
public void shouldFindUserByUsernameUsingOptionalSearchParameterForMockedHandler() throws Exception { SimpleObject response = deserialize(handle(newGetRequest(getURI(), new Parameter("username", "bruno")))); List<Object> results = Util.getResultsList(response); Object next = results.iterator().next(); assertEquals(1, results.size()); assertEquals(MOCKED_USER_NAME_FOR_THRID_COMPONENT, PropertyUtils.getProperty(next, "display")); }
Source:
protected Dialog onCreateDialog(int id, Bundle bundle) { if (id == R.id.dialog_cancel_confirmation) { final String message; if (mType == VCardService.TYPE_IMPORT) { message = getString(R.string.cancel_import_confirmation_message, mDisplayName); } else { message = getString(R.string.cancel_export_confirmation_message, mDisplayName); } final AlertDialog.Builder builder = new AlertDialog.Builder(this) .setMessage(message) .setPositiveButton(android.R.string.yes, new RequestCancelListener()) .setOnCancelListener(mCancelListener) .setNegativeButton(android.R.string.no, mCancelListener); return builder.create(); } else if (id == R.id.dialog_cancel_failed) { final AlertDialog.Builder builder = new AlertDialog.Builder(this) .setTitle(R.string.cancel_vcard_import_or_export_failed) .setIconAttribute(android.R.attr.alertDialogIcon) .setMessage(getString(R.string.fail_reason_unknown)) .setOnCancelListener(mCancelListener) .setPositiveButton(android.R.string.ok, mCancelListener); return builder.create(); } else { Log.w(LOG_TAG, "Unknown dialog id: " + id); return super.onCreateDialog(id, bundle); } }

Target:
protected Dialog onCreateDialog(int id, Bundle bundle) { if (id == R.id.dialog_cancel_confirmation) { final String message; if (mType == VCardService.TYPE_IMPORT) { message = getString(R.string.cancel_import_confirmation_message, mDisplayName); } else { message = getString(R.string.cancel_export_confirmation_message, mDisplayName); } final AlertDialog.Builder builder = new AlertDialog.Builder(this) .setMessage(message) .setPositiveButton(R.string.stop_import_export_dialog_yes_txt, new RequestCancelListener()) .setOnCancelListener(mCancelListener) .setNegativeButton(R.string.stop_import_export_dialog_no_txt, mCancelListener); return builder.create(); } else if (id == R.id.dialog_cancel_failed) { final AlertDialog.Builder builder = new AlertDialog.Builder(this) .setTitle(R.string.cancel_vcard_import_or_export_failed) .setIconAttribute(android.R.attr.alertDialogIcon) .setMessage(getString(R.string.fail_reason_unknown)) .setOnCancelListener(mCancelListener) .setPositiveButton(android.R.string.ok, mCancelListener); return builder.create(); } else { Log.w(LOG_TAG, "Unknown dialog id: " + id); return super.onCreateDialog(id, bundle); } }
Source:
public Condition updateFHIRCondition(Condition condition, String theId)throws NotImplementedException { return null; }

Target:
public Condition updateFHIRCondition(Condition condition, String theId) { throw new NotImplementedException(); }
Source:
public void confirmNoKnownAllergies() throws RuntimeException { if (!allergies.isEmpty()) { throw new APIException("Cannot confirm no known allergies if allergy list is not empty"); } allergyStatus = NO_KNOWN_ALLERGIES; }

Target:
public void confirmNoKnownAllergies() throws APIException { if (!allergies.isEmpty()) { throw new APIException("Cannot confirm no known allergies if allergy list is not empty"); } allergyStatus = NO_KNOWN_ALLERGIES; }
Source:
private void addChannelFromString(Collection<MessageChannel> channels, String channelKey, Message<?> message) { if (channelKey.indexOf(',') != -1) { for (String name : StringUtils.tokenizeToStringArray(channelKey, ",")) { addChannelFromString(channels, name, message); } return; } String channelName = channelKey; boolean mapped = false; if (this.channelMappings.containsKey(channelKey)) { channelName = this.channelMappings.get(channelKey); mapped = true; } if (this.prefix != null) { channelName = this.prefix + channelName; } if (this.suffix != null) { channelName = channelName + this.suffix; } MessageChannel channel = resolveChannelForName(channelName, message); if (channel != null) { channels.add(channel); if (!mapped && !this.dynamicChannels.contains(channelName)) { this.dynamicChannels.add(channelName); } } }

Target:
private void addChannelFromString(Collection<MessageChannel> channels, String channelKey, Message<?> message) { if (channelKey.indexOf(',') != -1) { for (String name : StringUtils.tokenizeToStringArray(channelKey, ",")) { addChannelFromString(channels, name, message); } return; } String channelName = channelKey; boolean mapped = false; if (this.channelMappings.containsKey(channelKey)) { channelName = this.channelMappings.get(channelKey); mapped = true; } if (this.prefix != null) { channelName = this.prefix + channelName; } if (this.suffix != null) { channelName = channelName + this.suffix; } MessageChannel channel = resolveChannelForName(channelName, message); if (channel != null) { channels.add(channel); if (!mapped && !(this.dynamicChannels.get(channelName) != null)) { this.dynamicChannels.put(channelName, channel); } } }
Source:
private void verifyNoHeaderJunk(TaskListener listener) throws IOException, InterruptedException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); connection.exec("true",baos); final String s; try { s = baos.toString(Charset.defaultCharset().name()); } catch (UnsupportedEncodingException ex) { throw new IOException("Default encoding is unsupported"); } if (s.length()!=0) { listener.getLogger().println(Messages.SSHLauncher_SSHHeeaderJunkDetected()); listener.getLogger().println(s); throw new AbortException(); } }

Target:
private void verifyNoHeaderJunk(TaskListener listener) throws IOException, InterruptedException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); connection.exec("true",baos); final String s; try { s = baos.toString(Charset.defaultCharset().name()); } catch (UnsupportedEncodingException ex) { throw new IOException("Default encoding is unsupported", ex); } if (s.length()!=0) { listener.getLogger().println(Messages.SSHLauncher_SSHHeeaderJunkDetected()); listener.getLogger().println(s); throw new AbortException(); } }
Source:
private void initOSType() { List<Integer> list = AsyncDataProvider.getAllVMsOsIds(); Collections.sort(list); getOSType().setItems(list); getOSType().setSelectedItem(OsRepository.DEFAULT_OS); }

Target:
private void initOSType() { List<Integer> list = AsyncDataProvider.getOsIds(); Collections.sort(list); getOSType().setItems(list); getOSType().setSelectedItem(OsRepository.DEFAULT_OS); }
Source:
public Map<String, Long> getGroupCount(@QueryParam("search") String search, @QueryParam("top") @DefaultValue("false") boolean onlyTopGroups) { List<GroupModel> results; Map<String, Long> map = new HashMap<>(); if (Objects.nonNull(search)) { results = realm.searchForGroupByName(search, null, null); } else { results = realm.getTopLevelGroups(); } Long count = results.stream() .filter(group -> auth.groups().canView(group)) .count(); map.put("count", count); return map; }

Target:
public Map<String, Long> getGroupCount(@QueryParam("search") String search, @QueryParam("top") @DefaultValue("false") boolean onlyTopGroups) { Long results; Map<String, Long> map = new HashMap<>(); if (auth.users().canView()) { if (Objects.nonNull(search)) { results = realm.getGroupsCountByNameContaining(search); } else { results = realm.getGroupsCount(onlyTopGroups); } } else { Set<String> groups = auth.groups().getGroupsWithViewPermission(); Stream<String> s = groups.stream(); if (search!=null) s=s.filter(group->group.contains(search.trim())); results = s.count(); } map.put("count", results); return map; }
Source:
private void registerPushResources(Bundle pushBundle) { Hashtable<String, Object> properties = new Hashtable<>(); properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/VAADIN/static/push/*"); servletRegistration.compareAndSet(null, pushBundle.getBundleContext().registerService(Servlet.class, new PushResourceServlet(pushBundle), properties)); }

Target:
private void registerPushResources(Bundle pushBundle) { Hashtable<String, Object> properties = new Hashtable<>(); properties.put("osgi.http.whiteboard.servlet.pattern", "/VAADIN/static/push/*"); servletPushRegistration.compareAndSet(null, pushBundle.getBundleContext().registerService(Servlet.class, new ResourceServlet(pushBundle, "/META-INF/resources/VAADIN/static/push"), properties)); }
Source:
protected void configure() { install(new ChristianModule()); install(new ChristopherModule()); install(new JasonModule()); install(new JoelModule()); install(new LarryModule()); install(new ManonModule()); install(new MaximeModule()); install(new PhilippeaModule()); install(new PhilippebModule()); install(new RenaudModule()); install(new OlivierModule()); install(new JeanNicolasModule()); bindPresenter(BeesPresenter.class, BeesPresenter.MyView.class, BeesView.class, BeesPresenter.MyProxy.class); bindPresenterWidget(QuestionPresenter.class, QuestionPresenter.MyView.class, QuestionView.class); bind(Konami.class).asEagerSingleton(); }

Target:
protected void configure() { install(new ChristianModule()); install(new ChristopherModule()); install(new JasonModule()); install(new JeanNicolasModule()); install(new JoelModule()); install(new LarryModule()); install(new ManonModule()); install(new MaximeModule()); install(new OlivierModule()); install(new PhilippeaModule()); install(new PhilippebModule()); install(new RenaudModule()); bindPresenter(BeesPresenter.class, BeesPresenter.MyView.class, BeesView.class, BeesPresenter.MyProxy.class); bindPresenterWidget(QuestionPresenter.class, QuestionPresenter.MyView.class, QuestionView.class); bind(Konami.class).asEagerSingleton(); }
Source:
public String constructGroupId(Datastream datastream) { return constructGroupId(KafkaConnectionString.valueOf(datastream.getSource().getConnectionString()), datastream.getDestination().getConnectionString()); }

Target:
public String constructGroupId(Datastream datastream) { if (_isGroupIdHashingEnabled) { return constructGroupId(DatastreamUtils.getTaskPrefix(datastream), _clusterName); } else { return constructGroupId(KafkaConnectionString.valueOf(datastream.getSource().getConnectionString()), datastream.getDestination().getConnectionString()); } }
Source:
public void testListSizes() { List<Size> sizes = sizesApi.list(); assertTrue(sizes.size() > 0, "Size list should not be empty"); }

Target:
public void testListSizes() { List<Size> sizes = sizesApi.list(); assertFalse(sizes.isEmpty(), "Size list should not be empty"); }
Source:
public void deleteDraft(final Account account, long id) { LocalFolder localFolder = null; try { LocalStore localStore = account.getLocalStore(); localFolder = localStore.getFolder(account.getDraftsFolderName()); localFolder.open(Folder.OPEN_MODE_RW); String uid = localFolder.getMessageUidById(id); if (uid != null) { LocalMessage message = localFolder.getMessage(uid); if (message != null) { deleteMessages(Collections.singletonList(message.makeMessageReference()), null); } } } catch (MessagingException me) { addErrorMessage(account, null, me); } finally { closeFolder(localFolder); } }

Target:
public void deleteDraft(final Account account, long id) { LocalFolder localFolder = null; try { LocalStore localStore = account.getLocalStore(); localFolder = localStore.getFolder(account.getDraftsFolderName()); localFolder.open(Folder.OPEN_MODE_RW); String uid = localFolder.getMessageUidById(id); if (uid != null) { MessageReference messageReference = new MessageReference( account.getUuid(), account.getDraftsFolderName(), uid, null); deleteMessage(messageReference, null); } } catch (MessagingException me) { addErrorMessage(account, null, me); } finally { closeFolder(localFolder); } }
Source:
public void execute(MApplication app, EModelService service, IExtensionRegistry registery, IThemeManager mgr) { if (menu == null) { return; } List<String> tags = app.getTags(); for (String tag : tags) { if (PROCESSOR_ID.equals(tag)) { return; } } tags.add(PROCESSOR_ID); IThemeEngine engine = mgr.getEngineForDisplay(Display.getCurrent()); List<ITheme> themes = engine.getThemes(); if (themes.size() > 0) { MCommand switchThemeCommand = null; for (MCommand cmd : app.getCommands()) { if ("contacts.switchTheme".equals(cmd.getElementId())) { switchThemeCommand = cmd; break; } } if (switchThemeCommand != null) { themesMenu = MMenuFactory.INSTANCE.createMenu(); themesMenu.setLabel("%switchThemeMenu"); themesMenu.setContributorURI(BUNDLE_ID); for (ITheme theme : themes) { MParameter parameter = service .createModelElement(MParameter.class); parameter.setName("contacts.commands.switchtheme.themeid"); parameter.setValue(theme.getId()); String iconURI = Util.getCSSUri(theme.getId(), registery); if (iconURI != null) { iconURI = iconURI.replace(".css", ".png"); } processTheme(theme.getLabel(), switchThemeCommand, parameter, iconURI, service); } menu.getChildren().add(themesMenu); } } }

Target:
public void execute(MApplication app, EModelService service, IExtensionRegistry registery, IThemeManager mgr) { if (menu == null) { return; } List<String> tags = app.getTags(); for (String tag : tags) { if (PROCESSOR_ID.equals(tag)) { return; } } tags.add(PROCESSOR_ID); IThemeEngine engine = mgr.getEngineForDisplay(Display.getCurrent()); List<ITheme> themes = engine.getThemes(); MCommand switchThemeCommand = findCommand(app); if (themes.size() <= 0 || switchThemeCommand == null) { return; } themesMenu = service.createModelElement(MMenu.class); themesMenu.setLabel("%switchThemeMenu"); themesMenu.setContributorURI(BUNDLE_ID); for (ITheme theme : themes) { MParameter parameter = service.createModelElement(MParameter.class); parameter.setName("contacts.commands.switchtheme.themeid"); parameter.setValue(theme.getId()); String iconURI = Util.getCSSUri(theme.getId(), registery); if (iconURI != null) { iconURI = iconURI.replace(".css", ".png"); } processTheme(theme.getLabel(), switchThemeCommand, parameter, iconURI, service); } menu.getChildren().add(themesMenu); }
Source:
public void setAdminStatus(Boolean status){ this.adminStatus = status; this.mySlicer.setAdminState(status); if(status){ log.debug("Slice: "+ this.mySlicer.getSliceName() +" is re-enabled"); }else{ log.info("Disabling Slice:"+this.mySlicer.getSliceName() ); if(this.connected()){ this.removeFlows(); this.disconnect(); } } }

Target:
public void setAdminStatus(Boolean status){ this.adminStatus = status; this.mySlicer.setAdminState(status); if(status){ log.info("Slice: "+ this.mySlicer.getSliceName() +" is re-enabled"); }else{ log.warn("Disabling Slice:"+this.mySlicer.getSliceName() ); if(this.connected()){ this.removeFlows(); this.disconnect(); } } }
Source:
public static Timer createTimer(String cronExpression, Procedure0 closure) { JobKey jobKey = new JobKey("CRON" + cronExpression + ": " + closure.toString()); Trigger trigger = newTrigger() .withSchedule(cronSchedule(cronExpression)) .build(); Timer timer = new TimerImpl(jobKey, trigger.getKey(), cronExpression); try { JobDataMap dataMap = new JobDataMap(); dataMap.put("procedure", closure); dataMap.put("timer", timer); JobDetail job = newJob(TimerExecutionJob.class) .withIdentity(jobKey) .usingJobData(dataMap) .build(); TimerImpl.scheduler.scheduleJob(job, trigger); logger.debug("Scheduled code for execution at {}", cronExpression); return timer; } catch(SchedulerException e) { logger.error("Failed to schedule code for execution.", e); return null; } }

Target:
public static Timer createTimer(String cronExpression, Procedure0 closure) { JobDataMap dataMap = new JobDataMap(); dataMap.put("procedure", closure); return makeTimer(instant, closure.toString(), dataMap); }
Source:
boolean readFromDirectories(List<File> directories) { boolean success = false; for (File dir : directories) { File statusFile = new File(dir, BOOKIE_STATUS_FILENAME); try { BookieStatus status = readFromFile(statusFile); if (null != status) { synchronized (status) { if (status.lastUpdateTime > this.lastUpdateTime) { this.lastUpdateTime = status.lastUpdateTime; this.layoutVersion = status.layoutVersion; this.bookieMode = status.bookieMode; success = true; } } } } catch (IOException e) { LOG.warn("IOException while trying to read bookie status from directory {}." + " This is fine if not all directories failed.", dir); } catch (IllegalArgumentException e ){ LOG.warn("IllegalArgumentException while trying to read bookie status from directory {}." + " This is fine if not all directories failed.", dir); } } if (success) { LOG.info("Successfully retrieve bookie status from disks.", getBookieMode()); } else { LOG.warn("Failed to retrieve bookie status from disks." + " Fall back to current or default bookie status: {}", getBookieMode()); } return success; }

Target:
void readFromDirectories(List<File> directories) { boolean success = false; for (File dir : directories) { File statusFile = new File(dir, BOOKIE_STATUS_FILENAME); try { BookieStatus status = readFromFile(statusFile); if (null != status) { synchronized (status) { if (status.lastUpdateTime > this.lastUpdateTime) { this.lastUpdateTime = status.lastUpdateTime; this.layoutVersion = status.layoutVersion; this.bookieMode = status.bookieMode; success = true; } } } } catch (IOException e) { LOG.warn("IOException while trying to read bookie status from directory {}." + " This is fine if not all directories failed.", dir); } catch (IllegalArgumentException e ){ LOG.warn("IllegalArgumentException while trying to read bookie status from directory {}." + " This is fine if not all directories failed.", dir); } } if (success) { LOG.info("Successfully retrieve bookie status from disks.", getBookieMode()); } else { LOG.warn("Failed to retrieve bookie status from disks." + " Fall back to current or default bookie status: {}", getBookieMode()); } }
Source:
public void setPublicURI(Map<String, String> fullHostNames) { if (fullHostNames != null && !fullHostNames.isEmpty()) { final StringBuilder sb = new StringBuilder(); final Iterator<Map.Entry<String, String>> iterator = fullHostNames.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry<String, String> entry = iterator.next(); sb.append(entry.getKey()).append("://").append(entry.getValue()).append("/").append(name); if (iterator.hasNext()) { sb.append("\n"); } } toStringContent = sb.toString(); } else { toStringContent = "git://" + name; } }

Target:
public void setPublicURI(Map<String, String> fullHostNames) { if (fullHostNames != null && !fullHostNames.isEmpty()) { toStringContent = fullHostNames.entrySet() .stream() .map(e -> e.getKey() + "://" + e.getValue() + "/" + name) .collect(Collectors.joining("\n")); } else { toStringContent = "git://" + name; } }
Source:
public boolean isLocal() { return getStorageType() == StorageType.LOCALFS; }

Target:
public boolean isLocal() { return getStorageType().isLocal(); }
Source:
public static void initializeMap(InputStream resource) { try { InputStreamReader isr = new InputStreamReader(resource); BufferedReader br = new BufferedReader(isr); String line; while ((line = br.readLine()) != null) { String parts[] = line.split("="); map.put(parts[0], parts[1]); } br.close(); isr.close(); resource.close(); } catch (IOException e) { e.printStackTrace(); System.err.print("Cannot open location mapping file"); } }

Target:
public static void initializeMap(InputStream resource) { InputStreamReader isr = null; BufferedReader br = null; try { isr = new InputStreamReader(resource); br = new BufferedReader(isr); String line; while ((line = br.readLine()) != null) { String parts[] = line.split("="); map.put(parts[0], parts[1]); } } catch (IOException e) { e.printStackTrace(); System.err.print("Cannot open location mapping file"); } finally { try { if (isr != null) { isr.close(); } if (br != null) { br.close(); } if (resource != null) { resource.close(); } } catch (IOException e) { e.printStackTrace(); } } }
Source:
public void addAccount(Account account) throws SQLException { try { long startTimeMs = System.currentTimeMillis(); PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql); insertStatement.setString(1, AccountCollectionSerde.accountToJsonNoContainers(account).toString()); insertStatement.setInt(2, account.getSnapshotVersion()); insertStatement.executeUpdate(); dataAccessor.onSuccess(MySqlDataAccessor.OperationType.Write, System.currentTimeMillis() - startTimeMs); } catch (SQLException e) { dataAccessor.onException(e, MySqlDataAccessor.OperationType.Write); throw e; } }

Target:
public void addAccount(Account account) throws SQLException { try { long startTimeMs = System.currentTimeMillis(); PreparedStatement insertStatement = dataAccessor.getPreparedStatement(insertSql); insertStatement.setString(1, AccountCollectionSerde.accountToJsonNoContainers(account).toString()); insertStatement.setInt(2, account.getSnapshotVersion()); insertStatement.executeUpdate(); dataAccessor.onSuccess(Write, System.currentTimeMillis() - startTimeMs); } catch (SQLException e) { dataAccessor.onException(e, Write); throw e; } }
Source:
private void fire(final Project.NameKey p, final Properties statistics) { Event event = new GarbageCollectorListener.Event() { @Override public String getProjectName() { return p.get(); } @Override public Properties getStatistics() { return statistics; } }; for (GarbageCollectorListener listener : listeners) { listener.onGarbageCollected(event); } }

Target:
private void fire(final Project.NameKey p, final Properties statistics) { Event event = new GarbageCollectorListener.Event() { @Override public String getProjectName() { return p.get(); } @Override public Properties getStatistics() { return statistics; } }; for (GarbageCollectorListener l : listeners) { try { l.onGarbageCollected(event); } catch (RuntimeException e) { log.warn("Failure in GarbageCollectorListener", e); } } }
Source:
public void concurrentAccesses() throws Exception { final int numIterations = 500000; final String storeName = "word-count-store"; final String windowStoreName = "windowed-word-count-store"; final ProducerRunnable producerRunnable = new ProducerRunnable(streamConcurrent, inputValues, numIterations); final Thread producerThread = new Thread(producerRunnable); kafkaStreams = createCountStream( streamConcurrent, outputTopicConcurrent, outputTopicConcurrentWindowed, storeName, windowStoreName, streamsConfiguration); StreamsTestUtils.startKafkaStreamsAndWaitForRunningState(kafkaStreams); producerThread.start(); try { waitUntilAtLeastNumRecordProcessed(outputTopicConcurrent, numberOfWordsPerIteration); waitUntilAtLeastNumRecordProcessed(outputTopicConcurrentWindowed, numberOfWordsPerIteration); final ReadOnlyKeyValueStore<String, Long> keyValueStore = kafkaStreams.store(storeName + "-" + streamConcurrent, QueryableStoreTypes.keyValueStore()); final ReadOnlyWindowStore<String, Long> windowStore = kafkaStreams.store(windowStoreName + "-" + streamConcurrent, QueryableStoreTypes.windowStore()); final Map<String, Long> expectedWindowState = new HashMap<>(); final Map<String, Long> expectedCount = new HashMap<>(); while (producerRunnable.getCurrIteration() < numIterations) { verifyGreaterOrEqual(inputValuesKeys.toArray(new String[0]), expectedWindowState, expectedCount, windowStore, keyValueStore, true); } } finally { producerRunnable.shutdown(); producerThread.interrupt(); producerThread.join(); } }

Target:
public void concurrentAccesses() throws Exception { final int numIterations = 500000; final String storeName = "word-count-store"; final String windowStoreName = "windowed-word-count-store"; final ProducerRunnable producerRunnable = new ProducerRunnable(streamConcurrent, inputValues, numIterations); final Thread producerThread = new Thread(producerRunnable); kafkaStreams = createCountStream( streamConcurrent, outputTopicConcurrent, outputTopicConcurrentWindowed, storeName, windowStoreName, streamsConfiguration); startKafkaStreamsAndWaitForRunningState(kafkaStreams); producerThread.start(); try { waitUntilAtLeastNumRecordProcessed(outputTopicConcurrent, numberOfWordsPerIteration); waitUntilAtLeastNumRecordProcessed(outputTopicConcurrentWindowed, numberOfWordsPerIteration); final ReadOnlyKeyValueStore<String, Long> keyValueStore = kafkaStreams.store(storeName + "-" + streamConcurrent, QueryableStoreTypes.keyValueStore()); final ReadOnlyWindowStore<String, Long> windowStore = kafkaStreams.store(windowStoreName + "-" + streamConcurrent, QueryableStoreTypes.windowStore()); final Map<String, Long> expectedWindowState = new HashMap<>(); final Map<String, Long> expectedCount = new HashMap<>(); while (producerRunnable.getCurrIteration() < numIterations) { verifyGreaterOrEqual(inputValuesKeys.toArray(new String[0]), expectedWindowState, expectedCount, windowStore, keyValueStore, true); } } finally { producerRunnable.shutdown(); producerThread.interrupt(); producerThread.join(); } }
Source:
public Page<T> getPagedData(Pageable pageable, List<T> list) { if (CollectionUtils.isEmpty(list)) { return new PageImpl<T>(list); } Collections.sort(list); int offSet = pageable.getOffset(); int size = pageable.getPageSize(); List<T> page = new ArrayList<T>(); for (int i = offSet; i < Math.min(list.size(), offSet + size); i++) { page.add(list.get(i)); } return new PageImpl<T>(page, pageable, list.size()); }

Target:
public Page<T> getPagedData(Pageable pageable, List<T> list) { Assert.notNull(pageable, "Pagination info can't be null."); if (CollectionUtils.isEmpty(list)) { return new PageImpl<T>(list); } Collections.sort(list); int to = Math.min(list.size(), pageable.getOffset() + pageable.getPageSize()); List<T> data = list.subList(pageable.getOffset(), to); return new PageImpl<T>(data, pageable, list.size()); }
Source:
public static NitfHeaderImpl getDefault(final FileType fileType) { NitfHeaderImpl nitfFileHeader = new NitfHeaderImpl(); nitfFileHeader.setFileType(fileType); nitfFileHeader.setComplexityLevel(LOWEST_COMPLEXITY_LEVEL); nitfFileHeader.setStandardType(STANDARD_TYPE_VAL); nitfFileHeader.setOriginatingStationId(NitfHeaderConstants.DEFAULT_ORIGINATING_STATION); NitfDateTime ndt = NitfDateTime.getNitfDateTimeForNow(); nitfFileHeader.setFileDateTime(ndt); nitfFileHeader.setFileTitle(""); nitfFileHeader.setFileSecurityMetadata(SecurityMetadataFactory.getDefaultFileSecurityMetadata(fileType)); RGBColour backgroundColour = new RGBColour(RGBColour.CODICE_LOGO_RED_COMPONENT, RGBColour.CODICE_LOGO_GREEN_COMPONENT, RGBColour.CODICE_LOGO_BLUE_COMPONENT); nitfFileHeader.setFileBackgroundColour(backgroundColour); nitfFileHeader.setOriginatorsName(""); nitfFileHeader.setOriginatorsPhoneNumber(""); return nitfFileHeader; }

Target:
public static NitfHeader getDefault(final FileType fileType) { NitfHeaderImpl nitfFileHeader = new NitfHeaderImpl(); nitfFileHeader.setFileType(fileType); nitfFileHeader.setComplexityLevel(LOWEST_COMPLEXITY_LEVEL); nitfFileHeader.setStandardType(STANDARD_TYPE_VAL); nitfFileHeader.setOriginatingStationId(NitfHeaderConstants.DEFAULT_ORIGINATING_STATION); NitfDateTime ndt = NitfDateTime.getNitfDateTimeForNow(); nitfFileHeader.setFileDateTime(ndt); nitfFileHeader.setFileTitle(""); nitfFileHeader.setFileSecurityMetadata(SecurityMetadataFactory.getDefaultFileSecurityMetadata(fileType)); RGBColour backgroundColour = new RGBColour(RGBColour.CODICE_LOGO_RED_COMPONENT, RGBColour.CODICE_LOGO_GREEN_COMPONENT, RGBColour.CODICE_LOGO_BLUE_COMPONENT); nitfFileHeader.setFileBackgroundColour(backgroundColour); nitfFileHeader.setOriginatorsName(""); nitfFileHeader.setOriginatorsPhoneNumber(""); return nitfFileHeader; }
Source:
private void updateLabelList() { AsyncQuery getLabelsQuery = new AsyncQuery(); getLabelsQuery.asyncCallback = new INewAsyncCallback() { @SuppressWarnings("unchecked") @Override public void onSuccess(Object model, Object result) { List<Label> allLabels = (List<Label>) result; if (getIsNew()) { labelList.setItems(allLabels); labelList.setSelectedItems(new ArrayList<Label>()); } else { List<Label> selectedLabels = new ArrayList<>(); for (Label label : allLabels) { if (label.getHosts().contains(getVmId())) { selectedLabels.add(label); } } labelList.setItems(allLabels); labelList.setSelectedItems(selectedLabels); } labelList.setIsChangeable(false); } }; AsyncDataProvider.getInstance().getLabelList(getLabelsQuery); }

Target:
private void updateLabelList() { AsyncQuery getLabelsQuery = new AsyncQuery(); getLabelsQuery.asyncCallback = new INewAsyncCallback() { @SuppressWarnings("unchecked") @Override public void onSuccess(Object model, Object result) { final List<Label> allLabels = (List<Label>) result; if (getIsNew()) { labelList.setItems(allLabels); labelList.setSelectedItems(new ArrayList<Label>()); } else { AsyncQuery getLabelsByVmIdQuery = new AsyncQuery(); getLabelsByVmIdQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<Label> vmLabelsList = (List<Label>) returnValue; labelList.setItems(allLabels); labelList.setSelectedItems(vmLabelsList); } }; Guid vmId = ((ExistingVmModelBehavior) getBehavior()).getVm().getId(); AsyncDataProvider.getInstance().getLabelListByEntityId(getLabelsByVmIdQuery, vmId); } labelList.setIsChangeable(false); } }; AsyncDataProvider.getInstance().getLabelList(getLabelsQuery); }
Source:
public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleeper) { log.warn("Zookeeper can't be reached, retrying (retryCount = " + retryCount + " out of " + this.getN() + ")..."); boolean shouldRetry = super.allowRetry(retryCount, elapsedTimeMs, sleeper); if (!shouldRetry) { log.warn("Since Zookeeper can't be reached after retries exhausted, calling exit function..."); exitRunner.run(); } return shouldRetry; }

Target:
public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleeper) { log.warn("Zookeeper can't be reached, retrying (retryCount = %s out of %s)...", retryCount, this.getN()); boolean shouldRetry = super.allowRetry(retryCount, elapsedTimeMs, sleeper); if (!shouldRetry) { log.warn("Since Zookeeper can't be reached after retries exhausted, calling exit function..."); exitRunner.run(); } return shouldRetry; }
Source:
private void createDefaultSet() { OAISet newOaiSet = new OAISet(); newOaiSet.setSpec(""); newOaiSet.setName(""); newOaiSet.setDescription("The default, \"no name\" set. The OAI server will serve the records from this set when no \"setspec\" argument is specified by the client."); newOaiSet.setDefinition(""); boolean success = false; try { oaiSetService.save(newOaiSet); configuredHarvestingSets = oaiSetService.findAll(); success = true; } catch (Exception ex) { JH.addMessage(FacesMessage.SEVERITY_FATAL, BundleUtil.getStringFromBundle("harvest.oaicreate.defaultset.fail")); logger.log(Level.SEVERE, "Failed to create the Default OAI set" + ex.getMessage(), ex); } if (success) { OAISet savedSet = oaiSetService.findBySpec(getNewSetSpec()); if (savedSet != null) { runSetExport(savedSet); configuredHarvestingSets = oaiSetService.findAll(); } } setPageMode(HarvestingSetsPage.PageMode.VIEW); }

Target:
private void createDefaultSet() { OAISet newOaiSet = new OAISet(); newOaiSet.setSpec(""); newOaiSet.setName(""); newOaiSet.setDescription(BundleUtil.getStringFromBundle("harvestserver.newSetDialog.setdescription.default")); newOaiSet.setDefinition(""); boolean success = false; try { oaiSetService.save(newOaiSet); configuredHarvestingSets = oaiSetService.findAll(); success = true; } catch (Exception ex) { JH.addMessage(FacesMessage.SEVERITY_FATAL, BundleUtil.getStringFromBundle("harvest.oaicreate.defaultset.fail")); logger.log(Level.SEVERE, "Failed to create the Default OAI set" + ex.getMessage(), ex); } if (success) { OAISet savedSet = oaiSetService.findBySpec(getNewSetSpec()); if (savedSet != null) { runSetExport(savedSet); configuredHarvestingSets = oaiSetService.findAll(); } } setPageMode(HarvestingSetsPage.PageMode.VIEW); }
Source:
public void run() { try { synchronized (this) { if(closed.get()){ return; } curatorFramework = CuratorUtil.newAppCurator(env.getConfiguration()); CuratorCnxnListener cnxnListener = new CuratorCnxnListener(); curatorFramework.getConnectionStateListenable().addListener(cnxnListener); curatorFramework.start(); while (!cnxnListener.isConnected()) Thread.sleep(200); pathChildrenCache = new PathChildrenCache(curatorFramework, ZookeeperPath.ORACLE_SERVER, true); pathChildrenCache.getListenable().addListener(this); pathChildrenCache.start(); leaderSelector = new LeaderSelector(curatorFramework, ZookeeperPath.ORACLE_SERVER, this); connect(); } doWork(); } catch (Exception e) { if (!closed.get()) { log.error("Exception occurred in run() method", e); } } }

Target:
public void run() { try { synchronized (this) { if(closed.get()){ return; } curatorFramework = CuratorUtil.newAppCurator(env.getConfiguration()); CuratorCnxnListener cnxnListener = new CuratorCnxnListener(); curatorFramework.getConnectionStateListenable().addListener(cnxnListener); curatorFramework.start(); while (!cnxnListener.isConnected()) Thread.sleep(200); pathChildrenCache = new PathChildrenCache(curatorFramework, ZookeeperPath.ORACLE_SERVER, true); pathChildrenCache.getListenable().addListener(this); pathChildrenCache.start(); leaderSelector = new LeaderSelector(curatorFramework, ZookeeperPath.ORACLE_SERVER, this); connect(); } doWork(); } catch (Exception e) { if (!closed.get()) { log.error("Exception occurred in run() method", e); } else { log.debug("Exception occurred in run() method", e); } } }
Source:
private void onGameInfo(GameInfoMessage gameInfoMessage) { if (gameInfoMessage.getGames() != null) { gameInfoMessage.getGames().forEach(this::onGameInfo); return; } final Game game; Integer gameId = gameInfoMessage.getUid(); Player currentPlayer = playerService.getCurrentPlayer(); if (!uidToGameInfoBean.containsKey(gameId)) { game = new Game(gameInfoMessage); uidToGameInfoBean.put(gameId, game); } else { game = uidToGameInfoBean.get(gameId); Platform.runLater(() -> game.updateFromGameInfo(gameInfoMessage)); if (GameState.CLOSED == gameInfoMessage.getState()) { if (currentPlayer.getGame() == game) { currentPlayer.gameProperty().addListener((observable, oldValue, newValue) -> { if (newValue == null && oldValue.getStatus() == GameState.CLOSED) { removeGame(gameInfoMessage); } }); } else { removeGame(gameInfoMessage); } return; } } boolean currentPlayerInGame = gameInfoMessage.getTeams().values().stream() .anyMatch(team -> team.contains(currentPlayer.getUsername())); if (currentPlayerInGame && GameState.OPEN == gameInfoMessage.getState()) { synchronized (currentGame) { currentGame.set(game); } } game.statusProperty().addListener((observable, oldValue, newValue) -> { if (oldValue == GameState.OPEN && newValue == GameState.PLAYING && game.getTeams().values().stream().anyMatch(team -> team.contains(currentPlayer.getUsername())) && !platformService.isGameWindowFocused()) { platformService.focusGameWindow(); } }); }

Target:
private void onGameInfo(GameInfoMessage gameInfoMessage) { if (gameInfoMessage.getGames() != null) { gameInfoMessage.getGames().forEach(this::onGameInfo); return; } final Game game; Integer gameId = gameInfoMessage.getUid(); Player currentPlayer = playerService.getCurrentPlayer().orElseThrow(() -> new IllegalStateException("Player has not been set")); if (!uidToGameInfoBean.containsKey(gameId)) { game = new Game(gameInfoMessage); uidToGameInfoBean.put(gameId, game); } else { game = uidToGameInfoBean.get(gameId); Platform.runLater(() -> game.updateFromGameInfo(gameInfoMessage)); if (GameState.CLOSED == gameInfoMessage.getState()) { if (currentPlayer.getGame() == game) { currentPlayer.gameProperty().addListener((observable, oldValue, newValue) -> { if (newValue == null && oldValue.getStatus() == GameState.CLOSED) { removeGame(gameInfoMessage); } }); } else { removeGame(gameInfoMessage); } return; } } boolean currentPlayerInGame = gameInfoMessage.getTeams().values().stream() .anyMatch(team -> team.contains(currentPlayer.getUsername())); if (currentPlayerInGame && GameState.OPEN == gameInfoMessage.getState()) { synchronized (currentGame) { currentGame.set(game); } } game.statusProperty().addListener((observable, oldValue, newValue) -> { if (oldValue == GameState.OPEN && newValue == GameState.PLAYING && game.getTeams().values().stream().anyMatch(team -> team.contains(currentPlayer.getUsername())) && !platformService.isWindowFocused(faWindowTitle)) { platformService.focusWindow(faWindowTitle); } }); }
Source:
public void close() { logger.info("Close interpreter"); if (numReferenceOfSparkContext.decrementAndGet() == 0) { sc.stop(); sc = null; sparkSession = null; if (classServer != null) { Utils.invokeMethod(classServer, "stop"); classServer = null; } } Utils.invokeMethod(intp, "close"); }

Target:
public void close() { logger.info("Close interpreter"); if (numReferenceOfSparkContext.decrementAndGet() == 0) { if (sparkSession != null) { Utils.invokeMethod(sparkSession, "stop"); } else if (sc != null){ sc.stop(); } sparkSession = null; sc = null; if (classServer != null) { Utils.invokeMethod(classServer, "stop"); classServer = null; } } Utils.invokeMethod(intp, "close"); }
Source:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) { Uri uri = data.getData(); try { mImage = MediaStore.Images.Media.getBitmap(getContentResolver(), uri); Toast toast = Toast.makeText(YieldsApplication.getApplicationContext(), "Image added to message", Toast.LENGTH_SHORT); toast.show(); } catch (IOException e) { e.printStackTrace(); } } }

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) { Uri uri = data.getData(); try { mImage = MediaStore.Images.Media.getBitmap(getContentResolver(), uri); Toast toast = Toast.makeText(YieldsApplication.getApplicationContext(), "Image added to message", Toast.LENGTH_SHORT); toast.show(); } catch (IOException e) { Log.d("Message Activity", "Couldn't add image to the message"); } } }
Source:
public TableId parseTableIdentifier(String fqn) { List<String> parts = identifierRules().parseQualifiedIdentifier(fqn); if (parts == null || parts.isEmpty()) { throw new IllegalArgumentException("Invalid fully qualified name: '" + fqn + "'"); } if (parts.size() == 1) { return new TableId(null, null, parts.get(0)); } if (parts.size() == 3) { return new TableId(parts.get(0), parts.get(1), parts.get(2)); } assert parts.size() >= 2; if (useCatalog()) { return new TableId(parts.get(0), null, parts.get(1)); } return new TableId(null, parts.get(0), parts.get(1)); }

Target:
public TableId parseTableIdentifier(String fqn) { List<String> parts = identifierRules().parseQualifiedIdentifier(fqn); if (parts.isEmpty()) { throw new IllegalArgumentException("Invalid fully qualified name: '" + fqn + "'"); } if (parts.size() == 1) { return new TableId(null, null, parts.get(0)); } if (parts.size() == 3) { return new TableId(parts.get(0), parts.get(1), parts.get(2)); } assert parts.size() >= 2; if (useCatalog()) { return new TableId(parts.get(0), null, parts.get(1)); } return new TableId(null, parts.get(0), parts.get(1)); }
Source:
public static Collection<Object[]> getConstructorArguments() throws IOException { GoogleCloudStorage gcs = new InMemoryGoogleCloudStorage(); GoogleCloudStorage zeroLaggedGcs = new LaggedGoogleCloudStorage( new InMemoryGoogleCloudStorage(), Clock.SYSTEM, ListVisibilityCalculator.IMMEDIATELY_VISIBLE); GoogleCloudStorage performanceCachingGcs = new PerformanceCachingGoogleCloudStorage( new InMemoryGoogleCloudStorage(), PerformanceCachingGoogleCloudStorageOptions.builder() .setListCachingEnabled(true) .build()); ThrottledGoogleCloudStorage throttledGoogleCloudStorage = new ThrottledGoogleCloudStorage(gcs, RateLimiter.create(2)); ThrottledGoogleCloudStorage throttledGoogleCloudStorageWithOneOperation = new ThrottledGoogleCloudStorage( new Double(2.00), gcs, EnumSet.of(ThrottledGoogleCloudStorage.StorageOperation.CREATE_OBJECT)); return Arrays.asList( new Object[] {gcs}, new Object[] {zeroLaggedGcs}, new Object[] {performanceCachingGcs}, new Object[] {throttledGoogleCloudStorage}, new Object[] {throttledGoogleCloudStorageWithOneOperation}); }

Target:
public static Collection<Object[]> getConstructorArguments() throws IOException { GoogleCloudStorage gcs = new InMemoryGoogleCloudStorage(); GoogleCloudStorage zeroLaggedGcs = new LaggedGoogleCloudStorage( new InMemoryGoogleCloudStorage(), Clock.SYSTEM, ListVisibilityCalculator.IMMEDIATELY_VISIBLE); GoogleCloudStorage performanceCachingGcs = new PerformanceCachingGoogleCloudStorage( new InMemoryGoogleCloudStorage(), PerformanceCachingGoogleCloudStorageOptions.builder() .setListCachingEnabled(true) .build()); return Arrays.asList( new Object[] {gcs}, new Object[] {zeroLaggedGcs}, new Object[] {performanceCachingGcs}); }
Source:
public String toString() { return String.format("%s, ticket=%s, validTime=%s,m userName=%s, userId=%s", super.toString(), getTicket(), getValidTime(), getUserName(), getUserId().toString()); }

Target:
public String toString() { return String.format("%s, ticket=%s, validTime=%s,m userName=%s, userId=%s", super.toString(), getTicket(), getValidTime(), getUserName(), getUserId()); }
Source:
public void unretireOrderFrequency_shouldUnretireGivenOrderFrequency() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-otherOrderFrequencies.xml"); OrderFrequency orderFrequency = orderService.getOrderFrequency(103); assertNotNull(orderFrequency); assertTrue(orderFrequency.isRetired()); assertNull(orderFrequency.getRetireReason()); assertNotNull(orderFrequency.getDateRetired()); orderService.unretireOrderFrequency(orderFrequency); orderFrequency = orderService.getOrderFrequency(103); assertNotNull(orderFrequency); assertFalse(orderFrequency.isRetired()); assertNull(orderFrequency.getRetireReason()); assertNull(orderFrequency.getDateRetired()); }

Target:
public void unretireOrderFrequency_shouldUnretireGivenOrderFrequency() { executeDataSet("org/openmrs/api/include/OrderServiceTest-otherOrderFrequencies.xml"); OrderFrequency orderFrequency = orderService.getOrderFrequency(103); assertNotNull(orderFrequency); assertTrue(orderFrequency.getRetired()); assertEquals(null,orderFrequency.getRetireReason()); assertNotNull(orderFrequency.getDateRetired()); orderService.unretireOrderFrequency(orderFrequency); orderFrequency = orderService.getOrderFrequency(103); assertNotNull(orderFrequency); assertFalse(orderFrequency.getRetired()); assertNull(orderFrequency.getRetireReason()); assertNull(orderFrequency.getDateRetired()); assertEquals(7, orderService.getOrderFrequencies(true).size()); }
Source:
public void testPutIfAbsentHasStoreEntryCacheAccessExceptionNoCacheWriterEntry() throws Exception { final FakeStore realStore = new FakeStore(Collections.singletonMap("key", "oldValue")); this.store = spy(realStore); doThrow(new CacheAccessException("")).when(this.store).computeIfAbsent(eq("key"), getAnyFunction()); final FakeCacheWriter realCache = new FakeCacheWriter(Collections.<String, String>emptyMap()); this.cacheWriter = spy(realCache); final Ehcache<String, String> ehcache = this.getEhcache(this.cacheWriter); final InOrder ordered = inOrder(this.cacheWriter, this.spiedResilienceStrategy); ehcache.putIfAbsent("key", "value"); verify(this.store).computeIfAbsent(eq("key"), getAnyFunction()); ordered.verify(this.cacheWriter).write(eq("key"), eq("value")); ordered.verify(this.spiedResilienceStrategy) .putIfAbsentFailure(eq("key"), eq("value"), any(CacheAccessException.class), eq(true)); assertThat(realCache.getEntryMap().get("key"), equalTo("value")); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.PutIfAbsentOutcome.FAILURE)); }

Target:
public void testPutIfAbsentHasStoreEntryCacheAccessExceptionNoCacheWriterEntry() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.singletonMap("key", "oldValue")); this.store = spy(fakeStore); doThrow(new CacheAccessException("")).when(this.store).computeIfAbsent(eq("key"), getAnyFunction()); final FakeCacheWriter fakeWriter = new FakeCacheWriter(Collections.<String, String>emptyMap()); this.cacheWriter = spy(fakeWriter); final Ehcache<String, String> ehcache = this.getEhcache(this.cacheWriter); final InOrder ordered = inOrder(this.cacheWriter, this.spiedResilienceStrategy); ehcache.putIfAbsent("key", "value"); verify(this.store).computeIfAbsent(eq("key"), getAnyFunction()); ordered.verify(this.cacheWriter).write(eq("key"), eq("value")); ordered.verify(this.spiedResilienceStrategy) .putIfAbsentFailure(eq("key"), eq("value"), any(CacheAccessException.class), eq(true)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.PutIfAbsentOutcome.FAILURE)); }
Source:
public void highWaterMarkValueTest() throws Exception { String highWaterMark = "high-water-mark"; navigateToIIOPSubsystemPage(); page.switchToEditMode(); ConfigFragment editPanelFragment = page.getConfigFragment(); Editor editor = editPanelFragment.getEditor(); Console.withBrowser(browser).scrollIntoView(editor.getText(highWaterMark)); editor.text(highWaterMark, "7"); boolean finished = editPanelFragment.save(); assertTrue("Config should be saved and closed.", finished); new ResourceVerifier(iiopSubsystemAddress, client).verifyAttribute("high-water-mark", 7); page.switchToEditMode(); editPanelFragment = page.getConfigFragment(); editPanelFragment.getEditor().text("high-water-mark", ""); finished = editPanelFragment.save(); assertTrue("Config should be saved and closed.", finished); new ResourceVerifier(iiopSubsystemAddress, client).verifyAttributeIsUndefined("high-water-mark"); }

Target:
public void highWaterMarkValueTest() throws Exception { navigateToIIOPSubsystemPage(); page.switchToEditMode(); ConfigFragment editPanelFragment = page.getConfigFragment(); Editor editor = editPanelFragment.getEditor(); Console.withBrowser(browser).scrollIntoView(editor.getText(HIGH_WATER_MARK)); editor.text(HIGH_WATER_MARK, "7"); boolean finished = editPanelFragment.save(); assertTrue("Config should be saved and closed.", finished); new ResourceVerifier(iiopSubsystemAddress, client).verifyAttribute("high-water-mark", 7); page.switchToEditMode(); editPanelFragment = page.getConfigFragment(); editPanelFragment.getEditor().text("high-water-mark", ""); finished = editPanelFragment.save(); assertTrue("Config should be saved and closed.", finished); new ResourceVerifier(iiopSubsystemAddress, client).verifyAttributeIsUndefined("high-water-mark"); }
Source:
private void removeStaleAliasesFromChannel( Set<Long> channelIdsThatHaveAliasesAdded, Iterable<Channel> channels ) { for (Channel channel : channels) { if(!channelIdsThatHaveAliasesAdded.contains(channel.getId())) { channel.setAliases( channel.getAliases() .stream() .filter(alias -> !alias.getNamespace().equals(aliasNamespace)) .collect(Collectors.toList()) ); } channelWriter.createOrUpdate(channel); } }

Target:
private void removeStaleAliasesFromChannel( Set<Long> channelIdsThatHaveAliasesAdded, Iterable<Channel> channels ) { for (Channel channel : channels) { if(!channelIdsThatHaveAliasesAdded.contains(channel.getId())) { channel.setAliases( channel.getAliases() .stream() .filter(alias -> !alias.getNamespace().equals(aliasNamespace)) .collect(Collectors.toList()) ); channelWriter.createOrUpdate(channel); } } }