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 |
|---|---|---|---|---|---|---|---|---|---|---|
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/BaseCustomDfuImpl.java | BaseCustomDfuImpl.writePacket | private void writePacket(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final byte[] buffer, final int size) {
"""
Writes the buffer to the characteristic. The maximum size of the buffer is dependent on MTU.
This method is ASYNCHRONOUS and returns immediately after adding the data to ... | java | private void writePacket(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final byte[] buffer, final int size) {
byte[] locBuffer = buffer;
if (size <= 0) // This should never happen
return;
if (buffer.length != size) {
locBuffer = new byte[size];
System.arraycopy(buffer, 0, lo... | [
"private",
"void",
"writePacket",
"(",
"final",
"BluetoothGatt",
"gatt",
",",
"final",
"BluetoothGattCharacteristic",
"characteristic",
",",
"final",
"byte",
"[",
"]",
"buffer",
",",
"final",
"int",
"size",
")",
"{",
"byte",
"[",
"]",
"locBuffer",
"=",
"buffer... | Writes the buffer to the characteristic. The maximum size of the buffer is dependent on MTU.
This method is ASYNCHRONOUS and returns immediately after adding the data to TX queue.
@param characteristic the characteristic to write to. Should be the DFU PACKET.
@param buffer the buffer with 1-20 bytes.
@param si... | [
"Writes",
"the",
"buffer",
"to",
"the",
"characteristic",
".",
"The",
"maximum",
"size",
"of",
"the",
"buffer",
"is",
"dependent",
"on",
"MTU",
".",
"This",
"method",
"is",
"ASYNCHRONOUS",
"and",
"returns",
"immediately",
"after",
"adding",
"the",
"data",
"t... | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/BaseCustomDfuImpl.java#L412-L423 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/PathTools.java | PathTools.getVertexCountAtDistance | public static int getVertexCountAtDistance(IAtomContainer atomContainer, int distance) {
"""
Returns the number of vertices that are a distance 'd' apart.
In this method, d is the topological distance (ie edge count).
@param atomContainer The molecule to consider
@param distance The distance to conside... | java | public static int getVertexCountAtDistance(IAtomContainer atomContainer, int distance) {
int natom = atomContainer.getAtomCount();
int[][] admat = AdjacencyMatrix.getMatrix(atomContainer);
int[][] distanceMatrix = computeFloydAPSP(admat);
int matches = 0;
for (int i = 0; i < n... | [
"public",
"static",
"int",
"getVertexCountAtDistance",
"(",
"IAtomContainer",
"atomContainer",
",",
"int",
"distance",
")",
"{",
"int",
"natom",
"=",
"atomContainer",
".",
"getAtomCount",
"(",
")",
";",
"int",
"[",
"]",
"[",
"]",
"admat",
"=",
"AdjacencyMatrix... | Returns the number of vertices that are a distance 'd' apart.
In this method, d is the topological distance (ie edge count).
@param atomContainer The molecule to consider
@param distance The distance to consider
@return The number of vertices | [
"Returns",
"the",
"number",
"of",
"vertices",
"that",
"are",
"a",
"distance",
"d",
"apart",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/PathTools.java#L415-L429 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createRadioButton | public Shape createRadioButton(int x, int y, int diameter) {
"""
Return a path for a radio button's concentric sections.
@param x the X coordinate of the upper-left corner of the section
@param y the Y coordinate of the upper-left corner of the section
@param diameter the diameter of the sect... | java | public Shape createRadioButton(int x, int y, int diameter) {
return createEllipseInternal(x, y, diameter, diameter);
} | [
"public",
"Shape",
"createRadioButton",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"diameter",
")",
"{",
"return",
"createEllipseInternal",
"(",
"x",
",",
"y",
",",
"diameter",
",",
"diameter",
")",
";",
"}"
] | Return a path for a radio button's concentric sections.
@param x the X coordinate of the upper-left corner of the section
@param y the Y coordinate of the upper-left corner of the section
@param diameter the diameter of the section
@return a path representing the shape. | [
"Return",
"a",
"path",
"for",
"a",
"radio",
"button",
"s",
"concentric",
"sections",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L499-L501 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.initWorkplaceMembers | protected void initWorkplaceMembers(CmsObject cms, HttpSession session) {
"""
Initializes this workplace class instance.<p>
@param cms the user context
@param session the session
"""
m_cms = cms;
m_session = session;
// check role
try {
checkRole();
} ca... | java | protected void initWorkplaceMembers(CmsObject cms, HttpSession session) {
m_cms = cms;
m_session = session;
// check role
try {
checkRole();
} catch (CmsRoleViolationException e) {
throw new CmsIllegalStateException(e.getMessageContainer(), e);
}
... | [
"protected",
"void",
"initWorkplaceMembers",
"(",
"CmsObject",
"cms",
",",
"HttpSession",
"session",
")",
"{",
"m_cms",
"=",
"cms",
";",
"m_session",
"=",
"session",
";",
"// check role",
"try",
"{",
"checkRole",
"(",
")",
";",
"}",
"catch",
"(",
"CmsRoleVio... | Initializes this workplace class instance.<p>
@param cms the user context
@param session the session | [
"Initializes",
"this",
"workplace",
"class",
"instance",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L2340-L2378 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ResourceBundleELResolver.java | ResourceBundleELResolver.getValue | @Override
public Object getValue(ELContext context, Object base, Object property) {
"""
If the base object is an instance of ResourceBundle, the provided property will first be
coerced to a String. The Object returned by getObject on the base ResourceBundle will be
returned. If the base is ResourceBundle, the p... | java | @Override
public Object getValue(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException("context is null");
}
Object result = null;
if (isResolvable(base)) {
if (property != null) {
try {
result = ((ResourceBundle) base).getObject(property.toStri... | [
"@",
"Override",
"public",
"Object",
"getValue",
"(",
"ELContext",
"context",
",",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"context is null\"",
")",
"... | If the base object is an instance of ResourceBundle, the provided property will first be
coerced to a String. The Object returned by getObject on the base ResourceBundle will be
returned. If the base is ResourceBundle, the propertyResolved property of the ELContext
object must be set to true by this resolver, before re... | [
"If",
"the",
"base",
"object",
"is",
"an",
"instance",
"of",
"ResourceBundle",
"the",
"provided",
"property",
"will",
"first",
"be",
"coerced",
"to",
"a",
"String",
".",
"The",
"Object",
"returned",
"by",
"getObject",
"on",
"the",
"base",
"ResourceBundle",
"... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ResourceBundleELResolver.java#L161-L178 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/ExecutionChain.java | ExecutionChain.runOnBackgroundThread | public <T, U> ExecutionChain runOnBackgroundThread(Task<T, U> task) {
"""
Add a {@link Task} to be run on a {@link org.gearvrf.utility.Threads#spawn(Runnable)
background thread}. It will be run after all Tasks added prior to this
call.
@param task
{@code Task} to run
@return Reference to the {@code Executio... | java | public <T, U> ExecutionChain runOnBackgroundThread(Task<T, U> task) {
runOnThread(Context.Type.BACKGROUND, task);
return this;
} | [
"public",
"<",
"T",
",",
"U",
">",
"ExecutionChain",
"runOnBackgroundThread",
"(",
"Task",
"<",
"T",
",",
"U",
">",
"task",
")",
"{",
"runOnThread",
"(",
"Context",
".",
"Type",
".",
"BACKGROUND",
",",
"task",
")",
";",
"return",
"this",
";",
"}"
] | Add a {@link Task} to be run on a {@link org.gearvrf.utility.Threads#spawn(Runnable)
background thread}. It will be run after all Tasks added prior to this
call.
@param task
{@code Task} to run
@return Reference to the {@code ExecutionChain}.
@throws IllegalStateException
if the chain of execution has already been {@l... | [
"Add",
"a",
"{",
"@link",
"Task",
"}",
"to",
"be",
"run",
"on",
"a",
"{",
"@link",
"org",
".",
"gearvrf",
".",
"utility",
".",
"Threads#spawn",
"(",
"Runnable",
")",
"background",
"thread",
"}",
".",
"It",
"will",
"be",
"run",
"after",
"all",
"Tasks"... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/ExecutionChain.java#L302-L305 |
metafacture/metafacture-core | metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java | StringUtil.repeatChars | public static String repeatChars(final char ch, final int count) {
"""
Creates a string which contains a sequence of repeated characters.
@param ch to repeat
@param count number of repetitions
@return a string with {@code count} consisting only of {@code ch}
"""
return CharBuffer.allocate(count).t... | java | public static String repeatChars(final char ch, final int count) {
return CharBuffer.allocate(count).toString().replace('\0', ch);
} | [
"public",
"static",
"String",
"repeatChars",
"(",
"final",
"char",
"ch",
",",
"final",
"int",
"count",
")",
"{",
"return",
"CharBuffer",
".",
"allocate",
"(",
"count",
")",
".",
"toString",
"(",
")",
".",
"replace",
"(",
"'",
"'",
",",
"ch",
")",
";"... | Creates a string which contains a sequence of repeated characters.
@param ch to repeat
@param count number of repetitions
@return a string with {@code count} consisting only of {@code ch} | [
"Creates",
"a",
"string",
"which",
"contains",
"a",
"sequence",
"of",
"repeated",
"characters",
"."
] | train | https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java#L155-L157 |
undertow-io/undertow | core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java | HttpContinue.createResponseSender | public static ContinueResponseSender createResponseSender(final HttpServerExchange exchange) throws IOException {
"""
Creates a response sender that can be used to send a HTTP 100-continue response.
@param exchange The exchange
@return The response sender
"""
if (!exchange.isResponseChannelAvailabl... | java | public static ContinueResponseSender createResponseSender(final HttpServerExchange exchange) throws IOException {
if (!exchange.isResponseChannelAvailable()) {
throw UndertowMessages.MESSAGES.cannotSendContinueResponse();
}
if(exchange.getAttachment(ALREADY_SENT) != null) {
... | [
"public",
"static",
"ContinueResponseSender",
"createResponseSender",
"(",
"final",
"HttpServerExchange",
"exchange",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"exchange",
".",
"isResponseChannelAvailable",
"(",
")",
")",
"{",
"throw",
"UndertowMessages",
"."... | Creates a response sender that can be used to send a HTTP 100-continue response.
@param exchange The exchange
@return The response sender | [
"Creates",
"a",
"response",
"sender",
"that",
"can",
"be",
"used",
"to",
"send",
"a",
"HTTP",
"100",
"-",
"continue",
"response",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/protocol/http/HttpContinue.java#L115-L166 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/http/HttpServer.java | HttpServer.setThreads | public void setThreads(int min, int max) {
"""
Set the min, max number of worker threads (simultaneous connections).
"""
QueuedThreadPool pool = (QueuedThreadPool) webServer.getThreadPool() ;
pool.setMinThreads(min);
pool.setMaxThreads(max);
} | java | public void setThreads(int min, int max) {
QueuedThreadPool pool = (QueuedThreadPool) webServer.getThreadPool() ;
pool.setMinThreads(min);
pool.setMaxThreads(max);
} | [
"public",
"void",
"setThreads",
"(",
"int",
"min",
",",
"int",
"max",
")",
"{",
"QueuedThreadPool",
"pool",
"=",
"(",
"QueuedThreadPool",
")",
"webServer",
".",
"getThreadPool",
"(",
")",
";",
"pool",
".",
"setMinThreads",
"(",
"min",
")",
";",
"pool",
"... | Set the min, max number of worker threads (simultaneous connections). | [
"Set",
"the",
"min",
"max",
"number",
"of",
"worker",
"threads",
"(",
"simultaneous",
"connections",
")",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/http/HttpServer.java#L496-L500 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/DbPro.java | DbPro.queryFirst | public <T> T queryFirst(String sql, Object... paras) {
"""
Execute sql query and return the first result. I recommend add "limit 1" in your sql.
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql
@return Object[] if your sql has select more ... | java | public <T> T queryFirst(String sql, Object... paras) {
List<T> result = query(sql, paras);
return (result.size() > 0 ? result.get(0) : null);
} | [
"public",
"<",
"T",
">",
"T",
"queryFirst",
"(",
"String",
"sql",
",",
"Object",
"...",
"paras",
")",
"{",
"List",
"<",
"T",
">",
"result",
"=",
"query",
"(",
"sql",
",",
"paras",
")",
";",
"return",
"(",
"result",
".",
"size",
"(",
")",
">",
"... | Execute sql query and return the first result. I recommend add "limit 1" in your sql.
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql
@return Object[] if your sql has select more than one column,
and it return Object if your sql has select only o... | [
"Execute",
"sql",
"query",
"and",
"return",
"the",
"first",
"result",
".",
"I",
"recommend",
"add",
"limit",
"1",
"in",
"your",
"sql",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/DbPro.java#L114-L117 |
JDBDT/jdbdt | src/main/java/org/jdbdt/JDBDT.java | JDBDT.assertUnchanged | public static void assertUnchanged(String message, DataSource dataSource) throws DBAssertionError {
"""
Assert that no changes occurred for the given data source
(error message variant).
@param message Assertion error message.
@param dataSource Data source.
@throws DBAssertionError if the assertion fails.
@... | java | public static void assertUnchanged(String message, DataSource dataSource) throws DBAssertionError {
DataSet emptyDataSet = empty(dataSource);
DBAssert.deltaAssertion(CallInfo.create(message), emptyDataSet, emptyDataSet);
} | [
"public",
"static",
"void",
"assertUnchanged",
"(",
"String",
"message",
",",
"DataSource",
"dataSource",
")",
"throws",
"DBAssertionError",
"{",
"DataSet",
"emptyDataSet",
"=",
"empty",
"(",
"dataSource",
")",
";",
"DBAssert",
".",
"deltaAssertion",
"(",
"CallInf... | Assert that no changes occurred for the given data source
(error message variant).
@param message Assertion error message.
@param dataSource Data source.
@throws DBAssertionError if the assertion fails.
@see #assertDelta(DataSet,DataSet)
@see #assertDeleted(String, DataSet)
@see #assertInserted(String, DataSet) | [
"Assert",
"that",
"no",
"changes",
"occurred",
"for",
"the",
"given",
"data",
"source",
"(",
"error",
"message",
"variant",
")",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/JDBDT.java#L383-L386 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/qos/qos_stats.java | qos_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>
"""
qos_stats[] resources = new qos_stats[1];
qos_response result = (qos_response) service.get_... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
qos_stats[] resources = new qos_stats[1];
qos_response result = (qos_response) service.get_payload_formatter().string_to_resource(qos_response.class, response);
if(result.errorcode != 0) {
if (result.errorco... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"qos_stats",
"[",
"]",
"resources",
"=",
"new",
"qos_stats",
"[",
"1",
"]",
";",
"qos_response",
"result",
... | <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/qos/qos_stats.java#L867-L886 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_cluster.java | ns_cluster.modify_password | public static ns_cluster modify_password(nitro_service client, ns_cluster resource) throws Exception {
"""
<pre>
Use this operation to modify Cluster IP admin ns password.
</pre>
"""
return ((ns_cluster[]) resource.perform_operation(client, "modify_password"))[0];
} | java | public static ns_cluster modify_password(nitro_service client, ns_cluster resource) throws Exception
{
return ((ns_cluster[]) resource.perform_operation(client, "modify_password"))[0];
} | [
"public",
"static",
"ns_cluster",
"modify_password",
"(",
"nitro_service",
"client",
",",
"ns_cluster",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"ns_cluster",
"[",
"]",
")",
"resource",
".",
"perform_operation",
"(",
"client",
",",
"\"mod... | <pre>
Use this operation to modify Cluster IP admin ns password.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"modify",
"Cluster",
"IP",
"admin",
"ns",
"password",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_cluster.java#L559-L562 |
bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.contextualEncode | public static String contextualEncode(String s, Type t) {
"""
Contextually encodes the characters of string that are either non-ASCII
characters or are ASCII characters that must be percent-encoded using the
UTF-8 encoding. Percent-encoded characters will be recognized and not
double encoded.
@param s the st... | java | public static String contextualEncode(String s, Type t) {
return _encode(s, t, false, true);
} | [
"public",
"static",
"String",
"contextualEncode",
"(",
"String",
"s",
",",
"Type",
"t",
")",
"{",
"return",
"_encode",
"(",
"s",
",",
"t",
",",
"false",
",",
"true",
")",
";",
"}"
] | Contextually encodes the characters of string that are either non-ASCII
characters or are ASCII characters that must be percent-encoded using the
UTF-8 encoding. Percent-encoded characters will be recognized and not
double encoded.
@param s the string to be encoded.
@param t the URI component type identifying the ASCI... | [
"Contextually",
"encodes",
"the",
"characters",
"of",
"string",
"that",
"are",
"either",
"non",
"-",
"ASCII",
"characters",
"or",
"are",
"ASCII",
"characters",
"that",
"must",
"be",
"percent",
"-",
"encoded",
"using",
"the",
"UTF",
"-",
"8",
"encoding",
".",... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L167-L169 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.createTableAlias | private TableAlias createTableAlias(ClassDescriptor aCld, String aPath, String aUserAlias, List hints) {
"""
Create a TableAlias for path or userAlias
@param aCld
@param aPath
@param aUserAlias
@param hints a List os Class objects to be used as hints for path expressions
@return TableAlias
"""
if (aUse... | java | private TableAlias createTableAlias(ClassDescriptor aCld, String aPath, String aUserAlias, List hints)
{
if (aUserAlias == null)
{
return createTableAlias(aCld, hints, aPath);
}
else
{
return createTableAlias(aCld, hints, aUserAlias + ALIAS_SEPARATOR + aPath);
}
} | [
"private",
"TableAlias",
"createTableAlias",
"(",
"ClassDescriptor",
"aCld",
",",
"String",
"aPath",
",",
"String",
"aUserAlias",
",",
"List",
"hints",
")",
"{",
"if",
"(",
"aUserAlias",
"==",
"null",
")",
"{",
"return",
"createTableAlias",
"(",
"aCld",
",",
... | Create a TableAlias for path or userAlias
@param aCld
@param aPath
@param aUserAlias
@param hints a List os Class objects to be used as hints for path expressions
@return TableAlias | [
"Create",
"a",
"TableAlias",
"for",
"path",
"or",
"userAlias",
"@param",
"aCld",
"@param",
"aPath",
"@param",
"aUserAlias",
"@param",
"hints",
"a",
"List",
"os",
"Class",
"objects",
"to",
"be",
"used",
"as",
"hints",
"for",
"path",
"expressions",
"@return",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L1277-L1287 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/A_CmsListTab.java | A_CmsListTab.searchTreeItem | protected CmsTreeItem searchTreeItem(CmsList<? extends I_CmsListItem> list, String categoryPath) {
"""
Searches in the categories tree or list the item and returns it.<p>
@param list the list of items to start from
@param categoryPath the category id to search
@return the category item widget
"""
... | java | protected CmsTreeItem searchTreeItem(CmsList<? extends I_CmsListItem> list, String categoryPath) {
CmsTreeItem resultItem = (CmsTreeItem)list.getItem(categoryPath);
// item is not in this tree level
if (resultItem == null) {
// if list is not empty
for (int i = 0; i < li... | [
"protected",
"CmsTreeItem",
"searchTreeItem",
"(",
"CmsList",
"<",
"?",
"extends",
"I_CmsListItem",
">",
"list",
",",
"String",
"categoryPath",
")",
"{",
"CmsTreeItem",
"resultItem",
"=",
"(",
"CmsTreeItem",
")",
"list",
".",
"getItem",
"(",
"categoryPath",
")",... | Searches in the categories tree or list the item and returns it.<p>
@param list the list of items to start from
@param categoryPath the category id to search
@return the category item widget | [
"Searches",
"in",
"the",
"categories",
"tree",
"or",
"list",
"the",
"item",
"and",
"returns",
"it",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/A_CmsListTab.java#L675-L695 |
Red5/red5-server-common | src/main/java/org/red5/server/Server.java | Server.removeMapping | public boolean removeMapping(String hostName, String contextPath) {
"""
Remove mapping with given key
@param hostName
Host name
@param contextPath
Context path
@return true if mapping was removed, false if key doesn't exist
"""
log.info("Remove mapping host: {} context: {}", hostName, contextPa... | java | public boolean removeMapping(String hostName, String contextPath) {
log.info("Remove mapping host: {} context: {}", hostName, contextPath);
final String key = getKey(hostName, contextPath);
log.debug("Remove mapping: {}", key);
return (mapping.remove(key) != null);
} | [
"public",
"boolean",
"removeMapping",
"(",
"String",
"hostName",
",",
"String",
"contextPath",
")",
"{",
"log",
".",
"info",
"(",
"\"Remove mapping host: {} context: {}\"",
",",
"hostName",
",",
"contextPath",
")",
";",
"final",
"String",
"key",
"=",
"getKey",
"... | Remove mapping with given key
@param hostName
Host name
@param contextPath
Context path
@return true if mapping was removed, false if key doesn't exist | [
"Remove",
"mapping",
"with",
"given",
"key"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/Server.java#L225-L230 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanO.java | StatefulBeanO.postInvoke | @Override
public synchronized void postInvoke(int id, EJSDeployedSupport s) //LIDB2018-1
throws RemoteException {
"""
Inform this <code>SessionBeanO</code> that a method
invocation has completed on its associated enterprise bean. <p>
@param id an <code>int</code> indicating which method... | java | @Override
public synchronized void postInvoke(int id, EJSDeployedSupport s) //LIDB2018-1
throws RemoteException {
currentIsolationLevel = s.oldIsolationLevel;
if (removed) {
return;
}
switch (state) {
case IN_METHOD:
setS... | [
"@",
"Override",
"public",
"synchronized",
"void",
"postInvoke",
"(",
"int",
"id",
",",
"EJSDeployedSupport",
"s",
")",
"//LIDB2018-1",
"throws",
"RemoteException",
"{",
"currentIsolationLevel",
"=",
"s",
".",
"oldIsolationLevel",
";",
"if",
"(",
"removed",
")",
... | Inform this <code>SessionBeanO</code> that a method
invocation has completed on its associated enterprise bean. <p>
@param id an <code>int</code> indicating which method is being
invoked on this <code>BeanO</code> <p>
@param s the <code>EJSDeployedSupport</code> instance passed to
both pre and postInvoke <p> | [
"Inform",
"this",
"<code",
">",
"SessionBeanO<",
"/",
"code",
">",
"that",
"a",
"method",
"invocation",
"has",
"completed",
"on",
"its",
"associated",
"enterprise",
"bean",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanO.java#L1039-L1080 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getPrebuiltAsync | public Observable<PrebuiltEntityExtractor> getPrebuiltAsync(UUID appId, String versionId, UUID prebuiltId) {
"""
Gets information about the prebuilt entity model.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltId The prebuilt entity extractor ID.
@throws IllegalArgumentExcep... | java | public Observable<PrebuiltEntityExtractor> getPrebuiltAsync(UUID appId, String versionId, UUID prebuiltId) {
return getPrebuiltWithServiceResponseAsync(appId, versionId, prebuiltId).map(new Func1<ServiceResponse<PrebuiltEntityExtractor>, PrebuiltEntityExtractor>() {
@Override
public Preb... | [
"public",
"Observable",
"<",
"PrebuiltEntityExtractor",
">",
"getPrebuiltAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"prebuiltId",
")",
"{",
"return",
"getPrebuiltWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"prebuiltId",
... | Gets information about the prebuilt entity model.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltId The prebuilt entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PrebuiltEntityExtractor object | [
"Gets",
"information",
"about",
"the",
"prebuilt",
"entity",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4716-L4723 |
OpenTSDB/opentsdb | src/tsd/HttpSerializer.java | HttpSerializer.formatDropCachesV1 | public ChannelBuffer formatDropCachesV1(final Map<String, String> response) {
"""
Format a response from the DropCaches call
@param response A hash map with a response
@return A ChannelBuffer object to pass on to the caller
@throws BadRequestException if the plugin has not implemented this method
"""
th... | java | public ChannelBuffer formatDropCachesV1(final Map<String, String> response) {
throw new BadRequestException(HttpResponseStatus.NOT_IMPLEMENTED,
"The requested API endpoint has not been implemented",
this.getClass().getCanonicalName() +
" has not implemented formatDropCachesV1");
} | [
"public",
"ChannelBuffer",
"formatDropCachesV1",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"response",
")",
"{",
"throw",
"new",
"BadRequestException",
"(",
"HttpResponseStatus",
".",
"NOT_IMPLEMENTED",
",",
"\"The requested API endpoint has not been impleme... | Format a response from the DropCaches call
@param response A hash map with a response
@return A ChannelBuffer object to pass on to the caller
@throws BadRequestException if the plugin has not implemented this method | [
"Format",
"a",
"response",
"from",
"the",
"DropCaches",
"call"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpSerializer.java#L456-L461 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java | Dynamic.ofInvocation | public static Dynamic ofInvocation(Method method, Object... rawArgument) {
"""
Represents a constant that is resolved by invoking a {@code static} factory method.
@param method The method to invoke to create the represented constant value.
@param rawArgument The method's constant arguments.
@return A dyn... | java | public static Dynamic ofInvocation(Method method, Object... rawArgument) {
return ofInvocation(method, Arrays.asList(rawArgument));
} | [
"public",
"static",
"Dynamic",
"ofInvocation",
"(",
"Method",
"method",
",",
"Object",
"...",
"rawArgument",
")",
"{",
"return",
"ofInvocation",
"(",
"method",
",",
"Arrays",
".",
"asList",
"(",
"rawArgument",
")",
")",
";",
"}"
] | Represents a constant that is resolved by invoking a {@code static} factory method.
@param method The method to invoke to create the represented constant value.
@param rawArgument The method's constant arguments.
@return A dynamic constant that is resolved by the supplied factory method. | [
"Represents",
"a",
"constant",
"that",
"is",
"resolved",
"by",
"invoking",
"a",
"{",
"@code",
"static",
"}",
"factory",
"method",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java#L1520-L1522 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java | MessageFormatMessageFactory.newMessage | @Override
public Message newMessage(final String message, final Object... params) {
"""
Creates {@link org.apache.logging.log4j.message.StringFormattedMessage} instances.
@param message The message pattern.
@param params Parameters to the message.
@return The Message.
@see org.apache.logging.log4j.messag... | java | @Override
public Message newMessage(final String message, final Object... params) {
return new MessageFormatMessage(message, params);
} | [
"@",
"Override",
"public",
"Message",
"newMessage",
"(",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"return",
"new",
"MessageFormatMessage",
"(",
"message",
",",
"params",
")",
";",
"}"
] | Creates {@link org.apache.logging.log4j.message.StringFormattedMessage} instances.
@param message The message pattern.
@param params Parameters to the message.
@return The Message.
@see org.apache.logging.log4j.message.MessageFactory#newMessage(String, Object...) | [
"Creates",
"{",
"@link",
"org",
".",
"apache",
".",
"logging",
".",
"log4j",
".",
"message",
".",
"StringFormattedMessage",
"}",
"instances",
".",
"@param",
"message",
"The",
"message",
"pattern",
".",
"@param",
"params",
"Parameters",
"to",
"the",
"message",
... | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MessageFormatMessageFactory.java#L46-L49 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator.generateEnumerationDeclaration | protected boolean generateEnumerationDeclaration(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given enumeration declaration.
@param enumeration the enumeration.
@param it the receiver of the generated code.
@param context the context.
@return {@code... | java | protected boolean generateEnumerationDeclaration(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
if (!Strings.isEmpty(enumeration.getName())) {
it.append("class ").append(enumeration.getName()); //$NON-NLS-1$
it.append("(Enum"); //$NON-NLS-1$
it.append(newType("enum.En... | [
"protected",
"boolean",
"generateEnumerationDeclaration",
"(",
"SarlEnumeration",
"enumeration",
",",
"PyAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isEmpty",
"(",
"enumeration",
".",
"getName",
"(",
... | Generate the given enumeration declaration.
@param enumeration the enumeration.
@param it the receiver of the generated code.
@param context the context.
@return {@code true} if a declaration was generated. {@code false} if no enumeration was generated.
@since 0.8 | [
"Generate",
"the",
"given",
"enumeration",
"declaration",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java#L385-L411 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/client/ApiClient.java | ApiClient.configureAuthorizationFlow | public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) {
"""
Helper method to configure the OAuth accessCode/implicit flow parameters
@param clientId OAuth2 client ID
@param clientSecret OAuth2 client secret
@param redirectURI OAuth2 redirect uri
"""
for(Authent... | java | public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) {
for(Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
OAuth oauth = (OAuth) auth;
oauth.getTokenRequestBuilder()
.setClientId(clientId)
.s... | [
"public",
"void",
"configureAuthorizationFlow",
"(",
"String",
"clientId",
",",
"String",
"clientSecret",
",",
"String",
"redirectURI",
")",
"{",
"for",
"(",
"Authentication",
"auth",
":",
"authentications",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"auth"... | Helper method to configure the OAuth accessCode/implicit flow parameters
@param clientId OAuth2 client ID
@param clientSecret OAuth2 client secret
@param redirectURI OAuth2 redirect uri | [
"Helper",
"method",
"to",
"configure",
"the",
"OAuth",
"accessCode",
"/",
"implicit",
"flow",
"parameters"
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/client/ApiClient.java#L448-L462 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java | Execution.sendCancelRpcCall | private void sendCancelRpcCall(int numberRetries) {
"""
This method sends a CancelTask message to the instance of the assigned slot.
<p>The sending is tried up to NUM_CANCEL_CALL_TRIES times.
"""
final LogicalSlot slot = assignedResource;
if (slot != null) {
final TaskManagerGateway taskManagerGatew... | java | private void sendCancelRpcCall(int numberRetries) {
final LogicalSlot slot = assignedResource;
if (slot != null) {
final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway();
final ComponentMainThreadExecutor jobMasterMainThreadExecutor =
getVertex().getExecutionGraph().getJobMasterMainTh... | [
"private",
"void",
"sendCancelRpcCall",
"(",
"int",
"numberRetries",
")",
"{",
"final",
"LogicalSlot",
"slot",
"=",
"assignedResource",
";",
"if",
"(",
"slot",
"!=",
"null",
")",
"{",
"final",
"TaskManagerGateway",
"taskManagerGateway",
"=",
"slot",
".",
"getTas... | This method sends a CancelTask message to the instance of the assigned slot.
<p>The sending is tried up to NUM_CANCEL_CALL_TRIES times. | [
"This",
"method",
"sends",
"a",
"CancelTask",
"message",
"to",
"the",
"instance",
"of",
"the",
"assigned",
"slot",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L1184-L1204 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.openWriterSeq | public OutSegment openWriterSeq(long sequence) {
"""
Opens a new segment writer with a specified sequence. Called by the GC
which has multiple segments with the same sequence number.
@param sequence the sequence id for the new segment.
"""
int segmentSize = _segmentSizeNew;
SegmentKelp segment = _... | java | public OutSegment openWriterSeq(long sequence)
{
int segmentSize = _segmentSizeNew;
SegmentKelp segment = _segmentService.createSegment(segmentSize, getTableKey(), sequence);
addTableSegmentLength(segmentSize);
_activeSequenceSet.put(sequence, Boolean.TRUE);
return new OutSegment(_tabl... | [
"public",
"OutSegment",
"openWriterSeq",
"(",
"long",
"sequence",
")",
"{",
"int",
"segmentSize",
"=",
"_segmentSizeNew",
";",
"SegmentKelp",
"segment",
"=",
"_segmentService",
".",
"createSegment",
"(",
"segmentSize",
",",
"getTableKey",
"(",
")",
",",
"sequence"... | Opens a new segment writer with a specified sequence. Called by the GC
which has multiple segments with the same sequence number.
@param sequence the sequence id for the new segment. | [
"Opens",
"a",
"new",
"segment",
"writer",
"with",
"a",
"specified",
"sequence",
".",
"Called",
"by",
"the",
"GC",
"which",
"has",
"multiple",
"segments",
"with",
"the",
"same",
"sequence",
"number",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L523-L534 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/AddBrownPtoN_F64.java | AddBrownPtoN_F64.setK | public AddBrownPtoN_F64 setK( /**/double fx, /**/double fy, /**/double skew, /**/double cx, /**/double cy) {
"""
Specify camera calibration parameters
@param fx Focal length x-axis in pixels
@param fy Focal length y-axis in pixels
@param skew skew in pixels
@param cx camera center x-axis in pixels
@pa... | java | public AddBrownPtoN_F64 setK( /**/double fx, /**/double fy, /**/double skew, /**/double cx, /**/double cy) {
// analytic solution to matrix inverse
a11 = (double)(1.0/fx);
a12 = (double)(-skew/(fx*fy));
a13 = (double)((skew*cy - cx*fy)/(fx*fy));
a22 = (double)(1.0/fy);
a23 = (double)(-cy/fy);
return thi... | [
"public",
"AddBrownPtoN_F64",
"setK",
"(",
"/**/",
"double",
"fx",
",",
"/**/",
"double",
"fy",
",",
"/**/",
"double",
"skew",
",",
"/**/",
"double",
"cx",
",",
"/**/",
"double",
"cy",
")",
"{",
"// analytic solution to matrix inverse",
"a11",
"=",
"(",
"dou... | Specify camera calibration parameters
@param fx Focal length x-axis in pixels
@param fy Focal length y-axis in pixels
@param skew skew in pixels
@param cx camera center x-axis in pixels
@param cy center center y-axis in pixels | [
"Specify",
"camera",
"calibration",
"parameters"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/AddBrownPtoN_F64.java#L50-L60 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.integerAvg | public static <Key, Value> Aggregation<Key, Value, Integer> integerAvg() {
"""
Returns an aggregation to calculate the integer average of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@ret... | java | public static <Key, Value> Aggregation<Key, Value, Integer> integerAvg() {
return new AggregationAdapter(new IntegerAvgAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"Value",
",",
"Integer",
">",
"integerAvg",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"IntegerAvgAggregation",
"<",
"Key",
",",
"Value",
">",
"(",
... | Returns an aggregation to calculate the integer average of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the average over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"calculate",
"the",
"integer",
"average",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELECT",
"AVG",
"(",
"value",
")",
"FROM",
"x<",
"/"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L102-L104 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java | ArrayFunctions.arrayPosition | public static Expression arrayPosition(Expression expression, Expression value) {
"""
Returned expression results in the first position of value within the array, or -1.
Array position is zero-based, i.e. the first position is 0.
"""
return x("ARRAY_POSITION(" + expression.toString() + ", " + value.to... | java | public static Expression arrayPosition(Expression expression, Expression value) {
return x("ARRAY_POSITION(" + expression.toString() + ", " + value.toString() + ")");
} | [
"public",
"static",
"Expression",
"arrayPosition",
"(",
"Expression",
"expression",
",",
"Expression",
"value",
")",
"{",
"return",
"x",
"(",
"\"ARRAY_POSITION(\"",
"+",
"expression",
".",
"toString",
"(",
")",
"+",
"\", \"",
"+",
"value",
".",
"toString",
"("... | Returned expression results in the first position of value within the array, or -1.
Array position is zero-based, i.e. the first position is 0. | [
"Returned",
"expression",
"results",
"in",
"the",
"first",
"position",
"of",
"value",
"within",
"the",
"array",
"or",
"-",
"1",
".",
"Array",
"position",
"is",
"zero",
"-",
"based",
"i",
".",
"e",
".",
"the",
"first",
"position",
"is",
"0",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java#L259-L261 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOSC100ReadCallback.java | HttpOSC100ReadCallback.handleNewData | private boolean handleNewData(HttpOutboundServiceContextImpl sc, VirtualConnection vc) {
"""
Helper method to handle when new work is around and we need to parse it
and watch for errors/check for headersParsed being true.
@param sc
@param vc
@return boolean (have headers been fully parsed yet?)
"""
... | java | private boolean handleNewData(HttpOutboundServiceContextImpl sc, VirtualConnection vc) {
if (!sc.headersParsed()) {
try {
return sc.parseMessage();
} catch (Exception e) {
FFDCFilter.processException(e, getClass().getName() + ".handleNewData", "73", this);... | [
"private",
"boolean",
"handleNewData",
"(",
"HttpOutboundServiceContextImpl",
"sc",
",",
"VirtualConnection",
"vc",
")",
"{",
"if",
"(",
"!",
"sc",
".",
"headersParsed",
"(",
")",
")",
"{",
"try",
"{",
"return",
"sc",
".",
"parseMessage",
"(",
")",
";",
"}... | Helper method to handle when new work is around and we need to parse it
and watch for errors/check for headersParsed being true.
@param sc
@param vc
@return boolean (have headers been fully parsed yet?) | [
"Helper",
"method",
"to",
"handle",
"when",
"new",
"work",
"is",
"around",
"and",
"we",
"need",
"to",
"parse",
"it",
"and",
"watch",
"for",
"errors",
"/",
"check",
"for",
"headersParsed",
"being",
"true",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOSC100ReadCallback.java#L62-L77 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/auth/KeycloakAuthenticationStrategy.java | KeycloakAuthenticationStrategy.refreshToken | public OAuthAccessToken refreshToken(RequestContext requestContext, OAuthAccessToken token) {
"""
Refreshes the access token
@param requestContext request context
@param token token
@return refreshed token
"""
OAuthAccessToken result = token;
String[] scopes = token.getScopes();
String to... | java | public OAuthAccessToken refreshToken(RequestContext requestContext, OAuthAccessToken token) {
OAuthAccessToken result = token;
String[] scopes = token.getScopes();
String tokenUrl = String.format("%s/realms/%s/protocol/openid-connect/token", getServerUrl(), getRealm());
HttpPost httpPost = new... | [
"public",
"OAuthAccessToken",
"refreshToken",
"(",
"RequestContext",
"requestContext",
",",
"OAuthAccessToken",
"token",
")",
"{",
"OAuthAccessToken",
"result",
"=",
"token",
";",
"String",
"[",
"]",
"scopes",
"=",
"token",
".",
"getScopes",
"(",
")",
";",
"Stri... | Refreshes the access token
@param requestContext request context
@param token token
@return refreshed token | [
"Refreshes",
"the",
"access",
"token"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/auth/KeycloakAuthenticationStrategy.java#L148-L189 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.createShippingAddress | public ShippingAddress createShippingAddress(final String accountCode, final ShippingAddress shippingAddress) {
"""
Create a shipping address on an existing account
<p>
@param accountCode recurly account id
@param shippingAddress the shipping address request data
@return the newly created shipping address on... | java | public ShippingAddress createShippingAddress(final String accountCode, final ShippingAddress shippingAddress) {
return doPOST(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE, shippingAddress,
ShippingAddress.class);
} | [
"public",
"ShippingAddress",
"createShippingAddress",
"(",
"final",
"String",
"accountCode",
",",
"final",
"ShippingAddress",
"shippingAddress",
")",
"{",
"return",
"doPOST",
"(",
"Accounts",
".",
"ACCOUNTS_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
"+",
"ShippingAd... | Create a shipping address on an existing account
<p>
@param accountCode recurly account id
@param shippingAddress the shipping address request data
@return the newly created shipping address on success | [
"Create",
"a",
"shipping",
"address",
"on",
"an",
"existing",
"account",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1205-L1208 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getFloat | public static float getFloat(MemorySegment[] segments, int offset) {
"""
get float from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getFloat(offset);
} else {
return getFloatMultiSegments(segments, offset... | java | public static float getFloat(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getFloat(offset);
} else {
return getFloatMultiSegments(segments, offset);
}
} | [
"public",
"static",
"float",
"getFloat",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getFlo... | get float from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"float",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L852-L858 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java | MessageEventManager.sendDeliveredNotification | public void sendDeliveredNotification(Jid to, String packetID) throws NotConnectedException, InterruptedException {
"""
Sends the notification that the message was delivered to the sender of the original message.
@param to the recipient of the notification.
@param packetID the id of the message to send.
@thro... | java | public void sendDeliveredNotification(Jid to, String packetID) throws NotConnectedException, InterruptedException {
// Create the message to send
Message msg = new Message(to);
// Create a MessageEvent Package and add it to the message
MessageEvent messageEvent = new MessageEvent();
... | [
"public",
"void",
"sendDeliveredNotification",
"(",
"Jid",
"to",
",",
"String",
"packetID",
")",
"throws",
"NotConnectedException",
",",
"InterruptedException",
"{",
"// Create the message to send",
"Message",
"msg",
"=",
"new",
"Message",
"(",
"to",
")",
";",
"// C... | Sends the notification that the message was delivered to the sender of the original message.
@param to the recipient of the notification.
@param packetID the id of the message to send.
@throws NotConnectedException
@throws InterruptedException | [
"Sends",
"the",
"notification",
"that",
"the",
"message",
"was",
"delivered",
"to",
"the",
"sender",
"of",
"the",
"original",
"message",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java#L215-L225 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.getImageIdFromTag | public static String getImageIdFromTag(String imageTag, String host) throws IOException {
"""
Get image Id from imageTag using DockerBuildInfoHelper client.
@param imageTag
@param host
@return
"""
DockerClient dockerClient = null;
try {
dockerClient = getDockerClient(host);
... | java | public static String getImageIdFromTag(String imageTag, String host) throws IOException {
DockerClient dockerClient = null;
try {
dockerClient = getDockerClient(host);
return dockerClient.inspectImageCmd(imageTag).exec().getId();
} finally {
closeQuietly(docke... | [
"public",
"static",
"String",
"getImageIdFromTag",
"(",
"String",
"imageTag",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"DockerClient",
"dockerClient",
"=",
"null",
";",
"try",
"{",
"dockerClient",
"=",
"getDockerClient",
"(",
"host",
")",
";",
... | Get image Id from imageTag using DockerBuildInfoHelper client.
@param imageTag
@param host
@return | [
"Get",
"image",
"Id",
"from",
"imageTag",
"using",
"DockerBuildInfoHelper",
"client",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L34-L42 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | logging/api/src/main/java/org/wildfly/swarm/logging/LoggingFraction.java | LoggingFraction.customHandler | public LoggingFraction customHandler(String name, String module, String className, Properties properties, String formatter) {
"""
Add a CustomHandler to this logger
@param name the name of the handler
@param module the module that the handler uses
@param className the handler class name
@param pro... | java | public LoggingFraction customHandler(String name, String module, String className, Properties properties, String formatter) {
Map<Object, Object> handlerProperties = new HashMap<>();
final Enumeration<?> names = properties.propertyNames();
while (names.hasMoreElements()) {
final Stri... | [
"public",
"LoggingFraction",
"customHandler",
"(",
"String",
"name",
",",
"String",
"module",
",",
"String",
"className",
",",
"Properties",
"properties",
",",
"String",
"formatter",
")",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"handlerProperties",
"=",
... | Add a CustomHandler to this logger
@param name the name of the handler
@param module the module that the handler uses
@param className the handler class name
@param properties properties for the handler
@param formatter a pattern string for the formatter
@return this fraction | [
"Add",
"a",
"CustomHandler",
"to",
"this",
"logger"
] | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/logging/api/src/main/java/org/wildfly/swarm/logging/LoggingFraction.java#L249-L263 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/processor/http/MapUriProcessor.java | MapUriProcessor.setMapping | public void setMapping(final Map<String, String> mapping) {
"""
Set the uri mappings.
<p>
The key is a regular expression that must match uri's string form. The value will be used for the
replacement.
@param mapping the uri mappings.
"""
this.uriMapping.clear();
for (Map.Entry<String, Str... | java | public void setMapping(final Map<String, String> mapping) {
this.uriMapping.clear();
for (Map.Entry<String, String> entry: mapping.entrySet()) {
Pattern pattern = Pattern.compile(entry.getKey());
this.uriMapping.put(pattern, entry.getValue());
}
} | [
"public",
"void",
"setMapping",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"mapping",
")",
"{",
"this",
".",
"uriMapping",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"... | Set the uri mappings.
<p>
The key is a regular expression that must match uri's string form. The value will be used for the
replacement.
@param mapping the uri mappings. | [
"Set",
"the",
"uri",
"mappings",
".",
"<p",
">",
"The",
"key",
"is",
"a",
"regular",
"expression",
"that",
"must",
"match",
"uri",
"s",
"string",
"form",
".",
"The",
"value",
"will",
"be",
"used",
"for",
"the",
"replacement",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/processor/http/MapUriProcessor.java#L47-L53 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/util/Reflection.java | Reflection.buildFromConfig | public static <ComponentT> Optional<ComponentT> buildFromConfig(
InternalDriverContext context,
DriverOption classNameOption,
Class<ComponentT> expectedSuperType,
String... defaultPackages) {
"""
Tries to create an instance of a class, given an option defined in the driver configuration.
... | java | public static <ComponentT> Optional<ComponentT> buildFromConfig(
InternalDriverContext context,
DriverOption classNameOption,
Class<ComponentT> expectedSuperType,
String... defaultPackages) {
return buildFromConfig(context, null, classNameOption, expectedSuperType, defaultPackages);
} | [
"public",
"static",
"<",
"ComponentT",
">",
"Optional",
"<",
"ComponentT",
">",
"buildFromConfig",
"(",
"InternalDriverContext",
"context",
",",
"DriverOption",
"classNameOption",
",",
"Class",
"<",
"ComponentT",
">",
"expectedSuperType",
",",
"String",
"...",
"defa... | Tries to create an instance of a class, given an option defined in the driver configuration.
<p>For example:
<pre>
my-policy.class = my.package.MyPolicyImpl
</pre>
The class will be instantiated via reflection, it must have a constructor that takes a {@link
DriverContext} argument.
@param context the driver context... | [
"Tries",
"to",
"create",
"an",
"instance",
"of",
"a",
"class",
"given",
"an",
"option",
"defined",
"in",
"the",
"driver",
"configuration",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/util/Reflection.java#L86-L92 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectCanCast | void expectCanCast(Node n, JSType targetType, JSType sourceType) {
"""
Expect that the first type can be cast to the second type. The first type must have some
relationship with the second.
@param t The node traversal.
@param n The node where warnings should point.
@param targetType The type being cast to.
... | java | void expectCanCast(Node n, JSType targetType, JSType sourceType) {
if (!sourceType.canCastTo(targetType)) {
registerMismatch(
sourceType,
targetType,
report(JSError.make(n, INVALID_CAST, sourceType.toString(), targetType.toString())));
} else if (!sourceType.isSubtypeWithoutS... | [
"void",
"expectCanCast",
"(",
"Node",
"n",
",",
"JSType",
"targetType",
",",
"JSType",
"sourceType",
")",
"{",
"if",
"(",
"!",
"sourceType",
".",
"canCastTo",
"(",
"targetType",
")",
")",
"{",
"registerMismatch",
"(",
"sourceType",
",",
"targetType",
",",
... | Expect that the first type can be cast to the second type. The first type must have some
relationship with the second.
@param t The node traversal.
@param n The node where warnings should point.
@param targetType The type being cast to.
@param sourceType The type being cast from. | [
"Expect",
"that",
"the",
"first",
"type",
"can",
"be",
"cast",
"to",
"the",
"second",
"type",
".",
"The",
"first",
"type",
"must",
"have",
"some",
"relationship",
"with",
"the",
"second",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L778-L788 |
wcm-io/wcm-io-tooling | commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/install/VendorInstallerFactory.java | VendorInstallerFactory.getBaseUrl | public static String getBaseUrl(String url, Logger logger) {
"""
Returns the Base Url of a given URL with
based on its Vendors from the URL
@param url Service URL
@param logger Logger
@return Base URL if service vendor was found otherwise the given URL
"""
String answer = url;
switch (identify(url)... | java | public static String getBaseUrl(String url, Logger logger) {
String answer = url;
switch (identify(url)) {
case COMPOSUM:
answer = url.substring(0, url.indexOf(COMPOSUM_URL));
break;
case CRX:
answer = url.substring(0, url.indexOf(CRX_URL));
break;
default:
... | [
"public",
"static",
"String",
"getBaseUrl",
"(",
"String",
"url",
",",
"Logger",
"logger",
")",
"{",
"String",
"answer",
"=",
"url",
";",
"switch",
"(",
"identify",
"(",
"url",
")",
")",
"{",
"case",
"COMPOSUM",
":",
"answer",
"=",
"url",
".",
"substri... | Returns the Base Url of a given URL with
based on its Vendors from the URL
@param url Service URL
@param logger Logger
@return Base URL if service vendor was found otherwise the given URL | [
"Returns",
"the",
"Base",
"Url",
"of",
"a",
"given",
"URL",
"with",
"based",
"on",
"its",
"Vendors",
"from",
"the",
"URL"
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/crx-packmgr-helper/src/main/java/io/wcm/tooling/commons/packmgr/install/VendorInstallerFactory.java#L95-L108 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslHandler.java | SslHandler.allocateOutNetBuf | private ByteBuf allocateOutNetBuf(ChannelHandlerContext ctx, int pendingBytes, int numComponents) {
"""
Allocates an outbound network buffer for {@link SSLEngine#wrap(ByteBuffer, ByteBuffer)} which can encrypt
the specified amount of pending bytes.
"""
return allocate(ctx, engineType.calculateWrapBuff... | java | private ByteBuf allocateOutNetBuf(ChannelHandlerContext ctx, int pendingBytes, int numComponents) {
return allocate(ctx, engineType.calculateWrapBufferCapacity(this, pendingBytes, numComponents));
} | [
"private",
"ByteBuf",
"allocateOutNetBuf",
"(",
"ChannelHandlerContext",
"ctx",
",",
"int",
"pendingBytes",
",",
"int",
"numComponents",
")",
"{",
"return",
"allocate",
"(",
"ctx",
",",
"engineType",
".",
"calculateWrapBufferCapacity",
"(",
"this",
",",
"pendingByte... | Allocates an outbound network buffer for {@link SSLEngine#wrap(ByteBuffer, ByteBuffer)} which can encrypt
the specified amount of pending bytes. | [
"Allocates",
"an",
"outbound",
"network",
"buffer",
"for",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslHandler.java#L2133-L2135 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.replaceChars | public static String replaceChars(String str, char searchChar, char replaceChar) {
"""
<p>Replaces all occurrences of a character in a String with another.
This is a null-safe version of {@link String#replace(char, char)}.</p>
<p>A <code>null</code> string input returns <code>null</code>.
An empty ("") string... | java | public static String replaceChars(String str, char searchChar, char replaceChar) {
if (str == null) {
return null;
}
return str.replace(searchChar, replaceChar);
} | [
"public",
"static",
"String",
"replaceChars",
"(",
"String",
"str",
",",
"char",
"searchChar",
",",
"char",
"replaceChar",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"str",
".",
"replace",
"(",
"searchChar",... | <p>Replaces all occurrences of a character in a String with another.
This is a null-safe version of {@link String#replace(char, char)}.</p>
<p>A <code>null</code> string input returns <code>null</code>.
An empty ("") string input returns an empty string.</p>
<pre>
GosuStringUtil.replaceChars(null, *, *) = null... | [
"<p",
">",
"Replaces",
"all",
"occurrences",
"of",
"a",
"character",
"in",
"a",
"String",
"with",
"another",
".",
"This",
"is",
"a",
"null",
"-",
"safe",
"version",
"of",
"{",
"@link",
"String#replace",
"(",
"char",
"char",
")",
"}",
".",
"<",
"/",
"... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L3744-L3749 |
grpc/grpc-java | services/src/main/java/io/grpc/services/BinaryLogs.java | BinaryLogs.createBinaryLog | public static BinaryLog createBinaryLog(BinaryLogSink sink, String configStr) throws IOException {
"""
Creates a binary log with a custom {@link BinaryLogSink} for receiving the logged data,
and a config string as defined by
<a href="https://github.com/grpc/proposal/blob/master/A16-binary-logging.md">
A16-binar... | java | public static BinaryLog createBinaryLog(BinaryLogSink sink, String configStr) throws IOException {
return new BinaryLogProviderImpl(sink, configStr);
} | [
"public",
"static",
"BinaryLog",
"createBinaryLog",
"(",
"BinaryLogSink",
"sink",
",",
"String",
"configStr",
")",
"throws",
"IOException",
"{",
"return",
"new",
"BinaryLogProviderImpl",
"(",
"sink",
",",
"configStr",
")",
";",
"}"
] | Creates a binary log with a custom {@link BinaryLogSink} for receiving the logged data,
and a config string as defined by
<a href="https://github.com/grpc/proposal/blob/master/A16-binary-logging.md">
A16-binary-logging</a>. | [
"Creates",
"a",
"binary",
"log",
"with",
"a",
"custom",
"{"
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/services/src/main/java/io/grpc/services/BinaryLogs.java#L48-L50 |
3redronin/mu-server | src/main/java/io/muserver/handlers/ResourceHandlerBuilder.java | ResourceHandlerBuilder.fileOrClasspath | public static ResourceHandlerBuilder fileOrClasspath(String fileRootIfExists, String classpathRoot) {
"""
Creates a resource handler that serves from the file system if the directory exists; otherwise from the class path.
<p>
A common use case is for when you want to serve from the file path at development time ... | java | public static ResourceHandlerBuilder fileOrClasspath(String fileRootIfExists, String classpathRoot) {
Path path = Paths.get(fileRootIfExists);
if (Files.isDirectory(path)) {
return fileHandler(path);
} else {
return classpathHandler(classpathRoot);
}
} | [
"public",
"static",
"ResourceHandlerBuilder",
"fileOrClasspath",
"(",
"String",
"fileRootIfExists",
",",
"String",
"classpathRoot",
")",
"{",
"Path",
"path",
"=",
"Paths",
".",
"get",
"(",
"fileRootIfExists",
")",
";",
"if",
"(",
"Files",
".",
"isDirectory",
"("... | Creates a resource handler that serves from the file system if the directory exists; otherwise from the class path.
<p>
A common use case is for when you want to serve from the file path at development time (so you can update
files without restarting) but at deploy time resources are packaged in an uber jar.
@param fil... | [
"Creates",
"a",
"resource",
"handler",
"that",
"serves",
"from",
"the",
"file",
"system",
"if",
"the",
"directory",
"exists",
";",
"otherwise",
"from",
"the",
"class",
"path",
".",
"<p",
">",
"A",
"common",
"use",
"case",
"is",
"for",
"when",
"you",
"wan... | train | https://github.com/3redronin/mu-server/blob/51598606a3082a121fbd785348ee9770b40308e6/src/main/java/io/muserver/handlers/ResourceHandlerBuilder.java#L121-L128 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.notEmpty | @ArgumentsChecked
@Throws( {
"""
Ensures that a passed string as a parameter of the calling method is not empty.
<p>
The following example describes how to use it.
<pre>
@ArgumentsChecked
public setText(String text) {
this.text = Check.notEmpty(text, "text");
}
</pre>
@param chars
a... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class })
public static <T extends CharSequence> T notEmpty(@Nonnull final T chars, @Nullable final String name) {
notNull(chars, name);
notEmpty(chars, chars.length() == 0, name);
return chars;
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalEmptyArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"notEmpty",
"(",
"@",
"Nonnull",
"fin... | Ensures that a passed string as a parameter of the calling method is not empty.
<p>
The following example describes how to use it.
<pre>
@ArgumentsChecked
public setText(String text) {
this.text = Check.notEmpty(text, "text");
}
</pre>
@param chars
a readable sequence of {@code char} values which shou... | [
"Ensures",
"that",
"a",
"passed",
"string",
"as",
"a",
"parameter",
"of",
"the",
"calling",
"method",
"is",
"not",
"empty",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L2091-L2097 |
roboconf/roboconf-platform | core/roboconf-dm/src/main/java/net/roboconf/dm/management/ManagedApplication.java | ManagedApplication.storeAwaitingMessage | public void storeAwaitingMessage( Instance instance, Message msg ) {
"""
Stores a message to send once the root instance is online.
<p>
Can be called concurrently with {@link #removeAwaitingMessages(Instance)}.
</p>
@param instance an instance (any instance is fine, the root will be determined)
@param msg t... | java | public void storeAwaitingMessage( Instance instance, Message msg ) {
Instance scopedInstance = InstanceHelpers.findScopedInstance( instance );
this.logger.finer( "Storing message " + msg.getClass().getSimpleName() + " for instance " + scopedInstance );
// We need synchronized access to the map.
// ConcurrentH... | [
"public",
"void",
"storeAwaitingMessage",
"(",
"Instance",
"instance",
",",
"Message",
"msg",
")",
"{",
"Instance",
"scopedInstance",
"=",
"InstanceHelpers",
".",
"findScopedInstance",
"(",
"instance",
")",
";",
"this",
".",
"logger",
".",
"finer",
"(",
"\"Stori... | Stores a message to send once the root instance is online.
<p>
Can be called concurrently with {@link #removeAwaitingMessages(Instance)}.
</p>
@param instance an instance (any instance is fine, the root will be determined)
@param msg the message to store (not null) | [
"Stores",
"a",
"message",
"to",
"send",
"once",
"the",
"root",
"instance",
"is",
"online",
".",
"<p",
">",
"Can",
"be",
"called",
"concurrently",
"with",
"{",
"@link",
"#removeAwaitingMessages",
"(",
"Instance",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/management/ManagedApplication.java#L121-L137 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/CoreEnforcer.java | CoreEnforcer.newModel | public static Model newModel(String modelPath, String unused) {
"""
newModel creates a model.
@param modelPath the path of the model file.
@param unused unused parameter, just for differentiating with
newModel(String text).
@return the model.
"""
Model m = new Model();
if (!modelPath.equ... | java | public static Model newModel(String modelPath, String unused) {
Model m = new Model();
if (!modelPath.equals("")) {
m.loadModel(modelPath);
}
return m;
} | [
"public",
"static",
"Model",
"newModel",
"(",
"String",
"modelPath",
",",
"String",
"unused",
")",
"{",
"Model",
"m",
"=",
"new",
"Model",
"(",
")",
";",
"if",
"(",
"!",
"modelPath",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"m",
".",
"loadModel",
... | newModel creates a model.
@param modelPath the path of the model file.
@param unused unused parameter, just for differentiating with
newModel(String text).
@return the model. | [
"newModel",
"creates",
"a",
"model",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/CoreEnforcer.java#L98-L106 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java | SARLValidator.toLightweightTypeReference | protected LightweightTypeReference toLightweightTypeReference(JvmType type, EObject context) {
"""
Create a lightweight type reference from the given type.
@param type the type to point to.
@param context the context in which the reference is located.
@return the reference.
"""
final StandardTypeReferen... | java | protected LightweightTypeReference toLightweightTypeReference(JvmType type, EObject context) {
final StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(getServices(), context);
final LightweightTypeReferenceFactory factory = new LightweightTypeReferenceFactory(owner, false);
return factory.toLightw... | [
"protected",
"LightweightTypeReference",
"toLightweightTypeReference",
"(",
"JvmType",
"type",
",",
"EObject",
"context",
")",
"{",
"final",
"StandardTypeReferenceOwner",
"owner",
"=",
"new",
"StandardTypeReferenceOwner",
"(",
"getServices",
"(",
")",
",",
"context",
")... | Create a lightweight type reference from the given type.
@param type the type to point to.
@param context the context in which the reference is located.
@return the reference. | [
"Create",
"a",
"lightweight",
"type",
"reference",
"from",
"the",
"given",
"type",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java#L472-L476 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareGraphQuery | @Override
public MarkLogicGraphQuery prepareGraphQuery(String queryString,String baseURI) throws RepositoryException, MalformedQueryException {
"""
overload for prepareGraphQuery
@param queryString
@param baseURI
@return MarkLogicGraphQuery
@throws RepositoryException
@throws MalformedQueryException
... | java | @Override
public MarkLogicGraphQuery prepareGraphQuery(String queryString,String baseURI) throws RepositoryException, MalformedQueryException {
return prepareGraphQuery(QueryLanguage.SPARQL, queryString, baseURI);
} | [
"@",
"Override",
"public",
"MarkLogicGraphQuery",
"prepareGraphQuery",
"(",
"String",
"queryString",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"return",
"prepareGraphQuery",
"(",
"QueryLanguage",
".",
"SPARQL",
... | overload for prepareGraphQuery
@param queryString
@param baseURI
@return MarkLogicGraphQuery
@throws RepositoryException
@throws MalformedQueryException | [
"overload",
"for",
"prepareGraphQuery"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L296-L299 |
OpenLiberty/open-liberty | dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/websphere/crypto/PasswordUtil.java | PasswordUtil.passwordEncode | public static String passwordEncode(String decoded_string, String crypto_algorithm) {
"""
Encode the provided password with the algorithm. If another algorithm
is already applied, it will be removed and replaced with the new algorithm.
@param decoded_string the string to be encoded, or the encoded string.
@pa... | java | public static String passwordEncode(String decoded_string, String crypto_algorithm) {
/*
* check input:
*
* -- decoded_string: any string, any length, cannot be null,
* may start with valid (supported) crypto algorithm tag
*
* -- crypto_algorithm: any stri... | [
"public",
"static",
"String",
"passwordEncode",
"(",
"String",
"decoded_string",
",",
"String",
"crypto_algorithm",
")",
"{",
"/*\n * check input:\n * \n * -- decoded_string: any string, any length, cannot be null,\n * may start with valid (supported) crypto a... | Encode the provided password with the algorithm. If another algorithm
is already applied, it will be removed and replaced with the new algorithm.
@param decoded_string the string to be encoded, or the encoded string.
@param crypto_algorithm the algorithm to be used for encoding. The supported values are xor, aes, or h... | [
"Encode",
"the",
"provided",
"password",
"with",
"the",
"algorithm",
".",
"If",
"another",
"algorithm",
"is",
"already",
"applied",
"it",
"will",
"be",
"removed",
"and",
"replaced",
"with",
"the",
"new",
"algorithm",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/websphere/crypto/PasswordUtil.java#L442-L471 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java | ResourceLoader.getInputStreamReader | public static InputStreamReader getInputStreamReader(final File resource, final String encoding) throws IOException {
"""
Loads a resource as {@link InputStreamReader}.
@param resource
The resource to be loaded.
@param encoding
The encoding to use
@return The reader
"""
return new InputStreamReader(ge... | java | public static InputStreamReader getInputStreamReader(final File resource, final String encoding) throws IOException {
return new InputStreamReader(getInputStream(resource), encoding);
} | [
"public",
"static",
"InputStreamReader",
"getInputStreamReader",
"(",
"final",
"File",
"resource",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"return",
"new",
"InputStreamReader",
"(",
"getInputStream",
"(",
"resource",
")",
",",
"encodin... | Loads a resource as {@link InputStreamReader}.
@param resource
The resource to be loaded.
@param encoding
The encoding to use
@return The reader | [
"Loads",
"a",
"resource",
"as",
"{",
"@link",
"InputStreamReader",
"}",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java#L283-L285 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/HotSpotJavaDumperImpl.java | HotSpotJavaDumperImpl.createNewFile | private File createNewFile(File outputDir, String prefix, String extension) throws IOException {
"""
Create a dump file with a unique name.
@param outputDir the directory to contain the file
@param prefix the prefix for the filename
@param extension the file extension, not including a leading "."
@return the... | java | private File createNewFile(File outputDir, String prefix, String extension) throws IOException {
String dateTime = new SimpleDateFormat("yyyyMMdd.HHmmss").format(new Date());
File outputFile;
do {
String pid = PID == null ? "" : PID + '.';
int sequenceNumber = nextSequenc... | [
"private",
"File",
"createNewFile",
"(",
"File",
"outputDir",
",",
"String",
"prefix",
",",
"String",
"extension",
")",
"throws",
"IOException",
"{",
"String",
"dateTime",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyyMMdd.HHmmss\"",
")",
".",
"format",
"(",
"new"... | Create a dump file with a unique name.
@param outputDir the directory to contain the file
@param prefix the prefix for the filename
@param extension the file extension, not including a leading "."
@return the created file | [
"Create",
"a",
"dump",
"file",
"with",
"a",
"unique",
"name",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/HotSpotJavaDumperImpl.java#L116-L126 |
apereo/cas | support/cas-server-support-electrofence/src/main/java/org/apereo/cas/impl/calcs/BaseAuthenticationRequestRiskCalculator.java | BaseAuthenticationRequestRiskCalculator.calculateScoreBasedOnEventsCount | protected BigDecimal calculateScoreBasedOnEventsCount(final Authentication authentication,
final Collection<? extends CasEvent> events,
final long count) {
"""
Calculate score based on events count b... | java | protected BigDecimal calculateScoreBasedOnEventsCount(final Authentication authentication,
final Collection<? extends CasEvent> events,
final long count) {
if (count == events.size()) {
... | [
"protected",
"BigDecimal",
"calculateScoreBasedOnEventsCount",
"(",
"final",
"Authentication",
"authentication",
",",
"final",
"Collection",
"<",
"?",
"extends",
"CasEvent",
">",
"events",
",",
"final",
"long",
"count",
")",
"{",
"if",
"(",
"count",
"==",
"events"... | Calculate score based on events count big decimal.
@param authentication the authentication
@param events the events
@param count the count
@return the big decimal | [
"Calculate",
"score",
"based",
"on",
"events",
"count",
"big",
"decimal",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-electrofence/src/main/java/org/apereo/cas/impl/calcs/BaseAuthenticationRequestRiskCalculator.java#L97-L105 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.writeFile | public CmsFile writeFile(CmsRequestContext context, CmsFile resource) throws CmsException, CmsSecurityException {
"""
Writes a resource to the OpenCms VFS, including it's content.<p>
Applies only to resources of type <code>{@link CmsFile}</code>
i.e. resources that have a binary content attached.<p>
Certain... | java | public CmsFile writeFile(CmsRequestContext context, CmsFile resource) throws CmsException, CmsSecurityException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsFile result = null;
try {
checkOfflineProject(dbc);
checkPermissions(dbc, resource, CmsPermis... | [
"public",
"CmsFile",
"writeFile",
"(",
"CmsRequestContext",
"context",
",",
"CmsFile",
"resource",
")",
"throws",
"CmsException",
",",
"CmsSecurityException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"CmsF... | Writes a resource to the OpenCms VFS, including it's content.<p>
Applies only to resources of type <code>{@link CmsFile}</code>
i.e. resources that have a binary content attached.<p>
Certain resource types might apply content validation or transformation rules
before the resource is actually written to the VFS. The r... | [
"Writes",
"a",
"resource",
"to",
"the",
"OpenCms",
"VFS",
"including",
"it",
"s",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6636-L6650 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Cosine | public static double Cosine(IntPoint p, IntPoint q) {
"""
Gets the Cosine distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Cosine distance between x and y.
"""
return Cosine(p.x, p.y, q.x, q.y);
} | java | public static double Cosine(IntPoint p, IntPoint q) {
return Cosine(p.x, p.y, q.x, q.y);
} | [
"public",
"static",
"double",
"Cosine",
"(",
"IntPoint",
"p",
",",
"IntPoint",
"q",
")",
"{",
"return",
"Cosine",
"(",
"p",
".",
"x",
",",
"p",
".",
"y",
",",
"q",
".",
"x",
",",
"q",
".",
"y",
")",
";",
"}"
] | Gets the Cosine distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Cosine distance between x and y. | [
"Gets",
"the",
"Cosine",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L363-L365 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.sms_sendMessageWithSession | public int sms_sendMessageWithSession(Integer userId, CharSequence message)
throws FacebookException, IOException {
"""
Sends a message via SMS to the user identified by <code>userId</code>, with
the expectation that the user will reply. The SMS extended permission is required for success.
The returned mobil... | java | public int sms_sendMessageWithSession(Integer userId, CharSequence message)
throws FacebookException, IOException {
return extractInt(this.callMethod(FacebookMethod.SMS_SEND_MESSAGE,
new Pair<String, CharSequence>("uid", userId.toString()),
new Pair<... | [
"public",
"int",
"sms_sendMessageWithSession",
"(",
"Integer",
"userId",
",",
"CharSequence",
"message",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"extractInt",
"(",
"this",
".",
"callMethod",
"(",
"FacebookMethod",
".",
"SMS_SEND_MESSAGE"... | Sends a message via SMS to the user identified by <code>userId</code>, with
the expectation that the user will reply. The SMS extended permission is required for success.
The returned mobile session ID can be stored and used in {@link #sms_sendResponse} when
the user replies.
@param userId a user ID
@param message the... | [
"Sends",
"a",
"message",
"via",
"SMS",
"to",
"the",
"user",
"identified",
"by",
"<code",
">",
"userId<",
"/",
"code",
">",
"with",
"the",
"expectation",
"that",
"the",
"user",
"will",
"reply",
".",
"The",
"SMS",
"extended",
"permission",
"is",
"required",
... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1682-L1688 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/events/EventManager.java | EventManager.registerHandler | public synchronized void registerHandler(Object handler) {
"""
Register an event handler. The registration looks at the interfaces
that the handler implements. An entry is created in the event handler
map for each event interface that is implemented.
Event interfaces are named in the form [Category]Event (e.g... | java | public synchronized void registerHandler(Object handler) {
boolean validClass = false;
if (handler==null) {
throw new IllegalArgumentException("Null handler class");
}
// Get the implemented interfaces. This gets only the
// directly implemented inte... | [
"public",
"synchronized",
"void",
"registerHandler",
"(",
"Object",
"handler",
")",
"{",
"boolean",
"validClass",
"=",
"false",
";",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null handler class\"",
")",
";"... | Register an event handler. The registration looks at the interfaces
that the handler implements. An entry is created in the event handler
map for each event interface that is implemented.
Event interfaces are named in the form [Category]Event (e.g. ProductEvent)
@param handler handler class | [
"Register",
"an",
"event",
"handler",
".",
"The",
"registration",
"looks",
"at",
"the",
"interfaces",
"that",
"the",
"handler",
"implements",
".",
"An",
"entry",
"is",
"created",
"in",
"the",
"event",
"handler",
"map",
"for",
"each",
"event",
"interface",
"t... | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/events/EventManager.java#L53-L85 |
elvishew/xLog | library/src/main/java/com/elvishew/xlog/internal/util/StackTraceUtil.java | StackTraceUtil.getCroppedRealStackTrack | public static StackTraceElement[] getCroppedRealStackTrack(StackTraceElement[] stackTrace,
String stackTraceOrigin,
int maxDepth) {
"""
Get the real stack trace and then crop it with a max dept... | java | public static StackTraceElement[] getCroppedRealStackTrack(StackTraceElement[] stackTrace,
String stackTraceOrigin,
int maxDepth) {
return cropStackTrace(getRealStackTrack(stackTrace, stackTrace... | [
"public",
"static",
"StackTraceElement",
"[",
"]",
"getCroppedRealStackTrack",
"(",
"StackTraceElement",
"[",
"]",
"stackTrace",
",",
"String",
"stackTraceOrigin",
",",
"int",
"maxDepth",
")",
"{",
"return",
"cropStackTrace",
"(",
"getRealStackTrack",
"(",
"stackTrace... | Get the real stack trace and then crop it with a max depth.
@param stackTrace the full stack trace
@param maxDepth the max depth of real stack trace that will be cropped, 0 means no limitation
@return the cropped real stack trace | [
"Get",
"the",
"real",
"stack",
"trace",
"and",
"then",
"crop",
"it",
"with",
"a",
"max",
"depth",
"."
] | train | https://github.com/elvishew/xLog/blob/c6fb95555ce619d3e527f5ba6c45d4d247c5a838/library/src/main/java/com/elvishew/xlog/internal/util/StackTraceUtil.java#L72-L76 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContent.java | CmsXmlContent.initDocument | protected void initDocument(CmsObject cms, Document document, String encoding, CmsXmlContentDefinition definition) {
"""
Initializes an XML document based on the provided document, encoding and content definition.<p>
Checks the links and removes invalid ones in the initialized document.<p>
@param cms the cur... | java | protected void initDocument(CmsObject cms, Document document, String encoding, CmsXmlContentDefinition definition) {
initDocument(document, encoding, definition);
// check invalid links
if (cms != null) {
// this will remove all invalid links
getHandler().invalidateBroke... | [
"protected",
"void",
"initDocument",
"(",
"CmsObject",
"cms",
",",
"Document",
"document",
",",
"String",
"encoding",
",",
"CmsXmlContentDefinition",
"definition",
")",
"{",
"initDocument",
"(",
"document",
",",
"encoding",
",",
"definition",
")",
";",
"// check i... | Initializes an XML document based on the provided document, encoding and content definition.<p>
Checks the links and removes invalid ones in the initialized document.<p>
@param cms the current users OpenCms content
@param document the base XML document to use for initializing
@param encoding the encoding to use when ... | [
"Initializes",
"an",
"XML",
"document",
"based",
"on",
"the",
"provided",
"document",
"encoding",
"and",
"content",
"definition",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContent.java#L954-L962 |
blackfizz/EazeGraph | EazeGraphLibrary/src/main/java/org/eazegraph/lib/charts/PieChart.java | PieChart.setCurrentItem | private void setCurrentItem(int currentItem, boolean scrollIntoView) {
"""
Set the current item by index. Optionally, scroll the current item into view. This version
is for internal use--the scrollIntoView option is always true for external callers.
@param currentItem The index of the current item.
@param ... | java | private void setCurrentItem(int currentItem, boolean scrollIntoView) {
mCurrentItem = currentItem;
if (mListener != null) {
mListener.onItemFocusChanged(currentItem);
}
if (scrollIntoView) {
centerOnCurrentItem();
}
invalidateGlobal();
} | [
"private",
"void",
"setCurrentItem",
"(",
"int",
"currentItem",
",",
"boolean",
"scrollIntoView",
")",
"{",
"mCurrentItem",
"=",
"currentItem",
";",
"if",
"(",
"mListener",
"!=",
"null",
")",
"{",
"mListener",
".",
"onItemFocusChanged",
"(",
"currentItem",
")",
... | Set the current item by index. Optionally, scroll the current item into view. This version
is for internal use--the scrollIntoView option is always true for external callers.
@param currentItem The index of the current item.
@param scrollIntoView True if the pie should rotate until the current item is centered.
Fal... | [
"Set",
"the",
"current",
"item",
"by",
"index",
".",
"Optionally",
"scroll",
"the",
"current",
"item",
"into",
"view",
".",
"This",
"version",
"is",
"for",
"internal",
"use",
"--",
"the",
"scrollIntoView",
"option",
"is",
"always",
"true",
"for",
"external",... | train | https://github.com/blackfizz/EazeGraph/blob/ce5e68ecc70e154f83bbb2fcce1a970db125c1e6/EazeGraphLibrary/src/main/java/org/eazegraph/lib/charts/PieChart.java#L460-L469 |
OpenTSDB/opentsdb | src/core/Tags.java | Tags.validateString | public static void validateString(final String what, final String s) {
"""
Ensures that a given string is a valid metric name or tag name/value.
@param what A human readable description of what's being validated.
@param s The string to validate.
@throws IllegalArgumentException if the string isn't valid.
""... | java | public static void validateString(final String what, final String s) {
if (s == null) {
throw new IllegalArgumentException("Invalid " + what + ": null");
} else if ("".equals(s)) {
throw new IllegalArgumentException("Invalid " + what + ": empty string");
}
final int n = s.length();
for (... | [
"public",
"static",
"void",
"validateString",
"(",
"final",
"String",
"what",
",",
"final",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid \"",
"+",
"what",
"+",
"\": null\"",
")... | Ensures that a given string is a valid metric name or tag name/value.
@param what A human readable description of what's being validated.
@param s The string to validate.
@throws IllegalArgumentException if the string isn't valid. | [
"Ensures",
"that",
"a",
"given",
"string",
"is",
"a",
"valid",
"metric",
"name",
"or",
"tag",
"name",
"/",
"value",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Tags.java#L549-L565 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/StatementUtil.java | StatementUtil.prepareStatement | public static PreparedStatement prepareStatement(Connection conn, String sql, Collection<Object> params) throws SQLException {
"""
创建{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param params "?"对应参数列表
@return {@link PreparedStatement}
@throws SQLException SQL异常
@since 3.2.3
... | java | public static PreparedStatement prepareStatement(Connection conn, String sql, Collection<Object> params) throws SQLException {
return prepareStatement(conn, sql, params.toArray(new Object[params.size()]));
} | [
"public",
"static",
"PreparedStatement",
"prepareStatement",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Collection",
"<",
"Object",
">",
"params",
")",
"throws",
"SQLException",
"{",
"return",
"prepareStatement",
"(",
"conn",
",",
"sql",
",",
"params... | 创建{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param params "?"对应参数列表
@return {@link PreparedStatement}
@throws SQLException SQL异常
@since 3.2.3 | [
"创建",
"{",
"@link",
"PreparedStatement",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/StatementUtil.java#L124-L126 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/editor/AbstractEditor.java | AbstractEditor.getMessage | protected String getMessage(String key, Object[] params) {
"""
Method to obtain a message from the message source
defined via the services locator, at the default locale.
"""
MessageSource messageSource = ValkyrieRepository.getInstance().getApplicationConfig().messageSource();
return messageSource.getMess... | java | protected String getMessage(String key, Object[] params){
MessageSource messageSource = ValkyrieRepository.getInstance().getApplicationConfig().messageSource();
return messageSource.getMessage(key, params, Locale.getDefault());
} | [
"protected",
"String",
"getMessage",
"(",
"String",
"key",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"MessageSource",
"messageSource",
"=",
"ValkyrieRepository",
".",
"getInstance",
"(",
")",
".",
"getApplicationConfig",
"(",
")",
".",
"messageSource",
"(",
... | Method to obtain a message from the message source
defined via the services locator, at the default locale. | [
"Method",
"to",
"obtain",
"a",
"message",
"from",
"the",
"message",
"source",
"defined",
"via",
"the",
"services",
"locator",
"at",
"the",
"default",
"locale",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/editor/AbstractEditor.java#L176-L179 |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/scheduler/client/SchedulerREEF.java | SchedulerREEF.runTaskScheduler | public static void runTaskScheduler(final Configuration runtimeConf, final String[] args)
throws InjectionException, IOException, ParseException {
"""
Run the Task scheduler. If '-retain true' option is passed via command line,
the scheduler reuses evaluators to submit new Tasks.
@param runtimeConf The runti... | java | public static void runTaskScheduler(final Configuration runtimeConf, final String[] args)
throws InjectionException, IOException, ParseException {
final Tang tang = Tang.Factory.getTang();
final Configuration commandLineConf = CommandLine.parseToConfiguration(args, Retain.class);
// Merge the configur... | [
"public",
"static",
"void",
"runTaskScheduler",
"(",
"final",
"Configuration",
"runtimeConf",
",",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"InjectionException",
",",
"IOException",
",",
"ParseException",
"{",
"final",
"Tang",
"tang",
"=",
"Tang",
"."... | Run the Task scheduler. If '-retain true' option is passed via command line,
the scheduler reuses evaluators to submit new Tasks.
@param runtimeConf The runtime configuration (e.g. Local, YARN, etc)
@param args Command line arguments.
@throws InjectionException
@throws java.io.IOException | [
"Run",
"the",
"Task",
"scheduler",
".",
"If",
"-",
"retain",
"true",
"option",
"is",
"passed",
"via",
"command",
"line",
"the",
"scheduler",
"reuses",
"evaluators",
"to",
"submit",
"new",
"Tasks",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/scheduler/client/SchedulerREEF.java#L91-L102 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java | WTableRenderer.paintColumnHeadings | private void paintColumnHeadings(final WTable table, final WebXmlRenderContext renderContext) {
"""
Paints the column headings for the given table.
@param table the table to paint the headings for.
@param renderContext the RenderContext to paint to.
"""
XmlStringBuilder xml = renderContext.getWriter();
... | java | private void paintColumnHeadings(final WTable table, final WebXmlRenderContext renderContext) {
XmlStringBuilder xml = renderContext.getWriter();
int[] columnOrder = table.getColumnOrder();
TableModel model = table.getTableModel();
final int columnCount = columnOrder == null ? table.getColumnCount() : columnOrd... | [
"private",
"void",
"paintColumnHeadings",
"(",
"final",
"WTable",
"table",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
".",
"getWriter",
"(",
")",
";",
"int",
"[",
"]",
"columnOrder",
"=",
"tab... | Paints the column headings for the given table.
@param table the table to paint the headings for.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"column",
"headings",
"for",
"the",
"given",
"table",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java#L417-L438 |
ModeShape/modeshape | modeshape-schematic/src/main/java/org/modeshape/schematic/internal/document/JsonReader.java | JsonReader.readMultiple | public DocumentSequence readMultiple( InputStream stream,
boolean introspectStringValues ) {
"""
Return a {@link DocumentSequence} that can be used to pull multiple documents from the stream.
@param stream the input stream; may not be null
@param introspectStringValues... | java | public DocumentSequence readMultiple( InputStream stream,
boolean introspectStringValues ) {
return readMultiple(new InputStreamReader(stream, Json.UTF8), introspectStringValues);
} | [
"public",
"DocumentSequence",
"readMultiple",
"(",
"InputStream",
"stream",
",",
"boolean",
"introspectStringValues",
")",
"{",
"return",
"readMultiple",
"(",
"new",
"InputStreamReader",
"(",
"stream",
",",
"Json",
".",
"UTF8",
")",
",",
"introspectStringValues",
")... | Return a {@link DocumentSequence} that can be used to pull multiple documents from the stream.
@param stream the input stream; may not be null
@param introspectStringValues true if the string values should be examined for common patterns, or false otherwise
@return the sequence that can be used to get one or more Docu... | [
"Return",
"a",
"{",
"@link",
"DocumentSequence",
"}",
"that",
"can",
"be",
"used",
"to",
"pull",
"multiple",
"documents",
"from",
"the",
"stream",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/internal/document/JsonReader.java#L238-L241 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/ReplicationTaskProcessor.java | ReplicationTaskProcessor.logNetworkErrorSample | private void logNetworkErrorSample(ReplicationTask task, Throwable e) {
"""
We want to retry eagerly, but without flooding log file with tons of error entries.
As tasks are executed by a pool of threads the error logging multiplies. For example:
20 threads * 100ms delay == 200 error entries / sec worst case
Sti... | java | private void logNetworkErrorSample(ReplicationTask task, Throwable e) {
long now = System.currentTimeMillis();
if (now - lastNetworkErrorTime > 10000) {
lastNetworkErrorTime = now;
StringBuilder sb = new StringBuilder();
sb.append("Network level connection to peer ").... | [
"private",
"void",
"logNetworkErrorSample",
"(",
"ReplicationTask",
"task",
",",
"Throwable",
"e",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"now",
"-",
"lastNetworkErrorTime",
">",
"10000",
")",
"{",
"lastNe... | We want to retry eagerly, but without flooding log file with tons of error entries.
As tasks are executed by a pool of threads the error logging multiplies. For example:
20 threads * 100ms delay == 200 error entries / sec worst case
Still we would like to see the exception samples, so we print samples at regular interv... | [
"We",
"want",
"to",
"retry",
"eagerly",
"but",
"without",
"flooding",
"log",
"file",
"with",
"tons",
"of",
"error",
"entries",
".",
"As",
"tasks",
"are",
"executed",
"by",
"a",
"pool",
"of",
"threads",
"the",
"error",
"logging",
"multiplies",
".",
"For",
... | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/ReplicationTaskProcessor.java#L116-L128 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/OWLOntologyID_CustomFieldSerializer.java | OWLOntologyID_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLOntologyID instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLOntologyID instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLOntologyID",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.client.rp... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/OWLOntologyID_CustomFieldSerializer.java#L66-L69 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/text/word/Dictionary.java | Dictionary.loadWords | public void loadWords(InputStream is, int wordType) throws IOException {
"""
从流中载入一批指定类型的词条。如果某个词条在词典中已经存在,则合并。
<p>
Load a batch of word of specified type from stream. If any word already exists in the dictionary,
then the new definition will be merged into existing one.
@param is 输入流<br>The stream to read f... | java | public void loadWords(InputStream is, int wordType) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String w = null;
while ((w=br.readLine()) != null){
// Don't trim it, in case the word itself is blank. w = w.trim();
Word word = new Word();
word.setWord(w);... | [
"public",
"void",
"loadWords",
"(",
"InputStream",
"is",
",",
"int",
"wordType",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"br",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"is",
")",
")",
";",
"String",
"w",
"=",
"null",
... | 从流中载入一批指定类型的词条。如果某个词条在词典中已经存在,则合并。
<p>
Load a batch of word of specified type from stream. If any word already exists in the dictionary,
then the new definition will be merged into existing one.
@param is 输入流<br>The stream to read from.
@param wordType 类型,定义在Word类中<br>Type of the word, which is defined in the class Wo... | [
"从流中载入一批指定类型的词条。如果某个词条在词典中已经存在,则合并。",
"<p",
">",
"Load",
"a",
"batch",
"of",
"word",
"of",
"specified",
"type",
"from",
"stream",
".",
"If",
"any",
"word",
"already",
"exists",
"in",
"the",
"dictionary",
"then",
"the",
"new",
"definition",
"will",
"be",
"merge... | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/text/word/Dictionary.java#L118-L131 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.extractZipArchive | public static void extractZipArchive( File zipFile, File targetDirectory )
throws IOException {
"""
Extracts a ZIP archive in a directory.
@param zipFile a ZIP file (not null, must exist)
@param targetDirectory the target directory (may not exist but must be a directory)
@throws IOException if something went w... | java | public static void extractZipArchive( File zipFile, File targetDirectory )
throws IOException {
extractZipArchive( zipFile, targetDirectory, null, null );
} | [
"public",
"static",
"void",
"extractZipArchive",
"(",
"File",
"zipFile",
",",
"File",
"targetDirectory",
")",
"throws",
"IOException",
"{",
"extractZipArchive",
"(",
"zipFile",
",",
"targetDirectory",
",",
"null",
",",
"null",
")",
";",
"}"
] | Extracts a ZIP archive in a directory.
@param zipFile a ZIP file (not null, must exist)
@param targetDirectory the target directory (may not exist but must be a directory)
@throws IOException if something went wrong | [
"Extracts",
"a",
"ZIP",
"archive",
"in",
"a",
"directory",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L919-L923 |
legsem/legstar.avro | legstar.avro.cob2avro.hadoop/src/main/java/com/legstar/avro/cob2avro/hadoop/mapreduce/Cob2AvroJob.java | Cob2AvroJob.setInputRecordMatcher | public static void setInputRecordMatcher(Job job, Class<? extends CobolTypeFinder> matcherClass) {
"""
Sets the job input record matcher class.
@param job The job to configure.
@param matcherClass The input record matcher class.
"""
job.getConfiguration().setClass(CONF_INPUT_RECORD_MATCHER_CLASS, mat... | java | public static void setInputRecordMatcher(Job job, Class<? extends CobolTypeFinder> matcherClass) {
job.getConfiguration().setClass(CONF_INPUT_RECORD_MATCHER_CLASS, matcherClass, CobolTypeFinder.class);
} | [
"public",
"static",
"void",
"setInputRecordMatcher",
"(",
"Job",
"job",
",",
"Class",
"<",
"?",
"extends",
"CobolTypeFinder",
">",
"matcherClass",
")",
"{",
"job",
".",
"getConfiguration",
"(",
")",
".",
"setClass",
"(",
"CONF_INPUT_RECORD_MATCHER_CLASS",
",",
"... | Sets the job input record matcher class.
@param job The job to configure.
@param matcherClass The input record matcher class. | [
"Sets",
"the",
"job",
"input",
"record",
"matcher",
"class",
"."
] | train | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.cob2avro.hadoop/src/main/java/com/legstar/avro/cob2avro/hadoop/mapreduce/Cob2AvroJob.java#L80-L82 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java | NumberBindings.divideSafe | public static IntegerBinding divideSafe(ObservableIntegerValue dividend, ObservableIntegerValue divisor, int defaultValue) {
"""
An integer binding of a division that won't throw an {@link java.lang.ArithmeticException}
when a division by zero happens. See {@link #divideSafe(javafx.beans.value.ObservableIntegerVa... | java | public static IntegerBinding divideSafe(ObservableIntegerValue dividend, ObservableIntegerValue divisor, int defaultValue) {
return divideSafe(dividend, divisor, new SimpleIntegerProperty(defaultValue));
} | [
"public",
"static",
"IntegerBinding",
"divideSafe",
"(",
"ObservableIntegerValue",
"dividend",
",",
"ObservableIntegerValue",
"divisor",
",",
"int",
"defaultValue",
")",
"{",
"return",
"divideSafe",
"(",
"dividend",
",",
"divisor",
",",
"new",
"SimpleIntegerProperty",
... | An integer binding of a division that won't throw an {@link java.lang.ArithmeticException}
when a division by zero happens. See {@link #divideSafe(javafx.beans.value.ObservableIntegerValue,
javafx.beans.value.ObservableIntegerValue)}
for more information.
@param dividend the observable value used as dividend
@para... | [
"An",
"integer",
"binding",
"of",
"a",
"division",
"that",
"won",
"t",
"throw",
"an",
"{",
"@link",
"java",
".",
"lang",
".",
"ArithmeticException",
"}",
"when",
"a",
"division",
"by",
"zero",
"happens",
".",
"See",
"{",
"@link",
"#divideSafe",
"(",
"jav... | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/NumberBindings.java#L245-L247 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/conversions/explicit/ConversionHandler.java | ConversionHandler.error | private String error() {
"""
This method surrounds the explicit conversion defined with a try-catch, to handle null pointers.
@return the body wrapped
"""
Map<String, List<ConversionMethod>> conversions = xml.conversionsLoad();
String methodName = "illegalCode";
String paramater = "";
String r... | java | private String error(){
Map<String, List<ConversionMethod>> conversions = xml.conversionsLoad();
String methodName = "illegalCode";
String paramater = "";
String resource = xml.getXmlPath();
if(!isNull(resource)){
boolean isPath = isPath(resource);
methodName = !isPath ? "illegalCode... | [
"private",
"String",
"error",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"ConversionMethod",
">",
">",
"conversions",
"=",
"xml",
".",
"conversionsLoad",
"(",
")",
";",
"String",
"methodName",
"=",
"\"illegalCode\"",
";",
"String",
"paramater",
... | This method surrounds the explicit conversion defined with a try-catch, to handle null pointers.
@return the body wrapped | [
"This",
"method",
"surrounds",
"the",
"explicit",
"conversion",
"defined",
"with",
"a",
"try",
"-",
"catch",
"to",
"handle",
"null",
"pointers",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/conversions/explicit/ConversionHandler.java#L155-L175 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/RepositoryTags.java | RepositoryTags.getCompleteTagById | public String getCompleteTagById(int elementId, String characters) {
"""
returns the opening xml-tag associated with the repository element with
id <code>elementId</code>.
@return the resulting tag
"""
String result = getOpeningTagById(elementId);
result += characters;
result += ge... | java | public String getCompleteTagById(int elementId, String characters)
{
String result = getOpeningTagById(elementId);
result += characters;
result += getClosingTagById(elementId);
return result;
} | [
"public",
"String",
"getCompleteTagById",
"(",
"int",
"elementId",
",",
"String",
"characters",
")",
"{",
"String",
"result",
"=",
"getOpeningTagById",
"(",
"elementId",
")",
";",
"result",
"+=",
"characters",
";",
"result",
"+=",
"getClosingTagById",
"(",
"elem... | returns the opening xml-tag associated with the repository element with
id <code>elementId</code>.
@return the resulting tag | [
"returns",
"the",
"opening",
"xml",
"-",
"tag",
"associated",
"with",
"the",
"repository",
"element",
"with",
"id",
"<code",
">",
"elementId<",
"/",
"code",
">",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/RepositoryTags.java#L277-L283 |
kiswanij/jk-util | src/main/java/com/jk/util/datatypes/JKTypeMapping.java | JKTypeMapping.processOtherMappings | private static void processOtherMappings() {
"""
This method is used to avoid reconigure the mapping in the otherside again.
"""
codeToJavaMapping.clear();
codeToJKTypeMapping.clear();
shortListOfJKTypes.clear();
Set<Class<?>> keySet = javaToCodeMapping.keySet();
for (Class<?> clas : keySet) {
... | java | private static void processOtherMappings() {
codeToJavaMapping.clear();
codeToJKTypeMapping.clear();
shortListOfJKTypes.clear();
Set<Class<?>> keySet = javaToCodeMapping.keySet();
for (Class<?> clas : keySet) {
List<Integer> codes = javaToCodeMapping.get(clas);
for (Integer code : codes) {
c... | [
"private",
"static",
"void",
"processOtherMappings",
"(",
")",
"{",
"codeToJavaMapping",
".",
"clear",
"(",
")",
";",
"codeToJKTypeMapping",
".",
"clear",
"(",
")",
";",
"shortListOfJKTypes",
".",
"clear",
"(",
")",
";",
"Set",
"<",
"Class",
"<",
"?",
">",... | This method is used to avoid reconigure the mapping in the otherside again. | [
"This",
"method",
"is",
"used",
"to",
"avoid",
"reconigure",
"the",
"mapping",
"in",
"the",
"otherside",
"again",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/datatypes/JKTypeMapping.java#L101-L115 |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/exception/ExceptionUtils.java | ExceptionUtils.getCause | public static Throwable getCause(Throwable e, Class<? extends Throwable>... causes) {
"""
Gets the cause which are one of the given expected causes. This method is
useful when you have to find a cause within unexpected or unpredictable
exception wrappings.
@param e the exception instance to search the ca... | java | public static Throwable getCause(Throwable e, Class<? extends Throwable>... causes) {
if ((e == null) || (causes == null) || (causes.length < 1)) {
return null;
} else if (isInstance(e, causes)) {
if (((e.getCause() == null) || (e.getCause()
.equals(e) ||... | [
"public",
"static",
"Throwable",
"getCause",
"(",
"Throwable",
"e",
",",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"...",
"causes",
")",
"{",
"if",
"(",
"(",
"e",
"==",
"null",
")",
"||",
"(",
"causes",
"==",
"null",
")",
"||",
"(",
"causes",
... | Gets the cause which are one of the given expected causes. This method is
useful when you have to find a cause within unexpected or unpredictable
exception wrappings.
@param e the exception instance to search the cause on
@param causes the causes which are searched.
@return the found cause, where the first occurr... | [
"Gets",
"the",
"cause",
"which",
"are",
"one",
"of",
"the",
"given",
"expected",
"causes",
".",
"This",
"method",
"is",
"useful",
"when",
"you",
"have",
"to",
"find",
"a",
"cause",
"within",
"unexpected",
"or",
"unpredictable",
"exception",
"wrappings",
"."
... | train | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/exception/ExceptionUtils.java#L124-L141 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/loader/BufferStage.java | BufferStage.completeUploading | void completeUploading() throws IOException {
"""
Wait for all files to finish uploading and schedule stage for processing
@throws IOException raises an exception if IO error occurs
"""
LOGGER.debug("name: {}, currentSize: {}, Threshold: {},"
+ " fileCount: {}, fileBucketSize: {}",
... | java | void completeUploading() throws IOException
{
LOGGER.debug("name: {}, currentSize: {}, Threshold: {},"
+ " fileCount: {}, fileBucketSize: {}",
_file.getAbsolutePath(),
_currentSize, this._csvFileSize, _fileCount,
this._csvFileBucketSize);
_o... | [
"void",
"completeUploading",
"(",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"name: {}, currentSize: {}, Threshold: {},\"",
"+",
"\" fileCount: {}, fileBucketSize: {}\"",
",",
"_file",
".",
"getAbsolutePath",
"(",
")",
",",
"_currentSize",
",",
"t... | Wait for all files to finish uploading and schedule stage for processing
@throws IOException raises an exception if IO error occurs | [
"Wait",
"for",
"all",
"files",
"to",
"finish",
"uploading",
"and",
"schedule",
"stage",
"for",
"processing"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/loader/BufferStage.java#L239-L276 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/UtilMath.java | UtilMath.getRounded | public static int getRounded(double value, int round) {
"""
Get the rounded value.
@param value The value.
@param round The round factor (must not be equal to 0).
@return The rounded value.
@throws LionEngineException If invalid argument.
"""
Check.different(round, 0);
return (int) Math.... | java | public static int getRounded(double value, int round)
{
Check.different(round, 0);
return (int) Math.floor(value / round) * round;
} | [
"public",
"static",
"int",
"getRounded",
"(",
"double",
"value",
",",
"int",
"round",
")",
"{",
"Check",
".",
"different",
"(",
"round",
",",
"0",
")",
";",
"return",
"(",
"int",
")",
"Math",
".",
"floor",
"(",
"value",
"/",
"round",
")",
"*",
"rou... | Get the rounded value.
@param value The value.
@param round The round factor (must not be equal to 0).
@return The rounded value.
@throws LionEngineException If invalid argument. | [
"Get",
"the",
"rounded",
"value",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilMath.java#L305-L310 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java | Monitors.unregisterObject | public static void unregisterObject(String id, Object obj) {
"""
Unregister an object from the default registry. Equivalent to
{@code DefaultMonitorRegistry.getInstance().unregister(Monitors.newObjectMonitor(id, obj))}.
@param obj Previously registered using {@code Monitors.registerObject(id, obj)}
"""
... | java | public static void unregisterObject(String id, Object obj) {
DefaultMonitorRegistry.getInstance().unregister(newObjectMonitor(id, obj));
} | [
"public",
"static",
"void",
"unregisterObject",
"(",
"String",
"id",
",",
"Object",
"obj",
")",
"{",
"DefaultMonitorRegistry",
".",
"getInstance",
"(",
")",
".",
"unregister",
"(",
"newObjectMonitor",
"(",
"id",
",",
"obj",
")",
")",
";",
"}"
] | Unregister an object from the default registry. Equivalent to
{@code DefaultMonitorRegistry.getInstance().unregister(Monitors.newObjectMonitor(id, obj))}.
@param obj Previously registered using {@code Monitors.registerObject(id, obj)} | [
"Unregister",
"an",
"object",
"from",
"the",
"default",
"registry",
".",
"Equivalent",
"to",
"{",
"@code",
"DefaultMonitorRegistry",
".",
"getInstance",
"()",
".",
"unregister",
"(",
"Monitors",
".",
"newObjectMonitor",
"(",
"id",
"obj",
"))",
"}",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java#L207-L209 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/Function3Args.java | Function3Args.setArg | public void setArg(Expression arg, int argNum)
throws WrongNumberArgsException {
"""
Set an argument expression for a function. This method is called by the
XPath compiler.
@param arg non-null expression that represents the argument.
@param argNum The argument number index.
@throws WrongNumberAr... | java | public void setArg(Expression arg, int argNum)
throws WrongNumberArgsException
{
if (argNum < 2)
super.setArg(arg, argNum);
else if (2 == argNum)
{
m_arg2 = arg;
arg.exprSetParent(this);
}
else
reportWrongNumberArgs();
} | [
"public",
"void",
"setArg",
"(",
"Expression",
"arg",
",",
"int",
"argNum",
")",
"throws",
"WrongNumberArgsException",
"{",
"if",
"(",
"argNum",
"<",
"2",
")",
"super",
".",
"setArg",
"(",
"arg",
",",
"argNum",
")",
";",
"else",
"if",
"(",
"2",
"==",
... | Set an argument expression for a function. This method is called by the
XPath compiler.
@param arg non-null expression that represents the argument.
@param argNum The argument number index.
@throws WrongNumberArgsException If the argNum parameter is greater than 2. | [
"Set",
"an",
"argument",
"expression",
"for",
"a",
"function",
".",
"This",
"method",
"is",
"called",
"by",
"the",
"XPath",
"compiler",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/Function3Args.java#L77-L90 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java | ConfluenceGreenPepper.saveImplementedVersion | public void saveImplementedVersion(Page page, Integer version) {
"""
Saves the sprecified version as the Iimplemented version
@param page a {@link com.atlassian.confluence.pages.Page} object.
@param version a {@link java.lang.Integer} object.
"""
Integer previousImplementedVersion = getImplementedV... | java | public void saveImplementedVersion(Page page, Integer version) {
Integer previousImplementedVersion = getImplementedVersion(page);
if (previousImplementedVersion != null && version != null && previousImplementedVersion == version)
return;
if (previousImplementedVersion != null)
... | [
"public",
"void",
"saveImplementedVersion",
"(",
"Page",
"page",
",",
"Integer",
"version",
")",
"{",
"Integer",
"previousImplementedVersion",
"=",
"getImplementedVersion",
"(",
"page",
")",
";",
"if",
"(",
"previousImplementedVersion",
"!=",
"null",
"&&",
"version"... | Saves the sprecified version as the Iimplemented version
@param page a {@link com.atlassian.confluence.pages.Page} object.
@param version a {@link java.lang.Integer} object. | [
"Saves",
"the",
"sprecified",
"version",
"as",
"the",
"Iimplemented",
"version"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L611-L622 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DataSetFactory.java | DataSetFactory.createLineDataset | protected static JRDesignChartDataset createLineDataset(JRDesignGroup group, JRDesignGroup parentGroup, List vars, DJChart djchart) {
"""
Use vars[0] as value, user vars[1] as series
@param group
@param parentGroup
@param vars
@param djchart
@return
"""
JRDesignCategoryDataset data = new JRDesignCategor... | java | protected static JRDesignChartDataset createLineDataset(JRDesignGroup group, JRDesignGroup parentGroup, List vars, DJChart djchart) {
JRDesignCategoryDataset data = new JRDesignCategoryDataset(null);
// for (Iterator iterator = vars.iterator(); iterator.hasNext();) {
JRDesignCategorySeries serie = new JRDesignCa... | [
"protected",
"static",
"JRDesignChartDataset",
"createLineDataset",
"(",
"JRDesignGroup",
"group",
",",
"JRDesignGroup",
"parentGroup",
",",
"List",
"vars",
",",
"DJChart",
"djchart",
")",
"{",
"JRDesignCategoryDataset",
"data",
"=",
"new",
"JRDesignCategoryDataset",
"(... | Use vars[0] as value, user vars[1] as series
@param group
@param parentGroup
@param vars
@param djchart
@return | [
"Use",
"vars",
"[",
"0",
"]",
"as",
"value",
"user",
"vars",
"[",
"1",
"]",
"as",
"series"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DataSetFactory.java#L77-L114 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/tools/BrushedMetalFilter.java | BrushedMetalFilter.setRGB | public void setRGB(final BufferedImage IMAGE, final int X, final int Y, final int WIDTH, final int HEIGHT, final int[] PIXELS) {
"""
A convenience method for setting ARGB pixels in an image. This tries to avoid the performance
penalty of BufferedImage.setRGB unmanaging the image.
@param IMAGE
@param X
@param Y... | java | public void setRGB(final BufferedImage IMAGE, final int X, final int Y, final int WIDTH, final int HEIGHT, final int[] PIXELS) {
int type = IMAGE.getType();
if (type == BufferedImage.TYPE_INT_ARGB || type == BufferedImage.TYPE_INT_RGB) {
IMAGE.getRaster().setDataElements(X, Y, WIDTH, HEIGHT,... | [
"public",
"void",
"setRGB",
"(",
"final",
"BufferedImage",
"IMAGE",
",",
"final",
"int",
"X",
",",
"final",
"int",
"Y",
",",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"final",
"int",
"[",
"]",
"PIXELS",
")",
"{",
"int",
"type",
"="... | A convenience method for setting ARGB pixels in an image. This tries to avoid the performance
penalty of BufferedImage.setRGB unmanaging the image.
@param IMAGE
@param X
@param Y
@param WIDTH
@param HEIGHT
@param PIXELS | [
"A",
"convenience",
"method",
"for",
"setting",
"ARGB",
"pixels",
"in",
"an",
"image",
".",
"This",
"tries",
"to",
"avoid",
"the",
"performance",
"penalty",
"of",
"BufferedImage",
".",
"setRGB",
"unmanaging",
"the",
"image",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/tools/BrushedMetalFilter.java#L252-L259 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/headerfooter/RtfHeaderFooterGroup.java | RtfHeaderFooterGroup.setHeaderFooter | public void setHeaderFooter(HeaderFooter headerFooter, int displayAt) {
"""
Set a HeaderFooter to be displayed at a certain position
@param headerFooter The HeaderFooter to set
@param displayAt The display location to use
"""
this.mode = MODE_MULTIPLE;
switch(displayAt) {
case R... | java | public void setHeaderFooter(HeaderFooter headerFooter, int displayAt) {
this.mode = MODE_MULTIPLE;
switch(displayAt) {
case RtfHeaderFooter.DISPLAY_ALL_PAGES:
headerAll = new RtfHeaderFooter(this.document, headerFooter, this.type, displayAt);
break;
c... | [
"public",
"void",
"setHeaderFooter",
"(",
"HeaderFooter",
"headerFooter",
",",
"int",
"displayAt",
")",
"{",
"this",
".",
"mode",
"=",
"MODE_MULTIPLE",
";",
"switch",
"(",
"displayAt",
")",
"{",
"case",
"RtfHeaderFooter",
".",
"DISPLAY_ALL_PAGES",
":",
"headerAl... | Set a HeaderFooter to be displayed at a certain position
@param headerFooter The HeaderFooter to set
@param displayAt The display location to use | [
"Set",
"a",
"HeaderFooter",
"to",
"be",
"displayed",
"at",
"a",
"certain",
"position"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/headerfooter/RtfHeaderFooterGroup.java#L274-L290 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/stats/collector/WordNumberCollectorBundle.java | WordNumberCollectorBundle.addData | public WordNumberCollectorBundle addData(String key, String data) {
"""
Add data word number collector bundle.
@param key the key
@param data the data
@return the word number collector bundle
"""
if (JMString.isNumber(data))
addNumber(key, Double.valueOf(data));
else
... | java | public WordNumberCollectorBundle addData(String key, String data) {
if (JMString.isNumber(data))
addNumber(key, Double.valueOf(data));
else
addWord(key, data);
return this;
} | [
"public",
"WordNumberCollectorBundle",
"addData",
"(",
"String",
"key",
",",
"String",
"data",
")",
"{",
"if",
"(",
"JMString",
".",
"isNumber",
"(",
"data",
")",
")",
"addNumber",
"(",
"key",
",",
"Double",
".",
"valueOf",
"(",
"data",
")",
")",
";",
... | Add data word number collector bundle.
@param key the key
@param data the data
@return the word number collector bundle | [
"Add",
"data",
"word",
"number",
"collector",
"bundle",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/stats/collector/WordNumberCollectorBundle.java#L113-L119 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/marvin/image/MarvinColorModelConverter.java | MarvinColorModelConverter.rgbToBinary | public static MarvinImage rgbToBinary(MarvinImage img, int threshold) {
"""
Converts an image in RGB mode to BINARY mode
@param img image
@param threshold grays cale threshold
@return new MarvinImage instance in BINARY mode
"""
MarvinImage resultImage = new MarvinImage(img.getWidth(), img.ge... | java | public static MarvinImage rgbToBinary(MarvinImage img, int threshold) {
MarvinImage resultImage = new MarvinImage(img.getWidth(), img.getHeight(), MarvinImage.COLOR_MODEL_BINARY);
for (int y = 0; y < img.getHeight(); y++) {
for (int x = 0; x < img.getWidth(); x++) {
int gray... | [
"public",
"static",
"MarvinImage",
"rgbToBinary",
"(",
"MarvinImage",
"img",
",",
"int",
"threshold",
")",
"{",
"MarvinImage",
"resultImage",
"=",
"new",
"MarvinImage",
"(",
"img",
".",
"getWidth",
"(",
")",
",",
"img",
".",
"getHeight",
"(",
")",
",",
"Ma... | Converts an image in RGB mode to BINARY mode
@param img image
@param threshold grays cale threshold
@return new MarvinImage instance in BINARY mode | [
"Converts",
"an",
"image",
"in",
"RGB",
"mode",
"to",
"BINARY",
"mode"
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/marvin/image/MarvinColorModelConverter.java#L19-L34 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java | RunsInner.beginUpdate | public RunInner beginUpdate(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) {
"""
Patch the run properties.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param run... | java | public RunInner beginUpdate(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).toBlocking().single().body();
} | [
"public",
"RunInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"runId",
",",
"Boolean",
"isArchiveEnabled",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
... | Patch the run properties.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param runId The run ID.
@param isArchiveEnabled The value that indicates whether archiving is enabled or not.
@throws IllegalArgumentExcept... | [
"Patch",
"the",
"run",
"properties",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java#L691-L693 |
protostuff/protostuff | protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeSchema.java | RuntimeSchema.getSchema | public static <T> Schema<T> getSchema(Class<T> typeClass) {
"""
Gets the schema that was either registered or lazily initialized at runtime.
<p>
Method overload for backwards compatibility.
"""
return getSchema(typeClass, ID_STRATEGY);
} | java | public static <T> Schema<T> getSchema(Class<T> typeClass)
{
return getSchema(typeClass, ID_STRATEGY);
} | [
"public",
"static",
"<",
"T",
">",
"Schema",
"<",
"T",
">",
"getSchema",
"(",
"Class",
"<",
"T",
">",
"typeClass",
")",
"{",
"return",
"getSchema",
"(",
"typeClass",
",",
"ID_STRATEGY",
")",
";",
"}"
] | Gets the schema that was either registered or lazily initialized at runtime.
<p>
Method overload for backwards compatibility. | [
"Gets",
"the",
"schema",
"that",
"was",
"either",
"registered",
"or",
"lazily",
"initialized",
"at",
"runtime",
".",
"<p",
">",
"Method",
"overload",
"for",
"backwards",
"compatibility",
"."
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeSchema.java#L138-L141 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/WeakHashMap.java | WeakHashMap.put | public V put(K key, V value) {
"""
Associates the specified value with the specified key in this map.
If the map previously contained a mapping for this key, the old
value is replaced.
@param key key with which the specified value is to be associated.
@param value value to be associated with the specified ke... | java | public V put(K key, V value) {
Object k = maskNull(key);
int h = sun.misc.Hashing.singleWordWangJenkinsHash(k);
Entry<K,V>[] tab = getTable();
int i = indexFor(h, tab.length);
for (Entry<K,V> e = tab[i]; e != null; e = e.next) {
if (h == e.hash && eq(k, e.get())) {
... | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"Object",
"k",
"=",
"maskNull",
"(",
"key",
")",
";",
"int",
"h",
"=",
"sun",
".",
"misc",
".",
"Hashing",
".",
"singleWordWangJenkinsHash",
"(",
"k",
")",
";",
"Entry",
"<",
"K"... | Associates the specified value with the specified key in this map.
If the map previously contained a mapping for this key, the old
value is replaced.
@param key key with which the specified value is to be associated.
@param value value to be associated with the specified key.
@return the previous value associated with... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"If",
"the",
"map",
"previously",
"contained",
"a",
"mapping",
"for",
"this",
"key",
"the",
"old",
"value",
"is",
"replaced",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/WeakHashMap.java#L435-L456 |
cloudiator/sword | core/src/main/java/de/uniulm/omi/cloudiator/sword/util/IdScopeByLocations.java | IdScopeByLocations.from | public static IdScopedByLocation from(@Nullable String locationId, String id) {
"""
Creates a new scoped id using the supplied arguments.
@param locationId the location part of the id (nullable).
@param id the id part of the id (non null)
@return a new scoped id.
@throws NullPointerException if the supplied ... | java | public static IdScopedByLocation from(@Nullable String locationId, String id) {
checkNotNull(id);
checkArgument(!id.isEmpty());
if (locationId != null) {
checkArgument(!locationId.isEmpty());
}
return new SlashEncodedIdScopedByLocation(locationId, id);
} | [
"public",
"static",
"IdScopedByLocation",
"from",
"(",
"@",
"Nullable",
"String",
"locationId",
",",
"String",
"id",
")",
"{",
"checkNotNull",
"(",
"id",
")",
";",
"checkArgument",
"(",
"!",
"id",
".",
"isEmpty",
"(",
")",
")",
";",
"if",
"(",
"locationI... | Creates a new scoped id using the supplied arguments.
@param locationId the location part of the id (nullable).
@param id the id part of the id (non null)
@return a new scoped id.
@throws NullPointerException if the supplied id is null.
@throws IllegalArgumentException if the supplied strings are empty | [
"Creates",
"a",
"new",
"scoped",
"id",
"using",
"the",
"supplied",
"arguments",
"."
] | train | https://github.com/cloudiator/sword/blob/b7808ea2776c6d70d439342c403369dfc5bb26bc/core/src/main/java/de/uniulm/omi/cloudiator/sword/util/IdScopeByLocations.java#L43-L53 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java | XML.deleteAttributes | public XML deleteAttributes(Class<?> aClass,String[] attributes) {
"""
This method deletes the attributes to an existing Class.
@param aClass class to which delete the attributes
@param attributes attributes to delete
@return this instance of XML
"""
checksAttributesExistence(aClass,attributes);
i... | java | public XML deleteAttributes(Class<?> aClass,String[] attributes){
checksAttributesExistence(aClass,attributes);
if(isEmpty(findXmlClass(aClass).attributes) || findXmlClass(aClass).attributes.size()<=1)
Error.xmlWrongMethod(aClass);
for (String attributeName : attributes) {
XmlAttribute attribut... | [
"public",
"XML",
"deleteAttributes",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"String",
"[",
"]",
"attributes",
")",
"{",
"checksAttributesExistence",
"(",
"aClass",
",",
"attributes",
")",
";",
"if",
"(",
"isEmpty",
"(",
"findXmlClass",
"(",
"aClass",
... | This method deletes the attributes to an existing Class.
@param aClass class to which delete the attributes
@param attributes attributes to delete
@return this instance of XML | [
"This",
"method",
"deletes",
"the",
"attributes",
"to",
"an",
"existing",
"Class",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java#L349-L366 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/MapUtils.java | MapUtils.findAll | public static <K, V> Map<K, V> findAll(Map<K, V> map, Filter<Map.Entry<K, V>> filter) {
"""
Finds all key-value entries from the given {@link Map} accepted by the {@link Filter}.
@param <K> Class type of the key.
@param <V> Class type of the value.
@param map {@link Map} to search.
@param filter {@link Filte... | java | public static <K, V> Map<K, V> findAll(Map<K, V> map, Filter<Map.Entry<K, V>> filter) {
return filter(map, filter);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"findAll",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Filter",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"filter",
")",
"{",
"return",
"filter... | Finds all key-value entries from the given {@link Map} accepted by the {@link Filter}.
@param <K> Class type of the key.
@param <V> Class type of the value.
@param map {@link Map} to search.
@param filter {@link Filter} used to find matching key-value entries from the {@link Map}.
@return a new {@link Map} containing ... | [
"Finds",
"all",
"key",
"-",
"value",
"entries",
"from",
"the",
"given",
"{",
"@link",
"Map",
"}",
"accepted",
"by",
"the",
"{",
"@link",
"Filter",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/MapUtils.java#L145-L147 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isInnerClassAccess | public static boolean isInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) {
"""
Determine whether the given INVOKESTATIC instruction is an inner-class
field accessor method.
@param inv
the INVOKESTATIC instruction
@param cpg
the ConstantPoolGen for the method
@return true if the instruction is an inn... | java | public static boolean isInnerClassAccess(INVOKESTATIC inv, ConstantPoolGen cpg) {
String methodName = inv.getName(cpg);
return methodName.startsWith("access$");
} | [
"public",
"static",
"boolean",
"isInnerClassAccess",
"(",
"INVOKESTATIC",
"inv",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"String",
"methodName",
"=",
"inv",
".",
"getName",
"(",
"cpg",
")",
";",
"return",
"methodName",
".",
"startsWith",
"(",
"\"access$\"",
"... | Determine whether the given INVOKESTATIC instruction is an inner-class
field accessor method.
@param inv
the INVOKESTATIC instruction
@param cpg
the ConstantPoolGen for the method
@return true if the instruction is an inner-class field accessor, false
if not | [
"Determine",
"whether",
"the",
"given",
"INVOKESTATIC",
"instruction",
"is",
"an",
"inner",
"-",
"class",
"field",
"accessor",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L970-L973 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java | ZipExploder.process | public void process(File[] zipFiles, File[] jarFiles, File destDir) throws IOException {
"""
Explode source JAR and/or ZIP files into a target directory
@param zipFiles
source files
@param jarFiles
source files
@param destDir
target directory (should already exist)
@exception IOException
error creating a... | java | public void process(File[] zipFiles, File[] jarFiles, File destDir) throws IOException {
processZips(zipFiles, destDir);
processJars(jarFiles, destDir);
} | [
"public",
"void",
"process",
"(",
"File",
"[",
"]",
"zipFiles",
",",
"File",
"[",
"]",
"jarFiles",
",",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"processZips",
"(",
"zipFiles",
",",
"destDir",
")",
";",
"processJars",
"(",
"jarFiles",
",",
"... | Explode source JAR and/or ZIP files into a target directory
@param zipFiles
source files
@param jarFiles
source files
@param destDir
target directory (should already exist)
@exception IOException
error creating a target file | [
"Explode",
"source",
"JAR",
"and",
"/",
"or",
"ZIP",
"files",
"into",
"a",
"target",
"directory"
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L135-L138 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java | RuntimeExceptionsFactory.newIndexOutOfBoundsException | public static IndexOutOfBoundsException newIndexOutOfBoundsException(Throwable cause,
String message, Object... args) {
"""
Constructs and initializes a new {@link IndexOutOfBoundsException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}... | java | public static IndexOutOfBoundsException newIndexOutOfBoundsException(Throwable cause,
String message, Object... args) {
return (IndexOutOfBoundsException) new IndexOutOfBoundsException(format(message, args)).initCause(cause);
} | [
"public",
"static",
"IndexOutOfBoundsException",
"newIndexOutOfBoundsException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"(",
"IndexOutOfBoundsException",
")",
"new",
"IndexOutOfBoundsException",
"(",
"forma... | Constructs and initializes a new {@link IndexOutOfBoundsException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link IndexOutOfBoundsException} was thrown.
@param message {@link Stri... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"IndexOutOfBoundsException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java#L118-L122 |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java | CommerceUserSegmentEntryPersistenceImpl.findByG_K | @Override
public CommerceUserSegmentEntry findByG_K(long groupId, String key)
throws NoSuchUserSegmentEntryException {
"""
Returns the commerce user segment entry where groupId = ? and key = ? or throws a {@link NoSuchUserSegmentEntryException} if it could not be found.
@param groupId the group ID
@... | java | @Override
public CommerceUserSegmentEntry findByG_K(long groupId, String key)
throws NoSuchUserSegmentEntryException {
CommerceUserSegmentEntry commerceUserSegmentEntry = fetchByG_K(groupId,
key);
if (commerceUserSegmentEntry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_EN... | [
"@",
"Override",
"public",
"CommerceUserSegmentEntry",
"findByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"NoSuchUserSegmentEntryException",
"{",
"CommerceUserSegmentEntry",
"commerceUserSegmentEntry",
"=",
"fetchByG_K",
"(",
"groupId",
",",
"key",
... | Returns the commerce user segment entry where groupId = ? and key = ? or throws a {@link NoSuchUserSegmentEntryException} if it could not be found.
@param groupId the group ID
@param key the key
@return the matching commerce user segment entry
@throws NoSuchUserSegmentEntryException if a matching commerce user... | [
"Returns",
"the",
"commerce",
"user",
"segment",
"entry",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchUserSegmentEntryException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java#L995-L1022 |
crnk-project/crnk-framework | crnk-core/src/main/java/io/crnk/core/boot/CrnkBoot.java | CrnkBoot.putServerInfo | public void putServerInfo(String key, String value) {
"""
Returned in the jsonapi field with every response. See http://jsonapi.org/format/#document-top-level.
"""
serverInfo.put(key, value);
moduleRegistry.setServerInfo(serverInfo);
} | java | public void putServerInfo(String key, String value) {
serverInfo.put(key, value);
moduleRegistry.setServerInfo(serverInfo);
} | [
"public",
"void",
"putServerInfo",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"serverInfo",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"moduleRegistry",
".",
"setServerInfo",
"(",
"serverInfo",
")",
";",
"}"
] | Returned in the jsonapi field with every response. See http://jsonapi.org/format/#document-top-level. | [
"Returned",
"in",
"the",
"jsonapi",
"field",
"with",
"every",
"response",
".",
"See",
"http",
":",
"//",
"jsonapi",
".",
"org",
"/",
"format",
"/",
"#document",
"-",
"top",
"-",
"level",
"."
] | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/boot/CrnkBoot.java#L132-L136 |
googlemaps/google-maps-services-java | src/main/java/com/google/maps/PlacesApi.java | PlacesApi.queryAutocomplete | public static QueryAutocompleteRequest queryAutocomplete(GeoApiContext context, String input) {
"""
Allows you to add on-the-fly geographic query predictions to your application.
@param context The context on which to make Geo API requests.
@param input input is the text string on which to search.
@return Ret... | java | public static QueryAutocompleteRequest queryAutocomplete(GeoApiContext context, String input) {
QueryAutocompleteRequest request = new QueryAutocompleteRequest(context);
request.input(input);
return request;
} | [
"public",
"static",
"QueryAutocompleteRequest",
"queryAutocomplete",
"(",
"GeoApiContext",
"context",
",",
"String",
"input",
")",
"{",
"QueryAutocompleteRequest",
"request",
"=",
"new",
"QueryAutocompleteRequest",
"(",
"context",
")",
";",
"request",
".",
"input",
"(... | Allows you to add on-the-fly geographic query predictions to your application.
@param context The context on which to make Geo API requests.
@param input input is the text string on which to search.
@return Returns a QueryAutocompleteRequest that you can configure and execute. | [
"Allows",
"you",
"to",
"add",
"on",
"-",
"the",
"-",
"fly",
"geographic",
"query",
"predictions",
"to",
"your",
"application",
"."
] | train | https://github.com/googlemaps/google-maps-services-java/blob/23d20d1930f80e310d856d2da51d72ee0db4476b/src/main/java/com/google/maps/PlacesApi.java#L176-L180 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java | BundlePackager.getLocalResources | public static String getLocalResources(File basedir, boolean test, ProjectScanner scanner) {
"""
Gets local resources.
@param basedir the project's base directory
@param test whether or not we compute the test resources
@param scanner the project scanner to retrieve information about the sources and resour... | java | public static String getLocalResources(File basedir, boolean test, ProjectScanner scanner) {
final String basePath = basedir.getAbsolutePath();
String target = "target/classes";
if (test) {
target = "target/test-classes";
}
Set<String> files = scanner.getLocalResource... | [
"public",
"static",
"String",
"getLocalResources",
"(",
"File",
"basedir",
",",
"boolean",
"test",
",",
"ProjectScanner",
"scanner",
")",
"{",
"final",
"String",
"basePath",
"=",
"basedir",
".",
"getAbsolutePath",
"(",
")",
";",
"String",
"target",
"=",
"\"tar... | Gets local resources.
@param basedir the project's base directory
@param test whether or not we compute the test resources
@param scanner the project scanner to retrieve information about the sources and resources contained in the
project
@return the resource clause | [
"Gets",
"local",
"resources",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java#L244-L278 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_save_config.java | ns_save_config.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_save_config_responses result = (ns_save_config_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_save_config_responses result = (ns_save_config_responses) service.get_payload_formatter().string_to_resource(ns_save_config_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_save_config_responses",
"result",
"=",
"(",
"ns_save_config_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_save_config.java#L142-L159 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.