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 |
|---|---|---|---|---|---|---|---|---|---|---|
tzaeschke/zoodb | src/org/zoodb/internal/util/FormattedStringBuilder.java | FormattedStringBuilder.fillOrCutBuffer | public FormattedStringBuilder fillOrCutBuffer(int newLength, char c) {
"""
Attempts to append <tt>c</tt> until the buffer gets the length <tt>
newLength</tt>. If the buffer is already longer than <tt>newLength</tt>,
then the internal strings is cut to <tt>newLength</tt>.
@param newLength New length of the retur... | java | public FormattedStringBuilder fillOrCutBuffer(int newLength, char c) {
if (newLength < _delegate.length()) {
_delegate = new StringBuilder(_delegate.substring(0, newLength));
return this;
}
for (int i = _delegate.length(); i < newLength; i++ ) {
_delegat... | [
"public",
"FormattedStringBuilder",
"fillOrCutBuffer",
"(",
"int",
"newLength",
",",
"char",
"c",
")",
"{",
"if",
"(",
"newLength",
"<",
"_delegate",
".",
"length",
"(",
")",
")",
"{",
"_delegate",
"=",
"new",
"StringBuilder",
"(",
"_delegate",
".",
"substri... | Attempts to append <tt>c</tt> until the buffer gets the length <tt>
newLength</tt>. If the buffer is already longer than <tt>newLength</tt>,
then the internal strings is cut to <tt>newLength</tt>.
@param newLength New length of the returned buffer.
@param c Character to append.
@return The updated instance of Formatted... | [
"Attempts",
"to",
"append",
"<tt",
">",
"c<",
"/",
"tt",
">",
"until",
"the",
"buffer",
"gets",
"the",
"length",
"<tt",
">",
"newLength<",
"/",
"tt",
">",
".",
"If",
"the",
"buffer",
"is",
"already",
"longer",
"than",
"<tt",
">",
"newLength<",
"/",
"... | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/FormattedStringBuilder.java#L247-L256 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.reconnectCall | public void reconnectCall(
String connId,
String heldConnId,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
"""
Reconnect the specified call. This releases the established call and retrieves the held call
in one s... | java | public void reconnectCall(
String connId,
String heldConnId,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
try {
VoicecallsidreconnectData reconnectData = new VoicecallsidreconnectData();
... | [
"public",
"void",
"reconnectCall",
"(",
"String",
"connId",
",",
"String",
"heldConnId",
",",
"KeyValueCollection",
"reasons",
",",
"KeyValueCollection",
"extensions",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"VoicecallsidreconnectData",
"reconnectData",
... | Reconnect the specified call. This releases the established call and retrieves the held call
in one step. This is a quick way to to do `releaseCall()` and `retrieveCall()`.
@param connId The connection ID of the established call (will be released).
@param heldConnId The ID of the held call (will be retrieved).
@param r... | [
"Reconnect",
"the",
"specified",
"call",
".",
"This",
"releases",
"the",
"established",
"call",
"and",
"retrieves",
"the",
"held",
"call",
"in",
"one",
"step",
".",
"This",
"is",
"a",
"quick",
"way",
"to",
"to",
"do",
"releaseCall",
"()",
"and",
"retrieveC... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L1292-L1312 |
mazerty/torii | src/main/java/fr/mazerty/torii/cdi/LanguageProxy.java | LanguageProxy.set | public void set(Language language) {
"""
Saves the new selected language in this session bean and in a cookie for future use
@param language the new selected language
"""
this.language = language;
Cookie cookie = new Cookie(COOKIE_NAME, language.name());
cookie.setPath("/");
... | java | public void set(Language language) {
this.language = language;
Cookie cookie = new Cookie(COOKIE_NAME, language.name());
cookie.setPath("/");
cookie.setMaxAge(Integer.MAX_VALUE);
VaadinService.getCurrentResponse().addCookie(cookie);
} | [
"public",
"void",
"set",
"(",
"Language",
"language",
")",
"{",
"this",
".",
"language",
"=",
"language",
";",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"COOKIE_NAME",
",",
"language",
".",
"name",
"(",
")",
")",
";",
"cookie",
".",
"setPath",
"("... | Saves the new selected language in this session bean and in a cookie for future use
@param language the new selected language | [
"Saves",
"the",
"new",
"selected",
"language",
"in",
"this",
"session",
"bean",
"and",
"in",
"a",
"cookie",
"for",
"future",
"use"
] | train | https://github.com/mazerty/torii/blob/d162dff0a50b9c2b0a6415f6d359562461bf0cf1/src/main/java/fr/mazerty/torii/cdi/LanguageProxy.java#L50-L57 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/Environment.java | Environment.get | public String get(String environmentVariableName, String defaultValue) {
"""
Returns the value set for the environment variable identified by the given name. If the environment variable
is not set, then {@code defaultValue} is returned.
@param environmentVariableName {@link String} name of the environment var... | java | public String get(String environmentVariableName, String defaultValue) {
return environmentVariables().get(environmentVariableName, defaultValue);
} | [
"public",
"String",
"get",
"(",
"String",
"environmentVariableName",
",",
"String",
"defaultValue",
")",
"{",
"return",
"environmentVariables",
"(",
")",
".",
"get",
"(",
"environmentVariableName",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value set for the environment variable identified by the given name. If the environment variable
is not set, then {@code defaultValue} is returned.
@param environmentVariableName {@link String} name of the environment variable.
@param defaultValue the default value to return if the specified environment v... | [
"Returns",
"the",
"value",
"set",
"for",
"the",
"environment",
"variable",
"identified",
"by",
"the",
"given",
"name",
".",
"If",
"the",
"environment",
"variable",
"is",
"not",
"set",
"then",
"{",
"@code",
"defaultValue",
"}",
"is",
"returned",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/Environment.java#L234-L236 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/CreateIdentityPoolResult.java | CreateIdentityPoolResult.withSupportedLoginProviders | public CreateIdentityPoolResult withSupportedLoginProviders(java.util.Map<String, String> supportedLoginProviders) {
"""
<p>
Optional key:value pairs mapping provider names to provider app IDs.
</p>
@param supportedLoginProviders
Optional key:value pairs mapping provider names to provider app IDs.
@return R... | java | public CreateIdentityPoolResult withSupportedLoginProviders(java.util.Map<String, String> supportedLoginProviders) {
setSupportedLoginProviders(supportedLoginProviders);
return this;
} | [
"public",
"CreateIdentityPoolResult",
"withSupportedLoginProviders",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"supportedLoginProviders",
")",
"{",
"setSupportedLoginProviders",
"(",
"supportedLoginProviders",
")",
";",
"return",
"this",
... | <p>
Optional key:value pairs mapping provider names to provider app IDs.
</p>
@param supportedLoginProviders
Optional key:value pairs mapping provider names to provider app IDs.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Optional",
"key",
":",
"value",
"pairs",
"mapping",
"provider",
"names",
"to",
"provider",
"app",
"IDs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/CreateIdentityPoolResult.java#L252-L255 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/MutableURI.java | MutableURI.setQuery | public void setQuery( String query ) {
"""
Sets (and resets) the query string.
This method assumes that the query is already encoded and escaped.
@param query Query string
"""
_parameters = null;
if ( query == null || query.length() == 0 ) { return; }
for ( StringTokenizer tok = n... | java | public void setQuery( String query )
{
_parameters = null;
if ( query == null || query.length() == 0 ) { return; }
for ( StringTokenizer tok = new StringTokenizer( query, "&" ); tok.hasMoreElements(); )
{
String queryItem = tok.nextToken();
if ( queryItem.s... | [
"public",
"void",
"setQuery",
"(",
"String",
"query",
")",
"{",
"_parameters",
"=",
"null",
";",
"if",
"(",
"query",
"==",
"null",
"||",
"query",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"for",
"(",
"StringTokenizer",
"tok",
... | Sets (and resets) the query string.
This method assumes that the query is already encoded and escaped.
@param query Query string | [
"Sets",
"(",
"and",
"resets",
")",
"the",
"query",
"string",
".",
"This",
"method",
"assumes",
"that",
"the",
"query",
"is",
"already",
"encoded",
"and",
"escaped",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/MutableURI.java#L486-L511 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.getAnnotationAttribute | public static Object getAnnotationAttribute(final Annotation annotation, final String attributeName) {
"""
Retrieve an annotation property dynamically by reflection.
@param annotation the annotation to explore
@param attributeName the name of the method to call
@return the property value
"""
Obj... | java | public static Object getAnnotationAttribute(final Annotation annotation, final String attributeName) {
Object object = null;
try {
// Get the annotation method for the given name
final Method attributeMethod = annotation.annotationType().getDeclaredMethod(attributeName);
... | [
"public",
"static",
"Object",
"getAnnotationAttribute",
"(",
"final",
"Annotation",
"annotation",
",",
"final",
"String",
"attributeName",
")",
"{",
"Object",
"object",
"=",
"null",
";",
"try",
"{",
"// Get the annotation method for the given name",
"final",
"Method",
... | Retrieve an annotation property dynamically by reflection.
@param annotation the annotation to explore
@param attributeName the name of the method to call
@return the property value | [
"Retrieve",
"an",
"annotation",
"property",
"dynamically",
"by",
"reflection",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L417-L432 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/landf/ScreenUtil.java | ScreenUtil.setColor | public static void setColor(String strProperty, ColorUIResource color, PropertyOwner propertyOwner, Map<String,Object> properties) {
"""
Set this property to this color.
(Utility method).
@param strProperty The key to save this color as.
@param color The registered color for this property key.
"""
i... | java | public static void setColor(String strProperty, ColorUIResource color, PropertyOwner propertyOwner, Map<String,Object> properties)
{
if (color != null)
ScreenUtil.setProperty(strProperty, "#" + Integer.toHexString(color.getRGB() & 0xFFFFFF), propertyOwner, properties);
else
S... | [
"public",
"static",
"void",
"setColor",
"(",
"String",
"strProperty",
",",
"ColorUIResource",
"color",
",",
"PropertyOwner",
"propertyOwner",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"color",
"!=",
"null",
")",
"Scree... | Set this property to this color.
(Utility method).
@param strProperty The key to save this color as.
@param color The registered color for this property key. | [
"Set",
"this",
"property",
"to",
"this",
"color",
".",
"(",
"Utility",
"method",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/landf/ScreenUtil.java#L200-L206 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/http/HttpCredential.java | HttpCredential.toCredentials | @Nullable
public final Credentials toCredentials(final AuthScope authscope) {
"""
Check if this applies to the provided authorization scope and return the credentials for that scope or
null if it doesn't apply to the scope.
@param authscope the scope to test against.
"""
try {
if (... | java | @Nullable
public final Credentials toCredentials(final AuthScope authscope) {
try {
if (!matches(MatchInfo.fromAuthScope(authscope))) {
return null;
}
} catch (UnknownHostException | MalformedURLException | SocketException e) {
throw new RuntimeEx... | [
"@",
"Nullable",
"public",
"final",
"Credentials",
"toCredentials",
"(",
"final",
"AuthScope",
"authscope",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"matches",
"(",
"MatchInfo",
".",
"fromAuthScope",
"(",
"authscope",
")",
")",
")",
"{",
"return",
"null",
";"... | Check if this applies to the provided authorization scope and return the credentials for that scope or
null if it doesn't apply to the scope.
@param authscope the scope to test against. | [
"Check",
"if",
"this",
"applies",
"to",
"the",
"provided",
"authorization",
"scope",
"and",
"return",
"the",
"credentials",
"for",
"that",
"scope",
"or",
"null",
"if",
"it",
"doesn",
"t",
"apply",
"to",
"the",
"scope",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/http/HttpCredential.java#L104-L125 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/UnifierConfiguration.java | UnifierConfiguration.setEquivalence | public final void setEquivalence(String feature, String type,
PatternToken elem) {
"""
Prepares equivalence types for features to be tested. All equivalence
types are given as {@link PatternToken}s. They create an equivalence set (with
abstraction).
@param feature Feature to... | java | public final void setEquivalence(String feature, String type,
PatternToken elem) {
EquivalenceTypeLocator typeKey = new EquivalenceTypeLocator(feature, type);
if (equivalenceTypes.containsKey(typeKey)) {
return;
}
equivalenceTypes.put(typeKey, elem);
Li... | [
"public",
"final",
"void",
"setEquivalence",
"(",
"String",
"feature",
",",
"String",
"type",
",",
"PatternToken",
"elem",
")",
"{",
"EquivalenceTypeLocator",
"typeKey",
"=",
"new",
"EquivalenceTypeLocator",
"(",
"feature",
",",
"type",
")",
";",
"if",
"(",
"e... | Prepares equivalence types for features to be tested. All equivalence
types are given as {@link PatternToken}s. They create an equivalence set (with
abstraction).
@param feature Feature to be tested, like gender, grammatical case or number.
@param type Type of equivalence for the feature, for example plural, first per... | [
"Prepares",
"equivalence",
"types",
"for",
"features",
"to",
"be",
"tested",
".",
"All",
"equivalence",
"types",
"are",
"given",
"as",
"{",
"@link",
"PatternToken",
"}",
"s",
".",
"They",
"create",
"an",
"equivalence",
"set",
"(",
"with",
"abstraction",
")",... | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/UnifierConfiguration.java#L60-L78 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Shape.java | Shape.drawWithoutTransforms | @Override
protected void drawWithoutTransforms(final Context2D context, double alpha, final BoundingBox bounds) {
"""
Used internally. Draws the node in the current Context2D
without applying the transformation-related attributes
(e.g. X, Y, ROTATION, SCALE, SHEAR, OFFSET and TRANSFORM.)
<p>
Shapes should ... | java | @Override
protected void drawWithoutTransforms(final Context2D context, double alpha, final BoundingBox bounds)
{
final Attributes attr = getAttributes();
alpha = alpha * attr.getAlpha();
if (alpha <= 0)
{
return;
}
if (context.isSelection())
... | [
"@",
"Override",
"protected",
"void",
"drawWithoutTransforms",
"(",
"final",
"Context2D",
"context",
",",
"double",
"alpha",
",",
"final",
"BoundingBox",
"bounds",
")",
"{",
"final",
"Attributes",
"attr",
"=",
"getAttributes",
"(",
")",
";",
"alpha",
"=",
"alp... | Used internally. Draws the node in the current Context2D
without applying the transformation-related attributes
(e.g. X, Y, ROTATION, SCALE, SHEAR, OFFSET and TRANSFORM.)
<p>
Shapes should apply the non-Transform related attributes (such a colors, strokeWidth etc.)
and draw the Shape's details (such as the the actual l... | [
"Used",
"internally",
".",
"Draws",
"the",
"node",
"in",
"the",
"current",
"Context2D",
"without",
"applying",
"the",
"transformation",
"-",
"related",
"attributes",
"(",
"e",
".",
"g",
".",
"X",
"Y",
"ROTATION",
"SCALE",
"SHEAR",
"OFFSET",
"and",
"TRANSFORM... | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L232-L260 |
aeshell/aesh-readline | readline/src/main/java/org/aesh/readline/util/Parser.java | Parser.canDisplayColumns | private static boolean canDisplayColumns(List<TerminalString> displayList, int numRows, int terminalWidth) {
"""
Decides if it's possible to format provided Strings into calculated number of columns while the output will not exceed
terminal width
@param displayList
@param numRows
@param terminalWidth
@retur... | java | private static boolean canDisplayColumns(List<TerminalString> displayList, int numRows, int terminalWidth) {
int numColumns = displayList.size() / numRows;
if (displayList.size() % numRows > 0) {
numColumns++;
}
int[] columnSizes = calculateColumnSizes(displayList, numColum... | [
"private",
"static",
"boolean",
"canDisplayColumns",
"(",
"List",
"<",
"TerminalString",
">",
"displayList",
",",
"int",
"numRows",
",",
"int",
"terminalWidth",
")",
"{",
"int",
"numColumns",
"=",
"displayList",
".",
"size",
"(",
")",
"/",
"numRows",
";",
"i... | Decides if it's possible to format provided Strings into calculated number of columns while the output will not exceed
terminal width
@param displayList
@param numRows
@param terminalWidth
@return true if it's possible to format strings to columns and false otherwise. | [
"Decides",
"if",
"it",
"s",
"possible",
"to",
"format",
"provided",
"Strings",
"into",
"calculated",
"number",
"of",
"columns",
"while",
"the",
"output",
"will",
"not",
"exceed",
"terminal",
"width"
] | train | https://github.com/aeshell/aesh-readline/blob/3d7258f6490a422658ec85c8457514390c03232d/readline/src/main/java/org/aesh/readline/util/Parser.java#L253-L267 |
comapi/comapi-chat-sdk-android | COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java | ChatController.queryEventsRecursively | private Observable<ComapiResult<ConversationEventsResponse>> queryEventsRecursively(final RxComapiClient client, final String conversationId, final long lastEventId, final int count, final List<Boolean> successes) {
"""
Synchronise missing events for particular conversation.
@param client Foundation cli... | java | private Observable<ComapiResult<ConversationEventsResponse>> queryEventsRecursively(final RxComapiClient client, final String conversationId, final long lastEventId, final int count, final List<Boolean> successes) {
return client.service().messaging().queryConversationEvents(conversationId, lastEventId, events... | [
"private",
"Observable",
"<",
"ComapiResult",
"<",
"ConversationEventsResponse",
">",
">",
"queryEventsRecursively",
"(",
"final",
"RxComapiClient",
"client",
",",
"final",
"String",
"conversationId",
",",
"final",
"long",
"lastEventId",
",",
"final",
"int",
"count",
... | Synchronise missing events for particular conversation.
@param client Foundation client.
@param conversationId Unique ID of a conversation.
@param lastEventId Last known event id - query should start form it.
@param count Number of queries already made.
@param successes list of query & process... | [
"Synchronise",
"missing",
"events",
"for",
"particular",
"conversation",
"."
] | train | https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java#L600-L611 |
jfinal/jfinal | src/main/java/com/jfinal/template/expr/ExprParser.java | ExprParser.staticMember | Expr staticMember() {
"""
staticMember
: ID_list '::' ID
| ID_list '::' ID '(' exprList? ')'
"""
if (peek().sym != Sym.ID) {
return sharedMethod();
}
int begin = forward;
while (move().sym == Sym.DOT && move().sym == Sym.ID) {
;
}
// ID.ID.ID::
if (peek().sym != Sym.STATIC ||... | java | Expr staticMember() {
if (peek().sym != Sym.ID) {
return sharedMethod();
}
int begin = forward;
while (move().sym == Sym.DOT && move().sym == Sym.ID) {
;
}
// ID.ID.ID::
if (peek().sym != Sym.STATIC || tokenList.get(forward - 1).sym != Sym.ID) {
resetForward(begin);
return share... | [
"Expr",
"staticMember",
"(",
")",
"{",
"if",
"(",
"peek",
"(",
")",
".",
"sym",
"!=",
"Sym",
".",
"ID",
")",
"{",
"return",
"sharedMethod",
"(",
")",
";",
"}",
"int",
"begin",
"=",
"forward",
";",
"while",
"(",
"move",
"(",
")",
".",
"sym",
"==... | staticMember
: ID_list '::' ID
| ID_list '::' ID '(' exprList? ')' | [
"staticMember",
":",
"ID_list",
"::",
"ID",
"|",
"ID_list",
"::",
"ID",
"(",
"exprList?",
")"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/template/expr/ExprParser.java#L303-L337 |
weld/core | impl/src/main/java/org/jboss/weld/util/reflection/HierarchyDiscovery.java | HierarchyDiscovery.processTypeVariables | private void processTypeVariables(TypeVariable<?>[] variables, Type[] values) {
"""
/*
Processing part. Every type variable is mapped to the actual type in the resolvedTypeVariablesMap. This map is used later
on for resolving types.
"""
for (int i = 0; i < variables.length; i++) {
process... | java | private void processTypeVariables(TypeVariable<?>[] variables, Type[] values) {
for (int i = 0; i < variables.length; i++) {
processTypeVariable(variables[i], values[i]);
}
} | [
"private",
"void",
"processTypeVariables",
"(",
"TypeVariable",
"<",
"?",
">",
"[",
"]",
"variables",
",",
"Type",
"[",
"]",
"values",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"variables",
".",
"length",
";",
"i",
"++",
")",
"{",
... | /*
Processing part. Every type variable is mapped to the actual type in the resolvedTypeVariablesMap. This map is used later
on for resolving types. | [
"/",
"*",
"Processing",
"part",
".",
"Every",
"type",
"variable",
"is",
"mapped",
"to",
"the",
"actual",
"type",
"in",
"the",
"resolvedTypeVariablesMap",
".",
"This",
"map",
"is",
"used",
"later",
"on",
"for",
"resolving",
"types",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/reflection/HierarchyDiscovery.java#L172-L176 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java | LogFaxClientSpiInterceptor.logEvent | protected void logEvent(FaxClientSpiProxyEventType eventType,Method method,Object[] arguments,Object output,Throwable throwable) {
"""
This function logs the event.
@param eventType
The event type
@param method
The method invoked
@param arguments
The method arguments
@param output
The method outp... | java | protected void logEvent(FaxClientSpiProxyEventType eventType,Method method,Object[] arguments,Object output,Throwable throwable)
{
//init log data
int amount=3;
int argumentsAmount=0;
if(arguments!=null)
{
argumentsAmount=arguments.length;
}
if(eve... | [
"protected",
"void",
"logEvent",
"(",
"FaxClientSpiProxyEventType",
"eventType",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"arguments",
",",
"Object",
"output",
",",
"Throwable",
"throwable",
")",
"{",
"//init log data",
"int",
"amount",
"=",
"3",
";",
... | This function logs the event.
@param eventType
The event type
@param method
The method invoked
@param arguments
The method arguments
@param output
The method output
@param throwable
The throwable while invoking the method | [
"This",
"function",
"logs",
"the",
"event",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java#L90-L148 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ReplicationLinksInner.java | ReplicationLinksInner.beginFailover | public void beginFailover(String resourceGroupName, String serverName, String databaseName, String linkId) {
"""
Sets which replica database is primary by failing over from the current primary replica database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain th... | java | public void beginFailover(String resourceGroupName, String serverName, String databaseName, String linkId) {
beginFailoverWithServiceResponseAsync(resourceGroupName, serverName, databaseName, linkId).toBlocking().single().body();
} | [
"public",
"void",
"beginFailover",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"linkId",
")",
"{",
"beginFailoverWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"databaseName... | Sets which replica database is primary by failing over from the current primary replica database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseNam... | [
"Sets",
"which",
"replica",
"database",
"is",
"primary",
"by",
"failing",
"over",
"from",
"the",
"current",
"primary",
"replica",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ReplicationLinksInner.java#L380-L382 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitIdentifier | @Override
public R visitIdentifier(IdentifierTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitIdentifier(IdentifierTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitIdentifier",
"(",
"IdentifierTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L225-L228 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java | OmemoManager.isTrustedOmemoIdentity | public boolean isTrustedOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) {
"""
Returns true, if the fingerprint/OmemoDevice tuple is trusted, otherwise false.
The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must
be of length 64.
@param device de... | java | public boolean isTrustedOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) {
if (trustCallback == null) {
throw new IllegalStateException("No TrustCallback set.");
}
return trustCallback.getTrust(device, fingerprint) == TrustState.trusted;
} | [
"public",
"boolean",
"isTrustedOmemoIdentity",
"(",
"OmemoDevice",
"device",
",",
"OmemoFingerprint",
"fingerprint",
")",
"{",
"if",
"(",
"trustCallback",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"No TrustCallback set.\"",
")",
";",
"}... | Returns true, if the fingerprint/OmemoDevice tuple is trusted, otherwise false.
The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must
be of length 64.
@param device device
@param fingerprint fingerprint
@return | [
"Returns",
"true",
"if",
"the",
"fingerprint",
"/",
"OmemoDevice",
"tuple",
"is",
"trusted",
"otherwise",
"false",
".",
"The",
"fingerprint",
"must",
"be",
"the",
"lowercase",
"hexadecimal",
"fingerprint",
"of",
"the",
"identityKey",
"of",
"the",
"device",
"and"... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java#L451-L457 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java | ListIterate.detectLastIndex | public static <T> int detectLastIndex(List<T> list, Predicate<? super T> predicate) {
"""
Returns the last index where the predicate evaluates to true.
Returns -1 for no matches.
"""
if (list instanceof RandomAccess)
{
return RandomAccessListIterate.detectLastIndex(list, predicate)... | java | public static <T> int detectLastIndex(List<T> list, Predicate<? super T> predicate)
{
if (list instanceof RandomAccess)
{
return RandomAccessListIterate.detectLastIndex(list, predicate);
}
int size = list.size();
int i = size - 1;
ListIterator<T> reverseIt... | [
"public",
"static",
"<",
"T",
">",
"int",
"detectLastIndex",
"(",
"List",
"<",
"T",
">",
"list",
",",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"if",
"(",
"list",
"instanceof",
"RandomAccess",
")",
"{",
"return",
"RandomAccessListI... | Returns the last index where the predicate evaluates to true.
Returns -1 for no matches. | [
"Returns",
"the",
"last",
"index",
"where",
"the",
"predicate",
"evaluates",
"to",
"true",
".",
"Returns",
"-",
"1",
"for",
"no",
"matches",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/ListIterate.java#L1243-L1261 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.resetPassword | public void resetPassword(CmsRequestContext context, String username, String oldPassword, String newPassword)
throws CmsException, CmsSecurityException {
"""
Resets the password for a specified user.<p>
@param context the current request context
@param username the name of the user
@param oldPassword the ... | java | public void resetPassword(CmsRequestContext context, String username, String oldPassword, String newPassword)
throws CmsException, CmsSecurityException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.resetPassword(
dbc,
... | [
"public",
"void",
"resetPassword",
"(",
"CmsRequestContext",
"context",
",",
"String",
"username",
",",
"String",
"oldPassword",
",",
"String",
"newPassword",
")",
"throws",
"CmsException",
",",
"CmsSecurityException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFact... | Resets the password for a specified user.<p>
@param context the current request context
@param username the name of the user
@param oldPassword the old password
@param newPassword the new password
@throws CmsException if the user data could not be read from the database
@throws CmsSecurityException if the specified u... | [
"Resets",
"the",
"password",
"for",
"a",
"specified",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L5751-L5766 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java | SourceWriteUtil.writeMethod | public void writeMethod(SourceWriter writer, String signature, String body) {
"""
Writes a method with the given signature and body to the source writer.
@param writer writer that the method is written to
@param signature method's signature
@param body method's body
"""
writer.println(signature + " {"... | java | public void writeMethod(SourceWriter writer, String signature, String body) {
writer.println(signature + " {");
writer.indent();
writer.println(body);
writer.outdent();
writer.println("}");
writer.println();
} | [
"public",
"void",
"writeMethod",
"(",
"SourceWriter",
"writer",
",",
"String",
"signature",
",",
"String",
"body",
")",
"{",
"writer",
".",
"println",
"(",
"signature",
"+",
"\" {\"",
")",
";",
"writer",
".",
"indent",
"(",
")",
";",
"writer",
".",
"prin... | Writes a method with the given signature and body to the source writer.
@param writer writer that the method is written to
@param signature method's signature
@param body method's body | [
"Writes",
"a",
"method",
"with",
"the",
"given",
"signature",
"and",
"body",
"to",
"the",
"source",
"writer",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceWriteUtil.java#L260-L267 |
hdecarne/java-default | src/main/java/de/carne/util/SystemProperties.java | SystemProperties.booleanValue | public static boolean booleanValue(Class<?> clazz, String key, boolean defaultValue) {
"""
Gets a {@code boolean} system property value.
@param clazz the {@linkplain Class} to derive the property key from.
@param key the system property key (relative to the submitted {@linkplain Class}) to get.
@param default... | java | public static boolean booleanValue(Class<?> clazz, String key, boolean defaultValue) {
return booleanValue(clazz.getName() + key, defaultValue);
} | [
"public",
"static",
"boolean",
"booleanValue",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"return",
"booleanValue",
"(",
"clazz",
".",
"getName",
"(",
")",
"+",
"key",
",",
"defaultValue",
")",
"... | Gets a {@code boolean} system property value.
@param clazz the {@linkplain Class} to derive the property key from.
@param key the system property key (relative to the submitted {@linkplain Class}) to get.
@param defaultValue The default value to return in case the property is not defined.
@return The property value or... | [
"Gets",
"a",
"{",
"@code",
"boolean",
"}",
"system",
"property",
"value",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/util/SystemProperties.java#L103-L105 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.feedForward | public Map<String, INDArray> feedForward(INDArray[] input, boolean train, boolean clearInputs) {
"""
Conduct forward pass using an array of inputs. This overload allows the forward pass to be conducted, optionally
(not) clearing the layer input arrays.<br>
Note: this method should NOT be used with clearInputs = ... | java | public Map<String, INDArray> feedForward(INDArray[] input, boolean train, boolean clearInputs){
setInputs(input);
try {
return ffToLayerActivationsDetached(train, FwdPassType.STANDARD, false, vertices.length - 1,
null, input, inputMaskArrays, labelMaskArrays, clearInputs)... | [
"public",
"Map",
"<",
"String",
",",
"INDArray",
">",
"feedForward",
"(",
"INDArray",
"[",
"]",
"input",
",",
"boolean",
"train",
",",
"boolean",
"clearInputs",
")",
"{",
"setInputs",
"(",
"input",
")",
";",
"try",
"{",
"return",
"ffToLayerActivationsDetache... | Conduct forward pass using an array of inputs. This overload allows the forward pass to be conducted, optionally
(not) clearing the layer input arrays.<br>
Note: this method should NOT be used with clearInputs = true, unless you know what you are doing. Specifically:
when using clearInputs=false, in combination with wo... | [
"Conduct",
"forward",
"pass",
"using",
"an",
"array",
"of",
"inputs",
".",
"This",
"overload",
"allows",
"the",
"forward",
"pass",
"to",
"be",
"conducted",
"optionally",
"(",
"not",
")",
"clearing",
"the",
"layer",
"input",
"arrays",
".",
"<br",
">",
"Note... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L1549-L1558 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/servlet/filters/RequestSecurityFilter.java | RequestSecurityFilter.doFilter | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
ServletException {
"""
If {@code securityEnabled}, passes the request through the chain of {@link RequestSecurityProcessor}s,
depending if the request URL
matches or not the {@code urlsToInclude}... | java | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
ServletException {
HttpServletRequest httpRequest = (HttpServletRequest)request;
if (securityEnabled && (includeRequest(httpRequest) || !excludeRequest(httpRequest))) {
doFi... | [
"public",
"void",
"doFilter",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
",",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"HttpServletRequest",
"httpRequest",
"=",
"(",
"HttpServletRequest",
")",
"requ... | If {@code securityEnabled}, passes the request through the chain of {@link RequestSecurityProcessor}s,
depending if the request URL
matches or not the {@code urlsToInclude} or the {@code urlsToExclude}. The last processor of the chain calls
the actual filter
chain.
@param request
@param response
@param chain
@throws I... | [
"If",
"{",
"@code",
"securityEnabled",
"}",
"passes",
"the",
"request",
"through",
"the",
"chain",
"of",
"{",
"@link",
"RequestSecurityProcessor",
"}",
"s",
"depending",
"if",
"the",
"request",
"URL",
"matches",
"or",
"not",
"the",
"{",
"@code",
"urlsToInclude... | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/servlet/filters/RequestSecurityFilter.java#L105-L114 |
Stratio/bdt | src/main/java/com/stratio/qa/utils/CassandraUtils.java | CassandraUtils.existsKeyspace | public boolean existsKeyspace(String keyspace, boolean showLog) {
"""
Checks if a keyspace exists in Cassandra.
@param keyspace
@param showLog
@return boolean
"""
this.metadata = cluster.getMetadata();
if (!(this.metadata.getKeyspaces().isEmpty())) {
for (KeyspaceMetadata k : m... | java | public boolean existsKeyspace(String keyspace, boolean showLog) {
this.metadata = cluster.getMetadata();
if (!(this.metadata.getKeyspaces().isEmpty())) {
for (KeyspaceMetadata k : metadata.getKeyspaces()) {
if (k.getName().equals(keyspace)) {
return true;
... | [
"public",
"boolean",
"existsKeyspace",
"(",
"String",
"keyspace",
",",
"boolean",
"showLog",
")",
"{",
"this",
".",
"metadata",
"=",
"cluster",
".",
"getMetadata",
"(",
")",
";",
"if",
"(",
"!",
"(",
"this",
".",
"metadata",
".",
"getKeyspaces",
"(",
")"... | Checks if a keyspace exists in Cassandra.
@param keyspace
@param showLog
@return boolean | [
"Checks",
"if",
"a",
"keyspace",
"exists",
"in",
"Cassandra",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/utils/CassandraUtils.java#L215-L225 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationAssertionAxiomImpl_CustomFieldSerializer.java | OWLAnnotationAssertionAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLAnnotationAssertionAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.go... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLAnnotationAssertionAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLAnnotationAssertionAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLAnnotationAssertionAxiomImpl_CustomFieldSerializer.java#L71-L74 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java | ManagementEnforcer.addNamedGroupingPolicy | public boolean addNamedGroupingPolicy(String ptype, String... params) {
"""
addNamedGroupingPolicy adds a named role inheritance rule to the current policy.
If the rule already exists, the function returns false and the rule will not be added.
Otherwise the function returns true by adding the new rule.
@param... | java | public boolean addNamedGroupingPolicy(String ptype, String... params) {
return addNamedGroupingPolicy(ptype, Arrays.asList(params));
} | [
"public",
"boolean",
"addNamedGroupingPolicy",
"(",
"String",
"ptype",
",",
"String",
"...",
"params",
")",
"{",
"return",
"addNamedGroupingPolicy",
"(",
"ptype",
",",
"Arrays",
".",
"asList",
"(",
"params",
")",
")",
";",
"}"
] | addNamedGroupingPolicy adds a named role inheritance rule to the current policy.
If the rule already exists, the function returns false and the rule will not be added.
Otherwise the function returns true by adding the new rule.
@param ptype the policy type, can be "g", "g2", "g3", ..
@param params the "g" policy rule.... | [
"addNamedGroupingPolicy",
"adds",
"a",
"named",
"role",
"inheritance",
"rule",
"to",
"the",
"current",
"policy",
".",
"If",
"the",
"rule",
"already",
"exists",
"the",
"function",
"returns",
"false",
"and",
"the",
"rule",
"will",
"not",
"be",
"added",
".",
"O... | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java#L466-L468 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/PartialUpdate.java | PartialUpdate.increaseValueOfField | public void increaseValueOfField(String fieldName, Object value) {
"""
Add field with given name and value using {@link UpdateAction#INC} to the fields to be updated.
@param fieldName
@param value
"""
add(new SimpleUpdateField(fieldName, value, UpdateAction.INC));
} | java | public void increaseValueOfField(String fieldName, Object value) {
add(new SimpleUpdateField(fieldName, value, UpdateAction.INC));
} | [
"public",
"void",
"increaseValueOfField",
"(",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"add",
"(",
"new",
"SimpleUpdateField",
"(",
"fieldName",
",",
"value",
",",
"UpdateAction",
".",
"INC",
")",
")",
";",
"}"
] | Add field with given name and value using {@link UpdateAction#INC} to the fields to be updated.
@param fieldName
@param value | [
"Add",
"field",
"with",
"given",
"name",
"and",
"value",
"using",
"{",
"@link",
"UpdateAction#INC",
"}",
"to",
"the",
"fields",
"to",
"be",
"updated",
"."
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/PartialUpdate.java#L99-L101 |
prestodb/presto | presto-hive/src/main/java/com/facebook/presto/hive/parquet/ParquetTimestampUtils.java | ParquetTimestampUtils.getTimestampMillis | public static long getTimestampMillis(Binary timestampBinary) {
"""
Returns GMT timestamp from binary encoded parquet timestamp (12 bytes - julian date + time of day nanos).
@param timestampBinary INT96 parquet timestamp
@return timestamp in millis, GMT timezone
"""
if (timestampBinary.length() != ... | java | public static long getTimestampMillis(Binary timestampBinary)
{
if (timestampBinary.length() != 12) {
throw new PrestoException(HIVE_BAD_DATA, "Parquet timestamp must be 12 bytes, actual " + timestampBinary.length());
}
byte[] bytes = timestampBinary.getBytes();
// littl... | [
"public",
"static",
"long",
"getTimestampMillis",
"(",
"Binary",
"timestampBinary",
")",
"{",
"if",
"(",
"timestampBinary",
".",
"length",
"(",
")",
"!=",
"12",
")",
"{",
"throw",
"new",
"PrestoException",
"(",
"HIVE_BAD_DATA",
",",
"\"Parquet timestamp must be 12... | Returns GMT timestamp from binary encoded parquet timestamp (12 bytes - julian date + time of day nanos).
@param timestampBinary INT96 parquet timestamp
@return timestamp in millis, GMT timezone | [
"Returns",
"GMT",
"timestamp",
"from",
"binary",
"encoded",
"parquet",
"timestamp",
"(",
"12",
"bytes",
"-",
"julian",
"date",
"+",
"time",
"of",
"day",
"nanos",
")",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-hive/src/main/java/com/facebook/presto/hive/parquet/ParquetTimestampUtils.java#L45-L57 |
google/closure-templates | java/src/com/google/template/soy/internal/i18n/BidiGlobalDir.java | BidiGlobalDir.forIsRtlCodeSnippet | public static BidiGlobalDir forIsRtlCodeSnippet(
String isRtlCodeSnippet, @Nullable String namespace, SoyBackendKind backend) {
"""
Creates a bidi global direction that can only be determined at template runtime, by evaluating
a given source code snippet that yields a boolean value where true indicates rtl.... | java | public static BidiGlobalDir forIsRtlCodeSnippet(
String isRtlCodeSnippet, @Nullable String namespace, SoyBackendKind backend) {
Preconditions.checkArgument(
isRtlCodeSnippet != null && isRtlCodeSnippet.length() > 0,
"Bidi global direction source code snippet must be non-empty.");
Precondit... | [
"public",
"static",
"BidiGlobalDir",
"forIsRtlCodeSnippet",
"(",
"String",
"isRtlCodeSnippet",
",",
"@",
"Nullable",
"String",
"namespace",
",",
"SoyBackendKind",
"backend",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"isRtlCodeSnippet",
"!=",
"null",
"&&",
... | Creates a bidi global direction that can only be determined at template runtime, by evaluating
a given source code snippet that yields a boolean value where true indicates rtl.
@param isRtlCodeSnippet A code snippet that will evaluate at template runtime to a boolean
value indicating whether the bidi global direction ... | [
"Creates",
"a",
"bidi",
"global",
"direction",
"that",
"can",
"only",
"be",
"determined",
"at",
"template",
"runtime",
"by",
"evaluating",
"a",
"given",
"source",
"code",
"snippet",
"that",
"yields",
"a",
"boolean",
"value",
"where",
"true",
"indicates",
"rtl"... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/BidiGlobalDir.java#L112-L125 |
hal/elemento | core/src/main/java/org/jboss/gwt/elemento/core/Elements.java | Elements.onAttach | public static void onAttach(HTMLElement element, ObserverCallback callback) {
"""
Registers a callback when an element is appended to the document body. Note that the callback will be called
only once, if the element is appended more than once a new callback should be registered.
@param element the HTML eleme... | java | public static void onAttach(HTMLElement element, ObserverCallback callback) {
if (element != null) {
BodyObserver.addAttachObserver(element, callback);
}
} | [
"public",
"static",
"void",
"onAttach",
"(",
"HTMLElement",
"element",
",",
"ObserverCallback",
"callback",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"BodyObserver",
".",
"addAttachObserver",
"(",
"element",
",",
"callback",
")",
";",
"}",
"}"
... | Registers a callback when an element is appended to the document body. Note that the callback will be called
only once, if the element is appended more than once a new callback should be registered.
@param element the HTML element which is going to be added to the body
@param callback {@link ObserverCallback} | [
"Registers",
"a",
"callback",
"when",
"an",
"element",
"is",
"appended",
"to",
"the",
"document",
"body",
".",
"Note",
"that",
"the",
"callback",
"will",
"be",
"called",
"only",
"once",
"if",
"the",
"element",
"is",
"appended",
"more",
"than",
"once",
"a",... | train | https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/core/src/main/java/org/jboss/gwt/elemento/core/Elements.java#L742-L746 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java | StringSupport.getStackTrace | public static String getStackTrace(Throwable t, int depth, String prefix) {
"""
Retrieves stack trace from throwable.
@param t
@param depth
@param prefix
@return
"""
StringBuffer retval = new StringBuffer();
int nrWritten = 0;
retval.append(t.toString() + " with message: " + t.getMessage());
Stac... | java | public static String getStackTrace(Throwable t, int depth, String prefix) {
StringBuffer retval = new StringBuffer();
int nrWritten = 0;
retval.append(t.toString() + " with message: " + t.getMessage());
StackTraceElement[] elements = t.getStackTrace();
for (int i = 0; nrWritten < depth && i < elements.length;... | [
"public",
"static",
"String",
"getStackTrace",
"(",
"Throwable",
"t",
",",
"int",
"depth",
",",
"String",
"prefix",
")",
"{",
"StringBuffer",
"retval",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"int",
"nrWritten",
"=",
"0",
";",
"retval",
".",
"append",
... | Retrieves stack trace from throwable.
@param t
@param depth
@param prefix
@return | [
"Retrieves",
"stack",
"trace",
"from",
"throwable",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L976-L989 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeInference.java | TypeInference.inferTemplatedTypesForCall | private boolean inferTemplatedTypesForCall(Node n, FunctionType fnType, FlowScope scope) {
"""
For functions that use template types, specialize the function type for the call target based
on the call-site specific arguments. Specifically, this enables inference to set the type of
any function literal parameters... | java | private boolean inferTemplatedTypesForCall(Node n, FunctionType fnType, FlowScope scope) {
ImmutableList<TemplateType> keys = fnType.getTemplateTypeMap().getTemplateKeys();
if (keys.isEmpty()) {
return false;
}
// Try to infer the template types
Map<TemplateType, JSType> rawInferrence = infer... | [
"private",
"boolean",
"inferTemplatedTypesForCall",
"(",
"Node",
"n",
",",
"FunctionType",
"fnType",
",",
"FlowScope",
"scope",
")",
"{",
"ImmutableList",
"<",
"TemplateType",
">",
"keys",
"=",
"fnType",
".",
"getTemplateTypeMap",
"(",
")",
".",
"getTemplateKeys",... | For functions that use template types, specialize the function type for the call target based
on the call-site specific arguments. Specifically, this enables inference to set the type of
any function literal parameters based on these inferred types. | [
"For",
"functions",
"that",
"use",
"template",
"types",
"specialize",
"the",
"function",
"type",
"for",
"the",
"call",
"target",
"based",
"on",
"the",
"call",
"-",
"site",
"specific",
"arguments",
".",
"Specifically",
"this",
"enables",
"inference",
"to",
"set... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeInference.java#L2040-L2075 |
tobykurien/Xtendroid | Xtendroid/src/asia/sonix/android/orm/AbatisService.java | AbatisService.execute | public int execute(int sqlId, Map<String, ? extends Object> bindParams) {
"""
指定したSQLIDにparameterをmappingして、実行する。
<p>
mappingの時、parameterが足りない場合は0を返す。
</p>
@param sqlId
SQLiteDatabase object
@param bindParams
old version value
@return int 実行によって影響をもらった行数
"""
String sql = context.getResource... | java | public int execute(int sqlId, Map<String, ? extends Object> bindParams) {
String sql = context.getResources().getString(sqlId);
return execute(sql, bindParams);
} | [
"public",
"int",
"execute",
"(",
"int",
"sqlId",
",",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"bindParams",
")",
"{",
"String",
"sql",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getString",
"(",
"sqlId",
")",
";",
"return",
... | 指定したSQLIDにparameterをmappingして、実行する。
<p>
mappingの時、parameterが足りない場合は0を返す。
</p>
@param sqlId
SQLiteDatabase object
@param bindParams
old version value
@return int 実行によって影響をもらった行数 | [
"指定したSQLIDにparameterをmappingして、実行する。"
] | train | https://github.com/tobykurien/Xtendroid/blob/758bf1d06f4cf3b64f9c10632fe9c6fb30bcebd4/Xtendroid/src/asia/sonix/android/orm/AbatisService.java#L457-L460 |
vipshop/vjtools | vjkit/src/main/java/com/vip/vjtools/vjkit/collection/ListUtil.java | ListUtil.disjoint | public static <T> List<T> disjoint(final List<? extends T> list1, final List<? extends T> list2) {
"""
list1, list2的补集(在list1或list2中,但不在交集中的对象,又叫反交集)产生新List.
copy from Apache Common Collection4 ListUtils,但其并集-交集时,初始大小没有对交集*2,所以做了修改
"""
List<T> intersection = intersection(list1, list2);
List<T> towInters... | java | public static <T> List<T> disjoint(final List<? extends T> list1, final List<? extends T> list2) {
List<T> intersection = intersection(list1, list2);
List<T> towIntersection = union(intersection, intersection);
return difference(union(list1, list2), towIntersection);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"disjoint",
"(",
"final",
"List",
"<",
"?",
"extends",
"T",
">",
"list1",
",",
"final",
"List",
"<",
"?",
"extends",
"T",
">",
"list2",
")",
"{",
"List",
"<",
"T",
">",
"intersection",
"="... | list1, list2的补集(在list1或list2中,但不在交集中的对象,又叫反交集)产生新List.
copy from Apache Common Collection4 ListUtils,但其并集-交集时,初始大小没有对交集*2,所以做了修改 | [
"list1",
"list2的补集(在list1或list2中,但不在交集中的对象,又叫反交集)产生新List",
"."
] | train | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/collection/ListUtil.java#L399-L403 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/KAFDocument.java | KAFDocument.newTerm | public Term newTerm(String id, Span<WF> span) {
"""
Creates a Term object to load an existing term. It receives the ID as an argument. The Term is added to the document object.
@param id term's ID.
@param type type of term. There are two types of term: open and close.
@param lemma the lemma of the term.
@param... | java | public Term newTerm(String id, Span<WF> span) {
idManager.updateCounter(AnnotationType.TERM, id);
Term newTerm = new Term(id, span, false);
annotationContainer.add(newTerm, Layer.TERMS, AnnotationType.TERM);
addToWfTermIndex(newTerm.getSpan().getTargets(), newTerm); // Rodrirekin hitz egin hau kentzeko
return newT... | [
"public",
"Term",
"newTerm",
"(",
"String",
"id",
",",
"Span",
"<",
"WF",
">",
"span",
")",
"{",
"idManager",
".",
"updateCounter",
"(",
"AnnotationType",
".",
"TERM",
",",
"id",
")",
";",
"Term",
"newTerm",
"=",
"new",
"Term",
"(",
"id",
",",
"span"... | Creates a Term object to load an existing term. It receives the ID as an argument. The Term is added to the document object.
@param id term's ID.
@param type type of term. There are two types of term: open and close.
@param lemma the lemma of the term.
@param pos part of speech of the term.
@param wfs the list of word ... | [
"Creates",
"a",
"Term",
"object",
"to",
"load",
"an",
"existing",
"term",
".",
"It",
"receives",
"the",
"ID",
"as",
"an",
"argument",
".",
"The",
"Term",
"is",
"added",
"to",
"the",
"document",
"object",
"."
] | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L582-L588 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/URL/ParserUtils.java | ParserUtils.appendURLEscapeEncoding | private static void appendURLEscapeEncoding(StringBuilder builder, int ch) {
"""
Append a URL escape encoding for the specified character byte.
"""
builder.append('%');
builder.append(Character.forDigit(ch >> 4, 16));
builder.append(Character.forDigit(ch & 0xf, 16));
} | java | private static void appendURLEscapeEncoding(StringBuilder builder, int ch) {
builder.append('%');
builder.append(Character.forDigit(ch >> 4, 16));
builder.append(Character.forDigit(ch & 0xf, 16));
} | [
"private",
"static",
"void",
"appendURLEscapeEncoding",
"(",
"StringBuilder",
"builder",
",",
"int",
"ch",
")",
"{",
"builder",
".",
"append",
"(",
"'",
"'",
")",
";",
"builder",
".",
"append",
"(",
"Character",
".",
"forDigit",
"(",
"ch",
">>",
"4",
","... | Append a URL escape encoding for the specified character byte. | [
"Append",
"a",
"URL",
"escape",
"encoding",
"for",
"the",
"specified",
"character",
"byte",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/URL/ParserUtils.java#L158-L162 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperations.java | KnowledgeOperations.getListMap | public static Map<String, List<Object>> getListMap(Message message, List<ExpressionMapping> expressionMappings, boolean expand, String undefinedVariable) {
"""
Gets a list map.
@param message the message
@param expressionMappings the expression mappings
@param expand whether to expand
@param undefinedVariabl... | java | public static Map<String, List<Object>> getListMap(Message message, List<ExpressionMapping> expressionMappings, boolean expand, String undefinedVariable) {
return getListMap(message, expressionMappings, expand, undefinedVariable, null);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"getListMap",
"(",
"Message",
"message",
",",
"List",
"<",
"ExpressionMapping",
">",
"expressionMappings",
",",
"boolean",
"expand",
",",
"String",
"undefinedVariable",
")",
"{",
... | Gets a list map.
@param message the message
@param expressionMappings the expression mappings
@param expand whether to expand
@param undefinedVariable the undefined variable name
@return the list map | [
"Gets",
"a",
"list",
"map",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperations.java#L404-L406 |
pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java | PersistentStreamBase.submitScale | @Override
public CompletableFuture<VersionedMetadata<EpochTransitionRecord>> submitScale(final List<Long> segmentsToSeal,
final List<Map.Entry<Double, Double>> newRanges,
... | java | @Override
public CompletableFuture<VersionedMetadata<EpochTransitionRecord>> submitScale(final List<Long> segmentsToSeal,
final List<Map.Entry<Double, Double>> newRanges,
... | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"VersionedMetadata",
"<",
"EpochTransitionRecord",
">",
">",
"submitScale",
"(",
"final",
"List",
"<",
"Long",
">",
"segmentsToSeal",
",",
"final",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Doub... | This method attempts to start a new scale workflow. For this it first computes epoch transition and stores it in the metadastore.
This method can be called by manual scale or during the processing of auto-scale event. Which means there could be
concurrent calls to this method.
@param segmentsToSeal segments that will ... | [
"This",
"method",
"attempts",
"to",
"start",
"a",
"new",
"scale",
"workflow",
".",
"For",
"this",
"it",
"first",
"computes",
"epoch",
"transition",
"and",
"stores",
"it",
"in",
"the",
"metadastore",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"manu... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java#L680-L725 |
calimero-project/calimero-core | src/tuwien/auto/calimero/mgmt/PropertyClient.java | PropertyClient.addDefinitions | public void addDefinitions(final Collection<Property> definitions) {
"""
Adds the property definitions contained in the collection argument to the property
definitions of the property client.
<p>
Any definitions already existing in the client are not removed before adding new
ones. To remove definitions, use {... | java | public void addDefinitions(final Collection<Property> definitions)
{
for (final Iterator<Property> i = definitions.iterator(); i.hasNext();) {
final Property p = i.next();
properties.put(new PropertyKey(p.objType, p.id), p);
}
} | [
"public",
"void",
"addDefinitions",
"(",
"final",
"Collection",
"<",
"Property",
">",
"definitions",
")",
"{",
"for",
"(",
"final",
"Iterator",
"<",
"Property",
">",
"i",
"=",
"definitions",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
... | Adds the property definitions contained in the collection argument to the property
definitions of the property client.
<p>
Any definitions already existing in the client are not removed before adding new
ones. To remove definitions, use {@link #getDefinitions()} and remove entries
manually.<br>
An added property defini... | [
"Adds",
"the",
"property",
"definitions",
"contained",
"in",
"the",
"collection",
"argument",
"to",
"the",
"property",
"definitions",
"of",
"the",
"property",
"client",
".",
"<p",
">",
"Any",
"definitions",
"already",
"existing",
"in",
"the",
"client",
"are",
... | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/PropertyClient.java#L514-L520 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/InternalOutputStreamManager.java | InternalOutputStreamManager.getStreamSet | public StreamSet getStreamSet(SIBUuid12 streamID, boolean create) {
"""
Get a StreamSet for a given streamID. Optionally create the StreamSet
if it doesn't already exit.
@param streamID The streamID to map to a StreamSet.
@param create If TRUE then create the StreamSet if it doesn't already exit.
@return An ... | java | public StreamSet getStreamSet(SIBUuid12 streamID, boolean create)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getStreamSet", new Object[] { streamID, Boolean.valueOf(create) });
StreamSet streamSet = null;
synchronized (streamSets)
... | [
"public",
"StreamSet",
"getStreamSet",
"(",
"SIBUuid12",
"streamID",
",",
"boolean",
"create",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
... | Get a StreamSet for a given streamID. Optionally create the StreamSet
if it doesn't already exit.
@param streamID The streamID to map to a StreamSet.
@param create If TRUE then create the StreamSet if it doesn't already exit.
@return An instance of StreamSet | [
"Get",
"a",
"StreamSet",
"for",
"a",
"given",
"streamID",
".",
"Optionally",
"create",
"the",
"StreamSet",
"if",
"it",
"doesn",
"t",
"already",
"exit",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/InternalOutputStreamManager.java#L140-L183 |
graphhopper/map-matching | matching-core/src/main/java/com/graphhopper/matching/MapMatching.java | MapMatching.computeViterbiSequence | private List<SequenceState<State, Observation, Path>> computeViterbiSequence(
List<TimeStep<State, Observation, Path>> timeSteps, int originalGpxEntriesCount,
QueryGraph queryGraph) {
"""
Computes the most likely candidate sequence for the GPX entries.
"""
final HmmProbabilities... | java | private List<SequenceState<State, Observation, Path>> computeViterbiSequence(
List<TimeStep<State, Observation, Path>> timeSteps, int originalGpxEntriesCount,
QueryGraph queryGraph) {
final HmmProbabilities probabilities
= new HmmProbabilities(measurementErrorSigma, trans... | [
"private",
"List",
"<",
"SequenceState",
"<",
"State",
",",
"Observation",
",",
"Path",
">",
">",
"computeViterbiSequence",
"(",
"List",
"<",
"TimeStep",
"<",
"State",
",",
"Observation",
",",
"Path",
">",
">",
"timeSteps",
",",
"int",
"originalGpxEntriesCount... | Computes the most likely candidate sequence for the GPX entries. | [
"Computes",
"the",
"most",
"likely",
"candidate",
"sequence",
"for",
"the",
"GPX",
"entries",
"."
] | train | https://github.com/graphhopper/map-matching/blob/32cd83f14cb990c2be83c8781f22dfb59e0dbeb4/matching-core/src/main/java/com/graphhopper/matching/MapMatching.java#L362-L412 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.delegatedAccount_email_responder_PUT | public void delegatedAccount_email_responder_PUT(String email, OvhResponderAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /email/domain/delegatedAccount/{email}/responder
@param body [required] New object properties
@param email [required] Email
"""
String qPath = "/email/... | java | public void delegatedAccount_email_responder_PUT(String email, OvhResponderAccount body) throws IOException {
String qPath = "/email/domain/delegatedAccount/{email}/responder";
StringBuilder sb = path(qPath, email);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"delegatedAccount_email_responder_PUT",
"(",
"String",
"email",
",",
"OvhResponderAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/delegatedAccount/{email}/responder\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Alter this object properties
REST: PUT /email/domain/delegatedAccount/{email}/responder
@param body [required] New object properties
@param email [required] Email | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L311-L315 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/configuration/JawnConfigurations.java | JawnConfigurations.get | public <T> T get(String name, Class<T> type) {
"""
Retrieves object by name. Convenience generic method.
@param name name of object
@param type type requested.
@return object by name
"""
Object o = _getObject(name);
return o == null ? null : type.cast(o);
} | java | public <T> T get(String name, Class<T> type){
Object o = _getObject(name);
return o == null ? null : type.cast(o);
} | [
"public",
"<",
"T",
">",
"T",
"get",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Object",
"o",
"=",
"_getObject",
"(",
"name",
")",
";",
"return",
"o",
"==",
"null",
"?",
"null",
":",
"type",
".",
"cast",
"(",
"o",
... | Retrieves object by name. Convenience generic method.
@param name name of object
@param type type requested.
@return object by name | [
"Retrieves",
"object",
"by",
"name",
".",
"Convenience",
"generic",
"method",
"."
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/configuration/JawnConfigurations.java#L182-L185 |
intellimate/Izou | src/main/java/org/intellimate/izou/security/FilePermissionModule.java | FilePermissionModule.isForbidden | private void isForbidden(File request, AddOnModel addOnModel) {
"""
throws an Exception if the
@param request the requested File
@param addOnModel the AddonModel
"""
if (forbiddenWriteDirectories.stream()
.anyMatch(compare -> request.toPath().startsWith(compare.toPath()))) {
... | java | private void isForbidden(File request, AddOnModel addOnModel) {
if (forbiddenWriteDirectories.stream()
.anyMatch(compare -> request.toPath().startsWith(compare.toPath()))) {
throw getException("file: " + request.toString() + " is forbidden. Attempt made by: "
+ ad... | [
"private",
"void",
"isForbidden",
"(",
"File",
"request",
",",
"AddOnModel",
"addOnModel",
")",
"{",
"if",
"(",
"forbiddenWriteDirectories",
".",
"stream",
"(",
")",
".",
"anyMatch",
"(",
"compare",
"->",
"request",
".",
"toPath",
"(",
")",
".",
"startsWith"... | throws an Exception if the
@param request the requested File
@param addOnModel the AddonModel | [
"throws",
"an",
"Exception",
"if",
"the"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/security/FilePermissionModule.java#L154-L160 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.updateTagsAsync | public Observable<VirtualNetworkTapInner> updateTagsAsync(String resourceGroupName, String tapName) {
"""
Updates an VirtualNetworkTap tags.
@param resourceGroupName The name of the resource group.
@param tapName The name of the tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | java | public Observable<VirtualNetworkTapInner> updateTagsAsync(String resourceGroupName, String tapName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, tapName).map(new Func1<ServiceResponse<VirtualNetworkTapInner>, VirtualNetworkTapInner>() {
@Override
public VirtualNetworkTa... | [
"public",
"Observable",
"<",
"VirtualNetworkTapInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
")",
".",
"map",
"(",
"new"... | Updates an VirtualNetworkTap tags.
@param resourceGroupName The name of the resource group.
@param tapName The name of the tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"an",
"VirtualNetworkTap",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L554-L561 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/platform/PluginLoader.java | PluginLoader.basePluginKey | static String basePluginKey(PluginInfo plugin, Map<String, PluginInfo> allPluginsPerKey) {
"""
Get the root key of a tree of plugins. For example if plugin C depends on B, which depends on A, then
B and C must be attached to the classloader of A. The method returns A in the three cases.
"""
String base = ... | java | static String basePluginKey(PluginInfo plugin, Map<String, PluginInfo> allPluginsPerKey) {
String base = plugin.getKey();
String parentKey = plugin.getBasePlugin();
while (!Strings.isNullOrEmpty(parentKey)) {
PluginInfo parentPlugin = allPluginsPerKey.get(parentKey);
base = parentPlugin.getKey()... | [
"static",
"String",
"basePluginKey",
"(",
"PluginInfo",
"plugin",
",",
"Map",
"<",
"String",
",",
"PluginInfo",
">",
"allPluginsPerKey",
")",
"{",
"String",
"base",
"=",
"plugin",
".",
"getKey",
"(",
")",
";",
"String",
"parentKey",
"=",
"plugin",
".",
"ge... | Get the root key of a tree of plugins. For example if plugin C depends on B, which depends on A, then
B and C must be attached to the classloader of A. The method returns A in the three cases. | [
"Get",
"the",
"root",
"key",
"of",
"a",
"tree",
"of",
"plugins",
".",
"For",
"example",
"if",
"plugin",
"C",
"depends",
"on",
"B",
"which",
"depends",
"on",
"A",
"then",
"B",
"and",
"C",
"must",
"be",
"attached",
"to",
"the",
"classloader",
"of",
"A"... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/platform/PluginLoader.java#L158-L167 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.containsAny | public static boolean containsAny (@Nullable final char [] aInput, @Nonnull final char [] aSearchChars) {
"""
Check if any of the passed searched characters is contained in the input char
array.
@param aInput
The input char array. May be <code>null</code>.
@param aSearchChars
The char array to search. May n... | java | public static boolean containsAny (@Nullable final char [] aInput, @Nonnull final char [] aSearchChars)
{
ValueEnforcer.notNull (aSearchChars, "SearchChars");
if (aInput != null)
for (final char cIn : aInput)
if (ArrayHelper.contains (aSearchChars, cIn))
return true;
return false;... | [
"public",
"static",
"boolean",
"containsAny",
"(",
"@",
"Nullable",
"final",
"char",
"[",
"]",
"aInput",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aSearchChars",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSearchChars",
",",
"\"SearchChars\"",
"... | Check if any of the passed searched characters is contained in the input char
array.
@param aInput
The input char array. May be <code>null</code>.
@param aSearchChars
The char array to search. May not be <code>null</code>.
@return <code>true</code> if at least any of the search char is contained in
the input char arra... | [
"Check",
"if",
"any",
"of",
"the",
"passed",
"searched",
"characters",
"is",
"contained",
"in",
"the",
"input",
"char",
"array",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3100-L3109 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.getFirewallRuleAsync | public Observable<FirewallRuleInner> getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName) {
"""
Gets the specified Data Lake Store firewall rule.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account.
@param accountName Th... | java | public Observable<FirewallRuleInner> getFirewallRuleAsync(String resourceGroupName, String accountName, String firewallRuleName) {
return getFirewallRuleWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName).map(new Func1<ServiceResponse<FirewallRuleInner>, FirewallRuleInner>() {
... | [
"public",
"Observable",
"<",
"FirewallRuleInner",
">",
"getFirewallRuleAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"firewallRuleName",
")",
"{",
"return",
"getFirewallRuleWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gets the specified Data Lake Store firewall rule.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account.
@param accountName The name of the Data Lake Store account from which to get the firewall rule.
@param firewallRuleName The name of the firewall rule to retrieve.
@... | [
"Gets",
"the",
"specified",
"Data",
"Lake",
"Store",
"firewall",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java#L270-L277 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/OperandStackStateGenerators.java | OperandStackStateGenerators.computeSizes | public static StorageSizes computeSizes(Frame<BasicValue> frame, int offset, int length) {
"""
Compute sizes required for the storage arrays that will contain the operand stack at this frame.
@param frame frame to compute for
@param offset the position within the operand stack to start calculating
@param length... | java | public static StorageSizes computeSizes(Frame<BasicValue> frame, int offset, int length) {
Validate.notNull(frame);
Validate.isTrue(offset >= 0);
Validate.isTrue(length >= 0);
Validate.isTrue(offset < frame.getStackSize());
Validate.isTrue(offset + length <= frame.getStackSize())... | [
"public",
"static",
"StorageSizes",
"computeSizes",
"(",
"Frame",
"<",
"BasicValue",
">",
"frame",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"Validate",
".",
"notNull",
"(",
"frame",
")",
";",
"Validate",
".",
"isTrue",
"(",
"offset",
">=",
"... | Compute sizes required for the storage arrays that will contain the operand stack at this frame.
@param frame frame to compute for
@param offset the position within the operand stack to start calculating
@param length the number of stack items to include in calculation
@return size required by each storage array
@throw... | [
"Compute",
"sizes",
"required",
"for",
"the",
"storage",
"arrays",
"that",
"will",
"contain",
"the",
"operand",
"stack",
"at",
"this",
"frame",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/OperandStackStateGenerators.java#L458-L512 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java | TransformerRegistry.getServerRegistration | public TransformersSubRegistration getServerRegistration(final ModelVersionRange range) {
"""
Get the sub registry for the servers.
@param range the version range
@return the sub registry
"""
final PathAddress address = PathAddress.EMPTY_ADDRESS.append(HOST, SERVER);
return new Transformers... | java | public TransformersSubRegistration getServerRegistration(final ModelVersionRange range) {
final PathAddress address = PathAddress.EMPTY_ADDRESS.append(HOST, SERVER);
return new TransformersSubRegistrationImpl(range, domain, address);
} | [
"public",
"TransformersSubRegistration",
"getServerRegistration",
"(",
"final",
"ModelVersionRange",
"range",
")",
"{",
"final",
"PathAddress",
"address",
"=",
"PathAddress",
".",
"EMPTY_ADDRESS",
".",
"append",
"(",
"HOST",
",",
"SERVER",
")",
";",
"return",
"new",... | Get the sub registry for the servers.
@param range the version range
@return the sub registry | [
"Get",
"the",
"sub",
"registry",
"for",
"the",
"servers",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java#L185-L188 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/TemplateRestEntity.java | TemplateRestEntity.createTemplate | @POST
public Response createTemplate(@Context UriInfo uriInfo, TemplateParam templateParam) throws NotFoundException, ConflictException, InternalException {
"""
Returns the information of an specific template If the template it is not
in the database, it returns 404 with empty payload /** Creates a new
templ... | java | @POST
public Response createTemplate(@Context UriInfo uriInfo, TemplateParam templateParam) throws NotFoundException, ConflictException, InternalException {
logger.debug("StartOf createTemplate - Insert /templates");
TemplateHelperE templateRestHelper = getTemplateHelper();
String id, locat... | [
"@",
"POST",
"public",
"Response",
"createTemplate",
"(",
"@",
"Context",
"UriInfo",
"uriInfo",
",",
"TemplateParam",
"templateParam",
")",
"throws",
"NotFoundException",
",",
"ConflictException",
",",
"InternalException",
"{",
"logger",
".",
"debug",
"(",
"\"StartO... | Returns the information of an specific template If the template it is not
in the database, it returns 404 with empty payload /** Creates a new
template
<pre>
POST /templates
Request:
POST /templates HTTP/1.1
Accept: application/xml
Response:
HTTP/1.1 201 Created
Content-type: application/xml
Location: http://.../te... | [
"Returns",
"the",
"information",
"of",
"an",
"specific",
"template",
"If",
"the",
"template",
"it",
"is",
"not",
"in",
"the",
"database",
"it",
"returns",
"404",
"with",
"empty",
"payload",
"/",
"**",
"Creates",
"a",
"new",
"template"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/TemplateRestEntity.java#L298-L327 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-logging/xwiki-commons-logging-api/src/main/java/org/xwiki/logging/LogUtils.java | LogUtils.newLogEvent | public static LogEvent newLogEvent(Marker marker, LogLevel level, String message, Object[] argumentArray,
Throwable throwable) {
"""
Create and return a new {@link LogEvent} instance based on the passed parameters.
@param marker the log marker
@param level the log level
@param message the log message
... | java | public static LogEvent newLogEvent(Marker marker, LogLevel level, String message, Object[] argumentArray,
Throwable throwable)
{
return newLogEvent(marker, level, message, argumentArray, throwable, System.currentTimeMillis());
} | [
"public",
"static",
"LogEvent",
"newLogEvent",
"(",
"Marker",
"marker",
",",
"LogLevel",
"level",
",",
"String",
"message",
",",
"Object",
"[",
"]",
"argumentArray",
",",
"Throwable",
"throwable",
")",
"{",
"return",
"newLogEvent",
"(",
"marker",
",",
"level",... | Create and return a new {@link LogEvent} instance based on the passed parameters.
@param marker the log marker
@param level the log level
@param message the log message
@param argumentArray the event arguments to insert in the message
@param throwable the throwable associated to the event
@return the {@link LogEvent} | [
"Create",
"and",
"return",
"a",
"new",
"{",
"@link",
"LogEvent",
"}",
"instance",
"based",
"on",
"the",
"passed",
"parameters",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-logging/xwiki-commons-logging-api/src/main/java/org/xwiki/logging/LogUtils.java#L51-L55 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/commons/SerialVersionUIDAdder.java | SerialVersionUIDAdder.visitMethod | @Override
public MethodVisitor visitMethod(final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
"""
/*
Visit the methods and get constructor and method information (step 5 and
7). Also determine if there is a class initializer (step 6).
... | java | @Override
public MethodVisitor visitMethod(final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
if (computeSVUID) {
if ("<clinit>".equals(name)) {
hasStaticInitializer = true;
}
/*
... | [
"@",
"Override",
"public",
"MethodVisitor",
"visitMethod",
"(",
"final",
"int",
"access",
",",
"final",
"String",
"name",
",",
"final",
"String",
"desc",
",",
"final",
"String",
"signature",
",",
"final",
"String",
"[",
"]",
"exceptions",
")",
"{",
"if",
"... | /*
Visit the methods and get constructor and method information (step 5 and
7). Also determine if there is a class initializer (step 6). | [
"/",
"*",
"Visit",
"the",
"methods",
"and",
"get",
"constructor",
"and",
"method",
"information",
"(",
"step",
"5",
"and",
"7",
")",
".",
"Also",
"determine",
"if",
"there",
"is",
"a",
"class",
"initializer",
"(",
"step",
"6",
")",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/commons/SerialVersionUIDAdder.java#L225-L256 |
lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.setMenuButtonImage | public void setMenuButtonImage(MenuButton button, Drawable drawable) {
"""
Set image drawable for a menu button
@param button
@param drawable
"""
switch (button) {
case MID:
mMidBtn.setImageDrawable(drawable);
break;
case LEFT:
... | java | public void setMenuButtonImage(MenuButton button, Drawable drawable) {
switch (button) {
case MID:
mMidBtn.setImageDrawable(drawable);
break;
case LEFT:
mLeftBtn.setImageDrawable(drawable);
break;
case RIGHT:
... | [
"public",
"void",
"setMenuButtonImage",
"(",
"MenuButton",
"button",
",",
"Drawable",
"drawable",
")",
"{",
"switch",
"(",
"button",
")",
"{",
"case",
"MID",
":",
"mMidBtn",
".",
"setImageDrawable",
"(",
"drawable",
")",
";",
"break",
";",
"case",
"LEFT",
... | Set image drawable for a menu button
@param button
@param drawable | [
"Set",
"image",
"drawable",
"for",
"a",
"menu",
"button"
] | train | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L196-L208 |
kiswanij/jk-util | src/main/java/com/jk/util/security/JKSecurityManager.java | JKSecurityManager.matchPassword | public static boolean matchPassword(String plain, JKUser user) {
"""
Match password.
@param plain the plain
@param user the user
@return true, if successful
"""
JK.implementMe();
return JKSecurityUtil.encode(plain).equals(user.getPassword());
} | java | public static boolean matchPassword(String plain, JKUser user) {
JK.implementMe();
return JKSecurityUtil.encode(plain).equals(user.getPassword());
} | [
"public",
"static",
"boolean",
"matchPassword",
"(",
"String",
"plain",
",",
"JKUser",
"user",
")",
"{",
"JK",
".",
"implementMe",
"(",
")",
";",
"return",
"JKSecurityUtil",
".",
"encode",
"(",
"plain",
")",
".",
"equals",
"(",
"user",
".",
"getPassword",
... | Match password.
@param plain the plain
@param user the user
@return true, if successful | [
"Match",
"password",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/security/JKSecurityManager.java#L134-L137 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java | SocketBindingJBossASClient.setStandardSocketBindingPortExpression | public void setStandardSocketBindingPortExpression(String socketBindingName, String sysPropName, int port)
throws Exception {
"""
Sets the port number for the named standard socket binding.
If sysPropName is null, this simply sets the port number explicitly to the given port number.
If sysPropName is not... | java | public void setStandardSocketBindingPortExpression(String socketBindingName, String sysPropName, int port)
throws Exception {
setSocketBindingPortExpression(STANDARD_SOCKETS, socketBindingName, sysPropName, port);
} | [
"public",
"void",
"setStandardSocketBindingPortExpression",
"(",
"String",
"socketBindingName",
",",
"String",
"sysPropName",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"setSocketBindingPortExpression",
"(",
"STANDARD_SOCKETS",
",",
"socketBindingName",
",",
"sy... | Sets the port number for the named standard socket binding.
If sysPropName is null, this simply sets the port number explicitly to the given port number.
If sysPropName is not null, this sets the port to the expression "${sysPropName:port}".
@param socketBindingName the name of the standard socket binding whose port i... | [
"Sets",
"the",
"port",
"number",
"for",
"the",
"named",
"standard",
"socket",
"binding",
".",
"If",
"sysPropName",
"is",
"null",
"this",
"simply",
"sets",
"the",
"port",
"number",
"explicitly",
"to",
"the",
"given",
"port",
"number",
".",
"If",
"sysPropName"... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java#L223-L226 |
aoindustries/ao-encoding | src/main/java/com/aoindustries/encoding/ChainWriter.java | ChainWriter.writeHtmlColor | public static void writeHtmlColor(int color, Appendable out) throws IOException {
"""
Prints a color in HTML format #xxxxxx, where xxxxxx is the hex code.
"""
out.append('#');
out.append(getHex(color>>>20));
out.append(getHex(color>>>16));
out.append(getHex(color>>>12));
out.append(getHex(color>>>8))... | java | public static void writeHtmlColor(int color, Appendable out) throws IOException {
out.append('#');
out.append(getHex(color>>>20));
out.append(getHex(color>>>16));
out.append(getHex(color>>>12));
out.append(getHex(color>>>8));
out.append(getHex(color>>>4));
out.append(getHex(color));
} | [
"public",
"static",
"void",
"writeHtmlColor",
"(",
"int",
"color",
",",
"Appendable",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"append",
"(",
"'",
"'",
")",
";",
"out",
".",
"append",
"(",
"getHex",
"(",
"color",
">>>",
"20",
")",
")",
"... | Prints a color in HTML format #xxxxxx, where xxxxxx is the hex code. | [
"Prints",
"a",
"color",
"in",
"HTML",
"format",
"#xxxxxx",
"where",
"xxxxxx",
"is",
"the",
"hex",
"code",
"."
] | train | https://github.com/aoindustries/ao-encoding/blob/54eeb8ff58ab7b44bb02549bbe2572625b449e4e/src/main/java/com/aoindustries/encoding/ChainWriter.java#L687-L695 |
GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java | LevelDbInputReader.readToTmp | private void readToTmp(int length, boolean expectEnd) throws IOException {
"""
Reads {@code length} number of bytes into {@link #tmpBuffer}. {@link #offset} is incremented
and {@link #tmpBuffer} is flipped.
@param expectEnd if end of stream encountered will throw {@link NoSuchElementException} when
true and {... | java | private void readToTmp(int length, boolean expectEnd) throws IOException {
tmpBuffer.clear();
tmpBuffer.limit(length);
int read = read(tmpBuffer);
if (read == -1 && expectEnd) {
throw new NoSuchElementException();
}
if (read != length) {
throw new CorruptDataException("Premature end ... | [
"private",
"void",
"readToTmp",
"(",
"int",
"length",
",",
"boolean",
"expectEnd",
")",
"throws",
"IOException",
"{",
"tmpBuffer",
".",
"clear",
"(",
")",
";",
"tmpBuffer",
".",
"limit",
"(",
"length",
")",
";",
"int",
"read",
"=",
"read",
"(",
"tmpBuffe... | Reads {@code length} number of bytes into {@link #tmpBuffer}. {@link #offset} is incremented
and {@link #tmpBuffer} is flipped.
@param expectEnd if end of stream encountered will throw {@link NoSuchElementException} when
true and {@link CorruptDataException} when false. | [
"Reads",
"{",
"@code",
"length",
"}",
"number",
"of",
"bytes",
"into",
"{",
"@link",
"#tmpBuffer",
"}",
".",
"{",
"@link",
"#offset",
"}",
"is",
"incremented",
"and",
"{",
"@link",
"#tmpBuffer",
"}",
"is",
"flipped",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java#L220-L233 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/Validation.java | Validation.checkPolymerIDSConnection | private static void checkPolymerIDSConnection(ConnectionNotation not, List<String> listPolymerIDs)
throws PolymerIDsException {
"""
method to check for one connection if the two polymer ids exist
@param not
ConnectionNotation
@param listPolymerIDs
List of polymer ids
@throws PolymerIDsException
if the ... | java | private static void checkPolymerIDSConnection(ConnectionNotation not, List<String> listPolymerIDs)
throws PolymerIDsException {
/* the polymer ids have to be there */
checkExistenceOfPolymerID(not.getSourceId().getId(), listPolymerIDs);
checkExistenceOfPolymerID(not.getTargetId().getId(), listPolymerIDs);
... | [
"private",
"static",
"void",
"checkPolymerIDSConnection",
"(",
"ConnectionNotation",
"not",
",",
"List",
"<",
"String",
">",
"listPolymerIDs",
")",
"throws",
"PolymerIDsException",
"{",
"/* the polymer ids have to be there */",
"checkExistenceOfPolymerID",
"(",
"not",
".",
... | method to check for one connection if the two polymer ids exist
@param not
ConnectionNotation
@param listPolymerIDs
List of polymer ids
@throws PolymerIDsException
if the polymer ids do not exist | [
"method",
"to",
"check",
"for",
"one",
"connection",
"if",
"the",
"two",
"polymer",
"ids",
"exist"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/Validation.java#L521-L526 |
Alluxio/alluxio | integration/fuse/src/main/java/alluxio/fuse/AlluxioFuse.java | AlluxioFuse.main | public static void main(String[] args) {
"""
Running this class will mount the file system according to
the options passed to this function {@link #parseOptions(String[], AlluxioConfiguration)}.
The user-space fuse application will stay on the foreground and keep
the file system mounted. The user can unmount th... | java | public static void main(String[] args) {
AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
final AlluxioFuseOptions opts = parseOptions(args, conf);
if (opts == null) {
System.exit(1);
}
final FileSystem tfs = FileSystem.Factory.create(conf);
final All... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"AlluxioConfiguration",
"conf",
"=",
"new",
"InstancedConfiguration",
"(",
"ConfigurationUtils",
".",
"defaults",
"(",
")",
")",
";",
"final",
"AlluxioFuseOptions",
"opts",
"=",
"pa... | Running this class will mount the file system according to
the options passed to this function {@link #parseOptions(String[], AlluxioConfiguration)}.
The user-space fuse application will stay on the foreground and keep
the file system mounted. The user can unmount the file system by
gracefully killing (SIGINT) the proc... | [
"Running",
"this",
"class",
"will",
"mount",
"the",
"file",
"system",
"according",
"to",
"the",
"options",
"passed",
"to",
"this",
"function",
"{",
"@link",
"#parseOptions",
"(",
"String",
"[]",
"AlluxioConfiguration",
")",
"}",
".",
"The",
"user",
"-",
"spa... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/fuse/src/main/java/alluxio/fuse/AlluxioFuse.java#L55-L76 |
scireum/parsii | src/main/java/parsii/tokenizer/Tokenizer.java | Tokenizer.addWarning | public void addWarning(Position pos, String message, Object... parameters) {
"""
Adds a warning to the internal problem collector.
<p>
A warning indicates an anomaly which might lead to an error but still, the parser can continue to complete its
work.
@param pos the position of the warning. Note that ... | java | public void addWarning(Position pos, String message, Object... parameters) {
getProblemCollector().add(ParseError.warning(pos, String.format(message, parameters)));
} | [
"public",
"void",
"addWarning",
"(",
"Position",
"pos",
",",
"String",
"message",
",",
"Object",
"...",
"parameters",
")",
"{",
"getProblemCollector",
"(",
")",
".",
"add",
"(",
"ParseError",
".",
"warning",
"(",
"pos",
",",
"String",
".",
"format",
"(",
... | Adds a warning to the internal problem collector.
<p>
A warning indicates an anomaly which might lead to an error but still, the parser can continue to complete its
work.
@param pos the position of the warning. Note that {@link Token} implements {@link Position}.
Therefore the current token is often a good choi... | [
"Adds",
"a",
"warning",
"to",
"the",
"internal",
"problem",
"collector",
".",
"<p",
">",
"A",
"warning",
"indicates",
"an",
"anomaly",
"which",
"might",
"lead",
"to",
"an",
"error",
"but",
"still",
"the",
"parser",
"can",
"continue",
"to",
"complete",
"its... | train | https://github.com/scireum/parsii/blob/fbf686155b1147b9e07ae21dcd02820b15c79a8c/src/main/java/parsii/tokenizer/Tokenizer.java#L814-L816 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/memory/MKeyArea.java | MKeyArea.doRemove | public void doRemove(FieldTable table, KeyAreaInfo keyArea, BaseBuffer buffer) throws DBException {
"""
Delete the key from this buffer.
@param table The basetable.
@param keyArea The basetable's key area.
@param buffer The buffer to compare.
@exception DBException File exception.
"""
super.doRemov... | java | public void doRemove(FieldTable table, KeyAreaInfo keyArea, BaseBuffer buffer) throws DBException
{
super.doRemove(table, keyArea, buffer);
} | [
"public",
"void",
"doRemove",
"(",
"FieldTable",
"table",
",",
"KeyAreaInfo",
"keyArea",
",",
"BaseBuffer",
"buffer",
")",
"throws",
"DBException",
"{",
"super",
".",
"doRemove",
"(",
"table",
",",
"keyArea",
",",
"buffer",
")",
";",
"}"
] | Delete the key from this buffer.
@param table The basetable.
@param keyArea The basetable's key area.
@param buffer The buffer to compare.
@exception DBException File exception. | [
"Delete",
"the",
"key",
"from",
"this",
"buffer",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/memory/MKeyArea.java#L152-L155 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.getValue | @Api
public void getValue(String name, BooleanAttribute attribute) {
"""
Get a boolean value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1
"""
attribute.setValue(toBoolean(formWidget.getValue(name)));
} | java | @Api
public void getValue(String name, BooleanAttribute attribute) {
attribute.setValue(toBoolean(formWidget.getValue(name)));
} | [
"@",
"Api",
"public",
"void",
"getValue",
"(",
"String",
"name",
",",
"BooleanAttribute",
"attribute",
")",
"{",
"attribute",
".",
"setValue",
"(",
"toBoolean",
"(",
"formWidget",
".",
"getValue",
"(",
"name",
")",
")",
")",
";",
"}"
] | Get a boolean value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"Get",
"a",
"boolean",
"value",
"from",
"the",
"form",
"and",
"place",
"it",
"in",
"<code",
">",
"attribute<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L647-L650 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/interval/IntervalFactory.java | IntervalFactory.getInstance | public Interval getInstance(Long start, Granularity startGran,
Long finish, Granularity finishGran) {
"""
Returns at interval specified by the given start and finish and
granularities.
@param start a {@link Long} representing the start of the interval. If
<code>null</code>, the <code>start</code> ... | java | public Interval getInstance(Long start, Granularity startGran,
Long finish, Granularity finishGran) {
List<Object> key = Arrays.asList(new Object[]{start, startGran,
finish, finishGran});
Interval result;
synchronized (cache) {
result = cache.get(key);
... | [
"public",
"Interval",
"getInstance",
"(",
"Long",
"start",
",",
"Granularity",
"startGran",
",",
"Long",
"finish",
",",
"Granularity",
"finishGran",
")",
"{",
"List",
"<",
"Object",
">",
"key",
"=",
"Arrays",
".",
"asList",
"(",
"new",
"Object",
"[",
"]",
... | Returns at interval specified by the given start and finish and
granularities.
@param start a {@link Long} representing the start of the interval. If
<code>null</code>, the <code>start</code> will be unbounded.
@param startGran the {@link Granularity} of the start of the interval.
The <code>start</code> parameter's in... | [
"Returns",
"at",
"interval",
"specified",
"by",
"the",
"given",
"start",
"and",
"finish",
"and",
"granularities",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/interval/IntervalFactory.java#L110-L127 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/TransformationsInner.java | TransformationsInner.updateAsync | public Observable<TransformationInner> updateAsync(String resourceGroupName, String jobName, String transformationName, TransformationInner transformation, String ifMatch) {
"""
Updates an existing transformation under an existing streaming job. This can be used to partially update (ie. update one or two propertie... | java | public Observable<TransformationInner> updateAsync(String resourceGroupName, String jobName, String transformationName, TransformationInner transformation, String ifMatch) {
return updateWithServiceResponseAsync(resourceGroupName, jobName, transformationName, transformation, ifMatch).map(new Func1<ServiceRespon... | [
"public",
"Observable",
"<",
"TransformationInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"transformationName",
",",
"TransformationInner",
"transformation",
",",
"String",
"ifMatch",
")",
"{",
"return",
"upda... | Updates an existing transformation under an existing streaming job. This can be used to partially update (ie. update one or two properties) a transformation without affecting the rest the job or transformation definition.
@param resourceGroupName The name of the resource group that contains the resource. You can obtai... | [
"Updates",
"an",
"existing",
"transformation",
"under",
"an",
"existing",
"streaming",
"job",
".",
"This",
"can",
"be",
"used",
"to",
"partially",
"update",
"(",
"ie",
".",
"update",
"one",
"or",
"two",
"properties",
")",
"a",
"transformation",
"without",
"a... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/TransformationsInner.java#L420-L427 |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectProperties.java | ProjectProperties.selectField | private ProjectField selectField(ProjectField[] fields, int index) {
"""
Maps a field index to a TaskField instance.
@param fields array of fields used as the basis for the mapping.
@param index required field index
@return TaskField instance
"""
if (index < 1 || index > fields.length)
{
... | java | private ProjectField selectField(ProjectField[] fields, int index)
{
if (index < 1 || index > fields.length)
{
throw new IllegalArgumentException(index + " is not a valid field index");
}
return (fields[index - 1]);
} | [
"private",
"ProjectField",
"selectField",
"(",
"ProjectField",
"[",
"]",
"fields",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"1",
"||",
"index",
">",
"fields",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"index",... | Maps a field index to a TaskField instance.
@param fields array of fields used as the basis for the mapping.
@param index required field index
@return TaskField instance | [
"Maps",
"a",
"field",
"index",
"to",
"a",
"TaskField",
"instance",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectProperties.java#L2674-L2681 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java | PublicanPODocBookBuilder.cleanForPublican | protected String cleanForPublican(final BuildData buildData, final SpecTopic specTopic, final String translationString) {
"""
Resolves the injections, changes ' and " entities to characters and removes any left over comments from
source/translation strings.
@param buildData Information and da... | java | protected String cleanForPublican(final BuildData buildData, final SpecTopic specTopic, final String translationString) {
if (translationString == null) return null;
try {
final Document doc = TopicUtilities.convertXMLStringToDocument("<temp>" + translationString + "</temp>",
... | [
"protected",
"String",
"cleanForPublican",
"(",
"final",
"BuildData",
"buildData",
",",
"final",
"SpecTopic",
"specTopic",
",",
"final",
"String",
"translationString",
")",
"{",
"if",
"(",
"translationString",
"==",
"null",
")",
"return",
"null",
";",
"try",
"{"... | Resolves the injections, changes ' and " entities to characters and removes any left over comments from
source/translation strings.
@param buildData Information and data structures for the build.
@param specTopic The topic to resolve the injections for.
@param translationString The string to ... | [
"Resolves",
"the",
"injections",
"changes",
"&apos",
";",
"and",
""",
";",
"entities",
"to",
"characters",
"and",
"removes",
"any",
"left",
"over",
"comments",
"from",
"source",
"/",
"translation",
"strings",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java#L1014-L1053 |
windup/windup | utils/src/main/java/org/jboss/windup/util/Checks.java | Checks.checkFileOrDirectoryToBeRead | public static void checkFileOrDirectoryToBeRead(File fileOrDir, String fileDesc) {
"""
Throws if the given file is null, is not a file or directory, or is an empty directory.
"""
if (fileOrDir == null)
throw new IllegalArgumentException(fileDesc + " must not be null.");
if (!fileOrD... | java | public static void checkFileOrDirectoryToBeRead(File fileOrDir, String fileDesc)
{
if (fileOrDir == null)
throw new IllegalArgumentException(fileDesc + " must not be null.");
if (!fileOrDir.exists())
throw new IllegalArgumentException(fileDesc + " does not exist: " + fileOrDi... | [
"public",
"static",
"void",
"checkFileOrDirectoryToBeRead",
"(",
"File",
"fileOrDir",
",",
"String",
"fileDesc",
")",
"{",
"if",
"(",
"fileOrDir",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"fileDesc",
"+",
"\" must not be null.\"",
")",
"... | Throws if the given file is null, is not a file or directory, or is an empty directory. | [
"Throws",
"if",
"the",
"given",
"file",
"is",
"null",
"is",
"not",
"a",
"file",
"or",
"directory",
"or",
"is",
"an",
"empty",
"directory",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/Checks.java#L45-L58 |
stevespringett/Alpine | alpine/src/main/java/alpine/auth/JsonWebToken.java | JsonWebToken.createToken | public String createToken(final Principal principal, final List<Permission> permissions) {
"""
Creates a new JWT for the specified principal. Token is signed using
the SecretKey with an HMAC 256 algorithm.
@param principal the Principal to create the token for
@param permissions the effective list of permissi... | java | public String createToken(final Principal principal, final List<Permission> permissions) {
final Date today = new Date();
final JwtBuilder jwtBuilder = Jwts.builder();
jwtBuilder.setSubject(principal.getName());
jwtBuilder.setIssuer(ISSUER);
jwtBuilder.setIssuedAt(today);
... | [
"public",
"String",
"createToken",
"(",
"final",
"Principal",
"principal",
",",
"final",
"List",
"<",
"Permission",
">",
"permissions",
")",
"{",
"final",
"Date",
"today",
"=",
"new",
"Date",
"(",
")",
";",
"final",
"JwtBuilder",
"jwtBuilder",
"=",
"Jwts",
... | Creates a new JWT for the specified principal. Token is signed using
the SecretKey with an HMAC 256 algorithm.
@param principal the Principal to create the token for
@param permissions the effective list of permissions for the principal
@return a String representation of the generated token
@since 1.1.0 | [
"Creates",
"a",
"new",
"JWT",
"for",
"the",
"specified",
"principal",
".",
"Token",
"is",
"signed",
"using",
"the",
"SecretKey",
"with",
"an",
"HMAC",
"256",
"algorithm",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/auth/JsonWebToken.java#L111-L125 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/classfile/MethodDesc.java | MethodDesc.forArguments | public static MethodDesc forArguments(TypeDesc ret, TypeDesc[] params, String[] paramNames) {
"""
Acquire a MethodDesc from a set of arguments.
@param ret return type of method; null implies void
@param params parameters to method; null implies none
@param paramNames parameter names to method; null implies none... | java | public static MethodDesc forArguments(TypeDesc ret, TypeDesc[] params, String[] paramNames) {
if (ret == null) {
ret = TypeDesc.VOID;
}
if (params == null || params.length == 0) {
params = EMPTY_PARAMS;
}
if (paramNames == null || paramNames.length == 0) {... | [
"public",
"static",
"MethodDesc",
"forArguments",
"(",
"TypeDesc",
"ret",
",",
"TypeDesc",
"[",
"]",
"params",
",",
"String",
"[",
"]",
"paramNames",
")",
"{",
"if",
"(",
"ret",
"==",
"null",
")",
"{",
"ret",
"=",
"TypeDesc",
".",
"VOID",
";",
"}",
"... | Acquire a MethodDesc from a set of arguments.
@param ret return type of method; null implies void
@param params parameters to method; null implies none
@param paramNames parameter names to method; null implies none | [
"Acquire",
"a",
"MethodDesc",
"from",
"a",
"set",
"of",
"arguments",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/classfile/MethodDesc.java#L70-L81 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/tenant/TenantService.java | TenantService.modifyTenant | public TenantDefinition modifyTenant(String tenantName, TenantDefinition newTenantDef) {
"""
Modify the tenant with the given name to match the given definition, and return the
updated definition.
@param tenantName Name of tenant to be modified.
@param newTenantDef Updated {@link TenantDefinition} to appl... | java | public TenantDefinition modifyTenant(String tenantName, TenantDefinition newTenantDef) {
checkServiceState();
TenantDefinition oldTenantDef = getTenantDef(tenantName);
Utils.require(oldTenantDef != null, "Tenant '%s' does not exist", tenantName);
modifyTenantProperties(oldTenantDef, newT... | [
"public",
"TenantDefinition",
"modifyTenant",
"(",
"String",
"tenantName",
",",
"TenantDefinition",
"newTenantDef",
")",
"{",
"checkServiceState",
"(",
")",
";",
"TenantDefinition",
"oldTenantDef",
"=",
"getTenantDef",
"(",
"tenantName",
")",
";",
"Utils",
".",
"req... | Modify the tenant with the given name to match the given definition, and return the
updated definition.
@param tenantName Name of tenant to be modified.
@param newTenantDef Updated {@link TenantDefinition} to apply to tenant.
@return Updated {@link TenantDefinition}. | [
"Modify",
"the",
"tenant",
"with",
"the",
"given",
"name",
"to",
"match",
"the",
"given",
"definition",
"and",
"return",
"the",
"updated",
"definition",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/tenant/TenantService.java#L279-L294 |
Azure/azure-sdk-for-java | common/azure-common-auth/src/main/java/com/azure/common/auth/credentials/DelegatedTokenCredentials.java | DelegatedTokenCredentials.generateAuthenticationUrl | public String generateAuthenticationUrl(ResponseMode responseMode, String state) {
"""
Generate the URL to authenticate through OAuth2.
@param responseMode the method that should be used to send the resulting token back to your app
@param state a value included in the request that is also returned in the token... | java | public String generateAuthenticationUrl(ResponseMode responseMode, String state) {
return String.format("%s/%s/oauth2/authorize?client_id=%s&response_type=code&redirect_uri=%s&response_mode=%s&state=%s",
environment().activeDirectoryEndpoint(), domain(), clientId(), this.redirectUrl, responseMod... | [
"public",
"String",
"generateAuthenticationUrl",
"(",
"ResponseMode",
"responseMode",
",",
"String",
"state",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s/%s/oauth2/authorize?client_id=%s&response_type=code&redirect_uri=%s&response_mode=%s&state=%s\"",
",",
"environmen... | Generate the URL to authenticate through OAuth2.
@param responseMode the method that should be used to send the resulting token back to your app
@param state a value included in the request that is also returned in the token response
@return the URL to authenticate through OAuth2 | [
"Generate",
"the",
"URL",
"to",
"authenticate",
"through",
"OAuth2",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-auth/src/main/java/com/azure/common/auth/credentials/DelegatedTokenCredentials.java#L113-L116 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.createInstance | public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException {
"""
This is the primary way to create a secondary index instance for a CF column.
It will validate the index_options before initializing.
@param baseCfs the source of data for the Index... | java | public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException
{
SecondaryIndex index;
switch (cdef.getIndexType())
{
case KEYS:
index = new KeysIndex();
break;
case COMPOSITES:
... | [
"public",
"static",
"SecondaryIndex",
"createInstance",
"(",
"ColumnFamilyStore",
"baseCfs",
",",
"ColumnDefinition",
"cdef",
")",
"throws",
"ConfigurationException",
"{",
"SecondaryIndex",
"index",
";",
"switch",
"(",
"cdef",
".",
"getIndexType",
"(",
")",
")",
"{"... | This is the primary way to create a secondary index instance for a CF column.
It will validate the index_options before initializing.
@param baseCfs the source of data for the Index
@param cdef the meta information about this column (index_type, index_options, name, etc...)
@return The secondary index instance for th... | [
"This",
"is",
"the",
"primary",
"way",
"to",
"create",
"a",
"secondary",
"index",
"instance",
"for",
"a",
"CF",
"column",
".",
"It",
"will",
"validate",
"the",
"index_options",
"before",
"initializing",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L322-L356 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/PhotoUtils.java | PhotoUtils.getImageForSize | public static BufferedImage getImageForSize(JinxConstants.PhotoSize size, PhotoInfo info) throws JinxException {
"""
Get an image for photo info at a specific size.
@param size Required. The the desired size.
@param info Required. The photo info describing the photo.
@return buffered image data from Flickr.
... | java | public static BufferedImage getImageForSize(JinxConstants.PhotoSize size, PhotoInfo info) throws JinxException {
if (info == null || size == null) {
throw new JinxException("Cannot look up null photo or size.");
}
BufferedImage image;
try {
image = ImageIO.read(getUrlForSize(size, info));
} catch (JinxE... | [
"public",
"static",
"BufferedImage",
"getImageForSize",
"(",
"JinxConstants",
".",
"PhotoSize",
"size",
",",
"PhotoInfo",
"info",
")",
"throws",
"JinxException",
"{",
"if",
"(",
"info",
"==",
"null",
"||",
"size",
"==",
"null",
")",
"{",
"throw",
"new",
"Jin... | Get an image for photo info at a specific size.
@param size Required. The the desired size.
@param info Required. The photo info describing the photo.
@return buffered image data from Flickr.
@throws JinxException if any parameter is null, or if there are any errors. | [
"Get",
"an",
"image",
"for",
"photo",
"info",
"at",
"a",
"specific",
"size",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/PhotoUtils.java#L77-L90 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/layout/Layout.java | Layout.previousGeneration | public Layout previousGeneration() throws FetchException {
"""
Returns the previous known generation of the storable's layout, or null
if none.
@return a layout with a lower generation, or null if none
"""
Cursor<StoredLayout> cursor = mLayoutFactory.mLayoutStorage
.query("storableTyp... | java | public Layout previousGeneration() throws FetchException {
Cursor<StoredLayout> cursor = mLayoutFactory.mLayoutStorage
.query("storableTypeName = ? & generation < ?")
.with(getStorableTypeName()).with(getGeneration())
.orderBy("-generation")
.fetch();
... | [
"public",
"Layout",
"previousGeneration",
"(",
")",
"throws",
"FetchException",
"{",
"Cursor",
"<",
"StoredLayout",
">",
"cursor",
"=",
"mLayoutFactory",
".",
"mLayoutStorage",
".",
"query",
"(",
"\"storableTypeName = ? & generation < ?\"",
")",
".",
"with",
"(",
"g... | Returns the previous known generation of the storable's layout, or null
if none.
@return a layout with a lower generation, or null if none | [
"Returns",
"the",
"previous",
"known",
"generation",
"of",
"the",
"storable",
"s",
"layout",
"or",
"null",
"if",
"none",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/layout/Layout.java#L429-L445 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java | Ftp.upload | public boolean upload(String path, String fileName, InputStream fileStream) {
"""
上传文件到指定目录,可选:
<pre>
1. path为null或""上传到当前路径
2. path为相对路径则相对于当前路径的子路径
3. path为绝对路径则上传到此路径
</pre>
@param path 服务端路径,可以为{@code null} 或者相对路径或绝对路径
@param fileName 文件名
@param fileStream 文件流
@return 是否上传成功
"""
try {
... | java | public boolean upload(String path, String fileName, InputStream fileStream) {
try {
client.setFileType(FTPClient.BINARY_FILE_TYPE);
} catch (IOException e) {
throw new FtpException(e);
}
if(StrUtil.isNotBlank(path)) {
mkDirs(path);
boolean isOk = cd(path);
if(false == isOk) {
re... | [
"public",
"boolean",
"upload",
"(",
"String",
"path",
",",
"String",
"fileName",
",",
"InputStream",
"fileStream",
")",
"{",
"try",
"{",
"client",
".",
"setFileType",
"(",
"FTPClient",
".",
"BINARY_FILE_TYPE",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",... | 上传文件到指定目录,可选:
<pre>
1. path为null或""上传到当前路径
2. path为相对路径则相对于当前路径的子路径
3. path为绝对路径则上传到此路径
</pre>
@param path 服务端路径,可以为{@code null} 或者相对路径或绝对路径
@param fileName 文件名
@param fileStream 文件流
@return 是否上传成功 | [
"上传文件到指定目录,可选:"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L405-L425 |
Waikato/moa | moa/src/main/java/moa/clusterers/kmeanspm/ClusteringFeature.java | ClusteringFeature.toCluster | public Cluster toCluster() {
"""
Creates a Cluster of the ClusteringFeature.
@return a Cluster
"""
double[] output = new double[this.sumPoints.length];
System.arraycopy(this.sumPoints, 0, output, 0, this.sumPoints.length);
for (int i = 0; i < output.length; i++) {
output[i] /= this.numPoints;
}
... | java | public Cluster toCluster() {
double[] output = new double[this.sumPoints.length];
System.arraycopy(this.sumPoints, 0, output, 0, this.sumPoints.length);
for (int i = 0; i < output.length; i++) {
output[i] /= this.numPoints;
}
return new SphereCluster(output, getThreshold(), this.numPoints);
} | [
"public",
"Cluster",
"toCluster",
"(",
")",
"{",
"double",
"[",
"]",
"output",
"=",
"new",
"double",
"[",
"this",
".",
"sumPoints",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"this",
".",
"sumPoints",
",",
"0",
",",
"output",
",",
"0",... | Creates a Cluster of the ClusteringFeature.
@return a Cluster | [
"Creates",
"a",
"Cluster",
"of",
"the",
"ClusteringFeature",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/kmeanspm/ClusteringFeature.java#L126-L133 |
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.updateHierarchicalEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<OperationStatus>> updateHierarchicalEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId, UpdateHierarchicalEntityRoleOptionalParameter updateHierarchicalEntityRoleOptionalParameter) {
"""
Update an entity role for a given entity.
@param ... | java | public Observable<ServiceResponse<OperationStatus>> updateHierarchicalEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId, UpdateHierarchicalEntityRoleOptionalParameter updateHierarchicalEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
thr... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"OperationStatus",
">",
">",
"updateHierarchicalEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
",",
"UUID",
"roleId",
",",
"UpdateHierarchicalEntityRoleO... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@param roleId The entity role ID.
@param updateHierarchicalEntityRoleOptionalParameter the object representing the optional parameters to be set before call... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | 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#L13311-L13330 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp.2.3/src/org/apache/jasper/runtime/BodyContentImpl.java | BodyContentImpl.getReader | public Reader getReader() {
"""
Return the value of this BodyJspWriter as a Reader.
Note: this is after evaluation!! There are no scriptlets,
etc in this stream.
@return the value of this BodyJspWriter as a Reader
"""
// PK33136
char[] charBuffer = new char[strBuffer.length()] ;
s... | java | public Reader getReader() {
// PK33136
char[] charBuffer = new char[strBuffer.length()] ;
strBuffer.getChars(0, strBuffer.length(), charBuffer, 0);
//PK33136
return (writer == null) ? new CharArrayReader (charBuffer, 0, strBuffer.length()) : null;
} | [
"public",
"Reader",
"getReader",
"(",
")",
"{",
"// PK33136",
"char",
"[",
"]",
"charBuffer",
"=",
"new",
"char",
"[",
"strBuffer",
".",
"length",
"(",
")",
"]",
";",
"strBuffer",
".",
"getChars",
"(",
"0",
",",
"strBuffer",
".",
"length",
"(",
")",
... | Return the value of this BodyJspWriter as a Reader.
Note: this is after evaluation!! There are no scriptlets,
etc in this stream.
@return the value of this BodyJspWriter as a Reader | [
"Return",
"the",
"value",
"of",
"this",
"BodyJspWriter",
"as",
"a",
"Reader",
".",
"Note",
":",
"this",
"is",
"after",
"evaluation!!",
"There",
"are",
"no",
"scriptlets",
"etc",
"in",
"this",
"stream",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp.2.3/src/org/apache/jasper/runtime/BodyContentImpl.java#L603-L609 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java | ZipExploder.processZips | @Deprecated
public void processZips(String[] zipNames, String destDir) throws IOException {
"""
Explode source ZIP files into a target directory
@param zipNames
names of source files
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file
@deprec... | java | @Deprecated
public void processZips(String[] zipNames, String destDir) throws IOException {
//Delegation to preferred method
processZips(FileUtils.pathNamesToFiles(zipNames), new File(destDir));
} | [
"@",
"Deprecated",
"public",
"void",
"processZips",
"(",
"String",
"[",
"]",
"zipNames",
",",
"String",
"destDir",
")",
"throws",
"IOException",
"{",
"//Delegation to preferred method",
"processZips",
"(",
"FileUtils",
".",
"pathNamesToFiles",
"(",
"zipNames",
")",
... | Explode source ZIP files into a target directory
@param zipNames
names of source files
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file
@deprecated use {@link #processZips(File[], File)} for a type save
variant | [
"Explode",
"source",
"ZIP",
"files",
"into",
"a",
"target",
"directory"
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L186-L190 |
CloudSlang/cs-actions | cs-powershell/src/main/java/io/cloudslang/content/utils/WSManUtils.java | WSManUtils.validateUUID | public static void validateUUID(String uuid, String uuidValueOf) throws RuntimeException {
"""
Validates a UUID value and throws a specific exception if UUID is invalid.
@param uuid The UUID value to validate.
@param uuidValueOf The property associated to the given UUID value.
@throws RuntimeException
... | java | public static void validateUUID(String uuid, String uuidValueOf) throws RuntimeException {
if (!WSManUtils.isUUID(uuid)) {
throw new RuntimeException("The returned " + uuidValueOf + " is not a valid UUID value! " + uuidValueOf + ": " + uuid);
}
} | [
"public",
"static",
"void",
"validateUUID",
"(",
"String",
"uuid",
",",
"String",
"uuidValueOf",
")",
"throws",
"RuntimeException",
"{",
"if",
"(",
"!",
"WSManUtils",
".",
"isUUID",
"(",
"uuid",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"The ... | Validates a UUID value and throws a specific exception if UUID is invalid.
@param uuid The UUID value to validate.
@param uuidValueOf The property associated to the given UUID value.
@throws RuntimeException | [
"Validates",
"a",
"UUID",
"value",
"and",
"throws",
"a",
"specific",
"exception",
"if",
"UUID",
"is",
"invalid",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/utils/WSManUtils.java#L118-L122 |
scalecube/socketio | src/main/java/io/scalecube/socketio/SocketIOServer.java | SocketIOServer.newInstance | public static SocketIOServer newInstance(int port, SSLContext sslContext) {
"""
Creates instance of Socket.IO server with the given secure port.
"""
SslContext nettySslContext = new JdkSslContext(sslContext, false, ClientAuth.NONE);
return newInstance(port, nettySslContext);
} | java | public static SocketIOServer newInstance(int port, SSLContext sslContext) {
SslContext nettySslContext = new JdkSslContext(sslContext, false, ClientAuth.NONE);
return newInstance(port, nettySslContext);
} | [
"public",
"static",
"SocketIOServer",
"newInstance",
"(",
"int",
"port",
",",
"SSLContext",
"sslContext",
")",
"{",
"SslContext",
"nettySslContext",
"=",
"new",
"JdkSslContext",
"(",
"sslContext",
",",
"false",
",",
"ClientAuth",
".",
"NONE",
")",
";",
"return",... | Creates instance of Socket.IO server with the given secure port. | [
"Creates",
"instance",
"of",
"Socket",
".",
"IO",
"server",
"with",
"the",
"given",
"secure",
"port",
"."
] | train | https://github.com/scalecube/socketio/blob/bad28fe7a132320750173e7cb71ad6d3688fb626/src/main/java/io/scalecube/socketio/SocketIOServer.java#L75-L78 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.getSortedCatalogItems | public static <T extends CatalogType> void getSortedCatalogItems(CatalogMap<T> items, String sortFieldName, List<T> result) {
"""
A getSortedCatalogItems variant with the result list filled in-place
@param <T> The type of item to sort.
@param items The set of catalog items.
@param sortFieldName The name of the ... | java | public static <T extends CatalogType> void getSortedCatalogItems(CatalogMap<T> items, String sortFieldName, List<T> result) {
result.addAll(getSortedCatalogItems(items, sortFieldName ));
} | [
"public",
"static",
"<",
"T",
"extends",
"CatalogType",
">",
"void",
"getSortedCatalogItems",
"(",
"CatalogMap",
"<",
"T",
">",
"items",
",",
"String",
"sortFieldName",
",",
"List",
"<",
"T",
">",
"result",
")",
"{",
"result",
".",
"addAll",
"(",
"getSorte... | A getSortedCatalogItems variant with the result list filled in-place
@param <T> The type of item to sort.
@param items The set of catalog items.
@param sortFieldName The name of the field to sort on.
@param result An output list of catalog items, sorted on the specified field. | [
"A",
"getSortedCatalogItems",
"variant",
"with",
"the",
"result",
"list",
"filled",
"in",
"-",
"place"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L569-L571 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java | ExceptionUtils.removeCommonFrames | public static void removeCommonFrames(final List<String> causeFrames, final List<String> wrapperFrames) {
"""
<p>Removes common frames from the cause trace given the two stack traces.</p>
@param causeFrames stack trace of a cause throwable
@param wrapperFrames stack trace of a wrapper throwable
@throws Ille... | java | public static void removeCommonFrames(final List<String> causeFrames, final List<String> wrapperFrames) {
if (causeFrames == null || wrapperFrames == null) {
throw new IllegalArgumentException("The List must not be null");
}
int causeFrameIndex = causeFrames.size() - 1;
int w... | [
"public",
"static",
"void",
"removeCommonFrames",
"(",
"final",
"List",
"<",
"String",
">",
"causeFrames",
",",
"final",
"List",
"<",
"String",
">",
"wrapperFrames",
")",
"{",
"if",
"(",
"causeFrames",
"==",
"null",
"||",
"wrapperFrames",
"==",
"null",
")",
... | <p>Removes common frames from the cause trace given the two stack traces.</p>
@param causeFrames stack trace of a cause throwable
@param wrapperFrames stack trace of a wrapper throwable
@throws IllegalArgumentException if either argument is null
@since 2.0 | [
"<p",
">",
"Removes",
"common",
"frames",
"from",
"the",
"cause",
"trace",
"given",
"the",
"two",
"stack",
"traces",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java#L563-L580 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/geo/pose/PnPStereoJacobianRodrigues.java | PnPStereoJacobianRodrigues.addRodriguesJacobian | private void addRodriguesJacobian( DMatrixRMaj Rj , Point3D_F64 worldPt , Point3D_F64 cameraPt ) {
"""
Adds to the Jacobian matrix using the derivative from a Rodrigues parameter.
deriv [x,y] = -dot(z)/(z^2)*(R*X+T) + (1/z)*dot(R)*X
where R is rotation matrix, T is translation, z = z-coordinate of point in c... | java | private void addRodriguesJacobian( DMatrixRMaj Rj , Point3D_F64 worldPt , Point3D_F64 cameraPt )
{
// (1/z)*dot(R)*X
double Rx = (Rj.data[0]*worldPt.x + Rj.data[1]*worldPt.y + Rj.data[2]*worldPt.z)/cameraPt.z;
double Ry = (Rj.data[3]*worldPt.x + Rj.data[4]*worldPt.y + Rj.data[5]*worldPt.z)/cameraPt.z;
// dot(... | [
"private",
"void",
"addRodriguesJacobian",
"(",
"DMatrixRMaj",
"Rj",
",",
"Point3D_F64",
"worldPt",
",",
"Point3D_F64",
"cameraPt",
")",
"{",
"// (1/z)*dot(R)*X",
"double",
"Rx",
"=",
"(",
"Rj",
".",
"data",
"[",
"0",
"]",
"*",
"worldPt",
".",
"x",
"+",
"R... | Adds to the Jacobian matrix using the derivative from a Rodrigues parameter.
deriv [x,y] = -dot(z)/(z^2)*(R*X+T) + (1/z)*dot(R)*X
where R is rotation matrix, T is translation, z = z-coordinate of point in camera frame
@param Rj Jacobian for Rodrigues
@param worldPt Location of point in world coordinates
@param camer... | [
"Adds",
"to",
"the",
"Jacobian",
"matrix",
"using",
"the",
"derivative",
"from",
"a",
"Rodrigues",
"parameter",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/geo/pose/PnPStereoJacobianRodrigues.java#L154-L166 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/XMLResourceBundle.java | XMLResourceBundle.get | public String get(final String aMessage, final String aDetail) {
"""
Return a message value with the supplied string integrated into it.
@param aMessage A message in which to include the supplied string value
@param aDetail A string value to be included into the supplied message
@return A message with the sup... | java | public String get(final String aMessage, final String aDetail) {
return StringUtils.format(super.getString(aMessage), aDetail);
} | [
"public",
"String",
"get",
"(",
"final",
"String",
"aMessage",
",",
"final",
"String",
"aDetail",
")",
"{",
"return",
"StringUtils",
".",
"format",
"(",
"super",
".",
"getString",
"(",
"aMessage",
")",
",",
"aDetail",
")",
";",
"}"
] | Return a message value with the supplied string integrated into it.
@param aMessage A message in which to include the supplied string value
@param aDetail A string value to be included into the supplied message
@return A message with the supplied string value integrated into it | [
"Return",
"a",
"message",
"value",
"with",
"the",
"supplied",
"string",
"integrated",
"into",
"it",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/XMLResourceBundle.java#L102-L104 |
apache/groovy | src/main/groovy/groovy/time/TimeCategory.java | TimeCategory.getDaylightSavingsOffset | public static Duration getDaylightSavingsOffset(Date self) {
"""
Get the DST offset (if any) for the default locale and the given date.
@param self a Date
@return the DST offset as a Duration.
"""
TimeZone timeZone = getTimeZone(self);
int millis = (timeZone.useDaylightTime() && timeZone.in... | java | public static Duration getDaylightSavingsOffset(Date self) {
TimeZone timeZone = getTimeZone(self);
int millis = (timeZone.useDaylightTime() && timeZone.inDaylightTime(self))
? timeZone.getDSTSavings() : 0;
return new TimeDuration(0, 0, 0, millis);
} | [
"public",
"static",
"Duration",
"getDaylightSavingsOffset",
"(",
"Date",
"self",
")",
"{",
"TimeZone",
"timeZone",
"=",
"getTimeZone",
"(",
"self",
")",
";",
"int",
"millis",
"=",
"(",
"timeZone",
".",
"useDaylightTime",
"(",
")",
"&&",
"timeZone",
".",
"inD... | Get the DST offset (if any) for the default locale and the given date.
@param self a Date
@return the DST offset as a Duration. | [
"Get",
"the",
"DST",
"offset",
"(",
"if",
"any",
")",
"for",
"the",
"default",
"locale",
"and",
"the",
"given",
"date",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/time/TimeCategory.java#L85-L90 |
aws/aws-sdk-java | aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/model/S3Location.java | S3Location.withUserMetadata | public S3Location withUserMetadata(java.util.Map<String, String> userMetadata) {
"""
<p>
A map of metadata to store with the job results in Amazon S3.
</p>
@param userMetadata
A map of metadata to store with the job results in Amazon S3.
@return Returns a reference to this object so that method calls can be... | java | public S3Location withUserMetadata(java.util.Map<String, String> userMetadata) {
setUserMetadata(userMetadata);
return this;
} | [
"public",
"S3Location",
"withUserMetadata",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"userMetadata",
")",
"{",
"setUserMetadata",
"(",
"userMetadata",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of metadata to store with the job results in Amazon S3.
</p>
@param userMetadata
A map of metadata to store with the job results in Amazon S3.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"of",
"metadata",
"to",
"store",
"with",
"the",
"job",
"results",
"in",
"Amazon",
"S3",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/model/S3Location.java#L422-L425 |
Sefford/fraggle | fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java | FraggleManager.configureAdditionMode | protected void configureAdditionMode(Fragment frag, int flags, FragmentTransaction ft, int containerId) {
"""
Configures the way to add the Fragment into the transaction. It can vary from adding a new fragment,
to using a previous instance and refresh it, or replacing the last one.
@param frag Fragment ... | java | protected void configureAdditionMode(Fragment frag, int flags, FragmentTransaction ft, int containerId) {
if ((flags & DO_NOT_REPLACE_FRAGMENT) != DO_NOT_REPLACE_FRAGMENT) {
ft.replace(containerId, frag, ((FraggleFragment) frag).getFragmentTag());
} else {
ft.add(containerId, fra... | [
"protected",
"void",
"configureAdditionMode",
"(",
"Fragment",
"frag",
",",
"int",
"flags",
",",
"FragmentTransaction",
"ft",
",",
"int",
"containerId",
")",
"{",
"if",
"(",
"(",
"flags",
"&",
"DO_NOT_REPLACE_FRAGMENT",
")",
"!=",
"DO_NOT_REPLACE_FRAGMENT",
")",
... | Configures the way to add the Fragment into the transaction. It can vary from adding a new fragment,
to using a previous instance and refresh it, or replacing the last one.
@param frag Fragment to add
@param flags Added flags to the Fragment configuration
@param ft Transaction to add the fragment... | [
"Configures",
"the",
"way",
"to",
"add",
"the",
"Fragment",
"into",
"the",
"transaction",
".",
"It",
"can",
"vary",
"from",
"adding",
"a",
"new",
"fragment",
"to",
"using",
"a",
"previous",
"instance",
"and",
"refresh",
"it",
"or",
"replacing",
"the",
"las... | train | https://github.com/Sefford/fraggle/blob/d1b65a99ecc3c3faeef8f288ca6225bbf475c3a3/fraggle/src/main/java/com/sefford/fraggle/FraggleManager.java#L253-L260 |
jbundle/jbundle | main/db/src/main/java/org/jbundle/main/db/PropertiesRecord.java | PropertiesRecord.addPropertiesFieldBehavior | public void addPropertiesFieldBehavior(BaseField fldDisplay, String strProperty) {
"""
Add the behaviors to sync this property to this virtual field.
"""
BaseField fldProperties = this.getField(PropertiesRecord.PROPERTIES);
FieldListener listener = new CopyConvertersHandler(new PropertiesConver... | java | public void addPropertiesFieldBehavior(BaseField fldDisplay, String strProperty)
{
BaseField fldProperties = this.getField(PropertiesRecord.PROPERTIES);
FieldListener listener = new CopyConvertersHandler(new PropertiesConverter(fldProperties, strProperty));
listener.setRespondsToMode(DBConst... | [
"public",
"void",
"addPropertiesFieldBehavior",
"(",
"BaseField",
"fldDisplay",
",",
"String",
"strProperty",
")",
"{",
"BaseField",
"fldProperties",
"=",
"this",
".",
"getField",
"(",
"PropertiesRecord",
".",
"PROPERTIES",
")",
";",
"FieldListener",
"listener",
"="... | Add the behaviors to sync this property to this virtual field. | [
"Add",
"the",
"behaviors",
"to",
"sync",
"this",
"property",
"to",
"this",
"virtual",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/db/PropertiesRecord.java#L88-L97 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/WritableSessionCache.java | WritableSessionCache.rollback | private void rollback(Transaction txn, Exception cause) throws Exception {
"""
Rolling back given transaction caused by given cause.
@param txn the transaction
@param cause roll back cause
@throws Exception roll back cause.
"""
try {
txn.rollback();
} catch (Exception e) {
... | java | private void rollback(Transaction txn, Exception cause) throws Exception {
try {
txn.rollback();
} catch (Exception e) {
logger.debug(e, "Error while rolling back transaction " + txn);
} finally {
throw cause;
}
} | [
"private",
"void",
"rollback",
"(",
"Transaction",
"txn",
",",
"Exception",
"cause",
")",
"throws",
"Exception",
"{",
"try",
"{",
"txn",
".",
"rollback",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"logger",
".",
"debug",
"(",
"e",
... | Rolling back given transaction caused by given cause.
@param txn the transaction
@param cause roll back cause
@throws Exception roll back cause. | [
"Rolling",
"back",
"given",
"transaction",
"caused",
"by",
"given",
"cause",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/WritableSessionCache.java#L872-L880 |
SonarSource/sonarqube | server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/SiblingsIssueMerger.java | SiblingsIssueMerger.tryMerge | public void tryMerge(Component component, Collection<DefaultIssue> newIssues) {
"""
Look for all unclosed issues in branches/PR targeting the same long living branch, and run
a light issue tracking to find matches. Then merge issue attributes in the new issues.
"""
Collection<SiblingIssue> siblingIssues =... | java | public void tryMerge(Component component, Collection<DefaultIssue> newIssues) {
Collection<SiblingIssue> siblingIssues = siblingsIssuesLoader.loadCandidateSiblingIssuesForMerging(component);
Tracking<DefaultIssue, SiblingIssue> tracking = tracker.track(newIssues, siblingIssues);
Map<DefaultIssue, SiblingIs... | [
"public",
"void",
"tryMerge",
"(",
"Component",
"component",
",",
"Collection",
"<",
"DefaultIssue",
">",
"newIssues",
")",
"{",
"Collection",
"<",
"SiblingIssue",
">",
"siblingIssues",
"=",
"siblingsIssuesLoader",
".",
"loadCandidateSiblingIssuesForMerging",
"(",
"co... | Look for all unclosed issues in branches/PR targeting the same long living branch, and run
a light issue tracking to find matches. Then merge issue attributes in the new issues. | [
"Look",
"for",
"all",
"unclosed",
"issues",
"in",
"branches",
"/",
"PR",
"targeting",
"the",
"same",
"long",
"living",
"branch",
"and",
"run",
"a",
"light",
"issue",
"tracking",
"to",
"find",
"matches",
".",
"Then",
"merge",
"issue",
"attributes",
"in",
"t... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/SiblingsIssueMerger.java#L48-L60 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java | BoxApiCollaboration.getAddRequest | public BoxRequestsShare.AddCollaboration getAddRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, BoxCollaborator collaborator) {
"""
A request that adds a {@link com.box.androidsdk.content.models.BoxUser user} or {@link com.box.androidsdk.content.models.BoxGroup group} as a collaborator t... | java | public BoxRequestsShare.AddCollaboration getAddRequest(BoxCollaborationItem collaborationItem, BoxCollaboration.Role role, BoxCollaborator collaborator) {
return new BoxRequestsShare.AddCollaboration(getCollaborationsUrl(),
createStubItem(collaborationItem), role, collaborator, mSession);
} | [
"public",
"BoxRequestsShare",
".",
"AddCollaboration",
"getAddRequest",
"(",
"BoxCollaborationItem",
"collaborationItem",
",",
"BoxCollaboration",
".",
"Role",
"role",
",",
"BoxCollaborator",
"collaborator",
")",
"{",
"return",
"new",
"BoxRequestsShare",
".",
"AddCollabor... | A request that adds a {@link com.box.androidsdk.content.models.BoxUser user} or {@link com.box.androidsdk.content.models.BoxGroup group} as a collaborator to an item.
@param collaborationItem item to be collaborated.
@param role role of the collaboration
@param collaborator the {@link com.box.androidsdk.content.models.... | [
"A",
"request",
"that",
"adds",
"a",
"{"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollaboration.java#L98-L101 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/inherited/CmsContainerConfigurationWriter.java | CmsContainerConfigurationWriter.removeExistingEntry | protected void removeExistingEntry(CmsObject cms, CmsXmlContent content, Locale locale, String name) {
"""
Removes an existing inheritance container entry with a given name from the configuration file.<p>
This does nothing if no such entry actually exists.<p>
@param cms the current CMS context
@param conten... | java | protected void removeExistingEntry(CmsObject cms, CmsXmlContent content, Locale locale, String name) {
if (!content.hasLocale(locale)) {
return;
}
String entriesXpath = N_CONFIGURATION;
List<I_CmsXmlContentValue> values = content.getValues(entriesXpath, locale);
... | [
"protected",
"void",
"removeExistingEntry",
"(",
"CmsObject",
"cms",
",",
"CmsXmlContent",
"content",
",",
"Locale",
"locale",
",",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"content",
".",
"hasLocale",
"(",
"locale",
")",
")",
"{",
"return",
";",
"}",
... | Removes an existing inheritance container entry with a given name from the configuration file.<p>
This does nothing if no such entry actually exists.<p>
@param cms the current CMS context
@param content the XML content
@param locale the locale from which to remove the entry
@param name the name of the entry | [
"Removes",
"an",
"existing",
"inheritance",
"container",
"entry",
"with",
"a",
"given",
"name",
"from",
"the",
"configuration",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/inherited/CmsContainerConfigurationWriter.java#L306-L324 |
bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/owner/OstrichOwnerGroup.java | OstrichOwnerGroup.awaitRunning | private boolean awaitRunning(Service service, long timeoutAt) {
"""
Returns true if the Guava service entered the RUNNING state within the specified time period.
"""
if (service.isRunning()) {
return true;
}
long waitMillis = timeoutAt - System.currentTimeMillis();
i... | java | private boolean awaitRunning(Service service, long timeoutAt) {
if (service.isRunning()) {
return true;
}
long waitMillis = timeoutAt - System.currentTimeMillis();
if (waitMillis <= 0) {
return false;
}
try {
service.start().get(waitMil... | [
"private",
"boolean",
"awaitRunning",
"(",
"Service",
"service",
",",
"long",
"timeoutAt",
")",
"{",
"if",
"(",
"service",
".",
"isRunning",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"long",
"waitMillis",
"=",
"timeoutAt",
"-",
"System",
".",
"curr... | Returns true if the Guava service entered the RUNNING state within the specified time period. | [
"Returns",
"true",
"if",
"the",
"Guava",
"service",
"entered",
"the",
"RUNNING",
"state",
"within",
"the",
"specified",
"time",
"period",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/owner/OstrichOwnerGroup.java#L241-L255 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newNoSuchFileException | public static NoSuchFileException newNoSuchFileException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link NoSuchFileException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link... | java | public static NoSuchFileException newNoSuchFileException(Throwable cause, String message, Object... args) {
return new NoSuchFileException(format(message, args), cause);
} | [
"public",
"static",
"NoSuchFileException",
"newNoSuchFileException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"NoSuchFileException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"cause... | Constructs and initializes a new {@link NoSuchFileException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link NoSuchFileException} was thrown.
@param message {@link String} describi... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"NoSuchFileException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Obje... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L227-L229 |
Alluxio/alluxio | core/base/src/main/java/alluxio/util/URIUtils.java | URIUtils.appendPath | public static URI appendPath(URI base, String path) throws URISyntaxException {
"""
Appends the given path to the given base URI.
@param base the base URI
@param path the path to append
@return the URI resulting from appending the base and the path
@throws URISyntaxException if URI syntax error is encountere... | java | public static URI appendPath(URI base, String path) throws URISyntaxException {
return new URI(base.getScheme(), base.getAuthority(),
PathUtils.concatPath(base.getPath(), path), base.getQuery(), base.getFragment());
} | [
"public",
"static",
"URI",
"appendPath",
"(",
"URI",
"base",
",",
"String",
"path",
")",
"throws",
"URISyntaxException",
"{",
"return",
"new",
"URI",
"(",
"base",
".",
"getScheme",
"(",
")",
",",
"base",
".",
"getAuthority",
"(",
")",
",",
"PathUtils",
"... | Appends the given path to the given base URI.
@param base the base URI
@param path the path to append
@return the URI resulting from appending the base and the path
@throws URISyntaxException if URI syntax error is encountered | [
"Appends",
"the",
"given",
"path",
"to",
"the",
"given",
"base",
"URI",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/URIUtils.java#L50-L53 |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/security/SIG0Signer.java | SIG0Signer.apply | public void apply(Message m, byte [] old)
throws IOException, SignatureException, InvalidKeyException,
NoSuchAlgorithmException {
"""
Appends a SIG(0) signature to the message.
@param m the message
@param old if this message is a response, the original message
"""
int validity = Options.intValue("s... | java | public void apply(Message m, byte [] old)
throws IOException, SignatureException, InvalidKeyException,
NoSuchAlgorithmException
{
int validity = Options.intValue("sig0validity");
if (validity < 0)
validity = VALIDITY;
long now = System.currentTimeMillis();
Date timeSigned = new Date(now);
Date timeExpi... | [
"public",
"void",
"apply",
"(",
"Message",
"m",
",",
"byte",
"[",
"]",
"old",
")",
"throws",
"IOException",
",",
"SignatureException",
",",
"InvalidKeyException",
",",
"NoSuchAlgorithmException",
"{",
"int",
"validity",
"=",
"Options",
".",
"intValue",
"(",
"\... | Appends a SIG(0) signature to the message.
@param m the message
@param old if this message is a response, the original message | [
"Appends",
"a",
"SIG",
"(",
"0",
")",
"signature",
"to",
"the",
"message",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/SIG0Signer.java#L72-L120 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.