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 |
|---|---|---|---|---|---|---|---|---|---|---|
MenoData/Time4J | base/src/main/java/net/time4j/calendar/astro/SolarTime.java | SolarTime.ofLocation | public static SolarTime ofLocation(
double latitude,
double longitude,
int altitude,
String calculator
) {
"""
/*[deutsch]
<p>Liefert die Sonnenzeit zur angegebenen geographischen Position. </p>
<p>Diese Methode nimmt geographische Angaben nur in Dezimalgrad entgegen. Wenn d... | java | public static SolarTime ofLocation(
double latitude,
double longitude,
int altitude,
String calculator
) {
check(latitude, longitude, altitude, calculator);
return new SolarTime(latitude, longitude, altitude, calculator, null);
} | [
"public",
"static",
"SolarTime",
"ofLocation",
"(",
"double",
"latitude",
",",
"double",
"longitude",
",",
"int",
"altitude",
",",
"String",
"calculator",
")",
"{",
"check",
"(",
"latitude",
",",
"longitude",
",",
"altitude",
",",
"calculator",
")",
";",
"re... | /*[deutsch]
<p>Liefert die Sonnenzeit zur angegebenen geographischen Position. </p>
<p>Diese Methode nimmt geographische Angaben nur in Dezimalgrad entgegen. Wenn diese Daten aber
in Grad, Bogenminuten und Bogensekunden vorliegen, sollten Anwender den {@link #ofLocation() Builder-Ansatz}
bevorzugen. </p>
@param lat... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Liefert",
"die",
"Sonnenzeit",
"zur",
"angegebenen",
"geographischen",
"Position",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/astro/SolarTime.java#L400-L410 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getLastToken | @Nullable
public static String getLastToken (@Nullable final String sStr, @Nullable final String sSearch) {
"""
Get the last token from (and excluding) the separating string.
@param sStr
The string to search. May be <code>null</code>.
@param sSearch
The search string. May be <code>null</code>.
@return The... | java | @Nullable
public static String getLastToken (@Nullable final String sStr, @Nullable final String sSearch)
{
if (StringHelper.hasNoText (sSearch))
return sStr;
final int nIndex = getLastIndexOf (sStr, sSearch);
return nIndex == StringHelper.STRING_NOT_FOUND ? sStr : sStr.substring (nIndex + getLeng... | [
"@",
"Nullable",
"public",
"static",
"String",
"getLastToken",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sSearch",
")",
")",
"return",
"... | Get the last token from (and excluding) the separating string.
@param sStr
The string to search. May be <code>null</code>.
@param sSearch
The search string. May be <code>null</code>.
@return The passed string if no such separator token was found. | [
"Get",
"the",
"last",
"token",
"from",
"(",
"and",
"excluding",
")",
"the",
"separating",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5154-L5161 |
lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java | ASMUtil.toType | public static Type toType(String cfType, boolean axistype) throws PageException {
"""
translate a string cfml type definition to a Type Object
@param cfType
@param axistype
@return
@throws PageException
"""
return toType(Caster.cfTypeToClass(cfType), axistype);
} | java | public static Type toType(String cfType, boolean axistype) throws PageException {
return toType(Caster.cfTypeToClass(cfType), axistype);
} | [
"public",
"static",
"Type",
"toType",
"(",
"String",
"cfType",
",",
"boolean",
"axistype",
")",
"throws",
"PageException",
"{",
"return",
"toType",
"(",
"Caster",
".",
"cfTypeToClass",
"(",
"cfType",
")",
",",
"axistype",
")",
";",
"}"
] | translate a string cfml type definition to a Type Object
@param cfType
@param axistype
@return
@throws PageException | [
"translate",
"a",
"string",
"cfml",
"type",
"definition",
"to",
"a",
"Type",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java#L646-L648 |
dmerkushov/log-helper | src/main/java/ru/dmerkushov/loghelper/LogHelperDebug.java | LogHelperDebug.printMessage | public static void printMessage (String message, boolean force) {
"""
Print a message to <code>System.out</code>, with an every-line prefix: "log-helper DEBUG: "
@param message
@param force <code>true</code> if we need to override the debug enabled flag (i.e. the message is REALLY important), <code>false</code> ... | java | public static void printMessage (String message, boolean force) {
if (isDebugEnabled () || force) {
String toOutput = "log-helper DEBUG: " + message.replaceAll ("\n", "\nlog-helper DEBUG: ");
System.out.println (toOutput);
}
} | [
"public",
"static",
"void",
"printMessage",
"(",
"String",
"message",
",",
"boolean",
"force",
")",
"{",
"if",
"(",
"isDebugEnabled",
"(",
")",
"||",
"force",
")",
"{",
"String",
"toOutput",
"=",
"\"log-helper DEBUG: \"",
"+",
"message",
".",
"replaceAll",
"... | Print a message to <code>System.out</code>, with an every-line prefix: "log-helper DEBUG: "
@param message
@param force <code>true</code> if we need to override the debug enabled flag (i.e. the message is REALLY important), <code>false</code> otherwise | [
"Print",
"a",
"message",
"to",
"<code",
">",
"System",
".",
"out<",
"/",
"code",
">",
"with",
"an",
"every",
"-",
"line",
"prefix",
":",
"log",
"-",
"helper",
"DEBUG",
":"
] | train | https://github.com/dmerkushov/log-helper/blob/3b7d3d30faa7f1437b27cd07c10fa579a995de23/src/main/java/ru/dmerkushov/loghelper/LogHelperDebug.java#L52-L57 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysInner.java | APIKeysInner.listAsync | public Observable<List<ApplicationInsightsComponentAPIKeyInner>> listAsync(String resourceGroupName, String resourceName) {
"""
Gets a list of API keys of an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights compone... | java | public Observable<List<ApplicationInsightsComponentAPIKeyInner>> listAsync(String resourceGroupName, String resourceName) {
return listWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<List<ApplicationInsightsComponentAPIKeyInner>>, List<ApplicationInsightsComponentAPIKeyIn... | [
"public",
"Observable",
"<",
"List",
"<",
"ApplicationInsightsComponentAPIKeyInner",
">",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName"... | Gets a list of API keys of an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<Application... | [
"Gets",
"a",
"list",
"of",
"API",
"keys",
"of",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/APIKeysInner.java#L113-L120 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckJSDoc.java | CheckJSDoc.validateClassLevelJsDoc | private void validateClassLevelJsDoc(Node n, JSDocInfo info) {
"""
Checks that class-level annotations like @interface/@extends are not used on member functions.
"""
if (info != null && n.isMemberFunctionDef()
&& hasClassLevelJsDoc(info)) {
report(n, DISALLOWED_MEMBER_JSDOC);
}
} | java | private void validateClassLevelJsDoc(Node n, JSDocInfo info) {
if (info != null && n.isMemberFunctionDef()
&& hasClassLevelJsDoc(info)) {
report(n, DISALLOWED_MEMBER_JSDOC);
}
} | [
"private",
"void",
"validateClassLevelJsDoc",
"(",
"Node",
"n",
",",
"JSDocInfo",
"info",
")",
"{",
"if",
"(",
"info",
"!=",
"null",
"&&",
"n",
".",
"isMemberFunctionDef",
"(",
")",
"&&",
"hasClassLevelJsDoc",
"(",
"info",
")",
")",
"{",
"report",
"(",
"... | Checks that class-level annotations like @interface/@extends are not used on member functions. | [
"Checks",
"that",
"class",
"-",
"level",
"annotations",
"like"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckJSDoc.java#L310-L315 |
alkacon/opencms-core | src/org/opencms/workflow/CmsDefaultPublishResourceFormatter.java | CmsDefaultPublishResourceFormatter.getOuAwareName | public static String getOuAwareName(CmsObject cms, String name) {
"""
Returns the simple name if the ou is the same as the current user's ou.<p>
@param cms the CMS context
@param name the fully qualified name to check
@return the simple name if the ou is the same as the current user's ou
"""
St... | java | public static String getOuAwareName(CmsObject cms, String name) {
String ou = CmsOrganizationalUnit.getParentFqn(name);
if (ou.equals(cms.getRequestContext().getCurrentUser().getOuFqn())) {
return CmsOrganizationalUnit.getSimpleName(name);
}
return CmsOrganizationalUnit.SEPA... | [
"public",
"static",
"String",
"getOuAwareName",
"(",
"CmsObject",
"cms",
",",
"String",
"name",
")",
"{",
"String",
"ou",
"=",
"CmsOrganizationalUnit",
".",
"getParentFqn",
"(",
"name",
")",
";",
"if",
"(",
"ou",
".",
"equals",
"(",
"cms",
".",
"getRequest... | Returns the simple name if the ou is the same as the current user's ou.<p>
@param cms the CMS context
@param name the fully qualified name to check
@return the simple name if the ou is the same as the current user's ou | [
"Returns",
"the",
"simple",
"name",
"if",
"the",
"ou",
"is",
"the",
"same",
"as",
"the",
"current",
"user",
"s",
"ou",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workflow/CmsDefaultPublishResourceFormatter.java#L324-L331 |
xqbase/tuna | core/src/main/java/com/xqbase/tuna/ConnectionFilter.java | ConnectionFilter.send | @Override
public void send(byte[] b, int off, int len) {
"""
Wraps sent data, from the application side to the network side
"""
handler.send(b, off, len);
} | java | @Override
public void send(byte[] b, int off, int len) {
handler.send(b, off, len);
} | [
"@",
"Override",
"public",
"void",
"send",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"handler",
".",
"send",
"(",
"b",
",",
"off",
",",
"len",
")",
";",
"}"
] | Wraps sent data, from the application side to the network side | [
"Wraps",
"sent",
"data",
"from",
"the",
"application",
"side",
"to",
"the",
"network",
"side"
] | train | https://github.com/xqbase/tuna/blob/60d05a9e03877a3daafe9de83dc4427c6cbb9995/core/src/main/java/com/xqbase/tuna/ConnectionFilter.java#L28-L31 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/GenericLogicDiscoverer.java | GenericLogicDiscoverer.findServicesClassifiedBySome | @Override
public Map<URI, MatchResult> findServicesClassifiedBySome(Set<URI> modelReferences) {
"""
Discover the services that are classified by some (i.e., at least one) of the types given. That is, all those
that have some level of matching with respect to at least one entity provided in the model reference... | java | @Override
public Map<URI, MatchResult> findServicesClassifiedBySome(Set<URI> modelReferences) {
return findServicesClassifiedBySome(modelReferences, LogicConceptMatchType.Plugin);
} | [
"@",
"Override",
"public",
"Map",
"<",
"URI",
",",
"MatchResult",
">",
"findServicesClassifiedBySome",
"(",
"Set",
"<",
"URI",
">",
"modelReferences",
")",
"{",
"return",
"findServicesClassifiedBySome",
"(",
"modelReferences",
",",
"LogicConceptMatchType",
".",
"Plu... | Discover the services that are classified by some (i.e., at least one) of the types given. That is, all those
that have some level of matching with respect to at least one entity provided in the model references.
@param modelReferences the classifications to match against
@return a Set containing all the matching serv... | [
"Discover",
"the",
"services",
"that",
"are",
"classified",
"by",
"some",
"(",
"i",
".",
"e",
".",
"at",
"least",
"one",
")",
"of",
"the",
"types",
"given",
".",
"That",
"is",
"all",
"those",
"that",
"have",
"some",
"level",
"of",
"matching",
"with",
... | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/GenericLogicDiscoverer.java#L452-L455 |
thorntail/thorntail | fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/JWTAuthMethodExtension.java | JWTAuthMethodExtension.handleDeployment | @Override
public void handleDeployment(DeploymentInfo deploymentInfo, ServletContext servletContext) {
"""
This registers the JWTAuthMechanismFactory under the "MP-JWT" mechanism name
@param deploymentInfo - the deployment to augment
@param servletContext - the ServletContext for the deployment
"""
... | java | @Override
public void handleDeployment(DeploymentInfo deploymentInfo, ServletContext servletContext) {
deploymentInfo.addAuthenticationMechanism("MP-JWT", new JWTAuthMechanismFactory());
deploymentInfo.addInnerHandlerChainWrapper(MpJwtPrincipalHandler::new);
} | [
"@",
"Override",
"public",
"void",
"handleDeployment",
"(",
"DeploymentInfo",
"deploymentInfo",
",",
"ServletContext",
"servletContext",
")",
"{",
"deploymentInfo",
".",
"addAuthenticationMechanism",
"(",
"\"MP-JWT\"",
",",
"new",
"JWTAuthMechanismFactory",
"(",
")",
")... | This registers the JWTAuthMechanismFactory under the "MP-JWT" mechanism name
@param deploymentInfo - the deployment to augment
@param servletContext - the ServletContext for the deployment | [
"This",
"registers",
"the",
"JWTAuthMechanismFactory",
"under",
"the",
"MP",
"-",
"JWT",
"mechanism",
"name"
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/microprofile/microprofile-jwt/src/main/java/org/wildfly/swarm/microprofile/jwtauth/deployment/auth/JWTAuthMethodExtension.java#L35-L39 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.beginCreateOrUpdateWorkerPoolAsync | public Observable<WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
"""
Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to wh... | java | public Observable<WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
return beginCreateOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).map(... | [
"public",
"Observable",
"<",
"WorkerPoolResourceInner",
">",
"beginCreateOrUpdateWorkerPoolAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"workerPoolName",
",",
"WorkerPoolResourceInner",
"workerPoolEnvelope",
")",
"{",
"return",
"beginCre... | Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@param workerPoolEnvelope Properties of the worker pool.
@throws IllegalArgu... | [
"Create",
"or",
"update",
"a",
"worker",
"pool",
".",
"Create",
"or",
"update",
"a",
"worker",
"pool",
"."
] | 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/AppServiceEnvironmentsInner.java#L5309-L5316 |
nantesnlp/uima-tokens-regex | src/main/java/fr/univnantes/lina/uima/tkregex/model/automata/AutomatonInstance.java | AutomatonInstance.doClone | public AutomatonInstance doClone() {
"""
Creates a clone of the current automatonEng instance for
iteration alternative purposes.
@return
"""
AutomatonInstance clone = new AutomatonInstance(this.automatonEng, this.current, this.instanceId, this.safeGuard);
clone.failed = this.failed;
clone.transitionCo... | java | public AutomatonInstance doClone() {
AutomatonInstance clone = new AutomatonInstance(this.automatonEng, this.current, this.instanceId, this.safeGuard);
clone.failed = this.failed;
clone.transitionCount = this.transitionCount;
clone.failCount = this.failCount;
clone.iterateCount = this.iterateCount;
clone.ba... | [
"public",
"AutomatonInstance",
"doClone",
"(",
")",
"{",
"AutomatonInstance",
"clone",
"=",
"new",
"AutomatonInstance",
"(",
"this",
".",
"automatonEng",
",",
"this",
".",
"current",
",",
"this",
".",
"instanceId",
",",
"this",
".",
"safeGuard",
")",
";",
"c... | Creates a clone of the current automatonEng instance for
iteration alternative purposes.
@return | [
"Creates",
"a",
"clone",
"of",
"the",
"current",
"automatonEng",
"instance",
"for",
"iteration",
"alternative",
"purposes",
"."
] | train | https://github.com/nantesnlp/uima-tokens-regex/blob/15c97c09007af9c33c7bddf8e74d5829d04623e2/src/main/java/fr/univnantes/lina/uima/tkregex/model/automata/AutomatonInstance.java#L74-L86 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readIdForUrlName | public CmsUUID readIdForUrlName(CmsDbContext dbc, String name) throws CmsDataAccessException {
"""
Reads the structure id which is mapped to a given URL name.<p>
@param dbc the current database context
@param name the name for which the mapped structure id should be looked up
@return the structure id which ... | java | public CmsUUID readIdForUrlName(CmsDbContext dbc, String name) throws CmsDataAccessException {
List<CmsUrlNameMappingEntry> entries = getVfsDriver(dbc).readUrlNameMappingEntries(
dbc,
dbc.currentProject().isOnlineProject(),
CmsUrlNameMappingFilter.ALL.filterName(name));
... | [
"public",
"CmsUUID",
"readIdForUrlName",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"name",
")",
"throws",
"CmsDataAccessException",
"{",
"List",
"<",
"CmsUrlNameMappingEntry",
">",
"entries",
"=",
"getVfsDriver",
"(",
"dbc",
")",
".",
"readUrlNameMappingEntries",
"... | Reads the structure id which is mapped to a given URL name.<p>
@param dbc the current database context
@param name the name for which the mapped structure id should be looked up
@return the structure id which is mapped to the given name, or null if there is no such id
@throws CmsDataAccessException if something goes... | [
"Reads",
"the",
"structure",
"id",
"which",
"is",
"mapped",
"to",
"a",
"given",
"URL",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L7014-L7024 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.endOfWeek | public static Calendar endOfWeek(Calendar calendar, boolean isSundayAsLastDay) {
"""
获取某周的结束时间
@param calendar 日期 {@link Calendar}
@param isSundayAsLastDay 是否周日做为一周的最后一天(false表示周六做为最后一天)
@return {@link Calendar}
@since 3.1.2
"""
if(isSundayAsLastDay) {
calendar.setFirstDayOfWeek(Calendar.MONDAY);
... | java | public static Calendar endOfWeek(Calendar calendar, boolean isSundayAsLastDay) {
if(isSundayAsLastDay) {
calendar.setFirstDayOfWeek(Calendar.MONDAY);
}
return ceiling(calendar, DateField.WEEK_OF_MONTH);
} | [
"public",
"static",
"Calendar",
"endOfWeek",
"(",
"Calendar",
"calendar",
",",
"boolean",
"isSundayAsLastDay",
")",
"{",
"if",
"(",
"isSundayAsLastDay",
")",
"{",
"calendar",
".",
"setFirstDayOfWeek",
"(",
"Calendar",
".",
"MONDAY",
")",
";",
"}",
"return",
"c... | 获取某周的结束时间
@param calendar 日期 {@link Calendar}
@param isSundayAsLastDay 是否周日做为一周的最后一天(false表示周六做为最后一天)
@return {@link Calendar}
@since 3.1.2 | [
"获取某周的结束时间"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L922-L927 |
opendigitaleducation/web-utils | src/main/java/org/vertx/java/core/http/RouteMatcher.java | RouteMatcher.connectWithRegEx | public RouteMatcher connectWithRegEx(String regex, Handler<HttpServerRequest> handler) {
"""
Specify a handler that will be called for a matching HTTP CONNECT
@param regex A regular expression
@param handler The handler to call
"""
addRegEx(regex, handler, connectBindings);
return this;
} | java | public RouteMatcher connectWithRegEx(String regex, Handler<HttpServerRequest> handler) {
addRegEx(regex, handler, connectBindings);
return this;
} | [
"public",
"RouteMatcher",
"connectWithRegEx",
"(",
"String",
"regex",
",",
"Handler",
"<",
"HttpServerRequest",
">",
"handler",
")",
"{",
"addRegEx",
"(",
"regex",
",",
"handler",
",",
"connectBindings",
")",
";",
"return",
"this",
";",
"}"
] | Specify a handler that will be called for a matching HTTP CONNECT
@param regex A regular expression
@param handler The handler to call | [
"Specify",
"a",
"handler",
"that",
"will",
"be",
"called",
"for",
"a",
"matching",
"HTTP",
"CONNECT"
] | train | https://github.com/opendigitaleducation/web-utils/blob/5c12f7e8781a9a0fbbe7b8d9fb741627aa97a1e3/src/main/java/org/vertx/java/core/http/RouteMatcher.java#L279-L282 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java | LicenseClient.insertLicense | @BetaApi
public final Operation insertLicense(ProjectName project, License licenseResource) {
"""
Create a License resource in the specified project.
<p>Sample code:
<pre><code>
try (LicenseClient licenseClient = LicenseClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
License licens... | java | @BetaApi
public final Operation insertLicense(ProjectName project, License licenseResource) {
InsertLicenseHttpRequest request =
InsertLicenseHttpRequest.newBuilder()
.setProject(project == null ? null : project.toString())
.setLicenseResource(licenseResource)
.build()... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertLicense",
"(",
"ProjectName",
"project",
",",
"License",
"licenseResource",
")",
"{",
"InsertLicenseHttpRequest",
"request",
"=",
"InsertLicenseHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setProject",
"(",
... | Create a License resource in the specified project.
<p>Sample code:
<pre><code>
try (LicenseClient licenseClient = LicenseClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
License licenseResource = License.newBuilder().build();
Operation response = licenseClient.insertLicense(project, licenseResou... | [
"Create",
"a",
"License",
"resource",
"in",
"the",
"specified",
"project",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/LicenseClient.java#L466-L475 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/json/JsonObject.java | JsonObject.getString | public String getString(String name, String defaultValue) {
"""
Returns the <code>String</code> value of the member with the specified name in this object. If
this object does not contain a member with this name, the given default value is returned. If
this object contains multiple members with the given name, t... | java | public String getString(String name, String defaultValue) {
JsonValue value = get(name);
return value != null ? value.asString() : defaultValue;
} | [
"public",
"String",
"getString",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"JsonValue",
"value",
"=",
"get",
"(",
"name",
")",
";",
"return",
"value",
"!=",
"null",
"?",
"value",
".",
"asString",
"(",
")",
":",
"defaultValue",
";",
... | Returns the <code>String</code> value of the member with the specified name in this object. If
this object does not contain a member with this name, the given default value is returned. If
this object contains multiple members with the given name, the last one is picked. If this
member's value does not represent a JSON... | [
"Returns",
"the",
"<code",
">",
"String<",
"/",
"code",
">",
"value",
"of",
"the",
"member",
"with",
"the",
"specified",
"name",
"in",
"this",
"object",
".",
"If",
"this",
"object",
"does",
"not",
"contain",
"a",
"member",
"with",
"this",
"name",
"the",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonObject.java#L675-L678 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/toolbar/CmsSitemapToolbar.java | CmsSitemapToolbar.setClipboardEnabled | public void setClipboardEnabled(boolean enabled, String disabledReason) {
"""
Enables/disables the new clipboard button.<p>
@param enabled <code>true</code> to enable the button
@param disabledReason the reason, why the button is disabled
"""
if (m_clipboardButton != null) {
if (enable... | java | public void setClipboardEnabled(boolean enabled, String disabledReason) {
if (m_clipboardButton != null) {
if (enabled) {
m_clipboardButton.enable();
} else {
m_clipboardButton.disable(disabledReason);
}
}
} | [
"public",
"void",
"setClipboardEnabled",
"(",
"boolean",
"enabled",
",",
"String",
"disabledReason",
")",
"{",
"if",
"(",
"m_clipboardButton",
"!=",
"null",
")",
"{",
"if",
"(",
"enabled",
")",
"{",
"m_clipboardButton",
".",
"enable",
"(",
")",
";",
"}",
"... | Enables/disables the new clipboard button.<p>
@param enabled <code>true</code> to enable the button
@param disabledReason the reason, why the button is disabled | [
"Enables",
"/",
"disables",
"the",
"new",
"clipboard",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/toolbar/CmsSitemapToolbar.java#L192-L201 |
craftercms/core | src/main/java/org/craftercms/core/xml/mergers/impl/resolvers/DescriptorMergeStrategyResolverChain.java | DescriptorMergeStrategyResolverChain.getStrategy | public DescriptorMergeStrategy getStrategy(String descriptorUrl, Document descriptorDom) {
"""
Returns the first non-null strategy returned by a {@link DescriptorMergeStrategyResolver} of the chain.
If there a no resolvers in the chain, or non of resolvers returns a {@link DescriptorMergeStrategy}, a
default str... | java | public DescriptorMergeStrategy getStrategy(String descriptorUrl, Document descriptorDom) {
DescriptorMergeStrategy strategy;
if (CollectionUtils.isNotEmpty(resolvers)) {
for (DescriptorMergeStrategyResolver resolver : resolvers) {
strategy = resolver.getStrategy(descriptorUr... | [
"public",
"DescriptorMergeStrategy",
"getStrategy",
"(",
"String",
"descriptorUrl",
",",
"Document",
"descriptorDom",
")",
"{",
"DescriptorMergeStrategy",
"strategy",
";",
"if",
"(",
"CollectionUtils",
".",
"isNotEmpty",
"(",
"resolvers",
")",
")",
"{",
"for",
"(",
... | Returns the first non-null strategy returned by a {@link DescriptorMergeStrategyResolver} of the chain.
If there a no resolvers in the chain, or non of resolvers returns a {@link DescriptorMergeStrategy}, a
default strategy is returned.
@param descriptorUrl the URL that identifies the descriptor
@param descriptorDom t... | [
"Returns",
"the",
"first",
"non",
"-",
"null",
"strategy",
"returned",
"by",
"a",
"{",
"@link",
"DescriptorMergeStrategyResolver",
"}",
"of",
"the",
"chain",
".",
"If",
"there",
"a",
"no",
"resolvers",
"in",
"the",
"chain",
"or",
"non",
"of",
"resolvers",
... | train | https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/xml/mergers/impl/resolvers/DescriptorMergeStrategyResolverChain.java#L57-L70 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/insight/InsightClient.java | InsightClient.getAdvancedNumberInsight | public AdvancedInsightResponse getAdvancedNumberInsight(String number, String country) throws IOException, NexmoClientException {
"""
Perform an Advanced Insight Request with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param count... | java | public AdvancedInsightResponse getAdvancedNumberInsight(String number, String country) throws IOException, NexmoClientException {
return getAdvancedNumberInsight(AdvancedInsightRequest.withNumberAndCountry(number, country));
} | [
"public",
"AdvancedInsightResponse",
"getAdvancedNumberInsight",
"(",
"String",
"number",
",",
"String",
"country",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getAdvancedNumberInsight",
"(",
"AdvancedInsightRequest",
".",
"withNumberAndCountry"... | Perform an Advanced Insight Request with a number and country.
@param number A single phone number that you need insight about in national or international format.
@param country If a number does not have a country code or it is uncertain, set the two-character country code.
@return A {@link AdvancedInsightResponse}... | [
"Perform",
"an",
"Advanced",
"Insight",
"Request",
"with",
"a",
"number",
"and",
"country",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L184-L186 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java | RegistriesInner.scheduleRun | public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) {
"""
Schedules a new run based on the request parameters and add it to the run queue.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name ... | java | public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) {
return scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).toBlocking().last().body();
} | [
"public",
"RunInner",
"scheduleRun",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RunRequest",
"runRequest",
")",
"{",
"return",
"scheduleRunWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"runRequest",
")",
"."... | Schedules a new run based on the request parameters and add it to the run queue.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param runRequest The parameters of a run that needs to scheduled.
@throws IllegalArg... | [
"Schedules",
"a",
"new",
"run",
"based",
"on",
"the",
"request",
"parameters",
"and",
"add",
"it",
"to",
"the",
"run",
"queue",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java#L1727-L1729 |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/MultipleAlignmentJmolDisplay.java | MultipleAlignmentJmolDisplay.showMultipleAligmentPanel | public static void showMultipleAligmentPanel(MultipleAlignment multAln,
AbstractAlignmentJmol jmol) throws StructureException {
"""
Creates a new Frame with the MultipleAlignment Sequence Panel.
The panel can communicate with the Jmol 3D visualization by
selecting the aligned residues of every structure.
@... | java | public static void showMultipleAligmentPanel(MultipleAlignment multAln,
AbstractAlignmentJmol jmol) throws StructureException {
MultipleAligPanel me = new MultipleAligPanel(multAln, jmol);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setTitle(jmol.getTitle());... | [
"public",
"static",
"void",
"showMultipleAligmentPanel",
"(",
"MultipleAlignment",
"multAln",
",",
"AbstractAlignmentJmol",
"jmol",
")",
"throws",
"StructureException",
"{",
"MultipleAligPanel",
"me",
"=",
"new",
"MultipleAligPanel",
"(",
"multAln",
",",
"jmol",
")",
... | Creates a new Frame with the MultipleAlignment Sequence Panel.
The panel can communicate with the Jmol 3D visualization by
selecting the aligned residues of every structure.
@param multAln
@param jmol
@throws StructureException | [
"Creates",
"a",
"new",
"Frame",
"with",
"the",
"MultipleAlignment",
"Sequence",
"Panel",
".",
"The",
"panel",
"can",
"communicate",
"with",
"the",
"Jmol",
"3D",
"visualization",
"by",
"selecting",
"the",
"aligned",
"residues",
"of",
"every",
"structure",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/MultipleAlignmentJmolDisplay.java#L105-L137 |
JOML-CI/JOML | src/org/joml/Quaternionf.java | Quaternionf.fromAxisAngleDeg | public Quaternionf fromAxisAngleDeg(Vector3fc axis, float angle) {
"""
Set this quaternion to be a representation of the supplied axis and
angle (in degrees).
@param axis
the rotation axis
@param angle
the angle in degrees
@return this
"""
return fromAxisAngleRad(axis.x(), axis.y(), axis.z(), (... | java | public Quaternionf fromAxisAngleDeg(Vector3fc axis, float angle) {
return fromAxisAngleRad(axis.x(), axis.y(), axis.z(), (float) Math.toRadians(angle));
} | [
"public",
"Quaternionf",
"fromAxisAngleDeg",
"(",
"Vector3fc",
"axis",
",",
"float",
"angle",
")",
"{",
"return",
"fromAxisAngleRad",
"(",
"axis",
".",
"x",
"(",
")",
",",
"axis",
".",
"y",
"(",
")",
",",
"axis",
".",
"z",
"(",
")",
",",
"(",
"float"... | Set this quaternion to be a representation of the supplied axis and
angle (in degrees).
@param axis
the rotation axis
@param angle
the angle in degrees
@return this | [
"Set",
"this",
"quaternion",
"to",
"be",
"a",
"representation",
"of",
"the",
"supplied",
"axis",
"and",
"angle",
"(",
"in",
"degrees",
")",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaternionf.java#L920-L922 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/Utils.java | Utils.fromJson | public static <T> T fromJson(String json, Class<T> klass) {
"""
Convert the given JSON string into an object using
<a href="https://github.com/google/gson">Gson</a>.
@param json
The input JSON.
@param klass
The class of the resultant object.
@return
A new object generated based on the input JSON.
@... | java | public static <T> T fromJson(String json, Class<T> klass)
{
return GSON.fromJson(json, klass);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJson",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"klass",
")",
"{",
"return",
"GSON",
".",
"fromJson",
"(",
"json",
",",
"klass",
")",
";",
"}"
] | Convert the given JSON string into an object using
<a href="https://github.com/google/gson">Gson</a>.
@param json
The input JSON.
@param klass
The class of the resultant object.
@return
A new object generated based on the input JSON.
@since 2.0 | [
"Convert",
"the",
"given",
"JSON",
"string",
"into",
"an",
"object",
"using",
"<a",
"href",
"=",
"https",
":",
"//",
"github",
".",
"com",
"/",
"google",
"/",
"gson",
">",
"Gson<",
"/",
"a",
">",
"."
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/Utils.java#L157-L160 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.listAsync | public Observable<ListContainerItemsInner> listAsync(String resourceGroupName, String accountName) {
"""
Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.
@param resourceGroupName The name of the resource group within the user's subscription. ... | java | public Observable<ListContainerItemsInner> listAsync(String resourceGroupName, String accountName) {
return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<ListContainerItemsInner>, ListContainerItemsInner>() {
@Override
public ListContainerItem... | [
"public",
"Observable",
"<",
"ListContainerItemsInner",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
".",
"map",
"(",
"new",
... | Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified resource g... | [
"Lists",
"all",
"containers",
"and",
"does",
"not",
"support",
"a",
"prefix",
"like",
"data",
"plane",
".",
"Also",
"SRP",
"today",
"does",
"not",
"return",
"continuation",
"token",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L154-L161 |
mgormley/prim | src/main/java_generated/edu/jhu/prim/vector/IntLongDenseVector.java | IntLongDenseVector.add | public void add(IntLongVector other) {
"""
Updates this vector to be the entrywise sum of this vector with the other.
"""
if (other instanceof IntLongUnsortedVector) {
IntLongUnsortedVector vec = (IntLongUnsortedVector) other;
for (int i=0; i<vec.top; i++) {
this... | java | public void add(IntLongVector other) {
if (other instanceof IntLongUnsortedVector) {
IntLongUnsortedVector vec = (IntLongUnsortedVector) other;
for (int i=0; i<vec.top; i++) {
this.add(vec.idx[i], vec.vals[i]);
}
} else {
// TODO: Add spec... | [
"public",
"void",
"add",
"(",
"IntLongVector",
"other",
")",
"{",
"if",
"(",
"other",
"instanceof",
"IntLongUnsortedVector",
")",
"{",
"IntLongUnsortedVector",
"vec",
"=",
"(",
"IntLongUnsortedVector",
")",
"other",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Updates this vector to be the entrywise sum of this vector with the other. | [
"Updates",
"this",
"vector",
"to",
"be",
"the",
"entrywise",
"sum",
"of",
"this",
"vector",
"with",
"the",
"other",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/vector/IntLongDenseVector.java#L143-L153 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java | MapExtensions.operator_minus | @Pure
public static <K, V> Map<K, V> operator_minus(Map<K, V> left, final Pair<? extends K, ? extends V> right) {
"""
Remove the given pair from a given map for obtaining a new map.
<p>
If the given key is inside the map, but is not mapped to the given value, the
map will not be changed.
</p>
<p>
The re... | java | @Pure
public static <K, V> Map<K, V> operator_minus(Map<K, V> left, final Pair<? extends K, ? extends V> right) {
return Maps.filterEntries(left, new Predicate<Entry<K, V>>() {
@Override
public boolean apply(Entry<K, V> input) {
return !Objects.equal(input.getKey(), right.getKey()) || !Objects.equal(input.... | [
"@",
"Pure",
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"operator_minus",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"left",
",",
"final",
"Pair",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"right",
"... | Remove the given pair from a given map for obtaining a new map.
<p>
If the given key is inside the map, but is not mapped to the given value, the
map will not be changed.
</p>
<p>
The replied map is a view on the given map. It means that any change
in the original map is reflected to the result of this operation.
</p... | [
"Remove",
"the",
"given",
"pair",
"from",
"a",
"given",
"map",
"for",
"obtaining",
"a",
"new",
"map",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java#L275-L283 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/Util.java | Util.writeVByte | public static int writeVByte(final int x, final OutputStream os) throws IOException {
"""
Encodes a natural number to an {@link OutputStream} using vByte.
@param x a natural number.
@param os an output stream.
@return the number of bytes written.
"""
if (x < (1 << 7)) {
os.write(x);
return 1;
}
... | java | public static int writeVByte(final int x, final OutputStream os) throws IOException {
if (x < (1 << 7)) {
os.write(x);
return 1;
}
if (x < (1 << 14)) {
os.write((x >>> 7 | 0x80));
os.write(x & 0x7F);
return 2;
}
if (x < (1 << 21)) {
os.write((x >>> 14 | 0x80));
os.write((x >>> 7 | 0x80)... | [
"public",
"static",
"int",
"writeVByte",
"(",
"final",
"int",
"x",
",",
"final",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"if",
"(",
"x",
"<",
"(",
"1",
"<<",
"7",
")",
")",
"{",
"os",
".",
"write",
"(",
"x",
")",
";",
"return",
"... | Encodes a natural number to an {@link OutputStream} using vByte.
@param x a natural number.
@param os an output stream.
@return the number of bytes written. | [
"Encodes",
"a",
"natural",
"number",
"to",
"an",
"{",
"@link",
"OutputStream",
"}",
"using",
"vByte",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L113-L146 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java | VersionsImpl.listAsync | public Observable<List<VersionInfo>> listAsync(UUID appId, ListVersionsOptionalParameter listOptionalParameter) {
"""
Gets the application versions info.
@param appId The application ID.
@param listOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Ille... | java | public Observable<List<VersionInfo>> listAsync(UUID appId, ListVersionsOptionalParameter listOptionalParameter) {
return listWithServiceResponseAsync(appId, listOptionalParameter).map(new Func1<ServiceResponse<List<VersionInfo>>, List<VersionInfo>>() {
@Override
public List<VersionInfo> ... | [
"public",
"Observable",
"<",
"List",
"<",
"VersionInfo",
">",
">",
"listAsync",
"(",
"UUID",
"appId",
",",
"ListVersionsOptionalParameter",
"listOptionalParameter",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"appId",
",",
"listOptionalParameter",
")",
".... | Gets the application versions info.
@param appId The application ID.
@param listOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<VersionInfo> object | [
"Gets",
"the",
"application",
"versions",
"info",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java#L315-L322 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/internal/collection/Array.java | Array.checkIndex | public static void checkIndex(final int from, final int until, final int size) {
"""
Check the given {@code from} and {@code until} indices.
@param from the from index, inclusively.
@param until the until index, exclusively.
@param size the array size
@throws ArrayIndexOutOfBoundsException if the given index... | java | public static void checkIndex(final int from, final int until, final int size) {
if (from < 0) {
throw new ArrayIndexOutOfBoundsException("fromIndex = " + from);
}
if (until > size) {
throw new ArrayIndexOutOfBoundsException(format(
"Invalid index range: [%d, %s)", from, until
));
}
if (from > un... | [
"public",
"static",
"void",
"checkIndex",
"(",
"final",
"int",
"from",
",",
"final",
"int",
"until",
",",
"final",
"int",
"size",
")",
"{",
"if",
"(",
"from",
"<",
"0",
")",
"{",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"\"fromIndex = \"",
"+... | Check the given {@code from} and {@code until} indices.
@param from the from index, inclusively.
@param until the until index, exclusively.
@param size the array size
@throws ArrayIndexOutOfBoundsException if the given index is not in the
valid range. | [
"Check",
"the",
"given",
"{",
"@code",
"from",
"}",
"and",
"{",
"@code",
"until",
"}",
"indices",
"."
] | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/internal/collection/Array.java#L317-L331 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.getValue | @Api
public void getValue(String name, StringAttribute attribute) {
"""
Get a string value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1
"""
attribute.setValue((String) formWidget.getValue(name));
} | java | @Api
public void getValue(String name, StringAttribute attribute) {
attribute.setValue((String) formWidget.getValue(name));
} | [
"@",
"Api",
"public",
"void",
"getValue",
"(",
"String",
"name",
",",
"StringAttribute",
"attribute",
")",
"{",
"attribute",
".",
"setValue",
"(",
"(",
"String",
")",
"formWidget",
".",
"getValue",
"(",
"name",
")",
")",
";",
"}"
] | Get a string value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"Get",
"a",
"string",
"value",
"from",
"the",
"form",
"and",
"place",
"it",
"in",
"<code",
">",
"attribute<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L728-L731 |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.findField | public static Field findField(Class<?> clazz, String name) {
"""
tries to find a field by a field name
@param clazz type
@param name name of the field
@return
"""
Class<?> entityClass = clazz;
while (!Object.class.equals(entityClass) && entityClass != null) {
Field[] fields ... | java | public static Field findField(Class<?> clazz, String name) {
Class<?> entityClass = clazz;
while (!Object.class.equals(entityClass) && entityClass != null) {
Field[] fields = entityClass.getDeclaredFields();
for (Field field : fields) {
if (name.equals(field.... | [
"public",
"static",
"Field",
"findField",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"Class",
"<",
"?",
">",
"entityClass",
"=",
"clazz",
";",
"while",
"(",
"!",
"Object",
".",
"class",
".",
"equals",
"(",
"entityClass",
"... | tries to find a field by a field name
@param clazz type
@param name name of the field
@return | [
"tries",
"to",
"find",
"a",
"field",
"by",
"a",
"field",
"name"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L114-L126 |
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/ManagedDatabasesInner.java | ManagedDatabasesInner.createOrUpdate | public ManagedDatabaseInner createOrUpdate(String resourceGroupName, String managedInstanceName, String databaseName, ManagedDatabaseInner parameters) {
"""
Creates a new database or updates an existing database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain ... | java | public ManagedDatabaseInner createOrUpdate(String resourceGroupName, String managedInstanceName, String databaseName, ManagedDatabaseInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, parameters).toBlocking().last().body();
} | [
"public",
"ManagedDatabaseInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"String",
"databaseName",
",",
"ManagedDatabaseInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resource... | Creates a new database or updates an existing database.
@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 managedInstanceName The name of the managed instance.
@param databaseName The name of the datab... | [
"Creates",
"a",
"new",
"database",
"or",
"updates",
"an",
"existing",
"database",
"."
] | 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/ManagedDatabasesInner.java#L515-L517 |
RestComm/Restcomm-Connect | restcomm/restcomm.commons/src/main/java/org/restcomm/connect/commons/cache/DiskCacheFactory.java | DiskCacheFactory.getDiskCache | public DiskCache getDiskCache(final String cachePath, final String cacheUri) {
"""
constructor for compatibility with existing cache implementation
"""
return new DiskCache(downloader, cachePath, cacheUri, true, cfg.isNoWavCache());
} | java | public DiskCache getDiskCache(final String cachePath, final String cacheUri) {
return new DiskCache(downloader, cachePath, cacheUri, true, cfg.isNoWavCache());
} | [
"public",
"DiskCache",
"getDiskCache",
"(",
"final",
"String",
"cachePath",
",",
"final",
"String",
"cacheUri",
")",
"{",
"return",
"new",
"DiskCache",
"(",
"downloader",
",",
"cachePath",
",",
"cacheUri",
",",
"true",
",",
"cfg",
".",
"isNoWavCache",
"(",
"... | constructor for compatibility with existing cache implementation | [
"constructor",
"for",
"compatibility",
"with",
"existing",
"cache",
"implementation"
] | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.commons/src/main/java/org/restcomm/connect/commons/cache/DiskCacheFactory.java#L27-L29 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/jhlabs/image/Gradient.java | Gradient.setKnots | public void setKnots(int[] x, int[] y, byte[] types, int offset, int count) {
"""
Set the values of a set of knots.
@param x the knot positions
@param y the knot colors
@param types the knot types
@param offset the first knot to set
@param count the number of knots
"""
numKnots = count;
xKnots = new i... | java | public void setKnots(int[] x, int[] y, byte[] types, int offset, int count) {
numKnots = count;
xKnots = new int[numKnots];
yKnots = new int[numKnots];
knotTypes = new byte[numKnots];
System.arraycopy(x, offset, xKnots, 0, numKnots);
System.arraycopy(y, offset, yKnots, 0, numKnots);
System.arraycopy(types... | [
"public",
"void",
"setKnots",
"(",
"int",
"[",
"]",
"x",
",",
"int",
"[",
"]",
"y",
",",
"byte",
"[",
"]",
"types",
",",
"int",
"offset",
",",
"int",
"count",
")",
"{",
"numKnots",
"=",
"count",
";",
"xKnots",
"=",
"new",
"int",
"[",
"numKnots",
... | Set the values of a set of knots.
@param x the knot positions
@param y the knot colors
@param types the knot types
@param offset the first knot to set
@param count the number of knots | [
"Set",
"the",
"values",
"of",
"a",
"set",
"of",
"knots",
"."
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/Gradient.java#L316-L326 |
realexpayments/rxp-hpp-java | src/main/java/com/realexpayments/hpp/sdk/utils/JsonUtils.java | JsonUtils.toJson | public static String toJson(HppResponse hppResponse) {
"""
Method serialises <code>HppResponse</code> to JSON.
@param hppResponse
@return String
"""
try {
return hppResponseWriter.writeValueAsString(hppResponse);
} catch (JsonProcessingException ex) {
LOGGER.error("Error writing HppResponse to JS... | java | public static String toJson(HppResponse hppResponse) {
try {
return hppResponseWriter.writeValueAsString(hppResponse);
} catch (JsonProcessingException ex) {
LOGGER.error("Error writing HppResponse to JSON.", ex);
throw new RealexException("Error writing HppResponse to JSON.", ex);
}
} | [
"public",
"static",
"String",
"toJson",
"(",
"HppResponse",
"hppResponse",
")",
"{",
"try",
"{",
"return",
"hppResponseWriter",
".",
"writeValueAsString",
"(",
"hppResponse",
")",
";",
"}",
"catch",
"(",
"JsonProcessingException",
"ex",
")",
"{",
"LOGGER",
".",
... | Method serialises <code>HppResponse</code> to JSON.
@param hppResponse
@return String | [
"Method",
"serialises",
"<code",
">",
"HppResponse<",
"/",
"code",
">",
"to",
"JSON",
"."
] | train | https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/utils/JsonUtils.java#L78-L85 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ItemRule.java | ItemRule.putValue | public void putValue(String name, Token[] tokens) {
"""
Puts the specified value with the specified key to this Map type item.
@param name the value name; may be null
@param tokens an array of tokens
"""
if (type == null) {
type = ItemType.MAP;
}
if (!isMappableType()) {... | java | public void putValue(String name, Token[] tokens) {
if (type == null) {
type = ItemType.MAP;
}
if (!isMappableType()) {
throw new IllegalArgumentException("The type of this item must be 'map' or 'properties'");
}
if (tokensMap == null) {
tokens... | [
"public",
"void",
"putValue",
"(",
"String",
"name",
",",
"Token",
"[",
"]",
"tokens",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"ItemType",
".",
"MAP",
";",
"}",
"if",
"(",
"!",
"isMappableType",
"(",
")",
")",
"{",
"thro... | Puts the specified value with the specified key to this Map type item.
@param name the value name; may be null
@param tokens an array of tokens | [
"Puts",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"to",
"this",
"Map",
"type",
"item",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ItemRule.java#L250-L261 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemIf.java | ElemIf.callChildVisitors | protected void callChildVisitors(XSLTVisitor visitor, boolean callAttrs) {
"""
Call the children visitors.
@param visitor The visitor whose appropriate method will be called.
"""
if(callAttrs)
m_test.getExpression().callVisitors(m_test, visitor);
super.callChildVisitors(visitor, callAttrs);
} | java | protected void callChildVisitors(XSLTVisitor visitor, boolean callAttrs)
{
if(callAttrs)
m_test.getExpression().callVisitors(m_test, visitor);
super.callChildVisitors(visitor, callAttrs);
} | [
"protected",
"void",
"callChildVisitors",
"(",
"XSLTVisitor",
"visitor",
",",
"boolean",
"callAttrs",
")",
"{",
"if",
"(",
"callAttrs",
")",
"m_test",
".",
"getExpression",
"(",
")",
".",
"callVisitors",
"(",
"m_test",
",",
"visitor",
")",
";",
"super",
".",... | Call the children visitors.
@param visitor The visitor whose appropriate method will be called. | [
"Call",
"the",
"children",
"visitors",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemIf.java#L143-L148 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.getVideoFramesWithServiceResponseAsync | public Observable<ServiceResponse<Frames>> getVideoFramesWithServiceResponseAsync(String teamName, String reviewId, GetVideoFramesOptionalParameter getVideoFramesOptionalParameter) {
"""
The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be PO... | java | public Observable<ServiceResponse<Frames>> getVideoFramesWithServiceResponseAsync(String teamName, String reviewId, GetVideoFramesOptionalParameter getVideoFramesOptionalParameter) {
if (this.client.baseUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.baseUrl() is required ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Frames",
">",
">",
"getVideoFramesWithServiceResponseAsync",
"(",
"String",
"teamName",
",",
"String",
"reviewId",
",",
"GetVideoFramesOptionalParameter",
"getVideoFramesOptionalParameter",
")",
"{",
"if",
"(",
"this",... | The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.
<h3>CallBack Schemas </h3>
<h4>Review Completion CallBack Sample</h4>
<p>
{<br/>
"ReviewId": "<R... | [
"The",
"reviews",
"created",
"would",
"show",
"up",
"for",
"Reviewers",
"on",
"your",
"team",
".",
"As",
"Reviewers",
"complete",
"reviewing",
"results",
"of",
"the",
"Review",
"would",
"be",
"POSTED",
"(",
"i",
".",
"e",
".",
"HTTP",
"POST",
")",
"on",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L1450-L1465 |
alkacon/opencms-core | src/org/opencms/workplace/CmsLoginUserAgreement.java | CmsLoginUserAgreement.dialogScriptSubmit | @Override
public String dialogScriptSubmit() {
"""
The standard JavaScript for submitting the dialog is overridden to show an alert in case that
an agreement is declined.<p>
See also {@link CmsDialog#dialogScriptSubmit()}
@return the standard JavaScript for submitting the dialog
"""
if (use... | java | @Override
public String dialogScriptSubmit() {
if (useNewStyle()) {
return super.dialogScriptSubmit();
}
StringBuffer result = new StringBuffer(512);
result.append("function submitAction(actionValue, theForm, formName) {\n");
result.append("\tif (theForm == null)... | [
"@",
"Override",
"public",
"String",
"dialogScriptSubmit",
"(",
")",
"{",
"if",
"(",
"useNewStyle",
"(",
")",
")",
"{",
"return",
"super",
".",
"dialogScriptSubmit",
"(",
")",
";",
"}",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"512",
")",... | The standard JavaScript for submitting the dialog is overridden to show an alert in case that
an agreement is declined.<p>
See also {@link CmsDialog#dialogScriptSubmit()}
@return the standard JavaScript for submitting the dialog | [
"The",
"standard",
"JavaScript",
"for",
"submitting",
"the",
"dialog",
"is",
"overridden",
"to",
"show",
"an",
"alert",
"in",
"case",
"that",
"an",
"agreement",
"is",
"declined",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsLoginUserAgreement.java#L200-L230 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.getEditSet | private static Element getEditSet(Element node, Document plf, IPerson person, boolean create)
throws PortalException {
"""
Get the edit set if any stored in the passed in node. If not found and if the create flag is
true then create a new edit set and add it as a child to the passed in node. Then retu... | java | private static Element getEditSet(Element node, Document plf, IPerson person, boolean create)
throws PortalException {
Node child = node.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_EDIT_SET)) return (Element) child;
child = c... | [
"private",
"static",
"Element",
"getEditSet",
"(",
"Element",
"node",
",",
"Document",
"plf",
",",
"IPerson",
"person",
",",
"boolean",
"create",
")",
"throws",
"PortalException",
"{",
"Node",
"child",
"=",
"node",
".",
"getFirstChild",
"(",
")",
";",
"while... | Get the edit set if any stored in the passed in node. If not found and if the create flag is
true then create a new edit set and add it as a child to the passed in node. Then return it. | [
"Get",
"the",
"edit",
"set",
"if",
"any",
"stored",
"in",
"the",
"passed",
"in",
"node",
".",
"If",
"not",
"found",
"and",
"if",
"the",
"create",
"flag",
"is",
"true",
"then",
"create",
"a",
"new",
"edit",
"set",
"and",
"add",
"it",
"as",
"a",
"chi... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L54-L82 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/service/utils/ServiceUtils.java | ServiceUtils.checkNotNullOrEmpty | public static void checkNotNullOrEmpty(Map<?, ?> map, String errorMessage) {
"""
This method checks if the input map is valid or not.
@param map input of type {@link Map}
@param errorMessage The exception message use if the map is empty or null
@throws com.netflix.conductor.core.execution.ApplicationException... | java | public static void checkNotNullOrEmpty(Map<?, ?> map, String errorMessage) {
if(map == null || map.isEmpty()) {
throw new ApplicationException(ApplicationException.Code.INVALID_INPUT, errorMessage);
}
} | [
"public",
"static",
"void",
"checkNotNullOrEmpty",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"String",
"errorMessage",
")",
"{",
"if",
"(",
"map",
"==",
"null",
"||",
"map",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"ApplicationExcepti... | This method checks if the input map is valid or not.
@param map input of type {@link Map}
@param errorMessage The exception message use if the map is empty or null
@throws com.netflix.conductor.core.execution.ApplicationException if input map is not valid | [
"This",
"method",
"checks",
"if",
"the",
"input",
"map",
"is",
"valid",
"or",
"not",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/service/utils/ServiceUtils.java#L75-L79 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/scoping/Scopes.java | Scopes.scopedElementsFor | public static <T extends EObject> Iterable<IEObjectDescription> scopedElementsFor(Iterable<? extends T> elements,
final Function<T, QualifiedName> nameComputation) {
"""
transforms an {@link Iterable} of {@link EObject}s into an {@link Iterable} of {@link IEObjectDescription}s computing
the name of the element... | java | public static <T extends EObject> Iterable<IEObjectDescription> scopedElementsFor(Iterable<? extends T> elements,
final Function<T, QualifiedName> nameComputation) {
Iterable<IEObjectDescription> transformed = Iterables.transform(elements,
new Function<T, IEObjectDescription>() {
@Override
public IEO... | [
"public",
"static",
"<",
"T",
"extends",
"EObject",
">",
"Iterable",
"<",
"IEObjectDescription",
">",
"scopedElementsFor",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"elements",
",",
"final",
"Function",
"<",
"T",
",",
"QualifiedName",
">",
"nameComputati... | transforms an {@link Iterable} of {@link EObject}s into an {@link Iterable} of {@link IEObjectDescription}s computing
the name of the elements using the passed {@link Function} If the passed function returns null the object is
filtered out. | [
"transforms",
"an",
"{"
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/scoping/Scopes.java#L87-L100 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeTypeParser.java | MimeTypeParser.safeParseMimeType | @Nullable
public static MimeType safeParseMimeType (@Nullable final String sMimeType) {
"""
Try to convert the string representation of a MIME type to an object. The
default quoting algorithm {@link CMimeType#DEFAULT_QUOTING} is used to
unquote strings. Compared to {@link #parseMimeType(String)} this method
s... | java | @Nullable
public static MimeType safeParseMimeType (@Nullable final String sMimeType)
{
try
{
return parseMimeType (sMimeType, CMimeType.DEFAULT_QUOTING);
}
catch (final MimeTypeParserException ex)
{
return null;
}
} | [
"@",
"Nullable",
"public",
"static",
"MimeType",
"safeParseMimeType",
"(",
"@",
"Nullable",
"final",
"String",
"sMimeType",
")",
"{",
"try",
"{",
"return",
"parseMimeType",
"(",
"sMimeType",
",",
"CMimeType",
".",
"DEFAULT_QUOTING",
")",
";",
"}",
"catch",
"("... | Try to convert the string representation of a MIME type to an object. The
default quoting algorithm {@link CMimeType#DEFAULT_QUOTING} is used to
unquote strings. Compared to {@link #parseMimeType(String)} this method
swallows all {@link MimeTypeParserException} and simply returns
<code>null</code>.
@param sMimeType
Th... | [
"Try",
"to",
"convert",
"the",
"string",
"representation",
"of",
"a",
"MIME",
"type",
"to",
"an",
"object",
".",
"The",
"default",
"quoting",
"algorithm",
"{",
"@link",
"CMimeType#DEFAULT_QUOTING",
"}",
"is",
"used",
"to",
"unquote",
"strings",
".",
"Compared"... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeTypeParser.java#L390-L401 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java | ElementFilter.modulesIn | public static Set<ModuleElement>
modulesIn(Set<? extends Element> elements) {
"""
Returns a set of modules in {@code elements}.
@return a set of modules in {@code elements}
@param elements the elements to filter
@since 9
@spec JPMS
"""
return setFilter(elements, MODULE_KIND, ModuleEleme... | java | public static Set<ModuleElement>
modulesIn(Set<? extends Element> elements) {
return setFilter(elements, MODULE_KIND, ModuleElement.class);
} | [
"public",
"static",
"Set",
"<",
"ModuleElement",
">",
"modulesIn",
"(",
"Set",
"<",
"?",
"extends",
"Element",
">",
"elements",
")",
"{",
"return",
"setFilter",
"(",
"elements",
",",
"MODULE_KIND",
",",
"ModuleElement",
".",
"class",
")",
";",
"}"
] | Returns a set of modules in {@code elements}.
@return a set of modules in {@code elements}
@param elements the elements to filter
@since 9
@spec JPMS | [
"Returns",
"a",
"set",
"of",
"modules",
"in",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L206-L209 |
banq/jdonframework | src/main/java/com/jdon/util/jdom/XMLFilterBase.java | XMLFilterBase.setProperty | public void setProperty (String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
"""
Set the value of a property.
<p>This will always fail if the parent is null.</p>
@param name The property name.
@param state The requested property value.
@exception org.xml.sax.SAXNotR... | java | public void setProperty (String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException
{
for (int i = 0; i < LEXICAL_HANDLER_NAMES.length; i++) {
if (LEXICAL_HANDLER_NAMES[i].equals(name)) {
setLexicalHandler((LexicalHandler) value);
... | [
"public",
"void",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"SAXNotRecognizedException",
",",
"SAXNotSupportedException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"LEXICAL_HANDLER_NAMES",
".",
"length",
";",
"i",... | Set the value of a property.
<p>This will always fail if the parent is null.</p>
@param name The property name.
@param state The requested property value.
@exception org.xml.sax.SAXNotRecognizedException When the
XMLReader does not recognize the property name.
@exception org.xml.sax.SAXNotSupportedException When the
... | [
"Set",
"the",
"value",
"of",
"a",
"property",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/jdom/XMLFilterBase.java#L507-L517 |
EdwardRaff/JSAT | JSAT/src/jsat/driftdetectors/DDM.java | DDM.setWarningThreshold | public void setWarningThreshold(double warningThreshold) {
"""
Sets the multiplier on the standard deviation that must be exceeded to
initiate a warning state. Once in the warning state, DDM will begin to
collect a history of the inputs <br>
Increasing the warning threshold makes it take longer to start detecti... | java | public void setWarningThreshold(double warningThreshold)
{
if(warningThreshold <= 0 || Double.isNaN(warningThreshold) || Double.isInfinite(warningThreshold))
throw new IllegalArgumentException("warning threshold must be positive, not " + warningThreshold);
this.warningThreshold = warning... | [
"public",
"void",
"setWarningThreshold",
"(",
"double",
"warningThreshold",
")",
"{",
"if",
"(",
"warningThreshold",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"warningThreshold",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"warningThreshold",
")",
")",
"t... | Sets the multiplier on the standard deviation that must be exceeded to
initiate a warning state. Once in the warning state, DDM will begin to
collect a history of the inputs <br>
Increasing the warning threshold makes it take longer to start detecting
a change, but reduces false positives. <br>
If the warning threshold... | [
"Sets",
"the",
"multiplier",
"on",
"the",
"standard",
"deviation",
"that",
"must",
"be",
"exceeded",
"to",
"initiate",
"a",
"warning",
"state",
".",
"Once",
"in",
"the",
"warning",
"state",
"DDM",
"will",
"begin",
"to",
"collect",
"a",
"history",
"of",
"th... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/driftdetectors/DDM.java#L152-L157 |
rholder/guava-retrying | src/main/java/com/github/rholder/retry/WaitStrategies.java | WaitStrategies.fixedWait | public static WaitStrategy fixedWait(long sleepTime, @Nonnull TimeUnit timeUnit) throws IllegalStateException {
"""
Returns a wait strategy that sleeps a fixed amount of time before retrying.
@param sleepTime the time to sleep
@param timeUnit the unit of the time to sleep
@return a wait strategy that sleeps ... | java | public static WaitStrategy fixedWait(long sleepTime, @Nonnull TimeUnit timeUnit) throws IllegalStateException {
Preconditions.checkNotNull(timeUnit, "The time unit may not be null");
return new FixedWaitStrategy(timeUnit.toMillis(sleepTime));
} | [
"public",
"static",
"WaitStrategy",
"fixedWait",
"(",
"long",
"sleepTime",
",",
"@",
"Nonnull",
"TimeUnit",
"timeUnit",
")",
"throws",
"IllegalStateException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"timeUnit",
",",
"\"The time unit may not be null\"",
")",
"... | Returns a wait strategy that sleeps a fixed amount of time before retrying.
@param sleepTime the time to sleep
@param timeUnit the unit of the time to sleep
@return a wait strategy that sleeps a fixed amount of time
@throws IllegalStateException if the sleep time is < 0 | [
"Returns",
"a",
"wait",
"strategy",
"that",
"sleeps",
"a",
"fixed",
"amount",
"of",
"time",
"before",
"retrying",
"."
] | train | https://github.com/rholder/guava-retrying/blob/177b6c9b9f3e7957f404f0bdb8e23374cb1de43f/src/main/java/com/github/rholder/retry/WaitStrategies.java#L58-L61 |
bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java | LoganSquare.registerTypeConverter | public static <E> void registerTypeConverter(Class<E> cls, TypeConverter<E> converter) {
"""
Register a new TypeConverter for parsing and serialization.
@param cls The class for which the TypeConverter should be used.
@param converter The TypeConverter
"""
TYPE_CONVERTERS.put(cls, converter);
} | java | public static <E> void registerTypeConverter(Class<E> cls, TypeConverter<E> converter) {
TYPE_CONVERTERS.put(cls, converter);
} | [
"public",
"static",
"<",
"E",
">",
"void",
"registerTypeConverter",
"(",
"Class",
"<",
"E",
">",
"cls",
",",
"TypeConverter",
"<",
"E",
">",
"converter",
")",
"{",
"TYPE_CONVERTERS",
".",
"put",
"(",
"cls",
",",
"converter",
")",
";",
"}"
] | Register a new TypeConverter for parsing and serialization.
@param cls The class for which the TypeConverter should be used.
@param converter The TypeConverter | [
"Register",
"a",
"new",
"TypeConverter",
"for",
"parsing",
"and",
"serialization",
"."
] | train | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java#L349-L351 |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java | VerifierFactory.newInstance | public static VerifierFactory newInstance(String language,ClassLoader classLoader) throws VerifierConfigurationException {
"""
Creates a new instance of a VerifierFactory for the specified schema language.
@param language
URI that specifies the schema language.
<p>
It is preferable to use the namespace URI... | java | public static VerifierFactory newInstance(String language,ClassLoader classLoader) throws VerifierConfigurationException {
Iterator itr = providers( VerifierFactoryLoader.class, classLoader );
while(itr.hasNext()) {
VerifierFactoryLoader loader = (VerifierFactoryLoader)itr.next();
try {
VerifierFac... | [
"public",
"static",
"VerifierFactory",
"newInstance",
"(",
"String",
"language",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"VerifierConfigurationException",
"{",
"Iterator",
"itr",
"=",
"providers",
"(",
"VerifierFactoryLoader",
".",
"class",
",",
"classLoader",... | Creates a new instance of a VerifierFactory for the specified schema language.
@param language
URI that specifies the schema language.
<p>
It is preferable to use the namespace URI of the schema language
to designate the schema language. For example,
<table><thead>
<tr>
<td>URI</td>
<td>language</td>
</tr>
</thead><... | [
"Creates",
"a",
"new",
"instance",
"of",
"a",
"VerifierFactory",
"for",
"the",
"specified",
"schema",
"language",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java#L323-L334 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPP14Reader.java | MPP14Reader.readSubProjects | private void readSubProjects(byte[] data, int uniqueIDOffset, int filePathOffset, int fileNameOffset, int subprojectIndex) {
"""
Read a list of sub projects.
@param data byte array
@param uniqueIDOffset offset of unique ID
@param filePathOffset offset of file path
@param fileNameOffset offset of file name
@... | java | private void readSubProjects(byte[] data, int uniqueIDOffset, int filePathOffset, int fileNameOffset, int subprojectIndex)
{
while (uniqueIDOffset < filePathOffset)
{
readSubProject(data, uniqueIDOffset, filePathOffset, fileNameOffset, subprojectIndex++);
uniqueIDOffset += 4;
}
... | [
"private",
"void",
"readSubProjects",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"uniqueIDOffset",
",",
"int",
"filePathOffset",
",",
"int",
"fileNameOffset",
",",
"int",
"subprojectIndex",
")",
"{",
"while",
"(",
"uniqueIDOffset",
"<",
"filePathOffset",
")",
... | Read a list of sub projects.
@param data byte array
@param uniqueIDOffset offset of unique ID
@param filePathOffset offset of file path
@param fileNameOffset offset of file name
@param subprojectIndex index of the subproject, used to calculate unique id offset | [
"Read",
"a",
"list",
"of",
"sub",
"projects",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP14Reader.java#L559-L566 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java | CommerceNotificationQueueEntryPersistenceImpl.findByLtS | @Override
public List<CommerceNotificationQueueEntry> findByLtS(Date sentDate,
int start, int end,
OrderByComparator<CommerceNotificationQueueEntry> orderByComparator) {
"""
Returns an ordered range of all the commerce notification queue entries where sentDate < ?.
<p>
Useful when paginating result... | java | @Override
public List<CommerceNotificationQueueEntry> findByLtS(Date sentDate,
int start, int end,
OrderByComparator<CommerceNotificationQueueEntry> orderByComparator) {
return findByLtS(sentDate, start, end, orderByComparator, true);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationQueueEntry",
">",
"findByLtS",
"(",
"Date",
"sentDate",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CommerceNotificationQueueEntry",
">",
"orderByComparator",
")",
"{",
"return"... | Returns an ordered range of all the commerce notification queue entries where sentDate < ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers t... | [
"Returns",
"an",
"ordered",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"queue",
"entries",
"where",
"sentDate",
"<",
";",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java#L1722-L1727 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Schema.java | Schema.removeGlobalUniqueIndex | void removeGlobalUniqueIndex(GlobalUniqueIndex index, boolean preserveData) {
"""
remove the given global unique index
@param index the index to remove
@param preserveData should we keep the sql data?
"""
getTopology().lock();
String fn = index.getName();
if (!uncommittedRemo... | java | void removeGlobalUniqueIndex(GlobalUniqueIndex index, boolean preserveData) {
getTopology().lock();
String fn = index.getName();
if (!uncommittedRemovedGlobalUniqueIndexes.contains(fn)) {
uncommittedRemovedGlobalUniqueIndexes.add(fn);
TopologyManager.removeGlobalUniqueInd... | [
"void",
"removeGlobalUniqueIndex",
"(",
"GlobalUniqueIndex",
"index",
",",
"boolean",
"preserveData",
")",
"{",
"getTopology",
"(",
")",
".",
"lock",
"(",
")",
";",
"String",
"fn",
"=",
"index",
".",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"uncommittedRe... | remove the given global unique index
@param index the index to remove
@param preserveData should we keep the sql data? | [
"remove",
"the",
"given",
"global",
"unique",
"index"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Schema.java#L1810-L1822 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/utils/ReflectionUtils.java | ReflectionUtils.getFieldVal | public static Object getFieldVal(final Object obj, final String fieldName, final boolean throwException)
throws IllegalArgumentException {
"""
Get the value of the named field in the class of the given object or any of its superclasses. If an exception
is thrown while trying to read the field, and thr... | java | public static Object getFieldVal(final Object obj, final String fieldName, final boolean throwException)
throws IllegalArgumentException {
if (obj == null || fieldName == null) {
if (throwException) {
throw new NullPointerException();
} else {
... | [
"public",
"static",
"Object",
"getFieldVal",
"(",
"final",
"Object",
"obj",
",",
"final",
"String",
"fieldName",
",",
"final",
"boolean",
"throwException",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"obj",
"==",
"null",
"||",
"fieldName",
"==",
... | Get the value of the named field in the class of the given object or any of its superclasses. If an exception
is thrown while trying to read the field, and throwException is true, then IllegalArgumentException is thrown
wrapping the cause, otherwise this will return null. If passed a null object, returns null unless
th... | [
"Get",
"the",
"value",
"of",
"the",
"named",
"field",
"in",
"the",
"class",
"of",
"the",
"given",
"object",
"or",
"any",
"of",
"its",
"superclasses",
".",
"If",
"an",
"exception",
"is",
"thrown",
"while",
"trying",
"to",
"read",
"the",
"field",
"and",
... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/ReflectionUtils.java#L123-L133 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/authorization/authorizationpolicylabel_stats.java | authorizationpolicylabel_stats.get | public static authorizationpolicylabel_stats get(nitro_service service, String labelname) throws Exception {
"""
Use this API to fetch statistics of authorizationpolicylabel_stats resource of given name .
"""
authorizationpolicylabel_stats obj = new authorizationpolicylabel_stats();
obj.set_labelname(label... | java | public static authorizationpolicylabel_stats get(nitro_service service, String labelname) throws Exception{
authorizationpolicylabel_stats obj = new authorizationpolicylabel_stats();
obj.set_labelname(labelname);
authorizationpolicylabel_stats response = (authorizationpolicylabel_stats) obj.stat_resource(service)... | [
"public",
"static",
"authorizationpolicylabel_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
")",
"throws",
"Exception",
"{",
"authorizationpolicylabel_stats",
"obj",
"=",
"new",
"authorizationpolicylabel_stats",
"(",
")",
";",
"obj",
".",
... | Use this API to fetch statistics of authorizationpolicylabel_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"authorizationpolicylabel_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/authorization/authorizationpolicylabel_stats.java#L149-L154 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateClient.java | NodeTemplateClient.insertNodeTemplate | @BetaApi
public final Operation insertNodeTemplate(String region, NodeTemplate nodeTemplateResource) {
"""
Creates a NodeTemplate resource in the specified project using the data included in the
request.
<p>Sample code:
<pre><code>
try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create())... | java | @BetaApi
public final Operation insertNodeTemplate(String region, NodeTemplate nodeTemplateResource) {
InsertNodeTemplateHttpRequest request =
InsertNodeTemplateHttpRequest.newBuilder()
.setRegion(region)
.setNodeTemplateResource(nodeTemplateResource)
.build();
ret... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertNodeTemplate",
"(",
"String",
"region",
",",
"NodeTemplate",
"nodeTemplateResource",
")",
"{",
"InsertNodeTemplateHttpRequest",
"request",
"=",
"InsertNodeTemplateHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"set... | Creates a NodeTemplate resource in the specified project using the data included in the
request.
<p>Sample code:
<pre><code>
try (NodeTemplateClient nodeTemplateClient = NodeTemplateClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
NodeTemplate nodeTemplateResource = NodeTem... | [
"Creates",
"a",
"NodeTemplate",
"resource",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/NodeTemplateClient.java#L651-L660 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.faulttolerance.cdi/src/com/ibm/ws/microprofile/faulttolerance/cdi/config/MethodFinder.java | MethodFinder.findMatchingMethod | public static Method findMatchingMethod(Method originalMethod, String methodName) {
"""
Recursively search the class hierarchy of the class which declares {@code originalMethod} to find a method named {@code methodName} with the same signature as
{@code originalMethod}
@return The matching method, or {@code nu... | java | public static Method findMatchingMethod(Method originalMethod, String methodName) {
Class<?> originalClass = originalMethod.getDeclaringClass();
return AccessController.doPrivileged(new PrivilegedAction<Method>() {
@Override
public Method run() {
return findMatch... | [
"public",
"static",
"Method",
"findMatchingMethod",
"(",
"Method",
"originalMethod",
",",
"String",
"methodName",
")",
"{",
"Class",
"<",
"?",
">",
"originalClass",
"=",
"originalMethod",
".",
"getDeclaringClass",
"(",
")",
";",
"return",
"AccessController",
".",
... | Recursively search the class hierarchy of the class which declares {@code originalMethod} to find a method named {@code methodName} with the same signature as
{@code originalMethod}
@return The matching method, or {@code null} if one could not be found | [
"Recursively",
"search",
"the",
"class",
"hierarchy",
"of",
"the",
"class",
"which",
"declares",
"{",
"@code",
"originalMethod",
"}",
"to",
"find",
"a",
"method",
"named",
"{",
"@code",
"methodName",
"}",
"with",
"the",
"same",
"signature",
"as",
"{",
"@code... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.faulttolerance.cdi/src/com/ibm/ws/microprofile/faulttolerance/cdi/config/MethodFinder.java#L40-L49 |
AlmogBaku/IntlPhoneInput | intlphoneinput/src/main/java/net/rimoto/intlphoneinput/CountrySpinnerAdapter.java | CountrySpinnerAdapter.getDropDownView | @Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
"""
Drop down item view
@param position position of item
@param convertView View of item
@param parent parent view of item's view
@return covertView
"""
final ViewHolder viewHolder;
if (c... | java | @Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
final ViewHolder viewHolder;
if (convertView == null) {
convertView = mLayoutInflater.inflate(R.layout.item_country, parent, false);
viewHolder = new ViewHolder();
viewHolder... | [
"@",
"Override",
"public",
"View",
"getDropDownView",
"(",
"int",
"position",
",",
"View",
"convertView",
",",
"ViewGroup",
"parent",
")",
"{",
"final",
"ViewHolder",
"viewHolder",
";",
"if",
"(",
"convertView",
"==",
"null",
")",
"{",
"convertView",
"=",
"m... | Drop down item view
@param position position of item
@param convertView View of item
@param parent parent view of item's view
@return covertView | [
"Drop",
"down",
"item",
"view"
] | train | https://github.com/AlmogBaku/IntlPhoneInput/blob/ac7313a2d1683feb4d535d5dbee6676b53879059/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/CountrySpinnerAdapter.java#L32-L51 |
tvbarthel/Cheerleader | library/src/main/java/fr/tvbarthel/cheerleader/library/offline/Offliner.java | Offliner.retrieveResponseFromCache | private Response retrieveResponseFromCache(Request request, @Nullable Response response) {
"""
Retrieve a {@link Response} from the offline layer.
@param request request for which an offline response must be retrieved
@param response original response which lead to an offline access. Can be null.
@return off... | java | private Response retrieveResponseFromCache(Request request, @Nullable Response response) {
Response.Builder cachedResponse;
if (response != null) {
cachedResponse = response.newBuilder();
} else {
cachedResponse = new Response.Builder()
.request(reques... | [
"private",
"Response",
"retrieveResponseFromCache",
"(",
"Request",
"request",
",",
"@",
"Nullable",
"Response",
"response",
")",
"{",
"Response",
".",
"Builder",
"cachedResponse",
";",
"if",
"(",
"response",
"!=",
"null",
")",
"{",
"cachedResponse",
"=",
"respo... | Retrieve a {@link Response} from the offline layer.
@param request request for which an offline response must be retrieved
@param response original response which lead to an offline access. Can be null.
@return offline response or null if no response can be retrieve from the offline layer. | [
"Retrieve",
"a",
"{",
"@link",
"Response",
"}",
"from",
"the",
"offline",
"layer",
"."
] | train | https://github.com/tvbarthel/Cheerleader/blob/f61527e4cc44fcd0ed2e1e98aca285f8c236f24e/library/src/main/java/fr/tvbarthel/cheerleader/library/offline/Offliner.java#L128-L148 |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.withStatus | public HttpClientResponseBuilder withStatus(int statusCode) {
"""
Sets response status code.
@param statusCode response status code
@return response builder
"""
Action lastAction = newRule.getLastAction();
StatusResponse statusAction = new StatusResponse(lastAction, statusCode);
new... | java | public HttpClientResponseBuilder withStatus(int statusCode) {
Action lastAction = newRule.getLastAction();
StatusResponse statusAction = new StatusResponse(lastAction, statusCode);
newRule.overrideLastAction(statusAction);
return this;
} | [
"public",
"HttpClientResponseBuilder",
"withStatus",
"(",
"int",
"statusCode",
")",
"{",
"Action",
"lastAction",
"=",
"newRule",
".",
"getLastAction",
"(",
")",
";",
"StatusResponse",
"statusAction",
"=",
"new",
"StatusResponse",
"(",
"lastAction",
",",
"statusCode"... | Sets response status code.
@param statusCode response status code
@return response builder | [
"Sets",
"response",
"status",
"code",
"."
] | train | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L39-L44 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java | MonitoringAspect.doProfilingMethod | @Around(value = "execution(* *(..)) && (@annotation(method))")
public Object doProfilingMethod(ProceedingJoinPoint pjp, Monitor method) throws Throwable {
"""
Common method profiling entry-point.
@param pjp
{@link ProceedingJoinPoint}
@param method
{@link Monitor}
@return call result
@throws Throwable
... | java | @Around(value = "execution(* *(..)) && (@annotation(method))")
public Object doProfilingMethod(ProceedingJoinPoint pjp, Monitor method) throws Throwable {
return doProfiling(pjp, method.producerId(), method.subsystem(), method.category());
} | [
"@",
"Around",
"(",
"value",
"=",
"\"execution(* *(..)) && (@annotation(method))\"",
")",
"public",
"Object",
"doProfilingMethod",
"(",
"ProceedingJoinPoint",
"pjp",
",",
"Monitor",
"method",
")",
"throws",
"Throwable",
"{",
"return",
"doProfiling",
"(",
"pjp",
",",
... | Common method profiling entry-point.
@param pjp
{@link ProceedingJoinPoint}
@param method
{@link Monitor}
@return call result
@throws Throwable
in case of error during {@link ProceedingJoinPoint#proceed()} | [
"Common",
"method",
"profiling",
"entry",
"-",
"point",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java#L36-L39 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryInterestPointAlgs.java | FactoryInterestPointAlgs.harrisLaplace | public static <T extends ImageGray<T>, D extends ImageGray<D>>
FeatureLaplacePyramid<T, D> harrisLaplace(int extractRadius,
float detectThreshold,
int maxFeatures,
Class<T> imageType,
Class<D> derivType) {
"""
Creates a {@link FeatureLaplacePyramid} which is use... | java | public static <T extends ImageGray<T>, D extends ImageGray<D>>
FeatureLaplacePyramid<T, D> harrisLaplace(int extractRadius,
float detectThreshold,
int maxFeatures,
Class<T> imageType,
Class<D> derivType) {
GradientCornerIntensity<D> harris = FactoryIntensityPointAl... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"FeatureLaplacePyramid",
"<",
"T",
",",
"D",
">",
"harrisLaplace",
"(",
"int",
"extractRadius",
",",
"float",
"detectThreshold",
",",... | Creates a {@link FeatureLaplacePyramid} which is uses the Harris corner detector.
@param extractRadius Size of the feature used to detect the corners.
@param detectThreshold Minimum corner intensity required
@param maxFeatures Max number of features that can be found.
@param imageType Type of input image.
... | [
"Creates",
"a",
"{",
"@link",
"FeatureLaplacePyramid",
"}",
"which",
"is",
"uses",
"the",
"Harris",
"corner",
"detector",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryInterestPointAlgs.java#L144-L161 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.beginExecuteScriptActions | public void beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) {
"""
Executes script actions on the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters... | java | public void beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) {
beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginExecuteScriptActions",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ExecuteScriptActionParameters",
"parameters",
")",
"{",
"beginExecuteScriptActionsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",... | Executes script actions on the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters The parameters for executing script actions.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponse... | [
"Executes",
"script",
"actions",
"on",
"the",
"specified",
"HDInsight",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L1795-L1797 |
mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TDNode.java | TDNode.fromNode | public static TDNode fromNode(Node node, List<String> preferredLanguages) {
"""
Constructs a new TDNode from a given osmosis node entity. Checks the validity of the entity.
@param node the osmosis entity
@param preferredLanguages the preferred language(s) or null if no preference
@return a new T... | java | public static TDNode fromNode(Node node, List<String> preferredLanguages) {
SpecialTagExtractionResult ster = OSMUtils.extractSpecialFields(node, preferredLanguages);
Map<Short, Object> knownWayTags = OSMUtils.extractKnownPOITags(node);
return new TDNode(node.getId(), LatLongUtils.degreesToMicr... | [
"public",
"static",
"TDNode",
"fromNode",
"(",
"Node",
"node",
",",
"List",
"<",
"String",
">",
"preferredLanguages",
")",
"{",
"SpecialTagExtractionResult",
"ster",
"=",
"OSMUtils",
".",
"extractSpecialFields",
"(",
"node",
",",
"preferredLanguages",
")",
";",
... | Constructs a new TDNode from a given osmosis node entity. Checks the validity of the entity.
@param node the osmosis entity
@param preferredLanguages the preferred language(s) or null if no preference
@return a new TDNode | [
"Constructs",
"a",
"new",
"TDNode",
"from",
"a",
"given",
"osmosis",
"node",
"entity",
".",
"Checks",
"the",
"validity",
"of",
"the",
"entity",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TDNode.java#L42-L49 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobsInner.java | JobsInner.stopAsync | public Observable<Void> stopAsync(String resourceGroupName, String automationAccountName, UUID jobId) {
"""
Stop the job identified by jobId.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job id.
@throws IllegalArgu... | java | public Observable<Void> stopAsync(String resourceGroupName, String automationAccountName, UUID jobId) {
return stopWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> res... | [
"public",
"Observable",
"<",
"Void",
">",
"stopAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"UUID",
"jobId",
")",
"{",
"return",
"stopWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
",",
"j... | Stop the job identified by jobId.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Stop",
"the",
"job",
"identified",
"by",
"jobId",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobsInner.java#L417-L424 |
relayrides/pushy | pushy/src/main/java/com/turo/pushy/apns/ApnsClientBuilder.java | ApnsClientBuilder.setClientCredentials | public ApnsClientBuilder setClientCredentials(final X509Certificate clientCertificate, final PrivateKey privateKey, final String privateKeyPassword) {
"""
<p>Sets the TLS credentials for the client under construction. Clients constructed with TLS credentials will use
TLS-based authentication when sending push not... | java | public ApnsClientBuilder setClientCredentials(final X509Certificate clientCertificate, final PrivateKey privateKey, final String privateKeyPassword) {
this.clientCertificate = clientCertificate;
this.privateKey = privateKey;
this.privateKeyPassword = privateKeyPassword;
return this;
... | [
"public",
"ApnsClientBuilder",
"setClientCredentials",
"(",
"final",
"X509Certificate",
"clientCertificate",
",",
"final",
"PrivateKey",
"privateKey",
",",
"final",
"String",
"privateKeyPassword",
")",
"{",
"this",
".",
"clientCertificate",
"=",
"clientCertificate",
";",
... | <p>Sets the TLS credentials for the client under construction. Clients constructed with TLS credentials will use
TLS-based authentication when sending push notifications.</p>
<p>Clients may not have both TLS credentials and a signing key.</p>
@param clientCertificate the certificate to be used to identify the client ... | [
"<p",
">",
"Sets",
"the",
"TLS",
"credentials",
"for",
"the",
"client",
"under",
"construction",
".",
"Clients",
"constructed",
"with",
"TLS",
"credentials",
"will",
"use",
"TLS",
"-",
"based",
"authentication",
"when",
"sending",
"push",
"notifications",
".",
... | train | https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/ApnsClientBuilder.java#L253-L259 |
playn/playn | scene/src/playn/scene/LayerUtil.java | LayerUtil.layerToParent | public static Point layerToParent(Layer layer, Layer parent, XY point, Point into) {
"""
Converts the supplied point from coordinates relative to the specified
child layer to coordinates relative to the specified parent layer. The
results are stored into {@code into}, which is returned for convenience.
"""
... | java | public static Point layerToParent(Layer layer, Layer parent, XY point, Point into) {
into.set(point);
while (layer != parent) {
if (layer == null) {
throw new IllegalArgumentException(
"Failed to find parent, perhaps you passed parent, layer instead of "
+ "layer, parent?");
... | [
"public",
"static",
"Point",
"layerToParent",
"(",
"Layer",
"layer",
",",
"Layer",
"parent",
",",
"XY",
"point",
",",
"Point",
"into",
")",
"{",
"into",
".",
"set",
"(",
"point",
")",
";",
"while",
"(",
"layer",
"!=",
"parent",
")",
"{",
"if",
"(",
... | Converts the supplied point from coordinates relative to the specified
child layer to coordinates relative to the specified parent layer. The
results are stored into {@code into}, which is returned for convenience. | [
"Converts",
"the",
"supplied",
"point",
"from",
"coordinates",
"relative",
"to",
"the",
"specified",
"child",
"layer",
"to",
"coordinates",
"relative",
"to",
"the",
"specified",
"parent",
"layer",
".",
"The",
"results",
"are",
"stored",
"into",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/LayerUtil.java#L54-L68 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java | DatabaseImpl.getPublicIdentifier | public String getPublicIdentifier() throws DocumentStoreException {
"""
<p>Returns the DocumentStore's unique identifier.</p>
<p>This is used for the checkpoint document in a remote DocumentStore
during replication.</p>
@return a unique identifier for the DocumentStore.
@throws DocumentStoreException if th... | java | public String getPublicIdentifier() throws DocumentStoreException {
Misc.checkState(this.isOpen(), "Database is closed");
try {
return get(queue.submit(new GetPublicIdentifierCallable()));
} catch (ExecutionException e) {
logger.log(Level.SEVERE, "Failed to get public ID"... | [
"public",
"String",
"getPublicIdentifier",
"(",
")",
"throws",
"DocumentStoreException",
"{",
"Misc",
".",
"checkState",
"(",
"this",
".",
"isOpen",
"(",
")",
",",
"\"Database is closed\"",
")",
";",
"try",
"{",
"return",
"get",
"(",
"queue",
".",
"submit",
... | <p>Returns the DocumentStore's unique identifier.</p>
<p>This is used for the checkpoint document in a remote DocumentStore
during replication.</p>
@return a unique identifier for the DocumentStore.
@throws DocumentStoreException if there was an error retrieving the unique identifier from the
database | [
"<p",
">",
"Returns",
"the",
"DocumentStore",
"s",
"unique",
"identifier",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java#L495-L503 |
dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.handleBetween | private String handleBetween(final String input) {
"""
Process between syntax. Just leave the beginning date.
@param input the source string
@return the stripped result
"""
final String outString = input.replace("BETWEEN ", "")
.replace("BET ", "").replace("FROM ", "");
retu... | java | private String handleBetween(final String input) {
final String outString = input.replace("BETWEEN ", "")
.replace("BET ", "").replace("FROM ", "");
return truncateAt(truncateAt(outString, " AND "), " TO ").trim();
} | [
"private",
"String",
"handleBetween",
"(",
"final",
"String",
"input",
")",
"{",
"final",
"String",
"outString",
"=",
"input",
".",
"replace",
"(",
"\"BETWEEN \"",
",",
"\"\"",
")",
".",
"replace",
"(",
"\"BET \"",
",",
"\"\"",
")",
".",
"replace",
"(",
... | Process between syntax. Just leave the beginning date.
@param input the source string
@return the stripped result | [
"Process",
"between",
"syntax",
".",
"Just",
"leave",
"the",
"beginning",
"date",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L205-L209 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Table.java | Table.dropIndex | public void dropIndex(Session session, String indexname) {
"""
Performs Table structure modification and changes to the index nodes
to remove a given index from a MEMORY or TEXT table. Not for PK index.
"""
// find the array index for indexname and remove
int todrop = getIndexIndex(indexname)... | java | public void dropIndex(Session session, String indexname) {
// find the array index for indexname and remove
int todrop = getIndexIndex(indexname);
indexList = (Index[]) ArrayUtil.toAdjustedArray(indexList, null,
todrop, -1);
for (int i = 0; i < indexList.length; i++) {... | [
"public",
"void",
"dropIndex",
"(",
"Session",
"session",
",",
"String",
"indexname",
")",
"{",
"// find the array index for indexname and remove",
"int",
"todrop",
"=",
"getIndexIndex",
"(",
"indexname",
")",
";",
"indexList",
"=",
"(",
"Index",
"[",
"]",
")",
... | Performs Table structure modification and changes to the index nodes
to remove a given index from a MEMORY or TEXT table. Not for PK index. | [
"Performs",
"Table",
"structure",
"modification",
"and",
"changes",
"to",
"the",
"index",
"nodes",
"to",
"remove",
"a",
"given",
"index",
"from",
"a",
"MEMORY",
"or",
"TEXT",
"table",
".",
"Not",
"for",
"PK",
"index",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L2159-L2176 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java | ModelsEngine.sourcesNet | public static boolean sourcesNet( RandomIter flowIterator, int[] colRow, int num, RandomIter netNum ) {
"""
Controls if the considered point is a source in the network map.
@param flowIterator
{@link RandomIter iterator} of flowdirections map
@param colRow the col and row of the point to check.
@param num
c... | java | public static boolean sourcesNet( RandomIter flowIterator, int[] colRow, int num, RandomIter netNum ) {
int[][] dir = {{0, 0, 0}, {1, 0, 5}, {1, -1, 6}, {0, -1, 7}, {-1, -1, 8}, {-1, 0, 1}, {-1, 1, 2}, {0, 1, 3}, {1, 1, 4}};
if (flowIterator.getSampleDouble(colRow[0], colRow[1], 0) <= 10.0
... | [
"public",
"static",
"boolean",
"sourcesNet",
"(",
"RandomIter",
"flowIterator",
",",
"int",
"[",
"]",
"colRow",
",",
"int",
"num",
",",
"RandomIter",
"netNum",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"dir",
"=",
"{",
"{",
"0",
",",
"0",
",",
"0",
"}",... | Controls if the considered point is a source in the network map.
@param flowIterator
{@link RandomIter iterator} of flowdirections map
@param colRow the col and row of the point to check.
@param num
channel number
@param netNum
{@link RandomIter iterator} of the netnumbering map.
@return | [
"Controls",
"if",
"the",
"considered",
"point",
"is",
"a",
"source",
"in",
"the",
"network",
"map",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java#L442-L458 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java | ListApi.getNullableString | public static String getNullableString(final List list, final Integer... path) {
"""
Get string value by path.
@param list subject
@param path nodes to walk in map
@return value
"""
return getNullable(list, String.class, path);
} | java | public static String getNullableString(final List list, final Integer... path) {
return getNullable(list, String.class, path);
} | [
"public",
"static",
"String",
"getNullableString",
"(",
"final",
"List",
"list",
",",
"final",
"Integer",
"...",
"path",
")",
"{",
"return",
"getNullable",
"(",
"list",
",",
"String",
".",
"class",
",",
"path",
")",
";",
"}"
] | Get string value by path.
@param list subject
@param path nodes to walk in map
@return value | [
"Get",
"string",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java#L160-L162 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableUniqueVariableFactory.java | RandomVariableUniqueVariableFactory.createRandomVariable | public RandomVariable createRandomVariable(RandomVariable randomvariable, boolean isConstant, ArrayList<RandomVariableUniqueVariable> parentVariables, RandomVariableUniqueVariable.OperatorType parentOperatorType) {
"""
Add an object of {@link RandomVariable} to variable list at the index of the current ID
and ris... | java | public RandomVariable createRandomVariable(RandomVariable randomvariable, boolean isConstant, ArrayList<RandomVariableUniqueVariable> parentVariables, RandomVariableUniqueVariable.OperatorType parentOperatorType) {
int factoryID = currentFactoryID++;
listOfAllVariables.add(
factoryID,
randomvariable... | [
"public",
"RandomVariable",
"createRandomVariable",
"(",
"RandomVariable",
"randomvariable",
",",
"boolean",
"isConstant",
",",
"ArrayList",
"<",
"RandomVariableUniqueVariable",
">",
"parentVariables",
",",
"RandomVariableUniqueVariable",
".",
"OperatorType",
"parentOperatorTyp... | Add an object of {@link RandomVariable} to variable list at the index of the current ID
and rises the current ID to the next one.
@param randomvariable object of {@link RandomVariable} to add to ArrayList and return as {@link RandomVariableUniqueVariable}
@param isConstant boolean such that if true the derivative will ... | [
"Add",
"an",
"object",
"of",
"{"
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableUniqueVariableFactory.java#L49-L59 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java | Check.superiorStrict | public static void superiorStrict(int a, int b) {
"""
Check if <code>a</code> is strictly superior to <code>b</code>.
@param a The parameter to test.
@param b The parameter to compare to.
@throws LionEngineException If check failed.
"""
if (a <= b)
{
throw new LionEngineExce... | java | public static void superiorStrict(int a, int b)
{
if (a <= b)
{
throw new LionEngineException(ERROR_ARGUMENT
+ String.valueOf(a)
+ ERROR_SUPERIOR_STRICT
+ ... | [
"public",
"static",
"void",
"superiorStrict",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"if",
"(",
"a",
"<=",
"b",
")",
"{",
"throw",
"new",
"LionEngineException",
"(",
"ERROR_ARGUMENT",
"+",
"String",
".",
"valueOf",
"(",
"a",
")",
"+",
"ERROR_SUPER... | Check if <code>a</code> is strictly superior to <code>b</code>.
@param a The parameter to test.
@param b The parameter to compare to.
@throws LionEngineException If check failed. | [
"Check",
"if",
"<code",
">",
"a<",
"/",
"code",
">",
"is",
"strictly",
"superior",
"to",
"<code",
">",
"b<",
"/",
"code",
">",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java#L82-L91 |
michael-rapp/AndroidMaterialDialog | library/src/main/java/de/mrapp/android/dialog/decorator/MaterialDialogDecorator.java | MaterialDialogDecorator.getLayoutDimension | private int getLayoutDimension(final int dimension, final int margin, final int total) {
"""
Returns a dimension (width or height) of the dialog, depending of the margin of the
corresponding orientation and the display space, which is available in total.
@param dimension
The dimension, which should be used, i... | java | private int getLayoutDimension(final int dimension, final int margin, final int total) {
if (dimension == Dialog.MATCH_PARENT) {
return RelativeLayout.LayoutParams.MATCH_PARENT;
} else if (dimension == Dialog.WRAP_CONTENT) {
return RelativeLayout.LayoutParams.WRAP_CONTENT;
... | [
"private",
"int",
"getLayoutDimension",
"(",
"final",
"int",
"dimension",
",",
"final",
"int",
"margin",
",",
"final",
"int",
"total",
")",
"{",
"if",
"(",
"dimension",
"==",
"Dialog",
".",
"MATCH_PARENT",
")",
"{",
"return",
"RelativeLayout",
".",
"LayoutPa... | Returns a dimension (width or height) of the dialog, depending of the margin of the
corresponding orientation and the display space, which is available in total.
@param dimension
The dimension, which should be used, in pixels as an {@link Integer value}
@param margin
The margin in pixels as an {@link Integer} value
@p... | [
"Returns",
"a",
"dimension",
"(",
"width",
"or",
"height",
")",
"of",
"the",
"dialog",
"depending",
"of",
"the",
"margin",
"of",
"the",
"corresponding",
"orientation",
"and",
"the",
"display",
"space",
"which",
"is",
"available",
"in",
"total",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/library/src/main/java/de/mrapp/android/dialog/decorator/MaterialDialogDecorator.java#L653-L661 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDictionary.java | MutableDictionary.setDouble | @NonNull
@Override
public MutableDictionary setDouble(@NonNull String key, double value) {
"""
Set a double value for the given key.
@param key The key
@param value The double value.
@return The self object.
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDictionary setDouble(@NonNull String key, double value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDictionary",
"setDouble",
"(",
"@",
"NonNull",
"String",
"key",
",",
"double",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a double value for the given key.
@param key The key
@param value The double value.
@return The self object. | [
"Set",
"a",
"double",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDictionary.java#L182-L186 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/CommitsApi.java | CommitsApi.addComment | public Comment addComment(Object projectIdOrPath, String sha, String note, String path, Integer line, LineType lineType) throws GitLabApiException {
"""
Add a comment to a commit. In order to post a comment in a particular line of a particular file,
you must specify the full commit SHA, the path, the line and li... | java | public Comment addComment(Object projectIdOrPath, String sha, String note, String path, Integer line, LineType lineType) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("note", note, true)
.withParam("path", path)
.withParam("li... | [
"public",
"Comment",
"addComment",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"sha",
",",
"String",
"note",
",",
"String",
"path",
",",
"Integer",
"line",
",",
"LineType",
"lineType",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"... | Add a comment to a commit. In order to post a comment in a particular line of a particular file,
you must specify the full commit SHA, the path, the line and lineType should be NEW.
<pre><code>GitLab Endpoint: POST /projects/:id/repository/commits/:sha/comments</code></pre>
@param projectIdOrPath the project in the ... | [
"Add",
"a",
"comment",
"to",
"a",
"commit",
".",
"In",
"order",
"to",
"post",
"a",
"comment",
"in",
"a",
"particular",
"line",
"of",
"a",
"particular",
"file",
"you",
"must",
"specify",
"the",
"full",
"commit",
"SHA",
"the",
"path",
"the",
"line",
"and... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/CommitsApi.java#L526-L534 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java | VirtualHubsInner.getByResourceGroupAsync | public Observable<VirtualHubInner> getByResourceGroupAsync(String resourceGroupName, String virtualHubName) {
"""
Retrieves the details of a VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@throws IllegalArgumentException thrown... | java | public Observable<VirtualHubInner> getByResourceGroupAsync(String resourceGroupName, String virtualHubName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualHubName).map(new Func1<ServiceResponse<VirtualHubInner>, VirtualHubInner>() {
@Override
public Virtual... | [
"public",
"Observable",
"<",
"VirtualHubInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualHubName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualHubName",
")",
".",
... | Retrieves the details of a VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VirtualHubInner object | [
"Retrieves",
"the",
"details",
"of",
"a",
"VirtualHub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java#L151-L158 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java | ToStream.charactersRaw | protected void charactersRaw(char ch[], int start, int length)
throws org.xml.sax.SAXException {
"""
If available, when the disable-output-escaping attribute is used,
output raw text without escaping.
@param ch The characters from the XML document.
@param start The start position in the array.
@param... | java | protected void charactersRaw(char ch[], int start, int length)
throws org.xml.sax.SAXException
{
if (m_inEntityRef)
return;
try
{
if (m_elemContext.m_startTagOpen)
{
closeStartTag();
m_elemContext.m_startTagOpen = f... | [
"protected",
"void",
"charactersRaw",
"(",
"char",
"ch",
"[",
"]",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"if",
"(",
"m_inEntityRef",
")",
"return",
";",
"try",
"{",
"if",
"(... | If available, when the disable-output-escaping attribute is used,
output raw text without escaping.
@param ch The characters from the XML document.
@param start The start position in the array.
@param length The number of characters to read from the array.
@throws org.xml.sax.SAXException | [
"If",
"available",
"when",
"the",
"disable",
"-",
"output",
"-",
"escaping",
"attribute",
"is",
"used",
"output",
"raw",
"text",
"without",
"escaping",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L1344-L1367 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/geo/LastLocationFinder.java | LastLocationFinder.getLastBestLocation | public Location getLastBestLocation(int minDistance, long minTime) {
"""
Returns the most accurate and timely previously detected location.
Where the last result is beyond the specified maximum distance or
latency a one-off location update is returned via the {@link LocationListener}
@param minDistance Minimu... | java | public Location getLastBestLocation(int minDistance, long minTime) {
Location bestResult = null;
float bestAccuracy = Float.MAX_VALUE;
long bestTime = Long.MIN_VALUE;
// Iterate through all the providers on the system, keeping
// note of the most accurate result within the accep... | [
"public",
"Location",
"getLastBestLocation",
"(",
"int",
"minDistance",
",",
"long",
"minTime",
")",
"{",
"Location",
"bestResult",
"=",
"null",
";",
"float",
"bestAccuracy",
"=",
"Float",
".",
"MAX_VALUE",
";",
"long",
"bestTime",
"=",
"Long",
".",
"MIN_VALUE... | Returns the most accurate and timely previously detected location.
Where the last result is beyond the specified maximum distance or
latency a one-off location update is returned via the {@link LocationListener}
@param minDistance Minimum distance before we require a location update.
@param minTime Minimum time re... | [
"Returns",
"the",
"most",
"accurate",
"and",
"timely",
"previously",
"detected",
"location",
".",
"Where",
"the",
"last",
"result",
"is",
"beyond",
"the",
"specified",
"maximum",
"distance",
"or",
"latency",
"a",
"one",
"-",
"off",
"location",
"update",
"is",
... | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/geo/LastLocationFinder.java#L69-L106 |
fabiomaffioletti/jsondoc | jsondoc-core/src/main/java/org/jsondoc/core/scanner/AbstractJSONDocScanner.java | AbstractJSONDocScanner.getApiDoc | private ApiDoc getApiDoc(Class<?> controller, MethodDisplay displayMethodAs) {
"""
Gets the API documentation for a single class annotated with @Api and for its methods, annotated with @ApiMethod
@param controller
@return
"""
log.debug("Getting JSONDoc for class: " + controller.getName());
ApiDoc apiDoc ... | java | private ApiDoc getApiDoc(Class<?> controller, MethodDisplay displayMethodAs) {
log.debug("Getting JSONDoc for class: " + controller.getName());
ApiDoc apiDoc = initApiDoc(controller);
apiDoc.setSupportedversions(JSONDocApiVersionDocBuilder.build(controller));
apiDoc.setAuth(JSONDocApiAuthDocBuilder.getApiAuthD... | [
"private",
"ApiDoc",
"getApiDoc",
"(",
"Class",
"<",
"?",
">",
"controller",
",",
"MethodDisplay",
"displayMethodAs",
")",
"{",
"log",
".",
"debug",
"(",
"\"Getting JSONDoc for class: \"",
"+",
"controller",
".",
"getName",
"(",
")",
")",
";",
"ApiDoc",
"apiDo... | Gets the API documentation for a single class annotated with @Api and for its methods, annotated with @ApiMethod
@param controller
@return | [
"Gets",
"the",
"API",
"documentation",
"for",
"a",
"single",
"class",
"annotated",
"with"
] | train | https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-core/src/main/java/org/jsondoc/core/scanner/AbstractJSONDocScanner.java#L135-L148 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java | VirtualNetworksInner.beginCreateOrUpdate | public VirtualNetworkInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) {
"""
Creates or updates a virtual network in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virt... | java | public VirtualNetworkInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().single().body();
} | [
"public",
"VirtualNetworkInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkName",
",",
"VirtualNetworkInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualN... | Creates or updates a virtual network in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@param parameters Parameters supplied to the create or update virtual network operation
@throws IllegalArgumentException thrown if pa... | [
"Creates",
"or",
"updates",
"a",
"virtual",
"network",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java#L531-L533 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/ThriftDataResultHelper.java | ThriftDataResultHelper.transformThriftResultAndAddToList | public <T> List<T> transformThriftResultAndAddToList(Map<ByteBuffer, List<ColumnOrSuperColumn>> coscResultMap,
ColumnFamilyType columnFamilyType, ThriftRow row) {
"""
Transforms data retrieved as result via thrift to a List whose content
type is determined by {@link ColumnFamilyType}.
@param <T> th... | java | public <T> List<T> transformThriftResultAndAddToList(Map<ByteBuffer, List<ColumnOrSuperColumn>> coscResultMap,
ColumnFamilyType columnFamilyType, ThriftRow row)
{
List<ColumnOrSuperColumn> coscList = new ArrayList<ColumnOrSuperColumn>();
for (List<ColumnOrSuperColumn> list : coscResult... | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"transformThriftResultAndAddToList",
"(",
"Map",
"<",
"ByteBuffer",
",",
"List",
"<",
"ColumnOrSuperColumn",
">",
">",
"coscResultMap",
",",
"ColumnFamilyType",
"columnFamilyType",
",",
"ThriftRow",
"row",
")",
"{"... | Transforms data retrieved as result via thrift to a List whose content
type is determined by {@link ColumnFamilyType}.
@param <T> the generic type
@param coscResultMap the cosc result map
@param columnFamilyType the column family type
@param row the row
@return the list | [
"Transforms",
"data",
"retrieved",
"as",
"result",
"via",
"thrift",
"to",
"a",
"List",
"whose",
"content",
"type",
"is",
"determined",
"by",
"{",
"@link",
"ColumnFamilyType",
"}",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/ThriftDataResultHelper.java#L191-L203 |
BioPAX/Paxtools | paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java | QueryExecuter.runGOI | public static Set<BioPAXElement> runGOI(
Set<BioPAXElement> sourceSet,
Model model,
int limit,
Filter... filters) {
"""
Gets paths between the seed nodes.
@param sourceSet Seed to the query
@param model BioPAX model
@param limit Length limit for the paths to be found
@param filters for filtering graph ... | java | public static Set<BioPAXElement> runGOI(
Set<BioPAXElement> sourceSet,
Model model,
int limit,
Filter... filters)
{
return runPathsFromTo(sourceSet, sourceSet, model, LimitType.NORMAL, limit, filters);
} | [
"public",
"static",
"Set",
"<",
"BioPAXElement",
">",
"runGOI",
"(",
"Set",
"<",
"BioPAXElement",
">",
"sourceSet",
",",
"Model",
"model",
",",
"int",
"limit",
",",
"Filter",
"...",
"filters",
")",
"{",
"return",
"runPathsFromTo",
"(",
"sourceSet",
",",
"s... | Gets paths between the seed nodes.
@param sourceSet Seed to the query
@param model BioPAX model
@param limit Length limit for the paths to be found
@param filters for filtering graph elements
@return BioPAX elements in the result
@deprecated Use runPathsBetween instead | [
"Gets",
"paths",
"between",
"the",
"seed",
"nodes",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java#L176-L183 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/SynchronizationGenerators.java | SynchronizationGenerators.enterMonitorAndStore | public static InsnList enterMonitorAndStore(MarkerType markerType, LockVariables lockVars) {
"""
Generates instruction to enter a monitor (top item on the stack) and store it in the {@link LockState} object sitting in the
lockstate variable.
@param markerType debug marker type
@param lockVars variables for lock... | java | public static InsnList enterMonitorAndStore(MarkerType markerType, LockVariables lockVars) {
Validate.notNull(markerType);
Validate.notNull(lockVars);
Variable lockStateVar = lockVars.getLockStateVar();
Validate.isTrue(lockStateVar != null);
Type clsType = Type.getType(LOCKSTAT... | [
"public",
"static",
"InsnList",
"enterMonitorAndStore",
"(",
"MarkerType",
"markerType",
",",
"LockVariables",
"lockVars",
")",
"{",
"Validate",
".",
"notNull",
"(",
"markerType",
")",
";",
"Validate",
".",
"notNull",
"(",
"lockVars",
")",
";",
"Variable",
"lock... | Generates instruction to enter a monitor (top item on the stack) and store it in the {@link LockState} object sitting in the
lockstate variable.
@param markerType debug marker type
@param lockVars variables for lock/synchpoint functionality
@return instructions to enter a monitor and store it in the {@link LockState} o... | [
"Generates",
"instruction",
"to",
"enter",
"a",
"monitor",
"(",
"top",
"item",
"on",
"the",
"stack",
")",
"and",
"store",
"it",
"in",
"the",
"{"
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/SynchronizationGenerators.java#L149-L176 |
netty/netty | common/src/main/java/io/netty/util/NetUtil.java | NetUtil.createByteArrayFromIpAddressString | public static byte[] createByteArrayFromIpAddressString(String ipAddressString) {
"""
Creates an byte[] based on an ipAddressString. No error handling is performed here.
"""
if (isValidIpV4Address(ipAddressString)) {
return validIpV4ToBytes(ipAddressString);
}
if (isValidI... | java | public static byte[] createByteArrayFromIpAddressString(String ipAddressString) {
if (isValidIpV4Address(ipAddressString)) {
return validIpV4ToBytes(ipAddressString);
}
if (isValidIpV6Address(ipAddressString)) {
if (ipAddressString.charAt(0) == '[') {
ip... | [
"public",
"static",
"byte",
"[",
"]",
"createByteArrayFromIpAddressString",
"(",
"String",
"ipAddressString",
")",
"{",
"if",
"(",
"isValidIpV4Address",
"(",
"ipAddressString",
")",
")",
"{",
"return",
"validIpV4ToBytes",
"(",
"ipAddressString",
")",
";",
"}",
"if... | Creates an byte[] based on an ipAddressString. No error handling is performed here. | [
"Creates",
"an",
"byte",
"[]",
"based",
"on",
"an",
"ipAddressString",
".",
"No",
"error",
"handling",
"is",
"performed",
"here",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/NetUtil.java#L366-L385 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cdn_dedicated_serviceName_cacheRule_duration_POST | public OvhOrder cdn_dedicated_serviceName_cacheRule_duration_POST(String serviceName, String duration, OvhOrderCacheRuleEnum cacheRule) throws IOException {
"""
Create order
REST: POST /order/cdn/dedicated/{serviceName}/cacheRule/{duration}
@param cacheRule [required] cache rule upgrade option to 100 or 1000
... | java | public OvhOrder cdn_dedicated_serviceName_cacheRule_duration_POST(String serviceName, String duration, OvhOrderCacheRuleEnum cacheRule) throws IOException {
String qPath = "/order/cdn/dedicated/{serviceName}/cacheRule/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
HashMap<String, Object>o = n... | [
"public",
"OvhOrder",
"cdn_dedicated_serviceName_cacheRule_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhOrderCacheRuleEnum",
"cacheRule",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cdn/dedicated/{serviceName}/cacheR... | Create order
REST: POST /order/cdn/dedicated/{serviceName}/cacheRule/{duration}
@param cacheRule [required] cache rule upgrade option to 100 or 1000
@param serviceName [required] The internal name of your CDN offer
@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#L5293-L5300 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/res/XSLMessages.java | XSLMessages.createWarning | public static final String createWarning(String msgKey, Object args[]) //throws Exception {
"""
Creates a message from the specified key and replacement
arguments, localized to the given locale.
@param msgKey The key for the message text.
@param args The arguments to be used as replacement text
in t... | java | public static final String createWarning(String msgKey, Object args[]) //throws Exception
{
// BEGIN android-changed
// don't localize exception messages
return createMsg(XSLTBundle, msgKey, args);
// END android-changed
} | [
"public",
"static",
"final",
"String",
"createWarning",
"(",
"String",
"msgKey",
",",
"Object",
"args",
"[",
"]",
")",
"//throws Exception",
"{",
"// BEGIN android-changed",
"// don't localize exception messages",
"return",
"createMsg",
"(",
"XSLTBundle",
",",
"msgK... | Creates a message from the specified key and replacement
arguments, localized to the given locale.
@param msgKey The key for the message text.
@param args The arguments to be used as replacement text
in the message created.
@return The formatted warning string. | [
"Creates",
"a",
"message",
"from",
"the",
"specified",
"key",
"and",
"replacement",
"arguments",
"localized",
"to",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/res/XSLMessages.java#L66-L72 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java | HBasePanel.printHtmlBanner | public void printHtmlBanner(PrintWriter out, ResourceBundle reg)
throws DBException {
"""
Print the top nav menu.
@param out The html out stream.
@param reg The resources object.
@exception DBException File exception.
"""
if (HBasePanel.getFirstToUpper(this.getProperty(DBParams.BANNERS), 'N'... | java | public void printHtmlBanner(PrintWriter out, ResourceBundle reg)
throws DBException
{
if (HBasePanel.getFirstToUpper(this.getProperty(DBParams.BANNERS), 'N') == 'Y')
{
String strNav = reg.getString("htmlBanner");
strNav = Utility.replaceResources(strNav, reg, null, nu... | [
"public",
"void",
"printHtmlBanner",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"throws",
"DBException",
"{",
"if",
"(",
"HBasePanel",
".",
"getFirstToUpper",
"(",
"this",
".",
"getProperty",
"(",
"DBParams",
".",
"BANNERS",
")",
",",
"'",
... | Print the top nav menu.
@param out The html out stream.
@param reg The resources object.
@exception DBException File exception. | [
"Print",
"the",
"top",
"nav",
"menu",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L251-L260 |
Lukaszpg/jPUBG | src/main/java/pro/lukasgorny/factory/JPubgFactory.java | JPubgFactory.getWrapper | public static JPubg getWrapper(@Nonnull String apiKey, int connectionTimeout) {
"""
Returns fully initialized, ready to use API object with specified connection timeout.
@param apiKey your http://pubgtracker.com API-KEY
@param connectionTimeout connection timeout in miliseconds (default 5000 miliseconds - 5 se... | java | public static JPubg getWrapper(@Nonnull String apiKey, int connectionTimeout) {
validateApiKey(apiKey);
return new JPubgImpl(apiKey, connectionTimeout);
} | [
"public",
"static",
"JPubg",
"getWrapper",
"(",
"@",
"Nonnull",
"String",
"apiKey",
",",
"int",
"connectionTimeout",
")",
"{",
"validateApiKey",
"(",
"apiKey",
")",
";",
"return",
"new",
"JPubgImpl",
"(",
"apiKey",
",",
"connectionTimeout",
")",
";",
"}"
] | Returns fully initialized, ready to use API object with specified connection timeout.
@param apiKey your http://pubgtracker.com API-KEY
@param connectionTimeout connection timeout in miliseconds (default 5000 miliseconds - 5 seconds)
@return Fully initialized API object | [
"Returns",
"fully",
"initialized",
"ready",
"to",
"use",
"API",
"object",
"with",
"specified",
"connection",
"timeout",
"."
] | train | https://github.com/Lukaszpg/jPUBG/blob/e4ff6176dea5cb0f876e6d553f467ee882a4749a/src/main/java/pro/lukasgorny/factory/JPubgFactory.java#L34-L37 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/Try.java | Try.withResources | public static <A extends AutoCloseable, B extends AutoCloseable, C> Try<Exception, C> withResources(
CheckedSupplier<? extends Exception, ? extends A> aSupplier,
CheckedFn1<? extends Exception, ? super A, ? extends B> bFn,
CheckedFn1<? extends Exception, ? super B, ? extends Try<? ex... | java | public static <A extends AutoCloseable, B extends AutoCloseable, C> Try<Exception, C> withResources(
CheckedSupplier<? extends Exception, ? extends A> aSupplier,
CheckedFn1<? extends Exception, ? super A, ? extends B> bFn,
CheckedFn1<? extends Exception, ? super B, ? extends Try<? ex... | [
"public",
"static",
"<",
"A",
"extends",
"AutoCloseable",
",",
"B",
"extends",
"AutoCloseable",
",",
"C",
">",
"Try",
"<",
"Exception",
",",
"C",
">",
"withResources",
"(",
"CheckedSupplier",
"<",
"?",
"extends",
"Exception",
",",
"?",
"extends",
"A",
">",... | Convenience overload of {@link Try#withResources(CheckedSupplier, CheckedFn1) withResources} that cascades
dependent resource creation via nested calls.
@param aSupplier the first resource supplier
@param bFn the dependent resource function
@param fn the function body
@param <A> the first resource t... | [
"Convenience",
"overload",
"of",
"{",
"@link",
"Try#withResources",
"(",
"CheckedSupplier",
"CheckedFn1",
")",
"withResources",
"}",
"that",
"cascades",
"dependent",
"resource",
"creation",
"via",
"nested",
"calls",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/Try.java#L342-L347 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.purgeDeletedSecret | public void purgeDeletedSecret(String vaultBaseUrl, String secretName) {
"""
Permanently deletes the specified secret.
The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires ... | java | public void purgeDeletedSecret(String vaultBaseUrl, String secretName) {
purgeDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).toBlocking().single().body();
} | [
"public",
"void",
"purgeDeletedSecret",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
")",
"{",
"purgeDeletedSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"bod... | Permanently deletes the specified secret.
The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission.
@param vaultBaseUrl The vault name, for example http... | [
"Permanently",
"deletes",
"the",
"specified",
"secret",
".",
"The",
"purge",
"deleted",
"secret",
"operation",
"removes",
"the",
"secret",
"permanently",
"without",
"the",
"possibility",
"of",
"recovery",
".",
"This",
"operation",
"can",
"only",
"be",
"enabled",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L4730-L4732 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrInvalidPropertyName | public static void assertTrueOrInvalidPropertyName(boolean expression, SQLProperty item1, SQLProperty item2) {
"""
Assert true or invalid property name.
@param expression
the expression
@param item1
the item 1
@param item2
the item 2
"""
if (!expression) {
String msg = String.format("Properties '%... | java | public static void assertTrueOrInvalidPropertyName(boolean expression, SQLProperty item1, SQLProperty item2) {
if (!expression) {
String msg = String.format("Properties '%s#%s' and '%s#%s' must have same column name",
item1.getParent().name, item1.name, item2.getParent().name, item2.name);
throw (new Inval... | [
"public",
"static",
"void",
"assertTrueOrInvalidPropertyName",
"(",
"boolean",
"expression",
",",
"SQLProperty",
"item1",
",",
"SQLProperty",
"item2",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"String",
"msg",
"=",
"String",
".",
"format",
"(",
"\"Prop... | Assert true or invalid property name.
@param expression
the expression
@param item1
the item 1
@param item2
the item 2 | [
"Assert",
"true",
"or",
"invalid",
"property",
"name",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L327-L334 |
wg/lettuce | src/main/java/com/lambdaworks/redis/RedisClient.java | RedisClient.connectPubSub | public <K, V> RedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec) {
"""
Open a new pub/sub connection to the redis server. Use the supplied
{@link RedisCodec codec} to encode/decode keys and values.
@param codec Use this codec to encode/decode keys and values.
@return A new pub/sub connection.... | java | public <K, V> RedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec) {
BlockingQueue<Command<K, V, ?>> queue = new LinkedBlockingQueue<Command<K, V, ?>>();
PubSubCommandHandler<K, V> handler = new PubSubCommandHandler<K, V>(queue, codec);
RedisPubSubConnection<K, V> connection = new ... | [
"public",
"<",
"K",
",",
"V",
">",
"RedisPubSubConnection",
"<",
"K",
",",
"V",
">",
"connectPubSub",
"(",
"RedisCodec",
"<",
"K",
",",
"V",
">",
"codec",
")",
"{",
"BlockingQueue",
"<",
"Command",
"<",
"K",
",",
"V",
",",
"?",
">",
">",
"queue",
... | Open a new pub/sub connection to the redis server. Use the supplied
{@link RedisCodec codec} to encode/decode keys and values.
@param codec Use this codec to encode/decode keys and values.
@return A new pub/sub connection. | [
"Open",
"a",
"new",
"pub",
"/",
"sub",
"connection",
"to",
"the",
"redis",
"server",
".",
"Use",
"the",
"supplied",
"{",
"@link",
"RedisCodec",
"codec",
"}",
"to",
"encode",
"/",
"decode",
"keys",
"and",
"values",
"."
] | train | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/RedisClient.java#L150-L157 |
jboss/jboss-el-api_spec | src/main/java/javax/el/ELManager.java | ELManager.defineBean | public Object defineBean(String name, Object bean) {
"""
Define a bean in the local bean repository
@param name The name of the bean
@param bean The bean instance to be defined. If null, the definition
of the bean is removed.
"""
Object ret = getELContext().getBeans().get(name);
getELContex... | java | public Object defineBean(String name, Object bean) {
Object ret = getELContext().getBeans().get(name);
getELContext().getBeans().put(name, bean);
return ret;
} | [
"public",
"Object",
"defineBean",
"(",
"String",
"name",
",",
"Object",
"bean",
")",
"{",
"Object",
"ret",
"=",
"getELContext",
"(",
")",
".",
"getBeans",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"getELContext",
"(",
")",
".",
"getBeans",
"(",
")... | Define a bean in the local bean repository
@param name The name of the bean
@param bean The bean instance to be defined. If null, the definition
of the bean is removed. | [
"Define",
"a",
"bean",
"in",
"the",
"local",
"bean",
"repository"
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELManager.java#L177-L181 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java | DebuggableThreadPoolExecutor.createWithFixedPoolSize | public static DebuggableThreadPoolExecutor createWithFixedPoolSize(String threadPoolName, int size) {
"""
Returns a ThreadPoolExecutor with a fixed number of threads.
When all threads are actively executing tasks, new tasks are queued.
If (most) threads are expected to be idle most of the time, prefer createWith... | java | public static DebuggableThreadPoolExecutor createWithFixedPoolSize(String threadPoolName, int size)
{
return createWithMaximumPoolSize(threadPoolName, size, Integer.MAX_VALUE, TimeUnit.SECONDS);
} | [
"public",
"static",
"DebuggableThreadPoolExecutor",
"createWithFixedPoolSize",
"(",
"String",
"threadPoolName",
",",
"int",
"size",
")",
"{",
"return",
"createWithMaximumPoolSize",
"(",
"threadPoolName",
",",
"size",
",",
"Integer",
".",
"MAX_VALUE",
",",
"TimeUnit",
... | Returns a ThreadPoolExecutor with a fixed number of threads.
When all threads are actively executing tasks, new tasks are queued.
If (most) threads are expected to be idle most of the time, prefer createWithMaxSize() instead.
@param threadPoolName the name of the threads created by this executor
@param size the fixed n... | [
"Returns",
"a",
"ThreadPoolExecutor",
"with",
"a",
"fixed",
"number",
"of",
"threads",
".",
"When",
"all",
"threads",
"are",
"actively",
"executing",
"tasks",
"new",
"tasks",
"are",
"queued",
".",
"If",
"(",
"most",
")",
"threads",
"are",
"expected",
"to",
... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java#L110-L113 |
nutzam/nutzboot | nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java | FastdfsService.getFileName | private String getFileName(int type, String tokenFilename) {
"""
获取文件名
@param type 0-原图 1水印图 2缩略图
@param tokenFilename 文件名
@return
"""
StringBuilder sb = new StringBuilder();
String filename = tokenFilename.substring(0, tokenFilename.indexOf(EXT_SEPERATOR));
String ext = t... | java | private String getFileName(int type, String tokenFilename) {
StringBuilder sb = new StringBuilder();
String filename = tokenFilename.substring(0, tokenFilename.indexOf(EXT_SEPERATOR));
String ext = tokenFilename.substring(tokenFilename.indexOf(EXT_SEPERATOR));
sb.append(filename);
... | [
"private",
"String",
"getFileName",
"(",
"int",
"type",
",",
"String",
"tokenFilename",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"filename",
"=",
"tokenFilename",
".",
"substring",
"(",
"0",
",",
"tokenFilename",
... | 获取文件名
@param type 0-原图 1水印图 2缩略图
@param tokenFilename 文件名
@return | [
"获取文件名"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java#L174-L189 |
lessthanoptimal/ddogleg | src/org/ddogleg/nn/alg/VpTree.java | VpTree.nthElement | private void nthElement(int left, int right, int n, double[] origin) {
"""
Ensures that the n-th element is in a correct position in the list based on
the distance from origin.
@param left start of range
@param right end of range (exclusive)
@param n element to put in the right position
@param origin origin t... | java | private void nthElement(int left, int right, int n, double[] origin) {
int npos = partitionItems(left, right, n, origin);
if (npos < n)
nthElement(npos + 1, right, n, origin);
if (npos > n)
nthElement(left, npos, n, origin);
} | [
"private",
"void",
"nthElement",
"(",
"int",
"left",
",",
"int",
"right",
",",
"int",
"n",
",",
"double",
"[",
"]",
"origin",
")",
"{",
"int",
"npos",
"=",
"partitionItems",
"(",
"left",
",",
"right",
",",
"n",
",",
"origin",
")",
";",
"if",
"(",
... | Ensures that the n-th element is in a correct position in the list based on
the distance from origin.
@param left start of range
@param right end of range (exclusive)
@param n element to put in the right position
@param origin origin to compute the distance to | [
"Ensures",
"that",
"the",
"n",
"-",
"th",
"element",
"is",
"in",
"a",
"correct",
"position",
"in",
"the",
"list",
"based",
"on",
"the",
"distance",
"from",
"origin",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/nn/alg/VpTree.java#L133-L139 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.deleteStream | public CompletableFuture<DeleteStreamStatus.Status> deleteStream(final String scope, final String stream,
final OperationContext contextOpt) {
"""
Delete a stream. Precondition for deleting a stream is that the stream sholud be sealed.
@param ... | java | public CompletableFuture<DeleteStreamStatus.Status> deleteStream(final String scope, final String stream,
final OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, strea... | [
"public",
"CompletableFuture",
"<",
"DeleteStreamStatus",
".",
"Status",
">",
"deleteStream",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"OperationContext",
"contextOpt",
")",
"{",
"final",
"OperationContext",
"context",
"=",
... | Delete a stream. Precondition for deleting a stream is that the stream sholud be sealed.
@param scope scope.
@param stream stream name.
@param contextOpt optional context
@return delete status. | [
"Delete",
"a",
"stream",
".",
"Precondition",
"for",
"deleting",
"a",
"stream",
"is",
"that",
"the",
"stream",
"sholud",
"be",
"sealed",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L484-L512 |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java | AnimationInteractivityManager.StringFieldMatch | private boolean StringFieldMatch (String original, String matching) {
"""
/* Allows string matching fields, handling mis-matched case, if value has 'set' so
'set_translation' and 'translation' or 'translation_changed' and 'translation' match.
Also gets rid of leading and trailing spaces. All possible in JavaScr... | java | private boolean StringFieldMatch (String original, String matching) {
boolean equal = false;
original = original.toLowerCase().trim();
matching = matching.toLowerCase();
if (original.endsWith(matching)) {
equal = true;
}
else if (original.startsWith(matching))... | [
"private",
"boolean",
"StringFieldMatch",
"(",
"String",
"original",
",",
"String",
"matching",
")",
"{",
"boolean",
"equal",
"=",
"false",
";",
"original",
"=",
"original",
".",
"toLowerCase",
"(",
")",
".",
"trim",
"(",
")",
";",
"matching",
"=",
"matchi... | /* Allows string matching fields, handling mis-matched case, if value has 'set' so
'set_translation' and 'translation' or 'translation_changed' and 'translation' match.
Also gets rid of leading and trailing spaces. All possible in JavaScript and X3D Routes. | [
"/",
"*",
"Allows",
"string",
"matching",
"fields",
"handling",
"mis",
"-",
"matched",
"case",
"if",
"value",
"has",
"set",
"so",
"set_translation",
"and",
"translation",
"or",
"translation_changed",
"and",
"translation",
"match",
".",
"Also",
"gets",
"rid",
"... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java#L1556-L1567 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.