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 |
|---|---|---|---|---|---|---|---|---|---|---|
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_panwvpx_image.java | xen_panwvpx_image.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_panwvpx_image_responses result = (xen_panwvpx_image_responses) serv... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_panwvpx_image_responses result = (xen_panwvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_panwvpx_image_responses.class, response);
if(result.errorcode != 0)
{
if (... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_panwvpx_image_responses",
"result",
"=",
"(",
"xen_panwvpx_image_responses",
")",
"service",
".",
"get_pa... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_panwvpx_image.java#L264-L281 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.getPropertiesFromComputeNode | public void getPropertiesFromComputeNode(String poolId, String nodeId, String filePath) {
"""
Gets the properties of the specified compute node file.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node that contains the file.
@param filePath The path to th... | java | public void getPropertiesFromComputeNode(String poolId, String nodeId, String filePath) {
getPropertiesFromComputeNodeWithServiceResponseAsync(poolId, nodeId, filePath).toBlocking().single().body();
} | [
"public",
"void",
"getPropertiesFromComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"filePath",
")",
"{",
"getPropertiesFromComputeNodeWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
",",
"filePath",
")",
".",
"toBlocking",
"(",... | Gets the properties of the specified compute node file.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node that contains the file.
@param filePath The path to the compute node file that you want to get the properties of.
@throws IllegalArgumentException thrown if ... | [
"Gets",
"the",
"properties",
"of",
"the",
"specified",
"compute",
"node",
"file",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L1366-L1368 |
joestelmach/natty | src/main/java/com/joestelmach/natty/WalkerState.java | WalkerState.seekToDayOfWeek | public void seekToDayOfWeek(String direction, String seekType, String seekAmount, String dayOfWeek) {
"""
seeks to a specified day of the week in the past or future.
@param direction the direction to seek: two possibilities
'<' go backward
'>' go forward
@param seekType the type of seek to perform (by_day ... | java | public void seekToDayOfWeek(String direction, String seekType, String seekAmount, String dayOfWeek) {
int dayOfWeekInt = Integer.parseInt(dayOfWeek);
int seekAmountInt = Integer.parseInt(seekAmount);
assert(direction.equals(DIR_LEFT) || direction.equals(DIR_RIGHT));
assert(seekType.equals(SEEK_BY_DAY) |... | [
"public",
"void",
"seekToDayOfWeek",
"(",
"String",
"direction",
",",
"String",
"seekType",
",",
"String",
"seekAmount",
",",
"String",
"dayOfWeek",
")",
"{",
"int",
"dayOfWeekInt",
"=",
"Integer",
".",
"parseInt",
"(",
"dayOfWeek",
")",
";",
"int",
"seekAmoun... | seeks to a specified day of the week in the past or future.
@param direction the direction to seek: two possibilities
'<' go backward
'>' go forward
@param seekType the type of seek to perform (by_day or by_week)
by_day means we seek to the very next occurrence of the given day
by_week means we seek to the first occu... | [
"seeks",
"to",
"a",
"specified",
"day",
"of",
"the",
"week",
"in",
"the",
"past",
"or",
"future",
"."
] | train | https://github.com/joestelmach/natty/blob/74389feb4c9372e51cd51eb0800a0177fec3e5a0/src/main/java/com/joestelmach/natty/WalkerState.java#L80-L108 |
jhg023/SimpleNet | src/main/java/simplenet/Server.java | Server.writeAndFlushToAllExcept | @SafeVarargs
public final <T extends Client> void writeAndFlushToAllExcept(Packet packet, T... clients) {
"""
Queues a {@link Packet} to a one or more {@link Client}s and calls {@link Client#flush()}, flushing all
previously-queued packets as well.
@param <T> A {@link Client} or any of its children.
@para... | java | @SafeVarargs
public final <T extends Client> void writeAndFlushToAllExcept(Packet packet, T... clients) {
writeHelper(packet::writeAndFlush, clients);
} | [
"@",
"SafeVarargs",
"public",
"final",
"<",
"T",
"extends",
"Client",
">",
"void",
"writeAndFlushToAllExcept",
"(",
"Packet",
"packet",
",",
"T",
"...",
"clients",
")",
"{",
"writeHelper",
"(",
"packet",
"::",
"writeAndFlush",
",",
"clients",
")",
";",
"}"
] | Queues a {@link Packet} to a one or more {@link Client}s and calls {@link Client#flush()}, flushing all
previously-queued packets as well.
@param <T> A {@link Client} or any of its children.
@param clients A variable amount of {@link Client}s to exclude from receiving the {@link Packet}. | [
"Queues",
"a",
"{",
"@link",
"Packet",
"}",
"to",
"a",
"one",
"or",
"more",
"{",
"@link",
"Client",
"}",
"s",
"and",
"calls",
"{",
"@link",
"Client#flush",
"()",
"}",
"flushing",
"all",
"previously",
"-",
"queued",
"packets",
"as",
"well",
"."
] | train | https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/Server.java#L283-L286 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java | Constraints.eqProperty | public PropertyConstraint eqProperty(String propertyName, String otherPropertyName) {
"""
Apply a "equal to" constraint to two bean properties.
@param propertyName The first property
@param otherPropertyName The other property
@return The constraint
"""
return valueProperties(propertyName, EqualTo... | java | public PropertyConstraint eqProperty(String propertyName, String otherPropertyName) {
return valueProperties(propertyName, EqualTo.instance(), otherPropertyName);
} | [
"public",
"PropertyConstraint",
"eqProperty",
"(",
"String",
"propertyName",
",",
"String",
"otherPropertyName",
")",
"{",
"return",
"valueProperties",
"(",
"propertyName",
",",
"EqualTo",
".",
"instance",
"(",
")",
",",
"otherPropertyName",
")",
";",
"}"
] | Apply a "equal to" constraint to two bean properties.
@param propertyName The first property
@param otherPropertyName The other property
@return The constraint | [
"Apply",
"a",
"equal",
"to",
"constraint",
"to",
"two",
"bean",
"properties",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L842-L844 |
xebia-france/xebia-servlet-extras | src/main/java/fr/xebia/servlet/filter/ExpiresFilter.java | ExpiresFilter.substringBefore | protected static String substringBefore(String str, String separator) {
"""
Return the subset of the given <code>str</code> that is before the first
occurence of the given <code>separator</code>. Return <code>null</code>
if the given <code>str</code> or the given <code>separator</code> is
null. Return and empty... | java | protected static String substringBefore(String str, String separator) {
if (isEmpty(str) || separator == null) {
return null;
}
if (separator.length() == 0) {
return "";
}
int separatorIndex = str.indexOf(separator);
if (separatorIndex == -1) {
... | [
"protected",
"static",
"String",
"substringBefore",
"(",
"String",
"str",
",",
"String",
"separator",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
"||",
"separator",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"separator",
".",
"... | Return the subset of the given <code>str</code> that is before the first
occurence of the given <code>separator</code>. Return <code>null</code>
if the given <code>str</code> or the given <code>separator</code> is
null. Return and empty string if the <code>separator</code> is empty.
@param str
can be <code>null</code>... | [
"Return",
"the",
"subset",
"of",
"the",
"given",
"<code",
">",
"str<",
"/",
"code",
">",
"that",
"is",
"before",
"the",
"first",
"occurence",
"of",
"the",
"given",
"<code",
">",
"separator<",
"/",
"code",
">",
".",
"Return",
"<code",
">",
"null<",
"/",... | train | https://github.com/xebia-france/xebia-servlet-extras/blob/b263636fc78f8794dde57d92b835edb5e95ce379/src/main/java/fr/xebia/servlet/filter/ExpiresFilter.java#L1193-L1207 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/BsonParser.java | BsonParser.handleBinary | protected JsonToken handleBinary() throws IOException {
"""
Reads binary data from the input stream
@return the json token read
@throws IOException if an I/O error occurs
"""
int size = _in.readInt();
byte subtype = _in.readByte();
Context ctx = getContext();
switch (subtype) {
case BsonConstants.S... | java | protected JsonToken handleBinary() throws IOException {
int size = _in.readInt();
byte subtype = _in.readByte();
Context ctx = getContext();
switch (subtype) {
case BsonConstants.SUBTYPE_BINARY_OLD:
int size2 = _in.readInt();
byte[] buf2 = new byte[size2];
_in.readFully(buf2);
ctx.value = buf2;
... | [
"protected",
"JsonToken",
"handleBinary",
"(",
")",
"throws",
"IOException",
"{",
"int",
"size",
"=",
"_in",
".",
"readInt",
"(",
")",
";",
"byte",
"subtype",
"=",
"_in",
".",
"readByte",
"(",
")",
";",
"Context",
"ctx",
"=",
"getContext",
"(",
")",
";... | Reads binary data from the input stream
@return the json token read
@throws IOException if an I/O error occurs | [
"Reads",
"binary",
"data",
"from",
"the",
"input",
"stream"
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/BsonParser.java#L445-L471 |
pravega/pravega | common/src/main/java/io/pravega/common/LoggerHelpers.java | LoggerHelpers.traceEnter | public static long traceEnter(Logger log, String method, Object... args) {
"""
Traces the fact that a method entry has occurred.
@param log The Logger to log to.
@param method The name of the method.
@param args The arguments to the method.
@return A generated identifier that can be used to correlate th... | java | public static long traceEnter(Logger log, String method, Object... args) {
if (!log.isTraceEnabled()) {
return 0;
}
long time = CURRENT_TIME.get();
log.trace("ENTER {}@{} {}.", method, time, args);
return time;
} | [
"public",
"static",
"long",
"traceEnter",
"(",
"Logger",
"log",
",",
"String",
"method",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"long",
"time",
"=",
"CURRENT_... | Traces the fact that a method entry has occurred.
@param log The Logger to log to.
@param method The name of the method.
@param args The arguments to the method.
@return A generated identifier that can be used to correlate this traceEnter with its corresponding traceLeave.
This is usually generated from the curre... | [
"Traces",
"the",
"fact",
"that",
"a",
"method",
"entry",
"has",
"occurred",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/LoggerHelpers.java#L40-L48 |
VoltDB/voltdb | src/frontend/org/voltcore/utils/CoreUtils.java | CoreUtils.getBoundedSingleThreadExecutor | public static ListeningExecutorService getBoundedSingleThreadExecutor(String name, int capacity) {
"""
Create a bounded single threaded executor that rejects requests if more than capacity
requests are outstanding.
"""
LinkedBlockingQueue<Runnable> lbq = new LinkedBlockingQueue<Runnable>(capacity);
... | java | public static ListeningExecutorService getBoundedSingleThreadExecutor(String name, int capacity) {
LinkedBlockingQueue<Runnable> lbq = new LinkedBlockingQueue<Runnable>(capacity);
ThreadPoolExecutor tpe =
new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, lbq, CoreUtils.getThreadFac... | [
"public",
"static",
"ListeningExecutorService",
"getBoundedSingleThreadExecutor",
"(",
"String",
"name",
",",
"int",
"capacity",
")",
"{",
"LinkedBlockingQueue",
"<",
"Runnable",
">",
"lbq",
"=",
"new",
"LinkedBlockingQueue",
"<",
"Runnable",
">",
"(",
"capacity",
"... | Create a bounded single threaded executor that rejects requests if more than capacity
requests are outstanding. | [
"Create",
"a",
"bounded",
"single",
"threaded",
"executor",
"that",
"rejects",
"requests",
"if",
"more",
"than",
"capacity",
"requests",
"are",
"outstanding",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L485-L490 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.setObjectProp | public static Object setObjectProp(Object obj, String property,
Object value, Context cx,
Scriptable scope) {
"""
Version of setObjectElem when elem is a valid JS identifier name.
"""
Scriptable sobj = toObjectOrNull(cx, obj,... | java | public static Object setObjectProp(Object obj, String property,
Object value, Context cx,
Scriptable scope)
{
Scriptable sobj = toObjectOrNull(cx, obj, scope);
if (sobj == null) {
throw undefWriteError(obj, pro... | [
"public",
"static",
"Object",
"setObjectProp",
"(",
"Object",
"obj",
",",
"String",
"property",
",",
"Object",
"value",
",",
"Context",
"cx",
",",
"Scriptable",
"scope",
")",
"{",
"Scriptable",
"sobj",
"=",
"toObjectOrNull",
"(",
"cx",
",",
"obj",
",",
"sc... | Version of setObjectElem when elem is a valid JS identifier name. | [
"Version",
"of",
"setObjectElem",
"when",
"elem",
"is",
"a",
"valid",
"JS",
"identifier",
"name",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1729-L1738 |
molgenis/molgenis | molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlExceptionTranslator.java | PostgreSqlExceptionTranslator.translateDependentObjectsStillExist | MolgenisValidationException translateDependentObjectsStillExist(PSQLException pSqlException) {
"""
Package private for testability
@param pSqlException PostgreSQL exception
@return translated validation exception
"""
ServerErrorMessage serverErrorMessage = pSqlException.getServerErrorMessage();
Str... | java | MolgenisValidationException translateDependentObjectsStillExist(PSQLException pSqlException) {
ServerErrorMessage serverErrorMessage = pSqlException.getServerErrorMessage();
String detail = serverErrorMessage.getDetail();
Matcher matcher =
Pattern.compile(
"constraint (.+) on table \... | [
"MolgenisValidationException",
"translateDependentObjectsStillExist",
"(",
"PSQLException",
"pSqlException",
")",
"{",
"ServerErrorMessage",
"serverErrorMessage",
"=",
"pSqlException",
".",
"getServerErrorMessage",
"(",
")",
";",
"String",
"detail",
"=",
"serverErrorMessage",
... | Package private for testability
@param pSqlException PostgreSQL exception
@return translated validation exception | [
"Package",
"private",
"for",
"testability"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlExceptionTranslator.java#L172-L223 |
jbundle/jbundle | main/db/src/main/java/org/jbundle/main/user/db/SetupNewUserHandler.java | SetupNewUserHandler.doRecordChange | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption) {
"""
Called when a change is the record status is about to happen/has happened.
@param field If this file change is due to a field, this is the field.
@param iChangeType The type of change that occurred.
@param bDisplayOption I... | java | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{
if (iChangeType == DBConstants.AFTER_ADD_TYPE)
{
UserInfo userTemplate = this.getUserTemplate();
if (userTemplate != null)
{
Record userInfo = this.getOwner();
... | [
"public",
"int",
"doRecordChange",
"(",
"FieldInfo",
"field",
",",
"int",
"iChangeType",
",",
"boolean",
"bDisplayOption",
")",
"{",
"if",
"(",
"iChangeType",
"==",
"DBConstants",
".",
"AFTER_ADD_TYPE",
")",
"{",
"UserInfo",
"userTemplate",
"=",
"this",
".",
"... | Called when a change is the record status is about to happen/has happened.
@param field If this file change is due to a field, this is the field.
@param iChangeType The type of change that occurred.
@param bDisplayOption If true, display any changes.
@return an error code.
ADD_TYPE - Before a write.
UPDATE_TYPE - Befor... | [
"Called",
"when",
"a",
"change",
"is",
"the",
"record",
"status",
"is",
"about",
"to",
"happen",
"/",
"has",
"happened",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/user/db/SetupNewUserHandler.java#L98-L127 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java | UserAttrs.setDoubleAttribute | public static final void setDoubleAttribute(Path path, String attribute, double value, LinkOption... options) throws IOException {
"""
Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param value
@param options
@throws IOException
"""
attribute =... | java | public static final void setDoubleAttribute(Path path, String attribute, double value, LinkOption... options) throws IOException
{
attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
Files.setAttribute(path, attribute, Primitives.writeDouble(value), options);
} | [
"public",
"static",
"final",
"void",
"setDoubleAttribute",
"(",
"Path",
"path",
",",
"String",
"attribute",
",",
"double",
"value",
",",
"LinkOption",
"...",
"options",
")",
"throws",
"IOException",
"{",
"attribute",
"=",
"attribute",
".",
"startsWith",
"(",
"... | Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param value
@param options
@throws IOException | [
"Set",
"user",
"-",
"defined",
"-",
"attribute"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L92-L96 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.projectionSplit | public static void projectionSplit( DMatrixRMaj P , DMatrix3x3 M , DMatrix3 T ) {
"""
Splits the projection matrix into a 3x3 matrix and 3x1 vector.
@param P (Input) 3x4 projection matirx
@param M (Output) M = P(:,0:2)
@param T (Output) T = P(:,3)
"""
M.a11 = P.data[0]; M.a12 = P.data[1]; M.a13 = P.data... | java | public static void projectionSplit( DMatrixRMaj P , DMatrix3x3 M , DMatrix3 T ) {
M.a11 = P.data[0]; M.a12 = P.data[1]; M.a13 = P.data[2 ]; T.a1 = P.data[3 ];
M.a21 = P.data[4]; M.a22 = P.data[5]; M.a23 = P.data[6 ]; T.a2 = P.data[7 ];
M.a31 = P.data[8]; M.a32 = P.data[9]; M.a33 = P.data[10]; T.a3 = P.data[11];
... | [
"public",
"static",
"void",
"projectionSplit",
"(",
"DMatrixRMaj",
"P",
",",
"DMatrix3x3",
"M",
",",
"DMatrix3",
"T",
")",
"{",
"M",
".",
"a11",
"=",
"P",
".",
"data",
"[",
"0",
"]",
";",
"M",
".",
"a12",
"=",
"P",
".",
"data",
"[",
"1",
"]",
"... | Splits the projection matrix into a 3x3 matrix and 3x1 vector.
@param P (Input) 3x4 projection matirx
@param M (Output) M = P(:,0:2)
@param T (Output) T = P(:,3) | [
"Splits",
"the",
"projection",
"matrix",
"into",
"a",
"3x3",
"matrix",
"and",
"3x1",
"vector",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L664-L668 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/io/WritableUtils.java | WritableUtils.readEnum | public static <T extends Enum<T>> T readEnum(DataInput in, Class<T> enumType) throws IOException {
"""
Read an Enum value from DataInput, Enums are read and written
using String values.
@param <T> Enum type
@param in DataInput to read from
@param enumType Class type of Enum
@return Enum represented by String ... | java | public static <T extends Enum<T>> T readEnum(DataInput in, Class<T> enumType) throws IOException {
return T.valueOf(enumType, Text.readString(in));
} | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"readEnum",
"(",
"DataInput",
"in",
",",
"Class",
"<",
"T",
">",
"enumType",
")",
"throws",
"IOException",
"{",
"return",
"T",
".",
"valueOf",
"(",
"enumType",
",",
"Text",
"."... | Read an Enum value from DataInput, Enums are read and written
using String values.
@param <T> Enum type
@param in DataInput to read from
@param enumType Class type of Enum
@return Enum represented by String read from DataInput
@throws IOException | [
"Read",
"an",
"Enum",
"value",
"from",
"DataInput",
"Enums",
"are",
"read",
"and",
"written",
"using",
"String",
"values",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/io/WritableUtils.java#L370-L372 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java | BaseNeo4jAssociationQueries.initFindRelationshipQuery | private static String initFindRelationshipQuery(EntityKeyMetadata ownerEntityKeyMetadata, AssociationKeyMetadata associationKeyMetadata) {
"""
/*
Example with target node:
MATCH (n:ENTITY:table {id: {0}}) -[r:role] - (t {id: {1}})
RETURN r
Example with relationship indexes:
MATCH (n:ENTITY:table {id: {0... | java | private static String initFindRelationshipQuery(EntityKeyMetadata ownerEntityKeyMetadata, AssociationKeyMetadata associationKeyMetadata) {
int offset = 0;
StringBuilder queryBuilder = new StringBuilder( "MATCH " );
queryBuilder.append( "(n:" );
queryBuilder.append( ENTITY );
queryBuilder.append( ":" );
appe... | [
"private",
"static",
"String",
"initFindRelationshipQuery",
"(",
"EntityKeyMetadata",
"ownerEntityKeyMetadata",
",",
"AssociationKeyMetadata",
"associationKeyMetadata",
")",
"{",
"int",
"offset",
"=",
"0",
";",
"StringBuilder",
"queryBuilder",
"=",
"new",
"StringBuilder",
... | /*
Example with target node:
MATCH (n:ENTITY:table {id: {0}}) -[r:role] - (t {id: {1}})
RETURN r
Example with relationship indexes:
MATCH (n:ENTITY:table {id: {0}}) -[r:role {index: {1}}] - (t)
RETURN r | [
"/",
"*",
"Example",
"with",
"target",
"node",
":"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java#L79-L103 |
duracloud/duracloud | synctool/src/main/java/org/duracloud/sync/config/SyncToolConfigParser.java | SyncToolConfigParser.retrievePrevConfig | public SyncToolConfig retrievePrevConfig(File backupDir) {
"""
Retrieves the configuration of the previous run of the Sync Tool.
If there was no previous run, the backup file cannot be found, or
the backup file cannot be read, returns null, otherwise returns the
parsed configuration
@param backupDir the curr... | java | public SyncToolConfig retrievePrevConfig(File backupDir) {
File prevConfigBackupFile =
new File(backupDir, PREV_BACKUP_FILE_NAME);
if (prevConfigBackupFile.exists()) {
String[] prevConfigArgs = retrieveConfig(prevConfigBackupFile);
try {
return process... | [
"public",
"SyncToolConfig",
"retrievePrevConfig",
"(",
"File",
"backupDir",
")",
"{",
"File",
"prevConfigBackupFile",
"=",
"new",
"File",
"(",
"backupDir",
",",
"PREV_BACKUP_FILE_NAME",
")",
";",
"if",
"(",
"prevConfigBackupFile",
".",
"exists",
"(",
")",
")",
"... | Retrieves the configuration of the previous run of the Sync Tool.
If there was no previous run, the backup file cannot be found, or
the backup file cannot be read, returns null, otherwise returns the
parsed configuration
@param backupDir the current backup directory
@return config for previous sync tool run, or null | [
"Retrieves",
"the",
"configuration",
"of",
"the",
"previous",
"run",
"of",
"the",
"Sync",
"Tool",
".",
"If",
"there",
"was",
"no",
"previous",
"run",
"the",
"backup",
"file",
"cannot",
"be",
"found",
"or",
"the",
"backup",
"file",
"cannot",
"be",
"read",
... | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/synctool/src/main/java/org/duracloud/sync/config/SyncToolConfigParser.java#L547-L560 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/IndexPlanners.java | IndexPlanners.withProviders | public static IndexPlanners withProviders( final Map<String, IndexPlanner> plannersByProviderName ) {
"""
Get an IndexPlanners instance that looks for the implicit (built-in) indexes and that calls the appropriate
{@link IndexPlanner} instances given the available indexes for this selector.
@param plannersByPr... | java | public static IndexPlanners withProviders( final Map<String, IndexPlanner> plannersByProviderName ) {
return new IndexPlanners() {
@Override
public void applyIndexes( QueryContext context,
IndexCostCalculator calculator ) {
// Call th... | [
"public",
"static",
"IndexPlanners",
"withProviders",
"(",
"final",
"Map",
"<",
"String",
",",
"IndexPlanner",
">",
"plannersByProviderName",
")",
"{",
"return",
"new",
"IndexPlanners",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"applyIndexes",
"(",
"Quer... | Get an IndexPlanners instance that looks for the implicit (built-in) indexes and that calls the appropriate
{@link IndexPlanner} instances given the available indexes for this selector.
@param plannersByProviderName the map of query index planners keyed by the provider's name
@return the instance; never null | [
"Get",
"an",
"IndexPlanners",
"instance",
"that",
"looks",
"for",
"the",
"implicit",
"(",
"built",
"-",
"in",
")",
"indexes",
"and",
"that",
"calls",
"the",
"appropriate",
"{",
"@link",
"IndexPlanner",
"}",
"instances",
"given",
"the",
"available",
"indexes",
... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/IndexPlanners.java#L79-L96 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.safeMultiply | public static long safeMultiply(long val1, int val2) {
"""
Multiply two values throwing an exception if overflow occurs.
@param val1 the first value
@param val2 the second value
@return the new total
@throws ArithmeticException if the value is too big or too small
@since 1.2
"""
switch (val2) ... | java | public static long safeMultiply(long val1, int val2) {
switch (val2) {
case -1:
if (val1 == Long.MIN_VALUE) {
throw new ArithmeticException("Multiplication overflows a long: " + val1 + " * " + val2);
}
return -val1;
case... | [
"public",
"static",
"long",
"safeMultiply",
"(",
"long",
"val1",
",",
"int",
"val2",
")",
"{",
"switch",
"(",
"val2",
")",
"{",
"case",
"-",
"1",
":",
"if",
"(",
"val1",
"==",
"Long",
".",
"MIN_VALUE",
")",
"{",
"throw",
"new",
"ArithmeticException",
... | Multiply two values throwing an exception if overflow occurs.
@param val1 the first value
@param val2 the second value
@return the new total
@throws ArithmeticException if the value is too big or too small
@since 1.2 | [
"Multiply",
"two",
"values",
"throwing",
"an",
"exception",
"if",
"overflow",
"occurs",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L138-L155 |
enioka/jqm | jqm-all/jqm-client/jqm-api-client-core/src/main/java/com/enioka/jqm/api/Query.java | Query.addSortAsc | public Query addSortAsc(Sort column) {
"""
Adds a new column a the end of the sorting clause.
@see #addSortDesc(Sort)
"""
this.sorts.add(new SortSpec(SortOrder.ASCENDING, column));
return this;
} | java | public Query addSortAsc(Sort column)
{
this.sorts.add(new SortSpec(SortOrder.ASCENDING, column));
return this;
} | [
"public",
"Query",
"addSortAsc",
"(",
"Sort",
"column",
")",
"{",
"this",
".",
"sorts",
".",
"add",
"(",
"new",
"SortSpec",
"(",
"SortOrder",
".",
"ASCENDING",
",",
"column",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new column a the end of the sorting clause.
@see #addSortDesc(Sort) | [
"Adds",
"a",
"new",
"column",
"a",
"the",
"end",
"of",
"the",
"sorting",
"clause",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-client/jqm-api-client-core/src/main/java/com/enioka/jqm/api/Query.java#L141-L145 |
apereo/cas | support/cas-server-support-saml-sp-integrations/src/main/java/org/apereo/cas/util/SamlSPUtils.java | SamlSPUtils.saveService | public static void saveService(final RegisteredService service, final ServicesManager servicesManager) {
"""
Save service only if it's not already found in the registry.
@param service the service
@param servicesManager the services manager
"""
servicesManager.load();
if (servicesM... | java | public static void saveService(final RegisteredService service, final ServicesManager servicesManager) {
servicesManager.load();
if (servicesManager.findServiceBy(registeredService -> registeredService instanceof SamlRegisteredService
&& registeredService.getServiceId().equals(service.getSe... | [
"public",
"static",
"void",
"saveService",
"(",
"final",
"RegisteredService",
"service",
",",
"final",
"ServicesManager",
"servicesManager",
")",
"{",
"servicesManager",
".",
"load",
"(",
")",
";",
"if",
"(",
"servicesManager",
".",
"findServiceBy",
"(",
"register... | Save service only if it's not already found in the registry.
@param service the service
@param servicesManager the services manager | [
"Save",
"service",
"only",
"if",
"it",
"s",
"not",
"already",
"found",
"in",
"the",
"registry",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-sp-integrations/src/main/java/org/apereo/cas/util/SamlSPUtils.java#L146-L157 |
JCTools/JCTools | jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java | MpscRelaxedArrayQueue.validateSlowProducerOverClaim | private void validateSlowProducerOverClaim(final int activeCycleIndex, final long producerCycleClaim) {
"""
Validates a slow producer over-claim throwing {@link IllegalStateException} if the offer on it can't continue.
"""
//the cycle claim is now ok?
final long producerPosition = producerPosit... | java | private void validateSlowProducerOverClaim(final int activeCycleIndex, final long producerCycleClaim)
{
//the cycle claim is now ok?
final long producerPosition = producerPositionFromClaim(
producerCycleClaim,
positionWithinCycleMask,
cycleIdBitShift,
... | [
"private",
"void",
"validateSlowProducerOverClaim",
"(",
"final",
"int",
"activeCycleIndex",
",",
"final",
"long",
"producerCycleClaim",
")",
"{",
"//the cycle claim is now ok?",
"final",
"long",
"producerPosition",
"=",
"producerPositionFromClaim",
"(",
"producerCycleClaim",... | Validates a slow producer over-claim throwing {@link IllegalStateException} if the offer on it can't continue. | [
"Validates",
"a",
"slow",
"producer",
"over",
"-",
"claim",
"throwing",
"{"
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java#L438-L465 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/CriteriaReader.java | CriteriaReader.addCriteria | private void addCriteria(List<GenericCriteria> list, byte[] block) {
"""
Adds a basic LHS OPERATOR RHS block.
@param list parent criteria list
@param block current block
"""
byte[] leftBlock = getChildBlock(block);
byte[] rightBlock1 = getListNextBlock(leftBlock);
byte[] rightBlock2 = get... | java | private void addCriteria(List<GenericCriteria> list, byte[] block)
{
byte[] leftBlock = getChildBlock(block);
byte[] rightBlock1 = getListNextBlock(leftBlock);
byte[] rightBlock2 = getListNextBlock(rightBlock1);
TestOperator operator = TestOperator.getInstance(MPPUtility.getShort(block, 0) - ... | [
"private",
"void",
"addCriteria",
"(",
"List",
"<",
"GenericCriteria",
">",
"list",
",",
"byte",
"[",
"]",
"block",
")",
"{",
"byte",
"[",
"]",
"leftBlock",
"=",
"getChildBlock",
"(",
"block",
")",
";",
"byte",
"[",
"]",
"rightBlock1",
"=",
"getListNextB... | Adds a basic LHS OPERATOR RHS block.
@param list parent criteria list
@param block current block | [
"Adds",
"a",
"basic",
"LHS",
"OPERATOR",
"RHS",
"block",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L251-L280 |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java | SoapUtils.addNSdeclarations | public static void addNSdeclarations(Element source, Element target)
throws Exception {
"""
A method to copy namespaces declarations.
@param source
the source message containing the namespaces to be copied on
the target message.
@param target
the target message.
@author Simone Gianfranceschi... | java | public static void addNSdeclarations(Element source, Element target)
throws Exception {
NamedNodeMap sourceAttributes = source.getAttributes();
Attr attribute;
String attributeName;
for (int i = 0; i <= sourceAttributes.getLength() - 1; i++) {
attribute = (A... | [
"public",
"static",
"void",
"addNSdeclarations",
"(",
"Element",
"source",
",",
"Element",
"target",
")",
"throws",
"Exception",
"{",
"NamedNodeMap",
"sourceAttributes",
"=",
"source",
".",
"getAttributes",
"(",
")",
";",
"Attr",
"attribute",
";",
"String",
"att... | A method to copy namespaces declarations.
@param source
the source message containing the namespaces to be copied on
the target message.
@param target
the target message.
@author Simone Gianfranceschi | [
"A",
"method",
"to",
"copy",
"namespaces",
"declarations",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java#L110-L125 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dal/describe/DescribeParserFactory.java | DescribeParserFactory.newInstance | public static AbstractDescribeParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine) {
"""
Create describe parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine.
@re... | java | public static AbstractDescribeParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine) {
switch (dbType) {
case H2:
case MySQL:
return new MySQLDescribeParser(shardingRule, lexerEngine);
default:
... | [
"public",
"static",
"AbstractDescribeParser",
"newInstance",
"(",
"final",
"DatabaseType",
"dbType",
",",
"final",
"ShardingRule",
"shardingRule",
",",
"final",
"LexerEngine",
"lexerEngine",
")",
"{",
"switch",
"(",
"dbType",
")",
"{",
"case",
"H2",
":",
"case",
... | Create describe parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine.
@return describe parser instance | [
"Create",
"describe",
"parser",
"instance",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dal/describe/DescribeParserFactory.java#L43-L51 |
Red5/red5-io | src/main/java/org/red5/io/utils/ConversionUtils.java | ConversionUtils.convertMapToBean | public static Object convertMapToBean(Map<String, ? extends Object> source, Class<?> target) throws ConversionException {
"""
Convert map to bean
@param source
Source map
@param target
Target class
@return Bean of that class
@throws ConversionException
on failure
"""
Object bean = newInstance... | java | public static Object convertMapToBean(Map<String, ? extends Object> source, Class<?> target) throws ConversionException {
Object bean = newInstance(target);
if (bean == null) {
//try with just the target name as specified in Trac #352
bean = newInstance(target.getName());
... | [
"public",
"static",
"Object",
"convertMapToBean",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"source",
",",
"Class",
"<",
"?",
">",
"target",
")",
"throws",
"ConversionException",
"{",
"Object",
"bean",
"=",
"newInstance",
"(",
"target",
... | Convert map to bean
@param source
Source map
@param target
Target class
@return Bean of that class
@throws ConversionException
on failure | [
"Convert",
"map",
"to",
"bean"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/utils/ConversionUtils.java#L416-L431 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchIndex.java | CmsSearchIndex.getResource | protected CmsResource getResource(CmsObject cms, I_CmsSearchDocument doc, CmsResourceFilter filter) {
"""
Checks if the OpenCms resource referenced by the result document can be read
by the user of the given OpenCms context.
Returns the referenced <code>CmsResource</code> or <code>null</code> if
the user is n... | java | protected CmsResource getResource(CmsObject cms, I_CmsSearchDocument doc, CmsResourceFilter filter) {
try {
CmsObject clone = OpenCms.initCmsObject(cms);
clone.getRequestContext().setSiteRoot("");
return clone.readResource(doc.getPath(), filter);
} catch (CmsExceptio... | [
"protected",
"CmsResource",
"getResource",
"(",
"CmsObject",
"cms",
",",
"I_CmsSearchDocument",
"doc",
",",
"CmsResourceFilter",
"filter",
")",
"{",
"try",
"{",
"CmsObject",
"clone",
"=",
"OpenCms",
".",
"initCmsObject",
"(",
"cms",
")",
";",
"clone",
".",
"ge... | Checks if the OpenCms resource referenced by the result document can be read
by the user of the given OpenCms context.
Returns the referenced <code>CmsResource</code> or <code>null</code> if
the user is not permitted to read the resource.<p>
@param cms the OpenCms user context to use for permission testing
@param doc... | [
"Checks",
"if",
"the",
"OpenCms",
"resource",
"referenced",
"by",
"the",
"result",
"document",
"can",
"be",
"read",
"by",
"the",
"user",
"of",
"the",
"given",
"OpenCms",
"context",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L1724-L1735 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowController.java | PageFlowController.ensureFailover | public void ensureFailover( HttpServletRequest request ) {
"""
<p>
Ensure that any changes to this object will be replicated in a cluster (for failover), even if the
replication scheme uses a change-detection algorithm that relies on
{@link javax.servlet.http.HttpSession#setAttribute(String, Object)} to be awar... | java | public void ensureFailover( HttpServletRequest request )
{
//
// remove() puts the pageflow instance into a request attribute. Make sure not to re-save this
// instance if it's being removed. Also, if the session is null (after having been invalidated
// by the user), don't recreat... | [
"public",
"void",
"ensureFailover",
"(",
"HttpServletRequest",
"request",
")",
"{",
"//",
"// remove() puts the pageflow instance into a request attribute. Make sure not to re-save this",
"// instance if it's being removed. Also, if the session is null (after having been invalidated",
"// by... | <p>
Ensure that any changes to this object will be replicated in a cluster (for failover), even if the
replication scheme uses a change-detection algorithm that relies on
{@link javax.servlet.http.HttpSession#setAttribute(String, Object)} to be aware of changes. This method is
used by the framework and should not be c... | [
"<p",
">",
"Ensure",
"that",
"any",
"changes",
"to",
"this",
"object",
"will",
"be",
"replicated",
"in",
"a",
"cluster",
"(",
"for",
"failover",
")",
"even",
"if",
"the",
"replication",
"scheme",
"uses",
"a",
"change",
"-",
"detection",
"algorithm",
"that"... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowController.java#L259-L294 |
jbundle/webapp | base/src/main/java/org/jbundle/util/webapp/base/BaseOsgiServlet.java | BaseOsgiServlet.setProperties | public boolean setProperties(Dictionary<String, String> properties) {
"""
Set the properties. Override this to set any configuration up.
"""
boolean success = super.setProperties(properties);
if (success)
{
baseURL = null;
if (this.getProperty(BASE_PATH) != null)... | java | public boolean setProperties(Dictionary<String, String> properties)
{
boolean success = super.setProperties(properties);
if (success)
{
baseURL = null;
if (this.getProperty(BASE_PATH) != null) {
try {
baseURL = new URL(this.getPrope... | [
"public",
"boolean",
"setProperties",
"(",
"Dictionary",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"boolean",
"success",
"=",
"super",
".",
"setProperties",
"(",
"properties",
")",
";",
"if",
"(",
"success",
")",
"{",
"baseURL",
"=",
"null... | Set the properties. Override this to set any configuration up. | [
"Set",
"the",
"properties",
".",
"Override",
"this",
"to",
"set",
"any",
"configuration",
"up",
"."
] | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/BaseOsgiServlet.java#L143-L158 |
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java | XmlElementWrapperPlugin.renameFactoryMethod | private void renameFactoryMethod(JDefinedClass factoryClass, String oldMethodName, String newMethodName) {
"""
Rename methods in factory class: {@code createABC() -> createAC()}.
"""
for (JMethod method : factoryClass.methods()) {
String methodName = method.name();
if (!methodName.contains(oldMethodNa... | java | private void renameFactoryMethod(JDefinedClass factoryClass, String oldMethodName, String newMethodName) {
for (JMethod method : factoryClass.methods()) {
String methodName = method.name();
if (!methodName.contains(oldMethodName)) {
continue;
}
method.name(methodName.replace(oldMethodName, newMethod... | [
"private",
"void",
"renameFactoryMethod",
"(",
"JDefinedClass",
"factoryClass",
",",
"String",
"oldMethodName",
",",
"String",
"newMethodName",
")",
"{",
"for",
"(",
"JMethod",
"method",
":",
"factoryClass",
".",
"methods",
"(",
")",
")",
"{",
"String",
"methodN... | Rename methods in factory class: {@code createABC() -> createAC()}. | [
"Rename",
"methods",
"in",
"factory",
"class",
":",
"{"
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java#L805-L817 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java | AbstractItemLink.removeIfMatches | public final AbstractItem removeIfMatches(final Filter filter, PersistentTransaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException {
"""
remove the item if it matches and is available
@param filter
@param transaction
@return item if locked
@throws ProtocolExceptio... | java | public final AbstractItem removeIfMatches(final Filter filter, PersistentTransaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "removeIfMatches", new Object[] {... | [
"public",
"final",
"AbstractItem",
"removeIfMatches",
"(",
"final",
"Filter",
"filter",
",",
"PersistentTransaction",
"transaction",
")",
"throws",
"ProtocolException",
",",
"TransactionException",
",",
"SevereMessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",... | remove the item if it matches and is available
@param filter
@param transaction
@return item if locked
@throws ProtocolException Thrown if an add is attempted when the
transaction cannot allow any further work to be added i.e. after
completion of the transaction.
@throws TransactionException Thrown if an unexpected ... | [
"remove",
"the",
"item",
"if",
"it",
"matches",
"and",
"is",
"available"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L3916-L3926 |
undertow-io/undertow | servlet/src/main/java/io/undertow/servlet/api/DeploymentInfo.java | DeploymentInfo.addFirstAuthenticationMechanism | public DeploymentInfo addFirstAuthenticationMechanism(final String name, final AuthenticationMechanism mechanism) {
"""
Adds an authentication mechanism directly to the deployment. This mechanism will be first in the list.
In general you should just use {@link #addAuthenticationMechanism(String, io.undertow.sec... | java | public DeploymentInfo addFirstAuthenticationMechanism(final String name, final AuthenticationMechanism mechanism) {
authenticationMechanisms.put(name, new ImmediateAuthenticationMechanismFactory(mechanism));
if(loginConfig == null) {
loginConfig = new LoginConfig(null);
}
log... | [
"public",
"DeploymentInfo",
"addFirstAuthenticationMechanism",
"(",
"final",
"String",
"name",
",",
"final",
"AuthenticationMechanism",
"mechanism",
")",
"{",
"authenticationMechanisms",
".",
"put",
"(",
"name",
",",
"new",
"ImmediateAuthenticationMechanismFactory",
"(",
... | Adds an authentication mechanism directly to the deployment. This mechanism will be first in the list.
In general you should just use {@link #addAuthenticationMechanism(String, io.undertow.security.api.AuthenticationMechanismFactory)}
and allow the user to configure the methods they want by name.
This method is essen... | [
"Adds",
"an",
"authentication",
"mechanism",
"directly",
"to",
"the",
"deployment",
".",
"This",
"mechanism",
"will",
"be",
"first",
"in",
"the",
"list",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/servlet/src/main/java/io/undertow/servlet/api/DeploymentInfo.java#L1007-L1014 |
KyoriPowered/text | api/src/main/java/net/kyori/text/event/HoverEvent.java | HoverEvent.showEntity | public static @NonNull HoverEvent showEntity(final @NonNull Component entity) {
"""
Creates a hover event that shows an entity on hover.
@param entity the entity to show on hover
@return a hover event
"""
return new HoverEvent(Action.SHOW_ENTITY, entity);
} | java | public static @NonNull HoverEvent showEntity(final @NonNull Component entity) {
return new HoverEvent(Action.SHOW_ENTITY, entity);
} | [
"public",
"static",
"@",
"NonNull",
"HoverEvent",
"showEntity",
"(",
"final",
"@",
"NonNull",
"Component",
"entity",
")",
"{",
"return",
"new",
"HoverEvent",
"(",
"Action",
".",
"SHOW_ENTITY",
",",
"entity",
")",
";",
"}"
] | Creates a hover event that shows an entity on hover.
@param entity the entity to show on hover
@return a hover event | [
"Creates",
"a",
"hover",
"event",
"that",
"shows",
"an",
"entity",
"on",
"hover",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/event/HoverEvent.java#L76-L78 |
languagetool-org/languagetool | languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AvsAnRule.java | AvsAnRule.suggestAorAn | public String suggestAorAn(String origWord) {
"""
Adds "a" or "an" to the English noun. Used for suggesting the proper form of the indefinite article.
For the rare cases where both "a" and "an" are considered okay (e.g. for "historical"), "a" is returned.
@param origWord Word that needs an article.
@return Stri... | java | public String suggestAorAn(String origWord) {
AnalyzedTokenReadings token = new AnalyzedTokenReadings(new AnalyzedToken(origWord, null, null), 0);
Determiner determiner = getCorrectDeterminerFor(token);
if (determiner == Determiner.A || determiner == Determiner.A_OR_AN) {
return "a " + origWord;
}... | [
"public",
"String",
"suggestAorAn",
"(",
"String",
"origWord",
")",
"{",
"AnalyzedTokenReadings",
"token",
"=",
"new",
"AnalyzedTokenReadings",
"(",
"new",
"AnalyzedToken",
"(",
"origWord",
",",
"null",
",",
"null",
")",
",",
"0",
")",
";",
"Determiner",
"dete... | Adds "a" or "an" to the English noun. Used for suggesting the proper form of the indefinite article.
For the rare cases where both "a" and "an" are considered okay (e.g. for "historical"), "a" is returned.
@param origWord Word that needs an article.
@return String containing the word with a determiner, or just the word... | [
"Adds",
"a",
"or",
"an",
"to",
"the",
"English",
"noun",
".",
"Used",
"for",
"suggesting",
"the",
"proper",
"form",
"of",
"the",
"indefinite",
"article",
".",
"For",
"the",
"rare",
"cases",
"where",
"both",
"a",
"and",
"an",
"are",
"considered",
"okay",
... | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AvsAnRule.java#L133-L143 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/ext/listen/ListenParamExtension.java | ListenParamExtension.resolveListenerGeneric | private Class<?> resolveListenerGeneric(final MethodGenericsContext generics, final Class listenerType,
final int position) {
"""
Resolve generic specified directly in listener parameter (e.g. {@code QueryListener<Model>}). It would be
useful if, for some reason, correc... | java | private Class<?> resolveListenerGeneric(final MethodGenericsContext generics, final Class listenerType,
final int position) {
// TO BE IMPROVED here must be correct resolution of RequiresRecordConversion generic, but it requires
// some improvements in generic... | [
"private",
"Class",
"<",
"?",
">",
"resolveListenerGeneric",
"(",
"final",
"MethodGenericsContext",
"generics",
",",
"final",
"Class",
"listenerType",
",",
"final",
"int",
"position",
")",
"{",
"// TO BE IMPROVED here must be correct resolution of RequiresRecordConversion gen... | Resolve generic specified directly in listener parameter (e.g. {@code QueryListener<Model>}). It would be
useful if, for some reason, correct type could not be resolved from listener instance (in most cases it
would be possible).
@param generics repository method generics context
@param listenerType type of specif... | [
"Resolve",
"generic",
"specified",
"directly",
"in",
"listener",
"parameter",
"(",
"e",
".",
"g",
".",
"{",
"@code",
"QueryListener<Model",
">",
"}",
")",
".",
"It",
"would",
"be",
"useful",
"if",
"for",
"some",
"reason",
"correct",
"type",
"could",
"not",... | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/ext/listen/ListenParamExtension.java#L121-L137 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateHierarchicalEntity | public OperationStatus updateHierarchicalEntity(UUID appId, String versionId, UUID hEntityId, HierarchicalEntityModel hierarchicalModelUpdateObject) {
"""
Updates the name and children of a hierarchical entity model.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierar... | java | public OperationStatus updateHierarchicalEntity(UUID appId, String versionId, UUID hEntityId, HierarchicalEntityModel hierarchicalModelUpdateObject) {
return updateHierarchicalEntityWithServiceResponseAsync(appId, versionId, hEntityId, hierarchicalModelUpdateObject).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updateHierarchicalEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
",",
"HierarchicalEntityModel",
"hierarchicalModelUpdateObject",
")",
"{",
"return",
"updateHierarchicalEntityWithServiceResponseAsync",
"(",
"... | Updates the name and children of a hierarchical entity model.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@param hierarchicalModelUpdateObject Model containing names of the children of the hierarchical entity.
@throws IllegalArgumentException... | [
"Updates",
"the",
"name",
"and",
"children",
"of",
"a",
"hierarchical",
"entity",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L3748-L3750 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/util/FontUtils.java | FontUtils.drawCenter | public static void drawCenter(Font font, String s, int x, int y, int width) {
"""
Draw text center justified
@param font The font to draw with
@param s The string to draw
@param x The x location to draw at
@param y The y location to draw at
@param width The width to fill with the text
"""
drawString(f... | java | public static void drawCenter(Font font, String s, int x, int y, int width) {
drawString(font, s, Alignment.CENTER, x, y, width, Color.white);
} | [
"public",
"static",
"void",
"drawCenter",
"(",
"Font",
"font",
",",
"String",
"s",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
")",
"{",
"drawString",
"(",
"font",
",",
"s",
",",
"Alignment",
".",
"CENTER",
",",
"x",
",",
"y",
",",
"wi... | Draw text center justified
@param font The font to draw with
@param s The string to draw
@param x The x location to draw at
@param y The y location to draw at
@param width The width to fill with the text | [
"Draw",
"text",
"center",
"justified"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/util/FontUtils.java#L51-L53 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/MATH.java | MATH.atan2_x | public static Atan2 atan2_x(Number xval) {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>return the arctangent2 of a set of coordinates (x, y), in radians;</i></div>
<div color='red' style="font-size:18px;color:red"><... | java | public static Atan2 atan2_x(Number xval) {
JcNumber sub = new JcNumber(xval, null, null);
return new Atan2(sub);
} | [
"public",
"static",
"Atan2",
"atan2_x",
"(",
"Number",
"xval",
")",
"{",
"JcNumber",
"sub",
"=",
"new",
"JcNumber",
"(",
"xval",
",",
"null",
",",
"null",
")",
";",
"return",
"new",
"Atan2",
"(",
"sub",
")",
";",
"}"
] | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>return the arctangent2 of a set of coordinates (x, y), in radians;</i></div>
<div color='red' style="font-size:18px;color:red"><i>specify the x coordinate</i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/MATH.java#L65-L68 |
pressgang-ccms/PressGangCCMSDatasourceProviders | rest-provider/src/main/java/org/jboss/pressgang/ccms/utils/RESTEntityCache.java | RESTEntityCache.buildKey | protected String buildKey(final Class<?> clazz, final String id, final Number revision) {
"""
Build the unique key to be used for caching entities.
@param clazz The class of the entity to be cached.
@param id The id of the entity to be cached.
@param revision The revision of the entity to be cached, or null i... | java | protected String buildKey(final Class<?> clazz, final String id, final Number revision) {
if (revision != null) {
return clazz.getSimpleName() + "-" + id + "-" + revision;
} else {
return clazz.getSimpleName() + "-" + id;
}
} | [
"protected",
"String",
"buildKey",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"id",
",",
"final",
"Number",
"revision",
")",
"{",
"if",
"(",
"revision",
"!=",
"null",
")",
"{",
"return",
"clazz",
".",
"getSimpleName",
"(",
"... | Build the unique key to be used for caching entities.
@param clazz The class of the entity to be cached.
@param id The id of the entity to be cached.
@param revision The revision of the entity to be cached, or null if it's the latest entity.
@return The unique key that can be used for caching. | [
"Build",
"the",
"unique",
"key",
"to",
"be",
"used",
"for",
"caching",
"entities",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSDatasourceProviders/blob/e47588adad0dcd55608b197b37825a512bc8fd25/rest-provider/src/main/java/org/jboss/pressgang/ccms/utils/RESTEntityCache.java#L206-L212 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/Collections2.java | Collections2.containsAllImpl | static boolean containsAllImpl(Collection<?> self, Collection<?> c) {
"""
Returns {@code true} if the collection {@code self} contains all of the
elements in the collection {@code c}.
<p>This method iterates over the specified collection {@code c}, checking
each element returned by the iterator in turn to see... | java | static boolean containsAllImpl(Collection<?> self, Collection<?> c) {
return Iterables.all(c, Predicates.in(self));
} | [
"static",
"boolean",
"containsAllImpl",
"(",
"Collection",
"<",
"?",
">",
"self",
",",
"Collection",
"<",
"?",
">",
"c",
")",
"{",
"return",
"Iterables",
".",
"all",
"(",
"c",
",",
"Predicates",
".",
"in",
"(",
"self",
")",
")",
";",
"}"
] | Returns {@code true} if the collection {@code self} contains all of the
elements in the collection {@code c}.
<p>This method iterates over the specified collection {@code c}, checking
each element returned by the iterator in turn to see if it is contained in
the specified collection {@code self}. If all elements are s... | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"collection",
"{",
"@code",
"self",
"}",
"contains",
"all",
"of",
"the",
"elements",
"in",
"the",
"collection",
"{",
"@code",
"c",
"}",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Collections2.java#L284-L286 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toCompoundCurve | public CompoundCurve toCompoundCurve(List<Polyline> polylineList,
boolean hasZ, boolean hasM) {
"""
Convert a list of {@link Polyline} to a {@link CompoundCurve}
@param polylineList polyline list
@param hasZ has z flag
@param hasM has m flag
@return co... | java | public CompoundCurve toCompoundCurve(List<Polyline> polylineList,
boolean hasZ, boolean hasM) {
CompoundCurve compoundCurve = new CompoundCurve(hasZ, hasM);
for (Polyline polyline : polylineList) {
LineString lineString = toLineString(polyline);
... | [
"public",
"CompoundCurve",
"toCompoundCurve",
"(",
"List",
"<",
"Polyline",
">",
"polylineList",
",",
"boolean",
"hasZ",
",",
"boolean",
"hasM",
")",
"{",
"CompoundCurve",
"compoundCurve",
"=",
"new",
"CompoundCurve",
"(",
"hasZ",
",",
"hasM",
")",
";",
"for",... | Convert a list of {@link Polyline} to a {@link CompoundCurve}
@param polylineList polyline list
@param hasZ has z flag
@param hasM has m flag
@return compound curve | [
"Convert",
"a",
"list",
"of",
"{",
"@link",
"Polyline",
"}",
"to",
"a",
"{",
"@link",
"CompoundCurve",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1136-L1147 |
Alluxio/alluxio | core/base/src/main/java/alluxio/util/io/PathUtils.java | PathUtils.normalizePath | public static String normalizePath(String path, String separator) {
"""
Adds a trailing separator if it does not exist in path.
@param path the file name
@param separator trailing separator to add
@return updated path with trailing separator
"""
return path.endsWith(separator) ? path : path + separato... | java | public static String normalizePath(String path, String separator) {
return path.endsWith(separator) ? path : path + separator;
} | [
"public",
"static",
"String",
"normalizePath",
"(",
"String",
"path",
",",
"String",
"separator",
")",
"{",
"return",
"path",
".",
"endsWith",
"(",
"separator",
")",
"?",
"path",
":",
"path",
"+",
"separator",
";",
"}"
] | Adds a trailing separator if it does not exist in path.
@param path the file name
@param separator trailing separator to add
@return updated path with trailing separator | [
"Adds",
"a",
"trailing",
"separator",
"if",
"it",
"does",
"not",
"exist",
"in",
"path",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/io/PathUtils.java#L288-L290 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/operations/ReadMasterDomainModelUtil.java | ReadMasterDomainModelUtil.processServerConfig | static void processServerConfig(final Resource root, final RequiredConfigurationHolder requiredConfigurationHolder, final IgnoredNonAffectedServerGroupsUtil.ServerConfigInfo serverConfig, final ExtensionRegistry extensionRegistry) {
"""
Determine the relevant pieces of configuration which need to be included when ... | java | static void processServerConfig(final Resource root, final RequiredConfigurationHolder requiredConfigurationHolder, final IgnoredNonAffectedServerGroupsUtil.ServerConfigInfo serverConfig, final ExtensionRegistry extensionRegistry) {
final Set<String> serverGroups = requiredConfigurationHolder.serverGroups;
... | [
"static",
"void",
"processServerConfig",
"(",
"final",
"Resource",
"root",
",",
"final",
"RequiredConfigurationHolder",
"requiredConfigurationHolder",
",",
"final",
"IgnoredNonAffectedServerGroupsUtil",
".",
"ServerConfigInfo",
"serverConfig",
",",
"final",
"ExtensionRegistry",... | Determine the relevant pieces of configuration which need to be included when processing the domain model.
@param root the resource root
@param requiredConfigurationHolder the resolution context
@param serverConfig the server config
@param extensionRegistry the extension registry | [
"Determine",
"the",
"relevant",
"pieces",
"of",
"configuration",
"which",
"need",
"to",
"be",
"included",
"when",
"processing",
"the",
"domain",
"model",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/operations/ReadMasterDomainModelUtil.java#L240-L268 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy2nd | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spy2nd(TriFunction<T1, T2, T3, R> function, Box<T2> param2) {
"""
Proxies a ternary function spying for second parameter
@param <R> the function result type
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@p... | java | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spy2nd(TriFunction<T1, T2, T3, R> function, Box<T2> param2) {
return spy(function, Box.<R>empty(), Box.<T1>empty(), param2, Box.<T3>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"spy2nd",
"(",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"function",
",",
"Box",
"<",
"T2"... | Proxies a ternary function spying for second parameter
@param <R> the function result type
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@param <T3> the function third parameter type
@param function the function that will be spied
@param param2 a box that will be containi... | [
"Proxies",
"a",
"ternary",
"function",
"spying",
"for",
"second",
"parameter"
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L224-L226 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java | P2sVpnGatewaysInner.createOrUpdate | public P2SVpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) {
"""
Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gat... | java | public P2SVpnGatewayInner createOrUpdate(String resourceGroupName, String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, p2SVpnGatewayParameters).toBlocking().last().body();
} | [
"public",
"P2SVpnGatewayInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
",",
"P2SVpnGatewayInner",
"p2SVpnGatewayParameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"gatewayName",
... | Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway.
@param resourceGroupName The resource group name of the P2SVpnGateway.
@param gatewayName The name of the gateway.
@param p2SVpnGatewayParameters Parameters supplied to create or Update a virtual wan p2s vpn gateway.
@throws I... | [
"Creates",
"a",
"virtual",
"wan",
"p2s",
"vpn",
"gateway",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnGatewaysInner.java#L223-L225 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java | JavacProcessingEnvironment.importStringToPattern | private static Pattern importStringToPattern(String s, Processor p, Log log) {
"""
Convert import-style string for supported annotations into a
regex matching that string. If the string is a valid
import-style string, return a regex that won't match anything.
"""
if (isValidImportString(s)) {
... | java | private static Pattern importStringToPattern(String s, Processor p, Log log) {
if (isValidImportString(s)) {
return validImportStringToPattern(s);
} else {
log.warning("proc.malformed.supported.string", s, p.getClass().getName());
return noMatches; // won't match any ... | [
"private",
"static",
"Pattern",
"importStringToPattern",
"(",
"String",
"s",
",",
"Processor",
"p",
",",
"Log",
"log",
")",
"{",
"if",
"(",
"isValidImportString",
"(",
"s",
")",
")",
"{",
"return",
"validImportStringToPattern",
"(",
"s",
")",
";",
"}",
"el... | Convert import-style string for supported annotations into a
regex matching that string. If the string is a valid
import-style string, return a regex that won't match anything. | [
"Convert",
"import",
"-",
"style",
"string",
"for",
"supported",
"annotations",
"into",
"a",
"regex",
"matching",
"that",
"string",
".",
"If",
"the",
"string",
"is",
"a",
"valid",
"import",
"-",
"style",
"string",
"return",
"a",
"regex",
"that",
"won",
"t"... | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java#L1456-L1463 |
plume-lib/options | src/main/java/org/plumelib/options/Options.java | Options.getEnumValue | private <T extends Enum<T>> T getEnumValue(Class<T> enumType, String name) {
"""
Behaves like {@link java.lang.Enum#valueOf}, except that {@code name} is case-insensitive and
hyphen-insensitive (hyphens can be used in place of underscores). This allows for greater
flexibility when specifying enum types as comman... | java | private <T extends Enum<T>> T getEnumValue(Class<T> enumType, String name) {
T[] constants = enumType.getEnumConstants();
if (constants == null) {
throw new IllegalArgumentException(enumType.getName() + " is not an enum type");
}
for (T constant : constants) {
if (constant.name().equalsIgnor... | [
"private",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getEnumValue",
"(",
"Class",
"<",
"T",
">",
"enumType",
",",
"String",
"name",
")",
"{",
"T",
"[",
"]",
"constants",
"=",
"enumType",
".",
"getEnumConstants",
"(",
")",
";",
"if",
"(... | Behaves like {@link java.lang.Enum#valueOf}, except that {@code name} is case-insensitive and
hyphen-insensitive (hyphens can be used in place of underscores). This allows for greater
flexibility when specifying enum types as command-line arguments.
@param <T> the enum type whose constant is to be returned
@param enum... | [
"Behaves",
"like",
"{",
"@link",
"java",
".",
"lang",
".",
"Enum#valueOf",
"}",
"except",
"that",
"{",
"@code",
"name",
"}",
"is",
"case",
"-",
"insensitive",
"and",
"hyphen",
"-",
"insensitive",
"(",
"hyphens",
"can",
"be",
"used",
"in",
"place",
"of",
... | train | https://github.com/plume-lib/options/blob/1bdd0ac7a1794bdf9dd373e279f69d43395154f0/src/main/java/org/plumelib/options/Options.java#L1460-L1473 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/FlexibleLOF.java | FlexibleLOF.computeLRDs | protected void computeLRDs(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore lrds) {
"""
Computes the local reachability density (LRD) of the specified objects.
@param knnq the precomputed neighborhood of the objects w.r.t. the
reachability distance
@param ids the ids of the objects
@param lrds Reachabili... | java | protected void computeLRDs(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore lrds) {
FiniteProgress lrdsProgress = LOG.isVerbose() ? new FiniteProgress("LRD", ids.size(), LOG) : null;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
final KNNList neighbors = knnq.getKNNForDBID(iter, krea... | [
"protected",
"void",
"computeLRDs",
"(",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"DBIDs",
"ids",
",",
"WritableDoubleDataStore",
"lrds",
")",
"{",
"FiniteProgress",
"lrdsProgress",
"=",
"LOG",
".",
"isVerbose",
"(",
")",
"?",
"new",
"FiniteProgress",
"(",
"\... | Computes the local reachability density (LRD) of the specified objects.
@param knnq the precomputed neighborhood of the objects w.r.t. the
reachability distance
@param ids the ids of the objects
@param lrds Reachability storage | [
"Computes",
"the",
"local",
"reachability",
"density",
"(",
"LRD",
")",
"of",
"the",
"specified",
"objects",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/FlexibleLOF.java#L250-L270 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/RepositoryManager.java | RepositoryManager.matchBaseEntryIgnoreCase | public static boolean matchBaseEntryIgnoreCase(List<String> baseEntries, String baseEntry) {
"""
Returns true if the baseEntries list contains the baseEntry. The
comparison is done using equalsIgnoreCase() to make sure that Turkish
locale I's are handled properly.
"""
boolean result = false;
... | java | public static boolean matchBaseEntryIgnoreCase(List<String> baseEntries, String baseEntry) {
boolean result = false;
if (baseEntries != null && baseEntry != null) {
for (int i = 0; i < baseEntries.size(); i++) {
if (baseEntry.equalsIgnoreCase(baseEntries.get(i))) {
... | [
"public",
"static",
"boolean",
"matchBaseEntryIgnoreCase",
"(",
"List",
"<",
"String",
">",
"baseEntries",
",",
"String",
"baseEntry",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"baseEntries",
"!=",
"null",
"&&",
"baseEntry",
"!=",
"null",
... | Returns true if the baseEntries list contains the baseEntry. The
comparison is done using equalsIgnoreCase() to make sure that Turkish
locale I's are handled properly. | [
"Returns",
"true",
"if",
"the",
"baseEntries",
"list",
"contains",
"the",
"baseEntry",
".",
"The",
"comparison",
"is",
"done",
"using",
"equalsIgnoreCase",
"()",
"to",
"make",
"sure",
"that",
"Turkish",
"locale",
"I",
"s",
"are",
"handled",
"properly",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/RepositoryManager.java#L211-L223 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java | Decimal.sround | public static Decimal sround(Decimal b0, int r) {
"""
SQL <code>ROUND</code> operator applied to BigDecimal values.
"""
if (r >= b0.scale) {
return b0;
}
BigDecimal b2 = b0.toBigDecimal().movePointRight(r)
.setScale(0, RoundingMode.HALF_UP)
.movePointLeft(r);
int p = b0.precision;
int s =... | java | public static Decimal sround(Decimal b0, int r) {
if (r >= b0.scale) {
return b0;
}
BigDecimal b2 = b0.toBigDecimal().movePointRight(r)
.setScale(0, RoundingMode.HALF_UP)
.movePointLeft(r);
int p = b0.precision;
int s = b0.scale;
if (r < 0) {
return fromBigDecimal(b2, Math.min(38, 1 + p - s),... | [
"public",
"static",
"Decimal",
"sround",
"(",
"Decimal",
"b0",
",",
"int",
"r",
")",
"{",
"if",
"(",
"r",
">=",
"b0",
".",
"scale",
")",
"{",
"return",
"b0",
";",
"}",
"BigDecimal",
"b2",
"=",
"b0",
".",
"toBigDecimal",
"(",
")",
".",
"movePointRig... | SQL <code>ROUND</code> operator applied to BigDecimal values. | [
"SQL",
"<code",
">",
"ROUND<",
"/",
"code",
">",
"operator",
"applied",
"to",
"BigDecimal",
"values",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/Decimal.java#L449-L464 |
aws/aws-sdk-java | aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/Configuration.java | Configuration.withTags | public Configuration withTags(java.util.Map<String, String> tags) {
"""
The list of all tags associated with this configuration.
@param tags
The list of all tags associated with this configuration.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags... | java | public Configuration withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"Configuration",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | The list of all tags associated with this configuration.
@param tags
The list of all tags associated with this configuration.
@return Returns a reference to this object so that method calls can be chained together. | [
"The",
"list",
"of",
"all",
"tags",
"associated",
"with",
"this",
"configuration",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/Configuration.java#L384-L387 |
line/armeria | saml/src/main/java/com/linecorp/armeria/server/saml/HttpRedirectBindingUtil.java | HttpRedirectBindingUtil.validateSignature | private static void validateSignature(Credential validationCredential,
SamlParameters parameters,
String messageParamName) {
"""
Validates a signature in the specified {@link AggregatedHttpMessage}.
"""
requireNonNull(v... | java | private static void validateSignature(Credential validationCredential,
SamlParameters parameters,
String messageParamName) {
requireNonNull(validationCredential, "validationCredential");
requireNonNull(parameters, "param... | [
"private",
"static",
"void",
"validateSignature",
"(",
"Credential",
"validationCredential",
",",
"SamlParameters",
"parameters",
",",
"String",
"messageParamName",
")",
"{",
"requireNonNull",
"(",
"validationCredential",
",",
"\"validationCredential\"",
")",
";",
"requir... | Validates a signature in the specified {@link AggregatedHttpMessage}. | [
"Validates",
"a",
"signature",
"in",
"the",
"specified",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/saml/src/main/java/com/linecorp/armeria/server/saml/HttpRedirectBindingUtil.java#L132-L166 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java | SortedBugCollection.readXML | public void readXML(File file) throws IOException, DocumentException {
"""
Read XML data from given file into this object, populating given Project
as a side effect.
@param file
the file
"""
project.setCurrentWorkingDirectory(file.getParentFile());
dataSource = file.getAbsolutePath();
... | java | public void readXML(File file) throws IOException, DocumentException {
project.setCurrentWorkingDirectory(file.getParentFile());
dataSource = file.getAbsolutePath();
InputStream in = progessMonitoredInputStream(file, "Loading analysis");
try {
readXML(in, file);
} cat... | [
"public",
"void",
"readXML",
"(",
"File",
"file",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"project",
".",
"setCurrentWorkingDirectory",
"(",
"file",
".",
"getParentFile",
"(",
")",
")",
";",
"dataSource",
"=",
"file",
".",
"getAbsolutePath",... | Read XML data from given file into this object, populating given Project
as a side effect.
@param file
the file | [
"Read",
"XML",
"data",
"from",
"given",
"file",
"into",
"this",
"object",
"populating",
"given",
"Project",
"as",
"a",
"side",
"effect",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java#L267-L278 |
google/allocation-instrumenter | src/main/java/com/google/monitoring/runtime/instrumentation/AllocationRecorder.java | AllocationRecorder.getObjectSize | private static long getObjectSize(Object obj, boolean isArray, Instrumentation instr) {
"""
Returns the size of the given object. If the object is not an array, we check the cache first,
and update it as necessary.
@param obj the object.
@param isArray indicates if the given object is an array.
@param instr ... | java | private static long getObjectSize(Object obj, boolean isArray, Instrumentation instr) {
if (isArray) {
return instr.getObjectSize(obj);
}
Class<?> clazz = obj.getClass();
Long classSize = classSizesMap.get(clazz);
if (classSize == null) {
classSize = instr.getObjectSize(obj);
clas... | [
"private",
"static",
"long",
"getObjectSize",
"(",
"Object",
"obj",
",",
"boolean",
"isArray",
",",
"Instrumentation",
"instr",
")",
"{",
"if",
"(",
"isArray",
")",
"{",
"return",
"instr",
".",
"getObjectSize",
"(",
"obj",
")",
";",
"}",
"Class",
"<",
"?... | Returns the size of the given object. If the object is not an array, we check the cache first,
and update it as necessary.
@param obj the object.
@param isArray indicates if the given object is an array.
@param instr the instrumentation object to use for finding the object size
@return the size of the given object. | [
"Returns",
"the",
"size",
"of",
"the",
"given",
"object",
".",
"If",
"the",
"object",
"is",
"not",
"an",
"array",
"we",
"check",
"the",
"cache",
"first",
"and",
"update",
"it",
"as",
"necessary",
"."
] | train | https://github.com/google/allocation-instrumenter/blob/58d8473e8832e51f39ae7aa38328f61c4b747bff/src/main/java/com/google/monitoring/runtime/instrumentation/AllocationRecorder.java#L180-L193 |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java | GenericStats.getStatValueAsDouble | public double getStatValueAsDouble(T metric, String interval) {
"""
Get value of provided metric for the given interval as double value.
@param metric metric which value we wanna get
@param interval the name of the Interval or <code>null</code> to get the absolute value
@return the current value
"""
... | java | public double getStatValueAsDouble(T metric, String interval) {
StatValue statValue = getMonitoredStatValue(metric);
if (metric.isRateMetric()) {
//check for DEFAULT can be removed when same check removed from statValueImpl
if("default".equals(interval)) {
interva... | [
"public",
"double",
"getStatValueAsDouble",
"(",
"T",
"metric",
",",
"String",
"interval",
")",
"{",
"StatValue",
"statValue",
"=",
"getMonitoredStatValue",
"(",
"metric",
")",
";",
"if",
"(",
"metric",
".",
"isRateMetric",
"(",
")",
")",
"{",
"//check for DEF... | Get value of provided metric for the given interval as double value.
@param metric metric which value we wanna get
@param interval the name of the Interval or <code>null</code> to get the absolute value
@return the current value | [
"Get",
"value",
"of",
"provided",
"metric",
"for",
"the",
"given",
"interval",
"as",
"double",
"value",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java#L204-L218 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java | ParseTreeUtils.collectNodesByPath | public static <V, C extends Collection<Node<V>>> C collectNodesByPath(Node<V> parent, String path, C collection) {
"""
Collects all nodes underneath the given parent that match the given path.
The path is a '/' separated list of node label prefixes describing the ancestor chain of the node to look for
relative t... | java | public static <V, C extends Collection<Node<V>>> C collectNodesByPath(Node<V> parent, String path, C collection) {
checkArgNotNull(path, "path");
checkArgNotNull(collection, "collection");
return parent != null && hasChildren(parent) ?
collectNodesByPath(parent.getChildren(), pat... | [
"public",
"static",
"<",
"V",
",",
"C",
"extends",
"Collection",
"<",
"Node",
"<",
"V",
">",
">",
">",
"C",
"collectNodesByPath",
"(",
"Node",
"<",
"V",
">",
"parent",
",",
"String",
"path",
",",
"C",
"collection",
")",
"{",
"checkArgNotNull",
"(",
"... | Collects all nodes underneath the given parent that match the given path.
The path is a '/' separated list of node label prefixes describing the ancestor chain of the node to look for
relative to the given parent node.
@param parent the parent Node
@param path the path to the Nodes being searched for
@param ... | [
"Collects",
"all",
"nodes",
"underneath",
"the",
"given",
"parent",
"that",
"match",
"the",
"given",
"path",
".",
"The",
"path",
"is",
"a",
"/",
"separated",
"list",
"of",
"node",
"label",
"prefixes",
"describing",
"the",
"ancestor",
"chain",
"of",
"the",
... | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java#L98-L103 |
minio/minio-java | api/src/main/java/io/minio/Signer.java | Signer.signV4 | public static Request signV4(Request request, String region, String accessKey, String secretKey)
throws NoSuchAlgorithmException, InvalidKeyException {
"""
Returns signed request object for given request, region, access key and secret key.
"""
String contentSha256 = request.header("x-amz-content-sha256... | java | public static Request signV4(Request request, String region, String accessKey, String secretKey)
throws NoSuchAlgorithmException, InvalidKeyException {
String contentSha256 = request.header("x-amz-content-sha256");
DateTime date = DateFormat.AMZ_DATE_FORMAT.parseDateTime(request.header("x-amz-date"));
... | [
"public",
"static",
"Request",
"signV4",
"(",
"Request",
"request",
",",
"String",
"region",
",",
"String",
"accessKey",
",",
"String",
"secretKey",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"String",
"contentSha256",
"=",
"request"... | Returns signed request object for given request, region, access key and secret key. | [
"Returns",
"signed",
"request",
"object",
"for",
"given",
"request",
"region",
"access",
"key",
"and",
"secret",
"key",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/Signer.java#L276-L290 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.email_exchange_organizationName_service_exchangeService_accountUpgrade_duration_POST | public OvhOrder email_exchange_organizationName_service_exchangeService_accountUpgrade_duration_POST(String organizationName, String exchangeService, String duration, OvhAccountQuotaEnum newQuota, String primaryEmailAddress) throws IOException {
"""
Create order
REST: POST /order/email/exchange/{organizationNam... | java | public OvhOrder email_exchange_organizationName_service_exchangeService_accountUpgrade_duration_POST(String organizationName, String exchangeService, String duration, OvhAccountQuotaEnum newQuota, String primaryEmailAddress) throws IOException {
String qPath = "/order/email/exchange/{organizationName}/service/{exchan... | [
"public",
"OvhOrder",
"email_exchange_organizationName_service_exchangeService_accountUpgrade_duration_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"duration",
",",
"OvhAccountQuotaEnum",
"newQuota",
",",
"String",
"primaryEmailAddress"... | Create order
REST: POST /order/email/exchange/{organizationName}/service/{exchangeService}/accountUpgrade/{duration}
@param newQuota [required] New storage quota for that account
@param primaryEmailAddress [required] The account you wish to upgrade
@param organizationName [required] The internal name of your exchange ... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4003-L4011 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/JobConfigurationUtils.java | JobConfigurationUtils.putConfigurationIntoProperties | public static void putConfigurationIntoProperties(Configuration configuration, Properties properties) {
"""
Put all configuration properties in a given {@link Configuration} object into a given
{@link Properties} object.
@param configuration the given {@link Configuration} object
@param properties the given {... | java | public static void putConfigurationIntoProperties(Configuration configuration, Properties properties) {
for (Iterator<Entry<String, String>> it = configuration.iterator(); it.hasNext();) {
Entry<String, String> entry = it.next();
properties.put(entry.getKey(), entry.getValue());
}
} | [
"public",
"static",
"void",
"putConfigurationIntoProperties",
"(",
"Configuration",
"configuration",
",",
"Properties",
"properties",
")",
"{",
"for",
"(",
"Iterator",
"<",
"Entry",
"<",
"String",
",",
"String",
">",
">",
"it",
"=",
"configuration",
".",
"iterat... | Put all configuration properties in a given {@link Configuration} object into a given
{@link Properties} object.
@param configuration the given {@link Configuration} object
@param properties the given {@link Properties} object | [
"Put",
"all",
"configuration",
"properties",
"in",
"a",
"given",
"{",
"@link",
"Configuration",
"}",
"object",
"into",
"a",
"given",
"{",
"@link",
"Properties",
"}",
"object",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/JobConfigurationUtils.java#L79-L84 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java | Long.valueOf | public static Long valueOf(String s, int radix) throws NumberFormatException {
"""
Returns a {@code Long} object holding the value
extracted from the specified {@code String} when parsed
with the radix given by the second argument. The first
argument is interpreted as representing a signed
{@code long} in the... | java | public static Long valueOf(String s, int radix) throws NumberFormatException {
return Long.valueOf(parseLong(s, radix));
} | [
"public",
"static",
"Long",
"valueOf",
"(",
"String",
"s",
",",
"int",
"radix",
")",
"throws",
"NumberFormatException",
"{",
"return",
"Long",
".",
"valueOf",
"(",
"parseLong",
"(",
"s",
",",
"radix",
")",
")",
";",
"}"
] | Returns a {@code Long} object holding the value
extracted from the specified {@code String} when parsed
with the radix given by the second argument. The first
argument is interpreted as representing a signed
{@code long} in the radix specified by the second
argument, exactly as if the arguments were given to the {@lin... | [
"Returns",
"a",
"{",
"@code",
"Long",
"}",
"object",
"holding",
"the",
"value",
"extracted",
"from",
"the",
"specified",
"{",
"@code",
"String",
"}",
"when",
"parsed",
"with",
"the",
"radix",
"given",
"by",
"the",
"second",
"argument",
".",
"The",
"first",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java#L611-L613 |
dwdyer/watchmaker | framework/src/java/main/org/uncommons/watchmaker/framework/CachingFitnessEvaluator.java | CachingFitnessEvaluator.getFitness | public double getFitness(T candidate, List<? extends T> population) {
"""
{@inheritDoc}
<p>This implementation performs a cache look-up every time it is invoked. If the
fitness evaluator has already calculated the fitness score for the specified
candidate that score is returned without delegating to the wrap... | java | public double getFitness(T candidate, List<? extends T> population)
{
Double fitness = cache.get(candidate);
if (fitness == null)
{
fitness = delegate.getFitness(candidate, population);
cache.put(candidate, fitness);
}
return fitness;
} | [
"public",
"double",
"getFitness",
"(",
"T",
"candidate",
",",
"List",
"<",
"?",
"extends",
"T",
">",
"population",
")",
"{",
"Double",
"fitness",
"=",
"cache",
".",
"get",
"(",
"candidate",
")",
";",
"if",
"(",
"fitness",
"==",
"null",
")",
"{",
"fit... | {@inheritDoc}
<p>This implementation performs a cache look-up every time it is invoked. If the
fitness evaluator has already calculated the fitness score for the specified
candidate that score is returned without delegating to the wrapped evaluator.</p> | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/framework/src/java/main/org/uncommons/watchmaker/framework/CachingFitnessEvaluator.java#L78-L87 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createDeployKey | public GitlabSSHKey createDeployKey(Integer targetProjectId, String title, String key) throws IOException {
"""
Create a new deploy key for the project
@param targetProjectId The id of the Gitlab project
@param title The title of the ssh key
@param key The public key
@return The new Git... | java | public GitlabSSHKey createDeployKey(Integer targetProjectId, String title, String key) throws IOException {
return createDeployKey(targetProjectId, title, key, false);
} | [
"public",
"GitlabSSHKey",
"createDeployKey",
"(",
"Integer",
"targetProjectId",
",",
"String",
"title",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"return",
"createDeployKey",
"(",
"targetProjectId",
",",
"title",
",",
"key",
",",
"false",
")",
";"... | Create a new deploy key for the project
@param targetProjectId The id of the Gitlab project
@param title The title of the ssh key
@param key The public key
@return The new GitlabSSHKey
@throws IOException on gitlab api call error | [
"Create",
"a",
"new",
"deploy",
"key",
"for",
"the",
"project"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3167-L3169 |
jenetics/jenetics | jenetics.ext/src/main/java/io/jenetics/ext/internal/random.java | random.nextLong | public static long nextLong(final long n, final Random random) {
"""
Returns a pseudo-random, uniformly distributed int value between 0
(inclusive) and the specified value (exclusive), drawn from the given
random number generator's sequence.
@param n the bound on the random number to be returned. Must be
pos... | java | public static long nextLong(final long n, final Random random) {
if (n <= 0) {
throw new IllegalArgumentException(format(
"n is smaller than one: %d", n
));
}
long bits;
long result;
do {
bits = random.nextLong() & 0x7fffffffffffffffL;
result = bits%n;
} while (bits - result + (n - 1) < 0);... | [
"public",
"static",
"long",
"nextLong",
"(",
"final",
"long",
"n",
",",
"final",
"Random",
"random",
")",
"{",
"if",
"(",
"n",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"format",
"(",
"\"n is smaller than one: %d\"",
",",
"n",
"... | Returns a pseudo-random, uniformly distributed int value between 0
(inclusive) and the specified value (exclusive), drawn from the given
random number generator's sequence.
@param n the bound on the random number to be returned. Must be
positive.
@param random the random engine used for creating the random number.
@re... | [
"Returns",
"a",
"pseudo",
"-",
"random",
"uniformly",
"distributed",
"int",
"value",
"between",
"0",
"(",
"inclusive",
")",
"and",
"the",
"specified",
"value",
"(",
"exclusive",
")",
"drawn",
"from",
"the",
"given",
"random",
"number",
"generator",
"s",
"seq... | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics.ext/src/main/java/io/jenetics/ext/internal/random.java#L50-L65 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.addGreaterThanField | public void addGreaterThanField(String attribute, Object value) {
"""
Adds Greater Than (>) criteria,
customer_id > person_id
@param attribute The field name to be used
@param value The field to compare with
"""
// PAW
// addSelectionCriteria(FieldCriteria.buildGreaterCriteria(attribute, v... | java | public void addGreaterThanField(String attribute, Object value)
{
// PAW
// addSelectionCriteria(FieldCriteria.buildGreaterCriteria(attribute, value, getAlias()));
addSelectionCriteria(FieldCriteria.buildGreaterCriteria(attribute, value, getUserAlias(attribute)));
} | [
"public",
"void",
"addGreaterThanField",
"(",
"String",
"attribute",
",",
"Object",
"value",
")",
"{",
"// PAW\r",
"// addSelectionCriteria(FieldCriteria.buildGreaterCriteria(attribute, value, getAlias()));\r",
"addSelectionCriteria",
"(",
"FieldCriteria",
".",
"buildGreaterCriteri... | Adds Greater Than (>) criteria,
customer_id > person_id
@param attribute The field name to be used
@param value The field to compare with | [
"Adds",
"Greater",
"Than",
"(",
">",
")",
"criteria",
"customer_id",
">",
"person_id"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L521-L526 |
timehop/sticky-headers-recyclerview | library/src/main/java/com/timehop/stickyheadersrecyclerview/calculation/DimensionCalculator.java | DimensionCalculator.initMarginRect | private void initMarginRect(Rect marginRect, MarginLayoutParams marginLayoutParams) {
"""
Converts {@link MarginLayoutParams} into a representative {@link Rect}.
@param marginRect Rect to be initialized with margins coordinates, where
{@link MarginLayoutParams#leftMargin} is equivalent to {@link Rect#left}, et... | java | private void initMarginRect(Rect marginRect, MarginLayoutParams marginLayoutParams) {
marginRect.set(
marginLayoutParams.leftMargin,
marginLayoutParams.topMargin,
marginLayoutParams.rightMargin,
marginLayoutParams.bottomMargin
);
} | [
"private",
"void",
"initMarginRect",
"(",
"Rect",
"marginRect",
",",
"MarginLayoutParams",
"marginLayoutParams",
")",
"{",
"marginRect",
".",
"set",
"(",
"marginLayoutParams",
".",
"leftMargin",
",",
"marginLayoutParams",
".",
"topMargin",
",",
"marginLayoutParams",
"... | Converts {@link MarginLayoutParams} into a representative {@link Rect}.
@param marginRect Rect to be initialized with margins coordinates, where
{@link MarginLayoutParams#leftMargin} is equivalent to {@link Rect#left}, etc.
@param marginLayoutParams margins to populate the Rect with | [
"Converts",
"{",
"@link",
"MarginLayoutParams",
"}",
"into",
"a",
"representative",
"{",
"@link",
"Rect",
"}",
"."
] | train | https://github.com/timehop/sticky-headers-recyclerview/blob/f5a9e9b8f5d96734e20439b0a41381865fa52fb7/library/src/main/java/com/timehop/stickyheadersrecyclerview/calculation/DimensionCalculator.java#L39-L46 |
kiswanij/jk-util | src/main/java/com/jk/util/zip/JKZipUtility.java | JKZipUtility.extractFile | protected static void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
"""
Extracts a zip entry (file entry)
@param zipIn
@param filePath
@throws IOException
"""
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
byte[] bytesIn = new byte[BUFF... | java | protected static void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
byte[] bytesIn = new byte[BUFFER_SIZE];
int read = 0;
while ((read = zipIn.read(bytesIn)) != -1) {
bos.write(bytesIn, 0, read... | [
"protected",
"static",
"void",
"extractFile",
"(",
"ZipInputStream",
"zipIn",
",",
"String",
"filePath",
")",
"throws",
"IOException",
"{",
"BufferedOutputStream",
"bos",
"=",
"new",
"BufferedOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"filePath",
")",
")",
... | Extracts a zip entry (file entry)
@param zipIn
@param filePath
@throws IOException | [
"Extracts",
"a",
"zip",
"entry",
"(",
"file",
"entry",
")"
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/zip/JKZipUtility.java#L69-L77 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java | CollectionLiteralsTypeComputer.handleCollectionTypeNotAvailable | protected void handleCollectionTypeNotAvailable(XCollectionLiteral literal, ITypeComputationState state, Class<?> clazz) {
"""
Process all children and assign an unknown type to the literal.
"""
for(XExpression element: literal.getElements()) {
state.withNonVoidExpectation().computeTypes(element);
}
s... | java | protected void handleCollectionTypeNotAvailable(XCollectionLiteral literal, ITypeComputationState state, Class<?> clazz) {
for(XExpression element: literal.getElements()) {
state.withNonVoidExpectation().computeTypes(element);
}
state.acceptActualType(state.getReferenceOwner().newUnknownTypeReference(clazz.get... | [
"protected",
"void",
"handleCollectionTypeNotAvailable",
"(",
"XCollectionLiteral",
"literal",
",",
"ITypeComputationState",
"state",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"for",
"(",
"XExpression",
"element",
":",
"literal",
".",
"getElements",
"(",
")"... | Process all children and assign an unknown type to the literal. | [
"Process",
"all",
"children",
"and",
"assign",
"an",
"unknown",
"type",
"to",
"the",
"literal",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java#L208-L213 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElAnalyzer.java | ElAnalyzer.analyzeQuery | public static ElDescriptor analyzeQuery(final GenericsContext genericsContext, final String query) {
"""
Analyze query string for variables.
@param genericsContext generics context (set to the method owner type)
@param query query string
@return descriptor object if variables found, null otherwise
... | java | public static ElDescriptor analyzeQuery(final GenericsContext genericsContext, final String query) {
final List<String> vars = ElUtils.findVars(query);
ElDescriptor descriptor = null;
if (!vars.isEmpty()) {
descriptor = new ElDescriptor(vars);
checkGenericVars(descriptor,... | [
"public",
"static",
"ElDescriptor",
"analyzeQuery",
"(",
"final",
"GenericsContext",
"genericsContext",
",",
"final",
"String",
"query",
")",
"{",
"final",
"List",
"<",
"String",
">",
"vars",
"=",
"ElUtils",
".",
"findVars",
"(",
"query",
")",
";",
"ElDescript... | Analyze query string for variables.
@param genericsContext generics context (set to the method owner type)
@param query query string
@return descriptor object if variables found, null otherwise | [
"Analyze",
"query",
"string",
"for",
"variables",
"."
] | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElAnalyzer.java#L31-L39 |
alkacon/opencms-core | src/org/opencms/site/xmlsitemap/CmsXmlSitemapGenerator.java | CmsXmlSitemapGenerator.getDetailLink | protected String getDetailLink(CmsResource pageRes, CmsResource detailRes, Locale locale) {
"""
Gets the detail link for a given container page and detail content.<p>
@param pageRes the container page
@param detailRes the detail content
@param locale the locale for which we want the link
@return the detail... | java | protected String getDetailLink(CmsResource pageRes, CmsResource detailRes, Locale locale) {
String pageSitePath = m_siteGuestCms.getSitePath(pageRes);
String detailSitePath = m_siteGuestCms.getSitePath(detailRes);
CmsRequestContext requestContext = m_siteGuestCms.getRequestContext();
... | [
"protected",
"String",
"getDetailLink",
"(",
"CmsResource",
"pageRes",
",",
"CmsResource",
"detailRes",
",",
"Locale",
"locale",
")",
"{",
"String",
"pageSitePath",
"=",
"m_siteGuestCms",
".",
"getSitePath",
"(",
"pageRes",
")",
";",
"String",
"detailSitePath",
"=... | Gets the detail link for a given container page and detail content.<p>
@param pageRes the container page
@param detailRes the detail content
@param locale the locale for which we want the link
@return the detail page link | [
"Gets",
"the",
"detail",
"link",
"for",
"a",
"given",
"container",
"page",
"and",
"detail",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/xmlsitemap/CmsXmlSitemapGenerator.java#L494-L509 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/expression/Uris.java | Uris.unescapePath | public String unescapePath(final String text, final String encoding) {
"""
<p>
Perform am URI path <strong>unescape</strong> operation
on a {@code String} input.
</p>
<p>
This method simply calls the equivalent method in the {@code UriEscape} class from the
<a href="http://www.unbescape.org">Unbescape</a> li... | java | public String unescapePath(final String text, final String encoding) {
return UriEscape.unescapeUriPath(text, encoding);
} | [
"public",
"String",
"unescapePath",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"return",
"UriEscape",
".",
"unescapeUriPath",
"(",
"text",
",",
"encoding",
")",
";",
"}"
] | <p>
Perform am URI path <strong>unescape</strong> operation
on a {@code String} input.
</p>
<p>
This method simply calls the equivalent method in the {@code UriEscape} class from the
<a href="http://www.unbescape.org">Unbescape</a> library.
</p>
<p>
This method will unescape every percent-encoded ({@code %HH}) sequence... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"{",
"@code",
"String",
"}",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method",
"simply",
"calls",
"the",
"equivalent",
"m... | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/expression/Uris.java#L187-L189 |
samskivert/pythagoras | src/main/java/pythagoras/d/Matrix4.java | Matrix4.setToTransform | public Matrix4 setToTransform (IVector3 translation, IQuaternion rotation) {
"""
Sets this to a matrix that first rotates, then translates.
@return a reference to this matrix, for chaining.
"""
return setToRotation(rotation).setTranslation(translation);
} | java | public Matrix4 setToTransform (IVector3 translation, IQuaternion rotation) {
return setToRotation(rotation).setTranslation(translation);
} | [
"public",
"Matrix4",
"setToTransform",
"(",
"IVector3",
"translation",
",",
"IQuaternion",
"rotation",
")",
"{",
"return",
"setToRotation",
"(",
"rotation",
")",
".",
"setTranslation",
"(",
"translation",
")",
";",
"}"
] | Sets this to a matrix that first rotates, then translates.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"matrix",
"that",
"first",
"rotates",
"then",
"translates",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Matrix4.java#L103-L105 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/OutputsInner.java | OutputsInner.createOrReplace | public OutputInner createOrReplace(String resourceGroupName, String jobName, String outputName, OutputInner output, String ifMatch, String ifNoneMatch) {
"""
Creates an output or replaces an already existing output under an existing streaming job.
@param resourceGroupName The name of the resource group that con... | java | public OutputInner createOrReplace(String resourceGroupName, String jobName, String outputName, OutputInner output, String ifMatch, String ifNoneMatch) {
return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, outputName, output, ifMatch, ifNoneMatch).toBlocking().single().body();
} | [
"public",
"OutputInner",
"createOrReplace",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"outputName",
",",
"OutputInner",
"output",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
"{",
"return",
"createOrReplaceWithService... | Creates an output or replaces an already existing output under an existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param outputName The ... | [
"Creates",
"an",
"output",
"or",
"replaces",
"an",
"already",
"existing",
"output",
"under",
"an",
"existing",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/OutputsInner.java#L214-L216 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.disableComputeNodeScheduling | public void disableComputeNodeScheduling(String poolId, String nodeId, DisableComputeNodeSchedulingOption nodeDisableSchedulingOption) throws BatchErrorException, IOException {
"""
Disables task scheduling on the specified compute node.
@param poolId The ID of the pool.
@param nodeId The ID of the compute node... | java | public void disableComputeNodeScheduling(String poolId, String nodeId, DisableComputeNodeSchedulingOption nodeDisableSchedulingOption) throws BatchErrorException, IOException {
disableComputeNodeScheduling(poolId, nodeId, nodeDisableSchedulingOption, null);
} | [
"public",
"void",
"disableComputeNodeScheduling",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"DisableComputeNodeSchedulingOption",
"nodeDisableSchedulingOption",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"disableComputeNodeScheduling",
"(",
"p... | Disables task scheduling on the specified compute node.
@param poolId The ID of the pool.
@param nodeId The ID of the compute node.
@param nodeDisableSchedulingOption Specifies what to do with currently running tasks.
@throws BatchErrorException Exception thrown when an error response is received from the Batch servic... | [
"Disables",
"task",
"scheduling",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L381-L383 |
apache/incubator-gobblin | gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/data/management/trash/TrashCollectorJob.java | TrashCollectorJob.moveToTrash | public static boolean moveToTrash(FileSystem fs, Path path, Props props) throws IOException {
"""
Move a path to trash. The absolute path of the input path will be replicated under the trash directory.
@param fs {@link org.apache.hadoop.fs.FileSystem} where path and trash exist.
@param path {@link org.apache.had... | java | public static boolean moveToTrash(FileSystem fs, Path path, Props props) throws IOException {
return TrashFactory.createTrash(fs, props.toProperties()).moveToTrash(path);
} | [
"public",
"static",
"boolean",
"moveToTrash",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"Props",
"props",
")",
"throws",
"IOException",
"{",
"return",
"TrashFactory",
".",
"createTrash",
"(",
"fs",
",",
"props",
".",
"toProperties",
"(",
")",
")",
... | Move a path to trash. The absolute path of the input path will be replicated under the trash directory.
@param fs {@link org.apache.hadoop.fs.FileSystem} where path and trash exist.
@param path {@link org.apache.hadoop.fs.FileSystem} path to move to trash.
@param props {@link java.util.Properties} containing trash conf... | [
"Move",
"a",
"path",
"to",
"trash",
".",
"The",
"absolute",
"path",
"of",
"the",
"input",
"path",
"will",
"be",
"replicated",
"under",
"the",
"trash",
"directory",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-azkaban/src/main/java/org/apache/gobblin/data/management/trash/TrashCollectorJob.java#L67-L69 |
h2oai/h2o-3 | h2o-core/src/main/java/water/parser/Parser.java | Parser.readOneFile | private StreamInfo readOneFile(final InputStream is, final StreamParseWriter dout, InputStream bvs,
StreamParseWriter nextChunk, int zidx, int fileIndex) throws IOException {
"""
This method reads in one zip file. Before reading the file, it will check if the current file has the ... | java | private StreamInfo readOneFile(final InputStream is, final StreamParseWriter dout, InputStream bvs,
StreamParseWriter nextChunk, int zidx, int fileIndex) throws IOException {
int cidx = 0;
StreamData din = new StreamData(is);
// only check header for 2nd file onward since gu... | [
"private",
"StreamInfo",
"readOneFile",
"(",
"final",
"InputStream",
"is",
",",
"final",
"StreamParseWriter",
"dout",
",",
"InputStream",
"bvs",
",",
"StreamParseWriter",
"nextChunk",
",",
"int",
"zidx",
",",
"int",
"fileIndex",
")",
"throws",
"IOException",
"{",
... | This method reads in one zip file. Before reading the file, it will check if the current file has the same
number of columns and separator type as the previous files it has parssed. If they do not match, no file will
be parsed in this case.
@param is
@param dout
@param bvs
@param nextChunk
@param zidx
@return
@throw... | [
"This",
"method",
"reads",
"in",
"one",
"zip",
"file",
".",
"Before",
"reading",
"the",
"file",
"it",
"will",
"check",
"if",
"the",
"current",
"file",
"has",
"the",
"same",
"number",
"of",
"columns",
"and",
"separator",
"type",
"as",
"the",
"previous",
"... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/parser/Parser.java#L193-L217 |
jglobus/JGlobus | gss/src/main/java/org/globus/gsi/gssapi/SSLUtil.java | SSLUtil.writeInt | public static void writeInt(int v, byte[] buf, int off) {
"""
Converts the specified int value into
4 bytes. The bytes are put into the
specified byte array at a given offset
location.
@param v the int value to convert into 4 bytes.
@param buf the byte array to put the resulting
4 bytes.
@param off offset... | java | public static void writeInt(int v, byte[] buf, int off) {
buf[off] = (byte)((v >>> 24) & 0xFF);
buf[off+1] = (byte)((v >>> 16) & 0xFF);
buf[off+2] = (byte)((v >>> 8) & 0xFF);
buf[off+3] = (byte)((v >>> 0) & 0xFF);
} | [
"public",
"static",
"void",
"writeInt",
"(",
"int",
"v",
",",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
")",
"{",
"buf",
"[",
"off",
"]",
"=",
"(",
"byte",
")",
"(",
"(",
"v",
">>>",
"24",
")",
"&",
"0xFF",
")",
";",
"buf",
"[",
"off",
"+... | Converts the specified int value into
4 bytes. The bytes are put into the
specified byte array at a given offset
location.
@param v the int value to convert into 4 bytes.
@param buf the byte array to put the resulting
4 bytes.
@param off offset in the byte array | [
"Converts",
"the",
"specified",
"int",
"value",
"into",
"4",
"bytes",
".",
"The",
"bytes",
"are",
"put",
"into",
"the",
"specified",
"byte",
"array",
"at",
"a",
"given",
"offset",
"location",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/gsi/gssapi/SSLUtil.java#L185-L190 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/data/UserMessage.java | UserMessage.create | public static UserMessage create (Name speaker, String message) {
"""
Constructs a user message for a player originated tell (which has no bundle and is in the
default mode).
"""
return new UserMessage(speaker, null, message, ChatCodes.DEFAULT_MODE);
} | java | public static UserMessage create (Name speaker, String message)
{
return new UserMessage(speaker, null, message, ChatCodes.DEFAULT_MODE);
} | [
"public",
"static",
"UserMessage",
"create",
"(",
"Name",
"speaker",
",",
"String",
"message",
")",
"{",
"return",
"new",
"UserMessage",
"(",
"speaker",
",",
"null",
",",
"message",
",",
"ChatCodes",
".",
"DEFAULT_MODE",
")",
";",
"}"
] | Constructs a user message for a player originated tell (which has no bundle and is in the
default mode). | [
"Constructs",
"a",
"user",
"message",
"for",
"a",
"player",
"originated",
"tell",
"(",
"which",
"has",
"no",
"bundle",
"and",
"is",
"in",
"the",
"default",
"mode",
")",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/data/UserMessage.java#L41-L44 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingvisualsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/visualsearch/implementation/BingImagesImpl.java | BingImagesImpl.visualSearchWithServiceResponseAsync | public Observable<ServiceResponse<ImageKnowledge>> visualSearchWithServiceResponseAsync(VisualSearchOptionalParameter visualSearchOptionalParameter) {
"""
Visual Search API lets you discover insights about an image such as visually similar images, shopping sources, and related searches. The API can also perform te... | java | public Observable<ServiceResponse<ImageKnowledge>> visualSearchWithServiceResponseAsync(VisualSearchOptionalParameter visualSearchOptionalParameter) {
final String acceptLanguage = visualSearchOptionalParameter != null ? visualSearchOptionalParameter.acceptLanguage() : null;
final String contentType = v... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"ImageKnowledge",
">",
">",
"visualSearchWithServiceResponseAsync",
"(",
"VisualSearchOptionalParameter",
"visualSearchOptionalParameter",
")",
"{",
"final",
"String",
"acceptLanguage",
"=",
"visualSearchOptionalParameter",
"... | Visual Search API lets you discover insights about an image such as visually similar images, shopping sources, and related searches. The API can also perform text recognition, identify entities (people, places, things), return other topical content for the user to explore, and more. For more information, see [Visual Se... | [
"Visual",
"Search",
"API",
"lets",
"you",
"discover",
"insights",
"about",
"an",
"image",
"such",
"as",
"visually",
"similar",
"images",
"shopping",
"sources",
"and",
"related",
"searches",
".",
"The",
"API",
"can",
"also",
"perform",
"text",
"recognition",
"i... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingvisualsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/visualsearch/implementation/BingImagesImpl.java#L113-L124 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java | BytecodeUtils.defineDefaultConstructor | public static void defineDefaultConstructor(ClassVisitor cv, TypeInfo ownerType) {
"""
Generates a default nullary public constructor for the given type on the {@link ClassVisitor}.
<p>For java classes this is normally generated by the compiler and looks like:
<pre>{@code
public Foo() {
super();
}
}</pre... | java | public static void defineDefaultConstructor(ClassVisitor cv, TypeInfo ownerType) {
CodeBuilder mg = new CodeBuilder(Opcodes.ACC_PUBLIC, NULLARY_INIT, null, cv);
mg.visitCode();
Label start = mg.mark();
Label end = mg.newLabel();
LocalVariable thisVar = LocalVariable.createThisVar(ownerType, start, e... | [
"public",
"static",
"void",
"defineDefaultConstructor",
"(",
"ClassVisitor",
"cv",
",",
"TypeInfo",
"ownerType",
")",
"{",
"CodeBuilder",
"mg",
"=",
"new",
"CodeBuilder",
"(",
"Opcodes",
".",
"ACC_PUBLIC",
",",
"NULLARY_INIT",
",",
"null",
",",
"cv",
")",
";",... | Generates a default nullary public constructor for the given type on the {@link ClassVisitor}.
<p>For java classes this is normally generated by the compiler and looks like:
<pre>{@code
public Foo() {
super();
}
}</pre> | [
"Generates",
"a",
"default",
"nullary",
"public",
"constructor",
"for",
"the",
"given",
"type",
"on",
"the",
"{",
"@link",
"ClassVisitor",
"}",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L481-L493 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/LongTermRetentionBackupsInner.java | LongTermRetentionBackupsInner.listByDatabaseWithServiceResponseAsync | public Observable<ServiceResponse<Page<LongTermRetentionBackupInner>>> listByDatabaseWithServiceResponseAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName) {
"""
Lists all long term retention backups for a database.
@param locationName The locat... | java | public Observable<ServiceResponse<Page<LongTermRetentionBackupInner>>> listByDatabaseWithServiceResponseAsync(final String locationName, final String longTermRetentionServerName, final String longTermRetentionDatabaseName) {
return listByDatabaseSinglePageAsync(locationName, longTermRetentionServerName, longTer... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"LongTermRetentionBackupInner",
">",
">",
">",
"listByDatabaseWithServiceResponseAsync",
"(",
"final",
"String",
"locationName",
",",
"final",
"String",
"longTermRetentionServerName",
",",
"final",
"String"... | Lists all long term retention backups for a database.
@param locationName The location of the database
@param longTermRetentionServerName the String value
@param longTermRetentionDatabaseName the String value
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedL... | [
"Lists",
"all",
"long",
"term",
"retention",
"backups",
"for",
"a",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/LongTermRetentionBackupsInner.java#L453-L465 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java | AbstractMemberWriter.addNavDetailLink | protected void addNavDetailLink(SortedSet<Element> members, Content liNav) {
"""
Add the navigation detail link.
@param members the members to be linked
@param liNav the content tree to which the navigation detail link will be added
"""
addNavDetailLink(!members.isEmpty(), liNav);
} | java | protected void addNavDetailLink(SortedSet<Element> members, Content liNav) {
addNavDetailLink(!members.isEmpty(), liNav);
} | [
"protected",
"void",
"addNavDetailLink",
"(",
"SortedSet",
"<",
"Element",
">",
"members",
",",
"Content",
"liNav",
")",
"{",
"addNavDetailLink",
"(",
"!",
"members",
".",
"isEmpty",
"(",
")",
",",
"liNav",
")",
";",
"}"
] | Add the navigation detail link.
@param members the members to be linked
@param liNav the content tree to which the navigation detail link will be added | [
"Add",
"the",
"navigation",
"detail",
"link",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java#L477-L479 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java | CharOperation.trim | final static public char[] trim(char[] chars) {
"""
Answers a new array removing leading and trailing spaces (' '). Answers the given array if there is no space
characters to remove. <br>
<br>
For example:
<ol>
<li>
<pre>
chars = { ' ', 'a' , 'b', ' ', ' ' }
result => { 'a' , 'b' }
</pre>
</li>
... | java | final static public char[] trim(char[] chars)
{
if (chars == null)
{
return null;
}
int start = 0, length = chars.length, end = length - 1;
while (start < length && chars[start] == ' ')
{
start++;
}
while (end > start && chars[end] == ' ')
{
end--;
}
if (start != 0 || end != length - 1... | [
"final",
"static",
"public",
"char",
"[",
"]",
"trim",
"(",
"char",
"[",
"]",
"chars",
")",
"{",
"if",
"(",
"chars",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"start",
"=",
"0",
",",
"length",
"=",
"chars",
".",
"length",
",",
... | Answers a new array removing leading and trailing spaces (' '). Answers the given array if there is no space
characters to remove. <br>
<br>
For example:
<ol>
<li>
<pre>
chars = { ' ', 'a' , 'b', ' ', ' ' }
result => { 'a' , 'b' }
</pre>
</li>
<li>
<pre>
array = { 'A', 'b' }
result => { 'A' , 'b' }
</pre>
</... | [
"Answers",
"a",
"new",
"array",
"removing",
"leading",
"and",
"trailing",
"spaces",
"(",
")",
".",
"Answers",
"the",
"given",
"array",
"if",
"there",
"is",
"no",
"space",
"characters",
"to",
"remove",
".",
"<br",
">",
"<br",
">",
"For",
"example",
":",
... | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java#L3994-L4016 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadViewS.java | CreateSyntheticOverheadViewS.process | public void process(T input, T output) {
"""
Computes overhead view of input image. All pixels in input image are assumed to be on the ground plane.
@param input (Input) Camera image.
@param output (Output) Image containing overhead view.
"""
this.output = FactoryGImageGray.wrap(output,this.output);
... | java | public void process(T input, T output) {
this.output = FactoryGImageGray.wrap(output,this.output);
interp.setImage(input);
int indexMap = 0;
for( int i = 0; i < output.height; i++ ) {
int indexOut = output.startIndex + i*output.stride;
for( int j = 0; j < output.width; j++ , indexOut++,indexMap++ ) {
... | [
"public",
"void",
"process",
"(",
"T",
"input",
",",
"T",
"output",
")",
"{",
"this",
".",
"output",
"=",
"FactoryGImageGray",
".",
"wrap",
"(",
"output",
",",
"this",
".",
"output",
")",
";",
"interp",
".",
"setImage",
"(",
"input",
")",
";",
"int",... | Computes overhead view of input image. All pixels in input image are assumed to be on the ground plane.
@param input (Input) Camera image.
@param output (Output) Image containing overhead view. | [
"Computes",
"overhead",
"view",
"of",
"input",
"image",
".",
"All",
"pixels",
"in",
"input",
"image",
"are",
"assumed",
"to",
"be",
"on",
"the",
"ground",
"plane",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadViewS.java#L54-L69 |
lucee/Lucee | core/src/main/java/lucee/runtime/net/mail/MailClient.java | MailClient.contains | private boolean contains(String ids[], String id) {
"""
checks if a String Array (ids) has one element that is equal to id
@param ids
@param id
@return has element found or not
"""
for (int i = 0; i < ids.length; i++) {
if (Operator.compare(ids[i], id) == 0) return true;
}
return false;
} | java | private boolean contains(String ids[], String id) {
for (int i = 0; i < ids.length; i++) {
if (Operator.compare(ids[i], id) == 0) return true;
}
return false;
} | [
"private",
"boolean",
"contains",
"(",
"String",
"ids",
"[",
"]",
",",
"String",
"id",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ids",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Operator",
".",
"compare",
"(",
"ids",... | checks if a String Array (ids) has one element that is equal to id
@param ids
@param id
@return has element found or not | [
"checks",
"if",
"a",
"String",
"Array",
"(",
"ids",
")",
"has",
"one",
"element",
"that",
"is",
"equal",
"to",
"id"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailClient.java#L645-L650 |
jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java | DownloadProperties.forGalaxyCentral | @Deprecated
public static DownloadProperties forGalaxyCentral(final File destination, String revision) {
"""
Builds a new DownloadProperties for downloading Galaxy from galaxy-central.
@param destination The destination directory to store Galaxy, null if a directory
should be chosen by default.
@param revisio... | java | @Deprecated
public static DownloadProperties forGalaxyCentral(final File destination, String revision) {
return new DownloadProperties(GALAXY_CENTRAL_REPOSITORY_URL, BRANCH_DEFAULT, revision, destination);
} | [
"@",
"Deprecated",
"public",
"static",
"DownloadProperties",
"forGalaxyCentral",
"(",
"final",
"File",
"destination",
",",
"String",
"revision",
")",
"{",
"return",
"new",
"DownloadProperties",
"(",
"GALAXY_CENTRAL_REPOSITORY_URL",
",",
"BRANCH_DEFAULT",
",",
"revision"... | Builds a new DownloadProperties for downloading Galaxy from galaxy-central.
@param destination The destination directory to store Galaxy, null if a directory
should be chosen by default.
@param revision The revision to use for Galaxy.
@return A new DownloadProperties for downloading Galaxy from galaxy-central. | [
"Builds",
"a",
"new",
"DownloadProperties",
"for",
"downloading",
"Galaxy",
"from",
"galaxy",
"-",
"central",
"."
] | train | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L349-L352 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java | PageServiceImpl.toStream | StreamSource toStream(byte[] buffer, int rowOffset, byte []blobBuffer) {
"""
/*
private StreamSource toStreamOld(byte[] buffer, int rowOffset, byte []blobBuffer)
{
try {
TempStore tempStore = _table.getTempStore();
TempWriter tos = tempStore.openWriter();
Row row = _table.getRow();
row.writeStream(tos... | java | StreamSource toStream(byte[] buffer, int rowOffset, byte []blobBuffer)
{
Row row = _table.row();
return new RowStreamSource(row.getInSkeleton(), buffer, rowOffset,
_table.getPageActor());
} | [
"StreamSource",
"toStream",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"rowOffset",
",",
"byte",
"[",
"]",
"blobBuffer",
")",
"{",
"Row",
"row",
"=",
"_table",
".",
"row",
"(",
")",
";",
"return",
"new",
"RowStreamSource",
"(",
"row",
".",
"getInSkel... | /*
private StreamSource toStreamOld(byte[] buffer, int rowOffset, byte []blobBuffer)
{
try {
TempStore tempStore = _table.getTempStore();
TempWriter tos = tempStore.openWriter();
Row row = _table.getRow();
row.writeStream(tos, buffer, rowOffset, blobBuffer, this);
if (tos.getLength() <= 0) {
Thread.dumpStack();
}
S... | [
"/",
"*",
"private",
"StreamSource",
"toStreamOld",
"(",
"byte",
"[]",
"buffer",
"int",
"rowOffset",
"byte",
"[]",
"blobBuffer",
")",
"{",
"try",
"{",
"TempStore",
"tempStore",
"=",
"_table",
".",
"getTempStore",
"()",
";"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java#L1312-L1318 |
phax/ph-web | ph-http/src/main/java/com/helger/http/CacheControlBuilder.java | CacheControlBuilder.setSharedMaxAge | @Nonnull
public CacheControlBuilder setSharedMaxAge (@Nonnull final TimeUnit eTimeUnit, final long nDuration) {
"""
Set the maximum age for shared caches relative to the request time. Similar
to max-age, except that it only applies to shared (e.g., proxy) caches.
@param eTimeUnit
{@link TimeUnit} to use
@p... | java | @Nonnull
public CacheControlBuilder setSharedMaxAge (@Nonnull final TimeUnit eTimeUnit, final long nDuration)
{
return setSharedMaxAgeSeconds (eTimeUnit.toSeconds (nDuration));
} | [
"@",
"Nonnull",
"public",
"CacheControlBuilder",
"setSharedMaxAge",
"(",
"@",
"Nonnull",
"final",
"TimeUnit",
"eTimeUnit",
",",
"final",
"long",
"nDuration",
")",
"{",
"return",
"setSharedMaxAgeSeconds",
"(",
"eTimeUnit",
".",
"toSeconds",
"(",
"nDuration",
")",
"... | Set the maximum age for shared caches relative to the request time. Similar
to max-age, except that it only applies to shared (e.g., proxy) caches.
@param eTimeUnit
{@link TimeUnit} to use
@param nDuration
The duration in the passed unit
@return this | [
"Set",
"the",
"maximum",
"age",
"for",
"shared",
"caches",
"relative",
"to",
"the",
"request",
"time",
".",
"Similar",
"to",
"max",
"-",
"age",
"except",
"that",
"it",
"only",
"applies",
"to",
"shared",
"(",
"e",
".",
"g",
".",
"proxy",
")",
"caches",
... | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-http/src/main/java/com/helger/http/CacheControlBuilder.java#L178-L182 |
gallandarakhneorg/afc | advanced/attributes/src/main/java/org/arakhne/afc/attrs/collection/AbstractAttributeCollection.java | AbstractAttributeCollection.fireAttributeRemovedEvent | protected synchronized void fireAttributeRemovedEvent(String name, AttributeValue oldValue) {
"""
Fire the an attribute removal event.
@param name is the name of the attribute for which the event occured.
@param oldValue is the previous value of the attribute
"""
if (this.listenerList != null && isEventF... | java | protected synchronized void fireAttributeRemovedEvent(String name, AttributeValue oldValue) {
if (this.listenerList != null && isEventFirable()) {
final AttributeChangeListener[] list = new AttributeChangeListener[this.listenerList.size()];
this.listenerList.toArray(list);
final AttributeChangeEvent event = ... | [
"protected",
"synchronized",
"void",
"fireAttributeRemovedEvent",
"(",
"String",
"name",
",",
"AttributeValue",
"oldValue",
")",
"{",
"if",
"(",
"this",
".",
"listenerList",
"!=",
"null",
"&&",
"isEventFirable",
"(",
")",
")",
"{",
"final",
"AttributeChangeListene... | Fire the an attribute removal event.
@param name is the name of the attribute for which the event occured.
@param oldValue is the previous value of the attribute | [
"Fire",
"the",
"an",
"attribute",
"removal",
"event",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/attributes/src/main/java/org/arakhne/afc/attrs/collection/AbstractAttributeCollection.java#L139-L154 |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java | ClientFactory.registerNamedLoadBalancerFromProperties | public static synchronized ILoadBalancer registerNamedLoadBalancerFromProperties(String name, Class<? extends IClientConfig> configClass) throws ClientException {
"""
Create and register a load balancer with the name and given the class of configClass.
@throws ClientException if load balancer with the same name... | java | public static synchronized ILoadBalancer registerNamedLoadBalancerFromProperties(String name, Class<? extends IClientConfig> configClass) throws ClientException {
if (namedLBMap.get(name) != null) {
throw new ClientException("LoadBalancer for name " + name + " already exists");
}
ICl... | [
"public",
"static",
"synchronized",
"ILoadBalancer",
"registerNamedLoadBalancerFromProperties",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
"extends",
"IClientConfig",
">",
"configClass",
")",
"throws",
"ClientException",
"{",
"if",
"(",
"namedLBMap",
".",
"get",
... | Create and register a load balancer with the name and given the class of configClass.
@throws ClientException if load balancer with the same name already exists or any error occurs
@see #instantiateInstanceWithClientConfig(String, IClientConfig) | [
"Create",
"and",
"register",
"a",
"load",
"balancer",
"with",
"the",
"name",
"and",
"given",
"the",
"class",
"of",
"configClass",
"."
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java#L200-L206 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/TopNBuffer.java | TopNBuffer.putAll | void putAll(BaseRow sortKey, Collection<BaseRow> values) {
"""
Puts a record list into the buffer under the sortKey.
Note: if buffer already contains sortKey, putAll will overwrite the previous value
@param sortKey sort key with which the specified values are to be associated
@param values record lists to be ... | java | void putAll(BaseRow sortKey, Collection<BaseRow> values) {
treeMap.put(sortKey, values);
currentTopNum += values.size();
} | [
"void",
"putAll",
"(",
"BaseRow",
"sortKey",
",",
"Collection",
"<",
"BaseRow",
">",
"values",
")",
"{",
"treeMap",
".",
"put",
"(",
"sortKey",
",",
"values",
")",
";",
"currentTopNum",
"+=",
"values",
".",
"size",
"(",
")",
";",
"}"
] | Puts a record list into the buffer under the sortKey.
Note: if buffer already contains sortKey, putAll will overwrite the previous value
@param sortKey sort key with which the specified values are to be associated
@param values record lists to be associated with the specified key | [
"Puts",
"a",
"record",
"list",
"into",
"the",
"buffer",
"under",
"the",
"sortKey",
".",
"Note",
":",
"if",
"buffer",
"already",
"contains",
"sortKey",
"putAll",
"will",
"overwrite",
"the",
"previous",
"value"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/TopNBuffer.java#L77-L80 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java | DataFrameJoiner.inner | public Table inner(boolean allowDuplicateColumnNames, Table... tables) {
"""
Joins to the given tables assuming that they have a column of the name we're joining on
@param allowDuplicateColumnNames if {@code false} the join will fail if any columns other than the join column have the same name
if {@code true} ... | java | public Table inner(boolean allowDuplicateColumnNames, Table... tables) {
Table joined = table;
for (Table currT : tables) {
joined = joinInternal(joined, currT, false, allowDuplicateColumnNames, columnNames);
}
return joined;
} | [
"public",
"Table",
"inner",
"(",
"boolean",
"allowDuplicateColumnNames",
",",
"Table",
"...",
"tables",
")",
"{",
"Table",
"joined",
"=",
"table",
";",
"for",
"(",
"Table",
"currT",
":",
"tables",
")",
"{",
"joined",
"=",
"joinInternal",
"(",
"joined",
","... | Joins to the given tables assuming that they have a column of the name we're joining on
@param allowDuplicateColumnNames if {@code false} the join will fail if any columns other than the join column have the same name
if {@code true} the join will succeed and duplicate columns are renamed*
@param tables The tables to ... | [
"Joins",
"to",
"the",
"given",
"tables",
"assuming",
"that",
"they",
"have",
"a",
"column",
"of",
"the",
"name",
"we",
"re",
"joining",
"on"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L86-L93 |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.findAll | @Override
public List<CPDefinitionVirtualSetting> findAll() {
"""
Returns all the cp definition virtual settings.
@return the cp definition virtual settings
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionVirtualSetting> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionVirtualSetting",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition virtual settings.
@return the cp definition virtual settings | [
"Returns",
"all",
"the",
"cp",
"definition",
"virtual",
"settings",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L2386-L2389 |
carrotsearch/hppc | hppc/src/main/templates/com/carrotsearch/hppc/KTypeArrayList.java | KTypeArrayList.forEach | public <T extends KTypeProcedure<? super KType>> T forEach(T procedure, int fromIndex, final int toIndex) {
"""
Applies <code>procedure</code> to a slice of the list,
<code>fromIndex</code>, inclusive, to <code>toIndex</code>, exclusive.
"""
assert (fromIndex >= 0 && fromIndex <= size()) :
"Index ... | java | public <T extends KTypeProcedure<? super KType>> T forEach(T procedure, int fromIndex, final int toIndex) {
assert (fromIndex >= 0 && fromIndex <= size()) :
"Index " + fromIndex + " out of bounds [" + 0 + ", " + size() + ").";
assert (toIndex >= 0 && toIndex <= size()) :
"Index " + toIndex + " ... | [
"public",
"<",
"T",
"extends",
"KTypeProcedure",
"<",
"?",
"super",
"KType",
">",
">",
"T",
"forEach",
"(",
"T",
"procedure",
",",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
")",
"{",
"assert",
"(",
"fromIndex",
">=",
"0",
"&&",
"fromIndex",
"... | Applies <code>procedure</code> to a slice of the list,
<code>fromIndex</code>, inclusive, to <code>toIndex</code>, exclusive. | [
"Applies",
"<code",
">",
"procedure<",
"/",
"code",
">",
"to",
"a",
"slice",
"of",
"the",
"list",
"<code",
">",
"fromIndex<",
"/",
"code",
">",
"inclusive",
"to",
"<code",
">",
"toIndex<",
"/",
"code",
">",
"exclusive",
"."
] | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeArrayList.java#L552-L568 |
facebook/fresco | animated-base/src/main/java/com/facebook/imagepipeline/animated/impl/AnimatedImageCompositor.java | AnimatedImageCompositor.prepareCanvasWithClosestCachedFrame | private int prepareCanvasWithClosestCachedFrame(int previousFrameNumber, Canvas canvas) {
"""
Given a frame number, prepares the canvas to render based on the nearest cached frame
at or before the frame. On return the canvas will be prepared as if the nearest cached
frame had been rendered and disposed. The retu... | java | private int prepareCanvasWithClosestCachedFrame(int previousFrameNumber, Canvas canvas) {
for (int index = previousFrameNumber; index >= 0; index--) {
FrameNeededResult neededResult = isFrameNeededForRendering(index);
switch (neededResult) {
case REQUIRED:
AnimatedDrawableFrameInfo fra... | [
"private",
"int",
"prepareCanvasWithClosestCachedFrame",
"(",
"int",
"previousFrameNumber",
",",
"Canvas",
"canvas",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"previousFrameNumber",
";",
"index",
">=",
"0",
";",
"index",
"--",
")",
"{",
"FrameNeededResult",
"ne... | Given a frame number, prepares the canvas to render based on the nearest cached frame
at or before the frame. On return the canvas will be prepared as if the nearest cached
frame had been rendered and disposed. The returned index is the next frame that needs to be
composited onto the canvas.
@param previousFrameNumber... | [
"Given",
"a",
"frame",
"number",
"prepares",
"the",
"canvas",
"to",
"render",
"based",
"on",
"the",
"nearest",
"cached",
"frame",
"at",
"or",
"before",
"the",
"frame",
".",
"On",
"return",
"the",
"canvas",
"will",
"be",
"prepared",
"as",
"if",
"the",
"ne... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/animated-base/src/main/java/com/facebook/imagepipeline/animated/impl/AnimatedImageCompositor.java#L148-L183 |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.getAnnisAsyncWebResource | public static AsyncWebResource getAnnisAsyncWebResource() {
"""
Gets or creates an asynchronous web resource to the ANNIS service.
This is a convenience wrapper to {@link #getAnnisWebResource(java.lang.String, annis.security.AnnisUser)
}
that does not need any arguments
@return A reference to the ANNIS ser... | java | public static AsyncWebResource getAnnisAsyncWebResource()
{
// get URI used by the application
String uri = (String) VaadinSession.getCurrent().getAttribute(
KEY_WEB_SERVICE_URL);
// if already authentificated the REST client is set as the "user" property
AnnisUser user = getUser();
return... | [
"public",
"static",
"AsyncWebResource",
"getAnnisAsyncWebResource",
"(",
")",
"{",
"// get URI used by the application",
"String",
"uri",
"=",
"(",
"String",
")",
"VaadinSession",
".",
"getCurrent",
"(",
")",
".",
"getAttribute",
"(",
"KEY_WEB_SERVICE_URL",
")",
";",
... | Gets or creates an asynchronous web resource to the ANNIS service.
This is a convenience wrapper to {@link #getAnnisWebResource(java.lang.String, annis.security.AnnisUser)
}
that does not need any arguments
@return A reference to the ANNIS service root resource. | [
"Gets",
"or",
"creates",
"an",
"asynchronous",
"web",
"resource",
"to",
"the",
"ANNIS",
"service",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L351-L361 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java | JdbcCpoXaAdapter.insertObject | @Override
public <T> long insertObject(String name, T obj) throws CpoException {
"""
Creates the Object in the datasource. The assumption is that the object does not exist in the datasource. This
method creates and stores the object in the datasource
<p>
<pre>Example:
<code>
<p>
class SomeObject so = new S... | java | @Override
public <T> long insertObject(String name, T obj) throws CpoException {
return getCurrentResource().insertObject(name, obj);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"insertObject",
"(",
"String",
"name",
",",
"T",
"obj",
")",
"throws",
"CpoException",
"{",
"return",
"getCurrentResource",
"(",
")",
".",
"insertObject",
"(",
"name",
",",
"obj",
")",
";",
"}"
] | Creates the Object in the datasource. The assumption is that the object does not exist in the datasource. This
method creates and stores the object in the datasource
<p>
<pre>Example:
<code>
<p>
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
<p>
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInf... | [
"Creates",
"the",
"Object",
"in",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"object",
"does",
"not",
"exist",
"in",
"the",
"datasource",
".",
"This",
"method",
"creates",
"and",
"stores",
"the",
"object",
"in",
"the",
"datasource",
... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L199-L202 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmAttributes.java | XsdAsmAttributes.generateAttribute | static void generateAttribute(XsdAttribute attribute, String apiName) {
"""
Creates a class which represents a {@link XsdAttribute} object.
@param attribute The {@link XsdAttribute} type that contains the required information.
@param apiName The name of the generated fluent interface.
"""
String came... | java | static void generateAttribute(XsdAttribute attribute, String apiName){
String camelAttributeName = getAttributeName(attribute);
XsdList list = getAttributeList(attribute);
String javaType = list != null ? JAVA_LIST_DESC : getFullJavaType(attribute);
boolean hasEnum = attributeHasEnum(at... | [
"static",
"void",
"generateAttribute",
"(",
"XsdAttribute",
"attribute",
",",
"String",
"apiName",
")",
"{",
"String",
"camelAttributeName",
"=",
"getAttributeName",
"(",
"attribute",
")",
";",
"XsdList",
"list",
"=",
"getAttributeList",
"(",
"attribute",
")",
";"... | Creates a class which represents a {@link XsdAttribute} object.
@param attribute The {@link XsdAttribute} type that contains the required information.
@param apiName The name of the generated fluent interface. | [
"Creates",
"a",
"class",
"which",
"represents",
"a",
"{"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmAttributes.java#L125-L175 |
phax/ph-css | ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java | CSSReaderDeclarationList.readFromStream | @Nullable
public static CSSDeclarationList readFromStream (@Nonnull final IHasInputStream aISP,
@Nonnull final Charset aCharset,
@Nonnull final ECSSVersion eVersion,
... | java | @Nullable
public static CSSDeclarationList readFromStream (@Nonnull final IHasInputStream aISP,
@Nonnull final Charset aCharset,
@Nonnull final ECSSVersion eVersion,
... | [
"@",
"Nullable",
"public",
"static",
"CSSDeclarationList",
"readFromStream",
"(",
"@",
"Nonnull",
"final",
"IHasInputStream",
"aISP",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
",",
"@",
"Nonnull",
"final",
"ECSSVersion",
"eVersion",
",",
"@",
"Nullable"... | Read the CSS from the passed {@link IHasInputStream}.
@param aISP
The input stream provider to use. May not be <code>null</code>.
@param aCharset
The charset to be used. May not be <code>null</code>.
@param eVersion
The CSS version to use. May not be <code>null</code>.
@param aCustomErrorHandler
An optional custom err... | [
"Read",
"the",
"CSS",
"from",
"the",
"passed",
"{",
"@link",
"IHasInputStream",
"}",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/reader/CSSReaderDeclarationList.java#L520-L536 |
overview/mime-types | src/main/java/org/overviewproject/mime_types/MimeTypeDetector.java | MimeTypeDetector.matchletMagicCompareOr | private boolean matchletMagicCompareOr(int nMatchlets, int firstMatchletOffset, byte[] data) {
"""
Returns whether one of the specified matchlets matches the data.
"""
for (int i = 0, matchletOffset = firstMatchletOffset; i < nMatchlets; i++, matchletOffset += 32) {
if (matchletMagicCompare... | java | private boolean matchletMagicCompareOr(int nMatchlets, int firstMatchletOffset, byte[] data) {
for (int i = 0, matchletOffset = firstMatchletOffset; i < nMatchlets; i++, matchletOffset += 32) {
if (matchletMagicCompare(matchletOffset, data)) {
return true;
}
}
... | [
"private",
"boolean",
"matchletMagicCompareOr",
"(",
"int",
"nMatchlets",
",",
"int",
"firstMatchletOffset",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"matchletOffset",
"=",
"firstMatchletOffset",
";",
"i",
"<",
"nMatchl... | Returns whether one of the specified matchlets matches the data. | [
"Returns",
"whether",
"one",
"of",
"the",
"specified",
"matchlets",
"matches",
"the",
"data",
"."
] | train | https://github.com/overview/mime-types/blob/d5c45302049c0cd5e634a50954304d8ddeb9abb4/src/main/java/org/overviewproject/mime_types/MimeTypeDetector.java#L391-L399 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/schemamanager/OracleNoSQLSchemaManager.java | OracleNoSQLSchemaManager.createIndex | private void createIndex(String tableName, String indexName, String... fieldNames) {
"""
Creates the index.
@param tableName
the table name
@param indexName
the index name
@param fieldName
the field name
"""
StringBuilder builder = new StringBuilder();
builder.append("CREATE INDEX IF NO... | java | private void createIndex(String tableName, String indexName, String... fieldNames)
{
StringBuilder builder = new StringBuilder();
builder.append("CREATE INDEX IF NOT EXISTS ");
builder.append(indexName);
builder.append(" ON ");
builder.append(tableName);
builder.appen... | [
"private",
"void",
"createIndex",
"(",
"String",
"tableName",
",",
"String",
"indexName",
",",
"String",
"...",
"fieldNames",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"CREATE INDEX IF NOT ... | Creates the index.
@param tableName
the table name
@param indexName
the index name
@param fieldName
the field name | [
"Creates",
"the",
"index",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/schemamanager/OracleNoSQLSchemaManager.java#L379-L400 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.