auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean onScale(ScaleGestureDetector detector) { if (scale == -1f){ mGridView.setNumColumns(GridView.AUTO_FIT); scale = mGridView.getNumColumns(); } scale *= 1-(detector.getScaleFactor()- 1); scale = Math.max(2.0f, Math.min(scale, 10.0f)); Integer scaleInt = Math.round(scale); mGridView.setNumColumns(scaleInt); mGridView.invalidateViews(); return true; }

Target:
public boolean onScale(ScaleGestureDetector detector) { if (mScale == -1f) { mGridView.setNumColumns(GridView.AUTO_FIT); mScale = mGridView.getNumColumns(); } mScale *= 1.f - (detector.getScaleFactor() - 1.f); mScale = Math.max(2.0f, Math.min(mScale, 10.0f)); Integer scaleInt = Math.round(mScale); mGridView.setNumColumns(scaleInt); mGridView.invalidateViews(); return true; }
Source:
public RecoveryAuthenticationProviderImpl(RecoveryService recoveryService) { this.recoveryService = recoveryService; }

Target:
public RecoveryAuthenticationProviderImpl(RecoveryService recoveryService) { this.recoveryService = requireNonNull(recoveryService); }
Source:
public F.Promise<Result> process(final String languageTag) { final UserContext userContext = userContext(languageTag); final PlayJavaSphereClient sphere = sphere(); final F.Promise<Cart> cartPromise = getOrCreateCart(userContext, session()); return cartPromise.flatMap(cart -> { final Form<CheckoutShippingFormData> filledForm = Form.form(CheckoutShippingFormData.class, CheckoutShippingFormData.Validation.class).bindFromRequest(request()); final CheckoutShippingFormData checkoutShippingFormData = extractBean(request(), CheckoutShippingFormData.class); final Messages messages = messages(userContext); final String csrfToken = getCsrfToken(); final CheckoutShippingContent content = new CheckoutShippingContent(checkoutShippingFormData, cart, messages, configuration(), reverseRouter(), userContext, flash(), csrfToken, shippingMethods, productDataConfig); additionalValidations(filledForm, checkoutShippingFormData); if (filledForm.hasErrors()) { Logger.info("cart not valid"); content.getShippingForm().setErrors(new ErrorsBean(filledForm)); final SunrisePageData pageData = pageData(userContext, content); return F.Promise.pure(badRequest(templateService().renderToHtml("checkout-shipping", pageData, userContext.locales()))); } else { final Address shippingAddress = content.getShippingForm().getShippingAddress().toAddress(); final Address nullableBillingAddress = content.getShippingForm().isBillingAddressDifferentToBillingAddress() ? content.getShippingForm().getBillingAddress().toAddress() : null; final String shippingMethodId = checkoutShippingFormData.getShippingMethodId(); final List<UpdateAction<Cart>> updateActions = asList( SetShippingAddress.of(shippingAddress), SetBillingAddress.of(nullableBillingAddress), SetShippingMethod.of(Reference.of(ShippingMethod.referenceTypeId(), shippingMethodId)) ); return sphere.execute(CartUpdateCommand.of(cart, updateActions)) .map(updatedCart -> { Logger.info("cart updated " + updatedCart); final Result redirect = redirect(reverseRouter().showCheckoutShippingForm(languageTag)); return redirect; }); } }); }

Target:
public F.Promise<Result> process(final String languageTag) { final UserContext userContext = userContext(languageTag); return getOrCreateCart(userContext, session()).flatMap(cart -> { final CheckoutShippingFormData checkoutShippingFormData = extractBean(request(), CheckoutShippingFormData.class); final Form<CheckoutShippingFormData> filledForm = obtainFilledForm(checkoutShippingFormData); final Messages messages = messages(userContext); final CheckoutShippingContent content = new CheckoutShippingContent(checkoutShippingFormData, cart, messages, configuration(), reverseRouter(), userContext, getCsrfToken(), shippingMethods, productDataConfig); if (filledForm.hasErrors()) { return F.Promise.pure(badRequest(userContext, filledForm, content)); } else { return updateCart(sphere(), cart, checkoutShippingFormData, content) .map(updatedCart -> redirect(reverseRouter().showCheckoutShippingForm(languageTag))); } }); }
Source:
public void testDatetimeWithLength() throws Exception { if ( !server.getVersion().equals("5.6") ) return; String sql[] = { "create TABLE `test_datetime` ( id datetime(3) )" }; testIntegration(sql); }

Target:
public void testDatetimeWithLength() throws Exception { if ( !server.getVersion().equals("5.6") ) return; String sql[] = { "create TABLE `test_datetime` ( id datetime(3) )", "alter TABLE `test_datetime` add column ts timestamp(6)" }; testIntegration(sql); }
Source:
public void setAgsOptions(final AgsContext opts) { combo.removeActionListener(this); combo.removeAllItems(); final ImList<ComboEntry> validEntries = opts.validStrategies.map(agsStrategy -> new ComboEntry(agsStrategy.key().displayName(), new Some<>(agsStrategy))); final Option<ComboEntry> defaultEntry = opts.defaultStrategy.map(agsStrategy -> { final String name = String.format("Auto (%s)", agsStrategy.key().displayName()); return new ComboEntry(name, None.<AgsStrategy>instance()); }); final ImList<ComboEntry> allEntries = defaultEntry.isEmpty() ? validEntries : validEntries.cons(defaultEntry.getValue()); final ComboBoxModel<ComboEntry> model = new DefaultComboBoxModel<>(new Vector<>(allEntries.toList())); validEntries.foreach(new ApplyOp<ComboEntry>() { @Override public void apply(ComboEntry comboEntry) { System.out.println("ENT " + comboEntry); } }); final Option<ComboEntry> sel = opts.usingDefault() ? defaultEntry : allEntries.find(comboEntry -> comboEntry.strategy.equals(opts.strategyOverride)); sel.foreach(model::setSelectedItem); combo.setModel(model); combo.addActionListener(this); }

