auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public FormRecord process(FormRecord record) throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { String form = record.getPath(c); final File f = new File(form); final Cipher decrypter = FormUploadUtil.getDecryptCipher((new SecretKeySpec(record.getAesKey(), "AES"))); InputStream is = new CipherInputStream(new FileInputStream(f), decrypter); AndroidTransactionParserFactory factory = new AndroidTransactionParserFactory(c, null) { @Override public TransactionParser getParser(KXmlParser parser) { String namespace = parser.getNamespace(); String name = parser.getName(); if (LedgerXmlParsers.STOCK_XML_NAMESPACE.equals(namespace) || "case".equalsIgnoreCase(name)) { return super.getParser(parser); } else { return null; } } }; XmlFormRecordProcessor.process(is, factory); Intent i = new Intent("org.commcare.dalvik.api.action.data.update"); i.putStringArrayListExtra("cases", factory.getCreatedAndUpdatedCases()); c.sendBroadcast(i); FormRecord updatedRecord = updateRecordStatus(record, FormRecord.STATUS_UNSENT); if(factory.wereCaseIndexesDisrupted()) { if(isBulkProcessing) { isPurgePending = true; } else { performPurge(); } } return updatedRecord; }

Target:
public FormRecord process(FormRecord record) throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { String form = record.getPath(c); final File f = new File(form); final Cipher decrypter = FormUploadUtil.getDecryptCipher((new SecretKeySpec(record.getAesKey(), "AES"))); InputStream is = new CipherInputStream(new FileInputStream(f), decrypter); AndroidTransactionParserFactory factory = new AndroidTransactionParserFactory(c, null) { @Override public TransactionParser getParser(KXmlParser parser) { String namespace = parser.getNamespace(); String name = parser.getName(); if (LedgerXmlParsers.STOCK_XML_NAMESPACE.equals(namespace) || "case".equalsIgnoreCase(name)) { return super.getParser(parser); } else { return null; } } }; XmlFormRecordProcessor.process(is, factory); Intent i = new Intent("org.commcare.dalvik.api.action.data.update"); i.putStringArrayListExtra("cases", factory.getCreatedAndUpdatedCases()); c.sendBroadcast(i, "org.commcare.dalvik.provider.cases.read"); FormRecord updatedRecord = updateRecordStatus(record, FormRecord.STATUS_UNSENT); if(factory.wereCaseIndexesDisrupted()) { if(isBulkProcessing) { isPurgePending = true; } else { performPurge(); } } return updatedRecord; }
Source:
private void addWidget(StringBuilder sb, IAtsWorkItem workItem, IAtsWidgetDefinition widget) { if (widget.getName().equals("Role")) { addRoleWidget(sb, workItem, widget); } else if (widget.getName().equals("Review Defect")) { addDefectWidget(sb, workItem, widget); } else if (widget.getName().equals("Commit Manager")) { addCommitManager(sb, workItem, widget); } else { addWidgetDefault(sb, workItem, widget); } }

Target:
private void addWidget(StringBuilder sb, IAtsWorkItem workItem, IAtsWidgetDefinition widget) { if (widget.getName().equals(ROLE_WIDGET_NAME)) { addRoleWidget(sb, workItem, widget); } else if (widget.getName().equals(REVIEW_DEFECT_WIDGET_NAME)) { addDefectWidget(sb, workItem, widget); } else if (widget.getName().equals(COMMIT_MANAGER_WIDGET_NAME)) { addCommitManager(sb, workItem, widget); } else { addWidgetDefault(sb, workItem, widget); } }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Provider other = (Provider) obj; if (getId() == null) { if (other.getId() != null) return false; } else if (!getId().equals(other.getId())) return false; if (getUrl() == null) { if (other.getUrl() != null) return false; } else if (!getUrl().equals(other.getUrl())) return false; if (getDescription() == null) { if (other.getDescription() != null) return false; } else if (!getDescription().equals(other.getDescription())) return false; if (getName() == null) { if (other.getName() != null) return false; } else if (!getName().equals(other.getName())) return false; return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Provider)) { return false; } Provider other = (Provider) obj; if (getDescription() == null) { if (other.getDescription() != null) { return false; } } else if (!getDescription().equals(other.getDescription())) { return false; } if (getId() == null) { if (other.getId() != null) { return false; } } else if (!getId().equals(other.getId())) { return false; } if (getName() == null) { if (other.getName() != null) { return false; } } else if (!getName().equals(other.getName())) { return false; } if (getType() != other.getType()) { return false; } if (getUrl() == null) { if (other.getUrl() != null) { return false; } } else if (!getUrl().equals(other.getUrl())) { return false; } return true; }
Source:
protected final IField[] getExtractedFields(final ICompilationUnit unit) { Assert.isNotNull(unit); final List<IJavaElement> list= new ArrayList<>(); for (IMember fMember : fMembers) { if (fMember instanceof IField) { final IJavaElement element= JavaModelUtil.findInCompilationUnit(unit, fMember); if (element instanceof IField) list.add(element); } } final IField[] fields= new IField[list.size()]; list.toArray(fields); return fields; }

Target:
protected final IField[] getExtractedFields(final ICompilationUnit unit) { Assert.isNotNull(unit); final List<IJavaElement> list= new ArrayList<>(); for (IMember member : fMembers) { if (member instanceof IField) { final IJavaElement element= JavaModelUtil.findInCompilationUnit(unit, member); if (element instanceof IField) list.add(element); } } final IField[] fields= new IField[list.size()]; list.toArray(fields); return fields; }
Source:
public void testTimeout() throws Exception { final Mailer mailer = Mockito.mock(Mailer.class); Mockito.doAnswer(x -> { Thread.sleep(100000); return null; }).when(mailer).sendMail(Mockito.any()); final EmailSender sender = new EmailSender(mailer, _config, new ScheduledThreadPoolExecutor(1)); final CompletionStage<Void> send = sender.send( TestBeanFactory.createRecipient(), ImmutableMap.of(new HtmlReportFormat.Builder().build(), TestBeanFactory.createRenderedReportBuilder().build()), Duration.ofMillis(500) ); boolean cancelled = false; try { send.toCompletableFuture().get(1, TimeUnit.SECONDS); } catch (final CancellationException exception) { cancelled = true; } Assert.assertTrue("send().get() should have thrown a CancellationException", cancelled); }

