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 |
|---|---|---|---|---|---|---|---|---|---|---|
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/ServletContextFacesContextFactory.java | ServletContextFacesContextFactory.getFacesContext | @Override
public FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException {
"""
/*
Consult the initContextServletContextMap (reflectively obtained from
the FacesContext in our ctor). If it is non-empty, obtain
the ServletContext corresponding ... | java | @Override
public FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException {
FacesContext result = null;
if (null != initContextServletContextMap && !initContextServletContextMap.isEmpty()) {
ServletContext servletContext = (... | [
"@",
"Override",
"public",
"FacesContext",
"getFacesContext",
"(",
"Object",
"context",
",",
"Object",
"request",
",",
"Object",
"response",
",",
"Lifecycle",
"lifecycle",
")",
"throws",
"FacesException",
"{",
"FacesContext",
"result",
"=",
"null",
";",
"if",
"(... | /*
Consult the initContextServletContextMap (reflectively obtained from
the FacesContext in our ctor). If it is non-empty, obtain
the ServletContext corresponding to the current Thread's context ClassLoader.
If found, use the initContextServletContextMap to find the FacesContext
corresponding to that ServletContext. | [
"/",
"*",
"Consult",
"the",
"initContextServletContextMap",
"(",
"reflectively",
"obtained",
"from",
"the",
"FacesContext",
"in",
"our",
"ctor",
")",
".",
"If",
"it",
"is",
"non",
"-",
"empty",
"obtain",
"the",
"ServletContext",
"corresponding",
"to",
"the",
"... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/ServletContextFacesContextFactory.java#L138-L154 |
apereo/cas | support/cas-server-support-pac4j-authentication/src/main/java/org/apereo/cas/integration/pac4j/authentication/handler/support/AbstractPac4jAuthenticationHandler.java | AbstractPac4jAuthenticationHandler.finalizeAuthenticationHandlerResult | protected AuthenticationHandlerExecutionResult finalizeAuthenticationHandlerResult(final ClientCredential credentials,
final Principal principal,
... | java | protected AuthenticationHandlerExecutionResult finalizeAuthenticationHandlerResult(final ClientCredential credentials,
final Principal principal,
... | [
"protected",
"AuthenticationHandlerExecutionResult",
"finalizeAuthenticationHandlerResult",
"(",
"final",
"ClientCredential",
"credentials",
",",
"final",
"Principal",
"principal",
",",
"final",
"UserProfile",
"profile",
",",
"final",
"BaseClient",
"client",
")",
"{",
"preF... | Finalize authentication handler result.
@param credentials the credentials
@param principal the principal
@param profile the profile
@param client the client
@return the authentication handler execution result | [
"Finalize",
"authentication",
"handler",
"result",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-authentication/src/main/java/org/apereo/cas/integration/pac4j/authentication/handler/support/AbstractPac4jAuthenticationHandler.java#L78-L84 |
jbundle/jbundle | thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlView.java | JHtmlView.getURLFromPath | public static URL getURLFromPath(String path, BaseApplet applet) {
"""
Get the URL from the path.
@param The resource path.
@return The URL.
"""
URL url = null;
try {
if ((url == null) && (path != null))
url = new URL(path);
} catch (MalformedURLException e... | java | public static URL getURLFromPath(String path, BaseApplet applet)
{
URL url = null;
try {
if ((url == null) && (path != null))
url = new URL(path);
} catch (MalformedURLException ex) {
Application app = null;
if (applet == null)
... | [
"public",
"static",
"URL",
"getURLFromPath",
"(",
"String",
"path",
",",
"BaseApplet",
"applet",
")",
"{",
"URL",
"url",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"(",
"url",
"==",
"null",
")",
"&&",
"(",
"path",
"!=",
"null",
")",
")",
"url",
"=",
... | Get the URL from the path.
@param The resource path.
@return The URL. | [
"Get",
"the",
"URL",
"from",
"the",
"path",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlView.java#L110-L128 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java | SequenceManagerNextValImpl.getUniqueLong | protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException {
"""
returns a unique long value for class clazz and field fieldName.
the returned number is unique accross all tables in the extent of clazz.
"""
long result;
// lookup sequence name
String sequenc... | java | protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
{
long result;
// lookup sequence name
String sequenceName = calculateSequenceName(field);
try
{
result = buildNextSequence(field.getClassDescriptor(), sequenceName);
... | [
"protected",
"long",
"getUniqueLong",
"(",
"FieldDescriptor",
"field",
")",
"throws",
"SequenceManagerException",
"{",
"long",
"result",
";",
"// lookup sequence name\r",
"String",
"sequenceName",
"=",
"calculateSequenceName",
"(",
"field",
")",
";",
"try",
"{",
"resu... | returns a unique long value for class clazz and field fieldName.
the returned number is unique accross all tables in the extent of clazz. | [
"returns",
"a",
"unique",
"long",
"value",
"for",
"class",
"clazz",
"and",
"field",
"fieldName",
".",
"the",
"returned",
"number",
"is",
"unique",
"accross",
"all",
"tables",
"in",
"the",
"extent",
"of",
"clazz",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java#L118-L155 |
devcon5io/common | classutils/src/main/java/io/devcon5/classutils/ResourceResolver.java | ResourceResolver.resolvePath | private String resolvePath(final String resource, final Class consumer) {
"""
Resolves a resource relative to a consumer class. If the resource path starts with a '/', it will be used as
is, because it does not denote a relative path. If the resource path is a relative path, it will be resolved
relative to the p... | java | private String resolvePath(final String resource, final Class consumer) {
if(resource.startsWith("/")) {
//absolute path
return resource;
}
final StringBuilder buf = new StringBuilder(32);
buf.append('/').append(consumer.getPackage().getName().replaceAll("\\.", "... | [
"private",
"String",
"resolvePath",
"(",
"final",
"String",
"resource",
",",
"final",
"Class",
"consumer",
")",
"{",
"if",
"(",
"resource",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"//absolute path",
"return",
"resource",
";",
"}",
"final",
"StringBui... | Resolves a resource relative to a consumer class. If the resource path starts with a '/', it will be used as
is, because it does not denote a relative path. If the resource path is a relative path, it will be resolved
relative to the package of the consumer class.
@param resource
the path to the resource to resolve. It... | [
"Resolves",
"a",
"resource",
"relative",
"to",
"a",
"consumer",
"class",
".",
"If",
"the",
"resource",
"path",
"starts",
"with",
"a",
"/",
"it",
"will",
"be",
"used",
"as",
"is",
"because",
"it",
"does",
"not",
"denote",
"a",
"relative",
"path",
".",
"... | train | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/classutils/src/main/java/io/devcon5/classutils/ResourceResolver.java#L100-L110 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/NumberingOperator.java | NumberingOperator.getNumberingFormat | public static NumberingFormat getNumberingFormat(char formatCode) {
"""
Factory method for numbering format implementations. If format code is not recognized throws templates exception; anyway
validation tool catches this condition. See {@link NumberingFormat} for the list of valid format codes.
@param formatC... | java | public static NumberingFormat getNumberingFormat(char formatCode)
{
switch(formatCode) {
case 'n':
return new ArabicNumeralNumbering();
case 's':
return new LowerCaseStringNumbering();
case 'S':
return new UpperCaseStringNumbering();
case 'i':
return new LowerCase... | [
"public",
"static",
"NumberingFormat",
"getNumberingFormat",
"(",
"char",
"formatCode",
")",
"{",
"switch",
"(",
"formatCode",
")",
"{",
"case",
"'",
"'",
":",
"return",
"new",
"ArabicNumeralNumbering",
"(",
")",
";",
"case",
"'",
"'",
":",
"return",
"new",
... | Factory method for numbering format implementations. If format code is not recognized throws templates exception; anyway
validation tool catches this condition. See {@link NumberingFormat} for the list of valid format codes.
@param formatCode single char format code.
@return requested numbering format instance.
@throw... | [
"Factory",
"method",
"for",
"numbering",
"format",
"implementations",
".",
"If",
"format",
"code",
"is",
"not",
"recognized",
"throws",
"templates",
"exception",
";",
"anyway",
"validation",
"tool",
"catches",
"this",
"condition",
".",
"See",
"{",
"@link",
"Numb... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/NumberingOperator.java#L147-L162 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/VertexLabel.java | VertexLabel.removeEdgeRole | void removeEdgeRole(EdgeRole er, boolean preserveData) {
"""
remove a given edge role
@param er the edge role
@param preserveData should we keep the SQL data
"""
if (er.getVertexLabel() != this) {
throw new IllegalStateException("Trying to remove a EdgeRole from a non owner Ve... | java | void removeEdgeRole(EdgeRole er, boolean preserveData) {
if (er.getVertexLabel() != this) {
throw new IllegalStateException("Trying to remove a EdgeRole from a non owner VertexLabel");
}
Collection<VertexLabel> ers;
switch (er.getDirection()) {
// we don't support... | [
"void",
"removeEdgeRole",
"(",
"EdgeRole",
"er",
",",
"boolean",
"preserveData",
")",
"{",
"if",
"(",
"er",
".",
"getVertexLabel",
"(",
")",
"!=",
"this",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Trying to remove a EdgeRole from a non owner VertexL... | remove a given edge role
@param er the edge role
@param preserveData should we keep the SQL data | [
"remove",
"a",
"given",
"edge",
"role"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/VertexLabel.java#L1061-L1103 |
paymill/paymill-java | src/main/java/com/paymill/services/SubscriptionService.java | SubscriptionService.limitValidity | public Subscription limitValidity( Subscription subscription, Interval.Period newValidity ) {
"""
Change the period of validity for a subscription.
@param subscription the subscription.
@param newValidity the new validity.
@return the updated subscription.
"""
ParameterMap<String, String> params = new... | java | public Subscription limitValidity( Subscription subscription, Interval.Period newValidity ) {
ParameterMap<String, String> params = new ParameterMap<String, String>();
ValidationUtils.validatesIntervalPeriod( newValidity );
params.add( "period_of_validity", newValidity.toString() );
return RestfulUtils.... | [
"public",
"Subscription",
"limitValidity",
"(",
"Subscription",
"subscription",
",",
"Interval",
".",
"Period",
"newValidity",
")",
"{",
"ParameterMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"ParameterMap",
"<",
"String",
",",
"String",
">",
... | Change the period of validity for a subscription.
@param subscription the subscription.
@param newValidity the new validity.
@return the updated subscription. | [
"Change",
"the",
"period",
"of",
"validity",
"for",
"a",
"subscription",
"."
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/SubscriptionService.java#L551-L556 |
davidmoten/rxjava2-extras | src/main/java/com/github/davidmoten/rx2/flowable/Transformers.java | Transformers.doOnEmpty | public static <T> FlowableTransformer<T, T> doOnEmpty(final Action action) {
"""
Returns a transformer that when a stream is empty runs the given
{@link Action}.
<p>
<img src=
"https://raw.githubusercontent.com/davidmoten/rxjava2-extras/master/src/docs/doOnEmpty.png"
alt="image">
@param action
to be cal... | java | public static <T> FlowableTransformer<T, T> doOnEmpty(final Action action) {
return new FlowableTransformer<T, T>() {
@Override
public Publisher<T> apply(Flowable<T> upstream) {
return new FlowableDoOnEmpty<T>(upstream, action);
}
};
} | [
"public",
"static",
"<",
"T",
">",
"FlowableTransformer",
"<",
"T",
",",
"T",
">",
"doOnEmpty",
"(",
"final",
"Action",
"action",
")",
"{",
"return",
"new",
"FlowableTransformer",
"<",
"T",
",",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Publ... | Returns a transformer that when a stream is empty runs the given
{@link Action}.
<p>
<img src=
"https://raw.githubusercontent.com/davidmoten/rxjava2-extras/master/src/docs/doOnEmpty.png"
alt="image">
@param action
to be called when the stream is determined to be empty.
@param <T>
item type
@return a transformer that... | [
"Returns",
"a",
"transformer",
"that",
"when",
"a",
"stream",
"is",
"empty",
"runs",
"the",
"given",
"{",
"@link",
"Action",
"}",
"."
] | train | https://github.com/davidmoten/rxjava2-extras/blob/bf5ece3f97191f29a81957a6529bc3cfa4d7b328/src/main/java/com/github/davidmoten/rx2/flowable/Transformers.java#L88-L96 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java | LayoutService.getLayoutContentByAppId | @Override
public String getLayoutContentByAppId(String appId) {
"""
Load the layout associated with the specified application id.
@param appId An application id.
@return The layout content.
"""
String value = propertyService.getValue(PROPERTY_LAYOUT_ASSOCIATION, appId);
return value == ... | java | @Override
public String getLayoutContentByAppId(String appId) {
String value = propertyService.getValue(PROPERTY_LAYOUT_ASSOCIATION, appId);
return value == null ? null : getLayoutContent(new LayoutIdentifier(value, true));
} | [
"@",
"Override",
"public",
"String",
"getLayoutContentByAppId",
"(",
"String",
"appId",
")",
"{",
"String",
"value",
"=",
"propertyService",
".",
"getValue",
"(",
"PROPERTY_LAYOUT_ASSOCIATION",
",",
"appId",
")",
";",
"return",
"value",
"==",
"null",
"?",
"null"... | Load the layout associated with the specified application id.
@param appId An application id.
@return The layout content. | [
"Load",
"the",
"layout",
"associated",
"with",
"the",
"specified",
"application",
"id",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutService.java#L136-L140 |
jpmml/jpmml-evaluator | pmml-evaluator/src/main/java/org/jpmml/evaluator/TypeUtil.java | TypeUtil.toFloat | static
private Float toFloat(Object value) {
"""
<p>
Casts the specified value to Float data type.
</p>
@see DataType#FLOAT
"""
if(value instanceof Float){
return (Float)value;
} else
if(value instanceof Double){
Number number = (Number)value;
return toFloat(number.floatValue());
} el... | java | static
private Float toFloat(Object value){
if(value instanceof Float){
return (Float)value;
} else
if(value instanceof Double){
Number number = (Number)value;
return toFloat(number.floatValue());
} else
if((value instanceof Long) || (value instanceof Integer) || (value instanceof Short) || (val... | [
"static",
"private",
"Float",
"toFloat",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Float",
")",
"{",
"return",
"(",
"Float",
")",
"value",
";",
"}",
"else",
"if",
"(",
"value",
"instanceof",
"Double",
")",
"{",
"Number",
"num... | <p>
Casts the specified value to Float data type.
</p>
@see DataType#FLOAT | [
"<p",
">",
"Casts",
"the",
"specified",
"value",
"to",
"Float",
"data",
"type",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/jpmml/jpmml-evaluator/blob/ac8a48775877b6fa9dbc5f259871f3278489cc61/pmml-evaluator/src/main/java/org/jpmml/evaluator/TypeUtil.java#L629-L661 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java | AbstractJsonDeserializer.parseDefault | public Double parseDefault(String input, Double defaultValue) {
"""
Convenience method. Parses a string into a double. If it can no be converted to a double, the
defaultvalue is returned. Depending on your choice, you can allow null as output or assign it some value
and have very convenient syntax such as: doubl... | java | public Double parseDefault(String input, Double defaultValue) {
if (input == null) {
return defaultValue;
}
Double answer = defaultValue;
try {
answer = Double.parseDouble(input);
} catch (NumberFormatException ignored) {
}
return answer;
... | [
"public",
"Double",
"parseDefault",
"(",
"String",
"input",
",",
"Double",
"defaultValue",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"Double",
"answer",
"=",
"defaultValue",
";",
"try",
"{",
"answer",
"=",
... | Convenience method. Parses a string into a double. If it can no be converted to a double, the
defaultvalue is returned. Depending on your choice, you can allow null as output or assign it some value
and have very convenient syntax such as: double d = parseDefault(myString, 0.0); which is a lot shorter
than dealing with... | [
"Convenience",
"method",
".",
"Parses",
"a",
"string",
"into",
"a",
"double",
".",
"If",
"it",
"can",
"no",
"be",
"converted",
"to",
"a",
"double",
"the",
"defaultvalue",
"is",
"returned",
".",
"Depending",
"on",
"your",
"choice",
"you",
"can",
"allow",
... | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java#L314-L324 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.backupStorageAccountAsync | public ServiceFuture<BackupStorageResult> backupStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback<BackupStorageResult> serviceCallback) {
"""
Backs up the specified storage account.
Requests that a backup of the specified storage account be downloaded to the client. This op... | java | public ServiceFuture<BackupStorageResult> backupStorageAccountAsync(String vaultBaseUrl, String storageAccountName, final ServiceCallback<BackupStorageResult> serviceCallback) {
return ServiceFuture.fromResponse(backupStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName), serviceCallback);
... | [
"public",
"ServiceFuture",
"<",
"BackupStorageResult",
">",
"backupStorageAccountAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"final",
"ServiceCallback",
"<",
"BackupStorageResult",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFu... | Backs up the specified storage account.
Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.... | [
"Backs",
"up",
"the",
"specified",
"storage",
"account",
".",
"Requests",
"that",
"a",
"backup",
"of",
"the",
"specified",
"storage",
"account",
"be",
"downloaded",
"to",
"the",
"client",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"backup",
... | 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#L9534-L9536 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addScriptProperties | public void addScriptProperties(Content head) {
"""
Add a link to the JavaScript file.
@param head the content tree to which the files will be added
"""
HtmlTree javascript = HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
head.addContent(javascript);
if (configur... | java | public void addScriptProperties(Content head) {
HtmlTree javascript = HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
head.addContent(javascript);
if (configuration.createindex) {
if (pathToRoot != null && script != null) {
String ptrPath = pathToR... | [
"public",
"void",
"addScriptProperties",
"(",
"Content",
"head",
")",
"{",
"HtmlTree",
"javascript",
"=",
"HtmlTree",
".",
"SCRIPT",
"(",
"pathToRoot",
".",
"resolve",
"(",
"DocPaths",
".",
"JAVASCRIPT",
")",
".",
"getPath",
"(",
")",
")",
";",
"head",
"."... | Add a link to the JavaScript file.
@param head the content tree to which the files will be added | [
"Add",
"a",
"link",
"to",
"the",
"JavaScript",
"file",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L2163-L2179 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/util/OgnlUtil.java | OgnlUtil.parseExpression | public static Object parseExpression(String expression, String path, int lineNumber) {
"""
Parses an OGNL expression.
@param expression the expression
@param path the path
@param lineNumber the line number
@return a tree representation of the OGNL expression
@throws OgnlRuntimeException when a {@link og... | java | public static Object parseExpression(String expression, String path, int lineNumber) {
try {
return Ognl.parseExpression(expression);
} catch (Exception ex) {
throw new OgnlRuntimeException(ex, path, lineNumber);
}
} | [
"public",
"static",
"Object",
"parseExpression",
"(",
"String",
"expression",
",",
"String",
"path",
",",
"int",
"lineNumber",
")",
"{",
"try",
"{",
"return",
"Ognl",
".",
"parseExpression",
"(",
"expression",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
... | Parses an OGNL expression.
@param expression the expression
@param path the path
@param lineNumber the line number
@return a tree representation of the OGNL expression
@throws OgnlRuntimeException when a {@link ognl.OgnlException} occurs | [
"Parses",
"an",
"OGNL",
"expression",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/util/OgnlUtil.java#L132-L138 |
beckchr/juel | modules/api/src/main/java/javax/el/ELContext.java | ELContext.putContext | public void putContext(Class<?> key, Object contextObject) {
"""
Associates a context object with this ELContext. The ELContext maintains a collection of
context objects relevant to the evaluation of an expression. These context objects are used
by ELResolvers. This method is used to add a context object to that... | java | public void putContext(Class<?> key, Object contextObject) {
if (key == null) {
throw new NullPointerException("key is null");
}
if (context == null) {
context = new HashMap<Class<?>, Object>();
}
context.put(key, contextObject);
} | [
"public",
"void",
"putContext",
"(",
"Class",
"<",
"?",
">",
"key",
",",
"Object",
"contextObject",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"key is null\"",
")",
";",
"}",
"if",
"(",
"context",
... | Associates a context object with this ELContext. The ELContext maintains a collection of
context objects relevant to the evaluation of an expression. These context objects are used
by ELResolvers. This method is used to add a context object to that collection. By
convention, the contextObject will be of the type specif... | [
"Associates",
"a",
"context",
"object",
"with",
"this",
"ELContext",
".",
"The",
"ELContext",
"maintains",
"a",
"collection",
"of",
"context",
"objects",
"relevant",
"to",
"the",
"evaluation",
"of",
"an",
"expression",
".",
"These",
"context",
"objects",
"are",
... | train | https://github.com/beckchr/juel/blob/1a8fb366b7349ddae81f806dee1ab2de11b672c7/modules/api/src/main/java/javax/el/ELContext.java#L138-L146 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfImportedPage.java | PdfImportedPage.addTemplate | public void addTemplate(PdfTemplate template, float a, float b, float c, float d, float e, float f) {
"""
Always throws an error. This operation is not allowed.
@param template dummy
@param a dummy
@param b dummy
@param c dummy
@param d dummy
@param e dummy
@param f dummy
"""
throwError();
... | java | public void addTemplate(PdfTemplate template, float a, float b, float c, float d, float e, float f) {
throwError();
} | [
"public",
"void",
"addTemplate",
"(",
"PdfTemplate",
"template",
",",
"float",
"a",
",",
"float",
"b",
",",
"float",
"c",
",",
"float",
"d",
",",
"float",
"e",
",",
"float",
"f",
")",
"{",
"throwError",
"(",
")",
";",
"}"
] | Always throws an error. This operation is not allowed.
@param template dummy
@param a dummy
@param b dummy
@param c dummy
@param d dummy
@param e dummy
@param f dummy | [
"Always",
"throws",
"an",
"error",
".",
"This",
"operation",
"is",
"not",
"allowed",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfImportedPage.java#L109-L111 |
Harium/keel | src/main/java/com/harium/keel/effect/LevelsCurve.java | LevelsCurve.setCurve | public void setCurve(Curve curveRed, Curve curveGreen, Curve curveBlue) {
"""
Set curves.
@param curveRed Red curve.
@param curveGreen Green curve.
@param curveBlue Blue curve.
"""
this.curveRed = curveRed;
this.curveGreen = curveGreen;
this.curveBlue = curveBlue;
} | java | public void setCurve(Curve curveRed, Curve curveGreen, Curve curveBlue) {
this.curveRed = curveRed;
this.curveGreen = curveGreen;
this.curveBlue = curveBlue;
} | [
"public",
"void",
"setCurve",
"(",
"Curve",
"curveRed",
",",
"Curve",
"curveGreen",
",",
"Curve",
"curveBlue",
")",
"{",
"this",
".",
"curveRed",
"=",
"curveRed",
";",
"this",
".",
"curveGreen",
"=",
"curveGreen",
";",
"this",
".",
"curveBlue",
"=",
"curve... | Set curves.
@param curveRed Red curve.
@param curveGreen Green curve.
@param curveBlue Blue curve. | [
"Set",
"curves",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/LevelsCurve.java#L104-L108 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractIntObjectMap.java | AbstractIntObjectMap.containsValue | public boolean containsValue(final Object value) {
"""
Returns <tt>true</tt> if the receiver contains the specified value.
Tests for identity.
@return <tt>true</tt> if the receiver contains the specified value.
"""
return ! forEachPair(
new IntObjectProcedure() {
public boolean apply(int iterKey,... | java | public boolean containsValue(final Object value) {
return ! forEachPair(
new IntObjectProcedure() {
public boolean apply(int iterKey, Object iterValue) {
return (value != iterValue);
}
}
);
} | [
"public",
"boolean",
"containsValue",
"(",
"final",
"Object",
"value",
")",
"{",
"return",
"!",
"forEachPair",
"(",
"new",
"IntObjectProcedure",
"(",
")",
"{",
"public",
"boolean",
"apply",
"(",
"int",
"iterKey",
",",
"Object",
"iterValue",
")",
"{",
"return... | Returns <tt>true</tt> if the receiver contains the specified value.
Tests for identity.
@return <tt>true</tt> if the receiver contains the specified value. | [
"Returns",
"<tt",
">",
"true<",
"/",
"tt",
">",
"if",
"the",
"receiver",
"contains",
"the",
"specified",
"value",
".",
"Tests",
"for",
"identity",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractIntObjectMap.java#L54-L62 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showDetailsDialog | public static DetailsDialog showDetailsDialog (Stage stage, String text, String title, String details, boolean expandDetails) {
"""
Dialog with given title, provided text, and more details available after pressing 'Details' button.
@param expandDetails if true details will be visible without need to press 'Detail... | java | public static DetailsDialog showDetailsDialog (Stage stage, String text, String title, String details, boolean expandDetails) {
DetailsDialog dialog = new DetailsDialog(text, title, details);
dialog.setDetailsVisible(expandDetails);
stage.addActor(dialog.fadeIn());
return dialog;
} | [
"public",
"static",
"DetailsDialog",
"showDetailsDialog",
"(",
"Stage",
"stage",
",",
"String",
"text",
",",
"String",
"title",
",",
"String",
"details",
",",
"boolean",
"expandDetails",
")",
"{",
"DetailsDialog",
"dialog",
"=",
"new",
"DetailsDialog",
"(",
"tex... | Dialog with given title, provided text, and more details available after pressing 'Details' button.
@param expandDetails if true details will be visible without need to press 'Details' button | [
"Dialog",
"with",
"given",
"title",
"provided",
"text",
"and",
"more",
"details",
"available",
"after",
"pressing",
"Details",
"button",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L184-L189 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedConnection.java | MemcachedConnection.dbgBuffer | static String dbgBuffer(ByteBuffer b, int size) {
"""
Convert the {@link ByteBuffer} into a string for easier debugging.
@param b the buffer to debug.
@param size the size of the buffer.
@return the stringified {@link ByteBuffer}.
"""
StringBuilder sb = new StringBuilder();
byte[] bytes = b.array(... | java | static String dbgBuffer(ByteBuffer b, int size) {
StringBuilder sb = new StringBuilder();
byte[] bytes = b.array();
for (int i = 0; i < size; i++) {
char ch = (char) bytes[i];
if (Character.isWhitespace(ch) || Character.isLetterOrDigit(ch)) {
sb.append(ch);
} else {
sb.appe... | [
"static",
"String",
"dbgBuffer",
"(",
"ByteBuffer",
"b",
",",
"int",
"size",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"b",
".",
"array",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",... | Convert the {@link ByteBuffer} into a string for easier debugging.
@param b the buffer to debug.
@param size the size of the buffer.
@return the stringified {@link ByteBuffer}. | [
"Convert",
"the",
"{",
"@link",
"ByteBuffer",
"}",
"into",
"a",
"string",
"for",
"easier",
"debugging",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedConnection.java#L936-L949 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.comparetable | @Then("^I check that table '(.+?)' is iqual to$")
public void comparetable(String tableName, DataTable dataTable) throws Exception {
"""
/*
@param tableName
@param dataTable
compares two tables: pattern table and the result from remote database
by default: order by id
"""
Statement myStatement ... | java | @Then("^I check that table '(.+?)' is iqual to$")
public void comparetable(String tableName, DataTable dataTable) throws Exception {
Statement myStatement = null;
java.sql.ResultSet rs = null;
//from postgres table
List<String> sqlTable = new ArrayList<String>();
List<String... | [
"@",
"Then",
"(",
"\"^I check that table '(.+?)' is iqual to$\"",
")",
"public",
"void",
"comparetable",
"(",
"String",
"tableName",
",",
"DataTable",
"dataTable",
")",
"throws",
"Exception",
"{",
"Statement",
"myStatement",
"=",
"null",
";",
"java",
".",
"sql",
"... | /*
@param tableName
@param dataTable
compares two tables: pattern table and the result from remote database
by default: order by id | [
"/",
"*",
"@param",
"tableName",
"@param",
"dataTable",
"compares",
"two",
"tables",
":",
"pattern",
"table",
"and",
"the",
"result",
"from",
"remote",
"database",
"by",
"default",
":",
"order",
"by",
"id"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L952-L995 |
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.listWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync | public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName, final String instance) {
"""
Get metric definitions for a specific instance of a worker pool of an ... | java | public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName, final String instance) {
return listWorkerPoolInstanceMetricDefinitionsSinglePageAsync(resourceG... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"ResourceMetricDefinitionInner",
">",
">",
">",
"listWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
... | Get metric definitions for a specific instance of a worker pool of an App Service Environment.
Get metric definitions for a specific instance of a worker pool of an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environmen... | [
"Get",
"metric",
"definitions",
"for",
"a",
"specific",
"instance",
"of",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"metric",
"definitions",
"for",
"a",
"specific",
"instance",
"of",
"a",
"worker",
"pool",
"of",
"an",
... | 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#L5562-L5574 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayCountry | public static String getDisplayCountry(String localeID, ULocale displayLocale) {
"""
<strong>[icu]</strong> Returns a locale's country localized for display in the provided locale.
<b>Warning: </b>this is for the region part of a valid locale ID; it cannot just be the region code (like "FR").
To get the display ... | java | public static String getDisplayCountry(String localeID, ULocale displayLocale) {
return getDisplayCountryInternal(new ULocale(localeID), displayLocale);
} | [
"public",
"static",
"String",
"getDisplayCountry",
"(",
"String",
"localeID",
",",
"ULocale",
"displayLocale",
")",
"{",
"return",
"getDisplayCountryInternal",
"(",
"new",
"ULocale",
"(",
"localeID",
")",
",",
"displayLocale",
")",
";",
"}"
] | <strong>[icu]</strong> Returns a locale's country localized for display in the provided locale.
<b>Warning: </b>this is for the region part of a valid locale ID; it cannot just be the region code (like "FR").
To get the display name for a region alone, or for other options, use {@link LocaleDisplayNames} instead.
This ... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"a",
"locale",
"s",
"country",
"localized",
"for",
"display",
"in",
"the",
"provided",
"locale",
".",
"<b",
">",
"Warning",
":",
"<",
"/",
"b",
">",
"this",
"is",
"for",
"the",
"r... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1606-L1608 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java | XmlStreamReaderUtils.optionalBooleanAttribute | public static boolean optionalBooleanAttribute(
final XMLStreamReader reader,
final String localName,
final boolean defaultValue) {
"""
Returns the value of an attribute as a boolean. If the attribute is empty, this method
returns the default value provided.
@param reader
<... | java | public static boolean optionalBooleanAttribute(
final XMLStreamReader reader,
final String localName,
final boolean defaultValue) {
return optionalBooleanAttribute(reader, null, localName, defaultValue);
} | [
"public",
"static",
"boolean",
"optionalBooleanAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"localName",
",",
"final",
"boolean",
"defaultValue",
")",
"{",
"return",
"optionalBooleanAttribute",
"(",
"reader",
",",
"null",
",",
"loca... | Returns the value of an attribute as a boolean. If the attribute is empty, this method
returns the default value provided.
@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param localName
local name of attribute (the namespace is ignored).
@param defaultValue
default value
@return value of a... | [
"Returns",
"the",
"value",
"of",
"an",
"attribute",
"as",
"a",
"boolean",
".",
"If",
"the",
"attribute",
"is",
"empty",
"this",
"method",
"returns",
"the",
"default",
"value",
"provided",
"."
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L561-L566 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java | Ginv.addRowTimes | public static void addRowTimes(double[][] matrix, int diag, int fromCol, int row, double factor) {
"""
Add a factor times one row to another row
@param matrix
the matrix to modify
@param diag
coordinate on the diagonal
@param fromCol
first column to process
@param row
row to process
@param factor
facto... | java | public static void addRowTimes(double[][] matrix, int diag, int fromCol, int row, double factor) {
int cols = matrix[0].length;
double[] d = matrix[diag];
double[] r = matrix[row];
for (int col = fromCol; col < cols; col++) {
r[col] -= factor * d[col];
}
} | [
"public",
"static",
"void",
"addRowTimes",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"diag",
",",
"int",
"fromCol",
",",
"int",
"row",
",",
"double",
"factor",
")",
"{",
"int",
"cols",
"=",
"matrix",
"[",
"0",
"]",
".",
"length",
";"... | Add a factor times one row to another row
@param matrix
the matrix to modify
@param diag
coordinate on the diagonal
@param fromCol
first column to process
@param row
row to process
@param factor
factor to multiply | [
"Add",
"a",
"factor",
"times",
"one",
"row",
"to",
"another",
"row"
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L631-L638 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.isAuthorizationRequired | public boolean isAuthorizationRequired(int statusCode, Map<String, List<String>> headers) {
"""
Check if the params came from response that requires authorization
@param statusCode of the response
@param headers response headers
@return true if status is 401 or 403 and The value of the header contains 'Bearer'
... | java | public boolean isAuthorizationRequired(int statusCode, Map<String, List<String>> headers) {
if (headers.containsKey(WWW_AUTHENTICATE_HEADER_NAME)){
String authHeader = headers.get(WWW_AUTHENTICATE_HEADER_NAME).get(0);
return AuthorizationHeaderHelper.isAuthorizationRequired(statusCode, ... | [
"public",
"boolean",
"isAuthorizationRequired",
"(",
"int",
"statusCode",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"{",
"if",
"(",
"headers",
".",
"containsKey",
"(",
"WWW_AUTHENTICATE_HEADER_NAME",
")",
")",
"{",
"Str... | Check if the params came from response that requires authorization
@param statusCode of the response
@param headers response headers
@return true if status is 401 or 403 and The value of the header contains 'Bearer' | [
"Check",
"if",
"the",
"params",
"came",
"from",
"response",
"that",
"requires",
"authorization"
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L164-L172 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java | ResolvableType.forClassWithGenerics | public static ResolvableType forClassWithGenerics(Class<?> sourceClass, Class<?>... generics) {
"""
Return a {@link ResolvableType} for the specified {@link Class} with pre-declared generics.
@param sourceClass the source class
@param generics the generics of the class
@return a {@link ResolvableType} for the... | java | public static ResolvableType forClassWithGenerics(Class<?> sourceClass, Class<?>... generics) {
LettuceAssert.notNull(sourceClass, "Source class must not be null");
LettuceAssert.notNull(generics, "Generics must not be null");
ResolvableType[] resolvableGenerics = new ResolvableType[generics.len... | [
"public",
"static",
"ResolvableType",
"forClassWithGenerics",
"(",
"Class",
"<",
"?",
">",
"sourceClass",
",",
"Class",
"<",
"?",
">",
"...",
"generics",
")",
"{",
"LettuceAssert",
".",
"notNull",
"(",
"sourceClass",
",",
"\"Source class must not be null\"",
")",
... | Return a {@link ResolvableType} for the specified {@link Class} with pre-declared generics.
@param sourceClass the source class
@param generics the generics of the class
@return a {@link ResolvableType} for the specific class and generics
@see #forClassWithGenerics(Class, ResolvableType...) | [
"Return",
"a",
"{",
"@link",
"ResolvableType",
"}",
"for",
"the",
"specified",
"{",
"@link",
"Class",
"}",
"with",
"pre",
"-",
"declared",
"generics",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java#L877-L885 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/autocomplete/AbstractAutocompleteComponent.java | AbstractAutocompleteComponent.newAutocompleteJson | @SuppressWarnings("unchecked")
protected AutocompleteJson newAutocompleteJson(int id, T obj) {
"""
Create an {@link AutocompleteJson}
@param id
@param obj
@return a new instance of {@link AutocompleteJson}
"""
boolean thisOneSelected = obj.equals(getModelObject());
T objectValue = (T) getChoiceRende... | java | @SuppressWarnings("unchecked")
protected AutocompleteJson newAutocompleteJson(int id, T obj)
{
boolean thisOneSelected = obj.equals(getModelObject());
T objectValue = (T) getChoiceRenderer().getDisplayValue(obj);
Class<T> objectClass = (Class<T>) (objectValue == null ? null : objectValue.getClass());
String... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"AutocompleteJson",
"newAutocompleteJson",
"(",
"int",
"id",
",",
"T",
"obj",
")",
"{",
"boolean",
"thisOneSelected",
"=",
"obj",
".",
"equals",
"(",
"getModelObject",
"(",
")",
")",
";",
"T",
... | Create an {@link AutocompleteJson}
@param id
@param obj
@return a new instance of {@link AutocompleteJson} | [
"Create",
"an",
"{",
"@link",
"AutocompleteJson",
"}"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/autocomplete/AbstractAutocompleteComponent.java#L376-L401 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java | ToStringStyle.appendDetail | protected void appendDetail(final StringBuffer buffer, final String fieldName, final Map<?, ?> map) {
"""
<p>Append to the <code>toString</code> a <code>Map</code>.</p>
@param buffer the <code>StringBuffer</code> to populate
@param fieldName the field name, typically not used as already appended
@param map ... | java | protected void appendDetail(final StringBuffer buffer, final String fieldName, final Map<?, ?> map) {
buffer.append(map);
} | [
"protected",
"void",
"appendDetail",
"(",
"final",
"StringBuffer",
"buffer",
",",
"final",
"String",
"fieldName",
",",
"final",
"Map",
"<",
"?",
",",
"?",
">",
"map",
")",
"{",
"buffer",
".",
"append",
"(",
"map",
")",
";",
"}"
] | <p>Append to the <code>toString</code> a <code>Map</code>.</p>
@param buffer the <code>StringBuffer</code> to populate
@param fieldName the field name, typically not used as already appended
@param map the <code>Map</code> to add to the <code>toString</code>,
not <code>null</code> | [
"<p",
">",
"Append",
"to",
"the",
"<code",
">",
"toString<",
"/",
"code",
">",
"a",
"<code",
">",
"Map<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java#L649-L651 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartManager.java | DriverRestartManager.onRestart | public synchronized void onRestart(final StartTime startTime,
final List<EventHandler<DriverRestarted>> orderedHandlers) {
"""
Recovers the list of alive and failed evaluators and inform the driver restart handlers and inform the
evaluator failure handlers based on the specifi... | java | public synchronized void onRestart(final StartTime startTime,
final List<EventHandler<DriverRestarted>> orderedHandlers) {
if (this.state == DriverRestartState.BEGAN) {
restartEvaluators = driverRuntimeRestartManager.getPreviousEvaluators();
final DriverRestarted res... | [
"public",
"synchronized",
"void",
"onRestart",
"(",
"final",
"StartTime",
"startTime",
",",
"final",
"List",
"<",
"EventHandler",
"<",
"DriverRestarted",
">",
">",
"orderedHandlers",
")",
"{",
"if",
"(",
"this",
".",
"state",
"==",
"DriverRestartState",
".",
"... | Recovers the list of alive and failed evaluators and inform the driver restart handlers and inform the
evaluator failure handlers based on the specific runtime. Also sets the expected amount of evaluators to report
back as alive to the job driver. | [
"Recovers",
"the",
"list",
"of",
"alive",
"and",
"failed",
"evaluators",
"and",
"inform",
"the",
"driver",
"restart",
"handlers",
"and",
"inform",
"the",
"evaluator",
"failure",
"handlers",
"based",
"on",
"the",
"specific",
"runtime",
".",
"Also",
"sets",
"the... | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/driver/restart/DriverRestartManager.java#L111-L140 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectRayCircle | public static boolean intersectRayCircle(Vector2fc origin, Vector2fc dir, Vector2fc center, float radiusSquared, Vector2f result) {
"""
Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the circle with the given <code>center</code> and square radius <code>radiusSqua... | java | public static boolean intersectRayCircle(Vector2fc origin, Vector2fc dir, Vector2fc center, float radiusSquared, Vector2f result) {
return intersectRayCircle(origin.x(), origin.y(), dir.x(), dir.y(), center.x(), center.y(), radiusSquared, result);
} | [
"public",
"static",
"boolean",
"intersectRayCircle",
"(",
"Vector2fc",
"origin",
",",
"Vector2fc",
"dir",
",",
"Vector2fc",
"center",
",",
"float",
"radiusSquared",
",",
"Vector2f",
"result",
")",
"{",
"return",
"intersectRayCircle",
"(",
"origin",
".",
"x",
"("... | Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the circle with the given <code>center</code> and square radius <code>radiusSquared</code>,
and store the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> for both points (near
and far) o... | [
"Test",
"whether",
"the",
"ray",
"with",
"the",
"given",
"<code",
">",
"origin<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"dir<",
"/",
"code",
">",
"intersects",
"the",
"circle",
"with",
"the",
"given",
"<code",
">",
"center<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L4267-L4269 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/CommitsApi.java | CommitsApi.addCommitStatus | public CommitStatus addCommitStatus(Object projectIdOrPath, String sha, CommitBuildState state, CommitStatus status) throws GitLabApiException {
"""
<p>Add or update the build status of a commit. The following fluent methods are available on the
CommitStatus instance for setting up the status:</p>
<pre><code>
... | java | public CommitStatus addCommitStatus(Object projectIdOrPath, String sha, CommitBuildState state, CommitStatus status) throws GitLabApiException {
if (projectIdOrPath == null) {
throw new RuntimeException("projectIdOrPath cannot be null");
}
if (sha == null || sha.trim().isEmpty()) {... | [
"public",
"CommitStatus",
"addCommitStatus",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"sha",
",",
"CommitBuildState",
"state",
",",
"CommitStatus",
"status",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"projectIdOrPath",
"==",
"null",
")",
"{",
"t... | <p>Add or update the build status of a commit. The following fluent methods are available on the
CommitStatus instance for setting up the status:</p>
<pre><code>
withCoverage(Float)
withDescription(String)
withName(String)
withRef(String)
withTargetUrl(String)
</code></pre>
<pre><code>GitLab Endpoint: POST /projects/... | [
"<p",
">",
"Add",
"or",
"update",
"the",
"build",
"status",
"of",
"a",
"commit",
".",
"The",
"following",
"fluent",
"methods",
"are",
"available",
"on",
"the",
"CommitStatus",
"instance",
"for",
"setting",
"up",
"the",
"status",
":",
"<",
"/",
"p",
">",
... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/CommitsApi.java#L430-L451 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.setLocal | public <T> void setLocal (Class<T> key, T attr) {
"""
Configures a local attribute on this object. Local attributes are not sent over the network
and are thus only available on the server or client that set the attribute. Local attributes
are keyed by the class of the value being set as an attribute (the expecta... | java | public <T> void setLocal (Class<T> key, T attr)
{
// locate any existing attribute that matches our key
for (int ii = 0, ll = _locattrs.length; ii < ll; ii++) {
if (key.isInstance(_locattrs[ii])) {
if (attr != null) {
throw new IllegalStateException(
... | [
"public",
"<",
"T",
">",
"void",
"setLocal",
"(",
"Class",
"<",
"T",
">",
"key",
",",
"T",
"attr",
")",
"{",
"// locate any existing attribute that matches our key",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"ll",
"=",
"_locattrs",
".",
"length",
";",
"ii"... | Configures a local attribute on this object. Local attributes are not sent over the network
and are thus only available on the server or client that set the attribute. Local attributes
are keyed by the class of the value being set as an attribute (the expectation is that local
attributes will be encapsulated into helpe... | [
"Configures",
"a",
"local",
"attribute",
"on",
"this",
"object",
".",
"Local",
"attributes",
"are",
"not",
"sent",
"over",
"the",
"network",
"and",
"are",
"thus",
"only",
"available",
"on",
"the",
"server",
"or",
"client",
"that",
"set",
"the",
"attribute",
... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L613-L635 |
kiegroup/drools | kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSupport.java | CompiledFEELSupport.compiledError | public static CompiledFEELExpression compiledError(String expression, String msg) {
"""
Generates a compilable class that reports a (compile-time) error at runtime
"""
return new CompilerBytecodeLoader()
.makeFromJPExpression(
expression,
... | java | public static CompiledFEELExpression compiledError(String expression, String msg) {
return new CompilerBytecodeLoader()
.makeFromJPExpression(
expression,
compiledErrorExpression(msg),
Collections.emptySet());
} | [
"public",
"static",
"CompiledFEELExpression",
"compiledError",
"(",
"String",
"expression",
",",
"String",
"msg",
")",
"{",
"return",
"new",
"CompilerBytecodeLoader",
"(",
")",
".",
"makeFromJPExpression",
"(",
"expression",
",",
"compiledErrorExpression",
"(",
"msg",... | Generates a compilable class that reports a (compile-time) error at runtime | [
"Generates",
"a",
"compilable",
"class",
"that",
"reports",
"a",
"(",
"compile",
"-",
"time",
")",
"error",
"at",
"runtime"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSupport.java#L464-L470 |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.singleDayEvent | private static boolean singleDayEvent(long startMillis, long endMillis, long localGmtOffset) {
"""
Returns whether the specified time interval is in a single day.
"""
if (startMillis == endMillis) {
return true;
}
// An event ending at midnight should still be a single-day ... | java | private static boolean singleDayEvent(long startMillis, long endMillis, long localGmtOffset) {
if (startMillis == endMillis) {
return true;
}
// An event ending at midnight should still be a single-day event, so check
// time end-1.
int startDay = Time.getJulianDay(s... | [
"private",
"static",
"boolean",
"singleDayEvent",
"(",
"long",
"startMillis",
",",
"long",
"endMillis",
",",
"long",
"localGmtOffset",
")",
"{",
"if",
"(",
"startMillis",
"==",
"endMillis",
")",
"{",
"return",
"true",
";",
"}",
"// An event ending at midnight shou... | Returns whether the specified time interval is in a single day. | [
"Returns",
"whether",
"the",
"specified",
"time",
"interval",
"is",
"in",
"a",
"single",
"day",
"."
] | train | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L735-L745 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getModulePathForRelativeURI | public static String getModulePathForRelativeURI( String uri ) {
"""
Get the Struts module path for a URI that is relative to the web application root.
@param uri the URI for which to get the module path.
"""
if ( uri == null ) return null;
assert uri.length() > 0;
assert uri.charAt(... | java | public static String getModulePathForRelativeURI( String uri )
{
if ( uri == null ) return null;
assert uri.length() > 0;
assert uri.charAt( 0 ) == '/' : uri;
// Strip off the actual page name (e.g., some_page.jsp)
int slash = uri.lastIndexOf( '/' );
uri = uri.substr... | [
"public",
"static",
"String",
"getModulePathForRelativeURI",
"(",
"String",
"uri",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"return",
"null",
";",
"assert",
"uri",
".",
"length",
"(",
")",
">",
"0",
";",
"assert",
"uri",
".",
"charAt",
"(",
"0",
... | Get the Struts module path for a URI that is relative to the web application root.
@param uri the URI for which to get the module path. | [
"Get",
"the",
"Struts",
"module",
"path",
"for",
"a",
"URI",
"that",
"is",
"relative",
"to",
"the",
"web",
"application",
"root",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L116-L127 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatRunFileOutput.java | DssatRunFileOutput.writeFile | @Override
public void writeFile(String arg0, ArrayList<HashMap> results) {
"""
DSSAT Run File Output method
@param arg0 file output path
@param results array of data holder object
"""
writeFile(arg0, new HashMap());
} | java | @Override
public void writeFile(String arg0, ArrayList<HashMap> results) {
writeFile(arg0, new HashMap());
} | [
"@",
"Override",
"public",
"void",
"writeFile",
"(",
"String",
"arg0",
",",
"ArrayList",
"<",
"HashMap",
">",
"results",
")",
"{",
"writeFile",
"(",
"arg0",
",",
"new",
"HashMap",
"(",
")",
")",
";",
"}"
] | DSSAT Run File Output method
@param arg0 file output path
@param results array of data holder object | [
"DSSAT",
"Run",
"File",
"Output",
"method"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatRunFileOutput.java#L39-L42 |
alkacon/opencms-core | src-modules/org/opencms/workplace/explorer/CmsNewResource.java | CmsNewResource.createPropertyObject | protected static CmsProperty createPropertyObject(String name, String value) {
"""
Creates a single property object and sets the value individual or shared depending on the OpenCms settings.<p>
@param name the name of the property
@param value the value to set
@return an initialized property object
"""
... | java | protected static CmsProperty createPropertyObject(String name, String value) {
CmsProperty prop = new CmsProperty();
prop.setAutoCreatePropertyDefinition(true);
prop.setName(name);
if (OpenCms.getWorkplaceManager().isDefaultPropertiesOnStructure()) {
prop.setValue(value, Cms... | [
"protected",
"static",
"CmsProperty",
"createPropertyObject",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"CmsProperty",
"prop",
"=",
"new",
"CmsProperty",
"(",
")",
";",
"prop",
".",
"setAutoCreatePropertyDefinition",
"(",
"true",
")",
";",
"prop",... | Creates a single property object and sets the value individual or shared depending on the OpenCms settings.<p>
@param name the name of the property
@param value the value to set
@return an initialized property object | [
"Creates",
"a",
"single",
"property",
"object",
"and",
"sets",
"the",
"value",
"individual",
"or",
"shared",
"depending",
"on",
"the",
"OpenCms",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/explorer/CmsNewResource.java#L205-L216 |
whitesource/fs-agent | src/main/java/org/whitesource/agent/dependency/resolver/docker/ArchLinuxParser.java | ArchLinuxParser.getDescFiles | private void getDescFiles(File dir, Collection<File> files) {
"""
Get the desc files from specific folder (every dec contains dependency info data)
"""
if (dir.isDirectory()) {
for (File file : dir.listFiles()) {
if (file.isDirectory()) {
getDescFiles(fil... | java | private void getDescFiles(File dir, Collection<File> files) {
if (dir.isDirectory()) {
for (File file : dir.listFiles()) {
if (file.isDirectory()) {
getDescFiles(file, files);
} else if (file.getName().equals(DESC)) {
files.add(... | [
"private",
"void",
"getDescFiles",
"(",
"File",
"dir",
",",
"Collection",
"<",
"File",
">",
"files",
")",
"{",
"if",
"(",
"dir",
".",
"isDirectory",
"(",
")",
")",
"{",
"for",
"(",
"File",
"file",
":",
"dir",
".",
"listFiles",
"(",
")",
")",
"{",
... | Get the desc files from specific folder (every dec contains dependency info data) | [
"Get",
"the",
"desc",
"files",
"from",
"specific",
"folder",
"(",
"every",
"dec",
"contains",
"dependency",
"info",
"data",
")"
] | train | https://github.com/whitesource/fs-agent/blob/d6ee4842c4f08f4aeda7eb2307b24c49b6bed0e1/src/main/java/org/whitesource/agent/dependency/resolver/docker/ArchLinuxParser.java#L109-L119 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java | Utility.checkCompare | public static <T extends Comparable<T>> int checkCompare(T a, T b) {
"""
Convenience utility. Does null checks on objects, then calls compare.
"""
return a == null ?
b == null ? 0 : -1 :
b == null ? 1 : a.compareTo(b);
} | java | public static <T extends Comparable<T>> int checkCompare(T a, T b) {
return a == null ?
b == null ? 0 : -1 :
b == null ? 1 : a.compareTo(b);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"T",
">",
">",
"int",
"checkCompare",
"(",
"T",
"a",
",",
"T",
"b",
")",
"{",
"return",
"a",
"==",
"null",
"?",
"b",
"==",
"null",
"?",
"0",
":",
"-",
"1",
":",
"b",
"==",
"null",
"?... | Convenience utility. Does null checks on objects, then calls compare. | [
"Convenience",
"utility",
".",
"Does",
"null",
"checks",
"on",
"objects",
"then",
"calls",
"compare",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java#L200-L204 |
resource4j/resource4j | core/src/main/java/com/github/resource4j/values/ResourceStrings.java | ResourceStrings.ofNullable | public static OptionalString ofNullable(ResourceKey key, String value) {
"""
Returns new instance of OptionalString with given key and value
@param key key of the returned OptionalString
@param value wrapped string
@return given object wrapped in OptionalString with given key
"""
return new GenericO... | java | public static OptionalString ofNullable(ResourceKey key, String value) {
return new GenericOptionalString(RUNTIME_SOURCE, key, value);
} | [
"public",
"static",
"OptionalString",
"ofNullable",
"(",
"ResourceKey",
"key",
",",
"String",
"value",
")",
"{",
"return",
"new",
"GenericOptionalString",
"(",
"RUNTIME_SOURCE",
",",
"key",
",",
"value",
")",
";",
"}"
] | Returns new instance of OptionalString with given key and value
@param key key of the returned OptionalString
@param value wrapped string
@return given object wrapped in OptionalString with given key | [
"Returns",
"new",
"instance",
"of",
"OptionalString",
"with",
"given",
"key",
"and",
"value"
] | train | https://github.com/resource4j/resource4j/blob/6100443b9a78edc8a5867e1e075f7ee12e6698ca/core/src/main/java/com/github/resource4j/values/ResourceStrings.java#L41-L43 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.calculateSegmentSize | private int calculateSegmentSize(int factor, int segmentSizeOld) {
"""
Calculate the dynamic segment size.
The new segment size is a fraction of the current table size.
@param factor the target ratio compared to the table size
@param segmentSizeOld the previous segment size
"""
DatabaseKelp db = _ta... | java | private int calculateSegmentSize(int factor, int segmentSizeOld)
{
DatabaseKelp db = _table.database();
long segmentFactor = _tableLength / db.getSegmentSizeMin();
long segmentFactorNew = segmentFactor / factor;
// segment size is (tableSize / factor), restricted to a power of 4
// ov... | [
"private",
"int",
"calculateSegmentSize",
"(",
"int",
"factor",
",",
"int",
"segmentSizeOld",
")",
"{",
"DatabaseKelp",
"db",
"=",
"_table",
".",
"database",
"(",
")",
";",
"long",
"segmentFactor",
"=",
"_tableLength",
"/",
"db",
".",
"getSegmentSizeMin",
"(",... | Calculate the dynamic segment size.
The new segment size is a fraction of the current table size.
@param factor the target ratio compared to the table size
@param segmentSizeOld the previous segment size | [
"Calculate",
"the",
"dynamic",
"segment",
"size",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L600-L635 |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/internal/rendering/strategy/TileUtil.java | TileUtil.getTileBounds | public static Envelope getTileBounds(TileCode code, Envelope maxExtent, double scale) {
"""
Get the bounding box for a certain tile.
@param code
The unique tile code. Determines what tile we're talking about.
@param maxExtent
The maximum extent of the grid to which this tile belongs.
@param scale
The curre... | java | public static Envelope getTileBounds(TileCode code, Envelope maxExtent, double scale) {
double[] layerSize = getTileLayerSize(code, maxExtent, scale);
if (layerSize[0] == 0) {
return null;
}
double cX = maxExtent.getMinX() + code.getX() * layerSize[0];
double cY = maxExtent.getMinY() + code.getY() * layerS... | [
"public",
"static",
"Envelope",
"getTileBounds",
"(",
"TileCode",
"code",
",",
"Envelope",
"maxExtent",
",",
"double",
"scale",
")",
"{",
"double",
"[",
"]",
"layerSize",
"=",
"getTileLayerSize",
"(",
"code",
",",
"maxExtent",
",",
"scale",
")",
";",
"if",
... | Get the bounding box for a certain tile.
@param code
The unique tile code. Determines what tile we're talking about.
@param maxExtent
The maximum extent of the grid to which this tile belongs.
@param scale
The current client side scale.
@return Returns the bounding box for the tile, expressed in the layer's coordinate... | [
"Get",
"the",
"bounding",
"box",
"for",
"a",
"certain",
"tile",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/rendering/strategy/TileUtil.java#L77-L85 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseLibraryVisitor.java | ElmBaseLibraryVisitor.visitElement | @Override
public T visitElement(Element elm, C context) {
"""
Visit an Element in an ELM tree. This method will be called for
every node in the tree that is a descendant of the Element type.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
... | java | @Override
public T visitElement(Element elm, C context) {
if (elm instanceof IncludeDef) return visitIncludeDef((IncludeDef)elm, context);
else if (elm instanceof Library) return visitLibrary((Library)elm, context);
else if (elm instanceof UsingDef) return visitUsingDef((UsingDef)elm, contex... | [
"@",
"Override",
"public",
"T",
"visitElement",
"(",
"Element",
"elm",
",",
"C",
"context",
")",
"{",
"if",
"(",
"elm",
"instanceof",
"IncludeDef",
")",
"return",
"visitIncludeDef",
"(",
"(",
"IncludeDef",
")",
"elm",
",",
"context",
")",
";",
"else",
"i... | Visit an Element in an ELM tree. This method will be called for
every node in the tree that is a descendant of the Element type.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"an",
"Element",
"in",
"an",
"ELM",
"tree",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"descendant",
"of",
"the",
"Element",
"type",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseLibraryVisitor.java#L21-L27 |
jbundle/webapp | upload-unjar/src/main/java/org/jbundle/util/webapp/upload/unjar/UploadServletUnjar.java | UploadServletUnjar.writeAfterHTML | public void writeAfterHTML(PrintWriter out, HttpServletRequest req, Properties properties) {
"""
/*
Write HTML after the form (Override this to do something).
"""
String strDefault = properties.getProperty(DESTINATION, "");
out.write("<input type=\"hidden\" value=\"" + strDefault + "\" name=\"" + DESTINAT... | java | public void writeAfterHTML(PrintWriter out, HttpServletRequest req, Properties properties)
{
String strDefault = properties.getProperty(DESTINATION, "");
out.write("<input type=\"hidden\" value=\"" + strDefault + "\" name=\"" + DESTINATION + "\" />" + RETURN);
} | [
"public",
"void",
"writeAfterHTML",
"(",
"PrintWriter",
"out",
",",
"HttpServletRequest",
"req",
",",
"Properties",
"properties",
")",
"{",
"String",
"strDefault",
"=",
"properties",
".",
"getProperty",
"(",
"DESTINATION",
",",
"\"\"",
")",
";",
"out",
".",
"w... | /*
Write HTML after the form (Override this to do something). | [
"/",
"*",
"Write",
"HTML",
"after",
"the",
"form",
"(",
"Override",
"this",
"to",
"do",
"something",
")",
"."
] | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/upload-unjar/src/main/java/org/jbundle/util/webapp/upload/unjar/UploadServletUnjar.java#L94-L98 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrTokenizer.java | StrTokenizer.isQuote | private boolean isQuote(final char[] srcChars, final int pos, final int len, final int quoteStart, final int quoteLen) {
"""
Checks if the characters at the index specified match the quote
already matched in readNextToken().
@param srcChars the character array being tokenized
@param pos the position to chec... | java | private boolean isQuote(final char[] srcChars, final int pos, final int len, final int quoteStart, final int quoteLen) {
for (int i = 0; i < quoteLen; i++) {
if (pos + i >= len || srcChars[pos + i] != srcChars[quoteStart + i]) {
return false;
}
}
return tr... | [
"private",
"boolean",
"isQuote",
"(",
"final",
"char",
"[",
"]",
"srcChars",
",",
"final",
"int",
"pos",
",",
"final",
"int",
"len",
",",
"final",
"int",
"quoteStart",
",",
"final",
"int",
"quoteLen",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Checks if the characters at the index specified match the quote
already matched in readNextToken().
@param srcChars the character array being tokenized
@param pos the position to check for a quote
@param len the length of the character array being tokenized
@param quoteStart the start position of the matched quote... | [
"Checks",
"if",
"the",
"characters",
"at",
"the",
"index",
"specified",
"match",
"the",
"quote",
"already",
"matched",
"in",
"readNextToken",
"()",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java#L840-L847 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/commands/RemoteCommand.java | RemoteCommand.executeAction | private void executeAction(Action action, Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Executes the <code>action</code> with the <code>form</code>.
The action could be any of the available actions. The form must
be the answer of the previous stage. ... | java | private void executeAction(Action action, Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// TODO: Check that all the required fields of the form were filled, if
// TODO: not throw the corresponding exception. This will make a faster response,
... | [
"private",
"void",
"executeAction",
"(",
"Action",
"action",
",",
"Form",
"form",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"// TODO: Check that all the required fields of the form were fille... | Executes the <code>action</code> with the <code>form</code>.
The action could be any of the available actions. The form must
be the answer of the previous stage. It can be <tt>null</tt> if it is the first stage.
@param action the action to execute.
@param form the form with the information.
@throws XMPPErrorException ... | [
"Executes",
"the",
"<code",
">",
"action<",
"/",
"code",
">",
"with",
"the",
"<code",
">",
"form<",
"/",
"code",
">",
".",
"The",
"action",
"could",
"be",
"any",
"of",
"the",
"available",
"actions",
".",
"The",
"form",
"must",
"be",
"the",
"answer",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/RemoteCommand.java#L133-L160 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/VarTensor.java | VarTensor.elemApplyBinOp | private static void elemApplyBinOp(final VarTensor f1, final VarTensor f2, final AlgebraLambda.LambdaBinOp op) {
"""
Applies the operation to each element of f1 and f2, which are assumed to be of the same size.
The result is stored in f1.
@param f1 Input factor 1 and the output factor.
@param f2 Input factor ... | java | private static void elemApplyBinOp(final VarTensor f1, final VarTensor f2, final AlgebraLambda.LambdaBinOp op) {
checkSameAlgebra(f1, f2);
Algebra s = f1.s;
if (f1.size() != f2.size()) {
throw new IllegalArgumentException("VarTensors are different sizes");
}
for (int ... | [
"private",
"static",
"void",
"elemApplyBinOp",
"(",
"final",
"VarTensor",
"f1",
",",
"final",
"VarTensor",
"f2",
",",
"final",
"AlgebraLambda",
".",
"LambdaBinOp",
"op",
")",
"{",
"checkSameAlgebra",
"(",
"f1",
",",
"f2",
")",
";",
"Algebra",
"s",
"=",
"f1... | Applies the operation to each element of f1 and f2, which are assumed to be of the same size.
The result is stored in f1.
@param f1 Input factor 1 and the output factor.
@param f2 Input factor 2.
@param op The operation to apply. | [
"Applies",
"the",
"operation",
"to",
"each",
"element",
"of",
"f1",
"and",
"f2",
"which",
"are",
"assumed",
"to",
"be",
"of",
"the",
"same",
"size",
".",
"The",
"result",
"is",
"stored",
"in",
"f1",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/VarTensor.java#L225-L234 |
google/j2objc | jre_emul/android/frameworks/base/core/java/com/android/internal/util/ArrayUtils.java | ArrayUtils.indexOf | public static <T> int indexOf(T[] array, T value) {
"""
Return first index of {@code value} in {@code array}, or {@code -1} if
not found.
"""
for (int i = 0; i < array.length; i++) {
if (array[i] == null) {
if (value == null) return i;
} else {
i... | java | public static <T> int indexOf(T[] array, T value) {
for (int i = 0; i < array.length; i++) {
if (array[i] == null) {
if (value == null) return i;
} else {
if (value != null && array[i].equals(value)) return i;
}
}
return -1;
... | [
"public",
"static",
"<",
"T",
">",
"int",
"indexOf",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"value",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"array",
"[",
"i",
... | Return first index of {@code value} in {@code array}, or {@code -1} if
not found. | [
"Return",
"first",
"index",
"of",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/com/android/internal/util/ArrayUtils.java#L137-L146 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/UpdateIdentityPoolRequest.java | UpdateIdentityPoolRequest.withIdentityPoolTags | public UpdateIdentityPoolRequest withIdentityPoolTags(java.util.Map<String, String> identityPoolTags) {
"""
<p>
The tags that are assigned to the identity pool. A tag is a label that you can apply to identity pools to
categorize and manage them in different ways, such as by purpose, owner, environment, or other ... | java | public UpdateIdentityPoolRequest withIdentityPoolTags(java.util.Map<String, String> identityPoolTags) {
setIdentityPoolTags(identityPoolTags);
return this;
} | [
"public",
"UpdateIdentityPoolRequest",
"withIdentityPoolTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"identityPoolTags",
")",
"{",
"setIdentityPoolTags",
"(",
"identityPoolTags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags that are assigned to the identity pool. A tag is a label that you can apply to identity pools to
categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.
</p>
@param identityPoolTags
The tags that are assigned to the identity pool. A tag is a label that you ... | [
"<p",
">",
"The",
"tags",
"that",
"are",
"assigned",
"to",
"the",
"identity",
"pool",
".",
"A",
"tag",
"is",
"a",
"label",
"that",
"you",
"can",
"apply",
"to",
"identity",
"pools",
"to",
"categorize",
"and",
"manage",
"them",
"in",
"different",
"ways",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/UpdateIdentityPoolRequest.java#L571-L574 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/XMLUtils.java | XMLUtils.getAttribute | public static String getAttribute(XMLStreamReader reader, String localName) {
"""
Get the element attribute value
@param reader
@param localName
@return
"""
int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
String name = reader.getAttributeLocalName(i);
... | java | public static String getAttribute(XMLStreamReader reader, String localName) {
int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
String name = reader.getAttributeLocalName(i);
if (localName.equals(name)) {
return reader.getAttributeValue(i);... | [
"public",
"static",
"String",
"getAttribute",
"(",
"XMLStreamReader",
"reader",
",",
"String",
"localName",
")",
"{",
"int",
"count",
"=",
"reader",
".",
"getAttributeCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
... | Get the element attribute value
@param reader
@param localName
@return | [
"Get",
"the",
"element",
"attribute",
"value"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/XMLUtils.java#L29-L38 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java | ModelConstraints.isEqual | private boolean isEqual(FieldDescriptorDef first, FieldDescriptorDef second) {
"""
Tests whether the two field descriptors are equal, i.e. have same name, same column
and same jdbc-type.
@param first The first field
@param second The second field
@return <code>true</code> if they are equal
"""
... | java | private boolean isEqual(FieldDescriptorDef first, FieldDescriptorDef second)
{
return first.getName().equals(second.getName()) &&
first.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN).equals(second.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN)) &&
first.getProperty(Proper... | [
"private",
"boolean",
"isEqual",
"(",
"FieldDescriptorDef",
"first",
",",
"FieldDescriptorDef",
"second",
")",
"{",
"return",
"first",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"second",
".",
"getName",
"(",
")",
")",
"&&",
"first",
".",
"getProperty",
... | Tests whether the two field descriptors are equal, i.e. have same name, same column
and same jdbc-type.
@param first The first field
@param second The second field
@return <code>true</code> if they are equal | [
"Tests",
"whether",
"the",
"two",
"field",
"descriptors",
"are",
"equal",
"i",
".",
"e",
".",
"have",
"same",
"name",
"same",
"column",
"and",
"same",
"jdbc",
"-",
"type",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java#L354-L359 |
wigforss/Ka-Commons-Reflection | src/main/java/org/kasource/commons/reflection/ClassIntrospectorImpl.java | ClassIntrospectorImpl.getDeclaredMethod | @Override
public Method getDeclaredMethod(String name, Class<?>... params) throws IllegalArgumentException {
"""
Returns the named method from class <i>clazz</i>, does not throw checked exceptions.
@param clazz
The class to inspect
@param name
The name of the method to get
@param params
Parameter types... | java | @Override
public Method getDeclaredMethod(String name, Class<?>... params) throws IllegalArgumentException {
return MethodUtils.getDeclaredMethod(target, name, params);
} | [
"@",
"Override",
"public",
"Method",
"getDeclaredMethod",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"...",
"params",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"MethodUtils",
".",
"getDeclaredMethod",
"(",
"target",
",",
"name",
",",
"... | Returns the named method from class <i>clazz</i>, does not throw checked exceptions.
@param clazz
The class to inspect
@param name
The name of the method to get
@param params
Parameter types for the method
@return Returns the named method from class <i>clazz</i>.
@throws IllegalArgumentException if method could not... | [
"Returns",
"the",
"named",
"method",
"from",
"class",
"<i",
">",
"clazz<",
"/",
"i",
">",
"does",
"not",
"throw",
"checked",
"exceptions",
"."
] | train | https://github.com/wigforss/Ka-Commons-Reflection/blob/a80f7a164cd800089e4f4dd948ca6f0e7badcf33/src/main/java/org/kasource/commons/reflection/ClassIntrospectorImpl.java#L75-L78 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlInterface.java | AptControlInterface.initEventSets | private ArrayList<AptEventSet> initEventSets() {
"""
Initializes the list of EventSets declared by this AptControlInterface
"""
ArrayList<AptEventSet> eventSets = new ArrayList<AptEventSet>();
if ( _intfDecl == null || _intfDecl.getNestedTypes() == null )
return eventSets;
... | java | private ArrayList<AptEventSet> initEventSets()
{
ArrayList<AptEventSet> eventSets = new ArrayList<AptEventSet>();
if ( _intfDecl == null || _intfDecl.getNestedTypes() == null )
return eventSets;
for (TypeDeclaration innerDecl : _intfDecl.getNestedTypes())
{
... | [
"private",
"ArrayList",
"<",
"AptEventSet",
">",
"initEventSets",
"(",
")",
"{",
"ArrayList",
"<",
"AptEventSet",
">",
"eventSets",
"=",
"new",
"ArrayList",
"<",
"AptEventSet",
">",
"(",
")",
";",
"if",
"(",
"_intfDecl",
"==",
"null",
"||",
"_intfDecl",
".... | Initializes the list of EventSets declared by this AptControlInterface | [
"Initializes",
"the",
"list",
"of",
"EventSets",
"declared",
"by",
"this",
"AptControlInterface"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlInterface.java#L496-L527 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/FileEventStore.java | FileEventStore.getProjectDir | private File getProjectDir(String projectId, boolean create) throws IOException {
"""
Gets the cache directory for the given project. Optionally creates the directory if it
doesn't exist.
@param projectId The project ID.
@return The cache directory for the project.
@throws IOException
"""
File pr... | java | private File getProjectDir(String projectId, boolean create) throws IOException {
File projectDir = new File(getKeenCacheDirectory(), projectId);
if (create && !projectDir.exists()) {
KeenLogging.log("Cache directory for project '" + projectId + "' doesn't exist. " +
"Cre... | [
"private",
"File",
"getProjectDir",
"(",
"String",
"projectId",
",",
"boolean",
"create",
")",
"throws",
"IOException",
"{",
"File",
"projectDir",
"=",
"new",
"File",
"(",
"getKeenCacheDirectory",
"(",
")",
",",
"projectId",
")",
";",
"if",
"(",
"create",
"&... | Gets the cache directory for the given project. Optionally creates the directory if it
doesn't exist.
@param projectId The project ID.
@return The cache directory for the project.
@throws IOException | [
"Gets",
"the",
"cache",
"directory",
"for",
"the",
"given",
"project",
".",
"Optionally",
"creates",
"the",
"directory",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/FileEventStore.java#L275-L286 |
aws/aws-sdk-java | aws-java-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/EnvironmentResponse.java | EnvironmentResponse.withVariables | public EnvironmentResponse withVariables(java.util.Map<String, String> variables) {
"""
<p>
Environment variable key-value pairs.
</p>
@param variables
Environment variable key-value pairs.
@return Returns a reference to this object so that method calls can be chained together.
"""
setVariables(... | java | public EnvironmentResponse withVariables(java.util.Map<String, String> variables) {
setVariables(variables);
return this;
} | [
"public",
"EnvironmentResponse",
"withVariables",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"variables",
")",
"{",
"setVariables",
"(",
"variables",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Environment variable key-value pairs.
</p>
@param variables
Environment variable key-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Environment",
"variable",
"key",
"-",
"value",
"pairs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/EnvironmentResponse.java#L82-L85 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/EncodedElement_32.java | EncodedElement_32.addInt | public static void addInt(int value, int count, int startPos, int[] dest) {
"""
This method adds a given number of bits of an int to a byte array.
@param value int to store bits from
@param count number of low-order bits to store
@param startPos start bit location in array to begin writing
@param dest array to... | java | public static void addInt(int value, int count, int startPos, int[] dest) {
assert(count <= 32);
assert(count > 0);
assert(startPos >= 0);
//System.err.println("addInt("+value+", "+count + ", "+startPos+")");
/*
* Because we're using both 32 bit input and 32 bit output, ... | [
"public",
"static",
"void",
"addInt",
"(",
"int",
"value",
",",
"int",
"count",
",",
"int",
"startPos",
",",
"int",
"[",
"]",
"dest",
")",
"{",
"assert",
"(",
"count",
"<=",
"32",
")",
";",
"assert",
"(",
"count",
">",
"0",
")",
";",
"assert",
"(... | This method adds a given number of bits of an int to a byte array.
@param value int to store bits from
@param count number of low-order bits to store
@param startPos start bit location in array to begin writing
@param dest array to store bits in. dest MUST have enough space to store
the given data, or this function wil... | [
"This",
"method",
"adds",
"a",
"given",
"number",
"of",
"bits",
"of",
"an",
"int",
"to",
"a",
"byte",
"array",
"."
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/EncodedElement_32.java#L66-L124 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/VerticalRecordsProcessor.java | VerticalRecordsProcessor.isAvailabledRecord | private boolean isAvailabledRecord(final Optional<Method> ignoreMethod, final Object record)
throws AnnotationReadException, AnnotationInvalidException {
"""
レコードが有効かどうか判定する
<p>アノテーション{@link XlsIgnorable}のメソッドで判定を行う。
@param ignoreMethod レコードの判定を無視するかどうかの判定に使用するメソッド
@param record 判定対象のレコードのインスタンス。
... | java | private boolean isAvailabledRecord(final Optional<Method> ignoreMethod, final Object record)
throws AnnotationReadException, AnnotationInvalidException {
if(!ignoreMethod.isPresent()) {
// 判定用のメソッドが存在しない場合
return true;
}
try {
boolean ig... | [
"private",
"boolean",
"isAvailabledRecord",
"(",
"final",
"Optional",
"<",
"Method",
">",
"ignoreMethod",
",",
"final",
"Object",
"record",
")",
"throws",
"AnnotationReadException",
",",
"AnnotationInvalidException",
"{",
"if",
"(",
"!",
"ignoreMethod",
".",
"isPres... | レコードが有効かどうか判定する
<p>アノテーション{@link XlsIgnorable}のメソッドで判定を行う。
@param ignoreMethod レコードの判定を無視するかどうかの判定に使用するメソッド
@param record 判定対象のレコードのインスタンス。
@return trueの場合は有効。 | [
"レコードが有効かどうか判定する",
"<p",
">",
"アノテーション",
"{"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/VerticalRecordsProcessor.java#L791-L807 |
knowm/XChange | xchange-dsx/src/main/java/org/knowm/xchange/dsx/service/core/DSXMarketDataServiceCore.java | DSXMarketDataServiceCore.getTicker | @Override
public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException {
"""
Get ticker from exchange
@param currencyPair
@param args
@return The ticker
@throws IOException
"""
String marketName = DSXAdapters.currencyPairToMarketName(currencyPair);
String accountType =... | java | @Override
public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException {
String marketName = DSXAdapters.currencyPairToMarketName(currencyPair);
String accountType = null;
try {
if (args != null) {
accountType = (String) args[0];
}
} catch (ArrayIndexOutOf... | [
"@",
"Override",
"public",
"Ticker",
"getTicker",
"(",
"CurrencyPair",
"currencyPair",
",",
"Object",
"...",
"args",
")",
"throws",
"IOException",
"{",
"String",
"marketName",
"=",
"DSXAdapters",
".",
"currencyPairToMarketName",
"(",
"currencyPair",
")",
";",
"Str... | Get ticker from exchange
@param currencyPair
@param args
@return The ticker
@throws IOException | [
"Get",
"ticker",
"from",
"exchange"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-dsx/src/main/java/org/knowm/xchange/dsx/service/core/DSXMarketDataServiceCore.java#L40-L57 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UIInput.java | UIInput.compareValues | protected boolean compareValues(Object previous, Object value) {
"""
<p>Return <code>true</code> if the new value is different from
the previous value. First compare the two values by passing
<em>value</em> to the <code>equals</code> method on argument
<em>previous</em>. If that method returns <code>true</cod... | java | protected boolean compareValues(Object previous, Object value) {
boolean result = true;
if (previous == null) {
result = (value != null);
} else if (value == null) {
result = true;
} else {
boolean previousEqualsValue = previous.equals(value);
if (!prev... | [
"protected",
"boolean",
"compareValues",
"(",
"Object",
"previous",
",",
"Object",
"value",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"if",
"(",
"previous",
"==",
"null",
")",
"{",
"result",
"=",
"(",
"value",
"!=",
"null",
")",
";",
"}",
"else"... | <p>Return <code>true</code> if the new value is different from
the previous value. First compare the two values by passing
<em>value</em> to the <code>equals</code> method on argument
<em>previous</em>. If that method returns <code>true</code>,
return <code>true</code>. If that method returns
<code>false</code>, and... | [
"<p",
">",
"Return",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"new",
"value",
"is",
"different",
"from",
"the",
"previous",
"value",
".",
"First",
"compare",
"the",
"two",
"values",
"by",
"passing",
"<em",
">",
"value<",
"/",
"em",
">",
... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIInput.java#L1216-L1240 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobLauncherFactory.java | JobLauncherFactory.newJobLauncher | public static @Nonnull JobLauncher newJobLauncher(Properties sysProps, Properties jobProps) throws Exception {
"""
Create a new {@link JobLauncher}.
<p>
This method will never return a {@code null}.
</p>
@param sysProps system configuration properties
@param jobProps job configuration properties
@return ... | java | public static @Nonnull JobLauncher newJobLauncher(Properties sysProps, Properties jobProps) throws Exception {
return newJobLauncher(sysProps, jobProps, null);
} | [
"public",
"static",
"@",
"Nonnull",
"JobLauncher",
"newJobLauncher",
"(",
"Properties",
"sysProps",
",",
"Properties",
"jobProps",
")",
"throws",
"Exception",
"{",
"return",
"newJobLauncher",
"(",
"sysProps",
",",
"jobProps",
",",
"null",
")",
";",
"}"
] | Create a new {@link JobLauncher}.
<p>
This method will never return a {@code null}.
</p>
@param sysProps system configuration properties
@param jobProps job configuration properties
@return newly created {@link JobLauncher} | [
"Create",
"a",
"new",
"{",
"@link",
"JobLauncher",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobLauncherFactory.java#L67-L69 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallPlan | public static PlanBean unmarshallPlan(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the plan
"""
if (source == null) {
return null;
}
PlanBean bean = new PlanBean();
bean.setId(asString(source.get("i... | java | public static PlanBean unmarshallPlan(Map<String, Object> source) {
if (source == null) {
return null;
}
PlanBean bean = new PlanBean();
bean.setId(asString(source.get("id")));
bean.setName(asString(source.get("name")));
bean.setDescription(asString(source.get... | [
"public",
"static",
"PlanBean",
"unmarshallPlan",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"PlanBean",
"bean",
"=",
"new",
"PlanBean",
"(",
")",
";",
"... | Unmarshals the given map source into a bean.
@param source the source
@return the plan | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L826-L838 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/configuration/GreenMailConfiguration.java | GreenMailConfiguration.withUser | public GreenMailConfiguration withUser(final String email, final String login, final String password) {
"""
The given {@link com.icegreen.greenmail.user.GreenMailUser} will be created when servers will start.
@param email Email address
@param login Login name of user
@param password Password of user that belo... | java | public GreenMailConfiguration withUser(final String email, final String login, final String password) {
this.usersToCreate.add(new UserBean(email, login, password));
return this;
} | [
"public",
"GreenMailConfiguration",
"withUser",
"(",
"final",
"String",
"email",
",",
"final",
"String",
"login",
",",
"final",
"String",
"password",
")",
"{",
"this",
".",
"usersToCreate",
".",
"add",
"(",
"new",
"UserBean",
"(",
"email",
",",
"login",
",",... | The given {@link com.icegreen.greenmail.user.GreenMailUser} will be created when servers will start.
@param email Email address
@param login Login name of user
@param password Password of user that belongs to login name
@return Modified configuration | [
"The",
"given",
"{",
"@link",
"com",
".",
"icegreen",
".",
"greenmail",
".",
"user",
".",
"GreenMailUser",
"}",
"will",
"be",
"created",
"when",
"servers",
"will",
"start",
"."
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/configuration/GreenMailConfiguration.java#L32-L35 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java | ProjectiveInitializeAllCommon.initializeProjective3 | private void initializeProjective3(FastQueue<AssociatedTriple> associated ,
FastQueue<AssociatedTripleIndex> associatedIdx ,
int totalViews,
View viewA , View viewB , View viewC ,
int idxViewB , int idxViewC ) {
"""
Initializes projective reconstruction from 3-views.... | java | private void initializeProjective3(FastQueue<AssociatedTriple> associated ,
FastQueue<AssociatedTripleIndex> associatedIdx ,
int totalViews,
View viewA , View viewB , View viewC ,
int idxViewB , int idxViewC ) {
ransac.process(associated.toList());
List<AssociatedTri... | [
"private",
"void",
"initializeProjective3",
"(",
"FastQueue",
"<",
"AssociatedTriple",
">",
"associated",
",",
"FastQueue",
"<",
"AssociatedTripleIndex",
">",
"associatedIdx",
",",
"int",
"totalViews",
",",
"View",
"viewA",
",",
"View",
"viewB",
",",
"View",
"view... | Initializes projective reconstruction from 3-views.
1) RANSAC to fit a trifocal tensor
2) Extract camera matrices that have a common projective space
3) Triangulate location of 3D homogenous points
@param associated List of associated pixels
@param associatedIdx List of associated feature indexes | [
"Initializes",
"projective",
"reconstruction",
"from",
"3",
"-",
"views",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure2/ProjectiveInitializeAllCommon.java#L331-L377 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfPageLabels.java | PdfPageLabels.addPageLabel | public void addPageLabel(int page, int numberStyle, String text, int firstPage) {
"""
Adds or replaces a page label.
@param page the real page to start the numbering. First page is 1
@param numberStyle the numbering style such as LOWERCASE_ROMAN_NUMERALS
@param text the text to prefix the number. Can be <CODE>n... | java | public void addPageLabel(int page, int numberStyle, String text, int firstPage) {
if (page < 1 || firstPage < 1)
throw new IllegalArgumentException("In a page label the page numbers must be greater or equal to 1.");
PdfDictionary dic = new PdfDictionary();
if (numberStyle >= 0 && num... | [
"public",
"void",
"addPageLabel",
"(",
"int",
"page",
",",
"int",
"numberStyle",
",",
"String",
"text",
",",
"int",
"firstPage",
")",
"{",
"if",
"(",
"page",
"<",
"1",
"||",
"firstPage",
"<",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"... | Adds or replaces a page label.
@param page the real page to start the numbering. First page is 1
@param numberStyle the numbering style such as LOWERCASE_ROMAN_NUMERALS
@param text the text to prefix the number. Can be <CODE>null</CODE> or empty
@param firstPage the first logical page number | [
"Adds",
"or",
"replaces",
"a",
"page",
"label",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfPageLabels.java#L110-L121 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.strToZoneName | public static Expression strToZoneName(String expression, String zoneName) {
"""
Returned expression results in a conversion of the supported time stamp string to the named time zone.
"""
return strToZoneName(x(expression), zoneName);
} | java | public static Expression strToZoneName(String expression, String zoneName) {
return strToZoneName(x(expression), zoneName);
} | [
"public",
"static",
"Expression",
"strToZoneName",
"(",
"String",
"expression",
",",
"String",
"zoneName",
")",
"{",
"return",
"strToZoneName",
"(",
"x",
"(",
"expression",
")",
",",
"zoneName",
")",
";",
"}"
] | Returned expression results in a conversion of the supported time stamp string to the named time zone. | [
"Returned",
"expression",
"results",
"in",
"a",
"conversion",
"of",
"the",
"supported",
"time",
"stamp",
"string",
"to",
"the",
"named",
"time",
"zone",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L325-L327 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.toXml | public String toXml(boolean pretty, boolean declaration, String... attributeNames) {
"""
Generates a XML document from content of this model.
@param pretty pretty format (human readable), or one line text.
@param declaration true to include XML declaration at the top
@param attributeNames list of attributes t... | java | public String toXml(boolean pretty, boolean declaration, String... attributeNames) {
StringBuilder sb = new StringBuilder();
if(declaration) {
sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
if (pretty) { sb.append('\n'); }
}
toXmlP(sb, pretty, "", attri... | [
"public",
"String",
"toXml",
"(",
"boolean",
"pretty",
",",
"boolean",
"declaration",
",",
"String",
"...",
"attributeNames",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"declaration",
")",
"{",
"sb",
".",
"appen... | Generates a XML document from content of this model.
@param pretty pretty format (human readable), or one line text.
@param declaration true to include XML declaration at the top
@param attributeNames list of attributes to include. No arguments == include all attributes.
@return generated XML. | [
"Generates",
"a",
"XML",
"document",
"from",
"content",
"of",
"this",
"model",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L964-L973 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.setOffset | @SuppressWarnings( {
"""
Sets the offset in a symbolizer.
@param symbolizer the symbolizer.
@param text the text representing the offsets in the CSV form.
""""rawtypes", "unchecked"})
public static void setOffset( Symbolizer symbolizer, String text ) {
if (text.indexOf(',') == -1) {
... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public static void setOffset( Symbolizer symbolizer, String text ) {
if (text.indexOf(',') == -1) {
return;
}
String[] split = text.split(",");
if (split.length != 2) {
return;
}
double xOffset = Dou... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"void",
"setOffset",
"(",
"Symbolizer",
"symbolizer",
",",
"String",
"text",
")",
"{",
"if",
"(",
"text",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-"... | Sets the offset in a symbolizer.
@param symbolizer the symbolizer.
@param text the text representing the offsets in the CSV form. | [
"Sets",
"the",
"offset",
"in",
"a",
"symbolizer",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L721-L745 |
phax/ph-datetime | ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java | XMLHolidayManager.getHolidays | public HolidayMap getHolidays (final int nYear, @Nullable final String... aArgs) {
"""
Calls
<code>Set<LocalDate> getHolidays(int year, Configuration c, String... args)</code>
with the configuration from initialization.
"""
return _getHolidays (nYear, m_aConfiguration, aArgs);
} | java | public HolidayMap getHolidays (final int nYear, @Nullable final String... aArgs)
{
return _getHolidays (nYear, m_aConfiguration, aArgs);
} | [
"public",
"HolidayMap",
"getHolidays",
"(",
"final",
"int",
"nYear",
",",
"@",
"Nullable",
"final",
"String",
"...",
"aArgs",
")",
"{",
"return",
"_getHolidays",
"(",
"nYear",
",",
"m_aConfiguration",
",",
"aArgs",
")",
";",
"}"
] | Calls
<code>Set<LocalDate> getHolidays(int year, Configuration c, String... args)</code>
with the configuration from initialization. | [
"Calls",
"<code",
">",
"Set<",
";",
"LocalDate>",
";",
"getHolidays",
"(",
"int",
"year",
"Configuration",
"c",
"String",
"...",
"args",
")",
"<",
"/",
"code",
">",
"with",
"the",
"configuration",
"from",
"initialization",
"."
] | train | https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java#L125-L128 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_region_regionName_workflow_backup_GET | public ArrayList<OvhBackup> project_serviceName_region_regionName_workflow_backup_GET(String serviceName, String regionName) throws IOException {
"""
List your automated backups
REST: GET /cloud/project/{serviceName}/region/{regionName}/workflow/backup
@param regionName [required] Public Cloud region
@param s... | java | public ArrayList<OvhBackup> project_serviceName_region_regionName_workflow_backup_GET(String serviceName, String regionName) throws IOException {
String qPath = "/cloud/project/{serviceName}/region/{regionName}/workflow/backup";
StringBuilder sb = path(qPath, serviceName, regionName);
String resp = exec(qPath, "G... | [
"public",
"ArrayList",
"<",
"OvhBackup",
">",
"project_serviceName_region_regionName_workflow_backup_GET",
"(",
"String",
"serviceName",
",",
"String",
"regionName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/region/{regionName}/w... | List your automated backups
REST: GET /cloud/project/{serviceName}/region/{regionName}/workflow/backup
@param regionName [required] Public Cloud region
@param serviceName [required] Public Cloud project
API beta | [
"List",
"your",
"automated",
"backups"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L170-L175 |
SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java | ReminderDatePicker.setHideTime | public void setHideTime(boolean enable, final boolean useDarkTheme) {
"""
Toggles hiding the Time Spinner and replaces it with a Button.
@param enable True to hide the Spinner, false to show it.
@param useDarkTheme True if a white icon shall be used, false for a dark one.
"""
if(enable && !shouldHide... | java | public void setHideTime(boolean enable, final boolean useDarkTheme) {
if(enable && !shouldHideTime) {
// hide the time spinner and show a button to show it instead
timeSpinner.setVisibility(GONE);
ImageButton timeButton = (ImageButton) LayoutInflater.from(getContext()).inflat... | [
"public",
"void",
"setHideTime",
"(",
"boolean",
"enable",
",",
"final",
"boolean",
"useDarkTheme",
")",
"{",
"if",
"(",
"enable",
"&&",
"!",
"shouldHideTime",
")",
"{",
"// hide the time spinner and show a button to show it instead",
"timeSpinner",
".",
"setVisibility"... | Toggles hiding the Time Spinner and replaces it with a Button.
@param enable True to hide the Spinner, false to show it.
@param useDarkTheme True if a white icon shall be used, false for a dark one. | [
"Toggles",
"hiding",
"the",
"Time",
"Spinner",
"and",
"replaces",
"it",
"with",
"a",
"Button",
"."
] | train | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java#L330-L348 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java | I18N.htmlEncode | public static String htmlEncode(String text, boolean encodeSpace) {
"""
Encode pour affichage en html.
@param text message à encoder
@param encodeSpace booléen selon que les espaces sont encodés en nbsp (insécables)
@return String
"""
// ces encodages html sont incomplets mais suffisants pour le monitori... | java | public static String htmlEncode(String text, boolean encodeSpace) {
// ces encodages html sont incomplets mais suffisants pour le monitoring
String result = text.replaceAll("[&]", "&").replaceAll("[<]", "<")
.replaceAll("[>]", ">").replaceAll("[\n]", "<br/>");
if (encodeSpace) {
result = res... | [
"public",
"static",
"String",
"htmlEncode",
"(",
"String",
"text",
",",
"boolean",
"encodeSpace",
")",
"{",
"// ces encodages html sont incomplets mais suffisants pour le monitoring\r",
"String",
"result",
"=",
"text",
".",
"replaceAll",
"(",
"\"[&]\"",
",",
"\"&\"",
... | Encode pour affichage en html.
@param text message à encoder
@param encodeSpace booléen selon que les espaces sont encodés en nbsp (insécables)
@return String | [
"Encode",
"pour",
"affichage",
"en",
"html",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/common/I18N.java#L156-L164 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/CreateJobRequest.java | CreateJobRequest.withTags | public CreateJobRequest withTags(java.util.Map<String, String> tags) {
"""
<p>
The tags to use with this job. You may use tags to limit access to the job. For more information about tags in
AWS Glue, see <a href="http://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">AWS Tags in AWS Glue</a> in
the develo... | java | public CreateJobRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateJobRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags to use with this job. You may use tags to limit access to the job. For more information about tags in
AWS Glue, see <a href="http://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">AWS Tags in AWS Glue</a> in
the developer guide.
</p>
@param tags
The tags to use with this job. You may use tags to lim... | [
"<p",
">",
"The",
"tags",
"to",
"use",
"with",
"this",
"job",
".",
"You",
"may",
"use",
"tags",
"to",
"limit",
"access",
"to",
"the",
"job",
".",
"For",
"more",
"information",
"about",
"tags",
"in",
"AWS",
"Glue",
"see",
"<a",
"href",
"=",
"http",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/CreateJobRequest.java#L1359-L1362 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/seg/common/CWSEvaluator.java | CWSEvaluator.evaluate | public static CWSEvaluator.Result evaluate(Segment segment, String outputPath, String goldFile, String dictPath) throws IOException {
"""
标准化评测分词器
@param segment 分词器
@param outputPath 分词预测输出文件
@param goldFile 测试集segmented file
@param dictPath 训练集单词列表
@return 一个储存准确率的结构
@throws IOException
"""
... | java | public static CWSEvaluator.Result evaluate(Segment segment, String outputPath, String goldFile, String dictPath) throws IOException
{
IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(goldFile);
BufferedWriter bw = IOUtil.newBufferedWriter(outputPath);
for (String line : lineIterato... | [
"public",
"static",
"CWSEvaluator",
".",
"Result",
"evaluate",
"(",
"Segment",
"segment",
",",
"String",
"outputPath",
",",
"String",
"goldFile",
",",
"String",
"dictPath",
")",
"throws",
"IOException",
"{",
"IOUtil",
".",
"LineIterator",
"lineIterator",
"=",
"n... | 标准化评测分词器
@param segment 分词器
@param outputPath 分词预测输出文件
@param goldFile 测试集segmented file
@param dictPath 训练集单词列表
@return 一个储存准确率的结构
@throws IOException | [
"标准化评测分词器"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/common/CWSEvaluator.java#L191-L210 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java | EntrySerializer.serializeUpdate | private int serializeUpdate(@NonNull TableEntry entry, byte[] target, int targetOffset, long version) {
"""
Serializes the given {@link TableEntry} to the given byte array.
@param entry The {@link TableEntry} to serialize.
@param target The byte array to serialize to.
@param targetOffset The firs... | java | private int serializeUpdate(@NonNull TableEntry entry, byte[] target, int targetOffset, long version) {
val key = entry.getKey().getKey();
val value = entry.getValue();
Preconditions.checkArgument(key.getLength() <= MAX_KEY_LENGTH, "Key too large.");
int serializationLength = getUpdateLe... | [
"private",
"int",
"serializeUpdate",
"(",
"@",
"NonNull",
"TableEntry",
"entry",
",",
"byte",
"[",
"]",
"target",
",",
"int",
"targetOffset",
",",
"long",
"version",
")",
"{",
"val",
"key",
"=",
"entry",
".",
"getKey",
"(",
")",
".",
"getKey",
"(",
")"... | Serializes the given {@link TableEntry} to the given byte array.
@param entry The {@link TableEntry} to serialize.
@param target The byte array to serialize to.
@param targetOffset The first offset within the byte array to serialize at.
@param version The version to serialize. This will be encoded in... | [
"Serializes",
"the",
"given",
"{",
"@link",
"TableEntry",
"}",
"to",
"the",
"given",
"byte",
"array",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/EntrySerializer.java#L84-L104 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseClinicalVisitor.java | ElmBaseClinicalVisitor.visitUnaryExpression | @Override
public T visitUnaryExpression(UnaryExpression elm, C context) {
"""
Visit a UnaryExpression. This method will be called for
every node in the tree that is a UnaryExpression.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
i... | java | @Override
public T visitUnaryExpression(UnaryExpression elm, C context) {
if (elm instanceof CalculateAge) return visitCalculateAge((CalculateAge)elm, context);
else return super.visitUnaryExpression(elm, context);
} | [
"@",
"Override",
"public",
"T",
"visitUnaryExpression",
"(",
"UnaryExpression",
"elm",
",",
"C",
"context",
")",
"{",
"if",
"(",
"elm",
"instanceof",
"CalculateAge",
")",
"return",
"visitCalculateAge",
"(",
"(",
"CalculateAge",
")",
"elm",
",",
"context",
")",... | Visit a UnaryExpression. This method will be called for
every node in the tree that is a UnaryExpression.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"UnaryExpression",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"UnaryExpression",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseClinicalVisitor.java#L43-L47 |
google/error-prone | check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/NullnessPropagationTransfer.java | NullnessPropagationTransfer.visitLocalVariable | @Override
Nullness visitLocalVariable(LocalVariableNode node, LocalVariableValues<Nullness> values) {
"""
Variables take their values from their past assignments (as far as they can be determined).
Additionally, variables of primitive type are always refined to non-null.
<p>(This second case is rarely of int... | java | @Override
Nullness visitLocalVariable(LocalVariableNode node, LocalVariableValues<Nullness> values) {
return hasPrimitiveType(node) || hasNonNullConstantValue(node)
? NONNULL
: values.valueOfLocalVariable(node, defaultAssumption);
} | [
"@",
"Override",
"Nullness",
"visitLocalVariable",
"(",
"LocalVariableNode",
"node",
",",
"LocalVariableValues",
"<",
"Nullness",
">",
"values",
")",
"{",
"return",
"hasPrimitiveType",
"(",
"node",
")",
"||",
"hasNonNullConstantValue",
"(",
"node",
")",
"?",
"NONN... | Variables take their values from their past assignments (as far as they can be determined).
Additionally, variables of primitive type are always refined to non-null.
<p>(This second case is rarely of interest to us. Either the variable is being used as a
primitive, in which case we probably wouldn't have bothered to r... | [
"Variables",
"take",
"their",
"values",
"from",
"their",
"past",
"assignments",
"(",
"as",
"far",
"as",
"they",
"can",
"be",
"determined",
")",
".",
"Additionally",
"variables",
"of",
"primitive",
"type",
"are",
"always",
"refined",
"to",
"non",
"-",
"null",... | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/dataflow/nullnesspropagation/NullnessPropagationTransfer.java#L520-L525 |
HubSpot/Singularity | SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java | SingularityClient.getSingularityRequestSimple | public Optional<SingularityRequestWithState> getSingularityRequestSimple(String requestId) {
"""
Fetch only the request + state, no additional deploy/task data
"""
final Function<String, String> singularityApiRequestUri = (host) -> String.format(REQUEST_GET_SIMPLE_FORMAT, getApiBase(host), requestId);
... | java | public Optional<SingularityRequestWithState> getSingularityRequestSimple(String requestId) {
final Function<String, String> singularityApiRequestUri = (host) -> String.format(REQUEST_GET_SIMPLE_FORMAT, getApiBase(host), requestId);
return getSingle(singularityApiRequestUri, "request-simple", requestId, Singula... | [
"public",
"Optional",
"<",
"SingularityRequestWithState",
">",
"getSingularityRequestSimple",
"(",
"String",
"requestId",
")",
"{",
"final",
"Function",
"<",
"String",
",",
"String",
">",
"singularityApiRequestUri",
"=",
"(",
"host",
")",
"-",
">",
"String",
".",
... | Fetch only the request + state, no additional deploy/task data | [
"Fetch",
"only",
"the",
"request",
"+",
"state",
"no",
"additional",
"deploy",
"/",
"task",
"data"
] | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java#L588-L592 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/core/registration/DJGroupRegistrationManager.java | DJGroupRegistrationManager.transformEntity | protected Object transformEntity(Entity entity) throws JRException {
"""
PropertyColumn only can be used for grouping (not OperationColumn)
"""
//log.debug("transforming group...");
DJGroup djgroup = (DJGroup) entity;
PropertyColumn column = djgroup.getColumnToGroupBy();
JRDesignGroup group = new JRDes... | java | protected Object transformEntity(Entity entity) throws JRException {
//log.debug("transforming group...");
DJGroup djgroup = (DJGroup) entity;
PropertyColumn column = djgroup.getColumnToGroupBy();
JRDesignGroup group = new JRDesignGroup();
group.setName(djgroup.getName());
getLayoutManager().getReferen... | [
"protected",
"Object",
"transformEntity",
"(",
"Entity",
"entity",
")",
"throws",
"JRException",
"{",
"//log.debug(\"transforming group...\");",
"DJGroup",
"djgroup",
"=",
"(",
"DJGroup",
")",
"entity",
";",
"PropertyColumn",
"column",
"=",
"djgroup",
".",
"getColumnT... | PropertyColumn only can be used for grouping (not OperationColumn) | [
"PropertyColumn",
"only",
"can",
"be",
"used",
"for",
"grouping",
"(",
"not",
"OperationColumn",
")"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/core/registration/DJGroupRegistrationManager.java#L113-L155 |
jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/user/screen/UserPasswordChange.java | UserPasswordChange.doCommand | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) {
"""
Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't pr... | java | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
boolean bFlag = super.doCommand(strCommand, sourceSField, iCommandOptions);
if (MenuConstants.SUBMIT.equalsIgnoreCase(strCommand))
if (bFlag)
return super.doCommand(MenuConstants.HOME... | [
"public",
"boolean",
"doCommand",
"(",
"String",
"strCommand",
",",
"ScreenField",
"sourceSField",
",",
"int",
"iCommandOptions",
")",
"{",
"boolean",
"bFlag",
"=",
"super",
".",
"doCommand",
"(",
"strCommand",
",",
"sourceSField",
",",
"iCommandOptions",
")",
"... | Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't process, pass to parent (with me as the source).
<br />Note: Never pass to a parent or child that matches t... | [
"Process",
"the",
"command",
".",
"<br",
"/",
">",
"Step",
"1",
"-",
"Process",
"the",
"command",
"if",
"possible",
"and",
"return",
"true",
"if",
"processed",
".",
"<br",
"/",
">",
"Step",
"2",
"-",
"If",
"I",
"can",
"t",
"process",
"pass",
"to",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/user/screen/UserPasswordChange.java#L124-L131 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/route/Route.java | Route.ANY | public static Route ANY(String uriPattern, RouteHandler routeHandler) {
"""
Create a route responding to any HTTP Verb (GET, POST, PUT, ...).
@param uriPattern
@param routeHandler
@return
"""
return new Route(HttpConstants.Method.ANY, uriPattern, routeHandler);
} | java | public static Route ANY(String uriPattern, RouteHandler routeHandler) {
return new Route(HttpConstants.Method.ANY, uriPattern, routeHandler);
} | [
"public",
"static",
"Route",
"ANY",
"(",
"String",
"uriPattern",
",",
"RouteHandler",
"routeHandler",
")",
"{",
"return",
"new",
"Route",
"(",
"HttpConstants",
".",
"Method",
".",
"ANY",
",",
"uriPattern",
",",
"routeHandler",
")",
";",
"}"
] | Create a route responding to any HTTP Verb (GET, POST, PUT, ...).
@param uriPattern
@param routeHandler
@return | [
"Create",
"a",
"route",
"responding",
"to",
"any",
"HTTP",
"Verb",
"(",
"GET",
"POST",
"PUT",
"...",
")",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/route/Route.java#L166-L168 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/utils/ResponseUtils.java | ResponseUtils.contains | public static boolean contains(final byte[] pByte, final SwEnum... pEnum) {
"""
Method used to check equality with the last command return SW1SW2 ==
pEnum
@param pByte
response to the last command
@param pEnum
responses to check
@return true if the response of the last command is contained in pEnum
"""... | java | public static boolean contains(final byte[] pByte, final SwEnum... pEnum) {
SwEnum val = SwEnum.getSW(pByte);
if (LOGGER.isDebugEnabled() && pByte != null) {
LOGGER.debug("Response Status <"
+ BytesUtils.bytesToStringNoSpace(Arrays.copyOfRange(pByte, Math.max(pByte.length - 2, 0), pByte.length)) + "> : "
... | [
"public",
"static",
"boolean",
"contains",
"(",
"final",
"byte",
"[",
"]",
"pByte",
",",
"final",
"SwEnum",
"...",
"pEnum",
")",
"{",
"SwEnum",
"val",
"=",
"SwEnum",
".",
"getSW",
"(",
"pByte",
")",
";",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",... | Method used to check equality with the last command return SW1SW2 ==
pEnum
@param pByte
response to the last command
@param pEnum
responses to check
@return true if the response of the last command is contained in pEnum | [
"Method",
"used",
"to",
"check",
"equality",
"with",
"the",
"last",
"command",
"return",
"SW1SW2",
"==",
"pEnum"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/utils/ResponseUtils.java#L75-L83 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/NamespaceContextParser.java | NamespaceContextParser.parseNamespaceDefinitions | private void parseNamespaceDefinitions(BeanDefinitionBuilder builder, Element element) {
"""
Parses all variable definitions and adds those to the bean definition
builder as property value.
@param builder the target bean definition builder.
@param element the source element.
"""
Map<String, String> ... | java | private void parseNamespaceDefinitions(BeanDefinitionBuilder builder, Element element) {
Map<String, String> namespaces = new LinkedHashMap<String, String>();
for (Element namespace : DomUtils.getChildElementsByTagName(element, "namespace")) {
namespaces.put(namespace.getAttribute("prefix"),... | [
"private",
"void",
"parseNamespaceDefinitions",
"(",
"BeanDefinitionBuilder",
"builder",
",",
"Element",
"element",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"namespaces",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",... | Parses all variable definitions and adds those to the bean definition
builder as property value.
@param builder the target bean definition builder.
@param element the source element. | [
"Parses",
"all",
"variable",
"definitions",
"and",
"adds",
"those",
"to",
"the",
"bean",
"definition",
"builder",
"as",
"property",
"value",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/NamespaceContextParser.java#L51-L60 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/message/analytics/GenericAnalyticsRequest.java | GenericAnalyticsRequest.jsonQuery | public static GenericAnalyticsRequest jsonQuery(String jsonQuery, String bucket, String username, String password, int priority) {
"""
Create a {@link GenericAnalyticsRequest} and mark it as containing a full Analytics query in Json form
(including additional query parameters).
The simplest form of such a quer... | java | public static GenericAnalyticsRequest jsonQuery(String jsonQuery, String bucket, String username, String password, int priority) {
return new GenericAnalyticsRequest(jsonQuery, true, bucket, username, password, null, priority);
} | [
"public",
"static",
"GenericAnalyticsRequest",
"jsonQuery",
"(",
"String",
"jsonQuery",
",",
"String",
"bucket",
",",
"String",
"username",
",",
"String",
"password",
",",
"int",
"priority",
")",
"{",
"return",
"new",
"GenericAnalyticsRequest",
"(",
"jsonQuery",
"... | Create a {@link GenericAnalyticsRequest} and mark it as containing a full Analytics query in Json form
(including additional query parameters).
The simplest form of such a query is a single statement encapsulated in a json query object:
<pre>{"statement":"SELECT * FROM default"}</pre>.
@param jsonQuery the Analytics ... | [
"Create",
"a",
"{",
"@link",
"GenericAnalyticsRequest",
"}",
"and",
"mark",
"it",
"as",
"containing",
"a",
"full",
"Analytics",
"query",
"in",
"Json",
"form",
"(",
"including",
"additional",
"query",
"parameters",
")",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/analytics/GenericAnalyticsRequest.java#L116-L118 |
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.beginResizeAsync | public Observable<Void> beginResizeAsync(String resourceGroupName, String clusterName) {
"""
Resizes the specified HDInsight cluster to the specified size.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters... | java | public Observable<Void> beginResizeAsync(String resourceGroupName, String clusterName) {
return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"beginResizeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"return",
"beginResizeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"map",
"(",
"new",
"Fun... | Resizes the specified HDInsight cluster to the specified size.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Resizes",
"the",
"specified",
"HDInsight",
"cluster",
"to",
"the",
"specified",
"size",
"."
] | 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#L1035-L1042 |
gallandarakhneorg/afc | advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/path/astar/RoadAStar.java | RoadAStar.solve | public RoadPath solve(Point2D<?, ?> startPoint, Point2D<?, ?> endPoint, RoadNetwork network) {
"""
Run the A* algorithm from the nearest segment to
<var>startPoint</var> to the nearest segment to
<var>endPoint</var>.
@param startPoint is the starting point.
@param endPoint is the point to reach.
@param netw... | java | public RoadPath solve(Point2D<?, ?> startPoint, Point2D<?, ?> endPoint, RoadNetwork network) {
assert network != null && startPoint != null && endPoint != null;
final RoadSegment startSegment = network.getNearestSegment(startPoint);
if (startSegment != null) {
final RoadSegment endSegment = network.getNearestS... | [
"public",
"RoadPath",
"solve",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"startPoint",
",",
"Point2D",
"<",
"?",
",",
"?",
">",
"endPoint",
",",
"RoadNetwork",
"network",
")",
"{",
"assert",
"network",
"!=",
"null",
"&&",
"startPoint",
"!=",
"null",
"&&... | Run the A* algorithm from the nearest segment to
<var>startPoint</var> to the nearest segment to
<var>endPoint</var>.
@param startPoint is the starting point.
@param endPoint is the point to reach.
@param network is the road network to explore.
@return the found path, or <code>null</code> if none found. | [
"Run",
"the",
"A",
"*",
"algorithm",
"from",
"the",
"nearest",
"segment",
"to",
"<var",
">",
"startPoint<",
"/",
"var",
">",
"to",
"the",
"nearest",
"segment",
"to",
"<var",
">",
"endPoint<",
"/",
"var",
">",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/path/astar/RoadAStar.java#L160-L172 |
cloudendpoints/endpoints-management-java | endpoints-control/src/main/java/com/google/api/control/aggregator/CheckRequestAggregator.java | CheckRequestAggregator.addResponse | public void addResponse(CheckRequest req, CheckResponse resp) {
"""
Adds the response from sending {@code req} to this instances cache.
@param req a {@link CheckRequest}
@param resp the response from sending {@link CheckResponse}
"""
if (cache == null) {
return;
}
String signature = sign(... | java | public void addResponse(CheckRequest req, CheckResponse resp) {
if (cache == null) {
return;
}
String signature = sign(req).toString();
long now = ticker.read();
int quotaScale = 0; // WIP
synchronized (cache) {
CachedItem item = cache.getIfPresent(signature);
if (item == null)... | [
"public",
"void",
"addResponse",
"(",
"CheckRequest",
"req",
",",
"CheckResponse",
"resp",
")",
"{",
"if",
"(",
"cache",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
"signature",
"=",
"sign",
"(",
"req",
")",
".",
"toString",
"(",
")",
";",
... | Adds the response from sending {@code req} to this instances cache.
@param req a {@link CheckRequest}
@param resp the response from sending {@link CheckResponse} | [
"Adds",
"the",
"response",
"from",
"sending",
"{",
"@code",
"req",
"}",
"to",
"this",
"instances",
"cache",
"."
] | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-control/src/main/java/com/google/api/control/aggregator/CheckRequestAggregator.java#L174-L193 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/attachment/MediaType.java | MediaType.nonBinaryUtf8 | public static MediaType nonBinaryUtf8( MediaType.Type type, String subType ) {
"""
Creates a non-binary media type with the given type, subtype, and UTF-8 encoding
@throws com.tngtech.jgiven.exception.JGivenWrongUsageException if any of the given arguments is {@code null}
"""
return new MediaType( typ... | java | public static MediaType nonBinaryUtf8( MediaType.Type type, String subType ) {
return new MediaType( type, subType, UTF_8 );
} | [
"public",
"static",
"MediaType",
"nonBinaryUtf8",
"(",
"MediaType",
".",
"Type",
"type",
",",
"String",
"subType",
")",
"{",
"return",
"new",
"MediaType",
"(",
"type",
",",
"subType",
",",
"UTF_8",
")",
";",
"}"
] | Creates a non-binary media type with the given type, subtype, and UTF-8 encoding
@throws com.tngtech.jgiven.exception.JGivenWrongUsageException if any of the given arguments is {@code null} | [
"Creates",
"a",
"non",
"-",
"binary",
"media",
"type",
"with",
"the",
"given",
"type",
"subtype",
"and",
"UTF",
"-",
"8",
"encoding"
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/attachment/MediaType.java#L194-L196 |
qiujuer/Genius-Android | caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/effect/Effect.java | Effect.setPaintAlpha | protected int setPaintAlpha(Paint paint, int alpha) {
"""
Set the draw paint alpha by modulateAlpha
@param paint Paint
@param alpha Alpha
@return PrevAlpha
"""
final int prevAlpha = paint.getAlpha();
paint.setAlpha(Ui.modulateAlpha(prevAlpha, alpha));
return prevAlpha;
} | java | protected int setPaintAlpha(Paint paint, int alpha) {
final int prevAlpha = paint.getAlpha();
paint.setAlpha(Ui.modulateAlpha(prevAlpha, alpha));
return prevAlpha;
} | [
"protected",
"int",
"setPaintAlpha",
"(",
"Paint",
"paint",
",",
"int",
"alpha",
")",
"{",
"final",
"int",
"prevAlpha",
"=",
"paint",
".",
"getAlpha",
"(",
")",
";",
"paint",
".",
"setAlpha",
"(",
"Ui",
".",
"modulateAlpha",
"(",
"prevAlpha",
",",
"alpha... | Set the draw paint alpha by modulateAlpha
@param paint Paint
@param alpha Alpha
@return PrevAlpha | [
"Set",
"the",
"draw",
"paint",
"alpha",
"by",
"modulateAlpha"
] | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/effect/Effect.java#L109-L113 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/rpc/runner/XmlRpcRemoteRunner.java | XmlRpcRemoteRunner.runSpecification | public Execution runSpecification(String projectName, String sutName, String repositoryId, String specificationName,
boolean implementedVersion, String locale)
throws GreenPepperServerException {
"""
<p>runSpecification.</p>
@param projectName a {@link java.lang.String} object.
@param sutName a {... | java | public Execution runSpecification(String projectName, String sutName, String repositoryId, String specificationName,
boolean implementedVersion, String locale)
throws GreenPepperServerException
{
SystemUnderTest sut = SystemUnderTest.newInstance(sutName);
sut.setProject(Project.newInstance(projectNam... | [
"public",
"Execution",
"runSpecification",
"(",
"String",
"projectName",
",",
"String",
"sutName",
",",
"String",
"repositoryId",
",",
"String",
"specificationName",
",",
"boolean",
"implementedVersion",
",",
"String",
"locale",
")",
"throws",
"GreenPepperServerExceptio... | <p>runSpecification.</p>
@param projectName a {@link java.lang.String} object.
@param sutName a {@link java.lang.String} object.
@param repositoryId a {@link java.lang.String} object.
@param specificationName a {@link java.lang.String} object.
@param implementedVersion a boolean.
@param locale a {@link java.lang.Strin... | [
"<p",
">",
"runSpecification",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/rpc/runner/XmlRpcRemoteRunner.java#L99-L110 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.restoreKey | public KeyBundle restoreKey(String vaultBaseUrl, byte[] keyBundleBackup) {
"""
Restores a backed up key to a vault.
Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backe... | java | public KeyBundle restoreKey(String vaultBaseUrl, byte[] keyBundleBackup) {
return restoreKeyWithServiceResponseAsync(vaultBaseUrl, keyBundleBackup).toBlocking().single().body();
} | [
"public",
"KeyBundle",
"restoreKey",
"(",
"String",
"vaultBaseUrl",
",",
"byte",
"[",
"]",
"keyBundleBackup",
")",
"{",
"return",
"restoreKeyWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"keyBundleBackup",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(... | Restores a backed up key to a vault.
Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its... | [
"Restores",
"a",
"backed",
"up",
"key",
"to",
"a",
"vault",
".",
"Imports",
"a",
"previously",
"backed",
"up",
"key",
"into",
"Azure",
"Key",
"Vault",
"restoring",
"the",
"key",
"its",
"key",
"identifier",
"attributes",
"and",
"access",
"control",
"policies"... | 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#L2053-L2055 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getDeletedSasDefinitionAsync | public ServiceFuture<DeletedSasDefinitionBundle> getDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback<DeletedSasDefinitionBundle> serviceCallback) {
"""
Gets the specified deleted sas definition.
The Get Deleted SAS Definition operation retur... | java | public ServiceFuture<DeletedSasDefinitionBundle> getDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback<DeletedSasDefinitionBundle> serviceCallback) {
return ServiceFuture.fromResponse(getDeletedSasDefinitionWithServiceResponseAsync(vaultBase... | [
"public",
"ServiceFuture",
"<",
"DeletedSasDefinitionBundle",
">",
"getDeletedSasDefinitionAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
",",
"final",
"ServiceCallback",
"<",
"DeletedSasDefinitionBundle",
">",
... | Gets the specified deleted sas definition.
The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName T... | [
"Gets",
"the",
"specified",
"deleted",
"sas",
"definition",
".",
"The",
"Get",
"Deleted",
"SAS",
"Definition",
"operation",
"returns",
"the",
"specified",
"deleted",
"SAS",
"definition",
"along",
"with",
"its",
"attributes",
".",
"This",
"operation",
"requires",
... | 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#L10895-L10897 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java | PactDslJsonArray.arrayMaxLike | public static PactDslJsonArray arrayMaxLike(int maxSize, int numberExamples, PactDslJsonRootValue value) {
"""
Root level array with maximum size where each item must match the provided matcher
@param maxSize maximum size
@param numberExamples Number of examples to generate
"""
if (numberExamples > maxSi... | java | public static PactDslJsonArray arrayMaxLike(int maxSize, int numberExamples, PactDslJsonRootValue value) {
if (numberExamples > maxSize) {
throw new IllegalArgumentException(String.format("Number of example %d is more than the maximum size of %d",
numberExamples, maxSize));
}
PactDslJsonArray ... | [
"public",
"static",
"PactDslJsonArray",
"arrayMaxLike",
"(",
"int",
"maxSize",
",",
"int",
"numberExamples",
",",
"PactDslJsonRootValue",
"value",
")",
"{",
"if",
"(",
"numberExamples",
">",
"maxSize",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"St... | Root level array with maximum size where each item must match the provided matcher
@param maxSize maximum size
@param numberExamples Number of examples to generate | [
"Root",
"level",
"array",
"with",
"maximum",
"size",
"where",
"each",
"item",
"must",
"match",
"the",
"provided",
"matcher"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java#L851-L861 |
finmath/finmath-lib | src/main/java/net/finmath/fouriermethod/products/smile/EuropeanOptionSmile.java | EuropeanOptionSmile.getDescriptor | public SingleAssetEuropeanOptionProductDescriptor getDescriptor(LocalDate referenceDate, int index) throws ArrayIndexOutOfBoundsException {
"""
Return a product descriptor for a specific strike.
@param referenceDate The reference date (translating the maturity floating point date to dates.
@param index The ind... | java | public SingleAssetEuropeanOptionProductDescriptor getDescriptor(LocalDate referenceDate, int index) throws ArrayIndexOutOfBoundsException{
LocalDate maturityDate = FloatingpointDate.getDateFromFloatingPointDate(referenceDate, maturity);
if(index >= strikes.length) {
throw new ArrayIndexOutOfBoundsException("Stri... | [
"public",
"SingleAssetEuropeanOptionProductDescriptor",
"getDescriptor",
"(",
"LocalDate",
"referenceDate",
",",
"int",
"index",
")",
"throws",
"ArrayIndexOutOfBoundsException",
"{",
"LocalDate",
"maturityDate",
"=",
"FloatingpointDate",
".",
"getDateFromFloatingPointDate",
"("... | Return a product descriptor for a specific strike.
@param referenceDate The reference date (translating the maturity floating point date to dates.
@param index The index corresponding to the strike grid.
@return a product descriptor for a specific strike.
@throws ArrayIndexOutOfBoundsException Thrown if index is out o... | [
"Return",
"a",
"product",
"descriptor",
"for",
"a",
"specific",
"strike",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/fouriermethod/products/smile/EuropeanOptionSmile.java#L109-L116 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/PageFlowTagUtils.java | PageFlowTagUtils.getToken | public static String getToken(HttpServletRequest request, ActionMapping mapping) {
"""
Get or generate a token used to prevent double submits to an action. The token is stored in the session,
and checked (and removed) when processing an action with the <code>preventDoubleSubmit</code> attribute
set to <code>tru... | java | public static String getToken(HttpServletRequest request, ActionMapping mapping)
{
if (mapping instanceof PageFlowActionMapping && ((PageFlowActionMapping) mapping).isPreventDoubleSubmit()) {
HttpSession session = request.getSession();
String token = (String) session.getAttribute(Glo... | [
"public",
"static",
"String",
"getToken",
"(",
"HttpServletRequest",
"request",
",",
"ActionMapping",
"mapping",
")",
"{",
"if",
"(",
"mapping",
"instanceof",
"PageFlowActionMapping",
"&&",
"(",
"(",
"PageFlowActionMapping",
")",
"mapping",
")",
".",
"isPreventDoubl... | Get or generate a token used to prevent double submits to an action. The token is stored in the session,
and checked (and removed) when processing an action with the <code>preventDoubleSubmit</code> attribute
set to <code>true</code>. | [
"Get",
"or",
"generate",
"a",
"token",
"used",
"to",
"prevent",
"double",
"submits",
"to",
"an",
"action",
".",
"The",
"token",
"is",
"stored",
"in",
"the",
"session",
"and",
"checked",
"(",
"and",
"removed",
")",
"when",
"processing",
"an",
"action",
"w... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/PageFlowTagUtils.java#L161-L173 |
logic-ng/LogicNG | src/main/java/org/logicng/bdds/jbuddy/BDDKernel.java | BDDKernel.forAll | public int forAll(final int r, final int var) {
"""
Universal quantifier elimination for the variables in {@code var}.
@param r the BDD root node
@param var the variables to eliminate
@return the BDD with the eliminated variables
"""
final int res;
if (var < 2)
return r;
varset2vartable(... | java | public int forAll(final int r, final int var) {
final int res;
if (var < 2)
return r;
varset2vartable(var);
initRef();
res = quantRec(r, Operand.AND, (var << 3) | CACHEID_FORALL);
return res;
} | [
"public",
"int",
"forAll",
"(",
"final",
"int",
"r",
",",
"final",
"int",
"var",
")",
"{",
"final",
"int",
"res",
";",
"if",
"(",
"var",
"<",
"2",
")",
"return",
"r",
";",
"varset2vartable",
"(",
"var",
")",
";",
"initRef",
"(",
")",
";",
"res",
... | Universal quantifier elimination for the variables in {@code var}.
@param r the BDD root node
@param var the variables to eliminate
@return the BDD with the eliminated variables | [
"Universal",
"quantifier",
"elimination",
"for",
"the",
"variables",
"in",
"{"
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/bdds/jbuddy/BDDKernel.java#L757-L765 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/report/model/StepFormatter.java | StepFormatter.addArgumentByIndex | private void addArgumentByIndex( int index, StringBuilder currentWords, List<Word> formattedWords, Set<String> usedArguments ) {
"""
Looks up the argument by index via {@link #argumentIndexToWord(int)}, adds it to formattedWords and usedArguments
and flushes the previously accumulated text via {@link #flushCurren... | java | private void addArgumentByIndex( int index, StringBuilder currentWords, List<Word> formattedWords, Set<String> usedArguments ) {
flushCurrentWord( currentWords, formattedWords, true );
Word argument = argumentIndexToWord( index );
formattedWords.add( argument );
usedArguments.add( argume... | [
"private",
"void",
"addArgumentByIndex",
"(",
"int",
"index",
",",
"StringBuilder",
"currentWords",
",",
"List",
"<",
"Word",
">",
"formattedWords",
",",
"Set",
"<",
"String",
">",
"usedArguments",
")",
"{",
"flushCurrentWord",
"(",
"currentWords",
",",
"formatt... | Looks up the argument by index via {@link #argumentIndexToWord(int)}, adds it to formattedWords and usedArguments
and flushes the previously accumulated text via {@link #flushCurrentWord(StringBuilder, List, boolean)}.
@param index is searchable index
@param currentWords this {@link StringBuilder} holds the previously... | [
"Looks",
"up",
"the",
"argument",
"by",
"index",
"via",
"{",
"@link",
"#argumentIndexToWord",
"(",
"int",
")",
"}",
"adds",
"it",
"to",
"formattedWords",
"and",
"usedArguments",
"and",
"flushes",
"the",
"previously",
"accumulated",
"text",
"via",
"{",
"@link",... | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/report/model/StepFormatter.java#L270-L275 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java | FTPFileSystem.mkdirs | private boolean mkdirs(FTPClient client, Path file, FsPermission permission)
throws IOException {
"""
Convenience method, so that we don't open a new connection when using this
method from within another method. Otherwise every API invocation incurs
the overhead of opening/closing a TCP connection.
"""... | java | private boolean mkdirs(FTPClient client, Path file, FsPermission permission)
throws IOException {
boolean created = true;
Path workDir = new Path(client.printWorkingDirectory());
Path absolute = makeAbsolute(workDir, file);
String pathName = absolute.getName();
if (!exists(client, absolute)) {... | [
"private",
"boolean",
"mkdirs",
"(",
"FTPClient",
"client",
",",
"Path",
"file",
",",
"FsPermission",
"permission",
")",
"throws",
"IOException",
"{",
"boolean",
"created",
"=",
"true",
";",
"Path",
"workDir",
"=",
"new",
"Path",
"(",
"client",
".",
"printWo... | Convenience method, so that we don't open a new connection when using this
method from within another method. Otherwise every API invocation incurs
the overhead of opening/closing a TCP connection. | [
"Convenience",
"method",
"so",
"that",
"we",
"don",
"t",
"open",
"a",
"new",
"connection",
"when",
"using",
"this",
"method",
"from",
"within",
"another",
"method",
".",
"Otherwise",
"every",
"API",
"invocation",
"incurs",
"the",
"overhead",
"of",
"opening",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java#L467-L487 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.toFormatter | public DateTimeFormatter toFormatter() {
"""
Constructs a DateTimeFormatter using all the appended elements.
<p>
This is the main method used by applications at the end of the build
process to create a usable formatter.
<p>
Subsequent changes to this builder do not affect the returned formatter.
<p>
The ret... | java | public DateTimeFormatter toFormatter() {
Object f = getFormatter();
InternalPrinter printer = null;
if (isPrinter(f)) {
printer = (InternalPrinter) f;
}
InternalParser parser = null;
if (isParser(f)) {
parser = (InternalParser) f;
}
... | [
"public",
"DateTimeFormatter",
"toFormatter",
"(",
")",
"{",
"Object",
"f",
"=",
"getFormatter",
"(",
")",
";",
"InternalPrinter",
"printer",
"=",
"null",
";",
"if",
"(",
"isPrinter",
"(",
"f",
")",
")",
"{",
"printer",
"=",
"(",
"InternalPrinter",
")",
... | Constructs a DateTimeFormatter using all the appended elements.
<p>
This is the main method used by applications at the end of the build
process to create a usable formatter.
<p>
Subsequent changes to this builder do not affect the returned formatter.
<p>
The returned formatter may not support both printing and parsing... | [
"Constructs",
"a",
"DateTimeFormatter",
"using",
"all",
"the",
"appended",
"elements",
".",
"<p",
">",
"This",
"is",
"the",
"main",
"method",
"used",
"by",
"applications",
"at",
"the",
"end",
"of",
"the",
"build",
"process",
"to",
"create",
"a",
"usable",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L103-L117 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.