Target:
public void setAgsOptions(final AgsContext opts) { combo.removeActionListener(this); combo.removeAllItems(); final ImList<ComboEntry> validEntries = opts.validStrategies.map(agsStrategy -> new ComboEntry(agsStrategy.key().displayName(), new Some<>(agsStrategy))); final Option<ComboEntry> defaultEntry = opts.defaultStrategy.map(agsStrategy -> { final String name = String.format("Auto (%s)", agsStrategy.key().displayName()); return new ComboEntry(name, None.<AgsStrategy>instance()); }); final ImList<ComboEntry> allEntries = defaultEntry.isEmpty() ? validEntries : validEntries.cons(defaultEntry.getValue()); final ComboBoxModel<ComboEntry> model = new DefaultComboBoxModel<>(new Vector<>(allEntries.toList())); final Option<ComboEntry> sel = opts.usingDefault() ? defaultEntry : allEntries.find(comboEntry -> comboEntry.strategy.equals(opts.strategyOverride)); sel.foreach(model::setSelectedItem); combo.setModel(model); combo.addActionListener(this); }
Source:
public void addFeedbackSessionWithStandardTimeZone(String feedbackSessionName, String courseId, LocalDateTime startTime, LocalDateTime endTime, LocalDateTime visibleTime, LocalDateTime publishTime, Text instructions, int gracePeriod) { addFeedbackSessionWithTimeZone(feedbackSessionName, courseId, startTime, endTime, visibleTime, publishTime, instructions, gracePeriod, TimeHelper.convertToZoneId(8)); }

Target:
public void addFeedbackSessionWithStandardTimeZone(String feedbackSessionName, String courseId, LocalDateTime startTime, LocalDateTime endTime, LocalDateTime visibleTime, LocalDateTime publishTime, Text instructions, int gracePeriod) { addFeedbackSessionWithTimeZone(feedbackSessionName, courseId, startTime, endTime, visibleTime, publishTime, instructions, gracePeriod, ZoneId.of("UTC+08:00")); }
Source:
private void stopAncestryPath(GraphNode commit, Queue<GraphNode> theirQueue, Set<GraphNode> theirSet) { Queue<GraphNode> ancestorQueue = new LinkedList<GraphNode>(); ancestorQueue.add(commit); List<GraphNode> processed = new LinkedList<GraphNode>(); while (!ancestorQueue.isEmpty()) { GraphNode ancestor = ancestorQueue.poll(); for (GraphEdge parent : ancestor.getEdges(Direction.BOTH)) { GraphNode parentNode = parent.getToNode(); if (!parentNode.getIdentifier().equals(ancestor.getIdentifier())) { if (theirSet.contains(parentNode)) { ancestorQueue.add(parentNode); processed.add(parentNode); } } else if (theirQueue.contains(parentNode)) { theirQueue.remove(parentNode); } } } }

Target:
private void stopAncestryPath(GraphNode commit, Queue<GraphNode> theirQueue, Set<GraphNode> theirSet) { Queue<GraphNode> ancestorQueue = new LinkedList<GraphNode>(); ancestorQueue.add(commit); List<GraphNode> processed = new LinkedList<GraphNode>(); while (!ancestorQueue.isEmpty()) { GraphNode ancestor = ancestorQueue.poll(); for (GraphEdge parent : ancestor.getEdges(Direction.BOTH)) { GraphNode parentNode = parent.getToNode(); if (!parentNode.getIdentifier().equals(ancestor.getIdentifier())) { if (theirSet.contains(parentNode)) { ancestorQueue.add(parentNode); processed.add(parentNode); } } else { theirQueue.remove(parentNode); } } } }
Source:
private TestingCostProvider(Map<String, PlanNodeCostEstimate> costs, CostCalculator costCalculator, StatsProvider statsProvider, Session session, TypeProvider types) { this.costs = requireNonNull(costs, "costs is null"); this.costCalculator = requireNonNull(costCalculator, "costCalculator is null"); this.statsProvider = requireNonNull(statsProvider, "statsProvider is null"); this.session = requireNonNull(session, "session is null"); this.types = requireNonNull(types, "types is null"); }

Target:
private TestingCostProvider(Map<String, PlanNodeCostEstimate> costs, CostCalculator costCalculator, StatsProvider statsProvider, Session session, TypeProvider types) { this.costs = ImmutableMap.copyOf(requireNonNull(costs, "costs is null")); this.costCalculator = requireNonNull(costCalculator, "costCalculator is null"); this.statsProvider = requireNonNull(statsProvider, "statsProvider is null"); this.session = requireNonNull(session, "session is null"); this.types = requireNonNull(types, "types is null"); }
Source:
public OutputMappingBuilder setProcessTarget(final Data data) { outputMapping.setProcessTarget(data);; return this; }

Target:
public OutputMappingBuilder setProcessTarget(final Data data) { outputMapping.setProcessTarget(data); return this; }
Source:
private void defaultPropertyValues() { if (isRepl()) { ActionBar(actionBarEnabled); } else { ActionBar(themeHelper.hasActionBar()); } Scrollable(false); Sizing("Responsive"); BackgroundImage(""); AboutScreen(""); BackgroundImage(""); AlignHorizontal(ComponentConstants.GRAVITY_LEFT); AlignVertical(ComponentConstants.GRAVITY_TOP); Title(""); ShowStatusBar(true); TitleVisible(true); ShowListsAsJson(true); ActionBar(false); AccentColor(DEFAULT_ACCENT_COLOR); PrimaryColor(DEFAULT_PRIMARY_COLOR); PrimaryColorDark(DEFAULT_PRIMARY_COLOR_DARK); Theme(ComponentConstants.DEFAULT_THEME); ScreenOrientation("unspecified"); BackgroundColor(Component.COLOR_DEFAULT); AutoscaleImages(true); }

Target:
private void defaultPropertyValues() { if (isRepl()) { ActionBar(actionBarEnabled); } else { ActionBar(themeHelper.hasActionBar()); } Scrollable(false); Sizing("Responsive"); BackgroundImage(""); AboutScreen(""); BackgroundImage(""); AlignHorizontal(ComponentConstants.GRAVITY_LEFT); AlignVertical(ComponentConstants.GRAVITY_TOP); Title(""); ShowStatusBar(true); TitleVisible(true); ShowListsAsJson(true); ActionBar(false); AccentColor(DEFAULT_ACCENT_COLOR); PrimaryColor(DEFAULT_PRIMARY_COLOR); PrimaryColorDark(DEFAULT_PRIMARY_COLOR_DARK); Theme(ComponentConstants.DEFAULT_THEME); ScreenOrientation("unspecified"); BackgroundColor(Component.COLOR_DEFAULT); }
Source:
void startRetryTask() { if (retryScheduledFuture == null) { synchronized (retryCounter) { if (retryScheduledFuture == null) { retryScheduledFuture = retryExecutor.scheduleWithFixedDelay(new Runnable() { @Override public void run() { try { int times = retryCounter.incrementAndGet(); logger.error("start to retry task for metadata report. retry times:" + times); if (retry() && times > retryTimesIfNonFail) { cancelRetryTask(); } if (times > retryLimit) { cancelRetryTask(); } } catch (Throwable t) { logger.error("Unexpected error occur at failed retry, cause: " + t.getMessage(), t); } } }, 500, retryPeriod, TimeUnit.MILLISECONDS); } } } }

