repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimator.java
GVRAnimator.setDuration
public void setDuration(float start, float end) { """ Sets the duration for the animations in this animator. @param start the animation will start playing from the specified time @param end the animation will stop playing at the specified time @see GVRAnimation#setDuration(float, float) """ for ...
java
public void setDuration(float start, float end) { for (GVRAnimation anim : mAnimations) { anim.setDuration(start,end); } }
[ "public", "void", "setDuration", "(", "float", "start", ",", "float", "end", ")", "{", "for", "(", "GVRAnimation", "anim", ":", "mAnimations", ")", "{", "anim", ".", "setDuration", "(", "start", ",", "end", ")", ";", "}", "}" ]
Sets the duration for the animations in this animator. @param start the animation will start playing from the specified time @param end the animation will stop playing at the specified time @see GVRAnimation#setDuration(float, float)
[ "Sets", "the", "duration", "for", "the", "animations", "in", "this", "animator", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimator.java#L258-L264
MGunlogson/CuckooFilter4J
src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java
FilterTable.findTag
boolean findTag(long i1, long i2, long tag) { """ Finds a tag if present in two buckets. @param i1 first bucket index @param i2 second bucket index (alternate) @param tag tag @return true if tag found in one of the buckets """ for (int i = 0; i < CuckooFilter.BUCKET_SIZE; i++) { if (checkTag(i1...
java
boolean findTag(long i1, long i2, long tag) { for (int i = 0; i < CuckooFilter.BUCKET_SIZE; i++) { if (checkTag(i1, i, tag) || checkTag(i2, i, tag)) return true; } return false; }
[ "boolean", "findTag", "(", "long", "i1", ",", "long", "i2", ",", "long", "tag", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "CuckooFilter", ".", "BUCKET_SIZE", ";", "i", "++", ")", "{", "if", "(", "checkTag", "(", "i1", ",", "i",...
Finds a tag if present in two buckets. @param i1 first bucket index @param i2 second bucket index (alternate) @param tag tag @return true if tag found in one of the buckets
[ "Finds", "a", "tag", "if", "present", "in", "two", "buckets", "." ]
train
https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java#L130-L136
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/spec/AbstractSpecWithPrimaryKey.java
AbstractSpecWithPrimaryKey.withPrimaryKey
public AbstractSpecWithPrimaryKey<T> withPrimaryKey(String hashKeyName, Object hashKeyValue) { """ Sets the primary key with the specified hash-only key name and value. """ if (hashKeyName == null) throw new IllegalArgumentException(); withPrimaryKey(new PrimaryKey(hashKeyName, hash...
java
public AbstractSpecWithPrimaryKey<T> withPrimaryKey(String hashKeyName, Object hashKeyValue) { if (hashKeyName == null) throw new IllegalArgumentException(); withPrimaryKey(new PrimaryKey(hashKeyName, hashKeyValue)); return this; }
[ "public", "AbstractSpecWithPrimaryKey", "<", "T", ">", "withPrimaryKey", "(", "String", "hashKeyName", ",", "Object", "hashKeyValue", ")", "{", "if", "(", "hashKeyName", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", ")", ";", "withPrimaryKey"...
Sets the primary key with the specified hash-only key name and value.
[ "Sets", "the", "primary", "key", "with", "the", "specified", "hash", "-", "only", "key", "name", "and", "value", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/spec/AbstractSpecWithPrimaryKey.java#L68-L73
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/xml/XmlUtils.java
XmlUtils.getChildTextList
public static List getChildTextList(Element elem, String childTagName) { """ Return list of content Strings of all child elements with given tag name. @param elem @param childTagName @return List """ NodeList nodeList = elem.getElementsByTagName(childTagName); int len = nodeList.getLength();...
java
public static List getChildTextList(Element elem, String childTagName) { NodeList nodeList = elem.getElementsByTagName(childTagName); int len = nodeList.getLength(); if (len == 0) { return Collections.EMPTY_LIST; } List list = new ArrayList(len); ...
[ "public", "static", "List", "getChildTextList", "(", "Element", "elem", ",", "String", "childTagName", ")", "{", "NodeList", "nodeList", "=", "elem", ".", "getElementsByTagName", "(", "childTagName", ")", ";", "int", "len", "=", "nodeList", ".", "getLength", "...
Return list of content Strings of all child elements with given tag name. @param elem @param childTagName @return List
[ "Return", "list", "of", "content", "Strings", "of", "all", "child", "elements", "with", "given", "tag", "name", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/xml/XmlUtils.java#L87-L103
googleads/googleads-java-lib
modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java
DateTimesHelper.toDateTime
public T toDateTime(Instant instant, String timeZoneId) { """ Converts an {@code Instant} object to an API date time in the time zone supplied. """ return toDateTime( instant.toDateTime(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timeZoneId)))); }
java
public T toDateTime(Instant instant, String timeZoneId) { return toDateTime( instant.toDateTime(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timeZoneId)))); }
[ "public", "T", "toDateTime", "(", "Instant", "instant", ",", "String", "timeZoneId", ")", "{", "return", "toDateTime", "(", "instant", ".", "toDateTime", "(", "DateTimeZone", ".", "forTimeZone", "(", "TimeZone", ".", "getTimeZone", "(", "timeZoneId", ")", ")",...
Converts an {@code Instant} object to an API date time in the time zone supplied.
[ "Converts", "an", "{" ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java#L63-L66
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
JavacParser.classOrInterfaceOrEnumDeclaration
protected JCStatement classOrInterfaceOrEnumDeclaration(JCModifiers mods, Comment dc) { """ ClassOrInterfaceOrEnumDeclaration = ModifiersOpt (ClassDeclaration | InterfaceDeclaration | EnumDeclaration) @param mods Any modifiers starting the class or interface declaration @param dc The documentation com...
java
protected JCStatement classOrInterfaceOrEnumDeclaration(JCModifiers mods, Comment dc) { if (token.kind == CLASS) { return classDeclaration(mods, dc); } else if (token.kind == INTERFACE) { return interfaceDeclaration(mods, dc); } else if (token.kind == ENUM) { ...
[ "protected", "JCStatement", "classOrInterfaceOrEnumDeclaration", "(", "JCModifiers", "mods", ",", "Comment", "dc", ")", "{", "if", "(", "token", ".", "kind", "==", "CLASS", ")", "{", "return", "classDeclaration", "(", "mods", ",", "dc", ")", ";", "}", "else"...
ClassOrInterfaceOrEnumDeclaration = ModifiersOpt (ClassDeclaration | InterfaceDeclaration | EnumDeclaration) @param mods Any modifiers starting the class or interface declaration @param dc The documentation comment for the class, or null.
[ "ClassOrInterfaceOrEnumDeclaration", "=", "ModifiersOpt", "(", "ClassDeclaration", "|", "InterfaceDeclaration", "|", "EnumDeclaration", ")" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3350-L3374
zaproxy/zaproxy
src/org/zaproxy/zap/extension/script/ExtensionScript.java
ExtensionScript.handleUnspecifiedScriptError
private void handleUnspecifiedScriptError(ScriptWrapper script, Writer writer, String errorMessage) { """ Handles an unspecified error that occurred while calling or invoking a script. <p> The given {@code errorMessage} will be written to the given {@code writer} and the given {@code script} will be disabled an...
java
private void handleUnspecifiedScriptError(ScriptWrapper script, Writer writer, String errorMessage) { try { writer.append(errorMessage); } catch (IOException e) { if (logger.isDebugEnabled()) { logger.debug("Failed to append script error message because of an exception:", e); } logger.warn("F...
[ "private", "void", "handleUnspecifiedScriptError", "(", "ScriptWrapper", "script", ",", "Writer", "writer", ",", "String", "errorMessage", ")", "{", "try", "{", "writer", ".", "append", "(", "errorMessage", ")", ";", "}", "catch", "(", "IOException", "e", ")",...
Handles an unspecified error that occurred while calling or invoking a script. <p> The given {@code errorMessage} will be written to the given {@code writer} and the given {@code script} will be disabled and flagged that has an error. @param script the script that failed to be called/invoked, must not be {@code null} ...
[ "Handles", "an", "unspecified", "error", "that", "occurred", "while", "calling", "or", "invoking", "a", "script", ".", "<p", ">", "The", "given", "{", "@code", "errorMessage", "}", "will", "be", "written", "to", "the", "given", "{", "@code", "writer", "}",...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L1455-L1466
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java
ContinuousDistributions.gCf
private static double gCf(double x, double A) { """ Internal function used by gammaCdf @param x @param A @return """ // Good for X>A+1 double A0=0; double B0=1; double A1=1; double B1=x; double AOLD=0; double N=0; while (Math.abs((A1-AOLD)/A1)>.00001...
java
private static double gCf(double x, double A) { // Good for X>A+1 double A0=0; double B0=1; double A1=1; double B1=x; double AOLD=0; double N=0; while (Math.abs((A1-AOLD)/A1)>.00001) { AOLD=A1; N=N+1; A0=A1+(N-A)*A0; B0=...
[ "private", "static", "double", "gCf", "(", "double", "x", ",", "double", "A", ")", "{", "// Good for X>A+1", "double", "A0", "=", "0", ";", "double", "B0", "=", "1", ";", "double", "A1", "=", "1", ";", "double", "B1", "=", "x", ";", "double", "AOLD...
Internal function used by gammaCdf @param x @param A @return
[ "Internal", "function", "used", "by", "gammaCdf" ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java#L267-L290
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.formatGMT
public synchronized static String formatGMT(long gmtTime, String format) { """ Formats a date. @param time the time to format @param format the format string """ _gmtDate.setGMTTime(gmtTime); return _gmtDate.format(new CharBuffer(), format).toString(); }
java
public synchronized static String formatGMT(long gmtTime, String format) { _gmtDate.setGMTTime(gmtTime); return _gmtDate.format(new CharBuffer(), format).toString(); }
[ "public", "synchronized", "static", "String", "formatGMT", "(", "long", "gmtTime", ",", "String", "format", ")", "{", "_gmtDate", ".", "setGMTTime", "(", "gmtTime", ")", ";", "return", "_gmtDate", ".", "format", "(", "new", "CharBuffer", "(", ")", ",", "fo...
Formats a date. @param time the time to format @param format the format string
[ "Formats", "a", "date", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L920-L925
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/xml/XMLOutputUtil.java
XMLOutputUtil.writeElementList
public static void writeElementList(XMLOutput xmlOutput, String tagName, Iterable<String> listValues) throws IOException { """ Write a list of Strings to document as elements with given tag name. @param xmlOutput the XMLOutput object to write to @param tagName the tag name @param listValues Collection of S...
java
public static void writeElementList(XMLOutput xmlOutput, String tagName, Iterable<String> listValues) throws IOException { writeElementList(xmlOutput, tagName, listValues.iterator()); }
[ "public", "static", "void", "writeElementList", "(", "XMLOutput", "xmlOutput", ",", "String", "tagName", ",", "Iterable", "<", "String", ">", "listValues", ")", "throws", "IOException", "{", "writeElementList", "(", "xmlOutput", ",", "tagName", ",", "listValues", ...
Write a list of Strings to document as elements with given tag name. @param xmlOutput the XMLOutput object to write to @param tagName the tag name @param listValues Collection of String values to write
[ "Write", "a", "list", "of", "Strings", "to", "document", "as", "elements", "with", "given", "tag", "name", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/xml/XMLOutputUtil.java#L44-L46
rometools/rome
rome-modules/src/main/java/com/rometools/modules/georss/geometries/PositionList.java
PositionList.insert
public void insert(final int pos, final double latitude, final double longitude) { """ Add a position at a given index in the list. The rest of the list is shifted one place to the "right" @param pos position index """ ensureCapacity(size + 1); System.arraycopy(this.longitude, pos, this.lon...
java
public void insert(final int pos, final double latitude, final double longitude) { ensureCapacity(size + 1); System.arraycopy(this.longitude, pos, this.longitude, pos + 1, size - pos); System.arraycopy(this.latitude, pos, this.latitude, pos + 1, size - pos); this.longitude[pos] = longitu...
[ "public", "void", "insert", "(", "final", "int", "pos", ",", "final", "double", "latitude", ",", "final", "double", "longitude", ")", "{", "ensureCapacity", "(", "size", "+", "1", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "longitude", ",", ...
Add a position at a given index in the list. The rest of the list is shifted one place to the "right" @param pos position index
[ "Add", "a", "position", "at", "a", "given", "index", "in", "the", "list", ".", "The", "rest", "of", "the", "list", "is", "shifted", "one", "place", "to", "the", "right" ]
train
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/georss/geometries/PositionList.java#L129-L136
zaproxy/zaproxy
src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java
ExtensionHttpSessions.unmarkRemovedDefaultSessionToken
private void unmarkRemovedDefaultSessionToken(String site, String token) { """ Unmarks a default session token as removed for a particular site. @param site the site. This parameter has to be formed as defined in the {@link ExtensionHttpSessions} class documentation. @param token the token """ if (remov...
java
private void unmarkRemovedDefaultSessionToken(String site, String token) { if (removedDefaultTokens == null) return; HashSet<String> removed = removedDefaultTokens.get(site); if (removed == null) return; removed.remove(token); }
[ "private", "void", "unmarkRemovedDefaultSessionToken", "(", "String", "site", ",", "String", "token", ")", "{", "if", "(", "removedDefaultTokens", "==", "null", ")", "return", ";", "HashSet", "<", "String", ">", "removed", "=", "removedDefaultTokens", ".", "get"...
Unmarks a default session token as removed for a particular site. @param site the site. This parameter has to be formed as defined in the {@link ExtensionHttpSessions} class documentation. @param token the token
[ "Unmarks", "a", "default", "session", "token", "as", "removed", "for", "a", "particular", "site", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/httpsessions/ExtensionHttpSessions.java#L343-L350
SG-O/miIO
src/main/java/de/sg_o/app/miio/base/Device.java
Device.sendOk
public boolean sendOk(String method, Object params) throws CommandExecutionException { """ Send a command to a device. If no IP has been specified, this will try do discover a device on the network. @param method The method to execute on the device. @param params The command to execute on the device. Must be a J...
java
public boolean sendOk(String method, Object params) throws CommandExecutionException { return sendToArray(method, params).optString(0).toLowerCase().equals("ok"); }
[ "public", "boolean", "sendOk", "(", "String", "method", ",", "Object", "params", ")", "throws", "CommandExecutionException", "{", "return", "sendToArray", "(", "method", ",", "params", ")", ".", "optString", "(", "0", ")", ".", "toLowerCase", "(", ")", ".", ...
Send a command to a device. If no IP has been specified, this will try do discover a device on the network. @param method The method to execute on the device. @param params The command to execute on the device. Must be a JSONArray or JSONObject. @return True if a ok was received from the device. @throws CommandExecutio...
[ "Send", "a", "command", "to", "a", "device", ".", "If", "no", "IP", "has", "been", "specified", "this", "will", "try", "do", "discover", "a", "device", "on", "the", "network", "." ]
train
https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/base/Device.java#L402-L404
sculptor/sculptor
sculptor-eclipse/org.sculptor.dsl.ui/src/org/sculptor/dsl/ui/resource/MavenClasspathUriResolver.java
MavenClasspathUriResolver.findResourceInWorkspace
@Override protected URI findResourceInWorkspace(IJavaProject javaProject, URI classpathUri) throws CoreException { """ Before forwarding to {@link JdtClasspathUriResolver#findResourceInWorkspace(IJavaProject, URI)} this methods uses {@link #isMavenResourceDirectory(IPackageFragment)} to check if the given clas...
java
@Override protected URI findResourceInWorkspace(IJavaProject javaProject, URI classpathUri) throws CoreException { if (javaProject.exists()) { String packagePath = classpathUri.trimSegments(1).path(); String fileName = classpathUri.lastSegment(); IPath filePath = new Path(fileName); String packageName = ...
[ "@", "Override", "protected", "URI", "findResourceInWorkspace", "(", "IJavaProject", "javaProject", ",", "URI", "classpathUri", ")", "throws", "CoreException", "{", "if", "(", "javaProject", ".", "exists", "(", ")", ")", "{", "String", "packagePath", "=", "class...
Before forwarding to {@link JdtClasspathUriResolver#findResourceInWorkspace(IJavaProject, URI)} this methods uses {@link #isMavenResourceDirectory(IPackageFragment)} to check if the given classpath URI references a resource in an excluded Maven resource directory.
[ "Before", "forwarding", "to", "{" ]
train
https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-eclipse/org.sculptor.dsl.ui/src/org/sculptor/dsl/ui/resource/MavenClasspathUriResolver.java#L60-L81
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/HeapQuickSelectSketch.java
HeapQuickSelectSketch.heapifyInstance
static HeapQuickSelectSketch heapifyInstance(final Memory srcMem, final long seed) { """ Heapify a sketch from a Memory UpdateSketch or Union object containing sketch data. @param srcMem The source Memory object. <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> @param seed <a href="{@docRoot}/...
java
static HeapQuickSelectSketch heapifyInstance(final Memory srcMem, final long seed) { final int preambleLongs = extractPreLongs(srcMem); //byte 0 final int lgNomLongs = extractLgNomLongs(srcMem); //byte 3 final int lgArrLongs = extractLgArrLongs(srcMem); //byte 4 check...
[ "static", "HeapQuickSelectSketch", "heapifyInstance", "(", "final", "Memory", "srcMem", ",", "final", "long", "seed", ")", "{", "final", "int", "preambleLongs", "=", "extractPreLongs", "(", "srcMem", ")", ";", "//byte 0", "final", "int", "lgNomLongs", "=", "extr...
Heapify a sketch from a Memory UpdateSketch or Union object containing sketch data. @param srcMem The source Memory object. <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a> @return instance of this sketch
[ "Heapify", "a", "sketch", "from", "a", "Memory", "UpdateSketch", "or", "Union", "object", "containing", "sketch", "data", "." ]
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/HeapQuickSelectSketch.java#L97-L126
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
HtmlDocletWriter.addMethodInfo
private void addMethodInfo(ExecutableElement method, Content dl) { """ Add method information. @param method the method to be documented @param dl the content tree to which the method information will be added """ TypeElement enclosing = utils.getEnclosingTypeElement(method); List<? extends...
java
private void addMethodInfo(ExecutableElement method, Content dl) { TypeElement enclosing = utils.getEnclosingTypeElement(method); List<? extends TypeMirror> intfacs = enclosing.getInterfaces(); ExecutableElement overriddenMethod = utils.overriddenMethod(method); // Check whether there is...
[ "private", "void", "addMethodInfo", "(", "ExecutableElement", "method", ",", "Content", "dl", ")", "{", "TypeElement", "enclosing", "=", "utils", ".", "getEnclosingTypeElement", "(", "method", ")", ";", "List", "<", "?", "extends", "TypeMirror", ">", "intfacs", ...
Add method information. @param method the method to be documented @param dl the content tree to which the method information will be added
[ "Add", "method", "information", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L284-L302
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.setSecret
public SecretBundle setSecret(String vaultBaseUrl, String secretName, String value, Map<String, String> tags, String contentType, SecretAttributes secretAttributes) { """ Sets a secret in a specified key vault. The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key V...
java
public SecretBundle setSecret(String vaultBaseUrl, String secretName, String value, Map<String, String> tags, String contentType, SecretAttributes secretAttributes) { return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes).toBlocking().single().body(); ...
[ "public", "SecretBundle", "setSecret", "(", "String", "vaultBaseUrl", ",", "String", "secretName", ",", "String", "value", ",", "Map", "<", "String", ",", "String", ">", "tags", ",", "String", "contentType", ",", "SecretAttributes", "secretAttributes", ")", "{",...
Sets a secret in a specified key vault. The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. ...
[ "Sets", "a", "secret", "in", "a", "specified", "key", "vault", ".", "The", "SET", "operation", "adds", "a", "secret", "to", "the", "Azure", "Key", "Vault", ".", "If", "the", "named", "secret", "already", "exists", "Azure", "Key", "Vault", "creates", "a",...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3421-L3423
dihedron/dihedron-commons
src/main/java/org/dihedron/ui/ProgressArc.java
ProgressArc.setValue
public void setValue(int value) { """ Sets the current progress arc value. @param value the current value of the progress arc. """ if(value < min || value > max) { throw new IllegalArgumentException("The value " + value + " is out of the admitted range [" + min + ", " + max + "]."); } if(value !...
java
public void setValue(int value) { if(value < min || value > max) { throw new IllegalArgumentException("The value " + value + " is out of the admitted range [" + min + ", " + max + "]."); } if(value != min && value != max) { if(timer == null) { logger.trace("creating timer"); timer = new Timer(50, ...
[ "public", "void", "setValue", "(", "int", "value", ")", "{", "if", "(", "value", "<", "min", "||", "value", ">", "max", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The value \"", "+", "value", "+", "\" is out of the admitted range [\"", "+", ...
Sets the current progress arc value. @param value the current value of the progress arc.
[ "Sets", "the", "current", "progress", "arc", "value", "." ]
train
https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/ui/ProgressArc.java#L403-L426
networknt/light-4j
client/src/main/java/com/networknt/client/oauth/OauthHelper.java
OauthHelper.getKey
public static String getKey(KeyRequest keyRequest, String envTag) throws ClientException { """ Get the certificate from key distribution service of OAuth 2.0 provider with the kid. @param keyRequest One of the sub classes to get the key for access token or sign token. @param envTag the environment tag from the...
java
public static String getKey(KeyRequest keyRequest, String envTag) throws ClientException { final Http2Client client = Http2Client.getInstance(); final CountDownLatch latch = new CountDownLatch(1); final ClientConnection connection; try { if(keyRequest.getServerUrl() != null) ...
[ "public", "static", "String", "getKey", "(", "KeyRequest", "keyRequest", ",", "String", "envTag", ")", "throws", "ClientException", "{", "final", "Http2Client", "client", "=", "Http2Client", ".", "getInstance", "(", ")", ";", "final", "CountDownLatch", "latch", ...
Get the certificate from key distribution service of OAuth 2.0 provider with the kid. @param keyRequest One of the sub classes to get the key for access token or sign token. @param envTag the environment tag from the server.yml for the cluster lookup. @return String of the certificate @throws ClientException throw exc...
[ "Get", "the", "certificate", "from", "key", "distribution", "service", "of", "OAuth", "2", ".", "0", "provider", "with", "the", "kid", "." ]
train
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/oauth/OauthHelper.java#L386-L423
PistoiaHELM/HELM2NotationToolkit
src/main/java/org/helm/notation2/tools/FastaFormat.java
FastaFormat.generateElementsforRNA
protected static PolymerListElements generateElementsforRNA(String sequence, HELMEntity entity) throws FastaFormatException, NotationException, ChemistryException, NucleotideLoadingException { """ method to fill a rna polymer with its elements (MonomerNotationUnits) @param sequence rna sequence @param ent...
java
protected static PolymerListElements generateElementsforRNA(String sequence, HELMEntity entity) throws FastaFormatException, NotationException, ChemistryException, NucleotideLoadingException { initMapNucleotides(); initMapNucleotidesNaturalAnalog(); PolymerListElements elements = new PolymerListElements(en...
[ "protected", "static", "PolymerListElements", "generateElementsforRNA", "(", "String", "sequence", ",", "HELMEntity", "entity", ")", "throws", "FastaFormatException", ",", "NotationException", ",", "ChemistryException", ",", "NucleotideLoadingException", "{", "initMapNucleoti...
method to fill a rna polymer with its elements (MonomerNotationUnits) @param sequence rna sequence @param entity HELMEntity @return PolymerListElements @throws FastaFormatException if the input sequence is not correct @throws NotationException if notation is not valid @throws ChemistryException if chemistry engine can...
[ "method", "to", "fill", "a", "rna", "polymer", "with", "its", "elements", "(", "MonomerNotationUnits", ")" ]
train
https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/FastaFormat.java#L340-L361
DDTH/ddth-dao
ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java
BaseDao.getFromCache
@SuppressWarnings("unchecked") protected <T> T getFromCache(String cacheName, String key, Class<T> clazz) { """ Gets an entry from cache. <p> Note: if the object from cache is not assignable to clazz, <code>null</code> is returned. </p> @param cacheName @param key @param clazz @return """ ...
java
@SuppressWarnings("unchecked") protected <T> T getFromCache(String cacheName, String key, Class<T> clazz) { Object obj = getFromCache(cacheName, key); if (obj == null) { return null; } if (clazz.isAssignableFrom(obj.getClass())) { return (T) obj; } ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "<", "T", ">", "T", "getFromCache", "(", "String", "cacheName", ",", "String", "key", ",", "Class", "<", "T", ">", "clazz", ")", "{", "Object", "obj", "=", "getFromCache", "(", "cacheName", ...
Gets an entry from cache. <p> Note: if the object from cache is not assignable to clazz, <code>null</code> is returned. </p> @param cacheName @param key @param clazz @return
[ "Gets", "an", "entry", "from", "cache", "." ]
train
https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java#L233-L243
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.ortho2DLH
public Matrix4d ortho2DLH(double left, double right, double bottom, double top) { """ Apply an orthographic projection transformation for a left-handed coordinate system to this matrix. <p> This method is equivalent to calling {@link #orthoLH(double, double, double, double, double, double) orthoLH()} with <code...
java
public Matrix4d ortho2DLH(double left, double right, double bottom, double top) { return ortho2DLH(left, right, bottom, top, this); }
[ "public", "Matrix4d", "ortho2DLH", "(", "double", "left", ",", "double", "right", ",", "double", "bottom", ",", "double", "top", ")", "{", "return", "ortho2DLH", "(", "left", ",", "right", ",", "bottom", ",", "top", ",", "this", ")", ";", "}" ]
Apply an orthographic projection transformation for a left-handed coordinate system to this matrix. <p> This method is equivalent to calling {@link #orthoLH(double, double, double, double, double, double) orthoLH()} with <code>zNear=-1</code> and <code>zFar=+1</code>. <p> If <code>M</code> is <code>this</code> matrix a...
[ "Apply", "an", "orthographic", "projection", "transformation", "for", "a", "left", "-", "handed", "coordinate", "system", "to", "this", "matrix", ".", "<p", ">", "This", "method", "is", "equivalent", "to", "calling", "{", "@link", "#orthoLH", "(", "double", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10722-L10724
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.servlet.4.0/src/com/ibm/ws/webcontainer40/osgi/webapp/WebApp40.java
WebApp40.setInitParameter
@Override public boolean setInitParameter(String name, String value) throws IllegalStateException, IllegalArgumentException { """ /* Throw NPE if name is null @see com.ibm.ws.webcontainer.webapp.WebApp#setInitParameter(java.lang.String, java.lang.String) """ if (name == null) { logg...
java
@Override public boolean setInitParameter(String name, String value) throws IllegalStateException, IllegalArgumentException { if (name == null) { logger.logp(Level.SEVERE, CLASS_NAME, "setInitParameter", servlet40NLS.getString("name.is.null")); throw new java.lang.NullPointerExceptio...
[ "@", "Override", "public", "boolean", "setInitParameter", "(", "String", "name", ",", "String", "value", ")", "throws", "IllegalStateException", ",", "IllegalArgumentException", "{", "if", "(", "name", "==", "null", ")", "{", "logger", ".", "logp", "(", "Level...
/* Throw NPE if name is null @see com.ibm.ws.webcontainer.webapp.WebApp#setInitParameter(java.lang.String, java.lang.String)
[ "/", "*", "Throw", "NPE", "if", "name", "is", "null" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.4.0/src/com/ibm/ws/webcontainer40/osgi/webapp/WebApp40.java#L140-L148
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionCategoryPersistenceImpl.java
CPOptionCategoryPersistenceImpl.findByGroupId
@Override public List<CPOptionCategory> findByGroupId(long groupId) { """ Returns all the cp option categories where groupId = &#63;. @param groupId the group ID @return the matching cp option categories """ return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CPOptionCategory> findByGroupId(long groupId) { return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CPOptionCategory", ">", "findByGroupId", "(", "long", "groupId", ")", "{", "return", "findByGroupId", "(", "groupId", ",", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_POS", ",", "null", ")", ";", "}" ]
Returns all the cp option categories where groupId = &#63;. @param groupId the group ID @return the matching cp option categories
[ "Returns", "all", "the", "cp", "option", "categories", "where", "groupId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionCategoryPersistenceImpl.java#L1517-L1520
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.toListString
public static String toListString(Collection self, int maxSize) { """ Returns the string representation of the given list. The string displays the contents of the list, similar to a list literal, i.e. <code>[1, 2, a]</code>. @param self a Collection @param maxSize stop after approximately this many characte...
java
public static String toListString(Collection self, int maxSize) { return (self == null) ? "null" : InvokerHelper.toListString(self, maxSize); }
[ "public", "static", "String", "toListString", "(", "Collection", "self", ",", "int", "maxSize", ")", "{", "return", "(", "self", "==", "null", ")", "?", "\"null\"", ":", "InvokerHelper", ".", "toListString", "(", "self", ",", "maxSize", ")", ";", "}" ]
Returns the string representation of the given list. The string displays the contents of the list, similar to a list literal, i.e. <code>[1, 2, a]</code>. @param self a Collection @param maxSize stop after approximately this many characters and append '...' @return the string representation @since 1.7.3
[ "Returns", "the", "string", "representation", "of", "the", "given", "list", ".", "The", "string", "displays", "the", "contents", "of", "the", "list", "similar", "to", "a", "list", "literal", "i", ".", "e", ".", "<code", ">", "[", "1", "2", "a", "]", ...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L14912-L14914
jsonld-java/jsonld-java
core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java
JsonLdApi.removeEmbed
private static void removeEmbed(FramingContext state, String id) { """ Removes an existing embed. @param state the current framing state. @param id the @id of the embed to remove. """ // get existing embed final Map<String, EmbedNode> links = state.uniqueEmbeds; final EmbedNode em...
java
private static void removeEmbed(FramingContext state, String id) { // get existing embed final Map<String, EmbedNode> links = state.uniqueEmbeds; final EmbedNode embed = links.get(id); final Object parent = embed.parent; final String property = embed.property; // create ...
[ "private", "static", "void", "removeEmbed", "(", "FramingContext", "state", ",", "String", "id", ")", "{", "// get existing embed", "final", "Map", "<", "String", ",", "EmbedNode", ">", "links", "=", "state", ".", "uniqueEmbeds", ";", "final", "EmbedNode", "em...
Removes an existing embed. @param state the current framing state. @param id the @id of the embed to remove.
[ "Removes", "an", "existing", "embed", "." ]
train
https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/core/JsonLdApi.java#L1651-L1679
primefaces/primefaces
src/main/java/org/primefaces/application/exceptionhandler/PrimeExceptionHandler.java
PrimeExceptionHandler.findHandlerComponent
protected AjaxExceptionHandler findHandlerComponent(FacesContext context, Throwable rootCause) { """ Finds the proper {@link AjaxExceptionHandler} for the given {@link Throwable}. @param context The {@link FacesContext}. @param rootCause The occurred {@link Throwable}. @return The {@link AjaxExceptionHandler}...
java
protected AjaxExceptionHandler findHandlerComponent(FacesContext context, Throwable rootCause) { AjaxExceptionHandlerVisitCallback visitCallback = new AjaxExceptionHandlerVisitCallback(rootCause); context.getViewRoot().visitTree(VisitContext.createVisitContext(context), visitCallback); Map<Str...
[ "protected", "AjaxExceptionHandler", "findHandlerComponent", "(", "FacesContext", "context", ",", "Throwable", "rootCause", ")", "{", "AjaxExceptionHandlerVisitCallback", "visitCallback", "=", "new", "AjaxExceptionHandlerVisitCallback", "(", "rootCause", ")", ";", "context", ...
Finds the proper {@link AjaxExceptionHandler} for the given {@link Throwable}. @param context The {@link FacesContext}. @param rootCause The occurred {@link Throwable}. @return The {@link AjaxExceptionHandler} or <code>null</code>.
[ "Finds", "the", "proper", "{", "@link", "AjaxExceptionHandler", "}", "for", "the", "given", "{", "@link", "Throwable", "}", "." ]
train
https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/application/exceptionhandler/PrimeExceptionHandler.java#L282-L307
alkacon/opencms-core
src/org/opencms/workplace/tools/CmsToolManager.java
CmsToolManager.repairPath
private String repairPath(CmsWorkplace wp, String path) { """ Given a string a valid and visible tool path is computed.<p> @param wp the workplace object @param path the path to repair @return a valid and visible tool path """ String rootKey = getCurrentRoot(wp).getKey(); // navigate un...
java
private String repairPath(CmsWorkplace wp, String path) { String rootKey = getCurrentRoot(wp).getKey(); // navigate until to reach a valid path while (!validatePath(rootKey, path, true)) { // log failure LOG.warn(Messages.get().getBundle().key(Messages.LOG_MISSING_ADMIN_...
[ "private", "String", "repairPath", "(", "CmsWorkplace", "wp", ",", "String", "path", ")", "{", "String", "rootKey", "=", "getCurrentRoot", "(", "wp", ")", ".", "getKey", "(", ")", ";", "// navigate until to reach a valid path", "while", "(", "!", "validatePath",...
Given a string a valid and visible tool path is computed.<p> @param wp the workplace object @param path the path to repair @return a valid and visible tool path
[ "Given", "a", "string", "a", "valid", "and", "visible", "tool", "path", "is", "computed", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsToolManager.java#L792-L822
hawkular/hawkular-agent
hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/InfinispanJBossASClient.java
InfinispanJBossASClient.isLocalCache
public boolean isLocalCache(String cacheContainerName, String localCacheName) throws Exception { """ Checks to see if there is already a local cache with the given name. @param cacheContainerName the parent container @param localCacheName the name to check @return true if there is a local cache with the given...
java
public boolean isLocalCache(String cacheContainerName, String localCacheName) throws Exception { if (!isCacheContainer(cacheContainerName)) { return false; } Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_INFINISPAN, CACHE_CONTAINER, cacheContainerName); String hayst...
[ "public", "boolean", "isLocalCache", "(", "String", "cacheContainerName", ",", "String", "localCacheName", ")", "throws", "Exception", "{", "if", "(", "!", "isCacheContainer", "(", "cacheContainerName", ")", ")", "{", "return", "false", ";", "}", "Address", "add...
Checks to see if there is already a local cache with the given name. @param cacheContainerName the parent container @param localCacheName the name to check @return true if there is a local cache with the given name already in existence @throws Exception any error
[ "Checks", "to", "see", "if", "there", "is", "already", "a", "local", "cache", "with", "the", "given", "name", "." ]
train
https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/InfinispanJBossASClient.java#L59-L67
xdcrafts/flower
flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java
MapDotApi.dotGetNullable
public static <T> T dotGetNullable(final Map map, final Class<T> clazz, final String pathString) { """ Walks by map's nodes and extracts optional value of type T. @param <T> value type @param clazz type of value @param map subject @param pathString nodes to walk in map @return value of type T """ ...
java
public static <T> T dotGetNullable(final Map map, final Class<T> clazz, final String pathString) { if (pathString == null || pathString.isEmpty()) { throw new IllegalArgumentException(PATH_MUST_BE_SPECIFIED); } if (!pathString.contains(SEPARATOR)) { return (T) map.get(pat...
[ "public", "static", "<", "T", ">", "T", "dotGetNullable", "(", "final", "Map", "map", ",", "final", "Class", "<", "T", ">", "clazz", ",", "final", "String", "pathString", ")", "{", "if", "(", "pathString", "==", "null", "||", "pathString", ".", "isEmpt...
Walks by map's nodes and extracts optional value of type T. @param <T> value type @param clazz type of value @param map subject @param pathString nodes to walk in map @return value of type T
[ "Walks", "by", "map", "s", "nodes", "and", "extracts", "optional", "value", "of", "type", "T", "." ]
train
https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L70-L79
opsmatters/newrelic-api
src/main/java/com/opsmatters/newrelic/api/httpclient/GsonMessageBodyHandler.java
GsonMessageBodyHandler.getAppropriateType
private Type getAppropriateType(Class<?> type, Type genericType) { """ Returns the type of the given class. @param type The class to get the type for @param genericType The type to use if the input class is a generic type @return The type of the given class """ return type.equals(genericType) ? ...
java
private Type getAppropriateType(Class<?> type, Type genericType) { return type.equals(genericType) ? type : genericType; }
[ "private", "Type", "getAppropriateType", "(", "Class", "<", "?", ">", "type", ",", "Type", "genericType", ")", "{", "return", "type", ".", "equals", "(", "genericType", ")", "?", "type", ":", "genericType", ";", "}" ]
Returns the type of the given class. @param type The class to get the type for @param genericType The type to use if the input class is a generic type @return The type of the given class
[ "Returns", "the", "type", "of", "the", "given", "class", "." ]
train
https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/httpclient/GsonMessageBodyHandler.java#L395-L398
line/armeria
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java
AnnotatedHttpServiceFactory.userDefinedDecorator
@Nullable private static DecoratorAndOrder userDefinedDecorator(Annotation annotation) { """ Returns a decorator with its order if the specified {@code annotation} is one of the user-defined decorator annotation. """ // User-defined decorator MUST be annotated with @DecoratorFactory annotation. ...
java
@Nullable private static DecoratorAndOrder userDefinedDecorator(Annotation annotation) { // User-defined decorator MUST be annotated with @DecoratorFactory annotation. final DecoratorFactory d = findFirstDeclared(annotation.annotationType(), DecoratorFactory.class).orElse(null); ...
[ "@", "Nullable", "private", "static", "DecoratorAndOrder", "userDefinedDecorator", "(", "Annotation", "annotation", ")", "{", "// User-defined decorator MUST be annotated with @DecoratorFactory annotation.", "final", "DecoratorFactory", "d", "=", "findFirstDeclared", "(", "annota...
Returns a decorator with its order if the specified {@code annotation} is one of the user-defined decorator annotation.
[ "Returns", "a", "decorator", "with", "its", "order", "if", "the", "specified", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java#L676-L705
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java
InternalTextureLoader.getTexture
public Texture getTexture(File source, boolean flipped,int filter) throws IOException { """ Get a texture from a specific file @param source The file to load the texture from @param flipped True if we should flip the texture on the y axis while loading @param filter The filter to use @return The texture load...
java
public Texture getTexture(File source, boolean flipped,int filter) throws IOException { String resourceName = source.getAbsolutePath(); InputStream in = new FileInputStream(source); return getTexture(in, resourceName, flipped, filter, null); }
[ "public", "Texture", "getTexture", "(", "File", "source", ",", "boolean", "flipped", ",", "int", "filter", ")", "throws", "IOException", "{", "String", "resourceName", "=", "source", ".", "getAbsolutePath", "(", ")", ";", "InputStream", "in", "=", "new", "Fi...
Get a texture from a specific file @param source The file to load the texture from @param flipped True if we should flip the texture on the y axis while loading @param filter The filter to use @return The texture loaded @throws IOException Indicates a failure to load the image
[ "Get", "a", "texture", "from", "a", "specific", "file" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java#L135-L140
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Asserter.java
Asserter.assertCurrentActivity
public void assertCurrentActivity(String message, String name, boolean isNewInstance) { """ Asserts that an expected {@link Activity} is currently active one, with the possibility to verify that the expected {@code Activity} is a new instance of the {@code Activity}. @param message the message that should be d...
java
public void assertCurrentActivity(String message, String name, boolean isNewInstance) { assertCurrentActivity(message, name); Activity activity = activityUtils.getCurrentActivity(); if(activity != null){ assertCurrentActivity(message, activity.getClass(), isNewInstance); } }
[ "public", "void", "assertCurrentActivity", "(", "String", "message", ",", "String", "name", ",", "boolean", "isNewInstance", ")", "{", "assertCurrentActivity", "(", "message", ",", "name", ")", ";", "Activity", "activity", "=", "activityUtils", ".", "getCurrentAct...
Asserts that an expected {@link Activity} is currently active one, with the possibility to verify that the expected {@code Activity} is a new instance of the {@code Activity}. @param message the message that should be displayed if the assert fails @param name the name of the {@code Activity} that is expected to be act...
[ "Asserts", "that", "an", "expected", "{", "@link", "Activity", "}", "is", "currently", "active", "one", "with", "the", "possibility", "to", "verify", "that", "the", "expected", "{", "@code", "Activity", "}", "is", "a", "new", "instance", "of", "the", "{", ...
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Asserter.java#L85-L92
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/transform/condition/BooleanCondition.java
BooleanCondition.XOR
public static Condition XOR(Condition first, Condition second) { """ And of all the given conditions @param first the first condition @param second the second condition for xor @return the xor of these 2 conditions """ return new BooleanCondition(Type.XOR, first, second); }
java
public static Condition XOR(Condition first, Condition second) { return new BooleanCondition(Type.XOR, first, second); }
[ "public", "static", "Condition", "XOR", "(", "Condition", "first", ",", "Condition", "second", ")", "{", "return", "new", "BooleanCondition", "(", "Type", ".", "XOR", ",", "first", ",", "second", ")", ";", "}" ]
And of all the given conditions @param first the first condition @param second the second condition for xor @return the xor of these 2 conditions
[ "And", "of", "all", "the", "given", "conditions" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/condition/BooleanCondition.java#L296-L298
JakeWharton/NineOldAndroids
library/src/com/nineoldandroids/animation/AnimatorInflater.java
AnimatorInflater.loadAnimator
public static Animator loadAnimator(Context context, int id) throws NotFoundException { """ Loads an {@link Animator} object from a resource @param context Application context used to access resources @param id The resource id of the animation to load @return The animator object reference by the s...
java
public static Animator loadAnimator(Context context, int id) throws NotFoundException { XmlResourceParser parser = null; try { parser = context.getResources().getAnimation(id); return createAnimatorFromXml(context, parser); } catch (XmlPullParserException ex)...
[ "public", "static", "Animator", "loadAnimator", "(", "Context", "context", ",", "int", "id", ")", "throws", "NotFoundException", "{", "XmlResourceParser", "parser", "=", "null", ";", "try", "{", "parser", "=", "context", ".", "getResources", "(", ")", ".", "...
Loads an {@link Animator} object from a resource @param context Application context used to access resources @param id The resource id of the animation to load @return The animator object reference by the specified id @throws android.content.res.Resources.NotFoundException when the animation cannot be loaded
[ "Loads", "an", "{", "@link", "Animator", "}", "object", "from", "a", "resource" ]
train
https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/AnimatorInflater.java#L94-L116
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtensionRepository.java
DefaultInstalledExtensionRepository.removeInstalledFeature
private void removeInstalledFeature(String feature, String namespace) { """ Uninstall provided extension. @param feature the feature to uninstall @param namespace the namespace @see #uninstallExtension(LocalExtension, String) """ // Extensions namespaces by feature if (namespace == null) ...
java
private void removeInstalledFeature(String feature, String namespace) { // Extensions namespaces by feature if (namespace == null) { this.extensionNamespaceByFeature.remove(feature); } else { Map<String, InstalledFeature> namespaceInstalledExtension = this.extensionN...
[ "private", "void", "removeInstalledFeature", "(", "String", "feature", ",", "String", "namespace", ")", "{", "// Extensions namespaces by feature", "if", "(", "namespace", "==", "null", ")", "{", "this", ".", "extensionNamespaceByFeature", ".", "remove", "(", "featu...
Uninstall provided extension. @param feature the feature to uninstall @param namespace the namespace @see #uninstallExtension(LocalExtension, String)
[ "Uninstall", "provided", "extension", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtensionRepository.java#L452-L463
fflewddur/hola
src/main/java/net/straylightlabs/hola/sd/Query.java
Query.runOnceOn
public Set<Instance> runOnceOn(InetAddress localhost) throws IOException { """ Synchronously runs the Query a single time. @param localhost address of the network interface to listen on @return a list of Instances that match this Query @throws IOException thrown on socket and network errors """ lo...
java
public Set<Instance> runOnceOn(InetAddress localhost) throws IOException { logger.debug("Running query on {}", localhost); initialQuestion = new Question(service, domain); instances = Collections.synchronizedSet(new HashSet<>()); try { Thread listener = null; if (...
[ "public", "Set", "<", "Instance", ">", "runOnceOn", "(", "InetAddress", "localhost", ")", "throws", "IOException", "{", "logger", ".", "debug", "(", "\"Running query on {}\"", ",", "localhost", ")", ";", "initialQuestion", "=", "new", "Question", "(", "service",...
Synchronously runs the Query a single time. @param localhost address of the network interface to listen on @return a list of Instances that match this Query @throws IOException thrown on socket and network errors
[ "Synchronously", "runs", "the", "Query", "a", "single", "time", "." ]
train
https://github.com/fflewddur/hola/blob/08d9b9f3b807fd447181a5c1122f117a950db848/src/main/java/net/straylightlabs/hola/sd/Query.java#L126-L151
js-lib-com/template.xhtml
src/main/java/js/template/xhtml/Serializer.java
Serializer.execOperator
@SuppressWarnings("unchecked") private <T> T execOperator(Element element, Object scope, Meta meta, Format... format) throws IOException { """ Helper method for operator execution. @param element @param scope @param meta @return operator specific value, cast to any type or null. @throws IOException if und...
java
@SuppressWarnings("unchecked") private <T> T execOperator(Element element, Object scope, Meta meta, Format... format) throws IOException { Operator operator = factory.geInstance(meta.opcode); return (T) operator.exec(element, scope, meta.operand, format.length == 1 ? format[0] : null); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "T", ">", "T", "execOperator", "(", "Element", "element", ",", "Object", "scope", ",", "Meta", "meta", ",", "Format", "...", "format", ")", "throws", "IOException", "{", "Operator", "operato...
Helper method for operator execution. @param element @param scope @param meta @return operator specific value, cast to any type or null. @throws IOException if underlying writer fails to write.
[ "Helper", "method", "for", "operator", "execution", "." ]
train
https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/Serializer.java#L302-L306
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java
SymmetryTools.getQuaternarySymmetry
public static QuatSymmetryResults getQuaternarySymmetry(CeSymmResult result) throws StructureException { """ Given a symmetry result, it calculates the overall global symmetry, factoring out the alignment and detection steps of {@link QuatSymmetryDetector} algorithm. @param result symmetry result @return...
java
public static QuatSymmetryResults getQuaternarySymmetry(CeSymmResult result) throws StructureException { // Obtain the subunits of the repeats List<Atom[]> atoms = toRepeatsAlignment(result).getAtomArrays(); List<Subunit> subunits = atoms.stream() .map(a -> new Subunit(a, null, null, null)) .collect(C...
[ "public", "static", "QuatSymmetryResults", "getQuaternarySymmetry", "(", "CeSymmResult", "result", ")", "throws", "StructureException", "{", "// Obtain the subunits of the repeats", "List", "<", "Atom", "[", "]", ">", "atoms", "=", "toRepeatsAlignment", "(", "result", "...
Given a symmetry result, it calculates the overall global symmetry, factoring out the alignment and detection steps of {@link QuatSymmetryDetector} algorithm. @param result symmetry result @return global symmetry results @throws StructureException
[ "Given", "a", "symmetry", "result", "it", "calculates", "the", "overall", "global", "symmetry", "factoring", "out", "the", "alignment", "and", "detection", "steps", "of", "{", "@link", "QuatSymmetryDetector", "}", "algorithm", "." ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/SymmetryTools.java#L705-L726
remkop/picocli
src/main/java/picocli/CommandLine.java
CommandLine.printVersionHelp
public void printVersionHelp(PrintStream out, Help.Ansi ansi) { """ Prints version information from the {@link Command#version()} annotation to the specified {@code PrintStream}. Each element of the array of version strings is printed on a separate line. Version strings may contain <a href="http://picocli.info/#...
java
public void printVersionHelp(PrintStream out, Help.Ansi ansi) { for (String versionInfo : getCommandSpec().version()) { out.println(ansi.new Text(versionInfo)); } out.flush(); }
[ "public", "void", "printVersionHelp", "(", "PrintStream", "out", ",", "Help", ".", "Ansi", "ansi", ")", "{", "for", "(", "String", "versionInfo", ":", "getCommandSpec", "(", ")", ".", "version", "(", ")", ")", "{", "out", ".", "println", "(", "ansi", "...
Prints version information from the {@link Command#version()} annotation to the specified {@code PrintStream}. Each element of the array of version strings is printed on a separate line. Version strings may contain <a href="http://picocli.info/#_usage_help_with_styles_and_colors">markup for colors and style</a>. @param...
[ "Prints", "version", "information", "from", "the", "{" ]
train
https://github.com/remkop/picocli/blob/3c5384f0d12817401d1921c3013c1282e2edcab2/src/main/java/picocli/CommandLine.java#L2209-L2214
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/MediaservicesInner.java
MediaservicesInner.syncStorageKeysAsync
public Observable<Void> syncStorageKeysAsync(String resourceGroupName, String accountName) { """ Synchronizes Storage Account Keys. Synchronizes storage account keys for a storage account associated with the Media Service account. @param resourceGroupName The name of the resource group within the Azure subscri...
java
public Observable<Void> syncStorageKeysAsync(String resourceGroupName, String accountName) { return syncStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { ...
[ "public", "Observable", "<", "Void", ">", "syncStorageKeysAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ")", "{", "return", "syncStorageKeysWithServiceResponseAsync", "(", "resourceGroupName", ",", "accountName", ")", ".", "map", "(", "new"...
Synchronizes Storage Account Keys. Synchronizes storage account keys for a storage account associated with the Media Service account. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @throws IllegalArgumentException thrown if par...
[ "Synchronizes", "Storage", "Account", "Keys", ".", "Synchronizes", "storage", "account", "keys", "for", "a", "storage", "account", "associated", "with", "the", "Media", "Service", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/MediaservicesInner.java#L644-L651
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/RepositoryManager.java
RepositoryManager.addRepository
private void addRepository(String repositoryId, RepositoryWrapper repositoryHolder) { """ Pair adding to the repositories map and resetting the numRepos int. @param repositoryId @param repositoryHolder """ repositories.put(repositoryId, repositoryHolder); try { numRepos = getNum...
java
private void addRepository(String repositoryId, RepositoryWrapper repositoryHolder) { repositories.put(repositoryId, repositoryHolder); try { numRepos = getNumberOfRepositories(); } catch (WIMException e) { // okay } }
[ "private", "void", "addRepository", "(", "String", "repositoryId", ",", "RepositoryWrapper", "repositoryHolder", ")", "{", "repositories", ".", "put", "(", "repositoryId", ",", "repositoryHolder", ")", ";", "try", "{", "numRepos", "=", "getNumberOfRepositories", "("...
Pair adding to the repositories map and resetting the numRepos int. @param repositoryId @param repositoryHolder
[ "Pair", "adding", "to", "the", "repositories", "map", "and", "resetting", "the", "numRepos", "int", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/RepositoryManager.java#L77-L84
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/spi/impl/proxyservice/impl/ProxyRegistry.java
ProxyRegistry.getOrCreateProxy
public DistributedObject getOrCreateProxy(String name, boolean publishEvent) { """ Retrieves a DistributedObject proxy or creates it if it is not available. DistributedObject will be initialized by calling {@link InitializingObject#initialize()}, if it implements {@link InitializingObject}. @param name ...
java
public DistributedObject getOrCreateProxy(String name, boolean publishEvent) { DistributedObjectFuture proxyFuture = getOrCreateProxyFuture(name, publishEvent, true); return proxyFuture.get(); }
[ "public", "DistributedObject", "getOrCreateProxy", "(", "String", "name", ",", "boolean", "publishEvent", ")", "{", "DistributedObjectFuture", "proxyFuture", "=", "getOrCreateProxyFuture", "(", "name", ",", "publishEvent", ",", "true", ")", ";", "return", "proxyFuture...
Retrieves a DistributedObject proxy or creates it if it is not available. DistributedObject will be initialized by calling {@link InitializingObject#initialize()}, if it implements {@link InitializingObject}. @param name The name of the DistributedObject proxy object to retrieve or create. @param publishEvent ...
[ "Retrieves", "a", "DistributedObject", "proxy", "or", "creates", "it", "if", "it", "is", "not", "available", ".", "DistributedObject", "will", "be", "initialized", "by", "calling", "{", "@link", "InitializingObject#initialize", "()", "}", "if", "it", "implements",...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/proxyservice/impl/ProxyRegistry.java#L159-L162
pawelprazak/java-extended
hamcrest/src/main/java/com/bluecatcode/hamcrest/matchers/IsThrowable.java
IsThrowable.withCause
@Factory public static <T extends Throwable, C extends Throwable> Matcher<T> withCause(final Matcher<C> matcher) { """ Matches if value is a throwable with a cause that matches the <tt>matcher</tt> @param matcher cause matcher @param <T> the throwable type @param <C> the cause throwable type @return the ...
java
@Factory public static <T extends Throwable, C extends Throwable> Matcher<T> withCause(final Matcher<C> matcher) { return new CustomTypeSafeMatcher<T>(CustomMatchers.fixedDescription("cause ", matcher)) { @Override protected boolean matchesSafely(T item) { return matc...
[ "@", "Factory", "public", "static", "<", "T", "extends", "Throwable", ",", "C", "extends", "Throwable", ">", "Matcher", "<", "T", ">", "withCause", "(", "final", "Matcher", "<", "C", ">", "matcher", ")", "{", "return", "new", "CustomTypeSafeMatcher", "<", ...
Matches if value is a throwable with a cause that matches the <tt>matcher</tt> @param matcher cause matcher @param <T> the throwable type @param <C> the cause throwable type @return the matcher
[ "Matches", "if", "value", "is", "a", "throwable", "with", "a", "cause", "that", "matches", "the", "<tt", ">", "matcher<", "/", "tt", ">" ]
train
https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/hamcrest/src/main/java/com/bluecatcode/hamcrest/matchers/IsThrowable.java#L98-L110
anotheria/configureme
src/main/java/org/configureme/util/IOUtils.java
IOUtils.readFileBufferedAsString
public static String readFileBufferedAsString(final File file, final String charset) throws IOException { """ <p>readFileBufferedAsString.</p> @param file a {@link java.io.File} object. @param charset a {@link java.lang.String} object. @return a {@link java.lang.String} object. @throws java.io.IOException if...
java
public static String readFileBufferedAsString(final File file, final String charset) throws IOException { return readInputStreamBufferedAsString(new FileInputStream(file), charset); }
[ "public", "static", "String", "readFileBufferedAsString", "(", "final", "File", "file", ",", "final", "String", "charset", ")", "throws", "IOException", "{", "return", "readInputStreamBufferedAsString", "(", "new", "FileInputStream", "(", "file", ")", ",", "charset"...
<p>readFileBufferedAsString.</p> @param file a {@link java.io.File} object. @param charset a {@link java.lang.String} object. @return a {@link java.lang.String} object. @throws java.io.IOException if any.
[ "<p", ">", "readFileBufferedAsString", ".", "<", "/", "p", ">" ]
train
https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/util/IOUtils.java#L149-L151
mcxiaoke/Android-Next
recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java
HeaderFooterRecyclerAdapter.notifyHeaderItemRangeInserted
public final void notifyHeaderItemRangeInserted(int positionStart, int itemCount) { """ Notifies that multiple header items are inserted. @param positionStart the position. @param itemCount the item count. """ int newHeaderItemCount = getHeaderItemCount(); if (positionStart < 0 || itemC...
java
public final void notifyHeaderItemRangeInserted(int positionStart, int itemCount) { int newHeaderItemCount = getHeaderItemCount(); if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > newHeaderItemCount) { throw new IndexOutOfBoundsException("The given range [" + positionSta...
[ "public", "final", "void", "notifyHeaderItemRangeInserted", "(", "int", "positionStart", ",", "int", "itemCount", ")", "{", "int", "newHeaderItemCount", "=", "getHeaderItemCount", "(", ")", ";", "if", "(", "positionStart", "<", "0", "||", "itemCount", "<", "0", ...
Notifies that multiple header items are inserted. @param positionStart the position. @param itemCount the item count.
[ "Notifies", "that", "multiple", "header", "items", "are", "inserted", "." ]
train
https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L132-L138
Azure/azure-sdk-for-java
privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java
VirtualNetworkLinksInner.beginCreateOrUpdate
public VirtualNetworkLinkInner beginCreateOrUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) { """ Creates or updates a virtual network link to the specified Private DNS zone. @param resourceGroupName ...
java
public VirtualNetworkLinkInner beginCreateOrUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkN...
[ "public", "VirtualNetworkLinkInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "privateZoneName", ",", "String", "virtualNetworkLinkName", ",", "VirtualNetworkLinkInner", "parameters", ",", "String", "ifMatch", ",", "String", "ifNoneMatch", "...
Creates or updates a virtual network link to the specified Private DNS zone. @param resourceGroupName The name of the resource group. @param privateZoneName The name of the Private DNS zone (without a terminating dot). @param virtualNetworkLinkName The name of the virtual network link. @param parameters Parameters sup...
[ "Creates", "or", "updates", "a", "virtual", "network", "link", "to", "the", "specified", "Private", "DNS", "zone", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java#L390-L392
alkacon/opencms-core
src-modules/org/opencms/workplace/list/A_CmsListDialog.java
A_CmsListDialog.getListObject
public static CmsHtmlList getListObject(Class<?> listDialog, CmsWorkplaceSettings settings) { """ Returns the list object for the given list dialog, or <code>null</code> if no list object has been set.<p> @param listDialog the list dialog class @param settings the wp settings for accessing the session @ret...
java
public static CmsHtmlList getListObject(Class<?> listDialog, CmsWorkplaceSettings settings) { return getListObjectMap(settings).get(listDialog.getName()); }
[ "public", "static", "CmsHtmlList", "getListObject", "(", "Class", "<", "?", ">", "listDialog", ",", "CmsWorkplaceSettings", "settings", ")", "{", "return", "getListObjectMap", "(", "settings", ")", ".", "get", "(", "listDialog", ".", "getName", "(", ")", ")", ...
Returns the list object for the given list dialog, or <code>null</code> if no list object has been set.<p> @param listDialog the list dialog class @param settings the wp settings for accessing the session @return the list object for this list dialog, or <code>null</code>
[ "Returns", "the", "list", "object", "for", "the", "given", "list", "dialog", "or", "<code", ">", "null<", "/", "code", ">", "if", "no", "list", "object", "has", "been", "set", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/A_CmsListDialog.java#L296-L299
getsentry/sentry-java
sentry/src/main/java/io/sentry/SentryUncaughtExceptionHandler.java
SentryUncaughtExceptionHandler.uncaughtException
@Override public void uncaughtException(Thread thread, Throwable thrown) { """ Sends any uncaught exception to Sentry, then passes the exception on to the pre-existing uncaught exception handler. @param thread thread that threw the error @param thrown the uncaught throwable """ if (enabled) { ...
java
@Override public void uncaughtException(Thread thread, Throwable thrown) { if (enabled) { logger.trace("Uncaught exception received."); EventBuilder eventBuilder = new EventBuilder() .withMessage(thrown.getMessage()) .withLevel(Event.Level.FATAL) ...
[ "@", "Override", "public", "void", "uncaughtException", "(", "Thread", "thread", ",", "Throwable", "thrown", ")", "{", "if", "(", "enabled", ")", "{", "logger", ".", "trace", "(", "\"Uncaught exception received.\"", ")", ";", "EventBuilder", "eventBuilder", "=",...
Sends any uncaught exception to Sentry, then passes the exception on to the pre-existing uncaught exception handler. @param thread thread that threw the error @param thrown the uncaught throwable
[ "Sends", "any", "uncaught", "exception", "to", "Sentry", "then", "passes", "the", "exception", "on", "to", "the", "pre", "-", "existing", "uncaught", "exception", "handler", "." ]
train
https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/SentryUncaughtExceptionHandler.java#L44-L71
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.listCompositeEntities
public List<CompositeEntityExtractor> listCompositeEntities(UUID appId, String versionId, ListCompositeEntitiesOptionalParameter listCompositeEntitiesOptionalParameter) { """ Gets information about the composite entity models. @param appId The application ID. @param versionId The version ID. @param listCompos...
java
public List<CompositeEntityExtractor> listCompositeEntities(UUID appId, String versionId, ListCompositeEntitiesOptionalParameter listCompositeEntitiesOptionalParameter) { return listCompositeEntitiesWithServiceResponseAsync(appId, versionId, listCompositeEntitiesOptionalParameter).toBlocking().single().body(); ...
[ "public", "List", "<", "CompositeEntityExtractor", ">", "listCompositeEntities", "(", "UUID", "appId", ",", "String", "versionId", ",", "ListCompositeEntitiesOptionalParameter", "listCompositeEntitiesOptionalParameter", ")", "{", "return", "listCompositeEntitiesWithServiceRespons...
Gets information about the composite entity models. @param appId The application ID. @param versionId The version ID. @param listCompositeEntitiesOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation...
[ "Gets", "information", "about", "the", "composite", "entity", "models", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L1643-L1645
JodaOrg/joda-time
src/main/java/org/joda/time/field/RemainderDateTimeField.java
RemainderDateTimeField.addWrapField
public long addWrapField(long instant, int amount) { """ Add the specified amount to the specified time instant, wrapping around within the remainder range if necessary. The amount added may be negative. @param instant the time instant in millis to update. @param amount the amount to add (can be negative)....
java
public long addWrapField(long instant, int amount) { return set(instant, FieldUtils.getWrappedValue(get(instant), amount, 0, iDivisor - 1)); }
[ "public", "long", "addWrapField", "(", "long", "instant", ",", "int", "amount", ")", "{", "return", "set", "(", "instant", ",", "FieldUtils", ".", "getWrappedValue", "(", "get", "(", "instant", ")", ",", "amount", ",", "0", ",", "iDivisor", "-", "1", "...
Add the specified amount to the specified time instant, wrapping around within the remainder range if necessary. The amount added may be negative. @param instant the time instant in millis to update. @param amount the amount to add (can be negative). @return the updated time instant.
[ "Add", "the", "specified", "amount", "to", "the", "specified", "time", "instant", "wrapping", "around", "within", "the", "remainder", "range", "if", "necessary", ".", "The", "amount", "added", "may", "be", "negative", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/RemainderDateTimeField.java#L153-L155
agmip/ace-core
src/main/java/org/agmip/ace/io/AceGenerator.java
AceGenerator.generateACEB
public static void generateACEB(File dest, String json) throws IOException { """ Write a GZIP compressed string to a file. <p> This method GZIP compresses a string and writes it to a file. This method automatically closes the OutputStream used to create the file. @param dest Destination {@link File} @param ...
java
public static void generateACEB(File dest, String json) throws IOException { FileOutputStream fos = new FileOutputStream(dest); GZIPOutputStream gos = new GZIPOutputStream(fos); gos.write(json.getBytes("UTF-8")); gos.close(); fos.close(); }
[ "public", "static", "void", "generateACEB", "(", "File", "dest", ",", "String", "json", ")", "throws", "IOException", "{", "FileOutputStream", "fos", "=", "new", "FileOutputStream", "(", "dest", ")", ";", "GZIPOutputStream", "gos", "=", "new", "GZIPOutputStream"...
Write a GZIP compressed string to a file. <p> This method GZIP compresses a string and writes it to a file. This method automatically closes the OutputStream used to create the file. @param dest Destination {@link File} @param json String to GZIP compress and write. @throws IOException if there is an I/O error
[ "Write", "a", "GZIP", "compressed", "string", "to", "a", "file", ".", "<p", ">", "This", "method", "GZIP", "compresses", "a", "string", "and", "writes", "it", "to", "a", "file", ".", "This", "method", "automatically", "closes", "the", "OutputStream", "used...
train
https://github.com/agmip/ace-core/blob/51957e79b4567d0083c52d0720f4a268c3a02f44/src/main/java/org/agmip/ace/io/AceGenerator.java#L127-L134
alkacon/opencms-core
src/org/opencms/ade/configuration/CmsADEManager.java
CmsADEManager.saveElementList
private void saveElementList(CmsObject cms, List<CmsContainerElementBean> elementList, String listKey) throws CmsException { """ Saves an element list to the user additional infos.<p> @param cms the cms context @param elementList the element list @param listKey the list key @throws CmsException if some...
java
private void saveElementList(CmsObject cms, List<CmsContainerElementBean> elementList, String listKey) throws CmsException { // limit the favorite list size to avoid the additional info size limit if (elementList.size() > DEFAULT_ELEMENT_LIST_SIZE) { elementList = elementList.subList(0,...
[ "private", "void", "saveElementList", "(", "CmsObject", "cms", ",", "List", "<", "CmsContainerElementBean", ">", "elementList", ",", "String", "listKey", ")", "throws", "CmsException", "{", "// limit the favorite list size to avoid the additional info size limit", "if", "("...
Saves an element list to the user additional infos.<p> @param cms the cms context @param elementList the element list @param listKey the list key @throws CmsException if something goes wrong
[ "Saves", "an", "element", "list", "to", "the", "user", "additional", "infos", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L1485-L1506
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/dataformats/json/jackson/DefaultFeature.java
DefaultFeature.addProperty
public void addProperty(String propertyName, Object value) { """ The name of the property to add. if it already exists, the value is updated. If the propertyname is null, the property addition is ignored. @param propertyName the name of the property to add @param value the value to assign to the given property....
java
public void addProperty(String propertyName, Object value) { if (propertyName != null) { propertyNames.add(propertyName); if (value == null) { properties.remove(propertyName); } else { properties....
[ "public", "void", "addProperty", "(", "String", "propertyName", ",", "Object", "value", ")", "{", "if", "(", "propertyName", "!=", "null", ")", "{", "propertyNames", ".", "add", "(", "propertyName", ")", ";", "if", "(", "value", "==", "null", ")", "{", ...
The name of the property to add. if it already exists, the value is updated. If the propertyname is null, the property addition is ignored. @param propertyName the name of the property to add @param value the value to assign to the given property.
[ "The", "name", "of", "the", "property", "to", "add", ".", "if", "it", "already", "exists", "the", "value", "is", "updated", ".", "If", "the", "propertyname", "is", "null", "the", "property", "addition", "is", "ignored", "." ]
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/DefaultFeature.java#L119-L133
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.setOrthoSymmetricLH
public Matrix4d setOrthoSymmetricLH(double width, double height, double zNear, double zFar, boolean zZeroToOne) { """ Set this matrix to be a symmetric orthographic projection transformation for a left-handed coordinate system using the given NDC z range. <p> This method is equivalent to calling {@link #setOrtho...
java
public Matrix4d setOrthoSymmetricLH(double width, double height, double zNear, double zFar, boolean zZeroToOne) { if ((properties & PROPERTY_IDENTITY) == 0) _identity(); m00 = 2.0 / width; m11 = 2.0 / height; m22 = (zZeroToOne ? 1.0 : 2.0) / (zFar - zNear); m32 = (zZe...
[ "public", "Matrix4d", "setOrthoSymmetricLH", "(", "double", "width", ",", "double", "height", ",", "double", "zNear", ",", "double", "zFar", ",", "boolean", "zZeroToOne", ")", "{", "if", "(", "(", "properties", "&", "PROPERTY_IDENTITY", ")", "==", "0", ")", ...
Set this matrix to be a symmetric orthographic projection transformation for a left-handed coordinate system using the given NDC z range. <p> This method is equivalent to calling {@link #setOrtho(double, double, double, double, double, double, boolean) setOrtho()} with <code>left=-width/2</code>, <code>right=+width/2</...
[ "Set", "this", "matrix", "to", "be", "a", "symmetric", "orthographic", "projection", "transformation", "for", "a", "left", "-", "handed", "coordinate", "system", "using", "the", "given", "NDC", "z", "range", ".", "<p", ">", "This", "method", "is", "equivalen...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10490-L10499
hageldave/ImagingKit
ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Pixel.java
Pixel.argb_bounded
public static final int argb_bounded(final int a, final int r, final int g, final int b) { """ Packs 8bit ARGB color components into a single 32bit integer value. Components are clamped to [0,255]. @param a alpha @param r red @param g green @param b blue @return packed ARGB value @see #argb(int, int, int,...
java
public static final int argb_bounded(final int a, final int r, final int g, final int b){ return argb_fast( a > 255 ? 255: a < 0 ? 0:a, r > 255 ? 255: r < 0 ? 0:r, g > 255 ? 255: g < 0 ? 0:g, b > 255 ? 255: b < 0 ? 0:b); }
[ "public", "static", "final", "int", "argb_bounded", "(", "final", "int", "a", ",", "final", "int", "r", ",", "final", "int", "g", ",", "final", "int", "b", ")", "{", "return", "argb_fast", "(", "a", ">", "255", "?", "255", ":", "a", "<", "0", "?"...
Packs 8bit ARGB color components into a single 32bit integer value. Components are clamped to [0,255]. @param a alpha @param r red @param g green @param b blue @return packed ARGB value @see #argb(int, int, int, int) @see #argb_fast(int, int, int, int) @see #rgb_bounded(int, int, int) @see #rgb(int, int, int) @see #rg...
[ "Packs", "8bit", "ARGB", "color", "components", "into", "a", "single", "32bit", "integer", "value", ".", "Components", "are", "clamped", "to", "[", "0", "255", "]", ".", "@param", "a", "alpha", "@param", "r", "red", "@param", "g", "green", "@param", "b",...
train
https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Pixel.java#L717-L723
xdcrafts/flower
flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java
ListApi.getNullableMap
public static <A, B> Map<A, B> getNullableMap(final List list, final Integer... path) { """ Get map value by path. @param <A> map key type @param <B> map value type @param list subject @param path nodes to walk in map @return value """ return getNullable(list, Map.class, path); }
java
public static <A, B> Map<A, B> getNullableMap(final List list, final Integer... path) { return getNullable(list, Map.class, path); }
[ "public", "static", "<", "A", ",", "B", ">", "Map", "<", "A", ",", "B", ">", "getNullableMap", "(", "final", "List", "list", ",", "final", "Integer", "...", "path", ")", "{", "return", "getNullable", "(", "list", ",", "Map", ".", "class", ",", "pat...
Get map value by path. @param <A> map key type @param <B> map value type @param list subject @param path nodes to walk in map @return value
[ "Get", "map", "value", "by", "path", "." ]
train
https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java#L184-L186
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcEndpoint.java
RpcEndpoint.scheduleRunAsync
protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) { """ Execute the runnable in the main thread of the underlying RPC endpoint, with a delay of the given number of milliseconds. @param runnable Runnable to be executed @param delay The delay after which the runnable will be execu...
java
protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) { rpcServer.scheduleRunAsync(runnable, unit.toMillis(delay)); }
[ "protected", "void", "scheduleRunAsync", "(", "Runnable", "runnable", ",", "long", "delay", ",", "TimeUnit", "unit", ")", "{", "rpcServer", ".", "scheduleRunAsync", "(", "runnable", ",", "unit", ".", "toMillis", "(", "delay", ")", ")", ";", "}" ]
Execute the runnable in the main thread of the underlying RPC endpoint, with a delay of the given number of milliseconds. @param runnable Runnable to be executed @param delay The delay after which the runnable will be executed
[ "Execute", "the", "runnable", "in", "the", "main", "thread", "of", "the", "underlying", "RPC", "endpoint", "with", "a", "delay", "of", "the", "given", "number", "of", "milliseconds", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcEndpoint.java#L285-L287
Whiley/WhileyCompiler
src/main/java/wyc/io/WhileyFileParser.java
WhileyFileParser.parseHexLiteral
private BigInteger parseHexLiteral(Token input) { """ Parse a token representing a hex literal, such as "0x @param input The token representing the byte value. @return """ String text = input.text; // Start past 0x for (int i = 2; i != text.length(); ++i) { char c = text.charAt(i); if(c != '_'...
java
private BigInteger parseHexLiteral(Token input) { String text = input.text; // Start past 0x for (int i = 2; i != text.length(); ++i) { char c = text.charAt(i); if(c != '_' && !isHexDigit(c)) { syntaxError("invalid hex literal (invalid characters)", input); } } // Remove "0x" and "_" text = inp...
[ "private", "BigInteger", "parseHexLiteral", "(", "Token", "input", ")", "{", "String", "text", "=", "input", ".", "text", ";", "// Start past 0x", "for", "(", "int", "i", "=", "2", ";", "i", "!=", "text", ".", "length", "(", ")", ";", "++", "i", ")",...
Parse a token representing a hex literal, such as "0x @param input The token representing the byte value. @return
[ "Parse", "a", "token", "representing", "a", "hex", "literal", "such", "as", "0x" ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L4615-L4627
kiegroup/droolsjbpm-integration
kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java
KieServerHttpRequest.appendQueryParameters
static String appendQueryParameters( final CharSequence url, final Map<?, ?> params ) { """ Append given map as query parameters to the base URL <p> Each map entry's key will be a parameter name and the value's {@link Object#toString()} will be the parameter value. @param url @param params @return URL with ...
java
static String appendQueryParameters( final CharSequence url, final Map<?, ?> params ) { final String baseUrl = url.toString(); if( params == null || params.isEmpty() ) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result)...
[ "static", "String", "appendQueryParameters", "(", "final", "CharSequence", "url", ",", "final", "Map", "<", "?", ",", "?", ">", "params", ")", "{", "final", "String", "baseUrl", "=", "url", ".", "toString", "(", ")", ";", "if", "(", "params", "==", "nu...
Append given map as query parameters to the base URL <p> Each map entry's key will be a parameter name and the value's {@link Object#toString()} will be the parameter value. @param url @param params @return URL with appended query params
[ "Append", "given", "map", "as", "query", "parameters", "to", "the", "base", "URL", "<p", ">", "Each", "map", "entry", "s", "key", "will", "be", "a", "parameter", "name", "and", "the", "value", "s", "{", "@link", "Object#toString", "()", "}", "will", "b...
train
https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L505-L536
Appendium/objectlabkit
utils/src/main/java/net/objectlab/kit/console/ConsoleMenu.java
ConsoleMenu.getString
public static String getString(final String msg, final String defaultVal) { """ Gets a String from the System.in @param msg for the command line @return String as entered by the user of the console app """ String s = getString(msg + "(default:" + defaultVal + "):"); if (StringUtils.isBla...
java
public static String getString(final String msg, final String defaultVal) { String s = getString(msg + "(default:" + defaultVal + "):"); if (StringUtils.isBlank(s)) { s = defaultVal; } return s; }
[ "public", "static", "String", "getString", "(", "final", "String", "msg", ",", "final", "String", "defaultVal", ")", "{", "String", "s", "=", "getString", "(", "msg", "+", "\"(default:\"", "+", "defaultVal", "+", "\"):\"", ")", ";", "if", "(", "StringUtils...
Gets a String from the System.in @param msg for the command line @return String as entered by the user of the console app
[ "Gets", "a", "String", "from", "the", "System", ".", "in" ]
train
https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/console/ConsoleMenu.java#L331-L338
looly/hutool
hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java
BeanCopier.mappingKey
private static String mappingKey(Map<String, String> mapping, String fieldName) { """ 获取指定字段名对应的映射值 @param mapping 反向映射Map @param fieldName 字段名 @return 映射值,无对应值返回字段名 @since 4.1.10 """ if (MapUtil.isEmpty(mapping)) { return fieldName; } return ObjectUtil.defaultIfNull(mapping.get(fieldName), ...
java
private static String mappingKey(Map<String, String> mapping, String fieldName) { if (MapUtil.isEmpty(mapping)) { return fieldName; } return ObjectUtil.defaultIfNull(mapping.get(fieldName), fieldName); }
[ "private", "static", "String", "mappingKey", "(", "Map", "<", "String", ",", "String", ">", "mapping", ",", "String", "fieldName", ")", "{", "if", "(", "MapUtil", ".", "isEmpty", "(", "mapping", ")", ")", "{", "return", "fieldName", ";", "}", "return", ...
获取指定字段名对应的映射值 @param mapping 反向映射Map @param fieldName 字段名 @return 映射值,无对应值返回字段名 @since 4.1.10
[ "获取指定字段名对应的映射值" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java#L294-L299
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java
GeoJsonToAssembler.fromTransferObject
public GeometryCollection fromTransferObject(GeometryCollectionTo input, CrsId crsId) { """ Creates a geometrycollection object starting from a transfer object. @param input the geometry collection transfer object @param crsId the crs id to use (ignores the crs of the input). If null, uses the crs of the input...
java
public GeometryCollection fromTransferObject(GeometryCollectionTo input, CrsId crsId) { if (input == null) { return null; } crsId = getCrsId(input, crsId); isValid(input); Geometry[] geoms = new Geometry[input.getGeometries().length]; for (int i = 0; i < geoms.length; i++) { ...
[ "public", "GeometryCollection", "fromTransferObject", "(", "GeometryCollectionTo", "input", ",", "CrsId", "crsId", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "crsId", "=", "getCrsId", "(", "input", ",", "crsId", ")", ...
Creates a geometrycollection object starting from a transfer object. @param input the geometry collection transfer object @param crsId the crs id to use (ignores the crs of the input). If null, uses the crs of the input. @return the corresponding geometry @throws IllegalArgumentException If the geometry could not be c...
[ "Creates", "a", "geometrycollection", "object", "starting", "from", "a", "transfer", "object", "." ]
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java#L271-L282
protegeproject/jpaul
src/main/java/jpaul/DataStructs/DSUtil.java
DSUtil.unionIterable
public static <E> Iterable<E> unionIterable(Iterable<E> it1, Iterable<E> it2) { """ Returns an immutable <code>Iterable</code> that is the union of two <code>Iterable</code>s. The resulting <code>Iterable</code> contains first all elements from <code>it1</code>, and next all elements from <code>it2</code>. ...
java
public static <E> Iterable<E> unionIterable(Iterable<E> it1, Iterable<E> it2) { return unionIterable(Arrays.<Iterable<E>>asList(it1, it2)); }
[ "public", "static", "<", "E", ">", "Iterable", "<", "E", ">", "unionIterable", "(", "Iterable", "<", "E", ">", "it1", ",", "Iterable", "<", "E", ">", "it2", ")", "{", "return", "unionIterable", "(", "Arrays", ".", "<", "Iterable", "<", "E", ">", ">...
Returns an immutable <code>Iterable</code> that is the union of two <code>Iterable</code>s. The resulting <code>Iterable</code> contains first all elements from <code>it1</code>, and next all elements from <code>it2</code>.
[ "Returns", "an", "immutable", "<code", ">", "Iterable<", "/", "code", ">", "that", "is", "the", "union", "of", "two", "<code", ">", "Iterable<", "/", "code", ">", "s", ".", "The", "resulting", "<code", ">", "Iterable<", "/", "code", ">", "contains", "f...
train
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/DSUtil.java#L223-L225
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/ringsearch/AllRingsFinder.java
AllRingsFinder.toRing
private IRing toRing(IAtomContainer container, EdgeToBondMap edges, int[] cycle) { """ Convert a cycle in {@literal int[]} representation to an {@link IRing}. @param container atom container @param edges edge map @param cycle vertex walk forming the cycle, first and last vertex the same @return a ne...
java
private IRing toRing(IAtomContainer container, EdgeToBondMap edges, int[] cycle) { IRing ring = container.getBuilder().newInstance(IRing.class, 0); int len = cycle.length - 1; IAtom[] atoms = new IAtom[len]; IBond[] bonds = new IBond[len]; for (int i = 0; i < len; i++) { ...
[ "private", "IRing", "toRing", "(", "IAtomContainer", "container", ",", "EdgeToBondMap", "edges", ",", "int", "[", "]", "cycle", ")", "{", "IRing", "ring", "=", "container", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IRing", ".", "class", ",", ...
Convert a cycle in {@literal int[]} representation to an {@link IRing}. @param container atom container @param edges edge map @param cycle vertex walk forming the cycle, first and last vertex the same @return a new ring
[ "Convert", "a", "cycle", "in", "{", "@literal", "int", "[]", "}", "representation", "to", "an", "{", "@link", "IRing", "}", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/ringsearch/AllRingsFinder.java#L249-L267
infinispan/infinispan
cdi/common/src/main/java/org/infinispan/cdi/common/util/Beans.java
Beans.createInjectionPoints
public static <X> List<InjectionPoint> createInjectionPoints(AnnotatedMethod<X> method, Bean<?> declaringBean, BeanManager beanManager) { """ Given a method, and the bean on which the method is declared, create a collection of injection points representing the parameters of the method. @param <X> the...
java
public static <X> List<InjectionPoint> createInjectionPoints(AnnotatedMethod<X> method, Bean<?> declaringBean, BeanManager beanManager) { List<InjectionPoint> injectionPoints = new ArrayList<InjectionPoint>(); for (AnnotatedParameter<X> parameter : method.getParameters()) { InjectionPoint in...
[ "public", "static", "<", "X", ">", "List", "<", "InjectionPoint", ">", "createInjectionPoints", "(", "AnnotatedMethod", "<", "X", ">", "method", ",", "Bean", "<", "?", ">", "declaringBean", ",", "BeanManager", "beanManager", ")", "{", "List", "<", "Injection...
Given a method, and the bean on which the method is declared, create a collection of injection points representing the parameters of the method. @param <X> the type declaring the method @param method the method @param declaringBean the bean on which the method is declared @param beanManager the bean...
[ "Given", "a", "method", "and", "the", "bean", "on", "which", "the", "method", "is", "declared", "create", "a", "collection", "of", "injection", "points", "representing", "the", "parameters", "of", "the", "method", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/cdi/common/src/main/java/org/infinispan/cdi/common/util/Beans.java#L85-L92
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/BoundsOnBinomialProportions.java
BoundsOnBinomialProportions.approximateUpperBoundOnP
public static double approximateUpperBoundOnP(final long n, final long k, final double numStdDevs) { """ Computes upper bound of approximate Clopper-Pearson confidence interval for a binomial proportion. <p>Implementation Notes:<br> The approximateUpperBoundOnP is defined with respect to the left tail of the ...
java
public static double approximateUpperBoundOnP(final long n, final long k, final double numStdDevs) { checkInputs(n, k); if (n == 0) { return 1.0; } // the coin was never flipped, so we know nothing else if (k == n) { return 1.0; } else if (k == (n - 1)) { return (exactUpperBoundOnPForKequalsNminus...
[ "public", "static", "double", "approximateUpperBoundOnP", "(", "final", "long", "n", ",", "final", "long", "k", ",", "final", "double", "numStdDevs", ")", "{", "checkInputs", "(", "n", ",", "k", ")", ";", "if", "(", "n", "==", "0", ")", "{", "return", ...
Computes upper bound of approximate Clopper-Pearson confidence interval for a binomial proportion. <p>Implementation Notes:<br> The approximateUpperBoundOnP is defined with respect to the left tail of the binomial distribution.</p> <ul> <li>We want to solve for the <i>p</i> for which sum<sub><i>j,0,k</i></sub>bino(<i>...
[ "Computes", "upper", "bound", "of", "approximate", "Clopper", "-", "Pearson", "confidence", "interval", "for", "a", "binomial", "proportion", "." ]
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BoundsOnBinomialProportions.java#L128-L142
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/ui/SeaGlassTableUI.java
SeaGlassTableUI.installRendererIfPossible
private TableCellRenderer installRendererIfPossible(Class objectClass, TableCellRenderer renderer) { """ Installs a renderer if the existing renderer is an instance of UIResource. @param objectClass the class for which to install the renderer. @param renderer the renderer instance. @return the previou...
java
private TableCellRenderer installRendererIfPossible(Class objectClass, TableCellRenderer renderer) { TableCellRenderer currentRenderer = table.getDefaultRenderer(objectClass); if (currentRenderer instanceof UIResource) { table.setDefaultRenderer(objectClass, renderer); } re...
[ "private", "TableCellRenderer", "installRendererIfPossible", "(", "Class", "objectClass", ",", "TableCellRenderer", "renderer", ")", "{", "TableCellRenderer", "currentRenderer", "=", "table", ".", "getDefaultRenderer", "(", "objectClass", ")", ";", "if", "(", "currentRe...
Installs a renderer if the existing renderer is an instance of UIResource. @param objectClass the class for which to install the renderer. @param renderer the renderer instance. @return the previous renderer.
[ "Installs", "a", "renderer", "if", "the", "existing", "renderer", "is", "an", "instance", "of", "UIResource", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTableUI.java#L153-L161
alkacon/opencms-core
src/org/opencms/relations/CmsCategoryService.java
CmsCategoryService.readCategoriesForRepositories
public List<CmsCategory> readCategoriesForRepositories( CmsObject cms, String parentCategoryPath, boolean includeSubCats, List<String> repositories) throws CmsException { """ Returns all categories given some search parameters.<p> @param cms the current cms context @param pa...
java
public List<CmsCategory> readCategoriesForRepositories( CmsObject cms, String parentCategoryPath, boolean includeSubCats, List<String> repositories) throws CmsException { return readCategoriesForRepositories(cms, parentCategoryPath, includeSubCats, repositories, false); ...
[ "public", "List", "<", "CmsCategory", ">", "readCategoriesForRepositories", "(", "CmsObject", "cms", ",", "String", "parentCategoryPath", ",", "boolean", "includeSubCats", ",", "List", "<", "String", ">", "repositories", ")", "throws", "CmsException", "{", "return",...
Returns all categories given some search parameters.<p> @param cms the current cms context @param parentCategoryPath the path of the parent category to get the categories for @param includeSubCats if to include all categories, or first level child categories only @param repositories a list of root paths @return a list...
[ "Returns", "all", "categories", "given", "some", "search", "parameters", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L482-L490
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/searchindex/CmsDeleteIndexSourceDialog.java
CmsDeleteIndexSourceDialog.createDialogHtml
@Override protected String createDialogHtml(String dialog) { """ Creates the dialog HTML for all defined widgets of the named dialog (page).<p> This overwrites the method from the super class to create a layout variation for the widgets.<p> @param dialog the dialog (page) to get the HTML for @return the...
java
@Override protected String createDialogHtml(String dialog) { StringBuffer result = new StringBuffer(512); result.append(createWidgetTableStart()); // show error header once if there were validation errors result.append(createWidgetErrorHeader()); if (dialog.equals(PAGES[0]...
[ "@", "Override", "protected", "String", "createDialogHtml", "(", "String", "dialog", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", "512", ")", ";", "result", ".", "append", "(", "createWidgetTableStart", "(", ")", ")", ";", "// show erro...
Creates the dialog HTML for all defined widgets of the named dialog (page).<p> This overwrites the method from the super class to create a layout variation for the widgets.<p> @param dialog the dialog (page) to get the HTML for @return the dialog HTML for all defined widgets of the named dialog (page)
[ "Creates", "the", "dialog", "HTML", "for", "all", "defined", "widgets", "of", "the", "named", "dialog", "(", "page", ")", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsDeleteIndexSourceDialog.java#L110-L135
phoenixnap/springmvc-raml-plugin
src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/interpreters/EnumBuilder.java
EnumBuilder.withName
public EnumBuilder withName(String pojoPackage, String className) { """ Sets this Pojo's name @param pojoPackage The Package used to create POJO @param className Class to be created @return This instance """ className = NamingHelper.convertToClassName(className); final String fullyQualifiedClassNam...
java
public EnumBuilder withName(String pojoPackage, String className) { className = NamingHelper.convertToClassName(className); final String fullyQualifiedClassName = pojoPackage + "." + className; // Initiate package if necessary if (this.pojoPackage == null) { withPackage(pojoPackage); } // Builders shoul...
[ "public", "EnumBuilder", "withName", "(", "String", "pojoPackage", ",", "String", "className", ")", "{", "className", "=", "NamingHelper", ".", "convertToClassName", "(", "className", ")", ";", "final", "String", "fullyQualifiedClassName", "=", "pojoPackage", "+", ...
Sets this Pojo's name @param pojoPackage The Package used to create POJO @param className Class to be created @return This instance
[ "Sets", "this", "Pojo", "s", "name" ]
train
https://github.com/phoenixnap/springmvc-raml-plugin/blob/6387072317cd771eb7d6f30943f556ac20dd3c84/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/interpreters/EnumBuilder.java#L83-L113
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.indexOf
public int indexOf(final char ch, int startIndex) { """ Searches the string builder to find the first reference to the specified char. @param ch the character to find @param startIndex the index to start at, invalid index rounded to edge @return the first index of the character, or -1 if not found """ ...
java
public int indexOf(final char ch, int startIndex) { startIndex = (startIndex < 0 ? 0 : startIndex); if (startIndex >= size) { return -1; } final char[] thisBuf = buffer; for (int i = startIndex; i < size; i++) { if (thisBuf[i] == ch) { retu...
[ "public", "int", "indexOf", "(", "final", "char", "ch", ",", "int", "startIndex", ")", "{", "startIndex", "=", "(", "startIndex", "<", "0", "?", "0", ":", "startIndex", ")", ";", "if", "(", "startIndex", ">=", "size", ")", "{", "return", "-", "1", ...
Searches the string builder to find the first reference to the specified char. @param ch the character to find @param startIndex the index to start at, invalid index rounded to edge @return the first index of the character, or -1 if not found
[ "Searches", "the", "string", "builder", "to", "find", "the", "first", "reference", "to", "the", "specified", "char", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2417-L2429
Erudika/para
para-core/src/main/java/com/erudika/para/core/App.java
App.permissionsContainOwnKeyword
public boolean permissionsContainOwnKeyword(User user, ParaObject object) { """ Check if the permissions map contains "OWN" keyword, which restricts access to objects to their creators. @param user user in context @param object some object @return true if app contains permission for this resource and it is ma...
java
public boolean permissionsContainOwnKeyword(User user, ParaObject object) { if (user == null || object == null) { return false; } String resourcePath1 = object.getType(); String resourcePath2 = object.getObjectURI().substring(1); // remove first '/' String resourcePath3 = object.getPlural(); return hasOw...
[ "public", "boolean", "permissionsContainOwnKeyword", "(", "User", "user", ",", "ParaObject", "object", ")", "{", "if", "(", "user", "==", "null", "||", "object", "==", "null", ")", "{", "return", "false", ";", "}", "String", "resourcePath1", "=", "object", ...
Check if the permissions map contains "OWN" keyword, which restricts access to objects to their creators. @param user user in context @param object some object @return true if app contains permission for this resource and it is marked with "OWN"
[ "Check", "if", "the", "permissions", "map", "contains", "OWN", "keyword", "which", "restricts", "access", "to", "objects", "to", "their", "creators", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/App.java#L841-L854
jenkinsci/jenkins
core/src/main/java/hudson/util/jna/RegistryKey.java
RegistryKey.getSubKeys
public Collection<String> getSubKeys() { """ Get all sub keys of a key. @return array with all sub key names """ WINBASE.FILETIME lpftLastWriteTime; TreeSet<String> subKeys = new TreeSet<>(); char[] lpName = new char[256]; IntByReference lpcName = new IntByReference(256); ...
java
public Collection<String> getSubKeys() { WINBASE.FILETIME lpftLastWriteTime; TreeSet<String> subKeys = new TreeSet<>(); char[] lpName = new char[256]; IntByReference lpcName = new IntByReference(256); lpftLastWriteTime = new WINBASE.FILETIME(); int dwIndex = 0; w...
[ "public", "Collection", "<", "String", ">", "getSubKeys", "(", ")", "{", "WINBASE", ".", "FILETIME", "lpftLastWriteTime", ";", "TreeSet", "<", "String", ">", "subKeys", "=", "new", "TreeSet", "<>", "(", ")", ";", "char", "[", "]", "lpName", "=", "new", ...
Get all sub keys of a key. @return array with all sub key names
[ "Get", "all", "sub", "keys", "of", "a", "key", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/jna/RegistryKey.java#L188-L204
synchronoss/cpo-api
cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java
CassandraCpoAdapter.processUpdateGroup
protected <T> long processUpdateGroup(T obj, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Session sess) throws CpoException { """ DOCUMENT ME! @param obj DOCUMENT ME! @param groupType DOCUMENT ME! @param...
java
protected <T> long processUpdateGroup(T obj, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Session sess) throws CpoException { Logger localLogger = obj == null ? logger : LoggerFactory.getLogger(obj.getClass()); ...
[ "protected", "<", "T", ">", "long", "processUpdateGroup", "(", "T", "obj", ",", "String", "groupType", ",", "String", "groupName", ",", "Collection", "<", "CpoWhere", ">", "wheres", ",", "Collection", "<", "CpoOrderBy", ">", "orderBy", ",", "Collection", "<"...
DOCUMENT ME! @param obj DOCUMENT ME! @param groupType DOCUMENT ME! @param groupName DOCUMENT ME! @param sess DOCUMENT ME! @return DOCUMENT ME! @throws CpoException DOCUMENT ME!
[ "DOCUMENT", "ME!" ]
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L2070-L2097
alkacon/opencms-core
src/org/opencms/workplace/CmsWorkplace.java
CmsWorkplace.canEditPermissionsForRoles
public static boolean canEditPermissionsForRoles(CmsObject cms, String path) { """ Checks if permissions for roles should be editable for the current user on the resource with the given path.<p> @param cms the CMS context @param path the path of a resource @return <code>true</code> if permissions for roles ...
java
public static boolean canEditPermissionsForRoles(CmsObject cms, String path) { return OpenCms.getRoleManager().hasRoleForResource(cms, CmsRole.VFS_MANAGER, path) && path.startsWith(VFS_PATH_SYSTEM); }
[ "public", "static", "boolean", "canEditPermissionsForRoles", "(", "CmsObject", "cms", ",", "String", "path", ")", "{", "return", "OpenCms", ".", "getRoleManager", "(", ")", ".", "hasRoleForResource", "(", "cms", ",", "CmsRole", ".", "VFS_MANAGER", ",", "path", ...
Checks if permissions for roles should be editable for the current user on the resource with the given path.<p> @param cms the CMS context @param path the path of a resource @return <code>true</code> if permissions for roles should be editable for the current user on the resource with the given path
[ "Checks", "if", "permissions", "for", "roles", "should", "be", "editable", "for", "the", "current", "user", "on", "the", "resource", "with", "the", "given", "path", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L423-L427
jsonld-java/jsonld-java
core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java
JsonUtils.fromInputStream
public static Object fromInputStream(InputStream input, Charset enc) throws IOException { """ Parses a JSON-LD document from the given {@link InputStream} to an object that can be used as input for the {@link JsonLdApi} and {@link JsonLdProcessor} methods. @param input The JSON-LD document in an InputStream....
java
public static Object fromInputStream(InputStream input, Charset enc) throws IOException { try (InputStreamReader in = new InputStreamReader(input, enc); BufferedReader reader = new BufferedReader(in);) { return fromReader(reader); } }
[ "public", "static", "Object", "fromInputStream", "(", "InputStream", "input", ",", "Charset", "enc", ")", "throws", "IOException", "{", "try", "(", "InputStreamReader", "in", "=", "new", "InputStreamReader", "(", "input", ",", "enc", ")", ";", "BufferedReader", ...
Parses a JSON-LD document from the given {@link InputStream} to an object that can be used as input for the {@link JsonLdApi} and {@link JsonLdProcessor} methods. @param input The JSON-LD document in an InputStream. @param enc The character encoding to use when interpreting the characters in the InputStream. @return A...
[ "Parses", "a", "JSON", "-", "LD", "document", "from", "the", "given", "{", "@link", "InputStream", "}", "to", "an", "object", "that", "can", "be", "used", "as", "input", "for", "the", "{", "@link", "JsonLdApi", "}", "and", "{", "@link", "JsonLdProcessor"...
train
https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java#L151-L156
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java
FDBigInteger.cmpPow52
public /*@ pure @*/ int cmpPow52(int p5, int p2) { """ /*@ @ requires p5 >= 0 && p2 >= 0; @ ensures \result == (this.value() < pow52(p5, p2) ? -1 : this.value() > pow52(p5, p2) ? +1 : 0); @ """ if (p5 == 0) { int wordcount = p2 >> 5; int bitcount = p2 & 0x1f; int...
java
public /*@ pure @*/ int cmpPow52(int p5, int p2) { if (p5 == 0) { int wordcount = p2 >> 5; int bitcount = p2 & 0x1f; int size = this.nWords + this.offset; if (size > wordcount + 1) { return 1; } else if (size < wordcount + 1) { ...
[ "public", "/*@ pure @*/", "int", "cmpPow52", "(", "int", "p5", ",", "int", "p2", ")", "{", "if", "(", "p5", "==", "0", ")", "{", "int", "wordcount", "=", "p2", ">>", "5", ";", "int", "bitcount", "=", "p2", "&", "0x1f", ";", "int", "size", "=", ...
/*@ @ requires p5 >= 0 && p2 >= 0; @ ensures \result == (this.value() < pow52(p5, p2) ? -1 : this.value() > pow52(p5, p2) ? +1 : 0); @
[ "/", "*" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L991-L1009
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/ui/SeaGlassTextFieldUI.java
SeaGlassTextFieldUI.paintPlaceholderText
protected void paintPlaceholderText(SeaGlassContext context, Graphics g, JComponent c) { """ DOCUMENT ME! @param context DOCUMENT ME! @param g DOCUMENT ME! @param c DOCUMENT ME! """ g.setColor(placeholderColor); g.setFont(c.getFont()); Rectangle innerArea = SwingUtil...
java
protected void paintPlaceholderText(SeaGlassContext context, Graphics g, JComponent c) { g.setColor(placeholderColor); g.setFont(c.getFont()); Rectangle innerArea = SwingUtilities.calculateInnerArea(c, null); Rectangle cancelBounds = getCancelButtonBounds(); context.getStyle()...
[ "protected", "void", "paintPlaceholderText", "(", "SeaGlassContext", "context", ",", "Graphics", "g", ",", "JComponent", "c", ")", "{", "g", ".", "setColor", "(", "placeholderColor", ")", ";", "g", ".", "setFont", "(", "c", ".", "getFont", "(", ")", ")", ...
DOCUMENT ME! @param context DOCUMENT ME! @param g DOCUMENT ME! @param c DOCUMENT ME!
[ "DOCUMENT", "ME!" ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTextFieldUI.java#L495-L503
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.updateSecretAsync
public Observable<SecretBundle> updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion) { """ Updates the attributes associated with a specified secret in a given key vault. The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in...
java
public Observable<SecretBundle> updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion) { return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).map(new Func1<ServiceResponse<SecretBundle>, SecretBundle>() { @Override public SecretBun...
[ "public", "Observable", "<", "SecretBundle", ">", "updateSecretAsync", "(", "String", "vaultBaseUrl", ",", "String", "secretName", ",", "String", "secretVersion", ")", "{", "return", "updateSecretWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "secretName", ",", ...
Updates the attributes associated with a specified secret in a given key vault. The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set per...
[ "Updates", "the", "attributes", "associated", "with", "a", "specified", "secret", "in", "a", "given", "key", "vault", ".", "The", "UPDATE", "operation", "changes", "specified", "attributes", "of", "an", "existing", "stored", "secret", ".", "Attributes", "that", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3649-L3656
kiegroup/drools
drools-model/drools-constraint-parser/src/main/javacc-support/org/drools/constraint/parser/GeneratedDrlConstraintParserBase.java
GeneratedDrlConstraintParserBase.juggleArrayType
Type juggleArrayType(Type partialType, List<ArrayType.ArrayBracketPair> additionalBrackets) { """ Throws together a Type, taking care of all the array brackets """ Pair<Type, List<ArrayType.ArrayBracketPair>> partialParts = unwrapArrayTypes(partialType); Type elementType = partialParts.a; ...
java
Type juggleArrayType(Type partialType, List<ArrayType.ArrayBracketPair> additionalBrackets) { Pair<Type, List<ArrayType.ArrayBracketPair>> partialParts = unwrapArrayTypes(partialType); Type elementType = partialParts.a; List<ArrayType.ArrayBracketPair> leftMostBrackets = partialParts.b; ...
[ "Type", "juggleArrayType", "(", "Type", "partialType", ",", "List", "<", "ArrayType", ".", "ArrayBracketPair", ">", "additionalBrackets", ")", "{", "Pair", "<", "Type", ",", "List", "<", "ArrayType", ".", "ArrayBracketPair", ">", ">", "partialParts", "=", "unw...
Throws together a Type, taking care of all the array brackets
[ "Throws", "together", "a", "Type", "taking", "care", "of", "all", "the", "array", "brackets" ]
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-model/drools-constraint-parser/src/main/javacc-support/org/drools/constraint/parser/GeneratedDrlConstraintParserBase.java#L253-L258
Jasig/uPortal
uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/PortletTabIdResolver.java
PortletTabIdResolver.containsElmentWithId
private boolean containsElmentWithId(Node node, String id) { """ Recursevly find out whether node contains a folder or channel with given identifier. @param node Where to search. @param id Identifier to search for. @return true if node or any of its descendats contain an element with given identifier, false ...
java
private boolean containsElmentWithId(Node node, String id) { String nodeName = node.getNodeName(); if ("channel".equals(nodeName) || "folder".equals(nodeName)) { Element e = (Element) node; if (id.equals(e.getAttribute("ID"))) { return true; } ...
[ "private", "boolean", "containsElmentWithId", "(", "Node", "node", ",", "String", "id", ")", "{", "String", "nodeName", "=", "node", ".", "getNodeName", "(", ")", ";", "if", "(", "\"channel\"", ".", "equals", "(", "nodeName", ")", "||", "\"folder\"", ".", ...
Recursevly find out whether node contains a folder or channel with given identifier. @param node Where to search. @param id Identifier to search for. @return true if node or any of its descendats contain an element with given identifier, false otherwise.
[ "Recursevly", "find", "out", "whether", "node", "contains", "a", "folder", "or", "channel", "with", "given", "identifier", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/PortletTabIdResolver.java#L79-L97
GoogleCloudPlatform/bigdata-interop
gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadChannel.java
GoogleCloudStorageReadChannel.handleExecuteMediaException
private HttpResponse handleExecuteMediaException( IOException e, Get getObject, boolean retryWithLiveVersion) throws IOException { """ When an IOException is thrown, depending on if the exception is caused by non-existent object generation, and depending on the generation read consistency setting, either re...
java
private HttpResponse handleExecuteMediaException( IOException e, Get getObject, boolean retryWithLiveVersion) throws IOException { if (errorExtractor.itemNotFound(e)) { if (retryWithLiveVersion) { generation = null; footerContent = null; getObject.setGeneration(null); try...
[ "private", "HttpResponse", "handleExecuteMediaException", "(", "IOException", "e", ",", "Get", "getObject", ",", "boolean", "retryWithLiveVersion", ")", "throws", "IOException", "{", "if", "(", "errorExtractor", ".", "itemNotFound", "(", "e", ")", ")", "{", "if", ...
When an IOException is thrown, depending on if the exception is caused by non-existent object generation, and depending on the generation read consistency setting, either retry the read (of the latest generation), or handle the exception directly. @param e IOException thrown while reading from GCS. @param getObject th...
[ "When", "an", "IOException", "is", "thrown", "depending", "on", "if", "the", "exception", "is", "caused", "by", "non", "-", "existent", "object", "generation", "and", "depending", "on", "the", "generation", "read", "consistency", "setting", "either", "retry", ...
train
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageReadChannel.java#L1131-L1152
52inc/android-52Kit
library/src/main/java/com/ftinc/kit/util/Utils.java
Utils.parseFloat
public static float parseFloat(String val, float defVal) { """ Parse a float from a String in a safe manner. @param val the string to parse @param defVal the default value to return if parsing fails @return the parsed float, or default value """ if(TextUtils.isEmpty(v...
java
public static float parseFloat(String val, float defVal){ if(TextUtils.isEmpty(val)) return defVal; try{ return Float.parseFloat(val); }catch (NumberFormatException e){ return defVal; } }
[ "public", "static", "float", "parseFloat", "(", "String", "val", ",", "float", "defVal", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "val", ")", ")", "return", "defVal", ";", "try", "{", "return", "Float", ".", "parseFloat", "(", "val", ")",...
Parse a float from a String in a safe manner. @param val the string to parse @param defVal the default value to return if parsing fails @return the parsed float, or default value
[ "Parse", "a", "float", "from", "a", "String", "in", "a", "safe", "manner", "." ]
train
https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/Utils.java#L246-L253
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/EmailValidator.java
EmailValidator.isValid
@Override public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) { """ {@inheritDoc} check if given string is a valid mail. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext) """ if (StringUtils.isEmpt...
java
@Override public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) { if (StringUtils.isEmpty(pvalue)) { return true; } if (pvalue.length() > LENGTH_MAIL) { // Email is to long, but that's handled by size annotation return true; } if (!StringUti...
[ "@", "Override", "public", "final", "boolean", "isValid", "(", "final", "String", "pvalue", ",", "final", "ConstraintValidatorContext", "pcontext", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "pvalue", ")", ")", "{", "return", "true", ";", "}", ...
{@inheritDoc} check if given string is a valid mail. @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
[ "{", "@inheritDoc", "}", "check", "if", "given", "string", "is", "a", "valid", "mail", "." ]
train
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/EmailValidator.java#L53-L67
alkacon/opencms-core
src/org/opencms/ade/containerpage/CmsContainerpageService.java
CmsContainerpageService.saveInheritanceGroup
private void saveInheritanceGroup(CmsResource resource, CmsInheritanceContainer inheritanceContainer) throws CmsException { """ Saves the inheritance group.<p> @param resource the inheritance group resource @param inheritanceContainer the inherited group container data @throws CmsException if something ...
java
private void saveInheritanceGroup(CmsResource resource, CmsInheritanceContainer inheritanceContainer) throws CmsException { CmsObject cms = getCmsObject(); CmsFile file = cms.readFile(resource); CmsXmlContent document = CmsXmlContentFactory.unmarshal(cms, file); for (Locale docLoca...
[ "private", "void", "saveInheritanceGroup", "(", "CmsResource", "resource", ",", "CmsInheritanceContainer", "inheritanceContainer", ")", "throws", "CmsException", "{", "CmsObject", "cms", "=", "getCmsObject", "(", ")", ";", "CmsFile", "file", "=", "cms", ".", "readFi...
Saves the inheritance group.<p> @param resource the inheritance group resource @param inheritanceContainer the inherited group container data @throws CmsException if something goes wrong
[ "Saves", "the", "inheritance", "group", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsContainerpageService.java#L2810-L2828
alkacon/opencms-core
src/org/opencms/staticexport/CmsStaticExportManager.java
CmsStaticExportManager.createExportFolder
protected void createExportFolder(String exportPath, String rfsName) throws CmsException { """ Creates the parent folder for a exported resource in the RFS.<p> @param exportPath the path to export the file @param rfsName the rfs name of the resource @throws CmsException if the folder could not be created ...
java
protected void createExportFolder(String exportPath, String rfsName) throws CmsException { String exportFolderName = CmsFileUtil.normalizePath(exportPath + CmsResource.getFolderPath(rfsName)); File exportFolder = new File(exportFolderName); if (!exportFolder.exists()) { // in case o...
[ "protected", "void", "createExportFolder", "(", "String", "exportPath", ",", "String", "rfsName", ")", "throws", "CmsException", "{", "String", "exportFolderName", "=", "CmsFileUtil", ".", "normalizePath", "(", "exportPath", "+", "CmsResource", ".", "getFolderPath", ...
Creates the parent folder for a exported resource in the RFS.<p> @param exportPath the path to export the file @param rfsName the rfs name of the resource @throws CmsException if the folder could not be created
[ "Creates", "the", "parent", "folder", "for", "a", "exported", "resource", "in", "the", "RFS", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsStaticExportManager.java#L2433-L2443
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuGraphAddMemsetNode
public static int cuGraphAddMemsetNode(CUgraphNode phGraphNode, CUgraph hGraph, CUgraphNode dependencies[], long numDependencies, CUDA_MEMSET_NODE_PARAMS memsetParams, CUcontext ctx) { """ Creates a memset node and adds it to a graph.<br> <br> Creates a new memset node and adds it to \p hGraph with \p numDepende...
java
public static int cuGraphAddMemsetNode(CUgraphNode phGraphNode, CUgraph hGraph, CUgraphNode dependencies[], long numDependencies, CUDA_MEMSET_NODE_PARAMS memsetParams, CUcontext ctx) { return checkResult(cuGraphAddMemsetNodeNative(phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx)); ...
[ "public", "static", "int", "cuGraphAddMemsetNode", "(", "CUgraphNode", "phGraphNode", ",", "CUgraph", "hGraph", ",", "CUgraphNode", "dependencies", "[", "]", ",", "long", "numDependencies", ",", "CUDA_MEMSET_NODE_PARAMS", "memsetParams", ",", "CUcontext", "ctx", ")", ...
Creates a memset node and adds it to a graph.<br> <br> Creates a new memset node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any du...
[ "Creates", "a", "memset", "node", "and", "adds", "it", "to", "a", "graph", ".", "<br", ">", "<br", ">", "Creates", "a", "new", "memset", "node", "and", "adds", "it", "to", "\\", "p", "hGraph", "with", "\\", "p", "numDependencies", "dependencies", "spec...
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12296-L12299
tommyettinger/RegExodus
src/main/java/regexodus/ds/CharArrayList.java
CharArrayList.set
@Deprecated public Character set(final int index, final Character ok) { """ Delegates to the corresponding type-specific method. @deprecated Please use the corresponding type-specific method instead. """ return set(index, ok.charValue()); }
java
@Deprecated public Character set(final int index, final Character ok) { return set(index, ok.charValue()); }
[ "@", "Deprecated", "public", "Character", "set", "(", "final", "int", "index", ",", "final", "Character", "ok", ")", "{", "return", "set", "(", "index", ",", "ok", ".", "charValue", "(", ")", ")", ";", "}" ]
Delegates to the corresponding type-specific method. @deprecated Please use the corresponding type-specific method instead.
[ "Delegates", "to", "the", "corresponding", "type", "-", "specific", "method", "." ]
train
https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/ds/CharArrayList.java#L258-L261
Netflix/karyon
karyon2-governator/src/main/java/netflix/karyon/Karyon.java
Karyon.forTcpConnectionHandler
public static KaryonServer forTcpConnectionHandler(int port, ConnectionHandler<ByteBuf, ByteBuf> handler, Module... modules) { """ Creates a new {@link KaryonServer} that has a single TCP server instance which delegates all connection handling to {@link Conne...
java
public static KaryonServer forTcpConnectionHandler(int port, ConnectionHandler<ByteBuf, ByteBuf> handler, Module... modules) { return forTcpConnectionHandler(port, handler, toBootstrapModule(modules)); }
[ "public", "static", "KaryonServer", "forTcpConnectionHandler", "(", "int", "port", ",", "ConnectionHandler", "<", "ByteBuf", ",", "ByteBuf", ">", "handler", ",", "Module", "...", "modules", ")", "{", "return", "forTcpConnectionHandler", "(", "port", ",", "handler"...
Creates a new {@link KaryonServer} that has a single TCP server instance which delegates all connection handling to {@link ConnectionHandler}. The {@link RxServer} is created using {@link RxNetty#newTcpServerBuilder(int, ConnectionHandler)} @param port Port for the server. @param handler Connection Handler @param modu...
[ "Creates", "a", "new", "{", "@link", "KaryonServer", "}", "that", "has", "a", "single", "TCP", "server", "instance", "which", "delegates", "all", "connection", "handling", "to", "{", "@link", "ConnectionHandler", "}", ".", "The", "{", "@link", "RxServer", "}...
train
https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-governator/src/main/java/netflix/karyon/Karyon.java#L87-L90
sahan/RoboZombie
robozombie/src/main/java/org/apache/http42/client/utils/URLEncodedUtils.java
URLEncodedUtils.encodeFormFields
private static String encodeFormFields (final String content, final String charset) { """ Encode/escape www-url-form-encoded content. <p> Uses the {@link #URLENCODER} set of characters, rather than the {@link #UNRSERVED} set; this is for compatibilty with previous releases, URLEncoder.encode() and most browser...
java
private static String encodeFormFields (final String content, final String charset) { if (content == null) { return null; } return urlencode(content, charset != null ? Charset.forName(charset) : Consts.UTF_8, URLENCODER, true); }
[ "private", "static", "String", "encodeFormFields", "(", "final", "String", "content", ",", "final", "String", "charset", ")", "{", "if", "(", "content", "==", "null", ")", "{", "return", "null", ";", "}", "return", "urlencode", "(", "content", ",", "charse...
Encode/escape www-url-form-encoded content. <p> Uses the {@link #URLENCODER} set of characters, rather than the {@link #UNRSERVED} set; this is for compatibilty with previous releases, URLEncoder.encode() and most browsers. @param content the content to encode, will convert space to '+' @param charset the charset to u...
[ "Encode", "/", "escape", "www", "-", "url", "-", "form", "-", "encoded", "content", ".", "<p", ">", "Uses", "the", "{", "@link", "#URLENCODER", "}", "set", "of", "characters", "rather", "than", "the", "{", "@link", "#UNRSERVED", "}", "set", ";", "this"...
train
https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/org/apache/http42/client/utils/URLEncodedUtils.java#L479-L485
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/util/UTFDataInputStream.java
UTFDataInputStream.readUTFAsArray
public String readUTFAsArray() throws IOException { """ Read a byte array formed UTF-8 String @return a String written with {@link UTFDataOutputStream#writeUTFAsArray(String)} @throws IOException @see UTFDataOutputStream#writeUTFAsArray(String) """ byte[] buffer = new byte[super.readInt()]; super.r...
java
public String readUTFAsArray() throws IOException { byte[] buffer = new byte[super.readInt()]; super.read(buffer, 0, buffer.length); return new String(buffer, "UTF-8"); }
[ "public", "String", "readUTFAsArray", "(", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "super", ".", "readInt", "(", ")", "]", ";", "super", ".", "read", "(", "buffer", ",", "0", ",", "buffer", ".", "length...
Read a byte array formed UTF-8 String @return a String written with {@link UTFDataOutputStream#writeUTFAsArray(String)} @throws IOException @see UTFDataOutputStream#writeUTFAsArray(String)
[ "Read", "a", "byte", "array", "formed", "UTF", "-", "8", "String" ]
train
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/util/UTFDataInputStream.java#L72-L76
gallandarakhneorg/afc
core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphIterationElementComparator.java
GraphIterationElementComparator.compareSegments
@Pure protected int compareSegments(ST s1, ST s2) { """ Compare the two given segments. @param s1 the first segment. @param s2 the second segment. @return <code>-1</code> if {@code s1} is lower than {@code s2}, <code>1</code> if {@code s1} is greater than {@code s2}, otherwise <code>0</code>. """ ass...
java
@Pure protected int compareSegments(ST s1, ST s2) { assert s1 != null && s2 != null; return s1.hashCode() - s2.hashCode(); }
[ "@", "Pure", "protected", "int", "compareSegments", "(", "ST", "s1", ",", "ST", "s2", ")", "{", "assert", "s1", "!=", "null", "&&", "s2", "!=", "null", ";", "return", "s1", ".", "hashCode", "(", ")", "-", "s2", ".", "hashCode", "(", ")", ";", "}"...
Compare the two given segments. @param s1 the first segment. @param s2 the second segment. @return <code>-1</code> if {@code s1} is lower than {@code s2}, <code>1</code> if {@code s1} is greater than {@code s2}, otherwise <code>0</code>.
[ "Compare", "the", "two", "given", "segments", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphIterationElementComparator.java#L76-L80
DDTH/ddth-tsc
ddth-tsc-core/src/main/java/com/github/ddth/tsc/redis/RedisCounterFactory.java
RedisCounterFactory.newJedisPool
public static JedisPool newJedisPool(String hostAndPort, String password, int db) { """ Creates a new {@link JedisPool}, with specified database and default timeout. @param hostAndPort @param password @param db @return @since 0.7.0 """ return newJedisPool(hostAndPort, password, db, DEFAULT_TIME...
java
public static JedisPool newJedisPool(String hostAndPort, String password, int db) { return newJedisPool(hostAndPort, password, db, DEFAULT_TIMEOUT_MS); }
[ "public", "static", "JedisPool", "newJedisPool", "(", "String", "hostAndPort", ",", "String", "password", ",", "int", "db", ")", "{", "return", "newJedisPool", "(", "hostAndPort", ",", "password", ",", "db", ",", "DEFAULT_TIMEOUT_MS", ")", ";", "}" ]
Creates a new {@link JedisPool}, with specified database and default timeout. @param hostAndPort @param password @param db @return @since 0.7.0
[ "Creates", "a", "new", "{", "@link", "JedisPool", "}", "with", "specified", "database", "and", "default", "timeout", "." ]
train
https://github.com/DDTH/ddth-tsc/blob/d233c304c8fed2f3c069de42a36b7bbd5c8be01b/ddth-tsc-core/src/main/java/com/github/ddth/tsc/redis/RedisCounterFactory.java#L49-L51
Red5/red5-io
src/main/java/org/red5/io/flv/impl/FLVReader.java
FLVReader.readTagHeader
private ITag readTagHeader() throws UnsupportedDataTypeException { """ Read only header part of a tag. @return Tag header @throws UnsupportedDataTypeException """ // previous tag size (4 bytes) + flv tag header size (11 bytes) fillBuffer(15); // previous tag's size int previ...
java
private ITag readTagHeader() throws UnsupportedDataTypeException { // previous tag size (4 bytes) + flv tag header size (11 bytes) fillBuffer(15); // previous tag's size int previousTagSize = in.getInt(); // start of the flv tag byte dataType = in.get(); if (log.i...
[ "private", "ITag", "readTagHeader", "(", ")", "throws", "UnsupportedDataTypeException", "{", "// previous tag size (4 bytes) + flv tag header size (11 bytes)", "fillBuffer", "(", "15", ")", ";", "// previous tag's size", "int", "previousTagSize", "=", "in", ".", "getInt", "...
Read only header part of a tag. @return Tag header @throws UnsupportedDataTypeException
[ "Read", "only", "header", "part", "of", "a", "tag", "." ]
train
https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/flv/impl/FLVReader.java#L888-L924
adyliu/jafka
src/main/java/io/jafka/consumer/StringConsumers.java
StringConsumers.buildConsumer
public static StringConsumers buildConsumer( final String zookeeperConfig,// final String topic,// final String groupId, // final IMessageListener<String> listener) { """ create a consumer @param zookeeperConfig connect config of zookeeper; ex: 127.0.0.1:2181/jafk...
java
public static StringConsumers buildConsumer( final String zookeeperConfig,// final String topic,// final String groupId, // final IMessageListener<String> listener) { return buildConsumer(zookeeperConfig, topic, groupId, listener, 2); }
[ "public", "static", "StringConsumers", "buildConsumer", "(", "final", "String", "zookeeperConfig", ",", "//", "final", "String", "topic", ",", "//", "final", "String", "groupId", ",", "//", "final", "IMessageListener", "<", "String", ">", "listener", ")", "{", ...
create a consumer @param zookeeperConfig connect config of zookeeper; ex: 127.0.0.1:2181/jafka @param topic the topic to be watched @param groupId grouping the consumer clients @param listener message listener @return the real consumer
[ "create", "a", "consumer" ]
train
https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/consumer/StringConsumers.java#L126-L132
Ordinastie/MalisisCore
src/main/java/net/malisis/core/renderer/animation/transformation/BrightnessTransform.java
BrightnessTransform.doTransform
@Override protected void doTransform(ITransformable.Brightness transformable, float comp) { """ Calculates the transformation. @param transformable the transformable @param comp the comp """ if (comp <= 0) return; float from = reversed ? toBrightness : fromBrightness; float to = reversed ? fromB...
java
@Override protected void doTransform(ITransformable.Brightness transformable, float comp) { if (comp <= 0) return; float from = reversed ? toBrightness : fromBrightness; float to = reversed ? fromBrightness : toBrightness; transformable.setBrightness((int) (from + (to - from) * comp)); }
[ "@", "Override", "protected", "void", "doTransform", "(", "ITransformable", ".", "Brightness", "transformable", ",", "float", "comp", ")", "{", "if", "(", "comp", "<=", "0", ")", "return", ";", "float", "from", "=", "reversed", "?", "toBrightness", ":", "f...
Calculates the transformation. @param transformable the transformable @param comp the comp
[ "Calculates", "the", "transformation", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/BrightnessTransform.java#L91-L101
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHelper.java
SequenceManagerHelper.getMaxForExtent
public static long getMaxForExtent(PersistenceBroker brokerForClass, FieldDescriptor field) throws PersistenceBrokerException { """ Lookup all tables associated with given class (search all extent classes) to find the current maximum value for the given field. <br><b>Note:</b> Only works for <code>long</code> au...
java
public static long getMaxForExtent(PersistenceBroker brokerForClass, FieldDescriptor field) throws PersistenceBrokerException { if (field == null) { log.error("Given FieldDescriptor was null, could not detect max value across all extents"); return 0; // thro...
[ "public", "static", "long", "getMaxForExtent", "(", "PersistenceBroker", "brokerForClass", ",", "FieldDescriptor", "field", ")", "throws", "PersistenceBrokerException", "{", "if", "(", "field", "==", "null", ")", "{", "log", ".", "error", "(", "\"Given FieldDescript...
Lookup all tables associated with given class (search all extent classes) to find the current maximum value for the given field. <br><b>Note:</b> Only works for <code>long</code> autoincrement fields. @param brokerForClass persistence broker instance match the database of the given field/class @param field the target f...
[ "Lookup", "all", "tables", "associated", "with", "given", "class", "(", "search", "all", "extent", "classes", ")", "to", "find", "the", "current", "maximum", "value", "for", "the", "given", "field", ".", "<br", ">", "<b", ">", "Note", ":", "<", "/", "b...
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerHelper.java#L248-L259
morimekta/utils
console-util/src/main/java/net/morimekta/console/terminal/Terminal.java
Terminal.executeAbortable
public <T> T executeAbortable(ExecutorService exec, Callable<T> callable) throws IOException, InterruptedException, ExecutionException { """ Execute callable, which may not be interruptable by itself, but listen to terminal input and abort the task if CTRL-C is pressed. @param exec The executor to ...
java
public <T> T executeAbortable(ExecutorService exec, Callable<T> callable) throws IOException, InterruptedException, ExecutionException { Future<T> task = exec.submit(callable); waitAbortable(task); return task.get(); }
[ "public", "<", "T", ">", "T", "executeAbortable", "(", "ExecutorService", "exec", ",", "Callable", "<", "T", ">", "callable", ")", "throws", "IOException", ",", "InterruptedException", ",", "ExecutionException", "{", "Future", "<", "T", ">", "task", "=", "ex...
Execute callable, which may not be interruptable by itself, but listen to terminal input and abort the task if CTRL-C is pressed. @param exec The executor to run task on. @param callable The callable function. @param <T> The return type of the callable. @return The result of the callable. @throws IOException If aborte...
[ "Execute", "callable", "which", "may", "not", "be", "interruptable", "by", "itself", "but", "listen", "to", "terminal", "input", "and", "abort", "the", "task", "if", "CTRL", "-", "C", "is", "pressed", "." ]
train
https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/console-util/src/main/java/net/morimekta/console/terminal/Terminal.java#L226-L231