auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testTimeoutToHost() { bot.view("Package Explorer").show(); bot.menu("File").click(); bot.menu("File").menu("Import...").click(); bot.shell("Import"); SWTBotTree tree = bot.tree(0); tree.expandNode("Git").select("Git Repository"); bot.button("Next >").click(); bot.shell("Import Git Repository"); bot.textWithLabel("URI:").setText("git://www.example.com/EGIT"); assertSourceParams(null, "www.example.com", "/EGIT", "git", "", true, "", "", false, false); bot.button("Next >").click(); assertStartsWith(" git://www.example.com/EGIT: Connection timed out", bot.text(0).getText()); assertTrue(bot.button("Cancel").isEnabled()); assertTrue(bot.button("< Back").isEnabled()); assertFalse(bot.button("Next >").isEnabled()); assertFalse(bot.button("Finish").isEnabled()); bot.button("Cancel").click(); }

Target:
public void testTimeoutToHost() { goToImportGitRepository(); bot.textWithLabel("URI:").setText("git://www.example.com/EGIT"); assertSourceParams(null, "www.example.com", "/EGIT", "git", "", true, "", "", false, false); bot.button("Next >").click(); assertStartsWith(" git://www.example.com/EGIT: Connection timed out", bot.text(0).getText()); assertTrue(bot.button("Cancel").isEnabled()); assertTrue(bot.button("< Back").isEnabled()); assertFalse(bot.button("Next >").isEnabled()); assertFalse(bot.button("Finish").isEnabled()); bot.button("Cancel").click(); }
Source:
private PatchLineComment update(PatchLineComment e, Input in) { if (in.side != null) { e.setSide(in.side == Side.PARENT ? (short) 0 : (short) 1); } if (in.inReplyTo != null) { e.setParentUuid(Url.decode(in.inReplyTo)); } e.setMessage(in.message.trim()); Integer line = in.line; CommentRange range = in.range; if (range != null || line != null) { e.setRange(range); e.setLine(line == null ? range.getEndLine() : line); } e.updated(); return e; }

Target:
private PatchLineComment update(PatchLineComment e, Input in) { if (in.side != null) { e.setSide(in.side == Side.PARENT ? (short) 0 : (short) 1); } if (in.inReplyTo != null) { e.setParentUuid(Url.decode(in.inReplyTo)); } e.setMessage(in.message.trim()); if (in.range != null || in.line != null) { e.setRange(in.range); e.setLine(in.range != null ? in.range.getEndLine() : in.line); } e.updated(); return e; }
Source:
public ProxyAuthenticator createProxyAuthenticator() throws AxisFault { if (!isProxyHasCredential()) return null; ProxyAuthenticator proxyAuthenticator; try { if (isProxyProfileConfigured()) { proxyAuthenticator = new ProfileProxyAuthenticator(this); } else { proxyAuthenticator = new DefaultProxyAuthenticator(getCreds()); } } catch (MalformedChallengeException e) { throw new AxisFault("Error while creating proxy authenticator", e); } return proxyAuthenticator; }

Target:
public ProxyAuthenticator createProxyAuthenticator() throws AxisFault { if (!isProxyHasCredential()) { return null; } ProxyAuthenticator proxyAuthenticator; try { if (isProxyProfileConfigured()) { proxyAuthenticator = new ProfileProxyAuthenticator(this); } else { proxyAuthenticator = new DefaultProxyAuthenticator(getCreds()); } } catch (MalformedChallengeException e) { throw new AxisFault("Error while creating proxy authenticator", e); } return proxyAuthenticator; }
Source:
public RVRendererAdapter<String> create(List<String> searchImageItemList) { SearchCategoriesRenderer searchCategoriesRenderer = new SearchCategoriesRenderer(listener); RendererBuilder<String> builder = new RendererBuilder<String>().bind(String.class, searchCategoriesRenderer); ListAdapteeCollection<String> collection = new ListAdapteeCollection<>( searchImageItemList != null ? searchImageItemList : Collections.<String>emptyList()); return new RVRendererAdapter<>(builder, collection); }

Target:
public RVRendererAdapter<String> create(List<String> searchImageItemList) { RendererBuilder<String> builder = new RendererBuilder<String>().bind(String.class, new SearchCategoriesRenderer(listener)); ListAdapteeCollection<String> collection = new ListAdapteeCollection<>( searchImageItemList != null ? searchImageItemList : Collections.<String>emptyList()); return new RVRendererAdapter<>(builder, collection); }
Source:
public void onMessage(final Message message, final Channel channel) throws Exception { boolean retryEnabled = AmqpInboundChannelAdapter.this.retryTemplate == null; try { if (retryEnabled) { createAndSend(message, channel); } else { final org.springframework.messaging.Message<Object> toSend = createMessage(message, channel); AmqpInboundChannelAdapter.this.retryTemplate.execute(context -> { StaticMessageHeaderAccessor.getDeliveryAttempt(toSend).incrementAndGet(); setAttributesIfNecessary(message, toSend); sendMessage(toSend); return null; }, (RecoveryCallback<Object>) AmqpInboundChannelAdapter.this.recoveryCallback); } } catch (MessageConversionException e) { if (getErrorChannel() != null) { setAttributesIfNecessary(message, null); getMessagingTemplate().send(getErrorChannel(), buildErrorMessage(null, new ListenerExecutionFailedException("Message conversion failed", e, message))); } else { throw e; } } finally { if (retryEnabled) { attributesHolder.remove(); } } }

Target:
public void onMessage(final Message message, final Channel channel) throws Exception { boolean retryDisabled = AmqpInboundChannelAdapter.this.retryTemplate == null; try { if (retryDisabled) { createAndSend(message, channel); } else { final org.springframework.messaging.Message<Object> toSend = createMessage(message, channel); AmqpInboundChannelAdapter.this.retryTemplate.execute(context -> { StaticMessageHeaderAccessor.getDeliveryAttempt(toSend).incrementAndGet(); setAttributesIfNecessary(message, toSend); sendMessage(toSend); return null; }, (RecoveryCallback<Object>) AmqpInboundChannelAdapter.this.recoveryCallback); } } catch (MessageConversionException e) { if (getErrorChannel() != null) { setAttributesIfNecessary(message, null); getMessagingTemplate().send(getErrorChannel(), buildErrorMessage(null, new ListenerExecutionFailedException("Message conversion failed", e, message))); } else { throw e; } } finally { if (retryDisabled) { attributesHolder.remove(); } } }
Source:
public LogParserPublisher(Job parent, String path) { super(parent, path); controlMarkOnUnstableWarning = control("unstableOnWarning"); controlMarkOnBuildFail = control("failBuildOnError"); controlShowGraphs = control("showGraphs"); controlRuleType = control("useProjectRule"); }

