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 |
|---|---|---|---|---|---|---|---|---|---|---|
rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java | HttpRequestHandler.checkAccess | public void checkAccess(String pHost, String pAddress, String pOrigin) {
"""
Check whether the given host and/or address is allowed to access this agent.
@param pHost host to check
@param pAddress address to check
@param pOrigin (optional) origin header to check also.
"""
if (!backendManager.isRem... | java | public void checkAccess(String pHost, String pAddress, String pOrigin) {
if (!backendManager.isRemoteAccessAllowed(pHost, pAddress)) {
throw new SecurityException("No access from client " + pAddress + " allowed");
}
if (!backendManager.isOriginAllowed(pOrigin,true)) {
thr... | [
"public",
"void",
"checkAccess",
"(",
"String",
"pHost",
",",
"String",
"pAddress",
",",
"String",
"pOrigin",
")",
"{",
"if",
"(",
"!",
"backendManager",
".",
"isRemoteAccessAllowed",
"(",
"pHost",
",",
"pAddress",
")",
")",
"{",
"throw",
"new",
"SecurityExc... | Check whether the given host and/or address is allowed to access this agent.
@param pHost host to check
@param pAddress address to check
@param pOrigin (optional) origin header to check also. | [
"Check",
"whether",
"the",
"given",
"host",
"and",
"/",
"or",
"address",
"is",
"allowed",
"to",
"access",
"this",
"agent",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L282-L289 |
astrapi69/jaulp-wicket | jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/BaseModalWindow.java | BaseModalWindow.newContent | protected Component newContent(final String contentId, final IModel<T> model) {
"""
Factory method for create the new {@link Component} for the content. This method is invoked
in the constructor from the derived classes and can be overridden so users can provide their
own version of a new {@link Component} for t... | java | protected Component newContent(final String contentId, final IModel<T> model)
{
return new BaseModalPanel<T>(contentId, model)
{
/**
* The serialVersionUID.
*/
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected void onCancel(fina... | [
"protected",
"Component",
"newContent",
"(",
"final",
"String",
"contentId",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"return",
"new",
"BaseModalPanel",
"<",
"T",
">",
"(",
"contentId",
",",
"model",
")",
"{",
"/**\r\n\t\t\t * The serialVersio... | Factory method for create the new {@link Component} for the content. This method is invoked
in the constructor from the derived classes and can be overridden so users can provide their
own version of a new {@link Component} for the content.
@param contentId
the content id
@param model
the model
@return the new {@link ... | [
"Factory",
"method",
"for",
"create",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"content",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"u... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/BaseModalWindow.java#L97-L124 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/bodyanalysis/AipBodyAnalysis.java | AipBodyAnalysis.bodyAnalysis | public JSONObject bodyAnalysis(byte[] image, HashMap<String, String> options) {
"""
人体关键点识别接口
对于输入的一张图片(可正常解码,且长宽比适宜),**检测图片中的所有人体,输出每个人体的14个主要关键点,包含四肢、脖颈、鼻子等部位,以及人体的坐标信息和数量**。
@param image - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject
"""
AipRequ... | java | public JSONObject bodyAnalysis(byte[] image, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
String base64Content = Base64Util.encode(image);
request.addBody("image", base64Content);
if (options != null) {
requ... | [
"public",
"JSONObject",
"bodyAnalysis",
"(",
"byte",
"[",
"]",
"image",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"S... | 人体关键点识别接口
对于输入的一张图片(可正常解码,且长宽比适宜),**检测图片中的所有人体,输出每个人体的14个主要关键点,包含四肢、脖颈、鼻子等部位,以及人体的坐标信息和数量**。
@param image - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"人体关键点识别接口",
"对于输入的一张图片(可正常解码,且长宽比适宜),",
"**",
"检测图片中的所有人体,输出每个人体的14个主要关键点,包含四肢、脖颈、鼻子等部位,以及人体的坐标信息和数量",
"**",
"。"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/bodyanalysis/AipBodyAnalysis.java#L48-L60 |
apache/incubator-gobblin | gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClient.java | ConfigClient.getImports | public Collection<URI> getImports(URI configKeyUri, boolean recursive)
throws ConfigStoreFactoryDoesNotExistsException, ConfigStoreCreationException, VersionDoesNotExistException {
"""
Get the import links of the input URI.
@param configKeyUri - The URI for the configuration key.
@param recursive - Sp... | java | public Collection<URI> getImports(URI configKeyUri, boolean recursive)
throws ConfigStoreFactoryDoesNotExistsException, ConfigStoreCreationException, VersionDoesNotExistException {
return getImports(configKeyUri, recursive, Optional.<Config>absent());
} | [
"public",
"Collection",
"<",
"URI",
">",
"getImports",
"(",
"URI",
"configKeyUri",
",",
"boolean",
"recursive",
")",
"throws",
"ConfigStoreFactoryDoesNotExistsException",
",",
"ConfigStoreCreationException",
",",
"VersionDoesNotExistException",
"{",
"return",
"getImports",
... | Get the import links of the input URI.
@param configKeyUri - The URI for the configuration key.
@param recursive - Specify whether to get direct import links or recursively import links
@return the import links of the input URI.
@throws ConfigStoreFactoryDoesNotExistsException: if missing scheme name or the schem... | [
"Get",
"the",
"import",
"links",
"of",
"the",
"input",
"URI",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-client/src/main/java/org/apache/gobblin/config/client/ConfigClient.java#L222-L225 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/databasetype/SybaseDatabaseType.java | SybaseDatabaseType.getTableColumnInfo | public TableColumnInfo getTableColumnInfo(Connection connection, String schema, String table) throws SQLException {
"""
<p>Overridden to create the table metadata by hand rather than using the JDBC
<code>DatabaseMetadata.getColumns()</code> method. This is because the Sybase driver fails
when the connection is a... | java | public TableColumnInfo getTableColumnInfo(Connection connection, String schema, String table) throws SQLException
{
if (schema == null || schema.length() == 0)
{
schema = connection.getCatalog();
}
PreparedStatement stmt = connection.prepareStatement("SELECT name,co... | [
"public",
"TableColumnInfo",
"getTableColumnInfo",
"(",
"Connection",
"connection",
",",
"String",
"schema",
",",
"String",
"table",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"schema",
"==",
"null",
"||",
"schema",
".",
"length",
"(",
")",
"==",
"0",
")... | <p>Overridden to create the table metadata by hand rather than using the JDBC
<code>DatabaseMetadata.getColumns()</code> method. This is because the Sybase driver fails
when the connection is an XA connection unless you allow transactional DDL in tempdb.</p> | [
"<p",
">",
"Overridden",
"to",
"create",
"the",
"table",
"metadata",
"by",
"hand",
"rather",
"than",
"using",
"the",
"JDBC",
"<code",
">",
"DatabaseMetadata",
".",
"getColumns",
"()",
"<",
"/",
"code",
">",
"method",
".",
"This",
"is",
"because",
"the",
... | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/databasetype/SybaseDatabaseType.java#L698-L738 |
JOML-CI/JOML | src/org/joml/Vector3i.java | Vector3i.set | public Vector3i set(int index, IntBuffer buffer) {
"""
Read this vector from the supplied {@link IntBuffer} starting at the
specified absolute buffer position/index.
<p>
This method will not increment the position of the given IntBuffer.
@param index
the absolute position into the IntBuffer
@param buffer
... | java | public Vector3i set(int index, IntBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector3i",
"set",
"(",
"int",
"index",
",",
"IntBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link IntBuffer} starting at the
specified absolute buffer position/index.
<p>
This method will not increment the position of the given IntBuffer.
@param index
the absolute position into the IntBuffer
@param buffer
values will be read in <code>x, y, z</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"IntBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector3i.java#L363-L366 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/MjdbcFactory.java | MjdbcFactory.createDataSource | public static DataSource createDataSource(String url, String userName, String password) throws SQLException {
"""
Returns new Pooled {@link DataSource} implementation
<p/>
In case this function won't work - use {@link #createDataSource(java.util.Properties)}
@param url Database connection url
@param use... | java | public static DataSource createDataSource(String url, String userName, String password) throws SQLException {
try {
return MjdbcPoolBinder.createDataSource(url, userName, password);
} catch (NoClassDefFoundError ex) {
throw new NoClassDefFoundError(ERROR_COULDNT_FIND_POOL_PROVIDE... | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"String",
"url",
",",
"String",
"userName",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"return",
"MjdbcPoolBinder",
".",
"createDataSource",
"(",
"url",
",",
"userName",
"... | Returns new Pooled {@link DataSource} implementation
<p/>
In case this function won't work - use {@link #createDataSource(java.util.Properties)}
@param url Database connection url
@param userName Database user name
@param password Database user password
@return new Pooled {@link DataSource} implementation
@throws... | [
"Returns",
"new",
"Pooled",
"{",
"@link",
"DataSource",
"}",
"implementation",
"<p",
"/",
">",
"In",
"case",
"this",
"function",
"won",
"t",
"work",
"-",
"use",
"{",
"@link",
"#createDataSource",
"(",
"java",
".",
"util",
".",
"Properties",
")",
"}"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/MjdbcFactory.java#L160-L166 |
roboconf/roboconf-platform | core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/extensions/MessagingContext.java | MessagingContext.forImportedVariables | public static Collection<MessagingContext> forImportedVariables(
String domain,
String applicationName,
Instance instance,
ThoseThat thoseThat ) {
"""
Builds a list of messaging contexts.
@param domain the domain
@param applicationName the name of the agent's application
@param instance the current ... | java | public static Collection<MessagingContext> forImportedVariables(
String domain,
String applicationName,
Instance instance,
ThoseThat thoseThat ) {
Map<String,MessagingContext> result = new HashMap<> ();
for( ImportedVariable var : ComponentHelpers.findAllImportedVariables( instance.getComponent()).valu... | [
"public",
"static",
"Collection",
"<",
"MessagingContext",
">",
"forImportedVariables",
"(",
"String",
"domain",
",",
"String",
"applicationName",
",",
"Instance",
"instance",
",",
"ThoseThat",
"thoseThat",
")",
"{",
"Map",
"<",
"String",
",",
"MessagingContext",
... | Builds a list of messaging contexts.
@param domain the domain
@param applicationName the name of the agent's application
@param instance the current instance
@param thoseThat whether we target "those that import" or "those that export"
@return a non-null list | [
"Builds",
"a",
"list",
"of",
"messaging",
"contexts",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/extensions/MessagingContext.java#L236-L255 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authorization.jacc.web/src/com/ibm/ws/security/authorization/jacc/web/impl/URLMap.java | URLMap.getUserDataMap | public Map<String, MethodConstraint> getUserDataMap(int table) {
"""
to get entries with user data constraint is set as NONE, use getUserDataMapNone method
"""
if (tc.isDebugEnabled())
Tr.debug(tc, "Getting user data map of which attribute is either confidential or integral");
retur... | java | public Map<String, MethodConstraint> getUserDataMap(int table) {
if (tc.isDebugEnabled())
Tr.debug(tc, "Getting user data map of which attribute is either confidential or integral");
return getMethodSet(table, UD_CONFIDENTIAL_OR_INTEGRAL_NO_EX_CHECK);
} | [
"public",
"Map",
"<",
"String",
",",
"MethodConstraint",
">",
"getUserDataMap",
"(",
"int",
"table",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Getting user data map of which attribute is either confid... | to get entries with user data constraint is set as NONE, use getUserDataMapNone method | [
"to",
"get",
"entries",
"with",
"user",
"data",
"constraint",
"is",
"set",
"as",
"NONE",
"use",
"getUserDataMapNone",
"method"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authorization.jacc.web/src/com/ibm/ws/security/authorization/jacc/web/impl/URLMap.java#L1103-L1107 |
micronaut-projects/micronaut-core | http-client/src/main/java/io/micronaut/http/client/multipart/AbstractFilePart.java | AbstractFilePart.getData | @Override
InterfaceHttpData getData(HttpRequest request, HttpDataFactory factory) {
"""
Create an object of {@link InterfaceHttpData} to build Netty multipart request.
@see Part#getData(HttpRequest, HttpDataFactory)
"""
MediaType mediaType = contentType;
String contentType = mediaType.to... | java | @Override
InterfaceHttpData getData(HttpRequest request, HttpDataFactory factory) {
MediaType mediaType = contentType;
String contentType = mediaType.toString();
String encoding = mediaType.isTextBased() ? null : "binary";
Charset charset = mediaType.getCharset().orElse(null);
... | [
"@",
"Override",
"InterfaceHttpData",
"getData",
"(",
"HttpRequest",
"request",
",",
"HttpDataFactory",
"factory",
")",
"{",
"MediaType",
"mediaType",
"=",
"contentType",
";",
"String",
"contentType",
"=",
"mediaType",
".",
"toString",
"(",
")",
";",
"String",
"... | Create an object of {@link InterfaceHttpData} to build Netty multipart request.
@see Part#getData(HttpRequest, HttpDataFactory) | [
"Create",
"an",
"object",
"of",
"{",
"@link",
"InterfaceHttpData",
"}",
"to",
"build",
"Netty",
"multipart",
"request",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-client/src/main/java/io/micronaut/http/client/multipart/AbstractFilePart.java#L78-L92 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/FunctionExtensions.java | FunctionExtensions.curry | @Pure
public static <P1, P2, P3, RESULT> Function2<P2, P3, RESULT> curry(final Function3<? super P1, ? super P2, ? super P3, ? extends RESULT> function,
final P1 argument) {
"""
Curries a function that takes three arguments.
@param function
the original function. May not be <code>null</code>.
@param argum... | java | @Pure
public static <P1, P2, P3, RESULT> Function2<P2, P3, RESULT> curry(final Function3<? super P1, ? super P2, ? super P3, ? extends RESULT> function,
final P1 argument) {
if (function == null)
throw new NullPointerException("function");
return new Function2<P2, P3, RESULT>() {
@Override
public RESUL... | [
"@",
"Pure",
"public",
"static",
"<",
"P1",
",",
"P2",
",",
"P3",
",",
"RESULT",
">",
"Function2",
"<",
"P2",
",",
"P3",
",",
"RESULT",
">",
"curry",
"(",
"final",
"Function3",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"super",
... | Curries a function that takes three arguments.
@param function
the original function. May not be <code>null</code>.
@param argument
the fixed first argument of {@code function}.
@return a function that takes two arguments. Never <code>null</code>. | [
"Curries",
"a",
"function",
"that",
"takes",
"three",
"arguments",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/FunctionExtensions.java#L82-L93 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.generateRequest | @Deprecated
public Future<Response> generateRequest(String requestType, boolean secure, String endPoint, String data, String type, String codeBase64) throws Exception {
"""
Generates the request based on the type of request, the end point, the data and type passed
@param requestType type of request to be se... | java | @Deprecated
public Future<Response> generateRequest(String requestType, boolean secure, String endPoint, String data, String type, String codeBase64) throws Exception {
return generateRequest(requestType, false, null, null, endPoint, data, type, "");
} | [
"@",
"Deprecated",
"public",
"Future",
"<",
"Response",
">",
"generateRequest",
"(",
"String",
"requestType",
",",
"boolean",
"secure",
",",
"String",
"endPoint",
",",
"String",
"data",
",",
"String",
"type",
",",
"String",
"codeBase64",
")",
"throws",
"Except... | Generates the request based on the type of request, the end point, the data and type passed
@param requestType type of request to be sent
@param secure type of protocol
@param endPoint end point to sent the request to
@param data to be sent for PUT/POST requests
@param type type of data to be sen... | [
"Generates",
"the",
"request",
"based",
"on",
"the",
"type",
"of",
"request",
"the",
"end",
"point",
"the",
"data",
"and",
"type",
"passed"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1340-L1343 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/block/component/WallComponent.java | WallComponent.isCorner | public static boolean isCorner(IBlockAccess world, BlockPos pos) {
"""
Gets whether the wall is a corner or not.
@param world the world
@param pos the pos
@return the EnumFacing, null if the block is not {@link DirectionalComponent}
"""
return world != null && pos != null ? isCorner(world.getBlockState(... | java | public static boolean isCorner(IBlockAccess world, BlockPos pos)
{
return world != null && pos != null ? isCorner(world.getBlockState(pos)) : false;
} | [
"public",
"static",
"boolean",
"isCorner",
"(",
"IBlockAccess",
"world",
",",
"BlockPos",
"pos",
")",
"{",
"return",
"world",
"!=",
"null",
"&&",
"pos",
"!=",
"null",
"?",
"isCorner",
"(",
"world",
".",
"getBlockState",
"(",
"pos",
")",
")",
":",
"false"... | Gets whether the wall is a corner or not.
@param world the world
@param pos the pos
@return the EnumFacing, null if the block is not {@link DirectionalComponent} | [
"Gets",
"whether",
"the",
"wall",
"is",
"a",
"corner",
"or",
"not",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/block/component/WallComponent.java#L264-L267 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/config/PropertyConfigLoader.java | PropertyConfigLoader.loadProperty | private static void loadProperty(String filePath) {
"""
Load property file.
@param filePath property file path in classpath
"""
try (InputStream propertyStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(
filePath);
Reader propertyReader = new... | java | private static void loadProperty(String filePath)
{
try (InputStream propertyStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(
filePath);
Reader propertyReader = new InputStreamReader(propertyStream, DEFAULT_CHARSET);)
{
Properti... | [
"private",
"static",
"void",
"loadProperty",
"(",
"String",
"filePath",
")",
"{",
"try",
"(",
"InputStream",
"propertyStream",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
".",
"getResourceAsStream",
"(",
"filePath",
")"... | Load property file.
@param filePath property file path in classpath | [
"Load",
"property",
"file",
"."
] | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/config/PropertyConfigLoader.java#L77-L92 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/appstore/googleUtils/Security.java | Security.verifyPurchase | public static boolean verifyPurchase(@NotNull String base64PublicKey, @NotNull String signedData, @NotNull String signature) {
"""
Verifies that the data was signed with the given signature, and returns
the verified purchase. The data is in JSON format and signed
with a private key. The data also contains the {@... | java | public static boolean verifyPurchase(@NotNull String base64PublicKey, @NotNull String signedData, @NotNull String signature) {
if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey)
|| TextUtils.isEmpty(signature)) {
Logger.e("Purchase verification failed: missing da... | [
"public",
"static",
"boolean",
"verifyPurchase",
"(",
"@",
"NotNull",
"String",
"base64PublicKey",
",",
"@",
"NotNull",
"String",
"signedData",
",",
"@",
"NotNull",
"String",
"signature",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"signedData",
")"... | Verifies that the data was signed with the given signature, and returns
the verified purchase. The data is in JSON format and signed
with a private key. The data also contains the {@link com.amazon.inapp.purchasing.PurchaseResponse.PurchaseRequestStatus}
and product ID of the purchase.
@param base64PublicKey the base6... | [
"Verifies",
"that",
"the",
"data",
"was",
"signed",
"with",
"the",
"given",
"signature",
"and",
"returns",
"the",
"verified",
"purchase",
".",
"The",
"data",
"is",
"in",
"JSON",
"format",
"and",
"signed",
"with",
"a",
"private",
"key",
".",
"The",
"data",
... | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/googleUtils/Security.java#L57-L66 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/cache/cache_stats.java | cache_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
"""
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre>
"""
cache_stats[] resources = new cache_stats[1];
cache_response result = (cache_response) serv... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
cache_stats[] resources = new cache_stats[1];
cache_response result = (cache_response) service.get_payload_formatter().string_to_resource(cache_response.class, response);
if(result.errorcode != 0) {
if (resu... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"cache_stats",
"[",
"]",
"resources",
"=",
"new",
"cache_stats",
"[",
"1",
"]",
";",
"cache_response",
"res... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/cache/cache_stats.java#L887-L906 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java | AsyncMutateInBuilder.arrayPrependAll | public <T> AsyncMutateInBuilder arrayPrependAll(String path, Collection<T> values, SubdocOptionsBuilder optionsBuilder) {
"""
Prepend multiple values at once in an existing array, pushing all values in the collection's iteration order to
the front/start of the array.
First value becomes the first element of th... | java | public <T> AsyncMutateInBuilder arrayPrependAll(String path, Collection<T> values, SubdocOptionsBuilder optionsBuilder) {
this.mutationSpecs.add(new MutationSpec(Mutation.ARRAY_PUSH_FIRST, path, new MultiValue<T>(values), optionsBuilder));
return this;
} | [
"public",
"<",
"T",
">",
"AsyncMutateInBuilder",
"arrayPrependAll",
"(",
"String",
"path",
",",
"Collection",
"<",
"T",
">",
"values",
",",
"SubdocOptionsBuilder",
"optionsBuilder",
")",
"{",
"this",
".",
"mutationSpecs",
".",
"add",
"(",
"new",
"MutationSpec",
... | Prepend multiple values at once in an existing array, pushing all values in the collection's iteration order to
the front/start of the array.
First value becomes the first element of the array, second value the second, etc... All existing values
are shifted right in the array, by the number of inserted elements.
Each... | [
"Prepend",
"multiple",
"values",
"at",
"once",
"in",
"an",
"existing",
"array",
"pushing",
"all",
"values",
"in",
"the",
"collection",
"s",
"iteration",
"order",
"to",
"the",
"front",
"/",
"start",
"of",
"the",
"array",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java#L933-L936 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java | PlatformBitmapFactory.createBitmap | public CloseableReference<Bitmap> createBitmap(
DisplayMetrics display,
int width,
int height,
Bitmap.Config config,
@Nullable Object callerContext) {
"""
Creates a bitmap with the specified width and height. Its
initial density is determined from the given DisplayMetrics.
@param... | java | public CloseableReference<Bitmap> createBitmap(
DisplayMetrics display,
int width,
int height,
Bitmap.Config config,
@Nullable Object callerContext) {
return createBitmap(display, width, height, config, true, callerContext);
} | [
"public",
"CloseableReference",
"<",
"Bitmap",
">",
"createBitmap",
"(",
"DisplayMetrics",
"display",
",",
"int",
"width",
",",
"int",
"height",
",",
"Bitmap",
".",
"Config",
"config",
",",
"@",
"Nullable",
"Object",
"callerContext",
")",
"{",
"return",
"creat... | Creates a bitmap with the specified width and height. Its
initial density is determined from the given DisplayMetrics.
@param display Display metrics for the display this bitmap will be
drawn on.
@param width The width of the bitmap
@param height The height of the bitmap
@param config The bitmap config to cre... | [
"Creates",
"a",
"bitmap",
"with",
"the",
"specified",
"width",
"and",
"height",
".",
"Its",
"initial",
"density",
"is",
"determined",
"from",
"the",
"given",
"DisplayMetrics",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java#L396-L403 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java | HashCodeBuilder.reflectionHashCode | public static int reflectionHashCode(final Object object, final String... excludeFields) {
"""
<p>
Uses reflection to build a valid hash code from the fields of {@code object}.
</p>
<p>
This constructor uses two hard coded choices for the constants needed to build a hash code.
</p>
<p>
It uses <code>Acc... | java | public static int reflectionHashCode(final Object object, final String... excludeFields) {
return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, false,
null, excludeFields);
} | [
"public",
"static",
"int",
"reflectionHashCode",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"...",
"excludeFields",
")",
"{",
"return",
"reflectionHashCode",
"(",
"DEFAULT_INITIAL_VALUE",
",",
"DEFAULT_MULTIPLIER_VALUE",
",",
"object",
",",
"false",
"... | <p>
Uses reflection to build a valid hash code from the fields of {@code object}.
</p>
<p>
This constructor uses two hard coded choices for the constants needed to build a hash code.
</p>
<p>
It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will
throw a security... | [
"<p",
">",
"Uses",
"reflection",
"to",
"build",
"a",
"valid",
"hash",
"code",
"from",
"the",
"fields",
"of",
"{",
"@code",
"object",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java#L457-L460 |
CenturyLinkCloud/mdw | mdw-workflow/src/com/centurylink/mdw/workflow/adapter/rest/MultiRestServiceAdapter.java | MultiRestServiceAdapter.openConnection | public Object openConnection(String endpointUri) throws ConnectionException {
"""
Returns an HttpConnection based on the configured endpoint, which
includes the resource path. Override for HTTPS or other connection type.
"""
try {
Map<String,String> params = getRequestParameters();
... | java | public Object openConnection(String endpointUri) throws ConnectionException {
try {
Map<String,String> params = getRequestParameters();
if (params != null && !params.isEmpty()) {
StringBuffer query = new StringBuffer();
query.append(endpointUri.indexOf('?'... | [
"public",
"Object",
"openConnection",
"(",
"String",
"endpointUri",
")",
"throws",
"ConnectionException",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"getRequestParameters",
"(",
")",
";",
"if",
"(",
"params",
"!=",
"null",
"&&"... | Returns an HttpConnection based on the configured endpoint, which
includes the resource path. Override for HTTPS or other connection type. | [
"Returns",
"an",
"HttpConnection",
"based",
"on",
"the",
"configured",
"endpoint",
"which",
"includes",
"the",
"resource",
"path",
".",
"Override",
"for",
"HTTPS",
"or",
"other",
"connection",
"type",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/adapter/rest/MultiRestServiceAdapter.java#L49-L80 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java | ThresholdBlock.selectBlockSize | void selectBlockSize( int width , int height , int requestedBlockWidth) {
"""
Selects a block size which is close to the requested block size by the user
"""
if( height < requestedBlockWidth ) {
blockHeight = height;
} else {
int rows = height/requestedBlockWidth;
blockHeight = height/rows;
}
... | java | void selectBlockSize( int width , int height , int requestedBlockWidth) {
if( height < requestedBlockWidth ) {
blockHeight = height;
} else {
int rows = height/requestedBlockWidth;
blockHeight = height/rows;
}
if( width < requestedBlockWidth ) {
blockWidth = width;
} else {
int cols = width/r... | [
"void",
"selectBlockSize",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"requestedBlockWidth",
")",
"{",
"if",
"(",
"height",
"<",
"requestedBlockWidth",
")",
"{",
"blockHeight",
"=",
"height",
";",
"}",
"else",
"{",
"int",
"rows",
"=",
"height",... | Selects a block size which is close to the requested block size by the user | [
"Selects",
"a",
"block",
"size",
"which",
"is",
"close",
"to",
"the",
"requested",
"block",
"size",
"by",
"the",
"user"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/ThresholdBlock.java#L112-L127 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.select | org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement select(final int pos, final int b) {
"""
Look up $16^i r_i B$ in the precomputed table.
<p>
No secret array indices, no secret branching. Constant time.
<p>
Must have previously precomputed.
<p>
Method is package private only so that... | java | org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement select(final int pos, final int b) {
// Is r_i negative?
final int bnegative = Utils.negative(b);
// |r_i|
final int babs = b - (((-bnegative) & b) << 1);
// 16^i |r_i| B
final org.mariadb.jdbc.internal.com.send.authent... | [
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"select",
"(",
"final",
"int",
"pos",
",",
"final",
"int",
"b",
")",
"{",
"// Is r_i negative?",
"final... | Look up $16^i r_i B$ in the precomputed table.
<p>
No secret array indices, no secret branching. Constant time.
<p>
Must have previously precomputed.
<p>
Method is package private only so that tests run.
@param pos $= i/2$ for $i$ in $\{0, 2, 4,..., 62\}$
@param b $= r_i$
@return the GroupElement | [
"Look",
"up",
"$16^i",
"r_i",
"B$",
"in",
"the",
"precomputed",
"table",
".",
"<p",
">",
"No",
"secret",
"array",
"indices",
"no",
"secret",
"branching",
".",
"Constant",
"time",
".",
"<p",
">",
"Must",
"have",
"previously",
"precomputed",
".",
"<p",
">"... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L886-L908 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java | StereoConsistencyCheck.checkRectified | public boolean checkRectified( Point2D_F64 left , Point2D_F64 right ) {
"""
Checks to see if the observations from the left and right camera are consistent. Observations
are assumed to be in the rectified image pixel coordinates.
@param left Left camera observation in rectified pixels
@param right Right came... | java | public boolean checkRectified( Point2D_F64 left , Point2D_F64 right ) {
// rectifications should make them appear along the same y-coordinate/epipolar line
if( Math.abs(left.y - right.y) > toleranceY )
return false;
// features in the right camera should appear left of features in the image image
return rig... | [
"public",
"boolean",
"checkRectified",
"(",
"Point2D_F64",
"left",
",",
"Point2D_F64",
"right",
")",
"{",
"// rectifications should make them appear along the same y-coordinate/epipolar line",
"if",
"(",
"Math",
".",
"abs",
"(",
"left",
".",
"y",
"-",
"right",
".",
"y... | Checks to see if the observations from the left and right camera are consistent. Observations
are assumed to be in the rectified image pixel coordinates.
@param left Left camera observation in rectified pixels
@param right Right camera observation in rectified pixels
@return true for consistent | [
"Checks",
"to",
"see",
"if",
"the",
"observations",
"from",
"the",
"left",
"and",
"right",
"camera",
"are",
"consistent",
".",
"Observations",
"are",
"assumed",
"to",
"be",
"in",
"the",
"rectified",
"image",
"pixel",
"coordinates",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java#L102-L109 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.field2in | public void field2in(Object o, String field, Object to) {
"""
Maps an object's field to a component's In field with the same name
@param o the object
@param field the field name
@param to the component.
"""
field = field.trim();
if (field.indexOf(' ') > 0) { // maybe multiple fie... | java | public void field2in(Object o, String field, Object to) {
field = field.trim();
if (field.indexOf(' ') > 0) { // maybe multiple field names given
String[] fields = field.split("\\s+");
for (String f : fields) {
field2in(o, f, to, f);
}
... | [
"public",
"void",
"field2in",
"(",
"Object",
"o",
",",
"String",
"field",
",",
"Object",
"to",
")",
"{",
"field",
"=",
"field",
".",
"trim",
"(",
")",
";",
"if",
"(",
"field",
".",
"indexOf",
"(",
"'",
"'",
")",
">",
"0",
")",
"{",
"// maybe mult... | Maps an object's field to a component's In field with the same name
@param o the object
@param field the field name
@param to the component. | [
"Maps",
"an",
"object",
"s",
"field",
"to",
"a",
"component",
"s",
"In",
"field",
"with",
"the",
"same",
"name"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L199-L209 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.findVarPath | private VarDef findVarPath( List<VarDef> combinedVars, String varPath) {
"""
Returns the member of the given variable list with the given path.
"""
int i;
for( i = 0;
i < combinedVars.size()
&& !varPath.equals( combinedVars.get(i).getPathName());
i++);
return
i <... | java | private VarDef findVarPath( List<VarDef> combinedVars, String varPath)
{
int i;
for( i = 0;
i < combinedVars.size()
&& !varPath.equals( combinedVars.get(i).getPathName());
i++);
return
i < combinedVars.size()
? combinedVars.get(i)
: null;
} | [
"private",
"VarDef",
"findVarPath",
"(",
"List",
"<",
"VarDef",
">",
"combinedVars",
",",
"String",
"varPath",
")",
"{",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"combinedVars",
".",
"size",
"(",
")",
"&&",
"!",
"varPath",
".",
"e... | Returns the member of the given variable list with the given path. | [
"Returns",
"the",
"member",
"of",
"the",
"given",
"variable",
"list",
"with",
"the",
"given",
"path",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L399-L411 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/cellconverter/OptionalProcessCase.java | OptionalProcessCase.get | public T get(final ProcessCase processCase) {
"""
この{@link OptionalProcessCase}に値が存在する場合は値を返し、それ以外の場合は{@link NoSuchElementException}を返します。
@param processCase 処理ケース
@return この{@link NoSuchElementException}が保持する非null値
@throws NoSuchElementException 存在する値がない場合
"""
if(!isPresent(processCase)) {
... | java | public T get(final ProcessCase processCase) {
if(!isPresent(processCase)) {
throw new NoSuchElementException(String.format("No value present in processCase '%s'.", processCase.name()));
}
return value.get();
} | [
"public",
"T",
"get",
"(",
"final",
"ProcessCase",
"processCase",
")",
"{",
"if",
"(",
"!",
"isPresent",
"(",
"processCase",
")",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
"String",
".",
"format",
"(",
"\"No value present in processCase '%s'.\"",
... | この{@link OptionalProcessCase}に値が存在する場合は値を返し、それ以外の場合は{@link NoSuchElementException}を返します。
@param processCase 処理ケース
@return この{@link NoSuchElementException}が保持する非null値
@throws NoSuchElementException 存在する値がない場合 | [
"この",
"{"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/cellconverter/OptionalProcessCase.java#L85-L92 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostBodyUtil.java | HttpPostBodyUtil.findNonWhitespace | static int findNonWhitespace(String sb, int offset) {
"""
Find the first non whitespace
@return the rank of the first non whitespace
"""
int result;
for (result = offset; result < sb.length(); result ++) {
if (!Character.isWhitespace(sb.charAt(result))) {
break;
... | java | static int findNonWhitespace(String sb, int offset) {
int result;
for (result = offset; result < sb.length(); result ++) {
if (!Character.isWhitespace(sb.charAt(result))) {
break;
}
}
return result;
} | [
"static",
"int",
"findNonWhitespace",
"(",
"String",
"sb",
",",
"int",
"offset",
")",
"{",
"int",
"result",
";",
"for",
"(",
"result",
"=",
"offset",
";",
"result",
"<",
"sb",
".",
"length",
"(",
")",
";",
"result",
"++",
")",
"{",
"if",
"(",
"!",
... | Find the first non whitespace
@return the rank of the first non whitespace | [
"Find",
"the",
"first",
"non",
"whitespace"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostBodyUtil.java#L129-L137 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/spex/SXTag.java | SXTag.addTextNode | public synchronized void addTextNode(String text) throws IOException {
"""
Adds a text child node to this node.
<b>WARNING:</b> This will close the last added child node, if applicable!
@param text Text to be added
"""
// check for non-empty string
if(text == null || text.trim().length() == 0) {
ret... | java | public synchronized void addTextNode(String text) throws IOException {
// check for non-empty string
if(text == null || text.trim().length() == 0) {
return;
}
// reject modification of already closed node
if(isOpen==false) {
throw new IOException("Attempted to add child text node to already closed tag '... | [
"public",
"synchronized",
"void",
"addTextNode",
"(",
"String",
"text",
")",
"throws",
"IOException",
"{",
"// check for non-empty string",
"if",
"(",
"text",
"==",
"null",
"||",
"text",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
... | Adds a text child node to this node.
<b>WARNING:</b> This will close the last added child node, if applicable!
@param text Text to be added | [
"Adds",
"a",
"text",
"child",
"node",
"to",
"this",
"node",
".",
"<b",
">",
"WARNING",
":",
"<",
"/",
"b",
">",
"This",
"will",
"close",
"the",
"last",
"added",
"child",
"node",
"if",
"applicable!"
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/spex/SXTag.java#L169-L190 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/CompareToBuilder.java | CompareToBuilder.reflectionCompare | @GwtIncompatible("incompatible method")
public static int reflectionCompare(final Object lhs, final Object rhs, final Collection<String> excludeFields) {
"""
<p>Compares two <code>Object</code>s via reflection.</p>
<p>Fields can be private, thus <code>AccessibleObject.setAccessible</code>
is used to bypass... | java | @GwtIncompatible("incompatible method")
public static int reflectionCompare(final Object lhs, final Object rhs, final Collection<String> excludeFields) {
return reflectionCompare(lhs, rhs, ReflectionToStringBuilder.toNoNullStringArray(excludeFields));
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"int",
"reflectionCompare",
"(",
"final",
"Object",
"lhs",
",",
"final",
"Object",
"rhs",
",",
"final",
"Collection",
"<",
"String",
">",
"excludeFields",
")",
"{",
"return",
"refle... | <p>Compares two <code>Object</code>s via reflection.</p>
<p>Fields can be private, thus <code>AccessibleObject.setAccessible</code>
is used to bypass normal access control checks. This will fail under a
security manager unless the appropriate permissions are set.</p>
<ul>
<li>Static fields will not be compared</li>
<... | [
"<p",
">",
"Compares",
"two",
"<code",
">",
"Object<",
"/",
"code",
">",
"s",
"via",
"reflection",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/CompareToBuilder.java#L210-L213 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/alias/CmsClientAliasImportResult.java | CmsClientAliasImportResult.getString | protected static String getString(JSONObject json, String key) {
"""
Helper method to get a string value from a JSON object.<p>
@param json the JSON object
@param key the key whose value should be extracted as a string
@return the string value for the given key
"""
JSONValue value = json.get(... | java | protected static String getString(JSONObject json, String key) {
JSONValue value = json.get(key);
JSONString str = value.isString();
if (str == null) {
return null;
}
return str.stringValue();
} | [
"protected",
"static",
"String",
"getString",
"(",
"JSONObject",
"json",
",",
"String",
"key",
")",
"{",
"JSONValue",
"value",
"=",
"json",
".",
"get",
"(",
"key",
")",
";",
"JSONString",
"str",
"=",
"value",
".",
"isString",
"(",
")",
";",
"if",
"(",
... | Helper method to get a string value from a JSON object.<p>
@param json the JSON object
@param key the key whose value should be extracted as a string
@return the string value for the given key | [
"Helper",
"method",
"to",
"get",
"a",
"string",
"value",
"from",
"a",
"JSON",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/alias/CmsClientAliasImportResult.java#L115-L123 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/utils/MaterialUtils.java | MaterialUtils.findIndexPageDocument | public static LocalDocument findIndexPageDocument(Delfoi delfoi, Locale locale) {
"""
Finds delfoi index page document
@param delfoi delfoi
@param locale document locale
@return index page document or null if not defined
"""
String urlName = String.format("%s-%s", INDEX_PAGE_URLNAME, locale.getLanguag... | java | public static LocalDocument findIndexPageDocument(Delfoi delfoi, Locale locale) {
String urlName = String.format("%s-%s", INDEX_PAGE_URLNAME, locale.getLanguage());
return findLocalDocumentByParentAndUrlName(delfoi.getRootFolder(), urlName);
} | [
"public",
"static",
"LocalDocument",
"findIndexPageDocument",
"(",
"Delfoi",
"delfoi",
",",
"Locale",
"locale",
")",
"{",
"String",
"urlName",
"=",
"String",
".",
"format",
"(",
"\"%s-%s\"",
",",
"INDEX_PAGE_URLNAME",
",",
"locale",
".",
"getLanguage",
"(",
")",... | Finds delfoi index page document
@param delfoi delfoi
@param locale document locale
@return index page document or null if not defined | [
"Finds",
"delfoi",
"index",
"page",
"document"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/MaterialUtils.java#L83-L86 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/buffer/BufferUtil.java | BufferUtil.cardinalityInBitmapRange | public static int cardinalityInBitmapRange(LongBuffer bitmap, int start, int end) {
"""
Hamming weight of the bitset in the range
start, start+1,..., end-1
@param bitmap array of words representing a bitset
@param start first index (inclusive)
@param end last index (exclusive)
@return the hamming weight o... | java | public static int cardinalityInBitmapRange(LongBuffer bitmap, int start, int end) {
if (isBackedBySimpleArray(bitmap)) {
return Util.cardinalityInBitmapRange(bitmap.array(), start, end);
}
if (start >= end) {
return 0;
}
int firstword = start / 64;
int endword = (end - 1) / 64;
i... | [
"public",
"static",
"int",
"cardinalityInBitmapRange",
"(",
"LongBuffer",
"bitmap",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"isBackedBySimpleArray",
"(",
"bitmap",
")",
")",
"{",
"return",
"Util",
".",
"cardinalityInBitmapRange",
"(",
"bit... | Hamming weight of the bitset in the range
start, start+1,..., end-1
@param bitmap array of words representing a bitset
@param start first index (inclusive)
@param end last index (exclusive)
@return the hamming weight of the corresponding range | [
"Hamming",
"weight",
"of",
"the",
"bitset",
"in",
"the",
"range",
"start",
"start",
"+",
"1",
"...",
"end",
"-",
"1"
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/buffer/BufferUtil.java#L402-L420 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.findByUUID_G | @Override
public CPInstance findByUUID_G(String uuid, long groupId)
throws 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 groupId the group ID
@return the matc... | java | @Override
public CPInstance findByUUID_G(String uuid, long groupId)
throws NoSuchCPInstanceException {
CPInstance cpInstance = fetchByUUID_G(uuid, groupId);
if (cpInstance == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.append(uui... | [
"@",
"Override",
"public",
"CPInstance",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPInstanceException",
"{",
"CPInstance",
"cpInstance",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"if",
"(",
"cpInstan... | 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-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L663-L689 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java | DefaultFacelet.include | private void include(AbstractFaceletContext ctx, UIComponent parent) throws IOException, FacesException,
FaceletException, ELException {
"""
Given the passed FaceletContext, apply our child FaceletHandlers to the passed parent
@see FaceletHandler#apply(FaceletContext, UIComponent)
@param ctx
the F... | java | private void include(AbstractFaceletContext ctx, UIComponent parent) throws IOException, FacesException,
FaceletException, ELException
{
ctx.pushPageContext(new PageContextImpl());
try
{
this.refresh(parent);
DefaultFaceletContext ctxWrapper = new DefaultF... | [
"private",
"void",
"include",
"(",
"AbstractFaceletContext",
"ctx",
",",
"UIComponent",
"parent",
")",
"throws",
"IOException",
",",
"FacesException",
",",
"FaceletException",
",",
"ELException",
"{",
"ctx",
".",
"pushPageContext",
"(",
"new",
"PageContextImpl",
"("... | Given the passed FaceletContext, apply our child FaceletHandlers to the passed parent
@see FaceletHandler#apply(FaceletContext, UIComponent)
@param ctx
the FaceletContext to use for applying our FaceletHandlers
@param parent
the parent component to apply changes to
@throws IOException
@throws FacesException
@throws Fa... | [
"Given",
"the",
"passed",
"FaceletContext",
"apply",
"our",
"child",
"FaceletHandlers",
"to",
"the",
"passed",
"parent"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java#L517-L534 |
talsma-ict/umldoclet | src/main/java/nl/talsmasoftware/umldoclet/util/UriUtils.java | UriUtils.appendEscapedByte | private static void appendEscapedByte(StringBuilder builder, byte value) {
"""
Appends the byte as percent-encoded hex value (three characters).
@param builder The builder to append to
@param value the type to be appended as percent-encoded
"""
builder.append('%');
builder.append(HEX[(val... | java | private static void appendEscapedByte(StringBuilder builder, byte value) {
builder.append('%');
builder.append(HEX[(value >> 4) & 0x0f]);
builder.append(HEX[value & 0x0f]);
} | [
"private",
"static",
"void",
"appendEscapedByte",
"(",
"StringBuilder",
"builder",
",",
"byte",
"value",
")",
"{",
"builder",
".",
"append",
"(",
"'",
"'",
")",
";",
"builder",
".",
"append",
"(",
"HEX",
"[",
"(",
"value",
">>",
"4",
")",
"&",
"0x0f",
... | Appends the byte as percent-encoded hex value (three characters).
@param builder The builder to append to
@param value the type to be appended as percent-encoded | [
"Appends",
"the",
"byte",
"as",
"percent",
"-",
"encoded",
"hex",
"value",
"(",
"three",
"characters",
")",
"."
] | train | https://github.com/talsma-ict/umldoclet/blob/373b23f2646603fddca4a495e9eccbb4a4491fdf/src/main/java/nl/talsmasoftware/umldoclet/util/UriUtils.java#L118-L122 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/packet/Message.java | Message.addSubject | public Subject addSubject(String language, String subject) {
"""
Adds a subject with a corresponding language.
@param language the language of the subject being added.
@param subject the subject being added to the message.
@return the new {@link org.jivesoftware.smack.packet.Message.Subject}
@throws NullPoin... | java | public Subject addSubject(String language, String subject) {
language = determineLanguage(language);
Subject messageSubject = new Subject(language, subject);
subjects.add(messageSubject);
return messageSubject;
} | [
"public",
"Subject",
"addSubject",
"(",
"String",
"language",
",",
"String",
"subject",
")",
"{",
"language",
"=",
"determineLanguage",
"(",
"language",
")",
";",
"Subject",
"messageSubject",
"=",
"new",
"Subject",
"(",
"language",
",",
"subject",
")",
";",
... | Adds a subject with a corresponding language.
@param language the language of the subject being added.
@param subject the subject being added to the message.
@return the new {@link org.jivesoftware.smack.packet.Message.Subject}
@throws NullPointerException if the subject is null, a null pointer exception is thrown | [
"Adds",
"a",
"subject",
"with",
"a",
"corresponding",
"language",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/packet/Message.java#L237-L242 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/ImgCompressUtils.java | ImgCompressUtils.imgCompressByWH | public static void imgCompressByWH(String srcFile, String desFile, int width, int height, Float quality) {
"""
根据指定宽高和压缩质量进行压缩,如果指定宽或者高大于源图片则按照源图片大小宽高压缩
@param srcFile 指定原图片地址
@param desFile 指定压缩后图片存放地址,包括图片名称
@param width 指定压缩宽
@param height 指定压缩高
@param quality 指定压缩质量,范围[0.0,1.0],如果指定为null则按照默认值
""... | java | public static void imgCompressByWH(String srcFile, String desFile, int width, int height, Float quality) {
ImgCompressUtils.imgCompressByWH(srcFile, desFile, width, height, quality, false);
} | [
"public",
"static",
"void",
"imgCompressByWH",
"(",
"String",
"srcFile",
",",
"String",
"desFile",
",",
"int",
"width",
",",
"int",
"height",
",",
"Float",
"quality",
")",
"{",
"ImgCompressUtils",
".",
"imgCompressByWH",
"(",
"srcFile",
",",
"desFile",
",",
... | 根据指定宽高和压缩质量进行压缩,如果指定宽或者高大于源图片则按照源图片大小宽高压缩
@param srcFile 指定原图片地址
@param desFile 指定压缩后图片存放地址,包括图片名称
@param width 指定压缩宽
@param height 指定压缩高
@param quality 指定压缩质量,范围[0.0,1.0],如果指定为null则按照默认值 | [
"根据指定宽高和压缩质量进行压缩,如果指定宽或者高大于源图片则按照源图片大小宽高压缩"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/ImgCompressUtils.java#L37-L39 |
mlk/AssortmentOfJUnitRules | src/main/java/com/github/mlk/junit/rules/HadoopDFSRule.java | HadoopDFSRule.copyResource | public void copyResource(String filename, String resource) throws IOException {
"""
Copies the content of the given resource into Hadoop.
@param filename File to be created
@param resource Resource to copy
@throws IOException Anything
"""
write(filename, IOUtils.toByteArray(getClass().getResource(reso... | java | public void copyResource(String filename, String resource) throws IOException {
write(filename, IOUtils.toByteArray(getClass().getResource(resource)));
} | [
"public",
"void",
"copyResource",
"(",
"String",
"filename",
",",
"String",
"resource",
")",
"throws",
"IOException",
"{",
"write",
"(",
"filename",
",",
"IOUtils",
".",
"toByteArray",
"(",
"getClass",
"(",
")",
".",
"getResource",
"(",
"resource",
")",
")",... | Copies the content of the given resource into Hadoop.
@param filename File to be created
@param resource Resource to copy
@throws IOException Anything | [
"Copies",
"the",
"content",
"of",
"the",
"given",
"resource",
"into",
"Hadoop",
"."
] | train | https://github.com/mlk/AssortmentOfJUnitRules/blob/e3ab4f77419c6a009949f0b1c6e58f516dc29d64/src/main/java/com/github/mlk/junit/rules/HadoopDFSRule.java#L81-L83 |
SG-O/miIO | src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java | Vacuum.setDoNotDisturb | public boolean setDoNotDisturb(VacuumDoNotDisturb dnd) throws CommandExecutionException {
"""
Set the do not disturb timer.
@param dnd The new settings to set.
@return True if the command was received successfully.
@throws CommandExecutionException When there has been a error during the communication or the res... | java | public boolean setDoNotDisturb(VacuumDoNotDisturb dnd) throws CommandExecutionException {
if (dnd == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
return sendOk("set_dnd_timer", dnd.construct());
} | [
"public",
"boolean",
"setDoNotDisturb",
"(",
"VacuumDoNotDisturb",
"dnd",
")",
"throws",
"CommandExecutionException",
"{",
"if",
"(",
"dnd",
"==",
"null",
")",
"throw",
"new",
"CommandExecutionException",
"(",
"CommandExecutionException",
".",
"Error",
".",
"INVALID_P... | Set the do not disturb timer.
@param dnd The new settings to set.
@return True if the command was received successfully.
@throws CommandExecutionException When there has been a error during the communication or the response was invalid. | [
"Set",
"the",
"do",
"not",
"disturb",
"timer",
"."
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java#L257-L260 |
phax/ph-oton | ph-oton-security/src/main/java/com/helger/photon/security/login/LoggedInUserManager.java | LoggedInUserManager.loginUser | @Nonnull
public ELoginResult loginUser (@Nullable final String sLoginName, @Nullable final String sPlainTextPassword) {
"""
Login the passed user without much ado.
@param sLoginName
Login name of the user to log-in. May be <code>null</code>.
@param sPlainTextPassword
Plain text password to use. May be <cod... | java | @Nonnull
public ELoginResult loginUser (@Nullable final String sLoginName, @Nullable final String sPlainTextPassword)
{
return loginUser (sLoginName, sPlainTextPassword, (Iterable <String>) null);
} | [
"@",
"Nonnull",
"public",
"ELoginResult",
"loginUser",
"(",
"@",
"Nullable",
"final",
"String",
"sLoginName",
",",
"@",
"Nullable",
"final",
"String",
"sPlainTextPassword",
")",
"{",
"return",
"loginUser",
"(",
"sLoginName",
",",
"sPlainTextPassword",
",",
"(",
... | Login the passed user without much ado.
@param sLoginName
Login name of the user to log-in. May be <code>null</code>.
@param sPlainTextPassword
Plain text password to use. May be <code>null</code>.
@return Never <code>null</code> login status. | [
"Login",
"the",
"passed",
"user",
"without",
"much",
"ado",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/login/LoggedInUserManager.java#L316-L320 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.translateLocal | public Matrix4f translateLocal(float x, float y, float z) {
"""
Pre-multiply a translation to this matrix by translating by the given number of
units in x, y and z.
<p>
If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation
matrix, then the new matrix will be <code>T * M</code>. So wh... | java | public Matrix4f translateLocal(float x, float y, float z) {
return translateLocal(x, y, z, thisOrNew());
} | [
"public",
"Matrix4f",
"translateLocal",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"return",
"translateLocal",
"(",
"x",
",",
"y",
",",
"z",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Pre-multiply a translation to this matrix by translating by the given number of
units in x, y and z.
<p>
If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation
matrix, then the new matrix will be <code>T * M</code>. So when
transforming a vector <code>v</code> with the new matrix by using
<cod... | [
"Pre",
"-",
"multiply",
"a",
"translation",
"to",
"this",
"matrix",
"by",
"translating",
"by",
"the",
"given",
"number",
"of",
"units",
"in",
"x",
"y",
"and",
"z",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
"/",
"code",
">",
"is",
"<code",
">",
"thi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L6762-L6764 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/CuriTemplate.java | CuriTemplate.matchingCuriTemplateFor | public static Optional<CuriTemplate> matchingCuriTemplateFor(final List<Link> curies, final String rel) {
"""
Returns an optional CuriTemplate that is {@link #isMatching matching} the rel parameter, or empty if no matching CURI is found.
<p>
Example:
</p>
<pre><code>
List<Link> curies = asList(
Link.... | java | public static Optional<CuriTemplate> matchingCuriTemplateFor(final List<Link> curies, final String rel) {
return curies
.stream()
.map(CuriTemplate::curiTemplateFor)
.filter(t->t.isMatching(rel))
.findAny();
} | [
"public",
"static",
"Optional",
"<",
"CuriTemplate",
">",
"matchingCuriTemplateFor",
"(",
"final",
"List",
"<",
"Link",
">",
"curies",
",",
"final",
"String",
"rel",
")",
"{",
"return",
"curies",
".",
"stream",
"(",
")",
".",
"map",
"(",
"CuriTemplate",
":... | Returns an optional CuriTemplate that is {@link #isMatching matching} the rel parameter, or empty if no matching CURI is found.
<p>
Example:
</p>
<pre><code>
List<Link> curies = asList(
Link.curi("x", "http://example.org/rels/{rel}"),
Link.curi("y", "http://example.com/link-relations/{rel}")
);
String rel = "y:e... | [
"Returns",
"an",
"optional",
"CuriTemplate",
"that",
"is",
"{",
"@link",
"#isMatching",
"matching",
"}",
"the",
"rel",
"parameter",
"or",
"empty",
"if",
"no",
"matching",
"CURI",
"is",
"found",
"."
] | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/CuriTemplate.java#L137-L143 |
undertow-io/undertow | core/src/main/java/io/undertow/predicate/PredicatesHandler.java | PredicatesHandler.addPredicatedHandler | public PredicatesHandler addPredicatedHandler(final Predicate predicate, final HandlerWrapper handlerWrapper) {
"""
Adds a new predicated handler.
<p>
@param predicate
@param handlerWrapper
"""
this.addPredicatedHandler(predicate, handlerWrapper, null);
return this;
} | java | public PredicatesHandler addPredicatedHandler(final Predicate predicate, final HandlerWrapper handlerWrapper) {
this.addPredicatedHandler(predicate, handlerWrapper, null);
return this;
} | [
"public",
"PredicatesHandler",
"addPredicatedHandler",
"(",
"final",
"Predicate",
"predicate",
",",
"final",
"HandlerWrapper",
"handlerWrapper",
")",
"{",
"this",
".",
"addPredicatedHandler",
"(",
"predicate",
",",
"handlerWrapper",
",",
"null",
")",
";",
"return",
... | Adds a new predicated handler.
<p>
@param predicate
@param handlerWrapper | [
"Adds",
"a",
"new",
"predicated",
"handler",
".",
"<p",
">"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/predicate/PredicatesHandler.java#L142-L145 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.createTagString | static String createTagString(String lang, String script, String region, String trailing) {
"""
Create a tag string from the supplied parameters. The lang, script and region
parameters may be null references.If the lang parameter is an empty string, the
default value for an unknown language is written to the ou... | java | static String createTagString(String lang, String script, String region, String trailing) {
return createTagString(lang, script, region, trailing, null);
} | [
"static",
"String",
"createTagString",
"(",
"String",
"lang",
",",
"String",
"script",
",",
"String",
"region",
",",
"String",
"trailing",
")",
"{",
"return",
"createTagString",
"(",
"lang",
",",
"script",
",",
"region",
",",
"trailing",
",",
"null",
")",
... | Create a tag string from the supplied parameters. The lang, script and region
parameters may be null references.If the lang parameter is an empty string, the
default value for an unknown language is written to the output buffer.
@param lang The language tag to use.
@param script The script tag to use.
@param region T... | [
"Create",
"a",
"tag",
"string",
"from",
"the",
"supplied",
"parameters",
".",
"The",
"lang",
"script",
"and",
"region",
"parameters",
"may",
"be",
"null",
"references",
".",
"If",
"the",
"lang",
"parameter",
"is",
"an",
"empty",
"string",
"the",
"default",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L2766-L2768 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java | AbstractTagLibrary.addValidator | protected final void addValidator(String name, String validatorId, Class<? extends TagHandler> type) {
"""
Add a ValidateHandler for the specified validatorId
@see javax.faces.view.facelets.ValidatorHandler
@see javax.faces.view.facelets.ValidatorConfig
@see javax.faces.application.Application#createValidator... | java | protected final void addValidator(String name, String validatorId, Class<? extends TagHandler> type)
{
_factories.put(name, new UserValidatorHandlerFactory(validatorId, type));
} | [
"protected",
"final",
"void",
"addValidator",
"(",
"String",
"name",
",",
"String",
"validatorId",
",",
"Class",
"<",
"?",
"extends",
"TagHandler",
">",
"type",
")",
"{",
"_factories",
".",
"put",
"(",
"name",
",",
"new",
"UserValidatorHandlerFactory",
"(",
... | Add a ValidateHandler for the specified validatorId
@see javax.faces.view.facelets.ValidatorHandler
@see javax.faces.view.facelets.ValidatorConfig
@see javax.faces.application.Application#createValidator(java.lang.String)
@param name
name to use, "foo" would be <my:foo />
@param validatorId
id to pass to Applicatio... | [
"Add",
"a",
"ValidateHandler",
"for",
"the",
"specified",
"validatorId"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java#L248-L251 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/BookKeeperJournalManager.java | BookKeeperJournalManager.prepareBookKeeperEnv | @VisibleForTesting
public static void prepareBookKeeperEnv(final String availablePath,
ZooKeeper zooKeeper) throws IOException {
"""
Create parent ZNode under which available BookKeeper bookie servers will
register themselves. Will create parent ZNodes for that path as well.
@see ZkUtils#createFullPathOp... | java | @VisibleForTesting
public static void prepareBookKeeperEnv(final String availablePath,
ZooKeeper zooKeeper) throws IOException {
final CountDownLatch availablePathLatch = new CountDownLatch(1);
StringCallback cb = new StringCallback() {
@Override
public void processResult(int rc, String pat... | [
"@",
"VisibleForTesting",
"public",
"static",
"void",
"prepareBookKeeperEnv",
"(",
"final",
"String",
"availablePath",
",",
"ZooKeeper",
"zooKeeper",
")",
"throws",
"IOException",
"{",
"final",
"CountDownLatch",
"availablePathLatch",
"=",
"new",
"CountDownLatch",
"(",
... | Create parent ZNode under which available BookKeeper bookie servers will
register themselves. Will create parent ZNodes for that path as well.
@see ZkUtils#createFullPathOptimistic(ZooKeeper, String, byte[], List, CreateMode, StringCallback, Object)
@param availablePath Full ZooKeeper path for bookies to register
thems... | [
"Create",
"parent",
"ZNode",
"under",
"which",
"available",
"BookKeeper",
"bookie",
"servers",
"will",
"register",
"themselves",
".",
"Will",
"create",
"parent",
"ZNodes",
"for",
"that",
"path",
"as",
"well",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/bookkeeper/BookKeeperJournalManager.java#L212-L243 |
gpein/jcache-jee7 | src/main/java/io/github/gpein/jcache/service/JCacheService.java | JCacheService.setStatistics | public void setStatistics(boolean enabled) {
"""
Enable or disable statistics for all caches
@param enabled true for enabling all
"""
all().forEach(cache -> updateStatistics(cache.getName(), new Cache(false, enabled)));
} | java | public void setStatistics(boolean enabled) {
all().forEach(cache -> updateStatistics(cache.getName(), new Cache(false, enabled)));
} | [
"public",
"void",
"setStatistics",
"(",
"boolean",
"enabled",
")",
"{",
"all",
"(",
")",
".",
"forEach",
"(",
"cache",
"->",
"updateStatistics",
"(",
"cache",
".",
"getName",
"(",
")",
",",
"new",
"Cache",
"(",
"false",
",",
"enabled",
")",
")",
")",
... | Enable or disable statistics for all caches
@param enabled true for enabling all | [
"Enable",
"or",
"disable",
"statistics",
"for",
"all",
"caches"
] | train | https://github.com/gpein/jcache-jee7/blob/492dd3bb6423cdfb064e7005952a7b79fe4cd7aa/src/main/java/io/github/gpein/jcache/service/JCacheService.java#L90-L92 |
LearnLib/automatalib | core/src/main/java/net/automatalib/automata/base/compact/AbstractCompactSimpleNondet.java | AbstractCompactSimpleNondet.setTransitions | public void setTransitions(int state,
I input,
Collection<? extends Integer> successors) {
"""
public void setTransitions(int state, I input, TIntCollection successors) {
""" // TODO: replace by primitive specialization
setTransitions(state,... | java | public void setTransitions(int state,
I input,
Collection<? extends Integer> successors) { // TODO: replace by primitive specialization
setTransitions(state, getSymbolIndex(input), successors);
} | [
"public",
"void",
"setTransitions",
"(",
"int",
"state",
",",
"I",
"input",
",",
"Collection",
"<",
"?",
"extends",
"Integer",
">",
"successors",
")",
"{",
"// TODO: replace by primitive specialization",
"setTransitions",
"(",
"state",
",",
"getSymbolIndex",
"(",
... | public void setTransitions(int state, I input, TIntCollection successors) { | [
"public",
"void",
"setTransitions",
"(",
"int",
"state",
"I",
"input",
"TIntCollection",
"successors",
")",
"{"
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/core/src/main/java/net/automatalib/automata/base/compact/AbstractCompactSimpleNondet.java#L192-L196 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java | ExcelWriter.flush | public ExcelWriter flush(OutputStream out, boolean isCloseOut) throws IORuntimeException {
"""
将Excel Workbook刷出到输出流
@param out 输出流
@param isCloseOut 是否关闭输出流
@return this
@throws IORuntimeException IO异常
@since 4.4.1
"""
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
try {
this.... | java | public ExcelWriter flush(OutputStream out, boolean isCloseOut) throws IORuntimeException {
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
try {
this.workbook.write(out);
out.flush();
} catch (IOException e) {
throw new IORuntimeException(e);
} finally {
if (isCloseOut) {
... | [
"public",
"ExcelWriter",
"flush",
"(",
"OutputStream",
"out",
",",
"boolean",
"isCloseOut",
")",
"throws",
"IORuntimeException",
"{",
"Assert",
".",
"isFalse",
"(",
"this",
".",
"isClosed",
",",
"\"ExcelWriter has been closed!\"",
")",
";",
"try",
"{",
"this",
"... | 将Excel Workbook刷出到输出流
@param out 输出流
@param isCloseOut 是否关闭输出流
@return this
@throws IORuntimeException IO异常
@since 4.4.1 | [
"将Excel",
"Workbook刷出到输出流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java#L830-L843 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.writePropertyObject | public void writePropertyObject(CmsDbContext dbc, CmsResource resource, CmsProperty property) throws CmsException {
"""
Writes a property for a specified resource.<p>
@param dbc the current database context
@param resource the resource to write the property for
@param property the property to write
@throws... | java | public void writePropertyObject(CmsDbContext dbc, CmsResource resource, CmsProperty property) throws CmsException {
try {
if (property == CmsProperty.getNullProperty()) {
// skip empty or null properties
return;
}
// test if and what state sh... | [
"public",
"void",
"writePropertyObject",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"CmsProperty",
"property",
")",
"throws",
"CmsException",
"{",
"try",
"{",
"if",
"(",
"property",
"==",
"CmsProperty",
".",
"getNullProperty",
"(",
")",
")"... | Writes a property for a specified resource.<p>
@param dbc the current database context
@param resource the resource to write the property for
@param property the property to write
@throws CmsException if something goes wrong
@see CmsObject#writePropertyObject(String, CmsProperty)
@see I_CmsResourceType#writeProperty... | [
"Writes",
"a",
"property",
"for",
"a",
"specified",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9980-L10019 |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/FTPServerFacade.java | FTPServerFacade.setPassive | public HostPort setPassive(int port, int queue)
throws IOException {
"""
Start the local server
@param port required server port; can be set to ANY_PORT
@param queue max size of queue of awaiting new connection
requests
@return the server address
"""
if (serverSocket == null) {
... | java | public HostPort setPassive(int port, int queue)
throws IOException{
if (serverSocket == null) {
ServerSocketFactory factory =
ServerSocketFactory.getDefault();
serverSocket = factory.createServerSocket(port, queue);
}
session.serverMode = Session... | [
"public",
"HostPort",
"setPassive",
"(",
"int",
"port",
",",
"int",
"queue",
")",
"throws",
"IOException",
"{",
"if",
"(",
"serverSocket",
"==",
"null",
")",
"{",
"ServerSocketFactory",
"factory",
"=",
"ServerSocketFactory",
".",
"getDefault",
"(",
")",
";",
... | Start the local server
@param port required server port; can be set to ANY_PORT
@param queue max size of queue of awaiting new connection
requests
@return the server address | [
"Start",
"the",
"local",
"server"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/FTPServerFacade.java#L183-L210 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.binary | public static void binary(InputStream srcStream, OutputStream destStream, String imageType) {
"""
彩色转为黑白二值化图片<br>
此方法并不关闭流
@param srcStream 源图像流
@param destStream 目标图像流
@param imageType 图片格式(扩展名)
@since 4.0.5
"""
binary(read(srcStream), getImageOutputStream(destStream), imageType);
} | java | public static void binary(InputStream srcStream, OutputStream destStream, String imageType) {
binary(read(srcStream), getImageOutputStream(destStream), imageType);
} | [
"public",
"static",
"void",
"binary",
"(",
"InputStream",
"srcStream",
",",
"OutputStream",
"destStream",
",",
"String",
"imageType",
")",
"{",
"binary",
"(",
"read",
"(",
"srcStream",
")",
",",
"getImageOutputStream",
"(",
"destStream",
")",
",",
"imageType",
... | 彩色转为黑白二值化图片<br>
此方法并不关闭流
@param srcStream 源图像流
@param destStream 目标图像流
@param imageType 图片格式(扩展名)
@since 4.0.5 | [
"彩色转为黑白二值化图片<br",
">",
"此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L675-L677 |
stackify/stackify-api-java | src/main/java/com/stackify/api/common/AppIdentityService.java | AppIdentityService.identifyApp | private AppIdentity identifyApp(ApiConfiguration apiConfig) throws IOException, HttpException {
"""
Retrieves the application identity given the environment details
@return The application identity
@throws IOException
@throws HttpException
"""
// convert to json bytes
byte[] jsonBytes = objectMapper.wri... | java | private AppIdentity identifyApp(ApiConfiguration apiConfig) throws IOException, HttpException {
// convert to json bytes
byte[] jsonBytes = objectMapper.writer().writeValueAsBytes(apiConfig.getEnvDetail());
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("IdentifyApp Request: {}", new String(jsonBytes, "UTF-8")... | [
"private",
"AppIdentity",
"identifyApp",
"(",
"ApiConfiguration",
"apiConfig",
")",
"throws",
"IOException",
",",
"HttpException",
"{",
"// convert to json bytes",
"byte",
"[",
"]",
"jsonBytes",
"=",
"objectMapper",
".",
"writer",
"(",
")",
".",
"writeValueAsBytes",
... | Retrieves the application identity given the environment details
@return The application identity
@throws IOException
@throws HttpException | [
"Retrieves",
"the",
"application",
"identity",
"given",
"the",
"environment",
"details"
] | train | https://github.com/stackify/stackify-api-java/blob/d3000b7c87ed53a88b302939b0c88405d63d7b67/src/main/java/com/stackify/api/common/AppIdentityService.java#L174-L206 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.submitTask | public void submitTask(final String evaluatorConfiguration, final String taskConfiguration) {
"""
Submit Task with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side.
@param evaluatorConfiguration
@param taskConfiguration
"""
final ... | java | public void submitTask(final String evaluatorConfiguration, final String taskConfiguration) {
final Configuration contextConfiguration = ContextConfiguration.CONF
.set(ContextConfiguration.IDENTIFIER, "RootContext_" + this.getId())
.build();
final String contextConfigurationString = this.configu... | [
"public",
"void",
"submitTask",
"(",
"final",
"String",
"evaluatorConfiguration",
",",
"final",
"String",
"taskConfiguration",
")",
"{",
"final",
"Configuration",
"contextConfiguration",
"=",
"ContextConfiguration",
".",
"CONF",
".",
"set",
"(",
"ContextConfiguration",
... | Submit Task with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side.
@param evaluatorConfiguration
@param taskConfiguration | [
"Submit",
"Task",
"with",
"configuration",
"strings",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"bridge",
"and",
"the",
"configuration",
"strings",
"are",
"serialized",
"at",
".",
"Net",
"side",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L109-L116 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Date.java | Date.convertToAbbr | private static final StringBuilder convertToAbbr(StringBuilder sb, String name) {
"""
Converts the given name to its 3-letter abbreviation (e.g.,
"monday" -> "Mon") and stored the abbreviation in the given
<code>StringBuilder</code>.
"""
sb.append(Character.toUpperCase(name.charAt(0)));
sb.ap... | java | private static final StringBuilder convertToAbbr(StringBuilder sb, String name) {
sb.append(Character.toUpperCase(name.charAt(0)));
sb.append(name.charAt(1)).append(name.charAt(2));
return sb;
} | [
"private",
"static",
"final",
"StringBuilder",
"convertToAbbr",
"(",
"StringBuilder",
"sb",
",",
"String",
"name",
")",
"{",
"sb",
".",
"append",
"(",
"Character",
".",
"toUpperCase",
"(",
"name",
".",
"charAt",
"(",
"0",
")",
")",
")",
";",
"sb",
".",
... | Converts the given name to its 3-letter abbreviation (e.g.,
"monday" -> "Mon") and stored the abbreviation in the given
<code>StringBuilder</code>. | [
"Converts",
"the",
"given",
"name",
"to",
"its",
"3",
"-",
"letter",
"abbreviation",
"(",
"e",
".",
"g",
".",
"monday",
"-",
">",
"Mon",
")",
"and",
"stored",
"the",
"abbreviation",
"in",
"the",
"given",
"<code",
">",
"StringBuilder<",
"/",
"code",
">"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Date.java#L1077-L1081 |
jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java | DownloadProperties.gitGithub | public static DownloadProperties gitGithub(final String branch, final File destination) {
"""
Builds a new DownloadProperties for downloading Galaxy from github using wget.
@param branch The branch to download (e.g. master, dev, release_15.03).
@param destination The destination directory to store Galaxy, null i... | java | public static DownloadProperties gitGithub(final String branch, final File destination) {
return new DownloadProperties(new GitGithubDownloader(GALAXY_GITHUB_REPOSITORY_URL, branch, LATEST_COMMIT), destination);
} | [
"public",
"static",
"DownloadProperties",
"gitGithub",
"(",
"final",
"String",
"branch",
",",
"final",
"File",
"destination",
")",
"{",
"return",
"new",
"DownloadProperties",
"(",
"new",
"GitGithubDownloader",
"(",
"GALAXY_GITHUB_REPOSITORY_URL",
",",
"branch",
",",
... | Builds a new DownloadProperties for downloading Galaxy from github using wget.
@param branch The branch to download (e.g. master, dev, release_15.03).
@param destination The destination directory to store Galaxy, null if a directory
should be chosen by default.
@return A DownloadProperties for downloading Galaxy from ... | [
"Builds",
"a",
"new",
"DownloadProperties",
"for",
"downloading",
"Galaxy",
"from",
"github",
"using",
"wget",
"."
] | train | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L304-L306 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java | ProcessContext.addDataUsageFor | public void addDataUsageFor(String activity, String attribute) throws CompatibilityException {
"""
Adds a data attribute for an activity.<br>
The given activity/attributes have to be known by the context, i.e.
be contained in the activity/attribute list.
@param activity Activity for which the attribute usage ... | java | public void addDataUsageFor(String activity, String attribute) throws CompatibilityException {
setDataUsageFor(activity, attribute, new HashSet<>(validUsageModes));
} | [
"public",
"void",
"addDataUsageFor",
"(",
"String",
"activity",
",",
"String",
"attribute",
")",
"throws",
"CompatibilityException",
"{",
"setDataUsageFor",
"(",
"activity",
",",
"attribute",
",",
"new",
"HashSet",
"<>",
"(",
"validUsageModes",
")",
")",
";",
"}... | Adds a data attribute for an activity.<br>
The given activity/attributes have to be known by the context, i.e.
be contained in the activity/attribute list.
@param activity Activity for which the attribute usage is set.
@param attribute Attribute used by the given activity.
@throws ParameterException
@throws Compatibil... | [
"Adds",
"a",
"data",
"attribute",
"for",
"an",
"activity",
".",
"<br",
">",
"The",
"given",
"activity",
"/",
"attributes",
"have",
"to",
"be",
"known",
"by",
"the",
"context",
"i",
".",
"e",
".",
"be",
"contained",
"in",
"the",
"activity",
"/",
"attrib... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java#L631-L633 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindUnrelatedTypesInGenericContainer.java | FindUnrelatedTypesInGenericContainer.prescreen | public boolean prescreen(ClassContext classContext, Method method) {
"""
Use this to screen out methods that do not contain invocations.
"""
BitSet bytecodeSet = classContext.getBytecodeSet(method);
return bytecodeSet != null
&& (bytecodeSet.get(Const.INVOKEINTERFACE) || bytecod... | java | public boolean prescreen(ClassContext classContext, Method method) {
BitSet bytecodeSet = classContext.getBytecodeSet(method);
return bytecodeSet != null
&& (bytecodeSet.get(Const.INVOKEINTERFACE) || bytecodeSet.get(Const.INVOKEVIRTUAL)
|| bytecodeSet.get(Const.IN... | [
"public",
"boolean",
"prescreen",
"(",
"ClassContext",
"classContext",
",",
"Method",
"method",
")",
"{",
"BitSet",
"bytecodeSet",
"=",
"classContext",
".",
"getBytecodeSet",
"(",
"method",
")",
";",
"return",
"bytecodeSet",
"!=",
"null",
"&&",
"(",
"bytecodeSet... | Use this to screen out methods that do not contain invocations. | [
"Use",
"this",
"to",
"screen",
"out",
"methods",
"that",
"do",
"not",
"contain",
"invocations",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindUnrelatedTypesInGenericContainer.java#L278-L284 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/image/VisualizeImageData.java | VisualizeImageData.checkInputs | private static BufferedImage checkInputs(ImageBase src, BufferedImage dst) {
"""
If null the dst is declared, otherwise it checks to see if the 'dst' as the same shape as 'src'.
The returned image will be 8-bit RGB
"""
if (dst != null) {
if (dst.getWidth() != src.getWidth() || dst.getHeight() != src.ge... | java | private static BufferedImage checkInputs(ImageBase src, BufferedImage dst) {
if (dst != null) {
if (dst.getWidth() != src.getWidth() || dst.getHeight() != src.getHeight()) {
throw new IllegalArgumentException("image dimension are different. src="
+src.width+"x"+src.height+" dst="+dst.getWidth()+"x"+dst.... | [
"private",
"static",
"BufferedImage",
"checkInputs",
"(",
"ImageBase",
"src",
",",
"BufferedImage",
"dst",
")",
"{",
"if",
"(",
"dst",
"!=",
"null",
")",
"{",
"if",
"(",
"dst",
".",
"getWidth",
"(",
")",
"!=",
"src",
".",
"getWidth",
"(",
")",
"||",
... | If null the dst is declared, otherwise it checks to see if the 'dst' as the same shape as 'src'.
The returned image will be 8-bit RGB | [
"If",
"null",
"the",
"dst",
"is",
"declared",
"otherwise",
"it",
"checks",
"to",
"see",
"if",
"the",
"dst",
"as",
"the",
"same",
"shape",
"as",
"src",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/VisualizeImageData.java#L396-L406 |
ModeShape/modeshape | web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/handler/RestItemHandler.java | RestItemHandler.updateItem | public RestItem updateItem( HttpServletRequest request,
String rawRepositoryName,
String rawWorkspaceName,
String path,
String requestContent ) throws JSONException, RepositoryException {
... | java | public RestItem updateItem( HttpServletRequest request,
String rawRepositoryName,
String rawWorkspaceName,
String path,
String requestContent ) throws JSONException, RepositoryException {
... | [
"public",
"RestItem",
"updateItem",
"(",
"HttpServletRequest",
"request",
",",
"String",
"rawRepositoryName",
",",
"String",
"rawWorkspaceName",
",",
"String",
"path",
",",
"String",
"requestContent",
")",
"throws",
"JSONException",
",",
"RepositoryException",
"{",
"S... | Updates the properties at the path.
<p>
If path points to a property, this method expects the request content to be either a JSON array or a JSON string. The array
or string will become the values or value of the property. If path points to a node, this method expects the request
content to be a JSON object. The keys o... | [
"Updates",
"the",
"properties",
"at",
"the",
"path",
".",
"<p",
">",
"If",
"path",
"points",
"to",
"a",
"property",
"this",
"method",
"expects",
"the",
"request",
"content",
"to",
"be",
"either",
"a",
"JSON",
"array",
"or",
"a",
"JSON",
"string",
".",
... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/handler/RestItemHandler.java#L145-L156 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/constant/ProtectedCudaConstantHandler.java | ProtectedCudaConstantHandler.relocateConstantSpace | @Override
public DataBuffer relocateConstantSpace(DataBuffer dataBuffer) {
"""
PLEASE NOTE: This method implementation is hardware-dependant.
PLEASE NOTE: This method does NOT allow concurrent use of any array
@param dataBuffer
@return
"""
// we always assume that data is sync, and valid on ho... | java | @Override
public DataBuffer relocateConstantSpace(DataBuffer dataBuffer) {
// we always assume that data is sync, and valid on host side
Integer deviceId = AtomicAllocator.getInstance().getDeviceId();
ensureMaps(deviceId);
if (dataBuffer instanceof CudaIntDataBuffer) {
i... | [
"@",
"Override",
"public",
"DataBuffer",
"relocateConstantSpace",
"(",
"DataBuffer",
"dataBuffer",
")",
"{",
"// we always assume that data is sync, and valid on host side",
"Integer",
"deviceId",
"=",
"AtomicAllocator",
".",
"getInstance",
"(",
")",
".",
"getDeviceId",
"("... | PLEASE NOTE: This method implementation is hardware-dependant.
PLEASE NOTE: This method does NOT allow concurrent use of any array
@param dataBuffer
@return | [
"PLEASE",
"NOTE",
":",
"This",
"method",
"implementation",
"is",
"hardware",
"-",
"dependant",
".",
"PLEASE",
"NOTE",
":",
"This",
"method",
"does",
"NOT",
"allow",
"concurrent",
"use",
"of",
"any",
"array"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/constant/ProtectedCudaConstantHandler.java#L259-L283 |
appium/java-client | src/main/java/io/appium/java_client/TouchAction.java | TouchAction.longPress | public T longPress(LongPressOptions longPressOptions) {
"""
Press and hold the at the center of an element until the context menu event has fired.
@param longPressOptions see {@link LongPressOptions}.
@return this TouchAction, for chaining.
"""
ActionParameter action = new ActionParameter("longPres... | java | public T longPress(LongPressOptions longPressOptions) {
ActionParameter action = new ActionParameter("longPress", longPressOptions);
parameterBuilder.add(action);
//noinspection unchecked
return (T) this;
} | [
"public",
"T",
"longPress",
"(",
"LongPressOptions",
"longPressOptions",
")",
"{",
"ActionParameter",
"action",
"=",
"new",
"ActionParameter",
"(",
"\"longPress\"",
",",
"longPressOptions",
")",
";",
"parameterBuilder",
".",
"add",
"(",
"action",
")",
";",
"//noin... | Press and hold the at the center of an element until the context menu event has fired.
@param longPressOptions see {@link LongPressOptions}.
@return this TouchAction, for chaining. | [
"Press",
"and",
"hold",
"the",
"at",
"the",
"center",
"of",
"an",
"element",
"until",
"the",
"context",
"menu",
"event",
"has",
"fired",
"."
] | train | https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/TouchAction.java#L152-L157 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java | GumbelDistribution.logpdf | public static double logpdf(double x, double mu, double beta) {
"""
log PDF of Gumbel distribution
@param x Value
@param mu Mode
@param beta Shape
@return PDF at position x.
"""
if(x == Double.NEGATIVE_INFINITY) {
return Double.NEGATIVE_INFINITY;
}
final double z = (x - mu) / beta;
... | java | public static double logpdf(double x, double mu, double beta) {
if(x == Double.NEGATIVE_INFINITY) {
return Double.NEGATIVE_INFINITY;
}
final double z = (x - mu) / beta;
return -z - FastMath.exp(-z) - FastMath.log(beta);
} | [
"public",
"static",
"double",
"logpdf",
"(",
"double",
"x",
",",
"double",
"mu",
",",
"double",
"beta",
")",
"{",
"if",
"(",
"x",
"==",
"Double",
".",
"NEGATIVE_INFINITY",
")",
"{",
"return",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"}",
"final",
"double... | log PDF of Gumbel distribution
@param x Value
@param mu Mode
@param beta Shape
@return PDF at position x. | [
"log",
"PDF",
"of",
"Gumbel",
"distribution"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GumbelDistribution.java#L130-L136 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexCacheEntry.java | CmsFlexCacheEntry.setRedirect | public void setRedirect(String target, boolean permanent) {
"""
Set a redirect target for this cache entry.<p>
<b>Important:</b>
When a redirect target is set, all saved data is thrown away,
and new data will not be saved in the cache entry.
This is so since with a redirect nothing will be displayed
in the ... | java | public void setRedirect(String target, boolean permanent) {
if (m_completed || (target == null)) {
return;
}
m_redirectTarget = target;
m_redirectPermanent = permanent;
m_byteSize = 512 + CmsMemoryMonitor.getMemorySize(target);
// If we have a redirect we don... | [
"public",
"void",
"setRedirect",
"(",
"String",
"target",
",",
"boolean",
"permanent",
")",
"{",
"if",
"(",
"m_completed",
"||",
"(",
"target",
"==",
"null",
")",
")",
"{",
"return",
";",
"}",
"m_redirectTarget",
"=",
"target",
";",
"m_redirectPermanent",
... | Set a redirect target for this cache entry.<p>
<b>Important:</b>
When a redirect target is set, all saved data is thrown away,
and new data will not be saved in the cache entry.
This is so since with a redirect nothing will be displayed
in the browser anyway, so there is no point in saving the data.<p>
@param target ... | [
"Set",
"a",
"redirect",
"target",
"for",
"this",
"cache",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexCacheEntry.java#L532-L543 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ListUtil.java | ListUtil.arrayToList | public static String arrayToList(String[] array, String delimiter) {
"""
convert a string array to string list
@param array array to convert
@param delimiter delimiter for the new list
@return list generated from string array
"""
if (ArrayUtil.isEmpty(array)) return "";
StringBuilder sb = new StringBuil... | java | public static String arrayToList(String[] array, String delimiter) {
if (ArrayUtil.isEmpty(array)) return "";
StringBuilder sb = new StringBuilder(array[0]);
if (delimiter.length() == 1) {
char c = delimiter.charAt(0);
for (int i = 1; i < array.length; i++) {
sb.append(c);
sb.append(array[i]);
}
... | [
"public",
"static",
"String",
"arrayToList",
"(",
"String",
"[",
"]",
"array",
",",
"String",
"delimiter",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"array",
")",
")",
"return",
"\"\"",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
... | convert a string array to string list
@param array array to convert
@param delimiter delimiter for the new list
@return list generated from string array | [
"convert",
"a",
"string",
"array",
"to",
"string",
"list"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L901-L920 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.modified | @Modified
protected void modified(Map<String, Object> config) {
"""
DS method for runtime updates to configuration without stopping and
restarting the component.
@param config
"""
if (null == config || config.isEmpty()) {
return;
}
// config dictionaries are case-in... | java | @Modified
protected void modified(Map<String, Object> config) {
if (null == config || config.isEmpty()) {
return;
}
// config dictionaries are case-insensitive but case preserving per spec.
// The default value type is String, unless a different type is indicated in meta... | [
"@",
"Modified",
"protected",
"void",
"modified",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"config",
")",
"{",
"if",
"(",
"null",
"==",
"config",
"||",
"config",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"// config dictionaries are ca... | DS method for runtime updates to configuration without stopping and
restarting the component.
@param config | [
"DS",
"method",
"for",
"runtime",
"updates",
"to",
"configuration",
"without",
"stopping",
"and",
"restarting",
"the",
"component",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L200-L232 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.replaceEntry | public static boolean replaceEntry(File zip, String path, byte[] bytes, File destZip) {
"""
Copies an existing ZIP file and replaces a given entry in it.
@param zip
an existing ZIP file (only read).
@param path
new ZIP entry path.
@param bytes
new entry bytes (or <code>null</code> if directory).
@param de... | java | public static boolean replaceEntry(File zip, String path, byte[] bytes, File destZip) {
return replaceEntry(zip, new ByteSource(path, bytes), destZip);
} | [
"public",
"static",
"boolean",
"replaceEntry",
"(",
"File",
"zip",
",",
"String",
"path",
",",
"byte",
"[",
"]",
"bytes",
",",
"File",
"destZip",
")",
"{",
"return",
"replaceEntry",
"(",
"zip",
",",
"new",
"ByteSource",
"(",
"path",
",",
"bytes",
")",
... | Copies an existing ZIP file and replaces a given entry in it.
@param zip
an existing ZIP file (only read).
@param path
new ZIP entry path.
@param bytes
new entry bytes (or <code>null</code> if directory).
@param destZip
new ZIP file created.
@return <code>true</code> if the entry was replaced. | [
"Copies",
"an",
"existing",
"ZIP",
"file",
"and",
"replaces",
"a",
"given",
"entry",
"in",
"it",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2538-L2540 |
actframework/actframework | src/main/java/act/ws/WebSocketContext.java | WebSocketContext.sendJsonToUser | public WebSocketContext sendJsonToUser(Object data, String username) {
"""
Send JSON representation of a data object to all connections of a certain user
@param data the data to be sent
@param username the username
@return this context
"""
return sendToTagged(JSON.toJSONString(data), username);
... | java | public WebSocketContext sendJsonToUser(Object data, String username) {
return sendToTagged(JSON.toJSONString(data), username);
} | [
"public",
"WebSocketContext",
"sendJsonToUser",
"(",
"Object",
"data",
",",
"String",
"username",
")",
"{",
"return",
"sendToTagged",
"(",
"JSON",
".",
"toJSONString",
"(",
"data",
")",
",",
"username",
")",
";",
"}"
] | Send JSON representation of a data object to all connections of a certain user
@param data the data to be sent
@param username the username
@return this context | [
"Send",
"JSON",
"representation",
"of",
"a",
"data",
"object",
"to",
"all",
"connections",
"of",
"a",
"certain",
"user"
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketContext.java#L280-L282 |
ACRA/acra | acra-dialog/src/main/java/org/acra/interaction/DialogInteraction.java | DialogInteraction.createCrashReportDialogIntent | @NonNull
private Intent createCrashReportDialogIntent(@NonNull Context context, @NonNull CoreConfiguration config, @NonNull File reportFile) {
"""
Creates an Intent that can be used to create and show a CrashReportDialog.
@param reportFile Error report file to display in the crash report dialog.
"""
... | java | @NonNull
private Intent createCrashReportDialogIntent(@NonNull Context context, @NonNull CoreConfiguration config, @NonNull File reportFile) {
if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Creating DialogIntent for " + reportFile);
final Intent dialogIntent = new Intent(context, ConfigUtils.getPluginCo... | [
"@",
"NonNull",
"private",
"Intent",
"createCrashReportDialogIntent",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"CoreConfiguration",
"config",
",",
"@",
"NonNull",
"File",
"reportFile",
")",
"{",
"if",
"(",
"ACRA",
".",
"DEV_LOGGING",
")",
... | Creates an Intent that can be used to create and show a CrashReportDialog.
@param reportFile Error report file to display in the crash report dialog. | [
"Creates",
"an",
"Intent",
"that",
"can",
"be",
"used",
"to",
"create",
"and",
"show",
"a",
"CrashReportDialog",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-dialog/src/main/java/org/acra/interaction/DialogInteraction.java#L81-L88 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java | CompileStack.makeNextVariableID | private void makeNextVariableID(ClassNode type, boolean useReferenceDirectly) {
"""
Calculates the index of the next free register stores it
and sets the current variable index to the old value
"""
currentVariableIndex = nextVariableIndex;
if ((type== ClassHelper.long_TYPE || type== ClassHelpe... | java | private void makeNextVariableID(ClassNode type, boolean useReferenceDirectly) {
currentVariableIndex = nextVariableIndex;
if ((type== ClassHelper.long_TYPE || type== ClassHelper.double_TYPE) && !useReferenceDirectly) {
nextVariableIndex++;
}
nextVariableIndex++;
} | [
"private",
"void",
"makeNextVariableID",
"(",
"ClassNode",
"type",
",",
"boolean",
"useReferenceDirectly",
")",
"{",
"currentVariableIndex",
"=",
"nextVariableIndex",
";",
"if",
"(",
"(",
"type",
"==",
"ClassHelper",
".",
"long_TYPE",
"||",
"type",
"==",
"ClassHel... | Calculates the index of the next free register stores it
and sets the current variable index to the old value | [
"Calculates",
"the",
"index",
"of",
"the",
"next",
"free",
"register",
"stores",
"it",
"and",
"sets",
"the",
"current",
"variable",
"index",
"to",
"the",
"old",
"value"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java#L712-L718 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/util/TransitionUtil.java | TransitionUtil.executeOnGlobalLayout | public static void executeOnGlobalLayout(@NonNull final Activity activity, @NonNull final ViewTreeObserver.OnGlobalLayoutListener listener) {
"""
Helper that removes the drudgery of using ViewTreeObserver
@param activity used to retrieve a View that can be
@param listener
"""
executeOnGlobalLayout(... | java | public static void executeOnGlobalLayout(@NonNull final Activity activity, @NonNull final ViewTreeObserver.OnGlobalLayoutListener listener) {
executeOnGlobalLayout(activity.getWindow().getDecorView().findViewById(android.R.id.content), listener);
} | [
"public",
"static",
"void",
"executeOnGlobalLayout",
"(",
"@",
"NonNull",
"final",
"Activity",
"activity",
",",
"@",
"NonNull",
"final",
"ViewTreeObserver",
".",
"OnGlobalLayoutListener",
"listener",
")",
"{",
"executeOnGlobalLayout",
"(",
"activity",
".",
"getWindow"... | Helper that removes the drudgery of using ViewTreeObserver
@param activity used to retrieve a View that can be
@param listener | [
"Helper",
"that",
"removes",
"the",
"drudgery",
"of",
"using",
"ViewTreeObserver"
] | train | https://github.com/kaichunlin/android-transition/blob/7b53074206622f5cf5d82091d891a7ed8b9f06cd/core/src/main/java/com/kaichunlin/transition/util/TransitionUtil.java#L105-L107 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.createTranscodingJob | public CreateTranscodingJobResponse createTranscodingJob(CreateTranscodingJobRequest request) {
"""
Creates a new transcoder job which converts media files in BOS buckets with specified preset.
@param request The request object containing all options for creating a job.
@return The newly created job ID.
... | java | public CreateTranscodingJobResponse createTranscodingJob(CreateTranscodingJobRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getPipelineName(),
"The parameter pipelineName should NOT be null or empty string.");
... | [
"public",
"CreateTranscodingJobResponse",
"createTranscodingJob",
"(",
"CreateTranscodingJobRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getPipelineNam... | Creates a new transcoder job which converts media files in BOS buckets with specified preset.
@param request The request object containing all options for creating a job.
@return The newly created job ID. | [
"Creates",
"a",
"new",
"transcoder",
"job",
"which",
"converts",
"media",
"files",
"in",
"BOS",
"buckets",
"with",
"specified",
"preset",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L422-L437 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.addFacetRefinement | @NonNull
@SuppressWarnings( {
"""
Adds a facet refinement for the next queries.
<p>
<b>This method resets the current page to 0.</b>
@param attribute the attribute to refine on.
@param value the facet's value to refine with.
@return this {@link Searcher} for chaining.
""""WeakerAccess", "unused"... | java | @NonNull
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher addFacetRefinement(@NonNull String attribute, @NonNull String value) {
return addFacetRefinement(attribute, Collections.singletonList(value), disjunctiveFacets.contains(attribute));
} | [
"@",
"NonNull",
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"addFacetRefinement",
"(",
"@",
"NonNull",
"String",
"attribute",
",",
"@",
"NonNull",
"String",
"value",
")",
"{",
... | Adds a facet refinement for the next queries.
<p>
<b>This method resets the current page to 0.</b>
@param attribute the attribute to refine on.
@param value the facet's value to refine with.
@return this {@link Searcher} for chaining. | [
"Adds",
"a",
"facet",
"refinement",
"for",
"the",
"next",
"queries",
".",
"<p",
">",
"<b",
">",
"This",
"method",
"resets",
"the",
"current",
"page",
"to",
"0",
".",
"<",
"/",
"b",
">"
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L547-L551 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/HashUtil.java | HashUtil.MurmurHash3_x86_32_direct | public static int MurmurHash3_x86_32_direct(MemoryAccessor mem, long base, int offset, int len) {
"""
Returns the {@code MurmurHash3_x86_32} hash of a memory block accessed by the provided {@link MemoryAccessor}.
The {@code MemoryAccessor} will be used to access {@code int}-sized data at addresses {@code (base + ... | java | public static int MurmurHash3_x86_32_direct(MemoryAccessor mem, long base, int offset, int len) {
return MurmurHash3_x86_32(mem.isBigEndian() ? NARROW_DIRECT_LOADER : WIDE_DIRECT_LOADER,
mem, base + offset, len, DEFAULT_MURMUR_SEED);
} | [
"public",
"static",
"int",
"MurmurHash3_x86_32_direct",
"(",
"MemoryAccessor",
"mem",
",",
"long",
"base",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"return",
"MurmurHash3_x86_32",
"(",
"mem",
".",
"isBigEndian",
"(",
")",
"?",
"NARROW_DIRECT_LOADER",
... | Returns the {@code MurmurHash3_x86_32} hash of a memory block accessed by the provided {@link MemoryAccessor}.
The {@code MemoryAccessor} will be used to access {@code int}-sized data at addresses {@code (base + offset)},
{@code (base + offset + 4)}, etc. The caller must ensure that the {@code MemoryAccessor} supports ... | [
"Returns",
"the",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/HashUtil.java#L82-L85 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/ArgumentDescriptor.java | ArgumentDescriptor.setValue | public void setValue(String fieldRefName, boolean returnedByProcedure) {
"""
Sets up this object to represent a value that is derived from a field
in the corresponding class-descriptor.
<p>
If the value of <code>fieldRefName</code> is blank or refers to an
invalid field reference, then the value of the corresp... | java | public void setValue(String fieldRefName, boolean returnedByProcedure)
{
this.fieldSource = SOURCE_FIELD;
this.fieldRefName = fieldRefName;
this.returnedByProcedure = returnedByProcedure;
this.constantValue = null;
// If the field reference is not valid, then disregar... | [
"public",
"void",
"setValue",
"(",
"String",
"fieldRefName",
",",
"boolean",
"returnedByProcedure",
")",
"{",
"this",
".",
"fieldSource",
"=",
"SOURCE_FIELD",
";",
"this",
".",
"fieldRefName",
"=",
"fieldRefName",
";",
"this",
".",
"returnedByProcedure",
"=",
"r... | Sets up this object to represent a value that is derived from a field
in the corresponding class-descriptor.
<p>
If the value of <code>fieldRefName</code> is blank or refers to an
invalid field reference, then the value of the corresponding argument
will be set to null. In this case, {@link #getIsReturnedByProcedure}
w... | [
"Sets",
"up",
"this",
"object",
"to",
"represent",
"a",
"value",
"that",
"is",
"derived",
"from",
"a",
"field",
"in",
"the",
"corresponding",
"class",
"-",
"descriptor",
".",
"<p",
">",
"If",
"the",
"value",
"of",
"<code",
">",
"fieldRefName<",
"/",
"cod... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ArgumentDescriptor.java#L94-L114 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/StdScheduler.java | StdScheduler.triggerJob | public void triggerJob (final JobKey jobKey, final JobDataMap data) throws SchedulerException {
"""
<p>
Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
</p>
"""
m_aSched.triggerJob (jobKey, data);
} | java | public void triggerJob (final JobKey jobKey, final JobDataMap data) throws SchedulerException
{
m_aSched.triggerJob (jobKey, data);
} | [
"public",
"void",
"triggerJob",
"(",
"final",
"JobKey",
"jobKey",
",",
"final",
"JobDataMap",
"data",
")",
"throws",
"SchedulerException",
"{",
"m_aSched",
".",
"triggerJob",
"(",
"jobKey",
",",
"data",
")",
";",
"}"
] | <p>
Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
</p> | [
"<p",
">",
"Calls",
"the",
"equivalent",
"method",
"on",
"the",
"proxied",
"<code",
">",
"QuartzScheduler<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/StdScheduler.java#L349-L352 |
bigdatagenomics/convert | convert/src/main/java/org/bdgenomics/convert/AbstractConverter.java | AbstractConverter.warnOrThrow | protected final void warnOrThrow(final S source,
final String message,
final Throwable cause,
final ConversionStringency stringency,
final Logger logger) throws ConversionE... | java | protected final void warnOrThrow(final S source,
final String message,
final Throwable cause,
final ConversionStringency stringency,
final Logger logger) throws ConversionE... | [
"protected",
"final",
"void",
"warnOrThrow",
"(",
"final",
"S",
"source",
",",
"final",
"String",
"message",
",",
"final",
"Throwable",
"cause",
",",
"final",
"ConversionStringency",
"stringency",
",",
"final",
"Logger",
"logger",
")",
"throws",
"ConversionExcepti... | If the conversion stringency is lenient, log a warning with the specified message,
or if the conversion stringency is strict, throw a ConversionException with the specified
message and cause.
@param source source
@param message message
@param cause cause
@param stringency conversion stringency, must not be null
@param... | [
"If",
"the",
"conversion",
"stringency",
"is",
"lenient",
"log",
"a",
"warning",
"with",
"the",
"specified",
"message",
"or",
"if",
"the",
"conversion",
"stringency",
"is",
"strict",
"throw",
"a",
"ConversionException",
"with",
"the",
"specified",
"message",
"an... | train | https://github.com/bigdatagenomics/convert/blob/6bc1ddbef933742971af414cbb90fa41c1673358/convert/src/main/java/org/bdgenomics/convert/AbstractConverter.java#L108-L126 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChangesHolder.java | ChangesHolder.readField | private static Field readField(ObjectInput in, Document doc) throws IOException, ClassNotFoundException {
"""
Deserialize the field from the given {@link ObjectInput}
@param in the stream from which we deserialize the Field
@return the deserialized field
@throws IOException
@throws ClassNotFoundException
"... | java | private static Field readField(ObjectInput in, Document doc) throws IOException, ClassNotFoundException
{
String name = in.readUTF();
int flags = in.readInt();
float boost = (flags & BOOST_FLAG) > 0 ? in.readFloat() : 1.0f;
Object value = in.readObject();
Field field;
if (value in... | [
"private",
"static",
"Field",
"readField",
"(",
"ObjectInput",
"in",
",",
"Document",
"doc",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"String",
"name",
"=",
"in",
".",
"readUTF",
"(",
")",
";",
"int",
"flags",
"=",
"in",
".",
"read... | Deserialize the field from the given {@link ObjectInput}
@param in the stream from which we deserialize the Field
@return the deserialized field
@throws IOException
@throws ClassNotFoundException | [
"Deserialize",
"the",
"field",
"from",
"the",
"given",
"{"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ChangesHolder.java#L164-L192 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceClient.java | TranslationServiceClient.listGlossaries | public final ListGlossariesPagedResponse listGlossaries(String parent, String filter) {
"""
Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
<p>Sample code:
<pre><code>
try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
String format... | java | public final ListGlossariesPagedResponse listGlossaries(String parent, String filter) {
if (!parent.isEmpty()) {
LOCATION_PATH_TEMPLATE.validate(parent, "listGlossaries");
}
ListGlossariesRequest request =
ListGlossariesRequest.newBuilder().setParent(parent).setFilter(filter).build();
retu... | [
"public",
"final",
"ListGlossariesPagedResponse",
"listGlossaries",
"(",
"String",
"parent",
",",
"String",
"filter",
")",
"{",
"if",
"(",
"!",
"parent",
".",
"isEmpty",
"(",
")",
")",
"{",
"LOCATION_PATH_TEMPLATE",
".",
"validate",
"(",
"parent",
",",
"\"list... | Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
<p>Sample code:
<pre><code>
try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
String formattedParent = TranslationServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
String filter = "";... | [
"Lists",
"glossaries",
"in",
"a",
"project",
".",
"Returns",
"NOT_FOUND",
"if",
"the",
"project",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-translate/src/main/java/com/google/cloud/translate/v3beta1/TranslationServiceClient.java#L706-L713 |
qspin/qtaste | plugins_src/javagui/src/main/java/com/qspin/qtaste/javagui/server/TreeNodeSelector.java | TreeNodeSelector.compareNodeNames | protected boolean compareNodeNames(String nodePathElement, String nodeName) {
"""
Compare a node path element (provided as argument of the selectNode method) to a node name (from a JTree).
@param nodePathElement the node path element to compare with the node name
@param nodeName the node name
@return true if ... | java | protected boolean compareNodeNames(String nodePathElement, String nodeName) {
return mSelectorIdentifier == SelectorIdentifier.SELECT_BY_REGEX ? Pattern.matches(nodePathElement, nodeName) :
nodePathElement.equals(nodeName);
} | [
"protected",
"boolean",
"compareNodeNames",
"(",
"String",
"nodePathElement",
",",
"String",
"nodeName",
")",
"{",
"return",
"mSelectorIdentifier",
"==",
"SelectorIdentifier",
".",
"SELECT_BY_REGEX",
"?",
"Pattern",
".",
"matches",
"(",
"nodePathElement",
",",
"nodeNa... | Compare a node path element (provided as argument of the selectNode method) to a node name (from a JTree).
@param nodePathElement the node path element to compare with the node name
@param nodeName the node name
@return true if both match, false otherwise. | [
"Compare",
"a",
"node",
"path",
"element",
"(",
"provided",
"as",
"argument",
"of",
"the",
"selectNode",
"method",
")",
"to",
"a",
"node",
"name",
"(",
"from",
"a",
"JTree",
")",
"."
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/plugins_src/javagui/src/main/java/com/qspin/qtaste/javagui/server/TreeNodeSelector.java#L68-L71 |
michael-rapp/AndroidMaterialDialog | library/src/main/java/de/mrapp/android/dialog/view/DialogRootView.java | DialogRootView.applyDialogPaddingLeft | private void applyDialogPaddingLeft(@NonNull final Area area, @NonNull final View view) {
"""
Applies the dialog's left padding to the view of a specific area.
@param area
The area, the view, the padding should be applied to, corresponds to, as an instance
of the class {@link Area}. The area may not be null
... | java | private void applyDialogPaddingLeft(@NonNull final Area area, @NonNull final View view) {
int padding = area != Area.HEADER && area != Area.BUTTON_BAR && area != Area.CONTENT ?
dialogPadding[0] : 0;
view.setPadding(padding, view.getPaddingTop(), view.getPaddingRight(),
vi... | [
"private",
"void",
"applyDialogPaddingLeft",
"(",
"@",
"NonNull",
"final",
"Area",
"area",
",",
"@",
"NonNull",
"final",
"View",
"view",
")",
"{",
"int",
"padding",
"=",
"area",
"!=",
"Area",
".",
"HEADER",
"&&",
"area",
"!=",
"Area",
".",
"BUTTON_BAR",
... | Applies the dialog's left padding to the view of a specific area.
@param area
The area, the view, the padding should be applied to, corresponds to, as an instance
of the class {@link Area}. The area may not be null
@param view
The view, the padding should be applied to, as an instance of the class {@link View}.
The vi... | [
"Applies",
"the",
"dialog",
"s",
"left",
"padding",
"to",
"the",
"view",
"of",
"a",
"specific",
"area",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/library/src/main/java/de/mrapp/android/dialog/view/DialogRootView.java#L665-L670 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getTPTransaction | public void getTPTransaction(String API, Transaction.Time time, Transaction.Type type, Callback<List<Transaction>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on transactions API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/transactions">here</a><br/>
Give user th... | java | public void getTPTransaction(String API, Transaction.Time time, Transaction.Type type, Callback<List<Transaction>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API));
if (time == null || type == null)
throw new GuildWars2Exception(ErrorCode.TransTime, ... | [
"public",
"void",
"getTPTransaction",
"(",
"String",
"API",
",",
"Transaction",
".",
"Time",
"time",
",",
"Transaction",
".",
"Type",
"type",
",",
"Callback",
"<",
"List",
"<",
"Transaction",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"... | For more info on transactions API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/transactions">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param time current |... | [
"For",
"more",
"info",
"on",
"transactions",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"commerce",
"/",
"transactions",
">",
"here<",
"/",
"a",
">",
"<br",
"/"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1002-L1007 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/PollingThread.java | PollingThread.getRequest | private Request getRequest(Action action, BrokerSession session) {
"""
Creates a request packet for the specified action.
@param action Action to perform.
@param session Session receiving the request.
@return The fully formed request.
"""
switch (action) {
case QUERY:
i... | java | private Request getRequest(Action action, BrokerSession session) {
switch (action) {
case QUERY:
if (query == null) {
query = new Request(action);
query.addParameter("UID", session.getId());
}
re... | [
"private",
"Request",
"getRequest",
"(",
"Action",
"action",
",",
"BrokerSession",
"session",
")",
"{",
"switch",
"(",
"action",
")",
"{",
"case",
"QUERY",
":",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"query",
"=",
"new",
"Request",
"(",
"action",
... | Creates a request packet for the specified action.
@param action Action to perform.
@param session Session receiving the request.
@return The fully formed request. | [
"Creates",
"a",
"request",
"packet",
"for",
"the",
"specified",
"action",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/PollingThread.java#L129-L149 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/webapp/resources/LicenseResource.java | LicenseResource.getNames | @GET
@Produces( {
"""
Return the list of available license name.
This method is call via GET <dm_url>/license/names
@param uriInfo UriInfo
@return Response A list of license name in HTML or JSON
"""MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path(ServerAPI.GET_NAMES)
public Response getNames(@Co... | java | @GET
@Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path(ServerAPI.GET_NAMES)
public Response getNames(@Context final UriInfo uriInfo){
LOG.info("Got a get license names request.");
final ListView view = new ListView("License names view", "license");
final FiltersHolder filters = new Filt... | [
"@",
"GET",
"@",
"Produces",
"(",
"{",
"MediaType",
".",
"TEXT_HTML",
",",
"MediaType",
".",
"APPLICATION_JSON",
"}",
")",
"@",
"Path",
"(",
"ServerAPI",
".",
"GET_NAMES",
")",
"public",
"Response",
"getNames",
"(",
"@",
"Context",
"final",
"UriInfo",
"uri... | Return the list of available license name.
This method is call via GET <dm_url>/license/names
@param uriInfo UriInfo
@return Response A list of license name in HTML or JSON | [
"Return",
"the",
"list",
"of",
"available",
"license",
"name",
".",
"This",
"method",
"is",
"call",
"via",
"GET",
"<dm_url",
">",
"/",
"license",
"/",
"names"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/LicenseResource.java#L88-L102 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/StringUtils.java | StringUtils.lastIndexOf | @NullSafe
public static int lastIndexOf(String text, String value) {
"""
Determines the index of the last occurrence of token in the String value. This lastIndexOf operation is null-safe
and returns a -1 if the String value is null, or the token does not exist in the String value.
@param text the String val... | java | @NullSafe
public static int lastIndexOf(String text, String value) {
return text != null && value != null ? text.lastIndexOf(value) : -1;
} | [
"@",
"NullSafe",
"public",
"static",
"int",
"lastIndexOf",
"(",
"String",
"text",
",",
"String",
"value",
")",
"{",
"return",
"text",
"!=",
"null",
"&&",
"value",
"!=",
"null",
"?",
"text",
".",
"lastIndexOf",
"(",
"value",
")",
":",
"-",
"1",
";",
"... | Determines the index of the last occurrence of token in the String value. This lastIndexOf operation is null-safe
and returns a -1 if the String value is null, or the token does not exist in the String value.
@param text the String value used to search for the token.
@param value the text to search for in the String ... | [
"Determines",
"the",
"index",
"of",
"the",
"last",
"occurrence",
"of",
"token",
"in",
"the",
"String",
"value",
".",
"This",
"lastIndexOf",
"operation",
"is",
"null",
"-",
"safe",
"and",
"returns",
"a",
"-",
"1",
"if",
"the",
"String",
"value",
"is",
"nu... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/StringUtils.java#L404-L407 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/common/Similarity.java | Similarity.jaccardIndex | public static double jaccardIndex(Vector a, Vector b) {
"""
Computes the <a href="http://en.wikipedia.org/wiki/Jaccard_index">Jaccard
index</a> comparing the similarity both {@code Vector}s when viewed as
sets of samples.
"""
return jaccardIndex(Vectors.asDouble(a), Vectors.asDouble(b));
} | java | public static double jaccardIndex(Vector a, Vector b) {
return jaccardIndex(Vectors.asDouble(a), Vectors.asDouble(b));
} | [
"public",
"static",
"double",
"jaccardIndex",
"(",
"Vector",
"a",
",",
"Vector",
"b",
")",
"{",
"return",
"jaccardIndex",
"(",
"Vectors",
".",
"asDouble",
"(",
"a",
")",
",",
"Vectors",
".",
"asDouble",
"(",
"b",
")",
")",
";",
"}"
] | Computes the <a href="http://en.wikipedia.org/wiki/Jaccard_index">Jaccard
index</a> comparing the similarity both {@code Vector}s when viewed as
sets of samples. | [
"Computes",
"the",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Jaccard_index",
">",
"Jaccard",
"index<",
"/",
"a",
">",
"comparing",
"the",
"similarity",
"both",
"{"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/Similarity.java#L1005-L1007 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.processUpdateGroup | protected <T> long processUpdateGroup(T[] arr, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Session sess) throws CpoException {
"""
DOCUMENT ME!
@param arr DOCUMENT ME!
@param groupType DOCUMENT ME!
@par... | java | protected <T> long processUpdateGroup(T[] arr, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Session sess) throws CpoException {
CpoClass cpoClass;
List<CpoFunction> cpoFunctions;
CpoFunction cpoFunction;
... | [
"protected",
"<",
"T",
">",
"long",
"processUpdateGroup",
"(",
"T",
"[",
"]",
"arr",
",",
"String",
"groupType",
",",
"String",
"groupName",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Coll... | DOCUMENT ME!
@param arr DOCUMENT ME!
@param groupType DOCUMENT ME!
@param groupName DOCUMENT ME!
@param sess DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L2133-L2169 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/CurrentThreadToServletContext.java | CurrentThreadToServletContext.getServletContextForCurrentClassLoader | Object getServletContextForCurrentClassLoader() {
"""
/*
Uses the FactoryManagerCacheKey system to find the ServletContext
associated with the current ClassLoader, if any.
"""
Object result;
FactoryManagerCacheKey key = new FactoryManagerCacheKey(null, getClassLoader(), applicationMap);
... | java | Object getServletContextForCurrentClassLoader() {
Object result;
FactoryManagerCacheKey key = new FactoryManagerCacheKey(null, getClassLoader(), applicationMap);
result = key.getContext();
return result;
} | [
"Object",
"getServletContextForCurrentClassLoader",
"(",
")",
"{",
"Object",
"result",
";",
"FactoryManagerCacheKey",
"key",
"=",
"new",
"FactoryManagerCacheKey",
"(",
"null",
",",
"getClassLoader",
"(",
")",
",",
"applicationMap",
")",
";",
"result",
"=",
"key",
... | /*
Uses the FactoryManagerCacheKey system to find the ServletContext
associated with the current ClassLoader, if any. | [
"/",
"*",
"Uses",
"the",
"FactoryManagerCacheKey",
"system",
"to",
"find",
"the",
"ServletContext",
"associated",
"with",
"the",
"current",
"ClassLoader",
"if",
"any",
"."
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/CurrentThreadToServletContext.java#L163-L169 |
meertensinstituut/mtas | src/main/java/mtas/solr/handler/util/MtasSolrStatus.java | MtasSolrStatus.getLong | private final Long getLong(NamedList<Object> response, String... args) {
"""
Gets the long.
@param response
the response
@param args
the args
@return the long
"""
Object objectItem = response.findRecursive(args);
if (objectItem != null && objectItem instanceof Long) {
return (Long) objectI... | java | private final Long getLong(NamedList<Object> response, String... args) {
Object objectItem = response.findRecursive(args);
if (objectItem != null && objectItem instanceof Long) {
return (Long) objectItem;
} else {
return null;
}
} | [
"private",
"final",
"Long",
"getLong",
"(",
"NamedList",
"<",
"Object",
">",
"response",
",",
"String",
"...",
"args",
")",
"{",
"Object",
"objectItem",
"=",
"response",
".",
"findRecursive",
"(",
"args",
")",
";",
"if",
"(",
"objectItem",
"!=",
"null",
... | Gets the long.
@param response
the response
@param args
the args
@return the long | [
"Gets",
"the",
"long",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/util/MtasSolrStatus.java#L588-L595 |
aws/aws-sdk-java | aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/ConfigurationItem.java | ConfigurationItem.withTags | public ConfigurationItem withTags(java.util.Map<String, String> tags) {
"""
<p>
A mapping of key value tags associated with the resource.
</p>
@param tags
A mapping of key value tags associated with the resource.
@return Returns a reference to this object so that method calls can be chained together.
""... | java | public ConfigurationItem withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"ConfigurationItem",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A mapping of key value tags associated with the resource.
</p>
@param tags
A mapping of key value tags associated with the resource.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"mapping",
"of",
"key",
"value",
"tags",
"associated",
"with",
"the",
"resource",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/ConfigurationItem.java#L796-L799 |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/internal/rendering/strategy/TiledFeatureService.java | TiledFeatureService.fillTile | public void fillTile(InternalTile tile, Envelope maxTileExtent)
throws GeomajasException {
"""
Put features in a tile. This will assure all features are only added in one tile. When a feature's unique tile
is different from this one a link is added in the tile.
@param tile
tile to put features in
@param m... | java | public void fillTile(InternalTile tile, Envelope maxTileExtent)
throws GeomajasException {
List<InternalFeature> origFeatures = tile.getFeatures();
tile.setFeatures(new ArrayList<InternalFeature>());
for (InternalFeature feature : origFeatures) {
if (!addTileCode(tile, maxTileExtent, feature.getGeometry()))... | [
"public",
"void",
"fillTile",
"(",
"InternalTile",
"tile",
",",
"Envelope",
"maxTileExtent",
")",
"throws",
"GeomajasException",
"{",
"List",
"<",
"InternalFeature",
">",
"origFeatures",
"=",
"tile",
".",
"getFeatures",
"(",
")",
";",
"tile",
".",
"setFeatures",... | Put features in a tile. This will assure all features are only added in one tile. When a feature's unique tile
is different from this one a link is added in the tile.
@param tile
tile to put features in
@param maxTileExtent
the maximum tile extent
@throws GeomajasException oops | [
"Put",
"features",
"in",
"a",
"tile",
".",
"This",
"will",
"assure",
"all",
"features",
"are",
"only",
"added",
"in",
"one",
"tile",
".",
"When",
"a",
"feature",
"s",
"unique",
"tile",
"is",
"different",
"from",
"this",
"one",
"a",
"link",
"is",
"added... | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/rendering/strategy/TiledFeatureService.java#L71-L81 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/NodeReportsInner.java | NodeReportsInner.getContent | public Object getContent(String resourceGroupName, String automationAccountName, String nodeId, String reportId) {
"""
Retrieve the Dsc node reports by node id and report id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param nodeI... | java | public Object getContent(String resourceGroupName, String automationAccountName, String nodeId, String reportId) {
return getContentWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeId, reportId).toBlocking().single().body();
} | [
"public",
"Object",
"getContent",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"nodeId",
",",
"String",
"reportId",
")",
"{",
"return",
"getContentWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountNam... | Retrieve the Dsc node reports by node id and report id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param nodeId The Dsc node id.
@param reportId The report id.
@throws IllegalArgumentException thrown if parameters fail the validation
@thr... | [
"Retrieve",
"the",
"Dsc",
"node",
"reports",
"by",
"node",
"id",
"and",
"report",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/NodeReportsInner.java#L445-L447 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java | IndexChangeAdapters.forNodeLocalName | public static IndexChangeAdapter forNodeLocalName( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> index ) {
... | java | public static IndexChangeAdapter forNodeLocalName( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> index ) {
... | [
"public",
"static",
"IndexChangeAdapter",
"forNodeLocalName",
"(",
"ExecutionContext",
"context",
",",
"NodeTypePredicate",
"matcher",
",",
"String",
"workspaceName",
",",
"ProvidedIndex",
"<",
"?",
">",
"index",
")",
"{",
"return",
"new",
"NodeLocalNameChangeAdapter",
... | Create an {@link IndexChangeAdapter} implementation that handles the "mode:localName" property.
@param context the execution context; may not be null
@param matcher the node type matcher used to determine which nodes should be included in the index; may not be null
@param workspaceName the name of the workspace; may n... | [
"Create",
"an",
"{",
"@link",
"IndexChangeAdapter",
"}",
"implementation",
"that",
"handles",
"the",
"mode",
":",
"localName",
"property",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java#L112-L117 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/JSONNavi.java | JSONNavi.set | public JSONNavi<T> set(String key, double value) {
"""
write an value in the current object
@param key
key to access
@param value
new value
@return this
"""
return set(key, Double.valueOf(value));
} | java | public JSONNavi<T> set(String key, double value) {
return set(key, Double.valueOf(value));
} | [
"public",
"JSONNavi",
"<",
"T",
">",
"set",
"(",
"String",
"key",
",",
"double",
"value",
")",
"{",
"return",
"set",
"(",
"key",
",",
"Double",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"}"
] | write an value in the current object
@param key
key to access
@param value
new value
@return this | [
"write",
"an",
"value",
"in",
"the",
"current",
"object"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/JSONNavi.java#L265-L267 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/util/RidUtils.java | RidUtils.trackIdChange | public static void trackIdChange(final ODocument document, final Object pojo) {
"""
When just created object is detached to pure pojo it gets temporary id.
Real id is assigned only after transaction commit. This method tracks original
document, intercepts its id change and sets correct id and version into pojo.
... | java | public static void trackIdChange(final ODocument document, final Object pojo) {
if (document.getIdentity().isNew()) {
ORecordInternal.addIdentityChangeListener(document, new OIdentityChangeListener() {
@Override
public void onBeforeIdentityChange(final ORecord record)... | [
"public",
"static",
"void",
"trackIdChange",
"(",
"final",
"ODocument",
"document",
",",
"final",
"Object",
"pojo",
")",
"{",
"if",
"(",
"document",
".",
"getIdentity",
"(",
")",
".",
"isNew",
"(",
")",
")",
"{",
"ORecordInternal",
".",
"addIdentityChangeLis... | When just created object is detached to pure pojo it gets temporary id.
Real id is assigned only after transaction commit. This method tracks original
document, intercepts its id change and sets correct id and version into pojo.
So it become safe to use such pojo id outside of transaction.
@param document original doc... | [
"When",
"just",
"created",
"object",
"is",
"detached",
"to",
"pure",
"pojo",
"it",
"gets",
"temporary",
"id",
".",
"Real",
"id",
"is",
"assigned",
"only",
"after",
"transaction",
"commit",
".",
"This",
"method",
"tracks",
"original",
"document",
"intercepts",
... | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/util/RidUtils.java#L89-L104 |
phax/ph-oton | ph-oton-security/src/main/java/com/helger/photon/security/usergroup/UserGroupManager.java | UserGroupManager.assignRoleToUserGroup | @Nonnull
public EChange assignRoleToUserGroup (@Nullable final String sUserGroupID, @Nonnull @Nonempty final String sRoleID) {
"""
Assign the passed role ID to the user group with the passed ID.<br>
Note: the role ID must not be checked for consistency
@param sUserGroupID
The ID of the user group to assign ... | java | @Nonnull
public EChange assignRoleToUserGroup (@Nullable final String sUserGroupID, @Nonnull @Nonempty final String sRoleID)
{
// Resolve user group
final UserGroup aUserGroup = getOfID (sUserGroupID);
if (aUserGroup == null)
{
AuditHelper.onAuditModifyFailure (UserGroup.OT, sUserGroupID, "no-... | [
"@",
"Nonnull",
"public",
"EChange",
"assignRoleToUserGroup",
"(",
"@",
"Nullable",
"final",
"String",
"sUserGroupID",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sRoleID",
")",
"{",
"// Resolve user group",
"final",
"UserGroup",
"aUserGroup",
"=",
"... | Assign the passed role ID to the user group with the passed ID.<br>
Note: the role ID must not be checked for consistency
@param sUserGroupID
The ID of the user group to assign the role to.
@param sRoleID
The ID of the role to be assigned
@return {@link EChange#CHANGED} if the passed user group ID was resolved,
and th... | [
"Assign",
"the",
"passed",
"role",
"ID",
"to",
"the",
"user",
"group",
"with",
"the",
"passed",
"ID",
".",
"<br",
">",
"Note",
":",
"the",
"role",
"ID",
"must",
"not",
"be",
"checked",
"for",
"consistency"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/usergroup/UserGroupManager.java#L626-L656 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsDynamicFunctionBeanWrapper.java | CmsDynamicFunctionBeanWrapper.getJsp | public String getJsp() {
"""
Gets the JSP file name of the wrapped dynamic function bean's main format.<p>
@return a jsp file name
"""
if (m_functionBean == null) {
return "";
}
Format format = m_functionBean.getMainFormat();
CmsDynamicFunctionFormatWrapper... | java | public String getJsp() {
if (m_functionBean == null) {
return "";
}
Format format = m_functionBean.getMainFormat();
CmsDynamicFunctionFormatWrapper wrapper = new CmsDynamicFunctionFormatWrapper(m_cms, format);
return wrapper.getJsp();
} | [
"public",
"String",
"getJsp",
"(",
")",
"{",
"if",
"(",
"m_functionBean",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"Format",
"format",
"=",
"m_functionBean",
".",
"getMainFormat",
"(",
")",
";",
"CmsDynamicFunctionFormatWrapper",
"wrapper",
"=",
"... | Gets the JSP file name of the wrapped dynamic function bean's main format.<p>
@return a jsp file name | [
"Gets",
"the",
"JSP",
"file",
"name",
"of",
"the",
"wrapped",
"dynamic",
"function",
"bean",
"s",
"main",
"format",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsDynamicFunctionBeanWrapper.java#L107-L115 |
windup/windup | decompiler/impl-procyon/src/main/java/org/jboss/windup/decompiler/procyon/ProcyonDecompiler.java | ProcyonDecompiler.createFileWriter | private static synchronized FileOutputWriter createFileWriter(final TypeDefinition type, final DecompilerSettings settings)
throws IOException {
"""
Constructs the path from FQCN, validates writability, and creates a writer.
"""
final String outputDirectory = settings.getOutputDirectory... | java | private static synchronized FileOutputWriter createFileWriter(final TypeDefinition type, final DecompilerSettings settings)
throws IOException
{
final String outputDirectory = settings.getOutputDirectory();
final String fileName = type.getName() + settings.getLanguage().getFileExten... | [
"private",
"static",
"synchronized",
"FileOutputWriter",
"createFileWriter",
"(",
"final",
"TypeDefinition",
"type",
",",
"final",
"DecompilerSettings",
"settings",
")",
"throws",
"IOException",
"{",
"final",
"String",
"outputDirectory",
"=",
"settings",
".",
"getOutput... | Constructs the path from FQCN, validates writability, and creates a writer. | [
"Constructs",
"the",
"path",
"from",
"FQCN",
"validates",
"writability",
"and",
"creates",
"a",
"writer",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/decompiler/impl-procyon/src/main/java/org/jboss/windup/decompiler/procyon/ProcyonDecompiler.java#L699-L725 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/OrmElf.java | OrmElf.insertObject | public static <T> T insertObject(Connection connection, T target) throws SQLException {
"""
Insert an annotated object into the database.
@param connection a SQL connection
@param target the annotated object to insert
@param <T> the class template
@return the same object that was passed in, but with possibly... | java | public static <T> T insertObject(Connection connection, T target) throws SQLException
{
return OrmWriter.insertObject(connection, target);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"insertObject",
"(",
"Connection",
"connection",
",",
"T",
"target",
")",
"throws",
"SQLException",
"{",
"return",
"OrmWriter",
".",
"insertObject",
"(",
"connection",
",",
"target",
")",
";",
"}"
] | Insert an annotated object into the database.
@param connection a SQL connection
@param target the annotated object to insert
@param <T> the class template
@return the same object that was passed in, but with possibly updated @Id field due to auto-generated keys
@throws SQLException if a {@link SQLException} occurs | [
"Insert",
"an",
"annotated",
"object",
"into",
"the",
"database",
"."
] | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/OrmElf.java#L247-L250 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/BasicInsightRequest.java | BasicInsightRequest.withNumberAndCountry | public static BasicInsightRequest withNumberAndCountry(String number, String country) {
"""
Construct a BasicInsightRequest with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or... | java | public static BasicInsightRequest withNumberAndCountry(String number, String country) {
return new Builder(number).country(country).build();
} | [
"public",
"static",
"BasicInsightRequest",
"withNumberAndCountry",
"(",
"String",
"number",
",",
"String",
"country",
")",
"{",
"return",
"new",
"Builder",
"(",
"number",
")",
".",
"country",
"(",
"country",
")",
".",
"build",
"(",
")",
";",
"}"
] | Construct a BasicInsightRequest with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A new {@link BasicInsightRequest} obj... | [
"Construct",
"a",
"BasicInsightRequest",
"with",
"a",
"number",
"and",
"country",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/BasicInsightRequest.java#L49-L51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.