Target:
void startRetryTask() { if (retryScheduledFuture == null) { synchronized (retryCounter) { if (retryScheduledFuture == null) { retryScheduledFuture = retryExecutor.scheduleWithFixedDelay(new Runnable() { @Override public void run() { try { int times = retryCounter.incrementAndGet(); logger.info("start to retry task for metadata report. retry times:" + times); if (retry() && times > retryTimesIfNonFail) { cancelRetryTask(); } if (times > retryLimit) { cancelRetryTask(); } } catch (Throwable t) { logger.error("Unexpected error occur at failed retry, cause: " + t.getMessage(), t); } } }, 500, retryPeriod, TimeUnit.MILLISECONDS); } } } }
Source:
@Override public boolean add(int element) { if (element < 0) throw new UnsupportedOperationException("Negative or null values are not supported!"); boolean alreadySet = bitSet.get(element); if (!alreadySet) { bitSet.set(element); size++; } return !alreadySet; }

Target:
@Override public boolean add(int element) { if (element < 0) throw new IllegalArgumentException("Negative or null values are not supported!"); boolean alreadySet = bitSet.get(element); if (!alreadySet) { bitSet.set(element); size++; return true; } else return false; }
Source:
protected Object handleDefault(InvocationContext ctx, VisitableCommand cmd) throws Throwable { try { if (!ctx.isOriginLocal() || (watchLocal && isPrimaryOwner(cmd))) { infof("Delaying command %s", cmd); TestingUtil.sleepThread(5); } return invokeNextInterceptor(ctx, cmd); } finally { if (!ctx.isOriginLocal() || (watchLocal && isPrimaryOwner(cmd))) { logCommand(cmd); } else { infof("Not logging command (watchLocal=%b) %s", watchLocal, cmd); } } }

Target:
protected Object handleDefault(InvocationContext ctx, VisitableCommand cmd) throws Throwable { try { if (!ctx.isOriginLocal() || (watchLocal && isPrimaryOwner(cmd))) { debugf("Delaying command %s", cmd); TestingUtil.sleepThread(5); } return invokeNextInterceptor(ctx, cmd); } finally { if (!ctx.isOriginLocal() || (watchLocal && isPrimaryOwner(cmd))) { logCommand(cmd); } else { debugf("Not logging command (watchLocal=%b) %s", watchLocal, cmd); } } }
Source:
private List<Question> doSearch(String query) { String sanitized = HtmlSanitizer.sanitize(query); List<Long> ids = index.findQuestionsByTitle(sanitized, 10); List<Question> questions = new ArrayList<>(); for (Long id : ids) { questions.add(dao.getById(id)); } return questions; }

Target:
private List<Question> doSearch(String query) { String sanitized = HtmlSanitizer.sanitize(query); List<Long> ids = index.findQuestionsByTitle(sanitized, 10); return questions.getByIds(ids); }
Source:
private void validateConfiguredOptions() { int selendroidServerPort = Config.getIntConfigProperty(ConfigProperty.SELENDROID_SERVER_PORT); if (PortProber.pollPort(selendroidServerPort)) { throw new IllegalArgumentException("Specified SELENDROID_SERVER_PORT is already in use."); } try { checkAndValidateParameters(ConfigProperty.SELENDROID_EMULATOR_START_TIMEOUT); checkAndValidateParameters(ConfigProperty.SELENDROID_SERVER_START_TIMEOUT); checkAndValidateParameters(ConfigProperty.MOBILE_DRIVER_SESSION_TIMEOUT); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage(), e); } }

Target:
private void validateConfiguredOptions() { int selendroidServerPort = Config.getIntConfigProperty(ConfigProperty.SELENDROID_SERVER_PORT); String portInUseError = String.format("Port %d is already in use. Please shutdown the service " + "listening on this port or configure a different selendroid server port.", selendroidServerPort); boolean free = false; try { free = PortProber.pollPort(selendroidServerPort); } catch (RuntimeException e) { throw new IllegalArgumentException(portInUseError, e); } finally { if (!free) { throw new IllegalArgumentException(portInUseError); } } try { checkAndValidateParameters(ConfigProperty.SELENDROID_EMULATOR_START_TIMEOUT); checkAndValidateParameters(ConfigProperty.SELENDROID_SERVER_START_TIMEOUT); checkAndValidateParameters(ConfigProperty.MOBILE_DRIVER_SESSION_TIMEOUT); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage(), e); } }
Source:
public final void print(final PJsonObject spec, final Configuration config, final File configDir, final File taskDirectory, final OutputStream outputStream) throws Exception { final String templateName = spec.getString(Constants.JSON_LAYOUT_KEY); final Template template = config.getTemplate(templateName); final Values values = new Values(spec, template, this.parser, taskDirectory, this.httpRequestFactory, null, this.fileSuffix); final ForkJoinTask<Values> taskFuture = this.forkJoinPool.submit(template.getProcessorGraph().createTask(values)); try { taskFuture.get(); } catch (InterruptedException exc) { taskFuture.cancel(true); Thread.currentThread().interrupt(); throw new CancellationException(); } String mapSubReport = values.getString(getMapSubReportVariable(template)); try { mapSubReport = new File(new URI(mapSubReport)).getAbsolutePath(); } catch (URISyntaxException e) { throw new IllegalStateException(e); } FileInputStream is = new FileInputStream(mapSubReport); try { IOUtils.copy(is, outputStream); } finally { is.close(); } }

