repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nspbr6_stats.java | nspbr6_stats.get | public static nspbr6_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of nspbr6_stats resource of given name .
"""
nspbr6_stats obj = new nspbr6_stats();
obj.set_name(name);
nspbr6_stats response = (nspbr6_stats) obj.stat_resource(service);
return re... | java | public static nspbr6_stats get(nitro_service service, String name) throws Exception{
nspbr6_stats obj = new nspbr6_stats();
obj.set_name(name);
nspbr6_stats response = (nspbr6_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"nspbr6_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"nspbr6_stats",
"obj",
"=",
"new",
"nspbr6_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"nspbr6_stats... | Use this API to fetch statistics of nspbr6_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"nspbr6_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nspbr6_stats.java#L229-L234 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java | JsonUtil.putEnumList | public static void putEnumList(Writer writer, List<? extends Enum<?>> values)
throws IOException {
"""
Writes the given value with the given writer.
@param writer
@param values
@throws IOException
@author vvakame
"""
if (values == null) {
writer.write("null");
} else {
startArray(writer);
... | java | public static void putEnumList(Writer writer, List<? extends Enum<?>> values)
throws IOException {
if (values == null) {
writer.write("null");
} else {
startArray(writer);
for (int i = 0; i < values.size(); i++) {
put(writer, values.get(i));
if (i != values.size() - 1) {
addSeparator(write... | [
"public",
"static",
"void",
"putEnumList",
"(",
"Writer",
"writer",
",",
"List",
"<",
"?",
"extends",
"Enum",
"<",
"?",
">",
">",
"values",
")",
"throws",
"IOException",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"... | Writes the given value with the given writer.
@param writer
@param values
@throws IOException
@author vvakame | [
"Writes",
"the",
"given",
"value",
"with",
"the",
"given",
"writer",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L602-L617 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/KAFDocument.java | KAFDocument.newRelation | public Relation newRelation(String id, Relational from, Relational to) {
"""
Creates a new relation between entities and/or sentiment features. It receives its ID as an argument. The relation is added to the document.
@param id the ID of the relation
@param from source of the relation
@param to target of the re... | java | public Relation newRelation(String id, Relational from, Relational to) {
idManager.updateCounter(AnnotationType.RELATION, id);
Relation newRelation = new Relation(id, from, to);
annotationContainer.add(newRelation, Layer.RELATIONS, AnnotationType.RELATION);
return newRelation;
} | [
"public",
"Relation",
"newRelation",
"(",
"String",
"id",
",",
"Relational",
"from",
",",
"Relational",
"to",
")",
"{",
"idManager",
".",
"updateCounter",
"(",
"AnnotationType",
".",
"RELATION",
",",
"id",
")",
";",
"Relation",
"newRelation",
"=",
"new",
"Re... | Creates a new relation between entities and/or sentiment features. It receives its ID as an argument. The relation is added to the document.
@param id the ID of the relation
@param from source of the relation
@param to target of the relation
@return a new relation | [
"Creates",
"a",
"new",
"relation",
"between",
"entities",
"and",
"/",
"or",
"sentiment",
"features",
".",
"It",
"receives",
"its",
"ID",
"as",
"an",
"argument",
".",
"The",
"relation",
"is",
"added",
"to",
"the",
"document",
"."
] | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L984-L989 |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/matchers/MobileCapabilityMatcher.java | MobileCapabilityMatcher.verifyAppiumCapabilities | private boolean verifyAppiumCapabilities(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability) {
"""
Requested capabilities compared with node capabilities when both capabilities are not blank. If requested
capability have "ANY" or "*" then matcher bypassed to next capability without compar... | java | private boolean verifyAppiumCapabilities(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability) {
for (String capabilityName : toConsider) {
Object capabilityValueObject = requestedCapability.get(capabilityName);
Object nodeValueObject = nodeCapability.get(capabilit... | [
"private",
"boolean",
"verifyAppiumCapabilities",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"nodeCapability",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"requestedCapability",
")",
"{",
"for",
"(",
"String",
"capabilityName",
":",
"toConsider",
")",
"... | Requested capabilities compared with node capabilities when both capabilities are not blank. If requested
capability have "ANY" or "*" then matcher bypassed to next capability without comparison.
@param nodeCapability capabilities from node
@param requestedCapability capabilities requested for
@return <code>true/false... | [
"Requested",
"capabilities",
"compared",
"with",
"node",
"capabilities",
"when",
"both",
"capabilities",
"are",
"not",
"blank",
".",
"If",
"requested",
"capability",
"have",
"ANY",
"or",
"*",
"then",
"matcher",
"bypassed",
"to",
"next",
"capability",
"without",
... | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/matchers/MobileCapabilityMatcher.java#L93-L112 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.listNext | public PagedList<ComputeNode> listNext(final String nextPageLink, final ComputeNodeListNextOptions computeNodeListNextOptions) {
"""
Lists the compute nodes in the specified pool.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param computeNodeListNextOptions Additional ... | java | public PagedList<ComputeNode> listNext(final String nextPageLink, final ComputeNodeListNextOptions computeNodeListNextOptions) {
ServiceResponseWithHeaders<Page<ComputeNode>, ComputeNodeListHeaders> response = listNextSinglePageAsync(nextPageLink, computeNodeListNextOptions).toBlocking().single();
retur... | [
"public",
"PagedList",
"<",
"ComputeNode",
">",
"listNext",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"ComputeNodeListNextOptions",
"computeNodeListNextOptions",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"ComputeNode",
">",
",",
"ComputeNodeL... | Lists the compute nodes in the specified pool.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param computeNodeListNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchErrorException thrown if ... | [
"Lists",
"the",
"compute",
"nodes",
"in",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L3013-L3021 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java | SqlModifyBuilder.generateSQL | public static void generateSQL(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
"""
Generate SQL.
@param method
the method
@param methodBuilder
the method builder
"""
JQLChecker jqlChecker = JQLChecker.getInstance();
methodBuilder.addCode("\n// generate sql\n");
String sql = jql... | java | public static void generateSQL(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
JQLChecker jqlChecker = JQLChecker.getInstance();
methodBuilder.addCode("\n// generate sql\n");
String sql = jqlChecker.replace(method, method.jql, new JQLReplacerListenerImpl(method) {
@Override
public Strin... | [
"public",
"static",
"void",
"generateSQL",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"JQLChecker",
"jqlChecker",
"=",
"JQLChecker",
".",
"getInstance",
"(",
")",
";",
"methodBuilder",
".",
"addCode",... | Generate SQL.
@param method
the method
@param methodBuilder
the method builder | [
"Generate",
"SQL",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java#L650-L680 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/validation/XbaseDiagnostician.java | XbaseDiagnostician.doValidateLambdaContents | @Deprecated
protected boolean doValidateLambdaContents(XClosure closure, DiagnosticChain diagnostics, Map<Object, Object> context) {
"""
This was here for EMF 2.5 compatibility and was refactored to a no-op.
"""
return true;
} | java | @Deprecated
protected boolean doValidateLambdaContents(XClosure closure, DiagnosticChain diagnostics, Map<Object, Object> context) {
return true;
} | [
"@",
"Deprecated",
"protected",
"boolean",
"doValidateLambdaContents",
"(",
"XClosure",
"closure",
",",
"DiagnosticChain",
"diagnostics",
",",
"Map",
"<",
"Object",
",",
"Object",
">",
"context",
")",
"{",
"return",
"true",
";",
"}"
] | This was here for EMF 2.5 compatibility and was refactored to a no-op. | [
"This",
"was",
"here",
"for",
"EMF",
"2",
".",
"5",
"compatibility",
"and",
"was",
"refactored",
"to",
"a",
"no",
"-",
"op",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/validation/XbaseDiagnostician.java#L49-L52 |
grycap/coreutils | coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java | Http2Client.asyncDelete | public void asyncDelete(final String url, final Callback callback) {
"""
Delete HTTP method.
@param url - URL target of this request
@param callback - is called back when the response is readable
"""
final String url2 = requireNonNull(trimToNull(url), "A non-empty URL expected");
requireNonNull(callback,... | java | public void asyncDelete(final String url, final Callback callback) {
final String url2 = requireNonNull(trimToNull(url), "A non-empty URL expected");
requireNonNull(callback, "A valid callback expected");
// prepare request
final Request request = new Request.Builder().url(url2).delete().build();
// submit re... | [
"public",
"void",
"asyncDelete",
"(",
"final",
"String",
"url",
",",
"final",
"Callback",
"callback",
")",
"{",
"final",
"String",
"url2",
"=",
"requireNonNull",
"(",
"trimToNull",
"(",
"url",
")",
",",
"\"A non-empty URL expected\"",
")",
";",
"requireNonNull",... | Delete HTTP method.
@param url - URL target of this request
@param callback - is called back when the response is readable | [
"Delete",
"HTTP",
"method",
"."
] | train | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java#L190-L197 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java | XpathUtils.asDouble | public static Double asDouble(String expression, Node node)
throws XPathExpressionException {
"""
Evaluates the specified XPath expression and returns the results as a
Double.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly vi... | java | public static Double asDouble(String expression, Node node)
throws XPathExpressionException {
return asDouble(expression, node, xpath());
} | [
"public",
"static",
"Double",
"asDouble",
"(",
"String",
"expression",
",",
"Node",
"node",
")",
"throws",
"XPathExpressionException",
"{",
"return",
"asDouble",
"(",
"expression",
",",
"node",
",",
"xpath",
"(",
")",
")",
";",
"}"
] | Evaluates the specified XPath expression and returns the results as a
Double.
<p>
This method can be expensive as a new xpath is instantiated per
invocation. Consider passing in the xpath explicitly via {
{@link #asDouble(String, Node, XPath)} instead. Note {@link XPath} is
not thread-safe and not reentrant.
@param e... | [
"Evaluates",
"the",
"specified",
"XPath",
"expression",
"and",
"returns",
"the",
"results",
"as",
"a",
"Double",
".",
"<p",
">",
"This",
"method",
"can",
"be",
"expensive",
"as",
"a",
"new",
"xpath",
"is",
"instantiated",
"per",
"invocation",
".",
"Consider"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XpathUtils.java#L208-L211 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/Jenkins.java | Jenkins.onRenamed | public void onRenamed(TopLevelItem job, String oldName, String newName) throws IOException {
"""
Called by {@link Job#renameTo(String)} to update relevant data structure.
assumed to be synchronized on Jenkins by the caller.
"""
items.remove(oldName);
items.put(newName,job);
// For com... | java | public void onRenamed(TopLevelItem job, String oldName, String newName) throws IOException {
items.remove(oldName);
items.put(newName,job);
// For compatibility with old views:
for (View v : views)
v.onJobRenamed(job, oldName, newName);
} | [
"public",
"void",
"onRenamed",
"(",
"TopLevelItem",
"job",
",",
"String",
"oldName",
",",
"String",
"newName",
")",
"throws",
"IOException",
"{",
"items",
".",
"remove",
"(",
"oldName",
")",
";",
"items",
".",
"put",
"(",
"newName",
",",
"job",
")",
";",... | Called by {@link Job#renameTo(String)} to update relevant data structure.
assumed to be synchronized on Jenkins by the caller. | [
"Called",
"by",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2936-L2943 |
mp911de/visualizr | visualizr-metrics/src/main/java/biz/paluch/visualizr/metrics/VisualizrReporter.java | VisualizrReporter.reportTimer | private void reportTimer(String name, Timer timer) {
"""
Report a timer using fields max/mean/min/stddev,p50/p75/p95/p98/p99/p999/calls/m1_rate/m5_rate/m15_rate/mean_rate
@param name
@param timer
"""
final Snapshot snapshot = timer.getSnapshot();
String prefixedName = prefix(name);
... | java | private void reportTimer(String name, Timer timer) {
final Snapshot snapshot = timer.getSnapshot();
String prefixedName = prefix(name);
if (!snapshots.hasDescriptor(prefixedName)) {
MetricItem.Builder builder = MetricItem.Builder.create();
builder.duration("max", duratio... | [
"private",
"void",
"reportTimer",
"(",
"String",
"name",
",",
"Timer",
"timer",
")",
"{",
"final",
"Snapshot",
"snapshot",
"=",
"timer",
".",
"getSnapshot",
"(",
")",
";",
"String",
"prefixedName",
"=",
"prefix",
"(",
"name",
")",
";",
"if",
"(",
"!",
... | Report a timer using fields max/mean/min/stddev,p50/p75/p95/p98/p99/p999/calls/m1_rate/m5_rate/m15_rate/mean_rate
@param name
@param timer | [
"Report",
"a",
"timer",
"using",
"fields",
"max",
"/",
"mean",
"/",
"min",
"/",
"stddev",
"p50",
"/",
"p75",
"/",
"p95",
"/",
"p98",
"/",
"p99",
"/",
"p999",
"/",
"calls",
"/",
"m1_rate",
"/",
"m5_rate",
"/",
"m15_rate",
"/",
"mean_rate"
] | train | https://github.com/mp911de/visualizr/blob/57206391692e88b2c59d52d4f18faa4cdfd32a98/visualizr-metrics/src/main/java/biz/paluch/visualizr/metrics/VisualizrReporter.java#L86-L134 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SpecializedOps_DDRM.java | SpecializedOps_DDRM.copyChangeRow | public static DMatrixRMaj copyChangeRow(int order[] , DMatrixRMaj src , DMatrixRMaj dst ) {
"""
Creates a copy of a matrix but swaps the rows as specified by the order array.
@param order Specifies which row in the dest corresponds to a row in the src. Not modified.
@param src The original matrix. Not modified... | java | public static DMatrixRMaj copyChangeRow(int order[] , DMatrixRMaj src , DMatrixRMaj dst )
{
if( dst == null ) {
dst = new DMatrixRMaj(src.numRows,src.numCols);
} else if( src.numRows != dst.numRows || src.numCols != dst.numCols ) {
throw new IllegalArgumentException("src and ... | [
"public",
"static",
"DMatrixRMaj",
"copyChangeRow",
"(",
"int",
"order",
"[",
"]",
",",
"DMatrixRMaj",
"src",
",",
"DMatrixRMaj",
"dst",
")",
"{",
"if",
"(",
"dst",
"==",
"null",
")",
"{",
"dst",
"=",
"new",
"DMatrixRMaj",
"(",
"src",
".",
"numRows",
"... | Creates a copy of a matrix but swaps the rows as specified by the order array.
@param order Specifies which row in the dest corresponds to a row in the src. Not modified.
@param src The original matrix. Not modified.
@param dst A Matrix that is a row swapped copy of src. Modified. | [
"Creates",
"a",
"copy",
"of",
"a",
"matrix",
"but",
"swaps",
"the",
"rows",
"as",
"specified",
"by",
"the",
"order",
"array",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SpecializedOps_DDRM.java#L97-L113 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java | CmsXmlContainerPageFactory.getCache | private static CmsXmlContainerPage getCache(CmsObject cms, CmsResource resource, boolean keepEncoding) {
"""
Returns the cached container page.<p>
@param cms the cms context
@param resource the container page resource
@param keepEncoding if to keep the encoding while unmarshalling
@return the cached contai... | java | private static CmsXmlContainerPage getCache(CmsObject cms, CmsResource resource, boolean keepEncoding) {
if (resource instanceof I_CmsHistoryResource) {
return null;
}
return getCache().getCacheContainerPage(
getCache().getCacheKey(resource.getStructureId(), keepEncoding... | [
"private",
"static",
"CmsXmlContainerPage",
"getCache",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"boolean",
"keepEncoding",
")",
"{",
"if",
"(",
"resource",
"instanceof",
"I_CmsHistoryResource",
")",
"{",
"return",
"null",
";",
"}",
"return",
... | Returns the cached container page.<p>
@param cms the cms context
@param resource the container page resource
@param keepEncoding if to keep the encoding while unmarshalling
@return the cached container page, or <code>null</code> if not found | [
"Returns",
"the",
"cached",
"container",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPageFactory.java#L436-L444 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.checkTypeVariableSignature | private static int checkTypeVariableSignature(final String signature,
int pos) {
"""
Checks a type variable signature.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the ch... | java | private static int checkTypeVariableSignature(final String signature,
int pos) {
// TypeVariableSignature:
// T Identifier ;
pos = checkChar('T', signature, pos);
pos = checkIdentifier(signature, pos);
return checkChar(';', signature, pos);
} | [
"private",
"static",
"int",
"checkTypeVariableSignature",
"(",
"final",
"String",
"signature",
",",
"int",
"pos",
")",
"{",
"// TypeVariableSignature:",
"// T Identifier ;",
"pos",
"=",
"checkChar",
"(",
"'",
"'",
",",
"signature",
",",
"pos",
")",
";",
"pos",
... | Checks a type variable signature.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part. | [
"Checks",
"a",
"type",
"variable",
"signature",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L920-L928 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/io/Closeables.java | Closeables.closeableFrom | public static Closeable closeableFrom(@WillNotClose @Nullable final Connection connection) {
"""
Provides {@link Closeable} interface for {@link Connection}
@param connection the connection to decorate
@return a closeable decorated connection
"""
return closeableFrom(connection, Connection::close);... | java | public static Closeable closeableFrom(@WillNotClose @Nullable final Connection connection) {
return closeableFrom(connection, Connection::close);
} | [
"public",
"static",
"Closeable",
"closeableFrom",
"(",
"@",
"WillNotClose",
"@",
"Nullable",
"final",
"Connection",
"connection",
")",
"{",
"return",
"closeableFrom",
"(",
"connection",
",",
"Connection",
"::",
"close",
")",
";",
"}"
] | Provides {@link Closeable} interface for {@link Connection}
@param connection the connection to decorate
@return a closeable decorated connection | [
"Provides",
"{",
"@link",
"Closeable",
"}",
"interface",
"for",
"{",
"@link",
"Connection",
"}"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/io/Closeables.java#L38-L40 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/queue/AsynchConsumerQueue.java | AsynchConsumerQueue.put | public void put(QueueData queueData, short msgBatch) // f200337 {
"""
Places a message onto the queue.
@param queueData
The data which comprises the message to queue.
@param msgBatch
The message batch number.
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,... | java | public void put(QueueData queueData, short msgBatch) // f200337
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "put", new Object[] {queueData, ""+msgBatch});
synchronized(this)
{
if (!ordered && batchesReady == 1)
{
// A non-o... | [
"public",
"void",
"put",
"(",
"QueueData",
"queueData",
",",
"short",
"msgBatch",
")",
"// f200337",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this... | Places a message onto the queue.
@param queueData
The data which comprises the message to queue.
@param msgBatch
The message batch number. | [
"Places",
"a",
"message",
"onto",
"the",
"queue",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/queue/AsynchConsumerQueue.java#L94-L129 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java | DateIntervalFormat.getInstance | public static final DateIntervalFormat getInstance(String skeleton,
Locale locale,
DateIntervalInfo dtitvinf) {
"""
Construct a DateIntervalFormat from skeleton
a DateIntervalInfo, and the given locale.
This is a... | java | public static final DateIntervalFormat getInstance(String skeleton,
Locale locale,
DateIntervalInfo dtitvinf)
{
return getInstance(skeleton, ULocale.forLocale(locale), dtitvinf);
} | [
"public",
"static",
"final",
"DateIntervalFormat",
"getInstance",
"(",
"String",
"skeleton",
",",
"Locale",
"locale",
",",
"DateIntervalInfo",
"dtitvinf",
")",
"{",
"return",
"getInstance",
"(",
"skeleton",
",",
"ULocale",
".",
"forLocale",
"(",
"locale",
")",
"... | Construct a DateIntervalFormat from skeleton
a DateIntervalInfo, and the given locale.
This is a convenient override of
getInstance(String skeleton, ULocale locale, DateIntervalInfo dtitvinf)
<p>Example code:{@sample external/icu/android_icu4j/src/samples/java/android/icu/samples/text/dateintervalformat/DateIntervalF... | [
"Construct",
"a",
"DateIntervalFormat",
"from",
"skeleton",
"a",
"DateIntervalInfo",
"and",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java#L510-L515 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/StandbySafeMode.java | StandbySafeMode.triggerFailover | protected void triggerFailover() throws IOException {
"""
Triggers failover processing for safe mode and blocks until we have left
safe mode.
@throws IOException
"""
clearDataStructures();
// stop sending PREPARE_FAILOVER command
// we are performing failover now
prepareFailover = fals... | java | protected void triggerFailover() throws IOException {
clearDataStructures();
// stop sending PREPARE_FAILOVER command
// we are performing failover now
prepareFailover = false;
for (DatanodeInfo node : namesystem.datanodeReport(DatanodeReportType.LIVE)) {
liveDatanodes.add(node);
... | [
"protected",
"void",
"triggerFailover",
"(",
")",
"throws",
"IOException",
"{",
"clearDataStructures",
"(",
")",
";",
"// stop sending PREPARE_FAILOVER command",
"// we are performing failover now",
"prepareFailover",
"=",
"false",
";",
"for",
"(",
"DatanodeInfo",
"node",
... | Triggers failover processing for safe mode and blocks until we have left
safe mode.
@throws IOException | [
"Triggers",
"failover",
"processing",
"for",
"safe",
"mode",
"and",
"blocks",
"until",
"we",
"have",
"left",
"safe",
"mode",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/StandbySafeMode.java#L177-L203 |
dmfs/xmlobjects | src/org/dmfs/xmlobjects/serializer/XmlObjectSerializer.java | XmlObjectSerializer.useNamespace | public void useNamespace(SerializerContext serializerContext, ElementDescriptor<?> elementDescriptor) {
"""
Inform the serializer that the given {@link ElementDescriptor} will be used. This allows the serializer to bind a prefix early.
@param elementDescriptor
The {@link ElementDescriptor} that will be used.
... | java | public void useNamespace(SerializerContext serializerContext, ElementDescriptor<?> elementDescriptor)
{
useNamespace(serializerContext, elementDescriptor.qualifiedName.namespace);
} | [
"public",
"void",
"useNamespace",
"(",
"SerializerContext",
"serializerContext",
",",
"ElementDescriptor",
"<",
"?",
">",
"elementDescriptor",
")",
"{",
"useNamespace",
"(",
"serializerContext",
",",
"elementDescriptor",
".",
"qualifiedName",
".",
"namespace",
")",
";... | Inform the serializer that the given {@link ElementDescriptor} will be used. This allows the serializer to bind a prefix early.
@param elementDescriptor
The {@link ElementDescriptor} that will be used. | [
"Inform",
"the",
"serializer",
"that",
"the",
"given",
"{",
"@link",
"ElementDescriptor",
"}",
"will",
"be",
"used",
".",
"This",
"allows",
"the",
"serializer",
"to",
"bind",
"a",
"prefix",
"early",
"."
] | train | https://github.com/dmfs/xmlobjects/blob/b68ddd0ce994d804fc2ec6da1096bf0d883b37f9/src/org/dmfs/xmlobjects/serializer/XmlObjectSerializer.java#L276-L279 |
lotaris/rox-client-java | rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterUtils.java | FilterUtils.isRunnable | @SuppressWarnings("unchecked")
public static boolean isRunnable(Class cl, String methodName, String[] filters) {
"""
Define if a test is runnable or not based on a method name and class
@param cl Class
@param methodName The method name
@param filters The filters to apply
@return True if the test can be run
... | java | @SuppressWarnings("unchecked")
public static boolean isRunnable(Class cl, String methodName, String[] filters) {
try {
Method m = cl.getMethod(methodName);
return isRunnable(m, filters);
}
catch (NoSuchMethodException | SecurityException e) {
return true;
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"boolean",
"isRunnable",
"(",
"Class",
"cl",
",",
"String",
"methodName",
",",
"String",
"[",
"]",
"filters",
")",
"{",
"try",
"{",
"Method",
"m",
"=",
"cl",
".",
"getMethod",
"(",
"... | Define if a test is runnable or not based on a method name and class
@param cl Class
@param methodName The method name
@param filters The filters to apply
@return True if the test can be run | [
"Define",
"if",
"a",
"test",
"is",
"runnable",
"or",
"not",
"based",
"on",
"a",
"method",
"name",
"and",
"class"
] | train | https://github.com/lotaris/rox-client-java/blob/1b33f7560347c382c59a40c4037d175ab8127fde/rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterUtils.java#L42-L51 |
MenoData/Time4J | base/src/main/java/net/time4j/tz/ZonalOffset.java | ZonalOffset.atLongitude | public static ZonalOffset atLongitude(BigDecimal longitude) {
"""
/*[deutsch]
<p>Konstruiert eine neue Verschiebung auf Basis einer geographischen
Längenangabe. </p>
<p>Hinweis: Fraktionale Verschiebungen werden im Zeitzonenkontext
nicht verwendet, sondern nur dann, wenn ein {@code PlainTimestamp}
zu e... | java | public static ZonalOffset atLongitude(BigDecimal longitude) {
if (
(longitude.compareTo(DECIMAL_POS_180) > 0)
|| (longitude.compareTo(DECIMAL_NEG_180) < 0)
) {
throw new IllegalArgumentException("Out of range: " + longitude);
}
BigDecimal offset = lo... | [
"public",
"static",
"ZonalOffset",
"atLongitude",
"(",
"BigDecimal",
"longitude",
")",
"{",
"if",
"(",
"(",
"longitude",
".",
"compareTo",
"(",
"DECIMAL_POS_180",
")",
">",
"0",
")",
"||",
"(",
"longitude",
".",
"compareTo",
"(",
"DECIMAL_NEG_180",
")",
"<",... | /*[deutsch]
<p>Konstruiert eine neue Verschiebung auf Basis einer geographischen
Längenangabe. </p>
<p>Hinweis: Fraktionale Verschiebungen werden im Zeitzonenkontext
nicht verwendet, sondern nur dann, wenn ein {@code PlainTimestamp}
zu einem {@code Moment} oder zurück konvertiert wird. </p>
@param longitu... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Konstruiert",
"eine",
"neue",
"Verschiebung",
"auf",
"Basis",
"einer",
"geographischen",
"Lä",
";",
"ngenangabe",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/ZonalOffset.java#L204-L231 |
git-commit-id/maven-git-commit-id-plugin | src/main/java/pl/project13/maven/git/build/BuildServerDataProvider.java | BuildServerDataProvider.getBuildServerProvider | public static BuildServerDataProvider getBuildServerProvider(@Nonnull Map<String, String> env, @Nonnull LoggerBridge log) {
"""
Get the {@link BuildServerDataProvider} implementation for the running environment
@param env environment variables which get used to identify the environment
@param log logging provi... | java | public static BuildServerDataProvider getBuildServerProvider(@Nonnull Map<String, String> env, @Nonnull LoggerBridge log) {
if (BambooBuildServerData.isActiveServer(env)) {
return new BambooBuildServerData(log, env);
}
if (GitlabBuildServerData.isActiveServer(env)) {
return new GitlabBuildServer... | [
"public",
"static",
"BuildServerDataProvider",
"getBuildServerProvider",
"(",
"@",
"Nonnull",
"Map",
"<",
"String",
",",
"String",
">",
"env",
",",
"@",
"Nonnull",
"LoggerBridge",
"log",
")",
"{",
"if",
"(",
"BambooBuildServerData",
".",
"isActiveServer",
"(",
"... | Get the {@link BuildServerDataProvider} implementation for the running environment
@param env environment variables which get used to identify the environment
@param log logging provider which will be used to log events
@return the corresponding {@link BuildServerDataProvider} for your environment or {@link UnknownBui... | [
"Get",
"the",
"{",
"@link",
"BuildServerDataProvider",
"}",
"implementation",
"for",
"the",
"running",
"environment"
] | train | https://github.com/git-commit-id/maven-git-commit-id-plugin/blob/a276551fb043d1b7fc4c890603f6ea0c79dc729a/src/main/java/pl/project13/maven/git/build/BuildServerDataProvider.java#L75-L92 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java | TypicalLoginAssist.isValidRememberMeCookie | protected boolean isValidRememberMeCookie(String userKey, String expireDate) {
"""
Are the user ID and expire date extracted from cookie valid?
@param userKey The key of the login user. (NotNull)
@param expireDate The string expression for expire date of remember-me access token. (NotNull)
@return Is a validati... | java | protected boolean isValidRememberMeCookie(String userKey, String expireDate) {
final String currentDate = formatForRememberMeExpireDate(timeManager.currentHandyDate());
if (currentDate.compareTo(expireDate) < 0) { // String v.s. String
return true; // valid access token within time limit
... | [
"protected",
"boolean",
"isValidRememberMeCookie",
"(",
"String",
"userKey",
",",
"String",
"expireDate",
")",
"{",
"final",
"String",
"currentDate",
"=",
"formatForRememberMeExpireDate",
"(",
"timeManager",
".",
"currentHandyDate",
"(",
")",
")",
";",
"if",
"(",
... | Are the user ID and expire date extracted from cookie valid?
@param userKey The key of the login user. (NotNull)
@param expireDate The string expression for expire date of remember-me access token. (NotNull)
@return Is a validation for remember-me OK? | [
"Are",
"the",
"user",
"ID",
"and",
"expire",
"date",
"extracted",
"from",
"cookie",
"valid?"
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java#L593-L601 |
rythmengine/rythmengine | src/main/java/org/rythmengine/utils/IO.java | IO.readContentAsString | public static String readContentAsString(File file, String encoding) {
"""
Read file content to a String
@param file The file to read
@return The String content
"""
try {
return readContentAsString(new FileInputStream(file), encoding);
} catch (FileNotFoundException e) {
... | java | public static String readContentAsString(File file, String encoding) {
try {
return readContentAsString(new FileInputStream(file), encoding);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"String",
"readContentAsString",
"(",
"File",
"file",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"return",
"readContentAsString",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
",",
"encoding",
")",
";",
"}",
"catch",
"(",
"FileNo... | Read file content to a String
@param file The file to read
@return The String content | [
"Read",
"file",
"content",
"to",
"a",
"String"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/IO.java#L60-L66 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java | HtmlWriter.getResource | public Content getResource(String key, Object o) {
"""
Get the configuration string as a content.
@param key the key to look for in the configuration file
@param o string or content argument added to configuration text
@return a content tree for the text
"""
return configuration.getResource(key,... | java | public Content getResource(String key, Object o) {
return configuration.getResource(key, o);
} | [
"public",
"Content",
"getResource",
"(",
"String",
"key",
",",
"Object",
"o",
")",
"{",
"return",
"configuration",
".",
"getResource",
"(",
"key",
",",
"o",
")",
";",
"}"
] | Get the configuration string as a content.
@param key the key to look for in the configuration file
@param o string or content argument added to configuration text
@return a content tree for the text | [
"Get",
"the",
"configuration",
"string",
"as",
"a",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java#L265-L267 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/async/ServletAsyncSpec.java | ServletAsyncSpec.createAsync | @Nonnull
public static ServletAsyncSpec createAsync (@CheckForSigned final long nTimeoutMillis,
@Nullable final Iterable <? extends AsyncListener> aAsyncListeners) {
"""
Create an async spec.
@param nTimeoutMillis
Timeout in milliseconds. Only value > 0 are co... | java | @Nonnull
public static ServletAsyncSpec createAsync (@CheckForSigned final long nTimeoutMillis,
@Nullable final Iterable <? extends AsyncListener> aAsyncListeners)
{
return new ServletAsyncSpec (true, nTimeoutMillis, aAsyncListeners);
} | [
"@",
"Nonnull",
"public",
"static",
"ServletAsyncSpec",
"createAsync",
"(",
"@",
"CheckForSigned",
"final",
"long",
"nTimeoutMillis",
",",
"@",
"Nullable",
"final",
"Iterable",
"<",
"?",
"extends",
"AsyncListener",
">",
"aAsyncListeners",
")",
"{",
"return",
"new"... | Create an async spec.
@param nTimeoutMillis
Timeout in milliseconds. Only value > 0 are considered.
@param aAsyncListeners
The async listeners to use. May be <code>null</code>.
@return A new {@link ServletAsyncSpec} and never <code>null</code>. | [
"Create",
"an",
"async",
"spec",
"."
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/async/ServletAsyncSpec.java#L169-L174 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/commons/FileUtilsV2_2.java | FileUtilsV2_2.readFileToString | public static String readFileToString(File file, String encoding) throws IOException {
"""
Reads the contents of a file into a String.
The file is always closed.
@param file the file to read, must not be <code>null</code>
@param encoding the encoding to use, <code>null</code> means platform default
@return... | java | public static String readFileToString(File file, String encoding) throws IOException {
InputStream in = null;
try {
in = openInputStream(file);
return IOUtils.toString(in, encoding);
} finally {
IOUtils.closeQuietly(in);
}
} | [
"public",
"static",
"String",
"readFileToString",
"(",
"File",
"file",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"openInputStream",
"(",
"file",
")",
";",
"return",
"IOUtils",
... | Reads the contents of a file into a String.
The file is always closed.
@param file the file to read, must not be <code>null</code>
@param encoding the encoding to use, <code>null</code> means platform default
@return the file contents, never <code>null</code>
@throws IOException in case of an I/O error
@throws java.... | [
"Reads",
"the",
"contents",
"of",
"a",
"file",
"into",
"a",
"String",
".",
"The",
"file",
"is",
"always",
"closed",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/commons/FileUtilsV2_2.java#L742-L750 |
baratine/baratine | framework/src/main/java/com/caucho/v5/ramp/hamp/InHamp.java | InHamp.readMessage | public boolean readMessage(InputStream is)
throws IOException {
"""
Reads the next HMTP packet from the stream, returning false on
end of file.
"""
Thread thread = Thread.currentThread();
ClassLoader loader = thread.getContextClassLoader();
try (OutboxAmp outbox = OutboxAmp.currentOrCrea... | java | public boolean readMessage(InputStream is)
throws IOException
{
Thread thread = Thread.currentThread();
ClassLoader loader = thread.getContextClassLoader();
try (OutboxAmp outbox = OutboxAmp.currentOrCreate(getManager())) {
return readMessage(is, outbox);
} catch (Throwable e) {
... | [
"public",
"boolean",
"readMessage",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"Thread",
"thread",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"ClassLoader",
"loader",
"=",
"thread",
".",
"getContextClassLoader",
"(",
")",
";",
"try",... | Reads the next HMTP packet from the stream, returning false on
end of file. | [
"Reads",
"the",
"next",
"HMTP",
"packet",
"from",
"the",
"stream",
"returning",
"false",
"on",
"end",
"of",
"file",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/ramp/hamp/InHamp.java#L214-L229 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.willAttributeModifyModel | private boolean willAttributeModifyModel(String attributeName, Object newValue) {
"""
Verifies if the passed value for attributeName will set this instance to modified state.
"""
Object currentValue = get(attributeName);
return currentValue != null ? !currentValue.equals(newValue) : newValue !... | java | private boolean willAttributeModifyModel(String attributeName, Object newValue) {
Object currentValue = get(attributeName);
return currentValue != null ? !currentValue.equals(newValue) : newValue != null;
} | [
"private",
"boolean",
"willAttributeModifyModel",
"(",
"String",
"attributeName",
",",
"Object",
"newValue",
")",
"{",
"Object",
"currentValue",
"=",
"get",
"(",
"attributeName",
")",
";",
"return",
"currentValue",
"!=",
"null",
"?",
"!",
"currentValue",
".",
"e... | Verifies if the passed value for attributeName will set this instance to modified state. | [
"Verifies",
"if",
"the",
"passed",
"value",
"for",
"attributeName",
"will",
"set",
"this",
"instance",
"to",
"modified",
"state",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L271-L275 |
unic/neba | core/src/main/java/io/neba/core/resourcemodels/mapping/FieldValueMappingCallback.java | FieldValueMappingCallback.doWith | final void doWith(final MappedFieldMetaData metaData) {
"""
Invoked for each {@link io.neba.core.resourcemodels.metadata.ResourceModelMetaData#getMappableFields() mappable field}
of a {@link io.neba.api.annotations.ResourceModel} to map the {@link MappedFieldMetaData#getField() corresponding field's}
value from ... | java | final void doWith(final MappedFieldMetaData metaData) {
if (metaData == null) {
throw new IllegalArgumentException("Method argument metaData must not be null.");
}
// Prepare the dynamic contextual data of this mapping
final FieldData fieldData = new FieldData(metaData, eval... | [
"final",
"void",
"doWith",
"(",
"final",
"MappedFieldMetaData",
"metaData",
")",
"{",
"if",
"(",
"metaData",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Method argument metaData must not be null.\"",
")",
";",
"}",
"// Prepare the dynam... | Invoked for each {@link io.neba.core.resourcemodels.metadata.ResourceModelMetaData#getMappableFields() mappable field}
of a {@link io.neba.api.annotations.ResourceModel} to map the {@link MappedFieldMetaData#getField() corresponding field's}
value from the resource provided to the {@link #FieldValueMappingCallback(Obje... | [
"Invoked",
"for",
"each",
"{",
"@link",
"io",
".",
"neba",
".",
"core",
".",
"resourcemodels",
".",
"metadata",
".",
"ResourceModelMetaData#getMappableFields",
"()",
"mappable",
"field",
"}",
"of",
"a",
"{",
"@link",
"io",
".",
"neba",
".",
"api",
".",
"an... | train | https://github.com/unic/neba/blob/4d762e60112a1fcb850926a56a9843d5aa424c4b/core/src/main/java/io/neba/core/resourcemodels/mapping/FieldValueMappingCallback.java#L105-L133 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GeneralUtils.java | GeneralUtils.convertASTToSource | public static String convertASTToSource(ReaderSource readerSource, ASTNode expression) throws Exception {
"""
Converts an expression into the String source. Only some specific expressions like closure expression
support this.
@param readerSource a source
@param expression an expression. Can't be null
@return... | java | public static String convertASTToSource(ReaderSource readerSource, ASTNode expression) throws Exception {
if (expression == null) throw new IllegalArgumentException("Null: expression");
StringBuilder result = new StringBuilder();
for (int x = expression.getLineNumber(); x <= expression.getLastL... | [
"public",
"static",
"String",
"convertASTToSource",
"(",
"ReaderSource",
"readerSource",
",",
"ASTNode",
"expression",
")",
"throws",
"Exception",
"{",
"if",
"(",
"expression",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null: expression\"",... | Converts an expression into the String source. Only some specific expressions like closure expression
support this.
@param readerSource a source
@param expression an expression. Can't be null
@return the source the closure was created from
@throws java.lang.IllegalArgumentException when expression is null
@throws java... | [
"Converts",
"an",
"expression",
"into",
"the",
"String",
"source",
".",
"Only",
"some",
"specific",
"expressions",
"like",
"closure",
"expression",
"support",
"this",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GeneralUtils.java#L834-L859 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_filter_name_rule_id_GET | public OvhRule domain_account_accountName_filter_name_rule_id_GET(String domain, String accountName, String name, Long id) throws IOException {
"""
Get this object properties
REST: GET /email/domain/{domain}/account/{accountName}/filter/{name}/rule/{id}
@param domain [required] Name of your domain name
@param... | java | public OvhRule domain_account_accountName_filter_name_rule_id_GET(String domain, String accountName, String name, Long id) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/filter/{name}/rule/{id}";
StringBuilder sb = path(qPath, domain, accountName, name, id);
String resp = exec(q... | [
"public",
"OvhRule",
"domain_account_accountName_filter_name_rule_id_GET",
"(",
"String",
"domain",
",",
"String",
"accountName",
",",
"String",
"name",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/account/{accoun... | Get this object properties
REST: GET /email/domain/{domain}/account/{accountName}/filter/{name}/rule/{id}
@param domain [required] Name of your domain name
@param accountName [required] Name of account
@param name [required] Filter name
@param id [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L723-L728 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java | ElemLiteralResult.throwDOMException | public void throwDOMException(short code, String msg) {
"""
Throw a DOMException
@param msg key of the error that occured.
"""
String themsg = XSLMessages.createMessage(msg, null);
throw new DOMException(code, themsg);
} | java | public void throwDOMException(short code, String msg)
{
String themsg = XSLMessages.createMessage(msg, null);
throw new DOMException(code, themsg);
} | [
"public",
"void",
"throwDOMException",
"(",
"short",
"code",
",",
"String",
"msg",
")",
"{",
"String",
"themsg",
"=",
"XSLMessages",
".",
"createMessage",
"(",
"msg",
",",
"null",
")",
";",
"throw",
"new",
"DOMException",
"(",
"code",
",",
"themsg",
")",
... | Throw a DOMException
@param msg key of the error that occured. | [
"Throw",
"a",
"DOMException"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java#L1470-L1476 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java | XPathParser.parseSingleType | private SingleType parseSingleType() throws TTXPathException {
"""
Parses the the rule SingleType according to the following production
rule:
<p>
[48] SingleType ::= AtomicType "?"? .
</p>
@return SingleType
@throws TTXPathException
"""
final String atomicType = parseAtomicType();
fina... | java | private SingleType parseSingleType() throws TTXPathException {
final String atomicType = parseAtomicType();
final boolean intero = is(TokenType.INTERROGATION, true);
return new SingleType(atomicType, intero);
} | [
"private",
"SingleType",
"parseSingleType",
"(",
")",
"throws",
"TTXPathException",
"{",
"final",
"String",
"atomicType",
"=",
"parseAtomicType",
"(",
")",
";",
"final",
"boolean",
"intero",
"=",
"is",
"(",
"TokenType",
".",
"INTERROGATION",
",",
"true",
")",
... | Parses the the rule SingleType according to the following production
rule:
<p>
[48] SingleType ::= AtomicType "?"? .
</p>
@return SingleType
@throws TTXPathException | [
"Parses",
"the",
"the",
"rule",
"SingleType",
"according",
"to",
"the",
"following",
"production",
"rule",
":",
"<p",
">",
"[",
"48",
"]",
"SingleType",
"::",
"=",
"AtomicType",
"?",
"?",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java#L1322-L1327 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java | Ginv.canSwapCols | public static boolean canSwapCols(Matrix matrix, int col1, int col2, int row1) {
"""
Check to see if columns can be swapped - part of the bandwidth reduction
algorithm.
@param matrix
the matrix to check
@param col1
the first column
@param col2
the second column
@param row1
the row
@return true if the c... | java | public static boolean canSwapCols(Matrix matrix, int col1, int col2, int row1) {
boolean response = true;
for (int row = row1 + 1; row < matrix.getRowCount(); ++row) {
if (0 == matrix.getAsDouble(row, col1)) {
if (0 != matrix.getAsDouble(row, col2)) {
response = false;
break;
}
}
}
retur... | [
"public",
"static",
"boolean",
"canSwapCols",
"(",
"Matrix",
"matrix",
",",
"int",
"col1",
",",
"int",
"col2",
",",
"int",
"row1",
")",
"{",
"boolean",
"response",
"=",
"true",
";",
"for",
"(",
"int",
"row",
"=",
"row1",
"+",
"1",
";",
"row",
"<",
... | Check to see if columns can be swapped - part of the bandwidth reduction
algorithm.
@param matrix
the matrix to check
@param col1
the first column
@param col2
the second column
@param row1
the row
@return true if the columns can be swapped | [
"Check",
"to",
"see",
"if",
"columns",
"can",
"be",
"swapped",
"-",
"part",
"of",
"the",
"bandwidth",
"reduction",
"algorithm",
"."
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L892-L903 |
morimekta/providence | providence-core/src/main/java-gen/net/morimekta/providence/util/Any.java | Any.wrappedTypeIs | public <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>
boolean wrappedTypeIs(@javax.annotation.Nonnull net.morimekta.providence.descriptor.PMessageDescriptor<M,F> descriptor) {
"""
Check the wrapped message type against the provided message type
descri... | java | public <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>
boolean wrappedTypeIs(@javax.annotation.Nonnull net.morimekta.providence.descriptor.PMessageDescriptor<M,F> descriptor) {
return descriptor.getQualifiedName().equals(getType());
} | [
"public",
"<",
"M",
"extends",
"net",
".",
"morimekta",
".",
"providence",
".",
"PMessage",
"<",
"M",
",",
"F",
">",
",",
"F",
"extends",
"net",
".",
"morimekta",
".",
"providence",
".",
"descriptor",
".",
"PField",
">",
"boolean",
"wrappedTypeIs",
"(",
... | Check the wrapped message type against the provided message type
descriptor.
@param descriptor The message type to check.
@param <M> The message type
@param <F> The message field type
@return True if the wrapped message type matches the provided. | [
"Check",
"the",
"wrapped",
"message",
"type",
"against",
"the",
"provided",
"message",
"type",
"descriptor",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java-gen/net/morimekta/providence/util/Any.java#L274-L277 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java | ApiOvhDbaasqueue.serviceName_user_userId_changePassword_POST | public OvhUserWithPassword serviceName_user_userId_changePassword_POST(String serviceName, String userId) throws IOException {
"""
Generate a new user password
REST: POST /dbaas/queue/{serviceName}/user/{userId}/changePassword
@param serviceName [required] Application ID
@param userId [required] User ID
AP... | java | public OvhUserWithPassword serviceName_user_userId_changePassword_POST(String serviceName, String userId) throws IOException {
String qPath = "/dbaas/queue/{serviceName}/user/{userId}/changePassword";
StringBuilder sb = path(qPath, serviceName, userId);
String resp = exec(qPath, "POST", sb.toString(), null);
re... | [
"public",
"OvhUserWithPassword",
"serviceName_user_userId_changePassword_POST",
"(",
"String",
"serviceName",
",",
"String",
"userId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/queue/{serviceName}/user/{userId}/changePassword\"",
";",
"StringBuilder",
... | Generate a new user password
REST: POST /dbaas/queue/{serviceName}/user/{userId}/changePassword
@param serviceName [required] Application ID
@param userId [required] User ID
API beta | [
"Generate",
"a",
"new",
"user",
"password"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java#L163-L168 |
google/closure-templates | java/src/com/google/template/soy/internal/i18n/BidiFormatter.java | BidiFormatter.unicodeWrappingText | public BidiWrappingText unicodeWrappingText(@Nullable Dir dir, String str, boolean isHtml) {
"""
Operates like {@link #unicodeWrap(Dir, String, boolean)} but only returns the text that would
be prepended and appended to {@code str}.
@param dir {@code str}'s directionality. If null, i.e. unknown, it is estimate... | java | public BidiWrappingText unicodeWrappingText(@Nullable Dir dir, String str, boolean isHtml) {
if (dir == null) {
dir = estimateDirection(str, isHtml);
}
StringBuilder beforeText = new StringBuilder();
StringBuilder afterText = new StringBuilder();
if (dir != Dir.NEUTRAL && dir != contextDir) {
... | [
"public",
"BidiWrappingText",
"unicodeWrappingText",
"(",
"@",
"Nullable",
"Dir",
"dir",
",",
"String",
"str",
",",
"boolean",
"isHtml",
")",
"{",
"if",
"(",
"dir",
"==",
"null",
")",
"{",
"dir",
"=",
"estimateDirection",
"(",
"str",
",",
"isHtml",
")",
... | Operates like {@link #unicodeWrap(Dir, String, boolean)} but only returns the text that would
be prepended and appended to {@code str}.
@param dir {@code str}'s directionality. If null, i.e. unknown, it is estimated.
@param str The input string
@param isHtml Whether {@code str} is HTML / HTML-escaped | [
"Operates",
"like",
"{",
"@link",
"#unicodeWrap",
"(",
"Dir",
"String",
"boolean",
")",
"}",
"but",
"only",
"returns",
"the",
"text",
"that",
"would",
"be",
"prepended",
"and",
"appended",
"to",
"{",
"@code",
"str",
"}",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/BidiFormatter.java#L194-L206 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java | NetworkSecurityGroupsInner.beginUpdateTags | public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName, Map<String, String> tags) {
"""
Updates a network security group tags.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@p... | java | public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName, Map<String, String> tags) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().single().body();
} | [
"public",
"NetworkSecurityGroupInner",
"beginUpdateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkSecurityGroupName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGro... | Updates a network security group tags.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is re... | [
"Updates",
"a",
"network",
"security",
"group",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java#L835-L837 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.decryptAsync | public ServiceFuture<KeyOperationResult> decryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) {
"""
Decrypts a single block of encrypted data.
The DECRYPT operation decrypts a well-for... | java | public ServiceFuture<KeyOperationResult> decryptAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) {
return ServiceFuture.fromResponse(decryptWithServiceResponseAsync(vaultBaseUrl, keyNam... | [
"public",
"ServiceFuture",
"<",
"KeyOperationResult",
">",
"decryptAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"JsonWebKeyEncryptionAlgorithm",
"algorithm",
",",
"byte",
"[",
"]",
"value",
",",
"final",
"Service... | Decrypts a single block of encrypted data.
The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key... | [
"Decrypts",
"a",
"single",
"block",
"of",
"encrypted",
"data",
".",
"The",
"DECRYPT",
"operation",
"decrypts",
"a",
"well",
"-",
"formed",
"block",
"of",
"ciphertext",
"using",
"the",
"target",
"encryption",
"key",
"and",
"specified",
"algorithm",
".",
"This",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L2275-L2277 |
dbracewell/mango | src/main/java/com/davidbracewell/logging/LogManager.java | LogManager.setLevel | public void setLevel(String logger, Level level) {
"""
Sets the level of a logger
@param logger The name of the logger to set the level for.
@param level The level to set the logger at
"""
Logger log = getLogger(logger);
log.setLevel(level);
for (String loggerName : getLoggerNames()) {
... | java | public void setLevel(String logger, Level level) {
Logger log = getLogger(logger);
log.setLevel(level);
for (String loggerName : getLoggerNames()) {
if (loggerName.startsWith(logger) && !loggerName.equals(logger)) {
getLogger(loggerName).setLevel(level);
}
}
} | [
"public",
"void",
"setLevel",
"(",
"String",
"logger",
",",
"Level",
"level",
")",
"{",
"Logger",
"log",
"=",
"getLogger",
"(",
"logger",
")",
";",
"log",
".",
"setLevel",
"(",
"level",
")",
";",
"for",
"(",
"String",
"loggerName",
":",
"getLoggerNames",... | Sets the level of a logger
@param logger The name of the logger to set the level for.
@param level The level to set the logger at | [
"Sets",
"the",
"level",
"of",
"a",
"logger"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/logging/LogManager.java#L165-L173 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/cors/CorsServiceBuilder.java | CorsServiceBuilder.preflightResponseHeader | public CorsServiceBuilder preflightResponseHeader(CharSequence name, Supplier<?> valueSupplier) {
"""
Returns HTTP response headers that should be added to a CORS preflight response.
<p>An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables such ... | java | public CorsServiceBuilder preflightResponseHeader(CharSequence name, Supplier<?> valueSupplier) {
firstPolicyBuilder.preflightResponseHeader(name, valueSupplier);
return this;
} | [
"public",
"CorsServiceBuilder",
"preflightResponseHeader",
"(",
"CharSequence",
"name",
",",
"Supplier",
"<",
"?",
">",
"valueSupplier",
")",
"{",
"firstPolicyBuilder",
".",
"preflightResponseHeader",
"(",
"name",
",",
"valueSupplier",
")",
";",
"return",
"this",
";... | Returns HTTP response headers that should be added to a CORS preflight response.
<p>An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables such headers to be added.
<p>Some values must be dynamically created when the HTTP response is created, for
exampl... | [
"Returns",
"HTTP",
"response",
"headers",
"that",
"should",
"be",
"added",
"to",
"a",
"CORS",
"preflight",
"response",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/cors/CorsServiceBuilder.java#L335-L338 |
opentracing-contrib/java-kafka-client | opentracing-kafka-client/src/main/java/io/opentracing/contrib/kafka/TracingKafkaUtils.java | TracingKafkaUtils.extractSpanContext | public static SpanContext extractSpanContext(Headers headers, Tracer tracer) {
"""
Extract Span Context from Consumer record headers
@param headers Consumer record headers
@return span context
"""
return tracer
.extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers, true));
} | java | public static SpanContext extractSpanContext(Headers headers, Tracer tracer) {
return tracer
.extract(Format.Builtin.TEXT_MAP, new HeadersMapExtractAdapter(headers, true));
} | [
"public",
"static",
"SpanContext",
"extractSpanContext",
"(",
"Headers",
"headers",
",",
"Tracer",
"tracer",
")",
"{",
"return",
"tracer",
".",
"extract",
"(",
"Format",
".",
"Builtin",
".",
"TEXT_MAP",
",",
"new",
"HeadersMapExtractAdapter",
"(",
"headers",
","... | Extract Span Context from Consumer record headers
@param headers Consumer record headers
@return span context | [
"Extract",
"Span",
"Context",
"from",
"Consumer",
"record",
"headers"
] | train | https://github.com/opentracing-contrib/java-kafka-client/blob/e3aeec8d68d3a2dead89b9dbdfea3791817e1a26/opentracing-kafka-client/src/main/java/io/opentracing/contrib/kafka/TracingKafkaUtils.java#L52-L55 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSON.java | JSON.parseArray | public static JSONArray parseArray(File f, String csName) throws IOException {
"""
Parse the contents of a {@link File} as a JSON array, specifying the character set by
name.
@param f the {@link File}
@param csName the character set name
@return the JSON array
@throws JSONException if t... | java | public static JSONArray parseArray(File f, String csName) throws IOException {
return (JSONArray)parse(f, csName);
} | [
"public",
"static",
"JSONArray",
"parseArray",
"(",
"File",
"f",
",",
"String",
"csName",
")",
"throws",
"IOException",
"{",
"return",
"(",
"JSONArray",
")",
"parse",
"(",
"f",
",",
"csName",
")",
";",
"}"
] | Parse the contents of a {@link File} as a JSON array, specifying the character set by
name.
@param f the {@link File}
@param csName the character set name
@return the JSON array
@throws JSONException if the file does not contain a valid JSON value
@throws IOException on any I/O errors
@throws Cl... | [
"Parse",
"the",
"contents",
"of",
"a",
"{",
"@link",
"File",
"}",
"as",
"a",
"JSON",
"array",
"specifying",
"the",
"character",
"set",
"by",
"name",
"."
] | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSON.java#L291-L293 |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/PropertiesLightblueClientConfiguration.java | PropertiesLightblueClientConfiguration.loadInputStream | private static Reader loadInputStream(InputStream propertiesStream) throws IOException {
"""
Reads the {@link InputStream} and substitutes system properties.
@return {@link Reader}
"""
StringBuilder buff = new StringBuilder();
try (InputStreamReader isr = new InputStreamReader(propertiesStr... | java | private static Reader loadInputStream(InputStream propertiesStream) throws IOException {
StringBuilder buff = new StringBuilder();
try (InputStreamReader isr = new InputStreamReader(propertiesStream, Charset.defaultCharset());
BufferedReader reader = new BufferedReader(isr)) {
... | [
"private",
"static",
"Reader",
"loadInputStream",
"(",
"InputStream",
"propertiesStream",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"(",
"InputStreamReader",
"isr",
"=",
"new",
"InputStreamReader",... | Reads the {@link InputStream} and substitutes system properties.
@return {@link Reader} | [
"Reads",
"the",
"{",
"@link",
"InputStream",
"}",
"and",
"substitutes",
"system",
"properties",
"."
] | train | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/PropertiesLightblueClientConfiguration.java#L172-L184 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java | CPOptionPersistenceImpl.findByGroupId | @Override
public List<CPOption> findByGroupId(long groupId) {
"""
Returns all the cp options where groupId = ?.
@param groupId the group ID
@return the matching cp options
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPOption> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPOption",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp options where groupId = ?.
@param groupId the group ID
@return the matching cp options | [
"Returns",
"all",
"the",
"cp",
"options",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L1500-L1503 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/FieldCriteria.java | FieldCriteria.buildGreaterCriteria | static FieldCriteria buildGreaterCriteria(Object anAttribute, Object aValue, UserAlias anAlias) {
"""
static FieldCriteria buildGreaterCriteria(Object anAttribute, Object aValue, String anAlias)
"""
return new FieldCriteria(anAttribute, aValue,GREATER, anAlias);
} | java | static FieldCriteria buildGreaterCriteria(Object anAttribute, Object aValue, UserAlias anAlias)
{
return new FieldCriteria(anAttribute, aValue,GREATER, anAlias);
} | [
"static",
"FieldCriteria",
"buildGreaterCriteria",
"(",
"Object",
"anAttribute",
",",
"Object",
"aValue",
",",
"UserAlias",
"anAlias",
")",
"{",
"return",
"new",
"FieldCriteria",
"(",
"anAttribute",
",",
"aValue",
",",
"GREATER",
",",
"anAlias",
")",
";",
"}"
] | static FieldCriteria buildGreaterCriteria(Object anAttribute, Object aValue, String anAlias) | [
"static",
"FieldCriteria",
"buildGreaterCriteria",
"(",
"Object",
"anAttribute",
"Object",
"aValue",
"String",
"anAlias",
")"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/FieldCriteria.java#L42-L45 |
upwork/java-upwork | src/com/Upwork/api/Routers/Activities/Team.java | Team.unarchiveActivity | public JSONObject unarchiveActivity(String company, String team, String code) throws JSONException {
"""
Unarchive specific oTask/Activity record within a team
@param company Company ID
@param team Team ID
@param code Specific code(s)
@throws JSONException If error occurred
@return {@link JSONObject}
... | java | public JSONObject unarchiveActivity(String company, String team, String code) throws JSONException {
return oClient.put("/otask/v1/tasks/companies/" + company + "/teams/" + team + "/unarchive/" + code);
} | [
"public",
"JSONObject",
"unarchiveActivity",
"(",
"String",
"company",
",",
"String",
"team",
",",
"String",
"code",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"put",
"(",
"\"/otask/v1/tasks/companies/\"",
"+",
"company",
"+",
"\"/teams/\"",
"+... | Unarchive specific oTask/Activity record within a team
@param company Company ID
@param team Team ID
@param code Specific code(s)
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Unarchive",
"specific",
"oTask",
"/",
"Activity",
"record",
"within",
"a",
"team"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Activities/Team.java#L137-L139 |
JodaOrg/joda-time | src/main/java/org/joda/time/TimeOfDay.java | TimeOfDay.fromMillisOfDay | public static TimeOfDay fromMillisOfDay(long millisOfDay, Chronology chrono) {
"""
Constructs a TimeOfDay from the specified millis of day using the
specified chronology.
<p>
The millisOfDay value may exceed the number of millis in one day,
but additional days will be ignored.
This method uses the UTC time zo... | java | public static TimeOfDay fromMillisOfDay(long millisOfDay, Chronology chrono) {
chrono = DateTimeUtils.getChronology(chrono);
chrono = chrono.withUTC();
return new TimeOfDay(millisOfDay, chrono);
} | [
"public",
"static",
"TimeOfDay",
"fromMillisOfDay",
"(",
"long",
"millisOfDay",
",",
"Chronology",
"chrono",
")",
"{",
"chrono",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"chrono",
")",
";",
"chrono",
"=",
"chrono",
".",
"withUTC",
"(",
")",
";",
"ret... | Constructs a TimeOfDay from the specified millis of day using the
specified chronology.
<p>
The millisOfDay value may exceed the number of millis in one day,
but additional days will be ignored.
This method uses the UTC time zone internally.
@param millisOfDay the number of milliseconds into a day to convert
@param c... | [
"Constructs",
"a",
"TimeOfDay",
"from",
"the",
"specified",
"millis",
"of",
"day",
"using",
"the",
"specified",
"chronology",
".",
"<p",
">",
"The",
"millisOfDay",
"value",
"may",
"exceed",
"the",
"number",
"of",
"millis",
"in",
"one",
"day",
"but",
"additio... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/TimeOfDay.java#L182-L186 |
apache/groovy | src/main/groovy/groovy/util/ProxyGenerator.java | ProxyGenerator.instantiateDelegateWithBaseClass | @SuppressWarnings("unchecked")
public GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass, String name) {
"""
Creates a proxy with a delegate object.
@param closureMap the closure for methods not handled by the delegate
@param interfaces in... | java | @SuppressWarnings("unchecked")
public GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass, String name) {
Map<Object,Object> map = closureMap != null ? closureMap : EMPTY_CLOSURE_MAP;
ProxyGeneratorAdapter adapter = createAdapter(map... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"GroovyObject",
"instantiateDelegateWithBaseClass",
"(",
"Map",
"closureMap",
",",
"List",
"<",
"Class",
">",
"interfaces",
",",
"Object",
"delegate",
",",
"Class",
"baseClass",
",",
"String",
"name",
"... | Creates a proxy with a delegate object.
@param closureMap the closure for methods not handled by the delegate
@param interfaces interfaces to be implemented
@param delegate the delegate object
@param baseClass the base class
@param name the name of the proxy, unused, but kept for compatibility with previous versions o... | [
"Creates",
"a",
"proxy",
"with",
"a",
"delegate",
"object",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/ProxyGenerator.java#L202-L208 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Transaction.java | Transaction.isFinal | public boolean isFinal(int height, long blockTimeSeconds) {
"""
<p>Returns true if this transaction is considered finalized and can be placed in a block. Non-finalized
transactions won't be included by miners and can be replaced with newer versions using sequence numbers.
This is useful in certain types of <a hr... | java | public boolean isFinal(int height, long blockTimeSeconds) {
long time = getLockTime();
return time < (time < LOCKTIME_THRESHOLD ? height : blockTimeSeconds) || !isTimeLocked();
} | [
"public",
"boolean",
"isFinal",
"(",
"int",
"height",
",",
"long",
"blockTimeSeconds",
")",
"{",
"long",
"time",
"=",
"getLockTime",
"(",
")",
";",
"return",
"time",
"<",
"(",
"time",
"<",
"LOCKTIME_THRESHOLD",
"?",
"height",
":",
"blockTimeSeconds",
")",
... | <p>Returns true if this transaction is considered finalized and can be placed in a block. Non-finalized
transactions won't be included by miners and can be replaced with newer versions using sequence numbers.
This is useful in certain types of <a href="http://en.bitcoin.it/wiki/Contracts">contracts</a>, such as
micropa... | [
"<p",
">",
"Returns",
"true",
"if",
"this",
"transaction",
"is",
"considered",
"finalized",
"and",
"can",
"be",
"placed",
"in",
"a",
"block",
".",
"Non",
"-",
"finalized",
"transactions",
"won",
"t",
"be",
"included",
"by",
"miners",
"and",
"can",
"be",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L1740-L1743 |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRImporter.java | LRImporter.getObtainRequestPath | private String getObtainRequestPath(String requestID, Boolean byResourceID, Boolean byDocID, Boolean idsOnly, String resumptionToken) {
"""
Obtain the path used for an obtain request
@param requestID the "request_ID" parameter for the request
@param byResourceID the "by_resource_ID" parameter for the request
... | java | private String getObtainRequestPath(String requestID, Boolean byResourceID, Boolean byDocID, Boolean idsOnly, String resumptionToken)
{
String path = obtainPath;
if (resumptionToken != null)
{
path += "?" + resumptionTokenParam + "=" + resumptionToken;
return... | [
"private",
"String",
"getObtainRequestPath",
"(",
"String",
"requestID",
",",
"Boolean",
"byResourceID",
",",
"Boolean",
"byDocID",
",",
"Boolean",
"idsOnly",
",",
"String",
"resumptionToken",
")",
"{",
"String",
"path",
"=",
"obtainPath",
";",
"if",
"(",
"resum... | Obtain the path used for an obtain request
@param requestID the "request_ID" parameter for the request
@param byResourceID the "by_resource_ID" parameter for the request
@param byDocID the "by_doc_ID" parameter for the request
@param idsOnly the "ids_only" parameter for the request
@param resumptionToken the "resumpti... | [
"Obtain",
"the",
"path",
"used",
"for",
"an",
"obtain",
"request"
] | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRImporter.java#L118-L166 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java | Ingest.getLagBytes | public long getLagBytes() {
"""
Returns the distance in bytes between the current position inside of the
edits log and the length of the edits log
"""
try {
if (inputEditStream != null && inputEditStream.isInProgress()) {
// for file journals it may happen that we read a segment finalized
... | java | public long getLagBytes() {
try {
if (inputEditStream != null && inputEditStream.isInProgress()) {
// for file journals it may happen that we read a segment finalized
// by primary, but not refreshed by the standby, so length() returns 0
// hence we take max(-1,lag)
return Math... | [
"public",
"long",
"getLagBytes",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"inputEditStream",
"!=",
"null",
"&&",
"inputEditStream",
".",
"isInProgress",
"(",
")",
")",
"{",
"// for file journals it may happen that we read a segment finalized",
"// by primary, but not refresh... | Returns the distance in bytes between the current position inside of the
edits log and the length of the edits log | [
"Returns",
"the",
"distance",
"in",
"bytes",
"between",
"the",
"current",
"position",
"inside",
"of",
"the",
"edits",
"log",
"and",
"the",
"length",
"of",
"the",
"edits",
"log"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/Ingest.java#L169-L183 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java | BasePropertyTaglet.getTagletOutput | public Content getTagletOutput(Element element, DocTree tag, TagletWriter tagletWriter) {
"""
Given the <code>Tag</code> representation of this custom
tag, return its string representation, which is output
to the generated page.
@param element
@param tag the <code>Tag</code> representation of this custom tag.
... | java | public Content getTagletOutput(Element element, DocTree tag, TagletWriter tagletWriter) {
return tagletWriter.propertyTagOutput(element, tag, getText(tagletWriter));
} | [
"public",
"Content",
"getTagletOutput",
"(",
"Element",
"element",
",",
"DocTree",
"tag",
",",
"TagletWriter",
"tagletWriter",
")",
"{",
"return",
"tagletWriter",
".",
"propertyTagOutput",
"(",
"element",
",",
"tag",
",",
"getText",
"(",
"tagletWriter",
")",
")"... | Given the <code>Tag</code> representation of this custom
tag, return its string representation, which is output
to the generated page.
@param element
@param tag the <code>Tag</code> representation of this custom tag.
@param tagletWriter the taglet writer for output.
@return the TagletOutput representation of this <code... | [
"Given",
"the",
"<code",
">",
"Tag<",
"/",
"code",
">",
"representation",
"of",
"this",
"custom",
"tag",
"return",
"its",
"string",
"representation",
"which",
"is",
"output",
"to",
"the",
"generated",
"page",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java#L66-L68 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java | DebugUtil.printDebug | public static void printDebug(final int[] pIntArray, final PrintStream pPrintStream) {
"""
Prints the content of a {@code int[]} to a {@code java.io.PrintStream}.
<p>
@param pIntArray the {@code int[]} to be printed.
@param pPrintStream the {@code java.io.PrintStream} for flushing the results.
"""
if... | java | public static void printDebug(final int[] pIntArray, final PrintStream pPrintStream) {
if (pPrintStream == null) {
System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
return;
}
if (pIntArray == null) {
pPrintStream.println(INTARRAY_IS_NULL_ERROR_MESSAGE);
return;
}
... | [
"public",
"static",
"void",
"printDebug",
"(",
"final",
"int",
"[",
"]",
"pIntArray",
",",
"final",
"PrintStream",
"pPrintStream",
")",
"{",
"if",
"(",
"pPrintStream",
"==",
"null",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"PRINTSTREAM_IS_NULL_ER... | Prints the content of a {@code int[]} to a {@code java.io.PrintStream}.
<p>
@param pIntArray the {@code int[]} to be printed.
@param pPrintStream the {@code java.io.PrintStream} for flushing the results. | [
"Prints",
"the",
"content",
"of",
"a",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L317-L330 |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java | AbstractBeanDeployer.createObserversProducersDisposers | protected <T> void createObserversProducersDisposers(AbstractClassBean<T> bean) {
"""
Creates the sub bean for an class (simple or enterprise) bean
@param bean The class bean
"""
if (bean instanceof ManagedBean<?> || bean instanceof SessionBean<?>) {
// disposal methods have to go first ... | java | protected <T> void createObserversProducersDisposers(AbstractClassBean<T> bean) {
if (bean instanceof ManagedBean<?> || bean instanceof SessionBean<?>) {
// disposal methods have to go first as we want them to be ready for resolution when initializing producer method/fields
createDisposa... | [
"protected",
"<",
"T",
">",
"void",
"createObserversProducersDisposers",
"(",
"AbstractClassBean",
"<",
"T",
">",
"bean",
")",
"{",
"if",
"(",
"bean",
"instanceof",
"ManagedBean",
"<",
"?",
">",
"||",
"bean",
"instanceof",
"SessionBean",
"<",
"?",
">",
")",
... | Creates the sub bean for an class (simple or enterprise) bean
@param bean The class bean | [
"Creates",
"the",
"sub",
"bean",
"for",
"an",
"class",
"(",
"simple",
"or",
"enterprise",
")",
"bean"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java#L188-L198 |
lastaflute/lasta-di | src/main/java/org/lastaflute/di/util/LdiSrl.java | LdiSrl.substringFirstRearIgnoreCase | public static String substringFirstRearIgnoreCase(String str, String... delimiters) {
"""
Extract rear sub-string from first-found delimiter ignoring case.
<pre>
substringFirstRear("foo.bar/baz.qux", "A", "U")
returns "ar/baz.qux"
</pre>
@param str The target string. (NotNull)
@param delimiters The array of ... | java | public static String substringFirstRearIgnoreCase(String str, String... delimiters) {
assertStringNotNull(str);
return doSubstringFirstRear(false, true, true, str, delimiters);
} | [
"public",
"static",
"String",
"substringFirstRearIgnoreCase",
"(",
"String",
"str",
",",
"String",
"...",
"delimiters",
")",
"{",
"assertStringNotNull",
"(",
"str",
")",
";",
"return",
"doSubstringFirstRear",
"(",
"false",
",",
"true",
",",
"true",
",",
"str",
... | Extract rear sub-string from first-found delimiter ignoring case.
<pre>
substringFirstRear("foo.bar/baz.qux", "A", "U")
returns "ar/baz.qux"
</pre>
@param str The target string. (NotNull)
@param delimiters The array of delimiters. (NotNull)
@return The part of string. (NotNull: if delimiter not found, returns argument-... | [
"Extract",
"rear",
"sub",
"-",
"string",
"from",
"first",
"-",
"found",
"delimiter",
"ignoring",
"case",
".",
"<pre",
">",
"substringFirstRear",
"(",
"foo",
".",
"bar",
"/",
"baz",
".",
"qux",
"A",
"U",
")",
"returns",
"ar",
"/",
"baz",
".",
"qux",
"... | train | https://github.com/lastaflute/lasta-di/blob/c4e123610c53a04cc836c5e456660e32d613447b/src/main/java/org/lastaflute/di/util/LdiSrl.java#L672-L675 |
Waikato/moa | moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java | Instances.trainCV | public Instances trainCV(int numFolds, int numFold, Random random) {
"""
Train cv.
@param numFolds the num folds
@param numFold
@param random the random
@return the instances
"""
Instances train = trainCV(numFolds, numFold);
train.randomize(random);
return train;
} | java | public Instances trainCV(int numFolds, int numFold, Random random) {
Instances train = trainCV(numFolds, numFold);
train.randomize(random);
return train;
} | [
"public",
"Instances",
"trainCV",
"(",
"int",
"numFolds",
",",
"int",
"numFold",
",",
"Random",
"random",
")",
"{",
"Instances",
"train",
"=",
"trainCV",
"(",
"numFolds",
",",
"numFold",
")",
";",
"train",
".",
"randomize",
"(",
"random",
")",
";",
"retu... | Train cv.
@param numFolds the num folds
@param numFold
@param random the random
@return the instances | [
"Train",
"cv",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java#L399-L403 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.writePublishJob | public void writePublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsException {
"""
Updates a publish job.<p>
@param dbc the current database context
@param publishJob the publish job to update
@throws CmsException if something goes wrong
"""
getProjectDriver(dbc).writePub... | java | public void writePublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsException {
getProjectDriver(dbc).writePublishJob(dbc, publishJob);
} | [
"public",
"void",
"writePublishJob",
"(",
"CmsDbContext",
"dbc",
",",
"CmsPublishJobInfoBean",
"publishJob",
")",
"throws",
"CmsException",
"{",
"getProjectDriver",
"(",
"dbc",
")",
".",
"writePublishJob",
"(",
"dbc",
",",
"publishJob",
")",
";",
"}"
] | Updates a publish job.<p>
@param dbc the current database context
@param publishJob the publish job to update
@throws CmsException if something goes wrong | [
"Updates",
"a",
"publish",
"job",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L10113-L10116 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UIInput.java | UIInput.getConvertedValue | protected Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException {
"""
Convert the provided object to the desired value.
<p>
If there is a renderer for this component, then call the renderer's getConvertedValue method. While this can of
course be implemented in any way t... | java | protected Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException
{
Renderer renderer = getRenderer(context);
if (renderer != null)
{
return renderer.getConvertedValue(context, this, submittedValue);
}
else if (submittedValu... | [
"protected",
"Object",
"getConvertedValue",
"(",
"FacesContext",
"context",
",",
"Object",
"submittedValue",
")",
"throws",
"ConverterException",
"{",
"Renderer",
"renderer",
"=",
"getRenderer",
"(",
"context",
")",
";",
"if",
"(",
"renderer",
"!=",
"null",
")",
... | Convert the provided object to the desired value.
<p>
If there is a renderer for this component, then call the renderer's getConvertedValue method. While this can of
course be implemented in any way the renderer desires, it typically performs exactly the same processing that
this method would have done anyway (ie that ... | [
"Convert",
"the",
"provided",
"object",
"to",
"the",
"desired",
"value",
".",
"<p",
">",
"If",
"there",
"is",
"a",
"renderer",
"for",
"this",
"component",
"then",
"call",
"the",
"renderer",
"s",
"getConvertedValue",
"method",
".",
"While",
"this",
"can",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/UIInput.java#L696-L712 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/IntentUtils.java | IntentUtils.isIntentAvailable | public static boolean isIntentAvailable(Context context, String action, String mimeType) {
"""
Checks whether there are applications installed which are able to handle the given action/type.
@param context the current context
@param action the action to check
@param mimeType the MIME type of the content (m... | java | public static boolean isIntentAvailable(Context context, String action, String mimeType) {
final Intent intent = new Intent(action);
if (mimeType != null) {
intent.setType(mimeType);
}
List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent,
... | [
"public",
"static",
"boolean",
"isIntentAvailable",
"(",
"Context",
"context",
",",
"String",
"action",
",",
"String",
"mimeType",
")",
"{",
"final",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"action",
")",
";",
"if",
"(",
"mimeType",
"!=",
"null",
")... | Checks whether there are applications installed which are able to handle the given action/type.
@param context the current context
@param action the action to check
@param mimeType the MIME type of the content (may be null)
@return true if there are apps which will respond to this action/type | [
"Checks",
"whether",
"there",
"are",
"applications",
"installed",
"which",
"are",
"able",
"to",
"handle",
"the",
"given",
"action",
"/",
"type",
"."
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/IntentUtils.java#L61-L69 |
kaazing/gateway | service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/AmqpTable.java | AmqpTable.addLongString | public AmqpTable addLongString(String key, String value) {
"""
Adds a long string entry to the AmqpTable.
@param key name of an entry
@param value long string value of an entry
@return AmqpTable object that holds the table of entries
"""
this.add(key, value, AmqpType.LONGSTRING);
retur... | java | public AmqpTable addLongString(String key, String value) {
this.add(key, value, AmqpType.LONGSTRING);
return this;
} | [
"public",
"AmqpTable",
"addLongString",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"add",
"(",
"key",
",",
"value",
",",
"AmqpType",
".",
"LONGSTRING",
")",
";",
"return",
"this",
";",
"}"
] | Adds a long string entry to the AmqpTable.
@param key name of an entry
@param value long string value of an entry
@return AmqpTable object that holds the table of entries | [
"Adds",
"a",
"long",
"string",
"entry",
"to",
"the",
"AmqpTable",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/AmqpTable.java#L142-L145 |
prestodb/presto | presto-spi/src/main/java/com/facebook/presto/spi/HostAddress.java | HostAddress.withDefaultPort | public HostAddress withDefaultPort(int defaultPort) {
"""
Provide a default port if the parsed string contained only a host.
<p>
You can chain this after {@link #fromString(String)} to include a port in
case the port was omitted from the input string. If a port was already
provided, then this method is a no-o... | java | public HostAddress withDefaultPort(int defaultPort)
{
if (!isValidPort(defaultPort)) {
throw new IllegalArgumentException("Port number out of range: " + defaultPort);
}
if (hasPort() || port == defaultPort) {
return this;
}
return new HostAddress(host... | [
"public",
"HostAddress",
"withDefaultPort",
"(",
"int",
"defaultPort",
")",
"{",
"if",
"(",
"!",
"isValidPort",
"(",
"defaultPort",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Port number out of range: \"",
"+",
"defaultPort",
")",
";",
"}",... | Provide a default port if the parsed string contained only a host.
<p>
You can chain this after {@link #fromString(String)} to include a port in
case the port was omitted from the input string. If a port was already
provided, then this method is a no-op.
@param defaultPort a port number, from [0..65535]
@return a Hos... | [
"Provide",
"a",
"default",
"port",
"if",
"the",
"parsed",
"string",
"contained",
"only",
"a",
"host",
".",
"<p",
">",
"You",
"can",
"chain",
"this",
"after",
"{",
"@link",
"#fromString",
"(",
"String",
")",
"}",
"to",
"include",
"a",
"port",
"in",
"cas... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-spi/src/main/java/com/facebook/presto/spi/HostAddress.java#L232-L242 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeType.java | MimeType.addParameter | @Nonnull
public MimeType addParameter (@Nonnull @Nonempty final String sAttribute, @Nonnull @Nonempty final String sValue) {
"""
Add a parameter.
@param sAttribute
Parameter name. Must neither be <code>null</code> nor empty and must
match {@link MimeTypeParser#isToken(String)}.
@param sValue
The value to ... | java | @Nonnull
public MimeType addParameter (@Nonnull @Nonempty final String sAttribute, @Nonnull @Nonempty final String sValue)
{
return addParameter (new MimeTypeParameter (sAttribute, sValue));
} | [
"@",
"Nonnull",
"public",
"MimeType",
"addParameter",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sAttribute",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sValue",
")",
"{",
"return",
"addParameter",
"(",
"new",
"MimeTypeParameter",
... | Add a parameter.
@param sAttribute
Parameter name. Must neither be <code>null</code> nor empty and must
match {@link MimeTypeParser#isToken(String)}.
@param sValue
The value to use. May neither be <code>null</code> nor empty. Must
not be a valid MIME token.
@return this | [
"Add",
"a",
"parameter",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeType.java#L184-L188 |
kstateome/canvas-api | src/main/java/edu/ksu/canvas/CanvasApiFactory.java | CanvasApiFactory.getReader | public <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken) {
"""
Get a reader implementation class to perform API calls with.
@param type Interface type you wish to get an implementation for
@param oauthToken An OAuth token to use for authentication when making API calls
@param <T> The re... | java | public <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken) {
return getReader(type, oauthToken, null);
} | [
"public",
"<",
"T",
"extends",
"CanvasReader",
">",
"T",
"getReader",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"OauthToken",
"oauthToken",
")",
"{",
"return",
"getReader",
"(",
"type",
",",
"oauthToken",
",",
"null",
")",
";",
"}"
] | Get a reader implementation class to perform API calls with.
@param type Interface type you wish to get an implementation for
@param oauthToken An OAuth token to use for authentication when making API calls
@param <T> The reader type to request an instance of
@return A reader implementation class | [
"Get",
"a",
"reader",
"implementation",
"class",
"to",
"perform",
"API",
"calls",
"with",
"."
] | train | https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/CanvasApiFactory.java#L67-L69 |
jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.findProperty | @Transactional
public <T> List<T> findProperty(Class<T> propertyType, E entity, SearchParameters sp, List<Attribute<?, ?>> attributes) {
"""
/*
Find a list of E property.
@param propertyType type of the property
@param entity a sample entity whose non-null properties may be used as search hints
@pa... | java | @Transactional
public <T> List<T> findProperty(Class<T> propertyType, E entity, SearchParameters sp, List<Attribute<?, ?>> attributes) {
if (sp.hasNamedQuery()) {
return byNamedQueryUtil.findByNamedQuery(sp);
}
CriteriaBuilder builder = entityManager.getCriteriaBuilder();
... | [
"@",
"Transactional",
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"findProperty",
"(",
"Class",
"<",
"T",
">",
"propertyType",
",",
"E",
"entity",
",",
"SearchParameters",
"sp",
",",
"List",
"<",
"Attribute",
"<",
"?",
",",
"?",
">",
">",
"attrib... | /*
Find a list of E property.
@param propertyType type of the property
@param entity a sample entity whose non-null properties may be used as search hints
@param sp carries additional search information
@param attributes the list of attributes to the property
@return the entities property matching th... | [
"/",
"*",
"Find",
"a",
"list",
"of",
"E",
"property",
"."
] | train | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L272-L306 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/translator/VariableTranslator.java | VariableTranslator.toObject | public static Object toObject(String type, String value) {
"""
Translates the Passed in String value based on the
Passed in type
@param type
@param value
@return Translated Object
"""
if(StringHelper.isEmpty(value) || EMPTY_STRING.equals(value)){
return null;
}
com.centu... | java | public static Object toObject(String type, String value){
if(StringHelper.isEmpty(value) || EMPTY_STRING.equals(value)){
return null;
}
com.centurylink.mdw.variable.VariableTranslator trans = getTranslator(type);
return trans.toObject(value);
} | [
"public",
"static",
"Object",
"toObject",
"(",
"String",
"type",
",",
"String",
"value",
")",
"{",
"if",
"(",
"StringHelper",
".",
"isEmpty",
"(",
"value",
")",
"||",
"EMPTY_STRING",
".",
"equals",
"(",
"value",
")",
")",
"{",
"return",
"null",
";",
"}... | Translates the Passed in String value based on the
Passed in type
@param type
@param value
@return Translated Object | [
"Translates",
"the",
"Passed",
"in",
"String",
"value",
"based",
"on",
"the",
"Passed",
"in",
"type"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/translator/VariableTranslator.java#L105-L111 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java | SyncGroupsInner.updateAsync | public Observable<SyncGroupInner> updateAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, SyncGroupInner parameters) {
"""
Updates a sync group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azur... | java | public Observable<SyncGroupInner> updateAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, SyncGroupInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).map(new Func1<ServiceResponse<SyncGroup... | [
"public",
"Observable",
"<",
"SyncGroupInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"SyncGroupInner",
"parameters",
")",
"{",
"return",
"updateWithServi... | Updates a sync group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hosted.
@param syncGro... | [
"Updates",
"a",
"sync",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java#L1631-L1638 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java | ExamplePickerTree.addExamples | public void addExamples(final String groupName, final ExampleData[] entries) {
"""
Add a set of examples to the WTree.
@param groupName The name of the example group.
@param entries An array of examples in this group.
"""
data.add(new ExampleMenuList(groupName, entries));
} | java | public void addExamples(final String groupName, final ExampleData[] entries) {
data.add(new ExampleMenuList(groupName, entries));
} | [
"public",
"void",
"addExamples",
"(",
"final",
"String",
"groupName",
",",
"final",
"ExampleData",
"[",
"]",
"entries",
")",
"{",
"data",
".",
"add",
"(",
"new",
"ExampleMenuList",
"(",
"groupName",
",",
"entries",
")",
")",
";",
"}"
] | Add a set of examples to the WTree.
@param groupName The name of the example group.
@param entries An array of examples in this group. | [
"Add",
"a",
"set",
"of",
"examples",
"to",
"the",
"WTree",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePickerTree.java#L67-L69 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/SerIteratorFactory.java | SerIteratorFactory.sortedMap | public static final SerIterable sortedMap(final Class<?> keyType, final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
"""
Gets an iterable wrapper for {@code SortedMap}.
@param keyType the value type, not null
@param valueType the value type, not null
@param valueTypeTypes the generic paramete... | java | public static final SerIterable sortedMap(final Class<?> keyType, final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
final SortedMap<Object, Object> map = new TreeMap<>();
return map(keyType, valueType, valueTypeTypes, map);
} | [
"public",
"static",
"final",
"SerIterable",
"sortedMap",
"(",
"final",
"Class",
"<",
"?",
">",
"keyType",
",",
"final",
"Class",
"<",
"?",
">",
"valueType",
",",
"final",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"valueTypeTypes",
")",
"{",
"final",
"S... | Gets an iterable wrapper for {@code SortedMap}.
@param keyType the value type, not null
@param valueType the value type, not null
@param valueTypeTypes the generic parameters of the value type
@return the iterable, not null | [
"Gets",
"an",
"iterable",
"wrapper",
"for",
"{",
"@code",
"SortedMap",
"}",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerIteratorFactory.java#L549-L552 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.setFontAndSize | public void setFontAndSize(BaseFont bf, float size) {
"""
Set the font and the size for the subsequent text writing.
@param bf the font
@param size the font size in points
"""
checkWriter();
if (size < 0.0001f && size > -0.0001f)
throw new IllegalArgumentException("Font size too... | java | public void setFontAndSize(BaseFont bf, float size) {
checkWriter();
if (size < 0.0001f && size > -0.0001f)
throw new IllegalArgumentException("Font size too small: " + size);
state.size = size;
state.fontDetails = writer.addSimple(bf);
PageResources prs = getPageReso... | [
"public",
"void",
"setFontAndSize",
"(",
"BaseFont",
"bf",
",",
"float",
"size",
")",
"{",
"checkWriter",
"(",
")",
";",
"if",
"(",
"size",
"<",
"0.0001f",
"&&",
"size",
">",
"-",
"0.0001f",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Font siz... | Set the font and the size for the subsequent text writing.
@param bf the font
@param size the font size in points | [
"Set",
"the",
"font",
"and",
"the",
"size",
"for",
"the",
"subsequent",
"text",
"writing",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L1384-L1394 |
threerings/narya | core/src/main/java/com/threerings/admin/client/PulldownFieldEditor.java | PulldownFieldEditor.addChoice | public void addChoice (Object choice) {
"""
Add the specified object as a choice. The name will be the
toString() of the object.
"""
String name = (choice == null) ? "null" : choice.toString();
addChoice(new Choice(name, choice));
} | java | public void addChoice (Object choice)
{
String name = (choice == null) ? "null" : choice.toString();
addChoice(new Choice(name, choice));
} | [
"public",
"void",
"addChoice",
"(",
"Object",
"choice",
")",
"{",
"String",
"name",
"=",
"(",
"choice",
"==",
"null",
")",
"?",
"\"null\"",
":",
"choice",
".",
"toString",
"(",
")",
";",
"addChoice",
"(",
"new",
"Choice",
"(",
"name",
",",
"choice",
... | Add the specified object as a choice. The name will be the
toString() of the object. | [
"Add",
"the",
"specified",
"object",
"as",
"a",
"choice",
".",
"The",
"name",
"will",
"be",
"the",
"toString",
"()",
"of",
"the",
"object",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/client/PulldownFieldEditor.java#L92-L96 |
google/gwtmockito | gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeMessagesProvider.java | FakeMessagesProvider.getFake | @Override
@SuppressWarnings("unchecked") // safe since the proxy implements type
public T getFake(Class<?> type) {
"""
Returns a new instance of the given type that implements methods as
described in the class description.
@param type interface to be implemented by the returned type.
"""
return (T)... | java | @Override
@SuppressWarnings("unchecked") // safe since the proxy implements type
public T getFake(Class<?> type) {
return (T) Proxy.newProxyInstance(FakeMessagesProvider.class.getClassLoader(), new Class<?>[] {type},
new InvocationHandler() {
@Override
public Object invoke(Object pro... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// safe since the proxy implements type",
"public",
"T",
"getFake",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"(",
"T",
")",
"Proxy",
".",
"newProxyInstance",
"(",
"FakeMessages... | Returns a new instance of the given type that implements methods as
described in the class description.
@param type interface to be implemented by the returned type. | [
"Returns",
"a",
"new",
"instance",
"of",
"the",
"given",
"type",
"that",
"implements",
"methods",
"as",
"described",
"in",
"the",
"class",
"description",
"."
] | train | https://github.com/google/gwtmockito/blob/e886a9b9d290169b5f83582dd89b7545c5f198a2/gwtmockito/src/main/java/com/google/gwtmockito/fakes/FakeMessagesProvider.java#L45-L68 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/JsonDataProviderImpl.java | JsonDataProviderImpl.getDataByIndex | @Override
public Object[][] getDataByIndex(int[] indexes) {
"""
Gets JSON data from a resource for the specified indexes.
@param indexes
The set of indexes to be fetched from the JSON file.
"""
validateResourceParams(resource);
Preconditions.checkArgument((indexes.length != 0), "Indexes... | java | @Override
public Object[][] getDataByIndex(int[] indexes) {
validateResourceParams(resource);
Preconditions.checkArgument((indexes.length != 0), "Indexes cannot be empty");
logger.entering(indexes);
Object[][] requestedData = null;
Class<?> arrayType;
JsonReader reade... | [
"@",
"Override",
"public",
"Object",
"[",
"]",
"[",
"]",
"getDataByIndex",
"(",
"int",
"[",
"]",
"indexes",
")",
"{",
"validateResourceParams",
"(",
"resource",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"(",
"indexes",
".",
"length",
"!=",
"0",... | Gets JSON data from a resource for the specified indexes.
@param indexes
The set of indexes to be fetched from the JSON file. | [
"Gets",
"JSON",
"data",
"from",
"a",
"resource",
"for",
"the",
"specified",
"indexes",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/JsonDataProviderImpl.java#L148-L176 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/PassThruTable.java | PassThruTable.copyKeys | public void copyKeys(Record recAlt, Record recMain, int iKeyArea) {
"""
Copy the fields from the (main) source to the (mirrored) destination record.
This is done before any write or set.
@param recAlt Destination record
@param recMain Source record
"""
BaseBuffer vector = new VectorBuffer(null);
... | java | public void copyKeys(Record recAlt, Record recMain, int iKeyArea)
{
BaseBuffer vector = new VectorBuffer(null);
KeyArea keyMain = recMain.getKeyArea(iKeyArea);
KeyArea keyAlt = recAlt.getKeyArea(iKeyArea);
keyMain.setupKeyBuffer(vector, DBConstants.FILE_KEY_AREA);
keyAlt.reve... | [
"public",
"void",
"copyKeys",
"(",
"Record",
"recAlt",
",",
"Record",
"recMain",
",",
"int",
"iKeyArea",
")",
"{",
"BaseBuffer",
"vector",
"=",
"new",
"VectorBuffer",
"(",
"null",
")",
";",
"KeyArea",
"keyMain",
"=",
"recMain",
".",
"getKeyArea",
"(",
"iKe... | Copy the fields from the (main) source to the (mirrored) destination record.
This is done before any write or set.
@param recAlt Destination record
@param recMain Source record | [
"Copy",
"the",
"fields",
"from",
"the",
"(",
"main",
")",
"source",
"to",
"the",
"(",
"mirrored",
")",
"destination",
"record",
".",
"This",
"is",
"done",
"before",
"any",
"write",
"or",
"set",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/PassThruTable.java#L558-L566 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java | QueryReferenceBroker.retrieveCollection | public void retrieveCollection(Object obj, ClassDescriptor cld, CollectionDescriptor cds, boolean forced) {
"""
Retrieve a single Collection on behalf of <b>obj</b>.
The Collection is retrieved only if <b>cascade.retrieve is true</b>
or if <b>forced</b> is set to true. *
@param obj - the object to be upda... | java | public void retrieveCollection(Object obj, ClassDescriptor cld, CollectionDescriptor cds, boolean forced)
{
doRetrieveCollection(obj, cld, cds, forced, cds.isLazy());
} | [
"public",
"void",
"retrieveCollection",
"(",
"Object",
"obj",
",",
"ClassDescriptor",
"cld",
",",
"CollectionDescriptor",
"cds",
",",
"boolean",
"forced",
")",
"{",
"doRetrieveCollection",
"(",
"obj",
",",
"cld",
",",
"cds",
",",
"forced",
",",
"cds",
".",
"... | Retrieve a single Collection on behalf of <b>obj</b>.
The Collection is retrieved only if <b>cascade.retrieve is true</b>
or if <b>forced</b> is set to true. *
@param obj - the object to be updated
@param cld - the ClassDescriptor describing obj
@param cds - the CollectionDescriptor describing the collection attri... | [
"Retrieve",
"a",
"single",
"Collection",
"on",
"behalf",
"of",
"<b",
">",
"obj<",
"/",
"b",
">",
".",
"The",
"Collection",
"is",
"retrieved",
"only",
"if",
"<b",
">",
"cascade",
".",
"retrieve",
"is",
"true<",
"/",
"b",
">",
"or",
"if",
"<b",
">",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java#L720-L723 |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.printQuery | public QueryResult printQuery( Session session,
String jcrSql2,
long expectedNumberOfResults,
Variable... variables ) throws RepositoryException {
"""
Execute the supplied JCR-SQL2 query and, if printing is ena... | java | public QueryResult printQuery( Session session,
String jcrSql2,
long expectedNumberOfResults,
Variable... variables ) throws RepositoryException {
Map<String, String> keyValuePairs = new HashMap<String, Stri... | [
"public",
"QueryResult",
"printQuery",
"(",
"Session",
"session",
",",
"String",
"jcrSql2",
",",
"long",
"expectedNumberOfResults",
",",
"Variable",
"...",
"variables",
")",
"throws",
"RepositoryException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"keyValueP... | Execute the supplied JCR-SQL2 query and, if printing is enabled, print out the results.
@param session the session
@param jcrSql2 the JCR-SQL2 query
@param expectedNumberOfResults the expected number of rows in the results, or -1 if this is not to be checked
@param variables the variables for the query
@return the res... | [
"Execute",
"the",
"supplied",
"JCR",
"-",
"SQL2",
"query",
"and",
"if",
"printing",
"is",
"enabled",
"print",
"out",
"the",
"results",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L642-L651 |
finmath/finmath-lib | src/main/java6/net/finmath/marketdata/calibration/CalibratedCurves.java | CalibratedCurves.getCloneShifted | public CalibratedCurves getCloneShifted(Pattern symbolRegExp, double shift) throws SolverException, CloneNotSupportedException {
"""
Returns the set curves calibrated to "shifted" market data, that is,
the market date of <code>this</code> object, modified by the shifts
provided to this methods.
This method wi... | java | public CalibratedCurves getCloneShifted(Pattern symbolRegExp, double shift) throws SolverException, CloneNotSupportedException {
// Clone calibration specs, shifting the desired symbol
List<CalibrationSpec> calibrationSpecsShifted = new ArrayList<CalibrationSpec>();
for(CalibrationSpec calibrationSpec : calibrat... | [
"public",
"CalibratedCurves",
"getCloneShifted",
"(",
"Pattern",
"symbolRegExp",
",",
"double",
"shift",
")",
"throws",
"SolverException",
",",
"CloneNotSupportedException",
"{",
"// Clone calibration specs, shifting the desired symbol",
"List",
"<",
"CalibrationSpec",
">",
"... | Returns the set curves calibrated to "shifted" market data, that is,
the market date of <code>this</code> object, modified by the shifts
provided to this methods.
This method will shift all symbols matching a given regular expression <code>Pattern</code>.
@see java.util.regex.Pattern
@param symbolRegExp A pattern, i... | [
"Returns",
"the",
"set",
"curves",
"calibrated",
"to",
"shifted",
"market",
"data",
"that",
"is",
"the",
"market",
"date",
"of",
"<code",
">",
"this<",
"/",
"code",
">",
"object",
"modified",
"by",
"the",
"shifts",
"provided",
"to",
"this",
"methods",
"."
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/calibration/CalibratedCurves.java#L596-L611 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.zipDir | public static void zipDir(final File srcDir, final String destPath, final File destFile) throws IOException {
"""
Creates a ZIP file and adds all files in a directory and all it's sub directories to the archive.
@param srcDir
Directory to add - Cannot be <code>null</code> and must be a valid directory.
@param... | java | public static void zipDir(final File srcDir, final String destPath, final File destFile) throws IOException {
zipDir(srcDir, null, destPath, destFile);
} | [
"public",
"static",
"void",
"zipDir",
"(",
"final",
"File",
"srcDir",
",",
"final",
"String",
"destPath",
",",
"final",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"zipDir",
"(",
"srcDir",
",",
"null",
",",
"destPath",
",",
"destFile",
")",
";",... | Creates a ZIP file and adds all files in a directory and all it's sub directories to the archive.
@param srcDir
Directory to add - Cannot be <code>null</code> and must be a valid directory.
@param destPath
Path to use for the ZIP archive - May be <code>null</code> or an empyt string.
@param destFile
Target ZIP file - ... | [
"Creates",
"a",
"ZIP",
"file",
"and",
"adds",
"all",
"files",
"in",
"a",
"directory",
"and",
"all",
"it",
"s",
"sub",
"directories",
"to",
"the",
"archive",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1404-L1408 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/time/DateTimePeriod.java | DateTimePeriod.toYears | public List<DateTimePeriod> toYears() {
"""
Converts this period to a list of year periods. Partial years will not be
included. For example, a period of "2009-2010" will return a list
of 2 years - one for 2009 and one for 2010. On the other hand, a period
of "January 2009" would return an empty list since pa... | java | public List<DateTimePeriod> toYears() {
ArrayList<DateTimePeriod> list = new ArrayList<DateTimePeriod>();
// default "current" year to start datetime
DateTime currentStart = getStart();
// calculate "next" year
DateTime nextStart = currentStart.plusYears(1);
// continue ... | [
"public",
"List",
"<",
"DateTimePeriod",
">",
"toYears",
"(",
")",
"{",
"ArrayList",
"<",
"DateTimePeriod",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"DateTimePeriod",
">",
"(",
")",
";",
"// default \"current\" year to start datetime",
"DateTime",
"currentStart",
... | Converts this period to a list of year periods. Partial years will not be
included. For example, a period of "2009-2010" will return a list
of 2 years - one for 2009 and one for 2010. On the other hand, a period
of "January 2009" would return an empty list since partial
years are not included.
@return A list of year... | [
"Converts",
"this",
"period",
"to",
"a",
"list",
"of",
"year",
"periods",
".",
"Partial",
"years",
"will",
"not",
"be",
"included",
".",
"For",
"example",
"a",
"period",
"of",
"2009",
"-",
"2010",
"will",
"return",
"a",
"list",
"of",
"2",
"years",
"-",... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/time/DateTimePeriod.java#L354-L371 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/StandardModelFactories.java | StandardModelFactories.rulesOf | private static final <T> RuleFactory<T> rulesOf(DynamoDBMapperConfig config, S3Link.Factory s3Links, DynamoDBMapperModelFactory models) {
"""
Creates a new set of conversion rules based on the configuration.
"""
final boolean ver1 = (config.getConversionSchema() == ConversionSchemas.V1);
final ... | java | private static final <T> RuleFactory<T> rulesOf(DynamoDBMapperConfig config, S3Link.Factory s3Links, DynamoDBMapperModelFactory models) {
final boolean ver1 = (config.getConversionSchema() == ConversionSchemas.V1);
final boolean ver2 = (config.getConversionSchema() == ConversionSchemas.V2);
fina... | [
"private",
"static",
"final",
"<",
"T",
">",
"RuleFactory",
"<",
"T",
">",
"rulesOf",
"(",
"DynamoDBMapperConfig",
"config",
",",
"S3Link",
".",
"Factory",
"s3Links",
",",
"DynamoDBMapperModelFactory",
"models",
")",
"{",
"final",
"boolean",
"ver1",
"=",
"(",
... | Creates a new set of conversion rules based on the configuration. | [
"Creates",
"a",
"new",
"set",
"of",
"conversion",
"rules",
"based",
"on",
"the",
"configuration",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/StandardModelFactories.java#L155-L181 |
zandero/cmd | src/main/java/com/zandero/cmd/CommandBuilder.java | CommandBuilder.setHelp | public void setHelp(String appVersion, String usageExample) {
"""
Sets app version and example to be show in help screen
@param appVersion application name and version
@param usageExample example or additional data
"""
helpAppVersion = StringUtils.trimToNull(appVersion);
helpAppExample = StringUtils.tri... | java | public void setHelp(String appVersion, String usageExample) {
helpAppVersion = StringUtils.trimToNull(appVersion);
helpAppExample = StringUtils.trimToNull(usageExample);
} | [
"public",
"void",
"setHelp",
"(",
"String",
"appVersion",
",",
"String",
"usageExample",
")",
"{",
"helpAppVersion",
"=",
"StringUtils",
".",
"trimToNull",
"(",
"appVersion",
")",
";",
"helpAppExample",
"=",
"StringUtils",
".",
"trimToNull",
"(",
"usageExample",
... | Sets app version and example to be show in help screen
@param appVersion application name and version
@param usageExample example or additional data | [
"Sets",
"app",
"version",
"and",
"example",
"to",
"be",
"show",
"in",
"help",
"screen"
] | train | https://github.com/zandero/cmd/blob/cf0c3b0afdd413f9f52243164bdf28e1db3e523f/src/main/java/com/zandero/cmd/CommandBuilder.java#L185-L189 |
sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.createPersistent | public void createPersistent(String path, boolean createParents) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
"""
Create a persistent node and set its ACLs.
@param path
@param createParents
if true all parent dirs are created as well and no {@link ZkNodeExistsExcept... | java | public void createPersistent(String path, boolean createParents) throws ZkInterruptedException, IllegalArgumentException, ZkException, RuntimeException {
createPersistent(path, createParents, ZooDefs.Ids.OPEN_ACL_UNSAFE);
} | [
"public",
"void",
"createPersistent",
"(",
"String",
"path",
",",
"boolean",
"createParents",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"createPersistent",
"(",
"path",
",",
"createParents... | Create a persistent node and set its ACLs.
@param path
@param createParents
if true all parent dirs are created as well and no {@link ZkNodeExistsException} is thrown in case the
path already exists
@throws ZkInterruptedException
if operation was interrupted, or a required reconnection got interrupted
@throws IllegalA... | [
"Create",
"a",
"persistent",
"node",
"and",
"set",
"its",
"ACLs",
"."
] | train | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L270-L272 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java | AbstractMappedClassFieldObserver.onFieldCustom | protected void onFieldCustom(final Object obj, final Field field, final Bin annotation, final Object customFieldProcessor, final Object value) {
"""
Notification about custom field.
@param obj the object instance, must not be null
@param field the custom field, must not be null
... | java | protected void onFieldCustom(final Object obj, final Field field, final Bin annotation, final Object customFieldProcessor, final Object value) {
} | [
"protected",
"void",
"onFieldCustom",
"(",
"final",
"Object",
"obj",
",",
"final",
"Field",
"field",
",",
"final",
"Bin",
"annotation",
",",
"final",
"Object",
"customFieldProcessor",
",",
"final",
"Object",
"value",
")",
"{",
"}"
] | Notification about custom field.
@param obj the object instance, must not be null
@param field the custom field, must not be null
@param annotation the annotation for the field, must not be null
@param customFieldProcessor processor for custom fields, must not be null
@param v... | [
"Notification",
"about",
"custom",
"field",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java#L527-L529 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfCopy.java | PdfCopy.getImportedPage | public PdfImportedPage getImportedPage(PdfReader reader, int pageNumber) {
"""
Grabs a page from the input document
@param reader the reader of the document
@param pageNumber which page to get
@return the page
"""
if (currentPdfReaderInstance != null) {
if (currentPdfReaderInstance.getRe... | java | public PdfImportedPage getImportedPage(PdfReader reader, int pageNumber) {
if (currentPdfReaderInstance != null) {
if (currentPdfReaderInstance.getReader() != reader) {
try {
currentPdfReaderInstance.getReader().close();
currentPdfReaderInstanc... | [
"public",
"PdfImportedPage",
"getImportedPage",
"(",
"PdfReader",
"reader",
",",
"int",
"pageNumber",
")",
"{",
"if",
"(",
"currentPdfReaderInstance",
"!=",
"null",
")",
"{",
"if",
"(",
"currentPdfReaderInstance",
".",
"getReader",
"(",
")",
"!=",
"reader",
")",... | Grabs a page from the input document
@param reader the reader of the document
@param pageNumber which page to get
@return the page | [
"Grabs",
"a",
"page",
"from",
"the",
"input",
"document"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfCopy.java#L160-L177 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2.java | SM2.verify | public boolean verify(byte[] data, byte[] sign, byte[] id) {
"""
用公钥检验数字签名的合法性
@param data 数据
@param sign 签名
@param id 可以为null,若为null,则默认withId为字节数组:"1234567812345678".getBytes()
@return 是否验证通过
"""
lock.lock();
final SM2Signer signer = getSigner();
try {
CipherParameters param = getCipherPar... | java | public boolean verify(byte[] data, byte[] sign, byte[] id) {
lock.lock();
final SM2Signer signer = getSigner();
try {
CipherParameters param = getCipherParameters(KeyType.PublicKey);
if (id != null) {
param = new ParametersWithID(param, id);
}
signer.init(false, param);
signer.update(d... | [
"public",
"boolean",
"verify",
"(",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"sign",
",",
"byte",
"[",
"]",
"id",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"final",
"SM2Signer",
"signer",
"=",
"getSigner",
"(",
")",
";",
"try",
"{",
... | 用公钥检验数字签名的合法性
@param data 数据
@param sign 签名
@param id 可以为null,若为null,则默认withId为字节数组:"1234567812345678".getBytes()
@return 是否验证通过 | [
"用公钥检验数字签名的合法性"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2.java#L219-L235 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.findAll | @Override
public List<CPDefinitionOptionValueRel> findAll() {
"""
Returns all the cp definition option value rels.
@return the cp definition option value rels
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionOptionValueRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionValueRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition option value rels.
@return the cp definition option value rels | [
"Returns",
"all",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L4638-L4641 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/HBaseUtils.java | HBaseUtils.addColumnsToScan | public static void addColumnsToScan(Collection<String> columns, final Scan scan) {
"""
Add a Collection of Columns to a Scanner, Only Add Single Columns
If Their Family Isn't Already Being Added.
@param columns
Collection of columns to add to the scan
@param scan
The scanner object to add the columns to
"... | java | public static void addColumnsToScan(Collection<String> columns, final Scan scan) {
addColumnsToOperation(columns, new Operation() {
@Override
public void addColumn(byte[] family, byte[] column) {
scan.addColumn(family, column);
}
@Override
public void addFamily(byte[] family) ... | [
"public",
"static",
"void",
"addColumnsToScan",
"(",
"Collection",
"<",
"String",
">",
"columns",
",",
"final",
"Scan",
"scan",
")",
"{",
"addColumnsToOperation",
"(",
"columns",
",",
"new",
"Operation",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"add... | Add a Collection of Columns to a Scanner, Only Add Single Columns
If Their Family Isn't Already Being Added.
@param columns
Collection of columns to add to the scan
@param scan
The scanner object to add the columns to | [
"Add",
"a",
"Collection",
"of",
"Columns",
"to",
"a",
"Scanner",
"Only",
"Add",
"Single",
"Columns",
"If",
"Their",
"Family",
"Isn",
"t",
"Already",
"Being",
"Added",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/HBaseUtils.java#L148-L160 |
thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/StokesEinsteinConverter.java | StokesEinsteinConverter.ViscosityByAndradeEquation | public static double ViscosityByAndradeEquation(double temperatur, SOLVENT s) {
"""
Calculates the viscosity for different solvent in dependence from the temperatur [k]. Please see
https://de.wikipedia.org/wiki/Andrade-Gleichung
@param temperatur Temperatur in Kelvin [K]
@return Viscosity in [kg m^-1 s^-1]
... | java | public static double ViscosityByAndradeEquation(double temperatur, SOLVENT s){
double res = 0;
double a;
double b;
switch (s) {
case WATER:
if(temperatur<274 || temperatur>373){
throw new IllegalArgumentException("The andrade equation can not be applied for this solvent/temperatur combination.");
}
... | [
"public",
"static",
"double",
"ViscosityByAndradeEquation",
"(",
"double",
"temperatur",
",",
"SOLVENT",
"s",
")",
"{",
"double",
"res",
"=",
"0",
";",
"double",
"a",
";",
"double",
"b",
";",
"switch",
"(",
"s",
")",
"{",
"case",
"WATER",
":",
"if",
"(... | Calculates the viscosity for different solvent in dependence from the temperatur [k]. Please see
https://de.wikipedia.org/wiki/Andrade-Gleichung
@param temperatur Temperatur in Kelvin [K]
@return Viscosity in [kg m^-1 s^-1] | [
"Calculates",
"the",
"viscosity",
"for",
"different",
"solvent",
"in",
"dependence",
"from",
"the",
"temperatur",
"[",
"k",
"]",
".",
"Please",
"see",
"https",
":",
"//",
"de",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Andrade",
"-",
"Gleichung"
] | train | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/StokesEinsteinConverter.java#L54-L99 |
JodaOrg/joda-time | src/main/java/org/joda/time/convert/CalendarConverter.java | CalendarConverter.getInstantMillis | public long getInstantMillis(Object object, Chronology chrono) {
"""
Gets the millis, which is the Calendar millis value.
@param object the Calendar to convert, must not be null
@param chrono the chronology result from getChronology, non-null
@return the millisecond value
@throws NullPointerException if th... | java | public long getInstantMillis(Object object, Chronology chrono) {
Calendar calendar = (Calendar) object;
return calendar.getTime().getTime();
} | [
"public",
"long",
"getInstantMillis",
"(",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"Calendar",
"calendar",
"=",
"(",
"Calendar",
")",
"object",
";",
"return",
"calendar",
".",
"getTime",
"(",
")",
".",
"getTime",
"(",
")",
";",
"}"
] | Gets the millis, which is the Calendar millis value.
@param object the Calendar to convert, must not be null
@param chrono the chronology result from getChronology, non-null
@return the millisecond value
@throws NullPointerException if the object is null
@throws ClassCastException if the object is an invalid type | [
"Gets",
"the",
"millis",
"which",
"is",
"the",
"Calendar",
"millis",
"value",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/CalendarConverter.java#L120-L123 |
mbeiter/util | db/src/main/java/org/beiter/michael/db/propsbuilder/MapBasedConnPropsBuilder.java | MapBasedConnPropsBuilder.logValue | private static void logValue(final String key, final String value) {
"""
Create a log entry when a value has been successfully configured.
@param key The configuration key
@param value The value that is being used
"""
// Fortify will report a violation here because of disclosure of potentially c... | java | private static void logValue(final String key, final String value) {
// Fortify will report a violation here because of disclosure of potentially confidential information.
// However, the configuration keys are not confidential, which makes this a non-issue / false positive.
if (LOG.isInfoEnabl... | [
"private",
"static",
"void",
"logValue",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"// Fortify will report a violation here because of disclosure of potentially confidential information.",
"// However, the configuration keys are not confidential, which m... | Create a log entry when a value has been successfully configured.
@param key The configuration key
@param value The value that is being used | [
"Create",
"a",
"log",
"entry",
"when",
"a",
"value",
"has",
"been",
"successfully",
"configured",
"."
] | train | https://github.com/mbeiter/util/blob/490fcebecb936e00c2f2ce2096b679b2fd10865e/db/src/main/java/org/beiter/michael/db/propsbuilder/MapBasedConnPropsBuilder.java#L630-L654 |
Virtlink/commons-configuration2-jackson | src/main/java/com/virtlink/commons/configuration2/jackson/JacksonConfiguration.java | JacksonConfiguration.addChildNode | private void addChildNode(final Builder builder, final String name, final Object value) {
"""
Adds a child node to the specified builder.
@param builder The builder to add the node to.
@param name The name of the node.
@param value The value of the node.
"""
assert !(value instanceof List);
... | java | private void addChildNode(final Builder builder, final String name, final Object value) {
assert !(value instanceof List);
final Builder childBuilder = new Builder();
// Set the name of the child node.
childBuilder.name(name);
// Set the value of the child node.
final Im... | [
"private",
"void",
"addChildNode",
"(",
"final",
"Builder",
"builder",
",",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
")",
"{",
"assert",
"!",
"(",
"value",
"instanceof",
"List",
")",
";",
"final",
"Builder",
"childBuilder",
"=",
"new",
"... | Adds a child node to the specified builder.
@param builder The builder to add the node to.
@param name The name of the node.
@param value The value of the node. | [
"Adds",
"a",
"child",
"node",
"to",
"the",
"specified",
"builder",
"."
] | train | https://github.com/Virtlink/commons-configuration2-jackson/blob/40474ab3c641fbbb4ccd9c97d4f7075c1644ef69/src/main/java/com/virtlink/commons/configuration2/jackson/JacksonConfiguration.java#L185-L195 |
alkacon/opencms-core | src/org/opencms/file/collectors/CmsDefaultResourceCollector.java | CmsDefaultResourceCollector.allInFolderNavPos | protected List<CmsResource> allInFolderNavPos(CmsObject cms, String param, boolean readSubTree, int numResults)
throws CmsException {
"""
Collects all resources in a folder (or subtree) sorted by the NavPos property.<p>
@param cms the current user's Cms object
@param param the collector's parameter(s)
@pa... | java | protected List<CmsResource> allInFolderNavPos(CmsObject cms, String param, boolean readSubTree, int numResults)
throws CmsException {
CmsCollectorData data = new CmsCollectorData(param);
String foldername = CmsResource.getFolderPath(data.getFileName());
CmsResourceFilter filter = CmsResour... | [
"protected",
"List",
"<",
"CmsResource",
">",
"allInFolderNavPos",
"(",
"CmsObject",
"cms",
",",
"String",
"param",
",",
"boolean",
"readSubTree",
",",
"int",
"numResults",
")",
"throws",
"CmsException",
"{",
"CmsCollectorData",
"data",
"=",
"new",
"CmsCollectorDa... | Collects all resources in a folder (or subtree) sorted by the NavPos property.<p>
@param cms the current user's Cms object
@param param the collector's parameter(s)
@param readSubTree if true, collects all resources in the subtree
@param numResults the number of results
@return a List of Cms resources found by the col... | [
"Collects",
"all",
"resources",
"in",
"a",
"folder",
"(",
"or",
"subtree",
")",
"sorted",
"by",
"the",
"NavPos",
"property",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/collectors/CmsDefaultResourceCollector.java#L255-L304 |
SonarSource/sonarqube | server/sonar-server-common/src/main/java/org/sonar/server/user/index/UserIndexer.java | UserIndexer.postCommit | private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
"""
Entry point for Byteman tests. See directory tests/resilience.
The parameter "logins" is used only by the Byteman script.
"""
index(dbSession, items);
} | java | private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
index(dbSession, items);
} | [
"private",
"void",
"postCommit",
"(",
"DbSession",
"dbSession",
",",
"Collection",
"<",
"String",
">",
"logins",
",",
"Collection",
"<",
"EsQueueDto",
">",
"items",
")",
"{",
"index",
"(",
"dbSession",
",",
"items",
")",
";",
"}"
] | Entry point for Byteman tests. See directory tests/resilience.
The parameter "logins" is used only by the Byteman script. | [
"Entry",
"point",
"for",
"Byteman",
"tests",
".",
"See",
"directory",
"tests",
"/",
"resilience",
".",
"The",
"parameter",
"logins",
"is",
"used",
"only",
"by",
"the",
"Byteman",
"script",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server-common/src/main/java/org/sonar/server/user/index/UserIndexer.java#L99-L101 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/sections/SectionLoader.java | SectionLoader.addressIsWithin | private static boolean addressIsWithin(Location location, long address) {
"""
Returns true if the address is within the given location
@param location
@param address
a address that may point into the section
@return true iff address is within location
"""
long endpoint = location.from() + locatio... | java | private static boolean addressIsWithin(Location location, long address) {
long endpoint = location.from() + location.size();
return address >= location.from() && address < endpoint;
} | [
"private",
"static",
"boolean",
"addressIsWithin",
"(",
"Location",
"location",
",",
"long",
"address",
")",
"{",
"long",
"endpoint",
"=",
"location",
".",
"from",
"(",
")",
"+",
"location",
".",
"size",
"(",
")",
";",
"return",
"address",
">=",
"location"... | Returns true if the address is within the given location
@param location
@param address
a address that may point into the section
@return true iff address is within location | [
"Returns",
"true",
"if",
"the",
"address",
"is",
"within",
"the",
"given",
"location"
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/sections/SectionLoader.java#L421-L424 |
josueeduardo/snappy | plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/jar/JarFile.java | JarFile.getUrl | public URL getUrl() throws MalformedURLException {
"""
Return a URL that can be used to access this JAR file. NOTE: the specified URL
cannot be serialized and or cloned.
@return the URL
@throws MalformedURLException if the URL is malformed
"""
if (this.url == null) {
Handler handler = ... | java | public URL getUrl() throws MalformedURLException {
if (this.url == null) {
Handler handler = new Handler(this);
String file = this.rootFile.getFile().toURI() + this.pathFromRoot + "!/";
file = file.replace("file:////", "file://"); // Fix UNC paths
this.url = new U... | [
"public",
"URL",
"getUrl",
"(",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"this",
".",
"url",
"==",
"null",
")",
"{",
"Handler",
"handler",
"=",
"new",
"Handler",
"(",
"this",
")",
";",
"String",
"file",
"=",
"this",
".",
"rootFile",
".",... | Return a URL that can be used to access this JAR file. NOTE: the specified URL
cannot be serialized and or cloned.
@return the URL
@throws MalformedURLException if the URL is malformed | [
"Return",
"a",
"URL",
"that",
"can",
"be",
"used",
"to",
"access",
"this",
"JAR",
"file",
".",
"NOTE",
":",
"the",
"specified",
"URL",
"cannot",
"be",
"serialized",
"and",
"or",
"cloned",
"."
] | train | https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/jar/JarFile.java#L452-L460 |
katharsis-project/katharsis-framework | katharsis-core/src/main/java/io/katharsis/module/ModuleRegistry.java | ModuleRegistry.getResourceInformationBuilder | public ResourceInformationBuilder getResourceInformationBuilder() {
"""
Returns a {@link ResourceInformationBuilder} instance that combines all
instances registered by modules.
@return resource information builder
"""
CombinedResourceInformationBuilder resourceInformationBuilder = new CombinedResourceInf... | java | public ResourceInformationBuilder getResourceInformationBuilder() {
CombinedResourceInformationBuilder resourceInformationBuilder = new CombinedResourceInformationBuilder(aggregatedModule.getResourceInformationBuilders());
DefaultResourceInformationBuilderContext context = new DefaultResourceInformationBuilderConte... | [
"public",
"ResourceInformationBuilder",
"getResourceInformationBuilder",
"(",
")",
"{",
"CombinedResourceInformationBuilder",
"resourceInformationBuilder",
"=",
"new",
"CombinedResourceInformationBuilder",
"(",
"aggregatedModule",
".",
"getResourceInformationBuilders",
"(",
")",
")... | Returns a {@link ResourceInformationBuilder} instance that combines all
instances registered by modules.
@return resource information builder | [
"Returns",
"a",
"{",
"@link",
"ResourceInformationBuilder",
"}",
"instance",
"that",
"combines",
"all",
"instances",
"registered",
"by",
"modules",
"."
] | train | https://github.com/katharsis-project/katharsis-framework/blob/73d1a8763c49c5cf4643d43e2dbfedb647630c46/katharsis-core/src/main/java/io/katharsis/module/ModuleRegistry.java#L234-L239 |
liferay/com-liferay-commerce | commerce-currency-api/src/main/java/com/liferay/commerce/currency/model/CommerceCurrencyWrapper.java | CommerceCurrencyWrapper.getName | @Override
public String getName(String languageId, boolean useDefault) {
"""
Returns the localized name of this commerce currency in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to u... | java | @Override
public String getName(String languageId, boolean useDefault) {
return _commerceCurrency.getName(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getName",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceCurrency",
".",
"getName",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized name of this commerce currency in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested language
@return t... | [
"Returns",
"the",
"localized",
"name",
"of",
"this",
"commerce",
"currency",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-api/src/main/java/com/liferay/commerce/currency/model/CommerceCurrencyWrapper.java#L457-L460 |
ksoichiro/Android-ObservableScrollView | library/src/main/java/com/github/ksoichiro/android/observablescrollview/ScrollUtils.java | ScrollUtils.getFloat | public static float getFloat(final float value, final float minValue, final float maxValue) {
"""
Return a float value within the range.
<p>This is just a wrapper for Math.min() and Math.max().
This may be useful if you feel it confusing ("Which is min and which is max?").</p>
@param value The target value... | java | public static float getFloat(final float value, final float minValue, final float maxValue) {
return Math.min(maxValue, Math.max(minValue, value));
} | [
"public",
"static",
"float",
"getFloat",
"(",
"final",
"float",
"value",
",",
"final",
"float",
"minValue",
",",
"final",
"float",
"maxValue",
")",
"{",
"return",
"Math",
".",
"min",
"(",
"maxValue",
",",
"Math",
".",
"max",
"(",
"minValue",
",",
"value"... | Return a float value within the range.
<p>This is just a wrapper for Math.min() and Math.max().
This may be useful if you feel it confusing ("Which is min and which is max?").</p>
@param value The target value.
@param minValue Minimum value. If value is less than this, minValue will be returned.
@param maxValue Max... | [
"Return",
"a",
"float",
"value",
"within",
"the",
"range",
".",
"<p",
">",
"This",
"is",
"just",
"a",
"wrapper",
"for",
"Math",
".",
"min",
"()",
"and",
"Math",
".",
"max",
"()",
".",
"This",
"may",
"be",
"useful",
"if",
"you",
"feel",
"it",
"confu... | train | https://github.com/ksoichiro/Android-ObservableScrollView/blob/47a5fb2db5e93d923a8c6772cde48bbb7d932345/library/src/main/java/com/github/ksoichiro/android/observablescrollview/ScrollUtils.java#L41-L43 |
sporniket/core | sporniket-core-io/src/main/java/com/sporniket/libre/io/TextLoader.java | TextLoader.append | public StringBuffer append(File source, StringBuffer buffer) throws IOException {
"""
Load a text from the specified file and put it in the provided StringBuffer.
@param source source file.
@param buffer buffer to load text into.
@return the buffer.
@throws IOException if there is a problem to deal with.
... | java | public StringBuffer append(File source, StringBuffer buffer) throws IOException
{
return append(new FileInputStream(source), buffer);
} | [
"public",
"StringBuffer",
"append",
"(",
"File",
"source",
",",
"StringBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"return",
"append",
"(",
"new",
"FileInputStream",
"(",
"source",
")",
",",
"buffer",
")",
";",
"}"
] | Load a text from the specified file and put it in the provided StringBuffer.
@param source source file.
@param buffer buffer to load text into.
@return the buffer.
@throws IOException if there is a problem to deal with. | [
"Load",
"a",
"text",
"from",
"the",
"specified",
"file",
"and",
"put",
"it",
"in",
"the",
"provided",
"StringBuffer",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-io/src/main/java/com/sporniket/libre/io/TextLoader.java#L161-L164 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.