auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private <M extends Metric> M metric(String name) { IgniteEx grid = grid(0); boolean isNear = ((IgniteKernal)grid).internalCache(DEFAULT_CACHE_NAME).isNear(); MetricRegistry mreg = grid.context().metric().registry(cacheMetricsRegistryName(DEFAULT_CACHE_NAME, isNear)); M histogram = mreg.findMetric(name); assertNotNull(histogram); return histogram; }

Target:
private <M extends Metric> M metric(String name) { IgniteEx grid = grid(0); boolean isNear = ((IgniteKernal)grid).internalCache(DEFAULT_CACHE_NAME).isNear(); MetricRegistry mreg = grid.context().metric().registry(cacheMetricsRegistryName(DEFAULT_CACHE_NAME, isNear)); M m = mreg.findMetric(name); assertNotNull(m); return m; }
Source:
public void run() { if (pullRetryTimeoutMs == 0L) { return; } try { Thread.sleep(pullRetryTimeoutMs); } catch (final InterruptedException e) { LOG.log(Level.FINE, "Interrupt while sleeping for retry interval"); } while (stateMachine.getCurrentState().equals(STATE_RUNNING)) { final long startTime = ticker.read(); for (final WorkerThread workerThread : threads) { final Map<K, PullRequest> pendingPullRequests = workerThread.pendingPullRequests; boolean needInterrupt = false; for (final PullRequest pullRequest : pendingPullRequests.values()) { if (needInterrupt) { pullRequest.retryIfTimeout(); } else { needInterrupt = pullRequest.retryIfTimeout(); } } if (needInterrupt) { workerThread.interruptToTriggerRetry(); } } final long elapsedTimeInMs = (long)((ticker.read() - startTime) / 1e6); if (elapsedTimeInMs < pullRetryTimeoutMs) { try { Thread.sleep(pullRetryTimeoutMs - elapsedTimeInMs); } catch (final InterruptedException e) { LOG.log(Level.FINE, "Interrupt while sleeping for retry interval"); } } } finishClose(); }

Target:
public void run() { if (pullRetryTimeoutMs == TIMEOUT_NO_RETRY) { return; } long elapsedTimeInMs = 0; while (stateMachine.getCurrentState().equals(STATE_RUNNING)) { if (elapsedTimeInMs < pullRetryTimeoutMs) { try { Thread.sleep(pullRetryTimeoutMs - elapsedTimeInMs); } catch (final InterruptedException e) { LOG.log(Level.FINE, "Interrupt while sleeping for retry interval"); } } final long startTime = ticker.read(); for (final WorkerThread workerThread : workerThreads) { final Map<K, PullRequest> pendingPullRequests = workerThread.pendingPullRequests; boolean needInterrupt = false; for (final PullRequest pullRequest : pendingPullRequests.values()) { needInterrupt |= pullRequest.requestRetryIfTimeout(); } if (needInterrupt) { workerThread.interruptToTriggerRetry(); } } elapsedTimeInMs = TimeUnit.MILLISECONDS.convert(ticker.read() - startTime, TimeUnit.NANOSECONDS); } finishClose(); }
Source:
public static int parseInt(String s, Dimension dimension) throws NumberFormatException { switch (dimension) { case NOT: case SIZE: return parseInt(s); case DURATION: try { long durationInMillis = TimeUtil.toMillis(s); if ((int) durationInMillis == durationInMillis) { return (int) durationInMillis; } throw new ArithmeticException("integer overflow"); } catch (NumberFormatException e) { return parseInt(s); } } throw new AssertionError("Unknown dimension " + dimension); }

Target:
public static int parseInt(String s, Dimension dimension) throws NumberFormatException { switch (dimension) { case NOT: case SIZE: return parseInt(s); case DURATION: long durationInMillis = TimeUtil.toMillis(s); if ((int) durationInMillis == durationInMillis) { return (int) durationInMillis; } throw new ArithmeticException("integer overflow"); } throw new AssertionError("Unknown dimension " + dimension); }
Source:
public List<SelectItem> resetSelectItems(DatasetFieldType typeIn) { List<SelectItem> retList = new ArrayList<>(); if ((typeIn.isHasParent() && typeIn.getParentDatasetFieldType().isInclude()) || (!typeIn.isHasParent() && typeIn.isInclude())) { SelectItem requiredItem = new SelectItem(); requiredItem.setLabel("Required"); requiredItem.setValue(true); retList.add(requiredItem); SelectItem optional = new SelectItem(); optional.setLabel("Optional"); optional.setValue(false); retList.add(optional); } else { SelectItem hidden = new SelectItem(); hidden.setLabel("Hidden"); hidden.setValue(false); hidden.setDisabled(true); retList.add(hidden); } return retList; }

Target:
public List<SelectItem> resetSelectItems(DatasetFieldType typeIn) { List<SelectItem> retList = new ArrayList<>(); if ((typeIn.isHasParent() && typeIn.getParentDatasetFieldType().isInclude()) || (!typeIn.isHasParent() && typeIn.isInclude())) { SelectItem requiredItem = new SelectItem(); requiredItem.setLabel(BundleUtil.getStringFromBundle("dataverse.item.required")); requiredItem.setValue(true); retList.add(requiredItem); SelectItem optional = new SelectItem(); optional.setLabel(BundleUtil.getStringFromBundle("dataverse.item.optional")); optional.setValue(false); retList.add(optional); } else { SelectItem hidden = new SelectItem(); hidden.setLabel(BundleUtil.getStringFromBundle("dataverse.item.hidden")); hidden.setValue(false); hidden.setDisabled(true); retList.add(hidden); } return retList; }
Source:
private void updateSavePageMenuItem(MenuItem menuItemSavePage) { if (refreshedIfSaved) { menuItemSavePage.setEnabled(false); menuItemSavePage.setTitle(getString(R.string.menu_page_saved)); } else if (isPageSaved) { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(getString(R.string.menu_refresh_saved_page)); } else { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(getString(R.string.menu_save_page)); } }

