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 |
|---|---|---|---|---|---|---|---|---|---|---|
lightoze/gwt-i18n-server | src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java | LocaleFactory.put | public static <T extends LocalizableResource> void put(Class<T> cls, String locale, T m) {
"""
Populate localization object cache for the specified locale.
@param cls localization interface class
@param locale locale string
@param m localization object
@param <T> localization interface class
"... | java | public static <T extends LocalizableResource> void put(Class<T> cls, String locale, T m) {
Map<String, LocalizableResource> localeCache = getLocaleCache(cls);
synchronized (cache) {
localeCache.put(locale, m);
}
} | [
"public",
"static",
"<",
"T",
"extends",
"LocalizableResource",
">",
"void",
"put",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"String",
"locale",
",",
"T",
"m",
")",
"{",
"Map",
"<",
"String",
",",
"LocalizableResource",
">",
"localeCache",
"=",
"getLocal... | Populate localization object cache for the specified locale.
@param cls localization interface class
@param locale locale string
@param m localization object
@param <T> localization interface class | [
"Populate",
"localization",
"object",
"cache",
"for",
"the",
"specified",
"locale",
"."
] | train | https://github.com/lightoze/gwt-i18n-server/blob/96de53288e9bf31721d7b0e2a1d9f7b6ce1a7e83/src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java#L95-L100 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.buildPendingIntentFromPushNotification | public static void buildPendingIntentFromPushNotification(@NonNull final PendingIntentCallback callback, @NonNull final Intent intent) {
"""
<p>Use this method in your push receiver to build a pending Intent when an Apptentive push
notification is received. Pass the generated PendingIntent to
{@link android.supp... | java | public static void buildPendingIntentFromPushNotification(@NonNull final PendingIntentCallback callback, @NonNull final Intent intent) {
if (callback == null) {
throw new IllegalArgumentException("Callback is null");
}
dispatchConversationTask(new ConversationDispatchTask() {
@Override
protected boolean... | [
"public",
"static",
"void",
"buildPendingIntentFromPushNotification",
"(",
"@",
"NonNull",
"final",
"PendingIntentCallback",
"callback",
",",
"@",
"NonNull",
"final",
"Intent",
"intent",
")",
"{",
"if",
"(",
"callback",
"==",
"null",
")",
"{",
"throw",
"new",
"I... | <p>Use this method in your push receiver to build a pending Intent when an Apptentive push
notification is received. Pass the generated PendingIntent to
{@link android.support.v4.app.NotificationCompat.Builder#setContentIntent} to allow Apptentive
to display Interactions such as Message Center. Calling this method for ... | [
"<p",
">",
"Use",
"this",
"method",
"in",
"your",
"push",
"receiver",
"to",
"build",
"a",
"pending",
"Intent",
"when",
"an",
"Apptentive",
"push",
"notification",
"is",
"received",
".",
"Pass",
"the",
"generated",
"PendingIntent",
"to",
"{",
"@link",
"androi... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L570-L589 |
virgo47/javasimon | console-embed/src/main/java/org/javasimon/console/SimonConsoleFilter.java | SimonConsoleFilter.doFilter | public final void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
"""
Wraps the HTTP request with Simon measuring. Separate Simons are created for different URIs (parameters
ignored).
@param servletRequest HTTP servlet req... | java | public final void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
String localPath =... | [
"public",
"final",
"void",
"doFilter",
"(",
"ServletRequest",
"servletRequest",
",",
"ServletResponse",
"servletResponse",
",",
"FilterChain",
"filterChain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"HttpServletRequest",
"request",
"=",
"(",
"HttpServ... | Wraps the HTTP request with Simon measuring. Separate Simons are created for different URIs (parameters
ignored).
@param servletRequest HTTP servlet request
@param servletResponse HTTP servlet response
@param filterChain filter chain
@throws java.io.IOException possibly thrown by other filter/serlvet in the chain
@thr... | [
"Wraps",
"the",
"HTTP",
"request",
"with",
"Simon",
"measuring",
".",
"Separate",
"Simons",
"are",
"created",
"for",
"different",
"URIs",
"(",
"parameters",
"ignored",
")",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/SimonConsoleFilter.java#L51-L62 |
samskivert/pythagoras | src/main/java/pythagoras/f/Matrix4.java | Matrix4.setToReflection | public Matrix4 setToReflection (float x, float y, float z, float w) {
"""
Sets this to a reflection across the specified plane.
@return a reference to this matrix, for chaining.
"""
float x2 = -2f*x, y2 = -2f*y, z2 = -2f*z;
float xy2 = x2*y, xz2 = x2*z, yz2 = y2*z;
float x2y2z2 = x*x... | java | public Matrix4 setToReflection (float x, float y, float z, float w) {
float x2 = -2f*x, y2 = -2f*y, z2 = -2f*z;
float xy2 = x2*y, xz2 = x2*z, yz2 = y2*z;
float x2y2z2 = x*x + y*y + z*z;
return set(1f + x2*x, xy2, xz2, x2*w*x2y2z2,
xy2, 1f + y2*y, yz2, y2*w*x2y2z2,
... | [
"public",
"Matrix4",
"setToReflection",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
",",
"float",
"w",
")",
"{",
"float",
"x2",
"=",
"-",
"2f",
"*",
"x",
",",
"y2",
"=",
"-",
"2f",
"*",
"y",
",",
"z2",
"=",
"-",
"2f",
"*",
"z",
... | Sets this to a reflection across the specified plane.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"reflection",
"across",
"the",
"specified",
"plane",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Matrix4.java#L326-L334 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java | IterableOfProtosSubject.usingDoubleToleranceForFields | public IterableOfProtosFluentAssertion<M> usingDoubleToleranceForFields(
double tolerance, Iterable<Integer> fieldNumbers) {
"""
Compares double fields with these explicitly specified top-level field numbers using the
provided absolute tolerance.
@param tolerance A finite, non-negative tolerance.
"""... | java | public IterableOfProtosFluentAssertion<M> usingDoubleToleranceForFields(
double tolerance, Iterable<Integer> fieldNumbers) {
return usingConfig(config.usingDoubleToleranceForFields(tolerance, fieldNumbers));
} | [
"public",
"IterableOfProtosFluentAssertion",
"<",
"M",
">",
"usingDoubleToleranceForFields",
"(",
"double",
"tolerance",
",",
"Iterable",
"<",
"Integer",
">",
"fieldNumbers",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"usingDoubleToleranceForFields",
"(",
... | Compares double fields with these explicitly specified top-level field numbers using the
provided absolute tolerance.
@param tolerance A finite, non-negative tolerance. | [
"Compares",
"double",
"fields",
"with",
"these",
"explicitly",
"specified",
"top",
"-",
"level",
"field",
"numbers",
"using",
"the",
"provided",
"absolute",
"tolerance",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/IterableOfProtosSubject.java#L764-L767 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/schema/AsyncHbaseSchemaService.java | AsyncHbaseSchemaService._getUniqueFastScan | private List<MetricSchemaRecord> _getUniqueFastScan(MetricSchemaRecordQuery query, final RecordType type) {
"""
Fast scan works when trying to discover either scopes or metrics with all other fields being *.
In this case, when the first result is obtained, we skip all other rows starting with that prefix and dire... | java | private List<MetricSchemaRecord> _getUniqueFastScan(MetricSchemaRecordQuery query, final RecordType type) {
requireNotDisposed();
SystemAssert.requireArgument(RecordType.METRIC.equals(type) || RecordType.SCOPE.equals(type),
"This method is only for use with metric or scope.");
_logger.info("Using... | [
"private",
"List",
"<",
"MetricSchemaRecord",
">",
"_getUniqueFastScan",
"(",
"MetricSchemaRecordQuery",
"query",
",",
"final",
"RecordType",
"type",
")",
"{",
"requireNotDisposed",
"(",
")",
";",
"SystemAssert",
".",
"requireArgument",
"(",
"RecordType",
".",
"METR... | Fast scan works when trying to discover either scopes or metrics with all other fields being *.
In this case, when the first result is obtained, we skip all other rows starting with that prefix and directly move
on to the next possible value which is obtained value incremented by 1 Ascii character. If that value exists... | [
"Fast",
"scan",
"works",
"when",
"trying",
"to",
"discover",
"either",
"scopes",
"or",
"metrics",
"with",
"all",
"other",
"fields",
"being",
"*",
".",
"In",
"this",
"case",
"when",
"the",
"first",
"result",
"is",
"obtained",
"we",
"skip",
"all",
"other",
... | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schema/AsyncHbaseSchemaService.java#L346-L400 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java | ByteOp.copyStream | public static void copyStream(InputStream is, OutputStream os)
throws IOException {
"""
Write all bytes from is to os. Does not close either stream.
@param is to copy bytes from
@param os to copy bytes to
@throws IOException for usual reasons
"""
copyStream(is,os,BUFFER_SIZE);
} | java | public static void copyStream(InputStream is, OutputStream os)
throws IOException {
copyStream(is,os,BUFFER_SIZE);
} | [
"public",
"static",
"void",
"copyStream",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"copyStream",
"(",
"is",
",",
"os",
",",
"BUFFER_SIZE",
")",
";",
"}"
] | Write all bytes from is to os. Does not close either stream.
@param is to copy bytes from
@param os to copy bytes to
@throws IOException for usual reasons | [
"Write",
"all",
"bytes",
"from",
"is",
"to",
"os",
".",
"Does",
"not",
"close",
"either",
"stream",
"."
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java#L129-L132 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/DateUtils.java | DateUtils.getDateOfDaysBack | public static Date getDateOfDaysBack(final int daysBack, final Date date) {
"""
Get specify days back from given date.
@param daysBack how many days want to be back.
@param date date to be handled.
@return a new Date object.
"""
return dateBack(Calendar.DAY_OF_MONTH, daysBack, date);
} | java | public static Date getDateOfDaysBack(final int daysBack, final Date date) {
return dateBack(Calendar.DAY_OF_MONTH, daysBack, date);
} | [
"public",
"static",
"Date",
"getDateOfDaysBack",
"(",
"final",
"int",
"daysBack",
",",
"final",
"Date",
"date",
")",
"{",
"return",
"dateBack",
"(",
"Calendar",
".",
"DAY_OF_MONTH",
",",
"daysBack",
",",
"date",
")",
";",
"}"
] | Get specify days back from given date.
@param daysBack how many days want to be back.
@param date date to be handled.
@return a new Date object. | [
"Get",
"specify",
"days",
"back",
"from",
"given",
"date",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DateUtils.java#L185-L188 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_spla_POST | public Long serviceName_spla_POST(String serviceName, String serialNumber, OvhSplaTypeEnum type) throws IOException {
"""
Add a new SPLA license
REST: POST /dedicated/server/{serviceName}/spla
@param type [required] License type
@param serialNumber [required] License serial number
@param serviceName [require... | java | public Long serviceName_spla_POST(String serviceName, String serialNumber, OvhSplaTypeEnum type) throws IOException {
String qPath = "/dedicated/server/{serviceName}/spla";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "serialNumber", serialNum... | [
"public",
"Long",
"serviceName_spla_POST",
"(",
"String",
"serviceName",
",",
"String",
"serialNumber",
",",
"OvhSplaTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/spla\"",
";",
"StringBuilder",
"sb",
"="... | Add a new SPLA license
REST: POST /dedicated/server/{serviceName}/spla
@param type [required] License type
@param serialNumber [required] License serial number
@param serviceName [required] The internal name of your dedicated server | [
"Add",
"a",
"new",
"SPLA",
"license"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L723-L731 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java | JedisUtils.newJedisCluster | public static JedisCluster newJedisCluster(JedisPoolConfig poolConfig, String hostsAndPorts,
String password, int timeoutMs) {
"""
Create a new {@link JedisCluster} with specified pool configs.
@param poolConfig
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is... | java | public static JedisCluster newJedisCluster(JedisPoolConfig poolConfig, String hostsAndPorts,
String password, int timeoutMs) {
return newJedisCluster(poolConfig, hostsAndPorts, password, timeoutMs, 3);
} | [
"public",
"static",
"JedisCluster",
"newJedisCluster",
"(",
"JedisPoolConfig",
"poolConfig",
",",
"String",
"hostsAndPorts",
",",
"String",
"password",
",",
"int",
"timeoutMs",
")",
"{",
"return",
"newJedisCluster",
"(",
"poolConfig",
",",
"hostsAndPorts",
",",
"pas... | Create a new {@link JedisCluster} with specified pool configs.
@param poolConfig
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@param password
@param timeoutMs
@return | [
"Create",
"a",
"new",
"{",
"@link",
"JedisCluster",
"}",
"with",
"specified",
"pool",
"configs",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java#L298-L301 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVGImageView.java | SVGImageView.setSVG | public void setSVG(SVG svg, String css) {
"""
Directly set the SVG and the CSS.
@param svg An {@code SVG} instance
@param css Optional extra CSS to apply when rendering
@since 1.3
"""
if (svg == null)
throw new IllegalArgumentException("Null value passed to setSVG()");
this.svg = ... | java | public void setSVG(SVG svg, String css)
{
if (svg == null)
throw new IllegalArgumentException("Null value passed to setSVG()");
this.svg = svg;
this.renderOptions.css(css);
doRender();
} | [
"public",
"void",
"setSVG",
"(",
"SVG",
"svg",
",",
"String",
"css",
")",
"{",
"if",
"(",
"svg",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null value passed to setSVG()\"",
")",
";",
"this",
".",
"svg",
"=",
"svg",
";",
"this",... | Directly set the SVG and the CSS.
@param svg An {@code SVG} instance
@param css Optional extra CSS to apply when rendering
@since 1.3 | [
"Directly",
"set",
"the",
"SVG",
"and",
"the",
"CSS",
"."
] | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGImageView.java#L152-L161 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/content/DocumentListTypeUrl.java | DocumentListTypeUrl.getDocumentListTypeUrl | public static MozuUrl getDocumentListTypeUrl(String documentListTypeFQN, String responseFields) {
"""
Get Resource Url for GetDocumentListType
@param documentListTypeFQN
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This p... | java | public static MozuUrl getDocumentListTypeUrl(String documentListTypeFQN, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/content/documentlistTypes/{documentListTypeFQN}?responseFields={responseFields}");
formatter.formatUrl("documentListTypeFQN", documentListTypeFQN);
formatter.forma... | [
"public",
"static",
"MozuUrl",
"getDocumentListTypeUrl",
"(",
"String",
"documentListTypeFQN",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/content/documentlistTypes/{documentListTypeFQN}?responseFields={response... | Get Resource Url for GetDocumentListType
@param documentListTypeFQN
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data ... | [
"Get",
"Resource",
"Url",
"for",
"GetDocumentListType"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/content/DocumentListTypeUrl.java#L38-L44 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java | URLUtil.encodeQuery | public static String encodeQuery(String url, String charset) throws UtilException {
"""
编码URL<br>
将需要转换的内容(ASCII码形式之外的内容),用十六进制表示法转换出来,并在之前加上%开头。<br>
此方法用于POST请求中的请求体自动编码,转义大部分特殊字符
@param url URL
@param charset 编码
@return 编码后的URL
@exception UtilException UnsupportedEncodingException
"""
return encod... | java | public static String encodeQuery(String url, String charset) throws UtilException {
return encodeQuery(url, StrUtil.isBlank(charset) ? CharsetUtil.defaultCharset() : CharsetUtil.charset(charset));
} | [
"public",
"static",
"String",
"encodeQuery",
"(",
"String",
"url",
",",
"String",
"charset",
")",
"throws",
"UtilException",
"{",
"return",
"encodeQuery",
"(",
"url",
",",
"StrUtil",
".",
"isBlank",
"(",
"charset",
")",
"?",
"CharsetUtil",
".",
"defaultCharset... | 编码URL<br>
将需要转换的内容(ASCII码形式之外的内容),用十六进制表示法转换出来,并在之前加上%开头。<br>
此方法用于POST请求中的请求体自动编码,转义大部分特殊字符
@param url URL
@param charset 编码
@return 编码后的URL
@exception UtilException UnsupportedEncodingException | [
"编码URL<br",
">",
"将需要转换的内容(ASCII码形式之外的内容),用十六进制表示法转换出来,并在之前加上%开头。<br",
">",
"此方法用于POST请求中的请求体自动编码,转义大部分特殊字符"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java#L332-L334 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/StringUtilities.java | StringUtilities.getMatchResult | public static boolean getMatchResult(String str, String expr) {
"""
Returns <CODE>true</CODE> if the given string matches the given regular expression.
@param str The string against which the expression is to be matched
@param expr The regular expression to match with the input string
@return <CODE>true</CODE> ... | java | public static boolean getMatchResult(String str, String expr)
{
Pattern pattern = Pattern.compile(expr, Pattern.DOTALL);
return pattern.matcher(str).matches();
} | [
"public",
"static",
"boolean",
"getMatchResult",
"(",
"String",
"str",
",",
"String",
"expr",
")",
"{",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"expr",
",",
"Pattern",
".",
"DOTALL",
")",
";",
"return",
"pattern",
".",
"matcher",
"(",
... | Returns <CODE>true</CODE> if the given string matches the given regular expression.
@param str The string against which the expression is to be matched
@param expr The regular expression to match with the input string
@return <CODE>true</CODE> if the given string matches the given regular expression | [
"Returns",
"<CODE",
">",
"true<",
"/",
"CODE",
">",
"if",
"the",
"given",
"string",
"matches",
"the",
"given",
"regular",
"expression",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/StringUtilities.java#L136-L140 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamResource.java | DatastreamResource.deleteDatastream | @Path("/ {
"""
<p>Invoke API-M.purgeDatastream
</p><p>
DELETE /objects/{pid}/datastreams/{dsID} ? startDT endDT logMessage</p>
"""dsID}")
@DELETE
@Produces(MediaType.APPLICATION_JSON)
public Response deleteDatastream(@PathParam(RestParam.PID) String pid,
@Path... | java | @Path("/{dsID}")
@DELETE
@Produces(MediaType.APPLICATION_JSON)
public Response deleteDatastream(@PathParam(RestParam.PID) String pid,
@PathParam(RestParam.DSID) String dsID,
@QueryParam(RestParam.START_DT) String startDT,
... | [
"@",
"Path",
"(",
"\"/{dsID}\"",
")",
"@",
"DELETE",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"deleteDatastream",
"(",
"@",
"PathParam",
"(",
"RestParam",
".",
"PID",
")",
"String",
"pid",
",",
"@",
"PathParam",
... | <p>Invoke API-M.purgeDatastream
</p><p>
DELETE /objects/{pid}/datastreams/{dsID} ? startDT endDT logMessage</p> | [
"<p",
">",
"Invoke",
"API",
"-",
"M",
".",
"purgeDatastream",
"<",
"/",
"p",
">",
"<p",
">",
"DELETE",
"/",
"objects",
"/",
"{",
"pid",
"}",
"/",
"datastreams",
"/",
"{",
"dsID",
"}",
"?",
"startDT",
"endDT",
"logMessage<",
"/",
"p",
">"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamResource.java#L293-L323 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.addCSS | protected void addCSS(final Scene scene, final StyleSheetItem styleSheetItem) {
"""
Attach a new CSS file to the scene using the default classloader.
@param scene the scene that will hold this new CSS file
@param styleSheetItem the stylesheet item to add
"""
final URL styleSheetURL = styleSheetIte... | java | protected void addCSS(final Scene scene, final StyleSheetItem styleSheetItem) {
final URL styleSheetURL = styleSheetItem.get();
if (styleSheetURL == null) {
LOGGER.error(CSS_LOADING_ERROR, styleSheetItem.toString(), ResourceParameters.STYLE_FOLDER.get());
} else {
scene.... | [
"protected",
"void",
"addCSS",
"(",
"final",
"Scene",
"scene",
",",
"final",
"StyleSheetItem",
"styleSheetItem",
")",
"{",
"final",
"URL",
"styleSheetURL",
"=",
"styleSheetItem",
".",
"get",
"(",
")",
";",
"if",
"(",
"styleSheetURL",
"==",
"null",
")",
"{",
... | Attach a new CSS file to the scene using the default classloader.
@param scene the scene that will hold this new CSS file
@param styleSheetItem the stylesheet item to add | [
"Attach",
"a",
"new",
"CSS",
"file",
"to",
"the",
"scene",
"using",
"the",
"default",
"classloader",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L456-L465 |
fabiomaffioletti/jsondoc | jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/builder/SpringQueryParamBuilder.java | SpringQueryParamBuilder.mergeApiQueryParamDoc | private static void mergeApiQueryParamDoc(ApiQueryParam apiQueryParam, ApiParamDoc apiParamDoc) {
"""
Available properties that can be overridden: name, description, required,
allowedvalues, format, defaultvalue. Name is overridden only if it's empty
in the apiParamDoc argument. Description, format and allowedva... | java | private static void mergeApiQueryParamDoc(ApiQueryParam apiQueryParam, ApiParamDoc apiParamDoc) {
if (apiQueryParam != null) {
if (apiParamDoc.getName().trim().isEmpty()) {
apiParamDoc.setName(apiQueryParam.name());
}
apiParamDoc.setDescription(apiQueryParam.description());
apiParamDoc.setAllowedvalue... | [
"private",
"static",
"void",
"mergeApiQueryParamDoc",
"(",
"ApiQueryParam",
"apiQueryParam",
",",
"ApiParamDoc",
"apiParamDoc",
")",
"{",
"if",
"(",
"apiQueryParam",
"!=",
"null",
")",
"{",
"if",
"(",
"apiParamDoc",
".",
"getName",
"(",
")",
".",
"trim",
"(",
... | Available properties that can be overridden: name, description, required,
allowedvalues, format, defaultvalue. Name is overridden only if it's empty
in the apiParamDoc argument. Description, format and allowedvalues are
copied in any case Default value and required are not overridden: in any
case they are coming from t... | [
"Available",
"properties",
"that",
"can",
"be",
"overridden",
":",
"name",
"description",
"required",
"allowedvalues",
"format",
"defaultvalue",
".",
"Name",
"is",
"overridden",
"only",
"if",
"it",
"s",
"empty",
"in",
"the",
"apiParamDoc",
"argument",
".",
"Desc... | train | https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/builder/SpringQueryParamBuilder.java#L109-L118 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram/BaseTangramEngine.java | BaseTangramEngine.parseSingleComponent | public L parseSingleComponent(@Nullable C parent, @Nullable O data) {
"""
Parse original data with type {@link O} into model data with type {@link L}
@param parent the parent group to hold parsed object.
@param data Original data.
@return Parsed data.
@since 3.0.0
"""
return mDataParser.parseSingle... | java | public L parseSingleComponent(@Nullable C parent, @Nullable O data) {
return mDataParser.parseSingleComponent(data, parent, this);
} | [
"public",
"L",
"parseSingleComponent",
"(",
"@",
"Nullable",
"C",
"parent",
",",
"@",
"Nullable",
"O",
"data",
")",
"{",
"return",
"mDataParser",
".",
"parseSingleComponent",
"(",
"data",
",",
"parent",
",",
"this",
")",
";",
"}"
] | Parse original data with type {@link O} into model data with type {@link L}
@param parent the parent group to hold parsed object.
@param data Original data.
@return Parsed data.
@since 3.0.0 | [
"Parse",
"original",
"data",
"with",
"type",
"{"
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram/BaseTangramEngine.java#L601-L603 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPInstanceUtil.java | CPInstanceUtil.findByUUID_G | public static CPInstance findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPInstanceException {
"""
Returns the cp instance where uuid = ? and groupId = ? or throws a {@link NoSuchCPInstanceException} if it could not be found.
@param uuid the uuid
@param gro... | java | public static CPInstance findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPInstanceException {
return getPersistence().findByUUID_G(uuid, groupId);
} | [
"public",
"static",
"CPInstance",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
".",
"exception",
".",
"NoSuchCPInstanceException",
"{",
"return",
"getPersistence",
"(",
")",... | Returns the cp instance where uuid = ? and groupId = ? or throws a {@link NoSuchCPInstanceException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp instance
@throws NoSuchCPInstanceException if a matching cp instance could not be found | [
"Returns",
"the",
"cp",
"instance",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPInstanceException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPInstanceUtil.java#L277-L280 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/CommonUtils.java | CommonUtils.toBean | public static <T> T toBean(Map<String, ?> property, Class<T> clazz) {
"""
将一个Map对象转换成一个Bean对象
@param property 一个Map对象,封装了相应的Bean中的属性
@param clazz 需要转换成的Bean
@return 返回一个封装好的Bean类实例,封装失败返回null
"""
T bean = null;
try {
bean = clazz.newInstance();
BeanUtils.populate... | java | public static <T> T toBean(Map<String, ?> property, Class<T> clazz) {
T bean = null;
try {
bean = clazz.newInstance();
BeanUtils.populate(bean, property);
} catch (Exception e) {
throw new RuntimeException(e);
}
return bean;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"toBean",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"property",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"T",
"bean",
"=",
"null",
";",
"try",
"{",
"bean",
"=",
"clazz",
".",
"newInstance",
"(",
")... | 将一个Map对象转换成一个Bean对象
@param property 一个Map对象,封装了相应的Bean中的属性
@param clazz 需要转换成的Bean
@return 返回一个封装好的Bean类实例,封装失败返回null | [
"将一个Map对象转换成一个Bean对象"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/CommonUtils.java#L36-L45 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ScriptAPI.java | ScriptAPI.validateVarValue | private static void validateVarValue(String varValue) throws ApiException {
"""
Validates that the value is non-{@code null}, that is, the variable exists.
@param varValue the value of the variable to validate.
@throws ApiException if the value is {@code null}.
"""
if (varValue == null) {
throw new ... | java | private static void validateVarValue(String varValue) throws ApiException {
if (varValue == null) {
throw new ApiException(ApiException.Type.DOES_NOT_EXIST, PARAM_VAR_KEY);
}
} | [
"private",
"static",
"void",
"validateVarValue",
"(",
"String",
"varValue",
")",
"throws",
"ApiException",
"{",
"if",
"(",
"varValue",
"==",
"null",
")",
"{",
"throw",
"new",
"ApiException",
"(",
"ApiException",
".",
"Type",
".",
"DOES_NOT_EXIST",
",",
"PARAM_... | Validates that the value is non-{@code null}, that is, the variable exists.
@param varValue the value of the variable to validate.
@throws ApiException if the value is {@code null}. | [
"Validates",
"that",
"the",
"value",
"is",
"non",
"-",
"{",
"@code",
"null",
"}",
"that",
"is",
"the",
"variable",
"exists",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ScriptAPI.java#L177-L181 |
fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java | FedoraResourceImpl.dateTimeDifference | private static long dateTimeDifference(final Temporal d1, final Temporal d2) {
"""
Calculate the difference between two datetime to the unit.
@param d1 first datetime
@param d2 second datetime
@return the difference
"""
return ChronoUnit.SECONDS.between(d1, d2);
} | java | private static long dateTimeDifference(final Temporal d1, final Temporal d2) {
return ChronoUnit.SECONDS.between(d1, d2);
} | [
"private",
"static",
"long",
"dateTimeDifference",
"(",
"final",
"Temporal",
"d1",
",",
"final",
"Temporal",
"d2",
")",
"{",
"return",
"ChronoUnit",
".",
"SECONDS",
".",
"between",
"(",
"d1",
",",
"d2",
")",
";",
"}"
] | Calculate the difference between two datetime to the unit.
@param d1 first datetime
@param d2 second datetime
@return the difference | [
"Calculate",
"the",
"difference",
"between",
"two",
"datetime",
"to",
"the",
"unit",
"."
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java#L1339-L1341 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listPreparationAndReleaseTaskStatusAsync | public ServiceFuture<List<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusAsync(final String jobId, final JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions, final ListOperationCallback<JobPreparationAndReleaseTaskExecutionInformation> servi... | java | public ServiceFuture<List<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusAsync(final String jobId, final JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions, final ListOperationCallback<JobPreparationAndReleaseTaskExecutionInformation> servi... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"JobPreparationAndReleaseTaskExecutionInformation",
">",
">",
"listPreparationAndReleaseTaskStatusAsync",
"(",
"final",
"String",
"jobId",
",",
"final",
"JobListPreparationAndReleaseTaskStatusOptions",
"jobListPreparationAndReleaseTaskStat... | Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.
This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since b... | [
"Lists",
"the",
"execution",
"status",
"of",
"the",
"Job",
"Preparation",
"and",
"Job",
"Release",
"task",
"for",
"the",
"specified",
"job",
"across",
"the",
"compute",
"nodes",
"where",
"the",
"job",
"has",
"run",
".",
"This",
"API",
"returns",
"the",
"Jo... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L2968-L2985 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java | RangeSelectorHelper.selectRange | public <T extends IItem & IExpandable> void selectRange(int from, int to, boolean select) {
"""
selects all items in a range, from and to indizes are inclusive
@param from the from index
@param to the to index
@param select true, if the provided range should be selected, false otherwise
"""
select... | java | public <T extends IItem & IExpandable> void selectRange(int from, int to, boolean select) {
selectRange(from, to, select, false);
} | [
"public",
"<",
"T",
"extends",
"IItem",
"&",
"IExpandable",
">",
"void",
"selectRange",
"(",
"int",
"from",
",",
"int",
"to",
",",
"boolean",
"select",
")",
"{",
"selectRange",
"(",
"from",
",",
"to",
",",
"select",
",",
"false",
")",
";",
"}"
] | selects all items in a range, from and to indizes are inclusive
@param from the from index
@param to the to index
@param select true, if the provided range should be selected, false otherwise | [
"selects",
"all",
"items",
"in",
"a",
"range",
"from",
"and",
"to",
"indizes",
"are",
"inclusive"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/RangeSelectorHelper.java#L123-L125 |
protegeproject/jpaul | src/main/java/jpaul/DataStructs/Relation.java | Relation.forAllEntries | public void forAllEntries(EntryVisitor<K,V> visitor) {
"""
Visits all the entries <code><key,value></code> of
<code>this</code> relation and calls
<code>visitor.visit</code> on each of them. This traversal of
the relation entries can be stopped at any point by throwing
an {@link jpaul.DataStructs.Interr... | java | public void forAllEntries(EntryVisitor<K,V> visitor) {
try {
for(K key : keys()) {
for(V value : _getValues(key)) {
visitor.visit(key, value);
}
}
}
catch(InterruptTraversalException itex) {
// Do nothing; InterruptTraversalException is only a way
// to terminate the traversal premature... | [
"public",
"void",
"forAllEntries",
"(",
"EntryVisitor",
"<",
"K",
",",
"V",
">",
"visitor",
")",
"{",
"try",
"{",
"for",
"(",
"K",
"key",
":",
"keys",
"(",
")",
")",
"{",
"for",
"(",
"V",
"value",
":",
"_getValues",
"(",
"key",
")",
")",
"{",
"... | Visits all the entries <code><key,value></code> of
<code>this</code> relation and calls
<code>visitor.visit</code> on each of them. This traversal of
the relation entries can be stopped at any point by throwing
an {@link jpaul.DataStructs.InterruptTraversalException
InterruptTraversalException} from the visitor;... | [
"Visits",
"all",
"the",
"entries",
"<code",
">",
"<",
";",
"key",
"value>",
";",
"<",
"/",
"code",
">",
"of",
"<code",
">",
"this<",
"/",
"code",
">",
"relation",
"and",
"calls",
"<code",
">",
"visitor",
".",
"visit<",
"/",
"code",
">",
"on",
"... | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/Relation.java#L189-L201 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/selection/DistanceFunctionVisualization.java | DistanceFunctionVisualization.drawCosine | public static Element drawCosine(SVGPlot svgp, Projection2D proj, NumberVector mid, double angle) {
"""
Visualizes Cosine and ArcCosine distance functions
@param svgp SVG Plot
@param proj Visualization projection
@param mid mean vector
@param angle Opening angle in radians
@return path element
"""
/... | java | public static Element drawCosine(SVGPlot svgp, Projection2D proj, NumberVector mid, double angle) {
// Project origin
double[] pointOfOrigin = proj.fastProjectDataToRenderSpace(new double[proj.getInputDimensionality()]);
// direction of the selected Point
double[] selPoint = proj.fastProjectDataToRende... | [
"public",
"static",
"Element",
"drawCosine",
"(",
"SVGPlot",
"svgp",
",",
"Projection2D",
"proj",
",",
"NumberVector",
"mid",
",",
"double",
"angle",
")",
"{",
"// Project origin",
"double",
"[",
"]",
"pointOfOrigin",
"=",
"proj",
".",
"fastProjectDataToRenderSpac... | Visualizes Cosine and ArcCosine distance functions
@param svgp SVG Plot
@param proj Visualization projection
@param mid mean vector
@param angle Opening angle in radians
@return path element | [
"Visualizes",
"Cosine",
"and",
"ArcCosine",
"distance",
"functions"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/selection/DistanceFunctionVisualization.java#L146-L200 |
jenkinsci/jenkins | core/src/main/java/hudson/util/ReflectionUtils.java | ReflectionUtils.getPublicMethodNamed | public static Method getPublicMethodNamed(Class c, String methodName) {
"""
Finds a public method of the given name, regardless of its parameter definitions,
"""
for( Method m : c.getMethods() )
if(m.getName().equals(methodName))
return m;
return null;
} | java | public static Method getPublicMethodNamed(Class c, String methodName) {
for( Method m : c.getMethods() )
if(m.getName().equals(methodName))
return m;
return null;
} | [
"public",
"static",
"Method",
"getPublicMethodNamed",
"(",
"Class",
"c",
",",
"String",
"methodName",
")",
"{",
"for",
"(",
"Method",
"m",
":",
"c",
".",
"getMethods",
"(",
")",
")",
"if",
"(",
"m",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"meth... | Finds a public method of the given name, regardless of its parameter definitions, | [
"Finds",
"a",
"public",
"method",
"of",
"the",
"given",
"name",
"regardless",
"of",
"its",
"parameter",
"definitions"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ReflectionUtils.java#L52-L57 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/App.java | App.grantResourcePermission | public boolean grantResourcePermission(String subjectid, String resourcePath, EnumSet<AllowedMethods> permission) {
"""
Grants a new permission for a given subject and resource.
@param subjectid the subject to give permissions to
@param resourcePath the resource name/type
@param permission the set or HTTP metho... | java | public boolean grantResourcePermission(String subjectid, String resourcePath, EnumSet<AllowedMethods> permission) {
return grantResourcePermission(subjectid, resourcePath, permission, false);
} | [
"public",
"boolean",
"grantResourcePermission",
"(",
"String",
"subjectid",
",",
"String",
"resourcePath",
",",
"EnumSet",
"<",
"AllowedMethods",
">",
"permission",
")",
"{",
"return",
"grantResourcePermission",
"(",
"subjectid",
",",
"resourcePath",
",",
"permission"... | Grants a new permission for a given subject and resource.
@param subjectid the subject to give permissions to
@param resourcePath the resource name/type
@param permission the set or HTTP methods allowed
@return true if successful | [
"Grants",
"a",
"new",
"permission",
"for",
"a",
"given",
"subject",
"and",
"resource",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/App.java#L604-L606 |
hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/init/ScriptUtils.java | ScriptUtils.splitSqlScript | public static void splitSqlScript(String script, char separator, List<String> statements) throws ScriptException {
"""
Split an SQL script into separate statements delimited by the provided
separator character. Each individual statement will be added to the
provided {@code List}.
<p>
Within the script, {@value... | java | public static void splitSqlScript(String script, char separator, List<String> statements) throws ScriptException {
splitSqlScript(script, String.valueOf(separator), statements);
} | [
"public",
"static",
"void",
"splitSqlScript",
"(",
"String",
"script",
",",
"char",
"separator",
",",
"List",
"<",
"String",
">",
"statements",
")",
"throws",
"ScriptException",
"{",
"splitSqlScript",
"(",
"script",
",",
"String",
".",
"valueOf",
"(",
"separat... | Split an SQL script into separate statements delimited by the provided
separator character. Each individual statement will be added to the
provided {@code List}.
<p>
Within the script, {@value #DEFAULT_COMMENT_PREFIX} will be used as the
comment prefix; any text beginning with the comment prefix and extending
to the en... | [
"Split",
"an",
"SQL",
"script",
"into",
"separate",
"statements",
"delimited",
"by",
"the",
"provided",
"separator",
"character",
".",
"Each",
"individual",
"statement",
"will",
"be",
"added",
"to",
"the",
"provided",
"{",
"@code",
"List",
"}",
".",
"<p",
">... | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/init/ScriptUtils.java#L95-L97 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/Strings.java | Strings.isInteger | public static boolean isInteger(CharSequence str, int off, int len) {
"""
Check if the string is representing an integer (or long) value.
@param str The string to check if is an integer.
@param off The offset of the string to start checking.
@param len The length / number fo chars to check.
@return True if k... | java | public static boolean isInteger(CharSequence str, int off, int len) {
if (len == 0) return false;
int i = off;
if (str.charAt(i) == '-') {
if (len == 1) return false;
++i;
}
for (; i < len; ++i) {
char c = str.charAt(i);
if (c < '0'... | [
"public",
"static",
"boolean",
"isInteger",
"(",
"CharSequence",
"str",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"if",
"(",
"len",
"==",
"0",
")",
"return",
"false",
";",
"int",
"i",
"=",
"off",
";",
"if",
"(",
"str",
".",
"charAt",
"(",
"... | Check if the string is representing an integer (or long) value.
@param str The string to check if is an integer.
@param off The offset of the string to start checking.
@param len The length / number fo chars to check.
@return True if key is an integer. | [
"Check",
"if",
"the",
"string",
"is",
"representing",
"an",
"integer",
"(",
"or",
"long",
")",
"value",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/Strings.java#L421-L433 |
enioka/jqm | jqm-all/jqm-client/jqm-api-client-core/src/main/java/com/enioka/jqm/api/JobRequest.java | JobRequest.addParameter | public JobRequest addParameter(String key, String value) {
"""
Parameters are <key,value> pairs that are passed at runtime to the job. The amount of required parameters depends on the requested
job itself.
@param key
max length is 50
@param value
max length is 1000
"""
validateParameter(key, val... | java | public JobRequest addParameter(String key, String value)
{
validateParameter(key, value);
parameters.put(key, value);
return this;
} | [
"public",
"JobRequest",
"addParameter",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"validateParameter",
"(",
"key",
",",
"value",
")",
";",
"parameters",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Parameters are <key,value> pairs that are passed at runtime to the job. The amount of required parameters depends on the requested
job itself.
@param key
max length is 50
@param value
max length is 1000 | [
"Parameters",
"are",
"<key",
"value",
">",
"pairs",
"that",
"are",
"passed",
"at",
"runtime",
"to",
"the",
"job",
".",
"The",
"amount",
"of",
"required",
"parameters",
"depends",
"on",
"the",
"requested",
"job",
"itself",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-client/jqm-api-client-core/src/main/java/com/enioka/jqm/api/JobRequest.java#L131-L136 |
bramp/unsafe | unsafe-helper/src/main/java/net/bramp/unsafe/UnsafeHelper.java | UnsafeHelper.copyMemoryFieldByField | public static void copyMemoryFieldByField(long srcAddress, Object dest) {
"""
Copies from srcAddress to dest one field at a time.
@param srcAddress
@param dest
"""
Class clazz = dest.getClass();
while (clazz != Object.class) {
for (Field f : clazz.getDeclaredFields()) {
if ((f.getMod... | java | public static void copyMemoryFieldByField(long srcAddress, Object dest) {
Class clazz = dest.getClass();
while (clazz != Object.class) {
for (Field f : clazz.getDeclaredFields()) {
if ((f.getModifiers() & Modifier.STATIC) == 0) {
final Class type = f.getType();
// TODO maybe ... | [
"public",
"static",
"void",
"copyMemoryFieldByField",
"(",
"long",
"srcAddress",
",",
"Object",
"dest",
")",
"{",
"Class",
"clazz",
"=",
"dest",
".",
"getClass",
"(",
")",
";",
"while",
"(",
"clazz",
"!=",
"Object",
".",
"class",
")",
"{",
"for",
"(",
... | Copies from srcAddress to dest one field at a time.
@param srcAddress
@param dest | [
"Copies",
"from",
"srcAddress",
"to",
"dest",
"one",
"field",
"at",
"a",
"time",
"."
] | train | https://github.com/bramp/unsafe/blob/805f54e2a8aee905003329556135b6c4059b4418/unsafe-helper/src/main/java/net/bramp/unsafe/UnsafeHelper.java#L109-L136 |
JM-Lab/utils-java9 | src/main/java/kr/jm/utils/helper/JMJson.java | JMJson.transformToMap | public static <T> Map<String, Object> transformToMap(T object) {
"""
Transform to map map.
@param <T> the type parameter
@param object the object
@return the map
"""
return transform(object, MAP_TYPE_REFERENCE);
} | java | public static <T> Map<String, Object> transformToMap(T object) {
return transform(object, MAP_TYPE_REFERENCE);
} | [
"public",
"static",
"<",
"T",
">",
"Map",
"<",
"String",
",",
"Object",
">",
"transformToMap",
"(",
"T",
"object",
")",
"{",
"return",
"transform",
"(",
"object",
",",
"MAP_TYPE_REFERENCE",
")",
";",
"}"
] | Transform to map map.
@param <T> the type parameter
@param object the object
@return the map | [
"Transform",
"to",
"map",
"map",
"."
] | train | https://github.com/JM-Lab/utils-java9/blob/ee80235b2760396a616cf7563cbdc98d4affe8e1/src/main/java/kr/jm/utils/helper/JMJson.java#L379-L381 |
flow/nbt | src/main/java/com/flowpowered/nbt/holder/FieldUtils.java | FieldUtils.checkTagCast | public static <T extends Tag<?>> T checkTagCast(Tag<?> tag, Class<T> type) throws IllegalArgumentException {
"""
Checks that a tag is not null and of the required type
@param tag The tag to check
@param type The type of tag required
@param <T> The type parameter of {@code type}
@return The casted tag
@throw... | java | public static <T extends Tag<?>> T checkTagCast(Tag<?> tag, Class<T> type) throws IllegalArgumentException {
if (tag == null) {
throw new IllegalArgumentException("Expected tag of type " + type.getName() + ", was null");
} else if (!type.isInstance(tag)) {
throw new IllegalArgume... | [
"public",
"static",
"<",
"T",
"extends",
"Tag",
"<",
"?",
">",
">",
"T",
"checkTagCast",
"(",
"Tag",
"<",
"?",
">",
"tag",
",",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"tag",
"==",
"null",
")",
"{"... | Checks that a tag is not null and of the required type
@param tag The tag to check
@param type The type of tag required
@param <T> The type parameter of {@code type}
@return The casted tag
@throws IllegalArgumentException if the tag is null or not of the required type | [
"Checks",
"that",
"a",
"tag",
"is",
"not",
"null",
"and",
"of",
"the",
"required",
"type"
] | train | https://github.com/flow/nbt/blob/7a1b6d986e6fbd01862356d47827b8b357349a22/src/main/java/com/flowpowered/nbt/holder/FieldUtils.java#L44-L51 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/SessionBeanO.java | SessionBeanO.getEJBObject | @Override
public EJBObject getEJBObject() {
"""
Obtain a reference to the EJB object that is currently associated with
the instance. <p>
An instance of a session enterprise Bean can call this method at anytime
between the ejbCreate() and ejbRemove() methods, including from within the
ejbCreate() and ejbR... | java | @Override
public EJBObject getEJBObject()
{
EJBObject result = null;
// d367572.1 start
if (state == PRE_CREATE || state == DESTROYED)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Incorrect state: " + getStateName(s... | [
"@",
"Override",
"public",
"EJBObject",
"getEJBObject",
"(",
")",
"{",
"EJBObject",
"result",
"=",
"null",
";",
"// d367572.1 start",
"if",
"(",
"state",
"==",
"PRE_CREATE",
"||",
"state",
"==",
"DESTROYED",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAny... | Obtain a reference to the EJB object that is currently associated with
the instance. <p>
An instance of a session enterprise Bean can call this method at anytime
between the ejbCreate() and ejbRemove() methods, including from within the
ejbCreate() and ejbRemove() methods. <p>
An instance can use this method, for exa... | [
"Obtain",
"a",
"reference",
"to",
"the",
"EJB",
"object",
"that",
"is",
"currently",
"associated",
"with",
"the",
"instance",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/SessionBeanO.java#L319-L360 |
ben-manes/caffeine | simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/feedback/FeedbackWindowTinyLfuPolicy.java | FeedbackWindowTinyLfuPolicy.policies | public static Set<Policy> policies(Config config) {
"""
Returns all variations of this policy based on the configuration parameters.
"""
FeedbackWindowTinyLfuSettings settings = new FeedbackWindowTinyLfuSettings(config);
return settings.percentMain().stream()
.map(percentMain -> new FeedbackWin... | java | public static Set<Policy> policies(Config config) {
FeedbackWindowTinyLfuSettings settings = new FeedbackWindowTinyLfuSettings(config);
return settings.percentMain().stream()
.map(percentMain -> new FeedbackWindowTinyLfuPolicy(percentMain, settings))
.collect(toSet());
} | [
"public",
"static",
"Set",
"<",
"Policy",
">",
"policies",
"(",
"Config",
"config",
")",
"{",
"FeedbackWindowTinyLfuSettings",
"settings",
"=",
"new",
"FeedbackWindowTinyLfuSettings",
"(",
"config",
")",
";",
"return",
"settings",
".",
"percentMain",
"(",
")",
"... | Returns all variations of this policy based on the configuration parameters. | [
"Returns",
"all",
"variations",
"of",
"this",
"policy",
"based",
"on",
"the",
"configuration",
"parameters",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/feedback/FeedbackWindowTinyLfuPolicy.java#L106-L111 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/MapsInner.java | MapsInner.listContentCallbackUrl | public WorkflowTriggerCallbackUrlInner listContentCallbackUrl(String resourceGroupName, String integrationAccountName, String mapName, GetCallbackUrlParameters listContentCallbackUrl) {
"""
Get the content callback url.
@param resourceGroupName The resource group name.
@param integrationAccountName The integra... | java | public WorkflowTriggerCallbackUrlInner listContentCallbackUrl(String resourceGroupName, String integrationAccountName, String mapName, GetCallbackUrlParameters listContentCallbackUrl) {
return listContentCallbackUrlWithServiceResponseAsync(resourceGroupName, integrationAccountName, mapName, listContentCallbackU... | [
"public",
"WorkflowTriggerCallbackUrlInner",
"listContentCallbackUrl",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"mapName",
",",
"GetCallbackUrlParameters",
"listContentCallbackUrl",
")",
"{",
"return",
"listContentCallbackUrlWith... | Get the content callback url.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param mapName The integration account map name.
@param listContentCallbackUrl the GetCallbackUrlParameters value
@throws IllegalArgumentException thrown if parameters fail the va... | [
"Get",
"the",
"content",
"callback",
"url",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/MapsInner.java#L643-L645 |
httl/httl | httl/src/main/java/httl/spi/codecs/json/JSONObject.java | JSONObject.getBoolean | public boolean getBoolean(String key, boolean def) {
"""
get boolean value.
@param key key.
@param def default value.
@return value or default value.
"""
Object tmp = objectMap.get(key);
return tmp != null && tmp instanceof Boolean ? (Boolean) tmp : def;
} | java | public boolean getBoolean(String key, boolean def) {
Object tmp = objectMap.get(key);
return tmp != null && tmp instanceof Boolean ? (Boolean) tmp : def;
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"def",
")",
"{",
"Object",
"tmp",
"=",
"objectMap",
".",
"get",
"(",
"key",
")",
";",
"return",
"tmp",
"!=",
"null",
"&&",
"tmp",
"instanceof",
"Boolean",
"?",
"(",
"Boolean",
")"... | get boolean value.
@param key key.
@param def default value.
@return value or default value. | [
"get",
"boolean",
"value",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/codecs/json/JSONObject.java#L51-L54 |
kumuluz/kumuluzee | tools/loader/src/main/java/com/kumuluz/ee/loader/EeBootLoader.java | EeBootLoader.launch | private static void launch(String[] args, String mainClass) throws Throwable {
"""
Start the boot procedure.
Use the {@link EeClassLoader} EeClassLoader to find, load and start the main class.
"""
EeClassLoader classLoader = new EeClassLoader();
classLoader.invokeMain(mainClass, args);
} | java | private static void launch(String[] args, String mainClass) throws Throwable {
EeClassLoader classLoader = new EeClassLoader();
classLoader.invokeMain(mainClass, args);
} | [
"private",
"static",
"void",
"launch",
"(",
"String",
"[",
"]",
"args",
",",
"String",
"mainClass",
")",
"throws",
"Throwable",
"{",
"EeClassLoader",
"classLoader",
"=",
"new",
"EeClassLoader",
"(",
")",
";",
"classLoader",
".",
"invokeMain",
"(",
"mainClass",... | Start the boot procedure.
Use the {@link EeClassLoader} EeClassLoader to find, load and start the main class. | [
"Start",
"the",
"boot",
"procedure",
".",
"Use",
"the",
"{"
] | train | https://github.com/kumuluz/kumuluzee/blob/86fbce2acc04264f20d548173d5d9f28d79cb415/tools/loader/src/main/java/com/kumuluz/ee/loader/EeBootLoader.java#L52-L55 |
spring-cloud/spring-cloud-config | spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/support/GitCredentialsProviderFactory.java | GitCredentialsProviderFactory.createFor | @Deprecated
public CredentialsProvider createFor(String uri, String username, String password,
String passphrase) {
"""
Search for a credential provider that will handle the specified URI. If not found,
and the username or passphrase has text, then create a default using the provided
username and password or... | java | @Deprecated
public CredentialsProvider createFor(String uri, String username, String password,
String passphrase) {
return createFor(uri, username, password, passphrase, false);
} | [
"@",
"Deprecated",
"public",
"CredentialsProvider",
"createFor",
"(",
"String",
"uri",
",",
"String",
"username",
",",
"String",
"password",
",",
"String",
"passphrase",
")",
"{",
"return",
"createFor",
"(",
"uri",
",",
"username",
",",
"password",
",",
"passp... | Search for a credential provider that will handle the specified URI. If not found,
and the username or passphrase has text, then create a default using the provided
username and password or passphrase. Otherwise null.
@param uri the URI of the repository (cannot be null)
@param username the username provided for the re... | [
"Search",
"for",
"a",
"credential",
"provider",
"that",
"will",
"handle",
"the",
"specified",
"URI",
".",
"If",
"not",
"found",
"and",
"the",
"username",
"or",
"passphrase",
"has",
"text",
"then",
"create",
"a",
"default",
"using",
"the",
"provided",
"userna... | train | https://github.com/spring-cloud/spring-cloud-config/blob/6b99631f78bac4e1b521d2cc126c8b2da45d1f1f/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/support/GitCredentialsProviderFactory.java#L59-L63 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Signature.java | Signature.dropArg | public Signature dropArg(int index) {
"""
Drops the argument at the given index.
@param index the index of the argument to drop
@return a new signature
"""
assert index < argNames.length;
String[] newArgNames = new String[argNames.length - 1];
if (index > 0) System.arraycopy(argNam... | java | public Signature dropArg(int index) {
assert index < argNames.length;
String[] newArgNames = new String[argNames.length - 1];
if (index > 0) System.arraycopy(argNames, 0, newArgNames, 0, index);
if (index < argNames.length - 1)
System.arraycopy(argNames, index + 1, newArgNam... | [
"public",
"Signature",
"dropArg",
"(",
"int",
"index",
")",
"{",
"assert",
"index",
"<",
"argNames",
".",
"length",
";",
"String",
"[",
"]",
"newArgNames",
"=",
"new",
"String",
"[",
"argNames",
".",
"length",
"-",
"1",
"]",
";",
"if",
"(",
"index",
... | Drops the argument at the given index.
@param index the index of the argument to drop
@return a new signature | [
"Drops",
"the",
"argument",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L334-L345 |
ZuInnoTe/hadoopcryptoledger | inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java | BitcoinBlockReader.parseTransactionInputs | public List<BitcoinTransactionInput> parseTransactionInputs(ByteBuffer rawByteBuffer, long noOfTransactionInputs) {
"""
/*
Parses the Bitcoin transaction inputs in a byte buffer.
@param rawByteBuffer ByteBuffer from which the transaction inputs have to be parsed
@param noOfTransactionInputs Number of expected... | java | public List<BitcoinTransactionInput> parseTransactionInputs(ByteBuffer rawByteBuffer, long noOfTransactionInputs) {
ArrayList<BitcoinTransactionInput> currentTransactionInput = new ArrayList<>((int)noOfTransactionInputs);
for (int i=0;i<noOfTransactionInputs;i++) {
// read previous Hash of Transaction
byte[] cu... | [
"public",
"List",
"<",
"BitcoinTransactionInput",
">",
"parseTransactionInputs",
"(",
"ByteBuffer",
"rawByteBuffer",
",",
"long",
"noOfTransactionInputs",
")",
"{",
"ArrayList",
"<",
"BitcoinTransactionInput",
">",
"currentTransactionInput",
"=",
"new",
"ArrayList",
"<>",... | /*
Parses the Bitcoin transaction inputs in a byte buffer.
@param rawByteBuffer ByteBuffer from which the transaction inputs have to be parsed
@param noOfTransactionInputs Number of expected transaction inputs
@return Array of transactions | [
"/",
"*",
"Parses",
"the",
"Bitcoin",
"transaction",
"inputs",
"in",
"a",
"byte",
"buffer",
"."
] | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java#L373-L395 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/AbstractAWSSigner.java | AbstractAWSSigner.sanitizeCredentials | protected AWSCredentials sanitizeCredentials(AWSCredentials credentials) {
"""
Loads the individual access key ID and secret key from the specified
credentials, ensuring that access to the credentials is synchronized on
the credentials object itself, and trimming any extra whitespace from the
credentials.
<p>
... | java | protected AWSCredentials sanitizeCredentials(AWSCredentials credentials) {
String accessKeyId = null;
String secretKey = null;
String token = null;
synchronized (credentials) {
accessKeyId = credentials.getAWSAccessKeyId();
secretKey = credentials.getAWSSecret... | [
"protected",
"AWSCredentials",
"sanitizeCredentials",
"(",
"AWSCredentials",
"credentials",
")",
"{",
"String",
"accessKeyId",
"=",
"null",
";",
"String",
"secretKey",
"=",
"null",
";",
"String",
"token",
"=",
"null",
";",
"synchronized",
"(",
"credentials",
")",
... | Loads the individual access key ID and secret key from the specified
credentials, ensuring that access to the credentials is synchronized on
the credentials object itself, and trimming any extra whitespace from the
credentials.
<p>
Returns either a {@link BasicSessionCredentials} or a
{@link BasicAWSCredentials} object... | [
"Loads",
"the",
"individual",
"access",
"key",
"ID",
"and",
"secret",
"key",
"from",
"the",
"specified",
"credentials",
"ensuring",
"that",
"access",
"to",
"the",
"credentials",
"is",
"synchronized",
"on",
"the",
"credentials",
"object",
"itself",
"and",
"trimmi... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AbstractAWSSigner.java#L413-L433 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/apidiff/ApiDiff.java | ApiDiff.isMemberUnsupported | boolean isMemberUnsupported(String className, ClassMemberKey memberKey) {
"""
Returns true if the member with the given declaring class is unsupported.
"""
return unsupportedMembersByClass().containsEntry(className, memberKey)
|| unsupportedMembersByClass()
.containsEntry(className, Cla... | java | boolean isMemberUnsupported(String className, ClassMemberKey memberKey) {
return unsupportedMembersByClass().containsEntry(className, memberKey)
|| unsupportedMembersByClass()
.containsEntry(className, ClassMemberKey.create(memberKey.identifier(), ""));
} | [
"boolean",
"isMemberUnsupported",
"(",
"String",
"className",
",",
"ClassMemberKey",
"memberKey",
")",
"{",
"return",
"unsupportedMembersByClass",
"(",
")",
".",
"containsEntry",
"(",
"className",
",",
"memberKey",
")",
"||",
"unsupportedMembersByClass",
"(",
")",
"... | Returns true if the member with the given declaring class is unsupported. | [
"Returns",
"true",
"if",
"the",
"member",
"with",
"the",
"given",
"declaring",
"class",
"is",
"unsupported",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/apidiff/ApiDiff.java#L62-L66 |
hawtio/hawtio | hawtio-system/src/main/java/io/hawt/web/auth/LoginServlet.java | LoginServlet.doPost | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
"""
POST with username/password tries authentication and returns result as JSON
"""
clearSession(request);
JSONObject json = ServletHelpers.readObject(request.getReader());
... | java | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
clearSession(request);
JSONObject json = ServletHelpers.readObject(request.getReader());
String username = (String) json.get("username");
String password = (String) json.ge... | [
"@",
"Override",
"protected",
"void",
"doPost",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"clearSession",
"(",
"request",
")",
";",
"JSONObject",
"json",
"=",
"ServletHelpers",
".",
"readObject",... | POST with username/password tries authentication and returns result as JSON | [
"POST",
"with",
"username",
"/",
"password",
"tries",
"authentication",
"and",
"returns",
"result",
"as",
"JSON"
] | train | https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-system/src/main/java/io/hawt/web/auth/LoginServlet.java#L90-L115 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/client/SocialClientUserDetailsSource.java | SocialClientUserDetailsSource.getPrincipal | @Override
public Authentication getPrincipal() {
"""
Get as much generic information as possible about the current user from
the remote endpoint. The aim is to
collect as much of the properties of a {@link SocialClientUserDetails} as
possible but not to fail if there is an
authenticated user. If one of the... | java | @Override
public Authentication getPrincipal() {
@SuppressWarnings("unchecked")
Map<String, String> map = restTemplate.getForObject(userInfoUrl, Map.class);
String userName = getUserName(map);
String email = null;
if (map.containsKey("email")) {
email = map.get("e... | [
"@",
"Override",
"public",
"Authentication",
"getPrincipal",
"(",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"restTemplate",
".",
"getForObject",
"(",
"userInfoUrl",
",",
"Map",
".",
"c... | Get as much generic information as possible about the current user from
the remote endpoint. The aim is to
collect as much of the properties of a {@link SocialClientUserDetails} as
possible but not to fail if there is an
authenticated user. If one of the tested remote providers is used at
least a user id will be availa... | [
"Get",
"as",
"much",
"generic",
"information",
"as",
"possible",
"about",
"the",
"current",
"user",
"from",
"the",
"remote",
"endpoint",
".",
"The",
"aim",
"is",
"to",
"collect",
"as",
"much",
"of",
"the",
"properties",
"of",
"a",
"{",
"@link",
"SocialClie... | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/client/SocialClientUserDetailsSource.java#L96-L124 |
appium/java-client | src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java | FeaturesMatchingResult.getPoints1 | public List<Point> getPoints1() {
"""
Returns a list of matching points on the first image.
@return The list of matching points on the first image.
"""
verifyPropertyPresence(POINTS1);
//noinspection unchecked
return ((List<Map<String, Object>>) getCommandResult().get(POINTS1)).strea... | java | public List<Point> getPoints1() {
verifyPropertyPresence(POINTS1);
//noinspection unchecked
return ((List<Map<String, Object>>) getCommandResult().get(POINTS1)).stream()
.map(ComparisonResult::mapToPoint)
.collect(Collectors.toList());
} | [
"public",
"List",
"<",
"Point",
">",
"getPoints1",
"(",
")",
"{",
"verifyPropertyPresence",
"(",
"POINTS1",
")",
";",
"//noinspection unchecked",
"return",
"(",
"(",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
")",
"getCommandResult",
"(",
... | Returns a list of matching points on the first image.
@return The list of matching points on the first image. | [
"Returns",
"a",
"list",
"of",
"matching",
"points",
"on",
"the",
"first",
"image",
"."
] | train | https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java#L67-L73 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/TreePrint.java | TreePrint.getCollocationProcessedTree | private static synchronized Tree getCollocationProcessedTree(Tree tree,
HeadFinder hf) {
"""
For the input tree, collapse any collocations in it that exist in
WordNet and are contiguous in the tree into a single node.
A single static Wordnet connect... | java | private static synchronized Tree getCollocationProcessedTree(Tree tree,
HeadFinder hf) {
if (wnc == null) {
try {
Class<?> cl = Class.forName("edu.stanford.nlp.trees.WordNetInstance");
wnc = (WordNetConnection) cl.newInstance(... | [
"private",
"static",
"synchronized",
"Tree",
"getCollocationProcessedTree",
"(",
"Tree",
"tree",
",",
"HeadFinder",
"hf",
")",
"{",
"if",
"(",
"wnc",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"cl",
"=",
"Class",
".",
"forName",
"(",
"... | For the input tree, collapse any collocations in it that exist in
WordNet and are contiguous in the tree into a single node.
A single static Wordnet connection is used by all instances of this
class. Reflection to check that a Wordnet connection exists. Otherwise
we print an error and do nothing.
@param tree The inp... | [
"For",
"the",
"input",
"tree",
"collapse",
"any",
"collocations",
"in",
"it",
"that",
"exist",
"in",
"WordNet",
"and",
"are",
"contiguous",
"in",
"the",
"tree",
"into",
"a",
"single",
"node",
".",
"A",
"single",
"static",
"Wordnet",
"connection",
"is",
"us... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/TreePrint.java#L672-L691 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/WidgetUtil.java | WidgetUtil.createParam | public static Element createParam (String name, String value) {
"""
Creates a {@code <param>} tag with the supplied name and value.
"""
Element pelem = DOM.createElement("param");
DOM.setElementProperty(pelem, "name", name);
DOM.setElementProperty(pelem, "value", value);
return ... | java | public static Element createParam (String name, String value)
{
Element pelem = DOM.createElement("param");
DOM.setElementProperty(pelem, "name", name);
DOM.setElementProperty(pelem, "value", value);
return pelem;
} | [
"public",
"static",
"Element",
"createParam",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Element",
"pelem",
"=",
"DOM",
".",
"createElement",
"(",
"\"param\"",
")",
";",
"DOM",
".",
"setElementProperty",
"(",
"pelem",
",",
"\"name\"",
",",
"... | Creates a {@code <param>} tag with the supplied name and value. | [
"Creates",
"a",
"{"
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/WidgetUtil.java#L242-L248 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java | TargetPoolClient.insertTargetPool | @BetaApi
public final Operation insertTargetPool(ProjectRegionName region, TargetPool targetPoolResource) {
"""
Creates a target pool in the specified project and region using the data included in the
request.
<p>Sample code:
<pre><code>
try (TargetPoolClient targetPoolClient = TargetPoolClient.create())... | java | @BetaApi
public final Operation insertTargetPool(ProjectRegionName region, TargetPool targetPoolResource) {
InsertTargetPoolHttpRequest request =
InsertTargetPoolHttpRequest.newBuilder()
.setRegion(region == null ? null : region.toString())
.setTargetPoolResource(targetPoolResourc... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertTargetPool",
"(",
"ProjectRegionName",
"region",
",",
"TargetPool",
"targetPoolResource",
")",
"{",
"InsertTargetPoolHttpRequest",
"request",
"=",
"InsertTargetPoolHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"se... | Creates a target pool in the specified project and region using the data included in the
request.
<p>Sample code:
<pre><code>
try (TargetPoolClient targetPoolClient = TargetPoolClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
TargetPool targetPoolResource = TargetPool.newBu... | [
"Creates",
"a",
"target",
"pool",
"in",
"the",
"specified",
"project",
"and",
"region",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetPoolClient.java#L858-L867 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/ContinuousDistribution.java | ContinuousDistribution.getDescriptiveName | public String getDescriptiveName() {
"""
The descriptive name of a distribution returns the name of the distribution, followed by the parameters of the distribution and their values.
@return the name of the distribution that includes parameter values
"""
StringBuilder sb = new StringBuilder(getDistrib... | java | public String getDescriptiveName()
{
StringBuilder sb = new StringBuilder(getDistributionName());
sb.append("(");
String[] vars = getVariables();
double[] vals = getCurrentVariableValues();
sb.append(vars[0]).append(" = ").append(vals[0]);
for(int i ... | [
"public",
"String",
"getDescriptiveName",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"getDistributionName",
"(",
")",
")",
";",
"sb",
".",
"append",
"(",
"\"(\"",
")",
";",
"String",
"[",
"]",
"vars",
"=",
"getVariables",
"(",
... | The descriptive name of a distribution returns the name of the distribution, followed by the parameters of the distribution and their values.
@return the name of the distribution that includes parameter values | [
"The",
"descriptive",
"name",
"of",
"a",
"distribution",
"returns",
"the",
"name",
"of",
"the",
"distribution",
"followed",
"by",
"the",
"parameters",
"of",
"the",
"distribution",
"and",
"their",
"values",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/ContinuousDistribution.java#L189-L251 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hash/MurmurHash3Adaptor.java | MurmurHash3Adaptor.hashToBytes | public static byte[] hashToBytes(final char[] data, final long seed) {
"""
Hash a char[] and long seed.
@param data the input char array
@param seed A long valued seed.
@return The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs.
"""
if ((data == null) || (data.length == 0)) {
... | java | public static byte[] hashToBytes(final char[] data, final long seed) {
if ((data == null) || (data.length == 0)) {
return null;
}
return toByteArray(hash(data, seed));
} | [
"public",
"static",
"byte",
"[",
"]",
"hashToBytes",
"(",
"final",
"char",
"[",
"]",
"data",
",",
"final",
"long",
"seed",
")",
"{",
"if",
"(",
"(",
"data",
"==",
"null",
")",
"||",
"(",
"data",
".",
"length",
"==",
"0",
")",
")",
"{",
"return",
... | Hash a char[] and long seed.
@param data the input char array
@param seed A long valued seed.
@return The 128-bit hash as a byte[16] in Big Endian order from 2 64-bit longs. | [
"Hash",
"a",
"char",
"[]",
"and",
"long",
"seed",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hash/MurmurHash3Adaptor.java#L84-L89 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AbstractAlpineQueryManager.java | AbstractAlpineQueryManager.getObjectByUuid | @SuppressWarnings("unchecked")
public <T> T getObjectByUuid(Class<T> clazz, String uuid) {
"""
Retrieves an object by its UUID.
@param <T> A type parameter. This type will be returned
@param clazz the persistence class to retrive the ID for
@param uuid the uuid of the object to retrieve
@return an object o... | java | @SuppressWarnings("unchecked")
public <T> T getObjectByUuid(Class<T> clazz, String uuid) {
return getObjectByUuid(clazz, UUID.fromString(uuid));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getObjectByUuid",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"uuid",
")",
"{",
"return",
"getObjectByUuid",
"(",
"clazz",
",",
"UUID",
".",
"fromString",
"(",
"u... | Retrieves an object by its UUID.
@param <T> A type parameter. This type will be returned
@param clazz the persistence class to retrive the ID for
@param uuid the uuid of the object to retrieve
@return an object of the specified type
@since 1.0.0 | [
"Retrieves",
"an",
"object",
"by",
"its",
"UUID",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AbstractAlpineQueryManager.java#L530-L533 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/interpreter/ListOfInterpreter.java | ListOfInterpreter.processRow | private void processRow(Example valuesRow, Example headers, Fixture rowFixtureAdapter) throws Exception {
"""
<p>processRow.</p>
@param valuesRow a {@link com.greenpepper.Example} object.
@param headers a {@link com.greenpepper.Example} object.
@param rowFixtureAdapter a {@link com.greenpepper.reflect.Fixture... | java | private void processRow(Example valuesRow, Example headers, Fixture rowFixtureAdapter) throws Exception
{
Statistics rowStats = new Statistics();
for (int i = 0; i != valuesRow.remainings(); ++i)
{
Example cell = valuesRow.at( i );
if (i < headers.remainings())
... | [
"private",
"void",
"processRow",
"(",
"Example",
"valuesRow",
",",
"Example",
"headers",
",",
"Fixture",
"rowFixtureAdapter",
")",
"throws",
"Exception",
"{",
"Statistics",
"rowStats",
"=",
"new",
"Statistics",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0"... | <p>processRow.</p>
@param valuesRow a {@link com.greenpepper.Example} object.
@param headers a {@link com.greenpepper.Example} object.
@param rowFixtureAdapter a {@link com.greenpepper.reflect.Fixture} object.
@throws java.lang.Exception if any. | [
"<p",
">",
"processRow",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/interpreter/ListOfInterpreter.java#L126-L146 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.makeSatisfied | private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples) {
"""
Using selections from the given set of tuples, completes bindings to satisfy all current test case conditions.
Returns true if and only if all conditions satisfied.
"""
// Test case still missing a required property?
boolea... | java | private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples)
{
// Test case still missing a required property?
boolean satisfied = testCase.isSatisfied();
if( !satisfied)
{
// Yes, find tuples that contain satisfying bindings.
int prevBindings = testCase.getBindingCount();
... | [
"private",
"boolean",
"makeSatisfied",
"(",
"TestCaseDef",
"testCase",
",",
"VarTupleSet",
"tuples",
")",
"{",
"// Test case still missing a required property?",
"boolean",
"satisfied",
"=",
"testCase",
".",
"isSatisfied",
"(",
")",
";",
"if",
"(",
"!",
"satisfied",
... | Using selections from the given set of tuples, completes bindings to satisfy all current test case conditions.
Returns true if and only if all conditions satisfied. | [
"Using",
"selections",
"from",
"the",
"given",
"set",
"of",
"tuples",
"completes",
"bindings",
"to",
"satisfy",
"all",
"current",
"test",
"case",
"conditions",
".",
"Returns",
"true",
"if",
"and",
"only",
"if",
"all",
"conditions",
"satisfied",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L482-L501 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/AxesWalker.java | AxesWalker.findClone | static AxesWalker findClone(AxesWalker key, Vector cloneList) {
"""
Find a clone that corresponds to the key argument.
@param key The original AxesWalker for which there may be a clone.
@param cloneList vector of sources in odd elements, and the
corresponding clones in even vectors, may be null.
@return A ... | java | static AxesWalker findClone(AxesWalker key, Vector cloneList)
{
if(null != cloneList)
{
// First, look for clone on list.
int n = cloneList.size();
for (int i = 0; i < n; i+=2)
{
if(key == cloneList.elementAt(i))
return (AxesWalker)cloneList.elementAt(i+1);
}
... | [
"static",
"AxesWalker",
"findClone",
"(",
"AxesWalker",
"key",
",",
"Vector",
"cloneList",
")",
"{",
"if",
"(",
"null",
"!=",
"cloneList",
")",
"{",
"// First, look for clone on list.",
"int",
"n",
"=",
"cloneList",
".",
"size",
"(",
")",
";",
"for",
"(",
... | Find a clone that corresponds to the key argument.
@param key The original AxesWalker for which there may be a clone.
@param cloneList vector of sources in odd elements, and the
corresponding clones in even vectors, may be null.
@return A clone that corresponds to the key, or null if key not found. | [
"Find",
"a",
"clone",
"that",
"corresponds",
"to",
"the",
"key",
"argument",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/AxesWalker.java#L157-L170 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ElevationUtil.java | ElevationUtil.createElevationShadow | public static Bitmap createElevationShadow(@NonNull final Context context, final int elevation,
@NonNull final Orientation orientation) {
"""
Creates and returns a bitmap, which can be used to emulate a shadow of an elevated view on
pre-Lollipop devices. By default a... | java | public static Bitmap createElevationShadow(@NonNull final Context context, final int elevation,
@NonNull final Orientation orientation) {
return createElevationShadow(context, elevation, orientation, false);
} | [
"public",
"static",
"Bitmap",
"createElevationShadow",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"final",
"int",
"elevation",
",",
"@",
"NonNull",
"final",
"Orientation",
"orientation",
")",
"{",
"return",
"createElevationShadow",
"(",
"context",
",... | Creates and returns a bitmap, which can be used to emulate a shadow of an elevated view on
pre-Lollipop devices. By default a non-parallel illumination of the view is emulated, which
causes the shadow at its bottom to appear a bit more intense than the shadows to its left and
right and a lot more intense than the shado... | [
"Creates",
"and",
"returns",
"a",
"bitmap",
"which",
"can",
"be",
"used",
"to",
"emulate",
"a",
"shadow",
"of",
"an",
"elevated",
"view",
"on",
"pre",
"-",
"Lollipop",
"devices",
".",
"By",
"default",
"a",
"non",
"-",
"parallel",
"illumination",
"of",
"t... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L792-L795 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/RepositoryPersistor.java | RepositoryPersistor.readMetadataFromXML | private Object readMetadataFromXML(InputSource source, Class target)
throws MalformedURLException, ParserConfigurationException, SAXException, IOException {
"""
Read metadata by populating an instance of the target class
using SAXParser.
"""
// TODO: make this configurable
boole... | java | private Object readMetadataFromXML(InputSource source, Class target)
throws MalformedURLException, ParserConfigurationException, SAXException, IOException
{
// TODO: make this configurable
boolean validate = false;
// get a xml reader instance:
SAXParserFa... | [
"private",
"Object",
"readMetadataFromXML",
"(",
"InputSource",
"source",
",",
"Class",
"target",
")",
"throws",
"MalformedURLException",
",",
"ParserConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"// TODO: make this configurable\r",
"boolean",
"vali... | Read metadata by populating an instance of the target class
using SAXParser. | [
"Read",
"metadata",
"by",
"populating",
"an",
"instance",
"of",
"the",
"target",
"class",
"using",
"SAXParser",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/RepositoryPersistor.java#L297-L345 |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.canPrincipalRender | @Override
@RequestCache
public boolean canPrincipalRender(IAuthorizationPrincipal principal, String portletDefinitionId)
throws AuthorizationException {
"""
Answers if the principal has permission to RENDER this Channel. This implementation currently
delegates to the SUBSCRIBE permission.
@... | java | @Override
@RequestCache
public boolean canPrincipalRender(IAuthorizationPrincipal principal, String portletDefinitionId)
throws AuthorizationException {
// This code simply assumes that anyone who can subscribe to a channel
// should be able to render it. In the future, we'd like to... | [
"@",
"Override",
"@",
"RequestCache",
"public",
"boolean",
"canPrincipalRender",
"(",
"IAuthorizationPrincipal",
"principal",
",",
"String",
"portletDefinitionId",
")",
"throws",
"AuthorizationException",
"{",
"// This code simply assumes that anyone who can subscribe to a channel"... | Answers if the principal has permission to RENDER this Channel. This implementation currently
delegates to the SUBSCRIBE permission.
@return boolean
@param principal IAuthorizationPrincipal
@param portletDefinitionId
@exception AuthorizationException indicates authorization information could not be retrieved. | [
"Answers",
"if",
"the",
"principal",
"has",
"permission",
"to",
"RENDER",
"this",
"Channel",
".",
"This",
"implementation",
"currently",
"delegates",
"to",
"the",
"SUBSCRIBE",
"permission",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L405-L413 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java | PropsCodeGen.writeConfigPropsDeclare | void writeConfigPropsDeclare(Definition def, Writer out, int indent) throws IOException {
"""
Output Configuration Properties Declare
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
if (getConfigProps(def) == null)
return;
... | java | void writeConfigPropsDeclare(Definition def, Writer out, int indent) throws IOException
{
if (getConfigProps(def) == null)
return;
for (int i = 0; i < getConfigProps(def).size(); i++)
{
writeWithIndent(out, indent, "/** " + getConfigProps(def).get(i).getName() + " */\n");
... | [
"void",
"writeConfigPropsDeclare",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"getConfigProps",
"(",
"def",
")",
"==",
"null",
")",
"return",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Output Configuration Properties Declare
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"Configuration",
"Properties",
"Declare"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java#L46-L71 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/SimpleBitfinexApiBroker.java | SimpleBitfinexApiBroker.setupDefaultAccountInfoHandler | private void setupDefaultAccountInfoHandler() {
"""
Setup the default info handler - can be replaced in onAuthenticationSuccessEvent
"""
final BitfinexAccountSymbol accountSymbol = BitfinexSymbols.account(BitfinexApiKeyPermissions.NO_PERMISSIONS);
final AccountInfoHandler accountInfoHandler = new AccountIn... | java | private void setupDefaultAccountInfoHandler() {
final BitfinexAccountSymbol accountSymbol = BitfinexSymbols.account(BitfinexApiKeyPermissions.NO_PERMISSIONS);
final AccountInfoHandler accountInfoHandler = new AccountInfoHandler(ACCCOUNT_INFO_CHANNEL, accountSymbol);
accountInfoHandler.onHeartbeatEvent(timestamp -... | [
"private",
"void",
"setupDefaultAccountInfoHandler",
"(",
")",
"{",
"final",
"BitfinexAccountSymbol",
"accountSymbol",
"=",
"BitfinexSymbols",
".",
"account",
"(",
"BitfinexApiKeyPermissions",
".",
"NO_PERMISSIONS",
")",
";",
"final",
"AccountInfoHandler",
"accountInfoHandl... | Setup the default info handler - can be replaced in onAuthenticationSuccessEvent | [
"Setup",
"the",
"default",
"info",
"handler",
"-",
"can",
"be",
"replaced",
"in",
"onAuthenticationSuccessEvent"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/SimpleBitfinexApiBroker.java#L344-L349 |
LevelFourAB/commons | commons-types/src/main/java/se/l4/commons/types/Types.java | Types.resolveMembers | @NonNull
public static ResolvedTypeWithMembers resolveMembers(@NonNull Type type, @NonNull Type... typeParameters) {
"""
Resolve the given base type and its members.
@param type
the base type to resolve
@param typeParameters
the type parameters
@return
resolve type instance
"""
ResolvedType rt = typ... | java | @NonNull
public static ResolvedTypeWithMembers resolveMembers(@NonNull Type type, @NonNull Type... typeParameters)
{
ResolvedType rt = typeResolver.resolve(type, typeParameters);
return memberResolver.resolve(rt, null, null);
} | [
"@",
"NonNull",
"public",
"static",
"ResolvedTypeWithMembers",
"resolveMembers",
"(",
"@",
"NonNull",
"Type",
"type",
",",
"@",
"NonNull",
"Type",
"...",
"typeParameters",
")",
"{",
"ResolvedType",
"rt",
"=",
"typeResolver",
".",
"resolve",
"(",
"type",
",",
"... | Resolve the given base type and its members.
@param type
the base type to resolve
@param typeParameters
the type parameters
@return
resolve type instance | [
"Resolve",
"the",
"given",
"base",
"type",
"and",
"its",
"members",
"."
] | train | https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-types/src/main/java/se/l4/commons/types/Types.java#L88-L93 |
amazon-archives/aws-sdk-java-resources | aws-resources-core/src/main/java/com/amazonaws/resources/internal/ReflectionUtils.java | ReflectionUtils.digIn | private static Object digIn(Object target, String field) {
"""
Uses reflection to dig into a chain of objects in preparation for
setting a value somewhere within the tree. Gets the value of the given
property of the target object and, if it is null, creates a new instance
of the appropriate type and sets it on ... | java | private static Object digIn(Object target, String field) {
if (target instanceof List) {
// The 'field' will tell us what type of objects belong in the list.
@SuppressWarnings("unchecked")
List<Object> list = (List<Object>) target;
return digInList(list, field);
... | [
"private",
"static",
"Object",
"digIn",
"(",
"Object",
"target",
",",
"String",
"field",
")",
"{",
"if",
"(",
"target",
"instanceof",
"List",
")",
"{",
"// The 'field' will tell us what type of objects belong in the list.",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",... | Uses reflection to dig into a chain of objects in preparation for
setting a value somewhere within the tree. Gets the value of the given
property of the target object and, if it is null, creates a new instance
of the appropriate type and sets it on the target object. Returns the
gotten or created value.
@param target ... | [
"Uses",
"reflection",
"to",
"dig",
"into",
"a",
"chain",
"of",
"objects",
"in",
"preparation",
"for",
"setting",
"a",
"value",
"somewhere",
"within",
"the",
"tree",
".",
"Gets",
"the",
"value",
"of",
"the",
"given",
"property",
"of",
"the",
"target",
"obje... | train | https://github.com/amazon-archives/aws-sdk-java-resources/blob/0f4fef2615d9687997b70a36eed1d62dd42df035/aws-resources-core/src/main/java/com/amazonaws/resources/internal/ReflectionUtils.java#L274-L292 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/bot/sharding/DefaultShardManagerBuilder.java | DefaultShardManagerBuilder.setGatewayPool | public DefaultShardManagerBuilder setGatewayPool(ScheduledExecutorService pool, boolean automaticShutdown) {
"""
Sets the {@link ScheduledExecutorService ScheduledExecutorService} that should be used for
the JDA main WebSocket workers.
<br><b>Only change this pool if you know what you're doing.</b>
<br>This wil... | java | public DefaultShardManagerBuilder setGatewayPool(ScheduledExecutorService pool, boolean automaticShutdown)
{
return setGatewayPoolProvider(pool == null ? null : new ThreadPoolProviderImpl<>(pool, automaticShutdown));
} | [
"public",
"DefaultShardManagerBuilder",
"setGatewayPool",
"(",
"ScheduledExecutorService",
"pool",
",",
"boolean",
"automaticShutdown",
")",
"{",
"return",
"setGatewayPoolProvider",
"(",
"pool",
"==",
"null",
"?",
"null",
":",
"new",
"ThreadPoolProviderImpl",
"<>",
"(",... | Sets the {@link ScheduledExecutorService ScheduledExecutorService} that should be used for
the JDA main WebSocket workers.
<br><b>Only change this pool if you know what you're doing.</b>
<br>This will override the worker pool provider set from {@link #setGatewayPoolProvider(ThreadPoolProvider)}.
@param pool
The threa... | [
"Sets",
"the",
"{",
"@link",
"ScheduledExecutorService",
"ScheduledExecutorService",
"}",
"that",
"should",
"be",
"used",
"for",
"the",
"JDA",
"main",
"WebSocket",
"workers",
".",
"<br",
">",
"<b",
">",
"Only",
"change",
"this",
"pool",
"if",
"you",
"know",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/bot/sharding/DefaultShardManagerBuilder.java#L785-L788 |
MTDdk/jawn | jawn-templates-stringtemplate/src/main/java/net/javapla/jawn/templates/stringtemplate/rewrite/STFastGroupDir.java | STFastGroupDir.loadTemplateResource | private final CompiledST loadTemplateResource(String prefix, String unqualifiedFileName) {
"""
Loads from a jar or similar resource if the template could not be found
directly on the filesystem.
"""
//if (resourceRoot == null) return null;
//return loadTemplate(resourceRoot, prefix, unqualifie... | java | private final CompiledST loadTemplateResource(String prefix, String unqualifiedFileName) {
//if (resourceRoot == null) return null;
//return loadTemplate(resourceRoot, prefix, unqualifiedFileName);
if (resourceRoots.isEmpty()) return null;
CompiledST template = null;
for (URL res... | [
"private",
"final",
"CompiledST",
"loadTemplateResource",
"(",
"String",
"prefix",
",",
"String",
"unqualifiedFileName",
")",
"{",
"//if (resourceRoot == null) return null;",
"//return loadTemplate(resourceRoot, prefix, unqualifiedFileName);",
"if",
"(",
"resourceRoots",
".",
"is... | Loads from a jar or similar resource if the template could not be found
directly on the filesystem. | [
"Loads",
"from",
"a",
"jar",
"or",
"similar",
"resource",
"if",
"the",
"template",
"could",
"not",
"be",
"found",
"directly",
"on",
"the",
"filesystem",
"."
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-templates-stringtemplate/src/main/java/net/javapla/jawn/templates/stringtemplate/rewrite/STFastGroupDir.java#L123-L133 |
phax/ph-oton | ph-oton-security/src/main/java/com/helger/photon/security/object/StubObject.java | StubObject.createForCurrentUser | @Nonnull
public static StubObject createForCurrentUser (@Nullable final Map <String, String> aCustomAttrs) {
"""
Create a {@link StubObject} for the current user creating a new object ID
@param aCustomAttrs
Custom attributes. May be <code>null</code>.
@return Never <code>null</code>.
"""
return crea... | java | @Nonnull
public static StubObject createForCurrentUser (@Nullable final Map <String, String> aCustomAttrs)
{
return createForUser (LoggedInUserManager.getInstance ().getCurrentUserID (), aCustomAttrs);
} | [
"@",
"Nonnull",
"public",
"static",
"StubObject",
"createForCurrentUser",
"(",
"@",
"Nullable",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"aCustomAttrs",
")",
"{",
"return",
"createForUser",
"(",
"LoggedInUserManager",
".",
"getInstance",
"(",
")",
".",... | Create a {@link StubObject} for the current user creating a new object ID
@param aCustomAttrs
Custom attributes. May be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"{",
"@link",
"StubObject",
"}",
"for",
"the",
"current",
"user",
"creating",
"a",
"new",
"object",
"ID"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/object/StubObject.java#L100-L104 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Elvis.java | Elvis.operate | public static boolean operate(PageContext pc, double scope, String[] varNames) {
"""
called by the Elvis operator from generated bytecode
@param pc
@param scope
@param varNames
@return
"""
return _operate(pc, scope, KeyImpl.toKeyArray(varNames), 0);
} | java | public static boolean operate(PageContext pc, double scope, String[] varNames) {
return _operate(pc, scope, KeyImpl.toKeyArray(varNames), 0);
} | [
"public",
"static",
"boolean",
"operate",
"(",
"PageContext",
"pc",
",",
"double",
"scope",
",",
"String",
"[",
"]",
"varNames",
")",
"{",
"return",
"_operate",
"(",
"pc",
",",
"scope",
",",
"KeyImpl",
".",
"toKeyArray",
"(",
"varNames",
")",
",",
"0",
... | called by the Elvis operator from generated bytecode
@param pc
@param scope
@param varNames
@return | [
"called",
"by",
"the",
"Elvis",
"operator",
"from",
"generated",
"bytecode"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Elvis.java#L51-L53 |
jtrfp/javamod | src/main/java/de/quippy/javamod/main/gui/components/SAMeterPanel.java | SAMeterPanel.drawMeter | protected void drawMeter(Graphics g, int newTop, int newLeft, int newWidth, int newHeight, boolean doClear) {
"""
Internal method doing the drawing
@param g
@param newTop
@param newLeft
@param newWidth
@param newHeight
@param doClear
@since 06.05.2011
"""
if (g!=null)
{
switch (drawWhat)
{
... | java | protected void drawMeter(Graphics g, int newTop, int newLeft, int newWidth, int newHeight, boolean doClear)
{
if (g!=null)
{
switch (drawWhat)
{
default:
case DRAW_SA_METER: drawSAMeter(g, newTop, newLeft, newWidth, newHeight, doClear); break;
case DRAW_WAVE_METER: drawWaveMeter(g, newTop, newLe... | [
"protected",
"void",
"drawMeter",
"(",
"Graphics",
"g",
",",
"int",
"newTop",
",",
"int",
"newLeft",
",",
"int",
"newWidth",
",",
"int",
"newHeight",
",",
"boolean",
"doClear",
")",
"{",
"if",
"(",
"g",
"!=",
"null",
")",
"{",
"switch",
"(",
"drawWhat"... | Internal method doing the drawing
@param g
@param newTop
@param newLeft
@param newWidth
@param newHeight
@param doClear
@since 06.05.2011 | [
"Internal",
"method",
"doing",
"the",
"drawing"
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/main/gui/components/SAMeterPanel.java#L215-L238 |
VoltDB/voltdb | examples/windowing/procedures/windowing/DeleteAfterDate.java | DeleteAfterDate.run | public long run(String partitionValue, TimestampType newestToDiscard, long targetMaxRowsToDelete) {
"""
Procedure main logic.
@param partitionValue Partitioning key for this procedure.
@param newestToDiscard Try to remove any tuples as old or older than this value.
@param targetMaxRowsToDelete The target uppe... | java | public long run(String partitionValue, TimestampType newestToDiscard, long targetMaxRowsToDelete) {
if (newestToDiscard == null) {
throw new VoltAbortException("newestToDiscard shouldn't be null.");
// It might be Long.MIN_VALUE as a TimestampType though.
}
if (targetMaxR... | [
"public",
"long",
"run",
"(",
"String",
"partitionValue",
",",
"TimestampType",
"newestToDiscard",
",",
"long",
"targetMaxRowsToDelete",
")",
"{",
"if",
"(",
"newestToDiscard",
"==",
"null",
")",
"{",
"throw",
"new",
"VoltAbortException",
"(",
"\"newestToDiscard sho... | Procedure main logic.
@param partitionValue Partitioning key for this procedure.
@param newestToDiscard Try to remove any tuples as old or older than this value.
@param targetMaxRowsToDelete The target upper limit on the number of rows to delete per transaction.
@return The number of rows deleted.
@throws VoltAbortExc... | [
"Procedure",
"main",
"logic",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/windowing/procedures/windowing/DeleteAfterDate.java#L65-L95 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java | SecurityCenterClient.createSource | public final Source createSource(String parent, Source source) {
"""
Creates a source.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
Source source = Source.newBuilder().build();... | java | public final Source createSource(String parent, Source source) {
CreateSourceRequest request =
CreateSourceRequest.newBuilder().setParent(parent).setSource(source).build();
return createSource(request);
} | [
"public",
"final",
"Source",
"createSource",
"(",
"String",
"parent",
",",
"Source",
"source",
")",
"{",
"CreateSourceRequest",
"request",
"=",
"CreateSourceRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",
"setSource",
"(",
"so... | Creates a source.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
Source source = Source.newBuilder().build();
Source response = securityCenterClient.createSource(parent.toString(), source);
... | [
"Creates",
"a",
"source",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java#L231-L236 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/Nbvcxz.java | Nbvcxz.backfillBruteForce | private void backfillBruteForce(final String password, final Map<Integer, Match> brute_force_matches, final List<Match> matches) {
"""
Fills in the matches array passed in with {@link BruteForceMatch} in every missing spot.
Returns them unsorted.
@param password the password
@param brute_force_matc... | java | private void backfillBruteForce(final String password, final Map<Integer, Match> brute_force_matches, final List<Match> matches)
{
Set<Match> bf_matches = new HashSet<>();
int index = 0;
while (index < password.length())
{
boolean has_match = false;
for (Match... | [
"private",
"void",
"backfillBruteForce",
"(",
"final",
"String",
"password",
",",
"final",
"Map",
"<",
"Integer",
",",
"Match",
">",
"brute_force_matches",
",",
"final",
"List",
"<",
"Match",
">",
"matches",
")",
"{",
"Set",
"<",
"Match",
">",
"bf_matches",
... | Fills in the matches array passed in with {@link BruteForceMatch} in every missing spot.
Returns them unsorted.
@param password the password
@param brute_force_matches map of index and brute force match to fit that index
@param matches the list of matches to fill in | [
"Fills",
"in",
"the",
"matches",
"array",
"passed",
"in",
"with",
"{",
"@link",
"BruteForceMatch",
"}",
"in",
"every",
"missing",
"spot",
".",
"Returns",
"them",
"unsorted",
"."
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/Nbvcxz.java#L552-L573 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java | CipherSuiteConverter.isO2JCached | static boolean isO2JCached(String key, String protocol, String value) {
"""
Tests if the specified key-value pair has been cached in OpenSSL-to-Java cache.
"""
Map<String, String> p2j = o2j.get(key);
if (p2j == null) {
return false;
} else {
return value.equals(p... | java | static boolean isO2JCached(String key, String protocol, String value) {
Map<String, String> p2j = o2j.get(key);
if (p2j == null) {
return false;
} else {
return value.equals(p2j.get(protocol));
}
} | [
"static",
"boolean",
"isO2JCached",
"(",
"String",
"key",
",",
"String",
"protocol",
",",
"String",
"value",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"p2j",
"=",
"o2j",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"p2j",
"==",
"null",
")... | Tests if the specified key-value pair has been cached in OpenSSL-to-Java cache. | [
"Tests",
"if",
"the",
"specified",
"key",
"-",
"value",
"pair",
"has",
"been",
"cached",
"in",
"OpenSSL",
"-",
"to",
"-",
"Java",
"cache",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java#L139-L146 |
bThink-BGU/BPjs | src/main/java/il/ac/bgu/cs/bp/bpjs/model/BProgram.java | BProgram.putInGlobalScope | public void putInGlobalScope(String name, Object obj) {
"""
Adds an object to the program's global scope. JS code can reference the
added object by {@code name}.
@param name The name under which {@code object} will be available to the
JS code.
@param obj The object to be added to the program's scope.
"""... | java | public void putInGlobalScope(String name, Object obj) {
if (getGlobalScope() == null) {
initialScopeValues.put(name, obj);
} else {
try {
Context.enter();
getGlobalScope().put(name, programScope, Context.javaToJS(obj, programScope));
} ... | [
"public",
"void",
"putInGlobalScope",
"(",
"String",
"name",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"getGlobalScope",
"(",
")",
"==",
"null",
")",
"{",
"initialScopeValues",
".",
"put",
"(",
"name",
",",
"obj",
")",
";",
"}",
"else",
"{",
"try",
... | Adds an object to the program's global scope. JS code can reference the
added object by {@code name}.
@param name The name under which {@code object} will be available to the
JS code.
@param obj The object to be added to the program's scope. | [
"Adds",
"an",
"object",
"to",
"the",
"program",
"s",
"global",
"scope",
".",
"JS",
"code",
"can",
"reference",
"the",
"added",
"object",
"by",
"{",
"@code",
"name",
"}",
"."
] | train | https://github.com/bThink-BGU/BPjs/blob/2d388365a27ad79ded108eaf98a35a7ef292ae1f/src/main/java/il/ac/bgu/cs/bp/bpjs/model/BProgram.java#L406-L417 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java | AlertPolicyServiceClient.createAlertPolicy | public final AlertPolicy createAlertPolicy(String name, AlertPolicy alertPolicy) {
"""
Creates a new alerting policy.
<p>Sample code:
<pre><code>
try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
ProjectName name = ProjectName.of("[PROJECT]");
AlertPolicy alertP... | java | public final AlertPolicy createAlertPolicy(String name, AlertPolicy alertPolicy) {
CreateAlertPolicyRequest request =
CreateAlertPolicyRequest.newBuilder().setName(name).setAlertPolicy(alertPolicy).build();
return createAlertPolicy(request);
} | [
"public",
"final",
"AlertPolicy",
"createAlertPolicy",
"(",
"String",
"name",
",",
"AlertPolicy",
"alertPolicy",
")",
"{",
"CreateAlertPolicyRequest",
"request",
"=",
"CreateAlertPolicyRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"... | Creates a new alerting policy.
<p>Sample code:
<pre><code>
try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
ProjectName name = ProjectName.of("[PROJECT]");
AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
AlertPolicy response = alertPolicyServiceClient.createAle... | [
"Creates",
"a",
"new",
"alerting",
"policy",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java#L465-L470 |
liyiorg/weixin-popular | src/main/java/weixin/popular/client/LocalHttpClient.java | LocalHttpClient.executeXmlResult | public static <T> T executeXmlResult(HttpUriRequest request,Class<T> clazz) {
"""
数据返回自动XML对象解析
@param request request
@param clazz clazz
@param <T> T
@return result
"""
return execute(request,XmlResponseHandler.createResponseHandler(clazz));
} | java | public static <T> T executeXmlResult(HttpUriRequest request,Class<T> clazz){
return execute(request,XmlResponseHandler.createResponseHandler(clazz));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"executeXmlResult",
"(",
"HttpUriRequest",
"request",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"execute",
"(",
"request",
",",
"XmlResponseHandler",
".",
"createResponseHandler",
"(",
"clazz",
")",
")"... | 数据返回自动XML对象解析
@param request request
@param clazz clazz
@param <T> T
@return result | [
"数据返回自动XML对象解析"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/client/LocalHttpClient.java#L166-L168 |
NLPchina/elasticsearch-sql | src/main/java/org/elasticsearch/plugin/nlpcn/ElasticUtils.java | ElasticUtils.hitsAsStringResult | public static String hitsAsStringResult(SearchHits results, MetaSearchResult metaResults) throws IOException {
"""
use our deserializer instead of results toXcontent because the source field is differnet from sourceAsMap.
"""
if(results == null) return null;
Object[] searchHits;
searchH... | java | public static String hitsAsStringResult(SearchHits results, MetaSearchResult metaResults) throws IOException {
if(results == null) return null;
Object[] searchHits;
searchHits = new Object[(int) results.getTotalHits()];
int i = 0;
for(SearchHit hit : results) {
HashMa... | [
"public",
"static",
"String",
"hitsAsStringResult",
"(",
"SearchHits",
"results",
",",
"MetaSearchResult",
"metaResults",
")",
"throws",
"IOException",
"{",
"if",
"(",
"results",
"==",
"null",
")",
"return",
"null",
";",
"Object",
"[",
"]",
"searchHits",
";",
... | use our deserializer instead of results toXcontent because the source field is differnet from sourceAsMap. | [
"use",
"our",
"deserializer",
"instead",
"of",
"results",
"toXcontent",
"because",
"the",
"source",
"field",
"is",
"differnet",
"from",
"sourceAsMap",
"."
] | train | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/elasticsearch/plugin/nlpcn/ElasticUtils.java#L43-L71 |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.valueOf | @Deprecated
@SuppressWarnings("unchecked")
public static <T> T valueOf(Class<T> type, String value, typeinfo annotation) {
"""
Converts a String representation into a value of a given type. Conversion attempts are made in the following order:
<ol>
<li>Try to invoke {@code public static SomeClass valueOf(... | java | @Deprecated
@SuppressWarnings("unchecked")
public static <T> T valueOf(Class<T> type, String value, typeinfo annotation) {
if (type.equals(String.class)) {
return type.cast(value);
} else {
try {
Class<?> boxed = boxPrimitive(type);
try {
... | [
"@",
"Deprecated",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"valueOf",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"value",
",",
"typeinfo",
"annotation",
")",
"{",
"if",
"(",
"type",
".",
"equ... | Converts a String representation into a value of a given type. Conversion attempts are made in the following order:
<ol>
<li>Try to invoke {@code public static SomeClass valueOf(String text)}.</li>
<li>Try to invoke {@code public static SomeClass valueOf(Class<SomeClass> type, String text)},
or {@code public static Som... | [
"Converts",
"a",
"String",
"representation",
"into",
"a",
"value",
"of",
"a",
"given",
"type",
".",
"Conversion",
"attempts",
"are",
"made",
"in",
"the",
"following",
"order",
":",
"<ol",
">",
"<li",
">",
"Try",
"to",
"invoke",
"{",
"@code",
"public",
"s... | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L481-L502 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/BlockThreadManager.java | BlockThreadManager.addFrameThread | synchronized public boolean addFrameThread(Frame frame) {
"""
Add a Frame to this manager, which it will use to encode a block. Each
Frame added allows one more thread to be used for encoding. At least one
Frame must be added for this manager to encode.
@param frame Frame to use for encoding.
@return boolean f... | java | synchronized public boolean addFrameThread(Frame frame) {
FrameThread ft = new FrameThread(frame, this);
inactiveFrameThreads.add(ft);
boolean r = true;
startFrameThreads();
return r;
} | [
"synchronized",
"public",
"boolean",
"addFrameThread",
"(",
"Frame",
"frame",
")",
"{",
"FrameThread",
"ft",
"=",
"new",
"FrameThread",
"(",
"frame",
",",
"this",
")",
";",
"inactiveFrameThreads",
".",
"add",
"(",
"ft",
")",
";",
"boolean",
"r",
"=",
"true... | Add a Frame to this manager, which it will use to encode a block. Each
Frame added allows one more thread to be used for encoding. At least one
Frame must be added for this manager to encode.
@param frame Frame to use for encoding.
@return boolean false if there was an error adding the frame, true
otherwise. | [
"Add",
"a",
"Frame",
"to",
"this",
"manager",
"which",
"it",
"will",
"use",
"to",
"encode",
"a",
"block",
".",
"Each",
"Frame",
"added",
"allows",
"one",
"more",
"thread",
"to",
"be",
"used",
"for",
"encoding",
".",
"At",
"least",
"one",
"Frame",
"must... | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/BlockThreadManager.java#L167-L173 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/Branch.java | Branch.initSession | public boolean initSession(BranchReferralInitListener callback, boolean isReferrable, Uri data) {
"""
<p>Initialises a session with the Branch API.</p>
@param callback A {@link BranchReferralInitListener} instance that will be called
following successful (or unsuccessful) initialisation of the session
wit... | java | public boolean initSession(BranchReferralInitListener callback, boolean isReferrable, Uri data) {
return initSession(callback, isReferrable, data, null);
} | [
"public",
"boolean",
"initSession",
"(",
"BranchReferralInitListener",
"callback",
",",
"boolean",
"isReferrable",
",",
"Uri",
"data",
")",
"{",
"return",
"initSession",
"(",
"callback",
",",
"isReferrable",
",",
"data",
",",
"null",
")",
";",
"}"
] | <p>Initialises a session with the Branch API.</p>
@param callback A {@link BranchReferralInitListener} instance that will be called
following successful (or unsuccessful) initialisation of the session
with the Branch API.
@param isReferrable A {@link Boolean} value indicating whether this initialisation
session sh... | [
"<p",
">",
"Initialises",
"a",
"session",
"with",
"the",
"Branch",
"API",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L1222-L1224 |
greenfrvr/rubber-loader | rubber-loader/src/main/java/com/greenfrvr/rubberloader/RubberLoaderView.java | RubberLoaderView.setPalette | public void setPalette(@ColorInt int primeColor, @ColorInt int extraColor) {
"""
Sets loader prime and extra color.
@param primeColor Prime color value
@param extraColor Extra color value
"""
this.primeColor = primeColor;
this.extraColor = extraColor == 0 ? primeColor : extraColor;
... | java | public void setPalette(@ColorInt int primeColor, @ColorInt int extraColor) {
this.primeColor = primeColor;
this.extraColor = extraColor == 0 ? primeColor : extraColor;
pathPaint.setColor(primeColor);
gradient = null;
} | [
"public",
"void",
"setPalette",
"(",
"@",
"ColorInt",
"int",
"primeColor",
",",
"@",
"ColorInt",
"int",
"extraColor",
")",
"{",
"this",
".",
"primeColor",
"=",
"primeColor",
";",
"this",
".",
"extraColor",
"=",
"extraColor",
"==",
"0",
"?",
"primeColor",
"... | Sets loader prime and extra color.
@param primeColor Prime color value
@param extraColor Extra color value | [
"Sets",
"loader",
"prime",
"and",
"extra",
"color",
"."
] | train | https://github.com/greenfrvr/rubber-loader/blob/7ce5c6edd567f37cd55654afc1987740550f6002/rubber-loader/src/main/java/com/greenfrvr/rubberloader/RubberLoaderView.java#L123-L128 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/websocket/utils/WSURI.java | WSURI.toWebsocket | public static URI toWebsocket(CharSequence inputUrl, String query) throws URISyntaxException {
"""
Convert to WebSocket <code>ws</code> or <code>wss</code> scheme URIs
<p>
Converting <code>http</code> and <code>https</code> URIs to their WebSocket equivalent
@param inputUrl the input URI
@param query the ... | java | public static URI toWebsocket(CharSequence inputUrl, String query) throws URISyntaxException {
if (query == null) {
return toWebsocket(new URI(inputUrl.toString()));
}
return toWebsocket(new URI(inputUrl.toString() + '?' + query));
} | [
"public",
"static",
"URI",
"toWebsocket",
"(",
"CharSequence",
"inputUrl",
",",
"String",
"query",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"return",
"toWebsocket",
"(",
"new",
"URI",
"(",
"inputUrl",
".",
"toStri... | Convert to WebSocket <code>ws</code> or <code>wss</code> scheme URIs
<p>
Converting <code>http</code> and <code>https</code> URIs to their WebSocket equivalent
@param inputUrl the input URI
@param query the optional query string
@return the WebSocket scheme URI for the input URI.
@throws URISyntaxException if unabl... | [
"Convert",
"to",
"WebSocket",
"<code",
">",
"ws<",
"/",
"code",
">",
"or",
"<code",
">",
"wss<",
"/",
"code",
">",
"scheme",
"URIs",
"<p",
">",
"Converting",
"<code",
">",
"http<",
"/",
"code",
">",
"and",
"<code",
">",
"https<",
"/",
"code",
">",
... | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/websocket/utils/WSURI.java#L64-L69 |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java | LinearSmoothScroller.calculateDyToMakeVisible | public int calculateDyToMakeVisible(View view, int snapPreference) {
"""
Calculates the vertical scroll amount necessary to make the given view fully visible
inside the RecyclerView.
@param view The view which we want to make fully visible
@param snapPreference The edge which the view should snap to... | java | public int calculateDyToMakeVisible(View view, int snapPreference) {
final RecyclerView.LayoutManager layoutManager = getLayoutManager();
if (!layoutManager.canScrollVertically()) {
return 0;
}
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
... | [
"public",
"int",
"calculateDyToMakeVisible",
"(",
"View",
"view",
",",
"int",
"snapPreference",
")",
"{",
"final",
"RecyclerView",
".",
"LayoutManager",
"layoutManager",
"=",
"getLayoutManager",
"(",
")",
";",
"if",
"(",
"!",
"layoutManager",
".",
"canScrollVertic... | Calculates the vertical scroll amount necessary to make the given view fully visible
inside the RecyclerView.
@param view The view which we want to make fully visible
@param snapPreference The edge which the view should snap to when entering the visible
area. One of {@link #SNAP_TO_START}, {@link #SNAP_TO_EN... | [
"Calculates",
"the",
"vertical",
"scroll",
"amount",
"necessary",
"to",
"make",
"the",
"given",
"view",
"fully",
"visible",
"inside",
"the",
"RecyclerView",
"."
] | train | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java#L298-L310 |
cdk/cdk | misc/extra/src/main/java/org/openscience/cdk/reaction/ReactionChain.java | ReactionChain.addReaction | public void addReaction(IReaction reaction, int position) {
"""
Added a IReaction for this chain in position.
@param reaction The IReaction
@param position The position in this chain where the reaction is to be inserted
"""
hashMapChain.put(reaction, position);
this.addReaction(reaction);... | java | public void addReaction(IReaction reaction, int position) {
hashMapChain.put(reaction, position);
this.addReaction(reaction);
} | [
"public",
"void",
"addReaction",
"(",
"IReaction",
"reaction",
",",
"int",
"position",
")",
"{",
"hashMapChain",
".",
"put",
"(",
"reaction",
",",
"position",
")",
";",
"this",
".",
"addReaction",
"(",
"reaction",
")",
";",
"}"
] | Added a IReaction for this chain in position.
@param reaction The IReaction
@param position The position in this chain where the reaction is to be inserted | [
"Added",
"a",
"IReaction",
"for",
"this",
"chain",
"in",
"position",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/reaction/ReactionChain.java#L59-L62 |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/Keys.java | Keys.newSecretKey | public static SecretKey newSecretKey() {
"""
Generates a new secret (also known as symmetric) key for use with {@value #SYMMETRIC_ALGORITHM}.
<p>
The key size is determined by {@link #SYMMETRIC_KEY_SIZE}.
@return A new, randomly generated secret key.
"""
// FYI: AES keys are just random bytes f... | java | public static SecretKey newSecretKey() {
// FYI: AES keys are just random bytes from a strong source of randomness.
// Get a key generator instance
KeyGenerator keyGenerator;
try {
keyGenerator = KeyGenerator.getInstance(SYMMETRIC_ALGORITHM);
} catch (NoSuch... | [
"public",
"static",
"SecretKey",
"newSecretKey",
"(",
")",
"{",
"// FYI: AES keys are just random bytes from a strong source of randomness.\r",
"// Get a key generator instance\r",
"KeyGenerator",
"keyGenerator",
";",
"try",
"{",
"keyGenerator",
"=",
"KeyGenerator",
".",
"getInst... | Generates a new secret (also known as symmetric) key for use with {@value #SYMMETRIC_ALGORITHM}.
<p>
The key size is determined by {@link #SYMMETRIC_KEY_SIZE}.
@return A new, randomly generated secret key. | [
"Generates",
"a",
"new",
"secret",
"(",
"also",
"known",
"as",
"symmetric",
")",
"key",
"for",
"use",
"with",
"{",
"@value",
"#SYMMETRIC_ALGORITHM",
"}",
".",
"<p",
">",
"The",
"key",
"size",
"is",
"determined",
"by",
"{",
"@link",
"#SYMMETRIC_KEY_SIZE",
"... | train | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/Keys.java#L133-L157 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ComplexImg.java | ComplexImg.setValueR | public void setValueR(int x, int y, double value) {
"""
Sets the real part at the specified position
<br>
If {@link #isSynchronizePowerSpectrum()} is true, then this will also
update the corresponding power value.
@param x coordinate
@param y coordinate
@param value to be set
"""
int idx=y*width+x;
s... | java | public void setValueR(int x, int y, double value) {
int idx=y*width+x;
setValueR_atIndex(idx, value);
} | [
"public",
"void",
"setValueR",
"(",
"int",
"x",
",",
"int",
"y",
",",
"double",
"value",
")",
"{",
"int",
"idx",
"=",
"y",
"*",
"width",
"+",
"x",
";",
"setValueR_atIndex",
"(",
"idx",
",",
"value",
")",
";",
"}"
] | Sets the real part at the specified position
<br>
If {@link #isSynchronizePowerSpectrum()} is true, then this will also
update the corresponding power value.
@param x coordinate
@param y coordinate
@param value to be set | [
"Sets",
"the",
"real",
"part",
"at",
"the",
"specified",
"position",
"<br",
">",
"If",
"{"
] | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ComplexImg.java#L430-L433 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/protonetwork/ProtoNetworkBuilder.java | ProtoNetworkBuilder.buildAnnotationPairs | protected Set<AnnotationPair> buildAnnotationPairs(
ProtoNetwork protoNetwork,
Map<String, Annotation> annotationMap) {
"""
Build a {@link Set} of {@link AnnotationPair} objects from a {@link Map}
of {@link Annotation} values.
@param protoNetwork {@link ProtoNetwork}, the proto network
... | java | protected Set<AnnotationPair> buildAnnotationPairs(
ProtoNetwork protoNetwork,
Map<String, Annotation> annotationMap) {
// build annotation value to annotation definition map
Set<AnnotationPair> valueDefinitions =
new LinkedHashSet<AnnotationPair>();
Annot... | [
"protected",
"Set",
"<",
"AnnotationPair",
">",
"buildAnnotationPairs",
"(",
"ProtoNetwork",
"protoNetwork",
",",
"Map",
"<",
"String",
",",
"Annotation",
">",
"annotationMap",
")",
"{",
"// build annotation value to annotation definition map",
"Set",
"<",
"AnnotationPair... | Build a {@link Set} of {@link AnnotationPair} objects from a {@link Map}
of {@link Annotation} values.
@param protoNetwork {@link ProtoNetwork}, the proto network
@param annotationMap {@link Map}, the annotations map
@return {@link Set}, the {@link Set} of annotation definition and value
pairs | [
"Build",
"a",
"{",
"@link",
"Set",
"}",
"of",
"{",
"@link",
"AnnotationPair",
"}",
"objects",
"from",
"a",
"{",
"@link",
"Map",
"}",
"of",
"{",
"@link",
"Annotation",
"}",
"values",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/protonetwork/ProtoNetworkBuilder.java#L396-L417 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.changeVnetWithServiceResponseAsync | public Observable<ServiceResponse<Page<SiteInner>>> changeVnetWithServiceResponseAsync(final String resourceGroupName, final String name, final VirtualNetworkProfile vnetInfo) {
"""
Move an App Service Environment to a different VNET.
Move an App Service Environment to a different VNET.
@param resourceGroupNam... | java | public Observable<ServiceResponse<Page<SiteInner>>> changeVnetWithServiceResponseAsync(final String resourceGroupName, final String name, final VirtualNetworkProfile vnetInfo) {
return changeVnetSinglePageAsync(resourceGroupName, name, vnetInfo)
.concatMap(new Func1<ServiceResponse<Page<SiteInner>>,... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"SiteInner",
">",
">",
">",
"changeVnetWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"VirtualNetworkProfile",
"vnetInfo",
")",
"... | Move an App Service Environment to a different VNET.
Move an App Service Environment to a different VNET.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param vnetInfo Details for the new virtual network.
@throws IllegalArgumentExcep... | [
"Move",
"an",
"App",
"Service",
"Environment",
"to",
"a",
"different",
"VNET",
".",
"Move",
"an",
"App",
"Service",
"Environment",
"to",
"a",
"different",
"VNET",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceEnvironmentsInner.java#L1602-L1614 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/ringsearch/FiguerasSSSRFinder.java | FiguerasSSSRFinder.trim | private void trim(IAtom atom, IAtomContainer molecule) {
"""
removes all bonds connected to the given atom leaving it with degree zero.
@param atom The atom to be disconnecred
@param molecule The molecule containing the atom
"""
List<IBond> bonds = molecule.getConnectedBondsList(atom);
... | java | private void trim(IAtom atom, IAtomContainer molecule) {
List<IBond> bonds = molecule.getConnectedBondsList(atom);
for (int i = 0; i < bonds.size(); i++) {
molecule.removeElectronContainer((IBond) bonds.get(i));
}
// you are erased! Har, har, har..... >8-)
} | [
"private",
"void",
"trim",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"molecule",
")",
"{",
"List",
"<",
"IBond",
">",
"bonds",
"=",
"molecule",
".",
"getConnectedBondsList",
"(",
"atom",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"... | removes all bonds connected to the given atom leaving it with degree zero.
@param atom The atom to be disconnecred
@param molecule The molecule containing the atom | [
"removes",
"all",
"bonds",
"connected",
"to",
"the",
"given",
"atom",
"leaving",
"it",
"with",
"degree",
"zero",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/ringsearch/FiguerasSSSRFinder.java#L295-L301 |
pedrovgs/DraggablePanel | draggablepanel/src/main/java/com/github/pedrovgs/DraggableViewCallback.java | DraggableViewCallback.clampViewPositionVertical | @Override public int clampViewPositionVertical(View child, int top, int dy) {
"""
Override method used to configure the vertical drag. Restrict the motion of the dragged child
view along the vertical axis.
@param child child view being dragged.
@param top attempted motion along the Y axis.
@param dy proposed... | java | @Override public int clampViewPositionVertical(View child, int top, int dy) {
int newTop = draggableView.getHeight() - draggableView.getDraggedViewHeightPlusMarginTop();
if (draggableView.isMinimized() && Math.abs(dy) >= MINIMUM_DY_FOR_VERTICAL_DRAG
|| (!draggableView.isMinimized() && !draggableView.isD... | [
"@",
"Override",
"public",
"int",
"clampViewPositionVertical",
"(",
"View",
"child",
",",
"int",
"top",
",",
"int",
"dy",
")",
"{",
"int",
"newTop",
"=",
"draggableView",
".",
"getHeight",
"(",
")",
"-",
"draggableView",
".",
"getDraggedViewHeightPlusMarginTop",... | Override method used to configure the vertical drag. Restrict the motion of the dragged child
view along the vertical axis.
@param child child view being dragged.
@param top attempted motion along the Y axis.
@param dy proposed change in position for top.
@return the new clamped position for top. | [
"Override",
"method",
"used",
"to",
"configure",
"the",
"vertical",
"drag",
".",
"Restrict",
"the",
"motion",
"of",
"the",
"dragged",
"child",
"view",
"along",
"the",
"vertical",
"axis",
"."
] | train | https://github.com/pedrovgs/DraggablePanel/blob/6b6d1806fa4140113f31307a2571bf02435aa53a/draggablepanel/src/main/java/com/github/pedrovgs/DraggableViewCallback.java#L127-L140 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java | StreamMetrics.deleteStream | public void deleteStream(String scope, String streamName, Duration latency) {
"""
This method increments the global and Stream-specific counters of Stream deletions and reports the latency of
the operation.
@param scope Scope.
@param streamName Name of the Stream.
@param latency Latency of t... | java | public void deleteStream(String scope, String streamName, Duration latency) {
DYNAMIC_LOGGER.incCounterValue(DELETE_STREAM, 1);
deleteStreamLatency.reportSuccessValue(latency.toMillis());
} | [
"public",
"void",
"deleteStream",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"Duration",
"latency",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"DELETE_STREAM",
",",
"1",
")",
";",
"deleteStreamLatency",
".",
"reportSuccessValue",
"(",
... | This method increments the global and Stream-specific counters of Stream deletions and reports the latency of
the operation.
@param scope Scope.
@param streamName Name of the Stream.
@param latency Latency of the deleteStream operation. | [
"This",
"method",
"increments",
"the",
"global",
"and",
"Stream",
"-",
"specific",
"counters",
"of",
"Stream",
"deletions",
"and",
"reports",
"the",
"latency",
"of",
"the",
"operation",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L88-L91 |
janus-project/guava.janusproject.io | guava-gwt/src-super/com/google/common/io/super/com/google/common/io/BaseEncoding.java | BaseEncoding.decodeChecked | final byte[] decodeChecked(CharSequence chars) throws DecodingException {
"""
Decodes the specified character sequence, and returns the resulting {@code byte[]}.
This is the inverse operation to {@link #encode(byte[])}.
@throws DecodingException if the input is not a valid encoded string according to this
enc... | java | final byte[] decodeChecked(CharSequence chars) throws DecodingException {
chars = padding().trimTrailingFrom(chars);
ByteInput decodedInput = decodingStream(asCharInput(chars));
byte[] tmp = new byte[maxDecodedSize(chars.length())];
int index = 0;
try {
for (int i = decodedInput.read(); i != -... | [
"final",
"byte",
"[",
"]",
"decodeChecked",
"(",
"CharSequence",
"chars",
")",
"throws",
"DecodingException",
"{",
"chars",
"=",
"padding",
"(",
")",
".",
"trimTrailingFrom",
"(",
"chars",
")",
";",
"ByteInput",
"decodedInput",
"=",
"decodingStream",
"(",
"asC... | Decodes the specified character sequence, and returns the resulting {@code byte[]}.
This is the inverse operation to {@link #encode(byte[])}.
@throws DecodingException if the input is not a valid encoded string according to this
encoding. | [
"Decodes",
"the",
"specified",
"character",
"sequence",
"and",
"returns",
"the",
"resulting",
"{",
"@code",
"byte",
"[]",
"}",
".",
"This",
"is",
"the",
"inverse",
"operation",
"to",
"{",
"@link",
"#encode",
"(",
"byte",
"[]",
")",
"}",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava-gwt/src-super/com/google/common/io/super/com/google/common/io/BaseEncoding.java#L207-L222 |
dbracewell/mango | src/main/java/com/davidbracewell/config/Config.java | Config.hasProperty | public static boolean hasProperty(String propertyPrefix, Language language, String... propertyComponents) {
"""
<p>Checks if a property is in the config or or set on the system. The property name is constructed as
<code>propertyPrefix+ . + propertyComponent[0] + . + propertyComponent[1] + ... +
(language.toStrin... | java | public static boolean hasProperty(String propertyPrefix, Language language, String... propertyComponents) {
return findKey(propertyPrefix, language, propertyComponents) != null;
} | [
"public",
"static",
"boolean",
"hasProperty",
"(",
"String",
"propertyPrefix",
",",
"Language",
"language",
",",
"String",
"...",
"propertyComponents",
")",
"{",
"return",
"findKey",
"(",
"propertyPrefix",
",",
"language",
",",
"propertyComponents",
")",
"!=",
"nu... | <p>Checks if a property is in the config or or set on the system. The property name is constructed as
<code>propertyPrefix+ . + propertyComponent[0] + . + propertyComponent[1] + ... +
(language.toString()|language.getCode().toLowerCase())</code> This will return true if the language specific
config option is set or a d... | [
"<p",
">",
"Checks",
"if",
"a",
"property",
"is",
"in",
"the",
"config",
"or",
"or",
"set",
"on",
"the",
"system",
".",
"The",
"property",
"name",
"is",
"constructed",
"as",
"<code",
">",
"propertyPrefix",
"+",
".",
"+",
"propertyComponent",
"[",
"0",
... | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/config/Config.java#L227-L229 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java | DeploymentResourceSupport.hasDeploymentSubModel | public boolean hasDeploymentSubModel(final String subsystemName, final PathAddress address) {
"""
Checks to see if a resource has already been registered for the specified address on the subsystem.
@param subsystemName the name of the subsystem
@param address the address to check
@return {@code true} ... | java | public boolean hasDeploymentSubModel(final String subsystemName, final PathAddress address) {
final Resource root = deploymentUnit.getAttachment(DEPLOYMENT_RESOURCE);
final PathElement subsystem = PathElement.pathElement(SUBSYSTEM, subsystemName);
boolean found = false;
if (root.hasChild... | [
"public",
"boolean",
"hasDeploymentSubModel",
"(",
"final",
"String",
"subsystemName",
",",
"final",
"PathAddress",
"address",
")",
"{",
"final",
"Resource",
"root",
"=",
"deploymentUnit",
".",
"getAttachment",
"(",
"DEPLOYMENT_RESOURCE",
")",
";",
"final",
"PathEle... | Checks to see if a resource has already been registered for the specified address on the subsystem.
@param subsystemName the name of the subsystem
@param address the address to check
@return {@code true} if the address exists on the subsystem otherwise {@code false} | [
"Checks",
"to",
"see",
"if",
"a",
"resource",
"has",
"already",
"been",
"registered",
"for",
"the",
"specified",
"address",
"on",
"the",
"subsystem",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java#L119-L139 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/InnerMetricContext.java | InnerMetricContext.getMeters | @Override
public SortedMap<String, Meter> getMeters(MetricFilter filter) {
"""
See {@link com.codahale.metrics.MetricRegistry#getMeters(com.codahale.metrics.MetricFilter)}.
<p>
This method will return fully-qualified metric names if the {@link MetricContext} is configured
to report fully-qualified metric na... | java | @Override
public SortedMap<String, Meter> getMeters(MetricFilter filter) {
return getSimplyNamedMetrics(Meter.class, Optional.of(filter));
} | [
"@",
"Override",
"public",
"SortedMap",
"<",
"String",
",",
"Meter",
">",
"getMeters",
"(",
"MetricFilter",
"filter",
")",
"{",
"return",
"getSimplyNamedMetrics",
"(",
"Meter",
".",
"class",
",",
"Optional",
".",
"of",
"(",
"filter",
")",
")",
";",
"}"
] | See {@link com.codahale.metrics.MetricRegistry#getMeters(com.codahale.metrics.MetricFilter)}.
<p>
This method will return fully-qualified metric names if the {@link MetricContext} is configured
to report fully-qualified metric names.
</p> | [
"See",
"{",
"@link",
"com",
".",
"codahale",
".",
"metrics",
".",
"MetricRegistry#getMeters",
"(",
"com",
".",
"codahale",
".",
"metrics",
".",
"MetricFilter",
")",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/InnerMetricContext.java#L229-L232 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java | ObjectEnvelopeOrdering.buildConcreteMNEdge | protected Edge buildConcreteMNEdge(Vertex vertex1, Vertex vertex2) {
"""
Checks if the database operations associated with two object envelopes
that are related via an m:n collection reference needs to be performed
in a particular order and if so builds and returns a corresponding
directed edge weighted with <c... | java | protected Edge buildConcreteMNEdge(Vertex vertex1, Vertex vertex2)
{
ModificationState state1 = vertex1.getEnvelope().getModificationState();
ModificationState state2 = vertex2.getEnvelope().getModificationState();
if (state1.needsUpdate() || state1.needsInsert())
{
... | [
"protected",
"Edge",
"buildConcreteMNEdge",
"(",
"Vertex",
"vertex1",
",",
"Vertex",
"vertex2",
")",
"{",
"ModificationState",
"state1",
"=",
"vertex1",
".",
"getEnvelope",
"(",
")",
".",
"getModificationState",
"(",
")",
";",
"ModificationState",
"state2",
"=",
... | Checks if the database operations associated with two object envelopes
that are related via an m:n collection reference needs to be performed
in a particular order and if so builds and returns a corresponding
directed edge weighted with <code>CONCRETE_EDGE_WEIGHT</code>.
The following cases are considered (* means obje... | [
"Checks",
"if",
"the",
"database",
"operations",
"associated",
"with",
"two",
"object",
"envelopes",
"that",
"are",
"related",
"via",
"an",
"m",
":",
"n",
"collection",
"reference",
"needs",
"to",
"be",
"performed",
"in",
"a",
"particular",
"order",
"and",
"... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java#L603-L625 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java | CipherSuiteConverter.toJava | static String toJava(String openSslCipherSuite, String protocol) {
"""
Convert from OpenSSL cipher suite name convention to java cipher suite name convention.
@param openSslCipherSuite An OpenSSL cipher suite name.
@param protocol The cryptographic protocol (i.e. SSL, TLS, ...).
@return The translated cipher su... | java | static String toJava(String openSslCipherSuite, String protocol) {
Map<String, String> p2j = o2j.get(openSslCipherSuite);
if (p2j == null) {
p2j = cacheFromOpenSsl(openSslCipherSuite);
// This may happen if this method is queried when OpenSSL doesn't yet have a cipher setup. It w... | [
"static",
"String",
"toJava",
"(",
"String",
"openSslCipherSuite",
",",
"String",
"protocol",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"p2j",
"=",
"o2j",
".",
"get",
"(",
"openSslCipherSuite",
")",
";",
"if",
"(",
"p2j",
"==",
"null",
")",
"... | Convert from OpenSSL cipher suite name convention to java cipher suite name convention.
@param openSslCipherSuite An OpenSSL cipher suite name.
@param protocol The cryptographic protocol (i.e. SSL, TLS, ...).
@return The translated cipher suite name according to java conventions. This will not be {@code null}. | [
"Convert",
"from",
"OpenSSL",
"cipher",
"suite",
"name",
"convention",
"to",
"java",
"cipher",
"suite",
"name",
"convention",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java#L282-L303 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.getGroupsOfUser | public List<CmsGroup> getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus)
throws CmsException {
"""
Returns all the groups the given user belongs to.<p>
@param username the name of the user
@param directGroupsOnly if set only the direct assigned groups will be returned, if n... | java | public List<CmsGroup> getGroupsOfUser(String username, boolean directGroupsOnly, boolean includeOtherOus)
throws CmsException {
return getGroupsOfUser(username, directGroupsOnly, includeOtherOus, m_context.getRemoteAddress());
} | [
"public",
"List",
"<",
"CmsGroup",
">",
"getGroupsOfUser",
"(",
"String",
"username",
",",
"boolean",
"directGroupsOnly",
",",
"boolean",
"includeOtherOus",
")",
"throws",
"CmsException",
"{",
"return",
"getGroupsOfUser",
"(",
"username",
",",
"directGroupsOnly",
",... | Returns all the groups the given user belongs to.<p>
@param username the name of the user
@param directGroupsOnly if set only the direct assigned groups will be returned, if not also indirect roles
@param includeOtherOus if to include groups of other organizational units
@return a list of <code>{@link CmsGroup}</code... | [
"Returns",
"all",
"the",
"groups",
"the",
"given",
"user",
"belongs",
"to",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1471-L1475 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/serialization/HadoopSerialization.java | HadoopSerialization.deser | public <T> T deser(Object obj, InputStream in) throws IOException {
"""
Deseerializes into the given object using the Hadoop serialization system.
Object cannot be null.
"""
Map<Class, Deserializer> deserializers = cachedDeserializers.get();
Deserializer deSer = deserializers.get(obj.getClass());
if(deS... | java | public <T> T deser(Object obj, InputStream in) throws IOException {
Map<Class, Deserializer> deserializers = cachedDeserializers.get();
Deserializer deSer = deserializers.get(obj.getClass());
if(deSer == null) {
deSer = serialization.getDeserializer(obj.getClass());
deserializers.put(obj.getClass(), deSer);... | [
"public",
"<",
"T",
">",
"T",
"deser",
"(",
"Object",
"obj",
",",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"Class",
",",
"Deserializer",
">",
"deserializers",
"=",
"cachedDeserializers",
".",
"get",
"(",
")",
";",
"Deserializer",... | Deseerializes into the given object using the Hadoop serialization system.
Object cannot be null. | [
"Deseerializes",
"into",
"the",
"given",
"object",
"using",
"the",
"Hadoop",
"serialization",
"system",
".",
"Object",
"cannot",
"be",
"null",
"."
] | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/serialization/HadoopSerialization.java#L91-L102 |
myriadmobile/shove | library/src/main/java/com/myriadmobile/library/shove/SimpleNotificationDelegate.java | SimpleNotificationDelegate.showNotification | public void showNotification(Context context, Bundle extras) {
"""
Shows a notification for the given push message
@param extras the message extras
"""
// parse the title and message from the extras
String title = getTitle(context, extras);
String message = getMessage(context, extras... | java | public void showNotification(Context context, Bundle extras) {
// parse the title and message from the extras
String title = getTitle(context, extras);
String message = getMessage(context, extras);
// if the message is empty, bail
if (message == null)
return;
... | [
"public",
"void",
"showNotification",
"(",
"Context",
"context",
",",
"Bundle",
"extras",
")",
"{",
"// parse the title and message from the extras",
"String",
"title",
"=",
"getTitle",
"(",
"context",
",",
"extras",
")",
";",
"String",
"message",
"=",
"getMessage",... | Shows a notification for the given push message
@param extras the message extras | [
"Shows",
"a",
"notification",
"for",
"the",
"given",
"push",
"message"
] | train | https://github.com/myriadmobile/shove/blob/71ab329cdbaef5bdc2b75e43af1393308c4c1eed/library/src/main/java/com/myriadmobile/library/shove/SimpleNotificationDelegate.java#L95-L118 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java | vpnnexthopserver.get | public static vpnnexthopserver get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch vpnnexthopserver resource of given name .
"""
vpnnexthopserver obj = new vpnnexthopserver();
obj.set_name(name);
vpnnexthopserver response = (vpnnexthopserver) obj.get_resource(service);
... | java | public static vpnnexthopserver get(nitro_service service, String name) throws Exception{
vpnnexthopserver obj = new vpnnexthopserver();
obj.set_name(name);
vpnnexthopserver response = (vpnnexthopserver) obj.get_resource(service);
return response;
} | [
"public",
"static",
"vpnnexthopserver",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"vpnnexthopserver",
"obj",
"=",
"new",
"vpnnexthopserver",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"... | Use this API to fetch vpnnexthopserver resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnnexthopserver",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnnexthopserver.java#L256-L261 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.