Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
288,300
void () { }
onCancel
288,301
void () { }
onSuccess
288,302
void (@NotNull Exception error) { LOG.error(error); }
onError
288,303
void (@NotNull Throwable error) { if (error instanceof Exception) { onError((Exception)error); } else { LOG.error(error); } }
onThrowable
288,304
void () { }
onFinished
288,305
EdtReplacementThread () { return EdtReplacementThread.EDT_WITH_IW; }
whereToRunCallbacks
288,306
Project () { return myProject; }
getProject
288,307
void () { ProgressManager.getInstance().run(this); }
queue
288,308
Task (@ProgressTitle @NotNull String title) { myTitle = title; return this; }
setTitle
288,309
String () { return myCancelText; }
getCancelText
288,310
Task (@NlsContexts.Button String cancelText) { myCancelText = cancelText; return this; }
setCancelText
288,311
boolean () { return ApplicationManager.getApplication().isUnitTestMode() || ApplicationManager.getApplication().isHeadlessEnvironment(); }
isHeadless
288,312
Task (@NlsContexts.Tooltip String cancelTooltipText) { myCancelTooltipText = cancelTooltipText; return this; }
setCancelTooltipText
288,313
String () { return myCancelTooltipText; }
getCancelTooltipText
288,314
boolean () { return myCanBeCancelled; }
isCancellable
288,315
Modal () { if (isModal()) { return (Modal)this; } throw new IllegalStateException("Not a modal task"); }
asModal
288,316
Backgroundable () { if (!isModal()) { return (Backgroundable)this; } throw new IllegalStateException("Not a backgroundable task"); }
asBackgroundable
288,317
boolean () { return myBackgroundOption.shouldStartInBackground(); }
shouldStartInBackground
288,318
void () { //myBackgroundOption.processSentToBackground(); }
processSentToBackground
288,319
boolean () { return false; }
isModal
288,320
boolean () { return false; }
isConditionalModal
288,321
boolean () { return true; }
isModal
288,322
boolean () { return true; }
isConditionalModal
288,323
String () { return myNotificationName; }
getNotificationName
288,324
boolean () { return myShowWhenFocused; }
isShowWhenFocused
288,325
void (@NotNull ProgressIndicator indicator) { try { myResult = compute(indicator); } catch (Throwable t) { myError = t; } }
run
288,326
String () { return "ServiceDescriptor(" + "interface='" + serviceInterface + '\'' + ", serviceImplementation='" + serviceImplementation + '\'' + ", testServiceImplementation='" + testServiceImplementation + '\'' + ", headlessImplementation='" + headlessImplementation + '\'' + ", overrides=" + overrides + ", configurationSchemaKey='" + configurationSchemaKey + '\'' + ", preload=" + preload + ", client=" + client + ')'; }
toString
288,327
PluginDescriptor () { return myPluginDescriptor; }
getPluginDescriptor
288,328
void (@NotNull PluginDescriptor pluginDescriptor) { myPluginDescriptor = pluginDescriptor; }
setPluginDescriptor
288,329
String () { return "ComponentConfig{" + "implementationClass='" + implementationClass + '\'' + ", interfaceClass='" + interfaceClass + '\'' + ", headlessImplementationClass='" + headlessImplementationClass + '\'' + ", loadForDefaultProject=" + loadForDefaultProject + ", options=" + options + '}'; }
toString
288,330
StartupManager (@NotNull Project project) { return project.getService(StartupManager.class); }
getInstance
288,331
T (@NotNull ComponentManager componentManager) { T instance; if (factoryClass == null) { instance = super.createInstance(componentManager, getPluginDescriptor()); } else { ExtensionFactory factory = componentManager.instantiateClass(factoryClass, getPluginDescriptor()); //noinspection unchecked instance = (T)factory.createInstance(factoryArgument, getImplementationClassName()); } if (instance instanceof PluginAware) { ((PluginAware)instance).setPluginDescriptor(getPluginDescriptor()); } return instance; }
createInstance
288,332
PluginDescriptor () { return pluginDescriptor; }
getPluginDescriptor
288,333
void (@NotNull PluginDescriptor pluginDescriptor) { this.pluginDescriptor = pluginDescriptor; }
setPluginDescriptor
288,334
void (@NotNull ProgressIndicator indicator) { performInDumbMode(indicator); }
perform
288,335
void () { }
dispose
288,336
void (@NotNull Project project) { DumbService.getInstance(project).queueTask(this); }
queue
288,337
DumbUtil (@NotNull Project project) { return project.getService(DumbUtil.class); }
getInstance
288,338
String () { return "RootsChangeRescanningInfo.TOTAL_RESCAN"; }
toString
288,339
String () { return "RootsChangeRescanningInfo.RESCAN_DEPENDENCIES_IF_NEEDED"; }
toString
288,340
String () { return "RootsChangeRescanningInfo.NO_RESCAN_NEEDED"; }
toString
288,341
boolean (@NotNull VirtualFile file) { // do not use file.getFileType() to avoid autodetection by content loading for arbitrary files return isProjectOrWorkspaceFile(file, FileTypeRegistry.getInstance().getFileTypeByFileName(file.getNameSequence())); }
isProjectOrWorkspaceFile
288,342
boolean (@NotNull VirtualFile file, @Nullable FileType fileType) { return fileType instanceof InternalFileType || VfsUtilCore.findContainingDirectory(file, Project.DIRECTORY_STORE_FOLDER) != null; }
isProjectOrWorkspaceFile
288,343
void (Project project) { theOnlyProject = project; }
updateInternalTheOnlyProjectFieldTemporarily
288,344
IndexNotReadyException () { return create(null); }
create
288,345
IndexNotReadyException (@Nullable Throwable startTrace) { return new IndexNotReadyException(startTrace); }
create
288,346
DefaultProjectFactory () { return ApplicationManager.getApplication().getService(DefaultProjectFactory.class); }
getInstance
288,347
RunResult<T> () { final RunResult<T> result = new RunResult<>(this); Application application = ApplicationManager.getApplication(); if (application.isWriteIntentLockAcquired()) { try(AccessToken ignored = ApplicationManager.getApplication().acquireWriteActionLock(getClass())) { result.run(); } return result; } if (application.isReadAccessAllowed()) { LOG.error("Must not start write action from within read action in the other thread - deadlock is coming"); } WriteThread.invokeAndWait(() -> { try(AccessToken ignored = ApplicationManager.getApplication().acquireWriteActionLock(getClass())){ result.run(); } }); result.throwException(); return result; }
execute
288,348
AccessToken () { // get useful information about the write action Class<?> callerClass = ObjectUtils.notNull(ReflectionUtil.getCallerClass(3), WriteAction.class); return ApplicationManager.getApplication().acquireWriteActionLock(callerClass); }
start
288,349
PathMacros () { return ApplicationManager.getApplication().getService(PathMacros.class); }
getInstance
288,350
boolean (final @NotNull Params queryParameters, final @NotNull Processor<? super Result> consumer) { final AtomicBoolean toContinue = new AtomicBoolean(true); final Processor<Result> wrapper = result -> { if (!toContinue.get()) { return false; } if (!consumer.process(result)) { toContinue.set(false); return false; } return true; }; if (myRequireReadAction && !ApplicationManager.getApplication().isReadAccessAllowed()) { Runnable runnable = () -> { if (!(queryParameters instanceof QueryParameters) || ((QueryParameters)queryParameters).isQueryValid()) { processQuery(queryParameters, wrapper); } }; if (!DumbService.isDumbAware(this)) { Project project = queryParameters instanceof QueryParameters ? ((QueryParameters)queryParameters).getProject() : null; if (project != null) { DumbService.getInstance(project).runReadActionInSmartMode(runnable); return toContinue.get(); } } ApplicationManager.getApplication().runReadAction(runnable); } else { processQuery(queryParameters, wrapper); } return toContinue.get(); }
execute
288,351
RunResult<T> () { final RunResult<T> result = new RunResult<>(this); return compute(() -> result.run()); }
execute
288,352
NonBlockingReadAction<Void> (@NotNull Runnable task) { return nonBlocking(new RunnableCallable(task)); }
nonBlocking
288,353
RunResult<T> () { try { myActionRunnable.run(this); } catch (ProcessCanceledException e) { throw e; // this exception may occur from time to time and it shouldn't be caught } catch (Throwable t) { myThrowable = t; ExceptionUtil.rethrowAllAsUnchecked(t); } finally { myActionRunnable = null; } return this; }
run
288,354
T () { return myResult; }
getResultObject
288,355
RunResult (Logger logger) { if (myThrowable != null) { logger.error(myThrowable); } return this; }
logException
288,356
boolean () { return myThrowable != null; }
hasException
288,357
Throwable () { return myThrowable; }
getThrowable
288,358
void (Exception throwable) { myThrowable = throwable; }
setThrowable
288,359
Application () { return ourApplication; }
getApplication
288,360
void (@Nullable Application instance) { ourApplication = instance; for (Runnable cleaner : cleaners) { cleaner.run(); } }
setApplication
288,361
void (@NotNull Application instance, @NotNull Disposable parent) { Application old = ourApplication; Disposer.register(parent, () -> { if (old != null) { // to prevent NPEs in threads still running setApplication(old); } }); setApplication(instance); }
setApplication
288,362
void (@NotNull Application instance, @NotNull Supplier<? extends FileTypeRegistry> fileTypeRegistryGetter, @NotNull Disposable parent) { Application old = ourApplication; setApplication(instance); Supplier<? extends FileTypeRegistry> oldFileTypeRegistry = FileTypeRegistry.setInstanceSupplier(fileTypeRegistryGetter); Disposer.register(parent, () -> { if (old != null) { // to prevent NPEs in threads still running setApplication(old); FileTypeRegistry.setInstanceSupplier(oldFileTypeRegistry); } }); }
setApplication
288,363
void (Runnable cleaner) { cleaners.add(cleaner); }
registerCleaner
288,364
TransactionGuard () { return ourInstance.get(); }
getInstance
288,365
void (@NotNull Disposable parentDisposable, @NotNull Runnable transaction) { TransactionGuard guard = getInstance(); guard.submitTransaction(parentDisposable, guard.getContextTransaction(), transaction); }
submitTransaction
288,366
AsyncExecutionService () { return ApplicationManager.getApplication().getService(AsyncExecutionService.class); }
getService
288,367
ApplicationInfo () { return ApplicationManager.getApplication().getService(ApplicationInfo.class); }
getInstance
288,368
boolean () { if (!LoadingState.COMPONENTS_LOADED.isOccurred()) { return false; } ApplicationInfo info = getInstance(); return info != null && info.hasHelp(); }
helpAvailable
288,369
boolean () { if (!LoadingState.COMPONENTS_LOADED.isOccurred()) { return false; } ApplicationInfo info = getInstance(); return info != null && info.hasContextHelp(); }
contextHelpAvailable
288,370
String () { return getBuild().asString(); }
getBuildNumber
288,371
boolean () { return false; }
isEAP
288,372
IdeUrlTrackingParametersProvider () { return ApplicationManager.getApplication().getService(IdeUrlTrackingParametersProvider.class); }
getInstance
288,373
String (@NotNull String originalUrl) { return originalUrl; }
augmentUrl
288,374
String (@NotNull String originalUrl, String campaignId) { return originalUrl; }
augmentUrl
288,375
ExpirableExecutor (@NotNull Executor executor) { return AsyncExecutionService.getService().createExecutor(executor); }
on
288,376
void (T result) { myResult = result; }
setResult
288,377
XmlElement () { String prefix = System.getProperty(PlatformUtils.PLATFORM_PREFIX_KEY, ""); String appInfoData = getAppInfoData(); if (AppMode.isDevServer() && appInfoData.isEmpty()) { String module = null; if (prefix.isEmpty() || prefix.equals(PlatformUtils.IDEA_PREFIX)) { module = "intellij.idea.ultimate.customization"; } else if (prefix.equals(PlatformUtils.WEB_PREFIX)) { module = "intellij.webstorm"; } if (module != null) { Path file = Paths.get(PathManager.getHomePath() + "/out/classes/production/" + module + "/idea/" + (prefix.equals("idea") ? "" : prefix) + "ApplicationInfo.xml"); try { return XmlDomReader.readXmlAsModel(Files.newInputStream(file)); } catch (NoSuchFileException ignore) { } catch (Exception e) { throw new RuntimeException("Cannot load " + file, e); } } } else { // Gateway started from another IntelliJ-based IDE; same for Qodana if (prefix.equals(PlatformUtils.GATEWAY_PREFIX) || prefix.equals(PlatformUtils.QODANA_PREFIX)) { String customAppInfo = System.getProperty("idea.application.info.value"); if (customAppInfo != null) { try { Path file = Paths.get(customAppInfo); return XmlDomReader.readXmlAsModel(Files.newInputStream(file)); } catch (Exception e) { throw new RuntimeException("Cannot load custom application info file " + customAppInfo, e); } } } // this property is used when a product is started from distribution of another product boolean forceLoadingFromResources = "true".equals(System.getProperty("intellij.platform.load.app.info.from.resources")); if (!forceLoadingFromResources && !appInfoData.isEmpty()) { return XmlDomReader.readXmlAsModel(appInfoData.getBytes(StandardCharsets.UTF_8)); } } // from sources or from another product String resource = "idea/" + (prefix.equals("idea") ? "" : prefix) + "ApplicationInfo.xml"; InputStream stream = ApplicationNamesInfo.class.getClassLoader().getResourceAsStream(resource); if (stream == null) { throw new RuntimeException("Resource not found: " + resource); } try { return XmlDomReader.readXmlAsModel(stream); } catch (Exception e) { throw new RuntimeException("Cannot load resource: " + resource, e); } }
loadData
288,378
String () { // not easy to inject a byte array using ASM - it is not constant value return ""; }
getAppInfoData
288,379
XmlElement () { //noinspection SynchronizeOnThis synchronized (ApplicationNamesInfo.class) { XmlElement data = loadData(); if (instance == null) { instance = new ApplicationNamesInfo(data); } return data; } }
initAndGetRawData
288,380
ApplicationNamesInfo () { ApplicationNamesInfo result = instance; if (result == null) { //noinspection SynchronizeOnThis synchronized (ApplicationNamesInfo.class) { result = instance; if (result == null) { result = new ApplicationNamesInfo(loadData()); instance = result; } } } return result; }
getInstance
288,381
String () { String s = myProductName.toLowerCase(Locale.ENGLISH); return Character.isUpperCase(s.charAt(0)) ? s : Character.toUpperCase(s.charAt(0)) + s.substring(1); }
getLowercaseProductName
288,382
String () { return myScriptName; }
getScriptName
288,383
String () { return myMotto; }
getMotto
288,384
Future<Void> (@NotNull Runnable runnable, ModalityState modalityState) { return submit(() -> { runnable.run(); return null; }, modalityState); }
submit
288,385
void (@NotNull Runnable runnable) { invokeAndWait(runnable, ModalityState.defaultModalityState()); }
invokeAndWait
288,386
void (@NotNull Runnable runnable, ModalityState modalityState) { try { submit(runnable, modalityState).get(); } catch (InterruptedException ignore) { } catch (ExecutionException e) { ExceptionUtil.rethrowUnchecked(e.getCause()); } }
invokeAndWait
288,387
boolean (final T t) { return ReadAction.compute(() -> processInReadAction(t)); }
process
288,388
AppUIExecutor (@NotNull ModalityState modality) { return AsyncExecutionService.getService().createUIExecutor(modality); }
onUiThread
288,389
AppUIExecutor (@NotNull ModalityState modality) { return AsyncExecutionService.getService().createWriteThreadExecutor(modality); }
onWriteThread
288,390
AppUIExecutor () { return onUiThread(ModalityState.defaultModalityState()); }
onUiThread
288,391
AppUIExecutor () { return onWriteThread(ModalityState.defaultModalityState()); }
onWriteThread
288,392
void (@NotNull Runnable action) { compute((ThrowableComputable<Object, RuntimeException>)() -> { action.run(); return null; }); }
run
288,393
ModalityState () { return NON_MODAL; }
nonModal
288,394
ModalityState () { return ApplicationManager.getApplication().getCurrentModalityState(); }
current
288,395
ModalityState () { return ApplicationManager.getApplication().getAnyModalityState(); }
any
288,396
ModalityState (@NotNull Component component) { return ApplicationManager.getApplication().getModalityStateForComponent(component); }
stateForComponent
288,397
ModalityState () { return ApplicationManager.getApplication().getDefaultModalityState(); }
defaultModalityState
288,398
Language () { return myLanguage; }
getLanguage
288,399
boolean () { return false; }
isBinary