Target:
private void updateSavePageMenuItem(MenuItem menuItemSavePage) { if (!savedPageCheckComplete) { menuItemSavePage.setEnabled(false); } else if (refreshedIfSaved) { menuItemSavePage.setEnabled(false); menuItemSavePage.setTitle(getString(R.string.menu_page_saved)); } else if (pageSaved) { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(getString(R.string.menu_refresh_saved_page)); } else { menuItemSavePage.setEnabled(true); menuItemSavePage.setTitle(getString(R.string.menu_save_page)); } }
Source:
public void replaceQueryValues(Map<String, ?> unencoded, Map<String, Boolean> alreadyEncoded) { Iterator<Entry<String, Collection<String>>> iterator = queries.entrySet().iterator(); while (iterator.hasNext()) { Entry<String, Collection<String>> entry = iterator.next(); if (entry.getValue() == null) { continue; } Collection<String> values = new ArrayList<String>(); for (String value : entry.getValue()) { if (value.indexOf('{') == 0 && value.indexOf('}') == value.length() - 1) { Object variableValue = unencoded.get(value.substring(1, value.length() - 1)); if (variableValue == null) { continue; } if (variableValue instanceof Iterable) { for (Object val : Iterable.class.cast(variableValue)) { String encodedValue = encodeValueIfNotEncoded(entry.getKey(), val, alreadyEncoded); values.add(encodedValue); } } else { String encodedValue = encodeValueIfNotEncoded(entry.getKey(), variableValue, alreadyEncoded); values.add(encodedValue); } } else { values.add(value); } } if (values.isEmpty()) { iterator.remove(); } else { entry.setValue(values); } } }

Target:
void replaceQueryValues(Map<String, ?> unencoded, Map<String, Boolean> alreadyEncoded) { Iterator<Entry<String, Collection<String>>> iterator = queries.entrySet().iterator(); while (iterator.hasNext()) { Entry<String, Collection<String>> entry = iterator.next(); if (entry.getValue() == null) { continue; } Collection<String> values = new ArrayList<String>(); for (String value : entry.getValue()) { if (value.indexOf('{') == 0 && value.indexOf('}') == value.length() - 1) { Object variableValue = unencoded.get(value.substring(1, value.length() - 1)); if (variableValue == null) { continue; } if (variableValue instanceof Iterable) { for (Object val : Iterable.class.cast(variableValue)) { String encodedValue = encodeValueIfNotEncoded(entry.getKey(), val, alreadyEncoded); values.add(encodedValue); } } else { String encodedValue = encodeValueIfNotEncoded(entry.getKey(), variableValue, alreadyEncoded); values.add(encodedValue); } } else { values.add(value); } } if (values.isEmpty()) { iterator.remove(); } else { entry.setValue(values); } } }
Source:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_anonymous_upgrade); ButterKnife.bind(this); updateUI(); IdpResponse response = IdpResponse.fromResultIntent(getIntent()); if (response != null) { onActivityResult(RC_SIGN_IN, ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT, getIntent()); } }

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_anonymous_upgrade); ButterKnife.bind(this); updateUI(); IdpResponse response = IdpResponse.fromResultIntent(getIntent()); if (response != null) { handleSignInResult(RC_SIGN_IN, ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT, getIntent()); } }
Source:
protected void updateAccountOrContinue() { if (changedDisplayName()) { startProgress(); PushAccountSettingsPayload payload = new PushAccountSettingsPayload(); payload.params = new HashMap<>(); payload.params.put("display_name", mDisplayName); if (changedPassword()) { payload.params.put("password", mPassword); } mDispatcher.dispatch(AccountActionBuilder.newPushSettingsAction(payload)); } else if (changedPassword()) { startProgress(); PushAccountSettingsPayload payload = new PushAccountSettingsPayload(); payload.params = new HashMap<>(); payload.params.put("password", mPassword); mDispatcher.dispatch(AccountActionBuilder.newPushSettingsAction(payload)); } else if (changedUsername()) { startProgress(); PushUsernamePayload payload = new PushUsernamePayload(mUsername, AccountUsernameActionType.KEEP_OLD_SITE_AND_ADDRESS); mDispatcher.dispatch(AccountActionBuilder.newPushUsernameAction(payload)); } else if (mSignupEpilogueListener != null) { AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_EPILOGUE_UNCHANGED); mSignupEpilogueListener.onContinue(); } }

Target:
protected void updateAccountOrContinue() { if (changedDisplayName()) { startProgress(); PushAccountSettingsPayload payload = new PushAccountSettingsPayload(); payload.params = new HashMap<>(); payload.params.put("display_name", mDisplayName); if (changedPassword()) { payload.params.put("password", mInputPassword.getEditText().getText().toString()); } mDispatcher.dispatch(AccountActionBuilder.newPushSettingsAction(payload)); } else if (changedPassword()) { startProgress(); PushAccountSettingsPayload payload = new PushAccountSettingsPayload(); payload.params = new HashMap<>(); payload.params.put("password", mInputPassword.getEditText().getText().toString()); mDispatcher.dispatch(AccountActionBuilder.newPushSettingsAction(payload)); } else if (changedUsername()) { startProgress(); PushUsernamePayload payload = new PushUsernamePayload(mUsername, AccountUsernameActionType.KEEP_OLD_SITE_AND_ADDRESS); mDispatcher.dispatch(AccountActionBuilder.newPushUsernameAction(payload)); } else if (mSignupEpilogueListener != null) { AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_EPILOGUE_UNCHANGED); mSignupEpilogueListener.onContinue(); } }
Source:
public boolean addLocationInformation(final String readName, final PhysicalLocation loc){ if (!locationMap.containsKey(readName)) { final boolean b = readLocationInformation(readName, loc); if (b) { locationMap.put(readName, loc); } return b; } else { PhysicalLocation location = locationMap.get(readName); loc.setTile(location.getTile()); loc.setX(location.getX()); loc.setY(location.getY()); return true; } }

Target:
public boolean addLocationInformation(final String readName, final PhysicalLocation loc){ if (!readName.equals(readNameStored)) { if (readLocationInformation(readName, loc)) { readNameStored = readName; physicalLocationStored.setX(loc.getX()); physicalLocationStored.setY(loc.getY()); physicalLocationStored.setTile(loc.getTile()); return true; } return false; } else { loc.setTile(physicalLocationStored.getTile()); loc.setX(physicalLocationStored.getX()); loc.setY(physicalLocationStored.getY()); return true; } }
Source:
public List<VdsNetworkInterface> getNics(Guid hostId) { if (!hostIdToNics.containsKey(hostId)) { VDS host = new VDS(); host.setId(hostId); NetworkConfigurator configurator = new NetworkConfigurator(host, commandContext); hostIdToNics.put(hostId, configurator.filterBondsWithoutSlaves(interfaceDao.getAllInterfacesForVds(hostId))); } return hostIdToNics.get(hostId); }