Target:
public LogParserPublisher(Job parent, String path) { super(parent, path); }
Source:
private void revertLocalStateEdit(TurboIssue modifiedIssue, boolean isOpenOriginally) { TurboIssue currentIssue = getIssue(modifiedIssue.getRepoId(), modifiedIssue.getId()).orElse(modifiedIssue); LocalDateTime originalStateModifiedAt = modifiedIssue.getStateLastModifiedAt(); LocalDateTime currentStateModifiedAt = currentIssue.getStateLastModifiedAt(); boolean isCurrentStateModifiedOriginalState = originalStateModifiedAt.isEqual(currentStateModifiedAt); if (isCurrentStateModifiedOriginalState) { return; } logger.info("Reverting state for issue " + currentIssue); models.editIssueState(currentIssue.getRepoId(), currentIssue.getId(), isOpenOriginally); refreshUI(); }

Target:
private void revertLocalStateEdit(TurboIssue modifiedIssue, boolean isOpenOriginally) { TurboIssue currentIssue = getIssue(modifiedIssue.getRepoId(), modifiedIssue.getId()).orElse(modifiedIssue); LocalDateTime originalStateModifiedAt = modifiedIssue.getStateLastModifiedAt(); LocalDateTime currentStateModifiedAt = currentIssue.getStateLastModifiedAt(); boolean isCurrentStateModifiedFromOriginalState = originalStateModifiedAt.isEqual(currentStateModifiedAt); if (!isCurrentStateModifiedFromOriginalState) { logger.warn("Not reverting state for issue " + currentIssue + " as it is modified somewhere else."); return; } logger.info("Reverting state for issue " + currentIssue); models.editIssueState(currentIssue.getRepoId(), currentIssue.getId(), isOpenOriginally); refreshUI(); }
Source:
private List<FeedbackResponse> getFeedbackResponseEntitiesFromGiverForQuestion( String feedbackQuestionId, String giverEmail) { return load() .filter("feedbackQuestionId =", feedbackQuestionId) .filter("giver =", giverEmail) .list(); }

Target:
private List<FeedbackResponse> getFeedbackResponseEntitiesFromGiverForQuestion( String feedbackQuestionId, String giverEmail) { return load() .filter("feedbackQuestionId =", feedbackQuestionId) .filter("giverEmail =", giverEmail) .list(); }
Source:
private RecordsRetrieved peekNextResult() { throwOnIllegalState(); return publisherSession.prefetchRecordsQueue().peek(); }

Target:
private PrefetchRecordsRetrieved peekNextResult() { throwOnIllegalState(); return publisherSession.peekNextRecord(); }
Source:
private void handleStructureLine(String line) { int index = line.indexOf('='); if ((index > 0) && (index < (line.length() - 1))) { String formatString = line.substring(index + 1); setDefault = line.substring(0, index).equals(OOBibStyle.DEFAULT_MARK); EntryType type = EntryTypeFactory.parse(line.substring(0, index)); try { Layout layout = new LayoutHelper(new StringReader(formatString), this.prefs).getLayoutFromText(); if (setDefault) { defaultBibLayout = layout; } else { bibLayout.put(type, layout); } } catch (IOException ex) { LOGGER.warn("Cannot parse bibliography structure", ex); } } }

Target:
private void handleStructureLine(String line) { int index = line.indexOf('='); if ((index > 0) && (index < (line.length() - 1))) { String formatString = line.substring(index + 1); isDefaultLayoutPresent = line.substring(0, index).equals(OOBibStyle.DEFAULT_MARK); EntryType type = EntryTypeFactory.parse(line.substring(0, index)); try { Layout layout = new LayoutHelper(new StringReader(formatString), this.prefs).getLayoutFromText(); if (isDefaultLayoutPresent) { defaultBibLayout = layout; } else { bibLayout.put(type, layout); } } catch (IOException ex) { LOGGER.warn("Cannot parse bibliography structure", ex); } } }
Source:
private void createMessageArea(Composite parent, FormToolkit toolkit, int span) { Section messageSection = createSection(parent, toolkit, span); Composite messageArea = createSectionClient(messageSection, toolkit); messageSection.setText(UIText.CommitEditorPage_SectionMessage); RevCommit commit = getCommit().getRevCommit(); String message = commit.getFullMessage(); PersonIdent author = commit.getAuthorIdent(); if (author != null) message = replaceSignedOffByLine(message, author); PersonIdent committer = commit.getCommitterIdent(); if (committer != null) message = replaceSignedOffByLine(message, committer); SpellcheckableMessageArea textContent = new SpellcheckableMessageArea( messageArea, message, true, toolkit.getBorderStyle()) { @Override protected IAdaptable getDefaultTarget() { return new PlatformObject() { @Override public Object getAdapter(Class adapter) { return Platform.getAdapterManager().getAdapter( getEditorInput(), adapter); } }; } @Override protected void createMarginPainter() { } }; if ((toolkit.getBorderStyle() & SWT.BORDER) == 0) textContent.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); Point size = textContent.getTextWidget().computeSize(SWT.DEFAULT, SWT.DEFAULT); int yHint = size.y > 80 ? 80 : SWT.DEFAULT; GridDataFactory.fillDefaults().hint(SWT.DEFAULT, yHint).minSize(1, 20) .grab(true, true).applyTo(textContent); Control control = textContent.getTextWidget(); if (control != null) { addToFocusTracking(control); } updateSectionClient(messageSection, messageArea, toolkit); }