Target:
public void testTimeout() throws Exception { final Mailer mailer = Mockito.mock(Mailer.class); Mockito.doAnswer(x -> { Thread.sleep(100000); return null; }).when(mailer).sendMail(Mockito.any()); final EmailSender sender = new EmailSender(mailer, _config, new ScheduledThreadPoolExecutor(1)); final CompletionStage<Void> send = sender.send( TestBeanFactory.createRecipient(), ImmutableMap.of(new HtmlReportFormat.Builder().build(), TestBeanFactory.createRenderedReportBuilder().build()), Duration.ofMillis(500) ); boolean cancelled = false; try { send.toCompletableFuture().get(); } catch (final CancellationException exception) { cancelled = true; } Assert.assertTrue("send().get() should have thrown a CancellationException", cancelled); }
Source:
void single( long reference, Read read ) { if ( getId() != NO_ID ) { reset(); } if ( pageCursor == null ) { pageCursor = read.nodePage( reference ); } this.next = reference; this.highMark = NO_ID; this.read = read; this.hasChanges = HasChanges.MAYBE; this.addedNodes = emptySet(); this.single = true; }

Target:
void single( long reference, Read read ) { if ( getId() != NO_ID ) { reset(); } if ( pageCursor == null ) { pageCursor = read.nodePage( reference ); } this.next = reference; this.highMark = NO_ID; this.read = read; this.hasChanges = HasChanges.MAYBE; this.addedNodes = emptySet(); }
Source:
public SpecialAnonymizationUserPage fillFutureAnon(String anonymizedUser) { jsActions.scrollBy(0, 400); wait.forElementClickable(submitButton); AnonymizationTextBox.sendKeys(anonymizedUser); return this; }

Target:
public SpecialAnonymizationUserPage fillFutureAnon(String anonymizedUser) { wait.forElementClickable(submitButton); AnonymizationTextBox.sendKeys(anonymizedUser); return this; }
Source:
private void uiStateScreenTransition() { Fragment fragment = null; FragmentTransaction ft = fm.beginTransaction(); switch (uiState){ case upgrade: case ready: if(incomingRef == null || incomingRef.length() == 0){ Log.e(TAG,"During install: IncomingRef is empty!"); Toast.makeText(getApplicationContext(), "Invalid URL: '" + incomingRef + "'", Toast.LENGTH_SHORT).show(); return; } fragment = startInstall; break; default: List<Fragment> fgmts = fm.getFragments(); int lastIndex = fgmts != null ? fgmts.size() - 1 : -1; if(lastIndex > -1) { fragment = fgmts.get(lastIndex); if (BuildConfig.DEBUG) { Log.v(TAG, "Last fragment: " + fragment); } } if(!(fragment instanceof SetupEnterURLFragment)){ fragment = installFragment; } else { } break; } ft.replace(R.id.setup_fragment_container, fragment); ft.commit(); }

Target:
private void uiStateScreenTransition() { Fragment fragment; FragmentTransaction ft = fm.beginTransaction(); switch (uiState){ case UPGRADE: case READY_TO_INSTALL: if(incomingRef == null || incomingRef.length() == 0){ Log.e(TAG,"During install: IncomingRef is empty!"); Toast.makeText(getApplicationContext(), "Invalid URL: '" + incomingRef + "'", Toast.LENGTH_SHORT).show(); return; } fragment = startInstall; break; case IN_URL_ENTRY: fragment = restoreInstallSetupFragment(); break; case CHOOSE_INSTALL_ENTRY_METHOD: fragment = installFragment; break; default: return; } ft.replace(R.id.setup_fragment_container, fragment); ft.commit(); }
Source:
public SessionPresenterView showError(final String message) { Notify.hideAll(); getSettings().setType(kieNotificationCssClass(NotifyType.DANGER)); showNotification(translate(SessionPresenterView_Error), translate(SessionPresenterView_Notifications), IconType.EXCLAMATION_CIRCLE); return this; }

Target:
public SessionPresenterView showError(final String message) { getSettings().setType(kieNotificationCssClass(NotifyType.DANGER)); showNotification(translate(SessionPresenterView_Error), message, IconType.EXCLAMATION_CIRCLE); return this; }
Source:
public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException, ServiceMayNotContinueException { if (advertiseError != null) { adv.writeOne("ERR " + advertiseError); return; } try { advertiseRefsHook.advertiseRefs(this); } catch (ServiceMayNotContinueException fail) { if (fail.getMessage() != null) { adv.writeOne("ERR " + fail.getMessage()); fail.setOutput(); } throw fail; } adv.init(db); adv.advertiseCapability(CAPABILITY_SIDE_BAND_64K); adv.advertiseCapability(CAPABILITY_DELETE_REFS); adv.advertiseCapability(CAPABILITY_REPORT_STATUS); if (allowQuiet) adv.advertiseCapability(CAPABILITY_QUIET); String nonce = getPushCertificateParser().getAdvertiseNonce(); if (nonce != null) { adv.advertiseCapability(nonce); } if (db.getRefDatabase().performsAtomicTransactions()) adv.advertiseCapability(CAPABILITY_ATOMIC); if (allowOfsDelta) adv.advertiseCapability(CAPABILITY_OFS_DELTA); if (allowPushOptions) { adv.advertiseCapability(CAPABILITY_PUSH_OPTIONS); if (pushOptions == null) { pushOptions = new ArrayList<>(); } } adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); adv.send(getAdvertisedOrDefaultRefs()); for (ObjectId obj : advertisedHaves) adv.advertiseHave(obj); if (adv.isEmpty()) adv.advertiseId(ObjectId.zeroId(), "capabilities^{}"); adv.end(); }