Target:
public List<VdsNetworkInterface> getNics(Guid hostId) { if (!hostIdToNics.containsKey(hostId)) { VDS host = new VDS(); host.setId(hostId); NetworkConfigurator configurator = new NetworkConfigurator(host, null); hostIdToNics.put(hostId, configurator.filterBondsWithoutSlaves(interfaceDao.getAllInterfacesForVds(hostId))); } return hostIdToNics.get(hostId); }
Source:
public Collection<IRemoteTest> split(int shardCountHint) { if (shardCountHint <= 1 || mIsSharded) { return null; } Collection<IRemoteTest> tests = new ArrayList<>(); for (int i = 0; i < shardCountHint; i++) { tests.add(getTestShard(shardCountHint, i)); } mIsSharded = true; return tests; }

Target:
public Collection<IRemoteTest> split(int shardCountHint) { if (shardCountHint <= 1) { return null; } Collection<IRemoteTest> tests = new ArrayList<>(); for (int i = 0; i < shardCountHint; i++) { tests.add(getTestShard(shardCountHint, i)); } return tests; }
Source:
public void editProcessTest() throws Exception { assumeTrue(!SystemUtils.IS_OS_WINDOWS && !SystemUtils.IS_OS_MAC); Pages.getProcessesPage().editProcess(); assertEquals("Header for edit process is incorrect", "createNewProcess", Pages.getProcessFromTemplatePage().getHeaderText()); }

Target:
public void editProcessTest() throws Exception { assumeTrue(!SystemUtils.IS_OS_WINDOWS && !SystemUtils.IS_OS_MAC); Pages.getProcessesPage().editProcess(); assertEquals("Header for edit process is incorrect", "Vorgang bearbeiten (First process)", Pages.getProcessEditPage().getHeaderText()); }
Source:
public FullBean processFullBean(FullBean fullBean){ if(manifestAddUrl==null || manifestAddUrl.equals(Boolean.FALSE)){ WebMetaInfo.injectWebMetaInfoBatch(fullBean, mongoServer, false, api2BaseUrl); } else { WebMetaInfo.injectWebMetaInfoBatch(fullBean, mongoServer, true, api2BaseUrl); } if ((fullBean.getAggregations() != null && !fullBean.getAggregations().isEmpty())) { ((FullBeanImpl) fullBean).setAsParent(); for (Aggregation agg : fullBean.getAggregations()) { if (agg.getWebResources() != null && !agg.getWebResources().isEmpty()) { for (WebResourceImpl wRes : (List<WebResourceImpl>) agg.getWebResources()) { wRes.initAttributionSnippet(); } } } } return fullBean; }

Target:
public FullBean processFullBean(FullBean fullBean){ WebMetaInfo.injectWebMetaInfoBatch(fullBean, mongoServer, manifestAddUrl, api2BaseUrl); if ((fullBean.getAggregations() != null && !fullBean.getAggregations().isEmpty())) { ((FullBeanImpl) fullBean).setAsParent(); for (Aggregation agg : fullBean.getAggregations()) { if (agg.getWebResources() != null && !agg.getWebResources().isEmpty()) { for (WebResourceImpl wRes : (List<WebResourceImpl>) agg.getWebResources()) { wRes.initAttributionSnippet(); } } } } return fullBean; }
Source:
private String getStrongboxHome() { final String strongboxHome = ensureAbsolute(environment.getRequiredProperty("strongbox.home")); return strongboxHome.endsWith("/") ? strongboxHome : strongboxHome + "/"; }

Target:
private String getStrongboxHome() { final String strongboxHome = ensureParentOrCurrentDirAbsolute(environment.getRequiredProperty("strongbox.home")); return strongboxHome.endsWith("/") ? strongboxHome : strongboxHome + "/"; }
Source:
private static boolean isFileBeginning(int line, int column, boolean hasBOM) { if (line == 1) { return column > (hasBOM ? 1 : 0); } return true; }

Target:
private static boolean isFileBeginning(int line, int column, boolean hasBOM) { if (line == 1) { return column <= (hasBOM ? 1 : 0); } return false; }
Source:
private void fireCategorySelection(String categoryName){ for(CategorySelectionObserver o : observers){ try{ o.update(this, categoryName); }catch(Exception ex){} } }

Target:
private void fireCategorySelection(String categoryName) { for (CategorySelectionObserver o : observers) { o.update(this, categoryName); } }
Source:
@Override protected Boolean run(final VisorCancelServiceTaskArg arg) { IgniteServices services = ignite.services(); String svcName = arg.getName(); Optional<ServiceDescriptor> svc = services.serviceDescriptors().stream() .filter(d -> d.name().equalsIgnoreCase(svcName)) .findFirst(); if (!svc.isPresent()) return false; try { services.cancel(svcName); } catch (IgniteException e) { IgniteLogger log = ignite.log().getLogger(VisorCancelServiceTask.class); log.warning("Error on service cance.", e); return false; } return true; }

Target:
@Override protected Boolean run(final VisorCancelServiceTaskArg arg) { IgniteServices services = ignite.services(); String svcName = arg.getName(); Optional<ServiceDescriptor> svc = services.serviceDescriptors().stream() .filter(d -> d.name().equalsIgnoreCase(svcName)) .findFirst(); if (!svc.isPresent()) return false; services.cancel(svcName); return true; }
Source:
private static FormIndex indexFromString(String stringIndex, FormDef form){ if(stringIndex == null || stringIndex.equals("None")){ return null; } else if(stringIndex.equals("<")){ return FormIndex.createBeginningOfFormIndex(); } else if(stringIndex.equals(">")){ return FormIndex.createEndOfFormIndex(); } List<Pair<Integer, Integer>> list = stepToList(stringIndex); FormIndex ret = reduceFormIndex(list, null); ret.assignRefs(form); return ret; }

Target:
public static FormIndex indexFromString(String stringIndex, FormDef form) { if (stringIndex == null || stringIndex.equals("None")) { return null; } else if (stringIndex.equals("<")) { return FormIndex.createBeginningOfFormIndex(); } else if (stringIndex.equals(">")) { return FormIndex.createEndOfFormIndex(); } List<Pair<Integer, Integer>> list = stepToList(stringIndex); FormIndex ret = reduceFormIndex(list, null); ret.assignRefs(form); return ret; }
Source:
protected boolean shouldVerify() throws IOException { byte[] lastVerifyTimeValue = scan.getAttribute(UngroupedAggregateRegionObserver.INDEX_RETRY_VERIFY); Long lastVerifyTime = lastVerifyTimeValue == null ? 0 : Bytes.toLong(lastVerifyTimeValue); if(indexRowKeyforReadRepair != null || lastVerifyTime == 0 || shouldVerifyCheckDone) { return true; } IndexToolVerificationResult verificationResultTemp = verificationResultRepository .getVerificationResult(lastVerifyTime, scan, region, indexMaintainer.getIndexTableName()) ; if(verificationResultTemp != null) { verificationResult = verificationResultTemp; } shouldVerifyCheckDone = true; return verificationResultTemp == null; }