Target:
private void createMessageArea(Composite parent, FormToolkit toolkit, int span) { Section messageSection = createSection(parent, toolkit, span); Composite messageArea = createSectionClient(messageSection, toolkit); messageSection.setText(UIText.CommitEditorPage_SectionMessage); RevCommit commit = getCommit().getRevCommit(); String message = commit.getFullMessage(); PersonIdent author = commit.getAuthorIdent(); if (author != null) message = replaceSignedOffByLine(message, author); PersonIdent committer = commit.getCommitterIdent(); if (committer != null) message = replaceSignedOffByLine(message, committer); SpellcheckableMessageArea textContent = new SpellcheckableMessageArea( messageArea, message, true, toolkit.getBorderStyle()) { @Override protected IAdaptable getDefaultTarget() { return new PlatformObject() { @Override public Object getAdapter(Class adapter) { return Platform.getAdapterManager().getAdapter( getEditorInput(), adapter); } }; } @Override protected void createMarginPainter() { } }; if ((toolkit.getBorderStyle() & SWT.BORDER) == 0) textContent.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); StyledText textWidget = textContent.getTextWidget(); Point size = textWidget.computeSize(SWT.DEFAULT, SWT.DEFAULT); int yHint = size.y > 80 ? 80 : SWT.DEFAULT; GridDataFactory.fillDefaults().hint(SWT.DEFAULT, yHint).minSize(1, 20) .grab(true, true).applyTo(textContent); addToFocusTracking(textWidget); updateSectionClient(messageSection, messageArea, toolkit); }
Source:
private void onRegisterButtonClick() { String username = usernameInputLayout.getEditText().getText().toString().trim(); String password = passwordInputLayout.getEditText().getText().toString(); String passwordConfirmation = confirmPasswordInputLayout.getEditText().getText().toString(); String email = emailInputLayout.getEditText().getText().toString(); if (username.contains("@")) { showErrorAlertDialog(R.string.register_email_as_username_error); } else if (password.equals(passwordConfirmation)) { RegistrationTask registrationTask = new RegistrationTask(getActivity(), username, password, email); registrationTask.setOnRegistrationCompleteListener(this); registrationTask.execute(); } else { showErrorAlertDialog(R.string.register_password_mismatch); } }

Target:
private void onRegisterButtonClick() { String username = usernameInputLayout.getEditText().getText().toString().trim(); String password = passwordInputLayout.getEditText().getText().toString(); String passwordConfirmation = confirmPasswordInputLayout.getEditText().getText().toString(); String email = emailInputLayout.getEditText().getText().toString(); if (username.contains("@")) { showErrorAlertDialog(R.string.register_email_as_username_error); } else if (!password.equals(passwordConfirmation)) { showErrorAlertDialog(R.string.register_password_mismatch); } else { RegistrationTask registrationTask = new RegistrationTask(getActivity(), username, password, email); registrationTask.setOnRegistrationCompleteListener(this); registrationTask.execute(); } }
Source:
public void handleError(HttpCommand command, HttpResponse response) { String message = parseMessage(response); Exception exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); try { message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: if ((command.getCurrentRequest().getEndpoint().getPath().endsWith("/info")) || (message != null && message.indexOf("could not be found") != -1)) exception = new ResourceNotFoundException(message, exception); else if (message != null && message.indexOf("currently in use") != -1) exception = new IllegalStateException(message, exception); else exception = new IllegalArgumentException(message, exception); break; case 401: exception = new AuthorizationException(message, exception); break; case 402: exception = new IllegalStateException(message, exception); break; case 404: exception = new ResourceNotFoundException(message, exception); break; case 405: exception = new IllegalArgumentException(message, exception); break; case 409: exception = new IllegalStateException(message, exception); break; } } finally { closeQuietly(response.getPayload()); command.setException(exception); } }

Target:
public void handleError(HttpCommand command, HttpResponse response) { String message = parseMessage(response); Exception exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); try { message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: if ((command.getCurrentRequest().getEndpoint().getPath().endsWith("/info")) || (message != null && message.indexOf("could not be found") != -1)) exception = new ResourceNotFoundException(message, exception); else if (message != null && message.indexOf("currently in use") != -1) exception = new IllegalStateException(message, exception); else exception = new IllegalArgumentException(message, exception); break; case 401: exception = new AuthorizationException(message, exception); break; case 402: exception = new IllegalStateException(message, exception); break; case 404: if (!command.getCurrentRequest().getMethod().equals("DELETE")) { exception = new ResourceNotFoundException(message, exception); } break; case 405: exception = new IllegalArgumentException(message, exception); break; case 409: exception = new IllegalStateException(message, exception); break; } } finally { closeQuietly(response.getPayload()); command.setException(exception); } }
Source:
public void testDescribeTable() { sql("describe tbl").ok("DESCRIBE `TBL`"); sql("describe extended tbl").ok("DESCRIBE EXTENDED `TBL`"); sql("describe formatted tbl").ok("DESCRIBE EXTENDED `TBL`"); }

Target:
public void testDescribeTable() { sql("describe tbl").ok("DESCRIBE `TBL`"); sql("describe extended tbl").ok("DESCRIBE EXTENDED `TBL`"); sql("describe formatted tbl").ok("DESCRIBE FORMATTED `TBL`"); }
Source:
public void addOrganisationToUser(final String userId, final String organisationId) { try { final User intercomUser = User.find(userId); final Company company = Company.find(organisationId); intercomUser.addCompany(company); User.update(intercomUser); } catch (final Exception e) { logger.warn("Error adding organisation with id: to Intercom user with id: - ", organisationId, userId, e.getMessage()); } }

Target:
public void addOrganisationToUser(final String userId, final String organisationId) { try { final User intercomUser = User.find(userId); final Company company = new Company(); company.setCompanyID(organisationId); intercomUser.addCompany(company); User.update(intercomUser); } catch (final Exception e) { logger.warn("Error adding organisation with id: to Intercom user with id: - ", organisationId, userId, e.getMessage()); } }
Source:
protected State calculateNextState(final int permits, final long timeoutInNanos, final State activeState) { long cyclePeriodInNanos = activeState.getConfig().getLimitRefreshPeriod().toNanos(); int permissionsPerCycle = activeState.getConfig().getLimitForPeriod(); long currentNanos = currentNanoTime(); long currentCycle = currentNanos / cyclePeriodInNanos; long nextCycle = activeState.activeCycle; int nextPermissions = activeState.getActivePermissions(); if (nextCycle != currentCycle) { long elapsedCycles = currentCycle - nextCycle; long accumulatedPermissions = elapsedCycles * permissionsPerCycle; nextCycle = currentCycle; nextPermissions = (int) min(nextPermissions + accumulatedPermissions, permissionsPerCycle); } long nextNanosToWait = nanosToWaitForPermission( permits, cyclePeriodInNanos, permissionsPerCycle, nextPermissions, currentNanos, currentCycle ); State nextState = reservePermissions(activeState.getConfig(), permits, timeoutInNanos, nextCycle, nextPermissions, nextNanosToWait); return nextState; }