Target:
public void sendAdvertisedRefs(final RefAdvertiser adv) throws IOException, ServiceMayNotContinueException { if (advertiseError != null) { adv.writeOne("ERR " + advertiseError); return; } try { advertiseRefsHook.advertiseRefs(this); } catch (ServiceMayNotContinueException fail) { if (fail.getMessage() != null) { adv.writeOne("ERR " + fail.getMessage()); fail.setOutput(); } throw fail; } adv.init(db); adv.advertiseCapability(CAPABILITY_SIDE_BAND_64K); adv.advertiseCapability(CAPABILITY_DELETE_REFS); adv.advertiseCapability(CAPABILITY_REPORT_STATUS); if (allowQuiet) adv.advertiseCapability(CAPABILITY_QUIET); String nonce = getPushCertificateParser().getAdvertiseNonce(); if (nonce != null) { adv.advertiseCapability(nonce); } if (db.getRefDatabase().performsAtomicTransactions()) adv.advertiseCapability(CAPABILITY_ATOMIC); if (allowOfsDelta) adv.advertiseCapability(CAPABILITY_OFS_DELTA); if (allowPushOptions) { adv.advertiseCapability(CAPABILITY_PUSH_OPTIONS); pushOptions = new ArrayList<>(); } adv.advertiseCapability(OPTION_AGENT, UserAgent.get()); adv.send(getAdvertisedOrDefaultRefs()); for (ObjectId obj : advertisedHaves) adv.advertiseHave(obj); if (adv.isEmpty()) adv.advertiseId(ObjectId.zeroId(), "capabilities^{}"); adv.end(); }
Source:
protected void releaseRecoveryMemory(KeyExtent extent) { if (!extent.isMeta()) { recoveryLock.unlock(); } }

Target:
void releaseRecoveryMemory(KeyExtent extent) { if (!extent.isMeta()) { recoveryLock.unlock(); } }
Source:
public static void editDraft(PrivateMessage pmCurrent, PrivateMessage pmNew) throws AssertionFailedError, NoSuchElementException, ValidationException { readDraft(pmCurrent); pmPage.clearPrivateMessageFields(); pmPage.fillPrivateMessageFields(pmNew); if (pmPage.isSaveButtonEnabled()) { info("Clicking Save PM button"); pmPage.clickSaveButton(); } else { throw new PermissionsDeniedException("The save button is disabled. No permissions?"); } assertFormValid(); info("Draft had to be edited and saved"); }

Target:
public static void editDraft(PrivateMessage pmCurrent, PrivateMessage pmNew) throws AssertionFailedError, NoSuchElementException, ValidationException { openDraft(pmCurrent); pmPage.clearPrivateMessageFields(); pmPage.fillPrivateMessageFields(pmNew); if (pmPage.isSaveButtonEnabled()) { pmPage.clickSaveButton(); } else { info("The save button is disabled. No permissions?"); throw new PermissionsDeniedException("The save button is disabled. No permissions?"); } assertFormValid(); info("Draft had to be edited and saved"); }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { return vdsIds.stream() .map(vdsId -> new PermissionSubject(vdsId, VdcObjectType.VDS, getActionType().getActionGroup())) .collect(Collectors.toList()); }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> hostSubjects = vdsIds.stream() .map(vdsId -> new PermissionSubject(vdsId, VdcObjectType.VDS, getActionType().getActionGroup())) .collect(Collectors.toList()); hostSubjects.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.CONFIGURE_HOST_NETWORK)); return hostSubjects; }
Source:
private List<IResource> getTraceResources() { IFolder folder = getResource(); final List<IResource> list = new ArrayList<>(); try { folder.accept(new IResourceProxyVisitor() { @Override public boolean visit(IResourceProxy resource) throws CoreException { if (resource.isLinked()) { list.add(resource.requestResource()); } return true; } }, IResource.NONE); } catch (CoreException e) { } Comparator<IResource> comperator = new Comparator<IResource>() { @Override public int compare(IResource o1, IResource o2) { return o1.getFullPath().toString().compareTo(o2.getFullPath().toString()); } }; Collections.sort(list, comperator); return list; }

Target:
private List<IResource> getTraceResources() { IFolder folder = getResource(); final List<IResource> list = new ArrayList<>(); try { folder.accept(new IResourceProxyVisitor() { @Override public boolean visit(IResourceProxy resource) throws CoreException { if (resource.isLinked()) { list.add(resource.requestResource()); } return true; } }, IResource.NONE); } catch (CoreException e) { } Comparator<IResource> comparator = new Comparator<IResource>() { @Override public int compare(IResource o1, IResource o2) { return o1.getFullPath().toString().compareTo(o2.getFullPath().toString()); } }; Collections.sort(list, comparator); return list; }
Source:
protected AbstractRetryScheduler(Builder builder) { this.retryExecutor = builder.retryExecutor; this.maxRetryCount = builder.maxRetryCount; }

Target:
protected AbstractRetryScheduler(Builder builder) { builder.validate(); this.retryExecutor = builder.retryExecutor; this.maxRetryCount = builder.maxRetryCount; }
Source:
private void parseInjectExtra(Element fieldElement, Map<TypeElement, InjectionTarget> targetClassMap, Set<TypeMirror> erasedTargetTypes, boolean shouldAddParentInjectionMaps) { TypeElement typeElement = (TypeElement) fieldElement.getEnclosingElement(); if (!isValidUsageOfInjectExtra(InjectExtra.class, fieldElement)) { return; } InjectionTarget injectionTarget = getOrCreateTargetClass(targetClassMap, typeElement); if (shouldAddParentInjectionMaps) { findAllParentsInjectionMap(typeElement, injectionTarget); } addField(fieldElement, injectionTarget); TypeMirror erasedTargetType = typeUtils.erasure(typeElement.asType()); erasedTargetTypes.add(erasedTargetType); }

Target:
private void parseInjectExtra(Element fieldElement, Map<TypeElement, InjectionTarget> targetClassMap, Set<TypeMirror> erasedTargetTypes, boolean shouldAddParentInjectionMaps) { TypeElement typeElement = (TypeElement) fieldElement.getEnclosingElement(); if (!isValidUsageOfInjectExtra(InjectExtra.class, fieldElement)) { return; } InjectionTarget injectionTarget = getOrCreateTargetClass(targetClassMap, typeElement); if (shouldAddParentInjectionMaps) { findParentAndInheritInjectionMap(typeElement, injectionTarget); } addField(fieldElement, injectionTarget); TypeMirror erasedTargetType = typeUtils.erasure(typeElement.asType()); erasedTargetTypes.add(erasedTargetType); }
Source:
public static TenorDateParameterMetadata of(LocalDate date, Tenor tenor) { ArgChecker.notNull(tenor, "tenor"); return new TenorDateParameterMetadata(date, tenor, tenor.toString()); }