Target:
public boolean shouldVerify() throws IOException { byte[] lastVerifyTimeValue = scan.getAttribute(UngroupedAggregateRegionObserver.INDEX_RETRY_VERIFY); Long lastVerifyTime = lastVerifyTimeValue == null ? 0 : Bytes.toLong(lastVerifyTimeValue); if(indexRowKeyforReadRepair != null || lastVerifyTime == 0 || shouldVerifyCheckDone) { return true; } IndexToolVerificationResult verificationResultTemp = verificationResultRepository .getVerificationResult(lastVerifyTime, scan, region, indexMaintainer.getIndexTableName()) ; if(verificationResultTemp != null) { verificationResult = verificationResultTemp; } shouldVerifyCheckDone = true; return verificationResultTemp == null; }
Source:
static GroupByHash createGroupByHash( Session session, List<? extends Type> hashTypes, int[] hashChannels, Optional<Integer> inputHashChannel, int expectedSize, JoinCompiler joinCompiler) { return createGroupByHash(session, hashTypes, hashChannels, inputHashChannel, expectedSize, joinCompiler, x -> true); }

Target:
static GroupByHash createGroupByHash( Session session, List<? extends Type> hashTypes, int[] hashChannels, Optional<Integer> inputHashChannel, int expectedSize, JoinCompiler joinCompiler) { return createGroupByHash(hashTypes, hashChannels, inputHashChannel, expectedSize, isDictionaryAggregationEnabled(session), joinCompiler, NOOP); }
Source:
public CurrencyAmount presentValueFromProductPresentValue( FixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, CurrencyAmount productPresentValue) { CurrencyAmount pvProduct = productPresentValue.multipliedBy(trade.getQuantity()); CurrencyAmount pvPayment = presentValuePayment(trade, provider); return pvProduct.plus(pvPayment); }

Target:
private CurrencyAmount presentValueFromProductPresentValue( FixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, CurrencyAmount productPresentValue) { CurrencyAmount pvProduct = productPresentValue.multipliedBy(trade.getQuantity()); CurrencyAmount pvPayment = presentValuePayment(trade, provider); return pvProduct.plus(pvPayment); }
Source:
public List<LogicalNodeDto> getLogicalNodes() { return Collections.unmodifiableList(logicalNodes!=null?logicalNodes:new ArrayList<>()); }

Target:
public List<LogicalNodeDto> getLogicalNodes() { return Collections.unmodifiableList(this.logicalNodes!=null?this.logicalNodes:new ArrayList<>()); }
Source:
private static String readResponse(URLConnection conn) throws IOException { conn.setReadTimeout(10000); InputStreamReader isr = new InputStreamReader(conn.getInputStream(), Const.SystemParams.ENCODING); StringBuilder sb = new StringBuilder(); try (BufferedReader rd = new BufferedReader(isr)) { String line; while ((line = rd.readLine()) != null) { sb.append(line); } } return sb.toString(); }

Target:
private static String readResponse(URLConnection conn) throws IOException { conn.setReadTimeout(10000); StringBuilder sb = new StringBuilder(); try (InputStreamReader isr = new InputStreamReader(conn.getInputStream(), Const.SystemParams.ENCODING); BufferedReader rd = new BufferedReader(isr)) { String line; while ((line = rd.readLine()) != null) { sb.append(line); } } return sb.toString(); }
Source:
private void fetchDateBannerInfo() { if (canFetchBannerInfo && unit.getType() == BlockType.PROBLEM) { courseDateViewModel = new ViewModelProvider(this, new ViewModelFactory()).get(CourseDateViewModel.class); initObserver(); courseDateViewModel.fetchCourseDatesBannerInfo(unit.getCourseId(), true); } }

Target:
private void fetchDateBannerInfo() { if (unit.getType() == BlockType.PROBLEM) { courseDateViewModel.fetchCourseDatesBannerInfo(unit.getCourseId(), true); } }
Source:
public boolean covers(TrackingToken other) { return false; }

Target:
public boolean covers(TrackingToken other) { throw new UnsupportedOperationException("ConfigTokens don't support comparing to other tokens"); }
Source:
private Set<ValidatorWrapper> validatorFactory( String attribute, List<Outer.Validator> validators) { return validators .stream() .filter(Objects::nonNull) .filter(v -> StringUtils.isNotBlank(v.validator)) .map((Outer.Validator key) -> getValidator(attribute, key)) .collect(toSet()); }

Target:
private Set<ValidatorWrapper> validatorFactory( String attribute, List<Outer.Validator> validators) { return validators .stream() .filter(Objects::nonNull) .filter(v -> StringUtils.isNotBlank(v.validator)) .map((Outer.Validator validator) -> getValidator(attribute, validator)) .collect(toSet()); }
Source:
void incrementPlanCacheHitCount() { log.tracef( "QueryStatistics - plan cache hit : %s", query ); planCacheHitCount.increment(); }

Target:
void incrementPlanCacheHitCount() { planCacheHitCount.increment(); }
Source:
public void testJsonValueFieldIsEncoded() throws Exception { MockHttpServletResponse response = getAsServletResponse(RestBaseController.ROOT_PATH + "/about/system-status.json"); assertEquals(200, response.getStatus()); assertEquals("application/json", response.getContentType()); JSONArray array = ((JSONObject) ((JSONObject) JSONSerializer.toJSON(response.getContentAsString())) .get("metrics")) .getJSONArray("metric"); assertTrue(array.size() == MetricInfo.values().length); for (int i = 0; i < array.size(); i++) { assertNotNull(array.getJSONObject(i).get("value")); } }

Target:
public void testJsonValueFieldIsEncoded() throws Exception { MockHttpServletResponse response = getAsServletResponse(RestBaseController.ROOT_PATH + "/about/system-status.json"); assertEquals(200, response.getStatus()); assertEquals("application/json", response.getContentType()); JSONArray metrics = (JSONArray) ((JSONObject) json(response)) .getJSONObject("metrics") .getJSONArray("metric"); for (int i = 0; i < metrics.size(); i++) { assertNotNull(((JSONObject) metrics.get(i)).containsKey("value")); } }
Source:
Move(final Unit unit, final Route route, final Unit transportToLoad) { this( mutableSingletonList(unit), route, new HashMap<Unit, Unit>(Map.of(unit, transportToLoad))); }

