auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public IsNetworkOnInterfacePredicate(String networkName) { this.networkName = networkName; }

Target:
public IsNetworkOnInterfacePredicate(String networkName) { Validate.notNull(networkName, "networkName can not be null"); this.networkName = networkName; }
Source:
private void setClientCookies() { TimeSpan tsExpires = SessionCookieDataImpl.DEFAULT.getTimeout(); String domain = PageContextUtil.getCookieDomain(this); boolean httpOnly = SessionCookieDataImpl.DEFAULT.isHttpOnly(); boolean secure = SessionCookieDataImpl.DEFAULT.isSecure(); short samesite = SessionCookieDataImpl.DEFAULT.getSamesite(); String path = SessionCookieDataImpl.DEFAULT.getPath(); ApplicationContext ac = getApplicationContext(); if (ac instanceof ApplicationContextSupport) { ApplicationContextSupport acs = (ApplicationContextSupport) ac; SessionCookieData data = acs.getSessionCookie(); if (data != null) { TimeSpan ts = data.getTimeout(); if (ts != null) tsExpires = ts; httpOnly = data.isHttpOnly(); secure = data.isSecure(); String tmp = data.getDomain(); if (!StringUtil.isEmpty(tmp, true)) domain = tmp.trim(); samesite = data.getSamesite(); String tmp2 = data.getPath(); if (StringUtil.isEmpty(tmp2, true)) path = "/"; else path = tmp2.trim(); } } int expires; long tmp = tsExpires.getSeconds(); if (Integer.MAX_VALUE < tmp) expires = Integer.MAX_VALUE; else expires = (int) tmp; ((CookieImpl) cookieScope()).setCookieEL(KeyConstants._cfid, cfid, expires, secure, path, domain, httpOnly, true, false, samesite); ((CookieImpl) cookieScope()).setCookieEL(KeyConstants._cftoken, cftoken, expires, secure, path, domain, httpOnly, true, false, samesite); }

