auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run() throws Exception { final Ds3SpecParser parser = new Ds3SpecParserImpl(); System.out.println("Generating " + args.getType().toString() + " ds3 sdk code for the spec " + args.getInputSpec() ); final Ds3ApiSpec spec = parser.getSpec(Files.newInputStream(Paths.get(args.getInputSpec()))); CodeGenerator generator; switch (args.getType()) { case C: generator = new CCodeGenerator(); break; case JAVA: generator = new JavaCodeGenerator(); break; case NET: generator = new NetCodeGenerator(); break; case PYTHON: generator = new PythonCodeGenerator(); break; default: throw new IllegalArgumentException("Unknown generator type " + args.getType().toString()); } FileUtils fileUtils = new FileUtilsImpl(); generator.generate(spec, fileUtils, Paths.get(args.getTargetDir())); }

Target:
public void run() throws Exception { final Ds3SpecParser parser = new Ds3SpecParserImpl(); System.out.println("Generating " + args.getType().toString() + " ds3 sdk code for the spec " + args.getInputSpec() ); final Ds3ApiSpec spec = parser.getSpec(Files.newInputStream(Paths.get(args.getInputSpec()))); final CodeGenerator generator; switch (args.getType()) { case C: generator = new CCodeGenerator(); break; case JAVA: generator = new JavaCodeGenerator(); break; case NET: generator = new NetCodeGenerator(); break; case PYTHON: generator = new PythonCodeGenerator(); break; default: throw new IllegalArgumentException("Unknown generator type " + args.getType().toString()); } final FileUtils fileUtils = new FileUtilsImpl(); generator.generate(spec, fileUtils, Paths.get(args.getTargetDir())); }
Source:
public Set<String> getGrantedPermissions() { final Set<String> permissions = this.permissions.entrySet().stream().filter(Entry::getValue).map(Entry::getKey).collect(Collectors.toSet()); return permissions; }

Target:
public Set<String> getGrantedPermissions() { return permissions.entrySet().stream().filter(Entry::getValue).map(Entry::getKey).collect(Collectors.toSet()); }
Source:
public void loadFromDataStore() throws Exception { Datastore dsNoCredentials = null; try { dsNoCredentials = new Datastore("<LINK_0>"); System.out.println(file); File f = dsNoCredentials.getFile("edu.cogcomp", file, 1.3); InputStream is = new FileInputStream(f); loadFromInputStream(is); } catch (InvalidPortException | InvalidEndpointException e) { e.printStackTrace(); System.out.println("The BrownCluster did not load. This is probably because out datastore server is off. Try again later or ping us. "); } }

Target:
public void loadFromDataStore() throws Exception { Datastore dsNoCredentials = new Datastore(new ResourceConfigurator().getDefaultConfig()); File f = dsNoCredentials.getFile("org.cogcomp.brown-clusters", file, 1.3); InputStream is = new FileInputStream(f); loadFromInputStream(is); }
Source:
public void purge(Set<Integer> parts, IgniteCallable<Boolean> shouldStop) throws IgniteCheckedException { assert !F.isEmpty(parts) : "empty parts"; assert shouldStop != null : "shouldStop is null"; TreeRowClosure<H2Row, H2Row> rowClo = (tree, io, pageAddr, idx) -> { long link = ((H2RowLinkIO)io).getLink(pageAddr,idx); int partId = PageIdUtils.partId(link); return parts.contains(partId); }; InlineIndexHelper.setCurrentInlineIndexes(inlineIdxs); try { if (shouldStop.call()) return; GridCursor<Void> cur = purge(rowClo); while (cur.next()) { if (shouldStop.call()) return; cctx.shared().database().checkpointReadLock(); try { cur.get(); } catch (IgniteCheckedException e) { throw U.convertException(e); } finally { cctx.shared().database().checkpointReadUnlock(); } } } catch (IgniteCheckedException e) { throw e; } catch (Exception e) { if (e.getCause() instanceof NodeStoppingException) throw (NodeStoppingException)e.getCause(); throw U.cast(e); } finally { InlineIndexHelper.clearCurrentInlineIndexes(); } }

Target:
public void purge(Set<Integer> parts, IgniteCallable<Boolean> shouldStop) throws IgniteCheckedException { assert !F.isEmpty(parts) : "Empty parts"; assert shouldStop != null; TreeRowClosure<H2Row, H2Row> rowClo = (tree, io, pageAddr, idx) -> { long link = ((H2RowLinkIO)io).getLink(pageAddr,idx); int partId = PageIdUtils.partId(link); return parts.contains(partId); }; InlineIndexHelper.setCurrentInlineIndexes(inlineIdxs); try { if (shouldStop.call()) return; visitLeaves(rowClo, new PurgePageHandler(rowClo) { @Override public void onBefore() { cctx.shared().database().checkpointReadLock(); } @Override public void onAfter() throws IgniteCheckedException { try { super.onAfter(); } finally { cctx.shared().database().checkpointReadUnlock(); } } }); } catch (IgniteCheckedException e) { throw e; } catch (Exception e) { if (e.getCause() instanceof NodeStoppingException) throw (NodeStoppingException)e.getCause(); throw U.cast(e); } finally { InlineIndexHelper.clearCurrentInlineIndexes(); } }
Source:
protected Text createFilterText(Composite parent) { filterText = new Text(parent, SWT.NONE); Dialog.applyDialogFont(filterText); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalAlignment = GridData.FILL; data.verticalAlignment = GridData.CENTER; filterText.setLayoutData(data); filterText.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.CR || e.character == '\r' || e.character == '\n') { gotoSelectedElement(); dispose(); } else if (e.keyCode == SWT.ARROW_DOWN) { delegate.getTreeViewer().getTree().setFocus(); } else if (e.character == SWT.ESC) { dispose(); } } }); filterText.setText(""); filterText.addModifyListener(e -> { TreeViewer viewer = delegate.getTreeViewer(); try { viewer.getControl().setRedraw(false); String text = filterText.getText(); if (StringUtils.isEmptyOrNull(text)) { viewer.setFilters(); } else { final SearchPattern pattern = new SearchPattern(); pattern.setPattern(text); viewer.setFilters(new ViewerFilter() { private boolean firstMatch = true; @Override public boolean select(Viewer v, Object parentElement, Object element) { boolean result = isMatch(pattern, element); if (result && element instanceof FileDiffRegion && firstMatch) { firstMatch = false; viewer.setSelection( new StructuredSelection(element)); } return result; } }); } viewer.expandAll(); } finally { viewer.getControl().setRedraw(true); } }); return filterText; }