Target:
public final void print(final PJsonObject spec, final Configuration config, final File configDir, final File taskDirectory, final OutputStream outputStream) throws Exception { final String templateName = spec.getString(Constants.JSON_LAYOUT_KEY); final Template template = config.getTemplate(templateName); if (template == null) { final String possibleTemplates = config.getTemplates().keySet().toString(); throw new IllegalArgumentException("\nThere is no template with the name: " + templateName + ".\nAvailable templates: " + possibleTemplates); } final Values values = new Values(spec, template, this.parser, taskDirectory, this.httpRequestFactory, null, this.fileSuffix); final ForkJoinTask<Values> taskFuture = this.forkJoinPool.submit(template.getProcessorGraph().createTask(values)); try { taskFuture.get(); } catch (InterruptedException exc) { taskFuture.cancel(true); Thread.currentThread().interrupt(); throw new CancellationException(); } String mapSubReport = values.getString(getMapSubReportVariable(template)); try { mapSubReport = new File(new URI(mapSubReport)).getAbsolutePath(); } catch (URISyntaxException e) { throw new IllegalStateException(e); } FileInputStream is = new FileInputStream(mapSubReport); try { IOUtils.copy(is, outputStream); } finally { is.close(); } }
Source:
private int lastIndexOf(int fromIndex, int toIndex, byte value) { fromIndex = Math.min(fromIndex, capacity()); if (fromIndex < 0 || capacity() == 0) { return -1; } for (int i = fromIndex - 1; i >= toIndex; i --) { if (_getByte(i) == value) { return i; } } return -1; }

Target:
private int lastIndexOf(int fromIndex, int toIndex, byte value) { fromIndex = Math.min(fromIndex, capacity()); if (fromIndex < 0 || capacity() == 0) { return -1; } checkIndex(toIndex, fromIndex - toIndex); for (int i = fromIndex - 1; i >= toIndex; i --) { if (_getByte(i) == value) { return i; } } return -1; }
Source:
public void testCreateLiteralLangCaseInsensitive() throws Exception { final Literal lower = factory.createLiteral("Hello", "en-gb"); final Literal upper = factory.createLiteral("Hello", "EN-GB"); final Literal mixed = factory.createLiteral("Hello", "en-GB"); assertEquals("en-gb", lower.getLanguageTag().get()); assertEquals("en-gb", upper.getLanguageTag().get().toLowerCase(Locale.ROOT)); assertEquals("en-gb", mixed.getLanguageTag().get().toLowerCase(Locale.ROOT)); assertEquals(lower, lower); assertEquals(lower, upper); assertEquals(lower, mixed); assertEquals(upper, lower); assertEquals(upper, upper); assertEquals(upper, mixed); assertEquals(mixed, lower); assertEquals(mixed, upper); assertEquals(mixed, mixed); assertEquals(lower.hashCode(), upper.hashCode()); assertEquals(lower.hashCode(), mixed.hashCode()); }

Target:
public void testCreateLiteralLangCaseInsensitive() throws Exception { final Literal upper = factory.createLiteral("Hello", "EN-GB"); final Literal lower = factory.createLiteral("Hello", "en-gb"); final Literal mixed = factory.createLiteral("Hello", "en-GB"); assertEquals("en-gb", lower.getLanguageTag().get().toLowerCase(Locale.ROOT)); assertEquals("en-gb", upper.getLanguageTag().get().toLowerCase(Locale.ROOT)); assertEquals("en-gb", mixed.getLanguageTag().get().toLowerCase(Locale.ROOT)); assertEquals(lower, lower); assertEqualsBothWays(lower, upper); assertEqualsBothWays(lower, mixed); assertEquals(upper, upper); assertEqualsBothWays(upper, mixed); assertEquals(mixed, mixed); }
Source:
private static String getFacebookEndpoint() { return String.format("<LINK_0>", BuildConfig.FACEBOOK_APP_ID); }

Target:
private static String getFacebookEndpoint() { return String.format(Locale.ENGLISH, "<LINK_0>", BuildConfig.FACEBOOK_APP_ID); }
Source:
public Action<?, ?> failedAction() { return new AbstractEnvStackConfigUpdatesAction<>(EnvStopFailedEvent.class) { @Override protected void doExecute(CommonContext context, EnvStopFailedEvent payload, Map<Object, Object> variables) { LOGGER.warn( String.format("Failed to update environments stack configs '%s'. Status: '%s'.", payload.getEnvironmentDto(), payload.getEnvironmentStatus()), payload.getException()); EnvironmentDto environmentDto = environmentStatusUpdateService .updateFailedEnvironmentStatusAndNotify(context, payload, getCurrentStatus(payload.getResourceId()), ResourceEvent.ENVIRONMENT_STACK_CONFIGS_UPDATE_FAILED, EnvStackConfigUpdatesState.STACK_CONFIG_UPDATES_FAILED_STATE); metricService.incrementMetricCounter(MetricType.ENV_STACK_CONFIG_UPDATE_FAILED, environmentDto, payload.getException()); sendEvent(context, HANDLE_FAILED_ENV_STACK_CONIFG_UPDATES_EVENT.event(), payload); } }; }

Target:
public Action<?, ?> failedAction() { return new AbstractEnvStackConfigUpdatesAction<>(EnvStackConfigUpdatesFailedEvent.class) { @Override protected void doExecute(CommonContext context, EnvStackConfigUpdatesFailedEvent payload, Map<Object, Object> variables) { LOGGER.warn( String.format("Failed to update environments stack configs '%s'. Status: '%s'.", payload.getEnvironmentDto(), payload.getEnvironmentStatus()), payload.getException()); EnvironmentDto environmentDto = environmentStatusUpdateService .updateFailedEnvironmentStatusAndNotify(context, payload, getCurrentStatus(payload.getResourceId()), ResourceEvent.ENVIRONMENT_STACK_CONFIGS_UPDATE_FAILED, EnvStackConfigUpdatesState.STACK_CONFIG_UPDATES_FAILED_STATE); metricService.incrementMetricCounter(MetricType.ENV_STACK_CONFIG_UPDATE_FAILED, environmentDto, payload.getException()); sendEvent(context, HANDLE_FAILED_ENV_STACK_CONIFG_UPDATES_EVENT.event(), payload); } }; }
Source:
public BinderFactory binderFactory(BinderTypeRegistry binderTypeRegistry, ChannelBindingServiceProperties channelBindingServiceProperties) { Map<String, BinderConfiguration> binderConfigurations = new HashMap<>(); if (!CollectionUtils.isEmpty(channelBindingServiceProperties.getBinders())) { for (Map.Entry<String, BinderProperties> binderEntry : channelBindingServiceProperties.getBinders().entrySet()) { BinderProperties binderProperties = binderEntry.getValue(); if (binderTypeRegistry.get(binderEntry.getKey()) != null) { binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderTypeRegistry.get(binderEntry.getKey()), binderProperties.getProperties())); } else { Assert.hasText(binderProperties.getType(), "No 'type' property present for custom " + "binder " + binderEntry.getKey()); binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderTypeRegistry.get(binderProperties.getType()), binderProperties.getProperties())); } } } else { for (Map.Entry<String, BinderType> entry : binderTypeRegistry.getAll().entrySet()) { binderConfigurations.put(entry.getKey(), new BinderConfiguration(entry.getValue(), new Properties())); } } DefaultBinderFactory binderFactory = new DefaultBinderFactory<>(binderConfigurations); binderFactory.setDefaultBinder(channelBindingServiceProperties.getDefaultBinder()); return binderFactory; }