Target:
private void setClientCookies() { TimeSpan tsExpires = SessionCookieDataImpl.DEFAULT.getTimeout(); String domain = PageContextUtil.getCookieDomain(this); boolean httpOnly = SessionCookieDataImpl.DEFAULT.isHttpOnly(); boolean secure = SessionCookieDataImpl.DEFAULT.isSecure(); short samesite = SessionCookieDataImpl.DEFAULT.getSamesite(); String path = SessionCookieDataImpl.DEFAULT.getPath(); ApplicationContext ac = getApplicationContext(); if (ac instanceof ApplicationContextSupport) { ApplicationContextSupport acs = (ApplicationContextSupport) ac; SessionCookieData data = acs.getSessionCookie(); if (data != null) { TimeSpan ts = data.getTimeout(); if (ts != null) tsExpires = ts; httpOnly = data.isHttpOnly(); secure = data.isSecure(); String tmp = data.getDomain(); if (!StringUtil.isEmpty(tmp, true)) domain = tmp.trim(); samesite = data.getSamesite(); String tmp2 = data.getPath(); if (!StringUtil.isEmpty(tmp2, true)) path = tmp2.trim(); } } int expires; long tmp = tsExpires.getSeconds(); if (Integer.MAX_VALUE < tmp) expires = Integer.MAX_VALUE; else expires = (int) tmp; ((CookieImpl) cookieScope()).setCookieEL(KeyConstants._cfid, cfid, expires, secure, path, domain, httpOnly, true, false, samesite); ((CookieImpl) cookieScope()).setCookieEL(KeyConstants._cftoken, cftoken, expires, secure, path, domain, httpOnly, true, false, samesite); }
Source:
private ModelAndView serveDebugPage() { ModelAndView mav = new ModelAndView(" mav.addObject("environment", runtimeConfiguration.getEnvironment()); mav.addObject("siteKeys", siteSet.getSiteKeys()); mav.addObject("mappingTable", buildMappingTable()); mav.addObject("themeTable", ImmutableList.copyOf(themeGraph.describe(siteSet))); try { mav.addObject("imageCode", getResourceAsBase64("/WEB-INF/themes/root/app/wombat.jpg")); } catch (IOException e) { log.error("Error displaying root page image", e); } return mav; }

Target:
private ModelAndView serveDebugPage() { ModelAndView mav = new ModelAndView(" mav.addObject("siteKeys", siteSet.getSiteKeys()); mav.addObject("mappingTable", buildMappingTable()); mav.addObject("themeTable", ImmutableList.copyOf(themeGraph.describe(siteSet))); try { mav.addObject("imageCode", getResourceAsBase64("/WEB-INF/themes/root/app/wombat.jpg")); } catch (IOException e) { log.error("Error displaying root page image", e); } return mav; }
Source:
public boolean replace(String key, String oldValue, String newValue) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(oldValue, "'oldValue' must not be null."); Assert.notNull(newValue, "'newValue' must not be null."); Query query = new Query(Criteria.where("key").is(key)); Update update = new Update(); update.set("value", newValue); WriteResult result = template.updateFirst(query, update, Datastore.class,collectionName); return result.isUpdateOfExisting(); }

Target:
public boolean replace(String key, String oldValue, String newValue) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(oldValue, "'oldValue' must not be null."); Assert.notNull(newValue, "'newValue' must not be null."); Query query = new Query(Criteria.where(ID_FIELD).is(key).and(VALUE).is(oldValue)); return template.updateFirst(query, Update.update(VALUE, newValue), collectionName) .isUpdateOfExisting(); }
Source:
protected Object getReply(ResponseEntity<?> httpResponse) { if (this.expectReply) { HttpHeaders httpHeaders = httpResponse.getHeaders(); Map<String, Object> headers = this.headerMapper.toHeaders(httpHeaders); if (this.transferCookies) { this.doConvertSetCookie(headers); } AbstractIntegrationMessageBuilder<?> replyBuilder = null; if (httpResponse.hasBody()) { Object responseBody = httpResponse.getBody(); replyBuilder = (responseBody instanceof Message<?>) ? this.getMessageBuilderFactory().fromMessage((Message<?>) responseBody) : this.getMessageBuilderFactory().withPayload(responseBody); } else { replyBuilder = this.getMessageBuilderFactory().withPayload(httpResponse); } replyBuilder.setHeader(org.springframework.integration.http.HttpHeaders.STATUS_CODE, httpResponse.getStatusCode()); return replyBuilder.copyHeaders(headers).build(); } return null; }

Target:
protected Object getReply(ResponseEntity<?> httpResponse) { if (this.expectReply) { HttpHeaders httpHeaders = httpResponse.getHeaders(); Map<String, Object> headers = this.headerMapper.toHeaders(httpHeaders); if (this.transferCookies) { this.doConvertSetCookie(headers); } AbstractIntegrationMessageBuilder<?> replyBuilder = null; if (httpResponse.hasBody()) { Object responseBody = httpResponse.getBody(); replyBuilder = (responseBody instanceof Message<?>) ? this.getMessageBuilderFactory().fromMessage((Message<?>) responseBody) : this.getMessageBuilderFactory().withPayload(responseBody); } else { replyBuilder = this.getMessageBuilderFactory().withPayload(httpResponse); } replyBuilder.setHeader(org.springframework.integration.http.HttpHeaders.STATUS_CODE, httpResponse.getStatusCode()); return replyBuilder.copyHeaders(headers); } return null; }
Source:
public void testBuildCoordinatorStreamConfigWithJobName() { Map<String, String> mapConfig = new HashMap<>(); mapConfig.put("job.name", "testName"); mapConfig.put("job.id", "testId"); mapConfig.put("job.coordinator.system", "testSamza"); mapConfig.put("test.only", "nothing"); mapConfig.put("systems.testSamza.test", "test"); Config config = factory.buildCoordinatorStreamConfig(new MapConfig(mapConfig)); assertEquals(config.get("systems.testSamza.test"), "test"); assertEquals(config.get(JobConfig.JOB_NAME), "testName"); assertNull(config.get("test.only")); }

Target:
public void testBuildCoordinatorStreamConfigWithJobName() { Map<String, String> mapConfig = new HashMap<>(); mapConfig.put("job.name", "testName"); mapConfig.put("job.id", "testId"); mapConfig.put("job.coordinator.system", "testSamza"); mapConfig.put("test.only", "nothing"); mapConfig.put("systems.testSamza.test", "test"); Config config = factory.buildCoordinatorStreamConfig(new MapConfig(mapConfig)); Map<String, String> expectedMap = new HashMap<>(); expectedMap.put("job.name", "testName"); expectedMap.put("job.id", "testId"); expectedMap.put("systems.testSamza.test", "test"); expectedMap.put(JobConfig.JOB_COORDINATOR_SYSTEM, "testSamza"); expectedMap.put(JobConfig.MONITOR_PARTITION_CHANGE_FREQUENCY_MS, "300000"); assertEquals(config, new MapConfig(expectedMap)); }
Source:
public Builder initialData(Realm.Transaction transaction) { if (readOnly) { throw new IllegalStateException("This Realm is marked as read-only. Read-only Realms cannot use initialData(Realm.Transaction)."); } initialDataTransaction = transaction; return this; }

Target:
public Builder initialData(Realm.Transaction transaction) { initialDataTransaction = transaction; return this; }
Source:
public String toString() { return com.google.common.base.Objects.toStringHelper(this) .add("super", super.toString()) .add("application", m_application) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("m_application", m_application) .toString(); }
Source:
public void collectionWithSameJobNameShouldTakeHighestJobNumber() throws Exception { List<BuildResult> results = new ArrayList<BuildResult>(); results.add(new BuildResult(0, "", BuildStatus.STARTED, 1, "SameJob")); results.add(new BuildResult(1, "", BuildStatus.STARTED, 1, "SameJob")); TaskBuildStatusMapper mapper = new TaskBuildStatusMapper(results); TaskAttribute root = createRootAttribute(); mapper.applyTo(root); assertEquals(1, root.getAttributes().size()); assertNotNull(root.getAttribute("BUILD_RESULT-0")); int buildNumber = Integer.parseInt(root.getAttribute("BUILD_RESULT-0").getAttribute("NUMBER").getValue()); assertEquals(1, buildNumber); }

Target:
public void collectionWithSameJobNameShouldTakeHighestJobNumber() throws Exception { List<BuildResult> results = new ArrayList<BuildResult>(); final String HUDSON_BUILD_URL = "<LINK_0>"; final String JOB_NAME = "SameJob"; results.add(new BuildResult(0, HUDSON_BUILD_URL, BuildStatus.STARTED, 1, JOB_NAME)); results.add(new BuildResult(1, HUDSON_BUILD_URL, BuildStatus.STARTED, 1, JOB_NAME)); TaskBuildStatusMapper mapper = new TaskBuildStatusMapper(results); TaskAttribute root = createRootAttribute(); mapper.applyTo(root); assertEquals(1, root.getAttributes().size()); assertNotNull(root.getAttribute("BUILD_RESULT-0")); TaskAttribute taskAttribute = root.getAttribute("BUILD_RESULT-0"); int buildNumber = Integer.parseInt(taskAttribute.getAttribute("NUMBER").getValue()); assertEquals(1, buildNumber); assertEquals(taskAttribute.getAttribute("JOB"), JOB_NAME); assertEquals(taskAttribute.getAttribute("URL"), HUDSON_BUILD_URL); }
Source:
private static String unquote(String eTag) { if (eTag.startsWith("\"") && eTag.endsWith("\"")) { eTag = eTag.substring(1, eTag.length() - 1); } return eTag; }

Target:
static String unquote(String eTag) { return QUOTED_STRING.matcher(eTag).replaceAll("$1"); }
Source:
public Iterable<Icon> getProjectIcons(String project) { List<Icon> icons = Lists.newArrayList(); for (ProjectCustomIcon customIcon : projectIcons) { for (CustomIconInfo icon : customIcon.getIcons(project)) { icons.add(new Icon(icon.name, icon.path)); } } return icons; }

Target:
public Iterable<CustomIconInfo> getProjectIcons(String project) { List<CustomIconInfo> icons = Lists.newArrayList(); for (ProjectCustomIcon customIcon : projectIcons) { for (CustomIconInfo icon : customIcon.getIcons(project)) { icons.add(icon); } } return icons; }
Source:
public void dispose() { historyPage.removePropertyChangeListener(this); if (dialog != null) dialog.close(); }

Target:
public void dispose() { historyPage.removePropertyChangeListener(this); if (dialog != null) { dialog.close(); } }
Source:
public View getView(int pos, View convertView, ViewGroup parent) { if (convertView == null) { convertView = getLayoutInflater().inflate(R.layout.item_usercontribs_entry, parent, false); } TextView titleText = (TextView) convertView.findViewById(R.id.user_contrib_item_page_name); TextView summaryText = (TextView) convertView.findViewById(R.id.user_contrib_item_edit_summary); TextView timeAgoText = (TextView) convertView.findViewById(R.id.user_contrib_item_time_ago); PageHistoryItem item = (PageHistoryItem) getItem(pos); titleText.setText(item.getTitle().getDisplayText()); summaryText.setText(Html.fromHtml(item.getSummary())); timeAgoText.setText(Utils.formatDateRelative(item.getTimestamp())); if (summaryText.getText().length() == 0) { summaryText.setVisibility(View.GONE); } else { summaryText.setVisibility(View.VISIBLE); } return convertView; }

Target:
public View getView(int pos, View convertView, ViewGroup parent) { if (convertView == null) { convertView = getLayoutInflater().inflate(R.layout.item_usercontribs_entry, parent, false); } TextView titleText = (TextView) convertView.findViewById(R.id.user_contrib_item_page_name); TextView summaryText = (TextView) convertView.findViewById(R.id.user_contrib_item_edit_summary); TextView timeAgoText = (TextView) convertView.findViewById(R.id.user_contrib_item_time_ago); PageHistoryItem item = (PageHistoryItem) getItem(pos); titleText.setText(item.getTitle().getDisplayText()); summaryText.setText(item.getSummary()); timeAgoText.setText(Utils.formatDateRelative(item.getTimestamp())); if (summaryText.getText().length() == 0) { summaryText.setVisibility(View.GONE); } else { summaryText.setVisibility(View.VISIBLE); } return convertView; }
Source:
private List<AccountInfo> suggestAccountFullTextSearch( VisibilityControl visibilityControl) throws OrmException { String str = query.toLowerCase(); LinkedHashMap<Account.Id, AccountInfo> accountMap = Maps.newLinkedHashMap(); List<Account> fullNameMatches = Lists.newArrayList(); List<Account> emailMatches = Lists.newArrayList(); for (Account a : dbProvider.get().accounts().all()) { if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); } if (fullNameMatches.size() >= MAX_MATCHES) { break; } if (a.getPreferredEmail() != null && emailMatches.size() < MAX_MATCHES && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); } } for (Account a : fullNameMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } if (accountMap.size() < limit) { for (Account a : emailMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } } return Lists.newArrayList(accountMap.values()); }