Target:
private Text createFilterText(Composite parent) { filterText = new Text(parent, SWT.NONE); Dialog.applyDialogFont(filterText); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER) .grab(true, false).applyTo(filterText); filterText.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.CR || e.character == '\r' || e.character == '\n') { gotoSelectedElement(); close(); } else if (e.keyCode == SWT.ARROW_DOWN) { delegate.getTreeViewer().getTree().setFocus(); selectFirst(); } else if (e.character == SWT.ESC) { close(); } } }); filterText.setMessage(UIText.DiffEditor_QuickOutlineFilterHint); filterText.addModifyListener(e -> { TreeViewer viewer = delegate.getTreeViewer(); try { viewer.getControl().setRedraw(false); String text = filterText.getText(); if (StringUtils.isEmptyOrNull(text)) { viewer.setFilters(); } else { final SearchPattern pattern = new SearchPattern(); pattern.setPattern(text); viewer.setFilters(new ViewerFilter() { @Override public boolean select(Viewer v, Object parentElement, Object element) { return isMatch(pattern, element); } }); } viewer.expandAll(); selectFirst(); } finally { viewer.getControl().setRedraw(true); } }); return filterText; }
Source:
public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final LinkedSpan<T> other = (LinkedSpan<T>) obj; return Objects.equals(this.linkedEntries, other.linkedEntries) && this.sentenceid == other.sentenceid && Objects.equals(this.searchTerm, other.searchTerm); }

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final LinkedSpan<T> other = (LinkedSpan<T>) obj; if (!Objects.equals(this.linkedEntries, other.linkedEntries)) { return false; } return this.sentenceid == other.sentenceid && Objects.equals(this.searchTerm, other.searchTerm); }
Source:
protected List<MethodMatcher> getMethodInvocationMatchers() { return Arrays.asList( MethodMatcher.create().typeDefinition("java.net.Socket").name(INIT).withAnyParameters(), MethodMatcher.create().typeDefinition("java.net.ServerSocket").name(INIT).withAnyParameters(), MethodMatcher.create().typeDefinition(JAVAX_NET_SOCKET_FACTORY).name(INIT).withAnyParameters(), MethodMatcher.create().typeDefinition(JAVAX_NET_SOCKET_FACTORY).name("createSocket").withAnyParameters(), MethodMatcher.create().typeDefinition("java.nio.channels.AsynchronousServerSocketChannel").name("open").withAnyParameters(), MethodMatcher.create().typeDefinition("java.nio.channels.AsynchronousSocketChannel").name("open").withAnyParameters(), MethodMatcher.create().typeDefinition("java.nio.channels.SocketChannel").name("open").withAnyParameters(), MethodMatcher.create().typeDefinition("java.nio.channels.ServerSocketChannel").name("open").withAnyParameters(), MethodMatcher.create().typeDefinition("io.netty.channel.ChannelInitializer").name(INIT).withAnyParameters()); }

Target:
protected List<MethodMatcher> getMethodInvocationMatchers() { return Arrays.asList( MethodMatcher.create().typeDefinition("java.net.Socket").name(INIT).withAnyParameters(), MethodMatcher.create().typeDefinition("java.net.ServerSocket").name(INIT).withAnyParameters(), MethodMatcher.create().typeDefinition(JAVAX_NET_SOCKET_FACTORY).name(INIT).withAnyParameters(), MethodMatcher.create().typeDefinition(JAVAX_NET_SOCKET_FACTORY).name("createSocket").withAnyParameters(), MethodMatcher.create().typeDefinition("java.nio.channels.AsynchronousServerSocketChannel").name(OPEN_METHOD).withAnyParameters(), MethodMatcher.create().typeDefinition("java.nio.channels.AsynchronousSocketChannel").name(OPEN_METHOD).withAnyParameters(), MethodMatcher.create().typeDefinition("java.nio.channels.SocketChannel").name(OPEN_METHOD).withAnyParameters(), MethodMatcher.create().typeDefinition("java.nio.channels.ServerSocketChannel").name(OPEN_METHOD).withAnyParameters(), MethodMatcher.create().typeDefinition("io.netty.channel.ChannelInitializer").name(INIT).withAnyParameters()); }
Source:
protected void close() { if (!shouldPause()) { tryStop(); } if (producer != null) { try { producer.close(Duration.ofSeconds(30)); } catch (Throwable t) { log.warn("Could not close producer", t); } } try { transformationChain.close(); } catch (Throwable t) { log.warn("Could not close transformation chain", t); } try { retryWithToleranceOperator.close(); } catch (Throwable t) { log.warn("Could not close retry operator", t); } }

Target:
protected void close() { if (!shouldPause()) { tryStop(); } if (producer != null) { try { producer.close(Duration.ofSeconds(30)); } catch (Throwable t) { log.warn("Could not close producer", t); } } try { transformationChain.close(); } catch (Throwable t) { log.warn("Could not close transformation chain", t); } Utils.closeQuietly(retryWithToleranceOperator, "retry operator"); }
Source:
public static UsageReporter getInstance(Map<String, String> configs) { if (s_instance == null) { s_instance = new UsageReporter(); s_instance.init(configs); } return s_instance; }

Target:
public synchronized static UsageReporter getInstance(Map<String, String> configs) { if (s_instance == null) { UsageReporter new_instance = new UsageReporter(); new_instance.init(configs); s_instance = new_instance; } return s_instance; }
Source:
public ProxyConfiguration(String name, int port, String userName, String password, String noProxyHost, String testUrl) { this.name = Util.fixEmptyAndTrim(name); this.port = port; this.userName = Util.fixEmptyAndTrim(userName); this.secretPassword = password != null ? Secret.fromString(password) : null; this.noProxyHost = Util.fixEmptyAndTrim(noProxyHost); this.testUrl = Util.fixEmptyAndTrim(testUrl); this.authenticator = newAuthenticator(); }

