Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
38,900
Object (String className) { return myClassLoadingLocks == null ? this : myClassLoadingLocks.getOrCreateLock(className); }
getClassLoadingLock
38,901
Object[] (int s) { return s==0?ArrayUtilRt.EMPTY_OBJECT_ARRAY:new Object[s]; }
produce
38,902
LoaderData () { int uniques = myUsedNameFingerprints.size(); if (uniques > 20000) { // allow some growth for Idea main loader uniques += (int)(uniques * 0.03d); } NameFilter nameFilter = new NameFilter(uniques, PROBABILITY); StrippedLongOpenHashSet.SetIterator iterator = myUsedNameFingerprints.iterator(); while (iterat...
build
38,903
int (@NotNull String resourcePath) { int index = resourcePath.lastIndexOf('/'); int h = 0; for (int off = 0; off < index; off++) { h = 31 * h + resourcePath.charAt(off); } return h; }
getPackageNameHash
38,904
void (int hash, @NotNull IntObjectHashMap map, @NotNull Loader loader) { Object o = map.get(hash); if (o == null) { map.put(hash, loader); } else if (o instanceof Loader) { if (ClassPath.recordLoadingInfo) { assert loader != o; } map.put(hash, new Loader[]{(Loader)o, loader}); } else { Loader[] loadersArray = (Loader[]...
addResourceEntry
38,905
String (@NotNull String name) { int nameEnd = !name.isEmpty() && name.charAt(name.length() - 1) == '/' ? name.length() - 1 : name.length(); name = name.substring(name.lastIndexOf('/', nameEnd-1) + 1, nameEnd); if (name.endsWith(UrlClassLoader.CLASS_EXTENSION)) { String name1 = name; int $ = name1.indexOf('$'); if ($ !=...
transformName
38,906
void (long nameFingerprint) { int hash = (int)(nameFingerprint >> 32); int hash2 = (int)nameFingerprint; addIt(hash, hash2); }
addNameFingerprint
38,907
long (@NotNull String name) { int hash = name.hashCode(); int hash2 = StringHash.murmur(name, SEED); return ((long)hash << 32) | (hash2 & 0xFFFFFFFFL); }
toNameFingerprint
38,908
Object (@NotNull String className) { WeakLockReference lockReference = myMap.get(className); if (lockReference != null) { Object lock = lockReference.get(); if (lock != null) { return lock; } } Object newLock = new Object(); WeakLockReference newRef = new WeakLockReference(className, newLock, myQueue); while (true) { p...
getOrCreateLock
38,909
void () { while (true) { WeakLockReference ref = (WeakLockReference)myQueue.poll(); if (ref == null) break; myMap.remove(ref.myClassName, ref); } }
processQueue
38,910
void () { if (myClassPathManifestAttribute != null) return; synchronized (this) { try { if (myClassPathManifestAttribute != null) return; ZipFile zipFile = getZipFile(); try { Attributes manifestAttributes = null; ZipEntry entry = zipFile.getEntry(JarFile.MANIFEST_NAME); if (entry != null) { manifestAttributes = loadMa...
loadManifestAttributes
38,911
Attributes (InputStream stream) { try { try { return new Manifest(stream).getMainAttributes(); } finally { stream.close(); } } catch (Exception ignored) { } return null; }
loadManifestAttributes
38,912
URL () { return myUrl; }
getURL
38,913
String (@NotNull Attribute key) { loadManifestAttributes(); return myAttributes != null ? myAttributes.get(key) : null; }
getValue
38,914
void (@NotNull String message, @NotNull Throwable t) { if (myConfiguration.myLogErrorOnMissingJar) { LoggerRt.getInstance(JarLoader.class).error(message, t); } else { LoggerRt.getInstance(JarLoader.class).warn(message, t); } }
error
38,915
String () { return "JarLoader [" + myFilePath + "]"; }
toString
38,916
void (@NotNull File dir, @NotNull ClasspathCache.LoaderDataBuilder context) { context.addResourcePackageFromName(getRelativeResourcePath(dir)); final File[] files = dir.listFiles(); if (files == null) { return; } boolean containsClasses = false; for (File file : files) { final boolean isClass = file.getPath().endsWith(...
buildPackageCache
38,917
String (@NotNull File file) { return getRelativeResourcePath(file.getAbsolutePath()); }
getRelativeResourcePath
38,918
String (@NotNull String absFilePath) { String relativePath = absFilePath.substring(myRootDirAbsolutePath.length()); relativePath = relativePath.replace(File.separatorChar, '/'); relativePath = relativePath.startsWith("/") ? relativePath.substring(1) : relativePath; return relativePath; }
getRelativeResourcePath
38,919
DirEntry (@NotNull DirEntry lastEntry, @NotNull String name, int prevIndex, int nameEnd, int nameHash) { DirEntry nextEntry = null; DirEntry[] directories = lastEntry.childrenDirectories; // volatile read if (directories != null) { //noinspection ForLoopReplaceableByForEach for (int index = 0, len = directories.length;...
findOrCreateNextDirEntry
38,920
boolean (@NotNull DirEntry lastEntry, @NotNull String name, int prevIndex, int nameHash) { int[] childrenNameHashes = lastEntry.childrenNameHashes; // volatile read if (childrenNameHashes == null) { String[] list = (prevIndex != 0 ? new File(myRootDir, name.substring(0, prevIndex)) : myRootDir).list(); if (list != null...
nameHashIsPresentInChildren
38,921
void (@NotNull ClasspathCache.LoaderData data) { if (!myConfiguration.myCanHavePersistentIndex) return; long started = System.nanoTime(); File index = getIndexFileFile(); DataOutput writer = null; boolean isOk = false; try { writer = new UnsyncDataOutputStream(new BufferedOutputStream(new FileOutputStream(index))); Dat...
trySaveToIndex
38,922
File () { return new File(myRootDir, "classpath.index"); }
getIndexFileFile
38,923
URL () { return myUrl; }
getURL
38,924
String () { return "FileLoader [" + myRootDir + "]"; }
toString
38,925
void () { //noinspection UseOfSystemOutOrSystemErr System.out.println("Classloading requests: " + ClassPath.class.getClassLoader() + "," + ourTotalRequests + ", time:" + (ourTotalTime.get() / 1000000) + "ms"); }
run
38,926
long () { return ourTotalTime.get(); }
getTotalTime
38,927
long () { return ourTotalRequests.get(); }
getTotalRequests
38,928
void (List<URL> urls) { if (!urls.isEmpty()) { synchronized (myUrls) { for (int i = urls.size() - 1; i >= 0; i--) { myUrls.add(urls.get(i)); } myAllUrlsWereProcessed = false; } } }
push
38,929
Resource (@NotNull String s) { final long started = startTiming(); Resource resource = null; try { String shortName = ClasspathCache.transformName(s); int i; if (myCanUseCache) { boolean allUrlsWereProcessed = myAllUrlsWereProcessed; i = allUrlsWereProcessed ? 0 : myLastLoaderProcessed.get(); resource = myCache.iterate...
getResource
38,930
Enumeration<URL> (final String name) { return new MyEnumeration(name); }
getResources
38,931
Loader (int i) { if (i < myLastLoaderProcessed.get()) { // volatile read return myLoaders.get(i); } return getLoaderSlowPath(i); }
getLoader
38,932
boolean () { if (myRes != null) return true; long started = startTiming(); try { Loader loader; if (myLoaders != null) { while (myIndex < myLoaders.size()) { loader = myLoaders.get(myIndex++); if (!loader.containsName(myName, myShortName)) { myRes = null; continue; } myRes = loader.getResource(myName); if (myRes != nul...
next
38,933
boolean () { return next(); }
hasMoreElements
38,934
URL () { if (!next()) { throw new NoSuchElementException(); } else { Resource resource = myRes; myRes = null; return resource.getURL(); } }
nextElement
38,935
Resource (@NotNull Loader loader, @NotNull String s) { return loader.getResource(s); }
findInLoader
38,936
long () { if (!recordLoadingStats || doingTiming.get() != null) { return 0; } doingTiming.set(Boolean.TRUE); return System.nanoTime(); }
startTiming
38,937
void (ClassPath path, long started, String resourceName, Resource resource) { if (resource != null && recordLoadingInfo) { loadedClassNames.add(resource.getURL().getPath()); } if (started == 0 || !recordLoadingStats) { return; } doingTiming.set(null); long time = System.nanoTime() - started; long totalTime = ourTotalTi...
logInfo
38,938
String[] (JarLoader loader) { try { String classPath = loader.getClassPathManifestAttribute(); if (classPath != null) { String[] urls = classPath.split(" "); if (urls.length > 0 && urls[0].startsWith("file:")) { return urls; } } } catch (Exception ignore) { } return null; }
loadManifestClasspath
38,939
int (final int expected, final float f) { final long s = Math.max(2, nextPowerOfTwo((long)Math.ceil(expected / f))); if (s > (1 << 30)) throw new IllegalArgumentException("Too large (" + expected + " expected elements with load factor " + f + ")"); return (int)s; }
arraySize
38,940
int (int x) { if (x == 0) return 1; x--; x |= x >> 1; x |= x >> 2; x |= x >> 4; x |= x >> 8; return (x | x >> 16) + 1; }
nextPowerOfTwo
38,941
int (final long l) { return (int)(l ^ (l >>> 32)); }
long2int
38,942
long (long x) { if (x == 0) return 1; x--; x |= x >> 1; x |= x >> 2; x |= x >> 4; x |= x >> 8; x |= x >> 16; return (x | x >> 32) + 1; }
nextPowerOfTwo
38,943
int (final int n, final float f) { /* We must guarantee that there is always at least * one free entry (even with pathological load factors). */ return Math.min((int)Math.ceil(n * f), n - 1); }
maxFill
38,944
int (final int x) { final int h = x * INT_PHI; return h ^ (h >>> 16); }
mix
38,945
long (final long x) { long h = x * LONG_PHI; h ^= h >>> 32; return h ^ (h >>> 16); }
mix
38,946
int () { return containsNull ? size - 1 : size; }
realSize
38,947
boolean (final long k) { int pos; if (k == 0) { if (containsNull) { return false; } containsNull = true; } else { long curr; final long[] key = this.key; // The starting point. if (!((curr = key[pos = (int)Hash.mix(k) & mask]) == 0)) { if (curr == k) { return false; } while (!((curr = key[pos = pos + 1 & mask]) == 0)) ...
add
38,948
void (int pos) { // Shift entries with the same hash. int last, slot; long curr; final long[] key = this.key; for (; ; ) { pos = (last = pos) + 1 & mask; for (; ; ) { if ((curr = key[pos]) == 0) { key[last] = 0; return; } slot = (int)Hash.mix(curr) & mask; if (last <= pos ? last >= slot || slot > pos : last >= slot && ...
shiftKeys
38,949
boolean (final int pos) { size--; shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > Hash.DEFAULT_INITIAL_SIZE) { rehash(n / 2); } return true; }
removeEntry
38,950
boolean () { containsNull = false; key[n] = 0; size--; if (n > minN && size < maxFill / 4 && n > Hash.DEFAULT_INITIAL_SIZE) { rehash(n / 2); } return true; }
removeNullEntry
38,951
boolean (final long k) { if (k == 0) { if (containsNull) { return removeNullEntry(); } return false; } long curr; final long[] key = this.key; int pos; // The starting point. if ((curr = key[pos = (int)Hash.mix(k) & mask]) == 0) { return false; } if (k == curr) { return removeEntry(pos); } while (true) { if ((curr = ke...
remove
38,952
boolean (final long k) { if (k == 0) { return containsNull; } long curr; final long[] key = this.key; int pos; // The starting point. if ((curr = key[pos = (int)Hash.mix(k) & mask]) == 0) { return false; } if (k == curr) { return true; } while (true) { if ((curr = key[pos = pos + 1 & mask]) == 0) { return false; } if (...
contains
38,953
int () { return size; }
size
38,954
boolean () { return size == 0; }
isEmpty
38,955
boolean () { return c != 0; }
hasNext
38,956
long () { if (!hasNext()) { throw new NoSuchElementException(); } c--; if (mustReturnNull) { mustReturnNull = false; return key[n]; } long[] key = StrippedLongOpenHashSet.this.key; for (; ; ) { long v = key[--pos]; if (v != 0) { return v; } } }
nextLong
38,957
SetIterator () { return new SetIterator(); }
iterator
38,958
void (final int newN) { final long[] key = this.key; final int mask = newN - 1; // Note that this is used by the hashing macro final long[] newKey = new long[newN + 1]; int i = n, pos; for (int j = realSize(); j-- != 0; ) { while (key[--i] == 0) ; if (!(newKey[pos = (int)Hash.mix(key[i]) & mask] == 0)) { while (!(newKe...
rehash
38,959
int () { int h = 0; for (int j = realSize(), i = 0; j-- != 0; ) { while (key[i] == 0) { i++; } h += Hash.long2int(key[i]); i++; } // Zero / null have hash zero. return h; }
hashCode
38,960
int () { return containsNull ? size - 1 : size; }
realSize
38,961
boolean (final int k) { int pos; if (k == 0) { if (containsNull) { return false; } containsNull = true; } else { int curr; final int[] key = this.key; // The starting point. if (!((curr = key[pos = Hash.mix(k) & mask]) == 0)) { if (curr == k) { return false; } while (!((curr = key[pos = pos + 1 & mask]) == 0)) { if (cu...
add
38,962
void (int pos) { // Shift entries with the same hash. int last, slot; int curr; final int[] key = this.key; for (; ; ) { pos = (last = pos) + 1 & mask; for (; ; ) { if ((curr = key[pos]) == 0) { key[last] = 0; return; } slot = Hash.mix(curr) & mask; if (last <= pos ? last >= slot || slot > pos : last >= slot && slot > ...
shiftKeys
38,963
boolean (final int pos) { size--; shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > Hash.DEFAULT_INITIAL_SIZE) { rehash(n / 2); } return true; }
removeEntry
38,964
boolean () { containsNull = false; key[n] = 0; size--; if (n > minN && size < maxFill / 4 && n > Hash.DEFAULT_INITIAL_SIZE) { rehash(n / 2); } return true; }
removeNullEntry
38,965
boolean (final int k) { if (k == 0) { if (containsNull) { return removeNullEntry(); } return false; } int curr; final int[] key = this.key; int pos; // The starting point. if ((curr = key[pos = Hash.mix(k) & mask]) == 0) { return false; } if (k == curr) { return removeEntry(pos); } while (true) { if ((curr = key[pos = ...
remove
38,966
boolean (final int k) { if (k == 0) { return containsNull; } int curr; final int[] key = this.key; int pos; // The starting point. if ((curr = key[pos = Hash.mix(k) & mask]) == 0) { return false; } if (k == curr) { return true; } while (true) { if ((curr = key[pos = pos + 1 & mask]) == 0) { return false; } if (k == cur...
contains
38,967
int () { return size; }
size
38,968
boolean () { return size == 0; }
isEmpty
38,969
int[] () { int[] result = new int[size]; SetIterator iterator = iterator(); int i = 0; while (iterator.hasNext()) { result[i++] = iterator.nextInt(); } return result; }
toArray
38,970
boolean () { return c != 0; }
hasNext
38,971
int () { if (!hasNext()) { throw new NoSuchElementException(); } c--; if (mustReturnNull) { mustReturnNull = false; return key[n]; } final int[] key = StrippedIntOpenHashSet.this.key; for (; ; ) { int v = key[--pos]; if (v != 0) { return v; } } }
nextInt
38,972
SetIterator () { return new SetIterator(); }
iterator
38,973
void (final int newN) { final int[] key = this.key; final int mask = newN - 1; // Note that this is used by the hashing macro final int[] newKey = new int[newN + 1]; int i = n, pos; for (int j = realSize(); j-- != 0; ) { while (key[--i] == 0) ; if (!(newKey[pos = Hash.mix(key[i]) & mask] == 0)) { while (!(newKey[pos = ...
rehash
38,974
int () { int h = 0; for (int j = realSize(), i = 0; j-- != 0; ) { while (key[i] == 0) { i++; } h += key[i]; i++; } // Zero / null have hash zero. return h; }
hashCode
38,975
void (String[] args) { final GroovyShell shell = new GroovyShell(); try { shell.parse(args[0] + " import java.lang.*"); } catch (MultipleCompilationErrorsException e) { List errors = e.getErrorCollector().getErrors(); for (Object o : errors) { if (o instanceof ExceptionMessage) { Exception cause = ((ExceptionMessage)o)...
main
38,976
void (String[] args) { System.exit(intMain(args)); }
main
38,977
int (String[] args) { boolean indy = false; if (args.length != 3) { if (args.length != 4 || !"--indy".equals(args[3])) { //noinspection UseOfSystemOutOrSystemErr System.err.println("There is no arguments for groovy compiler"); return 1; } indy = true; } final boolean optimize = GroovyRtConstants.OPTIMIZE.equals(args[0]...
intMain
38,978
int (boolean indy, boolean optimize, boolean forStubs, String argPath, String configScript, @Nullable String targetBytecode, @Nullable Queue<? super Object> mailbox, @NotNull PrintStream out, @NotNull PrintStream err) { if (indy) { System.setProperty("groovy.target.indy", "true"); } if (!new File(argPath).exists()) { e...
intMain2
38,979
ClassLoader (String argsPath, PrintStream err) { final List<URL> urls = new ArrayList<>(); try { //noinspection IOResourceOpenedButNotSafelyClosed BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(argsPath), StandardCharsets.UTF_8)); String classpath = reader.readLine(); for (String s...
buildMainLoader
38,980
boolean (boolean forStubs, String argsPath, @Nullable String configScript, @Nullable String targetBytecode, @Nullable Queue<? super Object> mailbox, @NotNull PrintStream out, @NotNull PrintStream err) { File argsFile = new File(argsPath); CompilerConfiguration config = createCompilerConfiguration(targetBytecode); confi...
runGroovyc
38,981
CompilerConfiguration (@Nullable String targetBytecode) { CompilerConfiguration config = new CompilerConfiguration(); if (targetBytecode != null) { config.setTargetBytecode(targetBytecode); } if (config.getTargetBytecode() == null) { // unsupported value (e.g. "1.6" with older Groovyc versions which know only 1.5) // c...
createCompilerConfiguration
38,982
void (File configScript, CompilerConfiguration configuration, PrintStream err) { Binding binding = new Binding(); binding.setVariable("configuration", configuration); CompilerConfiguration configuratorConfig = new CompilerConfiguration(); ImportCustomizer customizer = new ImportCustomizer(); customizer.addStaticStars("...
applyConfigurationScript
38,983
void (String[] finalOutputs, String removeSuffix, String addSuffix) { for (String output : finalOutputs) { for (String res : RESOURCES_TO_MASK) { File file = new File(output, res + removeSuffix); if (file.exists()) { //noinspection ResultOfMethodCallIgnored file.renameTo(new File(output, res + addSuffix)); } } } }
renameResources
38,984
void (File argsFile, CompilerConfiguration compilerConfiguration, List<? super CompilationUnitPatcher> patchers, List<? super GroovyCompilerMessage> compilerMessages, List<? super File> srcFiles, Map<String, File> class2File, String[] finalOutputs, PrintStream err) { BufferedReader reader = null; FileInputStream stream...
fillFromArgsFile
38,985
void (boolean forStubs, List<? extends File> srcFiles, final CompilationUnit unit) { for (final File file : srcFiles) { if (forStubs && file.getName().endsWith(".java")) { continue; } unit.addSource(new SourceUnit(file, unit.getConfiguration(), unit.getClassLoader(), unit.getErrorCollector())); } }
addSources
38,986
void (List<? extends CompilationUnitPatcher> patchers, List<? super GroovyCompilerMessage> compilerMessages, CompilationUnit unit, final AstAwareResourceLoader loader, List<File> srcFiles) { if (!patchers.isEmpty()) { for (CompilationUnitPatcher patcher : patchers) { try { patcher.patchCompilationUnit(unit, loader, src...
runPatchers
38,987
void (@NotNull PrintStream out, @NotNull List<OutputItem> compiledFiles) { for (OutputItem compiledFile : compiledFiles) { /* * output path * source file * output root directory */ out.print(GroovyRtConstants.COMPILED_START); out.print(compiledFile.outputPath); out.print(GroovyRtConstants.SEPARATOR); out.print(compiled...
reportCompiledItems
38,988
void (@NotNull PrintStream out, @NotNull GroovyCompilerMessage message) { out.print(GroovyRtConstants.MESSAGES_START); out.print(message.getCategory()); out.print(GroovyRtConstants.SEPARATOR); out.print(message.getMessage()); out.print(GroovyRtConstants.SEPARATOR); out.print(message.getUrl()); out.print(GroovyRtConstan...
printMessage
38,989
void (List<? super GroovyCompilerMessage> compilerMessages, Throwable e, String message) { final StringWriter writer = new StringWriter(); e.printStackTrace(new PrintWriter(writer)); compilerMessages.add(new GroovyCompilerMessage( GroovyCompilerMessageCategories.WARNING, message + ":\n" + writer, "<exception>", -1, -1 ...
addExceptionInfo
38,990
CompilationUnit (final boolean forStubs, final CompilerConfiguration config, final GroovyClassLoader classLoader, Queue<? super Object> mailbox, GroovyCompilerWrapper wrapper, final PrintStream out, PrintStream err) { final GroovyClassLoader transformLoader = new GroovyClassLoader(classLoader); try { if (forStubs) { re...
createCompilationUnit
38,991
CompilationUnit (final CompilerConfiguration config, final GroovyClassLoader classLoader, final GroovyClassLoader transformLoader, final Queue<? super Object> mailbox, final GroovyCompilerWrapper wrapper, final PrintStream out, final PrintStream err) { final JavaAwareCompilationUnit unit = new JavaAwareCompilationUnit(...
createStubGenerator
38,992
GroovyClassLoader () { return transformLoader; }
getTransformLoader
38,993
void (PrimaryClassNodeOperation op, int phase) { if (!annoRemovedAdded && mailbox == null && phase == Phases.CONVERSION && "true".equals(System.getProperty(GroovyRtConstants.GROOVYC_LEGACY_REMOVE_ANNOTATIONS)) && op.getClass().getName().startsWith("org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit$")) { annoRemo...
addPhaseOperation
38,994
SourceUnit () { return source; }
getSourceUnit
38,995
void (ClassNode node) { if (node.isEnum()) { node.setModifiers(node.getModifiers() & ~Opcodes.ACC_FINAL); } super.visitClass(node); }
visitClass
38,996
void (FieldNode fieldNode) { Expression valueExpr = fieldNode.getInitialValueExpression(); if (valueExpr instanceof ConstantExpression && ClassHelper.STRING_TYPE.equals(valueExpr.getType())) { fieldNode.setInitialValueExpression(new MethodCallExpression(valueExpr, "toString", new ListExpression())); } super.visitField(...
visitField
38,997
void (AnnotatedNode node) { List<AnnotationNode> annotations = node.getAnnotations(); if (!annotations.isEmpty()) { annotations.clear(); } super.visitAnnotations(node); }
visitAnnotations
38,998
JavaCompiler (final CompilerConfiguration config) { return new JavaCompiler() { @Override public void compile(List<String> files, CompilationUnit cu) { if (mailbox != null) { reportCompiledItems( out, GroovyCompilerWrapper.getStubOutputItems(unit, (File)config.getJointCompilationOptions().get(STUB_DIR)) ); out.flush();...
createCompiler
38,999
void (List<String> files, CompilationUnit cu) { if (mailbox != null) { reportCompiledItems( out, GroovyCompilerWrapper.getStubOutputItems(unit, (File)config.getJointCompilationOptions().get(STUB_DIR)) ); out.flush(); err.flush(); pauseAndWaitForJavac(mailbox); wrapper.onContinuation(); } }
compile