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 |
|---|---|---|---|---|---|---|---|---|---|---|
weld/core | impl/src/main/java/org/jboss/weld/resolution/CovariantTypes.java | CovariantTypes.isAssignableFrom | private static boolean isAssignableFrom(WildcardType type1, Type type2) {
"""
This logic is shared for all actual types i.e. raw types, parameterized types and generic array types.
"""
if (!isAssignableFrom(type1.getUpperBounds()[0], type2)) {
return false;
}
if (type1.getLo... | java | private static boolean isAssignableFrom(WildcardType type1, Type type2) {
if (!isAssignableFrom(type1.getUpperBounds()[0], type2)) {
return false;
}
if (type1.getLowerBounds().length > 0 && !isAssignableFrom(type2, type1.getLowerBounds()[0])) {
return false;
}
... | [
"private",
"static",
"boolean",
"isAssignableFrom",
"(",
"WildcardType",
"type1",
",",
"Type",
"type2",
")",
"{",
"if",
"(",
"!",
"isAssignableFrom",
"(",
"type1",
".",
"getUpperBounds",
"(",
")",
"[",
"0",
"]",
",",
"type2",
")",
")",
"{",
"return",
"fa... | This logic is shared for all actual types i.e. raw types, parameterized types and generic array types. | [
"This",
"logic",
"is",
"shared",
"for",
"all",
"actual",
"types",
"i",
".",
"e",
".",
"raw",
"types",
"parameterized",
"types",
"and",
"generic",
"array",
"types",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/CovariantTypes.java#L295-L303 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/URLUtils.java | URLUtils.setFragment | public static URI setFragment(final URI path, final String fragment) {
"""
Create new URI with a given fragment.
@param path URI to set fragment on
@param fragment new fragment, {@code null} for no fragment
@return new URI instance with given fragment
"""
try {
if (path.getPath() != nu... | java | public static URI setFragment(final URI path, final String fragment) {
try {
if (path.getPath() != null) {
return new URI(path.getScheme(), path.getUserInfo(), path.getHost(), path.getPort(), path.getPath(), path.getQuery(), fragment);
} else {
return new ... | [
"public",
"static",
"URI",
"setFragment",
"(",
"final",
"URI",
"path",
",",
"final",
"String",
"fragment",
")",
"{",
"try",
"{",
"if",
"(",
"path",
".",
"getPath",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"new",
"URI",
"(",
"path",
".",
"getScheme... | Create new URI with a given fragment.
@param path URI to set fragment on
@param fragment new fragment, {@code null} for no fragment
@return new URI instance with given fragment | [
"Create",
"new",
"URI",
"with",
"a",
"given",
"fragment",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/URLUtils.java#L551-L561 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java | CameraEncoder.prepareEncoder | private void prepareEncoder(EGLContext sharedContext, int width, int height, int bitRate,
Muxer muxer) throws IOException {
"""
Called with the display EGLContext current, on Encoder thread
@param sharedContext The display EGLContext to be shared with the Encoder Surface's contex... | java | private void prepareEncoder(EGLContext sharedContext, int width, int height, int bitRate,
Muxer muxer) throws IOException {
mVideoEncoder = new VideoEncoderCore(width, height, bitRate, muxer);
if (mEglCore == null) {
// This is the first prepare called for thi... | [
"private",
"void",
"prepareEncoder",
"(",
"EGLContext",
"sharedContext",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"bitRate",
",",
"Muxer",
"muxer",
")",
"throws",
"IOException",
"{",
"mVideoEncoder",
"=",
"new",
"VideoEncoderCore",
"(",
"width",
... | Called with the display EGLContext current, on Encoder thread
@param sharedContext The display EGLContext to be shared with the Encoder Surface's context.
@param width the desired width of the encoder's video output
@param height the desired height of the encoder's video output
@param bitRate the ... | [
"Called",
"with",
"the",
"display",
"EGLContext",
"current",
"on",
"Encoder",
"thread"
] | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/CameraEncoder.java#L692-L708 |
pagehelper/Mybatis-PageHelper | src/main/java/com/github/pagehelper/page/PageMethod.java | PageMethod.startPage | public static <E> Page<E> startPage(int pageNum, int pageSize, boolean count) {
"""
开始分页
@param pageNum 页码
@param pageSize 每页显示数量
@param count 是否进行count查询
"""
return startPage(pageNum, pageSize, count, null, null);
} | java | public static <E> Page<E> startPage(int pageNum, int pageSize, boolean count) {
return startPage(pageNum, pageSize, count, null, null);
} | [
"public",
"static",
"<",
"E",
">",
"Page",
"<",
"E",
">",
"startPage",
"(",
"int",
"pageNum",
",",
"int",
"pageSize",
",",
"boolean",
"count",
")",
"{",
"return",
"startPage",
"(",
"pageNum",
",",
"pageSize",
",",
"count",
",",
"null",
",",
"null",
"... | 开始分页
@param pageNum 页码
@param pageSize 每页显示数量
@param count 是否进行count查询 | [
"开始分页"
] | train | https://github.com/pagehelper/Mybatis-PageHelper/blob/319750fd47cf75328ff321f38125fa15e954e60f/src/main/java/com/github/pagehelper/page/PageMethod.java#L112-L114 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.eachLine | public static <T> T eachLine(CharSequence self, int firstLine, @ClosureParams(value=FromString.class, options= {
"""
Iterates through this CharSequence line by line. Each line is passed
to the given 1 or 2 arg closure. If a 2 arg closure is found
the line count is passed as the second argument.
@param self ... | java | public static <T> T eachLine(CharSequence self, int firstLine, @ClosureParams(value=FromString.class, options={"String","String,Integer"}) Closure<T> closure) throws IOException {
int count = firstLine;
T result = null;
for (String line : readLines(self.toString())) {
result = callCl... | [
"public",
"static",
"<",
"T",
">",
"T",
"eachLine",
"(",
"CharSequence",
"self",
",",
"int",
"firstLine",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"String\"",
",",
"\"String,Integer\"",
"}",
")",... | Iterates through this CharSequence line by line. Each line is passed
to the given 1 or 2 arg closure. If a 2 arg closure is found
the line count is passed as the second argument.
@param self a CharSequence
@param firstLine the line number value used for the first line (default is 1, set to 0 to start counting from... | [
"Iterates",
"through",
"this",
"CharSequence",
"line",
"by",
"line",
".",
"Each",
"line",
"is",
"passed",
"to",
"the",
"given",
"1",
"or",
"2",
"arg",
"closure",
".",
"If",
"a",
"2",
"arg",
"closure",
"is",
"found",
"the",
"line",
"count",
"is",
"passe... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L611-L619 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getUsersAssignedToPrivilegesBatch | public OneLoginResponse<Long> getUsersAssignedToPrivilegesBatch(String id, int batchSize) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Get a batch of users assigned to privilege.
This is usually the first version of the users assigned to privilege batching methods to call as it r... | java | public OneLoginResponse<Long> getUsersAssignedToPrivilegesBatch(String id, int batchSize) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getUsersAssignedToPrivilegesBatch(id, batchSize, null);
} | [
"public",
"OneLoginResponse",
"<",
"Long",
">",
"getUsersAssignedToPrivilegesBatch",
"(",
"String",
"id",
",",
"int",
"batchSize",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"return",
"getUsersAssignedToPrivilegesBat... | Get a batch of users assigned to privilege.
This is usually the first version of the users assigned to privilege batching methods to call as it requires no after-cursor information.
@param id Id of the privilege
@param batchSize Size of the Batch
@return OneLoginResponse of Long (Batch)
@throws OAuthSystemException... | [
"Get",
"a",
"batch",
"of",
"users",
"assigned",
"to",
"privilege",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L3722-L3724 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/IntrospectionUtils.java | IntrospectionUtils.findStaticMethod | public static MethodHandle findStaticMethod(Class<?> clazz, String methodName,
Class<?> expectedReturnType, Class<?>... expectedParameterTypes) {
"""
Finds and returns a MethodHandle for a public static method.
@param clazz
the class to search
@param methodName
the name of the method
@param expectedRe... | java | public static MethodHandle findStaticMethod(Class<?> clazz, String methodName,
Class<?> expectedReturnType, Class<?>... expectedParameterTypes) {
return findMethod(clazz, methodName, true, expectedReturnType, expectedParameterTypes);
} | [
"public",
"static",
"MethodHandle",
"findStaticMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"expectedReturnType",
",",
"Class",
"<",
"?",
">",
"...",
"expectedParameterTypes",
")",
"{",
"return",
"f... | Finds and returns a MethodHandle for a public static method.
@param clazz
the class to search
@param methodName
the name of the method
@param expectedReturnType
the expected return type. If {@code null}, any return type is treated as valid.
@param expectedParameterTypes
expected parameter types
@return a MethodHandle ... | [
"Finds",
"and",
"returns",
"a",
"MethodHandle",
"for",
"a",
"public",
"static",
"method",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/IntrospectionUtils.java#L418-L421 |
op4j/op4j-jodatime | src/main/java/org/op4j/jodatime/functions/FnMutableDateTime.java | FnMutableDateTime.strToMutableDateTime | public static final Function<String, MutableDateTime> strToMutableDateTime(String pattern, DateTimeZone dateTimeZone) {
"""
<p>
It converts the input {@link String} into a {@link MutableDateTime} using the given pattern parameter and with the given
{@link DateTimeZone}. If the pattern includes either, the name o... | java | public static final Function<String, MutableDateTime> strToMutableDateTime(String pattern, DateTimeZone dateTimeZone) {
return new StringToMutableDateTime(pattern, dateTimeZone);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"MutableDateTime",
">",
"strToMutableDateTime",
"(",
"String",
"pattern",
",",
"DateTimeZone",
"dateTimeZone",
")",
"{",
"return",
"new",
"StringToMutableDateTime",
"(",
"pattern",
",",
"dateTimeZone",
")"... | <p>
It converts the input {@link String} into a {@link MutableDateTime} using the given pattern parameter and with the given
{@link DateTimeZone}. If the pattern includes either, the name of the month or day of week, a conversion
accepting a {@link Locale} must be used instead
</p>
@param pattern string with the forma... | [
"<p",
">",
"It",
"converts",
"the",
"input",
"{",
"@link",
"String",
"}",
"into",
"a",
"{",
"@link",
"MutableDateTime",
"}",
"using",
"the",
"given",
"pattern",
"parameter",
"and",
"with",
"the",
"given",
"{",
"@link",
"DateTimeZone",
"}",
".",
"If",
"th... | train | https://github.com/op4j/op4j-jodatime/blob/26e5b8cda8553fb3b5a4a64b3109dbbf5df21194/src/main/java/org/op4j/jodatime/functions/FnMutableDateTime.java#L89-L91 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/TransitionInflater.java | TransitionInflater.inflateTransition | @Nullable
public Transition inflateTransition(int resource) {
"""
Loads a {@link Transition} object from a resource
@param resource The resource id of the transition to load
@return The loaded Transition object
@throws android.content.res.Resources.NotFoundException when the
transition cannot be loaded
... | java | @Nullable
public Transition inflateTransition(int resource) {
XmlResourceParser parser = mContext.getResources().getXml(resource);
try {
return createTransitionFromXml(parser, Xml.asAttributeSet(parser), null);
} catch (XmlPullParserException e) {
InflateException ex ... | [
"@",
"Nullable",
"public",
"Transition",
"inflateTransition",
"(",
"int",
"resource",
")",
"{",
"XmlResourceParser",
"parser",
"=",
"mContext",
".",
"getResources",
"(",
")",
".",
"getXml",
"(",
"resource",
")",
";",
"try",
"{",
"return",
"createTransitionFromXm... | Loads a {@link Transition} object from a resource
@param resource The resource id of the transition to load
@return The loaded Transition object
@throws android.content.res.Resources.NotFoundException when the
transition cannot be loaded | [
"Loads",
"a",
"{",
"@link",
"Transition",
"}",
"object",
"from",
"a",
"resource"
] | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionInflater.java#L81-L99 |
Metatavu/paytrail-rest-api-sdk | src/main/java/fi/metatavu/paytrail/PaytrailService.java | PaytrailService.confirmFailure | public boolean confirmFailure(String orderNumber, String timestamp, String authCode) {
"""
This function can be used to validate parameters returned by failure request.
Parameters must be validated in order to avoid hacking of payment failure.
"""
String base = new StringBuilder()
.append(orderNumber)
... | java | public boolean confirmFailure(String orderNumber, String timestamp, String authCode) {
String base = new StringBuilder()
.append(orderNumber)
.append('|')
.append(timestamp)
.append('|')
.append(merchantSecret)
.toString();
return
StringUtils.equals(
StringUtils.upperCase(Di... | [
"public",
"boolean",
"confirmFailure",
"(",
"String",
"orderNumber",
",",
"String",
"timestamp",
",",
"String",
"authCode",
")",
"{",
"String",
"base",
"=",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"orderNumber",
")",
".",
"append",
"(",
"'",
... | This function can be used to validate parameters returned by failure request.
Parameters must be validated in order to avoid hacking of payment failure. | [
"This",
"function",
"can",
"be",
"used",
"to",
"validate",
"parameters",
"returned",
"by",
"failure",
"request",
".",
"Parameters",
"must",
"be",
"validated",
"in",
"order",
"to",
"avoid",
"hacking",
"of",
"payment",
"failure",
"."
] | train | https://github.com/Metatavu/paytrail-rest-api-sdk/blob/16fb16f89dae3523e836ac4ef0ab5dc0f96e9f05/src/main/java/fi/metatavu/paytrail/PaytrailService.java#L118-L132 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/Container.java | Container.rangeOfOnes | public static Container rangeOfOnes(final int start, final int last) {
"""
Create a container initialized with a range of consecutive values
@param start first index
@param last last index (range is exclusive)
@return a new container initialized with the specified values
"""
final int arrayContainerOv... | java | public static Container rangeOfOnes(final int start, final int last) {
final int arrayContainerOverRunThreshold = 2;
final int cardinality = last - start;
if (cardinality <= arrayContainerOverRunThreshold) {
return new ArrayContainer(start, last);
}
return new RunContainer(start, last);
} | [
"public",
"static",
"Container",
"rangeOfOnes",
"(",
"final",
"int",
"start",
",",
"final",
"int",
"last",
")",
"{",
"final",
"int",
"arrayContainerOverRunThreshold",
"=",
"2",
";",
"final",
"int",
"cardinality",
"=",
"last",
"-",
"start",
";",
"if",
"(",
... | Create a container initialized with a range of consecutive values
@param start first index
@param last last index (range is exclusive)
@return a new container initialized with the specified values | [
"Create",
"a",
"container",
"initialized",
"with",
"a",
"range",
"of",
"consecutive",
"values"
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/Container.java#L29-L37 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.listFilesFromComputeNode | public PagedList<NodeFile> listFilesFromComputeNode(String poolId, String nodeId) throws BatchErrorException, IOException {
"""
Lists files on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node.
@return A list of {@link NodeFil... | java | public PagedList<NodeFile> listFilesFromComputeNode(String poolId, String nodeId) throws BatchErrorException, IOException {
return listFilesFromComputeNode(poolId, nodeId, null, null, null);
} | [
"public",
"PagedList",
"<",
"NodeFile",
">",
"listFilesFromComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"listFilesFromComputeNode",
"(",
"poolId",
",",
"nodeId",
",",
"null",... | Lists files on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node.
@return A list of {@link NodeFile} objects.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOException E... | [
"Lists",
"files",
"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/FileOperations.java#L122-L124 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.toFormatter | public DateTimeFormatter toFormatter(Locale locale) {
"""
Completes this builder by creating the DateTimeFormatter using the specified locale.
<p>
This will create a formatter with the specified locale.
Numbers will be printed and parsed using the standard non-localized set of symbols.
<p>
Calling this method... | java | public DateTimeFormatter toFormatter(Locale locale) {
Jdk8Methods.requireNonNull(locale, "locale");
while (active.parent != null) {
optionalEnd();
}
CompositePrinterParser pp = new CompositePrinterParser(printerParsers, false);
return new DateTimeFormatter(pp, locale,... | [
"public",
"DateTimeFormatter",
"toFormatter",
"(",
"Locale",
"locale",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"locale",
",",
"\"locale\"",
")",
";",
"while",
"(",
"active",
".",
"parent",
"!=",
"null",
")",
"{",
"optionalEnd",
"(",
")",
";",
... | Completes this builder by creating the DateTimeFormatter using the specified locale.
<p>
This will create a formatter with the specified locale.
Numbers will be printed and parsed using the standard non-localized set of symbols.
<p>
Calling this method will end any open optional sections by repeatedly
calling {@link #o... | [
"Completes",
"this",
"builder",
"by",
"creating",
"the",
"DateTimeFormatter",
"using",
"the",
"specified",
"locale",
".",
"<p",
">",
"This",
"will",
"create",
"a",
"formatter",
"with",
"the",
"specified",
"locale",
".",
"Numbers",
"will",
"be",
"printed",
"and... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java#L1882-L1889 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpPost | public void doHttpPost(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
"""
Performs POST to supplied url of result's request.
@param url url to post to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param contentType co... | java | public void doHttpPost(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
httpClient.post(url, result, headers, contentType);
} | [
"public",
"void",
"doHttpPost",
"(",
"String",
"url",
",",
"HttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"String",
"contentType",
")",
"{",
"httpClient",
".",
"post",
"(",
"url",
",",
"result",
",",
"headers",
"... | Performs POST to supplied url of result's request.
@param url url to post to.
@param result result containing request, its response will be filled.
@param headers headers to add.
@param contentType contentType for request. | [
"Performs",
"POST",
"to",
"supplied",
"url",
"of",
"result",
"s",
"request",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L285-L287 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setProxypassword | public void setProxypassword(String proxypassword) throws ApplicationException {
"""
set the value password When required by a proxy server, a valid password.
@param proxypassword value to set
@throws ApplicationException
"""
try {
smtp.getProxyData().setPassword(proxypassword);
}
catch (Exception ... | java | public void setProxypassword(String proxypassword) throws ApplicationException {
try {
smtp.getProxyData().setPassword(proxypassword);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxypassword] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setProxypassword",
"(",
"String",
"proxypassword",
")",
"throws",
"ApplicationException",
"{",
"try",
"{",
"smtp",
".",
"getProxyData",
"(",
")",
".",
"setPassword",
"(",
"proxypassword",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
... | set the value password When required by a proxy server, a valid password.
@param proxypassword value to set
@throws ApplicationException | [
"set",
"the",
"value",
"password",
"When",
"required",
"by",
"a",
"proxy",
"server",
"a",
"valid",
"password",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L170-L177 |
netty/netty | codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java | LengthFieldBasedFrameDecoder.getUnadjustedFrameLength | protected long getUnadjustedFrameLength(ByteBuf buf, int offset, int length, ByteOrder order) {
"""
Decodes the specified region of the buffer into an unadjusted frame length. The default implementation is
capable of decoding the specified region into an unsigned 8/16/24/32/64 bit integer. Override this method ... | java | protected long getUnadjustedFrameLength(ByteBuf buf, int offset, int length, ByteOrder order) {
buf = buf.order(order);
long frameLength;
switch (length) {
case 1:
frameLength = buf.getUnsignedByte(offset);
break;
case 2:
frameLength = buf.getU... | [
"protected",
"long",
"getUnadjustedFrameLength",
"(",
"ByteBuf",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
",",
"ByteOrder",
"order",
")",
"{",
"buf",
"=",
"buf",
".",
"order",
"(",
"order",
")",
";",
"long",
"frameLength",
";",
"switch",
"(",
"... | Decodes the specified region of the buffer into an unadjusted frame length. The default implementation is
capable of decoding the specified region into an unsigned 8/16/24/32/64 bit integer. Override this method to
decode the length field encoded differently. Note that this method must not modify the state of the sp... | [
"Decodes",
"the",
"specified",
"region",
"of",
"the",
"buffer",
"into",
"an",
"unadjusted",
"frame",
"length",
".",
"The",
"default",
"implementation",
"is",
"capable",
"of",
"decoding",
"the",
"specified",
"region",
"into",
"an",
"unsigned",
"8",
"/",
"16",
... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/LengthFieldBasedFrameDecoder.java#L452-L476 |
jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java | SecondsDescriptor.describe | protected String describe(final Between between, final boolean and) {
"""
Provide a human readable description for Between instance.
@param between - Between
@return human readable description - String
"""
return new StringBuilder()
.append(
MessageFormat.for... | java | protected String describe(final Between between, final boolean and) {
return new StringBuilder()
.append(
MessageFormat.format(
bundle.getString("between_x_and_y"),
nominalValue(between.getFrom()),
... | [
"protected",
"String",
"describe",
"(",
"final",
"Between",
"between",
",",
"final",
"boolean",
"and",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"MessageFormat",
".",
"format",
"(",
"bundle",
".",
"getString",
"(",
"\"between_... | Provide a human readable description for Between instance.
@param between - Between
@return human readable description - String | [
"Provide",
"a",
"human",
"readable",
"description",
"for",
"Between",
"instance",
"."
] | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java#L114-L124 |
alkacon/opencms-core | src-modules/org/opencms/workplace/explorer/CmsNewResourceXmlPage.java | CmsNewResourceXmlPage.getBodies | public static TreeMap<String, String> getBodies(CmsObject cms, String currWpPath) throws CmsException {
"""
Returns a sorted Map of all available body files of the OpenCms modules.<p>
@param cms the current cms object
@param currWpPath the current path in the OpenCms workplace
@return a sorted map with the ... | java | public static TreeMap<String, String> getBodies(CmsObject cms, String currWpPath) throws CmsException {
return getElements(cms, CmsWorkplace.VFS_DIR_DEFAULTBODIES, currWpPath, true);
} | [
"public",
"static",
"TreeMap",
"<",
"String",
",",
"String",
">",
"getBodies",
"(",
"CmsObject",
"cms",
",",
"String",
"currWpPath",
")",
"throws",
"CmsException",
"{",
"return",
"getElements",
"(",
"cms",
",",
"CmsWorkplace",
".",
"VFS_DIR_DEFAULTBODIES",
",",
... | Returns a sorted Map of all available body files of the OpenCms modules.<p>
@param cms the current cms object
@param currWpPath the current path in the OpenCms workplace
@return a sorted map with the body file title as key and absolute path to the body file as value
@throws CmsException if reading a folder or file f... | [
"Returns",
"a",
"sorted",
"Map",
"of",
"all",
"available",
"body",
"files",
"of",
"the",
"OpenCms",
"modules",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/explorer/CmsNewResourceXmlPage.java#L81-L84 |
milaboratory/milib | src/main/java/com/milaboratory/core/sequence/SequencesUtils.java | SequencesUtils.mismatchCount | public static <S extends Sequence<S>> int mismatchCount(S seq0, int seq0Offset, S seq1, int seq1Offset, int length) {
"""
Calculates number of mismatches (comparing position by position) between two regions of one or two different
sequences.
@param seq0 first sequence
@param seq0Offset first letter of s... | java | public static <S extends Sequence<S>> int mismatchCount(S seq0, int seq0Offset, S seq1, int seq1Offset, int length) {
if (seq0.size() < seq0Offset + length || seq1.size() < seq1Offset + length)
throw new IllegalArgumentException();
int mm = 0;
for (int i = 0; i < length; ++i)
... | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"S",
">",
">",
"int",
"mismatchCount",
"(",
"S",
"seq0",
",",
"int",
"seq0Offset",
",",
"S",
"seq1",
",",
"int",
"seq1Offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"seq0",
".",
"size",
... | Calculates number of mismatches (comparing position by position) between two regions of one or two different
sequences.
@param seq0 first sequence
@param seq0Offset first letter of second region in first sequence
@param seq1 second sequence (may be the same as {@code seq0}
@param seq1Offset first letter of... | [
"Calculates",
"number",
"of",
"mismatches",
"(",
"comparing",
"position",
"by",
"position",
")",
"between",
"two",
"regions",
"of",
"one",
"or",
"two",
"different",
"sequences",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/sequence/SequencesUtils.java#L76-L85 |
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.getEntityRoleAsync | public Observable<EntityRole> getEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumentException... | java | public Observable<EntityRole> getEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
return getEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).map(new Func1<ServiceResponse<EntityRole>, EntityRole>() {
@Override
public EntityRole call(Servic... | [
"public",
"Observable",
"<",
"EntityRole",
">",
"getEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"getEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
","... | Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the EntityRole object | [
"Get",
"one",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10771-L10778 |
YahooArchive/samoa | samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaStream.java | SamzaStream.addDestination | public SamzaSystemStream addDestination(StreamDestination destination) {
"""
/*
Add the PI to the list of destinations.
Return the name of the corresponding SystemStream.
"""
PartitioningScheme scheme = destination.getPartitioningScheme();
int parallelism = destination.getParallelism();
SamzaSystemS... | java | public SamzaSystemStream addDestination(StreamDestination destination) {
PartitioningScheme scheme = destination.getPartitioningScheme();
int parallelism = destination.getParallelism();
SamzaSystemStream resultStream = null;
for (int i=0; i<systemStreams.size(); i++) {
// There is an existing SystemStream... | [
"public",
"SamzaSystemStream",
"addDestination",
"(",
"StreamDestination",
"destination",
")",
"{",
"PartitioningScheme",
"scheme",
"=",
"destination",
".",
"getPartitioningScheme",
"(",
")",
";",
"int",
"parallelism",
"=",
"destination",
".",
"getParallelism",
"(",
"... | /*
Add the PI to the list of destinations.
Return the name of the corresponding SystemStream. | [
"/",
"*",
"Add",
"the",
"PI",
"to",
"the",
"list",
"of",
"destinations",
".",
"Return",
"the",
"name",
"of",
"the",
"corresponding",
"SystemStream",
"."
] | train | https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaStream.java#L87-L109 |
GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.deletePipelineRecords | public static void deletePipelineRecords(String pipelineHandle, boolean force, boolean async)
throws NoSuchObjectException, IllegalStateException {
"""
Delete all data store entities corresponding to the given pipeline.
@param pipelineHandle The handle of the pipeline to be deleted
@param force If this p... | java | public static void deletePipelineRecords(String pipelineHandle, boolean force, boolean async)
throws NoSuchObjectException, IllegalStateException {
checkNonEmpty(pipelineHandle, "pipelineHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, pipelineHandle);
backEnd.deletePipeline(key, fo... | [
"public",
"static",
"void",
"deletePipelineRecords",
"(",
"String",
"pipelineHandle",
",",
"boolean",
"force",
",",
"boolean",
"async",
")",
"throws",
"NoSuchObjectException",
",",
"IllegalStateException",
"{",
"checkNonEmpty",
"(",
"pipelineHandle",
",",
"\"pipelineHan... | Delete all data store entities corresponding to the given pipeline.
@param pipelineHandle The handle of the pipeline to be deleted
@param force If this parameter is not {@code true} then this method will
throw an {@link IllegalStateException} if the specified pipeline is
not in the {@link State#FINALIZED} or {@link St... | [
"Delete",
"all",
"data",
"store",
"entities",
"corresponding",
"to",
"the",
"given",
"pipeline",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L409-L414 |
m-m-m/util | gwt/src/main/java/net/sf/mmm/util/gwt/base/rebind/AbstractIncrementalGenerator.java | AbstractIncrementalGenerator.generateDefaultConstructor | protected void generateDefaultConstructor(SourceWriter sourceWriter, String simpleName) {
"""
Generates the the default constructor.
@param sourceWriter is the {@link SourceWriter}.
@param simpleName is the {@link Class#getSimpleName() simple name}.
"""
generateSourcePublicConstructorDeclaration(sourc... | java | protected void generateDefaultConstructor(SourceWriter sourceWriter, String simpleName) {
generateSourcePublicConstructorDeclaration(sourceWriter, simpleName);
sourceWriter.println("super();");
generateSourceCloseBlock(sourceWriter);
} | [
"protected",
"void",
"generateDefaultConstructor",
"(",
"SourceWriter",
"sourceWriter",
",",
"String",
"simpleName",
")",
"{",
"generateSourcePublicConstructorDeclaration",
"(",
"sourceWriter",
",",
"simpleName",
")",
";",
"sourceWriter",
".",
"println",
"(",
"\"super();\... | Generates the the default constructor.
@param sourceWriter is the {@link SourceWriter}.
@param simpleName is the {@link Class#getSimpleName() simple name}. | [
"Generates",
"the",
"the",
"default",
"constructor",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/gwt/src/main/java/net/sf/mmm/util/gwt/base/rebind/AbstractIncrementalGenerator.java#L167-L172 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxCollaboration.java | BoxCollaboration.updateInfo | public void updateInfo(Info info) {
"""
Updates the information about this collaboration with any info fields that have been modified locally.
@param info the updated info.
"""
BoxAPIConnection api = this.getAPI();
URL url = COLLABORATION_URL_TEMPLATE.build(api.getBaseURL(), this.getID());
... | java | public void updateInfo(Info info) {
BoxAPIConnection api = this.getAPI();
URL url = COLLABORATION_URL_TEMPLATE.build(api.getBaseURL(), this.getID());
BoxJSONRequest request = new BoxJSONRequest(api, url, "PUT");
request.setBody(info.getPendingChanges());
BoxAPIResponse boxAPIRes... | [
"public",
"void",
"updateInfo",
"(",
"Info",
"info",
")",
"{",
"BoxAPIConnection",
"api",
"=",
"this",
".",
"getAPI",
"(",
")",
";",
"URL",
"url",
"=",
"COLLABORATION_URL_TEMPLATE",
".",
"build",
"(",
"api",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",... | Updates the information about this collaboration with any info fields that have been modified locally.
@param info the updated info. | [
"Updates",
"the",
"information",
"about",
"this",
"collaboration",
"with",
"any",
"info",
"fields",
"that",
"have",
"been",
"modified",
"locally",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxCollaboration.java#L162-L175 |
schallee/alib4j | core/src/main/java/net/darkmist/alib/res/PkgRes.java | PkgRes.appendResourcePathPrefixFor | protected static StringBuilder appendResourcePathPrefixFor(StringBuilder sb, Object obj) {
"""
Apend a package name converted to a resource path prefix.
@param sb what to append to. If this is null, a new
StringBuilder is created.
@param obj The object to get the package name from.
@return Path, starting and e... | java | protected static StringBuilder appendResourcePathPrefixFor(StringBuilder sb, Object obj)
{
if(obj == null)
throw new NullPointerException("obj is null");
return appendResourcePathPrefixFor(sb, getPackageName(obj));
} | [
"protected",
"static",
"StringBuilder",
"appendResourcePathPrefixFor",
"(",
"StringBuilder",
"sb",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"obj is null\"",
")",
";",
"return",
"appendResou... | Apend a package name converted to a resource path prefix.
@param sb what to append to. If this is null, a new
StringBuilder is created.
@param obj The object to get the package name from.
@return Path, starting and ending with a slash, for resources
prefixed by the package name.
@throws NullPointerException if obj is n... | [
"Apend",
"a",
"package",
"name",
"converted",
"to",
"a",
"resource",
"path",
"prefix",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/res/PkgRes.java#L172-L177 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.initNestedFormatters | protected void initNestedFormatters(Element element, CmsXmlContentDefinition contentDefinition)
throws CmsXmlException {
"""
Initializes the nested formatter fields.<p>
@param element the formatters element
@param contentDefinition the content definition
@throws CmsXmlException in case something goes wr... | java | protected void initNestedFormatters(Element element, CmsXmlContentDefinition contentDefinition)
throws CmsXmlException {
Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(element, APPINFO_NESTED_FORMATTER);
while (i.hasNext()) {
// iterate all "default" elements in the "default... | [
"protected",
"void",
"initNestedFormatters",
"(",
"Element",
"element",
",",
"CmsXmlContentDefinition",
"contentDefinition",
")",
"throws",
"CmsXmlException",
"{",
"Iterator",
"<",
"Element",
">",
"i",
"=",
"CmsXmlGenericWrapper",
".",
"elementIterator",
"(",
"element",... | Initializes the nested formatter fields.<p>
@param element the formatters element
@param contentDefinition the content definition
@throws CmsXmlException in case something goes wron | [
"Initializes",
"the",
"nested",
"formatter",
"fields",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L2782-L2792 |
joniles/mpxj | src/main/java/net/sf/mpxj/asta/AstaTextFileReader.java | AstaTextFileReader.processFileType | private void processFileType(String token) throws MPXJException {
"""
Reads the file version and configures the expected file format.
@param token token containing the file version
@throws MPXJException
"""
String version = token.substring(2).split(" ")[0];
//System.out.println(version);
... | java | private void processFileType(String token) throws MPXJException
{
String version = token.substring(2).split(" ")[0];
//System.out.println(version);
Class<? extends AbstractFileFormat> fileFormatClass = FILE_VERSION_MAP.get(Integer.valueOf(version));
if (fileFormatClass == null)
{
... | [
"private",
"void",
"processFileType",
"(",
"String",
"token",
")",
"throws",
"MPXJException",
"{",
"String",
"version",
"=",
"token",
".",
"substring",
"(",
"2",
")",
".",
"split",
"(",
"\" \"",
")",
"[",
"0",
"]",
";",
"//System.out.println(version);",
"Cla... | Reads the file version and configures the expected file format.
@param token token containing the file version
@throws MPXJException | [
"Reads",
"the",
"file",
"version",
"and",
"configures",
"the",
"expected",
"file",
"format",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaTextFileReader.java#L221-L241 |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/StatementCompiler.java | StatementCompiler.addUDFDependences | private static void addUDFDependences(Function function, Statement catalogStmt) {
"""
Add all statement dependences, both ways.
@param function The function to add as dependee.
@param procedure The procedure of the statement.
@param catalogStmt The statement to add as depender.
"""
Procedure procedu... | java | private static void addUDFDependences(Function function, Statement catalogStmt) {
Procedure procedure = (Procedure)catalogStmt.getParent();
addFunctionDependence(function, procedure, catalogStmt);
addStatementDependence(function, catalogStmt);
} | [
"private",
"static",
"void",
"addUDFDependences",
"(",
"Function",
"function",
",",
"Statement",
"catalogStmt",
")",
"{",
"Procedure",
"procedure",
"=",
"(",
"Procedure",
")",
"catalogStmt",
".",
"getParent",
"(",
")",
";",
"addFunctionDependence",
"(",
"function"... | Add all statement dependences, both ways.
@param function The function to add as dependee.
@param procedure The procedure of the statement.
@param catalogStmt The statement to add as depender. | [
"Add",
"all",
"statement",
"dependences",
"both",
"ways",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/StatementCompiler.java#L372-L376 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_snmp.java | syslog_snmp.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>
"""
syslog_snmp_responses result = (syslog_snmp_responses) service.get_payl... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
syslog_snmp_responses result = (syslog_snmp_responses) service.get_payload_formatter().string_to_resource(syslog_snmp_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode =... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"syslog_snmp_responses",
"result",
"=",
"(",
"syslog_snmp_responses",
")",
"service",
".",
"get_payload_format... | <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/mps/syslog_snmp.java#L583-L600 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractMapView.java | AbstractMapView.fireEntryRemoved | @SuppressWarnings("unchecked")
protected void fireEntryRemoved(K key, V value) {
"""
Fire the removal event.
@param key the removed key.
@param value the removed value.
"""
if (this.listeners != null) {
for (final DMapListener<? super K, ? super V> listener : this.listeners.getListeners(DMapListener.... | java | @SuppressWarnings("unchecked")
protected void fireEntryRemoved(K key, V value) {
if (this.listeners != null) {
for (final DMapListener<? super K, ? super V> listener : this.listeners.getListeners(DMapListener.class)) {
listener.entryRemoved(key, value);
}
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"fireEntryRemoved",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"this",
".",
"listeners",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"DMapListener",
"<",
"?",
"super"... | Fire the removal event.
@param key the removed key.
@param value the removed value. | [
"Fire",
"the",
"removal",
"event",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/util/AbstractMapView.java#L73-L80 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/PosixHelp.java | PosixHelp.setGroup | public static final void setGroup(String name, Path... files) throws IOException {
"""
Change group of given files. Works only in linux
@param name
@param files
@throws IOException
@see org.vesalainen.util.OSProcess#call(java.lang.String...)
"""
if (supports("posix"))
{
for (... | java | public static final void setGroup(String name, Path... files) throws IOException
{
if (supports("posix"))
{
for (Path file : files)
{
FileSystem fs = file.getFileSystem();
UserPrincipalLookupService upls = fs.getUserPrincipalLookupServic... | [
"public",
"static",
"final",
"void",
"setGroup",
"(",
"String",
"name",
",",
"Path",
"...",
"files",
")",
"throws",
"IOException",
"{",
"if",
"(",
"supports",
"(",
"\"posix\"",
")",
")",
"{",
"for",
"(",
"Path",
"file",
":",
"files",
")",
"{",
"FileSys... | Change group of given files. Works only in linux
@param name
@param files
@throws IOException
@see org.vesalainen.util.OSProcess#call(java.lang.String...) | [
"Change",
"group",
"of",
"given",
"files",
".",
"Works",
"only",
"in",
"linux"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/PosixHelp.java#L175-L192 |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LoginService.java | LoginService.performLcdsHeartBeat | public String performLcdsHeartBeat(long accountId, String sessionToken, int heartBeatCount, Date date) {
"""
Perform a heartbeat
@param accountId The user id
@param sessionToken The token for the current session
@param heartBeatCount The amount of heartbeats that have been sent
@param date The time of the hear... | java | public String performLcdsHeartBeat(long accountId, String sessionToken, int heartBeatCount, Date date) {
return client.sendRpcAndWait(SERVICE, "performLCDSHeartBeat", accountId, sessionToken, heartBeatCount, format.format(date));
} | [
"public",
"String",
"performLcdsHeartBeat",
"(",
"long",
"accountId",
",",
"String",
"sessionToken",
",",
"int",
"heartBeatCount",
",",
"Date",
"date",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"performLCDSHeartBeat\"",
",",
"acco... | Perform a heartbeat
@param accountId The user id
@param sessionToken The token for the current session
@param heartBeatCount The amount of heartbeats that have been sent
@param date The time of the heart beat
@return A string | [
"Perform",
"a",
"heartbeat"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LoginService.java#L69-L71 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.logSlowQueryByCommons | public ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit) {
"""
Register {@link CommonsSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@return builder
@since 1.4.1
"""
return logSlowQueryByComm... | java | public ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit) {
return logSlowQueryByCommons(thresholdTime, timeUnit, null, null);
} | [
"public",
"ProxyDataSourceBuilder",
"logSlowQueryByCommons",
"(",
"long",
"thresholdTime",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"logSlowQueryByCommons",
"(",
"thresholdTime",
",",
"timeUnit",
",",
"null",
",",
"null",
")",
";",
"}"
] | Register {@link CommonsSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@return builder
@since 1.4.1 | [
"Register",
"{",
"@link",
"CommonsSlowQueryListener",
"}",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L233-L235 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/liveweb/FileRegion.java | FileRegion.copyToOutputStream | public void copyToOutputStream(OutputStream o) throws IOException {
"""
Copy this record to the provided OutputStream
@param o the OutputStream where the bytes should be sent.
@throws IOException for usual reasons
"""
long left = end - start;
int BUFF_SIZE = 4096;
byte buf[] = new byte[BUFF_SIZE];
Ra... | java | public void copyToOutputStream(OutputStream o) throws IOException {
long left = end - start;
int BUFF_SIZE = 4096;
byte buf[] = new byte[BUFF_SIZE];
RandomAccessFile raf = new RandomAccessFile(file, "r");
try {
raf.seek(start);
while(left > 0) {
int amtToRead = (int) Math.min(left, BUFF_SIZE);
i... | [
"public",
"void",
"copyToOutputStream",
"(",
"OutputStream",
"o",
")",
"throws",
"IOException",
"{",
"long",
"left",
"=",
"end",
"-",
"start",
";",
"int",
"BUFF_SIZE",
"=",
"4096",
";",
"byte",
"buf",
"[",
"]",
"=",
"new",
"byte",
"[",
"BUFF_SIZE",
"]",
... | Copy this record to the provided OutputStream
@param o the OutputStream where the bytes should be sent.
@throws IOException for usual reasons | [
"Copy",
"this",
"record",
"to",
"the",
"provided",
"OutputStream"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/liveweb/FileRegion.java#L49-L68 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/BillingApi.java | BillingApi.listPayments | public BillingPaymentsResponse listPayments(String accountId, BillingApi.ListPaymentsOptions options) throws ApiException {
"""
Gets payment information for one or more payments.
Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response retu... | java | public BillingPaymentsResponse listPayments(String accountId, BillingApi.ListPaymentsOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required parameter ... | [
"public",
"BillingPaymentsResponse",
"listPayments",
"(",
"String",
"accountId",
",",
"BillingApi",
".",
"ListPaymentsOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"\"{}\"",
";",
"// verify the required parameter 'accountId' is se... | Gets payment information for one or more payments.
Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days. Privileges required: account administrator
@param accountId The external account numb... | [
"Gets",
"payment",
"information",
"for",
"one",
"or",
"more",
"payments",
".",
"Retrieves",
"a",
"list",
"containing",
"information",
"about",
"one",
"or",
"more",
"payments",
".",
"If",
"the",
"from",
"date",
"or",
"to",
"date",
"queries",
"are",
"not",
"... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/BillingApi.java#L542-L579 |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/util/StreamUtil.java | StreamUtil.copy | public static int copy(InputStream in, OutputStream out) throws IOException {
"""
将输入流的内容复制到输出流里
@param in 输入流
@param out 输出流
@return 复制的数据字节数
@throws IOException IO异常
"""
BeanUtil.requireNonNull(in, "No InputStream specified");
BeanUtil.requireNonNull(out, "No OutputStream specified");
... | java | public static int copy(InputStream in, OutputStream out) throws IOException {
BeanUtil.requireNonNull(in, "No InputStream specified");
BeanUtil.requireNonNull(out, "No OutputStream specified");
int byteCount = 0;
byte[] buffer = new byte[4096];
int bytesRead1;
for (; (byt... | [
"public",
"static",
"int",
"copy",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"BeanUtil",
".",
"requireNonNull",
"(",
"in",
",",
"\"No InputStream specified\"",
")",
";",
"BeanUtil",
".",
"requireNonNull",
"(",
"out"... | 将输入流的内容复制到输出流里
@param in 输入流
@param out 输出流
@return 复制的数据字节数
@throws IOException IO异常 | [
"将输入流的内容复制到输出流里"
] | train | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/util/StreamUtil.java#L31-L42 |
mqlight/java-mqlight | mqlight/src/main/java/com/ibm/mqlight/api/security/KeyStoreUtils.java | KeyStoreUtils.createPrivateKey | public static PrivateKey createPrivateKey(File pemKeyFile, char[] passwordChars) throws IOException, GeneralSecurityException {
"""
Creates a {@link PrivateKey} instance from the passed private key PEM format file and certificate chain.
@param pemKeyFile
A PEM format file containing the private key.
@param pa... | java | public static PrivateKey createPrivateKey(File pemKeyFile, char[] passwordChars) throws IOException, GeneralSecurityException {
final String methodName = "createPrivateKey";
logger.entry(methodName, pemKeyFile);
// Read the private key from the PEM format file
final PemFile privateKeyPe... | [
"public",
"static",
"PrivateKey",
"createPrivateKey",
"(",
"File",
"pemKeyFile",
",",
"char",
"[",
"]",
"passwordChars",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"final",
"String",
"methodName",
"=",
"\"createPrivateKey\"",
";",
"logger",
... | Creates a {@link PrivateKey} instance from the passed private key PEM format file and certificate chain.
@param pemKeyFile
A PEM format file containing the private key.
@param passwordChars
The password that protects the private key.
@return the private key, created by this method.
@throws IOException if the file cann... | [
"Creates",
"a",
"{",
"@link",
"PrivateKey",
"}",
"instance",
"from",
"the",
"passed",
"private",
"key",
"PEM",
"format",
"file",
"and",
"certificate",
"chain",
"."
] | train | https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/security/KeyStoreUtils.java#L147-L192 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ChiSquaredDistribution.java | ChiSquaredDistribution.logpdf | public static double logpdf(double x, double dof) {
"""
Chi-Squared distribution PDF (with 0.0 for x < 0)
@param x query value
@param dof Degrees of freedom.
@return probability density
"""
if(x <= 0) {
return Double.NEGATIVE_INFINITY;
}
if(dof <= 0) {
return Double.NaN;
}
... | java | public static double logpdf(double x, double dof) {
if(x <= 0) {
return Double.NEGATIVE_INFINITY;
}
if(dof <= 0) {
return Double.NaN;
}
final double k = dof * .5;
final double twox = x * 2.0;
return twox == Double.POSITIVE_INFINITY ? Double.NEGATIVE_INFINITY : //
(k - 1.0... | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"x",
",",
"double",
"dof",
")",
"{",
"if",
"(",
"x",
"<=",
"0",
")",
"{",
"return",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"}",
"if",
"(",
"dof",
"<=",
"0",
")",
"{",
"return",
"Double",
".",... | Chi-Squared distribution PDF (with 0.0 for x < 0)
@param x query value
@param dof Degrees of freedom.
@return probability density | [
"Chi",
"-",
"Squared",
"distribution",
"PDF",
"(",
"with",
"0",
".",
"0",
"for",
"x",
"<",
";",
"0",
")"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/ChiSquaredDistribution.java#L106-L117 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/configuration/SourceState.java | SourceState.createExtract | @Deprecated
public synchronized Extract createExtract(Extract.TableType type, String namespace, String table) {
"""
Create a new properly populated {@link Extract} instance.
<p>
This method should always return a new unique {@link Extract} instance.
</p>
@param type {@link org.apache.gobblin.source.worku... | java | @Deprecated
public synchronized Extract createExtract(Extract.TableType type, String namespace, String table) {
Extract extract = new Extract(this, type, namespace, table);
while (EXTRACT_SET.contains(extract)) {
if (Strings.isNullOrEmpty(extract.getExtractId())) {
extract.setExtractId(DTF.print... | [
"@",
"Deprecated",
"public",
"synchronized",
"Extract",
"createExtract",
"(",
"Extract",
".",
"TableType",
"type",
",",
"String",
"namespace",
",",
"String",
"table",
")",
"{",
"Extract",
"extract",
"=",
"new",
"Extract",
"(",
"this",
",",
"type",
",",
"name... | Create a new properly populated {@link Extract} instance.
<p>
This method should always return a new unique {@link Extract} instance.
</p>
@param type {@link org.apache.gobblin.source.workunit.Extract.TableType}
@param namespace namespace of the table this extract belongs to
@param table name of the table this extrac... | [
"Create",
"a",
"new",
"properly",
"populated",
"{",
"@link",
"Extract",
"}",
"instance",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/SourceState.java#L272-L285 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.sumRows | public static DMatrixRMaj sumRows(DMatrixRMaj input , DMatrixRMaj output ) {
"""
<p>
Computes the sum of each row in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = sum(i=1:n ; a<sub>ji</sub>)
</p>
@param input INput matrix whose rows are summed.
@param output Optional storag... | java | public static DMatrixRMaj sumRows(DMatrixRMaj input , DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(input.numRows,1);
} else {
output.reshape(input.numRows,1);
}
for( int row = 0; row < input.numRows; row++ ) {
double total = ... | [
"public",
"static",
"DMatrixRMaj",
"sumRows",
"(",
"DMatrixRMaj",
"input",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"input",
".",
"numRows",
",",
"1",
")",
";",
"}",
... | <p>
Computes the sum of each row in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = sum(i=1:n ; a<sub>ji</sub>)
</p>
@param input INput matrix whose rows are summed.
@param output Optional storage for output. Reshaped into a column. Modified.
@return Vector containing the sum of each row... | [
"<p",
">",
"Computes",
"the",
"sum",
"of",
"each",
"row",
"in",
"the",
"input",
"matrix",
"and",
"returns",
"the",
"results",
"in",
"a",
"vector",
":",
"<br",
">",
"<br",
">",
"b<sub",
">",
"j<",
"/",
"sub",
">",
"=",
"sum",
"(",
"i",
"=",
"1",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1862-L1880 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_sf_storagecentervpx_image.java | xen_sf_storagecentervpx_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_sf_storagecentervpx_image_responses result = (xen_sf_storagecenterv... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_sf_storagecentervpx_image_responses result = (xen_sf_storagecentervpx_image_responses) service.get_payload_formatter().string_to_resource(xen_sf_storagecentervpx_image_responses.class, response);
if(... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_sf_storagecentervpx_image_responses",
"result",
"=",
"(",
"xen_sf_storagecentervpx_image_responses",
")",
"se... | <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_sf_storagecentervpx_image.java#L264-L281 |
gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/UploadRequest.java | UploadRequest.startUpload | public String startUpload() {
"""
Start the background file upload service.
@return the uploadId string. If you have passed your own uploadId in the constructor, this
method will return that same uploadId, otherwise it will return the automatically
generated uploadId
"""
UploadService.setUploadStatu... | java | public String startUpload() {
UploadService.setUploadStatusDelegate(params.id, delegate);
final Intent intent = new Intent(context, UploadService.class);
this.initializeIntent(intent);
intent.setAction(UploadService.getActionUpload());
if (Build.VERSION.SDK_INT >= Build.VERSION... | [
"public",
"String",
"startUpload",
"(",
")",
"{",
"UploadService",
".",
"setUploadStatusDelegate",
"(",
"params",
".",
"id",
",",
"delegate",
")",
";",
"final",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"context",
",",
"UploadService",
".",
"class",
")"... | Start the background file upload service.
@return the uploadId string. If you have passed your own uploadId in the constructor, this
method will return that same uploadId, otherwise it will return the automatically
generated uploadId | [
"Start",
"the",
"background",
"file",
"upload",
"service",
"."
] | train | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/UploadRequest.java#L63-L80 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.newCallNode | static Node newCallNode(Node callTarget, Node... parameters) {
"""
A new CALL node with the "FREE_CALL" set based on call target.
"""
boolean isFreeCall = !isGet(callTarget);
Node call = IR.call(callTarget);
call.putBooleanProp(Node.FREE_CALL, isFreeCall);
for (Node parameter : parameters) {
... | java | static Node newCallNode(Node callTarget, Node... parameters) {
boolean isFreeCall = !isGet(callTarget);
Node call = IR.call(callTarget);
call.putBooleanProp(Node.FREE_CALL, isFreeCall);
for (Node parameter : parameters) {
call.addChildToBack(parameter);
}
return call;
} | [
"static",
"Node",
"newCallNode",
"(",
"Node",
"callTarget",
",",
"Node",
"...",
"parameters",
")",
"{",
"boolean",
"isFreeCall",
"=",
"!",
"isGet",
"(",
"callTarget",
")",
";",
"Node",
"call",
"=",
"IR",
".",
"call",
"(",
"callTarget",
")",
";",
"call",
... | A new CALL node with the "FREE_CALL" set based on call target. | [
"A",
"new",
"CALL",
"node",
"with",
"the",
"FREE_CALL",
"set",
"based",
"on",
"call",
"target",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L5014-L5022 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/Equality.java | Equality.satisfies | @Override
public boolean satisfies(Match match, int... ind) {
"""
Checks if the two elements are identical or not identical as desired.
@param match current pattern match
@param ind mapped indices
@return true if identity checks equals the desired value
"""
assert ind.length == 2;
return (match.get(in... | java | @Override
public boolean satisfies(Match match, int... ind)
{
assert ind.length == 2;
return (match.get(ind[0]) == match.get(ind[1])) == equals;
} | [
"@",
"Override",
"public",
"boolean",
"satisfies",
"(",
"Match",
"match",
",",
"int",
"...",
"ind",
")",
"{",
"assert",
"ind",
".",
"length",
"==",
"2",
";",
"return",
"(",
"match",
".",
"get",
"(",
"ind",
"[",
"0",
"]",
")",
"==",
"match",
".",
... | Checks if the two elements are identical or not identical as desired.
@param match current pattern match
@param ind mapped indices
@return true if identity checks equals the desired value | [
"Checks",
"if",
"the",
"two",
"elements",
"are",
"identical",
"or",
"not",
"identical",
"as",
"desired",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/Equality.java#L35-L41 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/SortOrderHandler.java | SortOrderHandler.init | public void init(BaseField field, GridScreenParent gridScreen, Record recGrid, boolean bCreateSortOrder) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param gridScreen The grid screen you will be requering.
@param recGrid The grid record.
"""
... | java | public void init(BaseField field, GridScreenParent gridScreen, Record recGrid, boolean bCreateSortOrder)
{
m_recGrid = recGrid;
m_bCreateSortOrder = bCreateSortOrder;
super.init(field, gridScreen, null);
m_iKeyAreaArray = new String[MAX_ARRAY_SIZE];
for (int i = 0; i < MAX_AR... | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"GridScreenParent",
"gridScreen",
",",
"Record",
"recGrid",
",",
"boolean",
"bCreateSortOrder",
")",
"{",
"m_recGrid",
"=",
"recGrid",
";",
"m_bCreateSortOrder",
"=",
"bCreateSortOrder",
";",
"super",
".",
... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param gridScreen The grid screen you will be requering.
@param recGrid The grid record. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/SortOrderHandler.java#L106-L115 |
osiam/connector4java | src/main/java/org/osiam/client/OsiamConnector.java | OsiamConnector.updateGroup | @Deprecated
public Group updateGroup(String id, UpdateGroup updateGroup, AccessToken accessToken) {
"""
update the group of the given id with the values given in the Group Object. For more detailed information how to
set new field. Update Fields or to delete Fields please look in the documentation
@param ... | java | @Deprecated
public Group updateGroup(String id, UpdateGroup updateGroup, AccessToken accessToken) {
return getGroupService().updateGroup(id, updateGroup, accessToken);
} | [
"@",
"Deprecated",
"public",
"Group",
"updateGroup",
"(",
"String",
"id",
",",
"UpdateGroup",
"updateGroup",
",",
"AccessToken",
"accessToken",
")",
"{",
"return",
"getGroupService",
"(",
")",
".",
"updateGroup",
"(",
"id",
",",
"updateGroup",
",",
"accessToken"... | update the group of the given id with the values given in the Group Object. For more detailed information how to
set new field. Update Fields or to delete Fields please look in the documentation
@param id id of the Group to be updated
@param updateGroup all Fields that need to be updated
@param accessToken th... | [
"update",
"the",
"group",
"of",
"the",
"given",
"id",
"with",
"the",
"values",
"given",
"in",
"the",
"Group",
"Object",
".",
"For",
"more",
"detailed",
"information",
"how",
"to",
"set",
"new",
"field",
".",
"Update",
"Fields",
"or",
"to",
"delete",
"Fie... | train | https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamConnector.java#L566-L569 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count, final Connection conn,
final String insertSQL) throws UncheckedSQLException {
"""
Imports the data from <code>DataSet</code> to database.
@param dataset
@param selectC... | java | public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count, final Connection conn,
final String insertSQL) throws UncheckedSQLException {
return importData(dataset, selectColumnNames, offset, count, conn, insertSQL, 200, 0);
... | [
"public",
"static",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"Collection",
"<",
"String",
">",
"selectColumnNames",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"count",
",",
"final",
"Connection",
"conn",
",",
"final",
"... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param selectColumnNames
@param offset
@param count
@param conn
@param insertSQL the column order in the sql must be consistent with the column order in the DataSet. Here is sample about how to create the sql:
<pre><code>
List<String> columnNameLis... | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L1895-L1898 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.scaleAround | public Matrix4f scaleAround(float factor, float ox, float oy, float oz) {
"""
Apply scaling to this matrix by scaling all three base axes by the given <code>factor</code>
while using <code>(ox, oy, oz)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling... | java | public Matrix4f scaleAround(float factor, float ox, float oy, float oz) {
return scaleAround(factor, factor, factor, ox, oy, oz, thisOrNew());
} | [
"public",
"Matrix4f",
"scaleAround",
"(",
"float",
"factor",
",",
"float",
"ox",
",",
"float",
"oy",
",",
"float",
"oz",
")",
"{",
"return",
"scaleAround",
"(",
"factor",
",",
"factor",
",",
"factor",
",",
"ox",
",",
"oy",
",",
"oz",
",",
"thisOrNew",
... | Apply scaling to this matrix by scaling all three base axes by the given <code>factor</code>
while using <code>(ox, oy, oz)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>M * S</code>. So when transforming a
vector... | [
"Apply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"all",
"three",
"base",
"axes",
"by",
"the",
"given",
"<code",
">",
"factor<",
"/",
"code",
">",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
"oz",
")",
"<",
"/",
"code",
">",
"as",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L4866-L4868 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/server/ServerImpl.java | ServerImpl.setSelfMuted | public void setSelfMuted(long userId, boolean muted) {
"""
Sets the self-muted state of the user with the given id.
@param userId The id of the user.
@param muted Whether the user with the given id is self-muted or not.
"""
if (muted) {
selfMuted.add(userId);
} else {
... | java | public void setSelfMuted(long userId, boolean muted) {
if (muted) {
selfMuted.add(userId);
} else {
selfMuted.remove(userId);
}
} | [
"public",
"void",
"setSelfMuted",
"(",
"long",
"userId",
",",
"boolean",
"muted",
")",
"{",
"if",
"(",
"muted",
")",
"{",
"selfMuted",
".",
"add",
"(",
"userId",
")",
";",
"}",
"else",
"{",
"selfMuted",
".",
"remove",
"(",
"userId",
")",
";",
"}",
... | Sets the self-muted state of the user with the given id.
@param userId The id of the user.
@param muted Whether the user with the given id is self-muted or not. | [
"Sets",
"the",
"self",
"-",
"muted",
"state",
"of",
"the",
"user",
"with",
"the",
"given",
"id",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/server/ServerImpl.java#L730-L736 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseNegationExpression | private Expr parseNegationExpression(EnclosingScope scope, boolean terminated) {
"""
Parse a negation expression, which is of the form:
<pre>
TermExpr::= ...
| '-' Expr
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the... | java | private Expr parseNegationExpression(EnclosingScope scope, boolean terminated) {
int start = index;
match(Minus);
Expr e = parseAccessExpression(scope, terminated);
return annotateSourceLocation(new Expr.IntegerNegation(Type.Void, e), start);
} | [
"private",
"Expr",
"parseNegationExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"Minus",
")",
";",
"Expr",
"e",
"=",
"parseAccessExpression",
"(",
"scope",
",",
"terminated"... | Parse a negation expression, which is of the form:
<pre>
TermExpr::= ...
| '-' Expr
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param terminated
This indicates that the expression is known to be ter... | [
"Parse",
"a",
"negation",
"expression",
"which",
"is",
"of",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L2926-L2931 |
actframework/actframework | src/main/java/act/conf/Config.java | Config.get | public <T> T get(ConfigKey key, T def) {
"""
Return configuration by {@link AppConfigKey configuration key}
@param key
@param <T>
@return the configured item
"""
Object o = data.get(key);
if (null == o) {
o = key.val(raw);
if (null == o) {
o = null =... | java | public <T> T get(ConfigKey key, T def) {
Object o = data.get(key);
if (null == o) {
o = key.val(raw);
if (null == o) {
o = null == def ? NULL : def;
}
data.put(key, o);
}
if (isDebugEnabled()) {
debug("config[%s]... | [
"public",
"<",
"T",
">",
"T",
"get",
"(",
"ConfigKey",
"key",
",",
"T",
"def",
")",
"{",
"Object",
"o",
"=",
"data",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"null",
"==",
"o",
")",
"{",
"o",
"=",
"key",
".",
"val",
"(",
"raw",
")",
"... | Return configuration by {@link AppConfigKey configuration key}
@param key
@param <T>
@return the configured item | [
"Return",
"configuration",
"by",
"{",
"@link",
"AppConfigKey",
"configuration",
"key",
"}"
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/conf/Config.java#L72-L89 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java | DatabasesInner.listByCluster | public List<DatabaseInner> listByCluster(String resourceGroupName, String clusterName) {
"""
Returns the list of databases of the given Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@throws IllegalArgument... | java | public List<DatabaseInner> listByCluster(String resourceGroupName, String clusterName) {
return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"DatabaseInner",
">",
"listByCluster",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"return",
"listByClusterWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"toBlocking",
"(",
")",... | Returns the list of databases of the given Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rej... | [
"Returns",
"the",
"list",
"of",
"databases",
"of",
"the",
"given",
"Kusto",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java#L219-L221 |
sannies/mp4parser | isoparser/src/main/java/org/mp4parser/boxes/microsoft/XtraBox.java | XtraBox.setTagValue | public void setTagValue(String name, long value) {
"""
Removes and recreates tag using specified Long value
@param name Tag name to replace
@param value New Long value
"""
removeTag(name);
XtraTag tag = new XtraTag(name);
tag.values.addElement(new XtraValue(value));
tags.ad... | java | public void setTagValue(String name, long value) {
removeTag(name);
XtraTag tag = new XtraTag(name);
tag.values.addElement(new XtraValue(value));
tags.addElement(tag);
} | [
"public",
"void",
"setTagValue",
"(",
"String",
"name",
",",
"long",
"value",
")",
"{",
"removeTag",
"(",
"name",
")",
";",
"XtraTag",
"tag",
"=",
"new",
"XtraTag",
"(",
"name",
")",
";",
"tag",
".",
"values",
".",
"addElement",
"(",
"new",
"XtraValue"... | Removes and recreates tag using specified Long value
@param name Tag name to replace
@param value New Long value | [
"Removes",
"and",
"recreates",
"tag",
"using",
"specified",
"Long",
"value"
] | train | https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/isoparser/src/main/java/org/mp4parser/boxes/microsoft/XtraBox.java#L329-L334 |
GoogleCloudPlatform/appengine-gcs-client | java/src/main/java/com/google/appengine/tools/cloudstorage/dev/LocalRawGcsService.java | LocalRawGcsService.continueObjectCreationAsync | @Override
public Future<RawGcsCreationToken> continueObjectCreationAsync(final RawGcsCreationToken token,
final ByteBuffer chunk, long timeoutMillis) {
"""
Runs calls in a background thread so that the results will actually be asynchronous.
@see com.google.appengine.tools.cloudstorage.RawGcsService#cont... | java | @Override
public Future<RawGcsCreationToken> continueObjectCreationAsync(final RawGcsCreationToken token,
final ByteBuffer chunk, long timeoutMillis) {
try {
ensureInitialized();
} catch (IOException e) {
throw new RuntimeException(e);
}
final Environment environment = ApiProxy.getCu... | [
"@",
"Override",
"public",
"Future",
"<",
"RawGcsCreationToken",
">",
"continueObjectCreationAsync",
"(",
"final",
"RawGcsCreationToken",
"token",
",",
"final",
"ByteBuffer",
"chunk",
",",
"long",
"timeoutMillis",
")",
"{",
"try",
"{",
"ensureInitialized",
"(",
")",... | Runs calls in a background thread so that the results will actually be asynchronous.
@see com.google.appengine.tools.cloudstorage.RawGcsService#continueObjectCreationAsync(
com.google.appengine.tools.cloudstorage.RawGcsService.RawGcsCreationToken,
java.nio.ByteBuffer, long) | [
"Runs",
"calls",
"in",
"a",
"background",
"thread",
"so",
"that",
"the",
"results",
"will",
"actually",
"be",
"asynchronous",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-gcs-client/blob/d11078331ecd915d753c886e96a80133599f3f98/java/src/main/java/com/google/appengine/tools/cloudstorage/dev/LocalRawGcsService.java#L286-L302 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java | RedundentExprEliminator.isNotSameAsOwner | protected boolean isNotSameAsOwner(MultistepExprHolder head, ElemTemplateElement ete) {
"""
Find out if the given ElemTemplateElement is not the same as one of
the ElemTemplateElement owners of the expressions.
@param head Head of linked list of expression owners.
@param ete The ElemTemplateElement that is a ... | java | protected boolean isNotSameAsOwner(MultistepExprHolder head, ElemTemplateElement ete)
{
MultistepExprHolder next = head;
while(null != next)
{
ElemTemplateElement elemOwner = getElemFromExpression(next.m_exprOwner.getExpression());
if(elemOwner == ete)
return false;
next = next.m_next;
}
... | [
"protected",
"boolean",
"isNotSameAsOwner",
"(",
"MultistepExprHolder",
"head",
",",
"ElemTemplateElement",
"ete",
")",
"{",
"MultistepExprHolder",
"next",
"=",
"head",
";",
"while",
"(",
"null",
"!=",
"next",
")",
"{",
"ElemTemplateElement",
"elemOwner",
"=",
"ge... | Find out if the given ElemTemplateElement is not the same as one of
the ElemTemplateElement owners of the expressions.
@param head Head of linked list of expression owners.
@param ete The ElemTemplateElement that is a candidate for a psuedo
variable parent.
@return true if the given ElemTemplateElement is not the same... | [
"Find",
"out",
"if",
"the",
"given",
"ElemTemplateElement",
"is",
"not",
"the",
"same",
"as",
"one",
"of",
"the",
"ElemTemplateElement",
"owners",
"of",
"the",
"expressions",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java#L382-L393 |
bingoohuang/excel2javabeans | src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java | PoiUtil.shiftRows | public static int shiftRows(Sheet sheet, int itemSize, int targetRowNum) {
"""
插入新的行(向下移动表格中的行),方便写入数据。
@param sheet 表单页。
@param itemSize 插入行数列。
@param targetRowNum 模板行号。
@return 插入行数列。
"""
int lastRowNum = sheet.getLastRowNum();
if (itemSize == 0 && targetRowNum == lastRowNum)... | java | public static int shiftRows(Sheet sheet, int itemSize, int targetRowNum) {
int lastRowNum = sheet.getLastRowNum();
if (itemSize == 0 && targetRowNum == lastRowNum) { // 没有写入行,直接删除模板行
sheet.removeRow(sheet.getRow(targetRowNum));
} else if (itemSize != 1 && targetRowNum < lastRowNum) {... | [
"public",
"static",
"int",
"shiftRows",
"(",
"Sheet",
"sheet",
",",
"int",
"itemSize",
",",
"int",
"targetRowNum",
")",
"{",
"int",
"lastRowNum",
"=",
"sheet",
".",
"getLastRowNum",
"(",
")",
";",
"if",
"(",
"itemSize",
"==",
"0",
"&&",
"targetRowNum",
"... | 插入新的行(向下移动表格中的行),方便写入数据。
@param sheet 表单页。
@param itemSize 插入行数列。
@param targetRowNum 模板行号。
@return 插入行数列。 | [
"插入新的行(向下移动表格中的行),方便写入数据。"
] | train | https://github.com/bingoohuang/excel2javabeans/blob/db136d460b93b649814366c0d84a982698b96dc3/src/main/java/com/github/bingoohuang/excel2beans/PoiUtil.java#L129-L138 |
stagemonitor/stagemonitor | stagemonitor-core/src/main/java/org/stagemonitor/core/elasticsearch/ElasticsearchClient.java | ElasticsearchClient.scheduleIndexManagement | public void scheduleIndexManagement(String indexPrefix, int optimizeAndMoveIndicesToColdNodesOlderThanDays, int deleteIndicesOlderThanDays) {
"""
Performs an optimize and delete on logstash-style index patterns [prefix]YYYY.MM.DD
@param indexPrefix the prefix of the logstash-style index pattern
"""
if (de... | java | public void scheduleIndexManagement(String indexPrefix, int optimizeAndMoveIndicesToColdNodesOlderThanDays, int deleteIndicesOlderThanDays) {
if (deleteIndicesOlderThanDays > 0) {
final TimerTask deleteIndicesTask = new DeleteIndicesTask(corePlugin.getIndexSelector(), indexPrefix,
deleteIndicesOlderThanDays, ... | [
"public",
"void",
"scheduleIndexManagement",
"(",
"String",
"indexPrefix",
",",
"int",
"optimizeAndMoveIndicesToColdNodesOlderThanDays",
",",
"int",
"deleteIndicesOlderThanDays",
")",
"{",
"if",
"(",
"deleteIndicesOlderThanDays",
">",
"0",
")",
"{",
"final",
"TimerTask",
... | Performs an optimize and delete on logstash-style index patterns [prefix]YYYY.MM.DD
@param indexPrefix the prefix of the logstash-style index pattern | [
"Performs",
"an",
"optimize",
"and",
"delete",
"on",
"logstash",
"-",
"style",
"index",
"patterns",
"[",
"prefix",
"]",
"YYYY",
".",
"MM",
".",
"DD"
] | train | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-core/src/main/java/org/stagemonitor/core/elasticsearch/ElasticsearchClient.java#L352-L371 |
paymill/paymill-java | src/main/java/com/paymill/services/SubscriptionService.java | SubscriptionService.limitValidity | public Subscription limitValidity( String subscription, String newValidity ) {
"""
Change the period of validity for a subscription.
@param subscription the subscription.
@param newValidity the new validity .
@return the updated subscription.
"""
return limitValidity( new Subscription( subscription ),... | java | public Subscription limitValidity( String subscription, String newValidity ) {
return limitValidity( new Subscription( subscription ), newValidity );
} | [
"public",
"Subscription",
"limitValidity",
"(",
"String",
"subscription",
",",
"String",
"newValidity",
")",
"{",
"return",
"limitValidity",
"(",
"new",
"Subscription",
"(",
"subscription",
")",
",",
"newValidity",
")",
";",
"}"
] | Change the period of validity for a subscription.
@param subscription the subscription.
@param newValidity the new validity .
@return the updated subscription. | [
"Change",
"the",
"period",
"of",
"validity",
"for",
"a",
"subscription",
"."
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/SubscriptionService.java#L587-L589 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addDelegateInstanceMethod | public static MethodNode addDelegateInstanceMethod(ClassNode classNode, Expression delegate, MethodNode declaredMethod) {
"""
Adds a delegate method to the target class node where the first argument
is to the delegate method is 'this'. In other words a method such as
foo(Object instance, String bar) would be add... | java | public static MethodNode addDelegateInstanceMethod(ClassNode classNode, Expression delegate, MethodNode declaredMethod) {
return addDelegateInstanceMethod(classNode, delegate, declaredMethod, null, true);
} | [
"public",
"static",
"MethodNode",
"addDelegateInstanceMethod",
"(",
"ClassNode",
"classNode",
",",
"Expression",
"delegate",
",",
"MethodNode",
"declaredMethod",
")",
"{",
"return",
"addDelegateInstanceMethod",
"(",
"classNode",
",",
"delegate",
",",
"declaredMethod",
"... | Adds a delegate method to the target class node where the first argument
is to the delegate method is 'this'. In other words a method such as
foo(Object instance, String bar) would be added with a signature of foo(String)
and 'this' is passed to the delegate instance
@param classNode The class node
@param delegate The... | [
"Adds",
"a",
"delegate",
"method",
"to",
"the",
"target",
"class",
"node",
"where",
"the",
"first",
"argument",
"is",
"to",
"the",
"delegate",
"method",
"is",
"this",
".",
"In",
"other",
"words",
"a",
"method",
"such",
"as",
"foo",
"(",
"Object",
"instan... | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L224-L226 |
google/closure-compiler | src/com/google/javascript/rhino/JSTypeExpression.java | JSTypeExpression.makeOptionalArg | public static JSTypeExpression makeOptionalArg(JSTypeExpression expr) {
"""
Make the given type expression into an optional type expression,
if possible.
"""
if (expr.isOptionalArg() || expr.isVarArgs()) {
return expr;
} else {
return new JSTypeExpression(
new Node(Token.EQUALS, ... | java | public static JSTypeExpression makeOptionalArg(JSTypeExpression expr) {
if (expr.isOptionalArg() || expr.isVarArgs()) {
return expr;
} else {
return new JSTypeExpression(
new Node(Token.EQUALS, expr.root), expr.sourceName);
}
} | [
"public",
"static",
"JSTypeExpression",
"makeOptionalArg",
"(",
"JSTypeExpression",
"expr",
")",
"{",
"if",
"(",
"expr",
".",
"isOptionalArg",
"(",
")",
"||",
"expr",
".",
"isVarArgs",
"(",
")",
")",
"{",
"return",
"expr",
";",
"}",
"else",
"{",
"return",
... | Make the given type expression into an optional type expression,
if possible. | [
"Make",
"the",
"given",
"type",
"expression",
"into",
"an",
"optional",
"type",
"expression",
"if",
"possible",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/JSTypeExpression.java#L73-L80 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.resourcedefinition.jms.2.0/src/com/ibm/ws/jca/processor/jms/service/JMSConnectionFactoryResourceBuilder.java | JMSConnectionFactoryResourceBuilder.getConnectionFactoryID | private static final String getConnectionFactoryID(String application, String module, String component, String jndiName) {
"""
Utility method that creates a unique identifier for an application defined data source.
For example,
application[MyApp]/module[MyModule]/connectionFactory[java:module/env/jdbc/cf1]
@p... | java | private static final String getConnectionFactoryID(String application, String module, String component, String jndiName) {
StringBuilder sb = new StringBuilder(jndiName.length() + 80);
if (application != null) {
sb.append(AppDefinedResource.APPLICATION).append('[').append(application).append... | [
"private",
"static",
"final",
"String",
"getConnectionFactoryID",
"(",
"String",
"application",
",",
"String",
"module",
",",
"String",
"component",
",",
"String",
"jndiName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"jndiName",
".",
"l... | Utility method that creates a unique identifier for an application defined data source.
For example,
application[MyApp]/module[MyModule]/connectionFactory[java:module/env/jdbc/cf1]
@param application application name if data source is in java:app, java:module, or java:comp. Otherwise null.
@param module module name if... | [
"Utility",
"method",
"that",
"creates",
"a",
"unique",
"identifier",
"for",
"an",
"application",
"defined",
"data",
"source",
".",
"For",
"example",
"application",
"[",
"MyApp",
"]",
"/",
"module",
"[",
"MyModule",
"]",
"/",
"connectionFactory",
"[",
"java",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.resourcedefinition.jms.2.0/src/com/ibm/ws/jca/processor/jms/service/JMSConnectionFactoryResourceBuilder.java#L382-L393 |
samskivert/samskivert | src/main/java/com/samskivert/util/CompactIntListUtil.java | CompactIntListUtil.indexOf | public static int indexOf (int[] list, int value) {
"""
Looks for an element that is equal to the supplied value and
returns its index in the array.
@return the index of the first matching value if one was found,
-1 otherwise.
"""
int llength = list.length; // no optimizing bastards
for (i... | java | public static int indexOf (int[] list, int value)
{
int llength = list.length; // no optimizing bastards
for (int i = 0; i < llength; i++) {
if (list[i] == value) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"indexOf",
"(",
"int",
"[",
"]",
"list",
",",
"int",
"value",
")",
"{",
"int",
"llength",
"=",
"list",
".",
"length",
";",
"// no optimizing bastards",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"llength",
";",
"i",
... | Looks for an element that is equal to the supplied value and
returns its index in the array.
@return the index of the first matching value if one was found,
-1 otherwise. | [
"Looks",
"for",
"an",
"element",
"that",
"is",
"equal",
"to",
"the",
"supplied",
"value",
"and",
"returns",
"its",
"index",
"in",
"the",
"array",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CompactIntListUtil.java#L72-L81 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java | Utilities.newLibraryEntry | public static IClasspathEntry newLibraryEntry(Bundle bundle, IPath precomputedBundlePath, BundleURLMappings javadocURLs) {
"""
Create the classpath library linked to the bundle with the given name.
@param bundle the bundle to point to. Never <code>null</code>.
@param precomputedBundlePath the path to the bundl... | java | public static IClasspathEntry newLibraryEntry(Bundle bundle, IPath precomputedBundlePath, BundleURLMappings javadocURLs) {
assert bundle != null;
final IPath bundlePath;
if (precomputedBundlePath == null) {
bundlePath = BundleUtil.getBundlePath(bundle);
} else {
bundlePath = precomputedBundlePath;
}
f... | [
"public",
"static",
"IClasspathEntry",
"newLibraryEntry",
"(",
"Bundle",
"bundle",
",",
"IPath",
"precomputedBundlePath",
",",
"BundleURLMappings",
"javadocURLs",
")",
"{",
"assert",
"bundle",
"!=",
"null",
";",
"final",
"IPath",
"bundlePath",
";",
"if",
"(",
"pre... | Create the classpath library linked to the bundle with the given name.
@param bundle the bundle to point to. Never <code>null</code>.
@param precomputedBundlePath the path to the bundle that is already available. If <code>null</code>,
the path is computed from the bundle with {@link BundleUtil}.
@param javadocURLs the... | [
"Create",
"the",
"classpath",
"library",
"linked",
"to",
"the",
"bundle",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Utilities.java#L181-L221 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java | RoleAssignmentsInner.createAsync | public Observable<RoleAssignmentInner> createAsync(String scope, String roleAssignmentName, RoleAssignmentProperties properties) {
"""
Creates a role assignment.
@param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-i... | java | public Observable<RoleAssignmentInner> createAsync(String scope, String roleAssignmentName, RoleAssignmentProperties properties) {
return createWithServiceResponseAsync(scope, roleAssignmentName, properties).map(new Func1<ServiceResponse<RoleAssignmentInner>, RoleAssignmentInner>() {
@Override
... | [
"public",
"Observable",
"<",
"RoleAssignmentInner",
">",
"createAsync",
"(",
"String",
"scope",
",",
"String",
"roleAssignmentName",
",",
"RoleAssignmentProperties",
"properties",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"scope",
",",
"roleAssignmentName... | Creates a role assignment.
@param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{su... | [
"Creates",
"a",
"role",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java#L769-L776 |
Jasig/resource-server | resource-server-core/src/main/java/org/jasig/resource/aggr/ResourcesAggregatorImpl.java | ResourcesAggregatorImpl.willAggregateWith | protected boolean willAggregateWith(Css first, Css second) {
"""
Similar to the {@link #equals(Object)} method, this will return
true if this object and the argument are "aggregatable".
2 {@link Css} objects are aggregatable if and only if:
<ol>
<li>Neither object returns true for {@link #isAbsolute()}</li>
... | java | protected boolean willAggregateWith(Css first, Css second) {
Validate.notNull(first, "Css argument cannot be null");
Validate.notNull(second, "Css argument cannot be null");
// never can aggregate absolute Css values
if (this.resourcesDao.isAbsolute(first) || this.resourcesDao.i... | [
"protected",
"boolean",
"willAggregateWith",
"(",
"Css",
"first",
",",
"Css",
"second",
")",
"{",
"Validate",
".",
"notNull",
"(",
"first",
",",
"\"Css argument cannot be null\"",
")",
";",
"Validate",
".",
"notNull",
"(",
"second",
",",
"\"Css argument cannot be ... | Similar to the {@link #equals(Object)} method, this will return
true if this object and the argument are "aggregatable".
2 {@link Css} objects are aggregatable if and only if:
<ol>
<li>Neither object returns true for {@link #isAbsolute()}</li>
<li>The values of their "conditional" properties are equivalent</li>
<li>Th... | [
"Similar",
"to",
"the",
"{",
"@link",
"#equals",
"(",
"Object",
")",
"}",
"method",
"this",
"will",
"return",
"true",
"if",
"this",
"object",
"and",
"the",
"argument",
"are",
"aggregatable",
"."
] | train | https://github.com/Jasig/resource-server/blob/13375f716777ec3c99ae9917f672881d4aa32df3/resource-server-core/src/main/java/org/jasig/resource/aggr/ResourcesAggregatorImpl.java#L476-L493 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/UcsApi.java | UcsApi.assignInteractionToContact | public ApiSuccessResponse assignInteractionToContact(String id, AssignInteractionToContactData assignInteractionToContactData) throws ApiException {
"""
Assign the interaction to a contact
@param id id of the Interaction (required)
@param assignInteractionToContactData (required)
@return ApiSuccessResponse
... | java | public ApiSuccessResponse assignInteractionToContact(String id, AssignInteractionToContactData assignInteractionToContactData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = assignInteractionToContactWithHttpInfo(id, assignInteractionToContactData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"assignInteractionToContact",
"(",
"String",
"id",
",",
"AssignInteractionToContactData",
"assignInteractionToContactData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"assignInteractionToContac... | Assign the interaction to a contact
@param id id of the Interaction (required)
@param assignInteractionToContactData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Assign",
"the",
"interaction",
"to",
"a",
"contact"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/UcsApi.java#L154-L157 |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java | HiveSessionImplwithUGI.setDelegationToken | private void setDelegationToken(String delegationTokenStr) throws HiveSQLException {
"""
Enable delegation token for the session
save the token string and set the token.signature in hive conf. The metastore client uses
this token.signature to determine where to use kerberos or delegation token
@throws HiveExcep... | java | private void setDelegationToken(String delegationTokenStr) throws HiveSQLException {
this.delegationTokenStr = delegationTokenStr;
if (delegationTokenStr != null) {
getHiveConf().set("hive.metastore.token.signature", HS2TOKEN);
try {
Utils.setTokenStr(sessionUgi, delegationTokenStr, HS2TOKEN... | [
"private",
"void",
"setDelegationToken",
"(",
"String",
"delegationTokenStr",
")",
"throws",
"HiveSQLException",
"{",
"this",
".",
"delegationTokenStr",
"=",
"delegationTokenStr",
";",
"if",
"(",
"delegationTokenStr",
"!=",
"null",
")",
"{",
"getHiveConf",
"(",
")",... | Enable delegation token for the session
save the token string and set the token.signature in hive conf. The metastore client uses
this token.signature to determine where to use kerberos or delegation token
@throws HiveException
@throws IOException | [
"Enable",
"delegation",
"token",
"for",
"the",
"session",
"save",
"the",
"token",
"string",
"and",
"set",
"the",
"token",
".",
"signature",
"in",
"hive",
"conf",
".",
"The",
"metastore",
"client",
"uses",
"this",
"token",
".",
"signature",
"to",
"determine",... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java#L128-L138 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/passport/AbstractHBCIPassport.java | AbstractHBCIPassport.getInstance | public static HBCIPassport getInstance(HBCICallback callback, Map<String, String> properties, Object init) {
"""
Erzeugt eine Instanz eines HBCI-Passports. Der Typ der erzeugten
Passport-Instanz wird hierbei dem Wert des HBCI-Parameters
<code>client.passport.default</code> entnommen. Gültige Werte für diesen
HB... | java | public static HBCIPassport getInstance(HBCICallback callback, Map<String, String> properties, Object init) {
String passportName = properties.get("client.passport.default");
if (passportName == null)
throw new InvalidUserDataException(HBCIUtils.getLocMsg("EXCMSG_NODEFPASS"));
return... | [
"public",
"static",
"HBCIPassport",
"getInstance",
"(",
"HBCICallback",
"callback",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
",",
"Object",
"init",
")",
"{",
"String",
"passportName",
"=",
"properties",
".",
"get",
"(",
"\"client.passport.def... | Erzeugt eine Instanz eines HBCI-Passports. Der Typ der erzeugten
Passport-Instanz wird hierbei dem Wert des HBCI-Parameters
<code>client.passport.default</code> entnommen. Gültige Werte für diesen
HBCI-Parameter sind die gleichen wie beim Aufruf der Methode
@return Instanz eines HBCI-Passports | [
"Erzeugt",
"eine",
"Instanz",
"eines",
"HBCI",
"-",
"Passports",
".",
"Der",
"Typ",
"der",
"erzeugten",
"Passport",
"-",
"Instanz",
"wird",
"hierbei",
"dem",
"Wert",
"des",
"HBCI",
"-",
"Parameters",
"<code",
">",
"client",
".",
"passport",
".",
"default<",
... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/passport/AbstractHBCIPassport.java#L121-L127 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/support/security/SymmetricKey.java | SymmetricKey.getCipher | private Cipher getCipher(int mode, byte[] iv) throws SymmetricKeyException {
"""
Get a cipher instance for either encrypt or decrypt mode with an IV header.
@param mode Cipher.ENCRYPT_MODE or Cipher.DECRYPT_MODE
@param iv IV header
@return A cipher object
@throws SymmetricKeyException
"""
Cipher ci... | java | private Cipher getCipher(int mode, byte[] iv) throws SymmetricKeyException {
Cipher cipher = null;
try {
cipher = getCipherInstance("AES/CBC/PKCS7Padding");
if (cipher == null) {
throw new SymmetricKeyException("Cannot get a cipher instance for AES/CBC/PKCS7Paddin... | [
"private",
"Cipher",
"getCipher",
"(",
"int",
"mode",
",",
"byte",
"[",
"]",
"iv",
")",
"throws",
"SymmetricKeyException",
"{",
"Cipher",
"cipher",
"=",
"null",
";",
"try",
"{",
"cipher",
"=",
"getCipherInstance",
"(",
"\"AES/CBC/PKCS7Padding\"",
")",
";",
"... | Get a cipher instance for either encrypt or decrypt mode with an IV header.
@param mode Cipher.ENCRYPT_MODE or Cipher.DECRYPT_MODE
@param iv IV header
@return A cipher object
@throws SymmetricKeyException | [
"Get",
"a",
"cipher",
"instance",
"for",
"either",
"encrypt",
"or",
"decrypt",
"mode",
"with",
"an",
"IV",
"header",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/support/security/SymmetricKey.java#L204-L223 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getItemStatInfo | public void getItemStatInfo(int[] ids, Callback<List<ItemStats>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Itemstat API go <a href="https://wiki.guildwars2.com/wiki/API:2/itemstats">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link... | java | public void getItemStatInfo(int[] ids, Callback<List<ItemStats>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getItemStatInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getItemStatInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"ItemStats",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"id... | For more info on Itemstat API go <a href="https://wiki.guildwars2.com/wiki/API:2/itemstats">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of itemstat id
@param callback callback that... | [
"For",
"more",
"info",
"on",
"Itemstat",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"itemstats",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1718-L1721 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/gen/GenerationUnit.java | GenerationUnit.addPackageJavadoc | private void addPackageJavadoc(CompilationUnit unit, String qualifiedMainType) {
"""
Collect javadoc from the package declarations to display in the header.
"""
Javadoc javadoc = unit.getPackage().getJavadoc();
if (javadoc == null) {
return;
}
SourceBuilder builder = new SourceBuilder(fal... | java | private void addPackageJavadoc(CompilationUnit unit, String qualifiedMainType) {
Javadoc javadoc = unit.getPackage().getJavadoc();
if (javadoc == null) {
return;
}
SourceBuilder builder = new SourceBuilder(false);
JavadocGenerator.printDocComment(builder, javadoc);
javadocBlocks.put(qualif... | [
"private",
"void",
"addPackageJavadoc",
"(",
"CompilationUnit",
"unit",
",",
"String",
"qualifiedMainType",
")",
"{",
"Javadoc",
"javadoc",
"=",
"unit",
".",
"getPackage",
"(",
")",
".",
"getJavadoc",
"(",
")",
";",
"if",
"(",
"javadoc",
"==",
"null",
")",
... | Collect javadoc from the package declarations to display in the header. | [
"Collect",
"javadoc",
"from",
"the",
"package",
"declarations",
"to",
"display",
"in",
"the",
"header",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/gen/GenerationUnit.java#L186-L194 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/DBUpdate.java | DBUpdate.addToSet | public static Builder addToSet(String field, Object value) {
"""
Add the given value to the array value if it doesn't already exist in the specified field atomically
@param field The field to add the value to
@param value The value to add
@return this object
"""
return new Builder().addToSet(field... | java | public static Builder addToSet(String field, Object value) {
return new Builder().addToSet(field, value);
} | [
"public",
"static",
"Builder",
"addToSet",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"addToSet",
"(",
"field",
",",
"value",
")",
";",
"}"
] | Add the given value to the array value if it doesn't already exist in the specified field atomically
@param field The field to add the value to
@param value The value to add
@return this object | [
"Add",
"the",
"given",
"value",
"to",
"the",
"array",
"value",
"if",
"it",
"doesn",
"t",
"already",
"exist",
"in",
"the",
"specified",
"field",
"atomically"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/DBUpdate.java#L123-L125 |
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java | CommonUtils.getAnnotationMemberExpression | public static JExpression getAnnotationMemberExpression(JAnnotationUse annotation, String annotationMember) {
"""
Returns the value of annotation element as {@link JExpression}. For example, for annotation
<code>@XmlElementRef(name = "last-name", namespace = "http://mycompany.org/exchange", type = JAXBElement.cla... | java | public static JExpression getAnnotationMemberExpression(JAnnotationUse annotation, String annotationMember) {
JAnnotationValue annotationValue = getAnnotationMember(annotation, annotationMember);
if (annotationValue == null) {
return null;
}
// FIXME: Pending for https://java.net/jira/browse/JAXB-878
try... | [
"public",
"static",
"JExpression",
"getAnnotationMemberExpression",
"(",
"JAnnotationUse",
"annotation",
",",
"String",
"annotationMember",
")",
"{",
"JAnnotationValue",
"annotationValue",
"=",
"getAnnotationMember",
"(",
"annotation",
",",
"annotationMember",
")",
";",
"... | Returns the value of annotation element as {@link JExpression}. For example, for annotation
<code>@XmlElementRef(name = "last-name", namespace = "http://mycompany.org/exchange", type = JAXBElement.class)</code>
for member <code>name</code> the value <code>last-name</code> will be returned. | [
"Returns",
"the",
"value",
"of",
"annotation",
"element",
"as",
"{"
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L94-L111 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/DoubleMaxGauge.java | DoubleMaxGauge.updateMax | private void updateMax(int idx, double v) {
"""
Update the max for the given index if the provided value is larger than the current max.
"""
AtomicLong current = max.getCurrent(idx);
long m = current.get();
while (v > Double.longBitsToDouble(m)) {
if (current.compareAndSet(m, Double.doubleToL... | java | private void updateMax(int idx, double v) {
AtomicLong current = max.getCurrent(idx);
long m = current.get();
while (v > Double.longBitsToDouble(m)) {
if (current.compareAndSet(m, Double.doubleToLongBits(v))) {
break;
}
m = current.get();
}
} | [
"private",
"void",
"updateMax",
"(",
"int",
"idx",
",",
"double",
"v",
")",
"{",
"AtomicLong",
"current",
"=",
"max",
".",
"getCurrent",
"(",
"idx",
")",
";",
"long",
"m",
"=",
"current",
".",
"get",
"(",
")",
";",
"while",
"(",
"v",
">",
"Double",... | Update the max for the given index if the provided value is larger than the current max. | [
"Update",
"the",
"max",
"for",
"the",
"given",
"index",
"if",
"the",
"provided",
"value",
"is",
"larger",
"than",
"the",
"current",
"max",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/DoubleMaxGauge.java#L58-L67 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/JerseyBinding.java | JerseyBinding.bindFactory | @SuppressWarnings("unchecked")
public static <T> void bindFactory(final AbstractBinder binder, final Injector injector, final Class<?> type,
final boolean hkManaged, final boolean singleton) {
"""
Binds HK2 {@link Supplier}. If bean is {@link HK2Managed} then registered d... | java | @SuppressWarnings("unchecked")
public static <T> void bindFactory(final AbstractBinder binder, final Injector injector, final Class<?> type,
final boolean hkManaged, final boolean singleton) {
// resolve Factory<T> actual type to bind properly
final Class<T> re... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"void",
"bindFactory",
"(",
"final",
"AbstractBinder",
"binder",
",",
"final",
"Injector",
"injector",
",",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"boolean... | Binds HK2 {@link Supplier}. If bean is {@link HK2Managed} then registered directly as
factory. Otherwise register factory through special "lazy bridge" to delay guice factory bean instantiation.
Also registers factory directly (through wrapper to be able to inject factory by its type).
<p>
NOTE: since jersey 2.26 jerse... | [
"Binds",
"HK2",
"{",
"@link",
"Supplier",
"}",
".",
"If",
"bean",
"is",
"{",
"@link",
"HK2Managed",
"}",
"then",
"registered",
"directly",
"as",
"factory",
".",
"Otherwise",
"register",
"factory",
"through",
"special",
"lazy",
"bridge",
"to",
"delay",
"guice... | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/JerseyBinding.java#L110-L126 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java | DfuBaseService.refreshDeviceCache | protected void refreshDeviceCache(final BluetoothGatt gatt, final boolean force) {
"""
Clears the device cache. After uploading new firmware the DFU target will have other
services than before.
@param gatt the GATT device to be refreshed.
@param force <code>true</code> to force the refresh.
"""
/*
*... | java | protected void refreshDeviceCache(final BluetoothGatt gatt, final boolean force) {
/*
* If the device is bonded this is up to the Service Changed characteristic to notify Android that the services has changed.
* There is no need for this trick in that case.
* If not bonded, the Android should not keep the se... | [
"protected",
"void",
"refreshDeviceCache",
"(",
"final",
"BluetoothGatt",
"gatt",
",",
"final",
"boolean",
"force",
")",
"{",
"/*\n\t\t * If the device is bonded this is up to the Service Changed characteristic to notify Android that the services has changed.\n\t\t * There is no need for t... | Clears the device cache. After uploading new firmware the DFU target will have other
services than before.
@param gatt the GATT device to be refreshed.
@param force <code>true</code> to force the refresh. | [
"Clears",
"the",
"device",
"cache",
".",
"After",
"uploading",
"new",
"firmware",
"the",
"DFU",
"target",
"will",
"have",
"other",
"services",
"than",
"before",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java#L1607-L1629 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/ProvisionerImpl.java | ProvisionerImpl.installBundles | protected BundleInstallStatus installBundles(BootstrapConfig config) throws InvalidBundleContextException {
"""
Install framework bundles.
@param bundleList
Properties describing the bundles to install
@oaran config
Bootstrap configuration containing information about
initial configuration parameters and fi... | java | protected BundleInstallStatus installBundles(BootstrapConfig config) throws InvalidBundleContextException {
BundleInstallStatus installStatus = new BundleInstallStatus();
KernelResolver resolver = config.getKernelResolver();
ContentBasedLocalBundleRepository repo = BundleRepositoryRegistry.getI... | [
"protected",
"BundleInstallStatus",
"installBundles",
"(",
"BootstrapConfig",
"config",
")",
"throws",
"InvalidBundleContextException",
"{",
"BundleInstallStatus",
"installStatus",
"=",
"new",
"BundleInstallStatus",
"(",
")",
";",
"KernelResolver",
"resolver",
"=",
"config"... | Install framework bundles.
@param bundleList
Properties describing the bundles to install
@oaran config
Bootstrap configuration containing information about
initial configuration parameters and file locations
@return BundleInstallStatus containing details about the bundles
installed, exceptions that occurred, bundles ... | [
"Install",
"framework",
"bundles",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/ProvisionerImpl.java#L220-L241 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java | Configuration.registerSchemaOverride | @Deprecated
public String registerSchemaOverride(String oldSchema, String newSchema) {
"""
Register a schema override
@param oldSchema schema to override
@param newSchema override
@return previous override value
@deprecated Use {@link #setDynamicNameMapping(NameMapping)} instead.
"""
return... | java | @Deprecated
public String registerSchemaOverride(String oldSchema, String newSchema) {
return schemaMapping.put(oldSchema, newSchema);
} | [
"@",
"Deprecated",
"public",
"String",
"registerSchemaOverride",
"(",
"String",
"oldSchema",
",",
"String",
"newSchema",
")",
"{",
"return",
"schemaMapping",
".",
"put",
"(",
"oldSchema",
",",
"newSchema",
")",
";",
"}"
] | Register a schema override
@param oldSchema schema to override
@param newSchema override
@return previous override value
@deprecated Use {@link #setDynamicNameMapping(NameMapping)} instead. | [
"Register",
"a",
"schema",
"override"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java#L322-L325 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/MathUtils.java | MathUtils.lerp | static void lerp(Point2D start_, Point2D end_, double t, Point2D result) {
"""
Computes interpolation between two values, using the interpolation factor t.
The interpolation formula is (end - start) * t + start.
However, the computation ensures that t = 0 produces exactly start, and t = 1, produces exactly end.
... | java | static void lerp(Point2D start_, Point2D end_, double t, Point2D result) {
assert(start_ != result);
// When end == start, we want result to be equal to start, for all t
// values. At the same time, when end != start, we want the result to be
// equal to start for t==0 and end for t == 1.0
// The regular form... | [
"static",
"void",
"lerp",
"(",
"Point2D",
"start_",
",",
"Point2D",
"end_",
",",
"double",
"t",
",",
"Point2D",
"result",
")",
"{",
"assert",
"(",
"start_",
"!=",
"result",
")",
";",
"// When end == start, we want result to be equal to start, for all t",
"// values.... | Computes interpolation between two values, using the interpolation factor t.
The interpolation formula is (end - start) * t + start.
However, the computation ensures that t = 0 produces exactly start, and t = 1, produces exactly end.
It also guarantees that for 0 <= t <= 1, the interpolated value v is between start and... | [
"Computes",
"interpolation",
"between",
"two",
"values",
"using",
"the",
"interpolation",
"factor",
"t",
".",
"The",
"interpolation",
"formula",
"is",
"(",
"end",
"-",
"start",
")",
"*",
"t",
"+",
"start",
".",
"However",
"the",
"computation",
"ensures",
"th... | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MathUtils.java#L196-L217 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/example/UserProfileExample.java | UserProfileExample.updateUserProfile | public void updateUserProfile(String firstName, String lastName,
boolean married) {
"""
Update the married status of a new user record.
This method demonstrates updating both a UserProfileModel and a
UserActionsModel with a single HBase request using the composite dao. It
performs a get/update/put opera... | java | public void updateUserProfile(String firstName, String lastName,
boolean married) {
// Get the timestamp we'll use to set the value of the profile_updated
// action.
long ts = System.currentTimeMillis();
// Construct the key we'll use to fetch the user.
PartitionKey key = new PartitionKey(las... | [
"public",
"void",
"updateUserProfile",
"(",
"String",
"firstName",
",",
"String",
"lastName",
",",
"boolean",
"married",
")",
"{",
"// Get the timestamp we'll use to set the value of the profile_updated",
"// action.",
"long",
"ts",
"=",
"System",
".",
"currentTimeMillis",
... | Update the married status of a new user record.
This method demonstrates updating both a UserProfileModel and a
UserActionsModel with a single HBase request using the composite dao. It
performs a get/update/put operation, which is protected by the
check_conflict field on UserProfileModel from colliding with another
ge... | [
"Update",
"the",
"married",
"status",
"of",
"a",
"new",
"user",
"record",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/example/UserProfileExample.java#L197-L230 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java | SegmentMeanShiftSearch.distanceSq | public static float distanceSq( float[] a , float[]b ) {
"""
Returns the Euclidean distance squared between the two vectors
"""
float ret = 0;
for( int i = 0; i < a.length; i++ ) {
float d = a[i] - b[i];
ret += d*d;
}
return ret;
} | java | public static float distanceSq( float[] a , float[]b ) {
float ret = 0;
for( int i = 0; i < a.length; i++ ) {
float d = a[i] - b[i];
ret += d*d;
}
return ret;
} | [
"public",
"static",
"float",
"distanceSq",
"(",
"float",
"[",
"]",
"a",
",",
"float",
"[",
"]",
"b",
")",
"{",
"float",
"ret",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"length",
";",
"i",
"++",
")",
"{",
"fl... | Returns the Euclidean distance squared between the two vectors | [
"Returns",
"the",
"Euclidean",
"distance",
"squared",
"between",
"the",
"two",
"vectors"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/segmentation/ms/SegmentMeanShiftSearch.java#L173-L180 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/convert/BooleanConverter.java | BooleanConverter.toBooleanWithDefault | public static boolean toBooleanWithDefault(Object value, boolean defaultValue) {
"""
Converts value into boolean or returns default value when conversion is not
possible
@param value the value to convert.
@param defaultValue the default value
@return boolean value or default when conversion is not sup... | java | public static boolean toBooleanWithDefault(Object value, boolean defaultValue) {
Boolean result = toNullableBoolean(value);
return result != null ? (boolean) result : defaultValue;
} | [
"public",
"static",
"boolean",
"toBooleanWithDefault",
"(",
"Object",
"value",
",",
"boolean",
"defaultValue",
")",
"{",
"Boolean",
"result",
"=",
"toNullableBoolean",
"(",
"value",
")",
";",
"return",
"result",
"!=",
"null",
"?",
"(",
"boolean",
")",
"result"... | Converts value into boolean or returns default value when conversion is not
possible
@param value the value to convert.
@param defaultValue the default value
@return boolean value or default when conversion is not supported.
@see BooleanConverter#toNullableBoolean(Object) | [
"Converts",
"value",
"into",
"boolean",
"or",
"returns",
"default",
"value",
"when",
"conversion",
"is",
"not",
"possible"
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/convert/BooleanConverter.java#L74-L77 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/collection/MapConverter.java | MapConverter.getBool | public boolean getBool(Map<String, Object> data, String name) {
"""
<p>
getBool.
</p>
@param data a {@link java.util.Map} object.
@param name a {@link java.lang.String} object.
@return a boolean.
"""
Boolean value = getBoolean(data, name);
return (null == value) ? false : value.booleanValue();
... | java | public boolean getBool(Map<String, Object> data, String name) {
Boolean value = getBoolean(data, name);
return (null == value) ? false : value.booleanValue();
} | [
"public",
"boolean",
"getBool",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
",",
"String",
"name",
")",
"{",
"Boolean",
"value",
"=",
"getBoolean",
"(",
"data",
",",
"name",
")",
";",
"return",
"(",
"null",
"==",
"value",
")",
"?",
"false"... | <p>
getBool.
</p>
@param data a {@link java.util.Map} object.
@param name a {@link java.lang.String} object.
@return a boolean. | [
"<p",
">",
"getBool",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/collection/MapConverter.java#L204-L207 |
VoltDB/voltdb | src/frontend/org/voltdb/importer/formatter/FormatterBuilder.java | FormatterBuilder.createFormatterBuilder | public static FormatterBuilder createFormatterBuilder(Properties formatterProperties) throws Exception {
"""
/*
Create a FormatterBuilder from the supplied arguments. If no formatter is specified by configuration, return a default CSV formatter builder.
"""
FormatterBuilder builder;
AbstractF... | java | public static FormatterBuilder createFormatterBuilder(Properties formatterProperties) throws Exception {
FormatterBuilder builder;
AbstractFormatterFactory factory;
if (formatterProperties.size() > 0) {
String formatterClass = formatterProperties.getProperty("formatter");
... | [
"public",
"static",
"FormatterBuilder",
"createFormatterBuilder",
"(",
"Properties",
"formatterProperties",
")",
"throws",
"Exception",
"{",
"FormatterBuilder",
"builder",
";",
"AbstractFormatterFactory",
"factory",
";",
"if",
"(",
"formatterProperties",
".",
"size",
"(",... | /*
Create a FormatterBuilder from the supplied arguments. If no formatter is specified by configuration, return a default CSV formatter builder. | [
"/",
"*",
"Create",
"a",
"FormatterBuilder",
"from",
"the",
"supplied",
"arguments",
".",
"If",
"no",
"formatter",
"is",
"specified",
"by",
"configuration",
"return",
"a",
"default",
"CSV",
"formatter",
"builder",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/importer/formatter/FormatterBuilder.java#L90-L126 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/mpsuser.java | mpsuser.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>
"""
mpsuser_responses result = (mpsuser_responses) service.get_payload_form... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
mpsuser_responses result = (mpsuser_responses) service.get_payload_formatter().string_to_resource(mpsuser_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NO... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"mpsuser_responses",
"result",
"=",
"(",
"mpsuser_responses",
")",
"service",
".",
"get_payload_formatter",
... | <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/mps/mpsuser.java#L368-L385 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeWordVectors | @Deprecated
public static void writeWordVectors(InMemoryLookupTable lookupTable, InMemoryLookupCache cache, String path)
throws IOException {
"""
Writes the word vectors to the given path. Note that this assumes an in memory cache
@param lookupTable
@param cache
@param path the path to ... | java | @Deprecated
public static void writeWordVectors(InMemoryLookupTable lookupTable, InMemoryLookupCache cache, String path)
throws IOException {
try (BufferedWriter write = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(path, false), StandardCharsets.UTF_8))) {
... | [
"@",
"Deprecated",
"public",
"static",
"void",
"writeWordVectors",
"(",
"InMemoryLookupTable",
"lookupTable",
",",
"InMemoryLookupCache",
"cache",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedWriter",
"write",
"=",
"new",
"BufferedW... | Writes the word vectors to the given path. Note that this assumes an in memory cache
@param lookupTable
@param cache
@param path the path to write
@throws IOException
@deprecated Use {@link #writeWord2VecModel(Word2Vec, File)} instead | [
"Writes",
"the",
"word",
"vectors",
"to",
"the",
"given",
"path",
".",
"Note",
"that",
"this",
"assumes",
"an",
"in",
"memory",
"cache"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1193-L1218 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateTowards | public Matrix4d rotateTowards(Vector3dc direction, Vector3dc up, Matrix4d dest) {
"""
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local <code>+Z</code> axis with <code>direction</code>
and store the result in <code>dest</code>.
<p>
If <code>M</code> is <cod... | java | public Matrix4d rotateTowards(Vector3dc direction, Vector3dc up, Matrix4d dest) {
return rotateTowards(direction.x(), direction.y(), direction.z(), up.x(), up.y(), up.z(), dest);
} | [
"public",
"Matrix4d",
"rotateTowards",
"(",
"Vector3dc",
"direction",
",",
"Vector3dc",
"up",
",",
"Matrix4d",
"dest",
")",
"{",
"return",
"rotateTowards",
"(",
"direction",
".",
"x",
"(",
")",
",",
"direction",
".",
"y",
"(",
")",
",",
"direction",
".",
... | Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local <code>+Z</code> axis with <code>direction</code>
and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix,
then the new matrix will be <code>M ... | [
"Apply",
"a",
"model",
"transformation",
"to",
"this",
"matrix",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"the",
"local",
"<code",
">",
"+",
"Z<",
"/",
"code",
">",
"axis",
"with",
"<code",
">",
"direction<",
"/",
"co... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L15119-L15121 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/generic/GenericMatrixOps_F64.java | GenericMatrixOps_F64.isIdentity | public static boolean isIdentity(DMatrix a , double tol ) {
"""
Returns true if the provided matrix is has a value of 1 along the diagonal
elements and zero along all the other elements.
@param a Matrix being inspected.
@param tol How close to zero or one each element needs to be.
@return If it is within tol... | java | public static boolean isIdentity(DMatrix a , double tol )
{
for( int i = 0; i < a.getNumRows(); i++ ) {
for( int j = 0; j < a.getNumCols(); j++ ) {
if( i == j ) {
if( Math.abs(a.get(i,j)-1.0) > tol )
return false;
} else... | [
"public",
"static",
"boolean",
"isIdentity",
"(",
"DMatrix",
"a",
",",
"double",
"tol",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"getNumRows",
"(",
")",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
"... | Returns true if the provided matrix is has a value of 1 along the diagonal
elements and zero along all the other elements.
@param a Matrix being inspected.
@param tol How close to zero or one each element needs to be.
@return If it is within tolerance to an identity matrix. | [
"Returns",
"true",
"if",
"the",
"provided",
"matrix",
"is",
"has",
"a",
"value",
"of",
"1",
"along",
"the",
"diagonal",
"elements",
"and",
"zero",
"along",
"all",
"the",
"other",
"elements",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/generic/GenericMatrixOps_F64.java#L63-L77 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitTracker.java | InputSplitTracker.getInputSplitFromLog | InputSplit getInputSplitFromLog(final ExecutionVertex vertex, final int sequenceNumber) {
"""
Returns the input split with the given sequence number from the specified vertex's log or <code>null</code> if no
such input split exists.
@param vertex
the vertex for which the input split shall be returned from the... | java | InputSplit getInputSplitFromLog(final ExecutionVertex vertex, final int sequenceNumber) {
final List<InputSplit> inputSplitLog = this.splitMap.get(vertex.getID());
if (inputSplitLog == null) {
LOG.error("Cannot find input split log for vertex " + vertex + " (" + vertex.getID() + ")");
return null;
}
syn... | [
"InputSplit",
"getInputSplitFromLog",
"(",
"final",
"ExecutionVertex",
"vertex",
",",
"final",
"int",
"sequenceNumber",
")",
"{",
"final",
"List",
"<",
"InputSplit",
">",
"inputSplitLog",
"=",
"this",
".",
"splitMap",
".",
"get",
"(",
"vertex",
".",
"getID",
"... | Returns the input split with the given sequence number from the specified vertex's log or <code>null</code> if no
such input split exists.
@param vertex
the vertex for which the input split shall be returned from the log
@param sequenceNumber
the sequence number identifying the log entry
@return the input split that w... | [
"Returns",
"the",
"input",
"split",
"with",
"the",
"given",
"sequence",
"number",
"from",
"the",
"specified",
"vertex",
"s",
"log",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"no",
"such",
"input",
"split",
"exists",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitTracker.java#L115-L131 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/converters/BooleanConverter.java | BooleanConverter.canConvert | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
"""
Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@retu... | java | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
return Boolean.class.equals(toType) || Boolean.TYPE.equals(toType);
} | [
"@",
"Override",
"public",
"boolean",
"canConvert",
"(",
"Class",
"<",
"?",
">",
"fromType",
",",
"Class",
"<",
"?",
">",
"toType",
")",
"{",
"return",
"Boolean",
".",
"class",
".",
"equals",
"(",
"toType",
")",
"||",
"Boolean",
".",
"TYPE",
".",
"eq... | Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@return a boolean indicating whether this {@link Converter} can convert {@link Object Objects}
... | [
"Determines",
"whether",
"this",
"{",
"@link",
"Converter",
"}",
"can",
"convert",
"{",
"@link",
"Object",
"Objects",
"}",
"{",
"@link",
"Class",
"from",
"type",
"}",
"{",
"@link",
"Class",
"to",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/converters/BooleanConverter.java#L73-L76 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/MenuUtil.java | MenuUtil.findMenu | public static BaseMenuComponent findMenu(BaseComponent parent, String label, BaseComponent insertBefore) {
"""
Returns the menu with the specified label, or creates one if it does not exist.
@param parent The parent component under which to search. May be a Toolbar or a Menupopup
component.
@param label Label... | java | public static BaseMenuComponent findMenu(BaseComponent parent, String label, BaseComponent insertBefore) {
for (BaseMenuComponent child : parent.getChildren(BaseMenuComponent.class)) {
if (label.equalsIgnoreCase(child.getLabel())) {
return child;
}
}
Bas... | [
"public",
"static",
"BaseMenuComponent",
"findMenu",
"(",
"BaseComponent",
"parent",
",",
"String",
"label",
",",
"BaseComponent",
"insertBefore",
")",
"{",
"for",
"(",
"BaseMenuComponent",
"child",
":",
"parent",
".",
"getChildren",
"(",
"BaseMenuComponent",
".",
... | Returns the menu with the specified label, or creates one if it does not exist.
@param parent The parent component under which to search. May be a Toolbar or a Menupopup
component.
@param label Label of menu to search.
@param insertBefore If not null, the new menu is inserted before this one. If null, the menu
is appe... | [
"Returns",
"the",
"menu",
"with",
"the",
"specified",
"label",
"or",
"creates",
"one",
"if",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/MenuUtil.java#L97-L109 |
Jasig/uPortal | uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImpl.java | PersonLookupHelperImpl.getPermittedAttributes | protected Set<String> getPermittedAttributes(final IAuthorizationPrincipal principal) {
"""
Get the set of all user attribute names defined in the portal for which the specified
principal has the attribute viewing permission.
@param principal
@return
"""
final Set<String> attributeNames = personAt... | java | protected Set<String> getPermittedAttributes(final IAuthorizationPrincipal principal) {
final Set<String> attributeNames = personAttributeDao.getPossibleUserAttributeNames();
return getPermittedAttributes(principal, attributeNames);
} | [
"protected",
"Set",
"<",
"String",
">",
"getPermittedAttributes",
"(",
"final",
"IAuthorizationPrincipal",
"principal",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"attributeNames",
"=",
"personAttributeDao",
".",
"getPossibleUserAttributeNames",
"(",
")",
";",
"r... | Get the set of all user attribute names defined in the portal for which the specified
principal has the attribute viewing permission.
@param principal
@return | [
"Get",
"the",
"set",
"of",
"all",
"user",
"attribute",
"names",
"defined",
"in",
"the",
"portal",
"for",
"which",
"the",
"specified",
"principal",
"has",
"the",
"attribute",
"viewing",
"permission",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/lookup/PersonLookupHelperImpl.java#L423-L426 |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.authorizationCodeRefresh | public AuthorizationCodeRefreshRequest.Builder authorizationCodeRefresh(String client_id, String client_secret, String refresh_token) {
"""
Refresh the access token by using authorization code grant. <br>
Requires client ID, client secret, and refresh token to be set.
@param client_id When you register you... | java | public AuthorizationCodeRefreshRequest.Builder authorizationCodeRefresh(String client_id, String client_secret, String refresh_token) {
return new AuthorizationCodeRefreshRequest.Builder(client_id, client_secret)
.setDefaults(httpManager, scheme, host, port)
.grant_type("refresh_token")
... | [
"public",
"AuthorizationCodeRefreshRequest",
".",
"Builder",
"authorizationCodeRefresh",
"(",
"String",
"client_id",
",",
"String",
"client_secret",
",",
"String",
"refresh_token",
")",
"{",
"return",
"new",
"AuthorizationCodeRefreshRequest",
".",
"Builder",
"(",
"client_... | Refresh the access token by using authorization code grant. <br>
Requires client ID, client secret, and refresh token to be set.
@param client_id When you register your application, Spotify provides you a Client ID.
@param client_secret When you register your application, Spotify provides you a Client Secret.
@par... | [
"Refresh",
"the",
"access",
"token",
"by",
"using",
"authorization",
"code",
"grant",
".",
"<br",
">",
"Requires",
"client",
"ID",
"client",
"secret",
"and",
"refresh",
"token",
"to",
"be",
"set",
"."
] | train | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L325-L330 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.copyTo | public final void copyTo(int offset, MemorySegment target, int targetOffset, int numBytes) {
"""
Bulk copy method. Copies {@code numBytes} bytes from this memory segment, starting at position
{@code offset} to the target memory segment. The bytes will be put into the target segment
starting at position {@code ta... | java | public final void copyTo(int offset, MemorySegment target, int targetOffset, int numBytes) {
final byte[] thisHeapRef = this.heapMemory;
final byte[] otherHeapRef = target.heapMemory;
final long thisPointer = this.address + offset;
final long otherPointer = target.address + targetOffset;
if ((numBytes | offs... | [
"public",
"final",
"void",
"copyTo",
"(",
"int",
"offset",
",",
"MemorySegment",
"target",
",",
"int",
"targetOffset",
",",
"int",
"numBytes",
")",
"{",
"final",
"byte",
"[",
"]",
"thisHeapRef",
"=",
"this",
".",
"heapMemory",
";",
"final",
"byte",
"[",
... | Bulk copy method. Copies {@code numBytes} bytes from this memory segment, starting at position
{@code offset} to the target memory segment. The bytes will be put into the target segment
starting at position {@code targetOffset}.
@param offset The position where the bytes are started to be read from in this memory segm... | [
"Bulk",
"copy",
"method",
".",
"Copies",
"{",
"@code",
"numBytes",
"}",
"bytes",
"from",
"this",
"memory",
"segment",
"starting",
"at",
"position",
"{",
"@code",
"offset",
"}",
"to",
"the",
"target",
"memory",
"segment",
".",
"The",
"bytes",
"will",
"be",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L1250-L1271 |
jenkinsci/jenkins | core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java | HudsonPrivateSecurityRealm.createAccount | private User createAccount(StaplerRequest req, StaplerResponse rsp, boolean validateCaptcha, String formView) throws ServletException, IOException {
"""
@param req the request to get the form data from (is also used for redirection)
@param rsp the response to use for forwarding if the creation fails
@param valid... | java | private User createAccount(StaplerRequest req, StaplerResponse rsp, boolean validateCaptcha, String formView) throws ServletException, IOException {
SignupInfo si = validateAccountCreationForm(req, validateCaptcha);
if (!si.errors.isEmpty()) {
// failed. ask the user to try again.
... | [
"private",
"User",
"createAccount",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
",",
"boolean",
"validateCaptcha",
",",
"String",
"formView",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"SignupInfo",
"si",
"=",
"validateAccountCreation... | @param req the request to get the form data from (is also used for redirection)
@param rsp the response to use for forwarding if the creation fails
@param validateCaptcha whether to attempt to validate a captcha in the request
@param formView the view to redirect to if creation fails
@return
null if failed. The browse... | [
"@param",
"req",
"the",
"request",
"to",
"get",
"the",
"form",
"data",
"from",
"(",
"is",
"also",
"used",
"for",
"redirection",
")",
"@param",
"rsp",
"the",
"response",
"to",
"use",
"for",
"forwarding",
"if",
"the",
"creation",
"fails",
"@param",
"validate... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java#L383-L393 |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/LogFileHandle.java | LogFileHandle.fileExists | protected boolean fileExists() {
"""
/*
Determine if the file managed by this LogFileHandle instance currently exists
on disk.
@return boolean true if the file currently exists.
"""
if (tc.isEntryEnabled())
Tr.entry(tc, "fileExists", this);
boolean fileAlreadyExists = true;
... | java | protected boolean fileExists()
{
if (tc.isEntryEnabled())
Tr.entry(tc, "fileExists", this);
boolean fileAlreadyExists = true;
File file = new File(_logDirectory, _fileName);
fileAlreadyExists = (file.exists() && (file.length() > 0));
if (tc.isEntryEnabled())
... | [
"protected",
"boolean",
"fileExists",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"fileExists\"",
",",
"this",
")",
";",
"boolean",
"fileAlreadyExists",
"=",
"true",
";",
"File",
"file",
"... | /*
Determine if the file managed by this LogFileHandle instance currently exists
on disk.
@return boolean true if the file currently exists. | [
"/",
"*",
"Determine",
"if",
"the",
"file",
"managed",
"by",
"this",
"LogFileHandle",
"instance",
"currently",
"exists",
"on",
"disk",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/LogFileHandle.java#L562-L575 |
kstateome/canvas-api | src/main/java/edu/ksu/canvas/CanvasApiFactory.java | CanvasApiFactory.getWriter | public <T extends CanvasWriter> T getWriter(Class<T> type, OauthToken oauthToken, Boolean serializeNulls) {
"""
Get a writer implementation to push data into Canvas while being able to control the behavior of blank values.
If the serializeNulls parameter is set to true, this writer will serialize null fields in t... | java | public <T extends CanvasWriter> T getWriter(Class<T> type, OauthToken oauthToken, Boolean serializeNulls) {
LOG.debug("Factory call to instantiate class: " + type.getName());
RestClient restClient = new RefreshingRestClient();
@SuppressWarnings("unchecked")
Class<T> concreteClass = (Cla... | [
"public",
"<",
"T",
"extends",
"CanvasWriter",
">",
"T",
"getWriter",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"OauthToken",
"oauthToken",
",",
"Boolean",
"serializeNulls",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Factory call to instantiate class: \"",
"+",
"t... | Get a writer implementation to push data into Canvas while being able to control the behavior of blank values.
If the serializeNulls parameter is set to true, this writer will serialize null fields in the JSON being
sent to Canvas. This is required if you want to explicitly blank out a value that is currently set to so... | [
"Get",
"a",
"writer",
"implementation",
"to",
"push",
"data",
"into",
"Canvas",
"while",
"being",
"able",
"to",
"control",
"the",
"behavior",
"of",
"blank",
"values",
".",
"If",
"the",
"serializeNulls",
"parameter",
"is",
"set",
"to",
"true",
"this",
"writer... | train | https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/CanvasApiFactory.java#L126-L146 |
fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java | WebACFilter.getHasMemberFromResource | private URI getHasMemberFromResource(final HttpServletRequest request) {
"""
Get ldp:membershipResource from an existing resource
@param request the request
@return URI of the ldp:membershipResource triple or null if not found.
"""
final FedoraResource resource = resource(request);
return g... | java | private URI getHasMemberFromResource(final HttpServletRequest request) {
final FedoraResource resource = resource(request);
return getHasMemberFromResource(request, resource);
} | [
"private",
"URI",
"getHasMemberFromResource",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"final",
"FedoraResource",
"resource",
"=",
"resource",
"(",
"request",
")",
";",
"return",
"getHasMemberFromResource",
"(",
"request",
",",
"resource",
")",
";",
... | Get ldp:membershipResource from an existing resource
@param request the request
@return URI of the ldp:membershipResource triple or null if not found. | [
"Get",
"ldp",
":",
"membershipResource",
"from",
"an",
"existing",
"resource"
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java#L681-L684 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/BrokerHelper.java | BrokerHelper.link | public void link(Object obj, ObjectReferenceDescriptor ord, boolean insert) {
"""
This method concatenate the main object and the specified reference
object (1:1 reference a referenced object, 1:n and m:n reference a
collection of referenced objects) by hand. This method is needed when
in the reference metadata... | java | public void link(Object obj, ObjectReferenceDescriptor ord, boolean insert)
{
linkOrUnlink(true, obj, ord, insert);
} | [
"public",
"void",
"link",
"(",
"Object",
"obj",
",",
"ObjectReferenceDescriptor",
"ord",
",",
"boolean",
"insert",
")",
"{",
"linkOrUnlink",
"(",
"true",
",",
"obj",
",",
"ord",
",",
"insert",
")",
";",
"}"
] | This method concatenate the main object and the specified reference
object (1:1 reference a referenced object, 1:n and m:n reference a
collection of referenced objects) by hand. This method is needed when
in the reference metadata definitions the auto-xxx setting was disabled.
More info see OJB doc.
@param obj Object ... | [
"This",
"method",
"concatenate",
"the",
"main",
"object",
"and",
"the",
"specified",
"reference",
"object",
"(",
"1",
":",
"1",
"reference",
"a",
"referenced",
"object",
"1",
":",
"n",
"and",
"m",
":",
"n",
"reference",
"a",
"collection",
"of",
"referenced... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L810-L813 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfStamper.java | PdfStamper.setEncryption | public void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException {
"""
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random stri... | java | public void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException {
setEncryption(DocWriter.getISOBytes(userPassword), DocWriter.getISOBytes(ownerPassword), permissions, strength);
} | [
"public",
"void",
"setEncryption",
"(",
"boolean",
"strength",
",",
"String",
"userPassword",
",",
"String",
"ownerPassword",
",",
"int",
"permissions",
")",
"throws",
"DocumentException",
"{",
"setEncryption",
"(",
"DocWriter",
".",
"getISOBytes",
"(",
"userPasswor... | Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScre... | [
"Sets",
"the",
"encryption",
"options",
"for",
"this",
"document",
".",
"The",
"userPassword",
"and",
"the",
"ownerPassword",
"can",
"be",
"null",
"or",
"have",
"zero",
"length",
".",
"In",
"this",
"case",
"the",
"ownerPassword",
"is",
"replaced",
"by",
"a",... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStamper.java#L311-L313 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.