Target:
public ProxyConfiguration(String name, int port, String userName, String password, String noProxyHost, String testUrl) { this.name = Util.fixEmptyAndTrim(name); this.port = port; this.userName = Util.fixEmptyAndTrim(userName); String tempPassword = Util.fixEmptyAndTrim(password); this.secretPassword = tempPassword != null ? Secret.fromString(tempPassword) : null; this.noProxyHost = Util.fixEmptyAndTrim(noProxyHost); this.testUrl = Util.fixEmptyAndTrim(testUrl); this.authenticator = newAuthenticator(); }
Source:
public String getUrlToShow() { if (!url.contains("user=")) { StringBuilder urlToShow = new StringBuilder(); urlToShow.append(url); if (!url.contains("?")) { urlToShow.append("?user=").append(googleId); } else { urlToShow.append("&user=").append(googleId); } return urlToShow.toString(); } return url; }

Target:
public String getUrlToShow() { if (url.contains("user=")) { return url; } if (url.contains("?")) { return url + "&user=" + googleId; } return url + "?user=" + googleId; }
Source:
public TextField() { labelElement = new Element("label"); inputElement = new Element("input"); String textFieldId = "textfield" + id++; inputElement.setAttribute("id", textFieldId); labelElement.setAttribute("for", textFieldId); inputElement.synchronizeProperty(VALUE_PROPERTY, "change"); inputElement.addEventListener("change", e -> fireEvent(new ChangeEvent(this, true))); getElement().appendChild(labelElement, inputElement); }

Target:
public TextField() { labelElement = new Element("label"); inputElement = new Element("input"); String textFieldId = generateId(); inputElement.setAttribute("id", textFieldId); labelElement.setAttribute("for", textFieldId); inputElement.synchronizeProperty(VALUE_PROPERTY, "change"); inputElement.addEventListener("change", e -> fireEvent(new ChangeEvent(this, true))); getElement().appendChild(labelElement, inputElement); }
Source:
public PlanNode replace(int group, PlanNode node, String reason) { PlanNode old = getGroup(group).membership; checkArgument(new HashSet<>(old.getOutputSymbols()).equals(new HashSet<>(node.getOutputSymbols())), "%s: transformed expression doesn't produce same outputs: %s vs %s", reason, old.getOutputSymbols(), node.getOutputSymbols()); if (node instanceof GroupReference) { node = getNode(((GroupReference) node).getGroupId()); } else { node = insertChildrenAndRewrite(node); } incrementReferenceCounts(node, group); getGroup(group).membership = node; decrementReferenceCounts(old, group); evictStatistics(group); return node; }

Target:
public PlanNode replace(int group, PlanNode node, String reason) { PlanNode old = getGroup(group).membership; checkArgument(new HashSet<>(old.getOutputSymbols()).equals(new HashSet<>(node.getOutputSymbols())), "%s: transformed expression doesn't produce same outputs: %s vs %s", reason, old.getOutputSymbols(), node.getOutputSymbols()); if (node instanceof GroupReference) { node = getNode(((GroupReference) node).getGroupId()); } else { node = insertChildrenAndRewrite(node); } incrementReferenceCounts(node, group); getGroup(group).membership = node; decrementReferenceCounts(old, group); evictStatisticsAndCost(group); return node; }
Source:
protected String determineFileName(String inputFileName) { for (final String prefix : inputPathPrefixes) { final Path prefPath = Paths.get(prefix).toAbsolutePath(); final String prefPathString = prefPath.toString(); if (inputFileName.startsWith(prefPathString)) { if (prefPath.toFile().isDirectory()) { return trimAnyPathSep(inputFileName.substring(prefPathString.length())); } else { if (inputFileName.indexOf(FILE_SEPARATOR.charAt(0)) == -1) { return inputFileName; } return trimAnyPathSep(inputFileName.substring(prefPathString.lastIndexOf(FILE_SEPARATOR))); } } } return inputFileName; }

Target:
protected String determineFileName(String inputFileName) { return ShortFilenameUtil.determineFileName(inputPathPrefixes, inputFileName); }
Source:
public Value list( Value request ) { final File dir = new File( request.getFirstChild( "directory" ).strValue() ); boolean fileInfo = false; if ( request.getFirstChild("fileInfo").isDefined() ) { fileInfo = request.getFirstChild("fileInfo").boolValue(); } final String regex; if ( request.hasChildren( "regex" ) ) { regex = request.getFirstChild( "regex" ).strValue(); } else { regex = ".*"; } boolean dirsOnly; if ( request.hasChildren( "dirsOnly" ) ) { dirsOnly = request.getFirstChild( "dirsOnly" ).boolValue(); } else { dirsOnly = false; } final String[] files = dir.list( new ListFilter( regex, dirsOnly ) ); if ( request.hasChildren( "order" ) ) { Value order = request.getFirstChild( "order" ); if ( files != null && order.hasChildren( "byname" ) && order.getFirstChild( "byname" ).boolValue() ) { Arrays.sort( files ); } } Value response = Value.create(); if ( files != null ) { ValueVector results = response.getChildren( "result" ); for( String file : files ) { Value fileValue = Value.create( file ); if( fileInfo ) { File currFile = new File ( dir + File.separator + file ); fileValue.getFirstChild("lastModified").setValue( currFile.lastModified() ); fileValue.getFirstChild("size").setValue( currFile.length() ); fileValue.getFirstChild("absolutePath").setValue( currFile.getAbsolutePath() ); fileValue.getFirstChild("isHidden").setValue( currFile.isHidden() ); fileValue.getFirstChild("isDirectory").setValue( currFile.isDirectory() ); } results.add( fileValue ); } } return response; }