Target:
public BinderFactory binderFactory(BinderTypeRegistry binderTypeRegistry, ChannelBindingServiceProperties channelBindingServiceProperties) { Map<String, BinderConfiguration> binderConfigurations = new HashMap<>(); if (!CollectionUtils.isEmpty(channelBindingServiceProperties.getBinders())) { for (Map.Entry<String, BinderProperties> binderEntry : channelBindingServiceProperties.getBinders().entrySet()) { BinderProperties binderProperties = binderEntry.getValue(); if (binderTypeRegistry.get(binderEntry.getKey()) != null) { binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderTypeRegistry.get(binderEntry.getKey()), binderProperties.getEnvironment())); } else { Assert.hasText(binderProperties.getType(), "No 'type' property present for custom " + "binder " + binderEntry.getKey()); binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderTypeRegistry.get(binderProperties.getType()), binderProperties.getEnvironment())); } } } else { for (Map.Entry<String, BinderType> entry : binderTypeRegistry.getAll().entrySet()) { binderConfigurations.put(entry.getKey(), new BinderConfiguration(entry.getValue(), new Properties())); } } DefaultBinderFactory binderFactory = new DefaultBinderFactory<>(binderConfigurations); binderFactory.setDefaultBinder(channelBindingServiceProperties.getDefaultBinder()); return binderFactory; }
Source:
public ListBoxModel doFillWebhookSecretIdItems(@QueryParameter String webhookSecretId) { return constructListBoxModel(webhookSecretId); }

Target:
public ListBoxModel doFillWebhookSecretIdItems(@QueryParameter String webhookSecretId) { return createListBoxModel(webhookSecretId); }
Source:
private void checkResources() { File validatorDir = new File(validatorDirPath); List<URL> resources = new ArrayList<URL>(); boolean reloadResources = false; try { for (File f : validatorDir.listFiles()) { if (f.getName().endsWith(".jar")) { resources.add(f.toURI().toURL()); if (resourceTimestamps.get(f.getName()) != f.lastModified()) { reloadResources = true; logger.info("Resource " + f.getName() + " is updated. Reload the classloader."); resourceTimestamps.put(f.getName(), f.lastModified()); } } } } catch (MalformedURLException e) { throw new ValidatorManagerException(e); } if (reloadResources) { validatorLoader = new URLClassLoader(resources.toArray(new URL[resources.size()])); } }

Target:
private void checkResources() { File validatorDir = new File(validatorDirPath); List<URL> resources = new ArrayList<URL>(); boolean reloadResources = false; try { for (File f : validatorDir.listFiles()) { if (f.getName().endsWith(".jar")) { resources.add(f.toURI().toURL()); if (resourceTimestamps.get(f.getName()) == null || resourceTimestamps.get(f.getName()) != f.lastModified()) { reloadResources = true; logger.info("Resource " + f.getName() + " is updated. Reload the classloader."); resourceTimestamps.put(f.getName(), f.lastModified()); } } } } catch (MalformedURLException e) { throw new ValidatorManagerException(e); } if (reloadResources) { validatorLoader = new URLClassLoader(resources.toArray(new URL[resources.size()])); } }
Source:
public Server listen() throws InterruptedException { BeatsInitializer beatsInitializer = null; try { logger.info("Starting server on port: " + this.port); beatsInitializer = new BeatsInitializer(isSslEnable(), messageListener, clientInactivityTimeoutSeconds); ServerBootstrap server = new ServerBootstrap(); server.group(workGroup) .channel(NioServerSocketChannel.class) .option(ChannelOption.SO_BACKLOG, 50) .childOption(ChannelOption.SO_LINGER, 0) .childHandler(beatsInitializer); Channel channel = server.bind(host, port).sync().channel(); channel.closeFuture().sync(); } finally { workGroup.shutdownGracefully().sync(); beatsInitializer.shutdownEventExecutor(); } return this; }

Target:
public Server listen() throws InterruptedException { BeatsInitializer beatsInitializer = null; try { logger.info("Starting server on port: " + this.port); beatsInitializer = new BeatsInitializer(isSslEnable(), messageListener, clientInactivityTimeoutSeconds, beatsHeandlerThreadCount); ServerBootstrap server = new ServerBootstrap(); server.group(workGroup) .channel(NioServerSocketChannel.class) .childOption(ChannelOption.SO_LINGER, 0) .childHandler(beatsInitializer); Channel channel = server.bind(host, port).sync().channel(); channel.closeFuture().sync(); } finally { workGroup.shutdownGracefully().sync(); beatsInitializer.shutdownEventExecutor(); } return this; }
Source:
public Guid getUpServerId(Guid clusterId) { return ClusterUtils.getInstance().getRandomUpServer(clusterId).getId(); }

Target:
public Guid getUpServerId(Guid clusterId) { VDS randomUpServer = ClusterUtils.getInstance().getRandomUpServer(clusterId); return randomUpServer == null ? null : randomUpServer.getId(); }
Source:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); Options options = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true).setBypassPCodeMatching(true).build(); player = new OoyalaPlayer(pcode, playerDomain, options); JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { } else { Log.e(TAG, "Asset Failure"); } } }

Target:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); Options options = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, playerDomain, options); JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { } else { Log.e(TAG, "Asset Failure"); } } }
Source:
public AttributeSet(String[] queryParams) { for (String param : queryParams) { String[] keyAndValue = param.split("="); if (keyAndValue.length != 2) { throw new IllegalArgumentException(String.format("Cannot parse query param '%s'", param)); } Attribute attr = Attribute.create(keyAndValue[0], keyAndValue[1]); attributeMap.put(attr.getName(), attr); } }