Target:
Move(final Unit unit, final Route route, final Unit transportToLoad) { this(new ArrayList<>(List.of(unit)), route, new HashMap<>(Map.of(unit, transportToLoad))); }
Source:
protected void executeCommand() { VDS spmVds = LinqUtils.first(LinqUtils.filter(getAllRunningVdssInPool(), new Predicate<VDS>() { @Override public boolean eval(VDS vds) { return vds.getSpmStatus() == VdsSpmStatus.SPM; } })); final List<LUNs> luns = getHostLuns(spmVds); final Map<String, LUNs> lunsMap = new HashMap<String, LUNs>(); for (LUNs lun : luns) { lunsMap.put(lun.getLUN_id(), lun); } final List<LUNs> processedLunsList = new ArrayList<LUNs>(); for (String lunId : getParameters().getLunIds()) { LUNs lun = lunsMap.get(lunId); if (lun == null) { handleFailure(spmVds, getDbFacade().getLunDao().get(lunId)); return; } lun.setvolume_group_id(getStorageDomain().getStorage()); processedLunsList.add(lun); } Pair<Boolean, Map<String, List<Guid>>> result = ConnectVdsToLun(processedLunsList); if (result.getFirst()) { getReturnValue().setActionReturnValue(processedLunsList); setCommandShouldBeLogged(false); setSucceeded(true); } else { Map<String, List<Guid>> processed = result.getSecond(); for (Map.Entry<String, List<Guid>> entry : processed.entrySet()) { for (Guid vdsId : entry.getValue()) { LUNs lun = lunsMap.get(entry.getKey()); StorageHelperDirector.getInstance().getItem(StorageType.ISCSI) .disconnectStorageFromLunByVdsId(getStorageDomain(), vdsId, lun); } } } }

Target:
protected void executeCommand() { VDS spmVds = LinqUtils.first(LinqUtils.filter(getAllRunningVdssInPool(), new Predicate<VDS>() { @Override public boolean eval(VDS vds) { return vds.getSpmStatus() == VdsSpmStatus.SPM; } })); final List<LUNs> luns = getHostLuns(spmVds); final Map<String, LUNs> lunsMap = new HashMap<String, LUNs>(); for (LUNs lun : luns) { lunsMap.put(lun.getLUN_id(), lun); } final List<LUNs> processedLunsList = new ArrayList<LUNs>(); for (String lunId : getParameters().getLunIds()) { LUNs lun = lunsMap.get(lunId); if (lun == null) { handleFailure(spmVds, getDbFacade().getLunDao().get(lunId)); return; } lun.setvolume_group_id(getStorageDomain().getStorage()); processedLunsList.add(lun); } Pair<Boolean, Map<String, List<Guid>>> result = ConnectVdsToLun(processedLunsList); if (result.getFirst()) { getReturnValue().setActionReturnValue(processedLunsList); setCommandShouldBeLogged(false); setSucceeded(true); } else { Map<String, List<Guid>> processed = result.getSecond(); for (Map.Entry<String, List<Guid>> entry : processed.entrySet()) { for (Guid vdsId : entry.getValue()) { LUNs lun = lunsMap.get(entry.getKey()); StorageHelperDirector.getInstance().getItem(getStoragePool().getStorageType()) .disconnectStorageFromLunByVdsId(getStorageDomain(), vdsId, lun); } } } }
Source:
public DataFileCategory getCategoryByName(String categoryName) { if (categoryName != null && !categoryName.isEmpty()) { if (dataFileCategories != null) { for (DataFileCategory dataFileCategorie : dataFileCategories) { if (categoryName.equals(dataFileCategorie.getName())) { return dataFileCategorie; } } } DataFileCategory newCategory = new DataFileCategory(); newCategory.setName(categoryName); newCategory.setDataset(this); this.addFileCategory(newCategory); return newCategory; } return null; }

Target:
public DataFileCategory getCategoryByName(String categoryName) { if (categoryName != null && !categoryName.isEmpty()) { if (dataFileCategories != null) { for (DataFileCategory dataFileCategory : dataFileCategories) { if (categoryName.equals(dataFileCategory.getName())) { return dataFileCategory; } } } DataFileCategory newCategory = new DataFileCategory(); newCategory.setName(categoryName); newCategory.setDataset(this); this.addFileCategory(newCategory); return newCategory; } return null; }
Source:
public boolean registerWorldTransfer(int newWorld) { try (Connection con = DatabaseConnection.getConnection()) { long currentTimeMillis = System.currentTimeMillis(); try (PreparedStatement ps = con.prepareStatement("SELECT completionTime FROM worldtransfers WHERE characterid=?")) { ps.setInt(1, getId()); ResultSet rs = ps.executeQuery(); while(rs.next()) { Timestamp completedTimestamp = rs.getTimestamp("completionTime"); if(completedTimestamp == null) return false; else if(completedTimestamp.getTime() + ServerConstants.WORLD_TRANSFER_COOLDOWN > currentTimeMillis) return false; } } catch(SQLException e) { e.printStackTrace(); return false; } try (PreparedStatement ps = con.prepareStatement("INSERT INTO worldtransfers (characterid, `from`, `to`) VALUES (?, ?, ?)")){ ps.setInt(1, getId()); ps.setInt(2, getWorld()); ps.setInt(3, newWorld); ps.executeUpdate(); return true; } catch (SQLException e) { e.printStackTrace(); } } catch(SQLException e) { e.printStackTrace(); } return false; }