Target:
public Value list( Value request ) { final File dir = new File( request.getFirstChild( "directory" ).strValue() ); boolean fileInfo = false; if ( request.getFirstChild( "info" ).isDefined() ) { fileInfo = request.getFirstChild( "info" ).boolValue(); } final String regex; if ( request.hasChildren( "regex" ) ) { regex = request.getFirstChild( "regex" ).strValue(); } else { regex = ".*"; } boolean dirsOnly; if ( request.hasChildren( "dirsOnly" ) ) { dirsOnly = request.getFirstChild( "dirsOnly" ).boolValue(); } else { dirsOnly = false; } final String[] files = dir.list( new ListFilter( regex, dirsOnly ) ); if ( request.hasChildren( "order" ) ) { Value order = request.getFirstChild( "order" ); if ( files != null && order.hasChildren( "byname" ) && order.getFirstChild( "byname" ).boolValue() ) { Arrays.sort( files ); } } Value response = Value.create(); if ( files != null ) { ValueVector results = response.getChildren( "result" ); for( String file : files ) { Value fileValue = Value.create( file ); if( fileInfo ) { Value info = fileValue.getFirstChild( "info" ); File currFile = new File ( dir + File.separator + file ); info.getFirstChild( "lastModified" ).setValue( currFile.lastModified() ); info.getFirstChild( "size" ).setValue( currFile.length() ); info.getFirstChild( "absolutePath" ).setValue( currFile.getAbsolutePath() ); info.getFirstChild( "isHidden" ).setValue( currFile.isHidden() ); info.getFirstChild( "isDirectory" ).setValue( currFile.isDirectory() ); } results.add( fileValue ); } } return response; }
Source:
public void showAdvancedOptions(final ClickEvent clickEvent) { if (advancedOptions.getHidden()) { advancedOptions.setHidden(false); showHideAdvancedOptions.setTextContent(ts.format(LibraryConstants.HideAdvancedOptions)); } else { advancedOptions.setHidden(true); showHideAdvancedOptions.setTextContent(ts.format(LibraryConstants.ShowAdvancedOptions)); artifactId.setValue(name.getValue()); } }

Target:
public void showAdvancedOptions(final ClickEvent clickEvent) { if (advancedOptions.getHidden()) { advancedOptions.setHidden(false); showHideAdvancedOptions.setTextContent(ts.format(LibraryConstants.HideAdvancedOptions)); } else { advancedOptions.setHidden(true); showHideAdvancedOptions.setTextContent(ts.format(LibraryConstants.ShowAdvancedOptions)); presenter.restoreDefaultAdvancedOptions(); } }
Source:
public String getUrl() { String url = PluginImpl.getInstance().getConfig().getGerritFrontEndUrl(); Provider provider = tEvent.getProvider(); if (provider != null) { String providerUrl = provider.getUrl(); if (providerUrl != null && !"".equals(providerUrl)) { url = providerUrl; } } if (tEvent instanceof ChangeBasedEvent) { ChangeBasedEvent changeBasedEvent = (ChangeBasedEvent)tEvent; if (null == changeBasedEvent.getPatchSet()) { return PluginImpl.getInstance().getConfig().getGerritFrontEndUrlFor( url, changeBasedEvent.getChange().getNumber(), null); } return PluginImpl.getInstance().getConfig().getGerritFrontEndUrlFor( url, changeBasedEvent.getChange().getNumber(), changeBasedEvent.getPatchSet().getNumber()); } return url; }

Target:
public String getUrl() { return PluginImpl.getInstance().getConfig().getGerritFrontEndUrlFor(tEvent); }
Source:
public TemporaryQueue createTemporaryQueue() throws JMSException { if (sessionType == ActiveMQSession.TYPE_TOPIC_SESSION) { throw new IllegalStateException("Cannot create a temporary queue using a TopicSession"); } try { ActiveMQTemporaryQueue queue = ActiveMQDestination.createTemporaryQueue(this, (enable1xPrefixes ? PacketImpl.OLD_TEMP_QUEUE_PREFIX.toString() : "")); SimpleString simpleAddress = queue.getSimpleAddress(); session.createTemporaryQueue(simpleAddress, RoutingType.ANYCAST, simpleAddress); connection.addTemporaryQueue(simpleAddress); return queue; } catch (ActiveMQException e) { throw JMSExceptionHelper.convertFromActiveMQException(e); } }

Target:
public TemporaryQueue createTemporaryQueue() throws JMSException { if (sessionType == ActiveMQSession.TYPE_TOPIC_SESSION) { throw new IllegalStateException("Cannot create a temporary queue using a TopicSession"); } try { final ActiveMQTemporaryQueue queue; if (enable1xPrefixes) { queue = ActiveMQDestination.createTemporaryQueue(this, PacketImpl.OLD_TEMP_QUEUE_PREFIX.toString()); } else { queue = ActiveMQDestination.createTemporaryQueue(this); } SimpleString simpleAddress = queue.getSimpleAddress(); session.createTemporaryQueue(simpleAddress, RoutingType.ANYCAST, simpleAddress); connection.addTemporaryQueue(simpleAddress); return queue; } catch (ActiveMQException e) { throw JMSExceptionHelper.convertFromActiveMQException(e); } }
Source:
private List<Long> collectResumingTasksForResumeFailedMode(long attemptId) { List<ArchivedTask> tasks = sm .getSessionStore(getSiteId()) .getTasksOfAttempt(attemptId); List<Long> groupRetryErrorTaskIds = tasks.stream() .filter(task -> task.getState() == TaskStateCode.GROUP_ERROR && task.getStateParams().has("retry_count")) .map(task -> task.getId()) .collect(Collectors.toList()); List<Long> successTasks = tasks.stream() .filter(task -> task.getParentId().isPresent() && !groupRetryErrorTaskIds.contains(task.getParentId().get())) .filter(task -> task.getState() == TaskStateCode.SUCCESS) .map(task -> { if (!task.getParentId().isPresent()) { throw new IllegalArgumentException("Resuming successfully completed attempts is not supported"); } return task.getId(); }) .collect(Collectors.toList()); return ImmutableList.copyOf(successTasks); }

Target:
private List<Long> collectResumingTasksForResumeFailedMode(long attemptId) { List<ArchivedTask> tasks = sm .getSessionStore(getSiteId()) .getTasksOfAttempt(attemptId); List<Long> groupRetryErrorTaskIds = tasks.stream() .filter(task -> task.getState() == TaskStateCode.GROUP_ERROR && task.getStateParams().has("retry_count")) .map(task -> task.getId()) .collect(Collectors.toList()); List<Long> successTasks = tasks.stream() .filter(task -> task.getParentId().isPresent() && !groupRetryErrorTaskIds.contains(task.getParentId().get())) .filter(task -> !task.getFullName().contains("^sub")) .filter(task -> task.getState() == TaskStateCode.SUCCESS) .map(task -> { if (!task.getParentId().isPresent()) { throw new IllegalArgumentException("Resuming successfully completed attempts is not supported"); } return task.getId(); }) .collect(Collectors.toList()); return ImmutableList.copyOf(successTasks); }
Source:
public DataStoreTransaction beginTransaction() { EntityManager entityManager = entityManagerSupplier.get(); JpaTransaction transaction = writeTransactionSupplier.get(entityManager, jpaTransactionCancel); transaction.begin(); return transaction; }