Target:
protected State calculateNextState(final int permits, final long timeoutInNanos, final State activeState) { RateLimiterConfig config = activeState.getConfig(); long cyclePeriodInNanos = config.getLimitRefreshPeriod().toNanos(); int permissionsPerCycle = config.getLimitForPeriod(); long currentNanos = currentNanoTime(); long currentCycle = currentNanos / cyclePeriodInNanos; long nextCycle = activeState.activeCycle; int nextPermissions = activeState.getActivePermissions(); if (nextCycle != currentCycle) { long elapsedCycles = currentCycle - nextCycle; long accumulatedPermissions = elapsedCycles * permissionsPerCycle; nextCycle = currentCycle; nextPermissions = (int) min(nextPermissions + accumulatedPermissions, permissionsPerCycle); } long nextNanosToWait = nanosToWaitForPermission( permits, cyclePeriodInNanos, permissionsPerCycle, nextPermissions, currentNanos, currentCycle ); State nextState = reservePermissions(config, permits, timeoutInNanos, nextCycle, nextPermissions, nextNanosToWait); return nextState; }
Source:
private void cookies(MockHttpServletRequest request) { List<Cookie> cookies = new ArrayList<>(); String cookieHeaderValue = header("Cookie"); if (cookieHeaderValue != null) { StringTokenizer tokens = new StringTokenizer(cookieHeaderValue, "=;"); while (tokens.hasMoreTokens()) { String cookieName = tokens.nextToken().trim(); Assert.isTrue(tokens.hasMoreTokens(), () -> "Expected value for cookie name '" + cookieName + "': full cookie header was [" + cookieHeaderValue + "]"); String cookieValue = tokens.nextToken().trim(); processCookie(request, cookies, new Cookie(cookieName, cookieValue)); } } Set<com.gargoylesoftware.htmlunit.util.Cookie> managedCookies = this.webClient.getCookies(this.webRequest.getUrl()); for (com.gargoylesoftware.htmlunit.util.Cookie cookie : managedCookies) { processCookie(request, cookies, new Cookie(cookie.getName(), cookie.getValue())); } Cookie[] parentCookies = request.getCookies(); if (parentCookies != null) { cookies.addAll(Arrays.asList(parentCookies)); } if (!ObjectUtils.isEmpty(cookies)) { request.setCookies(cookies.toArray(new Cookie[0])); } }

Target:
private void cookies(MockHttpServletRequest request) { List<Cookie> cookies = new ArrayList<>(); String cookieHeaderValue = header("Cookie"); if (cookieHeaderValue != null) { StringTokenizer tokens = new StringTokenizer(cookieHeaderValue, "=;"); while (tokens.hasMoreTokens()) { String cookieName = tokens.nextToken().trim(); Assert.isTrue(tokens.hasMoreTokens(), () -> "Expected value for cookie name '" + cookieName + "': full cookie header was [" + cookieHeaderValue + "]"); String cookieValue = tokens.nextToken().trim(); processCookie(request, cookies, new Cookie(cookieName, cookieValue)); } } Set<com.gargoylesoftware.htmlunit.util.Cookie> managedCookies = this.webClient.getCookies(this.webRequest.getUrl()); for (com.gargoylesoftware.htmlunit.util.Cookie cookie : managedCookies) { processCookie(request, cookies, new Cookie(cookie.getName(), cookie.getValue())); } Cookie[] parentCookies = request.getCookies(); if (parentCookies != null) { Collections.addAll(cookies, parentCookies); } if (!ObjectUtils.isEmpty(cookies)) { request.setCookies(cookies.toArray(new Cookie[0])); } }
Source:
public static Slice simplifyGeometry(@SqlType(GEOMETRY_TYPE_NAME) Slice input, @SqlType(DOUBLE) double distanceTolerance) { if (Double.isNaN(distanceTolerance)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "distance is NaN"); } if (distanceTolerance < 0) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "distance is negative"); } if (distanceTolerance == 0) { return input; } return JtsGeometryUtils.serialize(simplify(JtsGeometryUtils.deserialize(input), distanceTolerance)); }

Target:
public static Slice simplifyGeometry(@SqlType(GEOMETRY_TYPE_NAME) Slice input, @SqlType(DOUBLE) double distanceTolerance) { if (Double.isNaN(distanceTolerance)) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "distanceTolerance is NaN"); } if (distanceTolerance < 0) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "distanceTolerance is negative"); } if (distanceTolerance == 0) { return input; } return JtsGeometryUtils.serialize(simplify(JtsGeometryUtils.deserialize(input), distanceTolerance)); }
Source:
public boolean doAction(View view, ViewActionTrigger actionDetail, ViewDetail viewDetail) { Intent intent = new Intent(context, newActivityClass); Bundle bundle = new Bundle(); bundle.putLong("ID", (Long) view.getTag(view.getId())); intent.putExtras(bundle); context.startActivity(intent); return true; }

Target:
public boolean doAction(View view, ViewActionTrigger actionDetail, ViewDetail viewDetail) { Intent intent = new Intent(context, newActivityClass); if (bundleGenerator != null) { intent.putExtras(bundleGenerator.generate(view)); } context.startActivity(intent); return true; }
Source:
private String getCachedContextMapping( String baseUrl, String referer ) { if ( referer != null ) { return this.cachedContextMapping.computeIfAbsent( referer, k -> { List<IRequireJsPackageConfiguration> requireJsPackageConfigurations = this.packageConfigurationsTracker.getPackages(); for ( IRequireJsPackageConfiguration requireJsPackage : requireJsPackageConfigurations ) { String webRootPath = requireJsPackage.getWebRootPath(); if ( !StringUtils.isEmpty( webRootPath ) && referer.contains( baseUrl + webRootPath ) ) { Map<String, Object> contextConfig = new HashMap<>(); Map<String, Map<String, String>> topMap = new HashMap<>(); Map<String, String> map = new HashMap<>(); requireJsPackage.getModuleIdsMapping().forEach( map::put ); topMap.put( "*", map ); contextConfig.put( "map", topMap ); return JSONObject.toJSONString( contextConfig ); } } return null; } ); } return null; }

