Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
265,300
DownloadableFileDescription (@NotNull String downloadUrl, @NotNull String fileName) { return new DownloadableFileDescriptionImpl(downloadUrl, FileUtilRt.getNameWithoutExtension(fileName), FileUtilRt.getExtension(fileName)); }
createFileDescription
265,301
DownloadableFileSetVersions<DownloadableFileSetDescription> (@Nullable String groupId, URL @NotNull ... localUrls) { return new FileSetVersionsFetcherBase<>(groupId, localUrls) { @Override protected DownloadableFileSetDescription createVersion(Artifact version, List<? extends DownloadableFileDescription> files) { retur...
createFileSetVersions
265,302
DownloadableFileSetDescription (Artifact version, List<? extends DownloadableFileDescription> files) { return new DownloadableFileSetDescriptionImpl<>(version.getName(), version.getVersion(), files); }
createVersion
265,303
DownloadableFileDescription (ArtifactItem item, String url, String prefix) { return DownloadableFileService.getInstance().createFileDescription(url, item.getName()); }
createFileDescription
265,304
FileDownloader (@NotNull DownloadableFileSetDescription description) { return createDownloader(description.getFiles(), description.getName()); }
createDownloader
265,305
FileDownloader (@NotNull List<? extends DownloadableFileDescription> fileDescriptions, @NotNull String presentableDownloadName) { return new FileDownloaderImpl(fileDescriptions, null, null, presentableDownloadName); }
createDownloader
265,306
FileDownloader (final List<? extends DownloadableFileDescription> fileDescriptions, final @Nullable Project project, JComponent parent, @NotNull String presentableDownloadName) { return new FileDownloaderImpl(fileDescriptions, project, parent, presentableDownloadName); }
createDownloader
265,307
IdeScriptEngineManager () { return ApplicationManager.getApplication().getService(IdeScriptEngineManager.class); }
getInstance
265,308
void (@NotNull IdeaPluginDescriptor pluginDescriptor, boolean isUpdate) { dropFactories(); }
beforePluginUnload
265,309
void (@NotNull IdeaPluginDescriptor pluginDescriptor, boolean isUpdate) { }
pluginUnloaded
265,310
void (@NotNull IdeaPluginDescriptor pluginDescriptor) { dropFactories(); }
pluginLoaded
265,311
List<EngineInfo> () { return new ArrayList<>(getFactories().keySet()); }
getEngineInfos
265,312
void () { myFactories.drop(); }
dropFactories
265,313
void (@NotNull IdeScriptEngine engine) { final class Log extends Writer { private final boolean error; private Log(boolean error) { this.error = error; } @Override public void flush() { } @Override public void close() { } @Override public void write(char[] cbuf, int off, int len) { while (len > 0 && Character.isWhitesp...
redirectOutputToLog
265,314
void () { }
flush
265,315
void () { }
close
265,316
void (char[] cbuf, int off, int len) { while (len > 0 && Character.isWhitespace(cbuf[off + len - 1])) len--; if (len == 0) return; String s = new String(cbuf, off, len); if (error) { LOG.warn(s); } else { LOG.info(s); } }
write
265,317
Object (@NotNull String name) { return myEngine.get(name); }
getBinding
265,318
void (@NotNull String name, Object value) { myEngine.put(name, value); }
setBinding
265,319
Writer () { return myEngine.getContext().getWriter(); }
getStdOut
265,320
void (@NotNull Writer writer) { myEngine.getContext().setWriter(writer); }
setStdOut
265,321
Writer () { return myEngine.getContext().getErrorWriter(); }
getStdErr
265,322
void (@NotNull Writer writer) { myEngine.getContext().setErrorWriter(writer); }
setStdErr
265,323
Reader () { return myEngine.getContext().getReader(); }
getStdIn
265,324
void (@NotNull Reader reader) { myEngine.getContext().setReader(reader); }
setStdIn
265,325
String () { return myEngine.getFactory().getLanguageName(); }
getLanguage
265,326
List<String> () { return myEngine.getFactory().getExtensions(); }
getFileExtensions
265,327
boolean (String name) { // allow plugin engines but suppress all other resources return "META-INF/services/javax.script.ScriptEngineFactory".equals(name); }
isAllowedPluginResource
265,328
URL (String name) { if (isAllowedPluginResource(name)) { for (IdeaPluginDescriptor descriptor : PluginManagerCore.getPlugins()) { ClassLoader l = descriptor.getPluginClassLoader(); URL url = l == null ? null : l.getResource(name); if (url != null) return url; } } return getClass().getClassLoader().getResource(name); }
findResource
265,329
List<URL> () { return JBIterable.of(PluginManagerCore.getPlugins()) .map(PluginDescriptor::getClassLoader) .unique() .flatMap(o -> { try { return (List<URL>)o.getClass().getMethod("getUrls").invoke(o); } catch (Exception e) { return Collections.emptyList(); } }) .unique() .toList(); }
getUrls
265,330
FileTemplateManager (@NotNull Project project) { return project.getService(FileTemplateManager.class).checkInitialized(); }
getInstance
265,331
FileTemplateManager () { return this; }
checkInitialized
265,332
FileTemplateManager () { return getDefaultInstance(); }
getInstance
265,333
FileTemplateManager () { return getInstance(ProjectManager.getInstance().getDefaultProject()); }
getDefaultInstance
265,334
Properties (@NotNull Project project) { Properties properties = getDefaultProperties(); properties.setProperty(PROJECT_NAME_VARIABLE, project.getName()); return properties; }
getDefaultProperties
265,335
String () { return PathManager.getConfigDir().resolve(TEMPLATES_DIR).toString(); }
getTemplatesDir
265,336
Project () { return ProjectManager.getInstance().getDefaultProject(); }
getProject
265,337
String () { return myName; }
getName
265,338
MeasureUnit (@NotNull TimeUnit timeUnit) { return switch (timeUnit) { case NANOSECONDS -> MeasureUnit.NANOSECOND; case MICROSECONDS -> MeasureUnit.MICROSECOND; case MILLISECONDS -> MeasureUnit.MILLISECOND; case SECONDS -> MeasureUnit.SECOND; case MINUTES -> MeasureUnit.MINUTE; case HOURS -> MeasureUnit.HOUR; case DAYS ...
convert
265,339
NlsDurationFormatter (boolean padded) { this.padded = padded; return this; }
setPadded
265,340
NlsDurationFormatter (boolean narrow) { this.narrow = narrow; return this; }
setNarrow
265,341
NlsDurationFormatter (int maxFragments) { this.maxFragments = maxFragments; return this; }
setMaxFragments
265,342
NlsDurationFormatter (@NotNull TimeUnit durationTimeUnit) { this.durationTimeUnit = convert(durationTimeUnit); return this; }
setDurationTimeUnit
265,343
NlsDurationFormatter (@NotNull MeasureUnit durationTimeUnit) { if ( durationTimeUnit != MeasureUnit.NANOSECOND && durationTimeUnit != MeasureUnit.MICROSECOND && durationTimeUnit != MeasureUnit.MILLISECOND && durationTimeUnit != MeasureUnit.SECOND && durationTimeUnit != MeasureUnit.MINUTE && durationTimeUnit != MeasureU...
setDurationMeasureTimeUnit
265,344
CachedFormats () { CachedFormats formats = ourFormats; Locale locale = DynamicBundle.getLocale(); if (formats == null || formats.locale != locale) { // Not a big problem if two identical formats are created concurrently, // so we can skip locking and CAS ourFormats = formats = new CachedFormats(locale); } return format...
getFormats
265,345
boolean (@NotNull Object data, @NotNull String dataId, @NotNull Object source) { if (isPsiElementProvided(data) && EDT.isCurrentThreadEdt() && SlowOperations.isInSection(SlowOperations.FORCE_ASSERT)) { reportPsiElementOnEdt(dataId, source); } //noinspection unchecked Validator<Object>[] validators = (Validator<Object>[...
isDataValid
265,346
boolean (@Nullable Object data) { if (data instanceof PsiElement && !(data instanceof FakePsiElement)) return true; if (data instanceof Object[] array) return isPsiElementProvided(ArrayUtil.getFirstElement(array)); if (data instanceof Collection<?> collection) return isPsiElementProvided(ContainerUtil.getFirstItem(coll...
isPsiElementProvided
265,347
void (@NotNull String dataId, @NotNull Object source) { LOG.error(PluginException.createByClass( "PSI element is provided on EDT by " + source.getClass().getName() + ".getData(\"" + dataId + "\"). " + "Please move that to a BGT data provider using PlatformCoreDataKeys.BGT_DATA_PROVIDER", null, source.getClass())); }
reportPsiElementOnEdt
265,348
void (@NotNull String dataId, @NotNull Object source, @NotNull ClassCastException ex) { LOG.error(PluginException.createByClass( "Object of incorrect type provided by " + source.getClass().getName() + ".getData(\"" + dataId + "\")", ex, source.getClass())); }
reportObjectOfIncorrectType
265,349
boolean (@NotNull Path file) { return Files.isDirectory(file.resolve(Project.DIRECTORY_STORE_FOLDER)) || (Strings.endsWith(file.toString(), ProjectFileType.DOT_DEFAULT_EXTENSION) && Files.isRegularFile(file)); }
isValidProjectPath
265,350
GetDataRuleType (@NotNull String value) { return GetDataRuleType.valueOf(StringUtil.toUpperCase(value)); }
fromString
265,351
String (@NotNull GetDataRuleType value) { return value.name(); }
toString
265,352
DataContext (Component component) { ThreadingAssertions.assertEventDispatchThread(); if (ourGetDataLevel.get()[0] > 0) { LOG.error("DataContext shall not be created and queried inside another getData() call."); } if (component instanceof DependentTransientComponent) { LOG.assertTrue(getDataProviderEx(component) == null...
getDataContext
265,353
DataContext (@NotNull Component component, int x, int y) { if (x < 0 || x >= component.getWidth() || y < 0 || y >= component.getHeight()) { throw new IllegalArgumentException("wrong point: x=" + x + "; y=" + y); } // Point inside JTabbedPane has special meaning. If point is inside tab bounds then // we construct DataCo...
getDataContext
265,354
DataContext () { Component component = null; if (Registry.is("actionSystem.getContextByRecentMouseEvent", false)) { component = IdeUiService.getInstance().getComponentFromRecentMouseEvent(); } return getDataContext(component != null ? component : getFocusedComponent()); }
getDataContext
265,355
Promise<DataContext> () { AsyncPromise<DataContext> result = new AsyncPromise<>(); IdeFocusManager.getGlobalInstance() .doWhenFocusSettlesDown(() -> result.setResult(getDataContext()), ModalityState.defaultModalityState()); return result; }
getDataContextFromFocusAsync
265,356
ProgressIndicator (@NotNull ProgressIndicator progress, @NotNull Disposable parentDisposable) { ApplicationManager.getApplication().addApplicationListener(new ApplicationListener() { @Override public void beforeWriteActionStart(@NotNull Object action) { if (!progress.isCanceled()) { progress.cancel(); } } }, parentDisp...
forceWriteActionPriority
265,357
void (@NotNull Object action) { if (!progress.isCanceled()) { progress.cancel(); } }
beforeWriteActionStart
265,358
void (@NotNull ReadTask task) { scheduleWithWriteActionPriority(new ProgressIndicatorBase(false, false), task); }
scheduleWithWriteActionPriority
265,359
boolean (@NotNull Runnable action, @Nullable ProgressIndicator progressIndicator) { AtomicBoolean readActionAcquired = new AtomicBoolean(); boolean executed = runWithWriteActionPriority(() -> readActionAcquired.set(ApplicationManagerEx.getApplicationEx().tryRunReadAction(action)), progressIndicator == null ? new Progre...
runInReadActionWithWriteActionPriority
265,360
boolean (@NotNull Runnable action) { return runInReadActionWithWriteActionPriority(action, null); }
runInReadActionWithWriteActionPriority
265,361
boolean (@NotNull Runnable action, @NotNull ProgressIndicator progressIndicator) { ApplicationEx application = (ApplicationEx)ApplicationManager.getApplication(); application.assertIsNonDispatchThread(); Runnable cancellation = indicatorCancellation(progressIndicator); if (isWriteActionRunningOrPending(application)) { ...
runWithWriteActionPriority
265,362
void () { ProgressIndicatorUtilService.getInstance(ApplicationManager.getApplication()).cancelActionsToBeCancelledBeforeWrite(); }
cancelActionsToBeCancelledBeforeWrite
265,363
boolean (@NotNull ApplicationEx application, @NotNull Runnable cancellation, @NotNull Runnable action) { return ProgressIndicatorUtilService.getInstance(application).runActionAndCancelBeforeWrite(cancellation, action); }
runActionAndCancelBeforeWrite
265,364
AccessToken (@NotNull Application application) { return ProgressIndicatorUtilService.getInstance(application).prohibitWriteActionsInside(); }
prohibitWriteActionsInside
265,365
Runnable (@NotNull ProgressIndicator progressIndicator) { return () -> { if (!progressIndicator.isCanceled()) { progressIndicator.cancel(); } }; }
indicatorCancellation
265,366
boolean (@NotNull ApplicationEx application) { return application.isWriteActionPending() || application.isWriteActionInProgress(); }
isWriteActionRunningOrPending
265,367
void (@NotNull Object action) { if (!progressIndicator.isCanceled()) { progressIndicator.cancel(); readTask.onCanceled(progressIndicator); } }
beforeWriteActionStart
265,368
void () { ReadTask.Continuation continuation; try { continuation = runUnderProgress(progressIndicator, readTask); } catch (Throwable e) { future.completeExceptionally(e); throw e; } if (continuation == null) { future.complete(null); } else if (!future.isCancelled()) { application.invokeLater(new Runnable() { @Override ...
run
265,369
void () { if (future.isCancelled()) return; Disposer.dispose(listenerDisposable); // remove listener early to prevent firing it during continuation execution try { if (!progressIndicator.isCanceled()) { continuation.getAction().run(); } } finally { future.complete(null); } }
run
265,370
String () { return "continuation of " + readTask; }
toString
265,371
String () { return readTask.toString(); }
toString
265,372
void (@Nullable ProgressIndicator indicator) { Application application = ApplicationManager.getApplication(); if (application.isReadAccessAllowed()) { throw new IllegalStateException("Mustn't be called from within read action"); } application.assertIsNonDispatchThread(); Semaphore semaphore = new Semaphore(1); applicat...
yieldToPendingWriteActions
265,373
void () { yieldToPendingWriteActions(ProgressIndicatorProvider.getGlobalProgressIndicator()); }
yieldToPendingWriteActions
265,374
void (long millis) { long start = System.nanoTime(); awaitWithCheckCanceled(() -> { if (TimeoutUtil.getDurationMillis(start) > millis) return true; TimeoutUtil.sleep(ConcurrencyUtil.DEFAULT_TIMEOUT_MS); return false; }); }
awaitWithCheckCanceled
265,375
void (@NotNull Condition condition) { awaitWithCheckCanceled(() -> condition.await(ConcurrencyUtil.DEFAULT_TIMEOUT_MS, TimeUnit.MILLISECONDS)); }
awaitWithCheckCanceled
265,376
void (@NotNull CountDownLatch waiter) { awaitWithCheckCanceled(() -> waiter.await(ConcurrencyUtil.DEFAULT_TIMEOUT_MS, TimeUnit.MILLISECONDS)); }
awaitWithCheckCanceled
265,377
void (@NotNull Lock lock) { awaitWithCheckCanceled(() -> lock.tryLock(ConcurrencyUtil.DEFAULT_TIMEOUT_MS, TimeUnit.MILLISECONDS)); }
awaitWithCheckCanceled
265,378
void (@NotNull ThrowableComputable<Boolean, ? extends Exception> waiter) { ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); boolean success = false; while (!success) { checkCancelledEvenWithPCEDisabled(indicator); try { success = waiter.compute(); } catch (ProcessCanceledException pce...
awaitWithCheckCanceled
265,379
void (@Nullable ProgressIndicator indicator) { boolean isNonCancelable = Cancellation.isInNonCancelableSection(); if (isNonCancelable || indicator == null) { ((CoreProgressManager)ProgressManager.getInstance()).runCheckCanceledHooks(indicator); } if (isNonCancelable) return; Cancellation.checkCancelled(); if (indicator...
checkCancelledEvenWithPCEDisabled
265,380
void (@NotNull Semaphore semaphore, @Nullable ProgressIndicator indicator) { while (!semaphore.waitFor(ConcurrencyUtil.DEFAULT_TIMEOUT_MS)) { checkCancelledEvenWithPCEDisabled(indicator); } }
awaitWithCheckCanceled
265,381
void () { ProgressIndicator indicator = ProgressIndicatorProvider.getGlobalProgressIndicator(); if (indicator instanceof PingProgress && EDT.isCurrentThreadEdt()) { ((PingProgress)indicator).interact(); } }
interactWithEdtProgress
265,382
ProgressIndicator (@NotNull Function<? super ProgressIndicator, /*@NotNull*/ ? extends Runnable> backgroundTask, @Nullable Runnable onSlowAction) { return executeAndTryWait(backgroundTask, onSlowAction, ProgressIndicatorWithDelayedPresentation.DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS, false); }
executeAndTryWait
265,383
ProgressIndicator (@NotNull Function<? super ProgressIndicator, /*@NotNull*/ ? extends Runnable> backgroundTask, @Nullable Runnable onSlowAction, long waitMillis, boolean forceEDT) { ModalityState modality = ModalityState.current(); if (forceEDT) { ProgressIndicator indicator = new EmptyProgressIndicator(modality); try...
executeAndTryWait
265,384
void (@NotNull Runnable result, @NotNull ProgressIndicator indicator) { if (!indicator.isCanceled()) result.run(); }
finish
265,385
Disposable () { return parent; }
getParent
265,386
ProgressIndicator () { return indicator; }
getIndicator
265,387
CompletableFuture<T> () { return future; }
getFuture
265,388
void () { indicator.cancel(); }
cancel
265,389
ProgressIndicator (@NotNull Disposable parent, @NotNull Runnable runnable) { return execute(AppExecutorUtil.getAppExecutorService(), parent, runnable); }
executeOnPooledThread
265,390
ProgressIndicator (@NotNull Executor executor, @NotNull Disposable parent, @NotNull Runnable runnable) { return submitTask(executor, parent, runnable).indicator; }
execute
265,391
void (@NotNull Future<?> future, @NotNull @NlsSafe String taskName) { try { future.get(1, TimeUnit.SECONDS); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof ProcessCanceledException || cause instanceof CancellationException) { // ignore: expected cancellation } else { LOG.error(e);...
tryAwaitFuture
265,392
void (@NotNull Disposable parent, @NotNull Runnable task) { runUnderDisposeAwareIndicator(parent, task, ProgressManager.getInstance().getProgressIndicator()); }
runUnderDisposeAwareIndicator
265,393
void (@NotNull Disposable parent, @NotNull Runnable task, @Nullable ProgressIndicator parentIndicator) { final ProgressIndicator indicator = parentIndicator instanceof StandardProgressIndicator ? new SensitiveProgressWrapper(parentIndicator) : new EmptyProgressIndicator(ModalityState.defaultModalityState()); Disposable...
runUnderDisposeAwareIndicator
265,394
boolean (@NotNull Disposable parent, @NotNull Disposable disposable) { if (parent instanceof ComponentManager && ((ComponentManager)parent).isDisposed()) { return false; } return Disposer.tryRegister(parent, disposable); }
registerIfParentNotDisposed
265,395
boolean (T result) { boolean isFast = myResultRef.compareAndSet(INITIAL_STATE, result); mySemaphore.release(); return isFast; }
setResult
265,396
boolean (long waitMillis) { try { mySemaphore.tryAcquire(waitMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException ignore) { } return !myResultRef.compareAndSet(INITIAL_STATE, SLOW_OPERATION_STATE); }
await
265,397
T () { Object result = myResultRef.get(); assert result != INITIAL_STATE && result != SLOW_OPERATION_STATE; //noinspection unchecked return (T)result; }
getResult
265,398
ModalityState () { return myModalityState; }
getModalityState
265,399
Runnable () { return myAction; }
getAction