Target:
public DataStoreTransaction beginTransaction() { EntityManager entityManager = entityManagerSupplier.get(); JpaTransaction transaction = writeTransactionSupplier.get(entityManager); transaction.begin(); return transaction; }
Source:
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { if (isPaid()){ return true; } Choice choice = new CardTypeChoice(exileHandler.availableTypes(types)); if (!game.getPlayer(controllerId).choose(Outcome.Neutral, choice, game)) { return false; } CardType choiceType = null; for (CardType type:EnumSet.allOf(CardType.class)){ if (type.toString().equals(choice.getChoice())){ choiceType = type; break; } } paid = exileHandler.useCardType(choiceType); return paid; }

Target:
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { if (isPaid()){ return true; } CardType choiceType; EnumSet<CardType> availableChoices = exileHandler.availableTypes(types); if (availableChoices.size()==1){ choiceType = availableChoices.iterator().next(); }else { Choice choice = new CardTypeChoice(availableChoices); if (!game.getPlayer(controllerId).choose(Outcome.Neutral, choice, game)) { return false; } Optional<CardType> optionalChoice = Arrays.stream(CardType.values()).filter(type -> type.toString().equals(choice.getChoice())).findAny(); if (optionalChoice.isPresent()){ choiceType = optionalChoice.get(); }else{ return false; } } paid = exileHandler.useCardType(choiceType); return paid; }
Source:
public void readKey( PageCursor cursor, RawBytes into, int keySize ) { int offsetBeforeRead = cursor.getOffset(); try { into.bytes = new byte[keySize]; cursor.getBytes( into.bytes ); } catch ( BufferUnderflowException e ) { throw Exceptions.withMessage( e, e.getMessage() + " keySize:" + keySize + " offset: " + offsetBeforeRead + " page size:" + cursor.getCurrentPageSize() ); } }

Target:
public void readKey( PageCursor cursor, RawBytes into, int keySize ) { into.bytes = new byte[keySize]; cursor.getBytes( into.bytes ); }
Source:
public boolean execute( Property inputProperty, Node outputNode, Context context ) throws Exception { Binary binaryValue = inputProperty.getBinary(); CheckArg.isNotNull(binaryValue, "binary"); InputStream inputStream = binaryValue.getStream(); String mimeType = context.mimeTypeDetector().mimeTypeOf(getInputFileName(inputProperty), inputStream); Node sequencedNode = outputNode; if (outputNode.isNew()) { outputNode.setPrimaryType(METADATA_NODE); } else { sequencedNode = outputNode.addNode(METADATA_NODE, METADATA_NODE); } sequencedNode.setProperty(JCR_MIME_TYPE, mimeType); if (isPowerpoint(mimeType)) { sequencePowerpoint(sequencedNode, context.valueFactory(), inputStream); return true; } if (isWord(mimeType)) { sequenceWord(sequencedNode, context.valueFactory(), inputStream); return true; } if (isExcel(mimeType)) { sequenceExcel(sequencedNode, context.valueFactory(), inputStream); return true; } logger.warn("Unknown mimetype: for microsoft office", mimeType); return false; }

Target:
public boolean execute( Property inputProperty, Node outputNode, Context context ) throws Exception { Binary binaryValue = inputProperty.getBinary(); CheckArg.isNotNull(binaryValue, "binary"); InputStream inputStream = binaryValue.getStream(); String mimeType = context.mimeTypeDetector().mimeTypeOf(getInputFileName(inputProperty), inputStream); Node sequencedNode = outputNode; if (outputNode.isNew()) { outputNode.setPrimaryType(METADATA_NODE); } else { sequencedNode = outputNode.addNode(METADATA_NODE, METADATA_NODE); } sequencedNode.setProperty(JCR_MIME_TYPE, mimeType); if (isPowerpoint(mimeType)) { sequencePowerpoint(sequencedNode, context.valueFactory(), inputStream); return true; } if (isWord(mimeType)) { sequenceWord(sequencedNode, context.valueFactory(), inputStream); return true; } if (isExcel(mimeType)) { sequenceExcel(sequencedNode, context.valueFactory(), inputStream); return true; } getLogger().warn("Unknown mimetype: {0} for microsoft office", mimeType); return false; }
Source:
private void validateCommands(Devfile devfile, Set<String> toolNames) throws DevfileFormatException { Set<String> existingNames = new HashSet<>(); for (Command command : devfile.getCommands()) { if (!existingNames.add(command.getName())) { throw new DevfileFormatException( format("Duplicate command name found:'%s'", command.getName())); } Set<String> nonexistingToolActions = command .getActions() .stream() .map(Action::getTool) .filter(t -> !toolNames.contains(t)) .collect(toSet()); if (!nonexistingToolActions.isEmpty()) { throw new DevfileFormatException( format( "Found actions which refers to non-existing tools in command '%s':'%s'", command.getName(), String.join(",", nonexistingToolActions))); } } }

Target:
private void validateCommands(Devfile devfile, Set<String> toolNames) throws DevfileFormatException { Set<String> existingNames = new HashSet<>(); for (Command command : devfile.getCommands()) { if (!existingNames.add(command.getName())) { throw new DevfileFormatException( format("Duplicate command name found:'%s'", command.getName())); } Set<String> nonExistingToolActions = command .getActions() .stream() .map(Action::getTool) .filter(t -> !toolNames.contains(t)) .collect(toSet()); if (!nonExistingToolActions.isEmpty()) { throw new DevfileFormatException( format( "Found actions which refer to non-existing tools in command '%s':'%s'", command.getName(), String.join(",", nonExistingToolActions))); } } }
Source:
public BlockingChannelConnectionPoolTest() throws Exception { Properties props = new Properties(); props.setProperty("port", "6667"); VerifiableProperties propverify = new VerifiableProperties(props); NetworkConfig config = new NetworkConfig(propverify); ArrayList<Port> ports = new ArrayList<Port>(); ports.add(new Port(6667, PortType.PLAINTEXT)); ports.add(new Port(7667, PortType.SSL)); server1 = new SocketServer(config, new MetricRegistry(), ports); server1.start(); props.setProperty("port", "6668"); propverify = new VerifiableProperties(props); config = new NetworkConfig(propverify); ports = new ArrayList<Port>(); ports.add(new Port(6668, PortType.PLAINTEXT)); ports.add(new Port(7668, PortType.SSL)); server2 = new SocketServer(config, new MetricRegistry(), ports); server2.start(); props.setProperty("port", "6669"); propverify = new VerifiableProperties(props); config = new NetworkConfig(propverify); ports = new ArrayList<Port>(); ports.add(new Port(6669, PortType.PLAINTEXT)); ports.add(new Port(7669, PortType.SSL)); server3 = new SocketServer(config, new MetricRegistry(), ports); server3.start(); sslFactory = TestUtils.createSSLFactory(); SSLContext sslContext = sslFactory.createSSLContext(); sslSocketFactory = sslContext.getSocketFactory(); }