Target:
private List<AccountInfo> suggestAccountFullTextSearch( VisibilityControl visibilityControl) throws OrmException { String str = query.toLowerCase(); LinkedHashMap<Account.Id, AccountInfo> accountMap = Maps.newLinkedHashMap(); List<Account> fullNameMatches = Lists.newArrayList(); List<Account> emailMatches = Lists.newArrayList(); for (Account a : dbProvider.get().accounts().all()) { if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); }else if (a.getPreferredEmail() != null && emailMatches.size() < MAX_MATCHES && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); } if (fullNameMatches.size() >= MAX_MATCHES) { break; } } for (Account a : fullNameMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } if (accountMap.size() < limit) { for (Account a : emailMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } } return Lists.newArrayList(accountMap.values()); }
Source:
public int hashCode() { return getRepositoryName() != null ? getRepositoryName().hashCode() : System.identityHashCode(this); }

Target:
public int hashCode() { if (getRepositoryName() != null) return getRepositoryName().hashCode(); return System.identityHashCode(this); }
Source:
protected boolean validate() { if (!(getSourceVmFromDb().getStatus() == VMStatus.Suspended || getSourceVmFromDb().isDown())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN); } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(diskImagesFromConfiguration); validate(diskImagesValidator.diskImagesNotIllegal()); return super.validate(); }

Target:
protected boolean validate() { if (!(getSourceVmFromDb().getStatus() == VMStatus.Suspended || getSourceVmFromDb().isDown())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN); } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(diskImagesFromConfiguration); if (!validate(diskImagesValidator.diskImagesNotIllegal())) { return false; } return super.validate(); }
Source:
protected List<VmDevice> getRngDevices() { return getVmDeviceDao().getVmDeviceByVmIdAndType(getParameters().getRngDevice().getVmId(), VmDeviceGeneralType.RNG); }

Target:
protected List<VmDevice> getRngDevices() { return cachedRngDevices; }
Source:
private List<DeepLinkAnnotatedElement> generateCustomDeepLinkAnnotatedElements(Element element, DeepLinkEntry.Type type, Map<Element, String[]> prefixesMap) { List<DeepLinkAnnotatedElement> deepLinkElements = new ArrayList<>(); Set<? extends AnnotationMirror> annotationMirrors = AnnotationMirrors.getAnnotatedAnnotations(element, DEEP_LINK_SPEC_CLASS); for (AnnotationMirror customAnnotation : annotationMirrors) { List<? extends AnnotationValue> suffixes = asAnnotationValues(AnnotationMirrors.getAnnotationValue(customAnnotation, "value")); String[] prefixesArray = prefixesMap.get(customAnnotation.getAnnotationType().asElement()); try { for (AnnotationValue suffix : suffixes) { deepLinkElements.add(new DeepLinkAnnotatedElement(suffix.getValue().toString(), element, type, prefixesArray)); } } catch (MalformedURLException e) { e.printStackTrace(); } } return deepLinkElements; }

Target:
private List<DeepLinkAnnotatedElement> generateCustomDeepLinkAnnotatedElements(Element element, DeepLinkEntry.Type type, Map<Element, String[]> prefixesMap) { List<DeepLinkAnnotatedElement> deepLinkElements = new ArrayList<>(); Set<? extends AnnotationMirror> annotationMirrors = AnnotationMirrors.getAnnotatedAnnotations(element, DEEP_LINK_SPEC_CLASS); for (AnnotationMirror customAnnotation : annotationMirrors) { List<? extends AnnotationValue> suffixes = asAnnotationValues(AnnotationMirrors.getAnnotationValue(customAnnotation, "value")); String[] prefixesArray = prefixesMap.get(customAnnotation.getAnnotationType().asElement()); for (AnnotationValue suffix : suffixes) { try { deepLinkElements.add(new DeepLinkAnnotatedElement(suffix.getValue().toString(), element, type, prefixesArray)); } catch (MalformedURLException e) { messager.printMessage(Diagnostic.Kind.ERROR, "Malformed Deep Link URL " + suffix.getValue()); } } } return deepLinkElements; }
Source:
private String getYearFromStudy(final int studyIdentifier) { return this.studyDataManager.getProjectStartDateByProjectId(studyIdentifier).substring(0, 4); }