Target:
private String getCachedContextMapping( String baseUrl, String referer ) { if ( referer != null ) { return this.cachedContextMapping.computeIfAbsent( referer, k -> { List<IRequireJsPackageConfiguration> requireJsPackageConfigurations = this.packageConfigurationsTracker.getPackages(); for ( IRequireJsPackageConfiguration requireJsPackage : requireJsPackageConfigurations ) { String webRootPath = requireJsPackage.getWebRootPath(); if ( webRootPath != null && !webRootPath.isEmpty() && referer.contains( baseUrl + webRootPath ) ) { Map<String, Object> contextConfig = new HashMap<>(); Map<String, Map<String, String>> topMap = new HashMap<>(); Map<String, String> map = new HashMap<>(); requireJsPackage.getModuleIdsMapping().forEach( map::put ); topMap.put( "*", map ); contextConfig.put( "map", topMap ); return JSONObject.toJSONString( contextConfig ); } } return null; } ); } return null; }
Source:
public void testListWithCustomGlobalHeaderOverridden() { Map<String, String> headers = new HashMap<>(1); headers.put("my", "local"); clustersService.list().headers(headers).send(); assertEquals("local", getLastRequestHeaders().get("my").getFirst()); }

Target:
public void testListWithCustomGlobalHeaderOverridden() { clustersService.list() .header("my", "local") .send(); assertEquals("local", getLastRequestHeaders().get("my").getFirst()); }
Source:
public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException, InterruptedException { Job project = getProject(); if (project == null) { return; } project.checkPermission(Item.BUILD); if (isRebuildAvailable()) { if (!req.getMethod().equals("POST")) { req.getView(this, "index.jelly").forward(req, rsp); return; } build = req.findAncestorObject(Run.class); ParametersDefinitionProperty paramDefProp = build.getParent().getProperty( ParametersDefinitionProperty.class); List<ParameterValue> values = new ArrayList<ParameterValue>(); ParametersAction paramAction = build.getAction(ParametersAction.class); JSONObject formData = req.getSubmittedForm(); if (!formData.isEmpty()) { JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { if (o instanceof JSONNull) { continue; } JSONObject jo = (JSONObject)o; String name = jo.getString("name"); ParameterValue parameterValue = getParameterValue(paramDefProp, name, paramAction, req, jo); if (parameterValue != null) { values.add(parameterValue); } } } for (ParameterValue source : paramAction.getParameters()) { if (!values.contains(source)) { values.add(source); } } List<Action> actions = constructRebuildActions(build, new ParametersAction(values)); Jenkins.getInstance().getQueue().schedule((Queue.Task) build.getParent(), 0, actions); rsp.sendRedirect("../../"); } }

Target:
public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException, InterruptedException { Job project = getProject(); if (project == null) { return; } project.checkPermission(Item.BUILD); if (isRebuildAvailable()) { if (!req.getMethod().equals("POST")) { req.getView(this, "index.jelly").forward(req, rsp); return; } build = req.findAncestorObject(Run.class); ParametersDefinitionProperty paramDefProp = build.getParent().getProperty(ParametersDefinitionProperty.class); List<ParameterValue> values = new ArrayList<ParameterValue>(); ParametersAction paramAction = build.getAction(ParametersAction.class); JSONObject formData = req.getSubmittedForm(); if (!formData.isEmpty()) { JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { if (o instanceof JSONNull) { continue; } JSONObject jo = (JSONObject)o; String name = jo.getString("name"); ParameterValue parameterValue = getParameterValue(paramDefProp, name, paramAction, req, jo); if (parameterValue != null) { values.add(parameterValue); } } } for (ParameterValue source : paramAction.getParameters()) { boolean alreadyAdded = false; for (ParameterValue dest : values) { if (source.getName().equals(dest.getName())) { alreadyAdded = true; break; } } if (!alreadyAdded) { values.add(source); } } List<Action> actions = constructRebuildActions(build, new ParametersAction(values)); Jenkins.getInstance().getQueue().schedule((Queue.Task) build.getParent(), 0, actions); rsp.sendRedirect("../../"); } }
Source:
public void deleteEnvironment(String id) throws DotDataException { if(!UtilMethods.isSet(id)) return; List<PublishingEndPoint> endPoints = APILocator.getPublisherEndPointAPI().findSendingEndPointsByEnvironment(id); IntegrityUtil integrityUtil = new IntegrityUtil(); for (PublishingEndPoint ep : endPoints) { integrityUtil.completeDiscardConflicts(ep.getId()); APILocator.getPublisherEndPointAPI().deleteEndPointById(ep.getId()); } Environment e = findEnvironmentById(id); APILocator.getPermissionAPI().removePermissions(e); FactoryLocator.getBundleFactory().deleteBundleEnvironmentByEnvironment(id); FactoryLocator.getPushedAssetsFactory().deletePushedAssetsByEnvironment(id); environmentFactory.deleteEnvironmentById(id); }

Target:
public void deleteEnvironment(String id) throws DotDataException { if(!UtilMethods.isSet(id)) return; List<PublishingEndPoint> endPoints = APILocator.getPublisherEndPointAPI().findSendingEndPointsByEnvironment(id); for (PublishingEndPoint ep : endPoints) { APILocator.getPublisherEndPointAPI().deleteEndPointById(ep.getId()); } Environment e = findEnvironmentById(id); APILocator.getPermissionAPI().removePermissions(e); FactoryLocator.getBundleFactory().deleteBundleEnvironmentByEnvironment(id); FactoryLocator.getPushedAssetsFactory().deletePushedAssetsByEnvironment(id); environmentFactory.deleteEnvironmentById(id); }
Source:
public void serviceResolved(ServiceEvent se) { throw new UnsupportedOperationException("Not supported yet."); }