Target:
public BlockingChannelConnectionPoolTest() throws Exception { Properties props = new Properties(); props.setProperty("port", "6667"); VerifiableProperties propverify = new VerifiableProperties(props); NetworkConfig config = new NetworkConfig(propverify); ArrayList<Port> ports = new ArrayList<Port>(); ports.add(new Port(6667, PortType.PLAINTEXT)); ports.add(new Port(7667, PortType.SSL)); server1 = new SocketServer(config, new MetricRegistry(), ports); server1.start(); props.setProperty("port", "6668"); propverify = new VerifiableProperties(props); config = new NetworkConfig(propverify); ports = new ArrayList<Port>(); ports.add(new Port(6668, PortType.PLAINTEXT)); ports.add(new Port(7668, PortType.SSL)); server2 = new SocketServer(config, new MetricRegistry(), ports); server2.start(); props.setProperty("port", "6669"); propverify = new VerifiableProperties(props); config = new NetworkConfig(propverify); ports = new ArrayList<Port>(); ports.add(new Port(6669, PortType.PLAINTEXT)); ports.add(new Port(7669, PortType.SSL)); server3 = new SocketServer(config, new MetricRegistry(), ports); server3.start(); }
Source:
private static void adjustPlotStartAndEndTimeToMatchCurrentTime(PlotConfiguration settings, long currentTime) { if (settings.getTimeAxisSubsequentSetting() == TimeAxisSubsequentBoundsSetting.SCRUNCH) { if (currentTime > settings.getMaxTime()) { settings.setMaxTime(currentTime); } } else if (settings.getTimeAxisSubsequentSetting() == TimeAxisSubsequentBoundsSetting.JUMP && !settings.getPinTimeAxis()) { if (currentTime < settings.getMaxTime()) { long span = settings.getMaxTime() - settings.getMinTime(); settings.setMaxTime(currentTime); settings.setMinTime(currentTime - span); } } }