Target:
public AttributeSet(String[] queryParams) { for (String param : queryParams) { String[] keyAndValue = param.split("="); if (keyAndValue.length != 2) { throw new IllegalArgumentException(String.format("Cannot parse query param '%s'", param)); } Attribute attr = Attribute.create(keyAndValue[0], keyAndValue[1]); attributeMap.put(attr.getCoRELinkParam(), attr); } }
Source:
public Set<Rule<?>> rules() { return ImmutableSet.of( new ProjectExpressionRewrite(this::rewrite), new AggregationExpressionRewrite(this::rewrite), new FilterExpressionRewrite(this::rewrite), new TableScanExpressionRewrite(this::rewrite), new JoinExpressionRewrite(this::rewrite), new ValuesExpressionRewrite(this::rewrite)); }

Target:
public Set<Rule<?>> rules() { return ImmutableSet.of( projectExpressionRewrite(), aggregationExpressionRewrite(), filterExpressionRewrite(), tableScanExpressionRewrite(), joinExpressionRewrite(), valuesExpressionRewrite()); }
Source:
public Object execute(JobExecutionContext context) throws JobExecutionException { JobArguments args = context.getJobArguments(); String ownerKey = args.getAsString(OWNER_KEY); ConflictOverrides overrides = new ConflictOverrides(args.getAs(CONFLICT_OVERRIDES, String[].class)); String storedFileId = args.getAsString(STORED_FILE_ID); String uploadedFileName = args.getAsString(UPLOADED_FILE_NAME); Throwable caught; Owner targetOwner = null; try { targetOwner = ownerCurator.getByKey(ownerKey); if (targetOwner == null) { throw new NotFoundException(String.format("Owner %s was not found.", ownerKey)); } ImportRecord importRecord = manifestManager.importStoredManifest(targetOwner, storedFileId, overrides, uploadedFileName); log.info("Async import complete."); return importRecord; } catch (SyncDataFormatException e) { caught = new BadRequestException(e.getMessage(), e); } catch (ImporterException e) { caught = new IseException(e.getMessage(), e); } catch (Exception e) { caught = e; } manifestManager.recordImportFailure(targetOwner, caught, uploadedFileName); manifestManager.deleteStoredManifest(storedFileId); throw new JobExecutionException(caught.getMessage(), caught, false); }

Target:
public Object execute(JobExecutionContext context) throws JobExecutionException { JobArguments args = context.getJobArguments(); String ownerKey = args.getAsString(OWNER_KEY); ConflictOverrides overrides = new ConflictOverrides(args.getAs(CONFLICT_OVERRIDES, String[].class)); String storedFileId = args.getAsString(STORED_FILE_ID); String uploadedFileName = args.getAsString(UPLOADED_FILE_NAME); JobExecutionException toThrow; Throwable caught; Owner targetOwner = null; try { targetOwner = ownerCurator.getByKey(ownerKey); if (targetOwner == null) { throw new NotFoundException(String.format("Owner %s was not found.", ownerKey)); } ImportRecord importRecord = manifestManager.importStoredManifest(targetOwner, storedFileId, overrides, uploadedFileName); log.info("Async import complete."); return importRecord; } catch (ImportConflictException e) { toThrow = new ImportConflictJobException(e); caught = e; } catch (ImporterException e) { toThrow = new JobExecutionException(e.getMessage(), e, true); caught = e; } catch (Exception e) { toThrow = new JobExecutionException(e.getMessage(), e, false); caught = e; } manifestManager.recordImportFailure(targetOwner, caught, uploadedFileName); manifestManager.deleteStoredManifest(storedFileId); throw toThrow; }
Source:
private void adjustConsumers(int newCount) { int delta = newCount - this.consumersPerQueue; if (delta != 0) { synchronized (this.consumersMonitor) { if (delta > 0) { List<SimpleConsumer> newConsumers = new ArrayList<>(); for (int i = 0; i < delta; i++) { for (String queue : getQueueNames()) { try { newConsumers.add(doConsumeFromQueue(queue)); } catch (IOException e) { logger.error("Failed to start a new consumer, reverting", e); for (SimpleConsumer consumer : newConsumers) { try { consumer.getChannel().basicCancel(consumer.getConsumerTag()); List<SimpleConsumer> list = this.consumersByQueue.get(queue); if (list != null) { list.remove(consumer); } } catch (IOException e1) { logger.error("Failed to cancel consumer during revert", e); } } throw new AmqpIOException("Failed to increase consumers", e); } } } } else { for (Entry<String, List<SimpleConsumer>> entry : this.consumersByQueue.entrySet()) { List<SimpleConsumer> consumerList = entry.getValue(); while (consumerList.size() > newCount) { SimpleConsumer consumer = consumerList.remove(consumerList.size() - 1); try { consumer.getChannel().basicCancel(consumer.getConsumerTag()); this.consumers.remove(consumer); } catch (IOException e) { logger.error("Failed to cancel consumer", e); } } } } } } }

Target:
private void adjustConsumers(int newCount) { synchronized (this.consumersMonitor) { for (String queue : getQueueNames()) { try { while (this.consumersByQueue.get(queue) == null || this.consumersByQueue.get(queue).size() < newCount) { doConsumeFromQueue(queue); } if (this.consumersByQueue.get(queue).size() > newCount) { List<SimpleConsumer> consumerList = this.consumersByQueue.get(queue); while (consumerList.size() > newCount) { SimpleConsumer consumer = consumerList.remove(consumerList.size() - 1); try { consumer.getChannel().basicCancel(consumer.getConsumerTag()); this.consumers.remove(consumer); } catch (IOException e) { logger.error("Failed to cancel consumer", e); } } } } catch (IOException e) { throw new AmqpIOException( "Failed to adjust the consumer count for '" + queue + "' aborting adjustment", e); } } } }
Source:
public void givenInvalidTestClass_integrationTest() { Result result = JUnitCore.runClasses(TestClassWithErrors.class); assertThat(result.getFailureCount(), is(1)); Throwable failure = result.getFailures().get(0).getException(); assertThat(failure.getMessage(), allOf( startsWith("Invalid test class"), containsString(TestClassWithErrors.class.getName()), containsString("\n 1. "), containsString("\n 2. ") )); }

