repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java
JBossClassLoaderHandler.handleResourceLoader
private static void handleResourceLoader(final Object resourceLoader, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) { if (resourceLoader == null) { return; } // PathResourceLoader has root field, which i...
java
private static void handleResourceLoader(final Object resourceLoader, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) { if (resourceLoader == null) { return; } // PathResourceLoader has root field, which i...
[ "private", "static", "void", "handleResourceLoader", "(", "final", "Object", "resourceLoader", ",", "final", "ClassLoader", "classLoader", ",", "final", "ClasspathOrder", "classpathOrderOut", ",", "final", "ScanSpec", "scanSpec", ",", "final", "LogNode", "log", ")", ...
Handle a resource loader. @param resourceLoader the resource loader @param classLoader the classloader @param classpathOrderOut the classpath order @param scanSpec the scan spec @param log the log
[ "Handle", "a", "resource", "loader", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java#L97-L145
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java
JBossClassLoaderHandler.handleRealModule
private static void handleRealModule(final Object module, final Set<Object> visitedModules, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) { if (!visitedModules.add(module)) { // Avoid extracting paths from t...
java
private static void handleRealModule(final Object module, final Set<Object> visitedModules, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) { if (!visitedModules.add(module)) { // Avoid extracting paths from t...
[ "private", "static", "void", "handleRealModule", "(", "final", "Object", "module", ",", "final", "Set", "<", "Object", ">", "visitedModules", ",", "final", "ClassLoader", "classLoader", ",", "final", "ClasspathOrder", "classpathOrderOut", ",", "final", "ScanSpec", ...
Handle a module. @param module the module @param visitedModules visited modules @param classLoader the classloader @param classpathOrderOut the classpath order @param scanSpec the scan spec @param log the log
[ "Handle", "a", "module", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java#L163-L189
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/WhiteBlackList.java
WhiteBlackList.matchesPatternList
private static boolean matchesPatternList(final String str, final List<Pattern> patterns) { if (patterns != null) { for (final Pattern pattern : patterns) { if (pattern.matcher(str).matches()) { return true; } } } return...
java
private static boolean matchesPatternList(final String str, final List<Pattern> patterns) { if (patterns != null) { for (final Pattern pattern : patterns) { if (pattern.matcher(str).matches()) { return true; } } } return...
[ "private", "static", "boolean", "matchesPatternList", "(", "final", "String", "str", ",", "final", "List", "<", "Pattern", ">", "patterns", ")", "{", "if", "(", "patterns", "!=", "null", ")", "{", "for", "(", "final", "Pattern", "pattern", ":", "patterns",...
Check if a string matches one of the patterns in the provided list. @param str the string to test @param patterns the patterns @return true, if successful
[ "Check", "if", "a", "string", "matches", "one", "of", "the", "patterns", "in", "the", "provided", "list", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/WhiteBlackList.java#L578-L587
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/WhiteBlackList.java
WhiteBlackList.quoteList
private static void quoteList(final Collection<String> coll, final StringBuilder buf) { buf.append('['); boolean first = true; for (final String item : coll) { if (first) { first = false; } else { buf.append(", "); } ...
java
private static void quoteList(final Collection<String> coll, final StringBuilder buf) { buf.append('['); boolean first = true; for (final String item : coll) { if (first) { first = false; } else { buf.append(", "); } ...
[ "private", "static", "void", "quoteList", "(", "final", "Collection", "<", "String", ">", "coll", ",", "final", "StringBuilder", "buf", ")", "{", "buf", ".", "append", "(", "'", "'", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", "final", ...
Quote list. @param coll the coll @param buf the buf
[ "Quote", "list", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/WhiteBlackList.java#L661-L682
train
classgraph/classgraph
src/main/java/io/github/classgraph/ClasspathElementZip.java
ClasspathElementZip.getModuleName
@Override public String getModuleName() { String moduleName = moduleNameFromModuleDescriptor; if (moduleName == null || moduleName.isEmpty()) { moduleName = moduleNameFromManifestFile; } if (moduleName == null || moduleName.isEmpty()) { if (derivedAutomaticMod...
java
@Override public String getModuleName() { String moduleName = moduleNameFromModuleDescriptor; if (moduleName == null || moduleName.isEmpty()) { moduleName = moduleNameFromManifestFile; } if (moduleName == null || moduleName.isEmpty()) { if (derivedAutomaticMod...
[ "@", "Override", "public", "String", "getModuleName", "(", ")", "{", "String", "moduleName", "=", "moduleNameFromModuleDescriptor", ";", "if", "(", "moduleName", "==", "null", "||", "moduleName", ".", "isEmpty", "(", ")", ")", "{", "moduleName", "=", "moduleNa...
Get module name from module descriptor, or get the automatic module name from the manifest file, or derive an automatic module name from the jar name. @return the module name
[ "Get", "module", "name", "from", "module", "descriptor", "or", "get", "the", "automatic", "module", "name", "from", "the", "manifest", "file", "or", "derive", "an", "automatic", "module", "name", "from", "the", "jar", "name", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClasspathElementZip.java#L513-L526
train
classgraph/classgraph
src/main/java/io/github/classgraph/ClasspathElementZip.java
ClasspathElementZip.getZipFilePath
String getZipFilePath() { return packageRootPrefix.isEmpty() ? zipFilePath : zipFilePath + "!/" + packageRootPrefix.substring(0, packageRootPrefix.length() - 1); }
java
String getZipFilePath() { return packageRootPrefix.isEmpty() ? zipFilePath : zipFilePath + "!/" + packageRootPrefix.substring(0, packageRootPrefix.length() - 1); }
[ "String", "getZipFilePath", "(", ")", "{", "return", "packageRootPrefix", ".", "isEmpty", "(", ")", "?", "zipFilePath", ":", "zipFilePath", "+", "\"!/\"", "+", "packageRootPrefix", ".", "substring", "(", "0", ",", "packageRootPrefix", ".", "length", "(", ")", ...
Get the zipfile path. @return the path of the zipfile, including any package root.
[ "Get", "the", "zipfile", "path", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClasspathElementZip.java#L533-L536
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classpath/ClasspathOrder.java
ClasspathOrder.filter
private boolean filter(final String classpathElementPath) { if (scanSpec.classpathElementFilters != null) { for (final ClasspathElementFilter filter : scanSpec.classpathElementFilters) { if (!filter.includeClasspathElement(classpathElementPath)) { return false; ...
java
private boolean filter(final String classpathElementPath) { if (scanSpec.classpathElementFilters != null) { for (final ClasspathElementFilter filter : scanSpec.classpathElementFilters) { if (!filter.includeClasspathElement(classpathElementPath)) { return false; ...
[ "private", "boolean", "filter", "(", "final", "String", "classpathElementPath", ")", "{", "if", "(", "scanSpec", ".", "classpathElementFilters", "!=", "null", ")", "{", "for", "(", "final", "ClasspathElementFilter", "filter", ":", "scanSpec", ".", "classpathElemen...
Test to see if a RelativePath has been filtered out by the user. @param classpathElementPath the classpath element path @return true, if not filtered out
[ "Test", "to", "see", "if", "a", "RelativePath", "has", "been", "filtered", "out", "by", "the", "user", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/ClasspathOrder.java#L93-L102
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classpath/ClasspathOrder.java
ClasspathOrder.addSystemClasspathEntry
boolean addSystemClasspathEntry(final String pathEntry, final ClassLoader classLoader) { if (classpathEntryUniqueResolvedPaths.add(pathEntry)) { order.add(new SimpleEntry<>(pathEntry, classLoader)); return true; } return false; }
java
boolean addSystemClasspathEntry(final String pathEntry, final ClassLoader classLoader) { if (classpathEntryUniqueResolvedPaths.add(pathEntry)) { order.add(new SimpleEntry<>(pathEntry, classLoader)); return true; } return false; }
[ "boolean", "addSystemClasspathEntry", "(", "final", "String", "pathEntry", ",", "final", "ClassLoader", "classLoader", ")", "{", "if", "(", "classpathEntryUniqueResolvedPaths", ".", "add", "(", "pathEntry", ")", ")", "{", "order", ".", "add", "(", "new", "Simple...
Add a system classpath entry. @param pathEntry the system classpath entry -- the path string should already have been run through FastPathResolver.resolve(FileUtils.CURR_DIR_PATH, path @param classLoader the classloader @return true, if added and unique
[ "Add", "a", "system", "classpath", "entry", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/ClasspathOrder.java#L114-L120
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classpath/ClasspathOrder.java
ClasspathOrder.addClasspathEntry
private boolean addClasspathEntry(final String pathEntry, final ClassLoader classLoader, final ScanSpec scanSpec) { if (scanSpec.overrideClasspath == null // && (SystemJarFinder.getJreLibOrExtJars().contains(pathEntry) || pathEntry.equals(SystemJarFinder.getJr...
java
private boolean addClasspathEntry(final String pathEntry, final ClassLoader classLoader, final ScanSpec scanSpec) { if (scanSpec.overrideClasspath == null // && (SystemJarFinder.getJreLibOrExtJars().contains(pathEntry) || pathEntry.equals(SystemJarFinder.getJr...
[ "private", "boolean", "addClasspathEntry", "(", "final", "String", "pathEntry", ",", "final", "ClassLoader", "classLoader", ",", "final", "ScanSpec", "scanSpec", ")", "{", "if", "(", "scanSpec", ".", "overrideClasspath", "==", "null", "//", "&&", "(", "SystemJar...
Add a classpath entry. @param pathEntry the classpath entry -- the path string should already have been run through FastPathResolver.resolve(FileUtils.CURR_DIR_PATH, path) @param classLoader the classloader @param scanSpec the scan spec @return true, if added and unique
[ "Add", "a", "classpath", "entry", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/ClasspathOrder.java#L134-L148
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classpath/ClasspathOrder.java
ClasspathOrder.addClasspathEntries
public boolean addClasspathEntries(final String pathStr, final ClassLoader classLoader, final ScanSpec scanSpec, final LogNode log) { if (pathStr == null || pathStr.isEmpty()) { return false; } else { final String[] parts = JarUtils.smartPathSplit(pathStr); ...
java
public boolean addClasspathEntries(final String pathStr, final ClassLoader classLoader, final ScanSpec scanSpec, final LogNode log) { if (pathStr == null || pathStr.isEmpty()) { return false; } else { final String[] parts = JarUtils.smartPathSplit(pathStr); ...
[ "public", "boolean", "addClasspathEntries", "(", "final", "String", "pathStr", ",", "final", "ClassLoader", "classLoader", ",", "final", "ScanSpec", "scanSpec", ",", "final", "LogNode", "log", ")", "{", "if", "(", "pathStr", "==", "null", "||", "pathStr", ".",...
Add classpath entries, separated by the system path separator character. @param pathStr the delimited string of URLs or paths of the classpath. @param classLoader the ClassLoader that this classpath was obtained from. @param scanSpec the scan spec @param log the LogNode instance to use if logging in verbose mode. @ret...
[ "Add", "classpath", "entries", "separated", "by", "the", "system", "path", "separator", "character", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/ClasspathOrder.java#L288-L303
train
classgraph/classgraph
src/main/java/io/github/classgraph/TypeArgument.java
TypeArgument.parse
private static TypeArgument parse(final Parser parser, final String definingClassName) throws ParseException { final char peek = parser.peek(); if (peek == '*') { parser.expect('*'); return new TypeArgument(Wildcard.ANY, null); } else if (peek == '+') { parser...
java
private static TypeArgument parse(final Parser parser, final String definingClassName) throws ParseException { final char peek = parser.peek(); if (peek == '*') { parser.expect('*'); return new TypeArgument(Wildcard.ANY, null); } else if (peek == '+') { parser...
[ "private", "static", "TypeArgument", "parse", "(", "final", "Parser", "parser", ",", "final", "String", "definingClassName", ")", "throws", "ParseException", "{", "final", "char", "peek", "=", "parser", ".", "peek", "(", ")", ";", "if", "(", "peek", "==", ...
Parse a type argument. @param parser The parser. @param definingClassName The name of the defining class (for resolving type variables). @return The parsed method type signature. @throws ParseException If method type signature could not be parsed.
[ "Parse", "a", "type", "argument", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/TypeArgument.java#L111-L140
train
classgraph/classgraph
src/main/java/io/github/classgraph/TypeArgument.java
TypeArgument.parseList
static List<TypeArgument> parseList(final Parser parser, final String definingClassName) throws ParseException { if (parser.peek() == '<') { parser.expect('<'); final List<TypeArgument> typeArguments = new ArrayList<>(2); while (parser.peek() != '>') { if (!pa...
java
static List<TypeArgument> parseList(final Parser parser, final String definingClassName) throws ParseException { if (parser.peek() == '<') { parser.expect('<'); final List<TypeArgument> typeArguments = new ArrayList<>(2); while (parser.peek() != '>') { if (!pa...
[ "static", "List", "<", "TypeArgument", ">", "parseList", "(", "final", "Parser", "parser", ",", "final", "String", "definingClassName", ")", "throws", "ParseException", "{", "if", "(", "parser", ".", "peek", "(", ")", "==", "'", "'", ")", "{", "parser", ...
Parse a list of type arguments. @param parser The parser. @param definingClassName The name of the defining class (for resolving type variables). @return The list of type arguments. @throws ParseException If type signature could not be parsed.
[ "Parse", "a", "list", "of", "type", "arguments", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/TypeArgument.java#L153-L168
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classloaderhandler/EquinoxClassLoaderHandler.java
EquinoxClassLoaderHandler.addBundleFile
private static void addBundleFile(final Object bundlefile, final Set<Object> path, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) { // Don't get stuck in infinite loop if (bundlefile != null && path.add(bundlefil...
java
private static void addBundleFile(final Object bundlefile, final Set<Object> path, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) { // Don't get stuck in infinite loop if (bundlefile != null && path.add(bundlefil...
[ "private", "static", "void", "addBundleFile", "(", "final", "Object", "bundlefile", ",", "final", "Set", "<", "Object", ">", "path", ",", "final", "ClassLoader", "classLoader", ",", "final", "ClasspathOrder", "classpathOrderOut", ",", "final", "ScanSpec", "scanSpe...
Add the bundle file. @param bundlefile the bundle file @param path the path @param classLoader the classloader @param classpathOrderOut the classpath order @param scanSpec the scan spec @param log the log
[ "Add", "the", "bundle", "file", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classloaderhandler/EquinoxClassLoaderHandler.java#L103-L134
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classloaderhandler/EquinoxClassLoaderHandler.java
EquinoxClassLoaderHandler.addClasspathEntries
private static void addClasspathEntries(final Object owner, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) { // type ClasspathEntry[] final Object entries = ReflectionUtils.getFieldVal(owner, "entries", false); if (e...
java
private static void addClasspathEntries(final Object owner, final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec, final LogNode log) { // type ClasspathEntry[] final Object entries = ReflectionUtils.getFieldVal(owner, "entries", false); if (e...
[ "private", "static", "void", "addClasspathEntries", "(", "final", "Object", "owner", ",", "final", "ClassLoader", "classLoader", ",", "final", "ClasspathOrder", "classpathOrderOut", ",", "final", "ScanSpec", "scanSpec", ",", "final", "LogNode", "log", ")", "{", "/...
Adds the classpath entries. @param owner the owner @param classLoader the class loader @param classpathOrderOut the classpath order out @param scanSpec the scan spec @param log the log
[ "Adds", "the", "classpath", "entries", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classloaderhandler/EquinoxClassLoaderHandler.java#L150-L163
train
classgraph/classgraph
src/main/java/io/github/classgraph/ClassTypeSignature.java
ClassTypeSignature.parse
static ClassTypeSignature parse(final String typeDescriptor, final ClassInfo classInfo) throws ParseException { final Parser parser = new Parser(typeDescriptor); // The defining class name is used to resolve type variables using the defining class' type descriptor. // But here we are parsing the...
java
static ClassTypeSignature parse(final String typeDescriptor, final ClassInfo classInfo) throws ParseException { final Parser parser = new Parser(typeDescriptor); // The defining class name is used to resolve type variables using the defining class' type descriptor. // But here we are parsing the...
[ "static", "ClassTypeSignature", "parse", "(", "final", "String", "typeDescriptor", ",", "final", "ClassInfo", "classInfo", ")", "throws", "ParseException", "{", "final", "Parser", "parser", "=", "new", "Parser", "(", "typeDescriptor", ")", ";", "// The defining clas...
Parse a class type signature or class type descriptor. @param typeDescriptor The class type signature or class type descriptor to parse. @param classInfo the class info @return The parsed class type signature or class type descriptor. @throws ParseException If the class type signature could not be parsed.
[ "Parse", "a", "class", "type", "signature", "or", "class", "type", "descriptor", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassTypeSignature.java#L124-L151
train
classgraph/classgraph
src/main/java/io/github/classgraph/FieldInfo.java
FieldInfo.getTypeDescriptor
public TypeSignature getTypeDescriptor() { if (typeDescriptorStr == null) { return null; } if (typeDescriptor == null) { try { typeDescriptor = TypeSignature.parse(typeDescriptorStr, declaringClassName); typeDescriptor.setScanResult(scanRes...
java
public TypeSignature getTypeDescriptor() { if (typeDescriptorStr == null) { return null; } if (typeDescriptor == null) { try { typeDescriptor = TypeSignature.parse(typeDescriptorStr, declaringClassName); typeDescriptor.setScanResult(scanRes...
[ "public", "TypeSignature", "getTypeDescriptor", "(", ")", "{", "if", "(", "typeDescriptorStr", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "typeDescriptor", "==", "null", ")", "{", "try", "{", "typeDescriptor", "=", "TypeSignature", ".", ...
Returns the parsed type descriptor for the field, if available. @return The parsed type descriptor for the field, if available, else returns null.
[ "Returns", "the", "parsed", "type", "descriptor", "for", "the", "field", "if", "available", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/FieldInfo.java#L202-L215
train
classgraph/classgraph
src/main/java/io/github/classgraph/FieldInfo.java
FieldInfo.getTypeSignature
public TypeSignature getTypeSignature() { if (typeSignatureStr == null) { return null; } if (typeSignature == null) { try { typeSignature = TypeSignature.parse(typeSignatureStr, declaringClassName); typeSignature.setScanResult(scanResult); ...
java
public TypeSignature getTypeSignature() { if (typeSignatureStr == null) { return null; } if (typeSignature == null) { try { typeSignature = TypeSignature.parse(typeSignatureStr, declaringClassName); typeSignature.setScanResult(scanResult); ...
[ "public", "TypeSignature", "getTypeSignature", "(", ")", "{", "if", "(", "typeSignatureStr", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "typeSignature", "==", "null", ")", "{", "try", "{", "typeSignature", "=", "TypeSignature", ".", "pa...
Returns the parsed type signature for the field, if available. @return The parsed type signature for the field, if available, else returns null.
[ "Returns", "the", "parsed", "type", "signature", "for", "the", "field", "if", "available", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/FieldInfo.java#L222-L235
train
classgraph/classgraph
src/main/java/io/github/classgraph/FieldInfo.java
FieldInfo.compareTo
@Override public int compareTo(final FieldInfo other) { final int diff = declaringClassName.compareTo(other.declaringClassName); if (diff != 0) { return diff; } return name.compareTo(other.name); }
java
@Override public int compareTo(final FieldInfo other) { final int diff = declaringClassName.compareTo(other.declaringClassName); if (diff != 0) { return diff; } return name.compareTo(other.name); }
[ "@", "Override", "public", "int", "compareTo", "(", "final", "FieldInfo", "other", ")", "{", "final", "int", "diff", "=", "declaringClassName", ".", "compareTo", "(", "other", ".", "declaringClassName", ")", ";", "if", "(", "diff", "!=", "0", ")", "{", "...
Sort in order of class name then field name. @param other the other FieldInfo object to compare to. @return the result of comparison.
[ "Sort", "in", "order", "of", "class", "name", "then", "field", "name", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/FieldInfo.java#L449-L456
train
classgraph/classgraph
src/main/java/io/github/classgraph/Scanner.java
Scanner.getModuleOrder
private List<ClasspathElementModule> getModuleOrder(final LogNode log) throws InterruptedException { final List<ClasspathElementModule> moduleCpEltOrder = new ArrayList<>(); if (scanSpec.overrideClasspath == null && scanSpec.overrideClassLoaders == null && scanSpec.scanModules) { // Add modu...
java
private List<ClasspathElementModule> getModuleOrder(final LogNode log) throws InterruptedException { final List<ClasspathElementModule> moduleCpEltOrder = new ArrayList<>(); if (scanSpec.overrideClasspath == null && scanSpec.overrideClassLoaders == null && scanSpec.scanModules) { // Add modu...
[ "private", "List", "<", "ClasspathElementModule", ">", "getModuleOrder", "(", "final", "LogNode", "log", ")", "throws", "InterruptedException", "{", "final", "List", "<", "ClasspathElementModule", ">", "moduleCpEltOrder", "=", "new", "ArrayList", "<>", "(", ")", "...
Get the module order. @param log the log @return the module order @throws InterruptedException if interrupted
[ "Get", "the", "module", "order", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Scanner.java#L175-L231
train
classgraph/classgraph
src/main/java/io/github/classgraph/Scanner.java
Scanner.findClasspathOrderRec
private static void findClasspathOrderRec(final ClasspathElement currClasspathElement, final Set<ClasspathElement> visitedClasspathElts, final List<ClasspathElement> order) { if (visitedClasspathElts.add(currClasspathElement)) { if (!currClasspathElement.skipClasspathElement) { ...
java
private static void findClasspathOrderRec(final ClasspathElement currClasspathElement, final Set<ClasspathElement> visitedClasspathElts, final List<ClasspathElement> order) { if (visitedClasspathElts.add(currClasspathElement)) { if (!currClasspathElement.skipClasspathElement) { ...
[ "private", "static", "void", "findClasspathOrderRec", "(", "final", "ClasspathElement", "currClasspathElement", ",", "final", "Set", "<", "ClasspathElement", ">", "visitedClasspathElts", ",", "final", "List", "<", "ClasspathElement", ">", "order", ")", "{", "if", "(...
Recursively perform a depth-first search of jar interdependencies, breaking cycles if necessary, to determine the final classpath element order. @param currClasspathElement the current classpath element @param visitedClasspathElts visited classpath elts @param order the classpath element order
[ "Recursively", "perform", "a", "depth", "-", "first", "search", "of", "jar", "interdependencies", "breaking", "cycles", "if", "necessary", "to", "determine", "the", "final", "classpath", "element", "order", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Scanner.java#L246-L259
train
classgraph/classgraph
src/main/java/io/github/classgraph/Scanner.java
Scanner.orderClasspathElements
private static List<ClasspathElement> orderClasspathElements( final Collection<Entry<Integer, ClasspathElement>> classpathEltsIndexed) { final List<Entry<Integer, ClasspathElement>> classpathEltsIndexedOrdered = new ArrayList<>( classpathEltsIndexed); CollectionUtils.sortIfNo...
java
private static List<ClasspathElement> orderClasspathElements( final Collection<Entry<Integer, ClasspathElement>> classpathEltsIndexed) { final List<Entry<Integer, ClasspathElement>> classpathEltsIndexedOrdered = new ArrayList<>( classpathEltsIndexed); CollectionUtils.sortIfNo...
[ "private", "static", "List", "<", "ClasspathElement", ">", "orderClasspathElements", "(", "final", "Collection", "<", "Entry", "<", "Integer", ",", "ClasspathElement", ">", ">", "classpathEltsIndexed", ")", "{", "final", "List", "<", "Entry", "<", "Integer", ","...
Sort a collection of indexed ClasspathElements into increasing order of integer index key. @param classpathEltsIndexed the indexed classpath elts @return the classpath elements, ordered by index
[ "Sort", "a", "collection", "of", "indexed", "ClasspathElements", "into", "increasing", "order", "of", "integer", "index", "key", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Scanner.java#L278-L288
train
classgraph/classgraph
src/main/java/io/github/classgraph/Scanner.java
Scanner.findClasspathOrder
private List<ClasspathElement> findClasspathOrder(final Set<ClasspathElement> uniqueClasspathElements, final Queue<Entry<Integer, ClasspathElement>> toplevelClasspathEltsIndexed) { final List<ClasspathElement> toplevelClasspathEltsOrdered = orderClasspathElements( toplevelClasspathEl...
java
private List<ClasspathElement> findClasspathOrder(final Set<ClasspathElement> uniqueClasspathElements, final Queue<Entry<Integer, ClasspathElement>> toplevelClasspathEltsIndexed) { final List<ClasspathElement> toplevelClasspathEltsOrdered = orderClasspathElements( toplevelClasspathEl...
[ "private", "List", "<", "ClasspathElement", ">", "findClasspathOrder", "(", "final", "Set", "<", "ClasspathElement", ">", "uniqueClasspathElements", ",", "final", "Queue", "<", "Entry", "<", "Integer", ",", "ClasspathElement", ">", ">", "toplevelClasspathEltsIndexed",...
Recursively perform a depth-first traversal of child classpath elements, breaking cycles if necessary, to determine the final classpath element order. This causes child classpath elements to be inserted in-place in the classpath order, after the parent classpath element that contained them. @param uniqueClasspathEleme...
[ "Recursively", "perform", "a", "depth", "-", "first", "traversal", "of", "child", "classpath", "elements", "breaking", "cycles", "if", "necessary", "to", "determine", "the", "final", "classpath", "element", "order", ".", "This", "causes", "child", "classpath", "...
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Scanner.java#L301-L315
train
classgraph/classgraph
src/main/java/io/github/classgraph/Scanner.java
Scanner.processWorkUnits
private <W> void processWorkUnits(final Collection<W> workUnits, final LogNode log, final WorkUnitProcessor<W> workUnitProcessor) throws InterruptedException, ExecutionException { WorkQueue.runWorkQueue(workUnits, executorService, interruptionChecker, numParallelTasks, log, workUnitP...
java
private <W> void processWorkUnits(final Collection<W> workUnits, final LogNode log, final WorkUnitProcessor<W> workUnitProcessor) throws InterruptedException, ExecutionException { WorkQueue.runWorkQueue(workUnits, executorService, interruptionChecker, numParallelTasks, log, workUnitP...
[ "private", "<", "W", ">", "void", "processWorkUnits", "(", "final", "Collection", "<", "W", ">", "workUnits", ",", "final", "LogNode", "log", ",", "final", "WorkUnitProcessor", "<", "W", ">", "workUnitProcessor", ")", "throws", "InterruptedException", ",", "Ex...
Process work units. @param <W> the work unit type @param workUnits the work units @param log the log entry text to group work units under @param workUnitProcessor the work unit processor @throws InterruptedException if a worker was interrupted. @throws ExecutionException If a worker threw an uncaught exception.
[ "Process", "work", "units", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Scanner.java#L335-L344
train
classgraph/classgraph
src/main/java/io/github/classgraph/Scanner.java
Scanner.call
@Override public ScanResult call() throws InterruptedException, CancellationException, ExecutionException { ScanResult scanResult = null; Exception exception = null; final long scanStart = System.currentTimeMillis(); try { // Perform the scan scanResult = open...
java
@Override public ScanResult call() throws InterruptedException, CancellationException, ExecutionException { ScanResult scanResult = null; Exception exception = null; final long scanStart = System.currentTimeMillis(); try { // Perform the scan scanResult = open...
[ "@", "Override", "public", "ScanResult", "call", "(", ")", "throws", "InterruptedException", ",", "CancellationException", ",", "ExecutionException", "{", "ScanResult", "scanResult", "=", "null", ";", "Exception", "exception", "=", "null", ";", "final", "long", "s...
Determine the unique ordered classpath elements, and run a scan looking for file or classfile matches if necessary. @return the scan result @throws InterruptedException if scanning was interrupted @throws CancellationException if scanning was cancelled @throws ExecutionException if a worker threw an uncaught exception
[ "Determine", "the", "unique", "ordered", "classpath", "elements", "and", "run", "a", "scan", "looking", "for", "file", "or", "classfile", "matches", "if", "necessary", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Scanner.java#L994-L1094
train
classgraph/classgraph
src/main/java/io/github/classgraph/ModuleReaderProxy.java
ModuleReaderProxy.list
public List<String> list() throws SecurityException { if (collectorsToList == null) { throw new IllegalArgumentException("Could not call Collectors.toList()"); } final Object /* Stream<String> */ resourcesStream = ReflectionUtils.invokeMethod(moduleReader, "list", /* ...
java
public List<String> list() throws SecurityException { if (collectorsToList == null) { throw new IllegalArgumentException("Could not call Collectors.toList()"); } final Object /* Stream<String> */ resourcesStream = ReflectionUtils.invokeMethod(moduleReader, "list", /* ...
[ "public", "List", "<", "String", ">", "list", "(", ")", "throws", "SecurityException", "{", "if", "(", "collectorsToList", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Could not call Collectors.toList()\"", ")", ";", "}", "final", ...
Get the list of resources accessible to a ModuleReader. From the documentation for ModuleReader#list(): "Whether the stream of elements includes names corresponding to directories in the module is module reader specific. In lazy implementations then an IOException may be thrown when using the stream to list the module...
[ "Get", "the", "list", "of", "resources", "accessible", "to", "a", "ModuleReader", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ModuleReaderProxy.java#L103-L120
train
classgraph/classgraph
src/main/java/io/github/classgraph/ModuleReaderProxy.java
ModuleReaderProxy.openOrRead
private Object openOrRead(final String path, final boolean open) throws SecurityException { final String methodName = open ? "open" : "read"; final Object /* Optional<InputStream> */ optionalInputStream = ReflectionUtils.invokeMethod(moduleReader, methodName, String.class, path, /* throw...
java
private Object openOrRead(final String path, final boolean open) throws SecurityException { final String methodName = open ? "open" : "read"; final Object /* Optional<InputStream> */ optionalInputStream = ReflectionUtils.invokeMethod(moduleReader, methodName, String.class, path, /* throw...
[ "private", "Object", "openOrRead", "(", "final", "String", "path", ",", "final", "boolean", "open", ")", "throws", "SecurityException", "{", "final", "String", "methodName", "=", "open", "?", "\"open\"", ":", "\"read\"", ";", "final", "Object", "/* Optional<Inpu...
Use the proxied ModuleReader to open the named resource as an InputStream. @param path The path to the resource to open. @param open if true, call moduleReader.open(name).get() (returning an InputStream), otherwise call moduleReader.read(name).get() (returning a ByteBuffer). @return An {@link InputStream} for the cont...
[ "Use", "the", "proxied", "ModuleReader", "to", "open", "the", "named", "resource", "as", "an", "InputStream", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ModuleReaderProxy.java#L134-L147
train
classgraph/classgraph
src/main/java/io/github/classgraph/AnnotationInfoList.java
AnnotationInfoList.findMetaAnnotations
private static void findMetaAnnotations(final AnnotationInfo ai, final AnnotationInfoList allAnnotationsOut, final Set<ClassInfo> visited) { final ClassInfo annotationClassInfo = ai.getClassInfo(); if (annotationClassInfo != null && annotationClassInfo.annotationInfo != null // Don't...
java
private static void findMetaAnnotations(final AnnotationInfo ai, final AnnotationInfoList allAnnotationsOut, final Set<ClassInfo> visited) { final ClassInfo annotationClassInfo = ai.getClassInfo(); if (annotationClassInfo != null && annotationClassInfo.annotationInfo != null // Don't...
[ "private", "static", "void", "findMetaAnnotations", "(", "final", "AnnotationInfo", "ai", ",", "final", "AnnotationInfoList", "allAnnotationsOut", ",", "final", "Set", "<", "ClassInfo", ">", "visited", ")", "{", "final", "ClassInfo", "annotationClassInfo", "=", "ai"...
Find the transitive closure of meta-annotations. @param ai the annotationInfo object @param allAnnotationsOut annotations out @param visited visited
[ "Find", "the", "transitive", "closure", "of", "meta", "-", "annotations", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/AnnotationInfoList.java#L268-L286
train
classgraph/classgraph
src/main/java/io/github/classgraph/MethodInfoList.java
MethodInfoList.containsName
public boolean containsName(final String methodName) { for (final MethodInfo mi : this) { if (mi.getName().equals(methodName)) { return true; } } return false; }
java
public boolean containsName(final String methodName) { for (final MethodInfo mi : this) { if (mi.getName().equals(methodName)) { return true; } } return false; }
[ "public", "boolean", "containsName", "(", "final", "String", "methodName", ")", "{", "for", "(", "final", "MethodInfo", "mi", ":", "this", ")", "{", "if", "(", "mi", ".", "getName", "(", ")", ".", "equals", "(", "methodName", ")", ")", "{", "return", ...
Check whether the list contains a method with the given name. @param methodName The name of a class. @return true if the list contains a method with the given name.
[ "Check", "whether", "the", "list", "contains", "a", "method", "with", "the", "given", "name", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/MethodInfoList.java#L165-L172
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/InputStreamOrByteBufferAdapter.java
InputStreamOrByteBufferAdapter.read
private int read(final int off, final int len) throws IOException { if (len == 0) { return 0; } if (inputStream != null) { // Wrapped InputStream return inputStream.read(buf, off, len); } else { // Wrapped ByteBuffer final int b...
java
private int read(final int off, final int len) throws IOException { if (len == 0) { return 0; } if (inputStream != null) { // Wrapped InputStream return inputStream.read(buf, off, len); } else { // Wrapped ByteBuffer final int b...
[ "private", "int", "read", "(", "final", "int", "off", ",", "final", "int", "len", ")", "throws", "IOException", "{", "if", "(", "len", "==", "0", ")", "{", "return", "0", ";", "}", "if", "(", "inputStream", "!=", "null", ")", "{", "// Wrapped InputSt...
Copy up to len bytes into buf, starting at the given offset. @param off The start index for the copy. @param len The maximum number of bytes to copy. @return The number of bytes actually copied. @throws IOException If the file content could not be read.
[ "Copy", "up", "to", "len", "bytes", "into", "buf", "starting", "at", "the", "given", "offset", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/InputStreamOrByteBufferAdapter.java#L112-L142
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/InputStreamOrByteBufferAdapter.java
InputStreamOrByteBufferAdapter.readMore
private void readMore(final int bytesRequired) throws IOException { if ((long) used + (long) bytesRequired > FileUtils.MAX_BUFFER_SIZE) { // Since buf is an array, we're limited to reading 2GB per file throw new IOException("File is larger than 2GB, cannot read it"); } //...
java
private void readMore(final int bytesRequired) throws IOException { if ((long) used + (long) bytesRequired > FileUtils.MAX_BUFFER_SIZE) { // Since buf is an array, we're limited to reading 2GB per file throw new IOException("File is larger than 2GB, cannot read it"); } //...
[ "private", "void", "readMore", "(", "final", "int", "bytesRequired", ")", "throws", "IOException", "{", "if", "(", "(", "long", ")", "used", "+", "(", "long", ")", "bytesRequired", ">", "FileUtils", ".", "MAX_BUFFER_SIZE", ")", "{", "// Since buf is an array, ...
Read another chunk of from the InputStream or ByteBuffer. @param bytesRequired the number of bytes to read @throws IOException If an I/O exception occurs.
[ "Read", "another", "chunk", "of", "from", "the", "InputStream", "or", "ByteBuffer", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/InputStreamOrByteBufferAdapter.java#L152-L188
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/InputStreamOrByteBufferAdapter.java
InputStreamOrByteBufferAdapter.skip
public void skip(final int bytesToSkip) throws IOException { final int bytesToRead = Math.max(0, curr + bytesToSkip - used); if (bytesToRead > 0) { readMore(bytesToRead); } curr += bytesToSkip; }
java
public void skip(final int bytesToSkip) throws IOException { final int bytesToRead = Math.max(0, curr + bytesToSkip - used); if (bytesToRead > 0) { readMore(bytesToRead); } curr += bytesToSkip; }
[ "public", "void", "skip", "(", "final", "int", "bytesToSkip", ")", "throws", "IOException", "{", "final", "int", "bytesToRead", "=", "Math", ".", "max", "(", "0", ",", "curr", "+", "bytesToSkip", "-", "used", ")", ";", "if", "(", "bytesToRead", ">", "0...
Skip the given number of bytes. @param bytesToSkip The number of bytes to skip. @throws IOException If there was an exception while reading.
[ "Skip", "the", "given", "number", "of", "bytes", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/InputStreamOrByteBufferAdapter.java#L329-L335
train
classgraph/classgraph
src/main/java/io/github/classgraph/ResourceList.java
ResourceList.getPaths
public List<String> getPaths() { final List<String> resourcePaths = new ArrayList<>(this.size()); for (final Resource resource : this) { resourcePaths.add(resource.getPath()); } return resourcePaths; }
java
public List<String> getPaths() { final List<String> resourcePaths = new ArrayList<>(this.size()); for (final Resource resource : this) { resourcePaths.add(resource.getPath()); } return resourcePaths; }
[ "public", "List", "<", "String", ">", "getPaths", "(", ")", "{", "final", "List", "<", "String", ">", "resourcePaths", "=", "new", "ArrayList", "<>", "(", "this", ".", "size", "(", ")", ")", ";", "for", "(", "final", "Resource", "resource", ":", "thi...
Get the paths of all resources in this list relative to the package root. @return The paths of all resources in this list relative to the package root, by calling {@link Resource#getPath()} for each item in the list.
[ "Get", "the", "paths", "of", "all", "resources", "in", "this", "list", "relative", "to", "the", "package", "root", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ResourceList.java#L139-L145
train
classgraph/classgraph
src/main/java/io/github/classgraph/ClassGraphException.java
ClassGraphException.newClassGraphException
public static ClassGraphException newClassGraphException(final String message, final Throwable cause) throws ClassGraphException { return new ClassGraphException(message, cause); }
java
public static ClassGraphException newClassGraphException(final String message, final Throwable cause) throws ClassGraphException { return new ClassGraphException(message, cause); }
[ "public", "static", "ClassGraphException", "newClassGraphException", "(", "final", "String", "message", ",", "final", "Throwable", "cause", ")", "throws", "ClassGraphException", "{", "return", "new", "ClassGraphException", "(", "message", ",", "cause", ")", ";", "}"...
Static factory method to stop IDEs from auto-completing ClassGraphException after "new ClassGraph". @param message the message @param cause the cause @return the ClassGraphException @throws ClassGraphException the class graph exception
[ "Static", "factory", "method", "to", "stop", "IDEs", "from", "auto", "-", "completing", "ClassGraphException", "after", "new", "ClassGraph", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraphException.java#L87-L90
train
classgraph/classgraph
src/main/java/io/github/classgraph/ArrayTypeSignature.java
ArrayTypeSignature.parse
static ArrayTypeSignature parse(final Parser parser, final String definingClassName) throws ParseException { int numArrayDims = 0; while (parser.peek() == '[') { numArrayDims++; parser.next(); } if (numArrayDims > 0) { final TypeSignature elementTypeSi...
java
static ArrayTypeSignature parse(final Parser parser, final String definingClassName) throws ParseException { int numArrayDims = 0; while (parser.peek() == '[') { numArrayDims++; parser.next(); } if (numArrayDims > 0) { final TypeSignature elementTypeSi...
[ "static", "ArrayTypeSignature", "parse", "(", "final", "Parser", "parser", ",", "final", "String", "definingClassName", ")", "throws", "ParseException", "{", "int", "numArrayDims", "=", "0", ";", "while", "(", "parser", ".", "peek", "(", ")", "==", "'", "'",...
Parses the array type signature. @param parser the parser @param definingClassName the defining class name @return the array type signature @throws ParseException if parsing fails
[ "Parses", "the", "array", "type", "signature", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ArrayTypeSignature.java#L181-L196
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/URLPathEncoder.java
URLPathEncoder.normalizeURLPath
public static String normalizeURLPath(final String urlPath) { String urlPathNormalized = urlPath; if (!urlPathNormalized.startsWith("jrt:") && !urlPathNormalized.startsWith("http://") && !urlPathNormalized.startsWith("https://")) { // Any URL with the "jar:" prefix must have ...
java
public static String normalizeURLPath(final String urlPath) { String urlPathNormalized = urlPath; if (!urlPathNormalized.startsWith("jrt:") && !urlPathNormalized.startsWith("http://") && !urlPathNormalized.startsWith("https://")) { // Any URL with the "jar:" prefix must have ...
[ "public", "static", "String", "normalizeURLPath", "(", "final", "String", "urlPath", ")", "{", "String", "urlPathNormalized", "=", "urlPath", ";", "if", "(", "!", "urlPathNormalized", ".", "startsWith", "(", "\"jrt:\"", ")", "&&", "!", "urlPathNormalized", ".", ...
Normalize a URL path, so that it can be fed into the URL or URI constructor. @param urlPath the URL path @return the URL string
[ "Normalize", "a", "URL", "path", "so", "that", "it", "can", "be", "fed", "into", "the", "URL", "or", "URI", "constructor", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/URLPathEncoder.java#L110-L125
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/fastzipfilereader/FastZipEntry.java
FastZipEntry.canGetAsSlice
public boolean canGetAsSlice() throws IOException, InterruptedException { final long dataStartOffsetWithinPhysicalZipFile = getEntryDataStartOffsetWithinPhysicalZipFile(); return !isDeflated // && dataStartOffsetWithinPhysicalZipFile / FileUtils.MAX_BUFFER_SIZE // == (dat...
java
public boolean canGetAsSlice() throws IOException, InterruptedException { final long dataStartOffsetWithinPhysicalZipFile = getEntryDataStartOffsetWithinPhysicalZipFile(); return !isDeflated // && dataStartOffsetWithinPhysicalZipFile / FileUtils.MAX_BUFFER_SIZE // == (dat...
[ "public", "boolean", "canGetAsSlice", "(", ")", "throws", "IOException", ",", "InterruptedException", "{", "final", "long", "dataStartOffsetWithinPhysicalZipFile", "=", "getEntryDataStartOffsetWithinPhysicalZipFile", "(", ")", ";", "return", "!", "isDeflated", "//", "&&",...
True if the entire zip entry can be opened as a single ByteBuffer slice. @return true if the entire zip entry can be opened as a single ByteBuffer slice -- the entry must be STORED, and span only one 2GB buffer chunk. @throws IOException If an I/O exception occurs. @throws InterruptedException If the thread was interr...
[ "True", "if", "the", "entire", "zip", "entry", "can", "be", "opened", "as", "a", "single", "ByteBuffer", "slice", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/FastZipEntry.java#L215-L220
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/fastzipfilereader/FastZipEntry.java
FastZipEntry.load
public byte[] load() throws IOException, InterruptedException { try (InputStream is = open()) { return FileUtils.readAllBytesAsArray(is, uncompressedSize); } }
java
public byte[] load() throws IOException, InterruptedException { try (InputStream is = open()) { return FileUtils.readAllBytesAsArray(is, uncompressedSize); } }
[ "public", "byte", "[", "]", "load", "(", ")", "throws", "IOException", ",", "InterruptedException", "{", "try", "(", "InputStream", "is", "=", "open", "(", ")", ")", "{", "return", "FileUtils", ".", "readAllBytesAsArray", "(", "is", ",", "uncompressedSize", ...
Load the content of the zip entry, and return it as a byte array. @return the entry as a byte[] array @throws IOException If an I/O exception occurs. @throws InterruptedException If the thread was interrupted.
[ "Load", "the", "content", "of", "the", "zip", "entry", "and", "return", "it", "as", "a", "byte", "array", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/FastZipEntry.java#L568-L572
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/fastzipfilereader/FastZipEntry.java
FastZipEntry.compareTo
@Override public int compareTo(final FastZipEntry o) { final int diff0 = o.version - this.version; if (diff0 != 0) { return diff0; } final int diff1 = entryNameUnversioned.compareTo(o.entryNameUnversioned); if (diff1 != 0) { return diff1; } ...
java
@Override public int compareTo(final FastZipEntry o) { final int diff0 = o.version - this.version; if (diff0 != 0) { return diff0; } final int diff1 = entryNameUnversioned.compareTo(o.entryNameUnversioned); if (diff1 != 0) { return diff1; } ...
[ "@", "Override", "public", "int", "compareTo", "(", "final", "FastZipEntry", "o", ")", "{", "final", "int", "diff0", "=", "o", ".", "version", "-", "this", ".", "version", ";", "if", "(", "diff0", "!=", "0", ")", "{", "return", "diff0", ";", "}", "...
Sort in decreasing order of version number, then lexicographically increasing order of unversioned entry path. @param o the object to compare to @return the result of comparison
[ "Sort", "in", "decreasing", "order", "of", "version", "number", "then", "lexicographically", "increasing", "order", "of", "unversioned", "entry", "path", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/FastZipEntry.java#L617-L635
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/json/FieldTypeInfo.java
FieldTypeInfo.hasTypeVariables
private static boolean hasTypeVariables(final Type type) { if (type instanceof TypeVariable<?> || type instanceof GenericArrayType) { return true; } else if (type instanceof ParameterizedType) { for (final Type arg : ((ParameterizedType) type).getActualTypeArguments()) { ...
java
private static boolean hasTypeVariables(final Type type) { if (type instanceof TypeVariable<?> || type instanceof GenericArrayType) { return true; } else if (type instanceof ParameterizedType) { for (final Type arg : ((ParameterizedType) type).getActualTypeArguments()) { ...
[ "private", "static", "boolean", "hasTypeVariables", "(", "final", "Type", "type", ")", "{", "if", "(", "type", "instanceof", "TypeVariable", "<", "?", ">", "||", "type", "instanceof", "GenericArrayType", ")", "{", "return", "true", ";", "}", "else", "if", ...
Check if the type has type variables. @param type the type @return true if the type has type variables.
[ "Check", "if", "the", "type", "has", "type", "variables", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/FieldTypeInfo.java#L109-L120
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/json/FieldTypeInfo.java
FieldTypeInfo.getConstructorForFieldTypeWithSizeHint
public Constructor<?> getConstructorForFieldTypeWithSizeHint(final Type fieldTypeFullyResolved, final ClassFieldCache classFieldCache) { if (!isTypeVariable) { return constructorForFieldTypeWithSizeHint; } else { final Class<?> fieldRawTypeFullyResolved = JSONUtils.ge...
java
public Constructor<?> getConstructorForFieldTypeWithSizeHint(final Type fieldTypeFullyResolved, final ClassFieldCache classFieldCache) { if (!isTypeVariable) { return constructorForFieldTypeWithSizeHint; } else { final Class<?> fieldRawTypeFullyResolved = JSONUtils.ge...
[ "public", "Constructor", "<", "?", ">", "getConstructorForFieldTypeWithSizeHint", "(", "final", "Type", "fieldTypeFullyResolved", ",", "final", "ClassFieldCache", "classFieldCache", ")", "{", "if", "(", "!", "isTypeVariable", ")", "{", "return", "constructorForFieldType...
Get the constructor with size hint for the field type. @param fieldTypeFullyResolved the field type @param classFieldCache the class field cache @return the constructor with size hint for the field type
[ "Get", "the", "constructor", "with", "size", "hint", "for", "the", "field", "type", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/FieldTypeInfo.java#L191-L205
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/json/FieldTypeInfo.java
FieldTypeInfo.getDefaultConstructorForFieldType
public Constructor<?> getDefaultConstructorForFieldType(final Type fieldTypeFullyResolved, final ClassFieldCache classFieldCache) { if (!isTypeVariable) { return defaultConstructorForFieldType; } else { final Class<?> fieldRawTypeFullyResolved = JSONUtils.getRawType(f...
java
public Constructor<?> getDefaultConstructorForFieldType(final Type fieldTypeFullyResolved, final ClassFieldCache classFieldCache) { if (!isTypeVariable) { return defaultConstructorForFieldType; } else { final Class<?> fieldRawTypeFullyResolved = JSONUtils.getRawType(f...
[ "public", "Constructor", "<", "?", ">", "getDefaultConstructorForFieldType", "(", "final", "Type", "fieldTypeFullyResolved", ",", "final", "ClassFieldCache", "classFieldCache", ")", "{", "if", "(", "!", "isTypeVariable", ")", "{", "return", "defaultConstructorForFieldTy...
Get the default constructor for the field type. @param fieldTypeFullyResolved the field type @param classFieldCache the class field cache @return the default constructor for the field type
[ "Get", "the", "default", "constructor", "for", "the", "field", "type", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/FieldTypeInfo.java#L216-L224
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/JarUtils.java
JarUtils.appendPathElt
private static void appendPathElt(final Object pathElt, final StringBuilder buf) { if (buf.length() > 0) { buf.append(File.pathSeparatorChar); } // Escape any rogue path separators, as long as file separator is not '\\' (on Windows, if there are any // extra ';' characters in...
java
private static void appendPathElt(final Object pathElt, final StringBuilder buf) { if (buf.length() > 0) { buf.append(File.pathSeparatorChar); } // Escape any rogue path separators, as long as file separator is not '\\' (on Windows, if there are any // extra ';' characters in...
[ "private", "static", "void", "appendPathElt", "(", "final", "Object", "pathElt", ",", "final", "StringBuilder", "buf", ")", "{", "if", "(", "buf", ".", "length", "(", ")", ">", "0", ")", "{", "buf", ".", "append", "(", "File", ".", "pathSeparatorChar", ...
Append a path element to a buffer. @param pathElt the path element @param buf the buf
[ "Append", "a", "path", "element", "to", "a", "buffer", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/JarUtils.java#L191-L201
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/JarUtils.java
JarUtils.leafName
public static String leafName(final String path) { final int bangIdx = path.indexOf('!'); final int endIdx = bangIdx >= 0 ? bangIdx : path.length(); int leafStartIdx = 1 + (File.separatorChar == '/' ? path.lastIndexOf('/', endIdx) : Math.max(path.lastIndexOf('/', endIdx), path.la...
java
public static String leafName(final String path) { final int bangIdx = path.indexOf('!'); final int endIdx = bangIdx >= 0 ? bangIdx : path.length(); int leafStartIdx = 1 + (File.separatorChar == '/' ? path.lastIndexOf('/', endIdx) : Math.max(path.lastIndexOf('/', endIdx), path.la...
[ "public", "static", "String", "leafName", "(", "final", "String", "path", ")", "{", "final", "int", "bangIdx", "=", "path", ".", "indexOf", "(", "'", "'", ")", ";", "final", "int", "endIdx", "=", "bangIdx", ">=", "0", "?", "bangIdx", ":", "path", "."...
Returns the leafname of a path, after first stripping off everything after the first '!', if present. @param path A file path. @return The leafname of the path.
[ "Returns", "the", "leafname", "of", "a", "path", "after", "first", "stripping", "off", "everything", "after", "the", "first", "!", "if", "present", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/JarUtils.java#L246-L260
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/JarUtils.java
JarUtils.classfilePathToClassName
public static String classfilePathToClassName(final String classfilePath) { if (!classfilePath.endsWith(".class")) { throw new IllegalArgumentException("Classfile path does not end with \".class\": " + classfilePath); } return classfilePath.substring(0, classfilePath.length() - 6).re...
java
public static String classfilePathToClassName(final String classfilePath) { if (!classfilePath.endsWith(".class")) { throw new IllegalArgumentException("Classfile path does not end with \".class\": " + classfilePath); } return classfilePath.substring(0, classfilePath.length() - 6).re...
[ "public", "static", "String", "classfilePathToClassName", "(", "final", "String", "classfilePath", ")", "{", "if", "(", "!", "classfilePath", ".", "endsWith", "(", "\".class\"", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Classfile path does n...
Convert a classfile path to the corresponding class name. @param classfilePath the classfile path @return the class name
[ "Convert", "a", "classfile", "path", "to", "the", "corresponding", "class", "name", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/JarUtils.java#L271-L276
train
classgraph/classgraph
src/main/java/io/github/classgraph/BaseTypeSignature.java
BaseTypeSignature.parse
static BaseTypeSignature parse(final Parser parser) { switch (parser.peek()) { case 'B': parser.next(); return new BaseTypeSignature("byte"); case 'C': parser.next(); return new BaseTypeSignature("char"); case 'D': parser.next()...
java
static BaseTypeSignature parse(final Parser parser) { switch (parser.peek()) { case 'B': parser.next(); return new BaseTypeSignature("byte"); case 'C': parser.next(); return new BaseTypeSignature("char"); case 'D': parser.next()...
[ "static", "BaseTypeSignature", "parse", "(", "final", "Parser", "parser", ")", "{", "switch", "(", "parser", ".", "peek", "(", ")", ")", "{", "case", "'", "'", ":", "parser", ".", "next", "(", ")", ";", "return", "new", "BaseTypeSignature", "(", "\"byt...
Parse a base type. @param parser the parser @return the base type signature
[ "Parse", "a", "base", "type", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/BaseTypeSignature.java#L126-L158
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classloaderhandler/WebsphereLibertyClassLoaderHandler.java
WebsphereLibertyClassLoaderHandler.getPath
private static String getPath(final Object classpath) { final Object container = ReflectionUtils.getFieldVal(classpath, "container", false); if (container == null) { return ""; } final Object delegate = ReflectionUtils.getFieldVal(container, "delegate", false); if (d...
java
private static String getPath(final Object classpath) { final Object container = ReflectionUtils.getFieldVal(classpath, "container", false); if (container == null) { return ""; } final Object delegate = ReflectionUtils.getFieldVal(container, "delegate", false); if (d...
[ "private", "static", "String", "getPath", "(", "final", "Object", "classpath", ")", "{", "final", "Object", "container", "=", "ReflectionUtils", ".", "getFieldVal", "(", "classpath", ",", "\"container\"", ",", "false", ")", ";", "if", "(", "container", "==", ...
Get the path from a classpath object. @param classpath the classpath object @return the path object as a {@link File} or {@link String}.
[ "Get", "the", "path", "from", "a", "classpath", "object", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classloaderhandler/WebsphereLibertyClassLoaderHandler.java#L95-L123
train
classgraph/classgraph
src/main/java/io/github/classgraph/ScanResultObject.java
ScanResultObject.findReferencedClassNames
Set<String> findReferencedClassNames() { final Set<String> allReferencedClassNames = new LinkedHashSet<>(); findReferencedClassNames(allReferencedClassNames); // Remove references to java.lang.Object allReferencedClassNames.remove("java.lang.Object"); return allReferencedClassNam...
java
Set<String> findReferencedClassNames() { final Set<String> allReferencedClassNames = new LinkedHashSet<>(); findReferencedClassNames(allReferencedClassNames); // Remove references to java.lang.Object allReferencedClassNames.remove("java.lang.Object"); return allReferencedClassNam...
[ "Set", "<", "String", ">", "findReferencedClassNames", "(", ")", "{", "final", "Set", "<", "String", ">", "allReferencedClassNames", "=", "new", "LinkedHashSet", "<>", "(", ")", ";", "findReferencedClassNames", "(", "allReferencedClassNames", ")", ";", "// Remove ...
Get the names of all referenced classes. @return the referenced class names
[ "Get", "the", "names", "of", "all", "referenced", "classes", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResultObject.java#L63-L69
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java
JSONDeserializer.getInitialIdToObjectMap
private static Map<CharSequence, Object> getInitialIdToObjectMap(final Object objectInstance, final Object parsedJSON) { final Map<CharSequence, Object> idToObjectInstance = new HashMap<>(); if (parsedJSON instanceof JSONObject) { final JSONObject itemJsonObject = (JSONObject) pa...
java
private static Map<CharSequence, Object> getInitialIdToObjectMap(final Object objectInstance, final Object parsedJSON) { final Map<CharSequence, Object> idToObjectInstance = new HashMap<>(); if (parsedJSON instanceof JSONObject) { final JSONObject itemJsonObject = (JSONObject) pa...
[ "private", "static", "Map", "<", "CharSequence", ",", "Object", ">", "getInitialIdToObjectMap", "(", "final", "Object", "objectInstance", ",", "final", "Object", "parsedJSON", ")", "{", "final", "Map", "<", "CharSequence", ",", "Object", ">", "idToObjectInstance",...
Set up the initial mapping from id to object, by adding the id of the toplevel object, if it has an id field in JSON. @param objectInstance the object instance @param parsedJSON the parsed JSON @return the initial id to object map
[ "Set", "up", "the", "initial", "mapping", "from", "id", "to", "object", "by", "adding", "the", "id", "of", "the", "toplevel", "object", "if", "it", "has", "an", "id", "field", "in", "JSON", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java#L604-L620
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java
JSONDeserializer.deserializeObject
private static <T> T deserializeObject(final Class<T> expectedType, final String json, final ClassFieldCache classFieldCache) throws IllegalArgumentException { // Parse the JSON Object parsedJSON; try { parsedJSON = JSONParser.parseJSON(json); } catch (final Parse...
java
private static <T> T deserializeObject(final Class<T> expectedType, final String json, final ClassFieldCache classFieldCache) throws IllegalArgumentException { // Parse the JSON Object parsedJSON; try { parsedJSON = JSONParser.parseJSON(json); } catch (final Parse...
[ "private", "static", "<", "T", ">", "T", "deserializeObject", "(", "final", "Class", "<", "T", ">", "expectedType", ",", "final", "String", "json", ",", "final", "ClassFieldCache", "classFieldCache", ")", "throws", "IllegalArgumentException", "{", "// Parse the JS...
Deserialize JSON to a new object graph, with the root object of the specified expected type, using or reusing the given type cache. Does not work for generic types, since it is not possible to obtain the generic type of a Class reference. @param <T> the expected type @param expectedType The type that the JSON should c...
[ "Deserialize", "JSON", "to", "a", "new", "object", "graph", "with", "the", "root", "object", "of", "the", "specified", "expected", "type", "using", "or", "reusing", "the", "given", "type", "cache", ".", "Does", "not", "work", "for", "generic", "types", "si...
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java#L642-L672
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java
JSONDeserializer.deserializeObject
public static <T> T deserializeObject(final Class<T> expectedType, final String json) throws IllegalArgumentException { final ClassFieldCache classFieldCache = new ClassFieldCache(/* resolveTypes = */ true, /* onlySerializePublicFields = */ false); return deserializeObject(ex...
java
public static <T> T deserializeObject(final Class<T> expectedType, final String json) throws IllegalArgumentException { final ClassFieldCache classFieldCache = new ClassFieldCache(/* resolveTypes = */ true, /* onlySerializePublicFields = */ false); return deserializeObject(ex...
[ "public", "static", "<", "T", ">", "T", "deserializeObject", "(", "final", "Class", "<", "T", ">", "expectedType", ",", "final", "String", "json", ")", "throws", "IllegalArgumentException", "{", "final", "ClassFieldCache", "classFieldCache", "=", "new", "ClassFi...
Deserialize JSON to a new object graph, with the root object of the specified expected type. Does not work for generic types, since it is not possible to obtain the generic type of a Class reference. @param <T> The type that the JSON should conform to. @param expectedType The class reference for the type that the JSON...
[ "Deserialize", "JSON", "to", "a", "new", "object", "graph", "with", "the", "root", "object", "of", "the", "specified", "expected", "type", ".", "Does", "not", "work", "for", "generic", "types", "since", "it", "is", "not", "possible", "to", "obtain", "the",...
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONDeserializer.java#L688-L693
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classpath/ClassLoaderAndModuleFinder.java
ClassLoaderAndModuleFinder.findLayerOrder
private static void findLayerOrder(final Object /* ModuleLayer */ layer, final Set<Object> /* Set<ModuleLayer> */ layerVisited, final Set<Object> /* Set<ModuleLayer> */ parentLayers, final Deque<Object> /* Deque<ModuleLayer> */ layerOrderOut) { if (layerVisited.add(layer)) { ...
java
private static void findLayerOrder(final Object /* ModuleLayer */ layer, final Set<Object> /* Set<ModuleLayer> */ layerVisited, final Set<Object> /* Set<ModuleLayer> */ parentLayers, final Deque<Object> /* Deque<ModuleLayer> */ layerOrderOut) { if (layerVisited.add(layer)) { ...
[ "private", "static", "void", "findLayerOrder", "(", "final", "Object", "/* ModuleLayer */", "layer", ",", "final", "Set", "<", "Object", ">", "/* Set<ModuleLayer> */", "layerVisited", ",", "final", "Set", "<", "Object", ">", "/* Set<ModuleLayer> */", "parentLayers", ...
Recursively find the topological sort order of ancestral layers. <p> (The JDK (as of 10.0.0.1) uses a broken (non-topological) DFS ordering for layer resolution in ModuleLayer#layers() and Configuration#configurations() but when I reported this bug on the Jigsaw mailing list, Alan didn't see what the problem was.) @p...
[ "Recursively", "find", "the", "topological", "sort", "order", "of", "ancestral", "layers", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/ClassLoaderAndModuleFinder.java#L107-L123
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classpath/ClassLoaderAndModuleFinder.java
ClassLoaderAndModuleFinder.findModuleRefs
private static List<ModuleRef> findModuleRefs(final LinkedHashSet<Object> layers, final ScanSpec scanSpec, final LogNode log) { if (layers.isEmpty()) { return Collections.emptyList(); } // Traverse the layer DAG to find the layer resolution order final Deque<Obje...
java
private static List<ModuleRef> findModuleRefs(final LinkedHashSet<Object> layers, final ScanSpec scanSpec, final LogNode log) { if (layers.isEmpty()) { return Collections.emptyList(); } // Traverse the layer DAG to find the layer resolution order final Deque<Obje...
[ "private", "static", "List", "<", "ModuleRef", ">", "findModuleRefs", "(", "final", "LinkedHashSet", "<", "Object", ">", "layers", ",", "final", "ScanSpec", "scanSpec", ",", "final", "LogNode", "log", ")", "{", "if", "(", "layers", ".", "isEmpty", "(", ")"...
Get all visible ModuleReferences in a list of layers. @param layers the layers @param scanSpec the scan spec @param log the log @return the list
[ "Get", "all", "visible", "ModuleReferences", "in", "a", "list", "of", "layers", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classpath/ClassLoaderAndModuleFinder.java#L136-L200
train
classgraph/classgraph
src/main/java/io/github/classgraph/ClassRefTypeSignature.java
ClassRefTypeSignature.parse
static ClassRefTypeSignature parse(final Parser parser, final String definingClassName) throws ParseException { if (parser.peek() == 'L') { parser.next(); if (!TypeUtils.getIdentifierToken(parser, /* separator = */ '/', /* separatorReplace = */ '.')) { throw new ParseExce...
java
static ClassRefTypeSignature parse(final Parser parser, final String definingClassName) throws ParseException { if (parser.peek() == 'L') { parser.next(); if (!TypeUtils.getIdentifierToken(parser, /* separator = */ '/', /* separatorReplace = */ '.')) { throw new ParseExce...
[ "static", "ClassRefTypeSignature", "parse", "(", "final", "Parser", "parser", ",", "final", "String", "definingClassName", ")", "throws", "ParseException", "{", "if", "(", "parser", ".", "peek", "(", ")", "==", "'", "'", ")", "{", "parser", ".", "next", "(...
Parse a class type signature. @param parser The parser. @param definingClassName The name of the defining class (for resolving type variables). @return The class type signature. @throws ParseException If the type signature could not be parsed.
[ "Parse", "a", "class", "type", "signature", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassRefTypeSignature.java#L336-L367
train
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/classloaderhandler/PlexusClassWorldsClassRealmClassLoaderHandler.java
PlexusClassWorldsClassRealmClassLoaderHandler.isParentFirstStrategy
private static boolean isParentFirstStrategy(final ClassLoader classRealmInstance) { final Object strategy = ReflectionUtils.getFieldVal(classRealmInstance, "strategy", false); if (strategy != null) { final String strategyClassName = strategy.getClass().getName(); if (strategyCla...
java
private static boolean isParentFirstStrategy(final ClassLoader classRealmInstance) { final Object strategy = ReflectionUtils.getFieldVal(classRealmInstance, "strategy", false); if (strategy != null) { final String strategyClassName = strategy.getClass().getName(); if (strategyCla...
[ "private", "static", "boolean", "isParentFirstStrategy", "(", "final", "ClassLoader", "classRealmInstance", ")", "{", "final", "Object", "strategy", "=", "ReflectionUtils", ".", "getFieldVal", "(", "classRealmInstance", ",", "\"strategy\"", ",", "false", ")", ";", "...
Checks if is this classloader uses a parent-first strategy. @param classRealmInstance the ClassRealm instance @return true if classloader uses a parent-first strategy
[ "Checks", "if", "is", "this", "classloader", "uses", "a", "parent", "-", "first", "strategy", "." ]
c8c8b2ca1eb76339f69193fdac33d735c864215c
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/classloaderhandler/PlexusClassWorldsClassRealmClassLoaderHandler.java#L67-L79
train
zeromq/jeromq
src/main/java/zmq/io/Msgs.java
Msgs.startsWith
public static boolean startsWith(Msg msg, String data, boolean includeLength) { final int length = data.length(); assert (length < 256); int start = includeLength ? 1 : 0; if (msg.size() < length + start) { return false; } boolean comparison = includeLeng...
java
public static boolean startsWith(Msg msg, String data, boolean includeLength) { final int length = data.length(); assert (length < 256); int start = includeLength ? 1 : 0; if (msg.size() < length + start) { return false; } boolean comparison = includeLeng...
[ "public", "static", "boolean", "startsWith", "(", "Msg", "msg", ",", "String", "data", ",", "boolean", "includeLength", ")", "{", "final", "int", "length", "=", "data", ".", "length", "(", ")", ";", "assert", "(", "length", "<", "256", ")", ";", "int",...
Checks if the message starts with the given string. @param msg the message to check. @param data the string to check the message with. Shall be shorter than 256 characters. @param includeLength true if the string in the message is prefixed with the length, false if not. @return true if the message starts with the give...
[ "Checks", "if", "the", "message", "starts", "with", "the", "given", "string", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/Msgs.java#L20-L39
train
zeromq/jeromq
src/main/java/zmq/pipe/YPipe.java
YPipe.write
@Override public void write(final T value, boolean incomplete) { // Place the value to the queue, add new terminator element. queue.push(value); // Move the "flush up to here" pointer. if (!incomplete) { f = queue.backPos(); } }
java
@Override public void write(final T value, boolean incomplete) { // Place the value to the queue, add new terminator element. queue.push(value); // Move the "flush up to here" pointer. if (!incomplete) { f = queue.backPos(); } }
[ "@", "Override", "public", "void", "write", "(", "final", "T", "value", ",", "boolean", "incomplete", ")", "{", "// Place the value to the queue, add new terminator element.", "queue", ".", "push", "(", "value", ")", ";", "// Move the \"flush up to here\" pointer.", "...
flushed down the stream.
[ "flushed", "down", "the", "stream", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/YPipe.java#L44-L54
train
zeromq/jeromq
src/main/java/zmq/pipe/YPipe.java
YPipe.unwrite
@Override public T unwrite() { if (f == queue.backPos()) { return null; } queue.unpush(); return queue.back(); }
java
@Override public T unwrite() { if (f == queue.backPos()) { return null; } queue.unpush(); return queue.back(); }
[ "@", "Override", "public", "T", "unwrite", "(", ")", "{", "if", "(", "f", "==", "queue", ".", "backPos", "(", ")", ")", "{", "return", "null", ";", "}", "queue", ".", "unpush", "(", ")", ";", "return", "queue", ".", "back", "(", ")", ";", "}" ]
item exists, false otherwise.
[ "item", "exists", "false", "otherwise", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/YPipe.java#L58-L66
train
zeromq/jeromq
src/main/java/zmq/pipe/YPipe.java
YPipe.flush
@Override public boolean flush() { // If there are no un-flushed items, do nothing. if (w == f) { return true; } // Try to set 'c' to 'f'. if (!c.compareAndSet(w, f)) { // Compare-and-swap was unsuccessful because 'c' is NULL. // T...
java
@Override public boolean flush() { // If there are no un-flushed items, do nothing. if (w == f) { return true; } // Try to set 'c' to 'f'. if (!c.compareAndSet(w, f)) { // Compare-and-swap was unsuccessful because 'c' is NULL. // T...
[ "@", "Override", "public", "boolean", "flush", "(", ")", "{", "// If there are no un-flushed items, do nothing.", "if", "(", "w", "==", "f", ")", "{", "return", "true", ";", "}", "// Try to set 'c' to 'f'.", "if", "(", "!", "c", ".", "compareAndSet", "(", "w...
wake the reader up before using the pipe again.
[ "wake", "the", "reader", "up", "before", "using", "the", "pipe", "again", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/YPipe.java#L71-L95
train
zeromq/jeromq
src/main/java/zmq/pipe/YPipe.java
YPipe.checkRead
@Override public boolean checkRead() { // Was the value prefetched already? If so, return. int h = queue.frontPos(); if (h != r) { return true; } // There's no prefetched value, so let us prefetch more values. // Prefetching is to simply retrieve t...
java
@Override public boolean checkRead() { // Was the value prefetched already? If so, return. int h = queue.frontPos(); if (h != r) { return true; } // There's no prefetched value, so let us prefetch more values. // Prefetching is to simply retrieve t...
[ "@", "Override", "public", "boolean", "checkRead", "(", ")", "{", "// Was the value prefetched already? If so, return.", "int", "h", "=", "queue", ".", "frontPos", "(", ")", ";", "if", "(", "h", "!=", "r", ")", "{", "return", "true", ";", "}", "// There's ...
Check whether item is available for reading.
[ "Check", "whether", "item", "is", "available", "for", "reading", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/YPipe.java#L98-L129
train
zeromq/jeromq
src/main/java/zmq/io/coder/DecoderBase.java
DecoderBase.getBuffer
@Override public ByteBuffer getBuffer() { // If we are expected to read large message, we'll opt for zero- // copy, i.e. we'll ask caller to fill the data directly to the // message. Note that subsequent read(s) are non-blocking, thus // each single read reads at most SO_RCVB...
java
@Override public ByteBuffer getBuffer() { // If we are expected to read large message, we'll opt for zero- // copy, i.e. we'll ask caller to fill the data directly to the // message. Note that subsequent read(s) are non-blocking, thus // each single read reads at most SO_RCVB...
[ "@", "Override", "public", "ByteBuffer", "getBuffer", "(", ")", "{", "// If we are expected to read large message, we'll opt for zero-", "// copy, i.e. we'll ask caller to fill the data directly to the", "// message. Note that subsequent read(s) are non-blocking, thus", "// each single rea...
Returns a buffer to be filled with binary data.
[ "Returns", "a", "buffer", "to", "be", "filled", "with", "binary", "data", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/coder/DecoderBase.java#L51-L71
train
zeromq/jeromq
src/main/java/zmq/io/coder/DecoderBase.java
DecoderBase.decode
@Override public Step.Result decode(ByteBuffer data, int size, ValueReference<Integer> processed) { processed.set(0); // In case of zero-copy simply adjust the pointers, no copying // is required. Also, run the state machine in case all the data // were processed. if ...
java
@Override public Step.Result decode(ByteBuffer data, int size, ValueReference<Integer> processed) { processed.set(0); // In case of zero-copy simply adjust the pointers, no copying // is required. Also, run the state machine in case all the data // were processed. if ...
[ "@", "Override", "public", "Step", ".", "Result", "decode", "(", "ByteBuffer", "data", ",", "int", "size", ",", "ValueReference", "<", "Integer", ">", "processed", ")", "{", "processed", ".", "set", "(", "0", ")", ";", "// In case of zero-copy simply adjust t...
bytes actually processed.
[ "bytes", "actually", "processed", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/coder/DecoderBase.java#L77-L121
train
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Trie.java
Trie.rm
public boolean rm(Msg msg, int start, int size) { // TODO: Shouldn't an error be reported if the key does not exist? if (size == 0) { if (refcnt == 0) { return false; } refcnt--; return refcnt == 0; } assert (msg != n...
java
public boolean rm(Msg msg, int start, int size) { // TODO: Shouldn't an error be reported if the key does not exist? if (size == 0) { if (refcnt == 0) { return false; } refcnt--; return refcnt == 0; } assert (msg != n...
[ "public", "boolean", "rm", "(", "Msg", "msg", ",", "int", "start", ",", "int", "size", ")", "{", "// TODO: Shouldn't an error be reported if the key does not exist?", "if", "(", "size", "==", "0", ")", "{", "if", "(", "refcnt", "==", "0", ")", "{", "return"...
removed from the trie.
[ "removed", "from", "the", "trie", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Trie.java#L104-L214
train
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Trie.java
Trie.check
public boolean check(ByteBuffer data) { assert (data != null); int size = data.limit(); // This function is on critical path. It deliberately doesn't use // recursion to get a bit better performance. Trie current = this; int start = 0; while (true) { ...
java
public boolean check(ByteBuffer data) { assert (data != null); int size = data.limit(); // This function is on critical path. It deliberately doesn't use // recursion to get a bit better performance. Trie current = this; int start = 0; while (true) { ...
[ "public", "boolean", "check", "(", "ByteBuffer", "data", ")", "{", "assert", "(", "data", "!=", "null", ")", ";", "int", "size", "=", "data", ".", "limit", "(", ")", ";", "// This function is on critical path. It deliberately doesn't use", "// recursion to get a b...
Check whether particular key is in the trie.
[ "Check", "whether", "particular", "key", "is", "in", "the", "trie", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Trie.java#L217-L256
train
zeromq/jeromq
src/main/java/org/zeromq/ZMsg.java
ZMsg.duplicate
public ZMsg duplicate() { if (frames.isEmpty()) { return null; } else { ZMsg msg = new ZMsg(); for (ZFrame f : frames) { msg.add(f.duplicate()); } return msg; } }
java
public ZMsg duplicate() { if (frames.isEmpty()) { return null; } else { ZMsg msg = new ZMsg(); for (ZFrame f : frames) { msg.add(f.duplicate()); } return msg; } }
[ "public", "ZMsg", "duplicate", "(", ")", "{", "if", "(", "frames", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "else", "{", "ZMsg", "msg", "=", "new", "ZMsg", "(", ")", ";", "for", "(", "ZFrame", "f", ":", "frames", ")", "{"...
Creates copy of this ZMsg. Also duplicates all frame content. @return The duplicated ZMsg object, else null if this ZMsg contains an empty frame set
[ "Creates", "copy", "of", "this", "ZMsg", ".", "Also", "duplicates", "all", "frame", "content", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L101-L113
train
zeromq/jeromq
src/main/java/org/zeromq/ZMsg.java
ZMsg.wrap
public ZMsg wrap(ZFrame frame) { if (frame != null) { push(new ZFrame("")); push(frame); } return this; }
java
public ZMsg wrap(ZFrame frame) { if (frame != null) { push(new ZFrame("")); push(frame); } return this; }
[ "public", "ZMsg", "wrap", "(", "ZFrame", "frame", ")", "{", "if", "(", "frame", "!=", "null", ")", "{", "push", "(", "new", "ZFrame", "(", "\"\"", ")", ")", ";", "push", "(", "frame", ")", ";", "}", "return", "this", ";", "}" ]
Push frame plus empty frame to front of message, before 1st frame. Message takes ownership of frame, will destroy it when message is sent. @param frame
[ "Push", "frame", "plus", "empty", "frame", "to", "front", "of", "message", "before", "1st", "frame", ".", "Message", "takes", "ownership", "of", "frame", "will", "destroy", "it", "when", "message", "is", "sent", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L120-L127
train
zeromq/jeromq
src/main/java/org/zeromq/ZMsg.java
ZMsg.recvMsg
public static ZMsg recvMsg(Socket socket, boolean wait) { return recvMsg(socket, wait ? 0 : ZMQ.DONTWAIT); }
java
public static ZMsg recvMsg(Socket socket, boolean wait) { return recvMsg(socket, wait ? 0 : ZMQ.DONTWAIT); }
[ "public", "static", "ZMsg", "recvMsg", "(", "Socket", "socket", ",", "boolean", "wait", ")", "{", "return", "recvMsg", "(", "socket", ",", "wait", "?", "0", ":", "ZMQ", ".", "DONTWAIT", ")", ";", "}" ]
Receives message from socket, returns ZMsg object or null if the recv was interrupted. @param socket @param wait true to wait for next message, false to do a non-blocking recv. @return ZMsg object, null if interrupted
[ "Receives", "message", "from", "socket", "returns", "ZMsg", "object", "or", "null", "if", "the", "recv", "was", "interrupted", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L219-L222
train
zeromq/jeromq
src/main/java/org/zeromq/ZMsg.java
ZMsg.recvMsg
public static ZMsg recvMsg(Socket socket, int flag) { if (socket == null) { throw new IllegalArgumentException("socket is null"); } ZMsg msg = new ZMsg(); while (true) { ZFrame f = ZFrame.recvFrame(socket, flag); if (f == null) { ...
java
public static ZMsg recvMsg(Socket socket, int flag) { if (socket == null) { throw new IllegalArgumentException("socket is null"); } ZMsg msg = new ZMsg(); while (true) { ZFrame f = ZFrame.recvFrame(socket, flag); if (f == null) { ...
[ "public", "static", "ZMsg", "recvMsg", "(", "Socket", "socket", ",", "int", "flag", ")", "{", "if", "(", "socket", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"socket is null\"", ")", ";", "}", "ZMsg", "msg", "=", "new", "Z...
Receives message from socket, returns ZMsg object or null if the recv was interrupted. Setting the flag to ZMQ.DONTWAIT does a non-blocking recv. @param socket @param flag see ZMQ constants @return ZMsg object, null if interrupted
[ "Receives", "message", "from", "socket", "returns", "ZMsg", "object", "or", "null", "if", "the", "recv", "was", "interrupted", ".", "Setting", "the", "flag", "to", "ZMQ", ".", "DONTWAIT", "does", "a", "non", "-", "blocking", "recv", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L232-L254
train
zeromq/jeromq
src/main/java/org/zeromq/ZMsg.java
ZMsg.save
public static boolean save(ZMsg msg, DataOutputStream file) { if (msg == null) { return false; } try { // Write number of frames file.writeInt(msg.size()); if (msg.size() > 0) { for (ZFrame f : msg) { // Wri...
java
public static boolean save(ZMsg msg, DataOutputStream file) { if (msg == null) { return false; } try { // Write number of frames file.writeInt(msg.size()); if (msg.size() > 0) { for (ZFrame f : msg) { // Wri...
[ "public", "static", "boolean", "save", "(", "ZMsg", "msg", ",", "DataOutputStream", "file", ")", "{", "if", "(", "msg", "==", "null", ")", "{", "return", "false", ";", "}", "try", "{", "// Write number of frames", "file", ".", "writeInt", "(", "msg", "."...
Save message to an open data output stream. Data saved as: 4 bytes: number of frames For every frame: 4 bytes: byte size of frame data + n bytes: frame byte data @param msg ZMsg to save @param file DataOutputStream @return True if saved OK, else false
[ "Save", "message", "to", "an", "open", "data", "output", "stream", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L308-L330
train
zeromq/jeromq
src/main/java/org/zeromq/ZMsg.java
ZMsg.newStringMsg
public static ZMsg newStringMsg(String... strings) { ZMsg msg = new ZMsg(); for (String data : strings) { msg.addString(data); } return msg; }
java
public static ZMsg newStringMsg(String... strings) { ZMsg msg = new ZMsg(); for (String data : strings) { msg.addString(data); } return msg; }
[ "public", "static", "ZMsg", "newStringMsg", "(", "String", "...", "strings", ")", "{", "ZMsg", "msg", "=", "new", "ZMsg", "(", ")", ";", "for", "(", "String", "data", ":", "strings", ")", "{", "msg", ".", "addString", "(", "data", ")", ";", "}", "r...
Create a new ZMsg from one or more Strings @param strings Strings to add as frames. @return ZMsg object
[ "Create", "a", "new", "ZMsg", "from", "one", "or", "more", "Strings" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L373-L380
train
zeromq/jeromq
src/main/java/org/zeromq/ZMsg.java
ZMsg.dump
public ZMsg dump(Appendable out) { try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); pw.printf("--------------------------------------\n"); for (ZFrame frame : frames) { pw.printf("[%03d] %s\n", frame.size(), fra...
java
public ZMsg dump(Appendable out) { try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); pw.printf("--------------------------------------\n"); for (ZFrame frame : frames) { pw.printf("[%03d] %s\n", frame.size(), fra...
[ "public", "ZMsg", "dump", "(", "Appendable", "out", ")", "{", "try", "{", "StringWriter", "sw", "=", "new", "StringWriter", "(", ")", ";", "PrintWriter", "pw", "=", "new", "PrintWriter", "(", "sw", ")", ";", "pw", ".", "printf", "(", "\"-----------------...
Dump the message in human readable format. This should only be used for debugging and tracing, inefficient in handling large messages.
[ "Dump", "the", "message", "in", "human", "readable", "format", ".", "This", "should", "only", "be", "used", "for", "debugging", "and", "tracing", "inefficient", "in", "handling", "large", "messages", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L425-L441
train
zeromq/jeromq
src/main/java/org/zeromq/ZStar.java
ZStar.agent
@Deprecated protected ZAgent agent(Socket phone, String secret) { return ZAgent.Creator.create(phone, secret); }
java
@Deprecated protected ZAgent agent(Socket phone, String secret) { return ZAgent.Creator.create(phone, secret); }
[ "@", "Deprecated", "protected", "ZAgent", "agent", "(", "Socket", "phone", ",", "String", "secret", ")", "{", "return", "ZAgent", ".", "Creator", ".", "create", "(", "phone", ",", "secret", ")", ";", "}" ]
Creates a new agent for the star. @param phone the socket used to communicate with the star @param secret the specific keyword indicating the death of the star and locking the agent. Null to override the lock mechanism. @return the newly created agent for the star.
[ "Creates", "a", "new", "agent", "for", "the", "star", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZStar.java#L445-L449
train
zeromq/jeromq
src/main/java/org/zeromq/timer/ZTicket.java
ZTicket.add
public Ticket add(long delay, TimerHandler handler, Object... args) { if (handler == null) { return null; } Utils.checkArgument(delay > 0, "Delay of a ticket has to be strictly greater than 0"); final Ticket ticket = new Ticket(this, now(), delay, handler, args); ...
java
public Ticket add(long delay, TimerHandler handler, Object... args) { if (handler == null) { return null; } Utils.checkArgument(delay > 0, "Delay of a ticket has to be strictly greater than 0"); final Ticket ticket = new Ticket(this, now(), delay, handler, args); ...
[ "public", "Ticket", "add", "(", "long", "delay", ",", "TimerHandler", "handler", ",", "Object", "...", "args", ")", "{", "if", "(", "handler", "==", "null", ")", "{", "return", "null", ";", "}", "Utils", ".", "checkArgument", "(", "delay", ">", "0", ...
Add ticket to the set. @param delay the expiration delay in milliseconds. @param handler the callback called at the expiration of the ticket. @param args the optional arguments for the handler. @return an opaque handle for further cancel and reset.
[ "Add", "ticket", "to", "the", "set", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/timer/ZTicket.java#L149-L158
train
zeromq/jeromq
src/main/java/org/zeromq/timer/ZTicket.java
ZTicket.timeout
public long timeout() { if (tickets.isEmpty()) { return -1; } sortIfNeeded(); // Tickets are sorted, so check first ticket Ticket first = tickets.get(0); return first.start - now() + first.delay; }
java
public long timeout() { if (tickets.isEmpty()) { return -1; } sortIfNeeded(); // Tickets are sorted, so check first ticket Ticket first = tickets.get(0); return first.start - now() + first.delay; }
[ "public", "long", "timeout", "(", ")", "{", "if", "(", "tickets", ".", "isEmpty", "(", ")", ")", "{", "return", "-", "1", ";", "}", "sortIfNeeded", "(", ")", ";", "// Tickets are sorted, so check first ticket", "Ticket", "first", "=", "tickets", ".", "get...
Returns the time in millisecond until the next ticket. @return the time in millisecond until the next ticket.
[ "Returns", "the", "time", "in", "millisecond", "until", "the", "next", "ticket", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/timer/ZTicket.java#L164-L173
train
zeromq/jeromq
src/main/java/org/zeromq/timer/ZTicket.java
ZTicket.execute
public int execute() { int executed = 0; final long now = now(); sortIfNeeded(); Set<Ticket> cancelled = new HashSet<>(); for (Ticket ticket : this.tickets) { if (now - ticket.start < ticket.delay) { // tickets are ordered, not meeting the conditio...
java
public int execute() { int executed = 0; final long now = now(); sortIfNeeded(); Set<Ticket> cancelled = new HashSet<>(); for (Ticket ticket : this.tickets) { if (now - ticket.start < ticket.delay) { // tickets are ordered, not meeting the conditio...
[ "public", "int", "execute", "(", ")", "{", "int", "executed", "=", "0", ";", "final", "long", "now", "=", "now", "(", ")", ";", "sortIfNeeded", "(", ")", ";", "Set", "<", "Ticket", ">", "cancelled", "=", "new", "HashSet", "<>", "(", ")", ";", "fo...
Execute the tickets. @return the number of tickets triggered.
[ "Execute", "the", "tickets", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/timer/ZTicket.java#L179-L210
train
zeromq/jeromq
src/main/java/zmq/SocketBase.java
SocketBase.checkProtocol
private NetProtocol checkProtocol(String protocol) { // First check out whether the protcol is something we are aware of. NetProtocol proto = NetProtocol.getProtocol(protocol); if (proto == null || !proto.valid) { errno.set(ZError.EPROTONOSUPPORT); return proto; ...
java
private NetProtocol checkProtocol(String protocol) { // First check out whether the protcol is something we are aware of. NetProtocol proto = NetProtocol.getProtocol(protocol); if (proto == null || !proto.valid) { errno.set(ZError.EPROTONOSUPPORT); return proto; ...
[ "private", "NetProtocol", "checkProtocol", "(", "String", "protocol", ")", "{", "// First check out whether the protcol is something we are aware of.", "NetProtocol", "proto", "=", "NetProtocol", ".", "getProtocol", "(", "protocol", ")", ";", "if", "(", "proto", "==", ...
bind, is available and compatible with the socket type.
[ "bind", "is", "available", "and", "compatible", "with", "the", "socket", "type", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/SocketBase.java#L174-L192
train
zeromq/jeromq
src/main/java/zmq/SocketBase.java
SocketBase.addEndpoint
private void addEndpoint(String addr, Own endpoint, Pipe pipe) { // Activate the session. Make it a child of this socket. launchChild(endpoint); endpoints.insert(addr, new EndpointPipe(endpoint, pipe)); }
java
private void addEndpoint(String addr, Own endpoint, Pipe pipe) { // Activate the session. Make it a child of this socket. launchChild(endpoint); endpoints.insert(addr, new EndpointPipe(endpoint, pipe)); }
[ "private", "void", "addEndpoint", "(", "String", "addr", ",", "Own", "endpoint", ",", "Pipe", "pipe", ")", "{", "// Activate the session. Make it a child of this socket.", "launchChild", "(", "endpoint", ")", ";", "endpoints", ".", "insert", "(", "addr", ",", "ne...
Creates new endpoint ID and adds the endpoint to the map.
[ "Creates", "new", "endpoint", "ID", "and", "adds", "the", "endpoint", "to", "the", "map", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/SocketBase.java#L593-L598
train
zeromq/jeromq
src/main/java/zmq/SocketBase.java
SocketBase.startReaping
final void startReaping(Poller poller) { // Plug the socket to the reaper thread. this.poller = poller; SelectableChannel fd = mailbox.getFd(); handle = this.poller.addHandle(fd, this); this.poller.setPollIn(handle); // Initialize the termination and check whether ...
java
final void startReaping(Poller poller) { // Plug the socket to the reaper thread. this.poller = poller; SelectableChannel fd = mailbox.getFd(); handle = this.poller.addHandle(fd, this); this.poller.setPollIn(handle); // Initialize the termination and check whether ...
[ "final", "void", "startReaping", "(", "Poller", "poller", ")", "{", "// Plug the socket to the reaper thread.", "this", ".", "poller", "=", "poller", ";", "SelectableChannel", "fd", "=", "mailbox", ".", "getFd", "(", ")", ";", "handle", "=", "this", ".", "pol...
its poller.
[ "its", "poller", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/SocketBase.java#L888-L900
train
zeromq/jeromq
src/main/java/zmq/SocketBase.java
SocketBase.processCommands
private boolean processCommands(int timeout, boolean throttle) { Command cmd; if (timeout != 0) { // If we are asked to wait, simply ask mailbox to wait. cmd = mailbox.recv(timeout); } else { // If we are asked not to wait, check whether we haven...
java
private boolean processCommands(int timeout, boolean throttle) { Command cmd; if (timeout != 0) { // If we are asked to wait, simply ask mailbox to wait. cmd = mailbox.recv(timeout); } else { // If we are asked not to wait, check whether we haven...
[ "private", "boolean", "processCommands", "(", "int", "timeout", ",", "boolean", "throttle", ")", "{", "Command", "cmd", ";", "if", "(", "timeout", "!=", "0", ")", "{", "// If we are asked to wait, simply ask mailbox to wait.", "cmd", "=", "mailbox", ".", "recv", ...
in a predefined time period.
[ "in", "a", "predefined", "time", "period", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/SocketBase.java#L906-L958
train
zeromq/jeromq
src/main/java/zmq/SocketBase.java
SocketBase.extractFlags
private void extractFlags(Msg msg) { // Test whether IDENTITY flag is valid for this socket type. if (msg.isIdentity()) { assert (options.recvIdentity); } // Remove MORE flag. rcvmore = msg.hasMore(); }
java
private void extractFlags(Msg msg) { // Test whether IDENTITY flag is valid for this socket type. if (msg.isIdentity()) { assert (options.recvIdentity); } // Remove MORE flag. rcvmore = msg.hasMore(); }
[ "private", "void", "extractFlags", "(", "Msg", "msg", ")", "{", "// Test whether IDENTITY flag is valid for this socket type.", "if", "(", "msg", ".", "isIdentity", "(", ")", ")", "{", "assert", "(", "options", ".", "recvIdentity", ")", ";", "}", "// Remove MORE...
to be later retrieved by getSocketOpt.
[ "to", "be", "later", "retrieved", "by", "getSocketOpt", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/SocketBase.java#L1132-L1141
train
zeromq/jeromq
src/main/java/zmq/io/net/ipc/IpcListener.java
IpcListener.getAddress
@Override public String getAddress() { if (((InetSocketAddress) address.address()).getPort() == 0) { return address(address); } return address.toString(); }
java
@Override public String getAddress() { if (((InetSocketAddress) address.address()).getPort() == 0) { return address(address); } return address.toString(); }
[ "@", "Override", "public", "String", "getAddress", "(", ")", "{", "if", "(", "(", "(", "InetSocketAddress", ")", "address", ".", "address", "(", ")", ")", ".", "getPort", "(", ")", "==", "0", ")", "{", "return", "address", "(", "address", ")", ";", ...
Get the bound address for use with wildcards
[ "Get", "the", "bound", "address", "for", "use", "with", "wildcards" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/net/ipc/IpcListener.java#L22-L29
train
zeromq/jeromq
src/main/java/org/zeromq/ZConfig.java
ZConfig.pathExists
public boolean pathExists(String path) { String[] pathElements = path.split("/"); ZConfig current = this; for (String pathElem : pathElements) { if (pathElem.isEmpty()) { continue; } current = current.children.get(pathElem); if ...
java
public boolean pathExists(String path) { String[] pathElements = path.split("/"); ZConfig current = this; for (String pathElem : pathElements) { if (pathElem.isEmpty()) { continue; } current = current.children.get(pathElem); if ...
[ "public", "boolean", "pathExists", "(", "String", "path", ")", "{", "String", "[", "]", "pathElements", "=", "path", ".", "split", "(", "\"/\"", ")", ";", "ZConfig", "current", "=", "this", ";", "for", "(", "String", "pathElem", ":", "pathElements", ")",...
check if a value-path exists @param path @return true if value-path exists
[ "check", "if", "a", "value", "-", "path", "exists" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZConfig.java#L157-L171
train
zeromq/jeromq
src/main/java/zmq/io/mechanism/curve/Curve.java
Curve.keypairZ85
public String[] keypairZ85() { String[] pair = new String[2]; byte[] publicKey = new byte[Size.PUBLICKEY.bytes()]; byte[] secretKey = new byte[Size.SECRETKEY.bytes()]; int rc = curve25519xsalsa20poly1305.crypto_box_keypair(publicKey, secretKey); assert (rc == 0); p...
java
public String[] keypairZ85() { String[] pair = new String[2]; byte[] publicKey = new byte[Size.PUBLICKEY.bytes()]; byte[] secretKey = new byte[Size.SECRETKEY.bytes()]; int rc = curve25519xsalsa20poly1305.crypto_box_keypair(publicKey, secretKey); assert (rc == 0); p...
[ "public", "String", "[", "]", "keypairZ85", "(", ")", "{", "String", "[", "]", "pair", "=", "new", "String", "[", "2", "]", ";", "byte", "[", "]", "publicKey", "=", "new", "byte", "[", "Size", ".", "PUBLICKEY", ".", "bytes", "(", ")", "]", ";", ...
Generates a pair of Z85-encoded keys for use with this class. @return an array of 2 strings, holding Z85-encoded keys. The first element of the array is the public key, the second element is the private (or secret) key.
[ "Generates", "a", "pair", "of", "Z85", "-", "encoded", "keys", "for", "use", "with", "this", "class", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/mechanism/curve/Curve.java#L85-L99
train
zeromq/jeromq
src/main/java/zmq/io/mechanism/curve/Curve.java
Curve.keypair
public byte[][] keypair() { byte[][] pair = new byte[2][]; byte[] publicKey = new byte[Size.PUBLICKEY.bytes()]; byte[] secretKey = new byte[Size.SECRETKEY.bytes()]; int rc = curve25519xsalsa20poly1305.crypto_box_keypair(publicKey, secretKey); assert (rc == 0); pair...
java
public byte[][] keypair() { byte[][] pair = new byte[2][]; byte[] publicKey = new byte[Size.PUBLICKEY.bytes()]; byte[] secretKey = new byte[Size.SECRETKEY.bytes()]; int rc = curve25519xsalsa20poly1305.crypto_box_keypair(publicKey, secretKey); assert (rc == 0); pair...
[ "public", "byte", "[", "]", "[", "]", "keypair", "(", ")", "{", "byte", "[", "]", "[", "]", "pair", "=", "new", "byte", "[", "2", "]", "[", "", "]", ";", "byte", "[", "]", "publicKey", "=", "new", "byte", "[", "Size", ".", "PUBLICKEY", ".", ...
Generates a pair of keys for use with this class. @return an array of 2 byte arrays, holding keys. The first element of the array is the public key, the second element is the private (or secret) key.
[ "Generates", "a", "pair", "of", "keys", "for", "use", "with", "this", "class", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/mechanism/curve/Curve.java#L108-L122
train
zeromq/jeromq
src/main/java/zmq/io/StreamEngine.java
StreamEngine.error
private void error(ErrorReason error) { if (options.rawSocket) { // For raw sockets, send a final 0-length message to the application // so that it knows the peer has been disconnected. Msg terminator = new Msg(); processMsg.apply(terminator); } ...
java
private void error(ErrorReason error) { if (options.rawSocket) { // For raw sockets, send a final 0-length message to the application // so that it knows the peer has been disconnected. Msg terminator = new Msg(); processMsg.apply(terminator); } ...
[ "private", "void", "error", "(", "ErrorReason", "error", ")", "{", "if", "(", "options", ".", "rawSocket", ")", "{", "// For raw sockets, send a final 0-length message to the application", "// so that it knows the peer has been disconnected.", "Msg", "terminator", "=", "new...
Function to handle network disconnections.
[ "Function", "to", "handle", "network", "disconnections", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/StreamEngine.java#L1106-L1120
train
zeromq/jeromq
src/main/java/zmq/io/StreamEngine.java
StreamEngine.write
private int write(ByteBuffer outbuf) { int nbytes; try { nbytes = fd.write(outbuf); if (nbytes == 0) { errno.set(ZError.EAGAIN); } } catch (IOException e) { errno.set(ZError.ENOTCONN); nbytes = -1; } ...
java
private int write(ByteBuffer outbuf) { int nbytes; try { nbytes = fd.write(outbuf); if (nbytes == 0) { errno.set(ZError.EAGAIN); } } catch (IOException e) { errno.set(ZError.ENOTCONN); nbytes = -1; } ...
[ "private", "int", "write", "(", "ByteBuffer", "outbuf", ")", "{", "int", "nbytes", ";", "try", "{", "nbytes", "=", "fd", ".", "write", "(", "outbuf", ")", ";", "if", "(", "nbytes", "==", "0", ")", "{", "errno", ".", "set", "(", "ZError", ".", "EA...
of error or orderly shutdown by the other peer -1 is returned.
[ "of", "error", "or", "orderly", "shutdown", "by", "the", "other", "peer", "-", "1", "is", "returned", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/StreamEngine.java#L1240-L1255
train
zeromq/jeromq
src/main/java/zmq/io/StreamEngine.java
StreamEngine.read
private int read(ByteBuffer buf) { int nbytes; try { nbytes = fd.read(buf); if (nbytes == -1) { errno.set(ZError.ENOTCONN); } else if (nbytes == 0) { if (!fd.isBlocking()) { // If not a single byte c...
java
private int read(ByteBuffer buf) { int nbytes; try { nbytes = fd.read(buf); if (nbytes == -1) { errno.set(ZError.ENOTCONN); } else if (nbytes == 0) { if (!fd.isBlocking()) { // If not a single byte c...
[ "private", "int", "read", "(", "ByteBuffer", "buf", ")", "{", "int", "nbytes", ";", "try", "{", "nbytes", "=", "fd", ".", "read", "(", "buf", ")", ";", "if", "(", "nbytes", "==", "-", "1", ")", "{", "errno", ".", "set", "(", "ZError", ".", "ENO...
Zero indicates the peer has closed the connection.
[ "Zero", "indicates", "the", "peer", "has", "closed", "the", "connection", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/StreamEngine.java#L1260-L1287
train
zeromq/jeromq
src/main/java/org/zeromq/ZFrame.java
ZFrame.sendAndDestroy
public boolean sendAndDestroy(Socket socket, int flags) { boolean ret = send(socket, flags); if (ret) { destroy(); } return ret; }
java
public boolean sendAndDestroy(Socket socket, int flags) { boolean ret = send(socket, flags); if (ret) { destroy(); } return ret; }
[ "public", "boolean", "sendAndDestroy", "(", "Socket", "socket", ",", "int", "flags", ")", "{", "boolean", "ret", "=", "send", "(", "socket", ",", "flags", ")", ";", "if", "(", "ret", ")", "{", "destroy", "(", ")", ";", "}", "return", "ret", ";", "}...
Sends frame to socket if it contains data. Use this method to send a frame and destroy the data after. @param socket 0MQ socket to send frame @param flags Valid send() method flags, defined in org.zeromq.ZMQ class @return True if success, else False
[ "Sends", "frame", "to", "socket", "if", "it", "contains", "data", ".", "Use", "this", "method", "to", "send", "a", "frame", "and", "destroy", "the", "data", "after", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZFrame.java#L178-L185
train
zeromq/jeromq
src/main/java/org/zeromq/ZFrame.java
ZFrame.hasSameData
public boolean hasSameData(ZFrame other) { if (other == null) { return false; } if (size() == other.size()) { return Arrays.equals(data, other.data); } return false; }
java
public boolean hasSameData(ZFrame other) { if (other == null) { return false; } if (size() == other.size()) { return Arrays.equals(data, other.data); } return false; }
[ "public", "boolean", "hasSameData", "(", "ZFrame", "other", ")", "{", "if", "(", "other", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "size", "(", ")", "==", "other", ".", "size", "(", ")", ")", "{", "return", "Arrays", ".", "...
Returns true if both frames have byte - for byte identical data @param other The other ZFrame to compare @return True if both ZFrames have same byte-identical data, else false
[ "Returns", "true", "if", "both", "frames", "have", "byte", "-", "for", "byte", "identical", "data" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZFrame.java#L218-L228
train
zeromq/jeromq
src/main/java/org/zeromq/ZFrame.java
ZFrame.recv
private byte[] recv(Socket socket, int flags) { Utils.checkArgument(socket != null, "socket parameter must not be null"); data = socket.recv(flags); more = socket.hasReceiveMore(); return data; }
java
private byte[] recv(Socket socket, int flags) { Utils.checkArgument(socket != null, "socket parameter must not be null"); data = socket.recv(flags); more = socket.hasReceiveMore(); return data; }
[ "private", "byte", "[", "]", "recv", "(", "Socket", "socket", ",", "int", "flags", ")", "{", "Utils", ".", "checkArgument", "(", "socket", "!=", "null", ",", "\"socket parameter must not be null\"", ")", ";", "data", "=", "socket", ".", "recv", "(", "flags...
Internal method to call recv on the socket. Does not trap any ZMQExceptions but expects caling routine to handle them. @param socket 0MQ socket to read from @return byte[] data
[ "Internal", "method", "to", "call", "recv", "on", "the", "socket", ".", "Does", "not", "trap", "any", "ZMQExceptions", "but", "expects", "caling", "routine", "to", "handle", "them", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZFrame.java#L309-L315
train
zeromq/jeromq
src/main/java/org/zeromq/ZFrame.java
ZFrame.recvFrame
public static ZFrame recvFrame(Socket socket, int flags) { ZFrame f = new ZFrame(); byte[] data = f.recv(socket, flags); if (data == null) { return null; } return f; }
java
public static ZFrame recvFrame(Socket socket, int flags) { ZFrame f = new ZFrame(); byte[] data = f.recv(socket, flags); if (data == null) { return null; } return f; }
[ "public", "static", "ZFrame", "recvFrame", "(", "Socket", "socket", ",", "int", "flags", ")", "{", "ZFrame", "f", "=", "new", "ZFrame", "(", ")", ";", "byte", "[", "]", "data", "=", "f", ".", "recv", "(", "socket", ",", "flags", ")", ";", "if", "...
Receive a new frame off the socket, Returns newly-allocated frame, or null if there was no input waiting, or if the read was interrupted. @param socket Socket to read from @param flags Pass flags to 0MQ socket.recv call @return received frame, else null
[ "Receive", "a", "new", "frame", "off", "the", "socket", "Returns", "newly", "-", "allocated", "frame", "or", "null", "if", "there", "was", "no", "input", "waiting", "or", "if", "the", "read", "was", "interrupted", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZFrame.java#L342-L350
train
zeromq/jeromq
src/main/java/zmq/Ctx.java
Ctx.terminate
public void terminate() { slotSync.lock(); try { // Connect up any pending inproc connections, otherwise we will hang for (Entry<PendingConnection, String> pending : pendingConnections.entries()) { SocketBase s = createSocket(ZMQ.ZMQ_PAIR); // ...
java
public void terminate() { slotSync.lock(); try { // Connect up any pending inproc connections, otherwise we will hang for (Entry<PendingConnection, String> pending : pendingConnections.entries()) { SocketBase s = createSocket(ZMQ.ZMQ_PAIR); // ...
[ "public", "void", "terminate", "(", ")", "{", "slotSync", ".", "lock", "(", ")", ";", "try", "{", "// Connect up any pending inproc connections, otherwise we will hang", "for", "(", "Entry", "<", "PendingConnection", ",", "String", ">", "pending", ":", "pendingConne...
after the last one is closed.
[ "after", "the", "last", "one", "is", "closed", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/Ctx.java#L231-L292
train
zeromq/jeromq
src/main/java/zmq/Ctx.java
Ctx.createSelector
public Selector createSelector() { selectorSync.lock(); try { Selector selector = Selector.open(); assert (selector != null); selectors.add(selector); return selector; } catch (IOException e) { throw new ZError.IOException(e...
java
public Selector createSelector() { selectorSync.lock(); try { Selector selector = Selector.open(); assert (selector != null); selectors.add(selector); return selector; } catch (IOException e) { throw new ZError.IOException(e...
[ "public", "Selector", "createSelector", "(", ")", "{", "selectorSync", ".", "lock", "(", ")", ";", "try", "{", "Selector", "selector", "=", "Selector", ".", "open", "(", ")", ";", "assert", "(", "selector", "!=", "null", ")", ";", "selectors", ".", "ad...
Creates a Selector that will be closed when the context is destroyed.
[ "Creates", "a", "Selector", "that", "will", "be", "closed", "when", "the", "context", "is", "destroyed", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/Ctx.java#L493-L508
train
zeromq/jeromq
src/main/java/zmq/Ctx.java
Ctx.registerEndpoint
boolean registerEndpoint(String addr, Endpoint endpoint) { endpointsSync.lock(); Endpoint inserted = null; try { inserted = endpoints.put(addr, endpoint); } finally { endpointsSync.unlock(); } if (inserted != null) { return...
java
boolean registerEndpoint(String addr, Endpoint endpoint) { endpointsSync.lock(); Endpoint inserted = null; try { inserted = endpoints.put(addr, endpoint); } finally { endpointsSync.unlock(); } if (inserted != null) { return...
[ "boolean", "registerEndpoint", "(", "String", "addr", ",", "Endpoint", "endpoint", ")", "{", "endpointsSync", ".", "lock", "(", ")", ";", "Endpoint", "inserted", "=", "null", ";", "try", "{", "inserted", "=", "endpoints", ".", "put", "(", "addr", ",", "e...
Management of inproc endpoints.
[ "Management", "of", "inproc", "endpoints", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/Ctx.java#L569-L584
train
zeromq/jeromq
src/main/java/zmq/io/SessionBase.java
SessionBase.attachPipe
public void attachPipe(Pipe pipe) { assert (!isTerminating()); assert (this.pipe == null); assert (pipe != null); this.pipe = pipe; this.pipe.setEventSink(this); }
java
public void attachPipe(Pipe pipe) { assert (!isTerminating()); assert (this.pipe == null); assert (pipe != null); this.pipe = pipe; this.pipe.setEventSink(this); }
[ "public", "void", "attachPipe", "(", "Pipe", "pipe", ")", "{", "assert", "(", "!", "isTerminating", "(", ")", ")", ";", "assert", "(", "this", ".", "pipe", "==", "null", ")", ";", "assert", "(", "pipe", "!=", "null", ")", ";", "this", ".", "pipe", ...
To be used once only, when creating the session.
[ "To", "be", "used", "once", "only", "when", "creating", "the", "session", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/SessionBase.java#L111-L118
train
zeromq/jeromq
src/main/java/zmq/io/SessionBase.java
SessionBase.cleanPipes
private void cleanPipes() { assert (pipe != null); // Get rid of half-processed messages in the out pipe. Flush any // unflushed messages upstream. pipe.rollback(); pipe.flush(); // Remove any half-read message from the in pipe. while (incompleteIn) { ...
java
private void cleanPipes() { assert (pipe != null); // Get rid of half-processed messages in the out pipe. Flush any // unflushed messages upstream. pipe.rollback(); pipe.flush(); // Remove any half-read message from the in pipe. while (incompleteIn) { ...
[ "private", "void", "cleanPipes", "(", ")", "{", "assert", "(", "pipe", "!=", "null", ")", ";", "// Get rid of half-processed messages in the out pipe. Flush any", "// unflushed messages upstream.", "pipe", ".", "rollback", "(", ")", ";", "pipe", ".", "flush", "(", ...
Call this function when engine disconnect to get rid of leftovers.
[ "Call", "this", "function", "when", "engine", "disconnect", "to", "get", "rid", "of", "leftovers", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/SessionBase.java#L188-L205
train
zeromq/jeromq
src/main/java/org/zeromq/ZContext.java
ZContext.destroy
public void destroy() { for (Socket socket : sockets) { destroySocket(socket); } sockets.clear(); for (Selector selector : selectors) { context.close(selector); } selectors.clear(); // Only terminate context if we are on the main thre...
java
public void destroy() { for (Socket socket : sockets) { destroySocket(socket); } sockets.clear(); for (Selector selector : selectors) { context.close(selector); } selectors.clear(); // Only terminate context if we are on the main thre...
[ "public", "void", "destroy", "(", ")", "{", "for", "(", "Socket", "socket", ":", "sockets", ")", "{", "destroySocket", "(", "socket", ")", ";", "}", "sockets", ".", "clear", "(", ")", ";", "for", "(", "Selector", "selector", ":", "selectors", ")", "{...
Destructor. Call this to gracefully terminate context and close any managed 0MQ sockets
[ "Destructor", ".", "Call", "this", "to", "gracefully", "terminate", "context", "and", "close", "any", "managed", "0MQ", "sockets" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZContext.java#L102-L118
train
zeromq/jeromq
src/main/java/org/zeromq/ZContext.java
ZContext.createSocket
public Socket createSocket(SocketType type) { // Create and register socket Socket socket = context.socket(type); socket.setRcvHWM(this.rcvhwm); socket.setSndHWM(this.sndhwm); sockets.add(socket); return socket; }
java
public Socket createSocket(SocketType type) { // Create and register socket Socket socket = context.socket(type); socket.setRcvHWM(this.rcvhwm); socket.setSndHWM(this.sndhwm); sockets.add(socket); return socket; }
[ "public", "Socket", "createSocket", "(", "SocketType", "type", ")", "{", "// Create and register socket", "Socket", "socket", "=", "context", ".", "socket", "(", "type", ")", ";", "socket", ".", "setRcvHWM", "(", "this", ".", "rcvhwm", ")", ";", "socket", "....
Creates a new managed socket within this ZContext instance. Use this to get automatic management of the socket at shutdown @param type socket type @return Newly created Socket object
[ "Creates", "a", "new", "managed", "socket", "within", "this", "ZContext", "instance", ".", "Use", "this", "to", "get", "automatic", "management", "of", "the", "socket", "at", "shutdown" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZContext.java#L128-L136
train
zeromq/jeromq
src/main/java/org/zeromq/ZContext.java
ZContext.destroySocket
public void destroySocket(Socket s) { if (s == null) { return; } s.setLinger(linger); s.close(); this.sockets.remove(s); }
java
public void destroySocket(Socket s) { if (s == null) { return; } s.setLinger(linger); s.close(); this.sockets.remove(s); }
[ "public", "void", "destroySocket", "(", "Socket", "s", ")", "{", "if", "(", "s", "==", "null", ")", "{", "return", ";", "}", "s", ".", "setLinger", "(", "linger", ")", ";", "s", ".", "close", "(", ")", ";", "this", ".", "sockets", ".", "remove", ...
Destroys managed socket within this context and remove from sockets list @param s org.zeromq.Socket object to destroy
[ "Destroys", "managed", "socket", "within", "this", "context", "and", "remove", "from", "sockets", "list" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZContext.java#L157-L165
train
zeromq/jeromq
src/main/java/org/zeromq/ZContext.java
ZContext.selector
Selector selector() { Selector selector = context.selector(); selectors.add(selector); return selector; }
java
Selector selector() { Selector selector = context.selector(); selectors.add(selector); return selector; }
[ "Selector", "selector", "(", ")", "{", "Selector", "selector", "=", "context", ".", "selector", "(", ")", ";", "selectors", ".", "add", "(", "selector", ")", ";", "return", "selector", ";", "}" ]
Creates a selector. Resource will be released when context will be closed. @return a newly created selector.
[ "Creates", "a", "selector", ".", "Resource", "will", "be", "released", "when", "context", "will", "be", "closed", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZContext.java#L184-L189
train
zeromq/jeromq
src/main/java/org/zeromq/ZContext.java
ZContext.closeSelector
@Deprecated @Draft public void closeSelector(Selector selector) { if (selectors.remove(selector)) { context.close(selector); } }
java
@Deprecated @Draft public void closeSelector(Selector selector) { if (selectors.remove(selector)) { context.close(selector); } }
[ "@", "Deprecated", "@", "Draft", "public", "void", "closeSelector", "(", "Selector", "selector", ")", "{", "if", "(", "selectors", ".", "remove", "(", "selector", ")", ")", "{", "context", ".", "close", "(", "selector", ")", ";", "}", "}" ]
Closes a selector. This is a DRAFT method, and may change without notice. @param selector the selector to close. It needs to have been created by {@link #createSelector()}. @deprecated {@link #createSelector()} was exposed by mistake. while waiting for the API to disappear, this method is provided to allow releasing r...
[ "Closes", "a", "selector", ".", "This", "is", "a", "DRAFT", "method", "and", "may", "change", "without", "notice", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZContext.java#L198-L205
train