Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
4,600
String (Iterable<? extends File> path, boolean caseSensitiveFS) { return null; // this will cause FileManager to delegate to JVM implementation }
inferBinaryName
4,601
ByteArrayOutputStream () { return new ByteArrayOutputStream() { private boolean isClosed = false; private synchronized boolean markClosed() { return !isClosed && (isClosed = true); } @Override public void close() throws IOException { if (markClosed()) { try { super.close(); } finally { myContent = new BinaryContent(buf...
openOutputStream
4,602
BinaryContent () { return myContent; }
getContent
4,603
void (@NotNull byte[] updatedContent) { myContent = new BinaryContent(updatedContent, 0, updatedContent.length); }
updateContent
4,604
boolean (Object s) { return s != null; }
fun
4,605
boolean (Iterable<?> iterable) { return isEmptyCollection(iterable) || !iterable.iterator().hasNext(); }
isEmpty
4,606
boolean (Iterable<?> iterable) { return iterable == null || iterable instanceof Collection && ((Collection<?>)iterable).isEmpty(); }
isEmptyCollection
4,607
Iterator<T> () { return getDelegate().iterator(); }
iterator
4,608
Iterable<T> () { Iterable<T> delegate = myDelegate; if (delegate == null) { myDelegate = delegate = provider.get(); } return delegate; }
getDelegate
4,609
Iterator<T> () { return flat(first.iterator(), second.iterator()); }
iterator
4,610
boolean () { return first.hasNext() || second.hasNext(); }
hasNext
4,611
T () { return first.hasNext()? first.next() : second.next(); }
next
4,612
Iterator<T> () { return flat(map(parts.iterator(), new Function<Iterable<? extends T>, Iterator<T>>() { @Override public Iterator<T> fun(Iterable<? extends T> itr) { return asIterator(itr); } })); }
iterator
4,613
Iterator<T> (Iterable<? extends T> itr) { return asIterator(itr); }
fun
4,614
boolean () { return findNext() != null; }
hasNext
4,615
T () { Iterator<T> group = findNext(); if (group != null) { return group.next(); } throw new NoSuchElementException(); }
next
4,616
Iterator<T> () { if (currentGroup == null || !currentGroup.hasNext()) { do { currentGroup = groupsIterator.hasNext() ? groupsIterator.next() : null; } while (currentGroup != null && !currentGroup.hasNext()); } return currentGroup; }
findNext
4,617
Iterator<T> () { return asIterator(elem); }
iterator
4,618
boolean () { return available; }
hasNext
4,619
T () { if (available) { available = false; return elem; } throw new NoSuchElementException(); }
next
4,620
Iterator<O> () { return map(from.iterator(), mapper); }
iterator
4,621
boolean () { return it.hasNext(); }
hasNext
4,622
O () { return mapper.fun(it.next()); }
next
4,623
Iterator<T> () { return filter(it.iterator(), predicate); }
iterator
4,624
boolean () { if (!isPending) { findNext(); } return isPending; }
hasNext
4,625
T () { try { if (!isPending) { findNext(); if (!isPending) { throw new NoSuchElementException(); } } return current; } finally { current = null; isPending = false; } }
next
4,626
void () { isPending = false; current = null; while (it.hasNext()) { final T next = it.next(); if (predicate.fun(next)) { isPending = true; current = next; break; } } }
findNext
4,627
Iterator<T> () { return filterWithOrder(from.iterator(), predicates.iterator()); }
iterator
4,628
Iterator<T> (BooleanFunction<? super T> pred) { if (!buffer.isEmpty()) { for (Iterator<T> it = buffer.iterator(); it.hasNext(); ) { final T elem = it.next(); if (pred.fun(elem)) { it.remove(); return asIterator(elem); } } } while(from.hasNext()) { final T elem = from.next(); if (pred.fun(elem)) { return asIterator(elem...
fun
4,629
Iterator<T> () { return unique(it.iterator()); }
iterator
4,630
boolean (T t) { if (processed == null) { processed = new HashSet<>(); } return processed.add(t); }
fun
4,631
Iterator<T> () { return filter(it.iterator(), predicateFactory.get()); }
iterator
4,632
Iterator<T> () { return new Object() { private final Set<T> traversed = new HashSet<>(); private Iterator<T> recurse(final T elem, boolean includeHead) { if (!traversed.add(elem)) { return Collections.emptyIterator(); } if (!includeHead) { return tailOf(elem); } return flat(asIterator(elem), new LazyIterator<T>() { @Ov...
iterator
4,633
Iterator<T> (final T elem, boolean includeHead) { if (!traversed.add(elem)) { return Collections.emptyIterator(); } if (!includeHead) { return tailOf(elem); } return flat(asIterator(elem), new LazyIterator<T>() { @Override protected Iterator<? extends T> create() { return tailOf(elem); } }); }
recurse
4,634
Iterator<T> (final T elem) { final Iterable<? extends T> tail = filter(step.fun(elem), new BooleanFunction<T>() { @Override public boolean fun(T e) { return !traversed.contains(e); } }); return flat(tail.iterator(), flat(map(tail.iterator(), new Function<T, Iterator<T>>() { @Override public Iterator<T> fun(T obj) { ret...
tailOf
4,635
boolean (T e) { return !traversed.contains(e); }
fun
4,636
Iterator<T> (T obj) { return recurse(obj, false); }
fun
4,637
Iterator<T> () { return new Object() { private final Set<T> visited = new HashSet<>(); private Iterator<T> recurse(final T elem, boolean includeHead) { if (!visited.add(elem)) { return Collections.emptyIterator(); } if (!includeHead) { return flat(map(step.fun(elem).iterator(), new Function<T, Iterator<T>>() { @Overrid...
iterator
4,638
Iterator<T> (final T elem, boolean includeHead) { if (!visited.add(elem)) { return Collections.emptyIterator(); } if (!includeHead) { return flat(map(step.fun(elem).iterator(), new Function<T, Iterator<T>>() { @Override public Iterator<T> fun(T obj) { return recurse(obj, true); } })); } Iterator<? extends T> tail = new...
recurse
4,639
Iterator<T> (T obj) { return recurse(obj, true); }
fun
4,640
Iterator<T> (T obj) { return recurse(obj, true); }
fun
4,641
void () { throw new UnsupportedOperationException(); }
remove
4,642
boolean () { return getDelegate().hasNext(); }
hasNext
4,643
T () { return getDelegate().next(); }
next
4,644
void () { getDelegate().remove(); }
remove
4,645
String (String path) { return path != null? path.replace('\\', '/') : null; }
convertPath
4,646
DiagnosticOutputConsumer () { return myDiagnosticSink; }
getDiagnosticSink
4,647
boolean (MessageLite message) { try { final JavacRemoteProto.Message msg = (JavacRemoteProto.Message)message; final JavacRemoteProto.Message.Type messageType = msg.getMessageType(); if (messageType == JavacRemoteProto.Message.Type.RESPONSE) { final JavacRemoteProto.Message.Response response = msg.getResponse(); final J...
handleMessage
4,648
boolean () { return myTerminatedSuccessfully; }
isTerminatedSuccessfully
4,649
Kind () { return myMessageKind; }
getKind
4,650
JavaFileObject () { return mySrcFileObject; }
getSource
4,651
long () { return myCompileMessage.hasProblemLocationOffset()? myCompileMessage.getProblemLocationOffset() : -1; }
getPosition
4,652
long () { return myCompileMessage.hasProblemBeginOffset()? myCompileMessage.getProblemBeginOffset() : -1; }
getStartPosition
4,653
long () { return myCompileMessage.hasProblemEndOffset()? myCompileMessage.getProblemEndOffset() : -1; }
getEndPosition
4,654
long () { return myCompileMessage.hasLine()? myCompileMessage.getLine() : -1; }
getLineNumber
4,655
long () { return myCompileMessage.hasColumn()? myCompileMessage.getColumn() : -1; }
getColumnNumber
4,656
String () { return null; }
getCode
4,657
String (Locale locale) { //noinspection HardCodedStringLiteral return myCompileMessage.hasText()? myCompileMessage.getText() : null; }
getMessage
4,658
boolean (T data) { return JpsFileObject.findKind(myToNameConverter.fun(data)) == JavaFileObject.Kind.OTHER; }
fun
4,659
boolean (T data) { final String name = myToNameConverter.fun(data); return name.regionMatches(true, name.length() - kind.extension.length(), kind.extension, 0, kind.extension.length()); }
fun
4,660
BooleanFunction<T> (final Set<JavaFileObject.Kind> kinds) { // optimization for a single-element collection final Iterator<JavaFileObject.Kind> it = kinds.iterator(); if (it.hasNext()) { final JavaFileObject.Kind kind = it.next(); if (!it.hasNext()) { return myFilterMap.get(kind); } } // OR-filter, quite rare case retu...
getFor
4,661
boolean (T data) { for (JavaFileObject.Kind kind : kinds) { if (myFilterMap.get(kind).fun(data)) { return true; } } return false; }
fun
4,662
File () { return myFile.getAbsoluteFile(); }
get
4,663
File () { return myFile; }
getFile
4,664
long () { return myFile.lastModified(); }
getLastModified
4,665
boolean () { return myFile.delete(); }
delete
4,666
String (Iterable<? extends File> path, final boolean caseSensitiveFS) { final String fPath = myFile.getPath(); for (File dir: path) { String dirPath = dir.getPath(); if (dirPath.length() == 0) { dirPath = System.getProperty("user.dir"); } if (!fPath.regionMatches(!caseSensitiveFS, 0, dirPath, 0, dirPath.length())) { co...
inferBinaryName
4,667
boolean (@NotNull String cn, JavaFileObject.Kind kind) { if (kind == Kind.OTHER && getKind() != kind) { return false; } final String n = cn + kind.extension; String name = myFile.getName(); if (name.equals(n)) { return true; } if (name.equalsIgnoreCase(n)) { // if we are on a case-insensitive file system, // try to com...
isNameCompatible
4,668
boolean (Object other) { if (this == other) { return true; } if (!(other instanceof InputFileObject)) { return false; } final InputFileObject o = (InputFileObject)other; return getAbsoluteFile().equals(o.getAbsoluteFile()); }
equals
4,669
int () { return getAbsoluteFile().hashCode(); }
hashCode
4,670
File () { return myAbsFile.get(); }
getAbsoluteFile
4,671
boolean (Iterable<? extends String> options, Iterable<? extends File> sources, Iterable<? extends File> classpath, Iterable<? extends File> platformClasspath, ModulePath modulePath, Iterable<? extends File> upgradeModulePath, Iterable<? extends File> sourcePath, final Map<File, Set<File>> outputDirToRoots, final Diagno...
compile
4,672
boolean (File file) { return !outputDirToRoots.containsKey(file); }
fun
4,673
void (String line) { if (usingJavac) { diagnosticListener.outputLineAvailable(line); } else { // todo: filter too verbose eclipse output? } }
lineAvailable
4,674
Iterable<Processor> (final APIWrappers.ProcessingContext procContext, @Nullable Iterable<String> processorNames) { try { Iterable<Processor> processors = null; if (hasLocation(procContext.getFileManager(), "ANNOTATION_PROCESSOR_MODULE_PATH")) { // this is equivalent to //processors = fileManager.getServiceLoader(Standa...
lookupAnnotationProcessors
4,675
boolean (Processor processor) { return procName.equals(processor.getClass().getName()); }
fun
4,676
Iterable<String> (Iterable<String> options) { for (Iterator<String> it = options.iterator(); it.hasNext(); ) { final String option = it.next(); if ("-processor".equals(option)) { return it.hasNext()? Arrays.asList(it.next().split(",")) : null; } } return null; }
getAnnotationProcessorNames
4,677
String (Throwable e) { return new Object() { @Nls final StringBuilder buf = new StringBuilder(); @Nls String collectAllMessages(Throwable e, Set<Throwable> processed) { if (e != null && processed.add(e)) { final String msg = e.getMessage(); if (msg != null && !msg.trim().isEmpty() && buf.indexOf(msg) < 0) { if (buf.len...
buildCompilerErrorMessage
4,678
boolean (Field field) { return contextClass.equals(field.getType()); }
fun
4,679
void (final Object obj, final StandardJavaFileManager delegateTo, final Set<Object> visited) { if (obj instanceof JavaFileManager && visited.add(obj)) { forEachField(obj.getClass(), new BooleanFunction<Field>() { @Override public boolean fun(Field field) { try { if (JavaFileManager.class.isAssignableFrom(field.getType(...
installCallDispatcherRecursively
4,680
boolean (Field field) { try { if (JavaFileManager.class.isAssignableFrom(field.getType())) { final Object value = field.get(obj); if (isClientCodeWrapper(value, delegateTo)) { field.set(obj, APIWrappers.wrap(StandardJavaFileManager.class, value, Object.class, delegateTo)); } else { installCallDispatcherRecursively(valu...
fun
4,681
boolean (final Object obj, final StandardJavaFileManager delegateTo) { return obj instanceof StandardJavaFileManager && findField(obj.getClass(), new BooleanFunction<Field>() { @Override public boolean fun(Field f) { try { return f.get(obj) == delegateTo; } catch (Throwable ignored) { return false; } } }) != null; }
isClientCodeWrapper
4,682
boolean (Field f) { try { return f.get(obj) == delegateTo; } catch (Throwable ignored) { return false; } }
fun
4,683
Field (final Class<?> aClass, final BooleanFunction<? super Field> cond) { final Field[] res = new Field[]{null}; forEachField(aClass, new BooleanFunction<Field>() { @Override public boolean fun(Field field) { if (!cond.fun(field)) { return true; // continue } res[0] = field; return false; // stop } }); return res[0]; ...
findField
4,684
boolean (Field field) { if (!cond.fun(field)) { return true; // continue } res[0] = field; return false; // stop }
fun
4,685
void (final Class<?> aClass, final BooleanFunction<? super Field> func) { for (Class<?> from = aClass; from != null && !Object.class.equals(from); from = from.getSuperclass()) { for (Field field : from.getDeclaredFields()) { try { if (!field.isAccessible()) { field.setAccessible(true); } if (!func.fun(field)) { return;...
forEachField
4,686
boolean (StandardJavaFileManager fileManager, String locationId) { final JavaFileManager.Location location = StandardLocation.locationFor(locationId); return location != null && fileManager.hasLocation(location); }
hasLocation
4,687
boolean (final Iterable<String> options) { return !Iterators.contains(options, "-proc:none"); }
isAnnotationProcessingEnabled
4,688
Iterable<String> (final Iterable<? extends String> options, @NotNull JavaCompilingTool compilingTool) { final List<String> result = new ArrayList<>(compilingTool.getDefaultCompilerOptions()); boolean skip = false; for (String option : options) { if (FILTERED_OPTIONS.contains(option)) { skip = true; continue; } if (!ski...
prepareOptions
4,689
void (Map<PathOption, String> args, PathOption option, Collection<? super File> container, boolean listDir) { final String path = args.get(option); if (path == null) { return; } final StringTokenizer tokenizer = new StringTokenizer(path, File.pathSeparator, false); while (tokenizer.hasMoreTokens()) { final File file = ...
appendFiles
4,690
boolean (Map<PathOption, String> container, String arg, Iterator<String> rest) { if (myIsSuffix) { if (arg.startsWith(myArgName)) { container.put(this, arg.substring(myArgName.length())); return true; } } else { if (arg.equals(myArgName)) { if (rest.hasNext()) { container.put(this, rest.next()); } return true; } } retu...
parse
4,691
String (File pathElement) { return myModulePath.getModuleName(pathElement); }
getExplodedAutomaticModuleName
4,692
boolean () { return myCanceledStatus.isCanceled(); }
isCanceled
4,693
StandardJavaFileManager () { return myStdManager; }
getStandardFileManager
4,694
void (final Diagnostic.Kind kind, @Nls String message) { myOutConsumer.report(new PlainMessageDiagnostic(kind, message)); }
reportMessage
4,695
void (@NotNull final OutputFileObject cls) { myOutputFileSink.save(cls); }
consumeOutputFile
4,696
void () { try { final Field freelistField = NameTableCleanupDataHolder.freelistField; final Object emptyList = NameTableCleanupDataHolder.emptyList; // both parameters should be non-null if properly initialized if (freelistField != null && emptyList != null) { // the access to static 'freeList' field is synchronized in...
cleanupJavacNameTable
4,697
void () { if (zipCacheCleanupPossible) { final Method clearMethod = ZipFileIndexCleanupDataHolder.cacheClearMethod; if (clearMethod != null) { final Method getter = ZipFileIndexCleanupDataHolder.cacheInstanceGetter; try { Object instance = getter != null? getter.invoke(null) : null; clearMethod.invoke(instance); } catc...
clearCompilerZipFileCache
4,698
void ( com.google.protobuf.ExtensionRegistryLite registry) { }
registerAllExtensions
4,699
void ( com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); }
registerAllExtensions