Target:
public boolean registerWorldTransfer(int newWorld) { try (Connection con = DatabaseConnection.getConnection()) { long currentTimeMillis = System.currentTimeMillis(); try (PreparedStatement ps = con.prepareStatement("SELECT completionTime FROM worldtransfers WHERE characterid=?")) { ps.setInt(1, getId()); ResultSet rs = ps.executeQuery(); while(rs.next()) { Timestamp completedTimestamp = rs.getTimestamp("completionTime"); if(completedTimestamp == null) return false; else if(completedTimestamp.getTime() + ServerConstants.WORLD_TRANSFER_COOLDOWN > currentTimeMillis) return false; } } catch(SQLException e) { e.printStackTrace(); FilePrinter.printError(FilePrinter.WORLD_TRANSFER, e, "Failed to register world transfer for character " + getName() + "."); return false; } try (PreparedStatement ps = con.prepareStatement("INSERT INTO worldtransfers (characterid, `from`, `to`) VALUES (?, ?, ?)")){ ps.setInt(1, getId()); ps.setInt(2, getWorld()); ps.setInt(3, newWorld); ps.executeUpdate(); return true; } catch (SQLException e) { e.printStackTrace(); FilePrinter.printError(FilePrinter.WORLD_TRANSFER, e, "Failed to register world transfer for character " + getName() + "."); } } catch(SQLException e) { e.printStackTrace(); FilePrinter.printError(FilePrinter.WORLD_TRANSFER, e, "Failed to get DB connection."); } return false; }
Source:
public void edit(final NewExternalSubnetModel subnet) { driver.edit(subnet); if (subnet.getNetwork().getEntity() != null){ networkEditor.asValueBox().setValue(subnet.getNetwork().getEntity().getName()); } }

Target:
public void edit(final NewExternalSubnetModel subnet) { driver.edit(subnet); networkEditor.asValueBox().setValue(subnet.getNetwork().getEntity().getName()); }
Source:
public void prepare() throws Exception { super.init(TestUserMode.SUPER_TENANT_USER); }

Target:
public void prepare() throws XPathExpressionException { super.init(TestUserMode.SUPER_TENANT_USER); }
Source:
public void onBindViewHolder(@NonNull PatientAllergyRecyclerViewAdapter.ViewHolder holder, int position) { Allergy allergy = list.get(position); holder.allergen.setText(allergy.getAllergen().getCodedAllergen().getDisplay()); if (allergy.getComment().isEmpty()) { holder.comment.setText(ApplicationConstants.EMPTY_DASH_REPRESENTATION); } else { holder.comment.setText(allergy.getComment()); } if (allergy.getReactions().size() == 0) { holder.reaction.setText(ApplicationConstants.EMPTY_DASH_REPRESENTATION); } else { StringBuilder reactions = new StringBuilder(); for (int i = 0; i < allergy.getReactions().size() - 1; i++) { reactions.append(allergy.getReactions().get(i).getReaction().getDisplay()).append(", "); } reactions.append(allergy.getReactions().get(allergy.getReactions().size() - 1).getReaction().getDisplay()); holder.reaction.setText(reactions); } if (allergy.getSeverity() == null) { holder.severity.setText(ApplicationConstants.EMPTY_DASH_REPRESENTATION); } else { holder.severity.setText(allergy.getSeverity().getDisplay()); } }

Target:
public void onBindViewHolder(@NonNull PatientAllergyRecyclerViewAdapter.ViewHolder holder, int position) { Allergy allergy = list.get(position); holder.allergen.setText(allergy.getAllergen().getCodedAllergen().getDisplay()); if (null == allergy.getComment() || allergy.getComment().isEmpty()) { holder.comment.setText(ApplicationConstants.EMPTY_DASH_REPRESENTATION); } else { holder.comment.setText(allergy.getComment()); } if (allergy.getReactions().size() == 0) { holder.reaction.setText(ApplicationConstants.EMPTY_DASH_REPRESENTATION); } else { StringBuilder reactions = new StringBuilder(); for (int i = 0; i < allergy.getReactions().size() - 1; i++) { reactions.append(allergy.getReactions().get(i).getReaction().getDisplay()).append(ApplicationConstants.COMMA_WITH_SPACE); } reactions.append(allergy.getReactions().get(allergy.getReactions().size() - 1).getReaction().getDisplay()); holder.reaction.setText(reactions); } if (allergy.getSeverity() == null) { holder.severity.setText(ApplicationConstants.EMPTY_DASH_REPRESENTATION); } else { holder.severity.setText(allergy.getSeverity().getDisplay()); } }
Source:
public List<DatabaseEvent> getAllFailureMessages(String serviceType, Date startDate, Date endDate) { Session session = null; List<DatabaseEvent> events = null; try { final SessionFactory sessionFactory = getSessionFactory(); if (sessionFactory != null) { session = sessionFactory.openSession(); Criteria criteria = session.createCriteria(DatabaseEvent.class); criteria.add(Restrictions.eq(EVENT_TYPE_NAME, "MESSAGE_PROCESSING_FAILED")); if (startDate != null) { criteria.add(Restrictions.ge(DATE_NAME, startDate)); } if (endDate != null) { criteria.add(Restrictions.le(DATE_NAME, endDate)); } if (StringUtils.isNotBlank(serviceType)) { criteria.add(Restrictions.eq(SERVICE_TYPE, serviceType)); } } } catch (HibernateException e) { LOG.error("Exception getting failure messages caused by :{}", e.getLocalizedMessage(), e); } finally { GenericDBUtils.closeSession(session); } return events; }

Target:
public List<DatabaseEvent> getAllFailureMessages(String serviceType, Date startDate, Date endDate) { Session session = null; List<DatabaseEvent> events = null; try { final SessionFactory sessionFactory = getSessionFactory(); if (sessionFactory != null) { session = sessionFactory.openSession(); Criteria criteria = session.createCriteria(DatabaseEvent.class); criteria.add(Restrictions.eq(EVENT_TYPE_NAME, "MESSAGE_PROCESSING_FAILED")); if (startDate != null) { criteria.add(Restrictions.ge(DATE_NAME, startDate)); } if (endDate != null) { criteria.add(Restrictions.le(DATE_NAME, endDate)); } if (StringUtils.isNotBlank(serviceType)) { criteria.add(Restrictions.eq(SERVICE_TYPE, serviceType)); } events = criteria.list(); } } catch (HibernateException e) { LOG.error("Exception getting failure messages caused by :{}", e.getLocalizedMessage(), e); } finally { GenericDBUtils.closeSession(session); } return events; }
Source:
public void commit() throws IOException { close(); try { Files.move(tmpPath, destPath, StandardCopyOption.ATOMIC_MOVE); } catch (IOException e) { if (e instanceof AtomicMoveNotSupportedException) { LOGGER.log(Level.WARNING, "Atomic move not supported. falling back to non-atomic move.", e); } else { LOGGER.log(Level.WARNING, "Unable to move atomically, falling back to non-atomic move.", e); } if (destPath.toFile().exists()) { LOGGER.log(Level.INFO, "The target file {0} was already existing", destPath); } try { Files.move(tmpPath, destPath, StandardCopyOption.REPLACE_EXISTING); } catch (IOException e1) { e.addSuppressed(e1); LOGGER.log(Level.WARNING, "Unable to move {0} to {1}. Attempting to delete {0} and abandoning.", new Path[]{tmpPath, destPath}); try { Files.deleteIfExists(tmpPath); } catch (IOException e2) { e1.addSuppressed(e2); LOGGER.log(Level.WARNING, "Unable to delete {0}, good bye then!", tmpPath); throw e; } throw e; } } }