Target:
String getYearFromStudy(final int studyIdentifier) { final String startDate = this.studyDataManager.getProjectStartDateByProjectId(studyIdentifier); if(startDate != null) { return startDate.substring(0, 4); } return startDate; }
Source:
T get() { try { return this.future.get(); } catch (Exception e) { e.printStackTrace(); Assert.fail("Exception occured in operation: " + getOperationName() + ", exception: " + e); return null; } }

Target:
T get() throws Exception { try { return future.get(AWAIT_TIMEOUT, TimeUnit.SECONDS); } catch (Exception e) { throw new Exception("Exception occured in operation: " + getOperationName(), e); } }
Source:
public void testListenInvalidPort() { final int port = 9090; final HttpServer httpServer = vertx.createHttpServer(); httpServer.requestHandler(r -> {}).listen(port, httpResult -> { server.close(); server = vertx.createNetServer(new NetServerOptions().setPort(port)); server.connectHandler((netSocket) -> { }).listen(ar -> { if(httpResult.succeeded()) { httpServer.close(); } assertTrue(ar.failed()); assertFalse(ar.succeeded()); assertNotNull(ar.cause()); testComplete(); }); }); await(); }

Target:
public void testListenInvalidPort() { final int port = 9090; final HttpServer httpServer = vertx.createHttpServer(); try { httpServer.requestHandler(ignore -> {}) .listen(port, onSuccess(s -> vertx.createNetServer() .connectHandler(ignore -> {}) .listen(port, onFailure(error -> { assertNotNull(error); testComplete(); })))); await(); } finally { httpServer.close(); } }
Source:
public void close() throws IOException { LOG.info("Processing remaining requests [docs = " + bulkDocs + ", length = " + bulkLength + ", total docs = " + indexedDocs + "]"); createNewBulk = false; commit(); LOG.info("Processing to finalize last execute"); createNewBulk = false; commit(); client.shutdownClient(); }

Target:
public void close() throws IOException { LOG.info( "Processing remaining requests [docs = {}, length = {}, total docs = {}]", bulkDocs, bulkLength, indexedDocs); createNewBulk = false; commit(); LOG.info("Processing to finalize last execute"); createNewBulk = false; commit(); client.shutdownClient(); }
Source:
public String toString() { return "bytes=" + start + "-" + end; }

Target:
public String toString() { String endString = Objects.toString(end); return "bytes=" + String.valueOf(start) + "-" + endString; }
Source:
public void preprocess(DataSetLookup lookup) { if (identityProvider == null) { return; } boolean hasBusinessAdminRights = identityProvider.getRoles().stream().filter(s -> s.equals(ADMIN_GROUP)).findFirst().isPresent(); if (!hasBusinessAdminRights) { hasBusinessAdminRights = ADMIN_USER.equals(identityProvider.getName()); } if (hasBusinessAdminRights) { return; } final ColumnFilter columnFilter = equalsTo(COLUMN_TASKID, -1); LOGGER.debug("Adding column filter: {}", columnFilter); if (lookup.getFirstFilterOp() != null) { lookup.getFirstFilterOp().addFilterColumn(columnFilter); } else { DataSetFilter filter = new DataSetFilter(); filter.addFilterColumn(columnFilter); lookup.addOperation(filter); } }

Target:
public void preprocess(DataSetLookup lookup) { if (identityProvider == null) { return; } if (ADMIN_USER.equals(identityProvider.getName()) || identityProvider.getRoles().stream().filter(s -> s.equals(ADMIN_GROUP)).findFirst().isPresent()) { return; } final ColumnFilter columnFilter = equalsTo(COLUMN_TASKID, -1); LOGGER.debug("Adding column filter: {}", columnFilter); if (lookup.getFirstFilterOp() != null) { lookup.getFirstFilterOp().addFilterColumn(columnFilter); } else { DataSetFilter filter = new DataSetFilter(); filter.addFilterColumn(columnFilter); lookup.addOperation(filter); } }
Source:
public int hashCode() { return toString().hashCode(); }

Target:
public int hashCode() { return commit.hashCode() ^ blob.hashCode(); }
Source:
private void configureMappingRouter(AbstractMappingMessageRouter router) { if (this.channelMappings != null) { router.setChannelMappings(this.channelMappings); } if (this.resolutionRequired != null) { router.setResolutionRequired(this.resolutionRequired); } else { router.setResolutionRequired(true); } if (this.channelResolver != null) { logger.warn("'channel-resolver' attribute has been deprecated in favor of using SpEL via 'expression' attribute"); router.setChannelResolver(this.channelResolver); } }

Target:
private void configureMappingRouter(AbstractMappingMessageRouter router) { if (this.channelMappings != null) { router.setChannelMappings(this.channelMappings); } if (this.resolutionRequired != null) { router.setResolutionRequired(this.resolutionRequired); } if (this.channelResolver != null) { logger.warn("'channel-resolver' attribute has been deprecated in favor of using SpEL via 'expression' attribute"); router.setChannelResolver(this.channelResolver); } }
Source:
protected void onCreate(final Bundle savedInstanceState) { assureCorrectAppLanguage(this); super.onCreate(savedInstanceState); ThemeHelper.setTheme(this); this.setTitle(getString(R.string.title_activity_about)); setContentView(R.layout.activity_about); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mViewPager = findViewById(R.id.container); Configuration config = getResources().getConfiguration(); boolean isRTL = config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager(), isRTL); mViewPager.setAdapter(mSectionsPagerAdapter); TabLayout tabLayout = findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); if (isRTL) { tabLayout.getTabAt(mSectionsPagerAdapter.getCount() - 1).select(); } }

Target:
protected void onCreate(final Bundle savedInstanceState) { assureCorrectAppLanguage(this); super.onCreate(savedInstanceState); ThemeHelper.setTheme(this); this.setTitle(getString(R.string.title_activity_about)); setContentView(R.layout.activity_about); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mViewPager = findViewById(R.id.container); boolean isRTL = LocalizeLayoutUtils.isRTL(this); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager(), isRTL); mViewPager.setAdapter(mSectionsPagerAdapter); TabLayout tabLayout = findViewById(R.id.tabs); tabLayout.setupWithViewPager(mViewPager); if (isRTL) { tabLayout.getTabAt(mSectionsPagerAdapter.getCount() - 1).select(); } }
Source:
private Table getTable(String eventName, String className) throws Exception { Table tmp; try { tmp = client.getTable(database, eventName); } catch (HiveException e) { tmp = createTable(eventName, className); } return tmp; }