Target:
public static TenorDateParameterMetadata of(LocalDate date, Tenor tenor) { ArgChecker.notNull(date, "date"); ArgChecker.notNull(tenor, "tenor"); return new TenorDateParameterMetadata(date, tenor, tenor.toString()); }
Source:
public String spawnPrefab(@Sender EntityRef sender, @CommandParam("prefabId") String prefabName) { ClientComponent clientComponent = sender.getComponent(ClientComponent.class); LocationComponent characterLocation = clientComponent.character.getComponent(LocationComponent.class); Vector3f spawnPos = characterLocation.getWorldPosition(); Vector3f offset = new Vector3f(characterLocation.getWorldDirection()); offset.scale(2); spawnPos.add(offset); Vector3f dir = new Vector3f(characterLocation.getWorldDirection()); dir.y = 0; if (dir.lengthSquared() > 0.001f) { dir.normalize(); } else { dir.set(Direction.FORWARD.getVector3f()); } return Assets.getPrefab(prefabName).map(prefab -> { LocationComponent loc = prefab.getComponent(LocationComponent.class); if (loc != null) { entityManager.create(prefab, spawnPos); return "Done"; } else { return "Prefab cannot be spawned (no location component)"; } }).orElse("Unknown prefab"); }

Target:
public String spawnPrefab(@Sender EntityRef sender, @CommandParam("prefabId") String prefabName) { ClientComponent clientComponent = sender.getComponent(ClientComponent.class); LocationComponent characterLocation = clientComponent.character.getComponent(LocationComponent.class); Vector3f spawnPos = characterLocation.getWorldPosition(); Vector3f offset = new Vector3f(characterLocation.getWorldDirection()); offset.scale(2); spawnPos.add(offset); Vector3f dir = new Vector3f(characterLocation.getWorldDirection()); dir.y = 0; if (dir.lengthSquared() > 0.001f) { dir.normalize(); } else { dir.set(Direction.FORWARD.getVector3f()); } Quat4f rotation = Quat4f.shortestArcQuat(Direction.FORWARD.getVector3f(), dir); Optional<Prefab> prefab = Assets.getPrefab(prefabName); if (prefab.isPresent() && prefab.get().getComponent(LocationComponent.class) != null) { entityManager.create(prefab.get(), spawnPos, rotation); return "Done"; } else if (!prefab.isPresent()) { return "Unknown prefab"; } else { return "Prefab cannot be spawned (no location component)"; } }
Source:
public Builder setDomain(@Domain int domain) { mDomain = domain; return this; }

Target:
public @NonNull Builder setDomain(@Domain int domain) { mDomain = domain; return this; }
Source:
public Set<String> getSupportedRecipes() { return Sets.union(environmentFactories.keySet(), Collections.singleton("no-environment")); }

Target:
public Set<String> getSupportedRecipes() { return environmentFactories.keySet(); }
Source:
void performSubmit(Action action) { if (pausedTags.contains(action.getTag())) { pausedActions.put(action.getTarget(), action); if (action.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_IGNORED, action.request.logId(), "because tag '" + action.getTag() + "' is paused"); } return; } BitmapHunter hunter = hunterMap.get(action.getKey()); if (hunter != null) { hunter.attach(action); return; } if (service.isShutdown()) { if (action.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_IGNORED, action.request.logId(), "because shut down"); } return; } hunter = forRequest(action.getPicasso(), this, cache, stats, action); hunter.future = service.submit(hunter); hunterMap.put(action.getKey(), hunter); failedActions.remove(action.getTarget()); if (action.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_ENQUEUED, action.request.logId()); } }

Target:
void performSubmit(Action action) { if (pausedTags.contains(action.getTag())) { pausedActions.put(action.getTarget(), action); if (action.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_PAUSED, action.request.logId(), "because tag '" + action.getTag() + "' is paused"); } return; } BitmapHunter hunter = hunterMap.get(action.getKey()); if (hunter != null) { hunter.attach(action); return; } if (service.isShutdown()) { if (action.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_IGNORED, action.request.logId(), "because shut down"); } return; } hunter = forRequest(action.getPicasso(), this, cache, stats, action); hunter.future = service.submit(hunter); hunterMap.put(action.getKey(), hunter); failedActions.remove(action.getTarget()); if (action.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_ENQUEUED, action.request.logId()); } }
Source:
private void onCacheStarted(GridCacheContext cacheCtx) throws IgniteCheckedException { GridCacheAdapter cache = cacheCtx.cache(); CacheConfiguration cfg = cacheCtx.config(); CacheGroupContext grp = cacheGrps.get(cacheCtx.groupId()); cacheCtx.onStarted(); String dataRegion = cfg.getDataRegionName(); if (dataRegion == null && ctx.config().getDataStorageConfiguration() != null) dataRegion = ctx.config().getDataStorageConfiguration().getDefaultDataRegionConfiguration().getName(); if (log.isInfoEnabled()) { log.info("Started cache [name=" + cfg.getName() + ", id=" + cacheCtx.cacheId() + (cfg.getGroupName() != null ? ", group=" + cfg.getGroupName() : "") + ", dataRegionName=" + dataRegion + ", mode=" + cfg.getCacheMode() + ", atomicity=" + cfg.getAtomicityMode() + ", backups=" + cfg.getBackups() + ", mvcc=" + cacheCtx.mvccEnabled() + ']'); } if (ctx.metric().profilingEnabled()) { ctx.metric().profiling().cacheStart( cacheCtx.cacheId(), System.currentTimeMillis(), cacheCtx.name(), cfg.getGroupName(), cacheCtx.userCache()); } grp.onCacheStarted(cacheCtx); onKernalStart(cache); }

Target:
private void onCacheStarted(GridCacheContext cacheCtx) throws IgniteCheckedException { GridCacheAdapter cache = cacheCtx.cache(); CacheConfiguration cfg = cacheCtx.config(); CacheGroupContext grp = cacheGrps.get(cacheCtx.groupId()); cacheCtx.onStarted(); String dataRegion = cfg.getDataRegionName(); if (dataRegion == null && ctx.config().getDataStorageConfiguration() != null) dataRegion = ctx.config().getDataStorageConfiguration().getDefaultDataRegionConfiguration().getName(); if (log.isInfoEnabled()) { log.info("Started cache [name=" + cfg.getName() + ", id=" + cacheCtx.cacheId() + (cfg.getGroupName() != null ? ", group=" + cfg.getGroupName() : "") + ", dataRegionName=" + dataRegion + ", mode=" + cfg.getCacheMode() + ", atomicity=" + cfg.getAtomicityMode() + ", backups=" + cfg.getBackups() + ", mvcc=" + cacheCtx.mvccEnabled() + ']'); } grp.onCacheStarted(cacheCtx); onKernalStart(cache); if (ctx.performanceStatistics().enabled() && U.isLocalNodeCoordinator(ctx.discovery())) ctx.performanceStatistics().cacheStart(cacheCtx.cacheId(), cfg.getName()); }
Source:
private void propagateHeaders(ConsumerRecord<Object, Object> record, Exchange exchange, HeaderFilterStrategy headerFilterStrategy) { StreamSupport.stream(record.headers().spliterator(), false) .filter(header -> !headerFilterStrategy.applyFilterToCamelHeaders(header.key(), header.value(), exchange)) .forEach(header -> exchange.getIn().setHeader(header.key(), header.value())); }

