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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java | BuildsInner.getLogLinkAsync | public Observable<BuildGetLogResultInner> getLogLinkAsync(String resourceGroupName, String registryName, String buildId) {
"""
Gets a link to download the build logs.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container r... | java | public Observable<BuildGetLogResultInner> getLogLinkAsync(String resourceGroupName, String registryName, String buildId) {
return getLogLinkWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1<ServiceResponse<BuildGetLogResultInner>, BuildGetLogResultInner>() {
@Override
... | [
"public",
"Observable",
"<",
"BuildGetLogResultInner",
">",
"getLogLinkAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildId",
")",
"{",
"return",
"getLogLinkWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryNa... | Gets a link to download the build logs.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildId The build ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable ... | [
"Gets",
"a",
"link",
"to",
"download",
"the",
"build",
"logs",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java#L821-L828 |
trajano/caliper | caliper/src/main/java/com/google/caliper/util/InterleavedReader.java | InterleavedReader.findPossibleMarker | int findPossibleMarker(char[] chars, int limit) {
"""
Returns the index of marker in {@code chars}, stopping at {@code limit}.
Should the chars end with a prefix of marker, the offset of that prefix
is returned.
"""
search:
for (int i = 0; true; i++) {
for (int m = 0; m < marker.length() && i +... | java | int findPossibleMarker(char[] chars, int limit) {
search:
for (int i = 0; true; i++) {
for (int m = 0; m < marker.length() && i + m < limit; m++) {
if (chars[i + m] != marker.charAt(m)) {
continue search;
}
}
return i;
}
} | [
"int",
"findPossibleMarker",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"limit",
")",
"{",
"search",
":",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"true",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"m",
"=",
"0",
";",
"m",
"<",
"marker",
"."... | Returns the index of marker in {@code chars}, stopping at {@code limit}.
Should the chars end with a prefix of marker, the offset of that prefix
is returned. | [
"Returns",
"the",
"index",
"of",
"marker",
"in",
"{"
] | train | https://github.com/trajano/caliper/blob/a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658/caliper/src/main/java/com/google/caliper/util/InterleavedReader.java#L117-L127 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/SoftDeleteHandler.java | SoftDeleteHandler.doLocalCriteria | public boolean doLocalCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList) {
"""
Set up/do the local criteria.
@param strbFilter The SQL query string to add to.
@param bIncludeFileName Include the file name with this query?
@param vParamList The param list to add the raw dat... | java | public boolean doLocalCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
{
boolean bDontSkip = super.doLocalCriteria(strbFilter, bIncludeFileName, vParamList);
if (bDontSkip == true)
{
if (m_bFilterThisRecord)
bDontSkip = !th... | [
"public",
"boolean",
"doLocalCriteria",
"(",
"StringBuffer",
"strbFilter",
",",
"boolean",
"bIncludeFileName",
",",
"Vector",
"<",
"BaseField",
">",
"vParamList",
")",
"{",
"boolean",
"bDontSkip",
"=",
"super",
".",
"doLocalCriteria",
"(",
"strbFilter",
",",
"bInc... | Set up/do the local criteria.
@param strbFilter The SQL query string to add to.
@param bIncludeFileName Include the file name with this query?
@param vParamList The param list to add the raw data to (for prepared statements).
@return True if you should not skip this record (does a check on the local data). | [
"Set",
"up",
"/",
"do",
"the",
"local",
"criteria",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/SoftDeleteHandler.java#L100-L109 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.executeUpdate | public int executeUpdate(String sql, List<Object> params) throws SQLException {
"""
Executes the given SQL update with parameters.
<p>
This method supports named and named ordinal parameters.
See the class Javadoc for more details.
<p>
Resource handling is performed automatically where appropriate.
@param ... | java | public int executeUpdate(String sql, List<Object> params) throws SQLException {
Connection connection = createConnection();
PreparedStatement statement = null;
try {
statement = getPreparedStatement(connection, sql, params);
this.updateCount = statement.executeUpdate();
... | [
"public",
"int",
"executeUpdate",
"(",
"String",
"sql",
",",
"List",
"<",
"Object",
">",
"params",
")",
"throws",
"SQLException",
"{",
"Connection",
"connection",
"=",
"createConnection",
"(",
")",
";",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try"... | Executes the given SQL update with parameters.
<p>
This method supports named and named ordinal parameters.
See the class Javadoc for more details.
<p>
Resource handling is performed automatically where appropriate.
@param sql the SQL statement
@param params a list of parameters
@return the number of rows updated o... | [
"Executes",
"the",
"given",
"SQL",
"update",
"with",
"parameters",
".",
"<p",
">",
"This",
"method",
"supports",
"named",
"and",
"named",
"ordinal",
"parameters",
".",
"See",
"the",
"class",
"Javadoc",
"for",
"more",
"details",
".",
"<p",
">",
"Resource",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L2919-L2932 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.feed_publishStoryToUser | public boolean feed_publishStoryToUser(CharSequence title, CharSequence body,
Collection<IFeedImage> images, Integer priority)
throws FacebookException, IOException {
"""
Publish a story to the logged-in user's newsfeed.
@param title the title of the feed story
@param... | java | public boolean feed_publishStoryToUser(CharSequence title, CharSequence body,
Collection<IFeedImage> images, Integer priority)
throws FacebookException, IOException {
return feedHandler(FacebookMethod.FEED_PUBLISH_STORY_TO_USER, title, body, images, priority);
} | [
"public",
"boolean",
"feed_publishStoryToUser",
"(",
"CharSequence",
"title",
",",
"CharSequence",
"body",
",",
"Collection",
"<",
"IFeedImage",
">",
"images",
",",
"Integer",
"priority",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"feedHa... | Publish a story to the logged-in user's newsfeed.
@param title the title of the feed story
@param body the body of the feed story
@param images (optional) up to four pairs of image URLs and (possibly null) link URLs
@param priority
@return whether the story was successfully published; false in case of permission error
... | [
"Publish",
"a",
"story",
"to",
"the",
"logged",
"-",
"in",
"user",
"s",
"newsfeed",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L365-L369 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/types/MLNumericArray.java | MLNumericArray.directByteBufferEquals | private static boolean directByteBufferEquals(ByteBuffer buffa, ByteBuffer buffb) {
"""
Equals implementation for direct <code>ByteBuffer</code>
@param buffa the source buffer to be compared
@param buffb the destination buffer to be compared
@return <code>true</code> if buffers are equal in terms of content
... | java | private static boolean directByteBufferEquals(ByteBuffer buffa, ByteBuffer buffb)
{
if ( buffa == buffb )
{
return true;
}
if ( buffa ==null || buffb == null )
{
return false;
}
buffa.rewind();
buffb.rewind();
... | [
"private",
"static",
"boolean",
"directByteBufferEquals",
"(",
"ByteBuffer",
"buffa",
",",
"ByteBuffer",
"buffb",
")",
"{",
"if",
"(",
"buffa",
"==",
"buffb",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"buffa",
"==",
"null",
"||",
"buffb",
"==",
"n... | Equals implementation for direct <code>ByteBuffer</code>
@param buffa the source buffer to be compared
@param buffb the destination buffer to be compared
@return <code>true</code> if buffers are equal in terms of content | [
"Equals",
"implementation",
"for",
"direct",
"<code",
">",
"ByteBuffer<",
"/",
"code",
">"
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLNumericArray.java#L354-L385 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/document/json/JsonObject.java | JsonObject.putAndEncrypt | public JsonObject putAndEncrypt(String name, int value, String providerName) {
"""
Stores a {@link Integer} value as encrypted identified by the field name.
Note: Use of the Field Level Encryption functionality provided in the
com.couchbase.client.encryption namespace provided by Couchbase is
subject to the C... | java | public JsonObject putAndEncrypt(String name, int value, String providerName) {
addValueEncryptionInfo(name, providerName, true);
content.put(name, value);
return this;
} | [
"public",
"JsonObject",
"putAndEncrypt",
"(",
"String",
"name",
",",
"int",
"value",
",",
"String",
"providerName",
")",
"{",
"addValueEncryptionInfo",
"(",
"name",
",",
"providerName",
",",
"true",
")",
";",
"content",
".",
"put",
"(",
"name",
",",
"value",... | Stores a {@link Integer} value as encrypted identified by the field name.
Note: Use of the Field Level Encryption functionality provided in the
com.couchbase.client.encryption namespace provided by Couchbase is
subject to the Couchbase Inc. Enterprise Subscription License Agreement
at https://www.couchbase.com/ESLA-11... | [
"Stores",
"a",
"{",
"@link",
"Integer",
"}",
"value",
"as",
"encrypted",
"identified",
"by",
"the",
"field",
"name",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L409-L413 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/scop/CachedRemoteScopInstallation.java | CachedRemoteScopInstallation.loadRepresentativeDomains | private void loadRepresentativeDomains() throws IOException {
"""
get the ranges of representative domains from the centralized server
"""
URL u = null;
try {
u = new URL(RemoteScopInstallation.DEFAULT_SERVER + "getRepresentativeScopDomains");
} catch (MalformedURLException e) {
throw new IOExcept... | java | private void loadRepresentativeDomains() throws IOException {
URL u = null;
try {
u = new URL(RemoteScopInstallation.DEFAULT_SERVER + "getRepresentativeScopDomains");
} catch (MalformedURLException e) {
throw new IOException("URL " + RemoteScopInstallation.DEFAULT_SERVER + "getRepresentativeScopDomains" + ... | [
"private",
"void",
"loadRepresentativeDomains",
"(",
")",
"throws",
"IOException",
"{",
"URL",
"u",
"=",
"null",
";",
"try",
"{",
"u",
"=",
"new",
"URL",
"(",
"RemoteScopInstallation",
".",
"DEFAULT_SERVER",
"+",
"\"getRepresentativeScopDomains\"",
")",
";",
"}"... | get the ranges of representative domains from the centralized server | [
"get",
"the",
"ranges",
"of",
"representative",
"domains",
"from",
"the",
"centralized",
"server"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/CachedRemoteScopInstallation.java#L86-L105 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/services/path/PathManagerService.java | PathManagerService.removePathService | final void removePathService(final OperationContext operationContext, final String pathName) {
"""
Removes any {@code Service<String>} for the given path.
@param operationContext the operation context associated with the management operation making this request. Cannot be {@code null}
@param pathName the name o... | java | final void removePathService(final OperationContext operationContext, final String pathName) {
final ServiceController<?> serviceController = operationContext.getServiceRegistry(true).getService(AbstractPathService.pathNameOf(pathName));
if (serviceController != null) {
operationContext.remo... | [
"final",
"void",
"removePathService",
"(",
"final",
"OperationContext",
"operationContext",
",",
"final",
"String",
"pathName",
")",
"{",
"final",
"ServiceController",
"<",
"?",
">",
"serviceController",
"=",
"operationContext",
".",
"getServiceRegistry",
"(",
"true",... | Removes any {@code Service<String>} for the given path.
@param operationContext the operation context associated with the management operation making this request. Cannot be {@code null}
@param pathName the name of the relevant path. Cannot be {@code null} | [
"Removes",
"any",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/services/path/PathManagerService.java#L208-L213 |
bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.contextualEncode | public static String contextualEncode(String s, Type t, boolean template) {
"""
Contextually encodes the characters of string that are either non-ASCII
characters or are ASCII characters that must be percent-encoded using the
UTF-8 encoding. Percent-encoded characters will be recognized and not
double encoded.
... | java | public static String contextualEncode(String s, Type t, boolean template) {
return _encode(s, t, template, true);
} | [
"public",
"static",
"String",
"contextualEncode",
"(",
"String",
"s",
",",
"Type",
"t",
",",
"boolean",
"template",
")",
"{",
"return",
"_encode",
"(",
"s",
",",
"t",
",",
"template",
",",
"true",
")",
";",
"}"
] | Contextually encodes the characters of string that are either non-ASCII
characters or are ASCII characters that must be percent-encoded using the
UTF-8 encoding. Percent-encoded characters will be recognized and not
double encoded.
@param s the string to be encoded.
@param t the URI component type identi... | [
"Contextually",
"encodes",
"the",
"characters",
"of",
"string",
"that",
"are",
"either",
"non",
"-",
"ASCII",
"characters",
"or",
"are",
"ASCII",
"characters",
"that",
"must",
"be",
"percent",
"-",
"encoded",
"using",
"the",
"UTF",
"-",
"8",
"encoding",
".",... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L183-L185 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectBitwiseable | void expectBitwiseable(Node n, JSType type, String msg) {
"""
Expect the type to be a valid operand to a bitwise operator. This includes numbers, any type
convertible to a number, or any other primitive type (undefined|null|boolean|string).
"""
if (!type.matchesNumberContext() && !type.isSubtypeOf(allBitw... | java | void expectBitwiseable(Node n, JSType type, String msg) {
if (!type.matchesNumberContext() && !type.isSubtypeOf(allBitwisableValueTypes)) {
mismatch(n, msg, type, allBitwisableValueTypes);
} else {
expectNumberStrict(n, type, msg);
}
} | [
"void",
"expectBitwiseable",
"(",
"Node",
"n",
",",
"JSType",
"type",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"!",
"type",
".",
"matchesNumberContext",
"(",
")",
"&&",
"!",
"type",
".",
"isSubtypeOf",
"(",
"allBitwisableValueTypes",
")",
")",
"{",
"mi... | Expect the type to be a valid operand to a bitwise operator. This includes numbers, any type
convertible to a number, or any other primitive type (undefined|null|boolean|string). | [
"Expect",
"the",
"type",
"to",
"be",
"a",
"valid",
"operand",
"to",
"a",
"bitwise",
"operator",
".",
"This",
"includes",
"numbers",
"any",
"type",
"convertible",
"to",
"a",
"number",
"or",
"any",
"other",
"primitive",
"type",
"(",
"undefined|null|boolean|strin... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L401-L407 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java | AbstractParser.attributeAsString | protected String attributeAsString(XMLStreamReader reader, String attributeName, Map<String, String> expressions)
throws XMLStreamException {
"""
convert an xml element in String value
@param reader the StAX reader
@param attributeName the name of the attribute
@param expressions The expressions
@retur... | java | protected String attributeAsString(XMLStreamReader reader, String attributeName, Map<String, String> expressions)
throws XMLStreamException
{
String attributeString = rawAttributeText(reader, attributeName);
if (attributeName != null && expressions != null && attributeString != null &&
a... | [
"protected",
"String",
"attributeAsString",
"(",
"XMLStreamReader",
"reader",
",",
"String",
"attributeName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"expressions",
")",
"throws",
"XMLStreamException",
"{",
"String",
"attributeString",
"=",
"rawAttributeText",
... | convert an xml element in String value
@param reader the StAX reader
@param attributeName the name of the attribute
@param expressions The expressions
@return the string representing element
@throws XMLStreamException StAX exception | [
"convert",
"an",
"xml",
"element",
"in",
"String",
"value"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java#L196-L206 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java | FileUtilities.saveFile | public static void saveFile(final File file, byte[] fileContents) throws IOException {
"""
Save the data, represented as a byte array to a file
@param file The location/name of the file to be saved.
@param fileContents The data that is to be written to the file.
@throws IOException
"""
if... | java | public static void saveFile(final File file, byte[] fileContents) throws IOException {
if (file.isDirectory()) {
throw new IOException("Unable to save file contents as a directory.");
}
final FileOutputStream fos = new FileOutputStream(file);
fos.write(fileContents);
... | [
"public",
"static",
"void",
"saveFile",
"(",
"final",
"File",
"file",
",",
"byte",
"[",
"]",
"fileContents",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Unable to save... | Save the data, represented as a byte array to a file
@param file The location/name of the file to be saved.
@param fileContents The data that is to be written to the file.
@throws IOException | [
"Save",
"the",
"data",
"represented",
"as",
"a",
"byte",
"array",
"to",
"a",
"file"
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java#L261-L270 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/utils/ClassUtils.java | ClassUtils.forName | public static Class forName(String className, boolean initialize) {
"""
根据类名加载Class
@param className 类名
@param initialize 是否初始化
@return Class
"""
try {
return Class.forName(className, initialize, getCurrentClassLoader());
} catch (Exception e) {
throw new SofaRpcRu... | java | public static Class forName(String className, boolean initialize) {
try {
return Class.forName(className, initialize, getCurrentClassLoader());
} catch (Exception e) {
throw new SofaRpcRuntimeException(e);
}
} | [
"public",
"static",
"Class",
"forName",
"(",
"String",
"className",
",",
"boolean",
"initialize",
")",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"className",
",",
"initialize",
",",
"getCurrentClassLoader",
"(",
")",
")",
";",
"}",
"catch",
... | 根据类名加载Class
@param className 类名
@param initialize 是否初始化
@return Class | [
"根据类名加载Class"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/utils/ClassUtils.java#L55-L61 |
gtrght/jtuples | src/main/java/com/othelle/jtuples/serialize/JacksonConverter.java | JacksonConverter.getTupleMapperModule | public static SimpleModule getTupleMapperModule() {
"""
Returns the default mapping for all the possible TupleN
@return
"""
SimpleModule module = new SimpleModule("1", Version.unknownVersion());
SimpleAbstractTypeResolver resolver = getTupleTypeResolver();
module.setAbstractTypes(res... | java | public static SimpleModule getTupleMapperModule() {
SimpleModule module = new SimpleModule("1", Version.unknownVersion());
SimpleAbstractTypeResolver resolver = getTupleTypeResolver();
module.setAbstractTypes(resolver);
module.setKeyDeserializers(new SimpleKeyDeserializers());
r... | [
"public",
"static",
"SimpleModule",
"getTupleMapperModule",
"(",
")",
"{",
"SimpleModule",
"module",
"=",
"new",
"SimpleModule",
"(",
"\"1\"",
",",
"Version",
".",
"unknownVersion",
"(",
")",
")",
";",
"SimpleAbstractTypeResolver",
"resolver",
"=",
"getTupleTypeReso... | Returns the default mapping for all the possible TupleN
@return | [
"Returns",
"the",
"default",
"mapping",
"for",
"all",
"the",
"possible",
"TupleN"
] | train | https://github.com/gtrght/jtuples/blob/f76a6c710cc7b8360130fc4f83be4e5a1bb2de6e/src/main/java/com/othelle/jtuples/serialize/JacksonConverter.java#L28-L35 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/tools/SemanticSpaceExplorer.java | SemanticSpaceExplorer.getCurrentSSpaceFileName | private String getCurrentSSpaceFileName() {
"""
Returns the name of the file form which the current {@code SemanticSpace}
was loaded, or {@code null} if no semantic space is currently open.
@return the name of the file from which the current space was loaded
"""
// REMINDER: This instruction is exp... | java | private String getCurrentSSpaceFileName() {
// REMINDER: This instruction is expected to be rare, so rather than
// save the name and require a lookup every time the current sspace
// is needed, we use an O(n) call to find the name as necessary
for (Map.Entry<String,SemanticSpace> e : fi... | [
"private",
"String",
"getCurrentSSpaceFileName",
"(",
")",
"{",
"// REMINDER: This instruction is expected to be rare, so rather than",
"// save the name and require a lookup every time the current sspace",
"// is needed, we use an O(n) call to find the name as necessary",
"for",
"(",
"Map",
... | Returns the name of the file form which the current {@code SemanticSpace}
was loaded, or {@code null} if no semantic space is currently open.
@return the name of the file from which the current space was loaded | [
"Returns",
"the",
"name",
"of",
"the",
"file",
"form",
"which",
"the",
"current",
"{",
"@code",
"SemanticSpace",
"}",
"was",
"loaded",
"or",
"{",
"@code",
"null",
"}",
"if",
"no",
"semantic",
"space",
"is",
"currently",
"open",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/tools/SemanticSpaceExplorer.java#L150-L160 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java | ArrayHelper.getLast | @Nullable
@SafeVarargs
public static <ELEMENTTYPE> ELEMENTTYPE getLast (@Nullable final ELEMENTTYPE... aArray) {
"""
Get the last element of the array or <code>null</code> if the passed array
is empty.
@param <ELEMENTTYPE>
Array element type
@param aArray
The array who's last element is to be retrieved.... | java | @Nullable
@SafeVarargs
public static <ELEMENTTYPE> ELEMENTTYPE getLast (@Nullable final ELEMENTTYPE... aArray)
{
return getLast (aArray, null);
} | [
"@",
"Nullable",
"@",
"SafeVarargs",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"ELEMENTTYPE",
"getLast",
"(",
"@",
"Nullable",
"final",
"ELEMENTTYPE",
"...",
"aArray",
")",
"{",
"return",
"getLast",
"(",
"aArray",
",",
"null",
")",
";",
"}"
] | Get the last element of the array or <code>null</code> if the passed array
is empty.
@param <ELEMENTTYPE>
Array element type
@param aArray
The array who's last element is to be retrieved. May be
<code>null</code> or empty.
@return <code>null</code> if the passed array is <code>null</code> or empty
- the last element o... | [
"Get",
"the",
"last",
"element",
"of",
"the",
"array",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"the",
"passed",
"array",
"is",
"empty",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java#L1264-L1269 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.readXMLFragment | public static DocumentFragment readXMLFragment(InputStream stream, boolean skipRoot) throws IOException,
SAXException, ParserConfigurationException {
"""
Read an XML fragment from an XML file.
The XML file is well-formed. It means that the fragment will contains a single element: the root element
within the i... | java | public static DocumentFragment readXMLFragment(InputStream stream, boolean skipRoot) throws IOException,
SAXException, ParserConfigurationException {
assert stream != null : AssertMessages.notNullParameter();
try {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentB... | [
"public",
"static",
"DocumentFragment",
"readXMLFragment",
"(",
"InputStream",
"stream",
",",
"boolean",
"skipRoot",
")",
"throws",
"IOException",
",",
"SAXException",
",",
"ParserConfigurationException",
"{",
"assert",
"stream",
"!=",
"null",
":",
"AssertMessages",
"... | Read an XML fragment from an XML file.
The XML file is well-formed. It means that the fragment will contains a single element: the root element
within the input stream.
@param stream is the stream to read
@param skipRoot if {@code true} the root element itself is not part of the fragment, and the children
of the root ... | [
"Read",
"an",
"XML",
"fragment",
"from",
"an",
"XML",
"file",
".",
"The",
"XML",
"file",
"is",
"well",
"-",
"formed",
".",
"It",
"means",
"that",
"the",
"fragment",
"will",
"contains",
"a",
"single",
"element",
":",
"the",
"root",
"element",
"within",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1998-L2028 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextCollection | public <T extends Collection<R>, R> T nextCollection(@NonNull Supplier<T> supplier, @NonNull Class<R> elementType) throws IOException {
"""
Reads the next array as a collection.
@param <T> the collection type
@param <R> the component type of the collection
@param supplier the supplier to cr... | java | public <T extends Collection<R>, R> T nextCollection(@NonNull Supplier<T> supplier, @NonNull Class<R> elementType) throws IOException {
return nextCollection(supplier, null, elementType);
} | [
"public",
"<",
"T",
"extends",
"Collection",
"<",
"R",
">",
",",
"R",
">",
"T",
"nextCollection",
"(",
"@",
"NonNull",
"Supplier",
"<",
"T",
">",
"supplier",
",",
"@",
"NonNull",
"Class",
"<",
"R",
">",
"elementType",
")",
"throws",
"IOException",
"{",... | Reads the next array as a collection.
@param <T> the collection type
@param <R> the component type of the collection
@param supplier the supplier to create a new collection
@param elementType The class of the collection component type
@return the collection containing the items in the next array
@th... | [
"Reads",
"the",
"next",
"array",
"as",
"a",
"collection",
"."
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L409-L411 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.refreshPermissions | public final void refreshPermissions() {
"""
<p>
Issues a request to refresh the permissions on the session.
</p>
<p>
If successful, this will update the permissions and call the app back with
{@link SessionState#OPENED_TOKEN_UPDATED}. The session can then be queried to see the granted and declined
permissi... | java | public final void refreshPermissions() {
Request request = new Request(this, "me/permissions");
request.setCallback(new Request.Callback() {
@Override
public void onCompleted(Response response) {
PermissionsPair permissionsPair = handlePermissionResponse(response)... | [
"public",
"final",
"void",
"refreshPermissions",
"(",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"this",
",",
"\"me/permissions\"",
")",
";",
"request",
".",
"setCallback",
"(",
"new",
"Request",
".",
"Callback",
"(",
")",
"{",
"@",
"Overr... | <p>
Issues a request to refresh the permissions on the session.
</p>
<p>
If successful, this will update the permissions and call the app back with
{@link SessionState#OPENED_TOKEN_UPDATED}. The session can then be queried to see the granted and declined
permissions. If this fails because the user has removed the app... | [
"<p",
">",
"Issues",
"a",
"request",
"to",
"refresh",
"the",
"permissions",
"on",
"the",
"session",
".",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"successful",
"this",
"will",
"update",
"the",
"permissions",
"and",
"call",
"the",
"app",
"back",
"with",
"{"... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L608-L625 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java | TmdbPeople.getPersonMovieCredits | public PersonCreditList<CreditMovieBasic> getPersonMovieCredits(int personId, String language) throws MovieDbException {
"""
Get the movie credits for a specific person id.
@param personId
@param language
@return
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
... | java | public PersonCreditList<CreditMovieBasic> getPersonMovieCredits(int personId, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBas... | [
"public",
"PersonCreditList",
"<",
"CreditMovieBasic",
">",
"getPersonMovieCredits",
"(",
"int",
"personId",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
... | Get the movie credits for a specific person id.
@param personId
@param language
@return
@throws MovieDbException | [
"Get",
"the",
"movie",
"credits",
"for",
"a",
"specific",
"person",
"id",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java#L107-L122 |
forge/furnace | container-api/src/main/java/org/jboss/forge/furnace/util/Annotations.java | Annotations.getAnnotation | public static <A extends Annotation> A getAnnotation(final Method m, final Class<A> type) {
"""
Inspect method <b>m</b> for a specific <b>type</b> of annotation. This also discovers annotations defined through
a @ {@link Stereotype}.
@param m The method to inspect.
@param type The targeted annotation class
@... | java | public static <A extends Annotation> A getAnnotation(final Method m, final Class<A> type)
{
A result = m.getAnnotation(type);
if (result == null)
{
for (Annotation a : m.getAnnotations())
{
result = getAnnotation(a, type);
if (result != null)
{... | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"final",
"Method",
"m",
",",
"final",
"Class",
"<",
"A",
">",
"type",
")",
"{",
"A",
"result",
"=",
"m",
".",
"getAnnotation",
"(",
"type",
")",
";",
"if",
"(",
... | Inspect method <b>m</b> for a specific <b>type</b> of annotation. This also discovers annotations defined through
a @ {@link Stereotype}.
@param m The method to inspect.
@param type The targeted annotation class
@return The annotation instance found on this method or enclosing class, or null if no matching annotation ... | [
"Inspect",
"method",
"<b",
">",
"m<",
"/",
"b",
">",
"for",
"a",
"specific",
"<b",
">",
"type<",
"/",
"b",
">",
"of",
"annotation",
".",
"This",
"also",
"discovers",
"annotations",
"defined",
"through",
"a",
"@",
"{",
"@link",
"Stereotype",
"}",
"."
] | train | https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/container-api/src/main/java/org/jboss/forge/furnace/util/Annotations.java#L100-L120 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/Pager.java | Pager.getHeaderValue | private String getHeaderValue(Response response, String key) throws GitLabApiException {
"""
Get the specified header value from the Response instance.
@param response the Response instance to get the value from
@param key the HTTP header key to get the value for
@return the specified header value from the Re... | java | private String getHeaderValue(Response response, String key) throws GitLabApiException {
String value = response.getHeaderString(key);
value = (value != null ? value.trim() : null);
if (value == null || value.length() == 0) {
return (null);
}
return (value);... | [
"private",
"String",
"getHeaderValue",
"(",
"Response",
"response",
",",
"String",
"key",
")",
"throws",
"GitLabApiException",
"{",
"String",
"value",
"=",
"response",
".",
"getHeaderString",
"(",
"key",
")",
";",
"value",
"=",
"(",
"value",
"!=",
"null",
"?... | Get the specified header value from the Response instance.
@param response the Response instance to get the value from
@param key the HTTP header key to get the value for
@return the specified header value from the Response instance, or null if the header is not present
@throws GitLabApiException if any error occurs | [
"Get",
"the",
"specified",
"header",
"value",
"from",
"the",
"Response",
"instance",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/Pager.java#L139-L148 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.createPropertyDefinition | public CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc, String name) throws CmsException {
"""
Creates a property definition.<p>
Property definitions are valid for all resource types.<p>
@param dbc the current database context
@param name the name of the property definition to create
@ret... | java | public CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc, String name) throws CmsException {
CmsPropertyDefinition propertyDefinition = null;
name = name.trim();
// validate the property name
CmsPropertyDefinition.checkPropertyName(name);
// TODO: make the type a ... | [
"public",
"CmsPropertyDefinition",
"createPropertyDefinition",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"CmsPropertyDefinition",
"propertyDefinition",
"=",
"null",
";",
"name",
"=",
"name",
".",
"trim",
"(",
")",
";",
... | Creates a property definition.<p>
Property definitions are valid for all resource types.<p>
@param dbc the current database context
@param name the name of the property definition to create
@return the created property definition
@throws CmsException if something goes wrong | [
"Creates",
"a",
"property",
"definition",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L1530-L1578 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java | ArabicShaping.normalize | private int normalize(char[] dest, int start, int length) {
"""
/* Convert the input buffer from FExx Range into 06xx Range
to put all characters into the 06xx range
even the lamalef is converted to the special region in
the 06xx range. Return the number of lamalef chars found.
"""
int lacount = 0;... | java | private int normalize(char[] dest, int start, int length) {
int lacount = 0;
for (int i = start, e = i + length; i < e; ++i) {
char ch = dest[i];
if (ch >= '\uFE70' && ch <= '\uFEFC') {
if (isLamAlefChar(ch)) {
++lacount;
}
... | [
"private",
"int",
"normalize",
"(",
"char",
"[",
"]",
"dest",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"int",
"lacount",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"start",
",",
"e",
"=",
"i",
"+",
"length",
";",
"i",
"<",
"e",
"... | /* Convert the input buffer from FExx Range into 06xx Range
to put all characters into the 06xx range
even the lamalef is converted to the special region in
the 06xx range. Return the number of lamalef chars found. | [
"/",
"*",
"Convert",
"the",
"input",
"buffer",
"from",
"FExx",
"Range",
"into",
"06xx",
"Range",
"to",
"put",
"all",
"characters",
"into",
"the",
"06xx",
"range",
"even",
"the",
"lamalef",
"is",
"converted",
"to",
"the",
"special",
"region",
"in",
"the",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java#L1564-L1576 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/KernelResolver.java | KernelResolver.addBootJars | private void addBootJars(List<File> jarFiles, List<URL> urlList) {
"""
Given the list of files, add the URL for each file to the list of URLs
@param jarFiles List of Files (source)
@param urlList List of URLs (target)
"""
for (File jarFile : jarFiles) {
try {
urlList.add... | java | private void addBootJars(List<File> jarFiles, List<URL> urlList) {
for (File jarFile : jarFiles) {
try {
urlList.add(jarFile.toURI().toURL());
} catch (MalformedURLException e) {
// Unlikely: we're making URLs for files we know exist
}
... | [
"private",
"void",
"addBootJars",
"(",
"List",
"<",
"File",
">",
"jarFiles",
",",
"List",
"<",
"URL",
">",
"urlList",
")",
"{",
"for",
"(",
"File",
"jarFile",
":",
"jarFiles",
")",
"{",
"try",
"{",
"urlList",
".",
"add",
"(",
"jarFile",
".",
"toURI",... | Given the list of files, add the URL for each file to the list of URLs
@param jarFiles List of Files (source)
@param urlList List of URLs (target) | [
"Given",
"the",
"list",
"of",
"files",
"add",
"the",
"URL",
"for",
"each",
"file",
"to",
"the",
"list",
"of",
"URLs"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/KernelResolver.java#L252-L260 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/EmptyIfStatement.java | EmptyIfStatement.matchEmptyStatement | @Override
public Description matchEmptyStatement(EmptyStatementTree tree, VisitorState state) {
"""
Match empty statement if: - Parent statement is an if - The then part of the parent if is an
empty statement, and - The else part of the parent if does not exist
"""
boolean matches = false;
Tree pare... | java | @Override
public Description matchEmptyStatement(EmptyStatementTree tree, VisitorState state) {
boolean matches = false;
Tree parent = state.getPath().getParentPath().getLeaf();
if (parent.getKind() == IF) {
IfTree parentAsIf = (IfTree) parent;
matches =
(parentAsIf.getThenStatement(... | [
"@",
"Override",
"public",
"Description",
"matchEmptyStatement",
"(",
"EmptyStatementTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"boolean",
"matches",
"=",
"false",
";",
"Tree",
"parent",
"=",
"state",
".",
"getPath",
"(",
")",
".",
"getParentPath",
... | Match empty statement if: - Parent statement is an if - The then part of the parent if is an
empty statement, and - The else part of the parent if does not exist | [
"Match",
"empty",
"statement",
"if",
":",
"-",
"Parent",
"statement",
"is",
"an",
"if",
"-",
"The",
"then",
"part",
"of",
"the",
"parent",
"if",
"is",
"an",
"empty",
"statement",
"and",
"-",
"The",
"else",
"part",
"of",
"the",
"parent",
"if",
"does",
... | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/EmptyIfStatement.java#L57-L91 |
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/xbel/parser/XBELValidator.java | XBELValidator.utf8SourceForFile | private StreamSource utf8SourceForFile(final File f)
throws FileNotFoundException, UnsupportedEncodingException {
"""
Creates a UTF-8 {@link StreamSource} for a {@link File} by reading it
using the UTF-8 encoding.
@param f {@link File} to read as UTF-8
@return the {@link StreamSource} for <tt>f</t... | java | private StreamSource utf8SourceForFile(final File f)
throws FileNotFoundException, UnsupportedEncodingException {
FileInputStream fis = new FileInputStream(f);
Reader reader = new InputStreamReader(fis, UTF_8);
return new StreamSource(reader);
} | [
"private",
"StreamSource",
"utf8SourceForFile",
"(",
"final",
"File",
"f",
")",
"throws",
"FileNotFoundException",
",",
"UnsupportedEncodingException",
"{",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"f",
")",
";",
"Reader",
"reader",
"=",
"new",
... | Creates a UTF-8 {@link StreamSource} for a {@link File} by reading it
using the UTF-8 encoding.
@param f {@link File} to read as UTF-8
@return the {@link StreamSource} for <tt>f</tt>
@throws FileNotFoundException Thrown if <tt>f</tt> does not exist when
trying to read it
@throws UnsupportedEncodingException Thrown if ... | [
"Creates",
"a",
"UTF",
"-",
"8",
"{",
"@link",
"StreamSource",
"}",
"for",
"a",
"{",
"@link",
"File",
"}",
"by",
"reading",
"it",
"using",
"the",
"UTF",
"-",
"8",
"encoding",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/xbel/parser/XBELValidator.java#L365-L370 |
aws/aws-sdk-java | aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/DockerVolumeConfiguration.java | DockerVolumeConfiguration.withLabels | public DockerVolumeConfiguration withLabels(java.util.Map<String, String> labels) {
"""
<p>
Custom metadata to add to your Docker volume. This parameter maps to <code>Labels</code> in the <a
href="https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate">Create a volume</a> section of the <a
href="https... | java | public DockerVolumeConfiguration withLabels(java.util.Map<String, String> labels) {
setLabels(labels);
return this;
} | [
"public",
"DockerVolumeConfiguration",
"withLabels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"labels",
")",
"{",
"setLabels",
"(",
"labels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Custom metadata to add to your Docker volume. This parameter maps to <code>Labels</code> in the <a
href="https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate">Create a volume</a> section of the <a
href="https://docs.docker.com/engine/api/v1.35/">Docker Remote API</a> and the <code>xxlabel</code> option ... | [
"<p",
">",
"Custom",
"metadata",
"to",
"add",
"to",
"your",
"Docker",
"volume",
".",
"This",
"parameter",
"maps",
"to",
"<code",
">",
"Labels<",
"/",
"code",
">",
"in",
"the",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"docker",
".",
"com",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/DockerVolumeConfiguration.java#L490-L493 |
upwork/java-upwork | src/com/Upwork/api/Routers/Reports/Time.java | Time.getByAgency | public JSONObject getByAgency(String company, String agency, HashMap<String, String> params) throws JSONException {
"""
Generating Agency Specific Reports
@param company Company ID
@param agency Agency ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
"... | java | public JSONObject getByAgency(String company, String agency, HashMap<String, String> params) throws JSONException {
return _getByType(company, null, agency, params, false);
} | [
"public",
"JSONObject",
"getByAgency",
"(",
"String",
"company",
",",
"String",
"agency",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"_getByType",
"(",
"company",
",",
"null",
",",
"agency",
",... | Generating Agency Specific Reports
@param company Company ID
@param agency Agency ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Generating",
"Agency",
"Specific",
"Reports"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Reports/Time.java#L106-L108 |
Waikato/jclasslocator | src/main/java/nz/ac/waikato/cms/locator/ClassLister.java | ClassLister.updateClasses | protected void updateClasses(HashMap<String,List<Class>> list, String superclass, List<Class> classes) {
"""
Updates list for the superclass.
@param list the list to update
@param superclass the superclass
@param classes the names to add
"""
if (!list.containsKey(superclass)) {
list.put(supercla... | java | protected void updateClasses(HashMap<String,List<Class>> list, String superclass, List<Class> classes) {
if (!list.containsKey(superclass)) {
list.put(superclass, classes);
}
else {
for (Class cls : classes) {
if (!list.get(superclass).contains(cls))
list.get(superclass).add(cl... | [
"protected",
"void",
"updateClasses",
"(",
"HashMap",
"<",
"String",
",",
"List",
"<",
"Class",
">",
">",
"list",
",",
"String",
"superclass",
",",
"List",
"<",
"Class",
">",
"classes",
")",
"{",
"if",
"(",
"!",
"list",
".",
"containsKey",
"(",
"superc... | Updates list for the superclass.
@param list the list to update
@param superclass the superclass
@param classes the names to add | [
"Updates",
"list",
"for",
"the",
"superclass",
"."
] | train | https://github.com/Waikato/jclasslocator/blob/c899072fff607a56ee7f8c2d01fbeb15157ad144/src/main/java/nz/ac/waikato/cms/locator/ClassLister.java#L266-L276 |
aws/aws-sdk-java | aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/CreateBranchRequest.java | CreateBranchRequest.withTags | public CreateBranchRequest withTags(java.util.Map<String, String> tags) {
"""
<p>
Tag for the branch.
</p>
@param tags
Tag for the branch.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public CreateBranchRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateBranchRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Tag for the branch.
</p>
@param tags
Tag for the branch.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Tag",
"for",
"the",
"branch",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/CreateBranchRequest.java#L621-L624 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java | NodeImpl.doUnlock | protected void doUnlock() throws RepositoryException {
"""
Remove mix:lockable properties.
@throws RepositoryException if error occurs
"""
PlainChangesLog changesLog = new PlainChangesLogImpl(new ArrayList<ItemState>(), session, ExtendedEvent.UNLOCK);
ItemData lockOwner =
dataManager.g... | java | protected void doUnlock() throws RepositoryException
{
PlainChangesLog changesLog = new PlainChangesLogImpl(new ArrayList<ItemState>(), session, ExtendedEvent.UNLOCK);
ItemData lockOwner =
dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_LOCKOWNER, 0), ItemType.PROPERTY);
... | [
"protected",
"void",
"doUnlock",
"(",
")",
"throws",
"RepositoryException",
"{",
"PlainChangesLog",
"changesLog",
"=",
"new",
"PlainChangesLogImpl",
"(",
"new",
"ArrayList",
"<",
"ItemState",
">",
"(",
")",
",",
"session",
",",
"ExtendedEvent",
".",
"UNLOCK",
")... | Remove mix:lockable properties.
@throws RepositoryException if error occurs | [
"Remove",
"mix",
":",
"lockable",
"properties",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java#L2823-L2838 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/experimental/CollectSink.java | CollectSink.open | @Override
public void open(Configuration parameters) throws Exception {
"""
Initialize the connection with the Socket in the server.
@param parameters Configuration.
"""
try {
client = new Socket(hostIp, port);
outputStream = client.getOutputStream();
streamWriter = new DataOutputViewStreamWrapper... | java | @Override
public void open(Configuration parameters) throws Exception {
try {
client = new Socket(hostIp, port);
outputStream = client.getOutputStream();
streamWriter = new DataOutputViewStreamWrapper(outputStream);
}
catch (IOException e) {
throw new IOException("Cannot connect to the client to send... | [
"@",
"Override",
"public",
"void",
"open",
"(",
"Configuration",
"parameters",
")",
"throws",
"Exception",
"{",
"try",
"{",
"client",
"=",
"new",
"Socket",
"(",
"hostIp",
",",
"port",
")",
";",
"outputStream",
"=",
"client",
".",
"getOutputStream",
"(",
")... | Initialize the connection with the Socket in the server.
@param parameters Configuration. | [
"Initialize",
"the",
"connection",
"with",
"the",
"Socket",
"in",
"the",
"server",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/experimental/CollectSink.java#L77-L87 |
gaixie/jibu-core | src/main/java/org/gaixie/jibu/utils/BeanConverter.java | BeanConverter.mapToBean | public static <T> T mapToBean(Class<T> cls, Map map) throws JibuException {
"""
通过 Map 对Javabean 进行实例化并赋值。
<p>
Map 对象的格式必须为 key/value 。如果 map 中的 key 与 javabean
中的属性名称一致,并且值可以被转化,则进行赋值。</p>
<p>
Map 中的 value 不能为数组类型,也就是说不能用
request.getParameterValues() 来获取 value。</p>
@param <T> 必须给定 bean 的 class 类型
@param ... | java | public static <T> T mapToBean(Class<T> cls, Map map) throws JibuException {
try {
T bean = cls.newInstance();
BeanInfo beanInfo = Introspector.getBeanInfo(cls);
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
for( PropertyDescriptor pd : pds ){
... | [
"public",
"static",
"<",
"T",
">",
"T",
"mapToBean",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"Map",
"map",
")",
"throws",
"JibuException",
"{",
"try",
"{",
"T",
"bean",
"=",
"cls",
".",
"newInstance",
"(",
")",
";",
"BeanInfo",
"beanInfo",
"=",
"I... | 通过 Map 对Javabean 进行实例化并赋值。
<p>
Map 对象的格式必须为 key/value 。如果 map 中的 key 与 javabean
中的属性名称一致,并且值可以被转化,则进行赋值。</p>
<p>
Map 中的 value 不能为数组类型,也就是说不能用
request.getParameterValues() 来获取 value。</p>
@param <T> 必须给定 bean 的 class 类型
@param cls 被处理 bean 的 Class
@param map 由 bean 属性名做 key 的 Map
@return 实例化,并赋值完成的 Bean
@exception Jibu... | [
"通过",
"Map",
"对Javabean",
"进行实例化并赋值。",
"<p",
">",
"Map",
"对象的格式必须为",
"key",
"/",
"value",
"。如果",
"map",
"中的",
"key",
"与",
"javabean",
"中的属性名称一致,并且值可以被转化,则进行赋值。<",
"/",
"p",
">",
"<p",
">",
"Map",
"中的",
"value",
"不能为数组类型,也就是说不能用",
"request",
".",
"getParamete... | train | https://github.com/gaixie/jibu-core/blob/d5462f2883321c82d898c8752b7e5eba4b7dc184/src/main/java/org/gaixie/jibu/utils/BeanConverter.java#L54-L75 |
lukas-krecan/JsonUnit | json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java | JsonAssert.setOptions | public static void setOptions(Option firstOption, Option... rest) {
"""
Sets options changing comparison behavior. For more
details see {@link net.javacrumbs.jsonunit.core.Option}
@see net.javacrumbs.jsonunit.core.Option
"""
configuration = configuration.withOptions(Options.empty().with(firstOption... | java | public static void setOptions(Option firstOption, Option... rest) {
configuration = configuration.withOptions(Options.empty().with(firstOption, rest));
} | [
"public",
"static",
"void",
"setOptions",
"(",
"Option",
"firstOption",
",",
"Option",
"...",
"rest",
")",
"{",
"configuration",
"=",
"configuration",
".",
"withOptions",
"(",
"Options",
".",
"empty",
"(",
")",
".",
"with",
"(",
"firstOption",
",",
"rest",
... | Sets options changing comparison behavior. For more
details see {@link net.javacrumbs.jsonunit.core.Option}
@see net.javacrumbs.jsonunit.core.Option | [
"Sets",
"options",
"changing",
"comparison",
"behavior",
".",
"For",
"more",
"details",
"see",
"{",
"@link",
"net",
".",
"javacrumbs",
".",
"jsonunit",
".",
"core",
".",
"Option",
"}"
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java#L242-L244 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/QuantityFormatter.java | QuantityFormatter.selectPlural | public static StandardPlural selectPlural(double number, NumberFormat numberFormat, PluralRules rules) {
"""
Selects the standard plural form for the number/formatter/rules.
"""
String pluralKeyword;
if (numberFormat instanceof DecimalFormat) {
pluralKeyword = rules.select(((Decimal... | java | public static StandardPlural selectPlural(double number, NumberFormat numberFormat, PluralRules rules) {
String pluralKeyword;
if (numberFormat instanceof DecimalFormat) {
pluralKeyword = rules.select(((DecimalFormat) numberFormat).getFixedDecimal(number));
} else {
plura... | [
"public",
"static",
"StandardPlural",
"selectPlural",
"(",
"double",
"number",
",",
"NumberFormat",
"numberFormat",
",",
"PluralRules",
"rules",
")",
"{",
"String",
"pluralKeyword",
";",
"if",
"(",
"numberFormat",
"instanceof",
"DecimalFormat",
")",
"{",
"pluralKeyw... | Selects the standard plural form for the number/formatter/rules. | [
"Selects",
"the",
"standard",
"plural",
"form",
"for",
"the",
"number",
"/",
"formatter",
"/",
"rules",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/QuantityFormatter.java#L95-L103 |
52inc/android-52Kit | library-drawer/src/main/java/com/ftinc/kit/drawer/items/IconDrawerItem.java | IconDrawerItem.onCreateView | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, int highlightColor) {
"""
Called to create this view
@param inflater the layout inflater to inflate a layout from system
@param container the container the layout is going to be placed in
@return
"""
Cont... | java | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, int highlightColor) {
Context ctx = inflater.getContext();
View view = inflater.inflate(R.layout.navdrawer_item, container, false);
ImageView iconView = ButterKnife.findById(view, R.id.icon);
TextView t... | [
"@",
"Override",
"public",
"View",
"onCreateView",
"(",
"LayoutInflater",
"inflater",
",",
"ViewGroup",
"container",
",",
"int",
"highlightColor",
")",
"{",
"Context",
"ctx",
"=",
"inflater",
".",
"getContext",
"(",
")",
";",
"View",
"view",
"=",
"inflater",
... | Called to create this view
@param inflater the layout inflater to inflate a layout from system
@param container the container the layout is going to be placed in
@return | [
"Called",
"to",
"create",
"this",
"view"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-drawer/src/main/java/com/ftinc/kit/drawer/items/IconDrawerItem.java#L69-L108 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java | RtpPacket.getPayload | public void getPayload(byte[] buff, int offset) {
"""
Reads the data transported by RTP in a packet, for example
audio samples or compressed video data.
@param buff the buffer used for reading
@param offset the initial offset inside buffer.
"""
buffer.position(FIXED_HEADER_SIZE);
buffer.ge... | java | public void getPayload(byte[] buff, int offset) {
buffer.position(FIXED_HEADER_SIZE);
buffer.get(buff, offset, buffer.limit() - FIXED_HEADER_SIZE);
} | [
"public",
"void",
"getPayload",
"(",
"byte",
"[",
"]",
"buff",
",",
"int",
"offset",
")",
"{",
"buffer",
".",
"position",
"(",
"FIXED_HEADER_SIZE",
")",
";",
"buffer",
".",
"get",
"(",
"buff",
",",
"offset",
",",
"buffer",
".",
"limit",
"(",
")",
"-"... | Reads the data transported by RTP in a packet, for example
audio samples or compressed video data.
@param buff the buffer used for reading
@param offset the initial offset inside buffer. | [
"Reads",
"the",
"data",
"transported",
"by",
"RTP",
"in",
"a",
"packet",
"for",
"example",
"audio",
"samples",
"or",
"compressed",
"video",
"data",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java#L304-L307 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/super_src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.listAsString | public static <E> String listAsString(List<E> list, String separator) {
"""
Returns a string representation for the given list using the given separator.<p>
@param <E> type of list entries
@param list the list to write
@param separator the item separator string
@return the string representation for the giv... | java | public static <E> String listAsString(List<E> list, String separator) {
StringBuffer string = new StringBuffer(128);
Iterator<E> it = list.iterator();
while (it.hasNext()) {
string.append(it.next());
if (it.hasNext()) {
string.append(separator);
... | [
"public",
"static",
"<",
"E",
">",
"String",
"listAsString",
"(",
"List",
"<",
"E",
">",
"list",
",",
"String",
"separator",
")",
"{",
"StringBuffer",
"string",
"=",
"new",
"StringBuffer",
"(",
"128",
")",
";",
"Iterator",
"<",
"E",
">",
"it",
"=",
"... | Returns a string representation for the given list using the given separator.<p>
@param <E> type of list entries
@param list the list to write
@param separator the item separator string
@return the string representation for the given map | [
"Returns",
"a",
"string",
"representation",
"for",
"the",
"given",
"list",
"using",
"the",
"given",
"separator",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/super_src/org/opencms/util/CmsStringUtil.java#L318-L329 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/ChannelUpgradeHandler.java | ChannelUpgradeHandler.addProtocol | public synchronized void addProtocol(String productString, HttpUpgradeListener openListener, final HttpUpgradeHandshake handshake) {
"""
Add a protocol to this handler.
@param productString the product string to match
@param openListener the open listener to call
@param handshake a handshake implementati... | java | public synchronized void addProtocol(String productString, HttpUpgradeListener openListener, final HttpUpgradeHandshake handshake) {
addProtocol(productString, openListener, null, handshake);
} | [
"public",
"synchronized",
"void",
"addProtocol",
"(",
"String",
"productString",
",",
"HttpUpgradeListener",
"openListener",
",",
"final",
"HttpUpgradeHandshake",
"handshake",
")",
"{",
"addProtocol",
"(",
"productString",
",",
"openListener",
",",
"null",
",",
"hands... | Add a protocol to this handler.
@param productString the product string to match
@param openListener the open listener to call
@param handshake a handshake implementation that can be used to verify the client request and modify the response | [
"Add",
"a",
"protocol",
"to",
"this",
"handler",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/ChannelUpgradeHandler.java#L64-L66 |
google/flogger | api/src/main/java/com/google/common/flogger/util/CallerFinder.java | CallerFinder.findCallerOf | @Nullable
public static StackTraceElement findCallerOf(Class<?> target, Throwable throwable, int skip) {
"""
Returns the stack trace element of the immediate caller of the specified class.
@param target the target class whose callers we are looking for.
@param throwable a new Throwable made at a known point ... | java | @Nullable
public static StackTraceElement findCallerOf(Class<?> target, Throwable throwable, int skip) {
checkNotNull(target, "target");
checkNotNull(throwable, "throwable");
if (skip < 0) {
throw new IllegalArgumentException("skip count cannot be negative: " + skip);
}
// Getting the full s... | [
"@",
"Nullable",
"public",
"static",
"StackTraceElement",
"findCallerOf",
"(",
"Class",
"<",
"?",
">",
"target",
",",
"Throwable",
"throwable",
",",
"int",
"skip",
")",
"{",
"checkNotNull",
"(",
"target",
",",
"\"target\"",
")",
";",
"checkNotNull",
"(",
"th... | Returns the stack trace element of the immediate caller of the specified class.
@param target the target class whose callers we are looking for.
@param throwable a new Throwable made at a known point in the call hierarchy.
@param skip the minimum number of calls known to have occurred between the first call to
the tar... | [
"Returns",
"the",
"stack",
"trace",
"element",
"of",
"the",
"immediate",
"caller",
"of",
"the",
"specified",
"class",
"."
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/util/CallerFinder.java#L43-L76 |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.addProperty | public static void addProperty(String key, String value) {
"""
Add property to 'properties' map on transaction
@param key - of property
@param value - of property
"""
TransactionLogger instance = getInstance();
if (instance != null) {
instance.properties.put(key, value);
}
} | java | public static void addProperty(String key, String value) {
TransactionLogger instance = getInstance();
if (instance != null) {
instance.properties.put(key, value);
}
} | [
"public",
"static",
"void",
"addProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"TransactionLogger",
"instance",
"=",
"getInstance",
"(",
")",
";",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"instance",
".",
"properties",
".",
"put",... | Add property to 'properties' map on transaction
@param key - of property
@param value - of property | [
"Add",
"property",
"to",
"properties",
"map",
"on",
"transaction"
] | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L205-L210 |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java | MavenImportUtils.restorePom | static void restorePom(File projectDir, IProgressMonitor monitor) throws IOException {
"""
Restore the original pom file.
@param projectDir the folder in which the pom file is located.
@param monitor the progress monitor.
@throws IOException if the pom file cannot be changed.
"""
final File pomFile = ne... | java | static void restorePom(File projectDir, IProgressMonitor monitor) throws IOException {
final File pomFile = new File(projectDir, POM_FILE);
final File savedPomFile = new File(projectDir, POM_BACKUP_FILE);
if (savedPomFile.exists()) {
if (pomFile.exists()) {
pomFile.delete();
}
Files.copy(savedPomFile... | [
"static",
"void",
"restorePom",
"(",
"File",
"projectDir",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"IOException",
"{",
"final",
"File",
"pomFile",
"=",
"new",
"File",
"(",
"projectDir",
",",
"POM_FILE",
")",
";",
"final",
"File",
"savedPomFile",
"="... | Restore the original pom file.
@param projectDir the folder in which the pom file is located.
@param monitor the progress monitor.
@throws IOException if the pom file cannot be changed. | [
"Restore",
"the",
"original",
"pom",
"file",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java#L245-L256 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.binary | public static void binary(Image srcImage, ImageOutputStream destImageStream, String imageType) throws IORuntimeException {
"""
彩色转为黑白二值化图片<br>
此方法并不关闭流,输出JPG格式
@param srcImage 源图像流
@param destImageStream 目标图像流
@param imageType 图片格式(扩展名)
@since 4.0.5
@throws IORuntimeException IO异常
"""
write(binary(s... | java | public static void binary(Image srcImage, ImageOutputStream destImageStream, String imageType) throws IORuntimeException {
write(binary(srcImage), imageType, destImageStream);
} | [
"public",
"static",
"void",
"binary",
"(",
"Image",
"srcImage",
",",
"ImageOutputStream",
"destImageStream",
",",
"String",
"imageType",
")",
"throws",
"IORuntimeException",
"{",
"write",
"(",
"binary",
"(",
"srcImage",
")",
",",
"imageType",
",",
"destImageStream... | 彩色转为黑白二值化图片<br>
此方法并不关闭流,输出JPG格式
@param srcImage 源图像流
@param destImageStream 目标图像流
@param imageType 图片格式(扩展名)
@since 4.0.5
@throws IORuntimeException IO异常 | [
"彩色转为黑白二值化图片<br",
">",
"此方法并不关闭流,输出JPG格式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L726-L728 |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/AbstractParser.java | AbstractParser.addError | protected void addError(final DefaultDataSet ds, final String errorDesc, final int lineNo, final int errorLevel) {
"""
Adds a new error to this DataSet. These can be collected, and retrieved
after processing
@param ds
the dataset
@param errorDesc
String description of error
@param lineNo
line number error... | java | protected void addError(final DefaultDataSet ds, final String errorDesc, final int lineNo, final int errorLevel) {
addError(ds, errorDesc, lineNo, errorLevel, null);
} | [
"protected",
"void",
"addError",
"(",
"final",
"DefaultDataSet",
"ds",
",",
"final",
"String",
"errorDesc",
",",
"final",
"int",
"lineNo",
",",
"final",
"int",
"errorLevel",
")",
"{",
"addError",
"(",
"ds",
",",
"errorDesc",
",",
"lineNo",
",",
"errorLevel",... | Adds a new error to this DataSet. These can be collected, and retrieved
after processing
@param ds
the dataset
@param errorDesc
String description of error
@param lineNo
line number error occurred on
@param errorLevel
errorLevel 1,2,3 1=warning 2=error 3= severe error | [
"Adds",
"a",
"new",
"error",
"to",
"this",
"DataSet",
".",
"These",
"can",
"be",
"collected",
"and",
"retrieved",
"after",
"processing"
] | train | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/AbstractParser.java#L256-L258 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java | UriEscaper.isIllegal | private boolean isIllegal(final char c, final State state) {
"""
Returns whether or not this character is illegal in the given state
"""
switch (state) {
case FRAGMENT:
return (strict ? STRICT_ILLEGAL_IN_FRAGMENT : ILLEGAL_IN_FRAGMENT).matches(c);
case QUERY:
... | java | private boolean isIllegal(final char c, final State state) {
switch (state) {
case FRAGMENT:
return (strict ? STRICT_ILLEGAL_IN_FRAGMENT : ILLEGAL_IN_FRAGMENT).matches(c);
case QUERY:
return (strict ? STRICT_ILLEGAL_IN_QUERY : ILLEGAL_IN_QUERY).matches(c);... | [
"private",
"boolean",
"isIllegal",
"(",
"final",
"char",
"c",
",",
"final",
"State",
"state",
")",
"{",
"switch",
"(",
"state",
")",
"{",
"case",
"FRAGMENT",
":",
"return",
"(",
"strict",
"?",
"STRICT_ILLEGAL_IN_FRAGMENT",
":",
"ILLEGAL_IN_FRAGMENT",
")",
".... | Returns whether or not this character is illegal in the given state | [
"Returns",
"whether",
"or",
"not",
"this",
"character",
"is",
"illegal",
"in",
"the",
"given",
"state"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java#L151-L166 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceRecordAgent.java | NetworkServiceRecordAgent.deleteVNFDependency | @Help(
help =
"Delete the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id"
)
public void deleteVNFDependency(final String idNsr, final String idVnfrDep) throws SDKException {
"""
Deletes a specific VNFRecordDependency from a NetworkServiceRecord.
@param idNsr t... | java | @Help(
help =
"Delete the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id"
)
public void deleteVNFDependency(final String idNsr, final String idVnfrDep) throws SDKException {
String url = idNsr + "/vnfdependencies" + "/" + idVnfrDep;
requestDelete(url);
} | [
"@",
"Help",
"(",
"help",
"=",
"\"Delete the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id\"",
")",
"public",
"void",
"deleteVNFDependency",
"(",
"final",
"String",
"idNsr",
",",
"final",
"String",
"idVnfrDep",
")",
"throws",
"SDKException... | Deletes a specific VNFRecordDependency from a NetworkServiceRecord.
@param idNsr the ID of the NetworkServiceRecord
@param idVnfrDep the ID of the VNFRecordDependency to delete
@throws SDKException if the request fails | [
"Deletes",
"a",
"specific",
"VNFRecordDependency",
"from",
"a",
"NetworkServiceRecord",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceRecordAgent.java#L449-L456 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getInvoice | public Invoice getInvoice(final String invoiceId) {
"""
Lookup an invoice given an invoice id
<p>
Returns the invoice given a string id.
The invoice may or may not have acountry code prefix (ex: IE1023).
For more information on invoicing and prefixes, see:
https://docs.recurly.com/docs/site-settings#section... | java | public Invoice getInvoice(final String invoiceId) {
if (invoiceId == null || invoiceId.isEmpty())
throw new RuntimeException("invoiceId cannot be empty!");
return doGET(Invoices.INVOICES_RESOURCE + "/" + invoiceId, Invoice.class);
} | [
"public",
"Invoice",
"getInvoice",
"(",
"final",
"String",
"invoiceId",
")",
"{",
"if",
"(",
"invoiceId",
"==",
"null",
"||",
"invoiceId",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"invoiceId cannot be empty!\"",
")",
";",
"retu... | Lookup an invoice given an invoice id
<p>
Returns the invoice given a string id.
The invoice may or may not have acountry code prefix (ex: IE1023).
For more information on invoicing and prefixes, see:
https://docs.recurly.com/docs/site-settings#section-invoice-prefixing
@param invoiceId String Recurly Invoice ID
@ret... | [
"Lookup",
"an",
"invoice",
"given",
"an",
"invoice",
"id"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L994-L999 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/data/bayesnet/BayesNetReader.java | BayesNetReader.readBnAsFg | public FactorGraph readBnAsFg(File networkFile, File cpdFile) throws IOException {
"""
Reads a Bayesian Network from a network file and a CPD file, and returns
a factor graph representation of it.
"""
return readBnAsFg(new FileInputStream(networkFile), new FileInputStream(cpdFile));
} | java | public FactorGraph readBnAsFg(File networkFile, File cpdFile) throws IOException {
return readBnAsFg(new FileInputStream(networkFile), new FileInputStream(cpdFile));
} | [
"public",
"FactorGraph",
"readBnAsFg",
"(",
"File",
"networkFile",
",",
"File",
"cpdFile",
")",
"throws",
"IOException",
"{",
"return",
"readBnAsFg",
"(",
"new",
"FileInputStream",
"(",
"networkFile",
")",
",",
"new",
"FileInputStream",
"(",
"cpdFile",
")",
")",... | Reads a Bayesian Network from a network file and a CPD file, and returns
a factor graph representation of it. | [
"Reads",
"a",
"Bayesian",
"Network",
"from",
"a",
"network",
"file",
"and",
"a",
"CPD",
"file",
"and",
"returns",
"a",
"factor",
"graph",
"representation",
"of",
"it",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/data/bayesnet/BayesNetReader.java#L42-L44 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/component/rabbitmq/AmqpTemplateFactory.java | AmqpTemplateFactory.getRabbitTemplate | private RabbitTemplate getRabbitTemplate(String queueName, ConnectionFactory connectionFactory)
throws RabbitmqCommunicateException {
"""
RabbitTemplateを取得する。
@param queueName キュー名
@param connectionFactory ConnectionFactory
@return RabbitTemplate
@throws RabbitmqCommunicateException amqpTemplateを... | java | private RabbitTemplate getRabbitTemplate(String queueName, ConnectionFactory connectionFactory)
throws RabbitmqCommunicateException
{
// AmqpTemplateは使いまわされるため、ディープコピーをする。
RabbitTemplate template = null;
try
{
template = (RabbitTemplate) BeanUtils.cloneBean(ge... | [
"private",
"RabbitTemplate",
"getRabbitTemplate",
"(",
"String",
"queueName",
",",
"ConnectionFactory",
"connectionFactory",
")",
"throws",
"RabbitmqCommunicateException",
"{",
"// AmqpTemplateは使いまわされるため、ディープコピーをする。",
"RabbitTemplate",
"template",
"=",
"null",
";",
"try",
"{"... | RabbitTemplateを取得する。
@param queueName キュー名
@param connectionFactory ConnectionFactory
@return RabbitTemplate
@throws RabbitmqCommunicateException amqpTemplateを取得できなかった場合 | [
"RabbitTemplateを取得する。"
] | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/component/rabbitmq/AmqpTemplateFactory.java#L156-L174 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_L4 | @Pure
public static Point2d L2_L4(double x, double y) {
"""
This function convert France Lambert II coordinate to
France Lambert IV coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the France Lambert IV coordinate.
"""
final Point2d nt... | java | @Pure
public static Point2d L2_L4(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_4_N,
LAMBERT_4_C,
LAMBERT_4_XS,... | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L2_L4",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2_N",
",",
"LAMBERT_2_C",
",",
"LAMBERT_2_XS",
",",
... | This function convert France Lambert II coordinate to
France Lambert IV coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the France Lambert IV coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"IV",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L496-L509 |
mozilla/rhino | src/org/mozilla/classfile/ClassFileWriter.java | ClassFileWriter.addField | public void addField(String fieldName, String type, short flags) {
"""
Add a field to the class.
@param fieldName the name of the field
@param type the type of the field using ...
@param flags the attributes of the field, such as ACC_PUBLIC, etc. bitwise or'd together
"""
short fieldNameIndex = it... | java | public void addField(String fieldName, String type, short flags) {
short fieldNameIndex = itsConstantPool.addUtf8(fieldName);
short typeIndex = itsConstantPool.addUtf8(type);
itsFields.add(new ClassFileField(fieldNameIndex, typeIndex, flags));
} | [
"public",
"void",
"addField",
"(",
"String",
"fieldName",
",",
"String",
"type",
",",
"short",
"flags",
")",
"{",
"short",
"fieldNameIndex",
"=",
"itsConstantPool",
".",
"addUtf8",
"(",
"fieldName",
")",
";",
"short",
"typeIndex",
"=",
"itsConstantPool",
".",
... | Add a field to the class.
@param fieldName the name of the field
@param type the type of the field using ...
@param flags the attributes of the field, such as ACC_PUBLIC, etc. bitwise or'd together | [
"Add",
"a",
"field",
"to",
"the",
"class",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/classfile/ClassFileWriter.java#L135-L139 |
code4everything/util | src/main/java/com/zhazhapan/util/NetUtils.java | NetUtils.addCookie | public static boolean addCookie(HttpServletResponse response, String name, String value, int expiry, String uri) {
"""
添加Cookie
@param response {@link HttpServletResponse}
@param name Cookie名
@param value Cookie值
@param expiry 有效期
@param uri 路径
@return {@link Boolean}
@since 1.0.8
"""
Cook... | java | public static boolean addCookie(HttpServletResponse response, String name, String value, int expiry, String uri) {
Cookie cookie = new Cookie(name, value);
if (expiry > 0) {
cookie.setMaxAge(expiry);
}
if (Checker.isNotEmpty(uri)) {
cookie.setPath(uri);
}
... | [
"public",
"static",
"boolean",
"addCookie",
"(",
"HttpServletResponse",
"response",
",",
"String",
"name",
",",
"String",
"value",
",",
"int",
"expiry",
",",
"String",
"uri",
")",
"{",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"name",
",",
"value",
")... | 添加Cookie
@param response {@link HttpServletResponse}
@param name Cookie名
@param value Cookie值
@param expiry 有效期
@param uri 路径
@return {@link Boolean}
@since 1.0.8 | [
"添加Cookie"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/NetUtils.java#L608-L617 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WNumberField.java | WNumberField.handleRequestValue | protected void handleRequestValue(final BigDecimal value, final boolean valid, final String text) {
"""
Set the request value.
@param value the number value
@param valid true if valid value
@param text the user text
"""
// As setData() clears the text value (if valid), this must be called first so it ca... | java | protected void handleRequestValue(final BigDecimal value, final boolean valid, final String text) {
// As setData() clears the text value (if valid), this must be called first so it can be set after
setData(value);
NumberFieldModel model = getOrCreateComponentModel();
model.validNumber = valid;
model.text = t... | [
"protected",
"void",
"handleRequestValue",
"(",
"final",
"BigDecimal",
"value",
",",
"final",
"boolean",
"valid",
",",
"final",
"String",
"text",
")",
"{",
"// As setData() clears the text value (if valid), this must be called first so it can be set after",
"setData",
"(",
"v... | Set the request value.
@param value the number value
@param valid true if valid value
@param text the user text | [
"Set",
"the",
"request",
"value",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WNumberField.java#L85-L91 |
jenkinsci/jenkins | core/src/main/java/hudson/util/Iterators.java | Iterators.reverseSequence | public static List<Integer> reverseSequence(int start, int end, int step) {
"""
The short cut for {@code reverse(sequence(start,end,step))}.
@since 1.150
"""
return sequence(end-1,start-1,-step);
} | java | public static List<Integer> reverseSequence(int start, int end, int step) {
return sequence(end-1,start-1,-step);
} | [
"public",
"static",
"List",
"<",
"Integer",
">",
"reverseSequence",
"(",
"int",
"start",
",",
"int",
"end",
",",
"int",
"step",
")",
"{",
"return",
"sequence",
"(",
"end",
"-",
"1",
",",
"start",
"-",
"1",
",",
"-",
"step",
")",
";",
"}"
] | The short cut for {@code reverse(sequence(start,end,step))}.
@since 1.150 | [
"The",
"short",
"cut",
"for",
"{",
"@code",
"reverse",
"(",
"sequence",
"(",
"start",
"end",
"step",
"))",
"}",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/Iterators.java#L253-L255 |
pf4j/pf4j | pf4j/src/main/java/org/pf4j/util/FileUtils.java | FileUtils.findWithEnding | public static Path findWithEnding(Path basePath, String... endings) {
"""
Finds a path with various endings or null if not found.
@param basePath the base name
@param endings a list of endings to search for
@return new path or null if not found
"""
for (String ending : endings) {
Path ... | java | public static Path findWithEnding(Path basePath, String... endings) {
for (String ending : endings) {
Path newPath = basePath.resolveSibling(basePath.getFileName() + ending);
if (Files.exists(newPath)) {
return newPath;
}
}
return null;
} | [
"public",
"static",
"Path",
"findWithEnding",
"(",
"Path",
"basePath",
",",
"String",
"...",
"endings",
")",
"{",
"for",
"(",
"String",
"ending",
":",
"endings",
")",
"{",
"Path",
"newPath",
"=",
"basePath",
".",
"resolveSibling",
"(",
"basePath",
".",
"ge... | Finds a path with various endings or null if not found.
@param basePath the base name
@param endings a list of endings to search for
@return new path or null if not found | [
"Finds",
"a",
"path",
"with",
"various",
"endings",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/pf4j/pf4j/blob/6dd7a6069f0e2fbd842c81e2c8c388918b88ea81/pf4j/src/main/java/org/pf4j/util/FileUtils.java#L133-L142 |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.deserializeSecretKey | public static SecretKey deserializeSecretKey(byte[] keyData, String algorithm) {
"""
converts a byte[] that originally was created using {@link SecretKey#getEncoded()} back to the corresponding
instance.
Example: CipherUtils.deserializeSecretKey(data, "AES")
"""
LOGGER.trace("deserialize secret key... | java | public static SecretKey deserializeSecretKey(byte[] keyData, String algorithm) {
LOGGER.trace("deserialize secret key from data using algorithm \"{}\"", algorithm);
return new SecretKeySpec(keyData, algorithm);
} | [
"public",
"static",
"SecretKey",
"deserializeSecretKey",
"(",
"byte",
"[",
"]",
"keyData",
",",
"String",
"algorithm",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"deserialize secret key from data using algorithm \\\"{}\\\"\"",
",",
"algorithm",
")",
";",
"return",
"new"... | converts a byte[] that originally was created using {@link SecretKey#getEncoded()} back to the corresponding
instance.
Example: CipherUtils.deserializeSecretKey(data, "AES") | [
"converts",
"a",
"byte",
"[]",
"that",
"originally",
"was",
"created",
"using",
"{",
"@link",
"SecretKey#getEncoded",
"()",
"}",
"back",
"to",
"the",
"corresponding",
"instance",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L163-L166 |
mjiderhamn/classloader-leak-prevention | classloader-leak-prevention/classloader-leak-prevention-core/src/main/java/se/jiderhamn/classloader/leak/prevention/ClassLoaderLeakPreventorFactory.java | ClassLoaderLeakPreventorFactory.addConsideringOrder | private <I> void addConsideringOrder(Map<String, I> map, I newEntry) {
"""
Add new {@link I} entry to {@code map}, taking {@link MustBeAfter} into account
"""
for(Map.Entry<String, I> entry : map.entrySet()) {
if(entry.getValue() instanceof MustBeAfter<?>) {
final Class<? extends ClassLoaderP... | java | private <I> void addConsideringOrder(Map<String, I> map, I newEntry) {
for(Map.Entry<String, I> entry : map.entrySet()) {
if(entry.getValue() instanceof MustBeAfter<?>) {
final Class<? extends ClassLoaderPreMortemCleanUp>[] existingMustBeAfter =
((MustBeAfter<ClassLoaderPreMortemCleanUp>)... | [
"private",
"<",
"I",
">",
"void",
"addConsideringOrder",
"(",
"Map",
"<",
"String",
",",
"I",
">",
"map",
",",
"I",
"newEntry",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"I",
">",
"entry",
":",
"map",
".",
"entrySet",
"(",
")... | Add new {@link I} entry to {@code map}, taking {@link MustBeAfter} into account | [
"Add",
"new",
"{"
] | train | https://github.com/mjiderhamn/classloader-leak-prevention/blob/eea8e3cef64f8096dbbb87552df0a1bd272bcb63/classloader-leak-prevention/classloader-leak-prevention-core/src/main/java/se/jiderhamn/classloader/leak/prevention/ClassLoaderLeakPreventorFactory.java#L174-L189 |
aws/aws-sdk-java | aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/CreatePlayerSessionsRequest.java | CreatePlayerSessionsRequest.withPlayerDataMap | public CreatePlayerSessionsRequest withPlayerDataMap(java.util.Map<String, String> playerDataMap) {
"""
<p>
Map of string pairs, each specifying a player ID and a set of developer-defined information related to the
player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the ga... | java | public CreatePlayerSessionsRequest withPlayerDataMap(java.util.Map<String, String> playerDataMap) {
setPlayerDataMap(playerDataMap);
return this;
} | [
"public",
"CreatePlayerSessionsRequest",
"withPlayerDataMap",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"playerDataMap",
")",
"{",
"setPlayerDataMap",
"(",
"playerDataMap",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Map of string pairs, each specifying a player ID and a set of developer-defined information related to the
player. Amazon GameLift does not use this data, so it can be formatted as needed for use in the game. Player data
strings for player IDs not included in the <code>PlayerIds</code> parameter are ignored.
</p>
... | [
"<p",
">",
"Map",
"of",
"string",
"pairs",
"each",
"specifying",
"a",
"player",
"ID",
"and",
"a",
"set",
"of",
"developer",
"-",
"defined",
"information",
"related",
"to",
"the",
"player",
".",
"Amazon",
"GameLift",
"does",
"not",
"use",
"this",
"data",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/CreatePlayerSessionsRequest.java#L209-L212 |
zeroturnaround/zt-exec | src/main/java/org/zeroturnaround/exec/stream/slf4j/Slf4jStream.java | Slf4jStream.of | public static Slf4jStream of(Class<?> klass, String name) {
"""
Constructs a logger from a class name and an additional name,
appended to the end. So the final logger name will be:
<blockquote><code>klass.getName() + "." + name</code></blockquote>
@param klass class which is used to get the logger's name.
@p... | java | public static Slf4jStream of(Class<?> klass, String name) {
if (name == null) {
return of(klass);
} else {
return of(LoggerFactory.getLogger(klass.getName() + "." + name));
}
} | [
"public",
"static",
"Slf4jStream",
"of",
"(",
"Class",
"<",
"?",
">",
"klass",
",",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"of",
"(",
"klass",
")",
";",
"}",
"else",
"{",
"return",
"of",
"(",
"LoggerFactory... | Constructs a logger from a class name and an additional name,
appended to the end. So the final logger name will be:
<blockquote><code>klass.getName() + "." + name</code></blockquote>
@param klass class which is used to get the logger's name.
@param name logger's name, appended to the class name.
@return Slf4jStream w... | [
"Constructs",
"a",
"logger",
"from",
"a",
"class",
"name",
"and",
"an",
"additional",
"name",
"appended",
"to",
"the",
"end",
".",
"So",
"the",
"final",
"logger",
"name",
"will",
"be",
":",
"<blockquote",
">",
"<code",
">",
"klass",
".",
"getName",
"()",... | train | https://github.com/zeroturnaround/zt-exec/blob/6c3b93b99bf3c69c9f41d6350bf7707005b6a4cd/src/main/java/org/zeroturnaround/exec/stream/slf4j/Slf4jStream.java#L64-L70 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosApi.java | PhotosApi.addTags | public AddTags addTags(String photoId, List<String> tags) throws JinxException {
"""
Add tags to a photo.
<br>
This method requires authentication with 'write' permission.
<br>
Each tag in the list will be treated as a single tag. This method will automatically add quotation marks as
needed so that multi-word... | java | public AddTags addTags(String photoId, List<String> tags) throws JinxException {
JinxUtils.validateParams(photoId, tags);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.addTags");
params.put("photo_id", photoId);
StringBuilder sb = new StringBuilder();
for (Str... | [
"public",
"AddTags",
"addTags",
"(",
"String",
"photoId",
",",
"List",
"<",
"String",
">",
"tags",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photoId",
",",
"tags",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"... | Add tags to a photo.
<br>
This method requires authentication with 'write' permission.
<br>
Each tag in the list will be treated as a single tag. This method will automatically add quotation marks as
needed so that multi-word tags will be treated correctly by Flickr. This method can also be used to add
machine tags.
@... | [
"Add",
"tags",
"to",
"a",
"photo",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
".",
"<br",
">",
"Each",
"tag",
"in",
"the",
"list",
"will",
"be",
"treated",
"as",
"a",
"single",
"tag",
".",
"This",
"m... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosApi.java#L77-L94 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBaseScreen.java | JBaseScreen.doAction | public boolean doAction(String strAction, int iOptions) {
"""
Process this action.
This class calls controltofields on submit and resetfields on reset.
@param strAction The message or command to propagate.
"""
if (strAction == Constants.SUBMIT)
{
this.controlsToFields(); // Mov... | java | public boolean doAction(String strAction, int iOptions)
{
if (strAction == Constants.SUBMIT)
{
this.controlsToFields(); // Move screen data to record
}
else if (strAction == Constants.RESET)
{
this.resetFields();
}
return super.doAct... | [
"public",
"boolean",
"doAction",
"(",
"String",
"strAction",
",",
"int",
"iOptions",
")",
"{",
"if",
"(",
"strAction",
"==",
"Constants",
".",
"SUBMIT",
")",
"{",
"this",
".",
"controlsToFields",
"(",
")",
";",
"// Move screen data to record",
"}",
"else",
"... | Process this action.
This class calls controltofields on submit and resetfields on reset.
@param strAction The message or command to propagate. | [
"Process",
"this",
"action",
".",
"This",
"class",
"calls",
"controltofields",
"on",
"submit",
"and",
"resetfields",
"on",
"reset",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBaseScreen.java#L291-L302 |
OpenTSDB/opentsdb | src/core/TSDB.java | TSDB.newBatch | public WritableDataPoints newBatch(String metric, Map<String, String> tags) {
"""
Returns a new {@link BatchedDataPoints} instance suitable for this TSDB.
@param metric Every data point that gets appended must be associated to this metric.
@param tags The associated tags for all data points being added.
@retu... | java | public WritableDataPoints newBatch(String metric, Map<String, String> tags) {
return new BatchedDataPoints(this, metric, tags);
} | [
"public",
"WritableDataPoints",
"newBatch",
"(",
"String",
"metric",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"new",
"BatchedDataPoints",
"(",
"this",
",",
"metric",
",",
"tags",
")",
";",
"}"
] | Returns a new {@link BatchedDataPoints} instance suitable for this TSDB.
@param metric Every data point that gets appended must be associated to this metric.
@param tags The associated tags for all data points being added.
@return data structure which can have data points appended. | [
"Returns",
"a",
"new",
"{",
"@link",
"BatchedDataPoints",
"}",
"instance",
"suitable",
"for",
"this",
"TSDB",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/TSDB.java#L976-L978 |
tiesebarrell/process-assertions | process-assertions-api/src/main/java/org/toxos/processassertions/api/internal/MessageLogger.java | MessageLogger.logTrace | public final void logTrace(final Logger logger, final String messageKey, final Object... objects) {
"""
Logs a message by the provided key to the provided {@link Logger} at trace level after substituting the parameters in the message by the provided objects.
@param logger the logger to log to
@param messageKey t... | java | public final void logTrace(final Logger logger, final String messageKey, final Object... objects) {
logger.trace(getMessage(messageKey, objects));
} | [
"public",
"final",
"void",
"logTrace",
"(",
"final",
"Logger",
"logger",
",",
"final",
"String",
"messageKey",
",",
"final",
"Object",
"...",
"objects",
")",
"{",
"logger",
".",
"trace",
"(",
"getMessage",
"(",
"messageKey",
",",
"objects",
")",
")",
";",
... | Logs a message by the provided key to the provided {@link Logger} at trace level after substituting the parameters in the message by the provided objects.
@param logger the logger to log to
@param messageKey the key of the message in the bundle
@param objects the substitution parameters | [
"Logs",
"a",
"message",
"by",
"the",
"provided",
"key",
"to",
"the",
"provided",
"{"
] | train | https://github.com/tiesebarrell/process-assertions/blob/932a8443982e356cdf5a230165a35c725d9306ab/process-assertions-api/src/main/java/org/toxos/processassertions/api/internal/MessageLogger.java#L58-L60 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java | MetricServiceClient.createTimeSeries | public final void createTimeSeries(String name, List<TimeSeries> timeSeries) {
"""
Creates or adds data to one or more time series. The response is empty if all time series in
the request were written. If any time series could not be written, a corresponding failure
message is included in the error response.
... | java | public final void createTimeSeries(String name, List<TimeSeries> timeSeries) {
CreateTimeSeriesRequest request =
CreateTimeSeriesRequest.newBuilder().setName(name).addAllTimeSeries(timeSeries).build();
createTimeSeries(request);
} | [
"public",
"final",
"void",
"createTimeSeries",
"(",
"String",
"name",
",",
"List",
"<",
"TimeSeries",
">",
"timeSeries",
")",
"{",
"CreateTimeSeriesRequest",
"request",
"=",
"CreateTimeSeriesRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")"... | Creates or adds data to one or more time series. The response is empty if all time series in
the request were written. If any time series could not be written, a corresponding failure
message is included in the error response.
<p>Sample code:
<pre><code>
try (MetricServiceClient metricServiceClient = MetricServiceCli... | [
"Creates",
"or",
"adds",
"data",
"to",
"one",
"or",
"more",
"time",
"series",
".",
"The",
"response",
"is",
"empty",
"if",
"all",
"time",
"series",
"in",
"the",
"request",
"were",
"written",
".",
"If",
"any",
"time",
"series",
"could",
"not",
"be",
"wr... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java#L1125-L1130 |
knowm/XChange | xchange-core/src/main/java/org/knowm/xchange/currency/Currency.java | Currency.getCodeCurrency | public Currency getCodeCurrency(String code) {
"""
Gets the equivalent object with the passed code.
<p>This is useful in case some currencies share codes, such that {@link #getInstance(String)}
may return the wrong currency.
@param code The code the returned object will evaluate to
@return A Currency repre... | java | public Currency getCodeCurrency(String code) {
if (code.equals(this.code)) return this;
Currency currency = getInstance(code);
if (currency.equals(this)) return currency;
if (!attributes.codes.contains(code))
throw new IllegalArgumentException("Code not listed for this currency");
return n... | [
"public",
"Currency",
"getCodeCurrency",
"(",
"String",
"code",
")",
"{",
"if",
"(",
"code",
".",
"equals",
"(",
"this",
".",
"code",
")",
")",
"return",
"this",
";",
"Currency",
"currency",
"=",
"getInstance",
"(",
"code",
")",
";",
"if",
"(",
"curren... | Gets the equivalent object with the passed code.
<p>This is useful in case some currencies share codes, such that {@link #getInstance(String)}
may return the wrong currency.
@param code The code the returned object will evaluate to
@return A Currency representing the same currency but having the passed currency code
... | [
"Gets",
"the",
"equivalent",
"object",
"with",
"the",
"passed",
"code",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-core/src/main/java/org/knowm/xchange/currency/Currency.java#L395-L406 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.fetchByC_K | @Override
public CPDefinitionOptionValueRel fetchByC_K(long CPDefinitionOptionRelId,
String key) {
"""
Returns the cp definition option value rel where CPDefinitionOptionRelId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param CPDefinitionOptionRelId ... | java | @Override
public CPDefinitionOptionValueRel fetchByC_K(long CPDefinitionOptionRelId,
String key) {
return fetchByC_K(CPDefinitionOptionRelId, key, true);
} | [
"@",
"Override",
"public",
"CPDefinitionOptionValueRel",
"fetchByC_K",
"(",
"long",
"CPDefinitionOptionRelId",
",",
"String",
"key",
")",
"{",
"return",
"fetchByC_K",
"(",
"CPDefinitionOptionRelId",
",",
"key",
",",
"true",
")",
";",
"}"
] | Returns the cp definition option value rel where CPDefinitionOptionRelId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param CPDefinitionOptionRelId the cp definition option rel ID
@param key the key
@return the matching cp definition option value rel, or <code>... | [
"Returns",
"the",
"cp",
"definition",
"option",
"value",
"rel",
"where",
"CPDefinitionOptionRelId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
"."... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L3679-L3683 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/classreading/ClassFileIterator.java | ClassFileIterator.init | private static void init(List<File> list, File dir, Filter filter) {
"""
Creates the.
@param list
the list
@param dir
the dir
@param filter
the filter
@throws Exception
the exception
"""
File[] files = dir.listFiles();
for (int i = 0; i < files.length; i++)
{
... | java | private static void init(List<File> list, File dir, Filter filter)
{
File[] files = dir.listFiles();
for (int i = 0; i < files.length; i++)
{
if (files[i].isDirectory())
{
init(list, files[i], filter);
}
else
... | [
"private",
"static",
"void",
"init",
"(",
"List",
"<",
"File",
">",
"list",
",",
"File",
"dir",
",",
"Filter",
"filter",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"dir",
".",
"listFiles",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i... | Creates the.
@param list
the list
@param dir
the dir
@param filter
the filter
@throws Exception
the exception | [
"Creates",
"the",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/classreading/ClassFileIterator.java#L79-L96 |
OpenLiberty/open-liberty | dev/com.ibm.ws.collector.manager/src/com/ibm/ws/collector/manager/internal/SourceManager.java | SourceManager.addSubscriber | public void addSubscriber(Handler handler) {
"""
Method to add a subscriber to the source
Source manager will allocate a buffer when the source has
atleast one subscriber.
@param handler The handler that is to be added as subscriber
"""
String handlerId = CollectorManagerUtils.getHandlerId(handler... | java | public void addSubscriber(Handler handler) {
String handlerId = CollectorManagerUtils.getHandlerId(handler);
//temporary exception for audit Source //must change later
if (source.getSourceName().trim().equals("audit") && subscribers.isEmpty()) {
//First subscriber, assign a buffer.... | [
"public",
"void",
"addSubscriber",
"(",
"Handler",
"handler",
")",
"{",
"String",
"handlerId",
"=",
"CollectorManagerUtils",
".",
"getHandlerId",
"(",
"handler",
")",
";",
"//temporary exception for audit Source //must change later",
"if",
"(",
"source",
".",
"getSourc... | Method to add a subscriber to the source
Source manager will allocate a buffer when the source has
atleast one subscriber.
@param handler The handler that is to be added as subscriber | [
"Method",
"to",
"add",
"a",
"subscriber",
"to",
"the",
"source",
"Source",
"manager",
"will",
"allocate",
"a",
"buffer",
"when",
"the",
"source",
"has",
"atleast",
"one",
"subscriber",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.collector.manager/src/com/ibm/ws/collector/manager/internal/SourceManager.java#L84-L108 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java | SecondaryIndexManager.updaterFor | public Updater updaterFor(DecoratedKey key, ColumnFamily cf, OpOrder.Group opGroup) {
"""
This helper acts as a closure around the indexManager
and updated cf data to ensure that down in
Memtable's ColumnFamily implementation, the index
can get updated. Note: only a CF backed by AtomicSortedColumns implements
... | java | public Updater updaterFor(DecoratedKey key, ColumnFamily cf, OpOrder.Group opGroup)
{
return (indexesByColumn.isEmpty() && rowLevelIndexMap.isEmpty())
? nullUpdater
: new StandardUpdater(key, cf, opGroup);
} | [
"public",
"Updater",
"updaterFor",
"(",
"DecoratedKey",
"key",
",",
"ColumnFamily",
"cf",
",",
"OpOrder",
".",
"Group",
"opGroup",
")",
"{",
"return",
"(",
"indexesByColumn",
".",
"isEmpty",
"(",
")",
"&&",
"rowLevelIndexMap",
".",
"isEmpty",
"(",
")",
")",
... | This helper acts as a closure around the indexManager
and updated cf data to ensure that down in
Memtable's ColumnFamily implementation, the index
can get updated. Note: only a CF backed by AtomicSortedColumns implements
this behaviour fully, other types simply ignore the index updater. | [
"This",
"helper",
"acts",
"as",
"a",
"closure",
"around",
"the",
"indexManager",
"and",
"updated",
"cf",
"data",
"to",
"ensure",
"that",
"down",
"in",
"Memtable",
"s",
"ColumnFamily",
"implementation",
"the",
"index",
"can",
"get",
"updated",
".",
"Note",
":... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L504-L509 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeDataSourceNameEntry | protected void writeDataSourceNameEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
"""
Write datasource name when enabled as json.
<p>default: "name":"myDS",
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
... | java | protected void writeDataSourceNameEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
String name = execInfo.getDataSourceName();
sb.append("\"name\":\"");
sb.append(name == null ? "" : escapeSpecialCharacter(name));
sb.append("\", ");
} | [
"protected",
"void",
"writeDataSourceNameEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"String",
"name",
"=",
"execInfo",
".",
"getDataSourceName",
"(",
")",
";",
"sb",
".",
... | Write datasource name when enabled as json.
<p>default: "name":"myDS",
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"datasource",
"name",
"when",
"enabled",
"as",
"json",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L70-L75 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriPathSegment | public static String unescapeUriPathSegment(final String text, final String encoding) {
"""
<p>
Perform am URI path segment <strong>unescape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those charac... | java | public static String unescapeUriPathSegment(final String text, final String encoding) {
if (encoding == null) {
throw new IllegalArgumentException("Argument 'encoding' cannot be null");
}
return UriEscapeUtil.unescape(text, UriEscapeUtil.UriEscapeType.PATH_SEGMENT, encoding);
} | [
"public",
"static",
"String",
"unescapeUriPathSegment",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'encoding' cannot be nul... | <p>
Perform am URI path segment <strong>unescape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be percent-encoded in this context (unreserved characters
can be percent-encod... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"segment",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method",
"will",
"unescape",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1633-L1638 |
crawljax/crawljax | core/src/main/java/com/crawljax/forms/FormInputValueHelper.java | FormInputValueHelper.deserializeFormInputs | public static List<FormInput> deserializeFormInputs(File dir) {
"""
Serializes form inputs and writes the data to the output directory to be used by future
non-training crawls.
@param dir The output directory for the form input data.
@return The list of inputs
"""
List<FormInput> deserialized = new Arr... | java | public static List<FormInput> deserializeFormInputs(File dir) {
List<FormInput> deserialized = new ArrayList<>();
final File in = new File(dir, FORMS_JSON_FILE);
if (in.exists()) {
LOGGER.info("Reading trained form inputs from " + in.getAbsolutePath());
Gson gson = new GsonBuilder().create();
try {
... | [
"public",
"static",
"List",
"<",
"FormInput",
">",
"deserializeFormInputs",
"(",
"File",
"dir",
")",
"{",
"List",
"<",
"FormInput",
">",
"deserialized",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"File",
"in",
"=",
"new",
"File",
"(",
"dir",
... | Serializes form inputs and writes the data to the output directory to be used by future
non-training crawls.
@param dir The output directory for the form input data.
@return The list of inputs | [
"Serializes",
"form",
"inputs",
"and",
"writes",
"the",
"data",
"to",
"the",
"output",
"directory",
"to",
"be",
"used",
"by",
"future",
"non",
"-",
"training",
"crawls",
"."
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/core/src/main/java/com/crawljax/forms/FormInputValueHelper.java#L384-L406 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/GetLoggerDefinitionResult.java | GetLoggerDefinitionResult.withTags | public GetLoggerDefinitionResult withTags(java.util.Map<String, String> tags) {
"""
The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public GetLoggerDefinitionResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"GetLoggerDefinitionResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | The tags for the definition.
@param tags
The tags for the definition.
@return Returns a reference to this object so that method calls can be chained together. | [
"The",
"tags",
"for",
"the",
"definition",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/GetLoggerDefinitionResult.java#L310-L313 |
Impetus/Kundera | src/kundera-kudu/src/main/java/com/impetus/client/kudu/query/KuduDBQuery.java | KuduDBQuery.parseAndBuildFilters | private void parseAndBuildFilters(EntityType entityType, KuduScannerBuilder scannerBuilder, Expression whereExp) {
"""
Parses the and build filters.
@param entityType
the entity type
@param scannerBuilder
the scanner builder
@param whereExp
the where exp
"""
if (whereExp instanceof ComparisonEx... | java | private void parseAndBuildFilters(EntityType entityType, KuduScannerBuilder scannerBuilder, Expression whereExp)
{
if (whereExp instanceof ComparisonExpression)
{
String left = ((ComparisonExpression) whereExp).getLeftExpression().toActualText();
String right = ((ComparisonE... | [
"private",
"void",
"parseAndBuildFilters",
"(",
"EntityType",
"entityType",
",",
"KuduScannerBuilder",
"scannerBuilder",
",",
"Expression",
"whereExp",
")",
"{",
"if",
"(",
"whereExp",
"instanceof",
"ComparisonExpression",
")",
"{",
"String",
"left",
"=",
"(",
"(",
... | Parses the and build filters.
@param entityType
the entity type
@param scannerBuilder
the scanner builder
@param whereExp
the where exp | [
"Parses",
"the",
"and",
"build",
"filters",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-kudu/src/main/java/com/impetus/client/kudu/query/KuduDBQuery.java#L191-L226 |
wg/lettuce | src/main/java/com/lambdaworks/redis/protocol/Command.java | Command.writeInt | protected static void writeInt(ChannelBuffer buf, int value) {
"""
Write the textual value of a positive integer to the supplied buffer.
@param buf Buffer to write to.
@param value Value to write.
"""
if (value < 10) {
buf.writeByte('0' + value);
return;
}
... | java | protected static void writeInt(ChannelBuffer buf, int value) {
if (value < 10) {
buf.writeByte('0' + value);
return;
}
StringBuilder sb = new StringBuilder(8);
while (value > 0) {
int digit = value % 10;
sb.append((char) ('0' + digit));
... | [
"protected",
"static",
"void",
"writeInt",
"(",
"ChannelBuffer",
"buf",
",",
"int",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"10",
")",
"{",
"buf",
".",
"writeByte",
"(",
"'",
"'",
"+",
"value",
")",
";",
"return",
";",
"}",
"StringBuilder",
"sb",... | Write the textual value of a positive integer to the supplied buffer.
@param buf Buffer to write to.
@param value Value to write. | [
"Write",
"the",
"textual",
"value",
"of",
"a",
"positive",
"integer",
"to",
"the",
"supplied",
"buffer",
"."
] | train | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/protocol/Command.java#L178-L194 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/container/impl/deployment/StopProcessEnginesStep.java | StopProcessEnginesStep.stopProcessEngine | private void stopProcessEngine(String serviceName, PlatformServiceContainer serviceContainer) {
"""
Stops a process engine, failures are logged but no exceptions are thrown.
"""
try {
serviceContainer.stopService(serviceName);
}
catch(Exception e) {
LOG.exceptionWhileStopping("Process ... | java | private void stopProcessEngine(String serviceName, PlatformServiceContainer serviceContainer) {
try {
serviceContainer.stopService(serviceName);
}
catch(Exception e) {
LOG.exceptionWhileStopping("Process Engine", serviceName, e);
}
} | [
"private",
"void",
"stopProcessEngine",
"(",
"String",
"serviceName",
",",
"PlatformServiceContainer",
"serviceContainer",
")",
"{",
"try",
"{",
"serviceContainer",
".",
"stopService",
"(",
"serviceName",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
... | Stops a process engine, failures are logged but no exceptions are thrown. | [
"Stops",
"a",
"process",
"engine",
"failures",
"are",
"logged",
"but",
"no",
"exceptions",
"are",
"thrown",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/deployment/StopProcessEnginesStep.java#L56-L65 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java | BackupService.getProfileBackupData | public SingleProfileBackup getProfileBackupData(int profileID, String clientUUID) throws Exception {
"""
Get the active overrides with parameters and the active server group for a client
@param profileID Id of profile to get configuration for
@param clientUUID Client Id to export configuration
@return SingleP... | java | public SingleProfileBackup getProfileBackupData(int profileID, String clientUUID) throws Exception {
SingleProfileBackup singleProfileBackup = new SingleProfileBackup();
List<PathOverride> enabledPaths = new ArrayList<>();
List<EndpointOverride> paths = PathOverrideService.getInstance().getPath... | [
"public",
"SingleProfileBackup",
"getProfileBackupData",
"(",
"int",
"profileID",
",",
"String",
"clientUUID",
")",
"throws",
"Exception",
"{",
"SingleProfileBackup",
"singleProfileBackup",
"=",
"new",
"SingleProfileBackup",
"(",
")",
";",
"List",
"<",
"PathOverride",
... | Get the active overrides with parameters and the active server group for a client
@param profileID Id of profile to get configuration for
@param clientUUID Client Id to export configuration
@return SingleProfileBackup containing active overrides and active server group
@throws Exception exception | [
"Get",
"the",
"active",
"overrides",
"with",
"parameters",
"and",
"the",
"active",
"server",
"group",
"for",
"a",
"client"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/BackupService.java#L133-L160 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java | ConfigClient.updateSink | public final LogSink updateSink(SinkName sinkName, LogSink sink, FieldMask updateMask) {
"""
Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: `destination`, and `filter`. The updated sink might also have a new
`writer_identity`; see the `unique_writer_... | java | public final LogSink updateSink(SinkName sinkName, LogSink sink, FieldMask updateMask) {
UpdateSinkRequest request =
UpdateSinkRequest.newBuilder()
.setSinkName(sinkName == null ? null : sinkName.toString())
.setSink(sink)
.setUpdateMask(updateMask)
.build();... | [
"public",
"final",
"LogSink",
"updateSink",
"(",
"SinkName",
"sinkName",
",",
"LogSink",
"sink",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateSinkRequest",
"request",
"=",
"UpdateSinkRequest",
".",
"newBuilder",
"(",
")",
".",
"setSinkName",
"(",
"sinkName",
... | Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: `destination`, and `filter`. The updated sink might also have a new
`writer_identity`; see the `unique_writer_identity` field.
<p>Sample code:
<pre><code>
try (ConfigClient configClient = ConfigClient.create(... | [
"Updates",
"a",
"sink",
".",
"This",
"method",
"replaces",
"the",
"following",
"fields",
"in",
"the",
"existing",
"sink",
"with",
"values",
"from",
"the",
"new",
"sink",
":",
"destination",
"and",
"filter",
".",
"The",
"updated",
"sink",
"might",
"also",
"... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java#L565-L574 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/FixDependencyChecker.java | FixDependencyChecker.isUninstallable | public static boolean isUninstallable(Set<IFixInfo> installedFixes, IFixInfo fixToBeUninstalled) {
"""
Return true if fixToBeUninstalled can be uninstalled. fixToBeUninstalled can only be uninstalled if there are no file conflicts with other fixes in the installedFixes Set
that supersedes fixToBeUninstalled
@p... | java | public static boolean isUninstallable(Set<IFixInfo> installedFixes, IFixInfo fixToBeUninstalled) {
if (Boolean.valueOf(System.getenv(S_DISABLE)).booleanValue()) {
return true;
}
if (fixToBeUninstalled != null) {
for (IFixInfo fix : installedFixes) {
if (... | [
"public",
"static",
"boolean",
"isUninstallable",
"(",
"Set",
"<",
"IFixInfo",
">",
"installedFixes",
",",
"IFixInfo",
"fixToBeUninstalled",
")",
"{",
"if",
"(",
"Boolean",
".",
"valueOf",
"(",
"System",
".",
"getenv",
"(",
"S_DISABLE",
")",
")",
".",
"boole... | Return true if fixToBeUninstalled can be uninstalled. fixToBeUninstalled can only be uninstalled if there are no file conflicts with other fixes in the installedFixes Set
that supersedes fixToBeUninstalled
@param installedFixes The set of fixes that is already installed, the set does not include the fixToBeUninstalled... | [
"Return",
"true",
"if",
"fixToBeUninstalled",
"can",
"be",
"uninstalled",
".",
"fixToBeUninstalled",
"can",
"only",
"be",
"uninstalled",
"if",
"there",
"are",
"no",
"file",
"conflicts",
"with",
"other",
"fixes",
"in",
"the",
"installedFixes",
"Set",
"that",
"sup... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/FixDependencyChecker.java#L46-L63 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.oCRFileInputAsync | public Observable<OCR> oCRFileInputAsync(String language, byte[] imageStream, OCRFileInputOptionalParameter oCRFileInputOptionalParameter) {
"""
Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.
@param language Language o... | java | public Observable<OCR> oCRFileInputAsync(String language, byte[] imageStream, OCRFileInputOptionalParameter oCRFileInputOptionalParameter) {
return oCRFileInputWithServiceResponseAsync(language, imageStream, oCRFileInputOptionalParameter).map(new Func1<ServiceResponse<OCR>, OCR>() {
@Override
... | [
"public",
"Observable",
"<",
"OCR",
">",
"oCRFileInputAsync",
"(",
"String",
"language",
",",
"byte",
"[",
"]",
"imageStream",
",",
"OCRFileInputOptionalParameter",
"oCRFileInputOptionalParameter",
")",
"{",
"return",
"oCRFileInputWithServiceResponseAsync",
"(",
"language... | Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.
@param language Language of the terms.
@param imageStream The image file.
@param oCRFileInputOptionalParameter the object representing the optional parameters to be set before ca... | [
"Returns",
"any",
"text",
"found",
"in",
"the",
"image",
"for",
"the",
"language",
"specified",
".",
"If",
"no",
"language",
"is",
"specified",
"in",
"input",
"then",
"the",
"detection",
"defaults",
"to",
"English",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1273-L1280 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/http/IOUtils.java | IOUtils.loadKeyStore | public static KeyStore loadKeyStore(InputStream keyStore, String password)
throws CertificateException, NoSuchAlgorithmException, IOException, KeyStoreException {
"""
Loads keystore
@param keyStore Keystore InputStream
@param password Keystore password
@return Loaded Keystore
@throws CertificateE... | java | public static KeyStore loadKeyStore(InputStream keyStore, String password)
throws CertificateException, NoSuchAlgorithmException, IOException, KeyStoreException {
try {
KeyStore trustStore = KeyStore.getInstance("JKS");
trustStore.load(keyStore, password.toCharArray());
... | [
"public",
"static",
"KeyStore",
"loadKeyStore",
"(",
"InputStream",
"keyStore",
",",
"String",
"password",
")",
"throws",
"CertificateException",
",",
"NoSuchAlgorithmException",
",",
"IOException",
",",
"KeyStoreException",
"{",
"try",
"{",
"KeyStore",
"trustStore",
... | Loads keystore
@param keyStore Keystore InputStream
@param password Keystore password
@return Loaded Keystore
@throws CertificateException In case of Certificate error
@throws NoSuchAlgorithmException If no such algorithm present
@throws IOException In case if some IO errors
@throws KeyStoreException ... | [
"Loads",
"keystore"
] | train | https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/IOUtils.java#L88-L97 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/BandwidthClient.java | BandwidthClient.getUserResourceInstanceUri | public String getUserResourceInstanceUri(final String path, final String instanceId) {
"""
Convenience method that returns the resource instance uri. E.g.
@param path the path.
@param instanceId the instance id.
@return The user Instance URI.
"""
if(StringUtils.isEmpty(path) || StringUtils.isEmpty... | java | public String getUserResourceInstanceUri(final String path, final String instanceId){
if(StringUtils.isEmpty(path) || StringUtils.isEmpty(instanceId)) {
throw new IllegalArgumentException("Path and Instance Id cannot be null");
}
return getUserResourceUri(path) + "/" + instanceId;
... | [
"public",
"String",
"getUserResourceInstanceUri",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"instanceId",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"path",
")",
"||",
"StringUtils",
".",
"isEmpty",
"(",
"instanceId",
")",
")",
"{... | Convenience method that returns the resource instance uri. E.g.
@param path the path.
@param instanceId the instance id.
@return The user Instance URI. | [
"Convenience",
"method",
"that",
"returns",
"the",
"resource",
"instance",
"uri",
".",
"E",
".",
"g",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/BandwidthClient.java#L278-L283 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java | ConcurrencyTools.shutdownAndAwaitTermination | public static void shutdownAndAwaitTermination() {
"""
Closes the thread pool. Waits 1 minute for a clean exit; if necessary, waits another minute for cancellation.
"""
shutdown();
if (pool != null) {
try {
// wait a while for existing tasks to terminate
if (!pool.awaitTermination(60L, TimeUnit... | java | public static void shutdownAndAwaitTermination() {
shutdown();
if (pool != null) {
try {
// wait a while for existing tasks to terminate
if (!pool.awaitTermination(60L, TimeUnit.SECONDS)) {
pool.shutdownNow(); // cancel currently executing tasks
// wait a while for tasks to respond to being can... | [
"public",
"static",
"void",
"shutdownAndAwaitTermination",
"(",
")",
"{",
"shutdown",
"(",
")",
";",
"if",
"(",
"pool",
"!=",
"null",
")",
"{",
"try",
"{",
"// wait a while for existing tasks to terminate",
"if",
"(",
"!",
"pool",
".",
"awaitTermination",
"(",
... | Closes the thread pool. Waits 1 minute for a clean exit; if necessary, waits another minute for cancellation. | [
"Closes",
"the",
"thread",
"pool",
".",
"Waits",
"1",
"minute",
"for",
"a",
"clean",
"exit",
";",
"if",
"necessary",
"waits",
"another",
"minute",
"for",
"cancellation",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/ConcurrencyTools.java#L126-L143 |
reactor/reactor-netty | src/main/java/reactor/netty/http/client/HttpClient.java | HttpClient.doAfterRequest | public final HttpClient doAfterRequest(BiConsumer<? super HttpClientRequest, ? super Connection> doAfterRequest) {
"""
Setup a callback called when {@link HttpClientRequest} has been sent
@param doAfterRequest a consumer observing connected events
@return a new {@link HttpClient}
"""
Objects.requireNon... | java | public final HttpClient doAfterRequest(BiConsumer<? super HttpClientRequest, ? super Connection> doAfterRequest) {
Objects.requireNonNull(doAfterRequest, "doAfterRequest");
return new HttpClientDoOn(this, null, doAfterRequest, null, null);
} | [
"public",
"final",
"HttpClient",
"doAfterRequest",
"(",
"BiConsumer",
"<",
"?",
"super",
"HttpClientRequest",
",",
"?",
"super",
"Connection",
">",
"doAfterRequest",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"doAfterRequest",
",",
"\"doAfterRequest\"",
")",
... | Setup a callback called when {@link HttpClientRequest} has been sent
@param doAfterRequest a consumer observing connected events
@return a new {@link HttpClient} | [
"Setup",
"a",
"callback",
"called",
"when",
"{",
"@link",
"HttpClientRequest",
"}",
"has",
"been",
"sent"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L543-L546 |
morimekta/utils | diff-util/src/main/java/net/morimekta/diff/DiffBase.java | DiffBase.lineMode | private LinkedList<Change> lineMode(String text1, String text2) {
"""
Do a quick line-level diff on both strings, then rediff the parts for
greater accuracy.
This speedup can produce non-minimal diffs.
@param text1 Old string to be diffed.
@param text2 New string to be diffed.
@return Linked List of DiffBase ... | java | private LinkedList<Change> lineMode(String text1, String text2) {
// Scan the text on a line-by-line basis first.
LinesToCharsResult b = linesToChars(text1, text2);
text1 = b.chars1;
text2 = b.chars2;
List<String> linearray = b.lineArray;
LinkedList<Change> diffs = main(... | [
"private",
"LinkedList",
"<",
"Change",
">",
"lineMode",
"(",
"String",
"text1",
",",
"String",
"text2",
")",
"{",
"// Scan the text on a line-by-line basis first.",
"LinesToCharsResult",
"b",
"=",
"linesToChars",
"(",
"text1",
",",
"text2",
")",
";",
"text1",
"="... | Do a quick line-level diff on both strings, then rediff the parts for
greater accuracy.
This speedup can produce non-minimal diffs.
@param text1 Old string to be diffed.
@param text2 New string to be diffed.
@return Linked List of DiffBase objects. | [
"Do",
"a",
"quick",
"line",
"-",
"level",
"diff",
"on",
"both",
"strings",
"then",
"rediff",
"the",
"parts",
"for",
"greater",
"accuracy",
".",
"This",
"speedup",
"can",
"produce",
"non",
"-",
"minimal",
"diffs",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/diff-util/src/main/java/net/morimekta/diff/DiffBase.java#L446-L501 |
dkpro/dkpro-statistics | dkpro-statistics-correlation/src/main/java/org/dkpro/statistics/correlation/SpearmansRankCorrelation_old.java | SpearmansRankCorrelation_old.computeCorrelation | public static double computeCorrelation(final List<Double> list1, final List<Double> list2) {
"""
Computes the correlation between two datasets.
@param list1 The first dataset as a list.
@param list2 The second dataset as a list.
@return The correlation between the two datasets.
"""
final SpearmansR... | java | public static double computeCorrelation(final List<Double> list1, final List<Double> list2)
{
final SpearmansRankCorrelation_old src = new SpearmansRankCorrelation_old();
for (int i = 0; i < list1.size(); i++) {
src.addXValue(Integer.toString(i), list1.get(i));
src.addYValue(... | [
"public",
"static",
"double",
"computeCorrelation",
"(",
"final",
"List",
"<",
"Double",
">",
"list1",
",",
"final",
"List",
"<",
"Double",
">",
"list2",
")",
"{",
"final",
"SpearmansRankCorrelation_old",
"src",
"=",
"new",
"SpearmansRankCorrelation_old",
"(",
"... | Computes the correlation between two datasets.
@param list1 The first dataset as a list.
@param list2 The second dataset as a list.
@return The correlation between the two datasets. | [
"Computes",
"the",
"correlation",
"between",
"two",
"datasets",
"."
] | train | https://github.com/dkpro/dkpro-statistics/blob/0b0e93dc49223984964411cbc6df420ba796a8cb/dkpro-statistics-correlation/src/main/java/org/dkpro/statistics/correlation/SpearmansRankCorrelation_old.java#L66-L75 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerConnectionPoliciesInner.java | ServerConnectionPoliciesInner.getAsync | public Observable<ServerConnectionPolicyInner> getAsync(String resourceGroupName, String serverName) {
"""
Gets the server's secure connection policy.
@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.
... | java | public Observable<ServerConnectionPolicyInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<ServerConnectionPolicyInner>, ServerConnectionPolicyInner>() {
@Override
public ServerCon... | [
"public",
"Observable",
"<",
"ServerConnectionPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
".",
"map",
"(",
"new",
... | Gets the server's secure connection policy.
@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.
@throws IllegalArgumentException thrown if parameters fail the validatio... | [
"Gets",
"the",
"server",
"s",
"secure",
"connection",
"policy",
"."
] | 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/ServerConnectionPoliciesInner.java#L199-L206 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics/src/main/java/org/apache/gobblin/metrics/GobblinMetrics.java | GobblinMetrics.addCustomTagsToProperties | public static void addCustomTagsToProperties(Properties properties, List<Tag<?>> tags) {
"""
Add {@link List} of {@link Tag}s to a {@link Properties} with key {@link #METRICS_STATE_CUSTOM_TAGS}.
<p>
Also see {@link #addCustomTagToState(State, Tag)} , {@link #addCustomTagToProperties(Properties, Tag)}
</p>
<p... | java | public static void addCustomTagsToProperties(Properties properties, List<Tag<?>> tags) {
for (Tag<?> tag : tags) {
addCustomTagToProperties(properties, tag);
}
} | [
"public",
"static",
"void",
"addCustomTagsToProperties",
"(",
"Properties",
"properties",
",",
"List",
"<",
"Tag",
"<",
"?",
">",
">",
"tags",
")",
"{",
"for",
"(",
"Tag",
"<",
"?",
">",
"tag",
":",
"tags",
")",
"{",
"addCustomTagToProperties",
"(",
"pro... | Add {@link List} of {@link Tag}s to a {@link Properties} with key {@link #METRICS_STATE_CUSTOM_TAGS}.
<p>
Also see {@link #addCustomTagToState(State, Tag)} , {@link #addCustomTagToProperties(Properties, Tag)}
</p>
<p>
The {@link Properties} passed can be used to build a {@link State}.
{@link org.apache.gobblin.metrics... | [
"Add",
"{",
"@link",
"List",
"}",
"of",
"{",
"@link",
"Tag",
"}",
"s",
"to",
"a",
"{",
"@link",
"Properties",
"}",
"with",
"key",
"{",
"@link",
"#METRICS_STATE_CUSTOM_TAGS",
"}",
".",
"<p",
">",
"Also",
"see",
"{",
"@link",
"#addCustomTagToState",
"(",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics/src/main/java/org/apache/gobblin/metrics/GobblinMetrics.java#L212-L216 |
stratosphere/stratosphere | stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java | ExecutionEnvironment.createInput | public <X> DataSource<X> createInput(InputFormat<X, ?> inputFormat) {
"""
Generic method to create an input DataSet with in {@link InputFormat}. The DataSet will not be
immediately created - instead, this method returns a DataSet that will be lazily created from
the input format once the program is executed.
<p... | java | public <X> DataSource<X> createInput(InputFormat<X, ?> inputFormat) {
if (inputFormat == null) {
throw new IllegalArgumentException("InputFormat must not be null.");
}
try {
return createInput(inputFormat, TypeExtractor.getInputFormatTypes(inputFormat));
}
catch (Exception e) {
throw new InvalidPr... | [
"public",
"<",
"X",
">",
"DataSource",
"<",
"X",
">",
"createInput",
"(",
"InputFormat",
"<",
"X",
",",
"?",
">",
"inputFormat",
")",
"{",
"if",
"(",
"inputFormat",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"InputFormat mus... | Generic method to create an input DataSet with in {@link InputFormat}. The DataSet will not be
immediately created - instead, this method returns a DataSet that will be lazily created from
the input format once the program is executed.
<p>
Since all data sets need specific information about their types, this method nee... | [
"Generic",
"method",
"to",
"create",
"an",
"input",
"DataSet",
"with",
"in",
"{",
"@link",
"InputFormat",
"}",
".",
"The",
"DataSet",
"will",
"not",
"be",
"immediately",
"created",
"-",
"instead",
"this",
"method",
"returns",
"a",
"DataSet",
"that",
"will",
... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java#L271-L283 |
terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/PermissionAwareCrudService.java | PermissionAwareCrudService.removeAndSaveUserPermissions | public void removeAndSaveUserPermissions(E entity, User user, Permission... permissions) {
"""
This method removes (user) permissions from the passed entity and persists (!)
the permission collection!
@param entity The secured entity
@param user The user from which the permissions for the entity w... | java | public void removeAndSaveUserPermissions(E entity, User user, Permission... permissions) {
if (entity == null) {
LOG.error("Could not remove permissions: The passed entity is NULL.");
return;
}
// create a set from the passed array
final HashSet<Permission> permi... | [
"public",
"void",
"removeAndSaveUserPermissions",
"(",
"E",
"entity",
",",
"User",
"user",
",",
"Permission",
"...",
"permissions",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"LOG",
".",
"error",
"(",
"\"Could not remove permissions: The passed entity ... | This method removes (user) permissions from the passed entity and persists (!)
the permission collection!
@param entity The secured entity
@param user The user from which the permissions for the entity will be removed
@param permissions The permissions to remove | [
"This",
"method",
"removes",
"(",
"user",
")",
"permissions",
"from",
"the",
"passed",
"entity",
"and",
"persists",
"(",
"!",
")",
"the",
"permission",
"collection!"
] | train | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/PermissionAwareCrudService.java#L145-L196 |
pravega/pravega | common/src/main/java/io/pravega/common/util/BitConverter.java | BitConverter.writeInt | public static int writeInt(ArrayView target, int offset, int value) {
"""
Writes the given 32-bit Integer to the given ArrayView at the given offset.
@param target The ArrayView to write to.
@param offset The offset within the ArrayView to write at.
@param value The value to write.
@return The number of byt... | java | public static int writeInt(ArrayView target, int offset, int value) {
return writeInt(target.array(), target.arrayOffset() + offset, value);
} | [
"public",
"static",
"int",
"writeInt",
"(",
"ArrayView",
"target",
",",
"int",
"offset",
",",
"int",
"value",
")",
"{",
"return",
"writeInt",
"(",
"target",
".",
"array",
"(",
")",
",",
"target",
".",
"arrayOffset",
"(",
")",
"+",
"offset",
",",
"value... | Writes the given 32-bit Integer to the given ArrayView at the given offset.
@param target The ArrayView to write to.
@param offset The offset within the ArrayView to write at.
@param value The value to write.
@return The number of bytes written. | [
"Writes",
"the",
"given",
"32",
"-",
"bit",
"Integer",
"to",
"the",
"given",
"ArrayView",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L56-L58 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/PublishingScopeUrl.java | PublishingScopeUrl.getPublishSetUrl | public static MozuUrl getPublishSetUrl(String publishSetCode, String responseFields) {
"""
Get Resource Url for GetPublishSet
@param publishSetCode The unique identifier of the publish set.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a... | java | public static MozuUrl getPublishSetUrl(String publishSetCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/publishing/publishsets/{publishSetCode}?responseFields={responseFields}");
formatter.formatUrl("publishSetCode", publishSetCode);
formatter.formatUrl("... | [
"public",
"static",
"MozuUrl",
"getPublishSetUrl",
"(",
"String",
"publishSetCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/publishing/publishsets/{publishSetCode}?responseFields={resp... | Get Resource Url for GetPublishSet
@param publishSetCode The unique identifier of the publish set.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using... | [
"Get",
"Resource",
"Url",
"for",
"GetPublishSet"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/PublishingScopeUrl.java#L22-L28 |
ACRA/acra | acra-core/src/main/java/org/acra/attachment/AcraContentProvider.java | AcraContentProvider.getUriForFile | @SuppressWarnings("WeakerAccess")
@NonNull
public static Uri getUriForFile(@NonNull Context context, @NonNull Directory directory, @NonNull String relativePath) {
"""
Get an uri for this content provider for the given file
@param context a context
@param directory the directory, to with the pat... | java | @SuppressWarnings("WeakerAccess")
@NonNull
public static Uri getUriForFile(@NonNull Context context, @NonNull Directory directory, @NonNull String relativePath) {
final Uri.Builder builder = new Uri.Builder()
.scheme(ContentResolver.SCHEME_CONTENT)
.authority(getAuthority... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"@",
"NonNull",
"public",
"static",
"Uri",
"getUriForFile",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"Directory",
"directory",
",",
"@",
"NonNull",
"String",
"relativePath",
")",
"{",
... | Get an uri for this content provider for the given file
@param context a context
@param directory the directory, to with the path is relative
@param relativePath the file path
@return the uri | [
"Get",
"an",
"uri",
"for",
"this",
"content",
"provider",
"for",
"the",
"given",
"file"
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/attachment/AcraContentProvider.java#L222-L235 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.createOrUpdateByScopeAsync | public Observable<ManagementLockObjectInner> createOrUpdateByScopeAsync(String scope, String lockName, ManagementLockObjectInner parameters) {
"""
Create or update a management lock by scope.
@param scope The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' fo... | java | public Observable<ManagementLockObjectInner> createOrUpdateByScopeAsync(String scope, String lockName, ManagementLockObjectInner parameters) {
return createOrUpdateByScopeWithServiceResponseAsync(scope, lockName, parameters).map(new Func1<ServiceResponse<ManagementLockObjectInner>, ManagementLockObjectInner>() ... | [
"public",
"Observable",
"<",
"ManagementLockObjectInner",
">",
"createOrUpdateByScopeAsync",
"(",
"String",
"scope",
",",
"String",
"lockName",
",",
"ManagementLockObjectInner",
"parameters",
")",
"{",
"return",
"createOrUpdateByScopeWithServiceResponseAsync",
"(",
"scope",
... | Create or update a management lock by scope.
@param scope The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegr... | [
"Create",
"or",
"update",
"a",
"management",
"lock",
"by",
"scope",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L453-L460 |
OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.setLogbackExternal | protected static void setLogbackExternal(final String fileName) {
"""
Reloads the logback configuration to an external file
@param fileName The logback configuration file
"""
try {
final ObjectName logbackObjectName = new ObjectName("ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jm... | java | protected static void setLogbackExternal(final String fileName) {
try {
final ObjectName logbackObjectName = new ObjectName("ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator");
ManagementFactory.getPlatformMBeanServer().invoke(logbackObjectName, "reloadByFileName", new... | [
"protected",
"static",
"void",
"setLogbackExternal",
"(",
"final",
"String",
"fileName",
")",
"{",
"try",
"{",
"final",
"ObjectName",
"logbackObjectName",
"=",
"new",
"ObjectName",
"(",
"\"ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator\"",
... | Reloads the logback configuration to an external file
@param fileName The logback configuration file | [
"Reloads",
"the",
"logback",
"configuration",
"to",
"an",
"external",
"file"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L537-L545 |
phax/ph-css | ph-css/src/main/java/com/helger/css/writer/CSSCompressor.java | CSSCompressor.getCompressedCSS | @Nonnull
public static String getCompressedCSS (@Nonnull final String sOriginalCSS,
@Nonnull final ECSSVersion eCSSVersion,
final boolean bRemoveUnnecessaryCode) {
"""
Get the compressed version of the passed CSS code.
@param sO... | java | @Nonnull
public static String getCompressedCSS (@Nonnull final String sOriginalCSS,
@Nonnull final ECSSVersion eCSSVersion,
final boolean bRemoveUnnecessaryCode)
{
final CSSWriterSettings aSettings = new CSSWriterSettings (eCSSVer... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getCompressedCSS",
"(",
"@",
"Nonnull",
"final",
"String",
"sOriginalCSS",
",",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eCSSVersion",
",",
"final",
"boolean",
"bRemoveUnnecessaryCode",
")",
"{",
"final",
"CSSWriterSett... | Get the compressed version of the passed CSS code.
@param sOriginalCSS
The original CSS code to be compressed.
@param eCSSVersion
The CSS version to use.
@param bRemoveUnnecessaryCode
if <code>true</code> unnecessary empty declarations are omitted
@return If compression failed because the CSS is invalid or whatsoever,... | [
"Get",
"the",
"compressed",
"version",
"of",
"the",
"passed",
"CSS",
"code",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/writer/CSSCompressor.java#L75-L83 |
aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/InstallationRegistrationEndpoint.java | InstallationRegistrationEndpoint.crossOriginForInstallations | @OPTIONS
@Path(" {
"""
Cross Origin for Installations
@param headers "Origin" header
@param token token
@return "Access-Control-Allow-Origin" header for your response
@responseheader Access-Control-Allow-Origin With host in your "Origin" header
@responseheader Access-Control-Allow-... | java | @OPTIONS
@Path("{token: .*}")
public Response crossOriginForInstallations(
@Context HttpHeaders headers,
@PathParam("token") String token) {
return appendPreflightResponseHeaders(headers, Response.ok()).build();
} | [
"@",
"OPTIONS",
"@",
"Path",
"(",
"\"{token: .*}\"",
")",
"public",
"Response",
"crossOriginForInstallations",
"(",
"@",
"Context",
"HttpHeaders",
"headers",
",",
"@",
"PathParam",
"(",
"\"token\"",
")",
"String",
"token",
")",
"{",
"return",
"appendPreflightRespo... | Cross Origin for Installations
@param headers "Origin" header
@param token token
@return "Access-Control-Allow-Origin" header for your response
@responseheader Access-Control-Allow-Origin With host in your "Origin" header
@responseheader Access-Control-Allow-Methods POST, DELETE
@responseheade... | [
"Cross",
"Origin",
"for",
"Installations"
] | train | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/InstallationRegistrationEndpoint.java#L82-L89 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/Symmetry010Date.java | Symmetry010Date.ofYearDay | static Symmetry010Date ofYearDay(int prolepticYear, int dayOfYear) {
"""
Obtains a {@code Symmetry010Date} representing a date in the Symmetry010 calendar
system from the proleptic-year and day-of-year fields.
<p>
This returns a {@code Symmetry010Date} with the specified fields.
The day must be valid for the y... | java | static Symmetry010Date ofYearDay(int prolepticYear, int dayOfYear) {
YEAR_RANGE.checkValidValue(prolepticYear, ChronoField.YEAR_OF_ERA);
DAY_OF_YEAR_RANGE.checkValidValue(dayOfYear, ChronoField.DAY_OF_YEAR);
boolean leap = INSTANCE.isLeapYear(prolepticYear);
if (dayOfYear > DAYS_IN_YEAR ... | [
"static",
"Symmetry010Date",
"ofYearDay",
"(",
"int",
"prolepticYear",
",",
"int",
"dayOfYear",
")",
"{",
"YEAR_RANGE",
".",
"checkValidValue",
"(",
"prolepticYear",
",",
"ChronoField",
".",
"YEAR_OF_ERA",
")",
";",
"DAY_OF_YEAR_RANGE",
".",
"checkValidValue",
"(",
... | Obtains a {@code Symmetry010Date} representing a date in the Symmetry010 calendar
system from the proleptic-year and day-of-year fields.
<p>
This returns a {@code Symmetry010Date} with the specified fields.
The day must be valid for the year, otherwise an exception will be thrown.
@param prolepticYear the Symmetry010... | [
"Obtains",
"a",
"{",
"@code",
"Symmetry010Date",
"}",
"representing",
"a",
"date",
"in",
"the",
"Symmetry010",
"calendar",
"system",
"from",
"the",
"proleptic",
"-",
"year",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
".",
"<p",
">",
"This",
"returns",... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/Symmetry010Date.java#L236-L257 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.