Target:
private static void adjustPlotStartAndEndTimeToMatchCurrentTime(PlotConfiguration settings, long currentTime) { if (settings.getTimeAxisSubsequentSetting() == TimeAxisSubsequentBoundsSetting.SCRUNCH) { if (currentTime > settings.getMaxTime()) { settings.setMaxTime(currentTime); } } else if (settings.getTimeAxisSubsequentSetting() == TimeAxisSubsequentBoundsSetting.JUMP && !settings.getPinTimeAxis()) { if (currentTime > settings.getMaxTime()) { long span = settings.getMaxTime() - settings.getMinTime(); settings.setMaxTime(currentTime); settings.setMinTime(currentTime - span); } } }
Source:
private void requestForDownload(OCFile file) { Intent intent = new Intent(mContext, FileDownloader.class); intent.putExtra(FileDownloader.KEY_ACCOUNT, mAccount); intent.putExtra(FileDownloader.KEY_FILE, file); if (mContext instanceof AvailableOfflineSyncJobService && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { intent.putExtra(FileDownloader.KEY_IS_AVAILABLE_OFFLINE_FILE, true); mContext.startForegroundService(intent); } else { mContext.startService(intent); } mTransferWasRequested = true; }

Target:
private void requestForDownload(OCFile file) { Intent intent = new Intent(mContext, FileDownloader.class); intent.putExtra(FileDownloader.KEY_ACCOUNT, mAccount); intent.putExtra(FileDownloader.KEY_FILE, file); if (mRequestedFromAvOfflineService && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { intent.putExtra(FileDownloader.KEY_IS_AVAILABLE_OFFLINE_FILE, true); mContext.startForegroundService(intent); } else { mContext.startService(intent); } mTransferWasRequested = true; }
Source:
public boolean shouldAcquire(String name) { int lastDot = name.lastIndexOf('.'); String pkgName = name.substring(0, lastDot == -1 ? 0 : lastDot); if (pkgName.equals("org.robolectric.res") || (pkgName.equals("org.robolectric.manifest"))) { return name.contains("Test"); } if (name.matches("com\\.android\\.internal\\.R(\\$.*)?")) return true; if (name.equals("android.R$styleable")) return true; return !( name.matches(".*\\.R(|\\$[a-z]+)$") || classesToNotAquire.contains(name) || name.startsWith("java.") || name.startsWith("javax.") || name.startsWith("sun.") || name.startsWith("com.sun.") || name.startsWith("org.w3c.") || name.startsWith("org.xml.") || name.startsWith("org.junit") || name.startsWith("org.hamcrest") || name.startsWith("org.scalatest") || name.startsWith("org.specs2") || name.startsWith("scala.") || name.startsWith("kotlin.") || name.startsWith("com.almworks.sqlite4java") ); }

Target:
public boolean shouldAcquire(String name) { int lastDot = name.lastIndexOf('.'); String pkgName = name.substring(0, lastDot == -1 ? 0 : lastDot); if (pkgName.equals("org.robolectric.res") || (pkgName.equals("org.robolectric.manifest"))) { return name.contains("Test"); } if (name.matches("com\\.android\\.internal\\.R(\\$.*)?")) return true; if (name.equals("android.R$styleable")) return true; for (String packageName : packagesToNotAquire) { if (name.startsWith(packageName)) return false; } return !(name.matches(".*\\.R(|\\$[a-z]+)$") || classesToNotAquire.contains(name)); }
Source:
public String clickLinkButtonAndGetUrl(String linkText) { WebElement button = getDriver().findElement(By.linkText(linkText)); WebElement html = getHtmlElement(); button.click(); waitForPageRefresh(html); return getCurrentUrl(); }

Target:
protected String clickLinkButtonAndGetUrl(String linkText) { WebElement button = getDriver().findElement(By.linkText(linkText)); WebElement html = getHtmlElement(); button.click(); waitForPageRefresh(html); return getCurrentUrl(); }
Source:
public void createInitialLayout(IPageLayout layout) { if (layout == null) { return; } layout.setEditorAreaVisible(true); layout.setEditorAreaVisible(true); IFolderLayout topLeftFolder = layout.createFolder("topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); topLeftFolder.addView(IPageLayout.ID_PROJECT_EXPLORER); IFolderLayout topRightFolder = layout.createFolder("topRightFolder", IPageLayout.BOTTOM, 0.10f, IPageLayout.ID_EDITOR_AREA); topRightFolder.addView(HistogramView.ID); IFolderLayout middleRightFolder = layout.createFolder("middleRightFolder", IPageLayout.BOTTOM, 0.50f, "topRightFolder"); middleRightFolder.addView(CallStackView.ID); IFolderLayout bottomRightFolder = layout.createFolder("bottomRightFolder", IPageLayout.BOTTOM, 0.65f, "middleRightFolder"); bottomRightFolder.addView(TimeChartView.ID); layout.addPerspectiveShortcut(ID); layout.addNewWizardShortcut(NewTmfProjectWizard.ID); }

Target:
public void createInitialLayout(IPageLayout layout) { if (layout == null) { return; } layout.setEditorAreaVisible(true); layout.setEditorAreaVisible(true); IFolderLayout topLeftFolder = layout.createFolder("topLeftFolder", IPageLayout.LEFT, 0.15f, IPageLayout.ID_EDITOR_AREA); topLeftFolder.addView(IPageLayout.ID_PROJECT_EXPLORER); IFolderLayout topRightFolder = layout.createFolder("topRightFolder", IPageLayout.BOTTOM, EDITOR_AREA_RATIO, IPageLayout.ID_EDITOR_AREA); topRightFolder.addView(HistogramView.ID); IFolderLayout middleRightFolder = layout.createFolder("middleRightFolder", IPageLayout.BOTTOM, 0.50f, "topRightFolder"); middleRightFolder.addView(CallStackView.ID); IFolderLayout bottomRightFolder = layout.createFolder("bottomRightFolder", IPageLayout.BOTTOM, 0.65f, "middleRightFolder"); bottomRightFolder.addView(TimeChartView.ID); layout.addPerspectiveShortcut(ID); layout.addNewWizardShortcut(NewTmfProjectWizard.ID); }
Source:
private void doAssert(AssertionResult assertionResult, String responseDataAsJsonString, boolean invert) throws Exception { ObjectMapper mapper = new ObjectMapper(); JsonNode input = mapper.readValue(responseDataAsJsonString, JsonNode.class); Expression<JsonNode> expression = JMESPathCache.getInstance().get(getJmesPath()); JsonNode currentValue = expression.search(input); log.debug("JMESPath query invoked on response {}. Query result is {}. ", expression, responseDataAsJsonString, currentValue); boolean success = checkResult(mapper, currentValue, assertionResult, invert); if (!invert) { if (!success) { failAssertion(invert, assertionResult); } } else { if (success) { failAssertion(invert, assertionResult); } } }

Target:
private void doAssert(AssertionResult assertionResult, String responseDataAsJsonString, boolean invert) throws Exception { JsonNode input = OBJECT_MAPPER.readValue(responseDataAsJsonString, JsonNode.class); Expression<JsonNode> expression = JMESPathCache.getInstance().get(getJmesPath()); JsonNode currentValue = expression.search(input); log.debug("JMESPath query invoked on response {}. Query result is {}. ", expression, responseDataAsJsonString, currentValue); boolean success = checkResult(OBJECT_MAPPER, currentValue, assertionResult, invert); if (!invert) { if (!success) { failAssertion(invert, assertionResult); } } else { if (success) { failAssertion(invert, assertionResult); } } }
Source:
private static String loadResource(String fileName) { try { return Resources.toString(Resources.getResource(TestConstants.class, fileName), Charsets.UTF_8); } catch (IOException e) { Throwables.propagate(e); } throw new RuntimeException("Resource not available " + fileName); }

Target:
private static String loadResource(String fileName) { try { return Resources.toString(Resources.getResource(TestConstants.class, fileName), Charsets.UTF_8); } catch (IOException e) { throw Throwables.propagate(e); } }
Source:
public boolean equals(Object obj) { if (obj instanceof SimpleStack) { SimpleStack other = (SimpleStack) obj; if (this.damage == OreDictionary.WILDCARD_VALUE || other.damage == OreDictionary.WILDCARD_VALUE) { return this.qnty == other.qnty && this.id == other.id; } if(this.nbt != null && other.nbt != null){ return this.id == other.id && this.qnty == other.qnty && this.damage == other.damage && this.nbt.equals(other.nbt); } return this.id == other.id && this.qnty == other.qnty && this.damage == other.damage; } return false; }

Target:
public boolean equals(Object obj) { if (obj instanceof SimpleStack) { SimpleStack other = (SimpleStack) obj; if (this.damage == OreDictionary.WILDCARD_VALUE || other.damage == OreDictionary.WILDCARD_VALUE) { return this.qnty == other.qnty && this.id == other.id; } if(this.nbt != null && other.nbt != null){ return this.id == other.id && this.qnty == other.qnty && this.damage == other.damage && this.nbt.equals(other.nbt); } else if (this.nbt == null && other.nbt == null){ return this.id == other.id && this.qnty == other.qnty && this.damage == other.damage; } else { return false; } } return false; }
Source:
public static String processScript(Map<String, Object> conf, String script) { Thread interruptThread = null; try { Process process = Runtime.getRuntime().exec(script); final long timeout = ObjectReader.getLong(conf.get(DaemonConfig.STORM_HEALTH_CHECK_TIMEOUT_MS), 5000L); final Thread curThread = Thread.currentThread(); interruptThread = new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(timeout); curThread.interrupt(); } catch (InterruptedException e) { } } }); interruptThread.start(); process.waitFor(); interruptThread.interrupt(); curThread.interrupted(); if (process.exitValue() != 0) { String str; InputStream stdin = process.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(stdin)); while ((str = reader.readLine()) != null) { if (str.startsWith("ERROR")) { LOG.warn("The healthcheck process exited with code {}", script, process.exitValue()); return FAILED; } } return SUCCESS; } return SUCCESS; } catch (InterruptedException | ClosedByInterruptException e) { LOG.warn("Script: timed out.", script); return TIMEOUT; } catch (Exception e) { LOG.warn("Script failed with exception: ", e); return FAILED_WITH_EXIT_CODE; } finally { if (interruptThread != null) { interruptThread.interrupt(); } } }