Target:
public void serviceResolved(ServiceEvent se) { }
Source:
public Map<String, Map<String, List<String>>> getRoutingTableForTable(String tableName) throws Exception { final Map<String, Map<String, List<String>>> routingTableMap = new HashMap<>(); final String url = String.format(ROUTING_TABLE_API_TEMPLATE, getBrokerHost(tableName), tableName); String responseBody = sendHttpGet(url); log.debug("Trying to get routingTable for %s. url: %s", tableName, url); JSONObject resp = JSONObject.parseObject(responseBody); JSONArray routingTableSnapshots = resp.getJSONArray("routingTableSnapshot"); for (int i = 0; i < routingTableSnapshots.size(); i++) { JSONObject snapshot = routingTableSnapshots.getJSONObject(i); String tableNameWithType = snapshot.getString("tableName"); if (!tableName.equals(extractRawTableName(tableNameWithType))) { log.debug("Ignoring routingTable for %s", tableNameWithType); continue; } JSONArray routingTableEntriesArray = snapshot.getJSONArray("routingTableEntries"); if (routingTableEntriesArray.size() == 0) { throw new PrestoException( PINOT_FAILURE_GETTING_TABLE, "RoutingTable is empty for " + tableName); } String routingTableEntries = routingTableEntriesArray.getJSONObject(new Random().nextInt(routingTableEntriesArray.size())).toJSONString(); Map<String, List<String>> routingTable = objectMapper.readValue(routingTableEntries, Map.class); routingTableMap.put(tableNameWithType, routingTable); } return routingTableMap; }

Target:
public Map<String, Map<String, List<String>>> getRoutingTableForTable(String tableName) throws Exception { ImmutableMap.Builder<String, Map<String, List<String>>> routingTableMapBuilder = ImmutableMap.builder(); String url = String.format(ROUTING_TABLE_API_TEMPLATE, getBrokerHost(tableName), tableName); String responseBody = sendHttpGet(url); JSONObject resp = JSONObject.parseObject(responseBody); JSONArray routingTableSnapshots = resp.getJSONArray("routingTableSnapshot"); for (int i = 0; i < routingTableSnapshots.size(); i++) { JSONObject snapshot = routingTableSnapshots.getJSONObject(i); String tableNameWithType = snapshot.getString("tableName"); if (!tableName.equals(extractRawTableName(tableNameWithType))) { log.debug("Ignoring routingTable for %s", tableNameWithType); continue; } JSONArray routingTableEntriesArray = snapshot.getJSONArray("routingTableEntries"); if (routingTableEntriesArray.size() == 0) { throw new PrestoException( PINOT_FAILURE_GETTING_TABLE, "RoutingTable is empty for " + tableName); } String routingTableEntries = routingTableEntriesArray.getJSONObject(new Random().nextInt(routingTableEntriesArray.size())).toJSONString(); Map<String, List<String>> routingTable = objectMapper.readValue(routingTableEntries, Map.class); routingTableMapBuilder.put(tableNameWithType, routingTable); } return routingTableMapBuilder.build(); }
Source:
private static void accept(ByteArrayOutputStream byteOutputStream, ByteBuffer byteBuffer) { try { byteOutputStream.write(byteBufferToArray(byteBuffer)); } catch (IOException e) { throw new RuntimeException("Error occurs when write ByteBuffer to ByteArrayOutputStream. " + "Error details: " + e.getMessage(), e); } }

Target:
private static void accept(ByteArrayOutputStream byteOutputStream, ByteBuffer byteBuffer) { try { byteOutputStream.write(byteBufferToArray(byteBuffer)); } catch (IOException e) { throw new RuntimeException("Error occurred writing ByteBuffer to ByteArrayOutputStream.", e); } }
Source:
public void setUp() { this.transformer = new CsvMetacardTransformer(); this.arguments = new HashMap<>(); attributeDescriptorsSet = new HashSet<>(); attributeDescriptorsList = new ArrayList<>(); metacardDataMap = new HashMap<>(); ATTRIBUTE_DESCRIPTOR_LIST = new ArrayList<>(); String[] hiddenFieldsArray = {"attribute3", "attribute5"}; arguments.put("hiddenFields", buildSet(hiddenFieldsArray)); String[] columnOrderArray = {"attribute3", "attribute4", "attribute2"}; arguments.put("columnOrder", buildList(columnOrderArray)); String[][] aliases = {{"attribute1", "column1"}, {"attribute2", "column2"}}; arguments.put("aliases", buildMap(aliases)); attributeDescriptorsSet.add(buildAttributeDescriptor("attribute1", BasicTypes.STRING_TYPE)); attributeDescriptorsSet.add(buildAttributeDescriptor("attribute2", BasicTypes.STRING_TYPE)); attributeDescriptorsSet.add(buildAttributeDescriptor("attribute3", BasicTypes.STRING_TYPE)); attributeDescriptorsSet.add(buildAttributeDescriptor("1", BasicTypes.INTEGER_TYPE)); buildMetacardDataMap(); normalMC = buildMetacard(); }

Target:
public void setUp() { this.transformer = new CsvMetacardTransformer(); this.arguments = new HashMap<>(); arguments.put("columnOrder", ImmutableList.of("stringAtt", "intAtt", "doubleAtt")); normalMC = buildMetacard(); }
Source:
public int hashCode() { int result = (isSsl ? 1 : 0); result = 31 * result + hostAndPort.hashCode(); return result; }

Target:
public int hashCode() { return Objects.hashCode(isSsl, hostAndPort); }
Source:
public void process(final SocketEndpoint webSocket, JobIdentifier jobIdentifier, long start) throws Exception { if (start < 0L) start = 0L; socketHealthService.register(webSocket); boolean isRunningBuild = !detectCompleted(jobIdentifier); try { waitForLogToExist(webSocket, jobIdentifier); } catch (Retryable.TooManyRetriesException e) { socketHealthService.deregister(webSocket); webSocket.close(LOG_DOES_NOT_EXIST, e.getMessage()); return; } try (ConsoleConsumer streamer = consoleService.getStreamer(start, jobIdentifier)) { do { start += sendLogs(webSocket, streamer, jobIdentifier); if (isRunningBuild) { Thread.sleep(FILL_INTERVAL); } } while (webSocket.isOpen() && !detectCompleted(jobIdentifier)); if (isRunningBuild) sendLogs(webSocket, streamer, jobIdentifier); if (detectCompleted(jobIdentifier)) { sendLogs(webSocket, consoleService.getStreamer(start, jobIdentifier), jobIdentifier); } LOGGER.debug("Sent log lines for {}", streamer.totalLinesConsumed(), jobIdentifier); } finally { socketHealthService.deregister(webSocket); webSocket.close(); } }

