Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
276,400
List<URL> () { List<URL> result = new ArrayList<>(); for (Path file : classPath.getFiles()) { try { result.add(file.toUri().toURL()); } catch (MalformedURLException ignored) { } } return result; }
getUrls
276,401
List<Path> () { return classPath.getFiles(); }
getFiles
276,402
boolean (String name) { Class<?> aClass = findLoadedClass(name); return aClass != null && aClass.getClassLoader() == this; }
hasLoadedClass
276,403
void (String name) { int lastDotIndex = name.lastIndexOf('.'); if (lastDotIndex == -1) { return; } String packageName = name.substring(0, lastDotIndex); // check if the package is already loaded if (isPackageDefined(packageName)) { return; } try { definePackage(packageName, null, null, null, null, null, null, null); } catch (IllegalArgumentException ignore) { // do nothing, the package is already defined by another thread } }
definePackageIfNeeded
276,404
boolean (String packageName) { return getPackage(packageName) != null; }
isPackageDefined
276,405
boolean (@NotNull String name) { return true; }
isByteBufferSupported
276,406
Enumeration<URL> (@NotNull String name) { return classPath.getResources(name); }
findResources
276,407
Object (String className) { return classLoadingLocks == null ? this : classLoadingLocks.getOrCreateLock(className); }
getClassLoadingLock
276,408
CachePool () { return new CachePoolImpl(); }
createCachePool
276,409
String (@NotNull String path) { if (path.isEmpty()) { return path; } if (path.charAt(0) == '.') { if (path.length() == 1) { return ""; } char c = path.charAt(1); if (c == '/') { path = path.substring(2); } } // trying to speed up the common case when there are no "//" or "/." int index = -1; do { index = path.indexOf('/', index + 1); char next = index == path.length() - 1 ? 0 : path.charAt(index + 1); if (next == '.' || next == '/') { break; } } while (index != -1); if (index == -1) { return path; } StringBuilder result = new StringBuilder(path.length()); int start = processRoot(path, result); int dots = 0; boolean separator = true; for (int i = start; i < path.length(); ++i) { char c = path.charAt(i); if (c == '/') { if (!separator) { processDots(result, dots, start); dots = 0; } separator = true; } else if (c == '.') { if (separator || dots > 0) { ++dots; } else { result.append('.'); } separator = false; } else { while (dots > 0) { result.append('.'); dots--; } result.append(c); separator = false; } } if (dots > 0) { processDots(result, dots, start); } return result.toString(); }
toCanonicalPath
276,410
boolean (@NotNull CharSequence text, @NotNull CharSequence suffix) { int l1 = text.length(); int l2 = suffix.length(); if (l1 < l2) return false; for (int i = l1 - 1; i >= l1 - l2; i--) { if (text.charAt(i) != suffix.charAt(i + l2 - l1)) return false; } return true; }
endsWith
276,411
int (@NotNull CharSequence s, char c, int start, int end) { start = Math.max(start, 0); for (int i = Math.min(end, s.length()) - 1; i >= start; i--) { if (s.charAt(i) == c) return i; } return -1; }
lastIndexOf
276,412
void (StringBuilder result, int dots, int start) { if (dots == 2) { int pos = -1; if (!endsWith(result, "/../") && !"../".contentEquals(result)) { pos = lastIndexOf(result, '/', start, result.length() - 1); if (pos >= 0) { ++pos; // separator found, trim to next char } else if (start > 0) { pos = start; // the path is absolute, trim to root ('/..' -> '/') } else if (result.length() > 0) { pos = 0; // the path is relative, trim to default ('a/..' -> '') } } if (pos >= 0) { result.delete(pos, result.length()); } else { result.append("../"); // impossible to traverse, keep as-is } } else if (dots != 1) { for (int i = 0; i < dots; i++) { result.append('.'); } result.append('/'); } }
processDots
276,413
int (String path, StringBuilder result) { if (!path.isEmpty() && path.charAt(0) == '/') { result.append('/'); return 1; } if (path.length() > 2 && path.charAt(1) == ':' && path.charAt(2) == '/') { result.append(path, 0, 3); return 3; } return 0; }
processRoot
276,414
void (String message, Throwable t) { try { Class<?> logger = loadClass("com.intellij.openapi.diagnostic.Logger"); MethodHandles.Lookup lookup = MethodHandles.lookup(); Object instance = lookup.findStatic(logger, "getInstance", MethodType.methodType(logger, Class.class)).invoke(getClass()); lookup.findVirtual(logger, "error", MethodType.methodType(void.class, String.class, Throwable.class)) .bindTo(instance) .invokeExact(message, t); } catch (Throwable tt) { t.addSuppressed(tt); System.err.println(getClass().getName() + ": " + message); t.printStackTrace(System.err); } }
logError
276,415
String (@NotNull String url) { int start = url.startsWith("file:") ? "file:".length() : 0; int end = url.indexOf("!/"); if (url.charAt(start) == '/') { // trim leading slashes before drive letter if (url.length() > (start + 2) && url.charAt(start + 2) == ':') { start++; } } return UrlUtilRt.unescapePercentSequences(url, start, end < 0 ? url.length() : end).toString(); }
urlToFilePath
276,416
UrlClassLoader () { return new UrlClassLoader(this, null, isParallelCapable); }
get
276,417
long[] () { return a; }
elements
276,418
long[] (final long[] array, final int length, final int preserve) { final long[] t = new long[length]; System.arraycopy(array, 0, t, 0, preserve); return t; }
forceCapacity
276,419
void (int capacity) { if (capacity <= a.length) { return; } if (a != DEFAULT_EMPTY_ARRAY) { capacity = (int)Math.max( Math.min((long)a.length + (a.length >> 1), MAX_ARRAY_SIZE), capacity); } else if (capacity < DEFAULT_INITIAL_CAPACITY) { capacity = DEFAULT_INITIAL_CAPACITY; } a = forceCapacity(a, capacity, size); assert size <= a.length; }
grow
276,420
void (final int index, final long k) { grow(size + 1); if (index != size) { System.arraycopy(a, index, a, index + 1, size - index); } a[index] = k; size++; assert size <= a.length; }
add
276,421
boolean (final long k) { grow(size + 1); a[size++] = k; assert size <= a.length; return true; }
add
276,422
int () { return size; }
size
276,423
boolean (final Object o) { if (o == this) { return true; } if (!(o instanceof StrippedLongArrayList)) { return false; } int s = size(); if (s != ((StrippedLongArrayList)o).size()) { return false; } final long[] a1 = a; final long[] a2 = ((StrippedLongArrayList)o).a; if (a1 == a2) { return true; } while (s-- != 0) { if (a1[s] != a2[s]) { return false; } } return true; }
equals
276,424
void (@NotNull String dir, @NotNull Predicate<? super String> filter, @NotNull BiConsumer<? super String, ? super InputStream> consumer) { }
processResources
276,425
String () { return url.toString(); }
toString
276,426
URL () { URL result = url; if (result == null) { try { result = new URL(baseUrl, entry.getName()); } catch (MalformedURLException e) { throw new RuntimeException(e); } url = result; } return result; }
getURL
276,427
int () { return classPackageHashes.size(); }
classPackageCount
276,428
int () { return resourcePackageHashes.size(); }
resourcePackageCount
276,429
long[] () { return classPackageHashes.keys; }
classPackages
276,430
long[] () { return resourcePackageHashes.keys; }
resourcePackages
276,431
LongPredicate (boolean forClasses) { return new LongPredicate() { boolean addZero = forClasses ? classPackageHashes.hasNull() : resourcePackageHashes.hasNull(); @Override public boolean test(long it) { if (it == 0) { if (!addZero) { return false; } addZero = false; } return true; } }; }
getKeyFilter
276,432
boolean (long it) { if (it == 0) { if (!addZero) { return false; } addZero = false; } return true; }
test
276,433
long (@NotNull String resourcePath, int endIndex) { return endIndex <= 0 ? 0 : Xx3UnencodedString.hashUnencodedStringRange(resourcePath, endIndex); }
getPackageNameHash
276,434
void (long[] hashes, StrippedLongToObjectMap<Loader[]> map, Loader loader, @Nullable LongPredicate hashFilter) { Loader[] singleArray = null; for (long hash : hashes) { if (hashFilter != null && !hashFilter.test(hash)) { continue; } int index = map.index(hash); if (index < 0) { if (singleArray == null) { singleArray = new Loader[]{loader}; } map.addByIndex(index, hash, singleArray); } else { Loader[] loaders = map.getByIndex(index); Loader[] newList = new Loader[loaders.length + 1]; System.arraycopy(loaders, 0, newList, 0, loaders.length); newList[loaders.length] = loader; map.replaceByIndex(index, hash, newList); } } }
addPackages
276,435
Object (@NotNull String className) { Object lock = map.computeIfAbsent(className, it -> new WeakLockReference(it, new Object(), queue)).get(); if (lock != null) { return lock; } Object newLock = new Object(); WeakLockReference newRef = new WeakLockReference(className, newLock, queue); while (true) { removeExpired(); WeakLockReference oldRef = map.putIfAbsent(className, newRef); if (oldRef == null) { return newLock; } Object oldLock = oldRef.get(); if (oldLock != null) { return oldLock; } else if (map.replace(className, oldRef, newRef)) { return newLock; } } }
getOrCreateLock
276,436
void () { while (true) { WeakLockReference ref = (WeakLockReference)queue.poll(); if (ref == null) { break; } map.remove(ref.className, ref); } }
removeExpired
276,437
int () { return containsNull ? size - 1 : size; }
realSize
276,438
boolean () { return containsNull; }
hasNull
276,439
boolean (final long k) { int pos; if (k == 0) { if (containsNull) { return false; } containsNull = true; } else { long curr; final long[] key = this.keys; // The starting point. if (!((curr = key[pos = (int)k & mask]) == 0)) { if (curr == k) { return false; } while (!((curr = key[pos = pos + 1 & mask]) == 0)) { if (curr == k) { return false; } } } key[pos] = k; } if (size++ >= maxFill) { rehash(Hash.arraySize(size + 1, loadFactor)); } return true; }
add
276,440
boolean (final long k) { if (k == 0) { return containsNull; } long curr; final long[] key = this.keys; int pos; // The starting point. if ((curr = key[pos = (int)k & mask]) == 0) { return false; } if (k == curr) { return true; } while (true) { if ((curr = key[pos = pos + 1 & mask]) == 0) { return false; } if (k == curr) { return true; } } }
contains
276,441
int () { return size; }
size
276,442
boolean () { return size == 0; }
isEmpty
276,443
boolean () { return c != 0; }
hasNext
276,444
long () { if (!hasNext()) { throw new NoSuchElementException(); } c--; if (mustReturnNull) { mustReturnNull = false; return keys[n]; } long[] key = StrippedLongSet.this.keys; for (; ; ) { long v = key[--pos]; if (v != 0) { return v; } } }
nextLong
276,445
SetIterator () { return new SetIterator(); }
iterator
276,446
void (final int newN) { final long[] key = this.keys; 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)key[i] & mask] == 0)) { while (!(newKey[pos = pos + 1 & mask] == 0)) ; } newKey[pos] = key[i]; } n = newN; this.mask = mask; maxFill = Hash.maxFill(n, loadFactor); this.keys = newKey; }
rehash
276,447
long[] () { long[] result = new long[size]; SetIterator iterator = iterator(); int i = 0; while (iterator.hasNext()) { result[i++] = iterator.nextLong(); } return result; }
toArray
276,448
CharSequence (@NotNull CharSequence s, int from, int end) { int i = indexOf(s, from, end); if (i == -1) { return s.subSequence(from, end); } StringBuilder decoded = new StringBuilder(); decoded.append(s, from, i); byte[] byteBuffer = null; int byteBufferSize = 0; while (i < end) { char c = s.charAt(i); if (c == '%') { if (byteBuffer == null) { byteBuffer = new byte[end - from]; } else { byteBufferSize = 0; } while (i + 2 < end && s.charAt(i) == '%') { final int d1 = decode(s.charAt(i + 1)); final int d2 = decode(s.charAt(i + 2)); if (d1 != -1 && d2 != -1) { byteBuffer[byteBufferSize++] = (byte)((d1 & 0xf) << 4 | d2 & 0xf); i += 3; } else { break; } } if (byteBufferSize != 0) { decoded.append(new String(byteBuffer, 0, byteBufferSize, StandardCharsets.UTF_8)); continue; } } decoded.append(c); i++; } return decoded; }
unescapePercentSequences
276,449
int (char c) { if ((c >= '0') && (c <= '9')) { return c - '0'; } if ((c >= 'a') && (c <= 'f')) { return c - 'a' + 10; } if ((c >= 'A') && (c <= 'F')) { return c - 'A' + 10; } return -1; }
decode
276,450
int (@NotNull CharSequence s, int start, int end) { end = Math.min(end, s.length()); for (int i = Math.max(start, 0); i < end; i++) { if (s.charAt(i) == '%') { return i; } } return -1; }
indexOf
276,451
Path () { return path; }
getPath
276,452
URI (@NotNull Path file) { String path = file.toString().replace(File.separatorChar, '/'); if (!path.startsWith("/")) { path = '/' + path; } else if (path.startsWith("//")) { path = "//" + path; } try { return new URI("file", null, path, null); } catch (URISyntaxException e) { throw new IllegalArgumentException(path, e); } }
fileToUri
276,453
String () { return "JarLoader(path=" + path + ")"; }
toString
276,454
FileLoader (Path file, @Nullable CachePoolImpl cachePool, Predicate<? super Path> cachingCondition, boolean isClassPathIndexEnabled, ClasspathCache cache) { if (cachePool == null) { LoaderData data = buildData(file, isClassPathIndexEnabled); FileLoader loader = new FileLoader(file, data.nameFilter); cache.applyLoaderData(data, loader); return loader; } ClasspathCache.IndexRegistrar data = cachePool.loaderIndexCache.get(file); if (data == null) { LoaderData loaderData = buildData(file, isClassPathIndexEnabled); FileLoader loader = new FileLoader(file, loaderData.nameFilter); if (cachingCondition != null && cachingCondition.test(file)) { cachePool.loaderIndexCache.put(file, loaderData); } cache.applyLoaderData(loaderData, loader); return loader; } else { FileLoader loader = new FileLoader(file, data.getNameFilter()); cache.applyLoaderData(data, loader); return loader; } }
createCachingFileLoader
276,455
Path () { return path; }
getPath
276,456
void (Path startDir, ClasspathCache.LoaderDataBuilder context, StrippedLongArrayList nameHashes) { // FileVisitor is not used to avoid getting file attributes for class files // (`.class` extension is a strong indicator that it is a file and not a directory) Deque<Path> dirCandidates = new ArrayDeque<>(); dirCandidates.add(startDir); Path dir; int rootDirAbsolutePathLength = startDir.toString().length(); while ((dir = dirCandidates.pollFirst()) != null) { try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(dir)) { boolean containsClasses = false; boolean containsResources = false; for (Path file : dirStream) { String path = getRelativeResourcePath(file.toString(), rootDirAbsolutePathLength); long nameHash = Xx3UnencodedString.hashUnencodedString(path); if (path.endsWith(ClasspathCache.CLASS_EXTENSION)) { nameHashes.add(nameHash); containsClasses = true; } else { nameHashes.add(nameHash); containsResources = true; if (!path.endsWith(".svg") && !path.endsWith(".png") && !path.endsWith(".xml")) { dirCandidates.addLast(file); } } } if (containsClasses || containsResources) { String relativeResourcePath = getRelativeResourcePath(dir.toString(), rootDirAbsolutePathLength); if (containsClasses) { context.addClassPackage(relativeResourcePath); } if (containsResources) { context.addResourcePackage(relativeResourcePath); } } } catch (NoSuchFileException | NotDirectoryException ignore) { } catch (IOException e) { //noinspection UseOfSystemOutOrSystemErr e.printStackTrace(System.err); } } }
buildPackageAndNameCache
276,457
String (@NotNull String path, int startPathLength) { String relativePath = path.substring(startPathLength).replace(File.separatorChar, '/'); return relativePath.startsWith("/") ? relativePath.substring(1) : relativePath; }
getRelativeResourcePath
276,458
LoaderData (@NotNull Path path, boolean isClassPathIndexEnabled) { Path indexFile = isClassPathIndexEnabled ? path.resolve("classpath.index") : null; LoaderData loaderData = indexFile == null ? null : readFromIndex(indexFile); int nsMsFactor = 1_000_000; int currentLoaders = totalLoaders.incrementAndGet(); long currentScanningTime; if (loaderData == null) { long started = System.nanoTime(); StrippedLongArrayList nameHashes = new StrippedLongArrayList(); ClasspathCache.LoaderDataBuilder loaderDataBuilder = new ClasspathCache.LoaderDataBuilder(); buildPackageAndNameCache(path, loaderDataBuilder, nameHashes); loaderData = new LoaderData(loaderDataBuilder.resourcePackageHashes.toArray(), loaderDataBuilder.classPackageHashes.toArray(), new NameFilter(Xor16.construct(nameHashes.elements(), 0, nameHashes.size()))); long doneNanos = System.nanoTime() - started; currentScanningTime = totalScanning.addAndGet(doneNanos); if (doFsActivityLogging) { //noinspection UseOfSystemOutOrSystemErr System.out.println("Scanned: " + path + " for " + (doneNanos / nsMsFactor) + "ms"); } if (isClassPathIndexEnabled) { try { Path tempFile = indexFile.getParent().resolve("classpath.index.tmp"); saveIndex(loaderData, tempFile); try { Files.move(tempFile, indexFile, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); } catch (AtomicMoveNotSupportedException e) { Files.move(tempFile, indexFile, StandardCopyOption.REPLACE_EXISTING); } } catch (IOException e) { //noinspection CallToPrintStackTrace e.printStackTrace(); } } } else { currentScanningTime = totalScanning.get(); } if (doFsActivityLogging) { //noinspection UseOfSystemOutOrSystemErr System.out.println("Scanning: " + (currentScanningTime / nsMsFactor) + "ms" + ", loading: " + (totalReading.get() / nsMsFactor) + "ms for " + currentLoaders + " loaders"); } return loaderData; }
buildData
276,459
URL () { URL result = this.url; if (result == null) { try { result = file.toUri().toURL(); } catch (MalformedURLException e) { throw new RuntimeException(e); } url = result; } return result; }
getURL
276,460
String () { return file.toString(); }
toString
276,461
String () { return "FileLoader(path=" + path + ')'; }
toString
276,462
int () { return classPackageHashes.length; }
classPackageCount
276,463
int () { return resourcePackageHashes.length; }
resourcePackageCount
276,464
Predicate<String> () { return nameFilter; }
getNameFilter
276,465
long[] () { return classPackageHashes; }
classPackages
276,466
long[] () { return resourcePackageHashes; }
resourcePackages
276,467
boolean (String name) { if (name.isEmpty()) { return true; } int lastIndex = name.length() - 1; int end = name.charAt(lastIndex) == '/' ? lastIndex : name.length(); return filter.mightContain(Xx3UnencodedString.hashUnencodedStringRange(name, end)); }
test
276,468
int () { return containsNullKey ? size - 1 : size; }
realSize
276,469
int (long key) { if (key == 0) { return containsNullKey ? tableSize : -(tableSize + 1); } long current; long[] keys = this.keys; int index; // the starting point if ((current = keys[index = (int)key & mask]) == 0) { return -(index + 1); } if (key == current) { return index; } // there's always an unused entry while (true) { if ((current = keys[index = index + 1 & mask]) == 0) { return -(index + 1); } if (key == current) { return index; } } }
index
276,470
void (int index, long key, V value) { replaceByIndex(-index - 1, key, value); if (size++ >= maxFill) { rehash(Hash.arraySize(size + 1, Hash.FAST_LOAD_FACTOR)); } }
addByIndex
276,471
void (int index, long key, @NotNull V value) { if (index == tableSize) { containsNullKey = true; } keys[index] = key; values[index] = value; }
replaceByIndex
276,472
V (int index) { return values[index]; }
getByIndex
276,473
V (long k) { if (k == 0) { return containsNullKey ? values[tableSize] : null; } long curr; final long[] key = this.keys; int pos; // The starting point. if ((curr = key[pos = (int)k & mask]) == 0) { return null; } if (k == curr) { return values[pos]; } // There's always an unused entry. while (true) { if ((curr = key[pos = pos + 1 & mask]) == 0) { return null; } if (k == curr) { return values[pos]; } } }
apply
276,474
int () { return size; }
size
276,475
boolean () { return size == 0; }
isEmpty
276,476
void (final int newN) { final long[] keys = this.keys; final V[] values = this.values; final int mask = newN - 1; // Note that this is used by the hashing macro final long[] newKey = new long[newN + 1]; final V[] newValue = valueArrayFactory.apply(newN + 1); int i = tableSize; int pos; for (int j = realSize(); j-- != 0; ) { //noinspection StatementWithEmptyBody while (keys[--i] == 0) ; if (!(newKey[pos = (int)keys[i] & mask] == 0)) { //noinspection StatementWithEmptyBody while (!(newKey[pos = pos + 1 & mask] == 0)) ; } newKey[pos] = keys[i]; newValue[pos] = values[i]; } newValue[newN] = values[tableSize]; tableSize = newN; this.mask = mask; maxFill = Hash.maxFill(tableSize, Hash.FAST_LOAD_FACTOR); this.keys = newKey; this.values = newValue; }
rehash
276,477
Enumeration<URL> (@NotNull String name) { if (name.endsWith("/")) { name = name.substring(0, name.length() - 1); } if (useCache && allUrlsWereProcessed) { Loader[] loaders = cache.getLoadersByName(name); return loaders == null || loaders.length == 0 ? Collections.emptyEnumeration() : new ResourceEnumeration(name, loaders); } else { return new UncachedResourceEnumeration(name, this); } }
getResources
276,478
List<Path> () { List<Path> result = new ArrayList<>(); for (Loader loader : loaders) { result.add(loader.getPath()); } return result; }
getBaseUrls
276,479
void (@NotNull Path file, ResourceFile zipFile, JarLoader loader) { String[] referencedJars = loadManifestClasspath(loader, zipFile); if (referencedJars != null) { long startReferenced = logLoadingInfo ? System.nanoTime() : 0; List<Path> files = new ArrayList<>(referencedJars.length); for (String referencedJar : referencedJars) { try { files.add(Paths.get(UrlClassLoader.urlToFilePath(referencedJar))); } catch (Exception e) { //noinspection UseOfSystemOutOrSystemErr System.err.println("file: " + file + " / " + referencedJar + " " + e); } } addFiles(files); if (logLoadingInfo) { //noinspection UseOfSystemOutOrSystemErr System.out.println("Loaded all " + referencedJars.length + " files " + (System.nanoTime() - startReferenced) / 1000000 + "ms"); } } }
addFromManifestClassPathIfNeeded
276,480
boolean () { if (resource != null) { return true; } long start = resourceLoading.startTiming(); try { Loader loader; while (index < loaders.length) { loader = loaders[index++]; resource = loader.getResource(name); if (resource != null) { return true; } } } finally { resourceLoading.record(start, name); } return false; }
next
276,481
boolean () { return next(); }
hasMoreElements
276,482
URL () { if (!next()) { throw new NoSuchElementException(); } Resource resource = this.resource; this.resource = null; return resource.getURL(); }
nextElement
276,483
boolean () { if (resource != null) { return true; } long start = resourceLoading.startTiming(); try { Loader loader; while ((loader = classPath.getLoader(index++)) != null) { resource = loader.getResource(name); if (resource != null) { return true; } } } finally { resourceLoading.record(start, name); } return false; }
next
276,484
boolean () { return next(); }
hasMoreElements
276,485
URL () { if (!next()) { throw new NoSuchElementException(); } Resource resource = this.resource; this.resource = null; return resource.getURL(); }
nextElement
276,486
boolean (String name) { return classDataConsumer.isByteBufferSupported(name); }
isByteBufferSupported
276,487
long () { if (doingClassDefineTiming.get() != null) { return -1; } else { doingClassDefineTiming.set(Boolean.TRUE); return System.nanoTime(); } }
startTiming
276,488
void (long start) { if (start != -1) { //noinspection ThreadLocalSetWithNull doingClassDefineTiming.set(null); classDefineTotalTime.addAndGet(System.nanoTime() - start); } }
record
276,489
String () { return "Measurer(time=" + TimeUnit.NANOSECONDS.toMillis(timeCounter.get()) + "ms, requests=" + requestCounter + ')'; }
toString
276,490
void (Graphics g) { if (myPaintCallback != null) { myPaintCallback.consume(g); } super.paint(g); }
paint
276,491
void (@Nullable Consumer<? super Graphics> paintCallback) { myPaintCallback = paintCallback; }
setPaintCallback
276,492
int (Pair<ProjectSystemId, File> object) { return object.first.hashCode() + FileUtil.fileHashCode(object.second); }
hashCode
276,493
boolean (Pair<ProjectSystemId, File> o1, Pair<ProjectSystemId, File> o2) { return o1.first.equals(o2.first) && FileUtil.filesEqual(o1.second, o2.second); }
equals
276,494
int (@Nullable File file) { int hash; try { hash = FileUtil.pathHashCode(file == null ? null : file.getCanonicalPath()); } catch (IOException e) { LOG.warn("unable to get canonical file path", e); hash = FileUtil.fileHashCode(file); } return hash; }
fileHashCode
276,495
boolean (@Nullable File file1, @Nullable File file2) { try { return FileUtil.pathsEqual(file1 == null ? null : file1.getCanonicalPath(), file2 == null ? null : file2.getCanonicalPath()); } catch (IOException e) { LOG.warn("unable to get canonical file path", e); } return FileUtil.filesEqual(file1, file2); }
filesEqual
276,496
void (final @NotNull ImportSpecBuilder specBuilder) { refreshProjects(specBuilder.build()); }
refreshProjects
276,497
void (final @NotNull ImportSpec spec) { var manager = ExternalSystemApiUtil.getManager(spec.getExternalSystemId()); if (manager == null) { return; } var settings = manager.getSettingsProvider().fun(spec.getProject()); var projectsSettings = settings.getLinkedProjectsSettings(); if (projectsSettings.isEmpty()) { return; } final ExternalProjectRefreshCallback callback; if (spec.getCallback() == null) { callback = new MyMultiExternalProjectRefreshCallback(spec.getProject()); } else { callback = spec.getCallback(); } var toRefresh = new HashSet<String>(); for (var setting : projectsSettings) { toRefresh.add(setting.getExternalProjectPath()); } if (!toRefresh.isEmpty()) { ExternalSystemNotificationManager.getInstance(spec.getProject()) .clearNotifications(null, NotificationSource.PROJECT_SYNC, spec.getExternalSystemId()); for (var path : toRefresh) { refreshProject(path, new ImportSpecBuilder(spec).callback(callback)); } } }
refreshProjects
276,498
String (@NotNull Throwable e) { var unwrapped = RemoteUtil.unwrap(e); if (unwrapped instanceof ExternalSystemException esException) { var reason = esException.getOriginalReason(); if (!reason.isEmpty()) { return reason; } } return ExternalSystemApiUtil.stacktraceAsString(e); }
extractDetails
276,499
void (final @NotNull Project project, final @NotNull ProjectSystemId externalSystemId, final @NotNull String externalProjectPath, final boolean isPreviewMode, final @NotNull ProgressExecutionMode progressExecutionMode) { var builder = new ImportSpecBuilder(project, externalSystemId) .use(progressExecutionMode); if (isPreviewMode) builder.usePreviewMode(); refreshProject(externalProjectPath, builder); }
refreshProject