Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
69,000
int () { return myValues.size(); }
size
69,001
T (int index) { return myValues.get(index); }
get
69,002
long () { int size = 0; for (Bin value : myValues) { size += value.sizeInBytes(); } return size; }
sizeInBytes
69,003
Iterator<T> () { return myValues.iterator(); }
iterator
69,004
DWord () { return myPEHeaderOffset; }
getPEHeaderOffset
69,005
long () { return myMachine.getValue(); }
getMachine
69,006
Word () { return myNumberOfSections; }
getNumberOfSections
69,007
DirectoryEntry () { Iterator<Bin> iterator = myRoot.getMembers().iterator(); DirectoryEntry entry = (DirectoryEntry)iterator.next(); assert !iterator.hasNext(); return entry; }
getRoot
69,008
DWord () { return myStartOffset; }
getStartOffset
69,009
DWord () { return mySectionVAtoRawOffset; }
getSectionVAtoRawOffset
69,010
byte[] () { return myRawResource.getBytes(); }
getBytes
69,011
void ( byte[] bytes ) { myRawResource.setBytes(bytes); }
setBytes
69,012
Value () { return myRawOffset; }
getRawOffset
69,013
String () { return "RawResource{" + "VirtualAddress=" + myVirtualAddress + ", RawOffset=" + myRawOffset + ", Size=" + mySize + '}'; }
toString
69,014
long () { return myIdOrName; }
getIdOrName
69,015
ResourceSectionReader () { return mySection; }
getSection
69,016
ArrayList<DirectoryEntry> () { return mySubDirs; }
getSubDirs
69,017
ArrayList<DataEntry> () { return myData; }
getData
69,018
DirectoryEntry (long id) { for (DirectoryEntry directoryEntry : mySubDirs) { if (directoryEntry.getIdOrName() == id) { return directoryEntry; } } return null; }
findSubDir
69,019
RawResource () { Iterator<DataEntry> iterator = myData.iterator(); assert iterator.hasNext(); DataEntry dataEntry = iterator.next(); assert !iterator.hasNext(); return dataEntry.getRawResource(); }
getRawResource
69,020
void (DataEntry dataEntry) { getLevel().addLevelEntry(dataEntry); myData.add(dataEntry); }
addDataEntry
69,021
void (DirectoryEntry dir) { getLevel().addLevelEntry(dir); mySubDirs.add(dir); }
addDirectoryEntry
69,022
void (EntryDescription entry) { myIdEntries.addBin(entry); }
addIdEntry
69,023
void (ArrayOfBins<EntryDescription> entries) { for (EntryDescription entry : entries) { DWord offset = entry.getOffsetToData(); DWord name = entry.getNameW(); if ((offset.getValue() & DIRECTORY_ENTRY_FLAG) != 0) { addDirectoryEntry(new DirectoryEntry(mySection, entry, name.getValue())); } else { addDataEntry(new DataEn...
processEntries
69,024
String () { return "DirectoryEntry{" + ", idOrName=" + myIdOrName + ", subs=" + mySubDirs + ", data=" + myData + '}'; }
toString
69,025
void (LevelEntry dir) { if (mySubLevel == null) { mySubLevel = new Level(myDepth + 1); } dir.setLevel(mySubLevel); addMember(dir); }
addLevelEntry
69,026
long () { long size = super.sizeInBytes(); if (mySubLevel != null) { size += mySubLevel.sizeInBytes(); } return size; }
sizeInBytes
69,027
void (long newOffset) { super.resetOffsets(newOffset); if (mySubLevel != null) { mySubLevel.resetOffsets(getOffset() + super.sizeInBytes()); } }
resetOffsets
69,028
void () { ArrayList<Bin> members = getMembers(); if (members.stream().allMatch(bin -> bin instanceof RawResource)) { // Somehow RawResources could go out of order on disk, let's sort them, so we won't need to seek them in input stream members.sort((o1, o2) -> { assert o1 instanceof RawResource; assert o2 instanceof Raw...
sortMembersIfNeeded
69,029
String () { return "Level{" + "depth=" + myDepth + ", members_num=" + getMembers().size() + ", sub=" + mySubLevel + '}'; }
toString
69,030
RawResource () { return myRawResource; }
getRawResource
69,031
DWord () { return myLanguage; }
getLanguage
69,032
void () { getLevel().addLevelEntry(myRawResource); }
initRawData
69,033
String () { return "DataEntry{" + "RVA=" + myRVA + ", Size=" + mySize + '}'; }
toString
69,034
DWord () { return myNameW; }
getNameW
69,035
DWord () { return myOffsetToData; }
getOffsetToData
69,036
void ( int index, String string ) { strings[index].setValue(string); }
setString
69,037
DWord (long value) { myActual.setValue(value - myMinus.getValue()); return this; }
setValue
69,038
long () { return myActual.getValue() + myMinus.getValue(); }
getValue
69,039
void (int id, String value) { for (Entry entry : myEntries) { if (entry.startID == (id / 16)+1) { entry.table.setString(id % 16, value); return; } } throw new IllegalArgumentException("Cannot find string entry with ID " + id); }
setString
69,040
void (Level level) { myLevel = level; }
setLevel
69,041
Level () { return myLevel; }
getLevel
69,042
DWord (long value) { myActual.setValue(value + myMinus.getValue()); return this; }
setValue
69,043
long () { return myActual.getValue() - myMinus.getValue(); }
getValue
69,044
Word () { return myCount; }
getCount
69,045
IconHeader () { return myHeader; }
getHeader
69,046
ArrayOfBins<IconDirectory> () { return myIcons; }
getIcons
69,047
Bytes () { return myBytes; }
getBytes
69,048
IconHeader () { return myHeader; }
getHeader
69,049
ArrayOfBins<GroupIconResourceDirectory> () { return myIcons; }
getIcons
69,050
Word () { return myDwId; }
getDwId
69,051
long (DirectoryEntry root) { // Language ID is Name of third level entries Set<Long> languages = new HashSet<>(); // First search across icons only { DirectoryEntry first = root.findSubDir(DirectoryEntry.RT_ICON); for (DirectoryEntry second : first.getSubDirs()) { for (DataEntry third : second.getData()) { languages.ad...
getLanguage
69,052
DirectoryEntry (DirectoryEntry level1, int index, long languageId) { // We should construct and correctly add second and third level entries to a resource // Second level contains ID of icon // Third level contains languageId and raw data ResourceSectionReader section = level1.getSection(); EntryDescription description...
insertIcon
69,053
String () { return myValue.getValue(); }
getValue
69,054
void (String value) { myValue.setValue(value); // myValueLength has size in words, not bytes myValueLength.setValue(value.length() + 1); }
setValue
69,055
String () { return myKey.getValue() + " = " + myValue.getValue(); }
toString
69,056
VersionInfoBin (int index) { return new StringTable("StringTable" + index); }
createChild
69,057
StringTable () { long count = getMembers().stream().filter(bin -> bin instanceof StringTable).count(); if (count > 1) { throw new IllegalStateException("More than one StringTable found, indicates that there's more than one lanugage in executable"); } Optional<Bin> optional = getMembers().stream().filter(bin -> bin inst...
getSoleStringTable
69,058
FixedFileInfo () { return myFixedFileInfo; }
getFixedFileInfo
69,059
StringFileInfo () { return myStringFileInfo; }
getStringFileInfo
69,060
void (int mostSignificantVersion, int leastSignificantVersion) { myFileVersionMS.setValue(mostSignificantVersion); myFileVersionLS.setValue(leastSignificantVersion); }
setFileVersion
69,061
void (int mostSignificantVersion, int leastSignificantVersion) { myProductVersionMS.setValue(mostSignificantVersion); myProductVersionLS.setValue(leastSignificantVersion); }
setProductVersion
69,062
VersionInfoBin (int index) { return new StringTableEntry(); }
createChild
69,063
String (String key) { for (Bin bin : getMembers()) { if (bin instanceof StringTableEntry entry && bin.getName().equals(key)) { return entry.getValue(); } } throw new IllegalStateException("Could not find string with key: " + key); }
getStringValue
69,064
void (String key, String value) { for (Bin bin : getMembers()) { if (bin instanceof StringTableEntry entry && bin.getName().equals(key)) { entry.setValue(value); return; } } throw new IllegalStateException("Could not find string with key: " + key); }
setStringValue
69,065
long () { long size = myValueLength.getValue(); assert size % 4 == 0; return size / 4; // DWord size in bytes }
getValue
69,066
VersionInfoBin (int index) { return new Var("Var" + index); }
createChild
69,067
void (String[] args) { if (args.length != 6) { System.err.println("Usage: LauncherGeneratorMain <template EXE file> <app info file> <resource.h file> <properties> <path to ico> <output>"); System.exit(1); } File template = new File(args[0]); if (!template.exists()) { System.err.println("Launcher template EXE file " + a...
main
69,068
Element (Element appInfoRoot, String logo) { return appInfoRoot.getChild(logo, appInfoRoot.getNamespace()); }
getChild
69,069
RawResource () { DirectoryEntry viDir = myRoot.findSubDir(DirectoryEntry.RT_VERSION).findSubDir(1); return viDir.getRawResource(); }
getVersionInfoResource
69,070
void () { ImageOptionalHeader imageOptionalHeader = myReader.getPeHeader().getImageOptionalHeader(); final int FileAlignment = (int)imageOptionalHeader.getFileAlignment().getValue(); final int SectionAlignment = (int)imageOptionalHeader.getSectionAlignment().getValue(); List<String> errors = new ArrayList<>(); Bin.Arra...
verifySections
69,071
void (List<String> errors, String name, ImageDataDirectory idd, ImageSectionHeader ish) { long iddSize = idd.getSize().getValue(); long ishVirtualSize = ish.getVirtualSize().getValue(); if (iddSize != ishVirtualSize) { errors.add(format("Incorrect '%s' sizes: %#x, %#x", name, iddSize, ishVirtualSize)); } long iddAddres...
check
69,072
ImageSectionHeader (Bin.ArrayOfBins<ImageSectionHeader> sections, String name) { for (ImageSectionHeader header : sections) { if (name.equals(header.getSectionName())) { return header; } } throw new IllegalStateException("Cannot find section with name " + name); }
getSection
69,073
void (int id, String value) { myStringTableDirectory.setString(id, value); }
setResourceString
69,074
void (String key, String value) { StringTable stringTable = myVersionInfo.getStringFileInfo().getSoleStringTable(); stringTable.setStringValue(key, value); }
setVersionInfoString
69,075
void (int id, byte[] bitmapFileData) { DirectoryEntry subDirBmp = myRoot.findSubDir(DirectoryEntry.RT_BITMAP).findSubDir(id); RawResource bmpRes = subDirBmp.getRawResource(); // strip off BITMAPFILEHEADER byte[] bitmapResourceData = new byte[bitmapFileData.length - 14]; System.arraycopy(bitmapFileData, 14, bitmapResour...
injectBitmap
69,076
void (int majorVersion, int minorVersion, int bugfixVersion) { int mostSignificantVersion = majorVersion << 16 | minorVersion; int leastSignificantVersion = bugfixVersion << 16; myVersionInfo.getFixedFileInfo().setFileVersion(mostSignificantVersion, leastSignificantVersion); myVersionInfo.getFixedFileInfo().setProductV...
setVersionNumber
69,077
void (String[] args) { int exitStatus; try { ClassLoader original = Thread.currentThread().getContextClassLoader(); List<Path> files = new ArrayList<>(); for (String path : System.getProperty("java.class.path").split(File.pathSeparator)) { if (!path.isEmpty()) { files.add(Path.of(path)); } } UrlClassLoader loader = Url...
main
69,078
int (final String[] argv, final ClassLoader classLoader) { final Ref<Throwable> errorRef = new Ref<>(); final Ref<Runtime> runtimeRef = new Ref<>(); try { UITestUtil.replaceIdeEventQueueSafely(); EdtInvocationManager.invokeAndWaitIfNeeded(() -> { IdeEventQueue.getInstance().getRwLockHolder().runWriteIntentReadAction(()...
run
69,079
Iterable<Resource> (String path, String suffix) { Iterable<Resource> resources = super.resources(path, suffix); if (!TestCaseLoader.shouldBucketTests() || !".feature".equals(suffix)) { return resources; } List<Resource> result = new ArrayList<>(); for (Resource resource : resources) { if (TestCaseLoader.matchesCurrentB...
resources
69,080
String[] () { return new String[]{"jetbrains.dic", "names.dic"}; }
getBundledDictionaries
69,081
String () { return "Dictionary"; }
getName
69,082
String () { return SpellCheckerBundle.message("filetype.dictionary.description"); }
getDescription
69,083
String () { return SpellCheckerBundle.message("filetype.dictionary.display.name"); }
getDisplayName
69,084
String () { return "dic"; }
getDefaultExtension
69,085
Icon () { return SpellcheckerIcons.Dictionary; }
getIcon
69,086
boolean () { return false; }
isBinary
69,087
List<HighlightInfoType> () { final class T extends HighlightInfoType.HighlightInfoTypeImpl implements HighlightInfoType.Iconable { private T(@NotNull HighlightSeverity severity, @NotNull TextAttributesKey attributesKey) { super(severity, attributesKey); } @Override public @NotNull Icon getIcon() { return AllIcons.Gener...
getSeveritiesHighlightInfoTypes
69,088
Icon () { return AllIcons.General.InspectionsTypos; }
getIcon
69,089
boolean (HighlightSeverity minSeverity) { return TYPO != minSeverity; }
isGotoBySeverityEnabled
69,090
String () { return name; }
getName
69,091
void (@NotNull Consumer<String> consumer) { final VirtualFile file = VfsUtil.findFileByIoFile(new File(url), true); if (file == null || file.isDirectory()) { return; } Charset charset = file.getCharset(); try (InputStream stream = file.getInputStream()) { try (BufferedReader br = new BufferedReader(new InputStreamReade...
load
69,092
void (final String rootPath, final Consumer<? super String> consumer) { final File rootFile = new File(rootPath); if (rootFile.exists() && rootFile.isDirectory()) { FileUtil.processFilesRecursively(rootFile, file -> { if (!file.isDirectory()) { final String path = file.getPath(); if (path.endsWith(".dic")) { consumer.c...
processFilesRecursively
69,093
boolean (String word) { if (word.length() == 0) return false; boolean lowCase = true; for (int i = 1; i < word.length() && lowCase; i++) { lowCase = Character.isLowerCase(word.charAt(i)); } return Character.isUpperCase(word.charAt(0)) && lowCase; }
isCapitalized
69,094
boolean (@NotNull String text, @NotNull TextRange range) { if (range.getLength() == 0) return false; CharacterIterator it = new StringCharacterIterator(text, range.getStartOffset() + 1, range.getEndOffset(), range.getStartOffset() + 1); boolean lowCase = true; for (char c = it.first(); c != CharacterIterator.DONE; c = ...
isCapitalized
69,095
boolean (@NotNull String text, @NotNull TextRange range) { if (range.getLength() == 0) return false; CharacterIterator it = new StringCharacterIterator(text, range.getStartOffset(), range.getEndOffset(), range.getStartOffset()); for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) { if (!Character.isUp...
isUpperCased
69,096
boolean (String word) { boolean upperCase = true; for (int i = 0; i < word.length() && upperCase; i++) { upperCase = Character.isUpperCase(word.charAt(i)); } return upperCase; }
isUpperCase
69,097
boolean (String word) { if (word.length() < 2) return false; String tail = word.substring(1); String lowerCase = StringUtil.toLowerCase(tail); return !tail.equals(lowerCase) && !isUpperCase(word); }
isMixedCase
69,098
void (List<String> words) { words.replaceAll(StringUtil::capitalize); }
capitalize
69,099
void (List<String> words) { words.replaceAll(StringUtil::toUpperCase); }
upperCase