Target:
public void commit() throws IOException { close(); try { Files.move(tmpPath, destPath, StandardCopyOption.ATOMIC_MOVE); } catch (IOException moveFailed) { if (moveFailed instanceof AtomicMoveNotSupportedException) { LOGGER.log(Level.WARNING, "Atomic move not supported. falling back to non-atomic move.", moveFailed); } else { LOGGER.log(Level.WARNING, "Unable to move atomically, falling back to non-atomic move.", moveFailed); } if (destPath.toFile().exists()) { LOGGER.log(Level.INFO, "The target file {0} was already existing", destPath); } try { Files.move(tmpPath, destPath, StandardCopyOption.REPLACE_EXISTING); } catch (IOException replaceFailed) { replaceFailed.addSuppressed(moveFailed); LOGGER.log(Level.WARNING, "Unable to move {0} to {1}. Attempting to delete {0} and abandoning.", new Path[]{tmpPath, destPath}); try { Files.deleteIfExists(tmpPath); } catch (IOException deleteFailed) { replaceFailed.addSuppressed(deleteFailed); LOGGER.log(Level.WARNING, "Unable to delete {0}, good bye then!", tmpPath); throw replaceFailed; } throw replaceFailed; } } }
Source:
public NextAction handleFailure(StateExecution execution) { if (handleFailureImpl(execution)) { return moveToState(schedule, "Failure handled successfully"); } return moveToState(failed, "Requires manual fixing"); }

Target:
public NextAction handleFailure(StateExecution execution) { if (handleFailureImpl(execution)) { return moveToState(schedule, "Failure handled, rescheduling"); } return moveToState(failed, "Failure handling failed, stopping"); }
Source:
public void switchView(final ActiveScan scanner) { if (View.isInitialised() && !EventQueue.isDispatchThread()) { try { EventQueue.invokeAndWait(new Runnable() { @Override public void run() { switchView(scanner); } }); } catch (InvocationTargetException | InterruptedException e) { LOGGER.error("Failed to switch view: " + e.getMessage(), e); } return; } if (scanner != null) { getMessagesTable().setModel(scanner.getMessagesTableModel()); this.getNumRequests().setText(Integer.toString(scanner.getTotalRequests())); this.getProgressButton().setEnabled(true); if (scanner instanceof AttackScan) { this.getProgressBar().setEnabled(false); this.getProgressButton().setEnabled(false); this.getPauseScanButton().setEnabled(false); this.getStopScanButton().setEnabled(false); } } else { resetMessagesTable(); this.getNumRequests().setText(ZERO_REQUESTS_LABEL_TEXT); this.getNumNewAlerts().setText(ZERO_NEW_ALERTS_LABEL_TEXT); this.getProgressButton().setEnabled(false); } }

Target:
public void switchView(final ActiveScan scanner) { if (View.isInitialised() && !EventQueue.isDispatchThread()) { try { EventQueue.invokeAndWait(new Runnable() { @Override public void run() { switchView(scanner); } }); } catch (InvocationTargetException | InterruptedException e) { LOGGER.error("Failed to switch view: " + e.getMessage(), e); } return; } if (scanner != null) { getMessagesTable().setModel(scanner.getMessagesTableModel()); this.getNumRequests().setText(Integer.toString(scanner.getTotalRequests())); this.getNumNewAlerts().setText(Integer.toString(scanner.getTotalNewAlerts())); this.getProgressButton().setEnabled(true); if (scanner instanceof AttackScan) { this.getProgressBar().setEnabled(false); this.getProgressButton().setEnabled(false); this.getPauseScanButton().setEnabled(false); this.getStopScanButton().setEnabled(false); } } else { resetMessagesTable(); this.getNumRequests().setText(ZERO_REQUESTS_LABEL_TEXT); this.getNumNewAlerts().setText(ZERO_NEW_ALERTS_LABEL_TEXT); this.getProgressButton().setEnabled(false); } }
Source:
public static Slice serialize(OGCGeometry input) { DynamicSliceOutput sliceOutput = new DynamicSliceOutput(100); sliceOutput.appendByte(valueOf(input.geometryType()).getCode()); GeometryCursor cursor = input.getEsriGeometryCursor(); while (true) { Geometry geometry = cursor.next(); if (geometry == null) { break; } byte[] shape = geometryToEsriShape(geometry); if (input.geometryType().equals(GEOMETRY_COLLECTION)) { sliceOutput.appendInt(shape.length); } sliceOutput.appendBytes(shape); } return sliceOutput.slice(); }

Target:
public static Slice serialize(OGCGeometry input) { DynamicSliceOutput sliceOutput = new DynamicSliceOutput(100); sliceOutput.appendByte(valueOf(input.geometryType()).code()); GeometryCursor cursor = input.getEsriGeometryCursor(); boolean isGeometryCollection = input.geometryType().equals(GEOMETRY_COLLECTION); while (true) { Geometry geometry = cursor.next(); if (geometry == null) { break; } byte[] shape = geometryToEsriShape(geometry); if (isGeometryCollection) { sliceOutput.appendInt(shape.length); } sliceOutput.appendBytes(shape); } return sliceOutput.slice(); }
Source:
public void shouldRetainOrderWhenQueryingViewOrdered() { ViewQuery q = ViewQuery.from("test_beers", "by_name"); q.descending() .includeDocsOrdered(true); String prev = null; List<Beer> beers = template.findByView(q, Beer.class); for (Beer beer : beers) { if (prev != null) { assertThat(beer.getName() + " not alphabetically < to " + prev, beer.getName().compareTo(prev) < 0); } prev = beer.getName(); } }