Target:
public void givenInvalidTestClass_integrationTest() { Result result = JUnitCore.runClasses(TestClassWithErrors.class); assertThat(result.getFailureCount(), is(1)); Throwable failure = result.getFailures().get(0).getException(); assertThat(failure, instanceOf(InvalidTestClassError.class)); assertThat(failure.getMessage(), allOf( startsWith("Invalid test class '" + TestClassWithErrors.class.getName() + "'"), containsString("\n 1. "), containsString("\n 2. ") )); }
Source:
static <T, U, R extends Traversable<U>> R scanRight(Traversable<? extends T> traversable, U zero, BiFunction<? super T, ? super U, ? extends U> operation, Function<Iterator<U>, R> finisher) { final Iterator<? extends T> reversedElements = reverseIterator(traversable.iterator()); return scanLeft(reversedElements, zero, (u, t) -> operation.apply(t, u), us -> finisher.apply(reverseIterator(us))); }

Target:
static <T, U, R extends Traversable<U>> R scanRight(Traversable<? extends T> traversable, U zero, BiFunction<? super T, ? super U, ? extends U> operation, Function<Iterator<U>, R> finisher) { final Iterator<? extends T> reversedElements = reverseIterator(traversable); return scanLeft(reversedElements, zero, (u, t) -> operation.apply(t, u), us -> finisher.apply(reverseIterator(us))); }
Source:
public static View create(StaplerRequest req, StaplerResponse rsp, ViewGroup owner) throws FormException, IOException, ServletException { String mode = req.getParameter("mode"); String requestContentType = req.getContentType(); if (requestContentType == null && !(mode != null && mode.equals("copy"))) throw new Failure("No Content-Type header set"); boolean isXmlSubmission = requestContentType != null && (requestContentType.startsWith("application/xml") || requestContentType.startsWith("text/xml")); String name = req.getParameter("name"); checkGoodName(name); if(owner.getView(name)!=null) throw new Failure(Messages.Hudson_ViewAlreadyExists(name)); if (mode==null || mode.length()==0) { if(isXmlSubmission) { View v = createViewFromXML(name, req.getInputStream()); if (!owner.getACL().hasCreatePermission(Jenkins.getAuthentication(), owner, v.getDescriptor())) { throw new Failure(Messages.View_CreatePermissionMissing(v.getDescriptor().getDisplayName())); } v.owner = owner; rsp.setStatus(HttpServletResponse.SC_OK); return v; } else throw new Failure(Messages.View_MissingMode()); } View v; if ("copy".equals(mode)) { v = copy(req, owner, name); } else { ViewDescriptor descriptor = all().findByName(mode); if (descriptor == null) { throw new Failure("No view type ‘" + mode + "’ is known"); } v = descriptor.newInstance(req,req.getSubmittedForm()); } if (!owner.getACL().hasCreatePermission(Jenkins.getAuthentication(), owner, v.getDescriptor())) { throw new Failure(Messages.View_CreatePermissionMissing(v.getDescriptor().getDisplayName())); } v.owner = owner; rsp.sendRedirect2(req.getContextPath()+'/'+v.getUrl()+v.getPostConstructLandingPage()); return v; }

Target:
public static View create(StaplerRequest req, StaplerResponse rsp, ViewGroup owner) throws FormException, IOException, ServletException { String mode = req.getParameter("mode"); String requestContentType = req.getContentType(); if (requestContentType == null && !(mode != null && mode.equals("copy"))) throw new Failure("No Content-Type header set"); boolean isXmlSubmission = requestContentType != null && (requestContentType.startsWith("application/xml") || requestContentType.startsWith("text/xml")); String name = req.getParameter("name"); checkGoodName(name); if(owner.getView(name)!=null) throw new Failure(Messages.Hudson_ViewAlreadyExists(name)); if (mode==null || mode.length()==0) { if(isXmlSubmission) { View v = createViewFromXML(name, req.getInputStream()); owner.getACL().checkCreatePermission(owner, v.getDescriptor()); v.owner = owner; rsp.setStatus(HttpServletResponse.SC_OK); return v; } else throw new Failure(Messages.View_MissingMode()); } View v; if ("copy".equals(mode)) { v = copy(req, owner, name); } else { ViewDescriptor descriptor = all().findByName(mode); if (descriptor == null) { throw new Failure("No view type ‘" + mode + "’ is known"); } v = descriptor.newInstance(req,req.getSubmittedForm()); } owner.getACL().checkCreatePermission(owner, v.getDescriptor()); v.owner = owner; rsp.sendRedirect2(req.getContextPath()+'/'+v.getUrl()+v.getPostConstructLandingPage()); return v; }
Source:
protected void validateUpdatedModel(final OperationContext context, final Resource resource) throws OperationFailedException { final ModelNode model = resource.getModel(); ModelNode path = model.get(CommonAttributes.PATH); final ServiceController<PathManager> controller = (ServiceController<PathManager>) context.getServiceRegistry(false) .getService(PathManagerService.SERVICE_NAME); if (controller != null) { if (model.hasDefined(CommonAttributes.RELATIVE_TO)) { final ModelNode relativeToPath = model.get(CommonAttributes.RELATIVE_TO); String pathName; try { pathName = controller.getValue().resolveRelativePathEntry(path.asString(), relativeToPath.asString()); } catch (IllegalArgumentException e) { throw new OperationFailedException( DeploymentScannerLogger.ROOT_LOGGER.pathEntryNotFound(relativeToPath.asString())); } if (pathName != null) { File relativePath = new File(pathName); if (!relativePath.exists()) { throw new OperationFailedException( DeploymentScannerLogger.ROOT_LOGGER.directoryIsNonexistent(relativePath.getAbsolutePath())); } if (!relativePath.isDirectory()) { throw new OperationFailedException( DeploymentScannerLogger.ROOT_LOGGER.isNotADirectory(relativePath.getAbsolutePath())); } if (!relativePath.canWrite()) { throw new OperationFailedException( DeploymentScannerLogger.ROOT_LOGGER.directoryIsNotWritable(relativePath.getAbsolutePath())); } } } } }

Target:
protected void validateUpdatedModel(final OperationContext context, final Resource resource) throws OperationFailedException { final ModelNode model = resource.getModel(); final ModelNode relativeTo = DeploymentScannerDefinition.RELATIVE_TO.resolveModelAttribute(context, model); if (relativeTo.isDefined()) { try { PathEntry pathEntry = pathManager.getPathEntry(relativeTo.asString()); } catch (IllegalArgumentException e) { throw DeploymentScannerLogger.ROOT_LOGGER.pathEntryNotFound(relativeTo.asString()); } } }
Source:
private int calcTotalBinaryDecodedLength(byte[] buf, int ptr) throws PatchApplyException { int total = 0; while (buf[ptr] != '\n') { int sizeChar = buf[ptr++]; total += resolveDecodedLength(sizeChar); ptr = nextLF(buf, ptr); } return total; }