Target:
public void process(final SocketEndpoint webSocket, JobIdentifier jobIdentifier, long start) throws Exception { if (start < 0L) start = 0L; socketHealthService.register(webSocket); boolean isRunningBuild = !detectCompleted(jobIdentifier); try { waitForLogToExist(webSocket, jobIdentifier); } catch (Retryable.TooManyRetriesException e) { socketHealthService.deregister(webSocket); webSocket.close(LOG_DOES_NOT_EXIST, e.getMessage()); return; } try (ConsoleConsumer streamer = consoleService.getStreamer(start, jobIdentifier)) { do { start += sendLogs(webSocket, streamer, jobIdentifier); if (isRunningBuild) { Thread.sleep(FILL_INTERVAL); } } while (webSocket.isOpen() && !detectCompleted(jobIdentifier)); LOGGER.debug("Sent log lines for from {}", streamer.totalLinesConsumed(), jobIdentifier, consoleService.consoleLogFile(jobIdentifier).toPath()); if (isRunningBuild) sendLogs(webSocket, streamer, jobIdentifier); if (detectCompleted(jobIdentifier)) { try(ConsoleConsumer consoleFileStreamer = consoleService.getStreamer(start, jobIdentifier)) { start += sendLogs(webSocket, consoleFileStreamer, jobIdentifier); LOGGER.debug("Sent log lines for from {}", streamer.totalLinesConsumed(), jobIdentifier, consoleService.consoleLogFile(jobIdentifier).toPath()); } } LOGGER.debug("Sent log lines for from all sources", start, jobIdentifier); } finally { socketHealthService.deregister(webSocket); webSocket.close(); } }
Source:
public <T> T loadClass(ILanguageComponent component, String className, Class<T> expectedType) throws MetaborgException { final ClassLoader classLoader = classLoader(component); Class<?> theClass; try { logger.trace("Loading outliner class"); theClass = classLoader.loadClass(className); } catch (ClassNotFoundException e) { throw new MetaborgException("Given class was not found: " + className, e); } T instance; try { logger.trace("Instantiating outliner class"); instance = (T) theClass.newInstance(); injector.injectMembers(instance); } catch (InstantiationException e) { throw new MetaborgException("Given class was not instantiable", e); } catch (IllegalAccessException e) { throw new MetaborgException("Given class was not accessible", e); } catch (ClassCastException e) { throw new MetaborgException("Given class does not implement required interface", e); } return instance; }

Target:
public <T> T loadClass(ILanguageComponent component, String className, Class<T> expectedType) { final ClassLoader classLoader = classLoader(component); Class<?> theClass; try { logger.trace("Loading outliner class"); theClass = classLoader.loadClass(className); } catch (ClassNotFoundException e) { throw new MetaborgRuntimeException("Given class was not found: " + className, e); } T instance; try { logger.trace("Instantiating class " + className); instance = (T) theClass.newInstance(); injector.injectMembers(instance); } catch (InstantiationException e) { throw new MetaborgRuntimeException("Given class was not instantiable: " + className, e); } catch (IllegalAccessException e) { throw new MetaborgRuntimeException("Given class was not accessible: " + className, e); } catch (ClassCastException e) { throw new MetaborgRuntimeException("Given class does not implement required interface: " + className, e); } logger.trace("Successfully loaded and instantiated class " + className); return instance; }
Source:
public CommandResult command( DBObject cmd , int options, ReadPreference readPrefs ) throws MongoException { if (LOG.isDebugEnabled()) { LOG.debug("Fongo got command " + cmd); } if (cmd.containsField("getlasterror")) { return okResult(); } else if (cmd.containsField("drop")) { this.collMap.remove(cmd.get("drop").toString()); return okResult(); } else if(cmd.containsField("create")) { String collectionName = (String) cmd.get("create"); doGetCollection(collectionName); return okResult(); } else if (cmd.containsField("count")) { String collectionName = (String) cmd.get("count"); Number limit = (Number) cmd.get("limit"); Number skip = (Number) cmd.get("skip"); long result = doGetCollection(collectionName).getCount( (DBObject) cmd.get("query"), null, limit == null ? 0L : limit.longValue(), skip == null ? 0L : skip.longValue()); CommandResult okResult = okResult(); okResult.append("n", result); return okResult; } else if(cmd.containsField("deleteIndexes")) { String collectionName = (String) cmd.get("deleteIndexes"); String indexName = (String) cmd.get("index"); if("*".equals(indexName)) { doGetCollection(collectionName)._dropIndexes(); } else { doGetCollection(collectionName)._dropIndexes(indexName); } CommandResult okResult = okResult(); return okResult; } return koErrorResult("undefined command: " + cmd); }