Target:
private Table getTable(String eventName, String className) throws Exception { Table tmp = null; try { tmp = client.getTable(database, eventName, false); if(tmp == null) { tmp = createTable(eventName, className); } } catch (HiveException e) { LOG.warn("Exception thrown while creating the table", e); } return tmp; }
Source:
public final void visitBinaryExpression(BinaryExpressionTree tree) { if (tree.is(Tree.Kind.CONDITIONAL_AND)) { evaluateConditionalAnd(tree); } else if (tree.is(Tree.Kind.CONDITIONAL_OR)) { evaluateConditionalOr(tree); } else if (tree.is(Tree.Kind.EQUAL_TO)) { evaluateRelationalOperator(tree, SymbolicRelation.EQUAL_TO); } else if (tree.is(Tree.Kind.GREATER_THAN)) { evaluateRelationalOperator(tree, SymbolicRelation.GREATER_THAN); } else if (tree.is(Tree.Kind.GREATER_THAN_OR_EQUAL_TO)) { evaluateRelationalOperator(tree, SymbolicRelation.GREATER_EQUAL); } else if (tree.is(Tree.Kind.LESS_THAN)) { evaluateRelationalOperator(tree, SymbolicRelation.LESS_THAN); } else if (tree.is(Tree.Kind.LESS_THAN_OR_EQUAL_TO)) { evaluateRelationalOperator(tree, SymbolicRelation.LESS_EQUAL); } else if (tree.is(Tree.Kind.NOT_EQUAL_TO)) { evaluateRelationalOperator(tree, SymbolicRelation.NOT_EQUAL); } else { super.visitBinaryExpression(tree); for (ExecutionState executionState : currentStates) { executionState.pop(); executionState.pop(); executionState.push(createSymbolicInstanceValue()); } } }

Target:
public final void visitBinaryExpression(BinaryExpressionTree tree) { Tree.Kind kind = ((JavaTree) tree).getKind(); SymbolicRelation relation = OPERATOR_TO_RELATION.get(kind); if (relation != null) { evaluateRelationalOperator(tree, relation); } else { switch (kind) { case CONDITIONAL_AND: evaluateConditionalAnd(tree); break; case CONDITIONAL_OR: evaluateConditionalOr(tree); break; default: evaluateBinaryExpressionOther(tree); break; } } }
Source:
public void treatFailedCachedActionAsCacheMiss_remote() throws Exception { options.remoteAcceptCached = true; options.remoteLocalFallback = false; options.remoteUploadLocalResults = true; options.remoteResultCachePriority = 1; options.remoteExecutionPriority = 2; ActionResult failedAction = ActionResult.newBuilder().setExitCode(1).build(); when(cache.getCachedActionResult(any(ActionKey.class))).thenReturn(failedAction); RemoteSpawnRunner runner = new RemoteSpawnRunner( execRoot, options, Options.getDefaults(ExecutionOptions.class), new AtomicReference<>(localRunner), true, null, "build-req-id", "command-id", cache, executor, retrier, digestUtil, logDir); ExecuteResponse succeeded = ExecuteResponse.newBuilder().setResult( ActionResult.newBuilder().setExitCode(0).build()).build(); when(executor.executeRemotely(any(ExecuteRequest.class))).thenReturn(succeeded); Spawn spawn = new SimpleSpawn( new FakeOwner("foo", "bar"), ImmutableList.of(), ImmutableMap.of(), NO_CACHE, ImmutableList.of(), ImmutableList.<ActionInput>of(), ResourceSet.ZERO); SpawnExecutionContext policy = new FakeSpawnExecutionContext(spawn); runner.exec(spawn, policy); ArgumentCaptor<ExecuteRequest> requestCaptor = ArgumentCaptor.forClass(ExecuteRequest.class); verify(executor).executeRemotely(requestCaptor.capture()); assertThat(requestCaptor.getValue().getSkipCacheLookup()).isTrue(); assertThat(requestCaptor.getValue().getResultsCachePolicy().getPriority()).isEqualTo(1); assertThat(requestCaptor.getValue().getExecutionPolicy().getPriority()).isEqualTo(2); }

Target:
public void treatFailedCachedActionAsCacheMiss_remote() throws Exception { ActionResult failedAction = ActionResult.newBuilder().setExitCode(1).build(); when(cache.getCachedActionResult(any(ActionKey.class))).thenReturn(failedAction); RemoteSpawnRunner runner = new RemoteSpawnRunner( execRoot, options, Options.getDefaults(ExecutionOptions.class), new AtomicReference<>(localRunner), true, null, "build-req-id", "command-id", cache, executor, retrier, digestUtil, logDir); ExecuteResponse succeeded = ExecuteResponse.newBuilder().setResult( ActionResult.newBuilder().setExitCode(0).build()).build(); when(executor.executeRemotely(any(ExecuteRequest.class))).thenReturn(succeeded); Spawn spawn = newSimpleSpawn(); SpawnExecutionContext policy = new FakeSpawnExecutionContext(spawn); runner.exec(spawn, policy); ArgumentCaptor<ExecuteRequest> requestCaptor = ArgumentCaptor.forClass(ExecuteRequest.class); verify(executor).executeRemotely(requestCaptor.capture()); assertThat(requestCaptor.getValue().getSkipCacheLookup()).isTrue(); }
Source:
private void configureManagementNetwork() { final NetworkConfigurator networkConfigurator = new NetworkConfigurator(getVds()); if (networkConfigurator.awaitVdsmResponse()) { try { networkConfigurator.refreshNetworkConfiguration(); networkConfigurator.createManagementNetworkIfRequired(); } catch (VDSNetworkException e) { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error during communication with the host"); } catch (VdsInstallException e) { throw new VdsInstallException(VDSStatus.NonOperational, "Failed to configure manamgent network on the host"); } } else { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error during communication with the host"); } }

Target:
private void configureManagementNetwork() { final NetworkConfigurator networkConfigurator = new NetworkConfigurator(getVds()); if (!networkConfigurator.awaitVdsmResponse()) { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error during communication with the host"); } try { networkConfigurator.refreshNetworkConfiguration(); networkConfigurator.createManagementNetworkIfRequired(); } catch (VDSNetworkException e) { throw new VdsInstallException(VDSStatus.NonResponsive, "Network error during communication with the host", e); } catch (Exception e) { throw new VdsInstallException(VDSStatus.NonOperational, "Failed to configure manamgent network on the host", e); } }
Source:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {LocalDateTime.now().truncatedTo(ChronoUnit.MICROS), "timestamp_without_time_zone_column", "'2003-01-01'::TIMESTAMP"}, {OffsetDateTime.now().withOffsetSameInstant(ZoneOffset.UTC).truncatedTo(ChronoUnit.MICROS), "timestamp_with_time_zone_column", "'2007-06-03'::TIMESTAMP"}, {LocalDate.now(), "date_column", "'2003-01-01'::DATE"}, {LocalTime.now().truncatedTo(ChronoUnit.MICROS), "time_without_time_zone_column", "'07:23'::TIME WITHOUT TIME ZONE"} }); }