Target:
public static String processScript(Map<String, Object> conf, String script) { Thread interruptThread = null; try { Process process = Runtime.getRuntime().exec(script); final long timeout = ObjectReader.getLong(conf.get(DaemonConfig.STORM_HEALTH_CHECK_TIMEOUT_MS), 5000L); final Thread curThread = Thread.currentThread(); interruptThread = new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(timeout); curThread.interrupt(); } catch (InterruptedException e) { } } }); interruptThread.start(); process.waitFor(); interruptThread.interrupt(); curThread.interrupted(); if (process.exitValue() != 0) { String str; InputStream stdin = process.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(stdin)); while ((str = reader.readLine()) != null) { if (str.startsWith("ERROR")) { LOG.warn("The healthcheck process exited with code {}", script, process.exitValue()); return FAILED; } } return FAILED_WITH_EXIT_CODE; } return SUCCESS; } catch (InterruptedException | ClosedByInterruptException e) { LOG.warn("Script: timed out.", script); return TIMEOUT; } catch (Exception e) { LOG.warn("Script failed with exception: ", e); return FAILED; } finally { if (interruptThread != null) { interruptThread.interrupt(); } } }
Source:
public void testSaveAndRename() { final Supplier pathSupplier = mock(Supplier.class); final Validator validator = mock(Validator.class); final Caller supportsSaveAndRename = mock(Caller.class); final Supplier metadataSupplier = mock(Supplier.class); final Supplier contentSupplier = mock(Supplier.class); final Supplier isDirtySupplier = mock(Supplier.class); final ParameterizedCommand parameterizedCommand = mock(ParameterizedCommand.class); final Command command = mock(Command.class); doReturn(pathSupplier).when(editor).getPathSupplier(); doReturn(validator).when(editor).getRenameValidator(); doReturn(supportsSaveAndRename).when(editor).getSaveAndRenameServiceCaller(); doReturn(metadataSupplier).when(editor).getMetadataSupplier(); doReturn(contentSupplier).when(editor).getContentSupplier(); doReturn(isDirtySupplier).when(editor).isDirtySupplier(); doReturn(parameterizedCommand).when(editor).onSuccess(); doReturn(command).when(builder).build(); final Command saveAndRenameCommand = editor.getSaveAndRename(); assertEquals(command, saveAndRenameCommand); }

Target:
public void testSaveAndRename() { final Supplier pathSupplier = mock(Supplier.class); final Validator renameValidator = mock(Validator.class); final Supplier saveValidator = mock(Supplier.class); final Caller supportsSaveAndRename = mock(Caller.class); final Supplier metadataSupplier = mock(Supplier.class); final Supplier contentSupplier = mock(Supplier.class); final Supplier isDirtySupplier = mock(Supplier.class); final ParameterizedCommand parameterizedCommand = mock(ParameterizedCommand.class); final Command command = mock(Command.class); doReturn(pathSupplier).when(editor).getPathSupplier(); doReturn(renameValidator).when(editor).getRenameValidator(); doReturn(saveValidator).when(editor).getSaveValidator(); doReturn(supportsSaveAndRename).when(editor).getSaveAndRenameServiceCaller(); doReturn(metadataSupplier).when(editor).getMetadataSupplier(); doReturn(contentSupplier).when(editor).getContentSupplier(); doReturn(isDirtySupplier).when(editor).isDirtySupplier(); doReturn(parameterizedCommand).when(editor).onSuccess(); doReturn(command).when(builder).build(); final Command saveAndRenameCommand = editor.getSaveAndRename(); assertEquals(command, saveAndRenameCommand); verify(builder).addPathSupplier(pathSupplier); verify(builder).addValidator(renameValidator); verify(builder).addValidator(saveValidator); verify(builder).addRenameService(supportsSaveAndRename); verify(builder).addMetadataSupplier(metadataSupplier); verify(builder).addContentSupplier(contentSupplier); verify(builder).addIsDirtySupplier(isDirtySupplier); verify(builder).addSuccessCallback(parameterizedCommand); }
Source:
public RemoveMembersFromConsumerGroupResult removeMembersFromConsumerGroup(String groupId, RemoveMembersFromConsumerGroupOptions options) { final long startFindCoordinatorMs = time.milliseconds(); final long deadline = calcDeadlineMs(startFindCoordinatorMs, options.timeoutMs()); KafkaFutureImpl<Map<MemberIdentity, Errors>> future = new KafkaFutureImpl<>(); ConsumerGroupOperationContext<Map<MemberIdentity, Errors>, RemoveMembersFromConsumerGroupOptions> context = new ConsumerGroupOperationContext<>(groupId, options, deadline, future); Call findCoordinatorCall; if (options.removeAll()) { List<MemberIdentity> members = getMembersFromGroup(groupId); findCoordinatorCall = getFindCoordinatorCall(context, () -> getRemoveMembersFromGroupCall(context, members)); } else { findCoordinatorCall = getFindCoordinatorCall(context, () -> getRemoveMembersFromGroupCall(context, new ArrayList<>())); } runnable.call(findCoordinatorCall, startFindCoordinatorMs); return new RemoveMembersFromConsumerGroupResult(future, options.members(), options.removeAll()); }

Target:
public RemoveMembersFromConsumerGroupResult removeMembersFromConsumerGroup(String groupId, RemoveMembersFromConsumerGroupOptions options) { final long startFindCoordinatorMs = time.milliseconds(); final long deadline = calcDeadlineMs(startFindCoordinatorMs, options.timeoutMs()); KafkaFutureImpl<Map<MemberIdentity, Errors>> future = new KafkaFutureImpl<>(); ConsumerGroupOperationContext<Map<MemberIdentity, Errors>, RemoveMembersFromConsumerGroupOptions> context = new ConsumerGroupOperationContext<>(groupId, options, deadline, future); List<MemberIdentity> members; if (options.removeAll()) { members = getMembersFromGroup(groupId); } else { members = options.members().stream().map(MemberToRemove::toMemberIdentity).collect(Collectors.toList()); } Call findCoordinatorCall = getFindCoordinatorCall(context, () -> getRemoveMembersFromGroupCall(context, members)); runnable.call(findCoordinatorCall, startFindCoordinatorMs); return new RemoveMembersFromConsumerGroupResult(future, options.members()); }