Target:
public CommandResult command(DBObject cmd, int options, ReadPreference readPrefs) throws MongoException { if (LOG.isDebugEnabled()) { LOG.debug("Fongo got command " + cmd); } if (cmd.containsField("getlasterror")) { return okResult(); } else if (cmd.containsField("drop")) { this.collMap.remove(cmd.get("drop").toString()); return okResult(); } else if (cmd.containsField("create")) { String collectionName = (String) cmd.get("create"); doGetCollection(collectionName); return okResult(); } else if (cmd.containsField("count")) { String collectionName = (String) cmd.get("count"); Number limit = (Number) cmd.get("limit"); Number skip = (Number) cmd.get("skip"); long result = doGetCollection(collectionName).getCount( (DBObject) cmd.get("query"), null, limit == null ? 0L : limit.longValue(), skip == null ? 0L : skip.longValue()); CommandResult okResult = okResult(); okResult.append("n", result); return okResult; } else if (cmd.containsField("deleteIndexes")) { String collectionName = (String) cmd.get("deleteIndexes"); String indexName = (String) cmd.get("index"); if ("*".equals(indexName)) { doGetCollection(collectionName)._dropIndexes(); } else { doGetCollection(collectionName)._dropIndexes(indexName); } CommandResult okResult = okResult(); return okResult; } else if (cmd.containsField("aggregate")) { List<DBObject> result = doAggregateCollection((String) cmd.get("aggregate"), (List<DBObject>) cmd.get("pipeline")); if (result == null) { return koErrorResult("can't aggregate"); } CommandResult okResult = okResult(); BasicDBList list = new BasicDBList(); list.addAll(result); okResult.put("result", list); return okResult; } return koErrorResult("undefined command: " + cmd); }
Source:
private FedoraResource locateResource(final Path path, final Session session) { final Predicate<Path> exists = UncheckedPredicate.uncheck(x -> session.nodeExists(x.toString())); if (exists.test(path) || path.isRoot()) { LOGGER.debug("findRolesForPath: {}", path.getString()); return nodeService.find(session, path.toString()); } else { LOGGER.trace("Path: does not exist, checking parent", path.getString()); return locateResource(path.getParent(), session); } }

Target:
private FedoraResource locateResource(final Path path, final Session session) { final Predicate<Path> exists = UncheckedPredicate.uncheck(x -> session.nodeExists(x.toString())); if (exists.test(path) || path.isRoot()) { LOGGER.debug("findRolesForPath: {}", path.getString()); return nodeService.find(session, path.toString()); } LOGGER.trace("Path: does not exist, checking parent", path.getString()); return locateResource(path.getParent(), session); }
Source:
public void when_searching_for_several_tags_combine_them_with_OR() throws IOException { OrganizationDto organization = dbTester.organizations().insert(); RuleDefinitionDto both_tags_rule = createJavaRule(); insertMetadata(organization, both_tags_rule, setTags("tag1", "tag2")); RuleDefinitionDto one_tag_rule = createJavaRule(); insertMetadata(organization, one_tag_rule, setTags("tag1")); RuleDefinitionDto other_tag_rule = createJavaRule(); insertMetadata(organization, other_tag_rule, setTags("tag2")); RuleDefinitionDto no_tag_rule = createJavaRule(); insertMetadata(organization, no_tag_rule, setTags()); indexRules(); Consumer<TestRequest> request = r -> r .setParam("f", "repo,name") .setParam("tags", "tag1,tag2") .setParam("organization", organization.getKey()); verify(request, both_tags_rule, one_tag_rule, other_tag_rule); }

Target:
public void when_searching_for_several_tags_combine_them_with_OR() throws IOException { OrganizationDto organization = dbTester.organizations().insert(); RuleDefinitionDto bothTagsRule = createJavaRule(); insertMetadata(organization, bothTagsRule, setTags("tag1", "tag2")); RuleDefinitionDto oneTagRule = createJavaRule(); insertMetadata(organization, oneTagRule, setTags("tag1")); RuleDefinitionDto otherTagRule = createJavaRule(); insertMetadata(organization, otherTagRule, setTags("tag2")); RuleDefinitionDto noTagRule = createJavaRule(); insertMetadata(organization, noTagRule, setTags()); indexRules(); Consumer<TestRequest> request = r -> r .setParam("f", "repo,name") .setParam("tags", "tag1,tag2") .setParam("organization", organization.getKey()); verify(request, bothTagsRule, oneTagRule, otherTagRule); }
Source:
private void addOrUpdateSnapshotsConfig(Guid clusterId, GlusterSnapshotConfigInfo configInfo) { try (EngineLock lock = acquireEntityLock(clusterId)) { for (String key : configInfo.getClusterConfigOptions().keySet()) { String value = configInfo.getClusterConfigOptions().get(key); if (value != null) { addOrUpdateClusterConfig(clusterId, key, value); } } } Map<String, Map<String, String>> volumeConfigs = configInfo.getVolumeConfigOptions(); for (String key : volumeConfigs.keySet()) { GlusterVolumeEntity volume = getGlusterVolumeDao().getByName(clusterId, key); try (EngineLock lock = acquireEntityLock(volume.getId())) { Map<String, String> volumeConfig = volumeConfigs.get(key); if (volumeConfig != null) { for (String configKey : volumeConfig.keySet()) { String value = volumeConfig.get(configKey); if (value != null) { addOrUpdateVolumeConfig(clusterId, volume.getId(), configKey, value); } } } } } }

Target:
private void addOrUpdateSnapshotsConfig(Guid clusterId, GlusterSnapshotConfigInfo configInfo) { try (EngineLock lock = acquireEntityLock(clusterId)) { for (Map.Entry<String, String> entry : configInfo.getClusterConfigOptions().entrySet()) { if (entry.getValue() != null) { addOrUpdateClusterConfig(clusterId, entry.getKey(), entry.getValue()); } } } Map<String, Map<String, String>> volumeConfigs = configInfo.getVolumeConfigOptions(); for (Map.Entry<String, Map<String, String>> entry : volumeConfigs.entrySet()) { GlusterVolumeEntity volume = getGlusterVolumeDao().getByName(clusterId, entry.getKey()); if (volume == null) { continue; } try (EngineLock lock = acquireEntityLock(volume.getId())) { Map<String, String> volumeConfig = entry.getValue(); if (volumeConfig != null) { for (Map.Entry<String, String> entry1 : volumeConfig.entrySet()) { if (entry.getValue() != null) { addOrUpdateVolumeConfig(clusterId, volume.getId(), entry1.getKey(), entry1.getValue()); } } } } } }
Source:
public void stop() { this.binlogEventListener.stop(); try { this.replicator.stop(5, TimeUnit.SECONDS); } catch ( Exception e ) { System.err.println("Got exception while shutting down replicator: " + e); } if ( this.replicator.isRunning() ) { System.err.println("Maxwell' replicator thread wouldn't die, but we're exiting anyway."); } this.shouldStop = true; for ( int i = 0; i < 50 && this.isRunning; i++ ) { try { Thread.sleep(100); } catch ( InterruptedException e) } if ( this.isRunning ) { System.err.println("Maxwell's main thread didn't die, but we had to go anyway."); } System.err.flush(); }

Target:
public void stop() throws TimeoutException { stop(5000); }