Target:
public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {LocalDateTime.of(2017, 1, 2, 3, 4, 5, 6000).truncatedTo(ChronoUnit.MICROS), LocalDateTime.class, "timestamp_without_time_zone_column", "'2003-01-01'::TIMESTAMP"}, {OffsetDateTime.of(2017, 1, 2, 3, 4, 5, 6000, ZoneOffset.UTC).truncatedTo(ChronoUnit.MICROS), OffsetDateTime.class, "timestamp_with_time_zone_column", "'2007-06-03'::TIMESTAMP"}, {LocalDate.of(2017, 1, 2), LocalDate.class, "date_column", "'2003-01-01'::DATE"}, {LocalTime.of(11, 12, 13).truncatedTo(ChronoUnit.MICROS), LocalTime.class, "time_without_time_zone_column", "'07:23'::TIME WITHOUT TIME ZONE"}, {null, LocalDateTime.class, "timestamp_without_time_zone_column", "'2003-01-01'::TIMESTAMP"}, {null, OffsetDateTime.class, "timestamp_with_time_zone_column", "'2007-06-03'::TIMESTAMP"}, {null, LocalDate.class, "date_column", "'2003-01-01'::DATE"}, {null, LocalTime.class, "time_without_time_zone_column", "'07:23'::TIME WITHOUT TIME ZONE"} }); }
Source:
public void shouldCreate_withItemWithNullProperty() { final ItemId itemId = new ItemId(randomId()); final StubItem stubItem = generateRandomStubItem(itemId); stubItem.setStringProperty2(null); final ItemConfiguration itemConfiguration = new ItemConfiguration(StubItem.class, tableName); final Collection<ItemConfiguration> itemConfigurations = Arrays.asList(itemConfiguration); when(mockDatabaseSchemaHolder.itemConfigurations()).thenReturn(itemConfigurations); final Table mockTable = mock(Table.class); when(mockDynamoDBClient.getTable(any(String.class))).thenReturn(mockTable); final DynamoDocumentStoreTemplate dynamoDocumentStoreTemplate = new DynamoDocumentStoreTemplate( mockDatabaseSchemaHolder); dynamoDocumentStoreTemplate.initialize(mockAmazonDynamoDbClient); final Item mockTableItem = mock(Item.class); when(mockTableItem.toJSON()).thenReturn(dynamoDocumentStoreTemplate.itemToString(stubItem)); dynamoDocumentStoreTemplate.create(stubItem); final ArgumentCaptor<PutItemSpec> getItemRequestCaptor = ArgumentCaptor.forClass(PutItemSpec.class); verify(mockTable).putItem(getItemRequestCaptor.capture()); final PutItemSpec spec = getItemRequestCaptor.getValue(); assertFalse(spec.getItem().isNull("stringProperty2")); }

Target:
public void shouldCreate_withItemWithNullProperty() { final ItemId itemId = new ItemId(randomId()); final StubItem stubItem = generateRandomStubItem(itemId); stubItem.setStringProperty2(null); final ItemConfiguration itemConfiguration = new ItemConfiguration(StubItem.class, tableName); final Collection<ItemConfiguration> itemConfigurations = Arrays.asList(itemConfiguration); when(mockDatabaseSchemaHolder.itemConfigurations()).thenReturn(itemConfigurations); final Table mockTable = mock(Table.class); when(mockDynamoDBClient.getTable(any(String.class))).thenReturn(mockTable); final DynamoDocumentStoreTemplate dynamoDocumentStoreTemplate = new DynamoDocumentStoreTemplate( mockDatabaseSchemaHolder); dynamoDocumentStoreTemplate.initialize(mockAmazonDynamoDbClient); final Item mockTableItem = mock(Item.class); when(mockTableItem.toJSON()).thenReturn(dynamoDocumentStoreTemplate.itemToString(stubItem)); dynamoDocumentStoreTemplate.create(stubItem); final ArgumentCaptor<PutItemSpec> getItemRequestCaptor = ArgumentCaptor.forClass(PutItemSpec.class); verify(mockTable).putItem(getItemRequestCaptor.capture()); final PutItemSpec spec = getItemRequestCaptor.getValue(); assertFalse(spec.getItem().hasAttribute("stringProperty2")); }
Source:
public void clickCollapseExpandButtonAndWaitForPanelsToExpand() { click(collapseExpandButton); }

Target:
public void clickCollapseExpandButtonAndWaitForPanelsToExpand() { click(collapseExpandButton); waitForPanelsToExpand(); }
Source:
public IdfParserOutput parse(String experimentAccession) { try (TsvStreamer idfStreamer = idfReaderFactory.create(experimentAccession)) { parsedIdf = idfStreamer.get() .filter(line -> line.length > 1) .filter(line -> LINE_IDS.contains(line[0].trim().toUpperCase())) .collect(Collectors.toMap( line -> line[0].trim().toUpperCase(), line -> Arrays.stream(line) .skip(1) .filter(item -> !item.isEmpty()) .collect(Collectors.toList()))); String title = getParsedOutputByKey(AE_EXPERIMENT_DISPLAY_NAME_ID, getParsedOutputByKey(INVESTIGATION_TITLE_ID, Collections.emptyList())) .stream() .findFirst() .orElse(""); Map<String, String> publications = createPubMedIdToTitleMap( getParsedOutputByKey(PUBMED_ID, Collections.emptyList()), getParsedOutputByKey(PUBLICATION_TITLE_ID, Collections.emptyList())); int expectedClusters = NumberUtils.toInt(getParsedOutputByKey(EXPECTED_CLUSTERS_ID, Collections.emptyList()) .stream() .findFirst() .orElse(""), 0); return new IdfParserOutput( title, publications, expectedClusters ); } }