Target:
private void propagateHeaders(ConsumerRecord<Object, Object> record, Exchange exchange, HeaderFilterStrategy headerFilterStrategy) { StreamSupport.stream(record.headers().spliterator(), false) .filter(header -> shouldBeFiltered(header, exchange, headerFilterStrategy)) .forEach(header -> exchange.getIn().setHeader(header.key(), header.value())); }
Source:
private static void internalAssertEquals( String message, Object expecteds, Object actuals, ComparisonHelper comparisonHelper) { String messagePrefix = message == null ? "" : message + ": "; if (arraysTriviallyEqual(messagePrefix, expecteds, actuals)) { return; } assertElementsEqual(messagePrefix, comparisonHelper); }

Target:
private static void internalAssertEquals( String message, Object expecteds, Object actuals, ComparisonHelper comparisonHelper) { String messagePrefix = message == null ? "" : message + ": "; if (!arraysTriviallyEqual(messagePrefix, expecteds, actuals)) { assertElementsEqual(messagePrefix, expecteds, actuals, comparisonHelper); } }
Source:
private Function<Cursor, Result<TopNResultValue>> getMapFn(TopNQuery query, final StorageAdapter adapter) { final Capabilities capabilities = adapter.getCapabilities(); final String dimension = query.getDimensionSpec().getDimension(); final int cardinality = adapter.getDimensionCardinality(dimension); int numBytesPerRecord = 0; for (AggregatorFactory aggregatorFactory : query.getAggregatorSpecs()) { numBytesPerRecord += aggregatorFactory.getMaxIntermediateSize(); } final TopNAlgorithmSelector selector = new TopNAlgorithmSelector(cardinality, numBytesPerRecord); query.initTopNAlgorithmSelector(selector); final TopNAlgorithm topNAlgorithm; if ( selector.isHasExtractionFn() && dimension.equals(Column.TIME_COLUMN_NAME) ) { topNAlgorithm = new TimeExtractionTopNAlgorithm(capabilities, query); } else if (selector.isHasExtractionFn()) { if (canApplyExtractionInPost(query)) { topNAlgorithm = new PooledTopNAlgorithm(capabilities, query, bufferPool); } else { topNAlgorithm = new DimExtractionTopNAlgorithm(capabilities, query); } } else if (selector.isAggregateAllMetrics()) { topNAlgorithm = new PooledTopNAlgorithm(capabilities, query, bufferPool); } else if (selector.isAggregateTopNMetricFirst() || query.getContextValue("doAggregateTopNMetricFirst", false)) { topNAlgorithm = new AggregateTopNMetricFirstAlgorithm(capabilities, query, bufferPool); } else { topNAlgorithm = new PooledTopNAlgorithm(capabilities, query, bufferPool); } return new TopNMapFn(query, topNAlgorithm); }

Target:
private Function<Cursor, Result<TopNResultValue>> getMapFn(TopNQuery query, final StorageAdapter adapter) { final Capabilities capabilities = adapter.getCapabilities(); final String dimension = query.getDimensionSpec().getDimension(); final int cardinality = adapter.getDimensionCardinality(dimension); int numBytesPerRecord = 0; for (AggregatorFactory aggregatorFactory : query.getAggregatorSpecs()) { numBytesPerRecord += aggregatorFactory.getMaxIntermediateSize(); } final TopNAlgorithmSelector selector = new TopNAlgorithmSelector(cardinality, numBytesPerRecord); query.initTopNAlgorithmSelector(selector); final TopNAlgorithm topNAlgorithm; if ( selector.isHasExtractionFn() && dimension.equals(Column.TIME_COLUMN_NAME) ) { topNAlgorithm = new TimeExtractionTopNAlgorithm(capabilities, query); } else if (selector.isHasExtractionFn()) { topNAlgorithm = new DimExtractionTopNAlgorithm(capabilities, query); } else if (selector.isAggregateAllMetrics()) { topNAlgorithm = new PooledTopNAlgorithm(capabilities, query, bufferPool); } else if (selector.isAggregateTopNMetricFirst() || query.getContextValue("doAggregateTopNMetricFirst", false)) { topNAlgorithm = new AggregateTopNMetricFirstAlgorithm(capabilities, query, bufferPool); } else { topNAlgorithm = new PooledTopNAlgorithm(capabilities, query, bufferPool); } return new TopNMapFn(query, topNAlgorithm); }
Source:
public String getTitleTextWithIndex(int index) { return titles.get(index).getText(); }

Target:
public String getTitleTextWithIndex(int index) { WebElement selectedTitle = titles.get(index); wait.forElementVisible(selectedTitle); return selectedTitle.getText(); }
Source:
private void update(Cell cell) { if (isScannedDataRowCount(cell)) { addScannedDataRowCount(getValue(cell)); } else if (isRebuiltIndexRowCount(cell)) { addRebuiltIndexRowCount(getValue(cell)); } else if (isBeforeRebuildValidIndexRowCount(cell)) { addBeforeRebuildValidIndexRowCount(getValue(cell)); } else if (isBeforeRebuildExpiredIndexRowCount(cell)) { addBeforeRebuildExpiredIndexRowCount(getValue(cell)); } else if (isBeforeRebuildMissingIndexRowCount(cell)) { addBeforeRebuildMissingIndexRowCount(getValue(cell)); } else if (isBeforeRebuildInvalidIndexRowCount(cell)) { addBeforeRebuildInvalidIndexRowCount(getValue(cell)); } else if (isAfterRebuildValidIndexRowCount(cell)) { addAfterRebuildValidIndexRowCount(getValue(cell)); } else if (isAfterRebuildExpiredIndexRowCount(cell)) { addAfterRebuildExpiredIndexRowCount(getValue(cell)); } else if (isAfterRebuildMissingIndexRowCount(cell)) { addAfterRebuildMissingIndexRowCount(getValue(cell)); } else if (isAfterRebuildInvalidIndexRowCount(cell)) { addAfterRebuildInvalidIndexRowCount(getValue(cell)); } }