Target:
private int calcTotalBinaryDecodedLength(byte[] buf, int ptr) throws PatchApplyException { int total = 0; while (ptr < buf.length && buf[ptr] != '\n') { int sizeChar = buf[ptr++]; total += resolveDecodedLength(sizeChar); ptr = nextLF(buf, ptr); } if (ptr >= buf.length) { throw new PatchApplyException(JGitText.get().malformedBinaryPatch); } return total; }
Source:
public ImmutableBitmap getBitmapIndex( String value, BitmapFactory bitmapFactory, int numRows ) { if (column == null) { return bitmapFactory.makeEmptyImmutableBitmap(); } final float parsedFloat = Float.parseFloat(value); final MutableBitmap bitmap = bitmapFactory.makeEmptyMutableBitmap(); for (int rowIdx = 0; rowIdx < column.getLength(); rowIdx++) { float rowVal = genericColumn.getFloatSingleValueRow(rowIdx); if (rowVal == parsedFloat) { bitmap.add(rowIdx); } } return bitmapFactory.makeImmutableBitmap(bitmap); }

Target:
public ImmutableBitmap getBitmapIndex( String value, BitmapFactory bitmapFactory, int numRows ) { if (column == null) { return bitmapFactory.makeEmptyImmutableBitmap(); } final float parsedFloat; try { parsedFloat = Float.parseFloat(value); } catch (NumberFormatException nfe) { throw new ParseException("Could not parse value[%s] as float!", value); } final MutableBitmap bitmap = bitmapFactory.makeEmptyMutableBitmap(); for (int rowIdx = 0; rowIdx < column.getLength(); rowIdx++) { float rowVal = genericColumn.getFloatSingleValueRow(rowIdx); if (rowVal == parsedFloat) { bitmap.add(rowIdx); } } return bitmapFactory.makeImmutableBitmap(bitmap); }
Source:
public String getResult() { try { float res = Float.parseFloat(result); if (res > 0) { return "+" + result; } else { return result; } } catch (Exception e) { return result; } }

Target:
public String getResult(){ return result; }
Source:
public void setup() throws AssumptionViolatedException { assumeTrue(CameraUtil.checkCameraDevice()); Log.i("CameraTest", "setup"); mMockOnImageAvailableListener = Mockito.mock(ImageReader.OnImageAvailableListener.class); FakeUseCaseConfig config = new FakeUseCaseConfig.Builder() .setTargetName("UseCase") .setLensFacing(DEFAULT_LENS_FACING) .build(); mCameraId = getCameraIdForLensFacingUnchecked(DEFAULT_LENS_FACING); mFakeUseCase = new TestUseCase(config, mMockOnImageAvailableListener); Map<String, Size> suggestedResolutionMap = new HashMap<>(); suggestedResolutionMap.put(mCameraId, new Size(640, 480)); mFakeUseCase.updateSuggestedResolution(suggestedResolutionMap); mCamera = sCameraFactory.getCamera(mCameraId); }

Target:
public void setup() { assumeTrue(CameraUtil.deviceHasCamera()); mMockOnImageAvailableListener = Mockito.mock(ImageReader.OnImageAvailableListener.class); FakeUseCaseConfig config = new FakeUseCaseConfig.Builder() .setTargetName("UseCase") .setLensFacing(DEFAULT_LENS_FACING) .build(); mCameraId = getCameraIdForLensFacingUnchecked(DEFAULT_LENS_FACING); mFakeUseCase = new TestUseCase(config, mMockOnImageAvailableListener); Map<String, Size> suggestedResolutionMap = new HashMap<>(); suggestedResolutionMap.put(mCameraId, new Size(640, 480)); mFakeUseCase.updateSuggestedResolution(suggestedResolutionMap); mCamera = sCameraFactory.getCamera(mCameraId); }
Source:
public void testGetAddressDeletedFromJournal() throws Exception { SimpleString address = RandomUtil.randomSimpleString(); SimpleString name = RandomUtil.randomSimpleString(); ActiveMQServerControl serverControl = createManagementControl(); Assert.assertFalse(ActiveMQServerControlTest.contains(address.toString(), serverControl.getAddressNames())); serverControl.createAddress(address.toString(), "ANYCAST"); Assert.assertTrue(ActiveMQServerControlTest.contains(address.toString(), serverControl.getAddressNames())); serverControl.deleteAddress(address.toString()); server.stop(); server.start(); Assert.assertFalse(ActiveMQServerControlTest.contains(address.toString(), serverControl.getAddressNames())); }

Target:
public void testGetAddressDeletedFromJournal() throws Exception { SimpleString address = RandomUtil.randomSimpleString(); SimpleString name = RandomUtil.randomSimpleString(); ActiveMQServerControl serverControl = createManagementControl(); Assert.assertFalse(ActiveMQServerControlTest.contains(address.toString(), serverControl.getAddressNames())); serverControl.createAddress(address.toString(), "ANYCAST"); Assert.assertTrue(ActiveMQServerControlTest.contains(address.toString(), serverControl.getAddressNames())); restartServer(); serverControl.deleteAddress(address.toString()); restartServer(); Assert.assertFalse(ActiveMQServerControlTest.contains(address.toString(), serverControl.getAddressNames())); }
Source:
private void handleKeyEvent(KeyEvent e) { if (e.getCode() == KeyCode.CAPS) { updateCapsLocked(); } if (SHORTCUT_BACKSPACE.match(e)) { swipe(); } }

Target:
private void handleKeyEvent(KeyEvent e) { if (e.getCode() == KeyCode.CAPS) { updateCapsLocked(); } else if (SHORTCUT_BACKSPACE.match(e)) { swipe(); } }
Source:
public void onPlayButtonClicked() { modService.getFeaturedMod(COOP.getTechnicalName()) .thenAccept(featuredModBean -> gameService.hostGame(new NewGameInfo(titleTextField.getText(), Strings.emptyToNull(passwordTextField.getText()), featuredModBean, getSelectedMission().getMapFolderName(), emptySet(), 0, 3000, false))); }

Target:
public void onPlayButtonClicked() { modService.getFeaturedMod(COOP.getTechnicalName()) .thenAccept(featuredModBean -> gameService.hostGame(new NewGameInfo(titleTextField.getText(), Strings.emptyToNull(passwordTextField.getText()), featuredModBean, getSelectedMission().getMapFolderName(), emptySet()))); }