Target:
public IdfParserOutput parse(String experimentAccession) { try (TsvStreamer idfStreamer = idfReaderFactory.create(experimentAccession)) { parsedIdf = idfStreamer.get() .filter(line -> line.length > 1) .filter(line -> LINE_IDS.contains(line[0].trim().toUpperCase())) .collect(Collectors.toMap( line -> line[0].trim().toUpperCase(), line -> Arrays.stream(line) .skip(1) .filter(item -> !item.isEmpty()) .collect(Collectors.toList()))); String title = getParsedOutputByKey(AE_EXPERIMENT_DISPLAY_NAME_ID, getParsedOutputByKey(INVESTIGATION_TITLE_ID, Collections.emptyList())) .stream() .findFirst() .orElse(""); List<Publication> publications = createListOfPublications( getParsedOutputByKey(PUBMED_ID, Collections.emptyList()), getParsedOutputByKey(PUBLICATION_TITLE_ID, Collections.emptyList()), getParsedOutputByKey(PUBLICATION_DOI_ID, Collections.emptyList())); int expectedClusters = NumberUtils.toInt(getParsedOutputByKey(EXPECTED_CLUSTERS_ID, Collections.emptyList()) .stream() .findFirst() .orElse(""), 0); return new IdfParserOutput( title, publications, expectedClusters ); } }
Source:
private void glusterHostRemove() { boolean forceAction = false; if (isGlusterEnabled() && getVdsDAO().getAll().size() > 1 && !hasVolumeOnServer()) { String hostName = getVdsDAO().get(getParameters().getVdsId()).gethost_name(); VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((ClusterUtils.getInstance().getUpServer(getVdsGroupId())).getId(), hostName, forceAction)); setSucceeded(returnValue.getSucceeded()); if (!returnValue.getSucceeded()) { errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; } } }

Target:
private void glusterHostRemove() { boolean forceAction = false; if (isGlusterEnabled() && getVdsDAO().getAll().size() > 1 && !hasVolumeOnServer()) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((ClusterUtils.getInstance().getUpServer(getVdsGroupId())).getId(), getVds().gethost_name(), forceAction)); setSucceeded(returnValue.getSucceeded()); if (!returnValue.getSucceeded()) { errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; } } }
Source:
private PreviewWebViewClient loadWebview() { Assert.assertNotNull("Arguments can't be null at this point!", getArguments()); String siteAddress = getArguments().getString(ARG_SITE_ADDRESS); Assert.assertNotNull("Site address must be provided in the arguments!", siteAddress); String url = (siteAddress.contains("wordpress.com") ? "https://" : "http://") + siteAddress; PreviewWebViewClient client = new PreviewWebViewClient(url); mWebView.setWebViewClient(client); mWebView.loadUrl(url); return client; }

Target:
private @Nullable PreviewWebViewClient loadWebview() { String siteAddress = getArguments() != null ? getArguments().getString(ARG_SITE_ADDRESS, "") : ""; if (siteAddress.isEmpty()) { if (BuildConfig.DEBUG) { throw new IllegalStateException("The newly created site address should not be null!"); } return null; } String url = (siteAddress.contains("wordpress.com") ? "https://" : "http://") + siteAddress; PreviewWebViewClient client = new PreviewWebViewClient(url); mWebView.setWebViewClient(client); mWebView.loadUrl(url); return client; }
Source:
static void installService(OperationContext context, PathAddress pathAddress, ModelNode model) throws OperationFailedException { final String className = CODE.resolveModelAttribute(context, model).asString(); final ModuleIdentifier module = ModuleIdentifier.fromString(MODULE.resolveModelAttribute(context, model).asString()); final ServiceName serviceName = getServiceName(pathAddress); final ModelNode propsNode = model.get(PROPERTIES.getName()); final Map<String, String> properties; if (!propsNode.isDefined()) { properties = Collections.emptyMap(); } else { properties = new HashMap<>(); for (String key : propsNode.keys()) { String value = propsNode.hasDefined(key) ? propsNode.get(key).asString() : null; properties.put(key, value); } } NotificationRegistrarService.install( context.getServiceTarget(), serviceName, className, module, context.getProcessType(), context.getRunningMode(), properties); }

Target:
static void installService(OperationContext context, PathAddress pathAddress, ModelNode model) throws OperationFailedException { final String className = CODE.resolveModelAttribute(context, model).asString(); final ModuleIdentifier module = ModuleIdentifier.fromString(MODULE.resolveModelAttribute(context, model).asString()); final ServiceName serviceName = getServiceName(pathAddress); final Map<String, String> properties = PROPERTIES.unwrap(context, model); NotificationRegistrarService.install( context.getServiceTarget(), serviceName, className, module, context.getProcessType(), context.getRunningMode(), properties); }
Source:
protected SslContextFactory getSSLContext( Map args) { try { String privateKeyPassword; privateKeyPassword = Option.HTTPS_PRIVATE_KEY_PASSWORD.get(args, keystorePassword); KeyManagerFactory kmf = KeyManagerFactory.getInstance( Option.HTTPS_KEY_MANAGER_TYPE.get( args)); kmf.init(keystore, keystorePassword.toCharArray()); Logger.log(Logger.FULL_DEBUG, SSL_RESOURCES, "HttpsListener.KeyCount", keystore.size() + ""); for ( Enumeration e = keystore.aliases(); e.hasMoreElements();) { String alias = (String) e.nextElement(); Logger.log(Logger.FULL_DEBUG, SSL_RESOURCES, "HttpsListener.KeyFound", alias, keystore.getCertificate(alias) + ""); } SslContextFactory ssl = new SslContextFactory(); ssl.setKeyStore(keystore); ssl.setKeyStorePassword(keystorePassword); ssl.setKeyManagerPassword(privateKeyPassword); ssl.setKeyManagerFactoryAlgorithm(Option.HTTPS_KEY_MANAGER_TYPE.get(args)); ssl.setCertAlias(Option.HTTPS_CERTIFICATE_ALIAS.get(args)); ssl.setExcludeProtocols("SSLv3", "SSLv2", "SSLv2Hello"); String excludeCiphers = Option.HTTPS_EXCLUDE_CIPHER_SUITES.get( args ); if( StringUtil.isNotBlank(excludeCiphers)) { String[] cipherSuites = excludeCiphers.split(","); ssl.setExcludeCipherSuites(cipherSuites); } Logger.log( Logger.INFO, SSL_RESOURCES, "HttpsListener.ExcludeCiphers", Arrays.asList(ssl.getExcludeCipherSuites())); ssl.setNeedClientAuth(Option.HTTPS_VERIFY_CLIENT.get(args)); return ssl; } catch (Throwable err) { throw new WinstoneException(SSL_RESOURCES .getString("HttpsListener.ErrorGettingContext"), err); } }