Target:
private void update(Cell cell) { if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, SCANNED_DATA_ROW_COUNT_BYTES)) { addScannedDataRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, REBUILT_INDEX_ROW_COUNT_BYTES)) { addRebuiltIndexRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, BEFORE_REBUILD_VALID_INDEX_ROW_COUNT_BYTES)) { addBeforeRebuildValidIndexRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, BEFORE_REBUILD_EXPIRED_INDEX_ROW_COUNT_BYTES)) { addBeforeRebuildExpiredIndexRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, BEFORE_REBUILD_MISSING_INDEX_ROW_COUNT_BYTES)) { addBeforeRebuildMissingIndexRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, BEFORE_REBUILD_INVALID_INDEX_ROW_COUNT_BYTES)) { addBeforeRebuildInvalidIndexRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, AFTER_REBUILD_VALID_INDEX_ROW_COUNT_BYTES)) { addAfterRebuildValidIndexRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, AFTER_REBUILD_EXPIRED_INDEX_ROW_COUNT_BYTES)) { addAfterRebuildExpiredIndexRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, AFTER_REBUILD_MISSING_INDEX_ROW_COUNT_BYTES)) { addAfterRebuildMissingIndexRowCount(getValue(cell)); } else if (CellUtil.matchingColumn(cell, RESULT_TABLE_COLUMN_FAMILY, AFTER_REBUILD_INVALID_INDEX_ROW_COUNT_BYTES)) { addAfterRebuildInvalidIndexRowCount(getValue(cell)); } }
Source:
private void dumpYaml(Map<String, Object> generatedOutstandingRequests, Map<String, Object> generatedHeldLocks, File file) throws IOException { FileWriter writer = new FileWriter(file); Yaml yaml = new Yaml(getRepresenter(), getDumperOptions()); yaml.dump(generatedOutstandingRequests, writer); writer.append("\n\n---\n\n"); yaml.dump(generatedHeldLocks, writer); }

Target:
private void dumpYaml(Map<String, Object> generatedOutstandingRequests, Map<String, Object> generatedHeldLocks, File file) throws IOException { YamlWriter writer = YamlWriter.create(file); writer.writeToYaml(generatedOutstandingRequests); writer.appendString("\n\n---\n\n"); writer.writeToYaml(generatedHeldLocks); }
Source:
public Optional<P> authenticate(C credentials) throws AuthenticationException { final Timer.Context context = gets.time(); try { return cache.get(credentials); } catch (UncheckedExecutionException|ExecutionException e) { final Throwable cause = e.getCause(); if (cause instanceof InvalidCredentialsException) { return Optional.empty(); } Throwables.propagateIfPossible(cause, AuthenticationException.class); throw new AuthenticationException(Optional.ofNullable(cause).orElse(e)); } finally { context.stop(); } }

Target:
public Optional<P> authenticate(C credentials) throws AuthenticationException { final Timer.Context context = gets.time(); try { return cache.get(credentials); } catch (ExecutionException e) { final Throwable cause = e.getCause(); if (cause instanceof InvalidCredentialsException) { return Optional.empty(); } Throwables.propagateIfPossible(cause, AuthenticationException.class); throw new AuthenticationException(cause); } catch (UncheckedExecutionException e) { throw Throwables.propagate(e.getCause()); } finally { context.stop(); } }
Source:
public EventSenderResult send(AuditLogEvent event, AuditLogEventSubscriber subscriber) { EventSenderResult result = new EventSenderResult(); EventMessageContent message = new EventMessageContent(); message.prepareMessage(hostName, event, isBodyHtml); String recipient = subscriber.getMethodAddress(); if (StringUtils.isEmpty(recipient)) { log.error("Email recipient is not known, please check user table ( email )" + " or event_subscriber ( method_address )," + " unable to send email for subscriber " + subscriber.getSubscriberId() + "," + " message was " + message.getMessageSubject() + ":" + message.getMessageBody()); result.setSent(false); return result; } log.info(String.format("Send email to [%s]%n subject:%n [%s]", recipient, message.getMessageSubject())); if (log.isDebugEnabled()) { log.debug(String.format("body:%n [%s]", message.getMessageBody())); } boolean shouldRetry = false; try { mailSender.send(recipient, message.getMessageSubject(), message.getMessageBody()); } catch (MessagingException ex) { result.setReason(ex.getMessage()); shouldRetry = true; } for (int i = 0; i < 3 && shouldRetry; ++i) { shouldRetry = false; try { Thread.sleep(30000); mailSender.send(recipient, message.getMessageSubject(), message.getMessageBody()); } catch (MessagingException ex) { result.setReason(ex.getMessage()); shouldRetry = true; } catch (InterruptedException e) { log.error("Failed to suspend thread for 30 seconds while trying to resend a mail message.", e); } } if (shouldRetry) { result.setSent(false); } else { result.setSent(true); } return result; }

