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 |
|---|---|---|---|---|---|---|---|---|---|---|
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java | AnnotationQuery.setTags | public final void setTags(Map<String, String> tags) {
"""
Replaces the tags for the query.
@param tags The new tags. May be null.
"""
Map<String, String> updatedTags = new TreeMap<>();
if (tags != null) {
for (Map.Entry<String, String> entry : tags.entrySet()) {
... | java | public final void setTags(Map<String, String> tags) {
Map<String, String> updatedTags = new TreeMap<>();
if (tags != null) {
for (Map.Entry<String, String> entry : tags.entrySet()) {
String key = entry.getKey();
requireArgument(!Metric.ReservedField.isReserv... | [
"public",
"final",
"void",
"setTags",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"updatedTags",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"if",
"(",
"tags",
"!=",
"null",
")",
"{",
... | Replaces the tags for the query.
@param tags The new tags. May be null. | [
"Replaces",
"the",
"tags",
"for",
"the",
"query",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java#L222-L235 |
netty/netty | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.addComponents | public CompositeByteBuf addComponents(boolean increaseWriterIndex, ByteBuf... buffers) {
"""
Add the given {@link ByteBuf}s and increase the {@code writerIndex} if {@code increaseWriterIndex} is
{@code true}.
{@link ByteBuf#release()} ownership of all {@link ByteBuf} objects in {@code buffers} is transferred t... | java | public CompositeByteBuf addComponents(boolean increaseWriterIndex, ByteBuf... buffers) {
checkNotNull(buffers, "buffers");
addComponents0(increaseWriterIndex, componentCount, buffers, 0);
consolidateIfNeeded();
return this;
} | [
"public",
"CompositeByteBuf",
"addComponents",
"(",
"boolean",
"increaseWriterIndex",
",",
"ByteBuf",
"...",
"buffers",
")",
"{",
"checkNotNull",
"(",
"buffers",
",",
"\"buffers\"",
")",
";",
"addComponents0",
"(",
"increaseWriterIndex",
",",
"componentCount",
",",
... | Add the given {@link ByteBuf}s and increase the {@code writerIndex} if {@code increaseWriterIndex} is
{@code true}.
{@link ByteBuf#release()} ownership of all {@link ByteBuf} objects in {@code buffers} is transferred to this
{@link CompositeByteBuf}.
@param buffers the {@link ByteBuf}s to add. {@link ByteBuf#release()... | [
"Add",
"the",
"given",
"{",
"@link",
"ByteBuf",
"}",
"s",
"and",
"increase",
"the",
"{",
"@code",
"writerIndex",
"}",
"if",
"{",
"@code",
"increaseWriterIndex",
"}",
"is",
"{",
"@code",
"true",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L234-L239 |
sababado/CircularView | library/src/main/java/com/sababado/circularview/CircularView.java | CircularView.setTextSize | public void setTextSize(int unit, float size) {
"""
Set the default text size to a given unit and value. See {@link
TypedValue} for the possible dimension units.
See R.styleable#CircularView_textSize
@param unit The desired dimension unit.
@param size The desired size in the given units.
"""
Con... | java | public void setTextSize(int unit, float size) {
Context c = getContext();
Resources r;
if (c == null)
r = Resources.getSystem();
else
r = c.getResources();
setRawTextSize(TypedValue.applyDimension(
unit, size, r.getDisplayMetrics()));
... | [
"public",
"void",
"setTextSize",
"(",
"int",
"unit",
",",
"float",
"size",
")",
"{",
"Context",
"c",
"=",
"getContext",
"(",
")",
";",
"Resources",
"r",
";",
"if",
"(",
"c",
"==",
"null",
")",
"r",
"=",
"Resources",
".",
"getSystem",
"(",
")",
";",... | Set the default text size to a given unit and value. See {@link
TypedValue} for the possible dimension units.
See R.styleable#CircularView_textSize
@param unit The desired dimension unit.
@param size The desired size in the given units. | [
"Set",
"the",
"default",
"text",
"size",
"to",
"a",
"given",
"unit",
"and",
"value",
".",
"See",
"{",
"@link",
"TypedValue",
"}",
"for",
"the",
"possible",
"dimension",
"units",
".",
"See",
"R",
".",
"styleable#CircularView_textSize"
] | train | https://github.com/sababado/CircularView/blob/c9ab818d063bcc0796183616f8a82166a9b80aac/library/src/main/java/com/sababado/circularview/CircularView.java#L435-L446 |
jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/DescriptionStrategy.java | DescriptionStrategy.describe | protected String describe(final Every every, final boolean and) {
"""
Provide a human readable description for Every instance.
@param every - Every
@return human readable description - String
"""
String description;
if (every.getPeriod().getValue() > 1) {
description = String.fo... | java | protected String describe(final Every every, final boolean and) {
String description;
if (every.getPeriod().getValue() > 1) {
description = String.format("%s %s ", bundle.getString(EVERY), nominalValue(every.getPeriod())) + " %p ";
} else {
description = bundle.getString(... | [
"protected",
"String",
"describe",
"(",
"final",
"Every",
"every",
",",
"final",
"boolean",
"and",
")",
"{",
"String",
"description",
";",
"if",
"(",
"every",
".",
"getPeriod",
"(",
")",
".",
"getValue",
"(",
")",
">",
"1",
")",
"{",
"description",
"="... | Provide a human readable description for Every instance.
@param every - Every
@return human readable description - String | [
"Provide",
"a",
"human",
"readable",
"description",
"for",
"Every",
"instance",
"."
] | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/DescriptionStrategy.java#L148-L163 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.listCapabilities | public List<CapabilityInner> listCapabilities(String resourceGroupName, String name) {
"""
List all capabilities of an App Service plan.
List all capabilities of an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@... | java | public List<CapabilityInner> listCapabilities(String resourceGroupName, String name) {
return listCapabilitiesWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body();
} | [
"public",
"List",
"<",
"CapabilityInner",
">",
"listCapabilities",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"listCapabilitiesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"toBlocking",
"(",
")",
"."... | List all capabilities of an App Service plan.
List all capabilities of an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException throw... | [
"List",
"all",
"capabilities",
"of",
"an",
"App",
"Service",
"plan",
".",
"List",
"all",
"capabilities",
"of",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1043-L1045 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AlpineQueryManager.java | AlpineQueryManager.createLdapUser | public LdapUser createLdapUser(final String username) {
"""
Creates a new LdapUser object with the specified username.
@param username The username of the new LdapUser. This must reference an existing username in the directory service
@return an LdapUser
@since 1.0.0
"""
pm.currentTransaction().begi... | java | public LdapUser createLdapUser(final String username) {
pm.currentTransaction().begin();
final LdapUser user = new LdapUser();
user.setUsername(username);
user.setDN("Syncing...");
pm.makePersistent(user);
pm.currentTransaction().commit();
EventService.getInstance... | [
"public",
"LdapUser",
"createLdapUser",
"(",
"final",
"String",
"username",
")",
"{",
"pm",
".",
"currentTransaction",
"(",
")",
".",
"begin",
"(",
")",
";",
"final",
"LdapUser",
"user",
"=",
"new",
"LdapUser",
"(",
")",
";",
"user",
".",
"setUsername",
... | Creates a new LdapUser object with the specified username.
@param username The username of the new LdapUser. This must reference an existing username in the directory service
@return an LdapUser
@since 1.0.0 | [
"Creates",
"a",
"new",
"LdapUser",
"object",
"with",
"the",
"specified",
"username",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AlpineQueryManager.java#L157-L166 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java | ExpressRoutePortsInner.beginCreateOrUpdateAsync | public Observable<ExpressRoutePortInner> beginCreateOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) {
"""
Creates or updates the specified ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The n... | java | public Observable<ExpressRoutePortInner> beginCreateOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).map(new Func1<ServiceResponse<ExpressRoutePortInner... | [
"public",
"Observable",
"<",
"ExpressRoutePortInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
",",
"ExpressRoutePortInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
... | Creates or updates the specified ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@param parameters Parameters supplied to the create ExpressRoutePort operation.
@throws IllegalArgumentException thrown if paramete... | [
"Creates",
"or",
"updates",
"the",
"specified",
"ExpressRoutePort",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java#L464-L471 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.addTask | @Override public Task addTask() {
"""
This method allows nested tasks to be added, with the WBS being
completed automatically.
@return new task
"""
ProjectFile parent = getParentFile();
Task task = new Task(parent, this);
m_children.add(task);
parent.getTasks().add(task);
... | java | @Override public Task addTask()
{
ProjectFile parent = getParentFile();
Task task = new Task(parent, this);
m_children.add(task);
parent.getTasks().add(task);
setSummary(true);
return (task);
} | [
"@",
"Override",
"public",
"Task",
"addTask",
"(",
")",
"{",
"ProjectFile",
"parent",
"=",
"getParentFile",
"(",
")",
";",
"Task",
"task",
"=",
"new",
"Task",
"(",
"parent",
",",
"this",
")",
";",
"m_children",
".",
"add",
"(",
"task",
")",
";",
"par... | This method allows nested tasks to be added, with the WBS being
completed automatically.
@return new task | [
"This",
"method",
"allows",
"nested",
"tasks",
"to",
"be",
"added",
"with",
"the",
"WBS",
"being",
"completed",
"automatically",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L212-L225 |
virgo47/javasimon | core/src/main/java/org/javasimon/callback/quantiles/QuantilesCallback.java | QuantilesCallback.onStopwatchSplit | protected void onStopwatchSplit(Stopwatch stopwatch, Split split) {
"""
Called when there is a new split on a Stopwatch, either
{@link #onStopwatchStop} or {@link #onStopwatchAdd}.
If buckets have been initialized, the value is added to appropriate bucket.
"""
Buckets buckets = getOrCreateBuckets(stopwatc... | java | protected void onStopwatchSplit(Stopwatch stopwatch, Split split) {
Buckets buckets = getOrCreateBuckets(stopwatch);
if (buckets != null) {
buckets.addValue(split.runningFor());
buckets.log(split);
}
} | [
"protected",
"void",
"onStopwatchSplit",
"(",
"Stopwatch",
"stopwatch",
",",
"Split",
"split",
")",
"{",
"Buckets",
"buckets",
"=",
"getOrCreateBuckets",
"(",
"stopwatch",
")",
";",
"if",
"(",
"buckets",
"!=",
"null",
")",
"{",
"buckets",
".",
"addValue",
"(... | Called when there is a new split on a Stopwatch, either
{@link #onStopwatchStop} or {@link #onStopwatchAdd}.
If buckets have been initialized, the value is added to appropriate bucket. | [
"Called",
"when",
"there",
"is",
"a",
"new",
"split",
"on",
"a",
"Stopwatch",
"either",
"{"
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/quantiles/QuantilesCallback.java#L145-L151 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/proxy/AbstractProxyFactory.java | AbstractProxyFactory.createCollectionProxy | public ManageableCollection createCollectionProxy(PBKey brokerKey, Query query, Class collectionClass) {
"""
Create a Collection Proxy for a given query.
@param brokerKey The key of the persistence broker
@param query The query
@param collectionClass The class to build the proxy for
@return The collection pr... | java | public ManageableCollection createCollectionProxy(PBKey brokerKey, Query query, Class collectionClass)
{
Object args[] = {brokerKey, collectionClass, query};
try
{
return (ManageableCollection) getCollectionProxyConstructor(collectionClass).newInstance(args);
}
... | [
"public",
"ManageableCollection",
"createCollectionProxy",
"(",
"PBKey",
"brokerKey",
",",
"Query",
"query",
",",
"Class",
"collectionClass",
")",
"{",
"Object",
"args",
"[",
"]",
"=",
"{",
"brokerKey",
",",
"collectionClass",
",",
"query",
"}",
";",
"try",
"{... | Create a Collection Proxy for a given query.
@param brokerKey The key of the persistence broker
@param query The query
@param collectionClass The class to build the proxy for
@return The collection proxy | [
"Create",
"a",
"Collection",
"Proxy",
"for",
"a",
"given",
"query",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/proxy/AbstractProxyFactory.java#L360-L380 |
milaboratory/milib | src/main/java/com/milaboratory/core/alignment/AlignmentTrimmer.java | AlignmentTrimmer.leftTrimAlignment | public static <S extends Sequence<S>> Alignment<S> leftTrimAlignment(Alignment<S> alignment,
LinearGapAlignmentScoring<S> scoring) {
"""
Try increase total alignment score by partially (or fully) trimming it from left side. If score can't be
... | java | public static <S extends Sequence<S>> Alignment<S> leftTrimAlignment(Alignment<S> alignment,
LinearGapAlignmentScoring<S> scoring) {
S seq1 = alignment.getSequence1();
AlignmentIteratorForward<S> iterator = alignment.forwardIterato... | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"S",
">",
">",
"Alignment",
"<",
"S",
">",
"leftTrimAlignment",
"(",
"Alignment",
"<",
"S",
">",
"alignment",
",",
"LinearGapAlignmentScoring",
"<",
"S",
">",
"scoring",
")",
"{",
"S",
"seq1",
"="... | Try increase total alignment score by partially (or fully) trimming it from left side. If score can't be
increased the same alignment will be returned.
LinearGapAlignmentScoring case.
@param alignment input alignment
@param scoring scoring
@return resulting alignment | [
"Try",
"increase",
"total",
"alignment",
"score",
"by",
"partially",
"(",
"or",
"fully",
")",
"trimming",
"it",
"from",
"left",
"side",
".",
"If",
"score",
"can",
"t",
"be",
"increased",
"the",
"same",
"alignment",
"will",
"be",
"returned",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/alignment/AlignmentTrimmer.java#L54-L99 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/responder/responderhtmlpage.java | responderhtmlpage.get | public static responderhtmlpage get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch responderhtmlpage resource of given name .
"""
responderhtmlpage obj = new responderhtmlpage();
obj.set_name(name);
responderhtmlpage response = (responderhtmlpage) obj.get_resource(servic... | java | public static responderhtmlpage get(nitro_service service, String name) throws Exception{
responderhtmlpage obj = new responderhtmlpage();
obj.set_name(name);
responderhtmlpage response = (responderhtmlpage) obj.get_resource(service);
return response;
} | [
"public",
"static",
"responderhtmlpage",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"responderhtmlpage",
"obj",
"=",
"new",
"responderhtmlpage",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch responderhtmlpage resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"responderhtmlpage",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/responder/responderhtmlpage.java#L232-L237 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java | OperationSupport.handleResponse | protected <T> T handleResponse(OkHttpClient client, Request.Builder requestBuilder, Class<T> type, Map<String, String> parameters) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
"""
Send an http request and handle the response, optionally performing placeholder substituti... | java | protected <T> T handleResponse(OkHttpClient client, Request.Builder requestBuilder, Class<T> type, Map<String, String> parameters) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
VersionUsageUtils.log(this.resourceT, this.apiGroupVersion);
Request request = requestBuild... | [
"protected",
"<",
"T",
">",
"T",
"handleResponse",
"(",
"OkHttpClient",
"client",
",",
"Request",
".",
"Builder",
"requestBuilder",
",",
"Class",
"<",
"T",
">",
"type",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"throws",
"ExecutionE... | Send an http request and handle the response, optionally performing placeholder substitution to the response.
@param client OkHttp client provided
@param requestBuilder Request builder
@param type Type of object provided
@param parameters A hashmap containing parameters
@p... | [
"Send",
"an",
"http",
"request",
"and",
"handle",
"the",
"response",
"optionally",
"performing",
"placeholder",
"substitution",
"to",
"the",
"response",
"."
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java#L401-L424 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/HandshakeReader.java | HandshakeReader.validateAccept | private void validateAccept(StatusLine statusLine, Map<String, List<String>> headers, String key) throws WebSocketException {
"""
Validate the value of {@code Sec-WebSocket-Accept} header.
<blockquote>
<p>From RFC 6455, p19.</p>
<p><i>
If the response lacks a {@code Sec-WebSocket-Accept} header field or the
... | java | private void validateAccept(StatusLine statusLine, Map<String, List<String>> headers, String key) throws WebSocketException
{
// Get the values of Sec-WebSocket-Accept.
List<String> values = headers.get("Sec-WebSocket-Accept");
if (values == null)
{
// The opening handsh... | [
"private",
"void",
"validateAccept",
"(",
"StatusLine",
"statusLine",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
",",
"String",
"key",
")",
"throws",
"WebSocketException",
"{",
"// Get the values of Sec-WebSocket-Accept.",
"List",
... | Validate the value of {@code Sec-WebSocket-Accept} header.
<blockquote>
<p>From RFC 6455, p19.</p>
<p><i>
If the response lacks a {@code Sec-WebSocket-Accept} header field or the
{@code Sec-WebSocket-Accept} contains a value other than the base64-encoded
SHA-1 of the concatenation of the {@code Sec-WebSocket-Key} (as ... | [
"Validate",
"the",
"value",
"of",
"{",
"@code",
"Sec",
"-",
"WebSocket",
"-",
"Accept",
"}",
"header",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/HandshakeReader.java#L401-L451 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/WSEJBProxy.java | WSEJBProxy.addEJBMethod | private static void addEJBMethod(ClassWriter cw,
String className,
String implClassName,
Method method) {
"""
Adds a standard EJB Proxy Method. <p>
The method added just calls the EJB instance method d... | java | private static void addEJBMethod(ClassWriter cw,
String className,
String implClassName,
Method method)
{
GeneratorAdapter mg;
String methodName = method.getName();
if (TraceCompon... | [
"private",
"static",
"void",
"addEJBMethod",
"(",
"ClassWriter",
"cw",
",",
"String",
"className",
",",
"String",
"implClassName",
",",
"Method",
"method",
")",
"{",
"GeneratorAdapter",
"mg",
";",
"String",
"methodName",
"=",
"method",
".",
"getName",
"(",
")"... | Adds a standard EJB Proxy Method. <p>
The method added just calls the EJB instance method directly. <p>
@param cw ASM Class writer to add the method to.
@param className name of the proxy class being generated.
@param implClassName name of the EJB implementation class.
@param method reflection method from the interfa... | [
"Adds",
"a",
"standard",
"EJB",
"Proxy",
"Method",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/WSEJBProxy.java#L256-L320 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findResult | @Deprecated
public static <S, T, U extends T, V extends T> T findResult(Collection<S> self, U defaultResult, @ClosureParams(FirstParam.FirstGenericType.class) Closure<V> condition) {
"""
Iterates through the collection calling the given closure for each item but stopping once the first non-null
result is foun... | java | @Deprecated
public static <S, T, U extends T, V extends T> T findResult(Collection<S> self, U defaultResult, @ClosureParams(FirstParam.FirstGenericType.class) Closure<V> condition) {
return findResult((Iterable<S>) self, defaultResult, condition);
} | [
"@",
"Deprecated",
"public",
"static",
"<",
"S",
",",
"T",
",",
"U",
"extends",
"T",
",",
"V",
"extends",
"T",
">",
"T",
"findResult",
"(",
"Collection",
"<",
"S",
">",
"self",
",",
"U",
"defaultResult",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
... | Iterates through the collection calling the given closure for each item but stopping once the first non-null
result is found and returning that result. If all are null, the defaultResult is returned.
@param self a Collection
@param defaultResult an Object that should be returned if all closure results are nul... | [
"Iterates",
"through",
"the",
"collection",
"calling",
"the",
"given",
"closure",
"for",
"each",
"item",
"but",
"stopping",
"once",
"the",
"first",
"non",
"-",
"null",
"result",
"is",
"found",
"and",
"returning",
"that",
"result",
".",
"If",
"all",
"are",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4452-L4455 |
samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.fill | public static String fill (char c, int count) {
"""
Returns a string containing the specified character repeated the specified number of times.
"""
char[] sameChars = new char[count];
Arrays.fill(sameChars, c);
return new String(sameChars);
} | java | public static String fill (char c, int count)
{
char[] sameChars = new char[count];
Arrays.fill(sameChars, c);
return new String(sameChars);
} | [
"public",
"static",
"String",
"fill",
"(",
"char",
"c",
",",
"int",
"count",
")",
"{",
"char",
"[",
"]",
"sameChars",
"=",
"new",
"char",
"[",
"count",
"]",
";",
"Arrays",
".",
"fill",
"(",
"sameChars",
",",
"c",
")",
";",
"return",
"new",
"String"... | Returns a string containing the specified character repeated the specified number of times. | [
"Returns",
"a",
"string",
"containing",
"the",
"specified",
"character",
"repeated",
"the",
"specified",
"number",
"of",
"times",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L303-L308 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/CodepointMatcher.java | CodepointMatcher.replaceAll | public final String replaceAll(String s, char replacementCharacter) {
"""
Returns a copy of the input string with all Unicode codepoints matching this matcher replaced
with {@code replacementCharacter}.
"""
final StringBuilder sb = new StringBuilder();
for (int offset = 0; offset < s.length(); ) {
... | java | public final String replaceAll(String s, char replacementCharacter) {
final StringBuilder sb = new StringBuilder();
for (int offset = 0; offset < s.length(); ) {
final int codePoint = s.codePointAt(offset);
if (matches(codePoint)) {
sb.append(replacementCharacter);
} else {
sb... | [
"public",
"final",
"String",
"replaceAll",
"(",
"String",
"s",
",",
"char",
"replacementCharacter",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"offset",
"=",
"0",
";",
"offset",
"<",
"s",
".",... | Returns a copy of the input string with all Unicode codepoints matching this matcher replaced
with {@code replacementCharacter}. | [
"Returns",
"a",
"copy",
"of",
"the",
"input",
"string",
"with",
"all",
"Unicode",
"codepoints",
"matching",
"this",
"matcher",
"replaced",
"with",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/CodepointMatcher.java#L325-L339 |
aol/cyclops | cyclops-pure/src/main/java/cyclops/hkt/Active.java | Active.concreteFlatMap | public <C,R> NarrowedFlatMap<C,R> concreteFlatMap(Kleisli<W,C,R> widen) {
"""
Use concreteFlatMap to access a flatMap operator that works with the concrete type (rather than the higher kind encoding)
e.g. using a vavr Vector
<pre>
{@code
Active<vector,Integer> vector = Vectors.allTypeclasses(Vector.of(1,2,... | java | public <C,R> NarrowedFlatMap<C,R> concreteFlatMap(Kleisli<W,C,R> widen){
return new NarrowedFlatMap<>(widen);
} | [
"public",
"<",
"C",
",",
"R",
">",
"NarrowedFlatMap",
"<",
"C",
",",
"R",
">",
"concreteFlatMap",
"(",
"Kleisli",
"<",
"W",
",",
"C",
",",
"R",
">",
"widen",
")",
"{",
"return",
"new",
"NarrowedFlatMap",
"<>",
"(",
"widen",
")",
";",
"}"
] | Use concreteFlatMap to access a flatMap operator that works with the concrete type (rather than the higher kind encoding)
e.g. using a vavr Vector
<pre>
{@code
Active<vector,Integer> vector = Vectors.allTypeclasses(Vector.of(1,2,3));
vector.concreteFlatMap(Vectors.kindKleisli())
.flatMap(i->Vector.of(1,2,3)); //flat... | [
"Use",
"concreteFlatMap",
"to",
"access",
"a",
"flatMap",
"operator",
"that",
"works",
"with",
"the",
"concrete",
"type",
"(",
"rather",
"than",
"the",
"higher",
"kind",
"encoding",
")"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-pure/src/main/java/cyclops/hkt/Active.java#L228-L230 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/FragmentActivator.java | FragmentActivator.saveLayout | private void saveLayout(UserView view, IPerson owner) throws Exception {
"""
Saves the loaded layout in the database for the user and profile.
@param view
@param owner
@throws Exception
"""
IUserProfile profile = new UserProfile();
profile.setProfileId(view.getProfileId());
userLay... | java | private void saveLayout(UserView view, IPerson owner) throws Exception {
IUserProfile profile = new UserProfile();
profile.setProfileId(view.getProfileId());
userLayoutStore.setUserLayout(owner, profile, view.getLayout(), true, false);
} | [
"private",
"void",
"saveLayout",
"(",
"UserView",
"view",
",",
"IPerson",
"owner",
")",
"throws",
"Exception",
"{",
"IUserProfile",
"profile",
"=",
"new",
"UserProfile",
"(",
")",
";",
"profile",
".",
"setProfileId",
"(",
"view",
".",
"getProfileId",
"(",
")... | Saves the loaded layout in the database for the user and profile.
@param view
@param owner
@throws Exception | [
"Saves",
"the",
"loaded",
"layout",
"in",
"the",
"database",
"for",
"the",
"user",
"and",
"profile",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/FragmentActivator.java#L255-L259 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/ReadWriteManager.java | ReadWriteManager.print | static void print(KAFDocument kaf) {
"""
Writes the content of a KAFDocument object to standard output.
"""
try {
Writer out = new BufferedWriter(new OutputStreamWriter(System.out, "UTF8"));
out.write(kafToStr(kaf));
out.flush();
} catch (Exception e) {
System.out.println(e);
}
} | java | static void print(KAFDocument kaf) {
try {
Writer out = new BufferedWriter(new OutputStreamWriter(System.out, "UTF8"));
out.write(kafToStr(kaf));
out.flush();
} catch (Exception e) {
System.out.println(e);
}
} | [
"static",
"void",
"print",
"(",
"KAFDocument",
"kaf",
")",
"{",
"try",
"{",
"Writer",
"out",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"System",
".",
"out",
",",
"\"UTF8\"",
")",
")",
";",
"out",
".",
"write",
"(",
"kafToStr",
... | Writes the content of a KAFDocument object to standard output. | [
"Writes",
"the",
"content",
"of",
"a",
"KAFDocument",
"object",
"to",
"standard",
"output",
"."
] | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/ReadWriteManager.java#L73-L81 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.setLocation | public final void setLocation(final double LAT, final double LON) {
"""
Sets the location of the poi by the given latitude
and longitude values
@param LAT
@param LON
"""
this.lon = LON; // X
this.lat = LAT; // Y
this.LOCATION.setLocation(LON, LAT);
this.LOCATION_XY.setLocatio... | java | public final void setLocation(final double LAT, final double LON) {
this.lon = LON; // X
this.lat = LAT; // Y
this.LOCATION.setLocation(LON, LAT);
this.LOCATION_XY.setLocation(toXY(LAT, LON));
adjustDirection();
} | [
"public",
"final",
"void",
"setLocation",
"(",
"final",
"double",
"LAT",
",",
"final",
"double",
"LON",
")",
"{",
"this",
".",
"lon",
"=",
"LON",
";",
"// X",
"this",
".",
"lat",
"=",
"LAT",
";",
"// Y",
"this",
".",
"LOCATION",
".",
"setLocation",
"... | Sets the location of the poi by the given latitude
and longitude values
@param LAT
@param LON | [
"Sets",
"the",
"location",
"of",
"the",
"poi",
"by",
"the",
"given",
"latitude",
"and",
"longitude",
"values"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L335-L341 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/management/FedoraAPIMImpl.java | FedoraAPIMImpl.purgeObject | @Override
public String purgeObject(String pid, String logMessage, boolean force) {
"""
/*
(non-Javadoc)
@see org.fcrepo.server.management.FedoraAPIMMTOM#purgeObject(String pid
,)String logMessage ,)boolean force )*
"""
LOG.debug("start: purgeObject, {}", pid);
assertInitialized();
... | java | @Override
public String purgeObject(String pid, String logMessage, boolean force) {
LOG.debug("start: purgeObject, {}", pid);
assertInitialized();
try {
MessageContext ctx = context.getMessageContext();
return DateUtility.convertDateToString(m_management
... | [
"@",
"Override",
"public",
"String",
"purgeObject",
"(",
"String",
"pid",
",",
"String",
"logMessage",
",",
"boolean",
"force",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"start: purgeObject, {}\"",
",",
"pid",
")",
";",
"assertInitialized",
"(",
")",
";",
"try",... | /*
(non-Javadoc)
@see org.fcrepo.server.management.FedoraAPIMMTOM#purgeObject(String pid
,)String logMessage ,)boolean force )* | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/management/FedoraAPIMImpl.java#L182-L198 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuRenderer.java | WMenuRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WMenu.
@param component the WMenu to paint.
@param renderContext the RenderContext to paint to.
"""
WMenu menu = (WMenu) component;
XmlStringBuilder xml = renderContext.getWriter(... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WMenu menu = (WMenu) component;
XmlStringBuilder xml = renderContext.getWriter();
int rows = menu.getRows();
xml.appendTagOpen("ui:menu");
xml.appendAttribute("id", component.getId());
xml.appendOptionalA... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WMenu",
"menu",
"=",
"(",
"WMenu",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
".... | Paints the given WMenu.
@param component the WMenu to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WMenu",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WMenuRenderer.java#L22-L82 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/media/MediaClient.java | MediaClient.listWaterMark | public ListWaterMarkResponse listWaterMark(ListWaterMarkRequest request) {
"""
List all water mark.
@return The list of all user's water mark.
"""
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, WATER_MARK);
return invokeHttpClient(internalRequest, ListW... | java | public ListWaterMarkResponse listWaterMark(ListWaterMarkRequest request) {
InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, WATER_MARK);
return invokeHttpClient(internalRequest, ListWaterMarkResponse.class);
} | [
"public",
"ListWaterMarkResponse",
"listWaterMark",
"(",
"ListWaterMarkRequest",
"request",
")",
"{",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"HttpMethodName",
".",
"GET",
",",
"request",
",",
"WATER_MARK",
")",
";",
"return",
"invokeHttpClient"... | List all water mark.
@return The list of all user's water mark. | [
"List",
"all",
"water",
"mark",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L1151-L1155 |
biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java | FeatureList.selectByAttribute | public FeatureList selectByAttribute(String key, String value) {
"""
Create a list of all features that include the specified attribute key/value pair.
This method now properly supports adding the index before or after adding the features.
Adding features, then then index, then more features is still not support... | java | public FeatureList selectByAttribute(String key, String value) {
if (featindex.containsKey(key)){
Map<String,List<FeatureI>> featuresmap = featindex.get(key);
if (featuresmap==null) return new FeatureList();
List<FeatureI> list = featuresmap.get(value);
if (list == null){
return new FeatureList();
... | [
"public",
"FeatureList",
"selectByAttribute",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"featindex",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"FeatureI",
">",
">",
"featuresmap",
"=",... | Create a list of all features that include the specified attribute key/value pair.
This method now properly supports adding the index before or after adding the features.
Adding features, then then index, then more features is still not supported.
@param key The key to consider.
@param value The value to consider.
@re... | [
"Create",
"a",
"list",
"of",
"all",
"features",
"that",
"include",
"the",
"specified",
"attribute",
"key",
"/",
"value",
"pair",
".",
"This",
"method",
"now",
"properly",
"supports",
"adding",
"the",
"index",
"before",
"or",
"after",
"adding",
"the",
"featur... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/FeatureList.java#L268-L285 |
bmwcarit/joynr | java/messaging/bounceproxy/bounceproxy-controller/src/main/java/io/joynr/messaging/bounceproxy/controller/util/ChannelUrlUtil.java | ChannelUrlUtil.createChannelLocation | public static URI createChannelLocation(ControlledBounceProxyInformation bpInfo, String ccid, URI location) {
"""
Creates the channel location that is returned to the cluster controller.
This includes tweaking of the URL for example to contain a session ID.
@param bpInfo
information of the bounce proxy
@para... | java | public static URI createChannelLocation(ControlledBounceProxyInformation bpInfo, String ccid, URI location) {
return URI.create(location.toString() + ";jsessionid=." + bpInfo.getInstanceId());
} | [
"public",
"static",
"URI",
"createChannelLocation",
"(",
"ControlledBounceProxyInformation",
"bpInfo",
",",
"String",
"ccid",
",",
"URI",
"location",
")",
"{",
"return",
"URI",
".",
"create",
"(",
"location",
".",
"toString",
"(",
")",
"+",
"\";jsessionid=.\"",
... | Creates the channel location that is returned to the cluster controller.
This includes tweaking of the URL for example to contain a session ID.
@param bpInfo
information of the bounce proxy
@param ccid
channel identifier
@param location
the channel URL as returned by the bounce proxy instance that
created the channel
... | [
"Creates",
"the",
"channel",
"location",
"that",
"is",
"returned",
"to",
"the",
"cluster",
"controller",
".",
"This",
"includes",
"tweaking",
"of",
"the",
"URL",
"for",
"example",
"to",
"contain",
"a",
"session",
"ID",
"."
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/bounceproxy/bounceproxy-controller/src/main/java/io/joynr/messaging/bounceproxy/controller/util/ChannelUrlUtil.java#L48-L51 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatCommonOutput.java | DssatCommonOutput.formatNumStr | protected String formatNumStr(int bits, HashMap m, Object key, String defVal) {
"""
Format the number with maximum length and type
@param bits Maximum length of the output string
@param m the experiment data holder
@param key the key of field in the map
@param defVal the default return value when error happe... | java | protected String formatNumStr(int bits, HashMap m, Object key, String defVal) {
String ret = "";
String str = getObjectOr(m, key, defVal);
String[] inputStr = str.split("\\.");
if (str.trim().equals("")) {
return String.format("%" + bits + "s", defVal);
} else if (st... | [
"protected",
"String",
"formatNumStr",
"(",
"int",
"bits",
",",
"HashMap",
"m",
",",
"Object",
"key",
",",
"String",
"defVal",
")",
"{",
"String",
"ret",
"=",
"\"\"",
";",
"String",
"str",
"=",
"getObjectOr",
"(",
"m",
",",
"key",
",",
"defVal",
")",
... | Format the number with maximum length and type
@param bits Maximum length of the output string
@param m the experiment data holder
@param key the key of field in the map
@param defVal the default return value when error happens
@return formated string of number | [
"Format",
"the",
"number",
"with",
"maximum",
"length",
"and",
"type"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatCommonOutput.java#L75-L95 |
dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/util/Ascii.java | Ascii.indexOfIgnoreCase | public static int indexOfIgnoreCase(
CharSequence sequence, CharSequence subSequence, int fromIndex) {
"""
Returns the index within the {@code sequence} of the first occurrence of {@code subSequence},
starting at {@code fromIndex}, ignoring the case of any ASCII alphabetic characters
between {@code 'a'} an... | java | public static int indexOfIgnoreCase(
CharSequence sequence, CharSequence subSequence, int fromIndex) {
return indexOfIgnoreCase(sequence, 0, sequence.length(),
subSequence, 0, subSequence.length(), fromIndex);
} | [
"public",
"static",
"int",
"indexOfIgnoreCase",
"(",
"CharSequence",
"sequence",
",",
"CharSequence",
"subSequence",
",",
"int",
"fromIndex",
")",
"{",
"return",
"indexOfIgnoreCase",
"(",
"sequence",
",",
"0",
",",
"sequence",
".",
"length",
"(",
")",
",",
"su... | Returns the index within the {@code sequence} of the first occurrence of {@code subSequence},
starting at {@code fromIndex}, ignoring the case of any ASCII alphabetic characters
between {@code 'a'} and {@code 'z'} or {@code 'A'} and {@code 'Z'} inclusive.
@param sequence the sequence to be searched in.
@param subSe... | [
"Returns",
"the",
"index",
"within",
"the",
"{",
"@code",
"sequence",
"}",
"of",
"the",
"first",
"occurrence",
"of",
"{",
"@code",
"subSequence",
"}",
"starting",
"at",
"{",
"@code",
"fromIndex",
"}",
"ignoring",
"the",
"case",
"of",
"any",
"ASCII",
"alpha... | train | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/util/Ascii.java#L106-L110 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobInProgress.java | JobInProgress.getCounters | public Counters getCounters() {
"""
Returns the total job counters, by adding together the job,
the map and the reduce counters.
"""
Counters result = new Counters();
synchronized (this) {
result.incrAllCounters(getJobCounters());
}
incrementTaskCounters(result, maps);
return increm... | java | public Counters getCounters() {
Counters result = new Counters();
synchronized (this) {
result.incrAllCounters(getJobCounters());
}
incrementTaskCounters(result, maps);
return incrementTaskCounters(result, reduces);
} | [
"public",
"Counters",
"getCounters",
"(",
")",
"{",
"Counters",
"result",
"=",
"new",
"Counters",
"(",
")",
";",
"synchronized",
"(",
"this",
")",
"{",
"result",
".",
"incrAllCounters",
"(",
"getJobCounters",
"(",
")",
")",
";",
"}",
"incrementTaskCounters",... | Returns the total job counters, by adding together the job,
the map and the reduce counters. | [
"Returns",
"the",
"total",
"job",
"counters",
"by",
"adding",
"together",
"the",
"job",
"the",
"map",
"and",
"the",
"reduce",
"counters",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobInProgress.java#L1360-L1368 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java | JdbcCpoXaAdapter.retrieveBean | @Override
public <T> T retrieveBean(String name, T bean, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
funct... | java | @Override
public <T> T retrieveBean(String name, T bean, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
return getCurrentResource().retrieveBean(name, bean, wheres, orderBy, nativeExpressions);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"retrieveBean",
"(",
"String",
"name",
",",
"T",
"bean",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Collection",
"<",
"CpoNativeFunction",
">... | Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource. If the retrieve
function defined for this beans returns more than one row, an exception will be thrown.
@param name DOCUMENT ME!
@param bean This is an bean that has been defined within the metad... | [
"Retrieves",
"the",
"bean",
"from",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"bean",
"exists",
"in",
"the",
"datasource",
".",
"If",
"the",
"retrieve",
"function",
"defined",
"for",
"this",
"beans",
"returns",
"more",
"than",
"one"... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L1311-L1314 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java | Agg.maxAll | public static <T> Collector<T, ?, Seq<T>> maxAll(Comparator<? super T> comparator) {
"""
Get a {@link Collector} that calculates the <code>MAX()</code> function, producing multiple results.
"""
return maxAllBy(t -> t, comparator);
} | java | public static <T> Collector<T, ?, Seq<T>> maxAll(Comparator<? super T> comparator) {
return maxAllBy(t -> t, comparator);
} | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Seq",
"<",
"T",
">",
">",
"maxAll",
"(",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comparator",
")",
"{",
"return",
"maxAllBy",
"(",
"t",
"->",
"t",
",",
"comparator",
")... | Get a {@link Collector} that calculates the <code>MAX()</code> function, producing multiple results. | [
"Get",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L336-L338 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/APITrace.java | APITrace.logCall | public static void logCall(long entryTime,
long returnTime,
int callIndex,
Object returnValue,
Object argValues[],
long streamId) {
"""
Record a method call and its retur... | java | public static void logCall(long entryTime,
long returnTime,
int callIndex,
Object returnValue,
Object argValues[],
long streamId) {
if (!API_TRACE_LOG.isInfoEnabled()) {
... | [
"public",
"static",
"void",
"logCall",
"(",
"long",
"entryTime",
",",
"long",
"returnTime",
",",
"int",
"callIndex",
",",
"Object",
"returnValue",
",",
"Object",
"argValues",
"[",
"]",
",",
"long",
"streamId",
")",
"{",
"if",
"(",
"!",
"API_TRACE_LOG",
"."... | Record a method call and its return value in the log.
@param entry the System.nanoTime timestamp for method entry
@param callIndex index into callTable
@param returnValue value returned by traced method
@param argValues arguments passed to traced method
@param streamId unique identifier for stream, or -1 if not applic... | [
"Record",
"a",
"method",
"call",
"and",
"its",
"return",
"value",
"in",
"the",
"log",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/APITrace.java#L114-L149 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/WriteExcelUtils.java | WriteExcelUtils.writeWorkBook | public static <T> Workbook writeWorkBook(Workbook workbook, List<T> beans, String dateFormat) {
"""
将Beans写入WorkBook中,默认以bean中的所有属性作为标题且写入第0行,0-based
@param workbook 指定工作簿
@param beans 指定写入的Beans(或者泛型为Map)
@param dateFormat 日期格式
@return 返回传入的WorkBook
"""
if (beans == null || beans.isEmpty(... | java | public static <T> Workbook writeWorkBook(Workbook workbook, List<T> beans, String dateFormat) {
if (beans == null || beans.isEmpty()) {
return workbook;
}
Map<String, Object> map = null;
if (beans.get(0) instanceof Map) {
map = (Map<String, Object>) beans.get(0);
... | [
"public",
"static",
"<",
"T",
">",
"Workbook",
"writeWorkBook",
"(",
"Workbook",
"workbook",
",",
"List",
"<",
"T",
">",
"beans",
",",
"String",
"dateFormat",
")",
"{",
"if",
"(",
"beans",
"==",
"null",
"||",
"beans",
".",
"isEmpty",
"(",
")",
")",
"... | 将Beans写入WorkBook中,默认以bean中的所有属性作为标题且写入第0行,0-based
@param workbook 指定工作簿
@param beans 指定写入的Beans(或者泛型为Map)
@param dateFormat 日期格式
@return 返回传入的WorkBook | [
"将Beans写入WorkBook中",
"默认以bean中的所有属性作为标题且写入第0行,0",
"-",
"based"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/WriteExcelUtils.java#L328-L344 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java | CommonOps_DSCC.permuteInv | public static void permuteInv( int[] perm , double []input , double[]output , int N ) {
"""
Permutes a vector in the inverse. output[perm[k]] = input[k]
@param perm (Input) permutation vector
@param input (Input) Vector which is to be permuted
@param output (Output) Where the permuted vector is stored.
@par... | java | public static void permuteInv( int[] perm , double []input , double[]output , int N ) {
for (int k = 0; k < N; k++) {
output[perm[k]] = input[k];
}
} | [
"public",
"static",
"void",
"permuteInv",
"(",
"int",
"[",
"]",
"perm",
",",
"double",
"[",
"]",
"input",
",",
"double",
"[",
"]",
"output",
",",
"int",
"N",
")",
"{",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<",
"N",
";",
"k",
"++",
")",... | Permutes a vector in the inverse. output[perm[k]] = input[k]
@param perm (Input) permutation vector
@param input (Input) Vector which is to be permuted
@param output (Output) Where the permuted vector is stored.
@param N Number of elements in the vector. | [
"Permutes",
"a",
"vector",
"in",
"the",
"inverse",
".",
"output",
"[",
"perm",
"[",
"k",
"]]",
"=",
"input",
"[",
"k",
"]"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L967-L971 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java | ServiceLookup.getService | public static <T> T getService( BundleContext bc, String className ) {
"""
Returns a service matching the given criteria.
@param <T> class implemented or extended by the service
@param bc bundle context for accessing the OSGi registry
@param className name of class implemented or extended by the service
@ret... | java | public static <T> T getService( BundleContext bc, String className )
{
return ServiceLookup.<T> getService( bc, className, DEFAULT_TIMEOUT, "" );
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getService",
"(",
"BundleContext",
"bc",
",",
"String",
"className",
")",
"{",
"return",
"ServiceLookup",
".",
"<",
"T",
">",
"getService",
"(",
"bc",
",",
"className",
",",
"DEFAULT_TIMEOUT",
",",
"\"\"",
")",
";... | Returns a service matching the given criteria.
@param <T> class implemented or extended by the service
@param bc bundle context for accessing the OSGi registry
@param className name of class implemented or extended by the service
@return matching service (not null)
@throws ServiceLookupException when no matching servi... | [
"Returns",
"a",
"service",
"matching",
"the",
"given",
"criteria",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java#L56-L59 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET | public ArrayList<String> billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET(String billingAccount, String serviceName, Long keyNum) throws IOException {
"""
List the available functions for the key
REST: GET /telephony/{billingAccount}/line/{serviceName}/phone/functionKey/{keyNum}/av... | java | public ArrayList<String> billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET(String billingAccount, String serviceName, Long keyNum) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/phone/functionKey/{keyNum}/availableFunction";
StringBuilder sb = path(q... | [
"public",
"ArrayList",
"<",
"String",
">",
"billingAccount_line_serviceName_phone_functionKey_keyNum_availableFunction_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"keyNum",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\... | List the available functions for the key
REST: GET /telephony/{billingAccount}/line/{serviceName}/phone/functionKey/{keyNum}/availableFunction
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param keyNum [required] The number of the function key | [
"List",
"the",
"available",
"functions",
"for",
"the",
"key"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1133-L1138 |
OpenTSDB/opentsdb | src/core/ColumnDatapointIterator.java | ColumnDatapointIterator.writeToBuffers | public void writeToBuffers(ByteBufferList compQualifier, ByteBufferList compValue) {
"""
Copy this value to the output and advance to the next one.
@param compQualifier
@param compValue
@return true if there is more data left in this column
"""
compQualifier.add(qualifier, qualifier_offset, current_qu... | java | public void writeToBuffers(ByteBufferList compQualifier, ByteBufferList compValue) {
compQualifier.add(qualifier, qualifier_offset, current_qual_length);
compValue.add(value, value_offset, current_val_length);
} | [
"public",
"void",
"writeToBuffers",
"(",
"ByteBufferList",
"compQualifier",
",",
"ByteBufferList",
"compValue",
")",
"{",
"compQualifier",
".",
"add",
"(",
"qualifier",
",",
"qualifier_offset",
",",
"current_qual_length",
")",
";",
"compValue",
".",
"add",
"(",
"v... | Copy this value to the output and advance to the next one.
@param compQualifier
@param compValue
@return true if there is more data left in this column | [
"Copy",
"this",
"value",
"to",
"the",
"output",
"and",
"advance",
"to",
"the",
"next",
"one",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/ColumnDatapointIterator.java#L118-L121 |
quattor/pan | panc/src/main/java/org/quattor/pan/type/RecordType.java | RecordType.removeDefinedFields | private void removeDefinedFields(Context context, List<Term> undefinedFields)
throws ValidationException {
"""
This method will loop through all of the fields defined in this record
and remove them from the given list. This is used in the validation of
the fields.
@param context
ObjectContext to use to lo... | java | private void removeDefinedFields(Context context, List<Term> undefinedFields)
throws ValidationException {
// Loop through all of the required and optional fields removing each
// from the list of undefined fields.
for (Term term : reqKeys) {
undefinedFields.remove(term);
}
for (Term term : optKeys) {
... | [
"private",
"void",
"removeDefinedFields",
"(",
"Context",
"context",
",",
"List",
"<",
"Term",
">",
"undefinedFields",
")",
"throws",
"ValidationException",
"{",
"// Loop through all of the required and optional fields removing each",
"// from the list of undefined fields.",
"for... | This method will loop through all of the fields defined in this record
and remove them from the given list. This is used in the validation of
the fields.
@param context
ObjectContext to use to look up included type definitions
@param undefinedFields
List containing the field names to check; defined fields are
removed ... | [
"This",
"method",
"will",
"loop",
"through",
"all",
"of",
"the",
"fields",
"defined",
"in",
"this",
"record",
"and",
"remove",
"them",
"from",
"the",
"given",
"list",
".",
"This",
"is",
"used",
"in",
"the",
"validation",
"of",
"the",
"fields",
"."
] | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/type/RecordType.java#L317-L352 |
aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.registerJsonValueProcessor | public void registerJsonValueProcessor( Class propertyType, JsonValueProcessor jsonValueProcessor ) {
"""
Registers a JsonValueProcessor.<br>
[Java -> JSON]
@param propertyType the property type to use as key
@param jsonValueProcessor the processor to register
"""
if( propertyType != null && json... | java | public void registerJsonValueProcessor( Class propertyType, JsonValueProcessor jsonValueProcessor ) {
if( propertyType != null && jsonValueProcessor != null ) {
typeMap.put( propertyType, jsonValueProcessor );
}
} | [
"public",
"void",
"registerJsonValueProcessor",
"(",
"Class",
"propertyType",
",",
"JsonValueProcessor",
"jsonValueProcessor",
")",
"{",
"if",
"(",
"propertyType",
"!=",
"null",
"&&",
"jsonValueProcessor",
"!=",
"null",
")",
"{",
"typeMap",
".",
"put",
"(",
"prope... | Registers a JsonValueProcessor.<br>
[Java -> JSON]
@param propertyType the property type to use as key
@param jsonValueProcessor the processor to register | [
"Registers",
"a",
"JsonValueProcessor",
".",
"<br",
">",
"[",
"Java",
"-",
">",
";",
"JSON",
"]"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L826-L830 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_rules_optin_GET | public ArrayList<OvhOptin> serviceName_rules_optin_GET(String serviceName) throws IOException {
"""
Retrieve optin rule
REST: GET /domain/{serviceName}/rules/optin
@param serviceName [required] The internal name of your domain
"""
String qPath = "/domain/{serviceName}/rules/optin";
StringBuilder sb = p... | java | public ArrayList<OvhOptin> serviceName_rules_optin_GET(String serviceName) throws IOException {
String qPath = "/domain/{serviceName}/rules/optin";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t5);
} | [
"public",
"ArrayList",
"<",
"OvhOptin",
">",
"serviceName_rules_optin_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/rules/optin\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
... | Retrieve optin rule
REST: GET /domain/{serviceName}/rules/optin
@param serviceName [required] The internal name of your domain | [
"Retrieve",
"optin",
"rule"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1376-L1381 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/mains/FixedDurationTemporalRandomIndexingMain.java | FixedDurationTemporalRandomIndexingMain.printWordNeighbors | private void printWordNeighbors(String dateString,
SemanticSpace semanticPartition)
throws IOException {
"""
Using the {@link wordToTemporalSemantics} set and input parameters,
calculates the shift in each word's semantic vector per recorded time
period and also p... | java | private void printWordNeighbors(String dateString,
SemanticSpace semanticPartition)
throws IOException {
LOGGER.info("printing the most similar words for the semantic partition" +
" starting at: " + dateString);
NearestNeighb... | [
"private",
"void",
"printWordNeighbors",
"(",
"String",
"dateString",
",",
"SemanticSpace",
"semanticPartition",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"info",
"(",
"\"printing the most similar words for the semantic partition\"",
"+",
"\" starting at: \"",
"+",
... | Using the {@link wordToTemporalSemantics} set and input parameters,
calculates the shift in each word's semantic vector per recorded time
period and also prints out the nearest neighbors to each word for each
time period.
@param dateString the string that encodes the date of the semantic partition.
This will be used a... | [
"Using",
"the",
"{",
"@link",
"wordToTemporalSemantics",
"}",
"set",
"and",
"input",
"parameters",
"calculates",
"the",
"shift",
"in",
"each",
"word",
"s",
"semantic",
"vector",
"per",
"recorded",
"time",
"period",
"and",
"also",
"prints",
"out",
"the",
"neare... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/mains/FixedDurationTemporalRandomIndexingMain.java#L668-L708 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FileProxyRNASequenceCreator.java | FileProxyRNASequenceCreator.getSequence | @Override
public AbstractSequence<NucleotideCompound> getSequence(String sequence, long index ) throws CompoundNotFoundException, IOException {
"""
Even though we are passing in the sequence we really only care about the length of the sequence and the offset
index in the fasta file.
@param sequence
@param inde... | java | @Override
public AbstractSequence<NucleotideCompound> getSequence(String sequence, long index ) throws CompoundNotFoundException, IOException {
SequenceFileProxyLoader<NucleotideCompound> sequenceFileProxyLoader = new SequenceFileProxyLoader<NucleotideCompound>(
file,
sequenceParser,
index,
sequence.... | [
"@",
"Override",
"public",
"AbstractSequence",
"<",
"NucleotideCompound",
">",
"getSequence",
"(",
"String",
"sequence",
",",
"long",
"index",
")",
"throws",
"CompoundNotFoundException",
",",
"IOException",
"{",
"SequenceFileProxyLoader",
"<",
"NucleotideCompound",
">",... | Even though we are passing in the sequence we really only care about the length of the sequence and the offset
index in the fasta file.
@param sequence
@param index
@return
@throws CompoundNotFoundException
@throws IOException | [
"Even",
"though",
"we",
"are",
"passing",
"in",
"the",
"sequence",
"we",
"really",
"only",
"care",
"about",
"the",
"length",
"of",
"the",
"sequence",
"and",
"the",
"offset",
"index",
"in",
"the",
"fasta",
"file",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/FileProxyRNASequenceCreator.java#L79-L88 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/metadata/FunctionManager.java | FunctionManager.resolveFunction | public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes) {
"""
Resolves a function using the SQL path, and implicit type coercions.
@throws PrestoException if there are no matches or multiple matches
"""
// TODO Actually use session
... | java | public FunctionHandle resolveFunction(Session session, QualifiedName name, List<TypeSignatureProvider> parameterTypes)
{
// TODO Actually use session
// Session will be used to provide information about the order of function namespaces to through resolving the function.
// This is likely to ... | [
"public",
"FunctionHandle",
"resolveFunction",
"(",
"Session",
"session",
",",
"QualifiedName",
"name",
",",
"List",
"<",
"TypeSignatureProvider",
">",
"parameterTypes",
")",
"{",
"// TODO Actually use session",
"// Session will be used to provide information about the order of f... | Resolves a function using the SQL path, and implicit type coercions.
@throws PrestoException if there are no matches or multiple matches | [
"Resolves",
"a",
"function",
"using",
"the",
"SQL",
"path",
"and",
"implicit",
"type",
"coercions",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/metadata/FunctionManager.java#L72-L80 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java | UnsafeOperations.deepSizeOf | public final long deepSizeOf(Object o) {
"""
Determines the deep memory size of the given object (object or array), visiting all its references
@param o The object instance to calculate the deep size for
@return Size in bytes
"""
IdentityHashMap<Object, Boolean> seenObjects = new IdentityHashMap<Object, B... | java | public final long deepSizeOf(Object o) {
IdentityHashMap<Object, Boolean> seenObjects = new IdentityHashMap<Object, Boolean>(10);
return doDeepSizeOf(o, seenObjects);
} | [
"public",
"final",
"long",
"deepSizeOf",
"(",
"Object",
"o",
")",
"{",
"IdentityHashMap",
"<",
"Object",
",",
"Boolean",
">",
"seenObjects",
"=",
"new",
"IdentityHashMap",
"<",
"Object",
",",
"Boolean",
">",
"(",
"10",
")",
";",
"return",
"doDeepSizeOf",
"... | Determines the deep memory size of the given object (object or array), visiting all its references
@param o The object instance to calculate the deep size for
@return Size in bytes | [
"Determines",
"the",
"deep",
"memory",
"size",
"of",
"the",
"given",
"object",
"(",
"object",
"or",
"array",
")",
"visiting",
"all",
"its",
"references"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java#L670-L674 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.fetchByC_C_F | @Override
public CPAttachmentFileEntry fetchByC_C_F(long classNameId, long classPK,
long fileEntryId) {
"""
Returns the cp attachment file entry where classNameId = ? and classPK = ? and fileEntryId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param className... | java | @Override
public CPAttachmentFileEntry fetchByC_C_F(long classNameId, long classPK,
long fileEntryId) {
return fetchByC_C_F(classNameId, classPK, fileEntryId, true);
} | [
"@",
"Override",
"public",
"CPAttachmentFileEntry",
"fetchByC_C_F",
"(",
"long",
"classNameId",
",",
"long",
"classPK",
",",
"long",
"fileEntryId",
")",
"{",
"return",
"fetchByC_C_F",
"(",
"classNameId",
",",
"classPK",
",",
"fileEntryId",
",",
"true",
")",
";",... | Returns the cp attachment file entry where classNameId = ? and classPK = ? and fileEntryId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param classNameId the class name ID
@param classPK the class pk
@param fileEntryId the file entry ID
@return the matching cp attachme... | [
"Returns",
"the",
"cp",
"attachment",
"file",
"entry",
"where",
"classNameId",
"=",
"?",
";",
"and",
"classPK",
"=",
"?",
";",
"and",
"fileEntryId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L2680-L2684 |
hsiafan/requests | src/main/java/net/dongliu/requests/RawResponse.java | RawResponse.toResponse | public <T> Response<T> toResponse(ResponseHandler<T> handler) {
"""
Handle response body with handler, return a new response with content as handler result.
The response is closed whether this call succeed or failed with exception.
"""
ResponseInfo responseInfo = new ResponseInfo(this.url, this.status... | java | public <T> Response<T> toResponse(ResponseHandler<T> handler) {
ResponseInfo responseInfo = new ResponseInfo(this.url, this.statusCode, this.headers, body());
try {
T result = handler.handle(responseInfo);
return new Response<>(this.url, this.statusCode, this.cookies, this.header... | [
"public",
"<",
"T",
">",
"Response",
"<",
"T",
">",
"toResponse",
"(",
"ResponseHandler",
"<",
"T",
">",
"handler",
")",
"{",
"ResponseInfo",
"responseInfo",
"=",
"new",
"ResponseInfo",
"(",
"this",
".",
"url",
",",
"this",
".",
"statusCode",
",",
"this"... | Handle response body with handler, return a new response with content as handler result.
The response is closed whether this call succeed or failed with exception. | [
"Handle",
"response",
"body",
"with",
"handler",
"return",
"a",
"new",
"response",
"with",
"content",
"as",
"handler",
"result",
".",
"The",
"response",
"is",
"closed",
"whether",
"this",
"call",
"succeed",
"or",
"failed",
"with",
"exception",
"."
] | train | https://github.com/hsiafan/requests/blob/a6cc6f8293e808cc937d3789aec2616a8383dee0/src/main/java/net/dongliu/requests/RawResponse.java#L153-L163 |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/EntryFactory.java | EntryFactory.namedDescriptiveObject | public static Entry namedDescriptiveObject(String name, String description, Dn baseDn) throws LdapRuntimeException {
"""
Returns an {@link Entry} whose {@link Dn} is baseDn followed by name as Rdn. The attribute type of the Rdn is
'common name'. The description is optional in that it may also be null or the empty... | java | public static Entry namedDescriptiveObject(String name, String description, Dn baseDn) throws LdapRuntimeException {
Entry entry = namedObject(name, baseDn);
addDescription(entry, description);
return entry;
} | [
"public",
"static",
"Entry",
"namedDescriptiveObject",
"(",
"String",
"name",
",",
"String",
"description",
",",
"Dn",
"baseDn",
")",
"throws",
"LdapRuntimeException",
"{",
"Entry",
"entry",
"=",
"namedObject",
"(",
"name",
",",
"baseDn",
")",
";",
"addDescripti... | Returns an {@link Entry} whose {@link Dn} is baseDn followed by name as Rdn. The attribute type of the Rdn is
'common name'. The description is optional in that it may also be null or the empty String. Callers can rely on
this distinction, i.e. storing an empty string will also retrieve an empty string and storing null... | [
"Returns",
"an",
"{"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/EntryFactory.java#L79-L83 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java | ZooKeeper.getACL | public void getACL(final String path, Stat stat, ACLCallback cb, Object ctx) {
"""
The Asynchronous version of getACL. The request doesn't actually until
the asynchronous callback is called.
@see #getACL(String, Stat)
"""
verbotenThreadCheck();
final String clientPath = path;
PathUt... | java | public void getACL(final String path, Stat stat, ACLCallback cb, Object ctx) {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
final String serverPath = prependChroot(clientPath);
RequestHeader h = new RequestHeader();
h.setTyp... | [
"public",
"void",
"getACL",
"(",
"final",
"String",
"path",
",",
"Stat",
"stat",
",",
"ACLCallback",
"cb",
",",
"Object",
"ctx",
")",
"{",
"verbotenThreadCheck",
"(",
")",
";",
"final",
"String",
"clientPath",
"=",
"path",
";",
"PathUtils",
".",
"validateP... | The Asynchronous version of getACL. The request doesn't actually until
the asynchronous callback is called.
@see #getACL(String, Stat) | [
"The",
"Asynchronous",
"version",
"of",
"getACL",
".",
"The",
"request",
"doesn",
"t",
"actually",
"until",
"the",
"asynchronous",
"callback",
"is",
"called",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L1168-L1182 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.isInstanceOf | public <T> T isInstanceOf(final Class<?> type, final T obj) {
"""
Validates that the argument is an instance of the specified class, if not throws an exception. <p>This method is useful when validating according to an arbitrary class</p>
<pre>Validate.isInstanceOf(OkClass.class, object);</pre>
<p>The message of ... | java | public <T> T isInstanceOf(final Class<?> type, final T obj) {
if (!type.isInstance(obj)) {
fail(String.format(DEFAULT_IS_INSTANCE_OF_EX_MESSAGE, type.getName(), obj == null ? "null" : obj.getClass().getName()));
}
return obj;
} | [
"public",
"<",
"T",
">",
"T",
"isInstanceOf",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"T",
"obj",
")",
"{",
"if",
"(",
"!",
"type",
".",
"isInstance",
"(",
"obj",
")",
")",
"{",
"fail",
"(",
"String",
".",
"format",
"(",
"DE... | Validates that the argument is an instance of the specified class, if not throws an exception. <p>This method is useful when validating according to an arbitrary class</p>
<pre>Validate.isInstanceOf(OkClass.class, object);</pre>
<p>The message of the exception is "Expected type: {type}, actual: {obj_type}"</p... | [
"Validates",
"that",
"the",
"argument",
"is",
"an",
"instance",
"of",
"the",
"specified",
"class",
"if",
"not",
"throws",
"an",
"exception",
".",
"<p",
">",
"This",
"method",
"is",
"useful",
"when",
"validating",
"according",
"to",
"an",
"arbitrary",
"class<... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1544-L1549 |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/executor/SQLExecuteCallbackFactory.java | SQLExecuteCallbackFactory.getPreparedUpdateSQLExecuteCallback | public static SQLExecuteCallback<Integer> getPreparedUpdateSQLExecuteCallback(final DatabaseType databaseType, final boolean isExceptionThrown) {
"""
Get update callback.
@param databaseType database type
@param isExceptionThrown is exception thrown
@return update callback
"""
return new SQLExecut... | java | public static SQLExecuteCallback<Integer> getPreparedUpdateSQLExecuteCallback(final DatabaseType databaseType, final boolean isExceptionThrown) {
return new SQLExecuteCallback<Integer>(databaseType, isExceptionThrown) {
@Override
protected Integer executeSQL(final RouteUnit ... | [
"public",
"static",
"SQLExecuteCallback",
"<",
"Integer",
">",
"getPreparedUpdateSQLExecuteCallback",
"(",
"final",
"DatabaseType",
"databaseType",
",",
"final",
"boolean",
"isExceptionThrown",
")",
"{",
"return",
"new",
"SQLExecuteCallback",
"<",
"Integer",
">",
"(",
... | Get update callback.
@param databaseType database type
@param isExceptionThrown is exception thrown
@return update callback | [
"Get",
"update",
"callback",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/executor/SQLExecuteCallbackFactory.java#L43-L51 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicated_server_serviceName_bandwidth_duration_POST | public OvhOrder dedicated_server_serviceName_bandwidth_duration_POST(String serviceName, String duration, OvhBandwidthOrderEnum bandwidth, OvhBandwidthOrderTypeEnum type) throws IOException {
"""
Create order
REST: POST /order/dedicated/server/{serviceName}/bandwidth/{duration}
@param bandwidth [required] Band... | java | public OvhOrder dedicated_server_serviceName_bandwidth_duration_POST(String serviceName, String duration, OvhBandwidthOrderEnum bandwidth, OvhBandwidthOrderTypeEnum type) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/bandwidth/{duration}";
StringBuilder sb = path(qPath, serviceName, dur... | [
"public",
"OvhOrder",
"dedicated_server_serviceName_bandwidth_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhBandwidthOrderEnum",
"bandwidth",
",",
"OvhBandwidthOrderTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
... | Create order
REST: POST /order/dedicated/server/{serviceName}/bandwidth/{duration}
@param bandwidth [required] Bandwidth to allocate
@param type [required] bandwidth type
@param serviceName [required] The internal name of your dedicated server
@param duration [required] Duration | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2519-L2527 |
att/AAF | authz/authz-core/src/main/java/com/att/cssa/rserv/HttpCode.java | HttpCode.pathParam | public String pathParam(HttpServletRequest req, String key) {
"""
Get the variable element out of the Path Parameter, as set by initial Code
@param req
@param key
@return
"""
return match.param(req.getPathInfo(), key);
} | java | public String pathParam(HttpServletRequest req, String key) {
return match.param(req.getPathInfo(), key);
} | [
"public",
"String",
"pathParam",
"(",
"HttpServletRequest",
"req",
",",
"String",
"key",
")",
"{",
"return",
"match",
".",
"param",
"(",
"req",
".",
"getPathInfo",
"(",
")",
",",
"key",
")",
";",
"}"
] | Get the variable element out of the Path Parameter, as set by initial Code
@param req
@param key
@return | [
"Get",
"the",
"variable",
"element",
"out",
"of",
"the",
"Path",
"Parameter",
"as",
"set",
"by",
"initial",
"Code"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-core/src/main/java/com/att/cssa/rserv/HttpCode.java#L61-L63 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java | ParamFundamentalEpipolar.selectDivisor | private double selectDivisor( double v[] , double param[] ) {
"""
The divisor is the element in the first two columns that has the largest absolute value.
Finds this element, sets col0 to be the row which contains it, and specifies which elements
in that column are to be used.
@return Value of the divisor
... | java | private double selectDivisor( double v[] , double param[] ) {
double maxValue = 0;
int maxIndex = 0;
for( int i = 0; i < v.length; i++ ) {
if( Math.abs(v[i]) > maxValue ) {
maxValue = Math.abs(v[i]);
maxIndex = i;
}
}
double divisor = v[maxIndex];
int index = 0;
for( int i = 0; i < v.leng... | [
"private",
"double",
"selectDivisor",
"(",
"double",
"v",
"[",
"]",
",",
"double",
"param",
"[",
"]",
")",
"{",
"double",
"maxValue",
"=",
"0",
";",
"int",
"maxIndex",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"v",
".",
"l... | The divisor is the element in the first two columns that has the largest absolute value.
Finds this element, sets col0 to be the row which contains it, and specifies which elements
in that column are to be used.
@return Value of the divisor | [
"The",
"divisor",
"is",
"the",
"element",
"in",
"the",
"first",
"two",
"columns",
"that",
"has",
"the",
"largest",
"absolute",
"value",
".",
"Finds",
"this",
"element",
"sets",
"col0",
"to",
"be",
"the",
"row",
"which",
"contains",
"it",
"and",
"specifies"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/ParamFundamentalEpipolar.java#L94-L125 |
d-sauer/JCalcAPI | src/main/java/org/jdice/calc/Num.java | Num.isEqual | public boolean isEqual(Object value, int scale, Rounding rounding) {
"""
Convert <tt>value</tt> to {@link Num}, and scale both value before
comparing them.
@param value
@return
"""
Num numA = this;
Num numB = null;
if (value instanceof Num)
numB = (Num) value;
else
numB = new Num(value... | java | public boolean isEqual(Object value, int scale, Rounding rounding) {
Num numA = this;
Num numB = null;
if (value instanceof Num)
numB = (Num) value;
else
numB = new Num(value);
BigDecimal a = numA.toBigDecimal();
BigDecimal b = numB.toBigDecimal();
if (rounding != null) {
a = a.... | [
"public",
"boolean",
"isEqual",
"(",
"Object",
"value",
",",
"int",
"scale",
",",
"Rounding",
"rounding",
")",
"{",
"Num",
"numA",
"=",
"this",
";",
"Num",
"numB",
"=",
"null",
";",
"if",
"(",
"value",
"instanceof",
"Num",
")",
"numB",
"=",
"(",
"Num... | Convert <tt>value</tt> to {@link Num}, and scale both value before
comparing them.
@param value
@return | [
"Convert",
"<tt",
">",
"value<",
"/",
"tt",
">",
"to",
"{",
"@link",
"Num",
"}",
"and",
"scale",
"both",
"value",
"before",
"comparing",
"them",
"."
] | train | https://github.com/d-sauer/JCalcAPI/blob/36ae1f9adfe611a6f1bd8ef87cf1dc0ec88ac035/src/main/java/org/jdice/calc/Num.java#L720-L740 |
MutabilityDetector/MutabilityDetector | src/main/java/org/mutabilitydetector/DefaultCachingAnalysisSession.java | DefaultCachingAnalysisSession.createWithCurrentClassPath | public static AnalysisSession createWithCurrentClassPath(Configuration configuration) {
"""
Creates an analysis session based suitable for runtime analysis.
<p>
For analysis, classes will be accessed through the runtime classpath.
@param configuration custom configuration for analysis.
@return AnalysisSessio... | java | public static AnalysisSession createWithCurrentClassPath(Configuration configuration) {
ClassPath classpath = new ClassPathFactory().createFromJVM();
ClassLoadingVerifierFactory verifierFactory = new ClassLoadingVerifierFactory(new CachingAnalysisClassLoader(new ClassForNameWrapper()));
return c... | [
"public",
"static",
"AnalysisSession",
"createWithCurrentClassPath",
"(",
"Configuration",
"configuration",
")",
"{",
"ClassPath",
"classpath",
"=",
"new",
"ClassPathFactory",
"(",
")",
".",
"createFromJVM",
"(",
")",
";",
"ClassLoadingVerifierFactory",
"verifierFactory",... | Creates an analysis session based suitable for runtime analysis.
<p>
For analysis, classes will be accessed through the runtime classpath.
@param configuration custom configuration for analysis.
@return AnalysisSession for runtime analysis.
@see ConfigurationBuilder | [
"Creates",
"an",
"analysis",
"session",
"based",
"suitable",
"for",
"runtime",
"analysis",
".",
"<p",
">",
"For",
"analysis",
"classes",
"will",
"be",
"accessed",
"through",
"the",
"runtime",
"classpath",
"."
] | train | https://github.com/MutabilityDetector/MutabilityDetector/blob/36014d2f9e45cf0cc6d67b81395942cd39c4f6ae/src/main/java/org/mutabilitydetector/DefaultCachingAnalysisSession.java#L102-L106 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java | JSONObject.optBoolean | public boolean optBoolean(String name, boolean fallback) {
"""
Returns the value mapped by {@code name} if it exists and is a boolean or can be
coerced to a boolean. Returns {@code fallback} otherwise.
@param name the name of the property
@param fallback a fallback value
@return the value or {@code fallback}
... | java | public boolean optBoolean(String name, boolean fallback) {
Object object = opt(name);
Boolean result = JSON.toBoolean(object);
return result != null ? result : fallback;
} | [
"public",
"boolean",
"optBoolean",
"(",
"String",
"name",
",",
"boolean",
"fallback",
")",
"{",
"Object",
"object",
"=",
"opt",
"(",
"name",
")",
";",
"Boolean",
"result",
"=",
"JSON",
".",
"toBoolean",
"(",
"object",
")",
";",
"return",
"result",
"!=",
... | Returns the value mapped by {@code name} if it exists and is a boolean or can be
coerced to a boolean. Returns {@code fallback} otherwise.
@param name the name of the property
@param fallback a fallback value
@return the value or {@code fallback} | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L424-L428 |
line/armeria | examples/annotated-http-service/src/main/java/example/armeria/server/annotated/MessageConverterService.java | MessageConverterService.json1 | @Post("/node/node")
public JsonNode json1(@RequestObject JsonNode input) {
"""
Returns a {@link JsonNode} which is converted from a {@link Response} object. The {@link JsonNode}
will be converted as JSON string by the {@link JacksonResponseConverterFunction}.
"""
final JsonNode name = input.get("n... | java | @Post("/node/node")
public JsonNode json1(@RequestObject JsonNode input) {
final JsonNode name = input.get("name");
return mapper.valueToTree(new Response(Response.SUCCESS, name.textValue()));
} | [
"@",
"Post",
"(",
"\"/node/node\"",
")",
"public",
"JsonNode",
"json1",
"(",
"@",
"RequestObject",
"JsonNode",
"input",
")",
"{",
"final",
"JsonNode",
"name",
"=",
"input",
".",
"get",
"(",
"\"name\"",
")",
";",
"return",
"mapper",
".",
"valueToTree",
"(",... | Returns a {@link JsonNode} which is converted from a {@link Response} object. The {@link JsonNode}
will be converted as JSON string by the {@link JacksonResponseConverterFunction}. | [
"Returns",
"a",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/examples/annotated-http-service/src/main/java/example/armeria/server/annotated/MessageConverterService.java#L49-L53 |
finmath/finmath-lib | src/main/java6/net/finmath/functions/AnalyticFormulas.java | AnalyticFormulas.volatilityConversionLognormalATMtoNormalATM | public static double volatilityConversionLognormalATMtoNormalATM(double forward, double displacement, double maturity, double lognormalVolatiltiy) {
"""
Exact conversion of displaced lognormal ATM volatiltiy to normal ATM volatility.
@param forward The forward
@param displacement The displacement (considering ... | java | public static double volatilityConversionLognormalATMtoNormalATM(double forward, double displacement, double maturity, double lognormalVolatiltiy) {
double x = lognormalVolatiltiy * Math.sqrt(maturity / 8);
double y = org.apache.commons.math3.special.Erf.erf(x);
double normalVol = Math.sqrt(2*Math.PI / maturity) ... | [
"public",
"static",
"double",
"volatilityConversionLognormalATMtoNormalATM",
"(",
"double",
"forward",
",",
"double",
"displacement",
",",
"double",
"maturity",
",",
"double",
"lognormalVolatiltiy",
")",
"{",
"double",
"x",
"=",
"lognormalVolatiltiy",
"*",
"Math",
"."... | Exact conversion of displaced lognormal ATM volatiltiy to normal ATM volatility.
@param forward The forward
@param displacement The displacement (considering a displaced lognormal model, otherwise 0.
@param maturity The maturity
@param lognormalVolatiltiy The (implied) lognormal volatility.
@return The (implied) norma... | [
"Exact",
"conversion",
"of",
"displaced",
"lognormal",
"ATM",
"volatiltiy",
"to",
"normal",
"ATM",
"volatility",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/functions/AnalyticFormulas.java#L1301-L1307 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/method/DestinationPatternsMessageCondition.java | DestinationPatternsMessageCondition.getMatchingCondition | @Override
public DestinationPatternsMessageCondition getMatchingCondition(Message<?> message) {
"""
Check if any of the patterns match the given Message destination and return an
instance that is guaranteed to contain matching patterns, sorted via
{@link org.springframework.util.PathMatcher#getPatternComparator... | java | @Override
public DestinationPatternsMessageCondition getMatchingCondition(Message<?> message) {
WampMessage wampMessage = (WampMessage) message;
String destination = wampMessage.getDestination();
if (destination == null) {
return null;
}
if (this.patterns.isEmpty()) {
return this;
}
List<String> ... | [
"@",
"Override",
"public",
"DestinationPatternsMessageCondition",
"getMatchingCondition",
"(",
"Message",
"<",
"?",
">",
"message",
")",
"{",
"WampMessage",
"wampMessage",
"=",
"(",
"WampMessage",
")",
"message",
";",
"String",
"destination",
"=",
"wampMessage",
"."... | Check if any of the patterns match the given Message destination and return an
instance that is guaranteed to contain matching patterns, sorted via
{@link org.springframework.util.PathMatcher#getPatternComparator(String)}.
@param message the message to match to
@return the same instance if the condition contains no pat... | [
"Check",
"if",
"any",
"of",
"the",
"patterns",
"match",
"the",
"given",
"Message",
"destination",
"and",
"return",
"an",
"instance",
"that",
"is",
"guaranteed",
"to",
"contain",
"matching",
"patterns",
"sorted",
"via",
"{"
] | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/method/DestinationPatternsMessageCondition.java#L131-L158 |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/PreConditions.java | PreConditions.ensureNotEmpty | public static Buffer ensureNotEmpty(final Buffer reference, final String msg) throws IllegalArgumentException {
"""
Assert that the {@link Buffer} is not null nor empty.
@param reference
@param msg
@return
@throws IllegalArgumentException
"""
if (reference == null || reference.isEmpty()) {
... | java | public static Buffer ensureNotEmpty(final Buffer reference, final String msg) throws IllegalArgumentException {
if (reference == null || reference.isEmpty()) {
throw new IllegalArgumentException(msg);
}
return reference;
} | [
"public",
"static",
"Buffer",
"ensureNotEmpty",
"(",
"final",
"Buffer",
"reference",
",",
"final",
"String",
"msg",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"reference",
"==",
"null",
"||",
"reference",
".",
"isEmpty",
"(",
")",
")",
"{",
"... | Assert that the {@link Buffer} is not null nor empty.
@param reference
@param msg
@return
@throws IllegalArgumentException | [
"Assert",
"that",
"the",
"{",
"@link",
"Buffer",
"}",
"is",
"not",
"null",
"nor",
"empty",
"."
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/PreConditions.java#L114-L119 |
apache/spark | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java | UnsafeArrayData.pointTo | public void pointTo(Object baseObject, long baseOffset, int sizeInBytes) {
"""
Update this UnsafeArrayData to point to different backing data.
@param baseObject the base object
@param baseOffset the offset within the base object
@param sizeInBytes the size of this array's backing data, in bytes
"""
//... | java | public void pointTo(Object baseObject, long baseOffset, int sizeInBytes) {
// Read the number of elements from the first 8 bytes.
final long numElements = Platform.getLong(baseObject, baseOffset);
assert numElements >= 0 : "numElements (" + numElements + ") should >= 0";
assert numElements <= Integer.MA... | [
"public",
"void",
"pointTo",
"(",
"Object",
"baseObject",
",",
"long",
"baseOffset",
",",
"int",
"sizeInBytes",
")",
"{",
"// Read the number of elements from the first 8 bytes.",
"final",
"long",
"numElements",
"=",
"Platform",
".",
"getLong",
"(",
"baseObject",
",",... | Update this UnsafeArrayData to point to different backing data.
@param baseObject the base object
@param baseOffset the offset within the base object
@param sizeInBytes the size of this array's backing data, in bytes | [
"Update",
"this",
"UnsafeArrayData",
"to",
"point",
"to",
"different",
"backing",
"data",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java#L128-L140 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaMemset | public static int cudaMemset(Pointer mem, int c, long count) {
"""
Initializes or sets device memory to a value.
<pre>
cudaError_t cudaMemset (
void* devPtr,
int value,
size_t count )
</pre>
<div>
<p>Initializes or sets device memory to a
value. Fills the first <tt>count</tt> bytes of the memory area
... | java | public static int cudaMemset(Pointer mem, int c, long count)
{
return checkResult(cudaMemsetNative(mem, c, count));
} | [
"public",
"static",
"int",
"cudaMemset",
"(",
"Pointer",
"mem",
",",
"int",
"c",
",",
"long",
"count",
")",
"{",
"return",
"checkResult",
"(",
"cudaMemsetNative",
"(",
"mem",
",",
"c",
",",
"count",
")",
")",
";",
"}"
] | Initializes or sets device memory to a value.
<pre>
cudaError_t cudaMemset (
void* devPtr,
int value,
size_t count )
</pre>
<div>
<p>Initializes or sets device memory to a
value. Fills the first <tt>count</tt> bytes of the memory area
pointed to by <tt>devPtr</tt> with the constant byte value <tt>value</tt>.
</p>
<p... | [
"Initializes",
"or",
"sets",
"device",
"memory",
"to",
"a",
"value",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L6206-L6209 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobTargetExecutionsInner.java | JobTargetExecutionsInner.listByStepAsync | public Observable<Page<JobExecutionInner>> listByStepAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId, final String stepName, final DateTime createTimeMin, final DateTime createTimeMax, final DateTime endTimeMin, final DateTime end... | java | public Observable<Page<JobExecutionInner>> listByStepAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId, final String stepName, final DateTime createTimeMin, final DateTime createTimeMax, final DateTime endTimeMin, final DateTime end... | [
"public",
"Observable",
"<",
"Page",
"<",
"JobExecutionInner",
">",
">",
"listByStepAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"jobAgentName",
",",
"final",
"String",
"jobName",
",",
"final",
... | Lists the target executions of a job step execution.
@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 jobAgentName The name of the job agent.
@param jobName T... | [
"Lists",
"the",
"target",
"executions",
"of",
"a",
"job",
"step",
"execution",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobTargetExecutionsInner.java#L650-L658 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.createInstance | static public long createInstance(FileManager fm,
int tablesize,
int load)
throws IOException,
HashtableOnDiskException {
"""
***********************************************************************
... | java | static public long createInstance(FileManager fm,
int tablesize,
int load)
throws IOException,
HashtableOnDiskException {
HashHeader header = new HashHeader(fm, magic, load, tablesize);
re... | [
"static",
"public",
"long",
"createInstance",
"(",
"FileManager",
"fm",
",",
"int",
"tablesize",
",",
"int",
"load",
")",
"throws",
"IOException",
",",
"HashtableOnDiskException",
"{",
"HashHeader",
"header",
"=",
"new",
"HashHeader",
"(",
"fm",
",",
"magic",
... | ***********************************************************************
createInstance Creates a new instance of a HTOD and stores a pointer
to its header on disk so it can be retrived later, when
reinitializing the HTOD.
@param filemgr The FileManager instance over which the HTOD is
implemented.
@param instanceid The... | [
"***********************************************************************",
"createInstance",
"Creates",
"a",
"new",
"instance",
"of",
"a",
"HTOD",
"and",
"stores",
"a",
"pointer",
"to",
"its",
"header",
"on",
"disk",
"so",
"it",
"can",
"be",
"retrived",
"later",
"when... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L428-L435 |
lets-blade/blade | src/main/java/com/blade/kit/StringKit.java | StringKit.isBlankThen | public static void isBlankThen(String str, Consumer<String> consumer) {
"""
Execute consumer when the string is empty
@param str string value
@param consumer consumer
"""
if (isBlank(str)) {
consumer.accept(str);
}
} | java | public static void isBlankThen(String str, Consumer<String> consumer) {
if (isBlank(str)) {
consumer.accept(str);
}
} | [
"public",
"static",
"void",
"isBlankThen",
"(",
"String",
"str",
",",
"Consumer",
"<",
"String",
">",
"consumer",
")",
"{",
"if",
"(",
"isBlank",
"(",
"str",
")",
")",
"{",
"consumer",
".",
"accept",
"(",
"str",
")",
";",
"}",
"}"
] | Execute consumer when the string is empty
@param str string value
@param consumer consumer | [
"Execute",
"consumer",
"when",
"the",
"string",
"is",
"empty"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/StringKit.java#L87-L91 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.saveRecentList | public void saveRecentList(CmsObject cms, List<CmsContainerElementBean> recentList) throws CmsException {
"""
Saves the favorite list, user based.<p>
@param cms the cms context
@param recentList the element list
@throws CmsException if something goes wrong
"""
saveElementList(cms, recentList, A... | java | public void saveRecentList(CmsObject cms, List<CmsContainerElementBean> recentList) throws CmsException {
saveElementList(cms, recentList, ADDINFO_ADE_RECENT_LIST);
} | [
"public",
"void",
"saveRecentList",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsContainerElementBean",
">",
"recentList",
")",
"throws",
"CmsException",
"{",
"saveElementList",
"(",
"cms",
",",
"recentList",
",",
"ADDINFO_ADE_RECENT_LIST",
")",
";",
"}"
] | Saves the favorite list, user based.<p>
@param cms the cms context
@param recentList the element list
@throws CmsException if something goes wrong | [
"Saves",
"the",
"favorite",
"list",
"user",
"based",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L1258-L1261 |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/Generators.java | Generators.byMonthDayGenerator | static Generator byMonthDayGenerator(int[] dates, final DateValue dtStart) {
"""
constructs a function that yields the specified dates
(possibly relative to end of month) in increasing order
for each month seen.
@param dates elements in [-53,53] != 0
@param dtStart non null
"""
final int[] udates =... | java | static Generator byMonthDayGenerator(int[] dates, final DateValue dtStart) {
final int[] udates = Util.uniquify(dates);
return new Generator() {
int year = dtStart.year();
int month = dtStart.month();
/** list of generated dates for the current month */
i... | [
"static",
"Generator",
"byMonthDayGenerator",
"(",
"int",
"[",
"]",
"dates",
",",
"final",
"DateValue",
"dtStart",
")",
"{",
"final",
"int",
"[",
"]",
"udates",
"=",
"Util",
".",
"uniquify",
"(",
"dates",
")",
";",
"return",
"new",
"Generator",
"(",
")",... | constructs a function that yields the specified dates
(possibly relative to end of month) in increasing order
for each month seen.
@param dates elements in [-53,53] != 0
@param dtStart non null | [
"constructs",
"a",
"function",
"that",
"yields",
"the",
"specified",
"dates",
"(",
"possibly",
"relative",
"to",
"end",
"of",
"month",
")",
"in",
"increasing",
"order",
"for",
"each",
"month",
"seen",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/Generators.java#L720-L772 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/paging/NumberedPaging.java | NumberedPaging.pageUri | private String pageUri(final UriTemplate uriTemplate, final int pageNumber, final int pageSize) {
"""
Return the HREF of the page specified by UriTemplate, pageNumber and pageSize.
@param uriTemplate the template used to build hrefs.
@param pageNumber the number of the linked page.
@param pageSize the size of... | java | private String pageUri(final UriTemplate uriTemplate, final int pageNumber, final int pageSize) {
if (pageSize == MAX_VALUE) {
return uriTemplate.expand();
}
return uriTemplate.set(pageNumberVar(), pageNumber).set(pageSizeVar(), pageSize).expand();
} | [
"private",
"String",
"pageUri",
"(",
"final",
"UriTemplate",
"uriTemplate",
",",
"final",
"int",
"pageNumber",
",",
"final",
"int",
"pageSize",
")",
"{",
"if",
"(",
"pageSize",
"==",
"MAX_VALUE",
")",
"{",
"return",
"uriTemplate",
".",
"expand",
"(",
")",
... | Return the HREF of the page specified by UriTemplate, pageNumber and pageSize.
@param uriTemplate the template used to build hrefs.
@param pageNumber the number of the linked page.
@param pageSize the size of the pages.
@return href of the linked page. | [
"Return",
"the",
"HREF",
"of",
"the",
"page",
"specified",
"by",
"UriTemplate",
"pageNumber",
"and",
"pageSize",
"."
] | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/paging/NumberedPaging.java#L340-L345 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionInvoker.java | RaftSessionInvoker.invoke | private <T extends OperationRequest, U extends OperationResponse> void invoke(OperationAttempt<T, U> attempt) {
"""
Submits an operation attempt.
@param attempt The attempt to submit.
"""
if (state.getState() == PrimitiveState.CLOSED) {
attempt.fail(new PrimitiveException.ClosedSession("session cl... | java | private <T extends OperationRequest, U extends OperationResponse> void invoke(OperationAttempt<T, U> attempt) {
if (state.getState() == PrimitiveState.CLOSED) {
attempt.fail(new PrimitiveException.ClosedSession("session closed"));
} else {
attempts.put(attempt.sequence, attempt);
attempt.send(... | [
"private",
"<",
"T",
"extends",
"OperationRequest",
",",
"U",
"extends",
"OperationResponse",
">",
"void",
"invoke",
"(",
"OperationAttempt",
"<",
"T",
",",
"U",
">",
"attempt",
")",
"{",
"if",
"(",
"state",
".",
"getState",
"(",
")",
"==",
"PrimitiveState... | Submits an operation attempt.
@param attempt The attempt to submit. | [
"Submits",
"an",
"operation",
"attempt",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionInvoker.java#L152-L160 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java | RedisStorage.pauseTrigger | @Override
public void pauseTrigger(TriggerKey triggerKey, Jedis jedis) throws JobPersistenceException {
"""
Pause the trigger with the given key
@param triggerKey the key of the trigger to be paused
@param jedis a thread-safe Redis connection
@throws JobPersistenceException if the desired trigger does not e... | java | @Override
public void pauseTrigger(TriggerKey triggerKey, Jedis jedis) throws JobPersistenceException {
final String triggerHashKey = redisSchema.triggerHashKey(triggerKey);
Pipeline pipe = jedis.pipelined();
Response<Boolean> exists = pipe.exists(triggerHashKey);
Response<Double> co... | [
"@",
"Override",
"public",
"void",
"pauseTrigger",
"(",
"TriggerKey",
"triggerKey",
",",
"Jedis",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"triggerHashKey",
"=",
"redisSchema",
".",
"triggerHashKey",
"(",
"triggerKey",
")",
";",
"... | Pause the trigger with the given key
@param triggerKey the key of the trigger to be paused
@param jedis a thread-safe Redis connection
@throws JobPersistenceException if the desired trigger does not exist | [
"Pause",
"the",
"trigger",
"with",
"the",
"given",
"key"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java#L444-L470 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/IOUtils.java | IOUtils.copy | public static void copy(InputStream input, OutputStream output, boolean closeStreams) throws IOException {
"""
Writes all the contents of an InputStream to an OutputStream.
@param input
the input stream to read from
@param output
the output stream to write to
@param closeStreams
the flag indicating if the ... | java | public static void copy(InputStream input, OutputStream output, boolean closeStreams) throws IOException {
try {
copy(input, output);
} finally {
if (closeStreams) {
close(input);
close(output);
}
}
} | [
"public",
"static",
"void",
"copy",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
",",
"boolean",
"closeStreams",
")",
"throws",
"IOException",
"{",
"try",
"{",
"copy",
"(",
"input",
",",
"output",
")",
";",
"}",
"finally",
"{",
"if",
"(",
... | Writes all the contents of an InputStream to an OutputStream.
@param input
the input stream to read from
@param output
the output stream to write to
@param closeStreams
the flag indicating if the stream must be close at the end,
even if an exception occurs
@throws java.io.IOException
if an IOExcption occurs | [
"Writes",
"all",
"the",
"contents",
"of",
"an",
"InputStream",
"to",
"an",
"OutputStream",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/IOUtils.java#L121-L130 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednasha/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednasha.java | ApiOvhDedicatednasha.serviceName_partition_partitionName_snapshot_GET | public ArrayList<OvhSnapshotEnum> serviceName_partition_partitionName_snapshot_GET(String serviceName, String partitionName) throws IOException {
"""
Get scheduled snapshot types for this partition
REST: GET /dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot
@param serviceName [required] The int... | java | public ArrayList<OvhSnapshotEnum> serviceName_partition_partitionName_snapshot_GET(String serviceName, String partitionName) throws IOException {
String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot";
StringBuilder sb = path(qPath, serviceName, partitionName);
String resp = exec(qPath... | [
"public",
"ArrayList",
"<",
"OvhSnapshotEnum",
">",
"serviceName_partition_partitionName_snapshot_GET",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/nasha/{serviceName}/partition/{partitio... | Get scheduled snapshot types for this partition
REST: GET /dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot
@param serviceName [required] The internal name of your storage
@param partitionName [required] the given name of partition | [
"Get",
"scheduled",
"snapshot",
"types",
"for",
"this",
"partition"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednasha/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednasha.java#L325-L330 |
drewnoakes/metadata-extractor | Source/com/drew/imaging/jpeg/JpegSegmentData.java | JpegSegmentData.removeSegmentOccurrence | @SuppressWarnings( {
"""
Removes a specified instance of a segment's data from the collection. Use this method when more than one
occurrence of segment data exists for a given type exists.
@param segmentType identifies the required segment
@param occurrence the zero-based index of the segment occurrence to ... | java | @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"})
public void removeSegmentOccurrence(byte segmentType, int occurrence)
{
final List<byte[]> segmentList = _segmentDataMap.get(segmentType);
segmentList.remove(occurrence);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"MismatchedQueryAndUpdateOfCollection\"",
"}",
")",
"public",
"void",
"removeSegmentOccurrence",
"(",
"byte",
"segmentType",
",",
"int",
"occurrence",
")",
"{",
"final",
"List",
"<",
"byte",
"[",
"]",
">",
"segmentList",
"=",
... | Removes a specified instance of a segment's data from the collection. Use this method when more than one
occurrence of segment data exists for a given type exists.
@param segmentType identifies the required segment
@param occurrence the zero-based index of the segment occurrence to remove. | [
"Removes",
"a",
"specified",
"instance",
"of",
"a",
"segment",
"s",
"data",
"from",
"the",
"collection",
".",
"Use",
"this",
"method",
"when",
"more",
"than",
"one",
"occurrence",
"of",
"segment",
"data",
"exists",
"for",
"a",
"given",
"type",
"exists",
".... | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/imaging/jpeg/JpegSegmentData.java#L222-L227 |
arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/OpenShiftResourceFactory.java | OpenShiftResourceFactory.createImageStreamRequest | private static String createImageStreamRequest(String name, String version, String image, boolean insecure) {
"""
Creates image stream request and returns it in JSON formatted string.
@param name Name of the image stream
@param insecure If the registry where the image is stored is insecure
@param image ... | java | private static String createImageStreamRequest(String name, String version, String image, boolean insecure) {
JSONObject imageStream = new JSONObject();
JSONObject metadata = new JSONObject();
JSONObject annotations = new JSONObject();
metadata.put("name", name);
annotations.put... | [
"private",
"static",
"String",
"createImageStreamRequest",
"(",
"String",
"name",
",",
"String",
"version",
",",
"String",
"image",
",",
"boolean",
"insecure",
")",
"{",
"JSONObject",
"imageStream",
"=",
"new",
"JSONObject",
"(",
")",
";",
"JSONObject",
"metadat... | Creates image stream request and returns it in JSON formatted string.
@param name Name of the image stream
@param insecure If the registry where the image is stored is insecure
@param image Image name, includes registry information and tag
@param version Image stream version.
@return JSON formatted string | [
"Creates",
"image",
"stream",
"request",
"and",
"returns",
"it",
"in",
"JSON",
"formatted",
"string",
"."
] | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/resources/OpenShiftResourceFactory.java#L159-L198 |
joachimvda/jtransfo | core/src/main/java/org/jtransfo/internal/ReflectionHelper.java | ReflectionHelper.makeSynthetic | List<SyntheticField> makeSynthetic(Class<?> clazz, List<Field> fields) {
"""
Convert list of (real) fields to synthetic fields (which use accessor methods).
@param clazz class which contains the fields
@param fields fields to convert to synthetic fields
@return list of synthetic fields
"""
List<Sy... | java | List<SyntheticField> makeSynthetic(Class<?> clazz, List<Field> fields) {
List<SyntheticField> result = new ArrayList<>();
for (Field field : fields) {
result.add(new AccessorSyntheticField(this, clazz, field));
}
return result;
} | [
"List",
"<",
"SyntheticField",
">",
"makeSynthetic",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"List",
"<",
"Field",
">",
"fields",
")",
"{",
"List",
"<",
"SyntheticField",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Fi... | Convert list of (real) fields to synthetic fields (which use accessor methods).
@param clazz class which contains the fields
@param fields fields to convert to synthetic fields
@return list of synthetic fields | [
"Convert",
"list",
"of",
"(",
"real",
")",
"fields",
"to",
"synthetic",
"fields",
"(",
"which",
"use",
"accessor",
"methods",
")",
"."
] | train | https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/internal/ReflectionHelper.java#L114-L120 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/api/BooleanColumn.java | BooleanColumn.set | public BooleanColumn set(Selection rowSelection, boolean newValue) {
"""
Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria
"""
for (int row : rowSelection) {
set(row, newValue);
}
ret... | java | public BooleanColumn set(Selection rowSelection, boolean newValue) {
for (int row : rowSelection) {
set(row, newValue);
}
return this;
} | [
"public",
"BooleanColumn",
"set",
"(",
"Selection",
"rowSelection",
",",
"boolean",
"newValue",
")",
"{",
"for",
"(",
"int",
"row",
":",
"rowSelection",
")",
"{",
"set",
"(",
"row",
",",
"newValue",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Conditionally update this column, replacing current values with newValue for all rows where the current value
matches the selection criteria | [
"Conditionally",
"update",
"this",
"column",
"replacing",
"current",
"values",
"with",
"newValue",
"for",
"all",
"rows",
"where",
"the",
"current",
"value",
"matches",
"the",
"selection",
"criteria"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/api/BooleanColumn.java#L558-L563 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/convert/DateTimeConverter.java | DateTimeConverter.getDateFormat | private DateFormat getDateFormat(Locale locale) {
"""
<p>Return a <code>DateFormat</code> instance to use for formatting
and parsing in this {@link Converter}.</p>
@param locale The <code>Locale</code> used to select formatting
and parsing conventions
@throws ConverterException if no instance can be created... | java | private DateFormat getDateFormat(Locale locale) {
// PENDING(craigmcc) - Implement pooling if needed for performance?
if (pattern == null && type == null) {
throw new IllegalArgumentException("Either pattern or type must" +
" be specified.");
}
DateFormat ... | [
"private",
"DateFormat",
"getDateFormat",
"(",
"Locale",
"locale",
")",
"{",
"// PENDING(craigmcc) - Implement pooling if needed for performance?",
"if",
"(",
"pattern",
"==",
"null",
"&&",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | <p>Return a <code>DateFormat</code> instance to use for formatting
and parsing in this {@link Converter}.</p>
@param locale The <code>Locale</code> used to select formatting
and parsing conventions
@throws ConverterException if no instance can be created | [
"<p",
">",
"Return",
"a",
"<code",
">",
"DateFormat<",
"/",
"code",
">",
"instance",
"to",
"use",
"for",
"formatting",
"and",
"parsing",
"in",
"this",
"{",
"@link",
"Converter",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/convert/DateTimeConverter.java#L486-L512 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ThemeUtil.java | ThemeUtil.getInt | public static int getInt(@NonNull final Context context, @AttrRes final int resourceId,
final int defaultValue) {
"""
Obtains the integer value, which corresponds to a specific resource id, from a context's
theme.
@param context
The context, which should be used, as an instance of... | java | public static int getInt(@NonNull final Context context, @AttrRes final int resourceId,
final int defaultValue) {
return getInt(context, -1, resourceId, defaultValue);
} | [
"public",
"static",
"int",
"getInt",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"AttrRes",
"final",
"int",
"resourceId",
",",
"final",
"int",
"defaultValue",
")",
"{",
"return",
"getInt",
"(",
"context",
",",
"-",
"1",
",",
"resourceId",... | Obtains the integer value, which corresponds to a specific resource id, from a context's
theme.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param resourceId
The resource id of the attribute, which should be obtained, as an {@link Integer}
... | [
"Obtains",
"the",
"integer",
"value",
"which",
"corresponds",
"to",
"a",
"specific",
"resource",
"id",
"from",
"a",
"context",
"s",
"theme",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L757-L760 |
micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java | PathMatchingResourcePatternResolver.doRetrieveMatchingFiles | protected void doRetrieveMatchingFiles(String fullPattern, File dir, Set<File> result) throws IOException {
"""
Recursively retrieve files that match the given pattern,
adding them to the given result list.
@param fullPattern the pattern to match against,
with prepended root directory path
@param dir ... | java | protected void doRetrieveMatchingFiles(String fullPattern, File dir, Set<File> result) throws IOException {
File[] dirContents = dir.listFiles();
if (dirContents == null) {
return;
}
for (File content : dirContents) {
String currPath = content.getAbsolutePath().re... | [
"protected",
"void",
"doRetrieveMatchingFiles",
"(",
"String",
"fullPattern",
",",
"File",
"dir",
",",
"Set",
"<",
"File",
">",
"result",
")",
"throws",
"IOException",
"{",
"File",
"[",
"]",
"dirContents",
"=",
"dir",
".",
"listFiles",
"(",
")",
";",
"if",... | Recursively retrieve files that match the given pattern,
adding them to the given result list.
@param fullPattern the pattern to match against,
with prepended root directory path
@param dir the current directory
@param result the Set of matching File instances to add to
@throws IOException if directory co... | [
"Recursively",
"retrieve",
"files",
"that",
"match",
"the",
"given",
"pattern",
"adding",
"them",
"to",
"the",
"given",
"result",
"list",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java#L541-L557 |
iipc/webarchive-commons | src/main/java/org/archive/util/SurtPrefixSet.java | SurtPrefixSet.importFromMixed | public void importFromMixed(Reader r, boolean deduceFromSeeds) {
"""
Import SURT prefixes from a reader with mixed URI and SURT prefix
format.
@param r the reader to import the prefixes from
@param deduceFromSeeds true to also import SURT prefixes implied
from normal URIs/hostname seeds
"""
Bu... | java | public void importFromMixed(Reader r, boolean deduceFromSeeds) {
BufferedReader reader = new BufferedReader(r);
String s;
Iterator<String> iter =
new RegexLineIterator(
new LineReadingIterator(reader),
RegexLineIterator.COMMENT_LINE,
... | [
"public",
"void",
"importFromMixed",
"(",
"Reader",
"r",
",",
"boolean",
"deduceFromSeeds",
")",
"{",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"r",
")",
";",
"String",
"s",
";",
"Iterator",
"<",
"String",
">",
"iter",
"=",
"new",
"Reg... | Import SURT prefixes from a reader with mixed URI and SURT prefix
format.
@param r the reader to import the prefixes from
@param deduceFromSeeds true to also import SURT prefixes implied
from normal URIs/hostname seeds | [
"Import",
"SURT",
"prefixes",
"from",
"a",
"reader",
"with",
"mixed",
"URI",
"and",
"SURT",
"prefix",
"format",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/SurtPrefixSet.java#L107-L131 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.openapi_fat/fat/src/com/ibm/ws/microprofile/openapi/fat/utils/OpenAPIConnection.java | OpenAPIConnection.openAPIDocsConnection | public static OpenAPIConnection openAPIDocsConnection(LibertyServer server, boolean secure) {
"""
creates default connection for OpenAPI docs endpoint
@param server - server to connect to
@param secure - if true connection uses HTTPS
@return
"""
return new OpenAPIConnection(server, OPEN_API_DOCS).... | java | public static OpenAPIConnection openAPIDocsConnection(LibertyServer server, boolean secure) {
return new OpenAPIConnection(server, OPEN_API_DOCS).secure(secure);
} | [
"public",
"static",
"OpenAPIConnection",
"openAPIDocsConnection",
"(",
"LibertyServer",
"server",
",",
"boolean",
"secure",
")",
"{",
"return",
"new",
"OpenAPIConnection",
"(",
"server",
",",
"OPEN_API_DOCS",
")",
".",
"secure",
"(",
"secure",
")",
";",
"}"
] | creates default connection for OpenAPI docs endpoint
@param server - server to connect to
@param secure - if true connection uses HTTPS
@return | [
"creates",
"default",
"connection",
"for",
"OpenAPI",
"docs",
"endpoint"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.openapi_fat/fat/src/com/ibm/ws/microprofile/openapi/fat/utils/OpenAPIConnection.java#L270-L272 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/NLS.java | NLS.getString | public String getString(String key) throws MissingResourceException {
"""
Overrides ResourceBundle.getString. Adds some error checking to ensure that
we got a non-null key and resource bundle.
@param key Name portion of "name=value" pair.
@return rtn The resource string.
"""
// Error Checking Trac... | java | public String getString(String key) throws MissingResourceException {
// Error Checking Trace. Ensure that we got a valid key
if (key == null) {
if (tc.isEventEnabled()) {
// DGH20040823: Begin fix for defect 218797 - Source provided by Tom Musta
// String m... | [
"public",
"String",
"getString",
"(",
"String",
"key",
")",
"throws",
"MissingResourceException",
"{",
"// Error Checking Trace. Ensure that we got a valid key",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",... | Overrides ResourceBundle.getString. Adds some error checking to ensure that
we got a non-null key and resource bundle.
@param key Name portion of "name=value" pair.
@return rtn The resource string. | [
"Overrides",
"ResourceBundle",
".",
"getString",
".",
"Adds",
"some",
"error",
"checking",
"to",
"ensure",
"that",
"we",
"got",
"a",
"non",
"-",
"null",
"key",
"and",
"resource",
"bundle",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/NLS.java#L308-L341 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.fromCollection | public <OUT> DataStreamSource<OUT> fromCollection(Collection<OUT> data, TypeInformation<OUT> typeInfo) {
"""
Creates a data stream from the given non-empty collection.
<p>Note that this operation will result in a non-parallel data stream source,
i.e., a data stream source with parallelism one.
@param data
... | java | public <OUT> DataStreamSource<OUT> fromCollection(Collection<OUT> data, TypeInformation<OUT> typeInfo) {
Preconditions.checkNotNull(data, "Collection must not be null");
// must not have null elements and mixed elements
FromElementsFunction.checkCollection(data, typeInfo.getTypeClass());
SourceFunction<OUT> f... | [
"public",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"fromCollection",
"(",
"Collection",
"<",
"OUT",
">",
"data",
",",
"TypeInformation",
"<",
"OUT",
">",
"typeInfo",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"data",
",",
"\"Collection... | Creates a data stream from the given non-empty collection.
<p>Note that this operation will result in a non-parallel data stream source,
i.e., a data stream source with parallelism one.
@param data
The collection of elements to create the data stream from
@param typeInfo
The TypeInformation for the produced data stre... | [
"Creates",
"a",
"data",
"stream",
"from",
"the",
"given",
"non",
"-",
"empty",
"collection",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L805-L819 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getActionOutput | public static Object getActionOutput( String name, ServletRequest request ) {
"""
Get a named action output that was registered in the current request.
@param name the name of the action output.
@param request the current ServletRequest
@see #addActionOutput
"""
Map map = InternalUtils.getActionOu... | java | public static Object getActionOutput( String name, ServletRequest request )
{
Map map = InternalUtils.getActionOutputMap( request, false );
return map != null ? map.get( name ) : null;
} | [
"public",
"static",
"Object",
"getActionOutput",
"(",
"String",
"name",
",",
"ServletRequest",
"request",
")",
"{",
"Map",
"map",
"=",
"InternalUtils",
".",
"getActionOutputMap",
"(",
"request",
",",
"false",
")",
";",
"return",
"map",
"!=",
"null",
"?",
"ma... | Get a named action output that was registered in the current request.
@param name the name of the action output.
@param request the current ServletRequest
@see #addActionOutput | [
"Get",
"a",
"named",
"action",
"output",
"that",
"was",
"registered",
"in",
"the",
"current",
"request",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L969-L973 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.isCase | public static boolean isCase(Map caseValue, Object switchValue) {
"""
'Case' implementation for maps which tests the groovy truth
value obtained using the 'switch' operand as key.
For example:
<pre class="groovyTestCase">switch( 'foo' ) {
case [foo:true, bar:false]:
assert true
break
default:
assert false
... | java | public static boolean isCase(Map caseValue, Object switchValue) {
return DefaultTypeTransformation.castToBoolean(caseValue.get(switchValue));
} | [
"public",
"static",
"boolean",
"isCase",
"(",
"Map",
"caseValue",
",",
"Object",
"switchValue",
")",
"{",
"return",
"DefaultTypeTransformation",
".",
"castToBoolean",
"(",
"caseValue",
".",
"get",
"(",
"switchValue",
")",
")",
";",
"}"
] | 'Case' implementation for maps which tests the groovy truth
value obtained using the 'switch' operand as key.
For example:
<pre class="groovyTestCase">switch( 'foo' ) {
case [foo:true, bar:false]:
assert true
break
default:
assert false
}</pre>
@param caseValue the case value
@param switchValue the switch value
@ret... | [
"Case",
"implementation",
"for",
"maps",
"which",
"tests",
"the",
"groovy",
"truth",
"value",
"obtained",
"using",
"the",
"switch",
"operand",
"as",
"key",
".",
"For",
"example",
":",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"switch",
"(",
"foo",
")",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L1181-L1183 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.beginImportDataAsync | public Observable<Void> beginImportDataAsync(String resourceGroupName, String name, ImportRDBParameters parameters) {
"""
Import data into Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis import operation.
@t... | java | public Observable<Void> beginImportDataAsync(String resourceGroupName, String name, ImportRDBParameters parameters) {
return beginImportDataWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceRespo... | [
"public",
"Observable",
"<",
"Void",
">",
"beginImportDataAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ImportRDBParameters",
"parameters",
")",
"{",
"return",
"beginImportDataWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
"... | Import data into Redis cache.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis import operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Import",
"data",
"into",
"Redis",
"cache",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L1440-L1447 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForText | public TextView waitForText(String text, int expectedMinimumNumberOfMatches, long timeout) {
"""
Waits for a text to be shown.
@param text the text that needs to be shown, specified as a regular expression
@param expectedMinimumNumberOfMatches the minimum number of matches of text that must be shown. {@code 0}... | java | public TextView waitForText(String text, int expectedMinimumNumberOfMatches, long timeout)
{
return waitForText(text, expectedMinimumNumberOfMatches, timeout, true);
} | [
"public",
"TextView",
"waitForText",
"(",
"String",
"text",
",",
"int",
"expectedMinimumNumberOfMatches",
",",
"long",
"timeout",
")",
"{",
"return",
"waitForText",
"(",
"text",
",",
"expectedMinimumNumberOfMatches",
",",
"timeout",
",",
"true",
")",
";",
"}"
] | Waits for a text to be shown.
@param text the text that needs to be shown, specified as a regular expression
@param expectedMinimumNumberOfMatches the minimum number of matches of text that must be shown. {@code 0} means any number of matches
@param timeout the amount of time in milliseconds to wait
@return {@code tru... | [
"Waits",
"for",
"a",
"text",
"to",
"be",
"shown",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L552-L555 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/api/Table.java | Table.xTabTablePercents | public Table xTabTablePercents(String column1Name, String column2Name) {
"""
Returns a table with n by m + 1 cells. The first column contains labels, the other cells contains the proportion
for a unique combination of values from the two specified columns in this table
"""
return CrossTab.tablePercent... | java | public Table xTabTablePercents(String column1Name, String column2Name) {
return CrossTab.tablePercents(this, column1Name, column2Name);
} | [
"public",
"Table",
"xTabTablePercents",
"(",
"String",
"column1Name",
",",
"String",
"column2Name",
")",
"{",
"return",
"CrossTab",
".",
"tablePercents",
"(",
"this",
",",
"column1Name",
",",
"column2Name",
")",
";",
"}"
] | Returns a table with n by m + 1 cells. The first column contains labels, the other cells contains the proportion
for a unique combination of values from the two specified columns in this table | [
"Returns",
"a",
"table",
"with",
"n",
"by",
"m",
"+",
"1",
"cells",
".",
"The",
"first",
"column",
"contains",
"labels",
"the",
"other",
"cells",
"contains",
"the",
"proportion",
"for",
"a",
"unique",
"combination",
"of",
"values",
"from",
"the",
"two",
... | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/api/Table.java#L939-L941 |
atomix/atomix | utils/src/main/java/io/atomix/utils/Generics.java | Generics.getGenericClassType | public static Type getGenericClassType(Object instance, Class<?> clazz, int position) {
"""
Returns the generic type at the given position for the given class.
@param instance the implementing instance
@param clazz the generic class
@param position the generic position
@return the generic type at the give... | java | public static Type getGenericClassType(Object instance, Class<?> clazz, int position) {
Class<?> type = instance.getClass();
while (type != Object.class) {
if (type.getGenericSuperclass() instanceof ParameterizedType) {
ParameterizedType genericSuperclass = (ParameterizedType) type.getGenericSuper... | [
"public",
"static",
"Type",
"getGenericClassType",
"(",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"int",
"position",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"while",
"(",
"type",... | Returns the generic type at the given position for the given class.
@param instance the implementing instance
@param clazz the generic class
@param position the generic position
@return the generic type at the given position | [
"Returns",
"the",
"generic",
"type",
"at",
"the",
"given",
"position",
"for",
"the",
"given",
"class",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/Generics.java#L34-L49 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionParser.java | SuppressionParser.parseSuppressionRules | public List<SuppressionRule> parseSuppressionRules(InputStream inputStream) throws SuppressionParseException, SAXException {
"""
Parses the given XML stream and returns a list of the suppression rules
contained.
@param inputStream an InputStream containing suppression rules
@return a list of suppression rules... | java | public List<SuppressionRule> parseSuppressionRules(InputStream inputStream) throws SuppressionParseException, SAXException {
try (
InputStream schemaStream12 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_2);
InputStream schemaStream11 = FileUtils.getResourceAsStream(SUPPRE... | [
"public",
"List",
"<",
"SuppressionRule",
">",
"parseSuppressionRules",
"(",
"InputStream",
"inputStream",
")",
"throws",
"SuppressionParseException",
",",
"SAXException",
"{",
"try",
"(",
"InputStream",
"schemaStream12",
"=",
"FileUtils",
".",
"getResourceAsStream",
"(... | Parses the given XML stream and returns a list of the suppression rules
contained.
@param inputStream an InputStream containing suppression rules
@return a list of suppression rules
@throws SuppressionParseException thrown if the XML cannot be parsed
@throws SAXException thrown if the XML cannot be parsed | [
"Parses",
"the",
"given",
"XML",
"stream",
"and",
"returns",
"a",
"list",
"of",
"the",
"suppression",
"rules",
"contained",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionParser.java#L95-L124 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/locale/Locale.java | Locale.getString | public static String getString(String key, Object... params) {
"""
Replies the text that corresponds to the specified resource.
<p>This function assumes the classname of the caller as the
resource provider.
@param key is the name of the resource into the specified file
@param params is the the list of para... | java | public static String getString(String key, Object... params) {
final Class<?> resource = detectResourceClass(null);
return getString(ClassLoaderFinder.findClassLoader(), resource, key, params);
} | [
"public",
"static",
"String",
"getString",
"(",
"String",
"key",
",",
"Object",
"...",
"params",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"resource",
"=",
"detectResourceClass",
"(",
"null",
")",
";",
"return",
"getString",
"(",
"ClassLoaderFinder",
".",
... | Replies the text that corresponds to the specified resource.
<p>This function assumes the classname of the caller as the
resource provider.
@param key is the name of the resource into the specified file
@param params is the the list of parameters which will
replaces the <code>#1</code>, <code>#2</code>... into the st... | [
"Replies",
"the",
"text",
"that",
"corresponds",
"to",
"the",
"specified",
"resource",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/locale/Locale.java#L309-L312 |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java | GraphPath.splitAt | public GP splitAt(ST obj, PT startPoint) {
"""
Split this path and retains the first part of the
part in this object and reply the second part.
The first occurrence of this specified element
will be in the second part.
<p>This function removes until the <i>last occurence</i>
of the given object.
@param o... | java | public GP splitAt(ST obj, PT startPoint) {
return splitAt(indexOf(obj, startPoint), true);
} | [
"public",
"GP",
"splitAt",
"(",
"ST",
"obj",
",",
"PT",
"startPoint",
")",
"{",
"return",
"splitAt",
"(",
"indexOf",
"(",
"obj",
",",
"startPoint",
")",
",",
"true",
")",
";",
"}"
] | Split this path and retains the first part of the
part in this object and reply the second part.
The first occurrence of this specified element
will be in the second part.
<p>This function removes until the <i>last occurence</i>
of the given object.
@param obj the reference segment.
@param startPoint is the starting ... | [
"Split",
"this",
"path",
"and",
"retains",
"the",
"first",
"part",
"of",
"the",
"part",
"in",
"this",
"object",
"and",
"reply",
"the",
"second",
"part",
".",
"The",
"first",
"occurrence",
"of",
"this",
"specified",
"element",
"will",
"be",
"in",
"the",
"... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java#L1130-L1132 |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/TimebasedOrderFilter.java | TimebasedOrderFilter.addId | public static void addId(Entry entry, boolean updateRdn) {
"""
Adds a timebased uuid to entry. If updateRdn is true, the uuid becomes the rdn. Use this to handle duplicates.
"""
String uuid = newUUID().toString();
try {
entry.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, UNIQUE_OBJECT... | java | public static void addId(Entry entry, boolean updateRdn) {
String uuid = newUUID().toString();
try {
entry.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, UNIQUE_OBJECT_OC);
entry.add(ID_ATTRIBUTE, uuid);
} catch (LdapException e) {
throw new LdapRuntimeException(... | [
"public",
"static",
"void",
"addId",
"(",
"Entry",
"entry",
",",
"boolean",
"updateRdn",
")",
"{",
"String",
"uuid",
"=",
"newUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"try",
"{",
"entry",
".",
"add",
"(",
"SchemaConstants",
".",
"OBJECT_CLASS_ATT... | Adds a timebased uuid to entry. If updateRdn is true, the uuid becomes the rdn. Use this to handle duplicates. | [
"Adds",
"a",
"timebased",
"uuid",
"to",
"entry",
".",
"If",
"updateRdn",
"is",
"true",
"the",
"uuid",
"becomes",
"the",
"rdn",
".",
"Use",
"this",
"to",
"handle",
"duplicates",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/TimebasedOrderFilter.java#L57-L69 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/IntArray.java | IntArray.getInstance | public static IntArray getInstance(int[] buffer, int offset, int length) {
"""
Creates IntArray backed by int array
@param buffer
@param offset
@param length
@return
"""
return getInstance(IntBuffer.wrap(buffer, offset, length));
} | java | public static IntArray getInstance(int[] buffer, int offset, int length)
{
return getInstance(IntBuffer.wrap(buffer, offset, length));
} | [
"public",
"static",
"IntArray",
"getInstance",
"(",
"int",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"return",
"getInstance",
"(",
"IntBuffer",
".",
"wrap",
"(",
"buffer",
",",
"offset",
",",
"length",
")",
")",
";",
"}"... | Creates IntArray backed by int array
@param buffer
@param offset
@param length
@return | [
"Creates",
"IntArray",
"backed",
"by",
"int",
"array"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/IntArray.java#L137-L140 |
finmath/finmath-lib | src/main/java6/net/finmath/marketdata/model/curves/ForwardCurve.java | ForwardCurve.createForwardCurveFromForwards | public static ForwardCurve createForwardCurveFromForwards(String name, Date referenceDate, String paymentOffsetCode,
BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention,
InterpolationMethod interpolationMethod, ExtrapolationMethod extr... | java | public static ForwardCurve createForwardCurveFromForwards(String name, Date referenceDate, String paymentOffsetCode,
BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention,
InterpolationMethod interpolationMethod, ExtrapolationMethod extr... | [
"public",
"static",
"ForwardCurve",
"createForwardCurveFromForwards",
"(",
"String",
"name",
",",
"Date",
"referenceDate",
",",
"String",
"paymentOffsetCode",
",",
"BusinessdayCalendarInterface",
"paymentBusinessdayCalendar",
",",
"BusinessdayCalendarInterface",
".",
"DateRollC... | Create a forward curve from given times and given forwards.
@param name The name of this curve.
@param referenceDate The reference date for this code, i.e., the date which defines t=0.
@param paymentOffsetCode The maturity of the index modeled by this curve.
@param paymentBusinessdayCalendar The business day calendar ... | [
"Create",
"a",
"forward",
"curve",
"from",
"given",
"times",
"and",
"given",
"forwards",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/model/curves/ForwardCurve.java#L169-L176 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ListTemplateElementBuilder.java | ListTemplateElementBuilder.addUrlButton | public ListTemplateElementBuilder addUrlButton(String title, String url) {
"""
Adds a button which redirects to an URL when clicked to the current
{@link ListTemplateElement}. There can be at most 3 buttons per element.
@param title
the button label.
@param url
the URL to whom redirect when clicked.
@retur... | java | public ListTemplateElementBuilder addUrlButton(String title, String url) {
Button button = ButtonFactory.createUrlButton(title, url);
this.element.addButton(button);
return this;
} | [
"public",
"ListTemplateElementBuilder",
"addUrlButton",
"(",
"String",
"title",
",",
"String",
"url",
")",
"{",
"Button",
"button",
"=",
"ButtonFactory",
".",
"createUrlButton",
"(",
"title",
",",
"url",
")",
";",
"this",
".",
"element",
".",
"addButton",
"(",... | Adds a button which redirects to an URL when clicked to the current
{@link ListTemplateElement}. There can be at most 3 buttons per element.
@param title
the button label.
@param url
the URL to whom redirect when clicked.
@return this builder. | [
"Adds",
"a",
"button",
"which",
"redirects",
"to",
"an",
"URL",
"when",
"clicked",
"to",
"the",
"current",
"{",
"@link",
"ListTemplateElement",
"}",
".",
"There",
"can",
"be",
"at",
"most",
"3",
"buttons",
"per",
"element",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ListTemplateElementBuilder.java#L111-L115 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/sections/SectionLoader.java | SectionLoader.fileSizeAdjusted | private long fileSizeAdjusted(long alignedPointerToRaw, long readSize) {
"""
Adjusts the readsize of a section to the size of the file.
@param alignedPointerToRaw
the file offset of the start of the section
@param readSize
the determined readsize without file adjustments
@return adjusted readsize
"""
... | java | private long fileSizeAdjusted(long alignedPointerToRaw, long readSize) {
// end of section outside the file --> cut at file.length()
if (readSize + alignedPointerToRaw > file.length()) {
readSize = file.length() - alignedPointerToRaw;
}
// start of section outside the file --... | [
"private",
"long",
"fileSizeAdjusted",
"(",
"long",
"alignedPointerToRaw",
",",
"long",
"readSize",
")",
"{",
"// end of section outside the file --> cut at file.length()",
"if",
"(",
"readSize",
"+",
"alignedPointerToRaw",
">",
"file",
".",
"length",
"(",
")",
")",
"... | Adjusts the readsize of a section to the size of the file.
@param alignedPointerToRaw
the file offset of the start of the section
@param readSize
the determined readsize without file adjustments
@return adjusted readsize | [
"Adjusts",
"the",
"readsize",
"of",
"a",
"section",
"to",
"the",
"size",
"of",
"the",
"file",
"."
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/sections/SectionLoader.java#L249-L260 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/OJBSearchFilter.java | OJBSearchFilter.matchList | public void matchList(String elementName, String[] values, int oper) {
"""
Change the search filter to one that specifies an element to not
match one of a list of values.
The old search filter is deleted.
@param elementName is the name of the element to be matched
@param values is an array of possible matche... | java | public void matchList(String elementName, String[] values, int oper)
{
// see also matchList(String elementName, Vector values, int oper)
// Delete the old search criteria
criteria = new Criteria();
if (oper != NOT_IN)
{
for (int i = 0; i < values.lengt... | [
"public",
"void",
"matchList",
"(",
"String",
"elementName",
",",
"String",
"[",
"]",
"values",
",",
"int",
"oper",
")",
"{",
"// see also matchList(String elementName, Vector values, int oper)\r",
"// Delete the old search criteria\r",
"criteria",
"=",
"new",
"Criteria",
... | Change the search filter to one that specifies an element to not
match one of a list of values.
The old search filter is deleted.
@param elementName is the name of the element to be matched
@param values is an array of possible matches
@param oper is the IN or NOT_IN operator to indicate how to matche | [
"Change",
"the",
"search",
"filter",
"to",
"one",
"that",
"specifies",
"an",
"element",
"to",
"not",
"match",
"one",
"of",
"a",
"list",
"of",
"values",
".",
"The",
"old",
"search",
"filter",
"is",
"deleted",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/OJBSearchFilter.java#L86-L110 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ProfileServiceClient.java | ProfileServiceClient.createProfile | public final Profile createProfile(TenantName parent, Profile profile) {
"""
Creates and returns a new profile.
<p>Sample code:
<pre><code>
try (ProfileServiceClient profileServiceClient = ProfileServiceClient.create()) {
TenantName parent = TenantName.of("[PROJECT]", "[TENANT]");
Profile profile = Profil... | java | public final Profile createProfile(TenantName parent, Profile profile) {
CreateProfileRequest request =
CreateProfileRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setProfile(profile)
.build();
return createProfile(request);
} | [
"public",
"final",
"Profile",
"createProfile",
"(",
"TenantName",
"parent",
",",
"Profile",
"profile",
")",
"{",
"CreateProfileRequest",
"request",
"=",
"CreateProfileRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"==",
"null",
"?",
"nul... | Creates and returns a new profile.
<p>Sample code:
<pre><code>
try (ProfileServiceClient profileServiceClient = ProfileServiceClient.create()) {
TenantName parent = TenantName.of("[PROJECT]", "[TENANT]");
Profile profile = Profile.newBuilder().build();
Profile response = profileServiceClient.createProfile(parent, pro... | [
"Creates",
"and",
"returns",
"a",
"new",
"profile",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ProfileServiceClient.java#L317-L325 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.