Target:
protected SslContextFactory getSSLContext( Map args) { try { String privateKeyPassword; privateKeyPassword = Option.HTTPS_PRIVATE_KEY_PASSWORD.get(args, keystorePassword); KeyManagerFactory kmf = KeyManagerFactory.getInstance( Option.HTTPS_KEY_MANAGER_TYPE.get( args)); kmf.init(keystore, keystorePassword.toCharArray()); Logger.log(Logger.FULL_DEBUG, SSL_RESOURCES, "HttpsListener.KeyCount", keystore.size() + ""); for ( Enumeration e = keystore.aliases(); e.hasMoreElements();) { String alias = (String) e.nextElement(); Logger.log(Logger.FULL_DEBUG, SSL_RESOURCES, "HttpsListener.KeyFound", alias, keystore.getCertificate(alias) + ""); } SslContextFactory ssl = new SslContextFactory(); ssl.setKeyStore(keystore); ssl.setKeyStorePassword(keystorePassword); ssl.setKeyManagerPassword(privateKeyPassword); ssl.setKeyManagerFactoryAlgorithm(Option.HTTPS_KEY_MANAGER_TYPE.get(args)); ssl.setCertAlias(Option.HTTPS_CERTIFICATE_ALIAS.get(args)); ssl.setExcludeProtocols("SSLv3", "SSLv2", "SSLv2Hello"); String excludeCiphers = Option.HTTPS_EXCLUDE_CIPHER_SUITES.get(args); if(excludeCiphers!=null&&excludeCiphers.length()>0) { String[] cipherSuites = excludeCiphers.split(","); ssl.setExcludeCipherSuites(cipherSuites); } Logger.log( Logger.INFO, SSL_RESOURCES, "HttpsListener.ExcludeCiphers", Arrays.asList(ssl.getExcludeCipherSuites())); ssl.setNeedClientAuth(Option.HTTPS_VERIFY_CLIENT.get(args)); return ssl; } catch (Throwable err) { throw new WinstoneException(SSL_RESOURCES .getString("HttpsListener.ErrorGettingContext"), err); } }
Source:
public AsyncQueryForwardingServlet( @Json ObjectMapper jsonMapper, @Smile ObjectMapper smileMapper, QueryHostFinder hostFinder, @Router Provider<HttpClient> httpClientProvider, DruidHttpClientConfig httpClientConfig, ServiceEmitter emitter, RequestLogger requestLogger ) { this.jsonMapper = jsonMapper; this.smileMapper = smileMapper; this.hostFinder = hostFinder; this.httpClientProvider = httpClientProvider; this.httpClientConfig = httpClientConfig; this.emitter = emitter; this.requestLogger = requestLogger; this.broadcastClient = httpClientProvider.get(); broadcastClient.setConnectTimeout(CANCELLATION_TIMEOUT); broadcastClient.setMaxRequestsQueuedPerDestination(MAX_QUEUED_CANCELLATIONS); }

Target:
public AsyncQueryForwardingServlet( @Json ObjectMapper jsonMapper, @Smile ObjectMapper smileMapper, QueryHostFinder hostFinder, @Router Provider<HttpClient> httpClientProvider, DruidHttpClientConfig httpClientConfig, ServiceEmitter emitter, RequestLogger requestLogger ) { this.jsonMapper = jsonMapper; this.smileMapper = smileMapper; this.hostFinder = hostFinder; this.httpClientProvider = httpClientProvider; this.httpClientConfig = httpClientConfig; this.emitter = emitter; this.requestLogger = requestLogger; }
Source:
public PullFilter(String filterName, Map<String, String> parameters) { this.name = filterName; Map<String,Object> newMap =new HashMap<String,Object>(); for (Map.Entry<String, String> entry : parameters.entrySet()) { newMap.put(entry.getKey(),entry.getValue()); } setParameters(newMap); }

Target:
public PullFilter(String filterName, Map<String, String> parameters) { this.name = filterName; Map<String, String> internalParams = new HashMap<String, String>(); internalParams.putAll(parameters); this.parameters = Collections.unmodifiableMap(internalParams); }
Source:
public Iterable<Instance> listNodesByIds(final Iterable<String> ids) { return filter(listNodes(), new Predicate<Instance>() { @Override public boolean apply(Instance instance) { return contains(ids, String.valueOf(instance.instanceId())); } }); }

Target:
public Iterable<Instance> listNodesByIds(final Iterable<String> ids) { final ImmutableList.Builder<Instance> instancesBuilder = ImmutableList.builder(); for (String regionId : getAvailableLocationNames()) { instancesBuilder.addAll(api.instanceApi().list(regionId, ListInstancesOptions.Builder.instanceIds(Iterables.toArray(ids, String.class)))); } return instancesBuilder.build(); }
Source:
public void deleteDeprecatedRuleKeys() { db.executeUpdateSql("delete from deprecated_rule_keys"); DeprecatedRuleKeyDto deprecatedRuleKeyDto1 = new DeprecatedRuleKeyDto() .setUuid(uuidFactory.create()) .setOldRepositoryKey(randomAlphanumeric(50)) .setOldRuleKey(randomAlphanumeric(50)) .setRuleId(1) .setCreatedAt(1_500_000_000_000L); DeprecatedRuleKeyDto deprecatedRuleKeyDto2 = new DeprecatedRuleKeyDto() .setUuid(uuidFactory.create()) .setOldRepositoryKey(randomAlphanumeric(50)) .setOldRuleKey(randomAlphanumeric(50)) .setRuleId(2) .setCreatedAt(1_500_000_000_000L); underTest.insert(db.getSession(), deprecatedRuleKeyDto1); underTest.insert(db.getSession(), deprecatedRuleKeyDto2); assertThat(underTest.selectAllDeprecatedRuleKeys(db.getSession())).hasSize(2); underTest.deleteDeprecatedRuleKeys(db.getSession(), Arrays.asList(deprecatedRuleKeyDto1.getUuid())); assertThat(underTest.selectAllDeprecatedRuleKeys(db.getSession())).hasSize(1); }

Target:
public void deleteDeprecatedRuleKeys() { DeprecatedRuleKeyDto deprecatedRuleKeyDto1 = db.rules().insertDeprecatedKey(); db.rules().insertDeprecatedKey();; assertThat(underTest.selectAllDeprecatedRuleKeys(db.getSession())).hasSize(2); underTest.deleteDeprecatedRuleKeys(db.getSession(), singletonList(deprecatedRuleKeyDto1.getUuid())); assertThat(underTest.selectAllDeprecatedRuleKeys(db.getSession())).hasSize(1); }