Target:
public EventSenderResult send(AuditLogEvent event, AuditLogEventSubscriber subscriber) { EventSenderResult result = new EventSenderResult(); EventMessageContent message = new EventMessageContent(); message.prepareMessage(hostName, event, isBodyHtml); String recipient = subscriber.getMethodAddress(); if (StringUtils.isEmpty(recipient)) { log.error(String.format("Email recipient is not known, please check user table ( email )" + " or event_subscriber ( method_address )," + " unable to send email for subscriber %s ," + " message was %s:", subscriber.getSubscriberId(), message.getMessageSubject(), message.getMessageBody())); result.setSent(false); return result; } log.info(String.format("Send email to [%s]%n subject:%n [%s]", recipient, message.getMessageSubject())); if (log.isDebugEnabled()) { log.debug(String.format("body:%n [%s]", message.getMessageBody())); } boolean shouldRetry = false; try { mailSender.send(recipient, message.getMessageSubject(), message.getMessageBody()); } catch (MessagingException ex) { result.setReason(ex.getMessage()); shouldRetry = true; } for (int i = 0; i < RETRY_COUNT && shouldRetry; ++i) { shouldRetry = false; try { Thread.sleep(30000); mailSender.send(recipient, message.getMessageSubject(), message.getMessageBody()); } catch (MessagingException ex) { result.setReason(ex.getMessage()); shouldRetry = true; } catch (InterruptedException e) { log.error("Failed to suspend thread for 30 seconds while trying to resend a mail message.", e); } } if (shouldRetry) { result.setSent(false); } else { result.setSent(true); } return result; }
Source:
private RegionScanner getLocalScanner() throws IOException { if(minTimestamp!= 0) { Scan incrScan = new Scan(scan); incrScan.setTimeRange(minTimestamp, scan.getTimeRange().getMax()); incrScan.setRaw(true); incrScan.setMaxVersions(); incrScan.getFamilyMap().clear(); incrScan.setCacheBlocks(false); for (byte[] family : scan.getFamilyMap().keySet()) { incrScan.addFamily(family); } if(nextStartKey != null) { incrScan.setStartRow(nextStartKey); } List<KeyRange> keys = new ArrayList<>(); try(RegionScanner scanner = region.getScanner(incrScan)) { List<Cell> row = new ArrayList<>(); int rowCount = 0; do { hasMoreIncr = scanner.nextRaw(row); if (!row.isEmpty()) { keys.add(PVarbinary.INSTANCE.getKeyRange(CellUtil.cloneRow(row.get(0)))); rowCount++; } row.clear(); } while (hasMoreIncr && rowCount < pageSizeInRows); } if (!hasMoreIncr && keys.isEmpty()) { return null; } if (!keys.isEmpty()) { nextStartKey = ByteUtil.calculateTheClosestNextRowKeyForPrefix(keys.get(keys.size() - 1).getLowerRange()); } try { ScanRanges scanRanges = ScanRanges.createPointLookup(keys); scanRanges.initializeScan(incrScan); SkipScanFilter skipScanFilter = scanRanges.getSkipScanFilter(); incrScan.setFilter(new SkipScanFilter(skipScanFilter, true)); incrScan.setTimeRange(0, scan.getTimeRange().getMax()); scan.setTimeRange(0, scan.getTimeRange().getMax()); return region.getScanner(incrScan); } catch (IndexOutOfBoundsException ex) { if(keys.size()!=0) { throw ex; } } } return innerScanner; }

Target:
private RegionScanner getLocalScanner() throws IOException { if(minTimestamp!= 0) { Scan incrScan = new Scan(scan); incrScan.setTimeRange(minTimestamp, scan.getTimeRange().getMax()); incrScan.setRaw(true); incrScan.setMaxVersions(); incrScan.getFamilyMap().clear(); incrScan.setCacheBlocks(false); for (byte[] family : scan.getFamilyMap().keySet()) { incrScan.addFamily(family); } if (scan.getFilter() instanceof FirstKeyOnlyFilter) { incrScan.setFilter(null); } else if (scan.getFilter() != null) { incrScan.setFilter(new AllVersionsIndexRebuildFilter(scan.getFilter())); } if(nextStartKey != null) { incrScan.setStartRow(nextStartKey); } List<KeyRange> keys = new ArrayList<>(); try(RegionScanner scanner = region.getScanner(incrScan)) { List<Cell> row = new ArrayList<>(); int rowCount = 0; do { hasMoreIncr = scanner.nextRaw(row); if (!row.isEmpty()) { keys.add(PVarbinary.INSTANCE.getKeyRange(CellUtil.cloneRow(row.get(0)))); rowCount++; } row.clear(); } while (hasMoreIncr && rowCount < pageSizeInRows); } if (!hasMoreIncr && keys.isEmpty()) { return null; } if (keys.isEmpty()) { return innerScanner; } nextStartKey = ByteUtil.calculateTheClosestNextRowKeyForPrefix(keys.get(keys.size() - 1).getLowerRange()); ScanRanges scanRanges = ScanRanges.createPointLookup(keys); scanRanges.initializeScan(incrScan); SkipScanFilter skipScanFilter = scanRanges.getSkipScanFilter(); incrScan.setFilter(new SkipScanFilter(skipScanFilter, true)); incrScan.setTimeRange(0, scan.getTimeRange().getMax()); scan.setTimeRange(0, scan.getTimeRange().getMax()); return region.getScanner(incrScan); } return innerScanner; }
Source:
public void log(LogRecord logRecord) { final java.util.logging.LogRecord julLogRecord = new java.util.logging.LogRecord( mapSeverity(logRecord.getSeverity()), logRecord.getCursor() != null ? logRecord.getCursor().toString() + ": " + logRecord.getMessage() : logRecord.getMessage()); julLogRecord.setSourceClassName(logRecord.getSourceFileName()); julLogRecord.setSourceMethodName(logRecord.getSourceMethodName()); LOGGER.log(julLogRecord); }

Target:
public void log(LogRecord logRecord) { final java.util.logging.LogRecord julLogRecord = new java.util.logging.LogRecord( mapSeverity(logRecord.getSeverity()), logRecord.getCursor() != null ? logRecord.getCursor().toString() + ": " + logRecord.getMessage() : logRecord.getMessage()); julLogRecord.setSourceClassName(logRecord.getSourceFileName()); julLogRecord.setSourceMethodName(logRecord.getSourceMethodName()); julLogRecord.setParameters(new Object[] { logRecord.getCursor() }); LOGGER.log(julLogRecord); }
Source:
private void checkInterceptorBindings() { if (interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_CONSTRUCT) || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.PRE_DESTROY) || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_ACTIVATE) || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.PRE_PASSIVATE)) { for (Annotation interceptorBindingType : interceptorBindingTypes) { Target target = interceptorBindingType.annotationType().getAnnotation(Target.class); if (target == null || hasInvalidTargetType(target.value())) { throw ReflectionLogger.LOG.lifecycleCallbackInterceptorWithInvalidBindingTarget(this, interceptorBindingType.annotationType().getName(), target != null ? Arrays.toString(target.value()) : "Target meta-annotation is not present"); } } } }

