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 |
|---|---|---|---|---|---|---|---|---|---|---|
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java | UnitResponse.createSuccess | public static UnitResponse createSuccess(Object data, String errMsg) {
"""
create a succeeded response instance with specified data.
@param data the data for the susccessful response
@param errMsg the description message
@return the newly created response
"""
return createSuccess(data).setMessag... | java | public static UnitResponse createSuccess(Object data, String errMsg) {
return createSuccess(data).setMessage(errMsg);
} | [
"public",
"static",
"UnitResponse",
"createSuccess",
"(",
"Object",
"data",
",",
"String",
"errMsg",
")",
"{",
"return",
"createSuccess",
"(",
"data",
")",
".",
"setMessage",
"(",
"errMsg",
")",
";",
"}"
] | create a succeeded response instance with specified data.
@param data the data for the susccessful response
@param errMsg the description message
@return the newly created response | [
"create",
"a",
"succeeded",
"response",
"instance",
"with",
"specified",
"data",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java#L106-L108 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.copyFromTo | public static void copyFromTo(Object from, Object to, String fieldName) {
"""
Copy from to.
@param from the from
@param to the to
@param fieldName the field name
"""
if (from == null || to == null) {
log.info("object deep copy : from or to is null ");
return;
... | java | public static void copyFromTo(Object from, Object to, String fieldName) {
if (from == null || to == null) {
log.info("object deep copy : from or to is null ");
return;
}
try {
Method getter = getGetterMethod(from.getClass(), fieldName);
if (gett... | [
"public",
"static",
"void",
"copyFromTo",
"(",
"Object",
"from",
",",
"Object",
"to",
",",
"String",
"fieldName",
")",
"{",
"if",
"(",
"from",
"==",
"null",
"||",
"to",
"==",
"null",
")",
"{",
"log",
".",
"info",
"(",
"\"object deep copy : from or to is nu... | Copy from to.
@param from the from
@param to the to
@param fieldName the field name | [
"Copy",
"from",
"to",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L267-L293 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/cpc/CpcSketch.java | CpcSketch.updateWindowed | private static void updateWindowed(final CpcSketch sketch, final int rowCol) {
"""
The flavor is HYBRID, PINNED, or SLIDING.
@param sketch the given sketch
@param rowCol the given rowCol
"""
assert ((sketch.windowOffset >= 0) && (sketch.windowOffset <= 56));
final int k = 1 << sketch.lgK;
final l... | java | private static void updateWindowed(final CpcSketch sketch, final int rowCol) {
assert ((sketch.windowOffset >= 0) && (sketch.windowOffset <= 56));
final int k = 1 << sketch.lgK;
final long c32pre = sketch.numCoupons << 5;
assert c32pre >= (3L * k); // C < 3K/32, in other words flavor >= HYBRID
final... | [
"private",
"static",
"void",
"updateWindowed",
"(",
"final",
"CpcSketch",
"sketch",
",",
"final",
"int",
"rowCol",
")",
"{",
"assert",
"(",
"(",
"sketch",
".",
"windowOffset",
">=",
"0",
")",
"&&",
"(",
"sketch",
".",
"windowOffset",
"<=",
"56",
")",
")"... | The flavor is HYBRID, PINNED, or SLIDING.
@param sketch the given sketch
@param rowCol the given rowCol | [
"The",
"flavor",
"is",
"HYBRID",
"PINNED",
"or",
"SLIDING",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/cpc/CpcSketch.java#L586-L627 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseNewExpression | private Expr parseNewExpression(EnclosingScope scope, boolean terminated) {
"""
Parse a new expression, which is of the form:
<pre>
TermExpr::= ...
| "new" Expr
| Lifetime ":" "new" Identifier Expr
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. d... | java | private Expr parseNewExpression(EnclosingScope scope, boolean terminated) {
int start = index;
// try to match a lifetime
Identifier lifetime = parseOptionalLifetimeIdentifier(scope, terminated);
if (lifetime != null) {
scope.mustBeLifetime(lifetime);
match(Colon);
} else {
// FIXME: this should real... | [
"private",
"Expr",
"parseNewExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"// try to match a lifetime",
"Identifier",
"lifetime",
"=",
"parseOptionalLifetimeIdentifier",
"(",
"scope",
",",
"term... | Parse a new expression, which is of the form:
<pre>
TermExpr::= ...
| "new" Expr
| Lifetime ":" "new" Identifier Expr
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates tha... | [
"Parse",
"a",
"new",
"expression",
"which",
"is",
"of",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L2844-L2858 |
pravega/pravega | common/src/main/java/io/pravega/common/io/BoundedInputStream.java | BoundedInputStream.subStream | public BoundedInputStream subStream(int bound) {
"""
Creates a new BoundedInputStream wrapping the same InputStream as this one, starting at the current position, with
the given bound.
NOTE: both this instance and the result of this method should not be both used at the same time to read from the
InputStream.... | java | public BoundedInputStream subStream(int bound) {
Preconditions.checkArgument(bound >= 0 && bound <= this.remaining,
"bound must be a non-negative integer and less than or equal to the remaining length.");
this.remaining -= bound;
return new BoundedInputStream(this.in, bound);
... | [
"public",
"BoundedInputStream",
"subStream",
"(",
"int",
"bound",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"bound",
">=",
"0",
"&&",
"bound",
"<=",
"this",
".",
"remaining",
",",
"\"bound must be a non-negative integer and less than or equal to the remaining ... | Creates a new BoundedInputStream wrapping the same InputStream as this one, starting at the current position, with
the given bound.
NOTE: both this instance and the result of this method should not be both used at the same time to read from the
InputStream. When this method returns, this instance's remaining count wil... | [
"Creates",
"a",
"new",
"BoundedInputStream",
"wrapping",
"the",
"same",
"InputStream",
"as",
"this",
"one",
"starting",
"at",
"the",
"current",
"position",
"with",
"the",
"given",
"bound",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/BoundedInputStream.java#L113-L118 |
redkale/redkale | src/org/redkale/source/EntityInfo.java | EntityInfo.isLoggable | public boolean isLoggable(Logger logger, Level l) {
"""
判断日志级别
@param logger Logger
@param l Level
@return boolean
"""
return logger.isLoggable(l) && l.intValue() >= this.logLevel;
} | java | public boolean isLoggable(Logger logger, Level l) {
return logger.isLoggable(l) && l.intValue() >= this.logLevel;
} | [
"public",
"boolean",
"isLoggable",
"(",
"Logger",
"logger",
",",
"Level",
"l",
")",
"{",
"return",
"logger",
".",
"isLoggable",
"(",
"l",
")",
"&&",
"l",
".",
"intValue",
"(",
")",
">=",
"this",
".",
"logLevel",
";",
"}"
] | 判断日志级别
@param logger Logger
@param l Level
@return boolean | [
"判断日志级别"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/EntityInfo.java#L993-L995 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/Integration.java | Integration.withRequestTemplates | public Integration withRequestTemplates(java.util.Map<String, String> requestTemplates) {
"""
<p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
... | java | public Integration withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} | [
"public",
"Integration",
"withRequestTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestTemplates",
")",
"{",
"setRequestTemplates",
"(",
"requestTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
String) is the value.
</p>
@param requestTemplates
Represents a map of Velocity templates that are a... | [
"<p",
">",
"Represents",
"a",
"map",
"of",
"Velocity",
"templates",
"that",
"are",
"applied",
"on",
"the",
"request",
"payload",
"based",
"on",
"the",
"value",
"of",
"the",
"Content",
"-",
"Type",
"header",
"sent",
"by",
"the",
"client",
".",
"The",
"con... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/Integration.java#L1226-L1229 |
beihaifeiwu/dolphin | dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/i18n/Resources.java | Resources.getFormatted | public String getFormatted(String key, Object... arguments) {
"""
/*
Gets a resource string formatted with MessageFormat.
@param key the key
@param arguments the arguments
@return Formatted stirng.
"""
return MessageFormat.format(resource.getString(key), arguments);
} | java | public String getFormatted(String key, Object... arguments) {
return MessageFormat.format(resource.getString(key), arguments);
} | [
"public",
"String",
"getFormatted",
"(",
"String",
"key",
",",
"Object",
"...",
"arguments",
")",
"{",
"return",
"MessageFormat",
".",
"format",
"(",
"resource",
".",
"getString",
"(",
"key",
")",
",",
"arguments",
")",
";",
"}"
] | /*
Gets a resource string formatted with MessageFormat.
@param key the key
@param arguments the arguments
@return Formatted stirng. | [
"/",
"*",
"Gets",
"a",
"resource",
"string",
"formatted",
"with",
"MessageFormat",
"."
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/i18n/Resources.java#L158-L160 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java | MultiMap.removeValue | public boolean removeValue(Object name,Object value) {
"""
Remove value.
@param name The entry key.
@param value The entry value.
@return true if it was removed.
"""
Object lo = super.get(name);
Object ln=lo;
int s=LazyList.size(lo);
if (s>0)
{
ln=LazyList... | java | public boolean removeValue(Object name,Object value)
{
Object lo = super.get(name);
Object ln=lo;
int s=LazyList.size(lo);
if (s>0)
{
ln=LazyList.remove(lo,value);
if (ln==null)
super.remove(name);
else
super... | [
"public",
"boolean",
"removeValue",
"(",
"Object",
"name",
",",
"Object",
"value",
")",
"{",
"Object",
"lo",
"=",
"super",
".",
"get",
"(",
"name",
")",
";",
"Object",
"ln",
"=",
"lo",
";",
"int",
"s",
"=",
"LazyList",
".",
"size",
"(",
"lo",
")",
... | Remove value.
@param name The entry key.
@param value The entry value.
@return true if it was removed. | [
"Remove",
"value",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java#L227-L241 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/UsersApi.java | UsersApi.listSignatures | public UserSignaturesInformation listSignatures(String accountId, String userId) throws ApiException {
"""
Retrieves a list of user signature definitions for a specified user.
Retrieves the signature definitions for the specified user. The userId parameter specified in the endpoint must match the authenticated u... | java | public UserSignaturesInformation listSignatures(String accountId, String userId) throws ApiException {
return listSignatures(accountId, userId, null);
} | [
"public",
"UserSignaturesInformation",
"listSignatures",
"(",
"String",
"accountId",
",",
"String",
"userId",
")",
"throws",
"ApiException",
"{",
"return",
"listSignatures",
"(",
"accountId",
",",
"userId",
",",
"null",
")",
";",
"}"
] | Retrieves a list of user signature definitions for a specified user.
Retrieves the signature definitions for the specified user. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account. The `signatureId` parameter accepts a ... | [
"Retrieves",
"a",
"list",
"of",
"user",
"signature",
"definitions",
"for",
"a",
"specified",
"user",
".",
"Retrieves",
"the",
"signature",
"definitions",
"for",
"the",
"specified",
"user",
".",
"The",
"userId",
"parameter",
"specified",
"in",
"the",
"endpoint",
... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/UsersApi.java#L1267-L1269 |
knowm/Yank | src/main/java/org/knowm/yank/Yank.java | Yank.queryObjectArrays | public static List<Object[]> queryObjectArrays(String sql, Object[] params)
throws YankSQLException {
"""
Return a List of generic Object[]s given an SQL statement using the default connection pool.
@param sql The SQL statement
@param params The replacement parameters
@return The List of generic Object[... | java | public static List<Object[]> queryObjectArrays(String sql, Object[] params)
throws YankSQLException {
return queryObjectArrays(YankPoolManager.DEFAULT_POOL_NAME, sql, params);
} | [
"public",
"static",
"List",
"<",
"Object",
"[",
"]",
">",
"queryObjectArrays",
"(",
"String",
"sql",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"YankSQLException",
"{",
"return",
"queryObjectArrays",
"(",
"YankPoolManager",
".",
"DEFAULT_POOL_NAME",
",",
... | Return a List of generic Object[]s given an SQL statement using the default connection pool.
@param sql The SQL statement
@param params The replacement parameters
@return The List of generic Object[]s | [
"Return",
"a",
"List",
"of",
"generic",
"Object",
"[]",
"s",
"given",
"an",
"SQL",
"statement",
"using",
"the",
"default",
"connection",
"pool",
"."
] | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L665-L669 |
BrunoEberhard/minimal-j | src/main/java/org/minimalj/util/ExceptionUtils.java | ExceptionUtils.logReducedStackTrace | public static void logReducedStackTrace(Logger logger, Exception exception) {
"""
Logs only the relevant part of the stack trace. For example
if a getter fails it's irrelevant if the getter is called
by a swing class or something else
@param logger the logger where the output should go
@param exception the e... | java | public static void logReducedStackTrace(Logger logger, Exception exception) {
Exception here = new Exception();
String[] hereStrings = getStackFrames(here);
String[] throwableStrings = getStackFrames(exception);
int linesToSkip = 1;
while (throwableStrings.length - linesToSkip > 0 && hereStrings.length - l... | [
"public",
"static",
"void",
"logReducedStackTrace",
"(",
"Logger",
"logger",
",",
"Exception",
"exception",
")",
"{",
"Exception",
"here",
"=",
"new",
"Exception",
"(",
")",
";",
"String",
"[",
"]",
"hereStrings",
"=",
"getStackFrames",
"(",
"here",
")",
";"... | Logs only the relevant part of the stack trace. For example
if a getter fails it's irrelevant if the getter is called
by a swing class or something else
@param logger the logger where the output should go
@param exception the exception to be printed | [
"Logs",
"only",
"the",
"relevant",
"part",
"of",
"the",
"stack",
"trace",
".",
"For",
"example",
"if",
"a",
"getter",
"fails",
"it",
"s",
"irrelevant",
"if",
"the",
"getter",
"is",
"called",
"by",
"a",
"swing",
"class",
"or",
"something",
"else"
] | train | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/util/ExceptionUtils.java#L21-L36 |
ModeShape/modeshape | modeshape-schematic/src/main/java/org/modeshape/schematic/DocumentFactory.java | DocumentFactory.newDocument | public static EditableDocument newDocument( String name1,
Object value1,
String name2,
Object value2 ) {
"""
Create a new editable document, initialized with two fields, t... | java | public static EditableDocument newDocument( String name1,
Object value1,
String name2,
Object value2 ) {
return new DocumentEditor(new BasicDocument(name1, value1, name... | [
"public",
"static",
"EditableDocument",
"newDocument",
"(",
"String",
"name1",
",",
"Object",
"value1",
",",
"String",
"name2",
",",
"Object",
"value2",
")",
"{",
"return",
"new",
"DocumentEditor",
"(",
"new",
"BasicDocument",
"(",
"name1",
",",
"value1",
",",... | Create a new editable document, initialized with two fields, that can be used as a new document entry in a SchematicDb or
as nested documents for other documents.
@param name1 the name of the first field in the resulting document; if null, the field will not be added to the returned
document
@param value1 the value of... | [
"Create",
"a",
"new",
"editable",
"document",
"initialized",
"with",
"two",
"fields",
"that",
"can",
"be",
"used",
"as",
"a",
"new",
"document",
"entry",
"in",
"a",
"SchematicDb",
"or",
"as",
"nested",
"documents",
"for",
"other",
"documents",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/DocumentFactory.java#L86-L91 |
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/BitFieldReader.java | BitFieldReader.loadIndeces | public int loadIndeces(List<RowIndexEntry> rowIndexEntries, int startIndex) {
"""
Read in the number of bytes consumed at each index entry and store it,
also call loadIndeces on child stream and return the index of the next
streams indexes.
"""
int updatedStartIndex = input.loadIndeces(rowIndexEntries, s... | java | public int loadIndeces(List<RowIndexEntry> rowIndexEntries, int startIndex) {
int updatedStartIndex = input.loadIndeces(rowIndexEntries, startIndex);
int numIndeces = rowIndexEntries.size();
indeces = new int[numIndeces + 1];
int i = 0;
for (RowIndexEntry rowIndexEntry : rowIndexEntries) {
in... | [
"public",
"int",
"loadIndeces",
"(",
"List",
"<",
"RowIndexEntry",
">",
"rowIndexEntries",
",",
"int",
"startIndex",
")",
"{",
"int",
"updatedStartIndex",
"=",
"input",
".",
"loadIndeces",
"(",
"rowIndexEntries",
",",
"startIndex",
")",
";",
"int",
"numIndeces",... | Read in the number of bytes consumed at each index entry and store it,
also call loadIndeces on child stream and return the index of the next
streams indexes. | [
"Read",
"in",
"the",
"number",
"of",
"bytes",
"consumed",
"at",
"each",
"index",
"entry",
"and",
"store",
"it",
"also",
"call",
"loadIndeces",
"on",
"child",
"stream",
"and",
"return",
"the",
"index",
"of",
"the",
"next",
"streams",
"indexes",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/BitFieldReader.java#L80-L91 |
Minecrell/TerminalConsoleAppender | src/main/java/net/minecrell/terminalconsole/HighlightErrorConverter.java | HighlightErrorConverter.newInstance | public static HighlightErrorConverter newInstance(Configuration config, String[] options) {
"""
Gets a new instance of the {@link HighlightErrorConverter} with the
specified options.
@param config The current configuration
@param options The pattern options
@return The new instance
"""
if (option... | java | public static HighlightErrorConverter newInstance(Configuration config, String[] options) {
if (options.length != 1) {
LOGGER.error("Incorrect number of options on highlightError. Expected 1 received " + options.length);
return null;
}
if (options[0] == null) {
... | [
"public",
"static",
"HighlightErrorConverter",
"newInstance",
"(",
"Configuration",
"config",
",",
"String",
"[",
"]",
"options",
")",
"{",
"if",
"(",
"options",
".",
"length",
"!=",
"1",
")",
"{",
"LOGGER",
".",
"error",
"(",
"\"Incorrect number of options on h... | Gets a new instance of the {@link HighlightErrorConverter} with the
specified options.
@param config The current configuration
@param options The pattern options
@return The new instance | [
"Gets",
"a",
"new",
"instance",
"of",
"the",
"{",
"@link",
"HighlightErrorConverter",
"}",
"with",
"the",
"specified",
"options",
"."
] | train | https://github.com/Minecrell/TerminalConsoleAppender/blob/a540454b397ee488993019fbcacc49b2d88f1752/src/main/java/net/minecrell/terminalconsole/HighlightErrorConverter.java#L141-L154 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/HarFileSystem.java | HarFileSystem.listStatus | @Override
public FileStatus[] listStatus(Path f) throws IOException {
"""
liststatus returns the children of a directory
after looking up the index files.
"""
//need to see if the file is an index in file
//get the filestatus of the archive directory
// we will create fake filestatuses to return... | java | @Override
public FileStatus[] listStatus(Path f) throws IOException {
//need to see if the file is an index in file
//get the filestatus of the archive directory
// we will create fake filestatuses to return
// to the client
List<FileStatus> statuses = new ArrayList<FileStatus>();
FileStatus a... | [
"@",
"Override",
"public",
"FileStatus",
"[",
"]",
"listStatus",
"(",
"Path",
"f",
")",
"throws",
"IOException",
"{",
"//need to see if the file is an index in file",
"//get the filestatus of the archive directory",
"// we will create fake filestatuses to return",
"// to the client... | liststatus returns the children of a directory
after looking up the index files. | [
"liststatus",
"returns",
"the",
"children",
"of",
"a",
"directory",
"after",
"looking",
"up",
"the",
"index",
"files",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L745-L772 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java | AvroUtils.slowDeserializeGenericRecord | public static GenericRecord slowDeserializeGenericRecord(byte[] serializedRecord, Schema schema) throws IOException {
"""
Deserialize a {@link GenericRecord} from a byte array. This method is not intended for high performance.
"""
Decoder decoder = DecoderFactory.get().binaryDecoder(serializedRecord, null)... | java | public static GenericRecord slowDeserializeGenericRecord(byte[] serializedRecord, Schema schema) throws IOException {
Decoder decoder = DecoderFactory.get().binaryDecoder(serializedRecord, null);
GenericDatumReader<GenericRecord> reader = new GenericDatumReader<>(schema);
return reader.read(null, decoder);
... | [
"public",
"static",
"GenericRecord",
"slowDeserializeGenericRecord",
"(",
"byte",
"[",
"]",
"serializedRecord",
",",
"Schema",
"schema",
")",
"throws",
"IOException",
"{",
"Decoder",
"decoder",
"=",
"DecoderFactory",
".",
"get",
"(",
")",
".",
"binaryDecoder",
"("... | Deserialize a {@link GenericRecord} from a byte array. This method is not intended for high performance. | [
"Deserialize",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java#L840-L844 |
aws/aws-sdk-java | aws-java-sdk-fms/src/main/java/com/amazonaws/services/fms/model/Policy.java | Policy.withExcludeMap | public Policy withExcludeMap(java.util.Map<String, java.util.List<String>> excludeMap) {
"""
<p>
Specifies the AWS account IDs to exclude from the policy. The <code>IncludeMap</code> values are evaluated first,
with all the appropriate account IDs added to the policy. Then the accounts listed in <code>ExcludeMap... | java | public Policy withExcludeMap(java.util.Map<String, java.util.List<String>> excludeMap) {
setExcludeMap(excludeMap);
return this;
} | [
"public",
"Policy",
"withExcludeMap",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"excludeMap",
")",
"{",
"setExcludeMap",
"(",
"excludeMap",
")",
";",
"return",
"this",
";",
"}"
... | <p>
Specifies the AWS account IDs to exclude from the policy. The <code>IncludeMap</code> values are evaluated first,
with all the appropriate account IDs added to the policy. Then the accounts listed in <code>ExcludeMap</code> are
removed, resulting in the final list of accounts to add to the policy.
</p>
<p>
The key ... | [
"<p",
">",
"Specifies",
"the",
"AWS",
"account",
"IDs",
"to",
"exclude",
"from",
"the",
"policy",
".",
"The",
"<code",
">",
"IncludeMap<",
"/",
"code",
">",
"values",
"are",
"evaluated",
"first",
"with",
"all",
"the",
"appropriate",
"account",
"IDs",
"adde... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-fms/src/main/java/com/amazonaws/services/fms/model/Policy.java#L775-L778 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java | JsonUtil.getDouble | public static double getDouble(JsonObject object, String field) {
"""
Returns a field in a Json object as a double.
Throws IllegalArgumentException if the field value is null.
@param object the Json Object
@param field the field in the Json object to return
@return the Json field value as a double
"""
... | java | public static double getDouble(JsonObject object, String field) {
final JsonValue value = object.get(field);
throwExceptionIfNull(value, field);
return value.asDouble();
} | [
"public",
"static",
"double",
"getDouble",
"(",
"JsonObject",
"object",
",",
"String",
"field",
")",
"{",
"final",
"JsonValue",
"value",
"=",
"object",
".",
"get",
"(",
"field",
")",
";",
"throwExceptionIfNull",
"(",
"value",
",",
"field",
")",
";",
"retur... | Returns a field in a Json object as a double.
Throws IllegalArgumentException if the field value is null.
@param object the Json Object
@param field the field in the Json object to return
@return the Json field value as a double | [
"Returns",
"a",
"field",
"in",
"a",
"Json",
"object",
"as",
"a",
"double",
".",
"Throws",
"IllegalArgumentException",
"if",
"the",
"field",
"value",
"is",
"null",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java#L107-L111 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_availableRouteRules_GET | public ArrayList<OvhRouteAvailableRule> serviceName_availableRouteRules_GET(String serviceName) throws IOException {
"""
Available route match rules
REST: GET /ipLoadbalancing/{serviceName}/availableRouteRules
@param serviceName [required] The internal name of your IP load balancing
"""
String qPath = "/... | java | public ArrayList<OvhRouteAvailableRule> serviceName_availableRouteRules_GET(String serviceName) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/availableRouteRules";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t11... | [
"public",
"ArrayList",
"<",
"OvhRouteAvailableRule",
">",
"serviceName_availableRouteRules_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/availableRouteRules\"",
";",
"StringBuilder",
"sb",
"=",... | Available route match rules
REST: GET /ipLoadbalancing/{serviceName}/availableRouteRules
@param serviceName [required] The internal name of your IP load balancing | [
"Available",
"route",
"match",
"rules"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1762-L1767 |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/io/HessianOutput.java | HessianOutput.writeString | public void writeString(char[] buffer, int offset, int length)
throws IOException {
"""
Writes a string value to the stream using UTF-8 encoding.
The string will be written with the following syntax:
<code><pre>
S b16 b8 string-value
</pre></code>
If the value is null, it will be written as
<co... | java | public void writeString(char[] buffer, int offset, int length)
throws IOException
{
if (buffer == null) {
os.write('N');
}
else {
while (length > 0x8000) {
int sublen = 0x8000;
// chunk can't end in high surrogate
... | [
"public",
"void",
"writeString",
"(",
"char",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"{",
"os",
".",
"write",
"(",
"'",
"'",
")",
";",
"}",
"else",
... | Writes a string value to the stream using UTF-8 encoding.
The string will be written with the following syntax:
<code><pre>
S b16 b8 string-value
</pre></code>
If the value is null, it will be written as
<code><pre>
N
</pre></code>
@param value the string value to write. | [
"Writes",
"a",
"string",
"value",
"to",
"the",
"stream",
"using",
"UTF",
"-",
"8",
"encoding",
".",
"The",
"string",
"will",
"be",
"written",
"with",
"the",
"following",
"syntax",
":"
] | train | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/HessianOutput.java#L610-L642 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.scalarMin | public SDVariable scalarMin(SDVariable in, Number value) {
"""
Element-wise scalar minimum operation: out = min(in, value)
@param in Input variable
@param value Scalar value to compare
@return Output variable
"""
return scalarMin(null, in, value);
} | java | public SDVariable scalarMin(SDVariable in, Number value) {
return scalarMin(null, in, value);
} | [
"public",
"SDVariable",
"scalarMin",
"(",
"SDVariable",
"in",
",",
"Number",
"value",
")",
"{",
"return",
"scalarMin",
"(",
"null",
",",
"in",
",",
"value",
")",
";",
"}"
] | Element-wise scalar minimum operation: out = min(in, value)
@param in Input variable
@param value Scalar value to compare
@return Output variable | [
"Element",
"-",
"wise",
"scalar",
"minimum",
"operation",
":",
"out",
"=",
"min",
"(",
"in",
"value",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1968-L1970 |
google/closure-compiler | src/com/google/javascript/jscomp/TypedScopeCreator.java | TypedScopeCreator.createScope | @Override
public TypedScope createScope(Node root, AbstractScope<?, ?> parent) {
"""
Creates a scope with all types declared. Declares newly discovered types
and type properties in the type registry.
"""
checkArgument(parent == null || parent instanceof TypedScope);
TypedScope typedParent = (TypedSc... | java | @Override
public TypedScope createScope(Node root, AbstractScope<?, ?> parent) {
checkArgument(parent == null || parent instanceof TypedScope);
TypedScope typedParent = (TypedScope) parent;
TypedScope scope = memoized.get(root);
if (scope != null) {
checkState(typedParent == scope.getParent());... | [
"@",
"Override",
"public",
"TypedScope",
"createScope",
"(",
"Node",
"root",
",",
"AbstractScope",
"<",
"?",
",",
"?",
">",
"parent",
")",
"{",
"checkArgument",
"(",
"parent",
"==",
"null",
"||",
"parent",
"instanceof",
"TypedScope",
")",
";",
"TypedScope",
... | Creates a scope with all types declared. Declares newly discovered types
and type properties in the type registry. | [
"Creates",
"a",
"scope",
"with",
"all",
"types",
"declared",
".",
"Declares",
"newly",
"discovered",
"types",
"and",
"type",
"properties",
"in",
"the",
"type",
"registry",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypedScopeCreator.java#L366-L379 |
BoltsFramework/Bolts-Android | bolts-applinks/src/main/java/bolts/AppLinks.java | AppLinks.getTargetUrlFromInboundIntent | public static Uri getTargetUrlFromInboundIntent(Context context, Intent intent) {
"""
Gets the target URL for an intent. If the intent is from an App Link, this will be the App Link target.
Otherwise, it return null; For app link intent, this function will broadcast APP_LINK_NAVIGATE_IN_EVENT_NAME event.
@para... | java | public static Uri getTargetUrlFromInboundIntent(Context context, Intent intent) {
Bundle appLinkData = getAppLinkData(intent);
if (appLinkData != null) {
String targetString = appLinkData.getString(KEY_NAME_TARGET);
if (targetString != null) {
MeasurementEvent.sendBroadcastEvent(context, Mea... | [
"public",
"static",
"Uri",
"getTargetUrlFromInboundIntent",
"(",
"Context",
"context",
",",
"Intent",
"intent",
")",
"{",
"Bundle",
"appLinkData",
"=",
"getAppLinkData",
"(",
"intent",
")",
";",
"if",
"(",
"appLinkData",
"!=",
"null",
")",
"{",
"String",
"targ... | Gets the target URL for an intent. If the intent is from an App Link, this will be the App Link target.
Otherwise, it return null; For app link intent, this function will broadcast APP_LINK_NAVIGATE_IN_EVENT_NAME event.
@param context the context this function is called within.
@param intent the incoming intent.
@retu... | [
"Gets",
"the",
"target",
"URL",
"for",
"an",
"intent",
".",
"If",
"the",
"intent",
"is",
"from",
"an",
"App",
"Link",
"this",
"will",
"be",
"the",
"App",
"Link",
"target",
".",
"Otherwise",
"it",
"return",
"null",
";",
"For",
"app",
"link",
"intent",
... | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-applinks/src/main/java/bolts/AppLinks.java#L78-L88 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/LettuceFutures.java | LettuceFutures.awaitAll | public static boolean awaitAll(Duration timeout, Future<?>... futures) {
"""
Wait until futures are complete or the supplied timeout is reached. Commands are not canceled (in contrast to
{@link #awaitOrCancel(RedisFuture, long, TimeUnit)}) when the timeout expires.
@param timeout Maximum time to wait for futur... | java | public static boolean awaitAll(Duration timeout, Future<?>... futures) {
return awaitAll(timeout.toNanos(), TimeUnit.NANOSECONDS, futures);
} | [
"public",
"static",
"boolean",
"awaitAll",
"(",
"Duration",
"timeout",
",",
"Future",
"<",
"?",
">",
"...",
"futures",
")",
"{",
"return",
"awaitAll",
"(",
"timeout",
".",
"toNanos",
"(",
")",
",",
"TimeUnit",
".",
"NANOSECONDS",
",",
"futures",
")",
";"... | Wait until futures are complete or the supplied timeout is reached. Commands are not canceled (in contrast to
{@link #awaitOrCancel(RedisFuture, long, TimeUnit)}) when the timeout expires.
@param timeout Maximum time to wait for futures to complete.
@param futures Futures to wait for.
@return {@literal true} if all fu... | [
"Wait",
"until",
"futures",
"are",
"complete",
"or",
"the",
"supplied",
"timeout",
"is",
"reached",
".",
"Commands",
"are",
"not",
"canceled",
"(",
"in",
"contrast",
"to",
"{",
"@link",
"#awaitOrCancel",
"(",
"RedisFuture",
"long",
"TimeUnit",
")",
"}",
")",... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/LettuceFutures.java#L45-L47 |
zk1931/jzab | src/main/java/com/github/zk1931/jzab/MessageBuilder.java | MessageBuilder.buildSnapshot | public static Message buildSnapshot(Zxid lastZxid, Zxid snapZxid) {
"""
Creates a SNAPSHOT message.
@param lastZxid the last zxid of the sender.
@param snapZxid the last guaranteed applied zxid in snapshot.
@return a protobuf message.
"""
ZabMessage.Zxid lZxid = toProtoZxid(lastZxid);
ZabMessage.Z... | java | public static Message buildSnapshot(Zxid lastZxid, Zxid snapZxid) {
ZabMessage.Zxid lZxid = toProtoZxid(lastZxid);
ZabMessage.Zxid sZxid = toProtoZxid(snapZxid);
Snapshot snapshot = Snapshot.newBuilder().setLastZxid(lZxid)
.setSnapZxid(sZxid)
... | [
"public",
"static",
"Message",
"buildSnapshot",
"(",
"Zxid",
"lastZxid",
",",
"Zxid",
"snapZxid",
")",
"{",
"ZabMessage",
".",
"Zxid",
"lZxid",
"=",
"toProtoZxid",
"(",
"lastZxid",
")",
";",
"ZabMessage",
".",
"Zxid",
"sZxid",
"=",
"toProtoZxid",
"(",
"snapZ... | Creates a SNAPSHOT message.
@param lastZxid the last zxid of the sender.
@param snapZxid the last guaranteed applied zxid in snapshot.
@return a protobuf message. | [
"Creates",
"a",
"SNAPSHOT",
"message",
"."
] | train | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/MessageBuilder.java#L326-L335 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.executeForGeneratedKey | public static Long executeForGeneratedKey(Connection conn, String sql, Map<String, Object> paramMap) throws SQLException {
"""
执行非查询语句,返回主键<br>
发查询语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param paramMap 参数Map
@return 主键
@throws SQLException SQL执行异常
@since 4.0.10
"""
f... | java | public static Long executeForGeneratedKey(Connection conn, String sql, Map<String, Object> paramMap) throws SQLException {
final NamedSql namedSql = new NamedSql(sql, paramMap);
return executeForGeneratedKey(conn, namedSql.getSql(), namedSql.getParams());
} | [
"public",
"static",
"Long",
"executeForGeneratedKey",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"throws",
"SQLException",
"{",
"final",
"NamedSql",
"namedSql",
"=",
"new",
"NamedSql",
"(",
... | 执行非查询语句,返回主键<br>
发查询语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param paramMap 参数Map
@return 主键
@throws SQLException SQL执行异常
@since 4.0.10 | [
"执行非查询语句,返回主键<br",
">",
"发查询语句包括",
"插入、更新、删除<br",
">",
"此方法不会关闭Connection"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L116-L119 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getLongBytes | public long getLongBytes(String name, long defaultValue) {
"""
Get the value of the <code>name</code> property as a <code>long</code> or
human readable format. If no such property exists, the provided default
value is returned, or if the specified value is not a valid
<code>long</code> or human readable format,... | java | public long getLongBytes(String name, long defaultValue) {
String valueString = getTrimmed(name);
if (valueString == null)
return defaultValue;
return StringUtils.TraditionalBinaryPrefix.string2long(valueString);
} | [
"public",
"long",
"getLongBytes",
"(",
"String",
"name",
",",
"long",
"defaultValue",
")",
"{",
"String",
"valueString",
"=",
"getTrimmed",
"(",
"name",
")",
";",
"if",
"(",
"valueString",
"==",
"null",
")",
"return",
"defaultValue",
";",
"return",
"StringUt... | Get the value of the <code>name</code> property as a <code>long</code> or
human readable format. If no such property exists, the provided default
value is returned, or if the specified value is not a valid
<code>long</code> or human readable format, then an error is thrown. You
can use the following suffix (case insens... | [
"Get",
"the",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"a",
"<code",
">",
"long<",
"/",
"code",
">",
"or",
"human",
"readable",
"format",
".",
"If",
"no",
"such",
"property",
"exists",
"the",
"provided",
"default... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1431-L1436 |
OpenFeign/feign | core/src/main/java/feign/template/UriUtils.java | UriUtils.encodeChunk | private static String encodeChunk(String value, FragmentType type, Charset charset) {
"""
Encode a Uri Chunk, ensuring that all reserved characters are also encoded.
@param value to encode.
@param type identifying which uri fragment rules to apply.
@param charset to use.
@return an encoded uri chunk.
"""... | java | private static String encodeChunk(String value, FragmentType type, Charset charset) {
byte[] data = value.getBytes(charset);
ByteArrayOutputStream encoded = new ByteArrayOutputStream();
for (byte b : data) {
if (type.isAllowed(b)) {
encoded.write(b);
} else {
/* percent encode t... | [
"private",
"static",
"String",
"encodeChunk",
"(",
"String",
"value",
",",
"FragmentType",
"type",
",",
"Charset",
"charset",
")",
"{",
"byte",
"[",
"]",
"data",
"=",
"value",
".",
"getBytes",
"(",
"charset",
")",
";",
"ByteArrayOutputStream",
"encoded",
"="... | Encode a Uri Chunk, ensuring that all reserved characters are also encoded.
@param value to encode.
@param type identifying which uri fragment rules to apply.
@param charset to use.
@return an encoded uri chunk. | [
"Encode",
"a",
"Uri",
"Chunk",
"ensuring",
"that",
"all",
"reserved",
"characters",
"are",
"also",
"encoded",
"."
] | train | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/UriUtils.java#L180-L193 |
jbundle/jbundle | thin/base/thread/src/main/java/org/jbundle/thin/base/thread/PrivateTaskScheduler.java | PrivateTaskScheduler.init | public void init(App application, int iMaxThreads, boolean bKeepAlive) {
"""
Constructor.
@param application The parent application.
@param iMaxThreads The maximum number of threads to run (-1 = default).
@param bKeepAlive Keep the task alive after execution.
"""
iMaxThreads = 0;
super.init(... | java | public void init(App application, int iMaxThreads, boolean bKeepAlive)
{
iMaxThreads = 0;
super.init(application, iMaxThreads);
m_vPrivateJobs = new Vector<Object>(); // List of my private jobs
m_bKeepAlive = bKeepAlive; // Keep the task alive after execution.
i... | [
"public",
"void",
"init",
"(",
"App",
"application",
",",
"int",
"iMaxThreads",
",",
"boolean",
"bKeepAlive",
")",
"{",
"iMaxThreads",
"=",
"0",
";",
"super",
".",
"init",
"(",
"application",
",",
"iMaxThreads",
")",
";",
"m_vPrivateJobs",
"=",
"new",
"Vec... | Constructor.
@param application The parent application.
@param iMaxThreads The maximum number of threads to run (-1 = default).
@param bKeepAlive Keep the task alive after execution. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/thread/src/main/java/org/jbundle/thin/base/thread/PrivateTaskScheduler.java#L70-L78 |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teatools/TeaToolsUtils.java | TeaToolsUtils.createParameterDescriptions | public ParameterDescription[] createParameterDescriptions(
MethodDescriptor md) {
"""
Returns an array of ParameterDescriptions to wrap and describe the
parameters of the specified MethodDescriptor.
"""
if (md == null) {
return null;
... | java | public ParameterDescription[] createParameterDescriptions(
MethodDescriptor md) {
if (md == null) {
return null;
}
Method method = md.getMethod();
Class<?>[] paramClasses = method.getParameterTypes();
int d... | [
"public",
"ParameterDescription",
"[",
"]",
"createParameterDescriptions",
"(",
"MethodDescriptor",
"md",
")",
"{",
"if",
"(",
"md",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Method",
"method",
"=",
"md",
".",
"getMethod",
"(",
")",
";",
"Class"... | Returns an array of ParameterDescriptions to wrap and describe the
parameters of the specified MethodDescriptor. | [
"Returns",
"an",
"array",
"of",
"ParameterDescriptions",
"to",
"wrap",
"and",
"describe",
"the",
"parameters",
"of",
"the",
"specified",
"MethodDescriptor",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teatools/TeaToolsUtils.java#L146-L175 |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java | AbstractSarlMojo.executeMojo | protected void executeMojo(
String groupId, String artifactId,
String version, String goal,
String configuration,
Dependency... dependencies) throws MojoExecutionException, MojoFailureException {
"""
Execute another MOJO.
@param groupId identifier of the MOJO plugin group.
@param artifactId identif... | java | protected void executeMojo(
String groupId, String artifactId,
String version, String goal,
String configuration,
Dependency... dependencies) throws MojoExecutionException, MojoFailureException {
final Plugin plugin = new Plugin();
plugin.setArtifactId(artifactId);
plugin.setGroupId(groupId);
plugin... | [
"protected",
"void",
"executeMojo",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
",",
"String",
"goal",
",",
"String",
"configuration",
",",
"Dependency",
"...",
"dependencies",
")",
"throws",
"MojoExecutionException",
",",
"Moj... | Execute another MOJO.
@param groupId identifier of the MOJO plugin group.
@param artifactId identifier of the MOJO plugin artifact.
@param version version of the MOJO plugin version.
@param goal the goal to run.
@param configuration the XML code for the configuration.
@param dependencies the dependencies of the plugin... | [
"Execute",
"another",
"MOJO",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java#L231-L273 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/cluster/ClusterAnalyzer.java | ClusterAnalyzer.refined_vector_value | double refined_vector_value(SparseVector composite, SparseVector vec, int sign) {
"""
c^2 - 2c(a + c) + d^2 - 2d(b + d)
@param composite (a+c,b+d)
@param vec (c,d)
@param sign
@return
"""
double sum = 0.0;
for (Map.Entry<Integer, Double> entry : vec.entrySet())
{
... | java | double refined_vector_value(SparseVector composite, SparseVector vec, int sign)
{
double sum = 0.0;
for (Map.Entry<Integer, Double> entry : vec.entrySet())
{
sum += Math.pow(entry.getValue(), 2) + sign * 2 * composite.get(entry.getKey()) * entry.getValue();
}
retu... | [
"double",
"refined_vector_value",
"(",
"SparseVector",
"composite",
",",
"SparseVector",
"vec",
",",
"int",
"sign",
")",
"{",
"double",
"sum",
"=",
"0.0",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Double",
">",
"entry",
":",
"vec",
".",... | c^2 - 2c(a + c) + d^2 - 2d(b + d)
@param composite (a+c,b+d)
@param vec (c,d)
@param sign
@return | [
"c^2",
"-",
"2c",
"(",
"a",
"+",
"c",
")",
"+",
"d^2",
"-",
"2d",
"(",
"b",
"+",
"d",
")"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/ClusterAnalyzer.java#L339-L347 |
joniles/mpxj | src/main/java/net/sf/mpxj/conceptdraw/ConceptDrawProjectReader.java | ConceptDrawProjectReader.readResourceAssignment | private void readResourceAssignment(Task task, Document.Projects.Project.Task.ResourceAssignments.ResourceAssignment assignment) {
"""
Read resource assignments.
@param task Parent task
@param assignment ConceptDraw PROJECT resource assignment
"""
Resource resource = m_projectFile.getResourceByUnique... | java | private void readResourceAssignment(Task task, Document.Projects.Project.Task.ResourceAssignments.ResourceAssignment assignment)
{
Resource resource = m_projectFile.getResourceByUniqueID(assignment.getResourceID());
if (resource != null)
{
ResourceAssignment mpxjAssignment = task.addResour... | [
"private",
"void",
"readResourceAssignment",
"(",
"Task",
"task",
",",
"Document",
".",
"Projects",
".",
"Project",
".",
"Task",
".",
"ResourceAssignments",
".",
"ResourceAssignment",
"assignment",
")",
"{",
"Resource",
"resource",
"=",
"m_projectFile",
".",
"getR... | Read resource assignments.
@param task Parent task
@param assignment ConceptDraw PROJECT resource assignment | [
"Read",
"resource",
"assignments",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/ConceptDrawProjectReader.java#L466-L476 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java | MSPDIReader.readCalendars | private void readCalendars(Project project, HashMap<BigInteger, ProjectCalendar> map) {
"""
This method extracts calendar data from an MSPDI file.
@param project Root node of the MSPDI file
@param map Map of calendar UIDs to names
"""
Project.Calendars calendars = project.getCalendars();
if (ca... | java | private void readCalendars(Project project, HashMap<BigInteger, ProjectCalendar> map)
{
Project.Calendars calendars = project.getCalendars();
if (calendars != null)
{
LinkedList<Pair<ProjectCalendar, BigInteger>> baseCalendars = new LinkedList<Pair<ProjectCalendar, BigInteger>>();
... | [
"private",
"void",
"readCalendars",
"(",
"Project",
"project",
",",
"HashMap",
"<",
"BigInteger",
",",
"ProjectCalendar",
">",
"map",
")",
"{",
"Project",
".",
"Calendars",
"calendars",
"=",
"project",
".",
"getCalendars",
"(",
")",
";",
"if",
"(",
"calendar... | This method extracts calendar data from an MSPDI file.
@param project Root node of the MSPDI file
@param map Map of calendar UIDs to names | [
"This",
"method",
"extracts",
"calendar",
"data",
"from",
"an",
"MSPDI",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java#L384-L409 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/PresenceNotifySender.java | PresenceNotifySender.waitResponse | public EventObject waitResponse(SipTransaction trans, long timeout) {
"""
The waitResponse() method waits for a response to a previously sent transactional request
message. Call this method after calling sendStatefulNotify().
<p>
This method blocks until one of the following occurs: 1) A javax.sip.ResponseEve... | java | public EventObject waitResponse(SipTransaction trans, long timeout) {
EventObject event = phone.waitResponse(trans, timeout);
if (event instanceof ResponseEvent) {
receivedResponses.add(new SipResponse((ResponseEvent) event));
}
return event;
} | [
"public",
"EventObject",
"waitResponse",
"(",
"SipTransaction",
"trans",
",",
"long",
"timeout",
")",
"{",
"EventObject",
"event",
"=",
"phone",
".",
"waitResponse",
"(",
"trans",
",",
"timeout",
")",
";",
"if",
"(",
"event",
"instanceof",
"ResponseEvent",
")"... | The waitResponse() method waits for a response to a previously sent transactional request
message. Call this method after calling sendStatefulNotify().
<p>
This method blocks until one of the following occurs: 1) A javax.sip.ResponseEvent is received.
This is the object returned by this method. 2) A javax.sip.TimeoutE... | [
"The",
"waitResponse",
"()",
"method",
"waits",
"for",
"a",
"response",
"to",
"a",
"previously",
"sent",
"transactional",
"request",
"message",
".",
"Call",
"this",
"method",
"after",
"calling",
"sendStatefulNotify",
"()",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/PresenceNotifySender.java#L650-L658 |
att/AAF | authz/authz-gui/src/main/java/com/att/authz/gui/Page.java | Page.browser | public static BROWSER browser(AuthzTrans trans, Slot slot) {
"""
It's IE if int >=0
Use int found in "ieVersion"
Official IE 7
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322;
.NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Official IE 8
Mozilla/4.0 (compatible; MSIE ... | java | public static BROWSER browser(AuthzTrans trans, Slot slot) {
BROWSER br = trans.get(slot, null);
if(br==null) {
String agent = trans.agent();
int msie;
if(agent.contains("iPhone") /* other phones? */) {
br=BROWSER.iPhone;
} else if ((msie = agent.indexOf("MSIE"))>=0) {
msie+=5;
int end = ag... | [
"public",
"static",
"BROWSER",
"browser",
"(",
"AuthzTrans",
"trans",
",",
"Slot",
"slot",
")",
"{",
"BROWSER",
"br",
"=",
"trans",
".",
"get",
"(",
"slot",
",",
"null",
")",
";",
"if",
"(",
"br",
"==",
"null",
")",
"{",
"String",
"agent",
"=",
"tr... | It's IE if int >=0
Use int found in "ieVersion"
Official IE 7
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322;
.NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Official IE 8
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2;
.NET CLR 2.0.50727; .NET CLR 3... | [
"It",
"s",
"IE",
"if",
"int",
">",
"=",
"0"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-gui/src/main/java/com/att/authz/gui/Page.java#L267-L290 |
VoltDB/voltdb | third_party/java/src/au/com/bytecode/opencsv_voltpatches/CSVWriter.java | CSVWriter.writeAll | public void writeAll(java.sql.ResultSet rs, boolean includeColumnNames) throws SQLException, IOException {
"""
Writes the entire ResultSet to a CSV file.
The caller is responsible for closing the ResultSet.
@param rs the recordset to write
@param includeColumnNames true if you want column names in the outp... | java | public void writeAll(java.sql.ResultSet rs, boolean includeColumnNames) throws SQLException, IOException {
if (includeColumnNames) {
writeColumnNames(rs);
}
while (rs.next())
{
writeNext(resultService.getColumnValues(rs));
}
} | [
"public",
"void",
"writeAll",
"(",
"java",
".",
"sql",
".",
"ResultSet",
"rs",
",",
"boolean",
"includeColumnNames",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"if",
"(",
"includeColumnNames",
")",
"{",
"writeColumnNames",
"(",
"rs",
")",
";",
"... | Writes the entire ResultSet to a CSV file.
The caller is responsible for closing the ResultSet.
@param rs the recordset to write
@param includeColumnNames true if you want column names in the output, false otherwise
@throws java.io.IOException thrown by getColumnValue
@throws java.sql.SQLException thrown by getColum... | [
"Writes",
"the",
"entire",
"ResultSet",
"to",
"a",
"CSV",
"file",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/au/com/bytecode/opencsv_voltpatches/CSVWriter.java#L205-L216 |
belaban/JGroups | src/org/jgroups/stack/RouterStub.java | RouterStub.getMembers | public void getMembers(final String group, MembersNotification callback) throws Exception {
"""
Fetches a list of {@link PingData} from the GossipRouter, one for each member in the given group. This call
returns immediately and when the results are available, the
{@link org.jgroups.stack.RouterStub.MembersNotifi... | java | public void getMembers(final String group, MembersNotification callback) throws Exception {
if(callback == null)
return;
// if(!isConnected()) throw new Exception ("not connected");
synchronized(get_members_map) {
List<MembersNotification> set=get_members_map.get(group);
... | [
"public",
"void",
"getMembers",
"(",
"final",
"String",
"group",
",",
"MembersNotification",
"callback",
")",
"throws",
"Exception",
"{",
"if",
"(",
"callback",
"==",
"null",
")",
"return",
";",
"// if(!isConnected()) throw new Exception (\"not connected\");",
"synchron... | Fetches a list of {@link PingData} from the GossipRouter, one for each member in the given group. This call
returns immediately and when the results are available, the
{@link org.jgroups.stack.RouterStub.MembersNotification#members(List)} callback will be invoked.
@param group The group for which we need members inform... | [
"Fetches",
"a",
"list",
"of",
"{"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/stack/RouterStub.java#L155-L173 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.buildAnnotationList | public static List<ModelAnnotation> buildAnnotationList(final Element element, final AnnotationFilter filter) {
"""
Builds the annotation list.
@param element the element
@param filter the filter
@return the list
"""
final List<ModelAnnotation> annotationList=new ArrayList<>();
forEachAnnotations(e... | java | public static List<ModelAnnotation> buildAnnotationList(final Element element, final AnnotationFilter filter) {
final List<ModelAnnotation> annotationList=new ArrayList<>();
forEachAnnotations(element, filter, new AnnotationFoundListener() {
@Override
public void onAcceptAnnotation(Element executableMetho... | [
"public",
"static",
"List",
"<",
"ModelAnnotation",
">",
"buildAnnotationList",
"(",
"final",
"Element",
"element",
",",
"final",
"AnnotationFilter",
"filter",
")",
"{",
"final",
"List",
"<",
"ModelAnnotation",
">",
"annotationList",
"=",
"new",
"ArrayList",
"<>",... | Builds the annotation list.
@param element the element
@param filter the filter
@return the list | [
"Builds",
"the",
"annotation",
"list",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L422-L436 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/chunkblock/ChunkCallbackRegistry.java | ChunkCallbackRegistry.processCallbacks | public CallbackResult<V> processCallbacks(Chunk chunk, Object... params) {
"""
Processes the {@link IChunkCallback IChunkCallbacks} registered.
@param chunk the chunk
@param params the params
@return the callback result
"""
//true = cancel => return
Set<BlockPos> coords = ChunkBlockHandler.get().chunk... | java | public CallbackResult<V> processCallbacks(Chunk chunk, Object... params)
{
//true = cancel => return
Set<BlockPos> coords = ChunkBlockHandler.get().chunks(chunk).get(chunk);
return processListeners(coords, chunk, params);
} | [
"public",
"CallbackResult",
"<",
"V",
">",
"processCallbacks",
"(",
"Chunk",
"chunk",
",",
"Object",
"...",
"params",
")",
"{",
"//true = cancel => return",
"Set",
"<",
"BlockPos",
">",
"coords",
"=",
"ChunkBlockHandler",
".",
"get",
"(",
")",
".",
"chunks",
... | Processes the {@link IChunkCallback IChunkCallbacks} registered.
@param chunk the chunk
@param params the params
@return the callback result | [
"Processes",
"the",
"{",
"@link",
"IChunkCallback",
"IChunkCallbacks",
"}",
"registered",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunkblock/ChunkCallbackRegistry.java#L54-L59 |
lightblueseas/email-tails | src/main/java/de/alpharogroup/email/utils/EmailExtensions.java | EmailExtensions.newAddress | public static Address newAddress(final String address)
throws AddressException, UnsupportedEncodingException {
"""
Creates an Address from the given the email address as String object.
@param address
The address in RFC822 format.
@return The created InternetAddress-object from the given address.
@throw... | java | public static Address newAddress(final String address)
throws AddressException, UnsupportedEncodingException
{
return newAddress(address, null, null);
} | [
"public",
"static",
"Address",
"newAddress",
"(",
"final",
"String",
"address",
")",
"throws",
"AddressException",
",",
"UnsupportedEncodingException",
"{",
"return",
"newAddress",
"(",
"address",
",",
"null",
",",
"null",
")",
";",
"}"
] | Creates an Address from the given the email address as String object.
@param address
The address in RFC822 format.
@return The created InternetAddress-object from the given address.
@throws UnsupportedEncodingException
is thrown if the encoding not supported
@throws AddressException
is thrown if the parse failed | [
"Creates",
"an",
"Address",
"from",
"the",
"given",
"the",
"email",
"address",
"as",
"String",
"object",
"."
] | train | https://github.com/lightblueseas/email-tails/blob/7be6fee3548e61e697cc8e64e90603cb1f505be2/src/main/java/de/alpharogroup/email/utils/EmailExtensions.java#L175-L179 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.logException | public static void logException( Logger logger, Throwable t ) {
"""
Logs an exception with the given logger and the FINEST level.
@param logger the logger
@param t an exception or a throwable
"""
logException( logger, Level.FINEST, t );
} | java | public static void logException( Logger logger, Throwable t ) {
logException( logger, Level.FINEST, t );
} | [
"public",
"static",
"void",
"logException",
"(",
"Logger",
"logger",
",",
"Throwable",
"t",
")",
"{",
"logException",
"(",
"logger",
",",
"Level",
".",
"FINEST",
",",
"t",
")",
";",
"}"
] | Logs an exception with the given logger and the FINEST level.
@param logger the logger
@param t an exception or a throwable | [
"Logs",
"an",
"exception",
"with",
"the",
"given",
"logger",
"and",
"the",
"FINEST",
"level",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L1136-L1138 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.readPropertiesBoolean | public static boolean readPropertiesBoolean(Properties _props, String _property) {
"""
Reads a property as boolean from an properties object.
Returns true if read property matches 1, yes, true, enabled, on, y
@param _props
@param _property
@return
"""
if (_props.containsKey(_property)) {
... | java | public static boolean readPropertiesBoolean(Properties _props, String _property) {
if (_props.containsKey(_property)) {
if (_props.getProperty(_property).matches("(?i)(1|yes|true|enabled|on|y)")) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"readPropertiesBoolean",
"(",
"Properties",
"_props",
",",
"String",
"_property",
")",
"{",
"if",
"(",
"_props",
".",
"containsKey",
"(",
"_property",
")",
")",
"{",
"if",
"(",
"_props",
".",
"getProperty",
"(",
"_property",
")... | Reads a property as boolean from an properties object.
Returns true if read property matches 1, yes, true, enabled, on, y
@param _props
@param _property
@return | [
"Reads",
"a",
"property",
"as",
"boolean",
"from",
"an",
"properties",
"object",
".",
"Returns",
"true",
"if",
"read",
"property",
"matches",
"1",
"yes",
"true",
"enabled",
"on",
"y"
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L129-L136 |
netty/netty | common/src/main/java/io/netty/util/internal/PlatformDependent.java | PlatformDependent.isZero | public static boolean isZero(byte[] bytes, int startPos, int length) {
"""
Determine if a subsection of an array is zero.
@param bytes The byte array.
@param startPos The starting index (inclusive) in {@code bytes}.
@param length The amount of bytes to check for zero.
@return {@code false} if {@code bytes[star... | java | public static boolean isZero(byte[] bytes, int startPos, int length) {
return !hasUnsafe() || !unalignedAccess() ?
isZeroSafe(bytes, startPos, length) :
PlatformDependent0.isZero(bytes, startPos, length);
} | [
"public",
"static",
"boolean",
"isZero",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"length",
")",
"{",
"return",
"!",
"hasUnsafe",
"(",
")",
"||",
"!",
"unalignedAccess",
"(",
")",
"?",
"isZeroSafe",
"(",
"bytes",
",",
"startP... | Determine if a subsection of an array is zero.
@param bytes The byte array.
@param startPos The starting index (inclusive) in {@code bytes}.
@param length The amount of bytes to check for zero.
@return {@code false} if {@code bytes[startPos:startsPos+length)} contains a value other than zero. | [
"Determine",
"if",
"a",
"subsection",
"of",
"an",
"array",
"is",
"zero",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/PlatformDependent.java#L709-L713 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinder.java | ShuttleListBinder.createBindingContext | public static Map createBindingContext( FormModel formModel, String selectionFormProperty,
ValueModel selectableItemsHolder, String renderedProperty ) {
"""
Utility method to construct the context map used to configure instances
of {@link ShuttleListBinding} created by this binder.
<p>
Binds the val... | java | public static Map createBindingContext( FormModel formModel, String selectionFormProperty,
ValueModel selectableItemsHolder, String renderedProperty ) {
final Map context = new HashMap(4);
context.put(ShuttleListBinder.FORM_ID, formModel.getId());
final ValueModel selectionValueMo... | [
"public",
"static",
"Map",
"createBindingContext",
"(",
"FormModel",
"formModel",
",",
"String",
"selectionFormProperty",
",",
"ValueModel",
"selectableItemsHolder",
",",
"String",
"renderedProperty",
")",
"{",
"final",
"Map",
"context",
"=",
"new",
"HashMap",
"(",
... | Utility method to construct the context map used to configure instances
of {@link ShuttleListBinding} created by this binder.
<p>
Binds the values specified in the collection contained within
<code>selectableItemsHolder</code> to a {@link ShuttleList}, with any
user selection being placed in the form property referred ... | [
"Utility",
"method",
"to",
"construct",
"the",
"context",
"map",
"used",
"to",
"configure",
"instances",
"of",
"{",
"@link",
"ShuttleListBinding",
"}",
"created",
"by",
"this",
"binder",
".",
"<p",
">",
"Binds",
"the",
"values",
"specified",
"in",
"the",
"co... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinder.java#L148-L171 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.clickInRecyclerView | public void clickInRecyclerView(int itemIndex, int recyclerViewIndex, int id) {
"""
Clicks a View with a specified resource id on the specified item index in the RecyclerView matching the specified RecyclerView index
@param itemIndex the line where the View exists
@param recyclerViewIndex the index of the Recy... | java | public void clickInRecyclerView(int itemIndex, int recyclerViewIndex, int id) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "clickInRecyclerView("+itemIndex+", "+recyclerViewIndex+", " + id +")");
}
clicker.clickInRecyclerView(itemIndex, recyclerViewIndex, id, false, 0);
} | [
"public",
"void",
"clickInRecyclerView",
"(",
"int",
"itemIndex",
",",
"int",
"recyclerViewIndex",
",",
"int",
"id",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"clickInRecy... | Clicks a View with a specified resource id on the specified item index in the RecyclerView matching the specified RecyclerView index
@param itemIndex the line where the View exists
@param recyclerViewIndex the index of the RecyclerView. {@code 0} if only one is available
@param id the resource id of the View to click | [
"Clicks",
"a",
"View",
"with",
"a",
"specified",
"resource",
"id",
"on",
"the",
"specified",
"item",
"index",
"in",
"the",
"RecyclerView",
"matching",
"the",
"specified",
"RecyclerView",
"index"
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L1825-L1831 |
julianhyde/sqlline | src/main/java/sqlline/SqlLineHighlighter.java | SqlLineHighlighter.handleNumbers | int handleNumbers(String line, BitSet numberBitSet, int startingPoint) {
"""
Marks numbers position based on input.
<p>Assumes that a number starts at the specified position,
i.e. {@code Character.isDigit(line.charAt(startingPoint)) == true}
@param line Line where to handle number string
@param n... | java | int handleNumbers(String line, BitSet numberBitSet, int startingPoint) {
int end = startingPoint + 1;
while (end < line.length() && Character.isDigit(line.charAt(end))) {
end++;
}
if (end == line.length()) {
if (Character.isDigit(line.charAt(line.length() - 1))) {
numberBitSet.set(st... | [
"int",
"handleNumbers",
"(",
"String",
"line",
",",
"BitSet",
"numberBitSet",
",",
"int",
"startingPoint",
")",
"{",
"int",
"end",
"=",
"startingPoint",
"+",
"1",
";",
"while",
"(",
"end",
"<",
"line",
".",
"length",
"(",
")",
"&&",
"Character",
".",
"... | Marks numbers position based on input.
<p>Assumes that a number starts at the specified position,
i.e. {@code Character.isDigit(line.charAt(startingPoint)) == true}
@param line Line where to handle number string
@param numberBitSet BitSet to use for position of number
@param startingPoint Start point
@r... | [
"Marks",
"numbers",
"position",
"based",
"on",
"input",
"."
] | train | https://github.com/julianhyde/sqlline/blob/7577f3ebaca0897a9ff01d1553d4576487e1d2c3/src/main/java/sqlline/SqlLineHighlighter.java#L399-L429 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract.java | Tesseract.createDocuments | @Override
public void createDocuments(String[] filenames, String[] outputbases, List<RenderedFormat> formats) throws TesseractException {
"""
Creates documents.
@param filenames array of input files
@param outputbases array of output filenames without extension
@param formats types of renderer
@throws T... | java | @Override
public void createDocuments(String[] filenames, String[] outputbases, List<RenderedFormat> formats) throws TesseractException {
if (filenames.length != outputbases.length) {
throw new RuntimeException("The two arrays must match in length.");
}
init();
se... | [
"@",
"Override",
"public",
"void",
"createDocuments",
"(",
"String",
"[",
"]",
"filenames",
",",
"String",
"[",
"]",
"outputbases",
",",
"List",
"<",
"RenderedFormat",
">",
"formats",
")",
"throws",
"TesseractException",
"{",
"if",
"(",
"filenames",
".",
"le... | Creates documents.
@param filenames array of input files
@param outputbases array of output filenames without extension
@param formats types of renderer
@throws TesseractException | [
"Creates",
"documents",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L612-L646 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.addMember | public Member addMember(Object projectIdOrPath, Integer userId, Integer accessLevel) throws GitLabApiException {
"""
Adds a user to a project team. This is an idempotent method and can be called multiple times
with the same parameters. Adding team membership to a user that is already a member does not
affect the... | java | public Member addMember(Object projectIdOrPath, Integer userId, Integer accessLevel) throws GitLabApiException {
return (addMember(projectIdOrPath, userId, accessLevel, null));
} | [
"public",
"Member",
"addMember",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"userId",
",",
"Integer",
"accessLevel",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"addMember",
"(",
"projectIdOrPath",
",",
"userId",
",",
"accessLevel",
",",
"null"... | Adds a user to a project team. This is an idempotent method and can be called multiple times
with the same parameters. Adding team membership to a user that is already a member does not
affect the existing membership.
<pre><code>POST /projects/:id/members</code></pre>
@param projectIdOrPath projectIdOrPath the projec... | [
"Adds",
"a",
"user",
"to",
"a",
"project",
"team",
".",
"This",
"is",
"an",
"idempotent",
"method",
"and",
"can",
"be",
"called",
"multiple",
"times",
"with",
"the",
"same",
"parameters",
".",
"Adding",
"team",
"membership",
"to",
"a",
"user",
"that",
"i... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L1261-L1263 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsFormRow.java | CmsFormRow.setInfo | public void setInfo(final String info, final boolean isHtml) {
"""
Shows the info icon and sets the information text as its title.<p>
@param info the info
@param isHtml true if info should be interpreted as HTML rather than plain text
"""
if (info != null) {
if (!CmsStringUtil.isEmptyO... | java | public void setInfo(final String info, final boolean isHtml) {
if (info != null) {
if (!CmsStringUtil.isEmptyOrWhitespaceOnly(info)) {
initInfoStyle();
final Data tooltipData = new CmsFieldTooltip.Data(m_icon, info, isHtml);
final Panel icon = m_icon;... | [
"public",
"void",
"setInfo",
"(",
"final",
"String",
"info",
",",
"final",
"boolean",
"isHtml",
")",
"{",
"if",
"(",
"info",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"info",
")",
")",
"{",
"initInfoSty... | Shows the info icon and sets the information text as its title.<p>
@param info the info
@param isHtml true if info should be interpreted as HTML rather than plain text | [
"Shows",
"the",
"info",
"icon",
"and",
"sets",
"the",
"information",
"text",
"as",
"its",
"title",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsFormRow.java#L247-L258 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java | InsertAllRequest.newBuilder | public static Builder newBuilder(TableInfo tableInfo, RowToInsert... rows) {
"""
Returns a builder for an {@code InsertAllRequest} object given the destination table and the
rows to insert.
"""
return newBuilder(tableInfo.getTableId(), rows);
} | java | public static Builder newBuilder(TableInfo tableInfo, RowToInsert... rows) {
return newBuilder(tableInfo.getTableId(), rows);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableInfo",
"tableInfo",
",",
"RowToInsert",
"...",
"rows",
")",
"{",
"return",
"newBuilder",
"(",
"tableInfo",
".",
"getTableId",
"(",
")",
",",
"rows",
")",
";",
"}"
] | Returns a builder for an {@code InsertAllRequest} object given the destination table and the
rows to insert. | [
"Returns",
"a",
"builder",
"for",
"an",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java#L388-L390 |
JodaOrg/joda-time | src/main/java/org/joda/time/Minutes.java | Minutes.minutesBetween | public static Minutes minutesBetween(ReadableInstant start, ReadableInstant end) {
"""
Creates a <code>Minutes</code> representing the number of whole minutes
between the two specified datetimes.
@param start the start instant, must not be null
@param end the end instant, must not be null
@return the perio... | java | public static Minutes minutesBetween(ReadableInstant start, ReadableInstant end) {
int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.minutes());
return Minutes.minutes(amount);
} | [
"public",
"static",
"Minutes",
"minutesBetween",
"(",
"ReadableInstant",
"start",
",",
"ReadableInstant",
"end",
")",
"{",
"int",
"amount",
"=",
"BaseSingleFieldPeriod",
".",
"between",
"(",
"start",
",",
"end",
",",
"DurationFieldType",
".",
"minutes",
"(",
")"... | Creates a <code>Minutes</code> representing the number of whole minutes
between the two specified datetimes.
@param start the start instant, must not be null
@param end the end instant, must not be null
@return the period in minutes
@throws IllegalArgumentException if the instants are null or invalid | [
"Creates",
"a",
"<code",
">",
"Minutes<",
"/",
"code",
">",
"representing",
"the",
"number",
"of",
"whole",
"minutes",
"between",
"the",
"two",
"specified",
"datetimes",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Minutes.java#L100-L103 |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/AbstractSecureRedirectStrategy.java | AbstractSecureRedirectStrategy.makeInsecure | @Override
public void makeInsecure(HttpServletRequest request, HttpServletResponse response) throws IOException {
"""
Sends a moved perminately redirect to the insecure form of the request URL.
@request the request to make secure.
@response the response for the request.
"""
response.setStatus(HttpSer... | java | @Override
public void makeInsecure(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
response.setHeader("Location", insecureUrl(request, response));
response.getOutputStream().flush();
response.getOutputStream()... | [
"@",
"Override",
"public",
"void",
"makeInsecure",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"response",
".",
"setStatus",
"(",
"HttpServletResponse",
".",
"SC_MOVED_PERMANENTLY",
")",
";",
"respon... | Sends a moved perminately redirect to the insecure form of the request URL.
@request the request to make secure.
@response the response for the request. | [
"Sends",
"a",
"moved",
"perminately",
"redirect",
"to",
"the",
"insecure",
"form",
"of",
"the",
"request",
"URL",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/AbstractSecureRedirectStrategy.java#L170-L176 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.div | public static BigDecimal div(Number v1, Number v2, int scale) {
"""
提供(相对)精确的除法运算,当发生除不尽的情况时,由scale指定精确度,后面的四舍五入
@param v1 被除数
@param v2 除数
@param scale 精确度,如果为负值,取绝对值
@return 两个参数的商
@since 3.1.0
"""
return div(v1, v2, scale, RoundingMode.HALF_UP);
} | java | public static BigDecimal div(Number v1, Number v2, int scale) {
return div(v1, v2, scale, RoundingMode.HALF_UP);
} | [
"public",
"static",
"BigDecimal",
"div",
"(",
"Number",
"v1",
",",
"Number",
"v2",
",",
"int",
"scale",
")",
"{",
"return",
"div",
"(",
"v1",
",",
"v2",
",",
"scale",
",",
"RoundingMode",
".",
"HALF_UP",
")",
";",
"}"
] | 提供(相对)精确的除法运算,当发生除不尽的情况时,由scale指定精确度,后面的四舍五入
@param v1 被除数
@param v2 除数
@param scale 精确度,如果为负值,取绝对值
@return 两个参数的商
@since 3.1.0 | [
"提供",
"(",
"相对",
")",
"精确的除法运算",
"当发生除不尽的情况时",
"由scale指定精确度",
"后面的四舍五入"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L623-L625 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/YearQuarter.java | YearQuarter.plusYears | public YearQuarter plusYears(long yearsToAdd) {
"""
Returns a copy of this year-quarter with the specified period in years added.
<p>
This instance is immutable and unaffected by this method call.
@param yearsToAdd the years to add, may be negative
@return a {@code YearQuarter} based on this year-quarter wi... | java | public YearQuarter plusYears(long yearsToAdd) {
if (yearsToAdd == 0) {
return this;
}
int newYear = YEAR.checkValidIntValue(year + yearsToAdd); // safe overflow
return with(newYear, quarter);
} | [
"public",
"YearQuarter",
"plusYears",
"(",
"long",
"yearsToAdd",
")",
"{",
"if",
"(",
"yearsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"newYear",
"=",
"YEAR",
".",
"checkValidIntValue",
"(",
"year",
"+",
"yearsToAdd",
")",
";",
"// s... | Returns a copy of this year-quarter with the specified period in years added.
<p>
This instance is immutable and unaffected by this method call.
@param yearsToAdd the years to add, may be negative
@return a {@code YearQuarter} based on this year-quarter with the years added, not null
@throws DateTimeException if the ... | [
"Returns",
"a",
"copy",
"of",
"this",
"year",
"-",
"quarter",
"with",
"the",
"specified",
"period",
"in",
"years",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/YearQuarter.java#L848-L854 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/content/CmsElementRename.java | CmsElementRename.isEmptyElement | private boolean isEmptyElement(CmsXmlPage page, String element, Locale locale) {
"""
Checks if the specified element/locale of the given page has a content.<p>
@param page the xml page
@param element the element name
@param locale the locale
@return false if the specified element/locale of the given page has... | java | private boolean isEmptyElement(CmsXmlPage page, String element, Locale locale) {
CmsXmlHtmlValue xmlHtmlValue = (CmsXmlHtmlValue)page.getValue(element, locale);
if (CmsStringUtil.isNotEmpty(xmlHtmlValue.getPlainText(getCms()))) {
return false;
}
return true;
} | [
"private",
"boolean",
"isEmptyElement",
"(",
"CmsXmlPage",
"page",
",",
"String",
"element",
",",
"Locale",
"locale",
")",
"{",
"CmsXmlHtmlValue",
"xmlHtmlValue",
"=",
"(",
"CmsXmlHtmlValue",
")",
"page",
".",
"getValue",
"(",
"element",
",",
"locale",
")",
";... | Checks if the specified element/locale of the given page has a content.<p>
@param page the xml page
@param element the element name
@param locale the locale
@return false if the specified element/locale of the given page has a content; otherwise true | [
"Checks",
"if",
"the",
"specified",
"element",
"/",
"locale",
"of",
"the",
"given",
"page",
"has",
"a",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/content/CmsElementRename.java#L724-L732 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/update/version/Application.java | Application.getApplicationFromSource | public static Application getApplicationFromSource(final File _versionFile,
final List<String> _classpathElements,
final File _eFapsDir,
final File _output... | java | public static Application getApplicationFromSource(final File _versionFile,
final List<String> _classpathElements,
final File _eFapsDir,
final File _output... | [
"public",
"static",
"Application",
"getApplicationFromSource",
"(",
"final",
"File",
"_versionFile",
",",
"final",
"List",
"<",
"String",
">",
"_classpathElements",
",",
"final",
"File",
"_eFapsDir",
",",
"final",
"File",
"_outputDir",
",",
"final",
"List",
"<",
... | Returns the application definition read from a source directory.
@param _versionFile version file which defines the application
@param _classpathElements class path elements (required to compile)
@param _eFapsDir root directory with the XML installation
files
@param _outputDir direct... | [
"Returns",
"the",
"application",
"definition",
"read",
"from",
"a",
"source",
"directory",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/update/version/Application.java#L285-L323 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/QuickSelectDBIDs.java | QuickSelectDBIDs.insertionSort | private static void insertionSort(ModifiableDoubleDBIDList data, int start, int end, DoubleDBIDListIter iter1, DoubleDBIDListIter iter2) {
"""
Sort a small array using repetitive insertion sort.
@param data Data to sort
@param start Interval start
@param end Interval end
"""
for(int i = start + 1; i <... | java | private static void insertionSort(ModifiableDoubleDBIDList data, int start, int end, DoubleDBIDListIter iter1, DoubleDBIDListIter iter2) {
for(int i = start + 1; i < end; i++) {
for(int j = i; j > start; j--) {
if(iter1.seek(j - 1).doubleValue() < iter2.seek(j).doubleValue()) {
break;
... | [
"private",
"static",
"void",
"insertionSort",
"(",
"ModifiableDoubleDBIDList",
"data",
",",
"int",
"start",
",",
"int",
"end",
",",
"DoubleDBIDListIter",
"iter1",
",",
"DoubleDBIDListIter",
"iter2",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
"+",
"1",
"... | Sort a small array using repetitive insertion sort.
@param data Data to sort
@param start Interval start
@param end Interval end | [
"Sort",
"a",
"small",
"array",
"using",
"repetitive",
"insertion",
"sort",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/QuickSelectDBIDs.java#L488-L497 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/Security.java | Security.getSpiClass | private static Class getSpiClass(String type) {
"""
Return the Class object for the given engine type
(e.g. "MessageDigest"). Works for Spis in the java.security package
only.
"""
Class clazz = spiMap.get(type);
if (clazz != null) {
return clazz;
}
try {
... | java | private static Class getSpiClass(String type) {
Class clazz = spiMap.get(type);
if (clazz != null) {
return clazz;
}
try {
clazz = Class.forName("java.security." + type + "Spi");
spiMap.put(type, clazz);
return clazz;
} catch (Class... | [
"private",
"static",
"Class",
"getSpiClass",
"(",
"String",
"type",
")",
"{",
"Class",
"clazz",
"=",
"spiMap",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"clazz",
"!=",
"null",
")",
"{",
"return",
"clazz",
";",
"}",
"try",
"{",
"clazz",
"=",
"Cl... | Return the Class object for the given engine type
(e.g. "MessageDigest"). Works for Spis in the java.security package
only. | [
"Return",
"the",
"Class",
"object",
"for",
"the",
"given",
"engine",
"type",
"(",
"e",
".",
"g",
".",
"MessageDigest",
")",
".",
"Works",
"for",
"Spis",
"in",
"the",
"java",
".",
"security",
"package",
"only",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/Security.java#L548-L560 |
kopihao/peasy-recyclerview | peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyRecyclerView.java | PeasyRecyclerView.enhanceFAB | private void enhanceFAB(final FloatingActionButton fab, int dx, int dy) {
"""
Enhanced FAB UX Logic
Handle RecyclerView scrolling
@param fab FloatingActionButton
@param dx scrolling dx
@param dy scrolling dy
"""
if (isEnhancedFAB() && getFab() != null) {
final FloatingActionButton m... | java | private void enhanceFAB(final FloatingActionButton fab, int dx, int dy) {
if (isEnhancedFAB() && getFab() != null) {
final FloatingActionButton mFloatingActionButton = this.fab;
if (getLinearLayoutManager() != null) {
if (dy > 0) {
if (mFloatingActionB... | [
"private",
"void",
"enhanceFAB",
"(",
"final",
"FloatingActionButton",
"fab",
",",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"if",
"(",
"isEnhancedFAB",
"(",
")",
"&&",
"getFab",
"(",
")",
"!=",
"null",
")",
"{",
"final",
"FloatingActionButton",
"mFloatingA... | Enhanced FAB UX Logic
Handle RecyclerView scrolling
@param fab FloatingActionButton
@param dx scrolling dx
@param dy scrolling dy | [
"Enhanced",
"FAB",
"UX",
"Logic",
"Handle",
"RecyclerView",
"scrolling"
] | train | https://github.com/kopihao/peasy-recyclerview/blob/a26071849e5d5b5b1febe685f205558b49908f87/peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyRecyclerView.java#L218-L233 |
arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java | KuberntesServiceUrlResourceProvider.getScheme | private static String getScheme(Service service, Annotation... qualifiers) {
"""
Find the scheme to use to connect to the service.
Uses java annotations first and if not found, uses kubernetes annotations on the service object.
@param service
The target service.
@param qualifiers
The set of qualifiers.
@... | java | private static String getScheme(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Scheme) {
return ((Scheme) q).value();
}
}
if (service.getMetadata() != null && service.getMetadata().getAnnotations() != null)... | [
"private",
"static",
"String",
"getScheme",
"(",
"Service",
"service",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"for",
"(",
"Annotation",
"q",
":",
"qualifiers",
")",
"{",
"if",
"(",
"q",
"instanceof",
"Scheme",
")",
"{",
"return",
"(",
"(",
"Sc... | Find the scheme to use to connect to the service.
Uses java annotations first and if not found, uses kubernetes annotations on the service object.
@param service
The target service.
@param qualifiers
The set of qualifiers.
@return Returns the resolved scheme of 'http' as a fallback. | [
"Find",
"the",
"scheme",
"to",
"use",
"to",
"connect",
"to",
"the",
"service",
".",
"Uses",
"java",
"annotations",
"first",
"and",
"if",
"not",
"found",
"uses",
"kubernetes",
"annotations",
"on",
"the",
"service",
"object",
"."
] | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L184-L199 |
forge/core | resources/api/src/main/java/org/jboss/forge/addon/resource/util/ResourceUtil.java | ResourceUtil.getDigest | public static byte[] getDigest(Resource<?> resource, MessageDigest digest) {
"""
Returns the {@link Byte} array message digest of {@link #getResourceInputStream()} using the given
{@link MessageDigest}.
"""
try (InputStream stream = resource.getResourceInputStream();
DigestInputStream dig... | java | public static byte[] getDigest(Resource<?> resource, MessageDigest digest)
{
try (InputStream stream = resource.getResourceInputStream();
DigestInputStream digestStream = new DigestInputStream(stream, digest))
{
byte[] buffer = new byte[16384];
while (digestStream.read(bu... | [
"public",
"static",
"byte",
"[",
"]",
"getDigest",
"(",
"Resource",
"<",
"?",
">",
"resource",
",",
"MessageDigest",
"digest",
")",
"{",
"try",
"(",
"InputStream",
"stream",
"=",
"resource",
".",
"getResourceInputStream",
"(",
")",
";",
"DigestInputStream",
... | Returns the {@link Byte} array message digest of {@link #getResourceInputStream()} using the given
{@link MessageDigest}. | [
"Returns",
"the",
"{"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/resources/api/src/main/java/org/jboss/forge/addon/resource/util/ResourceUtil.java#L55-L71 |
eclipse/xtext-core | org.eclipse.xtext/xtend-gen/org/eclipse/xtext/generator/trace/node/GeneratorNodeExtensions.java | GeneratorNodeExtensions.appendTemplate | public CompositeGeneratorNode appendTemplate(final CompositeGeneratorNode parent, final StringConcatenationClient templateString) {
"""
Creates a template node for the given templateString and appends it to the given parent node.
Templates are translated to generator node trees and expressions in templates can ... | java | public CompositeGeneratorNode appendTemplate(final CompositeGeneratorNode parent, final StringConcatenationClient templateString) {
final TemplateNode proc = new TemplateNode(templateString, this);
List<IGeneratorNode> _children = parent.getChildren();
_children.add(proc);
return parent;
} | [
"public",
"CompositeGeneratorNode",
"appendTemplate",
"(",
"final",
"CompositeGeneratorNode",
"parent",
",",
"final",
"StringConcatenationClient",
"templateString",
")",
"{",
"final",
"TemplateNode",
"proc",
"=",
"new",
"TemplateNode",
"(",
"templateString",
",",
"this",
... | Creates a template node for the given templateString and appends it to the given parent node.
Templates are translated to generator node trees and expressions in templates can be of type IGeneratorNode.
@return the given parent node | [
"Creates",
"a",
"template",
"node",
"for",
"the",
"given",
"templateString",
"and",
"appends",
"it",
"to",
"the",
"given",
"parent",
"node",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/xtend-gen/org/eclipse/xtext/generator/trace/node/GeneratorNodeExtensions.java#L161-L166 |
Bedework/bw-util | bw-util-struts/src/main/java/org/bedework/util/struts/UtilAbstractAction.java | UtilAbstractAction.getReqPar | protected String getReqPar(final HttpServletRequest req, final String name) throws Throwable {
"""
Get a request parameter stripped of white space. Return null for zero
length.
@param req
@param name name of parameter
@return String value
@throws Throwable
"""
return Util.checkNull(req.getPara... | java | protected String getReqPar(final HttpServletRequest req, final String name) throws Throwable {
return Util.checkNull(req.getParameter(name));
} | [
"protected",
"String",
"getReqPar",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"String",
"name",
")",
"throws",
"Throwable",
"{",
"return",
"Util",
".",
"checkNull",
"(",
"req",
".",
"getParameter",
"(",
"name",
")",
")",
";",
"}"
] | Get a request parameter stripped of white space. Return null for zero
length.
@param req
@param name name of parameter
@return String value
@throws Throwable | [
"Get",
"a",
"request",
"parameter",
"stripped",
"of",
"white",
"space",
".",
"Return",
"null",
"for",
"zero",
"length",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-struts/src/main/java/org/bedework/util/struts/UtilAbstractAction.java#L981-L983 |
mojohaus/webstart | webstart-jnlp-servlet/src/main/java/jnlp/sample/servlet/JnlpDownloadServlet.java | JnlpDownloadServlet.constructResponse | private DownloadResponse constructResponse( JnlpResource jnlpres, DownloadRequest dreq )
throws IOException {
"""
Given a DownloadPath and a DownloadRequest, it constructs the data stream to return
to the requester
"""
String path = jnlpres.getPath();
if ( jnlpres.isJnlpFile() )
... | java | private DownloadResponse constructResponse( JnlpResource jnlpres, DownloadRequest dreq )
throws IOException
{
String path = jnlpres.getPath();
if ( jnlpres.isJnlpFile() )
{
// It is a JNLP file. It need to be macro-expanded, so it is handled differently
bo... | [
"private",
"DownloadResponse",
"constructResponse",
"(",
"JnlpResource",
"jnlpres",
",",
"DownloadRequest",
"dreq",
")",
"throws",
"IOException",
"{",
"String",
"path",
"=",
"jnlpres",
".",
"getPath",
"(",
")",
";",
"if",
"(",
"jnlpres",
".",
"isJnlpFile",
"(",
... | Given a DownloadPath and a DownloadRequest, it constructs the data stream to return
to the requester | [
"Given",
"a",
"DownloadPath",
"and",
"a",
"DownloadRequest",
"it",
"constructs",
"the",
"data",
"stream",
"to",
"return",
"to",
"the",
"requester"
] | train | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-jnlp-servlet/src/main/java/jnlp/sample/servlet/JnlpDownloadServlet.java#L303-L346 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java | ApplicationSession.setSessionAttribute | public void setSessionAttribute(String key, Object newValue) {
"""
Add a key/value pair to the session attributes map.
@param key
a unique string code.
@param newValue
the associated value.
"""
Object oldValue = sessionAttributes.put(key, newValue);
propertyChangeSupport.firePropertyChang... | java | public void setSessionAttribute(String key, Object newValue)
{
Object oldValue = sessionAttributes.put(key, newValue);
propertyChangeSupport.firePropertyChange(key, oldValue, newValue);
propertyChangeSupport.firePropertyChange(SESSION_ATTRIBUTES, null, sessionAttributes);
} | [
"public",
"void",
"setSessionAttribute",
"(",
"String",
"key",
",",
"Object",
"newValue",
")",
"{",
"Object",
"oldValue",
"=",
"sessionAttributes",
".",
"put",
"(",
"key",
",",
"newValue",
")",
";",
"propertyChangeSupport",
".",
"firePropertyChange",
"(",
"key",... | Add a key/value pair to the session attributes map.
@param key
a unique string code.
@param newValue
the associated value. | [
"Add",
"a",
"key",
"/",
"value",
"pair",
"to",
"the",
"session",
"attributes",
"map",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L280-L285 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/MSTSplit.java | MSTSplit.coverRadius | private static double coverRadius(double[][] matrix, int[] idx, int i) {
"""
Find the cover radius of a partition.
@param matrix Distance matrix
@param idx Partition keys
@param i Candidate index
@return max(d(i,j)) for all j with the same index
"""
final int idx_i = idx[i];
final double[] row_i ... | java | private static double coverRadius(double[][] matrix, int[] idx, int i) {
final int idx_i = idx[i];
final double[] row_i = matrix[i];
double m = 0;
for(int j = 0; j < row_i.length; j++) {
if(i != j && idx_i == idx[j]) {
final double d = row_i[j];
m = d > m ? d : m;
}
}
... | [
"private",
"static",
"double",
"coverRadius",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"[",
"]",
"idx",
",",
"int",
"i",
")",
"{",
"final",
"int",
"idx_i",
"=",
"idx",
"[",
"i",
"]",
";",
"final",
"double",
"[",
"]",
"row_i",
"=",... | Find the cover radius of a partition.
@param matrix Distance matrix
@param idx Partition keys
@param i Candidate index
@return max(d(i,j)) for all j with the same index | [
"Find",
"the",
"cover",
"radius",
"of",
"a",
"partition",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/MSTSplit.java#L108-L119 |
apache/incubator-shardingsphere | sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtil.java | QueryResultUtil.getValueByColumnType | public static Object getValueByColumnType(final ResultSet resultSet, final int columnIndex) throws SQLException {
"""
Get value by column type.
@param resultSet result set
@param columnIndex column index
@return column value
@throws SQLException SQL exception
"""
ResultSetMetaData metaData = resu... | java | public static Object getValueByColumnType(final ResultSet resultSet, final int columnIndex) throws SQLException {
ResultSetMetaData metaData = resultSet.getMetaData();
switch (metaData.getColumnType(columnIndex)) {
case Types.BIT:
case Types.BOOLEAN:
return result... | [
"public",
"static",
"Object",
"getValueByColumnType",
"(",
"final",
"ResultSet",
"resultSet",
",",
"final",
"int",
"columnIndex",
")",
"throws",
"SQLException",
"{",
"ResultSetMetaData",
"metaData",
"=",
"resultSet",
".",
"getMetaData",
"(",
")",
";",
"switch",
"(... | Get value by column type.
@param resultSet result set
@param columnIndex column index
@return column value
@throws SQLException SQL exception | [
"Get",
"value",
"by",
"column",
"type",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtil.java#L53-L94 |
zaproxy/zaproxy | src/org/zaproxy/zap/control/AddOn.java | AddOn.getAddOn | private static AddOn getAddOn(Collection<AddOn> addOns, String id) {
"""
Gets the add-on with the given {@code id} from the given collection of {@code addOns}.
@param addOns the collection of add-ons where the search will be made
@param id the id of the add-on to search for
@return the {@code AddOn} with the ... | java | private static AddOn getAddOn(Collection<AddOn> addOns, String id) {
for (AddOn addOn : addOns) {
if (addOn.getId().equals(id)) {
return addOn;
}
}
return null;
} | [
"private",
"static",
"AddOn",
"getAddOn",
"(",
"Collection",
"<",
"AddOn",
">",
"addOns",
",",
"String",
"id",
")",
"{",
"for",
"(",
"AddOn",
"addOn",
":",
"addOns",
")",
"{",
"if",
"(",
"addOn",
".",
"getId",
"(",
")",
".",
"equals",
"(",
"id",
")... | Gets the add-on with the given {@code id} from the given collection of {@code addOns}.
@param addOns the collection of add-ons where the search will be made
@param id the id of the add-on to search for
@return the {@code AddOn} with the given id, or {@code null} if not found | [
"Gets",
"the",
"add",
"-",
"on",
"with",
"the",
"given",
"{",
"@code",
"id",
"}",
"from",
"the",
"given",
"collection",
"of",
"{",
"@code",
"addOns",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/control/AddOn.java#L1472-L1479 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/matching/DictionaryMatcher.java | DictionaryMatcher.replaceAtIndex | private static void replaceAtIndex(final TreeMap<Integer, Character[]> replacements, Integer current_index, final char[] password, final List<String> final_passwords) {
"""
Internal function to recursively build the list of un-leet possibilities.
@param replacements TreeMap of replacement index, and the poss... | java | private static void replaceAtIndex(final TreeMap<Integer, Character[]> replacements, Integer current_index, final char[] password, final List<String> final_passwords)
{
for (final char replacement : replacements.get(current_index))
{
password[current_index] = replacement;
if ... | [
"private",
"static",
"void",
"replaceAtIndex",
"(",
"final",
"TreeMap",
"<",
"Integer",
",",
"Character",
"[",
"]",
">",
"replacements",
",",
"Integer",
"current_index",
",",
"final",
"char",
"[",
"]",
"password",
",",
"final",
"List",
"<",
"String",
">",
... | Internal function to recursively build the list of un-leet possibilities.
@param replacements TreeMap of replacement index, and the possible characters at that index to be replaced
@param current_index internal use for the function
@param password a Character array of the original password
@param final_pas... | [
"Internal",
"function",
"to",
"recursively",
"build",
"the",
"list",
"of",
"un",
"-",
"leet",
"possibilities",
"."
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/matching/DictionaryMatcher.java#L66-L85 |
mapbox/mapbox-events-android | libcore/src/main/java/com/mapbox/android/core/FileUtils.java | FileUtils.writeToFile | public static void writeToFile(@NonNull File file, @NonNull String content) throws IOException {
"""
Write to file.
@param file valid reference to the file.
@param content content to write to the file.
"""
OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
t... | java | public static void writeToFile(@NonNull File file, @NonNull String content) throws IOException {
OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
try {
writer.write(content);
writer.flush();
} catch (IOException ioe) {
Log.e(LOG_TAG, ioe.toString());... | [
"public",
"static",
"void",
"writeToFile",
"(",
"@",
"NonNull",
"File",
"file",
",",
"@",
"NonNull",
"String",
"content",
")",
"throws",
"IOException",
"{",
"OutputStreamWriter",
"writer",
"=",
"new",
"OutputStreamWriter",
"(",
"new",
"FileOutputStream",
"(",
"f... | Write to file.
@param file valid reference to the file.
@param content content to write to the file. | [
"Write",
"to",
"file",
"."
] | train | https://github.com/mapbox/mapbox-events-android/blob/5b5ca7e04cb8fab31a8dc040b6e7521f930a58a4/libcore/src/main/java/com/mapbox/android/core/FileUtils.java#L77-L91 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/StatementUtil.java | StatementUtil.prepareStatement | public static PreparedStatement prepareStatement(Connection conn, String sql, Object... params) throws SQLException {
"""
创建{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param params "?"对应参数列表
@return {@link PreparedStatement}
@throws SQLException SQL异常
@since 3.2.3
"""
As... | java | public static PreparedStatement prepareStatement(Connection conn, String sql, Object... params) throws SQLException {
Assert.notBlank(sql, "Sql String must be not blank!");
sql = sql.trim();
SqlLog.INSTASNCE.log(sql, params);
PreparedStatement ps;
if (StrUtil.startWithIgnoreCase(sql, "insert")) {
/... | [
"public",
"static",
"PreparedStatement",
"prepareStatement",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"Assert",
".",
"notBlank",
"(",
"sql",
",",
"\"Sql String must be not blank!\"",
")",
... | 创建{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param params "?"对应参数列表
@return {@link PreparedStatement}
@throws SQLException SQL异常
@since 3.2.3 | [
"创建",
"{",
"@link",
"PreparedStatement",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/StatementUtil.java#L138-L151 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/OptionsApi.java | OptionsApi.getOptions | public Options getOptions(String personDBID, String agentGroupDBID) throws ProvisioningApiException {
"""
Get options.
Get options for a specified application and merge them with the person and agent group annexes.
@param personDBID The DBID of a person. Options are merged with the person's annex and t... | java | public Options getOptions(String personDBID, String agentGroupDBID) throws ProvisioningApiException {
try {
OptionsGetResponseSuccess resp = optionsApi.optionsGet(
personDBID,
agentGroupDBID
);
if (!resp.getStatus().getCode().eq... | [
"public",
"Options",
"getOptions",
"(",
"String",
"personDBID",
",",
"String",
"agentGroupDBID",
")",
"throws",
"ProvisioningApiException",
"{",
"try",
"{",
"OptionsGetResponseSuccess",
"resp",
"=",
"optionsApi",
".",
"optionsGet",
"(",
"personDBID",
",",
"agentGroupD... | Get options.
Get options for a specified application and merge them with the person and agent group annexes.
@param personDBID The DBID of a person. Options are merged with the person's annex and the annexes of the person's agent groups. Mutual with agent_group_dbid. (optional)
@param agentGroupDBID The D... | [
"Get",
"options",
".",
"Get",
"options",
"for",
"a",
"specified",
"application",
"and",
"merge",
"them",
"with",
"the",
"person",
"and",
"agent",
"group",
"annexes",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/OptionsApi.java#L31-L52 |
aws/aws-sdk-java | aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/Input.java | Input.withAudioSelectorGroups | public Input withAudioSelectorGroups(java.util.Map<String, AudioSelectorGroup> audioSelectorGroups) {
"""
Specifies set of audio selectors within an input to combine. An input may have multiple audio selector groups.
See "Audio Selector Group":#inputs-audio_selector_group for more information.
@param audioSele... | java | public Input withAudioSelectorGroups(java.util.Map<String, AudioSelectorGroup> audioSelectorGroups) {
setAudioSelectorGroups(audioSelectorGroups);
return this;
} | [
"public",
"Input",
"withAudioSelectorGroups",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AudioSelectorGroup",
">",
"audioSelectorGroups",
")",
"{",
"setAudioSelectorGroups",
"(",
"audioSelectorGroups",
")",
";",
"return",
"this",
";",
"}"
] | Specifies set of audio selectors within an input to combine. An input may have multiple audio selector groups.
See "Audio Selector Group":#inputs-audio_selector_group for more information.
@param audioSelectorGroups
Specifies set of audio selectors within an input to combine. An input may have multiple audio selector
... | [
"Specifies",
"set",
"of",
"audio",
"selectors",
"within",
"an",
"input",
"to",
"combine",
".",
"An",
"input",
"may",
"have",
"multiple",
"audio",
"selector",
"groups",
".",
"See",
"Audio",
"Selector",
"Group",
":",
"#inputs",
"-",
"audio_selector_group",
"for"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/Input.java#L158-L161 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.charsToString | public String charsToString() {
"""
Returns a {@link String} consisting of chars from this stream.
<p>
This is a terminal operation.
<p>
During string creation stream elements are converted to chars using
{@code (char)} cast operation.
@return a new {@code String}
@since 0.2.1
"""
return c... | java | public String charsToString() {
return collect(StringBuilder::new, (sb, c) -> sb.append((char) c), StringBuilder::append).toString();
} | [
"public",
"String",
"charsToString",
"(",
")",
"{",
"return",
"collect",
"(",
"StringBuilder",
"::",
"new",
",",
"(",
"sb",
",",
"c",
")",
"->",
"sb",
".",
"append",
"(",
"(",
"char",
")",
"c",
")",
",",
"StringBuilder",
"::",
"append",
")",
".",
"... | Returns a {@link String} consisting of chars from this stream.
<p>
This is a terminal operation.
<p>
During string creation stream elements are converted to chars using
{@code (char)} cast operation.
@return a new {@code String}
@since 0.2.1 | [
"Returns",
"a",
"{",
"@link",
"String",
"}",
"consisting",
"of",
"chars",
"from",
"this",
"stream",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L1537-L1539 |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/asserts/SeLionAsserts.java | SeLionAsserts.verifyNotEquals | public static void verifyNotEquals(Object actual, Object expected, String msg) {
"""
verifyNotEquals method is used to assert based on actual and expected values and provide a Pass result for a
mismatch and continue to run the test.
@param actual
- Actual value obtained from executing a test
@param expected
... | java | public static void verifyNotEquals(Object actual, Object expected, String msg) {
getSoftAssertInContext().assertNotEquals(actual, expected, msg);
} | [
"public",
"static",
"void",
"verifyNotEquals",
"(",
"Object",
"actual",
",",
"Object",
"expected",
",",
"String",
"msg",
")",
"{",
"getSoftAssertInContext",
"(",
")",
".",
"assertNotEquals",
"(",
"actual",
",",
"expected",
",",
"msg",
")",
";",
"}"
] | verifyNotEquals method is used to assert based on actual and expected values and provide a Pass result for a
mismatch and continue to run the test.
@param actual
- Actual value obtained from executing a test
@param expected
- Expected value for the test to pass. <br>
@param msg
- A descriptive text narrating a validat... | [
"verifyNotEquals",
"method",
"is",
"used",
"to",
"assert",
"based",
"on",
"actual",
"and",
"expected",
"values",
"and",
"provide",
"a",
"Pass",
"result",
"for",
"a",
"mismatch",
"and",
"continue",
"to",
"run",
"the",
"test",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/asserts/SeLionAsserts.java#L308-L310 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/spillover/spilloverpolicy_stats.java | spilloverpolicy_stats.get | public static spilloverpolicy_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of spilloverpolicy_stats resource of given name .
"""
spilloverpolicy_stats obj = new spilloverpolicy_stats();
obj.set_name(name);
spilloverpolicy_stats response = (spillove... | java | public static spilloverpolicy_stats get(nitro_service service, String name) throws Exception{
spilloverpolicy_stats obj = new spilloverpolicy_stats();
obj.set_name(name);
spilloverpolicy_stats response = (spilloverpolicy_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"spilloverpolicy_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"spilloverpolicy_stats",
"obj",
"=",
"new",
"spilloverpolicy_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
... | Use this API to fetch statistics of spilloverpolicy_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"spilloverpolicy_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/spillover/spilloverpolicy_stats.java#L169-L174 |
Omertron/api-tvrage | src/main/java/com/omertron/tvrageapi/model/ShowInfo.java | ShowInfo.addNetwork | public void addNetwork(String country, String networkName) {
"""
Add a single network to the list
@param country
@param networkName
"""
if (!isValidString(country) || !isValidString(networkName)) {
return;
}
this.network.add(new CountryDetail(country, networkName));
... | java | public void addNetwork(String country, String networkName) {
if (!isValidString(country) || !isValidString(networkName)) {
return;
}
this.network.add(new CountryDetail(country, networkName));
} | [
"public",
"void",
"addNetwork",
"(",
"String",
"country",
",",
"String",
"networkName",
")",
"{",
"if",
"(",
"!",
"isValidString",
"(",
"country",
")",
"||",
"!",
"isValidString",
"(",
"networkName",
")",
")",
"{",
"return",
";",
"}",
"this",
".",
"netwo... | Add a single network to the list
@param country
@param networkName | [
"Add",
"a",
"single",
"network",
"to",
"the",
"list"
] | train | https://github.com/Omertron/api-tvrage/blob/4e805a99de812fabea69d97098f2376be14d51bc/src/main/java/com/omertron/tvrageapi/model/ShowInfo.java#L130-L136 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/impl/flexi/FlexiBean.java | FlexiBean.getLong | public long getLong(String propertyName, long defaultValue) {
"""
Gets the value of the property as a {@code long} using a default value.
@param propertyName the property name, not empty
@param defaultValue the default value for null or invalid property
@return the value of the property
@throws ClassCastEx... | java | public long getLong(String propertyName, long defaultValue) {
Object obj = get(propertyName);
return obj != null ? ((Number) get(propertyName)).longValue() : defaultValue;
} | [
"public",
"long",
"getLong",
"(",
"String",
"propertyName",
",",
"long",
"defaultValue",
")",
"{",
"Object",
"obj",
"=",
"get",
"(",
"propertyName",
")",
";",
"return",
"obj",
"!=",
"null",
"?",
"(",
"(",
"Number",
")",
"get",
"(",
"propertyName",
")",
... | Gets the value of the property as a {@code long} using a default value.
@param propertyName the property name, not empty
@param defaultValue the default value for null or invalid property
@return the value of the property
@throws ClassCastException if the value is not compatible | [
"Gets",
"the",
"value",
"of",
"the",
"property",
"as",
"a",
"{",
"@code",
"long",
"}",
"using",
"a",
"default",
"value",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/flexi/FlexiBean.java#L222-L225 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createGroup | public GitlabGroup createGroup(CreateGroupRequest request, GitlabUser sudoUser) throws IOException {
"""
Creates a Group
@param request An object that represents the parameters for the request.
@param sudoUser The user for whom we're creating the group
@return The GitLab Group
@throws IOException on gitlab ... | java | public GitlabGroup createGroup(CreateGroupRequest request, GitlabUser sudoUser) throws IOException {
Query query = request.toQuery();
query.appendIf(PARAM_SUDO, sudoUser != null ? sudoUser.getId() : null);
String tailUrl = GitlabGroup.URL + query.toString();
return dispatch().to(tailUr... | [
"public",
"GitlabGroup",
"createGroup",
"(",
"CreateGroupRequest",
"request",
",",
"GitlabUser",
"sudoUser",
")",
"throws",
"IOException",
"{",
"Query",
"query",
"=",
"request",
".",
"toQuery",
"(",
")",
";",
"query",
".",
"appendIf",
"(",
"PARAM_SUDO",
",",
"... | Creates a Group
@param request An object that represents the parameters for the request.
@param sudoUser The user for whom we're creating the group
@return The GitLab Group
@throws IOException on gitlab api call error | [
"Creates",
"a",
"Group"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L600-L607 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/BaseAsset.java | BaseAsset.createAttachment | public Attachment createAttachment(String name, String fileName, InputStream stream)
throws AttachmentLengthExceededException, ApplicationUnavailableException {
"""
Create an attachment that belongs to this asset.
@param name The name of the attachment.
@param fileName The name of the original ... | java | public Attachment createAttachment(String name, String fileName, InputStream stream)
throws AttachmentLengthExceededException, ApplicationUnavailableException {
return getInstance().create().attachment(name, this, fileName, stream);
} | [
"public",
"Attachment",
"createAttachment",
"(",
"String",
"name",
",",
"String",
"fileName",
",",
"InputStream",
"stream",
")",
"throws",
"AttachmentLengthExceededException",
",",
"ApplicationUnavailableException",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",... | Create an attachment that belongs to this asset.
@param name The name of the attachment.
@param fileName The name of the original attachment file.
@param stream The read-enabled stream that contains the attachment.
content to upload.
@return {@code Attachment} object with corresponding parameters.
@throws Attach... | [
"Create",
"an",
"attachment",
"that",
"belongs",
"to",
"this",
"asset",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/BaseAsset.java#L272-L275 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java | FileSystem.loadHadoopFsFactory | private static FileSystemFactory loadHadoopFsFactory() {
"""
Utility loader for the Hadoop file system factory.
We treat the Hadoop FS factory in a special way, because we use it as a catch
all for file systems schemes not supported directly in Flink.
<p>This method does a set of eager checks for availability... | java | private static FileSystemFactory loadHadoopFsFactory() {
final ClassLoader cl = FileSystem.class.getClassLoader();
// first, see if the Flink runtime classes are available
final Class<? extends FileSystemFactory> factoryClass;
try {
factoryClass = Class
.forName("org.apache.flink.runtime.fs.hdfs.Hadoop... | [
"private",
"static",
"FileSystemFactory",
"loadHadoopFsFactory",
"(",
")",
"{",
"final",
"ClassLoader",
"cl",
"=",
"FileSystem",
".",
"class",
".",
"getClassLoader",
"(",
")",
";",
"// first, see if the Flink runtime classes are available",
"final",
"Class",
"<",
"?",
... | Utility loader for the Hadoop file system factory.
We treat the Hadoop FS factory in a special way, because we use it as a catch
all for file systems schemes not supported directly in Flink.
<p>This method does a set of eager checks for availability of certain classes, to
be able to give better error messages. | [
"Utility",
"loader",
"for",
"the",
"Hadoop",
"file",
"system",
"factory",
".",
"We",
"treat",
"the",
"Hadoop",
"FS",
"factory",
"in",
"a",
"special",
"way",
"because",
"we",
"use",
"it",
"as",
"a",
"catch",
"all",
"for",
"file",
"systems",
"schemes",
"no... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java#L1038-L1077 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/AgentPoolsInner.java | AgentPoolsInner.listAsync | public Observable<Page<AgentPoolInner>> listAsync(final String resourceGroupName, final String managedClusterName) {
"""
Gets a list of agent pools in the specified managed cluster.
Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool.
@param resource... | java | public Observable<Page<AgentPoolInner>> listAsync(final String resourceGroupName, final String managedClusterName) {
return listWithServiceResponseAsync(resourceGroupName, managedClusterName)
.map(new Func1<ServiceResponse<Page<AgentPoolInner>>, Page<AgentPoolInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"AgentPoolInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"managedClusterName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"managedClu... | Gets a list of agent pools in the specified managed cluster.
Gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent pool.
@param resourceGroupName The name of the resource group.
@param managedClusterName The name of the managed cluster resource.
@throws IllegalArgu... | [
"Gets",
"a",
"list",
"of",
"agent",
"pools",
"in",
"the",
"specified",
"managed",
"cluster",
".",
"Gets",
"a",
"list",
"of",
"agent",
"pools",
"in",
"the",
"specified",
"managed",
"cluster",
".",
"The",
"operation",
"returns",
"properties",
"of",
"each",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/AgentPoolsInner.java#L146-L154 |
thorntail/thorntail | fractions/swagger/src/main/java/org/wildfly/swarm/swagger/runtime/SwaggerArchivePreparer.java | SwaggerArchivePreparer.extractAndAddPackageInfo | private static void extractAndAddPackageInfo(ClassInfo classInfo, Set<String> packages, IndexView indexView) {
"""
Extract the package information from the given {@code ClassInfo} object.
@param classInfo the class metadata.
@param packages the collection to which we need to add the package information.
"... | java | private static void extractAndAddPackageInfo(ClassInfo classInfo, Set<String> packages, IndexView indexView) {
if (classInfo == null) {
return;
}
// Check if we were given an abstract class / interface, in which case we need to check the IndexView to see if there
// is an im... | [
"private",
"static",
"void",
"extractAndAddPackageInfo",
"(",
"ClassInfo",
"classInfo",
",",
"Set",
"<",
"String",
">",
"packages",
",",
"IndexView",
"indexView",
")",
"{",
"if",
"(",
"classInfo",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// Check if we wer... | Extract the package information from the given {@code ClassInfo} object.
@param classInfo the class metadata.
@param packages the collection to which we need to add the package information. | [
"Extract",
"the",
"package",
"information",
"from",
"the",
"given",
"{",
"@code",
"ClassInfo",
"}",
"object",
"."
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/swagger/src/main/java/org/wildfly/swarm/swagger/runtime/SwaggerArchivePreparer.java#L291-L313 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.getInternalState | @SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, Class<T> fieldType) {
"""
Get the value of a field using reflection. This method will traverse the
super class hierarchy until the first field of type <tt>fieldType</tt> is
found. The value of this field will be returned.
@... | java | @SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, Class<T> fieldType) {
Field foundField = findFieldInHierarchy(object, new AssignableToFieldTypeMatcherStrategy(fieldType));
try {
return (T) foundField.get(object);
} catch (IllegalAccessException ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getInternalState",
"(",
"Object",
"object",
",",
"Class",
"<",
"T",
">",
"fieldType",
")",
"{",
"Field",
"foundField",
"=",
"findFieldInHierarchy",
"(",
"object",
",... | Get the value of a field using reflection. This method will traverse the
super class hierarchy until the first field of type <tt>fieldType</tt> is
found. The value of this field will be returned.
@param <T> the generic type
@param object the object to modify
@param fieldType the type of the field
@return the ... | [
"Get",
"the",
"value",
"of",
"a",
"field",
"using",
"reflection",
".",
"This",
"method",
"will",
"traverse",
"the",
"super",
"class",
"hierarchy",
"until",
"the",
"first",
"field",
"of",
"type",
"<tt",
">",
"fieldType<",
"/",
"tt",
">",
"is",
"found",
".... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L565-L573 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java | PatternsImpl.addPattern | public PatternRuleInfo addPattern(UUID appId, String versionId, PatternRuleCreateObject pattern) {
"""
Adds one pattern to the specified application.
@param appId The application ID.
@param versionId The version ID.
@param pattern The input pattern.
@throws IllegalArgumentException thrown if parameters fail ... | java | public PatternRuleInfo addPattern(UUID appId, String versionId, PatternRuleCreateObject pattern) {
return addPatternWithServiceResponseAsync(appId, versionId, pattern).toBlocking().single().body();
} | [
"public",
"PatternRuleInfo",
"addPattern",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"PatternRuleCreateObject",
"pattern",
")",
"{",
"return",
"addPatternWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"pattern",
")",
".",
"toBlocking",
... | Adds one pattern to the specified application.
@param appId The application ID.
@param versionId The version ID.
@param pattern The input pattern.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeExceptio... | [
"Adds",
"one",
"pattern",
"to",
"the",
"specified",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java#L114-L116 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/AbstractMicroNode.java | AbstractMicroNode.onInsertBefore | @OverrideOnDemand
protected void onInsertBefore (@Nonnull final AbstractMicroNode aChildNode, @Nonnull final IMicroNode aSuccessor) {
"""
Callback that is invoked once a child is to be inserted before another
child.
@param aChildNode
The new child node to be inserted.
@param aSuccessor
The node before whi... | java | @OverrideOnDemand
protected void onInsertBefore (@Nonnull final AbstractMicroNode aChildNode, @Nonnull final IMicroNode aSuccessor)
{
throw new MicroException ("Cannot insert children in class " + getClass ().getName ());
} | [
"@",
"OverrideOnDemand",
"protected",
"void",
"onInsertBefore",
"(",
"@",
"Nonnull",
"final",
"AbstractMicroNode",
"aChildNode",
",",
"@",
"Nonnull",
"final",
"IMicroNode",
"aSuccessor",
")",
"{",
"throw",
"new",
"MicroException",
"(",
"\"Cannot insert children in class... | Callback that is invoked once a child is to be inserted before another
child.
@param aChildNode
The new child node to be inserted.
@param aSuccessor
The node before which the new node will be inserted. | [
"Callback",
"that",
"is",
"invoked",
"once",
"a",
"child",
"is",
"to",
"be",
"inserted",
"before",
"another",
"child",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/AbstractMicroNode.java#L74-L78 |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java | UpdatePreferencesServlet.isTab | protected boolean isTab(IUserLayoutManager ulm, String folderId) throws PortalException {
"""
A folder is a tab if its parent element is the layout element
@param ulm User Layout Manager
@param folderId the folder in question
@return <code>true</code> if the folder is a tab, otherwise <code>false</code>
"... | java | protected boolean isTab(IUserLayoutManager ulm, String folderId) throws PortalException {
// we could be a bit more careful here and actually check the type
return ulm.getRootFolderId().equals(ulm.getParentId(folderId));
} | [
"protected",
"boolean",
"isTab",
"(",
"IUserLayoutManager",
"ulm",
",",
"String",
"folderId",
")",
"throws",
"PortalException",
"{",
"// we could be a bit more careful here and actually check the type",
"return",
"ulm",
".",
"getRootFolderId",
"(",
")",
".",
"equals",
"("... | A folder is a tab if its parent element is the layout element
@param ulm User Layout Manager
@param folderId the folder in question
@return <code>true</code> if the folder is a tab, otherwise <code>false</code> | [
"A",
"folder",
"is",
"a",
"tab",
"if",
"its",
"parent",
"element",
"is",
"the",
"layout",
"element"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java#L1401-L1404 |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.addCalendarException | public ProjectCalendarException addCalendarException(Date fromDate, Date toDate) {
"""
Used to add exceptions to the calendar. The MPX standard defines
a limit of 250 exceptions per calendar.
@param fromDate exception start date
@param toDate exception end date
@return ProjectCalendarException instance
"... | java | public ProjectCalendarException addCalendarException(Date fromDate, Date toDate)
{
ProjectCalendarException bce = new ProjectCalendarException(fromDate, toDate);
m_exceptions.add(bce);
m_expandedExceptions.clear();
m_exceptionsSorted = false;
clearWorkingDateCache();
return bce;
... | [
"public",
"ProjectCalendarException",
"addCalendarException",
"(",
"Date",
"fromDate",
",",
"Date",
"toDate",
")",
"{",
"ProjectCalendarException",
"bce",
"=",
"new",
"ProjectCalendarException",
"(",
"fromDate",
",",
"toDate",
")",
";",
"m_exceptions",
".",
"add",
"... | Used to add exceptions to the calendar. The MPX standard defines
a limit of 250 exceptions per calendar.
@param fromDate exception start date
@param toDate exception end date
@return ProjectCalendarException instance | [
"Used",
"to",
"add",
"exceptions",
"to",
"the",
"calendar",
".",
"The",
"MPX",
"standard",
"defines",
"a",
"limit",
"of",
"250",
"exceptions",
"per",
"calendar",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L185-L193 |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java | MavenImportUtils.restorePom | static void restorePom(IProject project, IProgressMonitor monitor) throws CoreException {
"""
Restore the original pom file.
@param project the project in which the pom file is located.
@param monitor the progress monitor.
@throws CoreException if the pom file cannot be changed.
"""
final IFile pomFile ... | java | static void restorePom(IProject project, IProgressMonitor monitor) throws CoreException {
final IFile pomFile = project.getFile(POM_FILE);
final IFile savedPomFile = project.getFile(POM_BACKUP_FILE);
pomFile.refreshLocal(IResource.DEPTH_ZERO, monitor);
savedPomFile.refreshLocal(IResource.DEPTH_ZERO, monitor);
... | [
"static",
"void",
"restorePom",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"final",
"IFile",
"pomFile",
"=",
"project",
".",
"getFile",
"(",
"POM_FILE",
")",
";",
"final",
"IFile",
"savedPomFile",
"=",
... | Restore the original pom file.
@param project the project in which the pom file is located.
@param monitor the progress monitor.
@throws CoreException 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#L218-L237 |
m-m-m/util | value/src/main/java/net/sf/mmm/util/value/api/ValueOutOfRangeException.java | ValueOutOfRangeException.checkRange | @Deprecated
public static void checkRange(Number value, Number minimum, Number maximum, Object valueSource)
throws ValueOutOfRangeException {
"""
This method checks that the given {@code value} is in the inclusive range from {@code minimum} to
{@code maximum}.
@param value is the value to check.
@para... | java | @Deprecated
public static void checkRange(Number value, Number minimum, Number maximum, Object valueSource)
throws ValueOutOfRangeException {
double d = value.doubleValue();
if ((d < minimum.doubleValue()) || (d > maximum.doubleValue())) {
if (valueSource == null) {
throw new ValueOutOfRa... | [
"@",
"Deprecated",
"public",
"static",
"void",
"checkRange",
"(",
"Number",
"value",
",",
"Number",
"minimum",
",",
"Number",
"maximum",
",",
"Object",
"valueSource",
")",
"throws",
"ValueOutOfRangeException",
"{",
"double",
"d",
"=",
"value",
".",
"doubleValue"... | This method checks that the given {@code value} is in the inclusive range from {@code minimum} to
{@code maximum}.
@param value is the value to check.
@param minimum is the minimum number allowed.
@param maximum is the maximum number allowed.
@param valueSource describes the source of the value. This may be the filena... | [
"This",
"method",
"checks",
"that",
"the",
"given",
"{",
"@code",
"value",
"}",
"is",
"in",
"the",
"inclusive",
"range",
"from",
"{",
"@code",
"minimum",
"}",
"to",
"{",
"@code",
"maximum",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/value/src/main/java/net/sf/mmm/util/value/api/ValueOutOfRangeException.java#L243-L255 |
ldapchai/ldapchai | src/main/java/com/novell/ldapchai/util/StringHelper.java | StringHelper.convertStrToInt | public static int convertStrToInt( final String string, final int defaultValue ) {
"""
Convert a string to an int value. If an error occurs during the conversion,
the default value is returned instead. Unlike the {@link Integer#parseInt(String)}
method, this method will not throw an exception.
@param string... | java | public static int convertStrToInt( final String string, final int defaultValue )
{
if ( string == null )
{
return defaultValue;
}
try
{
return Integer.parseInt( string );
}
catch ( Exception e )
{
return defaultValu... | [
"public",
"static",
"int",
"convertStrToInt",
"(",
"final",
"String",
"string",
",",
"final",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"try",
"{",
"return",
"Integer",
".",
"parseInt"... | Convert a string to an int value. If an error occurs during the conversion,
the default value is returned instead. Unlike the {@link Integer#parseInt(String)}
method, this method will not throw an exception.
@param string value to test
@param defaultValue value to return in case of difficulting converting.
@re... | [
"Convert",
"a",
"string",
"to",
"an",
"int",
"value",
".",
"If",
"an",
"error",
"occurs",
"during",
"the",
"conversion",
"the",
"default",
"value",
"is",
"returned",
"instead",
".",
"Unlike",
"the",
"{",
"@link",
"Integer#parseInt",
"(",
"String",
")",
"}"... | train | https://github.com/ldapchai/ldapchai/blob/a6d4b5dbfa4e270db0ce70892512cbe39e64b874/src/main/java/com/novell/ldapchai/util/StringHelper.java#L64-L79 |
Bedework/bw-util | bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java | XmlUtil.getAttrVal | public static String getAttrVal(final NamedNodeMap nnm, final String name) {
"""
Return the attribute value of the named attribute from the given map.
@param nnm NamedNodeMap
@param name String name of desired attribute
@return String attribute value or null
"""
Node nmAttr = nnm.ge... | java | public static String getAttrVal(final NamedNodeMap nnm, final String name) {
Node nmAttr = nnm.getNamedItem(name);
if ((nmAttr == null) || (absent(nmAttr.getNodeValue()))) {
return null;
}
return nmAttr.getNodeValue();
} | [
"public",
"static",
"String",
"getAttrVal",
"(",
"final",
"NamedNodeMap",
"nnm",
",",
"final",
"String",
"name",
")",
"{",
"Node",
"nmAttr",
"=",
"nnm",
".",
"getNamedItem",
"(",
"name",
")",
";",
"if",
"(",
"(",
"nmAttr",
"==",
"null",
")",
"||",
"(",... | Return the attribute value of the named attribute from the given map.
@param nnm NamedNodeMap
@param name String name of desired attribute
@return String attribute value or null | [
"Return",
"the",
"attribute",
"value",
"of",
"the",
"named",
"attribute",
"from",
"the",
"given",
"map",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java#L252-L260 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java | MarkerUtil.getMarkerFromEditor | public static IMarker getMarkerFromEditor(ITextSelection selection, IEditorPart editor) {
"""
Tries to retrieve right bug marker for given selection. If there are many
markers for given editor, and text selection doesn't match any of them,
return null. If there is only one marker for given editor, returns this
... | java | public static IMarker getMarkerFromEditor(ITextSelection selection, IEditorPart editor) {
IResource resource = (IResource) editor.getEditorInput().getAdapter(IFile.class);
IMarker[] allMarkers;
if (resource != null) {
allMarkers = getMarkers(resource, IResource.DEPTH_ZERO);
}... | [
"public",
"static",
"IMarker",
"getMarkerFromEditor",
"(",
"ITextSelection",
"selection",
",",
"IEditorPart",
"editor",
")",
"{",
"IResource",
"resource",
"=",
"(",
"IResource",
")",
"editor",
".",
"getEditorInput",
"(",
")",
".",
"getAdapter",
"(",
"IFile",
"."... | Tries to retrieve right bug marker for given selection. If there are many
markers for given editor, and text selection doesn't match any of them,
return null. If there is only one marker for given editor, returns this
marker in any case.
@param selection
@param editor
@return may return null | [
"Tries",
"to",
"retrieve",
"right",
"bug",
"marker",
"for",
"given",
"selection",
".",
"If",
"there",
"are",
"many",
"markers",
"for",
"given",
"editor",
"and",
"text",
"selection",
"doesn",
"t",
"match",
"any",
"of",
"them",
"return",
"null",
".",
"If",
... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L881-L908 |
nikhaldi/android-view-selector | src/main/java/com/nikhaldimann/viewselector/ViewSelectionAssert.java | ViewSelectionAssert.hasAttributeEqualTo | public ViewSelectionAssert hasAttributeEqualTo(String attributeName, Object expectedValue) {
"""
Asserts that every view in the selection has an attribute with the given
expected value. This is just a convenience shortcut for
{@code attribute(attributeName).containsOnly(expectedValue)}.
@param attributeName nam... | java | public ViewSelectionAssert hasAttributeEqualTo(String attributeName, Object expectedValue) {
attribute(attributeName).containsOnly(expectedValue);
return this;
} | [
"public",
"ViewSelectionAssert",
"hasAttributeEqualTo",
"(",
"String",
"attributeName",
",",
"Object",
"expectedValue",
")",
"{",
"attribute",
"(",
"attributeName",
")",
".",
"containsOnly",
"(",
"expectedValue",
")",
";",
"return",
"this",
";",
"}"
] | Asserts that every view in the selection has an attribute with the given
expected value. This is just a convenience shortcut for
{@code attribute(attributeName).containsOnly(expectedValue)}.
@param attributeName name of the attribute to check (e.g., {@code "text"}. The
implementation will call a getter on each view bas... | [
"Asserts",
"that",
"every",
"view",
"in",
"the",
"selection",
"has",
"an",
"attribute",
"with",
"the",
"given",
"expected",
"value",
".",
"This",
"is",
"just",
"a",
"convenience",
"shortcut",
"for",
"{"
] | train | https://github.com/nikhaldi/android-view-selector/blob/d3e4bf05f6111d116c6b0c1a8c51396e8bfae9b5/src/main/java/com/nikhaldimann/viewselector/ViewSelectionAssert.java#L52-L55 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.socketTextStream | @PublicEvolving
public DataStreamSource<String> socketTextStream(String hostname, int port, String delimiter, long maxRetry) {
"""
Creates a new data stream that contains the strings received infinitely from a socket. Received strings are
decoded by the system's default character set. On the termination of the s... | java | @PublicEvolving
public DataStreamSource<String> socketTextStream(String hostname, int port, String delimiter, long maxRetry) {
return addSource(new SocketTextStreamFunction(hostname, port, delimiter, maxRetry),
"Socket Stream");
} | [
"@",
"PublicEvolving",
"public",
"DataStreamSource",
"<",
"String",
">",
"socketTextStream",
"(",
"String",
"hostname",
",",
"int",
"port",
",",
"String",
"delimiter",
",",
"long",
"maxRetry",
")",
"{",
"return",
"addSource",
"(",
"new",
"SocketTextStreamFunction"... | Creates a new data stream that contains the strings received infinitely from a socket. Received strings are
decoded by the system's default character set. On the termination of the socket server connection retries can be
initiated.
<p>Let us note that the socket itself does not report on abort and as a consequence ret... | [
"Creates",
"a",
"new",
"data",
"stream",
"that",
"contains",
"the",
"strings",
"received",
"infinitely",
"from",
"a",
"socket",
".",
"Received",
"strings",
"are",
"decoded",
"by",
"the",
"system",
"s",
"default",
"character",
"set",
".",
"On",
"the",
"termin... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L1214-L1218 |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/ParsedOptions.java | ParsedOptions.getValue | public String getValue(char name, String defaultValue) {
"""
Retrieve the argument, if any, of an option.
@param name character name of the option
@param defaultValue the default value to be returned if the option
is not specified
@return the value of the argument if option is set, and has an argument,
othe... | java | public String getValue(char name, String defaultValue) {
return getValue(String.valueOf(name), defaultValue);
} | [
"public",
"String",
"getValue",
"(",
"char",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"getValue",
"(",
"String",
".",
"valueOf",
"(",
"name",
")",
",",
"defaultValue",
")",
";",
"}"
] | Retrieve the argument, if any, of an option.
@param name character name of the option
@param defaultValue the default value to be returned if the option
is not specified
@return the value of the argument if option is set, and has an argument,
otherwise {@code defaultValue} | [
"Retrieve",
"the",
"argument",
"if",
"any",
"of",
"an",
"option",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/ParsedOptions.java#L285-L287 |
javalite/activeweb | javalite-async/src/main/java/org/javalite/async/Async.java | Async.receiveMessage | public Message receiveMessage(String queueName, long timeout) {
"""
Receives a messafge from a queue asynchronously.If this queue also has listeners, then messages will be distributed across
all consumers.
@param queueName name of queue
@param timeout timeout in millis.
@return message if found, null if n... | java | public Message receiveMessage(String queueName, long timeout) {
checkStarted();
try(Session session = receiverSessionPool.getSession()){
Queue queue = (Queue) jmsServer.lookup(QUEUE_NAMESPACE + queueName);
try(MessageConsumer consumer = session.createConsumer(queue)) {
... | [
"public",
"Message",
"receiveMessage",
"(",
"String",
"queueName",
",",
"long",
"timeout",
")",
"{",
"checkStarted",
"(",
")",
";",
"try",
"(",
"Session",
"session",
"=",
"receiverSessionPool",
".",
"getSession",
"(",
")",
")",
"{",
"Queue",
"queue",
"=",
... | Receives a messafge from a queue asynchronously.If this queue also has listeners, then messages will be distributed across
all consumers.
@param queueName name of queue
@param timeout timeout in millis.
@return message if found, null if not. | [
"Receives",
"a",
"messafge",
"from",
"a",
"queue",
"asynchronously",
".",
"If",
"this",
"queue",
"also",
"has",
"listeners",
"then",
"messages",
"will",
"be",
"distributed",
"across",
"all",
"consumers",
"."
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/javalite-async/src/main/java/org/javalite/async/Async.java#L464-L474 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParametersLazyList.java | QueryParametersLazyList.updateResultSetCurrentLine | private void updateResultSetCurrentLine(ResultSet rs, QueryParameters params) throws SQLException {
"""
Updates ResultSet current row. Input value is handled by {@link TypeHandler}
@param rs ResultSet which would be updated
@param params values which would be used to update current row
@throws SQLExceptio... | java | private void updateResultSetCurrentLine(ResultSet rs, QueryParameters params) throws SQLException {
Object value = null;
Object prevValue = null;
int columnIndex = -1;
boolean readOnly = false;
QueryParameters prevParams = get(this.currentIndex);
ResultSetMetaData rsmd =... | [
"private",
"void",
"updateResultSetCurrentLine",
"(",
"ResultSet",
"rs",
",",
"QueryParameters",
"params",
")",
"throws",
"SQLException",
"{",
"Object",
"value",
"=",
"null",
";",
"Object",
"prevValue",
"=",
"null",
";",
"int",
"columnIndex",
"=",
"-",
"1",
";... | Updates ResultSet current row. Input value is handled by {@link TypeHandler}
@param rs ResultSet which would be updated
@param params values which would be used to update current row
@throws SQLException | [
"Updates",
"ResultSet",
"current",
"row",
".",
"Input",
"value",
"is",
"handled",
"by",
"{",
"@link",
"TypeHandler",
"}"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParametersLazyList.java#L1123-L1150 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.