Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
287,400
int () { return myChars.length; }
length
287,401
String (int start, int end) { return myText.substring(start, end); }
substring
287,402
String (String @NotNull [] lines) { StringBuilder buffer = new StringBuilder(); for (String line : lines) { buffer.append(line); } return buffer.substring(0, buffer.length()); }
concatLines
287,403
String (@NotNull String text) { return concatLines(new LineTokenizer(text).execute()); }
correctLineSeparators
287,404
void (List<? super T> lines) { while (notAtEnd()) { int begin = myIndex; skipToEOL(); int endIndex = myIndex; boolean appendNewLine = false; if (notAtEnd() && isAtEOL()) { if (charAt(endIndex) == '\n') { endIndex++; } else { appendNewLine = true; } skipEOL(); } addLine(lines, begin, endIndex, appendNewLine); } }
doExecute
287,405
void () { int eolStart = myIndex; boolean nFound = false; boolean rFound = false; while (notAtEnd()) { boolean n = charAt(myIndex) == '\n'; boolean r = charAt(myIndex) == '\r'; if (!n && !r) { break; } if ((nFound && n) || (rFound && r)) { break; } nFound |= n; rFound |= r; myIndex++; } if (myLineSeparatorStart == -1) { myLineSeparatorStart = eolStart; myLineSeparatorEnd = myIndex; } }
skipEOL
287,406
String () { if (myLineSeparatorStart == -1) return null; return substring(myLineSeparatorStart, myLineSeparatorEnd); }
getLineSeparator
287,407
void () { while (notAtEnd() && !isAtEOL()) { myIndex++; } }
skipToEOL
287,408
boolean () { return myIndex < length(); }
notAtEnd
287,409
boolean () { return charAt(myIndex) == '\r' || charAt(myIndex) == '\n'; }
isAtEOL
287,410
DiffContent (@NotNull String text, @NotNull FileType fileType) { return DiffContentFactory.getInstance().create(text, fileType); }
createContent
287,411
DiffManager () { return ApplicationManager.getApplication().getService(DiffManager.class); }
getInstance
287,412
Component () { return myParent; }
getParent
287,413
Consumer<WindowWrapper> () { return myWindowConsumer; }
getWindowConsumer
287,414
DiffRequestFactory () { return ApplicationManager.getApplication().getService(DiffRequestFactory.class); }
getInstance
287,415
DiffContentFactory () { return ApplicationManager.getApplication().getService(DiffContentFactory.class); }
getInstance
287,416
DiffApplicationSettings () { return ApplicationManager.getApplication().getService(DiffApplicationSettings.class); }
getInstance
287,417
DiffApplicationSettings () { return this; }
getState
287,418
void (@NotNull DiffApplicationSettings state) { XmlSerializerUtil.copyBean(state, this); }
loadState
287,419
DiffManagerEx () { return (DiffManagerEx)DiffManager.getInstance(); }
getInstance
287,420
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LineCol col = (LineCol)o; if (line != col.line) return false; if (column != col.column) return false; return true; }
equals
287,421
int () { int result = line; result = 31 * result + column; return result; }
hashCode
287,422
String () { return String.format("{ line: %s, column: %s }", line, column); }
toString
287,423
LineCol (@NotNull Document document, int offset) { if (offset < document.getTextLength()) { int line = document.getLineNumber(offset); int column = offset - document.getLineStartOffset(line); return new LineCol(line, column); } else { int line = Math.max(0, document.getLineCount() - 1); int column = document.getLineEndOffset(line) - document.getLineStartOffset(line); return new LineCol(line, column); } }
fromOffset
287,424
LineCol (@NotNull Editor editor) { return fromOffset(editor.getDocument(), editor.getCaretModel().getOffset()); }
fromCaret
287,425
int (@NotNull Document document, @NotNull LineCol linecol) { return linecol.toOffset(document); }
toOffset
287,426
int (@NotNull Document document, int line, int col) { return new LineCol(line, col).toOffset(document); }
toOffset
287,427
int (@NotNull Document document) { if (line >= document.getLineCount()) return document.getTextLength(); return Math.min(document.getLineStartOffset(line) + column, document.getLineEndOffset(line)); }
toOffset
287,428
int (@NotNull Editor editor) { return toOffset(editor.getDocument()); }
toOffset
287,429
boolean (int start, int end) { return this.start <= start && this.end >= end; }
contains
287,430
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LineRange range = (LineRange)o; if (start != range.start) return false; if (end != range.end) return false; return true; }
equals
287,431
int () { int result = start; result = 31 * result + end; return result; }
hashCode
287,432
String () { return "[" + start + ", " + end + ")"; }
toString
287,433
boolean () { return start == end; }
isEmpty
287,434
DiffRequestProducer () { return myProducer; }
getProducer
287,435
Throwable () { return myException; }
getException
287,436
String (@NotNull Throwable e) { String message = e.getMessage(); return StringUtil.isEmptyOrSpaces(message) ? DiffBundle.message("error.cant.show.diff.message") : message; }
getErrorMessage
287,437
List<DiffContent> () { return myContents; }
getContents
287,438
List<String> () { return myContentTitles; }
getContentTitles
287,439
String () { return myTitle; }
getTitle
287,440
void (boolean isAssigned) { for (DiffContent content : myContents) { content.onAssigned(isAssigned); } }
onAssigned
287,441
String () { return super.toString() + ":" + getContents(); }
toString
287,442
void (boolean isAssigned) { }
onAssigned
287,443
List<VirtualFile> () { List<VirtualFile> files = ContainerUtil.mapNotNull(getContents(), content -> { return content instanceof FileContent ? ((FileContent)content).getFile() : null; }); return ContainerUtil.filter(files, file -> file.isInLocalFileSystem()); }
getFilesToRefresh
287,444
void (boolean isAssigned) { }
onAssigned
287,445
List<VirtualFile> () { return Collections.emptyList(); }
getFilesToRefresh
287,446
String () { return myTitle; }
getTitle
287,447
String () { return myMessage; }
getMessage
287,448
void (@Nullable @NlsContexts.DialogTitle String title) { myTitle = title; }
setTitle
287,449
void (@NotNull @Nls String message) { myMessage = message; }
setMessage
287,450
void (boolean isAssigned) { }
onAssigned
287,451
void (@NotNull MergeResult result) { }
applyResult
287,452
boolean () { return true; }
checkIsValid
287,453
void (@NotNull Listener listener, @NotNull Disposable disposable) { }
addListener
287,454
void (@NotNull MergeResult result) { callback.consume(result); }
applyResult
287,455
MergeCallback (@NotNull MergeRequest request) { MergeCallback callback = request.getUserData(KEY); return callback != null ? callback : EMPTY; }
getCallback
287,456
void (@NotNull MergeRequest original, @NotNull MergeRequest target) { MergeCallback callback = original.getUserData(KEY); original.putUserData(KEY, null); register(target, callback); }
retarget
287,457
void (boolean assigned) { }
onAssigned
287,458
DiffRequestProducer (@NotNull FilePath filePath, @NotNull ThrowableComputable<? extends DiffRequest, Throwable> producer) { return new MyDiffRequestProducer(filePath.getPath(), filePath.getFileType(), producer); }
create
287,459
DiffRequestProducer (@NotNull @Nls String name, @NotNull ThrowableComputable<? extends DiffRequest, Throwable> producer) { return new MyDiffRequestProducer(name, null, producer); }
create
287,460
String () { return myName; }
getName
287,461
int () { return myIndex; }
getIndex
287,462
void (int index) { assert index == 0 || index > 0 && index < getRequests().size(); myIndex = index; }
setIndex
287,463
SimpleDiffRequestChain (@NotNull DiffRequestProducer producer) { return fromProducers(Collections.singletonList(producer)); }
fromProducer
287,464
SimpleDiffRequestChain (@NotNull List<? extends DiffRequestProducer> producers) { return fromProducers(producers, -1); }
fromProducers
287,465
SimpleDiffRequestChain (@NotNull List<? extends DiffRequestProducer> producers, int selectedIndex) { return fromProducers(ListSelection.createAt(producers, selectedIndex)); }
fromProducers
287,466
SimpleDiffRequestChain (@NotNull ListSelection<? extends DiffRequestProducer> producers) { return new SimpleDiffRequestChain(producers, null); }
fromProducers
287,467
DiffRequest () { return myRequest; }
getRequest
287,468
String () { String title = myRequest.getTitle(); if (title != null) return title; return DiffBundle.message("diff.files.generic.request.title"); }
getName
287,469
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DiffRequestProducerWrapper wrapper = (DiffRequestProducerWrapper)o; return myRequest == wrapper.myRequest; }
equals
287,470
int () { return Objects.hash(myRequest); }
hashCode
287,471
FileType () { return null; }
getContentType
287,472
ComparisonManager () { return ApplicationManager.getApplication().getService(ComparisonManager.class); }
getInstance
287,473
ResourceBundle ( @NotNull String pathToBundle, @NotNull ClassLoader baseLoader, @NotNull ResourceBundle.Control control ) { return resolveResourceBundle( getBundleClassLoader(), baseLoader, loader -> super.findBundle(pathToBundle, loader, control) ); }
findBundle
287,474
ResourceBundle ( @NotNull ClassLoader bundleClassLoader, @NotNull ClassLoader baseLoader, @NotNull Function<? super @NotNull ClassLoader, ? extends @NotNull ResourceBundle> bundleResolver ) { ResourceBundle base = bundleResolver.apply(baseLoader); ClassLoader pluginClassLoader = languagePluginClassLoader(bundleClassLoader); if (pluginClassLoader == null) { return base; } ResourceBundle pluginBundle = bundleResolver.apply(pluginClassLoader); if (!setBundleParent(pluginBundle, base)) { return base; } return pluginBundle; }
resolveResourceBundle
287,475
boolean (@NotNull ResourceBundle pluginBundle, ResourceBundle base) { if (pluginBundle == base) { return true; } try { if (DynamicBundleInternal.SET_PARENT != null) { DynamicBundleInternal.SET_PARENT.bindTo(pluginBundle).invoke(base); } return true; } catch (Throwable e) { LOG.warn(e); return false; } }
setBundleParent
287,476
ResourceBundle (@NotNull @NonNls String pathToBundle, @NotNull ClassLoader loader) { return getResourceBundle(loader, pathToBundle); }
getResourceBundle
287,477
void (@NotNull PluginDescriptor pluginDescriptor) { this.pluginDescriptor = pluginDescriptor; }
setPluginDescriptor
287,478
ResourceBundle (@NotNull ClassLoader loader, @NotNull @NonNls String pathToBundle) { return (DefaultBundleService.isDefaultBundle() ? ourDefaultCache : ourCache) .computeIfAbsent(loader, __ -> CollectionFactory.createConcurrentSoftValueMap()) .computeIfAbsent(pathToBundle, __ -> resolveResourceBundle(loader, pathToBundle)); }
getResourceBundle
287,479
ResourceBundle (@NotNull ClassLoader loader, @NonNls @NotNull String pathToBundle) { return resolveResourceBundleWithFallback( () -> resolveResourceBundle( DynamicBundle.class.getClassLoader(), loader, bundleResolver(pathToBundle) ), loader, pathToBundle ); }
resolveResourceBundle
287,480
ResourceBundle (@NotNull String baseName) { Class<?> callerClass = ReflectionUtil.findCallerClass(2); return getBundle(baseName, callerClass == null ? DynamicBundle.class : callerClass); }
getBundle
287,481
ResourceBundle (@NotNull String baseName, @NotNull Class<?> formClass) { ResourceBundle rb = getResourceBundle(formClass.getClassLoader(), baseName); if (!BundleBase.SHOW_LOCALIZED_MESSAGES) { return rb; } return new ResourceBundle() { @Override protected Object handleGetObject(@NotNull String key) { Object get = rb.getObject(key); assert get instanceof String : "Language bundles should contain only strings"; return BundleBase.appendLocalizationSuffix((String)get, BundleBase.L10N_MARKER); } @Override public @NotNull Enumeration<String> getKeys() { return rb.getKeys(); } }; }
getBundle
287,482
Object (@NotNull String key) { Object get = rb.getObject(key); assert get instanceof String : "Language bundles should contain only strings"; return BundleBase.appendLocalizationSuffix((String)get, BundleBase.L10N_MARKER); }
handleGetObject
287,483
Enumeration<String> () { return rb.getKeys(); }
getKeys
287,484
void (@Nullable LanguageBundleEP langBundle) { if (langBundle != null) { ourLangTag = langBundle.locale; ourCache.clear(); } }
loadLocale
287,485
Locale () { return Locale.forLanguageTag(ourLangTag); }
getLocale
287,486
void (DynamicBundle.@NotNull LanguageBundleEP extension, @NotNull PluginDescriptor pluginDescriptor) { myMapProvider.drop(); }
extensionAdded
287,487
void (DynamicBundle.@NotNull LanguageBundleEP extension, @NotNull PluginDescriptor pluginDescriptor) { myMapProvider.drop(); }
extensionRemoved
287,488
void () { }
dispose
287,489
LocaleSensitiveApplicationCacheService () { return ApplicationManager.getApplication().getService(LocaleSensitiveApplicationCacheService.class); }
getInstance
287,490
Collection<Result> () { assertNotProcessing(); List<Result> result = new ArrayList<>(); Processor<Result> processor = Processors.cancelableCollectProcessor(result); forEach(processor); if (RANDOMIZE && result.size() > 1) { result.sort(CRAZY_ORDER); } return result; }
findAll
287,491
Iterator<Result> () { assertNotProcessing(); return new UnmodifiableIterator<>(Query.super.iterator()); }
iterator
287,492
void () { assert myIsProcessing.get() == null : "Operation is not allowed while query is being processed"; }
assertNotProcessing
287,493
Query<Result> () { return new AbstractQuery<Result>() { @Override protected boolean processResults(@NotNull Processor<? super Result> consumer) { return AbstractQuery.this.doProcessResults(consumer); } @Override public boolean forEach(@NotNull Processor<? super Result> consumer) { return processResults(consumer); } }; }
allowParallelProcessing
287,494
boolean (@NotNull Processor<? super Result> consumer) { return AbstractQuery.this.doProcessResults(consumer); }
processResults
287,495
boolean (@NotNull Processor<? super Result> consumer) { return processResults(consumer); }
forEach
287,496
Processor<Result> (@NotNull Processor<? super Result> consumer) { Object lock = ObjectUtils.sentinel("AbstractQuery lock"); return e -> { synchronized (lock) { return consumer.process(e); } }; }
threadSafeProcessor
287,497
boolean (@NotNull Processor<? super Result> consumer) { return doProcessResults(threadSafeProcessor(consumer)); }
forEach
287,498
boolean (@NotNull Processor<? super Result> consumer) { assertNotProcessing(); myIsProcessing.set(true); try { return processResults(consumer); } finally { myIsProcessing.remove(); } }
doProcessResults
287,499
boolean (@NotNull Processor<? super T> consumer) { return AbstractQuery.delegateProcessResults(query, ReadActionProcessor.wrapInReadAction(consumer)); }
processResults