Target:
private void checkInterceptorBindings() { if (interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_CONSTRUCT) || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.PRE_DESTROY) || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_ACTIVATE) || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.PRE_PASSIVATE)) { for (Annotation interceptorBindingType : interceptorBindingTypes) { Target target = interceptorBindingType.annotationType().getAnnotation(Target.class); if (target == null || hasInvalidTargetType(target.value())) { ReflectionLogger.LOG.lifecycleCallbackInterceptorWithInvalidBindingTarget(this, interceptorBindingType.annotationType().getName(), target != null ? Arrays.toString(target.value()) : "Target meta-annotation is not present"); } } } }
Source:
public void testLRUEntriesAreEvicted() { Map<Integer, Integer> map = new LRUMap<>(3); for (int i = 0; i < 3; i++) { map.put(i, i); } map.get(2); map.get(0); map.put(3, 3); Map<Integer, Integer> expectedMap = new HashMap<>(); expectedMap.put(2, 2); expectedMap.put(0, 0); expectedMap.put(3, 3); Assert.assertEquals(expectedMap, map); }

Target:
public void testLRUEntriesAreEvicted() { Map<Integer, Integer> map = new LRUMap<>(3, 3); for (int i = 0; i < 3; i++) { map.put(i, i); } map.get(2); map.get(0); map.put(3, 3); Map<Integer, Integer> expectedMap = new LinkedHashMap<>(); expectedMap.put(2, 2); expectedMap.put(0, 0); expectedMap.put(3, 3); Assert.assertThat(map.entrySet(), IsIterableContainingInOrder .contains(expectedMap.entrySet().toArray())); }
Source:
public String toString() { OwnerDTO owner = this.getOwner(); ReleaseDTO release = this.getReleaseVer(); return String.format("ActivationKeyDTO [id: %s, name: %s, description: %s, owner id: %s, " + "releaseVer: %s, serviceLevel: %s, autoAttach: %s, " + "pools: %s, products: %s, contentOverrides: %s]", this.getId(), this.getName(), this.getDescription(), owner != null ? owner.getId() : null, release != null ? release.getReleaseVer() : null, this.getServiceLevel(), this.isAutoAttach(), this.getPools(), this.getProducts(), this.getContentOverrides()); }

Target:
public String toString() { return String.format("ActivationKeyDTO [id: %s, name: %s, description: %s]", this.getId(), this.getName(), this.getDescription()); }
Source:
public void prepare() throws Exception { URL resource = getClass().getResource(PROJECT_PATH); Path sourceFolder = get(resource.toURI()); write(createFile(sourceFolder.resolve(".project")), format(PROJECT_FILE, PROJECT).getBytes()); write(createFile(sourceFolder.resolve(".classpath")), CLASSPATH_FILE.getBytes()); prjServiceClient.importProject(ws.getId(), sourceFolder, PROJECT, PLAIN_JAVA); cmdClient.createCommand(DEBUG_APP, START_DEBUG, CUSTOM, ws.getId()); ide.open(ws); projectExplorer.waitItem(PROJECT); projectExplorer.quickExpandWithJavaScript(); debugPanel.openDebugPanel(); projectExplorer.openItemByPath(PROJECT + PATH_TO_CLASS); editor.waitActive(); editor.setCursorToLine(18); editor.setBreakpoint(18); menu.runCommand(RUN_MENU, EDIT_DEBUG_CONFIGURATION); debugConfig.createConfig(PROJECT); cmdPalette.openCommandPalette(); cmdPalette.startCommandByDoubleClick(START_DEBUG); menu.runCommandByXpath( TestMenuCommandsConstants.Run.RUN_MENU, TestMenuCommandsConstants.Run.DEBUG, debugConfig.getXpathToІRunDebugCommand(PROJECT)); consoles.waitExpectedTextIntoConsole(TestBuildConstants.LISTENING_AT_ADDRESS_8000); }

Target:
public void prepare() throws Exception { URL resource = getClass().getResource(PROJECT_PATH); prjServiceClient.importProject(ws.getId(), get(resource.toURI()), PROJECT, PLAIN_JAVA); cmdClient.createCommand(DEBUG_APP, START_DEBUG, CUSTOM, ws.getId()); ide.open(ws); projectExplorer.waitItem(PROJECT); projectExplorer.quickExpandWithJavaScript(); debugPanel.openDebugPanel(); projectExplorer.openItemByPath(PROJECT + PATH_TO_CLASS); editor.waitActive(); editor.setCursorToLine(18); editor.setBreakpoint(18); menu.runCommand(RUN_MENU, EDIT_DEBUG_CONFIGURATION); debugConfig.createConfig(PROJECT); cmdPalette.openCommandPalette(); cmdPalette.startCommandByDoubleClick(START_DEBUG); menu.runCommandByXpath( TestMenuCommandsConstants.Run.RUN_MENU, TestMenuCommandsConstants.Run.DEBUG, debugConfig.getXpathToІRunDebugCommand(PROJECT)); consoles.waitExpectedTextIntoConsole(TestBuildConstants.LISTENING_AT_ADDRESS_8000); }
Source:
public void run() { logger.trace("AsyncRequestWorker started"); AsyncRequestInfo requestInfo = null; try { while (isRunning()) { try { requestInfo = requests.take(); if (requestInfo.restRequest != null) { processRequest(requestInfo); logger.trace("Request was processed successfully", requestInfo.restRequest.getUri()); } else { break; } } catch (Exception e) { metrics.requestProcessingError.inc(); if (requestInfo != null) { onProcessingFailure(requestInfo.restRequest, requestInfo.restResponseChannel, e); } else { logger.error("Unexpected exception while processing requests", e); } } } } catch (Throwable t) { logger.error("AsyncRequestWorker encountered a throwable", t); } finally { running.set(false); discardRequests(); logger.trace("AsyncRequestWorker stopped"); shutdownLatch.countDown(); } }

Target:
public void run() { logger.trace("AsyncRequestWorker started"); AsyncRequestInfo requestInfo = null; try { while (isRunning()) { try { requestInfo = requests.take(); if (requestInfo.restRequest != null) { processRequest(requestInfo); logger.trace("Request was processed successfully", requestInfo.restRequest.getUri()); } else { break; } } catch (Exception e) { metrics.requestProcessingError.inc(); if (requestInfo != null) { onProcessingFailure(requestInfo.restRequest, requestInfo.restResponseChannel, e); } else { logger.error("Unexpected exception while processing requests", e); } } } } finally { running.set(false); discardRequests(); logger.trace("AsyncRequestWorker stopped"); shutdownLatch.countDown(); } }