Target:
public void shouldRetainOrderWhenQueryingViewOrdered() { ViewQuery q = ViewQuery.from("test_beers", "by_name"); q.descending().includeDocsOrdered(true); String prev = null; List<Beer> beers = template.findByView(q, Beer.class); assertTrue(q.isIncludeDocs()); assertTrue(q.isOrderRetained()); assertEquals(RawJsonDocument.class, q.includeDocsTarget()); for (Beer beer : beers) { if (prev != null) { assertThat(beer.getName() + " not alphabetically < to " + prev, beer.getName().compareTo(prev) < 0); } prev = beer.getName(); } }
Source:
public static Map<String, ObjectType> getConcreteTagTypes() { Map<String, ObjectType> tagTypes = new LinkedHashMap<>(); ObjectType.getInstance(RichTextElement.class).findConcreteTypes().forEach(type -> { String tagName = type.as(ToolUi.class).getRichTextElementTagName(); if (tagName != null && type.getObjectClass() != null) { ObjectType existingType = tagTypes.putIfAbsent(tagName, type); if (existingType != null) { LoggerFactory.getLogger(RichTextElement.class).warn(String.format( "Ignoring RichTextElement [%s] with conflicting tag name [%s] as [%s].", type.getInternalName(), tagName, existingType.getInternalName())); } } }); return tagTypes; }

Target:
public static Map<String, ObjectType> getConcreteTagTypes() { return CONCRETE_TAG_TYPES.get(); }
Source:
public List<SchematicEntry> load( Collection<String> keys ) { final TransactionStore.TransactionMap<String, Document> txContent = transactionalContent(false); final TransactionStore.TransactionMap<String, Document> actualContent = txContent != null ? txContent : persistedContent; return keys.stream() .map(actualContent::get) .filter(Objects::nonNull) .map(document -> (SchematicEntry) () -> document) .collect(Collectors.toList()); }

Target:
public List<SchematicEntry> load( Collection<String> keys ) { final TransactionStore.TransactionMap<String, Document> txContent = transactionalContent(false); final TransactionStore.TransactionMap<String, Document> actualContent = txContent != null ? txContent : persistedContent; return keys.stream() .map(actualContent::get) .filter(Objects::nonNull) .map(SchematicEntry::fromDocument) .collect(Collectors.toList()); }
Source:
public void traceOpened(TmfTraceOpenedSignal signal) { boolean signalIsForUs = false; ITmfEventProvider provider = this; while (provider != null) { if (provider == signal.getTrace()) { signalIsForUs = true; break; } provider = provider.getParent(); } if (!signalIsForUs) { return; } IStatus status = executeAnalysis(); if (!status.isOK()) { Activator.log(status); } new Thread() { @Override public void run() { TmfTraceManager.refreshSupplementaryFiles(TmfTrace.this); } }.start(); if (signal.getTrace() == this) { if (getNbEvents() == 0) { return; } if (getStreamingInterval() > 0) { return; } if (isComplete()) { final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); broadcastAsync(rangeUpdatedsignal); } return; } }

Target:
public void traceOpened(TmfTraceOpenedSignal signal) { boolean signalIsForUs = false; ITmfEventProvider provider = this; while (provider != null) { if (provider == signal.getTrace()) { signalIsForUs = true; break; } provider = provider.getParent(); } if (!signalIsForUs) { return; } IStatus status = executeAnalysis(); if (!status.isOK()) { Activator.log(status); } new Thread("Refresh supplementary files") { @Override public void run() { TmfTraceManager.refreshSupplementaryFiles(TmfTrace.this); } }.start(); if (signal.getTrace() == this) { if (getNbEvents() == 0) { return; } if (getStreamingInterval() > 0) { return; } if (isComplete()) { final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); broadcastAsync(rangeUpdatedsignal); } return; } }
Source:
public Query withContentType(String contentType) { checkNotEmpty(contentType, "contentType may not be empty."); if (hasContentTypeSet()) { throw new IllegalStateException( format("ContentType \"%s\" is already present in query.", contentType) ); } else { params.put(PARAMETER_CONTENT_TYPE, contentType); } return (Query) this; }

Target:
public Query withContentType(String contentType) { checkNotEmpty(contentType, "ContentType must not be empty."); if (hasContentTypeSet()) { throw new IllegalStateException( format("ContentType \"%s\" is already present in query.", contentType) ); } else { params.put(PARAMETER_CONTENT_TYPE, contentType); } return (Query) this; }
Source:
public void accept(final MethodNode methodNode, final MethodVisitor methodVisitor) { this.ignored.clear(); for (final IFilter filter : FILTERS) { filter.filter(methodNode, this); } for (final TryCatchBlockNode n : methodNode.tryCatchBlocks) { n.accept(methodVisitor); } for (int i = 0; i < methodNode.instructions.size(); i++) { final AbstractInsnNode instruction = methodNode.instructions.get(i); currentNode = instruction; instruction.accept(methodVisitor); } methodVisitor.visitEnd(); }

Target:
public void accept(final MethodNode methodNode, final MethodVisitor methodVisitor) { this.ignored.clear(); for (final IFilter filter : FILTERS) { filter.filter(methodNode, this); } for (final TryCatchBlockNode n : methodNode.tryCatchBlocks) { n.accept(methodVisitor); } currentNode = methodNode.instructions.getFirst(); while (currentNode != null) { currentNode.accept(methodVisitor); currentNode = currentNode.getNext(); } methodVisitor.visitEnd(); }
Source:
protected HttpHost determineProxy(HttpHost target, HttpRequest request, HttpContext context) throws HttpException { String targetHostName = target.getHostName(); HttpHost proxy = proxyMappings.getProxyFor(targetHostName); String[] proxyCredentials = proxyMappings.getProxyCredentialsFor(targetHostName); LOG.debugf("Returning proxy=%s for targetHost=%s", proxy, targetHostName); if (proxyCredentials != null && proxyCredentials.length == 2) { NTCredentials ntCreds = new NTCredentials(proxyCredentials[0], proxyCredentials[1], null, null); CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials(new AuthScope(proxy.getHostName(), proxy.getPort()), ntCreds); context.setAttribute(HttpClientContext.CREDS_PROVIDER, credsProvider); } return proxy; }

Target:
protected HttpHost determineProxy(HttpHost target, HttpRequest request, HttpContext context) throws HttpException { String targetHostName = target.getHostName(); ProxyMapping proxyMapping = proxyMappings.getProxyFor(targetHostName); LOG.debugf("Returning proxyMapping=%s for targetHost=%s", proxyMapping, targetHostName); UsernamePasswordCredentials proxyCredentials = proxyMapping.getProxyCredentials(); HttpHost proxyHost = proxyMapping.getProxyHost(); if (proxyCredentials != null) { CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials(new AuthScope(proxyHost.getHostName(), proxyHost.getPort()), proxyCredentials); context.setAttribute(HttpClientContext.CREDS_PROVIDER, credsProvider); } return proxyHost; }