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 |
|---|---|---|---|---|---|---|---|---|---|---|
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/config/dialplan/ExtensionsConfigFileReader.java | ExtensionsConfigFileReader.processTextLine | @Override
protected ConfigElement processTextLine(String configfile, int lineno, String line) throws ConfigParseException {
"""
/*
This method corresponds to an iteration of the loop at line 2212 Notes:
1. [general] and [globals] are allowed to be a context here if they
contain only configvariables 2. switc... | java | @Override
protected ConfigElement processTextLine(String configfile, int lineno, String line) throws ConfigParseException
{
ConfigElement configElement;
if ((line.trim().startsWith("exten") || line.trim().startsWith("include")) && currentCategory != null
&& (currentCategory.getN... | [
"@",
"Override",
"protected",
"ConfigElement",
"processTextLine",
"(",
"String",
"configfile",
",",
"int",
"lineno",
",",
"String",
"line",
")",
"throws",
"ConfigParseException",
"{",
"ConfigElement",
"configElement",
";",
"if",
"(",
"(",
"line",
".",
"trim",
"(... | /*
This method corresponds to an iteration of the loop at line 2212 Notes:
1. [general] and [globals] are allowed to be a context here if they
contain only configvariables 2. switch and ignorepat are treated like
regular ConfigVariable. | [
"/",
"*",
"This",
"method",
"corresponds",
"to",
"an",
"iteration",
"of",
"the",
"loop",
"at",
"line",
"2212",
"Notes",
":",
"1",
".",
"[",
"general",
"]",
"and",
"[",
"globals",
"]",
"are",
"allowed",
"to",
"be",
"a",
"context",
"here",
"if",
"they"... | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/config/dialplan/ExtensionsConfigFileReader.java#L23-L59 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java | GridDialects.hasFacet | public static boolean hasFacet(GridDialect gridDialect, Class<? extends GridDialect> facetType) {
"""
Whether the given grid dialect implements the specified facet or not.
@param gridDialect the dialect of interest
@param facetType the dialect facet type of interest
@return {@code true} in case the given dial... | java | public static boolean hasFacet(GridDialect gridDialect, Class<? extends GridDialect> facetType) {
if ( gridDialect instanceof ForwardingGridDialect ) {
return hasFacet( ( (ForwardingGridDialect<?>) gridDialect ).getGridDialect(), facetType );
}
else {
return facetType.isAssignableFrom( gridDialect.getClass(... | [
"public",
"static",
"boolean",
"hasFacet",
"(",
"GridDialect",
"gridDialect",
",",
"Class",
"<",
"?",
"extends",
"GridDialect",
">",
"facetType",
")",
"{",
"if",
"(",
"gridDialect",
"instanceof",
"ForwardingGridDialect",
")",
"{",
"return",
"hasFacet",
"(",
"(",... | Whether the given grid dialect implements the specified facet or not.
@param gridDialect the dialect of interest
@param facetType the dialect facet type of interest
@return {@code true} in case the given dialect implements the specified facet, {@code false} otherwise | [
"Whether",
"the",
"given",
"grid",
"dialect",
"implements",
"the",
"specified",
"facet",
"or",
"not",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java#L54-L61 |
operasoftware/operaprestodriver | src/com/opera/core/systems/OperaLogs.java | OperaLogs.addEntry | public void addEntry(String logType, LogEntry entry) {
"""
Add a new log entry to the local storage.
@param logType the log type to store
@param entry the entry to store
"""
if (logTypesToIgnore.contains(logType)) {
return;
}
if (!localLogs.containsKey(logType)) {
localLogs.put(l... | java | public void addEntry(String logType, LogEntry entry) {
if (logTypesToIgnore.contains(logType)) {
return;
}
if (!localLogs.containsKey(logType)) {
localLogs.put(logType, Lists.newArrayList(entry));
} else {
localLogs.get(logType).add(entry);
}
} | [
"public",
"void",
"addEntry",
"(",
"String",
"logType",
",",
"LogEntry",
"entry",
")",
"{",
"if",
"(",
"logTypesToIgnore",
".",
"contains",
"(",
"logType",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"localLogs",
".",
"containsKey",
"(",
"logType"... | Add a new log entry to the local storage.
@param logType the log type to store
@param entry the entry to store | [
"Add",
"a",
"new",
"log",
"entry",
"to",
"the",
"local",
"storage",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaLogs.java#L71-L81 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/CopyDither.java | CopyDither.getPoint2D | public final Point2D getPoint2D(Point2D pSrcPt, Point2D pDstPt) {
"""
Returns the location of the destination point given a
point in the source. If {@code dstPt} is not
{@code null}, it will be used to hold the return value.
Since this is not a geometric operation, the {@code srcPt}
will equal the {@code dstP... | java | public final Point2D getPoint2D(Point2D pSrcPt, Point2D pDstPt) {
// Create new Point, if needed
if (pDstPt == null) {
pDstPt = new Point2D.Float();
}
// Copy location
pDstPt.setLocation(pSrcPt.getX(), pSrcPt.getY());
// Return dest
return ... | [
"public",
"final",
"Point2D",
"getPoint2D",
"(",
"Point2D",
"pSrcPt",
",",
"Point2D",
"pDstPt",
")",
"{",
"// Create new Point, if needed\r",
"if",
"(",
"pDstPt",
"==",
"null",
")",
"{",
"pDstPt",
"=",
"new",
"Point2D",
".",
"Float",
"(",
")",
";",
"}",
"/... | Returns the location of the destination point given a
point in the source. If {@code dstPt} is not
{@code null}, it will be used to hold the return value.
Since this is not a geometric operation, the {@code srcPt}
will equal the {@code dstPt}.
@param pSrcPt a {@code Point2D} that represents a point
in the source image... | [
"Returns",
"the",
"location",
"of",
"the",
"destination",
"point",
"given",
"a",
"point",
"in",
"the",
"source",
".",
"If",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/CopyDither.java#L147-L158 |
trellis-ldp-archive/trellis-http | src/main/java/org/trellisldp/http/impl/RdfUtils.java | RdfUtils.getProfile | public static IRI getProfile(final List<MediaType> acceptableTypes, final RDFSyntax syntax) {
"""
Given a list of acceptable media types and an RDF syntax, get the relevant profile data, if
relevant
@param acceptableTypes the types from HTTP headers
@param syntax an RDF syntax
@return a profile IRI if relevant... | java | public static IRI getProfile(final List<MediaType> acceptableTypes, final RDFSyntax syntax) {
for (final MediaType type : acceptableTypes) {
if (RDFSyntax.byMediaType(type.toString()).filter(syntax::equals).isPresent() &&
type.getParameters().containsKey("profile")) {
... | [
"public",
"static",
"IRI",
"getProfile",
"(",
"final",
"List",
"<",
"MediaType",
">",
"acceptableTypes",
",",
"final",
"RDFSyntax",
"syntax",
")",
"{",
"for",
"(",
"final",
"MediaType",
"type",
":",
"acceptableTypes",
")",
"{",
"if",
"(",
"RDFSyntax",
".",
... | Given a list of acceptable media types and an RDF syntax, get the relevant profile data, if
relevant
@param acceptableTypes the types from HTTP headers
@param syntax an RDF syntax
@return a profile IRI if relevant | [
"Given",
"a",
"list",
"of",
"acceptable",
"media",
"types",
"and",
"an",
"RDF",
"syntax",
"get",
"the",
"relevant",
"profile",
"data",
"if",
"relevant"
] | train | https://github.com/trellis-ldp-archive/trellis-http/blob/bc762f88602c49c2b137a7adf68d576666e55fff/src/main/java/org/trellisldp/http/impl/RdfUtils.java#L214-L222 |
UrielCh/ovh-java-sdk | ovh-java-sdk-connectivity/src/main/java/net/minidev/ovh/api/ApiOvhConnectivity.java | ApiOvhConnectivity.eligibility_search_cities_POST | public OvhAsyncTaskArray<OvhCity> eligibility_search_cities_POST(String zipCode) throws IOException {
"""
Get all localities linked to a zip code
REST: POST /connectivity/eligibility/search/cities
@param zipCode [required] Zip code
"""
String qPath = "/connectivity/eligibility/search/cities";
StringBui... | java | public OvhAsyncTaskArray<OvhCity> eligibility_search_cities_POST(String zipCode) throws IOException {
String qPath = "/connectivity/eligibility/search/cities";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "zipCode", zipCode);
String resp = execN(qPath, "... | [
"public",
"OvhAsyncTaskArray",
"<",
"OvhCity",
">",
"eligibility_search_cities_POST",
"(",
"String",
"zipCode",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/connectivity/eligibility/search/cities\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath... | Get all localities linked to a zip code
REST: POST /connectivity/eligibility/search/cities
@param zipCode [required] Zip code | [
"Get",
"all",
"localities",
"linked",
"to",
"a",
"zip",
"code"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-connectivity/src/main/java/net/minidev/ovh/api/ApiOvhConnectivity.java#L88-L95 |
elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/DynamicParameters.java | DynamicParameters.addParameter | public synchronized void addParameter(Parameter<?> option, String value, int bits, int depth) {
"""
Add a single parameter to the list
@param option Option
@param value Value
@param bits Bits
@param depth Depth
"""
parameters.add(new Node(option, value, bits, depth));
} | java | public synchronized void addParameter(Parameter<?> option, String value, int bits, int depth) {
parameters.add(new Node(option, value, bits, depth));
} | [
"public",
"synchronized",
"void",
"addParameter",
"(",
"Parameter",
"<",
"?",
">",
"option",
",",
"String",
"value",
",",
"int",
"bits",
",",
"int",
"depth",
")",
"{",
"parameters",
".",
"add",
"(",
"new",
"Node",
"(",
"option",
",",
"value",
",",
"bit... | Add a single parameter to the list
@param option Option
@param value Value
@param bits Bits
@param depth Depth | [
"Add",
"a",
"single",
"parameter",
"to",
"the",
"list"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/DynamicParameters.java#L198-L200 |
kirgor/enklib | rest/src/main/java/com/kirgor/enklib/rest/RESTClient.java | RESTClient.putWithListResult | public <T> EntityResponse<List<T>> putWithListResult(Class<T> entityClass, String path, Object payload, Map<String, String> headers) throws IOException, RESTException {
"""
Performs PUT request, while expected response entity is a list of specified type.
@param entityClass Class, which contains expected respons... | java | public <T> EntityResponse<List<T>> putWithListResult(Class<T> entityClass, String path, Object payload, Map<String, String> headers) throws IOException, RESTException {
return postWithListResultInternal(entityClass, payload, new HttpPut(baseUrl + path), headers);
} | [
"public",
"<",
"T",
">",
"EntityResponse",
"<",
"List",
"<",
"T",
">",
">",
"putWithListResult",
"(",
"Class",
"<",
"T",
">",
"entityClass",
",",
"String",
"path",
",",
"Object",
"payload",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",... | Performs PUT request, while expected response entity is a list of specified type.
@param entityClass Class, which contains expected response entity fields.
@param path Request path.
@param payload Entity, which will be used as request payload.
@param headers Map of HTTP request headers.
@param <T> ... | [
"Performs",
"PUT",
"request",
"while",
"expected",
"response",
"entity",
"is",
"a",
"list",
"of",
"specified",
"type",
"."
] | train | https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/rest/src/main/java/com/kirgor/enklib/rest/RESTClient.java#L416-L418 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java | Assertions.assertNotNull | @Nonnull
public static <T> T assertNotNull(@Nullable final String failMessage, @Nullable final T object) {
"""
Assert that value is not null
@param <T> type of the object to check
@param failMessage the message to be provided as error description, can be null
@param object the object to check
... | java | @Nonnull
public static <T> T assertNotNull(@Nullable final String failMessage, @Nullable final T object) {
if (object == null) {
final String txt = failMessage == null ? "Object must not be NULL" : failMessage;
final AssertionError error = new AssertionError(txt);
MetaErrorListeners.fireError(tx... | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"T",
"assertNotNull",
"(",
"@",
"Nullable",
"final",
"String",
"failMessage",
",",
"@",
"Nullable",
"final",
"T",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"final",
"String",
"tx... | Assert that value is not null
@param <T> type of the object to check
@param failMessage the message to be provided as error description, can be null
@param object the object to check
@return the same input parameter if all is ok
@throws AssertionError it will be thrown if the value is null
@since 1.1.0 | [
"Assert",
"that",
"value",
"is",
"not",
"null"
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java#L124-L133 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_option_option_GET | public OvhOption serviceName_option_option_GET(String serviceName, net.minidev.ovh.api.dedicated.server.OvhOptionEnum option) throws IOException {
"""
Get this object properties
REST: GET /dedicated/server/{serviceName}/option/{option}
@param serviceName [required] The internal name of your dedicated server
@... | java | public OvhOption serviceName_option_option_GET(String serviceName, net.minidev.ovh.api.dedicated.server.OvhOptionEnum option) throws IOException {
String qPath = "/dedicated/server/{serviceName}/option/{option}";
StringBuilder sb = path(qPath, serviceName, option);
String resp = exec(qPath, "GET", sb.toString(), ... | [
"public",
"OvhOption",
"serviceName_option_option_GET",
"(",
"String",
"serviceName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"dedicated",
".",
"server",
".",
"OvhOptionEnum",
"option",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
... | Get this object properties
REST: GET /dedicated/server/{serviceName}/option/{option}
@param serviceName [required] The internal name of your dedicated server
@param option [required] The option name | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1557-L1562 |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/appenders/ExpressionSourceAppender.java | ExpressionSourceAppender.eInit | public void eInit(EObject context, Procedure1<? super XExpression> setter, IJvmTypeProvider typeContext) {
"""
Initialize the expression.
@param context the context of the expressions.
@param setter the object that permits to assign the expression to the context.
"""
this.builder.eInit(context, setter, typ... | java | public void eInit(EObject context, Procedure1<? super XExpression> setter, IJvmTypeProvider typeContext) {
this.builder.eInit(context, setter, typeContext);
} | [
"public",
"void",
"eInit",
"(",
"EObject",
"context",
",",
"Procedure1",
"<",
"?",
"super",
"XExpression",
">",
"setter",
",",
"IJvmTypeProvider",
"typeContext",
")",
"{",
"this",
".",
"builder",
".",
"eInit",
"(",
"context",
",",
"setter",
",",
"typeContext... | Initialize the expression.
@param context the context of the expressions.
@param setter the object that permits to assign the expression to the context. | [
"Initialize",
"the",
"expression",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/appenders/ExpressionSourceAppender.java#L79-L81 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/Utils.java | Utils.toJson | public static String toJson(Object object, boolean pretty) {
"""
Convert the given object into a JSON string using
<a href="https://github.com/google/gson">Gson</a>.
@param object
The input object.
@param pretty
True for human-readable format.
@return
A JSON string. If {@code object} is {@code null},
... | java | public static String toJson(Object object, boolean pretty)
{
if (object == null)
{
return null;
}
if (pretty)
{
return PRETTY_GSON.toJson(object);
}
else
{
return GSON.toJson(object);
}
} | [
"public",
"static",
"String",
"toJson",
"(",
"Object",
"object",
",",
"boolean",
"pretty",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"pretty",
")",
"{",
"return",
"PRETTY_GSON",
".",
"toJson",
"(",
... | Convert the given object into a JSON string using
<a href="https://github.com/google/gson">Gson</a>.
@param object
The input object.
@param pretty
True for human-readable format.
@return
A JSON string. If {@code object} is {@code null},
{@code null} is returned.
@since 2.0 | [
"Convert",
"the",
"given",
"object",
"into",
"a",
"JSON",
"string",
"using",
"<a",
"href",
"=",
"https",
":",
"//",
"github",
".",
"com",
"/",
"google",
"/",
"gson",
">",
"Gson<",
"/",
"a",
">",
"."
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/Utils.java#L124-L139 |
kiswanij/jk-util | src/main/java/com/jk/util/locale/JKMessage.java | JKMessage.addLables | public void addLables(JKLocale locale, final Properties lables) {
"""
Adds the lables.
@param locale the locale
@param lables the lables
"""
final Enumeration keys = lables.keys();
while (keys.hasMoreElements()) {
final String key = (String) keys.nextElement();
setProperty(locale, key, lables... | java | public void addLables(JKLocale locale, final Properties lables) {
final Enumeration keys = lables.keys();
while (keys.hasMoreElements()) {
final String key = (String) keys.nextElement();
setProperty(locale, key, lables.getProperty(key));
}
} | [
"public",
"void",
"addLables",
"(",
"JKLocale",
"locale",
",",
"final",
"Properties",
"lables",
")",
"{",
"final",
"Enumeration",
"keys",
"=",
"lables",
".",
"keys",
"(",
")",
";",
"while",
"(",
"keys",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"final"... | Adds the lables.
@param locale the locale
@param lables the lables | [
"Adds",
"the",
"lables",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/locale/JKMessage.java#L120-L126 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java | ScopeImpl.dupUnshared | public WriteableScope dupUnshared(Symbol newOwner) {
"""
Construct a fresh scope within this scope, with new owner,
with a new hash table, whose contents initially are those of
the table of its outer scope.
"""
if (shared > 0) {
//The nested Scopes might have already added somethi... | java | public WriteableScope dupUnshared(Symbol newOwner) {
if (shared > 0) {
//The nested Scopes might have already added something to the table, so all items
//that don't originate in this Scope or any of its outer Scopes need to be cleared:
Set<Scope> acceptScopes... | [
"public",
"WriteableScope",
"dupUnshared",
"(",
"Symbol",
"newOwner",
")",
"{",
"if",
"(",
"shared",
">",
"0",
")",
"{",
"//The nested Scopes might have already added something to the table, so all items",
"//that don't originate in this Scope or any of its outer Scopes need to be cl... | Construct a fresh scope within this scope, with new owner,
with a new hash table, whose contents initially are those of
the table of its outer scope. | [
"Construct",
"a",
"fresh",
"scope",
"within",
"this",
"scope",
"with",
"new",
"owner",
"with",
"a",
"new",
"hash",
"table",
"whose",
"contents",
"initially",
"are",
"those",
"of",
"the",
"table",
"of",
"its",
"outer",
"scope",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java#L352-L379 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.pushImage | public static boolean pushImage(Launcher launcher, final JenkinsBuildInfoLog log, final String imageTag, final String username, final String password, final String host)
throws IOException, InterruptedException {
"""
Execute push docker image on agent
@param launcher
@param log
@param imageTag
@p... | java | public static boolean pushImage(Launcher launcher, final JenkinsBuildInfoLog log, final String imageTag, final String username, final String password, final String host)
throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<Boolean, IOException>() {... | [
"public",
"static",
"boolean",
"pushImage",
"(",
"Launcher",
"launcher",
",",
"final",
"JenkinsBuildInfoLog",
"log",
",",
"final",
"String",
"imageTag",
",",
"final",
"String",
"username",
",",
"final",
"String",
"password",
",",
"final",
"String",
"host",
")",
... | Execute push docker image on agent
@param launcher
@param log
@param imageTag
@param username
@param password
@param host @return
@throws IOException
@throws InterruptedException | [
"Execute",
"push",
"docker",
"image",
"on",
"agent"
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L176-L191 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java | ProcessorInclude.getBaseURIOfIncludedStylesheet | private String getBaseURIOfIncludedStylesheet(StylesheetHandler handler, Source s)
throws TransformerException {
"""
Get the base URI of the included or imported stylesheet,
if the user provided a URIResolver, then get the Source
object for the stylsheet from it, and get the systemId
from that Sourc... | java | private String getBaseURIOfIncludedStylesheet(StylesheetHandler handler, Source s)
throws TransformerException {
String baseURI;
String idFromUriResolverSource;
if (s != null && (idFromUriResolverSource = s.getSystemId()) != null) {
// We have a Source ... | [
"private",
"String",
"getBaseURIOfIncludedStylesheet",
"(",
"StylesheetHandler",
"handler",
",",
"Source",
"s",
")",
"throws",
"TransformerException",
"{",
"String",
"baseURI",
";",
"String",
"idFromUriResolverSource",
";",
"if",
"(",
"s",
"!=",
"null",
"&&",
"(",
... | Get the base URI of the included or imported stylesheet,
if the user provided a URIResolver, then get the Source
object for the stylsheet from it, and get the systemId
from that Source object, otherwise try to recover by
using the SysteIDResolver to figure out the base URI.
@param handler The handler that processes the... | [
"Get",
"the",
"base",
"URI",
"of",
"the",
"included",
"or",
"imported",
"stylesheet",
"if",
"the",
"user",
"provided",
"a",
"URIResolver",
"then",
"get",
"the",
"Source",
"object",
"for",
"the",
"stylsheet",
"from",
"it",
"and",
"get",
"the",
"systemId",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java#L373-L395 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java | Subtypes2.traverseSupertypesDepthFirst | public void traverseSupertypesDepthFirst(ClassDescriptor start, SupertypeTraversalVisitor visitor) throws ClassNotFoundException {
"""
Starting at the class or interface named by the given ClassDescriptor,
traverse the inheritance graph depth first, visiting each class only
once. This is much faster than travers... | java | public void traverseSupertypesDepthFirst(ClassDescriptor start, SupertypeTraversalVisitor visitor) throws ClassNotFoundException {
this.traverseSupertypesDepthFirstHelper(start, visitor, new HashSet<ClassDescriptor>());
} | [
"public",
"void",
"traverseSupertypesDepthFirst",
"(",
"ClassDescriptor",
"start",
",",
"SupertypeTraversalVisitor",
"visitor",
")",
"throws",
"ClassNotFoundException",
"{",
"this",
".",
"traverseSupertypesDepthFirstHelper",
"(",
"start",
",",
"visitor",
",",
"new",
"Hash... | Starting at the class or interface named by the given ClassDescriptor,
traverse the inheritance graph depth first, visiting each class only
once. This is much faster than traversing all paths in certain circumstances.
@param start
ClassDescriptor naming the class where the traversal should
start
@param visitor
an Inhe... | [
"Starting",
"at",
"the",
"class",
"or",
"interface",
"named",
"by",
"the",
"given",
"ClassDescriptor",
"traverse",
"the",
"inheritance",
"graph",
"depth",
"first",
"visiting",
"each",
"class",
"only",
"once",
".",
"This",
"is",
"much",
"faster",
"than",
"trave... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java#L1010-L1012 |
landawn/AbacusUtil | src/com/landawn/abacus/util/FilenameUtil.java | FilenameUtil.equalsNormalizedOnSystem | public static boolean equalsNormalizedOnSystem(final String filename1, final String filename2) {
"""
Checks whether two filenames are equal after both have been normalized
and using the case rules of the system.
<p>
Both filenames are first passed to {@link #normalize(String)}.
The check is then performed case... | java | public static boolean equalsNormalizedOnSystem(final String filename1, final String filename2) {
return equals(filename1, filename2, true, IOCase.SYSTEM);
} | [
"public",
"static",
"boolean",
"equalsNormalizedOnSystem",
"(",
"final",
"String",
"filename1",
",",
"final",
"String",
"filename2",
")",
"{",
"return",
"equals",
"(",
"filename1",
",",
"filename2",
",",
"true",
",",
"IOCase",
".",
"SYSTEM",
")",
";",
"}"
] | Checks whether two filenames are equal after both have been normalized
and using the case rules of the system.
<p>
Both filenames are first passed to {@link #normalize(String)}.
The check is then performed case-sensitive on Unix and
case-insensitive on Windows.
@param filename1 the first filename to query, may be nul... | [
"Checks",
"whether",
"two",
"filenames",
"are",
"equal",
"after",
"both",
"have",
"been",
"normalized",
"and",
"using",
"the",
"case",
"rules",
"of",
"the",
"system",
".",
"<p",
">",
"Both",
"filenames",
"are",
"first",
"passed",
"to",
"{",
"@link",
"#norm... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FilenameUtil.java#L1109-L1111 |
tehuti-io/tehuti | src/main/java/io/tehuti/metrics/stats/SampledStat.java | SampledStat.purgeObsoleteSamples | protected void purgeObsoleteSamples(MetricConfig config, long now) {
"""
Timeout any windows that have expired in the absence of any events
"""
long expireAge = config.samples() * config.timeWindowMs();
for (int i = 0; i < samples.size(); i++) {
Sample sample = this.samples.get(i);
... | java | protected void purgeObsoleteSamples(MetricConfig config, long now) {
long expireAge = config.samples() * config.timeWindowMs();
for (int i = 0; i < samples.size(); i++) {
Sample sample = this.samples.get(i);
if (now - sample.lastWindowMs >= expireAge) {
// The sam... | [
"protected",
"void",
"purgeObsoleteSamples",
"(",
"MetricConfig",
"config",
",",
"long",
"now",
")",
"{",
"long",
"expireAge",
"=",
"config",
".",
"samples",
"(",
")",
"*",
"config",
".",
"timeWindowMs",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Timeout any windows that have expired in the absence of any events | [
"Timeout",
"any",
"windows",
"that",
"have",
"expired",
"in",
"the",
"absence",
"of",
"any",
"events"
] | train | https://github.com/tehuti-io/tehuti/blob/c28a2f838eac775660efb270aafd2a464d712948/src/main/java/io/tehuti/metrics/stats/SampledStat.java#L125-L141 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/lambda2/StaticAnalysis.java | StaticAnalysis.getEnclosingScope | public static Scope getEnclosingScope(Expression2 expression, int index) {
"""
Gets the scope of {@code expression} in which the
subexpression at {@code index} is evaluated. This scope
includes the bound variables, etc.
@param expression
@param index
@return
"""
Preconditions.checkArgument(index < e... | java | public static Scope getEnclosingScope(Expression2 expression, int index) {
Preconditions.checkArgument(index < expression.size());
ScopeSet scopes = getScopes(expression);
return scopes.getScope(index);
} | [
"public",
"static",
"Scope",
"getEnclosingScope",
"(",
"Expression2",
"expression",
",",
"int",
"index",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"index",
"<",
"expression",
".",
"size",
"(",
")",
")",
";",
"ScopeSet",
"scopes",
"=",
"getScopes",
... | Gets the scope of {@code expression} in which the
subexpression at {@code index} is evaluated. This scope
includes the bound variables, etc.
@param expression
@param index
@return | [
"Gets",
"the",
"scope",
"of",
"{",
"@code",
"expression",
"}",
"in",
"which",
"the",
"subexpression",
"at",
"{",
"@code",
"index",
"}",
"is",
"evaluated",
".",
"This",
"scope",
"includes",
"the",
"bound",
"variables",
"etc",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lambda2/StaticAnalysis.java#L104-L108 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.unzipFile | public static void unzipFile(File input, File output) throws IOException {
"""
Unzip a file into the output directory.
@param input the ZIP file to uncompress.
@param output the uncompressed file to create.
@throws IOException when uncompressing is failing.
@since 6.2
"""
try (FileInputStream fis = new... | java | public static void unzipFile(File input, File output) throws IOException {
try (FileInputStream fis = new FileInputStream(input)) {
unzipFile(fis, output);
}
} | [
"public",
"static",
"void",
"unzipFile",
"(",
"File",
"input",
",",
"File",
"output",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"input",
")",
")",
"{",
"unzipFile",
"(",
"fis",
",",
"output... | Unzip a file into the output directory.
@param input the ZIP file to uncompress.
@param output the uncompressed file to create.
@throws IOException when uncompressing is failing.
@since 6.2 | [
"Unzip",
"a",
"file",
"into",
"the",
"output",
"directory",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L3041-L3045 |
threerings/narya | core/src/main/java/com/threerings/presents/server/ClientManager.java | ClientManager.renameClientObject | protected boolean renameClientObject (Name oldname, Name newname) {
"""
Renames a currently connected client from <code>oldname</code> to <code>newname</code>.
@return true if the client was found and renamed.
"""
ClientObject clobj = _objmap.remove(oldname);
if (clobj == null) {
... | java | protected boolean renameClientObject (Name oldname, Name newname)
{
ClientObject clobj = _objmap.remove(oldname);
if (clobj == null) {
log.warning("Requested to rename unmapped client object", "username", oldname,
new Exception());
return false;
... | [
"protected",
"boolean",
"renameClientObject",
"(",
"Name",
"oldname",
",",
"Name",
"newname",
")",
"{",
"ClientObject",
"clobj",
"=",
"_objmap",
".",
"remove",
"(",
"oldname",
")",
";",
"if",
"(",
"clobj",
"==",
"null",
")",
"{",
"log",
".",
"warning",
"... | Renames a currently connected client from <code>oldname</code> to <code>newname</code>.
@return true if the client was found and renamed. | [
"Renames",
"a",
"currently",
"connected",
"client",
"from",
"<code",
">",
"oldname<",
"/",
"code",
">",
"to",
"<code",
">",
"newname<",
"/",
"code",
">",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientManager.java#L408-L418 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/strategies/writeable/AddThenHideOldStrategy.java | AddThenHideOldStrategy.getNonProductResourceWithHigherVersion | private RepositoryResource getNonProductResourceWithHigherVersion(RepositoryResource res1, RepositoryResource res2) {
"""
Return the resource with the highest version for when the appliesTo versions are equal
@param res1 resource to compare
@param res2 resource to compare
@return RepositoryResource with the h... | java | private RepositoryResource getNonProductResourceWithHigherVersion(RepositoryResource res1, RepositoryResource res2) {
if (res1.getVersion() == null || res2.getVersion() == null) {
return res1; // don't have two versions so can't compare
}
// have two String versions .. convert them... | [
"private",
"RepositoryResource",
"getNonProductResourceWithHigherVersion",
"(",
"RepositoryResource",
"res1",
",",
"RepositoryResource",
"res2",
")",
"{",
"if",
"(",
"res1",
".",
"getVersion",
"(",
")",
"==",
"null",
"||",
"res2",
".",
"getVersion",
"(",
")",
"=="... | Return the resource with the highest version for when the appliesTo versions are equal
@param res1 resource to compare
@param res2 resource to compare
@return RepositoryResource with the higher version field | [
"Return",
"the",
"resource",
"with",
"the",
"highest",
"version",
"for",
"when",
"the",
"appliesTo",
"versions",
"are",
"equal"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/strategies/writeable/AddThenHideOldStrategy.java#L375-L398 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/headerfooter/RtfHeaderFooterGroup.java | RtfHeaderFooterGroup.setHasFacingPages | public void setHasFacingPages() {
"""
Set that this RtfHeaderFooterGroup should have facing pages. If only
a header / footer for all pages exists, then it will be copied to the left
and right pages as well.
"""
if(this.mode == MODE_SINGLE) {
this.mode = MODE_MULTIPLE;
this.hea... | java | public void setHasFacingPages() {
if(this.mode == MODE_SINGLE) {
this.mode = MODE_MULTIPLE;
this.headerLeft = new RtfHeaderFooter(this.document, this.headerAll, RtfHeaderFooter.DISPLAY_LEFT_PAGES);
this.headerLeft.setType(this.type);
this.headerRight = new RtfHead... | [
"public",
"void",
"setHasFacingPages",
"(",
")",
"{",
"if",
"(",
"this",
".",
"mode",
"==",
"MODE_SINGLE",
")",
"{",
"this",
".",
"mode",
"=",
"MODE_MULTIPLE",
";",
"this",
".",
"headerLeft",
"=",
"new",
"RtfHeaderFooter",
"(",
"this",
".",
"document",
"... | Set that this RtfHeaderFooterGroup should have facing pages. If only
a header / footer for all pages exists, then it will be copied to the left
and right pages as well. | [
"Set",
"that",
"this",
"RtfHeaderFooterGroup",
"should",
"have",
"facing",
"pages",
".",
"If",
"only",
"a",
"header",
"/",
"footer",
"for",
"all",
"pages",
"exists",
"then",
"it",
"will",
"be",
"copied",
"to",
"the",
"left",
"and",
"right",
"pages",
"as",
... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/headerfooter/RtfHeaderFooterGroup.java#L310-L329 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.terminateSubscription | public void terminateSubscription(final Subscription subscription, final RefundOption refund) {
"""
Terminate a particular {@link Subscription} by it's UUID
@param subscription Subscription to terminate
"""
doPUT(Subscription.SUBSCRIPTION_RESOURCE + "/" + subscription.getUuid() + "/terminate?refund=... | java | public void terminateSubscription(final Subscription subscription, final RefundOption refund) {
doPUT(Subscription.SUBSCRIPTION_RESOURCE + "/" + subscription.getUuid() + "/terminate?refund=" + refund,
subscription, Subscription.class);
} | [
"public",
"void",
"terminateSubscription",
"(",
"final",
"Subscription",
"subscription",
",",
"final",
"RefundOption",
"refund",
")",
"{",
"doPUT",
"(",
"Subscription",
".",
"SUBSCRIPTION_RESOURCE",
"+",
"\"/\"",
"+",
"subscription",
".",
"getUuid",
"(",
")",
"+",... | Terminate a particular {@link Subscription} by it's UUID
@param subscription Subscription to terminate | [
"Terminate",
"a",
"particular",
"{",
"@link",
"Subscription",
"}",
"by",
"it",
"s",
"UUID"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L561-L564 |
MenoData/Time4J | base/src/main/java/net/time4j/calendar/PersianCalendar.java | PersianCalendar.getDate | public Date getDate(ZonalOffset offset) {
"""
/*[deutsch]
<p>Erhält eine astronomische Datumssicht spezifisch für die angegebene Zeitzonenverschiebung. </p>
@param offset timezone offset
@return Persian date based on astronomical calculations for given offset (possibly modified)
@throws Il... | java | public Date getDate(ZonalOffset offset) {
if (offset == null) {
throw new NullPointerException("Missing timezone offset.");
}
PersianAlgorithm algorithm = PersianAlgorithm.ASTRONOMICAL;
long utcDays = DEFAULT_COMPUTATION.transform(this, PersianAlgorithm.STD_OFFSET);
... | [
"public",
"Date",
"getDate",
"(",
"ZonalOffset",
"offset",
")",
"{",
"if",
"(",
"offset",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Missing timezone offset.\"",
")",
";",
"}",
"PersianAlgorithm",
"algorithm",
"=",
"PersianAlgorithm",
... | /*[deutsch]
<p>Erhält eine astronomische Datumssicht spezifisch für die angegebene Zeitzonenverschiebung. </p>
@param offset timezone offset
@return Persian date based on astronomical calculations for given offset (possibly modified)
@throws IllegalArgumentException in case of date overflow
@see ... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Erhä",
";",
"lt",
"eine",
"astronomische",
"Datumssicht",
"spezifisch",
"fü",
";",
"r",
"die",
"angegebene",
"Zeitzonenverschiebung",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/PersianCalendar.java#L747-L757 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java | SslContextBuilder.keyManager | public SslContextBuilder keyManager(PrivateKey key, String keyPassword, X509Certificate... keyCertChain) {
"""
Identifying certificate for this host. {@code keyCertChain} and {@code key} may
be {@code null} for client contexts, which disables mutual authentication.
@param key a PKCS#8 private key file
@param ... | java | public SslContextBuilder keyManager(PrivateKey key, String keyPassword, X509Certificate... keyCertChain) {
if (forServer) {
checkNotNull(keyCertChain, "keyCertChain required for servers");
if (keyCertChain.length == 0) {
throw new IllegalArgumentException("keyCertChain mu... | [
"public",
"SslContextBuilder",
"keyManager",
"(",
"PrivateKey",
"key",
",",
"String",
"keyPassword",
",",
"X509Certificate",
"...",
"keyCertChain",
")",
"{",
"if",
"(",
"forServer",
")",
"{",
"checkNotNull",
"(",
"keyCertChain",
",",
"\"keyCertChain required for serve... | Identifying certificate for this host. {@code keyCertChain} and {@code key} may
be {@code null} for client contexts, which disables mutual authentication.
@param key a PKCS#8 private key file
@param keyPassword the password of the {@code key}, or {@code null} if it's not
password-protected
@param keyCertChain an X.509... | [
"Identifying",
"certificate",
"for",
"this",
"host",
".",
"{",
"@code",
"keyCertChain",
"}",
"and",
"{",
"@code",
"key",
"}",
"may",
"be",
"{",
"@code",
"null",
"}",
"for",
"client",
"contexts",
"which",
"disables",
"mutual",
"authentication",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L310-L332 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/event/WebSocketEventStream.java | WebSocketEventStream.onMessage | @OnMessage
public void onMessage(String partialMessage, boolean last)
throws MessageTooBigException {
"""
Notify listeners on each event received on the websocket and buffer partial messages.
@param partialMessage partial message received on this websocket
@param last indicate the last part of ... | java | @OnMessage
public void onMessage(String partialMessage, boolean last)
throws MessageTooBigException {
if (partialMessage.length() > maxMessageLength - messageBuffer.length()) {
throw new MessageTooBigException(maxMessageLength);
}
if (last) {
String messa... | [
"@",
"OnMessage",
"public",
"void",
"onMessage",
"(",
"String",
"partialMessage",
",",
"boolean",
"last",
")",
"throws",
"MessageTooBigException",
"{",
"if",
"(",
"partialMessage",
".",
"length",
"(",
")",
">",
"maxMessageLength",
"-",
"messageBuffer",
".",
"len... | Notify listeners on each event received on the websocket and buffer partial messages.
@param partialMessage partial message received on this websocket
@param last indicate the last part of a message
@throws MessageTooBigException in case the message is longer than maxMessageLength | [
"Notify",
"listeners",
"on",
"each",
"event",
"received",
"on",
"the",
"websocket",
"and",
"buffer",
"partial",
"messages",
"."
] | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/event/WebSocketEventStream.java#L157-L187 |
Azure/azure-sdk-for-java | applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/EventsImpl.java | EventsImpl.getByType | public EventsResults getByType(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply) {
"""
Execute OData query.
Executes an OData query for events.
@param appId ID of the applicatio... | java | public EventsResults getByType(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply) {
return getByTypeWithServiceResponseAsync(appId, eventType, timespan, filter, search, orderby, s... | [
"public",
"EventsResults",
"getByType",
"(",
"String",
"appId",
",",
"EventType",
"eventType",
",",
"String",
"timespan",
",",
"String",
"filter",
",",
"String",
"search",
",",
"String",
"orderby",
",",
"String",
"select",
",",
"Integer",
"skip",
",",
"Integer... | Execute OData query.
Executes an OData query for events.
@param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal.
@param eventType The type of events to query; either a standard event type (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, `exc... | [
"Execute",
"OData",
"query",
".",
"Executes",
"an",
"OData",
"query",
"for",
"events",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/EventsImpl.java#L175-L177 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.undefinedMapping | public static void undefinedMapping(Field destinationField, Class<?> destinationClass, Field sourceField, Class<?> sourceClass) {
"""
Thrown when the instruction isn't defined.
@param destinationField destination field
@param destinationClass destination class
@param sourceField source field
@param sourceClass... | java | public static void undefinedMapping(Field destinationField, Class<?> destinationClass, Field sourceField, Class<?> sourceClass){
throw new UndefinedMappingException(MSG.INSTANCE.message(undefinedMappingException,destinationField.getName(),destinationClass.getSimpleName(),sourceField.getName(),sourceClass.getSimpleNa... | [
"public",
"static",
"void",
"undefinedMapping",
"(",
"Field",
"destinationField",
",",
"Class",
"<",
"?",
">",
"destinationClass",
",",
"Field",
"sourceField",
",",
"Class",
"<",
"?",
">",
"sourceClass",
")",
"{",
"throw",
"new",
"UndefinedMappingException",
"("... | Thrown when the instruction isn't defined.
@param destinationField destination field
@param destinationClass destination class
@param sourceField source field
@param sourceClass source class | [
"Thrown",
"when",
"the",
"instruction",
"isn",
"t",
"defined",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L396-L398 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java | ProjectNodeSupport.createCachingSource | private ResourceModelSource createCachingSource(
ResourceModelSource origin,
String ident,
String descr
) {
"""
@param origin origin source
@param ident unique identity for this cached source, used in filename
@param descr description of the source, used in logging
@r... | java | private ResourceModelSource createCachingSource(
ResourceModelSource origin,
String ident,
String descr
)
{
return createCachingSource(origin, ident, descr, SourceFactory.CacheType.BOTH, true);
} | [
"private",
"ResourceModelSource",
"createCachingSource",
"(",
"ResourceModelSource",
"origin",
",",
"String",
"ident",
",",
"String",
"descr",
")",
"{",
"return",
"createCachingSource",
"(",
"origin",
",",
"ident",
",",
"descr",
",",
"SourceFactory",
".",
"CacheType... | @param origin origin source
@param ident unique identity for this cached source, used in filename
@param descr description of the source, used in logging
@return new source | [
"@param",
"origin",
"origin",
"source",
"@param",
"ident",
"unique",
"identity",
"for",
"this",
"cached",
"source",
"used",
"in",
"filename",
"@param",
"descr",
"description",
"of",
"the",
"source",
"used",
"in",
"logging"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java#L367-L374 |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/OWLResultSetTableModel.java | OWLResultSetTableModel.getValueAt | @Override
public Object getValueAt(int row, int column) {
"""
This is the key method of TableModel: it returns the value at each cell
of the table. We use strings in this case. If anything goes wrong, we
return the exception as a string, so it will be displayed in the table.
Note that SQL row and column num... | java | @Override
public Object getValueAt(int row, int column) {
String value = resultsTable.get(row)[column];
if (value == null) {
return "";
}
else if (isHideUri) {
return prefixman.getShortForm(value);
} else {
return value;
}
} | [
"@",
"Override",
"public",
"Object",
"getValueAt",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"String",
"value",
"=",
"resultsTable",
".",
"get",
"(",
"row",
")",
"[",
"column",
"]",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
... | This is the key method of TableModel: it returns the value at each cell
of the table. We use strings in this case. If anything goes wrong, we
return the exception as a string, so it will be displayed in the table.
Note that SQL row and column numbers start at 1, but TableModel column
numbers start at 0. | [
"This",
"is",
"the",
"key",
"method",
"of",
"TableModel",
":",
"it",
"returns",
"the",
"value",
"at",
"each",
"cell",
"of",
"the",
"table",
".",
"We",
"use",
"strings",
"in",
"this",
"case",
".",
"If",
"anything",
"goes",
"wrong",
"we",
"return",
"the"... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/OWLResultSetTableModel.java#L294-L305 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Searches.java | Searches.findLast | public static <E> E findLast(Iterator<E> iterator, Predicate<E> predicate) {
"""
Searches the last matching element returning it.
@param <E> the element type parameter
@param iterator the iterator to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException if ... | java | public static <E> E findLast(Iterator<E> iterator, Predicate<E> predicate) {
final Iterator<E> filtered = new FilteringIterator<E>(iterator, predicate);
return new LastElement<E>().apply(filtered);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"findLast",
"(",
"Iterator",
"<",
"E",
">",
"iterator",
",",
"Predicate",
"<",
"E",
">",
"predicate",
")",
"{",
"final",
"Iterator",
"<",
"E",
">",
"filtered",
"=",
"new",
"FilteringIterator",
"<",
"E",
">",
"(... | Searches the last matching element returning it.
@param <E> the element type parameter
@param iterator the iterator to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException if no element matches
@return the last element found | [
"Searches",
"the",
"last",
"matching",
"element",
"returning",
"it",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Searches.java#L598-L601 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java | NetUtil.isInRange | public static boolean isInRange(String ip, String cidr) {
"""
是否在CIDR规则配置范围内<br>
方法来自:【成都】小邓
@param ip 需要验证的IP
@param cidr CIDR规则
@return 是否在范围内
@since 4.0.6
"""
String[] ips = StrUtil.splitToArray(ip, '.');
int ipAddr = (Integer.parseInt(ips[0]) << 24) | (Integer.parseInt(ips[1]) << 16) | (Intege... | java | public static boolean isInRange(String ip, String cidr) {
String[] ips = StrUtil.splitToArray(ip, '.');
int ipAddr = (Integer.parseInt(ips[0]) << 24) | (Integer.parseInt(ips[1]) << 16) | (Integer.parseInt(ips[2]) << 8) | Integer.parseInt(ips[3]);
int type = Integer.parseInt(cidr.replaceAll(".*/", ""));
int ... | [
"public",
"static",
"boolean",
"isInRange",
"(",
"String",
"ip",
",",
"String",
"cidr",
")",
"{",
"String",
"[",
"]",
"ips",
"=",
"StrUtil",
".",
"splitToArray",
"(",
"ip",
",",
"'",
"'",
")",
";",
"int",
"ipAddr",
"=",
"(",
"Integer",
".",
"parseInt... | 是否在CIDR规则配置范围内<br>
方法来自:【成都】小邓
@param ip 需要验证的IP
@param cidr CIDR规则
@return 是否在范围内
@since 4.0.6 | [
"是否在CIDR规则配置范围内<br",
">",
"方法来自:【成都】小邓"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java#L526-L535 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java | Cells.getBoolean | public Boolean getBoolean(String nameSpace, String cellName) {
"""
Returns the {@code Boolean} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or
null if this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the... | java | public Boolean getBoolean(String nameSpace, String cellName) {
return getValue(nameSpace, cellName, Boolean.class);
} | [
"public",
"Boolean",
"getBoolean",
"(",
"String",
"nameSpace",
",",
"String",
"cellName",
")",
"{",
"return",
"getValue",
"(",
"nameSpace",
",",
"cellName",
",",
"Boolean",
".",
"class",
")",
";",
"}"
] | Returns the {@code Boolean} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or
null if this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the name of the Cell we want to retrieve from this Cells object.
@return the {@... | [
"Returns",
"the",
"{",
"@code",
"Boolean",
"}",
"value",
"of",
"the",
"{",
"@link",
"Cell",
"}",
"(",
"associated",
"to",
"{",
"@code",
"table",
"}",
")",
"whose",
"name",
"iscellName",
"or",
"null",
"if",
"this",
"Cells",
"object",
"contains",
"no",
"... | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L931-L933 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/servlet/SingleThreadModelServlet.java | SingleThreadModelServlet.service | public void service(ServletRequest req, ServletResponse resp)
throws ServletException, IOException {
"""
Overloaded by subclasses to perform the servlet's request handling operation.
"""
try
{
TimedServletPoolElement e = _pool.getNextElement();
e.getServlet().service... | java | public void service(ServletRequest req, ServletResponse resp)
throws ServletException, IOException
{
try
{
TimedServletPoolElement e = _pool.getNextElement();
e.getServlet().service(req, resp);
_pool.returnElement(e);
_pool.removeExpiredElements();... | [
"public",
"void",
"service",
"(",
"ServletRequest",
"req",
",",
"ServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"try",
"{",
"TimedServletPoolElement",
"e",
"=",
"_pool",
".",
"getNextElement",
"(",
")",
";",
"e",
".",
"ge... | Overloaded by subclasses to perform the servlet's request handling operation. | [
"Overloaded",
"by",
"subclasses",
"to",
"perform",
"the",
"servlet",
"s",
"request",
"handling",
"operation",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/servlet/SingleThreadModelServlet.java#L116-L131 |
eurekaclinical/protempa | protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ProtegeKnowledgeSourceBackend.java | ProtegeKnowledgeSourceBackend.readClass | private Cls readClass(String name, String superClass)
throws KnowledgeSourceReadException {
"""
Returns the Cls from Protege if a matching Cls is found with the given
ancestor
@param name Name of the class to fetch
@param superClass name of the anscestor
@return A Cls containing the given class n... | java | private Cls readClass(String name, String superClass)
throws KnowledgeSourceReadException {
Cls cls = this.cm.getCls(name);
Cls superCls = this.cm.getCls(superClass);
if (cls != null && cls.hasSuperclass(superCls)) {
return cls;
} else {
return null;
... | [
"private",
"Cls",
"readClass",
"(",
"String",
"name",
",",
"String",
"superClass",
")",
"throws",
"KnowledgeSourceReadException",
"{",
"Cls",
"cls",
"=",
"this",
".",
"cm",
".",
"getCls",
"(",
"name",
")",
";",
"Cls",
"superCls",
"=",
"this",
".",
"cm",
... | Returns the Cls from Protege if a matching Cls is found with the given
ancestor
@param name Name of the class to fetch
@param superClass name of the anscestor
@return A Cls containing the given class name
@throws KnowledgeSourceReadException | [
"Returns",
"the",
"Cls",
"from",
"Protege",
"if",
"a",
"matching",
"Cls",
"is",
"found",
"with",
"the",
"given",
"ancestor"
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-ksb-protege/src/main/java/org/protempa/backend/ksb/protege/ProtegeKnowledgeSourceBackend.java#L222-L231 |
deeplearning4j/deeplearning4j | nd4j/nd4j-tensorflow/src/main/java/org/nd4j/tensorflow/conversion/TensorflowConversion.java | TensorflowConversion.loadGraph | public TF_Graph loadGraph(byte[] content, TF_Status status) {
"""
Get an initialized {@link TF_Graph}
based on the passed in byte array content
(the content must be a binary protobuf/pb file)
The graph will be modified to be associated
with the device associated with this current thread.
Depending on the ac... | java | public TF_Graph loadGraph(byte[] content, TF_Status status) {
byte[] toLoad = content;
TF_Buffer graph_def = TF_NewBufferFromString(new BytePointer(toLoad), content.length);
TF_Graph graphC = TF_NewGraph();
TF_ImportGraphDefOptions opts = TF_NewImportGraphDefOptions();
TF_GraphIm... | [
"public",
"TF_Graph",
"loadGraph",
"(",
"byte",
"[",
"]",
"content",
",",
"TF_Status",
"status",
")",
"{",
"byte",
"[",
"]",
"toLoad",
"=",
"content",
";",
"TF_Buffer",
"graph_def",
"=",
"TF_NewBufferFromString",
"(",
"new",
"BytePointer",
"(",
"toLoad",
")"... | Get an initialized {@link TF_Graph}
based on the passed in byte array content
(the content must be a binary protobuf/pb file)
The graph will be modified to be associated
with the device associated with this current thread.
Depending on the active {@link Nd4j#getBackend()}
the device will either be the gpu pinned to th... | [
"Get",
"an",
"initialized",
"{",
"@link",
"TF_Graph",
"}",
"based",
"on",
"the",
"passed",
"in",
"byte",
"array",
"content",
"(",
"the",
"content",
"must",
"be",
"a",
"binary",
"protobuf",
"/",
"pb",
"file",
")",
"The",
"graph",
"will",
"be",
"modified",... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-tensorflow/src/main/java/org/nd4j/tensorflow/conversion/TensorflowConversion.java#L330-L344 |
js-lib-com/commons | src/main/java/js/converter/ClassConverter.java | ClassConverter.asObject | @Override
public <T> T asObject(String string, Class<T> valueType) {
"""
Return the Java class instance for given canonical name. If given string is empty returns null. If class not found warn
to logger and also returns null.
"""
// at this point value type is a class
if (string.isEmpty())
return ... | java | @Override
public <T> T asObject(String string, Class<T> valueType) {
// at this point value type is a class
if (string.isEmpty())
return null;
// uses this library Classes#forName instead of Java standard Class#forName
// first uses current thread context loader whereas the second uses library loade... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"asObject",
"(",
"String",
"string",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"{",
"// at this point value type is a class\r",
"if",
"(",
"string",
".",
"isEmpty",
"(",
")",
")",
"return",
"null",
";",
... | Return the Java class instance for given canonical name. If given string is empty returns null. If class not found warn
to logger and also returns null. | [
"Return",
"the",
"Java",
"class",
"instance",
"for",
"given",
"canonical",
"name",
".",
"If",
"given",
"string",
"is",
"empty",
"returns",
"null",
".",
"If",
"class",
"not",
"found",
"warn",
"to",
"logger",
"and",
"also",
"returns",
"null",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/converter/ClassConverter.java#L27-L43 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java | WordReplacer.replaceWordsIgnoreCase | public static void replaceWordsIgnoreCase(StringBuilder input, String[] words, String[] replaces) {
"""
See {@link #replaceWords(String, String[], String[])}
@param input the text where the replacements take place
@param words the words to look for and replace
@param replaces the new words to use
"""
... | java | public static void replaceWordsIgnoreCase(StringBuilder input, String[] words, String[] replaces) {
replaceWords(input, words, replaces, true);
} | [
"public",
"static",
"void",
"replaceWordsIgnoreCase",
"(",
"StringBuilder",
"input",
",",
"String",
"[",
"]",
"words",
",",
"String",
"[",
"]",
"replaces",
")",
"{",
"replaceWords",
"(",
"input",
",",
"words",
",",
"replaces",
",",
"true",
")",
";",
"}"
] | See {@link #replaceWords(String, String[], String[])}
@param input the text where the replacements take place
@param words the words to look for and replace
@param replaces the new words to use | [
"See",
"{"
] | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java#L50-L52 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDateTime.java | LocalDateTime.toDate | @SuppressWarnings("deprecation")
public Date toDate() {
"""
Get the date time as a <code>java.util.Date</code>.
<p>
The <code>Date</code> object created has exactly the same fields as this
date-time, except when the time would be invalid due to a daylight savings
gap. In that case, the time will be set to ... | java | @SuppressWarnings("deprecation")
public Date toDate() {
int dom = getDayOfMonth();
Date date = new Date(getYear() - 1900, getMonthOfYear() - 1, dom,
getHourOfDay(), getMinuteOfHour(), getSecondOfMinute());
date.setTime(date.getTime() + getMillisOfSecond());
re... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"Date",
"toDate",
"(",
")",
"{",
"int",
"dom",
"=",
"getDayOfMonth",
"(",
")",
";",
"Date",
"date",
"=",
"new",
"Date",
"(",
"getYear",
"(",
")",
"-",
"1900",
",",
"getMonthOfYear",
"(",
"... | Get the date time as a <code>java.util.Date</code>.
<p>
The <code>Date</code> object created has exactly the same fields as this
date-time, except when the time would be invalid due to a daylight savings
gap. In that case, the time will be set to the earliest valid time after the gap.
<p>
In the case of a daylight savi... | [
"Get",
"the",
"date",
"time",
"as",
"a",
"<code",
">",
"java",
".",
"util",
".",
"Date<",
"/",
"code",
">",
".",
"<p",
">",
"The",
"<code",
">",
"Date<",
"/",
"code",
">",
"object",
"created",
"has",
"exactly",
"the",
"same",
"fields",
"as",
"this"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDateTime.java#L793-L800 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.loadReuse | public static ReuseResult loadReuse(String fileName, Bitmap dest) throws ImageLoadException {
"""
Loading bitmap with using reuse bitmap with the different size of source image.
If it is unable to load with reuse method tries to load without it.
Reuse works only for Android 4.4+
@param fileName Image file nam... | java | public static ReuseResult loadReuse(String fileName, Bitmap dest) throws ImageLoadException {
return loadBitmapReuse(new FileSource(fileName), dest);
} | [
"public",
"static",
"ReuseResult",
"loadReuse",
"(",
"String",
"fileName",
",",
"Bitmap",
"dest",
")",
"throws",
"ImageLoadException",
"{",
"return",
"loadBitmapReuse",
"(",
"new",
"FileSource",
"(",
"fileName",
")",
",",
"dest",
")",
";",
"}"
] | Loading bitmap with using reuse bitmap with the different size of source image.
If it is unable to load with reuse method tries to load without it.
Reuse works only for Android 4.4+
@param fileName Image file name
@param dest reuse bitmap
@return result of loading
@throws ImageLoadException if it is unable to load... | [
"Loading",
"bitmap",
"with",
"using",
"reuse",
"bitmap",
"with",
"the",
"different",
"size",
"of",
"source",
"image",
".",
"If",
"it",
"is",
"unable",
"to",
"load",
"with",
"reuse",
"method",
"tries",
"to",
"load",
"without",
"it",
".",
"Reuse",
"works",
... | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L202-L204 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/agent/ZooKeeperAgentModel.java | ZooKeeperAgentModel.setTaskStatus | @Override
public void setTaskStatus(final JobId jobId, final TaskStatus status)
throws InterruptedException {
"""
Set the {@link TaskStatus} for the job identified by {@code jobId}.
"""
log.debug("setting task status: {}", status);
taskStatuses.put(jobId.toString(), status.toJsonBytes());
i... | java | @Override
public void setTaskStatus(final JobId jobId, final TaskStatus status)
throws InterruptedException {
log.debug("setting task status: {}", status);
taskStatuses.put(jobId.toString(), status.toJsonBytes());
if (historyWriter != null) {
try {
historyWriter.saveHistoryItem(status)... | [
"@",
"Override",
"public",
"void",
"setTaskStatus",
"(",
"final",
"JobId",
"jobId",
",",
"final",
"TaskStatus",
"status",
")",
"throws",
"InterruptedException",
"{",
"log",
".",
"debug",
"(",
"\"setting task status: {}\"",
",",
"status",
")",
";",
"taskStatuses",
... | Set the {@link TaskStatus} for the job identified by {@code jobId}. | [
"Set",
"the",
"{"
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/agent/ZooKeeperAgentModel.java#L155-L175 |
twilio/twilio-java | src/main/java/com/twilio/rest/wireless/v1/sim/DataSessionReader.java | DataSessionReader.previousPage | @Override
public Page<DataSession> previousPage(final Page<DataSession> page,
final TwilioRestClient client) {
"""
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previ... | java | @Override
public Page<DataSession> previousPage(final Page<DataSession> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.WIRELESS.toString(),
... | [
"@",
"Override",
"public",
"Page",
"<",
"DataSession",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"DataSession",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/wireless/v1/sim/DataSessionReader.java#L136-L147 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java | AbstractMoskitoAspect.getProducerId | private String getProducerId(final ProceedingJoinPoint pjp, final String aPId, final boolean withMethod) {
"""
Fetch producer id - for further usage.
@param pjp
{@link ProceedingJoinPoint}
@param aPId
provided producer id
@param withMethod
{@code true} in case if methodName should be used in produce id, {@... | java | private String getProducerId(final ProceedingJoinPoint pjp, final String aPId, final boolean withMethod) {
if (!StringUtils.isEmpty(aPId))
return aPId;
String res = pjp.getSignature().getDeclaringTypeName();
try {
res = MoskitoUtils.producerName(res);
} catch (final RuntimeException e) {
if (logger.is... | [
"private",
"String",
"getProducerId",
"(",
"final",
"ProceedingJoinPoint",
"pjp",
",",
"final",
"String",
"aPId",
",",
"final",
"boolean",
"withMethod",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"aPId",
")",
")",
"return",
"aPId",
";",
... | Fetch producer id - for further usage.
@param pjp
{@link ProceedingJoinPoint}
@param aPId
provided producer id
@param withMethod
{@code true} in case if methodName should be used in produce id, {@code false} otheriwse
@return producer identifier | [
"Fetch",
"producer",
"id",
"-",
"for",
"further",
"usage",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java#L188-L203 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/UsersApi.java | UsersApi.getProfileImage | public byte[] getProfileImage(String accountId, String userId) throws ApiException {
"""
Retrieves the user profile image for the specified user.
Retrieves the user profile picture for the specified user. The image is returned in the same format as uploaded. The userId parameter specified in the endpoint must ma... | java | public byte[] getProfileImage(String accountId, String userId) throws ApiException {
return getProfileImage(accountId, userId, null);
} | [
"public",
"byte",
"[",
"]",
"getProfileImage",
"(",
"String",
"accountId",
",",
"String",
"userId",
")",
"throws",
"ApiException",
"{",
"return",
"getProfileImage",
"(",
"accountId",
",",
"userId",
",",
"null",
")",
";",
"}"
] | Retrieves the user profile image for the specified user.
Retrieves the user profile picture for the specified user. The image is returned in the same format as uploaded. The userId parameter specified in the endpoint must match the authenticated user's user ID and the user must be a member of the specified account... | [
"Retrieves",
"the",
"user",
"profile",
"image",
"for",
"the",
"specified",
"user",
".",
"Retrieves",
"the",
"user",
"profile",
"picture",
"for",
"the",
"specified",
"user",
".",
"The",
"image",
"is",
"returned",
"in",
"the",
"same",
"format",
"as",
"uploaded... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/UsersApi.java#L751-L753 |
woo-j/OkapiBarcode | src/main/java/uk/org/okapibarcode/OkapiBarcode.java | OkapiBarcode.main | public static void main(String[] args) {
"""
Starts the Okapi Barcode UI.
@param args the command line arguments
"""
Settings settings = new Settings();
new JCommander(settings, args);
if (!settings.isGuiSupressed()) {
OkapiUI okapiUi = new OkapiUI();
o... | java | public static void main(String[] args) {
Settings settings = new Settings();
new JCommander(settings, args);
if (!settings.isGuiSupressed()) {
OkapiUI okapiUi = new OkapiUI();
okapiUi.setVisible(true);
} else {
int returnValue;
... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"Settings",
"settings",
"=",
"new",
"Settings",
"(",
")",
";",
"new",
"JCommander",
"(",
"settings",
",",
"args",
")",
";",
"if",
"(",
"!",
"settings",
".",
"isGuiSupressed"... | Starts the Okapi Barcode UI.
@param args the command line arguments | [
"Starts",
"the",
"Okapi",
"Barcode",
"UI",
"."
] | train | https://github.com/woo-j/OkapiBarcode/blob/d1cb4f4ab64557cd3db64d9a473528a52ce58081/src/main/java/uk/org/okapibarcode/OkapiBarcode.java#L41-L57 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/CLINK.java | CLINK.clinkstep3 | private void clinkstep3(DBIDRef id, DBIDArrayIter i, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
"""
Third step: Determine the values for P and L
@param id the id of the object to be inserted into the pointer
representation
@param i Iterator
@param n Stopping... | java | private void clinkstep3(DBIDRef id, DBIDArrayIter i, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
DBIDVar p_i = DBIDUtil.newVar();
// for i = 1..n
for(i.seek(0); i.getOffset() < n; i.advance()) {
double l_i = lambda.doubleValue(i);
double m_i = m.... | [
"private",
"void",
"clinkstep3",
"(",
"DBIDRef",
"id",
",",
"DBIDArrayIter",
"i",
",",
"int",
"n",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
",",
"WritableDoubleDataStore",
"m",
")",
"{",
"DBIDVar",
"p_i",
"=",
"DBIDUtil",
"."... | Third step: Determine the values for P and L
@param id the id of the object to be inserted into the pointer
representation
@param i Iterator
@param n Stopping position
@param pi Pi data store
@param lambda Lambda data store
@param m Distance data store | [
"Third",
"step",
":",
"Determine",
"the",
"values",
"for",
"P",
"and",
"L"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/CLINK.java#L107-L127 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/FileUtils.java | FileUtils.createFile | public static void createFile(final File dest, final InputStream sourceInput) throws IOException {
"""
Read the content from an inputStream and write out to the other file
@param dest
@param sourceInput
@throws IOException
"""
if (sourceInput == null || dest == null)
return;
F... | java | public static void createFile(final File dest, final InputStream sourceInput) throws IOException {
if (sourceInput == null || dest == null)
return;
FileOutputStream fos = null;
try {
if (!dest.getParentFile().exists()) {
if (!dest.getParentFile().mkdirs()... | [
"public",
"static",
"void",
"createFile",
"(",
"final",
"File",
"dest",
",",
"final",
"InputStream",
"sourceInput",
")",
"throws",
"IOException",
"{",
"if",
"(",
"sourceInput",
"==",
"null",
"||",
"dest",
"==",
"null",
")",
"return",
";",
"FileOutputStream",
... | Read the content from an inputStream and write out to the other file
@param dest
@param sourceInput
@throws IOException | [
"Read",
"the",
"content",
"from",
"an",
"inputStream",
"and",
"write",
"out",
"to",
"the",
"other",
"file"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/FileUtils.java#L97-L121 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFile.java | BoxFile.uploadVersion | @Deprecated
public void uploadVersion(InputStream fileContent, String fileContentSHA1, Date modified) {
"""
Uploads a new version of this file, replacing the current version. Note that only users with premium accounts
will be able to view and recover previous versions of the file.
@param fileContent a ... | java | @Deprecated
public void uploadVersion(InputStream fileContent, String fileContentSHA1, Date modified) {
this.uploadVersion(fileContent, fileContentSHA1, modified, 0, null);
} | [
"@",
"Deprecated",
"public",
"void",
"uploadVersion",
"(",
"InputStream",
"fileContent",
",",
"String",
"fileContentSHA1",
",",
"Date",
"modified",
")",
"{",
"this",
".",
"uploadVersion",
"(",
"fileContent",
",",
"fileContentSHA1",
",",
"modified",
",",
"0",
","... | Uploads a new version of this file, replacing the current version. Note that only users with premium accounts
will be able to view and recover previous versions of the file.
@param fileContent a stream containing the new file contents.
@param fileContentSHA1 a string containing the SHA1 hash of the new file conten... | [
"Uploads",
"a",
"new",
"version",
"of",
"this",
"file",
"replacing",
"the",
"current",
"version",
".",
"Note",
"that",
"only",
"users",
"with",
"premium",
"accounts",
"will",
"be",
"able",
"to",
"view",
"and",
"recover",
"previous",
"versions",
"of",
"the",
... | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L751-L754 |
Whiley/WhileyCompiler | src/main/java/wyil/util/AbstractTypedVisitor.java | AbstractTypedVisitor.asType | public <T extends Type> T asType(Type type, Class<T> kind) {
"""
Unwrap a given type to reveal its underlying kind. For example, the type
<code>int</code> can be unwrapped only to <code>int</code>. A more complex
example:
<pre>
type nat is (int x) where x >= 0
</pre>
The type <code>nat</code> can be unwr... | java | public <T extends Type> T asType(Type type, Class<T> kind) {
if (kind.isInstance(type)) {
return (T) type;
} else if (type instanceof Type.Nominal) {
Type.Nominal t = (Type.Nominal) type;
Decl.Type decl = t.getLink().getTarget();
return asType(decl.getType(), kind);
} else {
throw new IllegalArgume... | [
"public",
"<",
"T",
"extends",
"Type",
">",
"T",
"asType",
"(",
"Type",
"type",
",",
"Class",
"<",
"T",
">",
"kind",
")",
"{",
"if",
"(",
"kind",
".",
"isInstance",
"(",
"type",
")",
")",
"{",
"return",
"(",
"T",
")",
"type",
";",
"}",
"else",
... | Unwrap a given type to reveal its underlying kind. For example, the type
<code>int</code> can be unwrapped only to <code>int</code>. A more complex
example:
<pre>
type nat is (int x) where x >= 0
</pre>
The type <code>nat</code> can be unwrapped to an <code>int</code>. In
general, the unwrapping process expands all n... | [
"Unwrap",
"a",
"given",
"type",
"to",
"reveal",
"its",
"underlying",
"kind",
".",
"For",
"example",
"the",
"type",
"<code",
">",
"int<",
"/",
"code",
">",
"can",
"be",
"unwrapped",
"only",
"to",
"<code",
">",
"int<",
"/",
"code",
">",
".",
"A",
"more... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/util/AbstractTypedVisitor.java#L1326-L1336 |
mozilla/rhino | src/org/mozilla/javascript/IRFactory.java | IRFactory.addSwitchCase | private void addSwitchCase(Node switchBlock, Node caseExpression,
Node statements) {
"""
If caseExpression argument is null it indicates a default label.
"""
if (switchBlock.getType() != Token.BLOCK) throw Kit.codeBug();
Jump switchNode = (Jump)switchBlock.getFirs... | java | private void addSwitchCase(Node switchBlock, Node caseExpression,
Node statements)
{
if (switchBlock.getType() != Token.BLOCK) throw Kit.codeBug();
Jump switchNode = (Jump)switchBlock.getFirstChild();
if (switchNode.getType() != Token.SWITCH) throw Kit.codeBug(... | [
"private",
"void",
"addSwitchCase",
"(",
"Node",
"switchBlock",
",",
"Node",
"caseExpression",
",",
"Node",
"statements",
")",
"{",
"if",
"(",
"switchBlock",
".",
"getType",
"(",
")",
"!=",
"Token",
".",
"BLOCK",
")",
"throw",
"Kit",
".",
"codeBug",
"(",
... | If caseExpression argument is null it indicates a default label. | [
"If",
"caseExpression",
"argument",
"is",
"null",
"it",
"indicates",
"a",
"default",
"label",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/IRFactory.java#L1395-L1412 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/topology/ClusterTopologyRefresh.java | ClusterTopologyRefresh.getViewedBy | public RedisURI getViewedBy(Map<RedisURI, Partitions> map, Partitions partitions) {
"""
Resolve a {@link RedisURI} from a map of cluster views by {@link Partitions} as key
@param map the map
@param partitions the key
@return a {@link RedisURI} or null
"""
for (Map.Entry<RedisURI, Partitions> entr... | java | public RedisURI getViewedBy(Map<RedisURI, Partitions> map, Partitions partitions) {
for (Map.Entry<RedisURI, Partitions> entry : map.entrySet()) {
if (entry.getValue() == partitions) {
return entry.getKey();
}
}
return null;
} | [
"public",
"RedisURI",
"getViewedBy",
"(",
"Map",
"<",
"RedisURI",
",",
"Partitions",
">",
"map",
",",
"Partitions",
"partitions",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"RedisURI",
",",
"Partitions",
">",
"entry",
":",
"map",
".",
"entrySet",
"(... | Resolve a {@link RedisURI} from a map of cluster views by {@link Partitions} as key
@param map the map
@param partitions the key
@return a {@link RedisURI} or null | [
"Resolve",
"a",
"{",
"@link",
"RedisURI",
"}",
"from",
"a",
"map",
"of",
"cluster",
"views",
"by",
"{",
"@link",
"Partitions",
"}",
"as",
"key"
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/topology/ClusterTopologyRefresh.java#L276-L285 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/exchange/KnowledgeExchangeHandler.java | KnowledgeExchangeHandler.getString | protected String getString(Exchange exchange, Message message, String name) {
"""
Gets a String context property.
@param exchange the exchange
@param message the message
@param name the name
@return the property
"""
Object value = getObject(exchange, message, name);
if (value instanceof S... | java | protected String getString(Exchange exchange, Message message, String name) {
Object value = getObject(exchange, message, name);
if (value instanceof String) {
return (String)value;
} else if (value != null) {
return String.valueOf(value);
}
return null;
... | [
"protected",
"String",
"getString",
"(",
"Exchange",
"exchange",
",",
"Message",
"message",
",",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"getObject",
"(",
"exchange",
",",
"message",
",",
"name",
")",
";",
"if",
"(",
"value",
"instanceof",
"Str... | Gets a String context property.
@param exchange the exchange
@param message the message
@param name the name
@return the property | [
"Gets",
"a",
"String",
"context",
"property",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/exchange/KnowledgeExchangeHandler.java#L238-L246 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SFTrustManager.java | SFTrustManager.isCached | private boolean isCached(List<SFPair<Certificate, Certificate>> pairIssuerSubjectList) {
"""
Is OCSP Response cached?
@param pairIssuerSubjectList a list of pair of issuer and subject certificates
@return true if all of OCSP response are cached else false
"""
long currentTimeSecond = new Date().getTime... | java | private boolean isCached(List<SFPair<Certificate, Certificate>> pairIssuerSubjectList)
{
long currentTimeSecond = new Date().getTime() / 1000L;
boolean isCached = true;
try
{
for (SFPair<Certificate, Certificate> pairIssuerSubject : pairIssuerSubjectList)
{
OCSPReq req = createRequ... | [
"private",
"boolean",
"isCached",
"(",
"List",
"<",
"SFPair",
"<",
"Certificate",
",",
"Certificate",
">",
">",
"pairIssuerSubjectList",
")",
"{",
"long",
"currentTimeSecond",
"=",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
"/",
"1000L",
";",
"bool... | Is OCSP Response cached?
@param pairIssuerSubjectList a list of pair of issuer and subject certificates
@return true if all of OCSP response are cached else false | [
"Is",
"OCSP",
"Response",
"cached?"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SFTrustManager.java#L844-L894 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.writeStreamToStream | public static void writeStreamToStream(InputStream input, OutputStream output)
throws IOException {
"""
Send all bytes from the input stream to the output stream.
@param input
The input bytes.
@param output
Where the bytes should be written.
"""
byte[] buffer = new byte[4096];
while (true) {... | java | public static void writeStreamToStream(InputStream input, OutputStream output)
throws IOException {
byte[] buffer = new byte[4096];
while (true) {
int len = input.read(buffer);
if (len == -1) {
break;
}
output.write(buffer, 0, len);
}
} | [
"public",
"static",
"void",
"writeStreamToStream",
"(",
"InputStream",
"input",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"4096",
"]",
";",
"while",
"(",
"true",
")",
"{",
"int",
... | Send all bytes from the input stream to the output stream.
@param input
The input bytes.
@param output
Where the bytes should be written. | [
"Send",
"all",
"bytes",
"from",
"the",
"input",
"stream",
"to",
"the",
"output",
"stream",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L930-L940 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/MessageEventHandler.java | MessageEventHandler.notifyToHandlers | protected void notifyToHandlers(Object message, ISFSObject params) {
"""
Propagate event to handlers
@param message message data
@param params addition data to send
"""
if(params == null) params = new SFSObject();
for(ServerHandlerClass handler : handlers) {
notifyToHandler(hand... | java | protected void notifyToHandlers(Object message, ISFSObject params) {
if(params == null) params = new SFSObject();
for(ServerHandlerClass handler : handlers) {
notifyToHandler(handler, message, params);
}
} | [
"protected",
"void",
"notifyToHandlers",
"(",
"Object",
"message",
",",
"ISFSObject",
"params",
")",
"{",
"if",
"(",
"params",
"==",
"null",
")",
"params",
"=",
"new",
"SFSObject",
"(",
")",
";",
"for",
"(",
"ServerHandlerClass",
"handler",
":",
"handlers",
... | Propagate event to handlers
@param message message data
@param params addition data to send | [
"Propagate",
"event",
"to",
"handlers"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/MessageEventHandler.java#L34-L39 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextCollection | public <T extends Collection<Val>> T nextCollection(@NonNull Supplier<T> supplier, String expectedName) throws IOException {
"""
Reads the next array as a collection with an expected name and returns a list of its values
@param <T> the collection type
@param expectedName The name that the next collect... | java | public <T extends Collection<Val>> T nextCollection(@NonNull Supplier<T> supplier, String expectedName) throws IOException {
beginArray(expectedName);
T collection = supplier.get();
while (peek() != JsonTokenType.END_ARRAY) {
collection.add(nextValue());
}
endArray();
return... | [
"public",
"<",
"T",
"extends",
"Collection",
"<",
"Val",
">",
">",
"T",
"nextCollection",
"(",
"@",
"NonNull",
"Supplier",
"<",
"T",
">",
"supplier",
",",
"String",
"expectedName",
")",
"throws",
"IOException",
"{",
"beginArray",
"(",
"expectedName",
")",
... | Reads the next array as a collection with an expected name and returns a list of its values
@param <T> the collection type
@param expectedName The name that the next collection should have
@return the collection containing the items in the next array
@throws IOException Something went wrong reading | [
"Reads",
"the",
"next",
"array",
"as",
"a",
"collection",
"with",
"an",
"expected",
"name",
"and",
"returns",
"a",
"list",
"of",
"its",
"values"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L421-L429 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java | GraphHelper.getSingleValuedProperty | public static <T> T getSingleValuedProperty(AtlasElement element, String propertyName, Class<T> clazz) {
"""
Gets the value of a property that is stored in the graph as a single property value. If
a multi-property such as {@link Constants#TRAIT_NAMES_PROPERTY_KEY} or {@link Constants#SUPER_TYPES_PROPERTY_KEY}
i... | java | public static <T> T getSingleValuedProperty(AtlasElement element, String propertyName, Class<T> clazz) {
String actualPropertyName = GraphHelper.encodePropertyKey(propertyName);
if (LOG.isDebugEnabled()) {
LOG.debug("Reading property {} from {}", actualPropertyName, string(element));
... | [
"public",
"static",
"<",
"T",
">",
"T",
"getSingleValuedProperty",
"(",
"AtlasElement",
"element",
",",
"String",
"propertyName",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"String",
"actualPropertyName",
"=",
"GraphHelper",
".",
"encodePropertyKey",
"(",
... | Gets the value of a property that is stored in the graph as a single property value. If
a multi-property such as {@link Constants#TRAIT_NAMES_PROPERTY_KEY} or {@link Constants#SUPER_TYPES_PROPERTY_KEY}
is used, an exception will be thrown.
@param element
@param propertyName
@param clazz
@return | [
"Gets",
"the",
"value",
"of",
"a",
"property",
"that",
"is",
"stored",
"in",
"the",
"graph",
"as",
"a",
"single",
"property",
"value",
".",
"If",
"a",
"multi",
"-",
"property",
"such",
"as",
"{",
"@link",
"Constants#TRAIT_NAMES_PROPERTY_KEY",
"}",
"or",
"{... | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java#L490-L498 |
voldemort/voldemort | src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorPool.java | ClientRequestExecutorPool.checkin | public void checkin(SocketDestination destination, ClientRequestExecutor clientRequestExecutor) {
"""
Check the socket back into the pool.
@param destination The socket destination of the socket
@param clientRequestExecutor The request executor wrapper
"""
try {
queuedPool.checkin(desti... | java | public void checkin(SocketDestination destination, ClientRequestExecutor clientRequestExecutor) {
try {
queuedPool.checkin(destination, clientRequestExecutor);
} catch(Exception e) {
throw new VoldemortException("Failure while checking in socket for " + destination
... | [
"public",
"void",
"checkin",
"(",
"SocketDestination",
"destination",
",",
"ClientRequestExecutor",
"clientRequestExecutor",
")",
"{",
"try",
"{",
"queuedPool",
".",
"checkin",
"(",
"destination",
",",
"clientRequestExecutor",
")",
";",
"}",
"catch",
"(",
"Exception... | Check the socket back into the pool.
@param destination The socket destination of the socket
@param clientRequestExecutor The request executor wrapper | [
"Check",
"the",
"socket",
"back",
"into",
"the",
"pool",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/socket/clientrequest/ClientRequestExecutorPool.java#L244-L251 |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/Query.java | Query.logical | public static Query logical(LogOp op, Query... expressions) {
"""
<pre>
{ $and : [ expressions ] }
{ $or : [ expressions ] }
</pre>
"""
return logical(op, Arrays.asList(expressions));
} | java | public static Query logical(LogOp op, Query... expressions) {
return logical(op, Arrays.asList(expressions));
} | [
"public",
"static",
"Query",
"logical",
"(",
"LogOp",
"op",
",",
"Query",
"...",
"expressions",
")",
"{",
"return",
"logical",
"(",
"op",
",",
"Arrays",
".",
"asList",
"(",
"expressions",
")",
")",
";",
"}"
] | <pre>
{ $and : [ expressions ] }
{ $or : [ expressions ] }
</pre> | [
"<pre",
">",
"{",
"$and",
":",
"[",
"expressions",
"]",
"}",
"{",
"$or",
":",
"[",
"expressions",
"]",
"}",
"<",
"/",
"pre",
">"
] | train | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/Query.java#L538-L540 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getPattern | public Pattern getPattern(String name, Pattern defaultValue) {
"""
Get the value of the <code>name</code> property as a <code>Pattern</code>.
If no such property is specified, or if the specified value is not a valid
<code>Pattern</code>, then <code>DefaultValue</code> is returned.
Note that the returned value ... | java | public Pattern getPattern(String name, Pattern defaultValue) {
String valString = get(name);
if (null == valString || valString.isEmpty()) {
return defaultValue;
}
try {
return Pattern.compile(valString);
} catch (PatternSyntaxException pse) {
LOG.warn("Regular expression '" + valString + "' for prop... | [
"public",
"Pattern",
"getPattern",
"(",
"String",
"name",
",",
"Pattern",
"defaultValue",
")",
"{",
"String",
"valString",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"null",
"==",
"valString",
"||",
"valString",
".",
"isEmpty",
"(",
")",
")",
"{",
"... | Get the value of the <code>name</code> property as a <code>Pattern</code>.
If no such property is specified, or if the specified value is not a valid
<code>Pattern</code>, then <code>DefaultValue</code> is returned.
Note that the returned value is NOT trimmed by this method.
@param name property name
@param defaultVal... | [
"Get",
"the",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"a",
"<code",
">",
"Pattern<",
"/",
"code",
">",
".",
"If",
"no",
"such",
"property",
"is",
"specified",
"or",
"if",
"the",
"specified",
"value",
"is",
"no... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1804-L1816 |
zeromq/jeromq | src/main/java/org/zeromq/proto/ZPicture.java | ZPicture.sendPicture | @Draft
public boolean sendPicture(Socket socket, String picture, Object... args) {
"""
Queues a 'picture' message to the socket (or actor), so it can be sent.
@param picture The picture is a string that defines the type of each frame.
This makes it easy to send a complex multiframe message in
one call. Th... | java | @Draft
public boolean sendPicture(Socket socket, String picture, Object... args)
{
if (!FORMAT.matcher(picture).matches()) {
throw new ZMQException(picture + " is not in expected format " + FORMAT.pattern(), ZError.EPROTO);
}
ZMsg msg = new ZMsg();
for (int pictureInd... | [
"@",
"Draft",
"public",
"boolean",
"sendPicture",
"(",
"Socket",
"socket",
",",
"String",
"picture",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"FORMAT",
".",
"matcher",
"(",
"picture",
")",
".",
"matches",
"(",
")",
")",
"{",
"throw",
"... | Queues a 'picture' message to the socket (or actor), so it can be sent.
@param picture The picture is a string that defines the type of each frame.
This makes it easy to send a complex multiframe message in
one call. The picture can contain any of these characters,
each corresponding to zero or one arguments:
<table>... | [
"Queues",
"a",
"picture",
"message",
"to",
"the",
"socket",
"(",
"or",
"actor",
")",
"so",
"it",
"can",
"be",
"sent",
"."
] | train | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/proto/ZPicture.java#L279-L339 |
Red5/red5-websocket | src/main/java/org/red5/net/websocket/WebSocketScopeManager.java | WebSocketScopeManager.addListener | public void addListener(IWebSocketDataListener listener, String path) {
"""
Add the listener on scope via its path.
@param listener
IWebSocketDataListener
@param path
"""
log.trace("addListener: {}", listener);
WebSocketScope scope = getScope(path);
if (scope != null) {
... | java | public void addListener(IWebSocketDataListener listener, String path) {
log.trace("addListener: {}", listener);
WebSocketScope scope = getScope(path);
if (scope != null) {
scope.addListener(listener);
} else {
log.info("Scope not found for path: {}", path);
... | [
"public",
"void",
"addListener",
"(",
"IWebSocketDataListener",
"listener",
",",
"String",
"path",
")",
"{",
"log",
".",
"trace",
"(",
"\"addListener: {}\"",
",",
"listener",
")",
";",
"WebSocketScope",
"scope",
"=",
"getScope",
"(",
"path",
")",
";",
"if",
... | Add the listener on scope via its path.
@param listener
IWebSocketDataListener
@param path | [
"Add",
"the",
"listener",
"on",
"scope",
"via",
"its",
"path",
"."
] | train | https://github.com/Red5/red5-websocket/blob/24b53f2f3875624fb01f0a2604f4117583aeab40/src/main/java/org/red5/net/websocket/WebSocketScopeManager.java#L212-L220 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/TraceId.java | TraceId.generateRandomId | public static TraceId generateRandomId(Random random) {
"""
Generates a new random {@code TraceId}.
@param random the random number generator.
@return a new valid {@code TraceId}.
@since 0.5
"""
long idHi;
long idLo;
do {
idHi = random.nextLong();
idLo = random.nextLong();
} wh... | java | public static TraceId generateRandomId(Random random) {
long idHi;
long idLo;
do {
idHi = random.nextLong();
idLo = random.nextLong();
} while (idHi == INVALID_ID && idLo == INVALID_ID);
return new TraceId(idHi, idLo);
} | [
"public",
"static",
"TraceId",
"generateRandomId",
"(",
"Random",
"random",
")",
"{",
"long",
"idHi",
";",
"long",
"idLo",
";",
"do",
"{",
"idHi",
"=",
"random",
".",
"nextLong",
"(",
")",
";",
"idLo",
"=",
"random",
".",
"nextLong",
"(",
")",
";",
"... | Generates a new random {@code TraceId}.
@param random the random number generator.
@return a new valid {@code TraceId}.
@since 0.5 | [
"Generates",
"a",
"new",
"random",
"{",
"@code",
"TraceId",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/TraceId.java#L140-L148 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java | NodeSequence.withNodes | public static NodeSequence withNodes( final Iterator<CachedNode> nodes,
final long nodeCount,
final float score,
final String workspaceName ) {
"""
Create a sequence of nodes that iterates ... | java | public static NodeSequence withNodes( final Iterator<CachedNode> nodes,
final long nodeCount,
final float score,
final String workspaceName ) {
assert nodeCount >= -1;
if (nodes ... | [
"public",
"static",
"NodeSequence",
"withNodes",
"(",
"final",
"Iterator",
"<",
"CachedNode",
">",
"nodes",
",",
"final",
"long",
"nodeCount",
",",
"final",
"float",
"score",
",",
"final",
"String",
"workspaceName",
")",
"{",
"assert",
"nodeCount",
">=",
"-",
... | Create a sequence of nodes that iterates over the supplied nodes. Note that the supplied iterator is accessed lazily as the
resulting sequence's {@link #nextBatch() first batch} is {@link Batch#nextRow() used}.
@param nodes the iterator over the node keys to be returned; if null, an {@link #emptySequence empty instanc... | [
"Create",
"a",
"sequence",
"of",
"nodes",
"that",
"iterates",
"over",
"the",
"supplied",
"nodes",
".",
"Note",
"that",
"the",
"supplied",
"iterator",
"is",
"accessed",
"lazily",
"as",
"the",
"resulting",
"sequence",
"s",
"{",
"@link",
"#nextBatch",
"()",
"fi... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L431-L438 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/calls/LocalCall.java | LocalCall.callAsync | public CompletionStage<Optional<Map<String, CompletionStage<Result<R>>>>> callAsync(
SaltClient client,
Target<?> target,
AuthMethod auth,
EventStream events,
CompletionStage<GenericError> cancel,
Batch batch) {
"""
Calls this salt call via th... | java | public CompletionStage<Optional<Map<String, CompletionStage<Result<R>>>>> callAsync(
SaltClient client,
Target<?> target,
AuthMethod auth,
EventStream events,
CompletionStage<GenericError> cancel,
Batch batch) {
return callAsync(client, tar... | [
"public",
"CompletionStage",
"<",
"Optional",
"<",
"Map",
"<",
"String",
",",
"CompletionStage",
"<",
"Result",
"<",
"R",
">",
">",
">",
">",
">",
"callAsync",
"(",
"SaltClient",
"client",
",",
"Target",
"<",
"?",
">",
"target",
",",
"AuthMethod",
"auth"... | Calls this salt call via the async client and returns the results
as they come in via the event stream.
@param client SaltClient instance
@param target the target for the function
@param events the event stream to use
@param cancel future to cancel the action
@param auth authentication credentials to use
@param batch ... | [
"Calls",
"this",
"salt",
"call",
"via",
"the",
"async",
"client",
"and",
"returns",
"the",
"results",
"as",
"they",
"come",
"in",
"via",
"the",
"event",
"stream",
"."
] | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/calls/LocalCall.java#L193-L201 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/DiscoveryResources.java | DiscoveryResources.searchRecords | @POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/metrics/search")
@Description("Discover metric schema records. If type is specified, then records of that particular type are returned.")
public MetricDiscoveryResultDto searchRecords(@Context HttpServletRequest req,
MetricDiscoveryQueryDto met... | java | @POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/metrics/search")
@Description("Discover metric schema records. If type is specified, then records of that particular type are returned.")
public MetricDiscoveryResultDto searchRecords(@Context HttpServletRequest req,
MetricDiscoveryQueryDto met... | [
"@",
"POST",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/metrics/search\"",
")",
"@",
"Description",
"(",
"\"Discover metric schema records. If type is specified, then records of that particular type are returned.\"",
")",
"public",
... | Discover metric schema records. If type is specified, then records of that particular type are returned.
@param req The HTTP request.
@param metricDiscoveryQueryDto This contains metric query parameters along with scanner starting schema record
@return The filtered set of schema records or unique val... | [
"Discover",
"metric",
"schema",
"records",
".",
"If",
"type",
"is",
"specified",
"then",
"records",
"of",
"that",
"particular",
"type",
"are",
"returned",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/DiscoveryResources.java#L228-L261 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.getRandomFileStats | public List<FileStatusExtended> getRandomFileStats(double percent) {
"""
Retrieves a list of random files with some information.
@param percent
the percent of files to return
@return the list of files
"""
readLock();
try {
List<FileStatusExtended> stats = new LinkedList<FileStatusExtended>()... | java | public List<FileStatusExtended> getRandomFileStats(double percent) {
readLock();
try {
List<FileStatusExtended> stats = new LinkedList<FileStatusExtended>();
for (INodeFile file : getRandomFiles(percent)) {
try {
String path = file.getFullPathName();
FileStatus stat = cre... | [
"public",
"List",
"<",
"FileStatusExtended",
">",
"getRandomFileStats",
"(",
"double",
"percent",
")",
"{",
"readLock",
"(",
")",
";",
"try",
"{",
"List",
"<",
"FileStatusExtended",
">",
"stats",
"=",
"new",
"LinkedList",
"<",
"FileStatusExtended",
">",
"(",
... | Retrieves a list of random files with some information.
@param percent
the percent of files to return
@return the list of files | [
"Retrieves",
"a",
"list",
"of",
"random",
"files",
"with",
"some",
"information",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1622-L1644 |
structr/structr | structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java | HtmlServlet.isVisibleForSite | private boolean isVisibleForSite(final HttpServletRequest request, final Page page) {
"""
Check if the given page is visible for the requested site defined by
a hostname and a port.
@param request
@param page
@return
"""
final Site site = page.getSite();
if (site == null) {
return true;
}
f... | java | private boolean isVisibleForSite(final HttpServletRequest request, final Page page) {
final Site site = page.getSite();
if (site == null) {
return true;
}
final String serverName = request.getServerName();
final int serverPort = request.getServerPort();
if (StringUtils.isNotBlank(serverName) && !s... | [
"private",
"boolean",
"isVisibleForSite",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"Page",
"page",
")",
"{",
"final",
"Site",
"site",
"=",
"page",
".",
"getSite",
"(",
")",
";",
"if",
"(",
"site",
"==",
"null",
")",
"{",
"return",
"tr... | Check if the given page is visible for the requested site defined by
a hostname and a port.
@param request
@param page
@return | [
"Check",
"if",
"the",
"given",
"page",
"is",
"visible",
"for",
"the",
"requested",
"site",
"defined",
"by",
"a",
"hostname",
"and",
"a",
"port",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1617-L1640 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/RepresentationModel.java | RepresentationModel.getRequiredLink | public Link getRequiredLink(String relation) {
"""
Returns the link with the given relation.
@param relation must not be {@literal null} or empty.
@return the link with the given relation.
@throws IllegalArgumentException in case no link with the given relation can be found.
"""
return getLink(relation... | java | public Link getRequiredLink(String relation) {
return getLink(relation) //
.orElseThrow(() -> new IllegalArgumentException(String.format("No link with rel %s found!", relation)));
} | [
"public",
"Link",
"getRequiredLink",
"(",
"String",
"relation",
")",
"{",
"return",
"getLink",
"(",
"relation",
")",
"//",
".",
"orElseThrow",
"(",
"(",
")",
"->",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"No link with rel %s found... | Returns the link with the given relation.
@param relation must not be {@literal null} or empty.
@return the link with the given relation.
@throws IllegalArgumentException in case no link with the given relation can be found. | [
"Returns",
"the",
"link",
"with",
"the",
"given",
"relation",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/RepresentationModel.java#L179-L183 |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/PasswordMaker.java | PasswordMaker.hashTheData | private SecureUTF8String hashTheData(SecureUTF8String masterPassword, SecureUTF8String data, Account account)
throws Exception {
"""
Intermediate step of generating a password. Performs constant hashing until
the resulting hash is long enough.
@param masterPassword You should know by now.
@param d... | java | private SecureUTF8String hashTheData(SecureUTF8String masterPassword, SecureUTF8String data, Account account)
throws Exception {
final SecureUTF8String output = new SecureUTF8String();
final SecureUTF8String secureIteration = new SecureUTF8String();
SecureUTF8String intermediateOutpu... | [
"private",
"SecureUTF8String",
"hashTheData",
"(",
"SecureUTF8String",
"masterPassword",
",",
"SecureUTF8String",
"data",
",",
"Account",
"account",
")",
"throws",
"Exception",
"{",
"final",
"SecureUTF8String",
"output",
"=",
"new",
"SecureUTF8String",
"(",
")",
";",
... | Intermediate step of generating a password. Performs constant hashing until
the resulting hash is long enough.
@param masterPassword You should know by now.
@param data Not much has changed.
@param account A donut?
@return A suitable hash.
@throws Exception if we ran out of donuts. | [
"Intermediate",
"step",
"of",
"generating",
"a",
"password",
".",
"Performs",
"constant",
"hashing",
"until",
"the",
"resulting",
"hash",
"is",
"long",
"enough",
"."
] | train | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/PasswordMaker.java#L410-L447 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.buildIndexAsync | public Future<?> buildIndexAsync() {
"""
Builds the index using the data in the underlying CF, non blocking
@return A future object which the caller can block on (optional)
"""
// if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done
boolea... | java | public Future<?> buildIndexAsync()
{
// if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done
boolean allAreBuilt = true;
for (ColumnDefinition cdef : columnDefs)
{
if (!SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName... | [
"public",
"Future",
"<",
"?",
">",
"buildIndexAsync",
"(",
")",
"{",
"// if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done",
"boolean",
"allAreBuilt",
"=",
"true",
";",
"for",
"(",
"ColumnDefinition",
"cdef",
":",
"columnD... | Builds the index using the data in the underlying CF, non blocking
@return A future object which the caller can block on (optional) | [
"Builds",
"the",
"index",
"using",
"the",
"data",
"in",
"the",
"underlying",
"CF",
"non",
"blocking"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L227-L257 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/Geometry.java | Geometry.cloneRecursively | private Geometry cloneRecursively(Geometry geometry) {
"""
Recursive cloning of geometries.
@param geometry
The geometry to clone.
@return The cloned geometry.
"""
Geometry clone = new Geometry(geometry.geometryType, geometry.srid, geometry.precision);
if (geometry.getGeometries() != null) {
Geomet... | java | private Geometry cloneRecursively(Geometry geometry) {
Geometry clone = new Geometry(geometry.geometryType, geometry.srid, geometry.precision);
if (geometry.getGeometries() != null) {
Geometry[] geometryClones = new Geometry[geometry.getGeometries().length];
for (int i = 0; i < geometry.getGeometries().length... | [
"private",
"Geometry",
"cloneRecursively",
"(",
"Geometry",
"geometry",
")",
"{",
"Geometry",
"clone",
"=",
"new",
"Geometry",
"(",
"geometry",
".",
"geometryType",
",",
"geometry",
".",
"srid",
",",
"geometry",
".",
"precision",
")",
";",
"if",
"(",
"geomet... | Recursive cloning of geometries.
@param geometry
The geometry to clone.
@return The cloned geometry. | [
"Recursive",
"cloning",
"of",
"geometries",
"."
] | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/Geometry.java#L241-L258 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/managers/GuildController.java | GuildController.createEmote | @CheckReturnValue
public AuditableRestAction<Emote> createEmote(String name, Icon icon, Role... roles) {
"""
Creates a new {@link net.dv8tion.jda.core.entities.Emote Emote} in this Guild.
<br>If one or more Roles are specified the new Emote will only be available to Members with any of the specified Roles (se... | java | @CheckReturnValue
public AuditableRestAction<Emote> createEmote(String name, Icon icon, Role... roles)
{
checkPermission(Permission.MANAGE_EMOTES);
Checks.notBlank(name, "Emote name");
Checks.notNull(icon, "Emote icon");
Checks.notNull(roles, "Roles");
JSONObject body = ... | [
"@",
"CheckReturnValue",
"public",
"AuditableRestAction",
"<",
"Emote",
">",
"createEmote",
"(",
"String",
"name",
",",
"Icon",
"icon",
",",
"Role",
"...",
"roles",
")",
"{",
"checkPermission",
"(",
"Permission",
".",
"MANAGE_EMOTES",
")",
";",
"Checks",
".",
... | Creates a new {@link net.dv8tion.jda.core.entities.Emote Emote} in this Guild.
<br>If one or more Roles are specified the new Emote will only be available to Members with any of the specified Roles (see {@link Member#canInteract(Emote)})
<br>For this to be successful, the logged in account has to have the {@link net.dv... | [
"Creates",
"a",
"new",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"entities",
".",
"Emote",
"Emote",
"}",
"in",
"this",
"Guild",
".",
"<br",
">",
"If",
"one",
"or",
"more",
"Roles",
"are",
"specified",
"the",
"new",
"Emote",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/managers/GuildController.java#L2004-L2035 |
infinispan/infinispan | core/src/main/java/org/infinispan/encoding/DataConversion.java | DataConversion.getStorageMediaType | private MediaType getStorageMediaType(Configuration configuration, boolean embeddedMode) {
"""
Obtain the configured {@link MediaType} for this instance, or assume sensible defaults.
"""
EncodingConfiguration encodingConfiguration = configuration.encoding();
ContentTypeConfiguration contentTypeConf... | java | private MediaType getStorageMediaType(Configuration configuration, boolean embeddedMode) {
EncodingConfiguration encodingConfiguration = configuration.encoding();
ContentTypeConfiguration contentTypeConfiguration = isKey ? encodingConfiguration.keyDataType() : encodingConfiguration.valueDataType();
//... | [
"private",
"MediaType",
"getStorageMediaType",
"(",
"Configuration",
"configuration",
",",
"boolean",
"embeddedMode",
")",
"{",
"EncodingConfiguration",
"encodingConfiguration",
"=",
"configuration",
".",
"encoding",
"(",
")",
";",
"ContentTypeConfiguration",
"contentTypeCo... | Obtain the configured {@link MediaType} for this instance, or assume sensible defaults. | [
"Obtain",
"the",
"configured",
"{"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/encoding/DataConversion.java#L119-L131 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/operations/deployment/DeploymentUploadUtil.java | DeploymentUploadUtil.addContentToExplodedAndTransformOperation | public static byte[] addContentToExplodedAndTransformOperation(OperationContext context, ModelNode operation, ContentRepository contentRepository) throws OperationFailedException, ExplodedContentException {
"""
Add contents to the deployment and attach a "transformed" slave operation to the operation context.
@... | java | public static byte[] addContentToExplodedAndTransformOperation(OperationContext context, ModelNode operation, ContentRepository contentRepository) throws OperationFailedException, ExplodedContentException {
final Resource deploymentResource = context.readResource(PathAddress.EMPTY_ADDRESS);
ModelNode co... | [
"public",
"static",
"byte",
"[",
"]",
"addContentToExplodedAndTransformOperation",
"(",
"OperationContext",
"context",
",",
"ModelNode",
"operation",
",",
"ContentRepository",
"contentRepository",
")",
"throws",
"OperationFailedException",
",",
"ExplodedContentException",
"{"... | Add contents to the deployment and attach a "transformed" slave operation to the operation context.
@param context the operation context
@param operation the original operation
@param contentRepository the content repository
@return the hash of the uploaded deployment content
@throws IOException
@throws OperationFaile... | [
"Add",
"contents",
"to",
"the",
"deployment",
"and",
"attach",
"a",
"transformed",
"slave",
"operation",
"to",
"the",
"operation",
"context",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/operations/deployment/DeploymentUploadUtil.java#L180-L215 |
amzn/ion-java | src/com/amazon/ion/util/Equivalence.java | Equivalence.convertToMultiSet | private static final Map<Field, Field>
convertToMultiSet(final IonStruct struct, final boolean strict) {
"""
Converts an IonStruct to a multi-set for use in IonStruct equality
checks. This method returns the multi-set as a {@code Map<Field, Field>}.
<p>
A multi-set supports order-independent equality, a... | java | private static final Map<Field, Field>
convertToMultiSet(final IonStruct struct, final boolean strict) {
final Map<Field, Field> structMultiSet =
new HashMap<Field, Field>();
for (final IonValue val : struct) {
final Field item = new Field(val, strict);
Fiel... | [
"private",
"static",
"final",
"Map",
"<",
"Field",
",",
"Field",
">",
"convertToMultiSet",
"(",
"final",
"IonStruct",
"struct",
",",
"final",
"boolean",
"strict",
")",
"{",
"final",
"Map",
"<",
"Field",
",",
"Field",
">",
"structMultiSet",
"=",
"new",
"Has... | Converts an IonStruct to a multi-set for use in IonStruct equality
checks. This method returns the multi-set as a {@code Map<Field, Field>}.
<p>
A multi-set supports order-independent equality, and may have duplicate
elements.
<p>
Take special note that {@link Set} is missing a {@code get()} API,
and cannot contain dup... | [
"Converts",
"an",
"IonStruct",
"to",
"a",
"multi",
"-",
"set",
"for",
"use",
"in",
"IonStruct",
"equality",
"checks",
".",
"This",
"method",
"returns",
"the",
"multi",
"-",
"set",
"as",
"a",
"{"
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/Equivalence.java#L168-L191 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/MessageBuilder.java | MessageBuilder.stripMentions | public MessageBuilder stripMentions(Guild guild, Message.MentionType... types) {
"""
Removes all mentions of the specified types and replaces them with the closest looking textual representation.
<p>Use this over {@link #stripMentions(JDA, Message.MentionType...)} if {@link net.dv8tion.jda.core.entities.User Us... | java | public MessageBuilder stripMentions(Guild guild, Message.MentionType... types)
{
return this.stripMentions(guild.getJDA(), guild, types);
} | [
"public",
"MessageBuilder",
"stripMentions",
"(",
"Guild",
"guild",
",",
"Message",
".",
"MentionType",
"...",
"types",
")",
"{",
"return",
"this",
".",
"stripMentions",
"(",
"guild",
".",
"getJDA",
"(",
")",
",",
"guild",
",",
"types",
")",
";",
"}"
] | Removes all mentions of the specified types and replaces them with the closest looking textual representation.
<p>Use this over {@link #stripMentions(JDA, Message.MentionType...)} if {@link net.dv8tion.jda.core.entities.User User} mentions should
be replaced with their nicknames in a specific guild based.
<br>Uses {@l... | [
"Removes",
"all",
"mentions",
"of",
"the",
"specified",
"types",
"and",
"replaces",
"them",
"with",
"the",
"closest",
"looking",
"textual",
"representation",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/MessageBuilder.java#L491-L494 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageResponse.java | SendUsersMessageResponse.withResult | public SendUsersMessageResponse withResult(java.util.Map<String, java.util.Map<String, EndpointMessageResult>> result) {
"""
An object that shows the endpoints that were messaged for each user. The object provides a list of user IDs. For
each user ID, it provides the endpoint IDs that were messaged. For each endp... | java | public SendUsersMessageResponse withResult(java.util.Map<String, java.util.Map<String, EndpointMessageResult>> result) {
setResult(result);
return this;
} | [
"public",
"SendUsersMessageResponse",
"withResult",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"EndpointMessageResult",
">",
">",
"result",
")",
"{",
"setResult",
"(",
"result",
")",
";",
... | An object that shows the endpoints that were messaged for each user. The object provides a list of user IDs. For
each user ID, it provides the endpoint IDs that were messaged. For each endpoint ID, it provides an
EndpointMessageResult object.
@param result
An object that shows the endpoints that were messaged for each... | [
"An",
"object",
"that",
"shows",
"the",
"endpoints",
"that",
"were",
"messaged",
"for",
"each",
"user",
".",
"The",
"object",
"provides",
"a",
"list",
"of",
"user",
"IDs",
".",
"For",
"each",
"user",
"ID",
"it",
"provides",
"the",
"endpoint",
"IDs",
"tha... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SendUsersMessageResponse.java#L149-L152 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormBuilder.java | AbstractFormBuilder.createSelector | protected JComponent createSelector(String fieldName, Constraint filter) {
"""
Creates a component which is used as a selector in the form. This
implementation creates a {@link JComboBox}
@param fieldName the name of the field for the selector
@param filter an optional filter constraint
@return the component... | java | protected JComponent createSelector(String fieldName, Constraint filter) {
Map context = new HashMap();
context.put(ComboBoxBinder.FILTER_KEY, filter);
return getBindingFactory().createBinding(JComboBox.class, fieldName).getControl();
} | [
"protected",
"JComponent",
"createSelector",
"(",
"String",
"fieldName",
",",
"Constraint",
"filter",
")",
"{",
"Map",
"context",
"=",
"new",
"HashMap",
"(",
")",
";",
"context",
".",
"put",
"(",
"ComboBoxBinder",
".",
"FILTER_KEY",
",",
"filter",
")",
";",
... | Creates a component which is used as a selector in the form. This
implementation creates a {@link JComboBox}
@param fieldName the name of the field for the selector
@param filter an optional filter constraint
@return the component to use for a selector, not null | [
"Creates",
"a",
"component",
"which",
"is",
"used",
"as",
"a",
"selector",
"in",
"the",
"form",
".",
"This",
"implementation",
"creates",
"a",
"{",
"@link",
"JComboBox",
"}"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormBuilder.java#L139-L143 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/JoinProducerBase.java | JoinProducerBase.restoreBlock | protected void restoreBlock(RestoreWork rejoinWork, SiteProcedureConnection siteConnection) {
"""
Received a datablock. Reset the watchdog timer and hand the block to the Site.
"""
kickWatchdog(true);
rejoinWork.restore(siteConnection);
} | java | protected void restoreBlock(RestoreWork rejoinWork, SiteProcedureConnection siteConnection)
{
kickWatchdog(true);
rejoinWork.restore(siteConnection);
} | [
"protected",
"void",
"restoreBlock",
"(",
"RestoreWork",
"rejoinWork",
",",
"SiteProcedureConnection",
"siteConnection",
")",
"{",
"kickWatchdog",
"(",
"true",
")",
";",
"rejoinWork",
".",
"restore",
"(",
"siteConnection",
")",
";",
"}"
] | Received a datablock. Reset the watchdog timer and hand the block to the Site. | [
"Received",
"a",
"datablock",
".",
"Reset",
"the",
"watchdog",
"timer",
"and",
"hand",
"the",
"block",
"to",
"the",
"Site",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/JoinProducerBase.java#L153-L157 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_filter_name_changeActivity_POST | public OvhTaskFilter domain_account_accountName_filter_name_changeActivity_POST(String domain, String accountName, String name, Boolean activity) throws IOException {
"""
Change filter activity
REST: POST /email/domain/{domain}/account/{accountName}/filter/{name}/changeActivity
@param activity [required] New a... | java | public OvhTaskFilter domain_account_accountName_filter_name_changeActivity_POST(String domain, String accountName, String name, Boolean activity) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/filter/{name}/changeActivity";
StringBuilder sb = path(qPath, domain, accountName, name)... | [
"public",
"OvhTaskFilter",
"domain_account_accountName_filter_name_changeActivity_POST",
"(",
"String",
"domain",
",",
"String",
"accountName",
",",
"String",
"name",
",",
"Boolean",
"activity",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{... | Change filter activity
REST: POST /email/domain/{domain}/account/{accountName}/filter/{name}/changeActivity
@param activity [required] New activity
@param domain [required] Name of your domain name
@param accountName [required] Name of account
@param name [required] Filter name | [
"Change",
"filter",
"activity"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L668-L675 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/asm/AsmUtils.java | AsmUtils.changeMethodAccess | public static Method changeMethodAccess(Class<?> clazz, String methodName, String srgName, boolean silenced, Class<?>... params) {
"""
Changes the access level for the specified method for a class.
@param clazz the clazz
@param methodName the field name
@param srgName the srg name
@param silenced the silence... | java | public static Method changeMethodAccess(Class<?> clazz, String methodName, String srgName, boolean silenced, Class<?>... params)
{
try
{
Method m = clazz.getDeclaredMethod(MalisisCore.isObfEnv ? srgName : methodName, params);
m.setAccessible(true);
return m;
}
catch (ReflectiveOperationException e)
... | [
"public",
"static",
"Method",
"changeMethodAccess",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"String",
"srgName",
",",
"boolean",
"silenced",
",",
"Class",
"<",
"?",
">",
"...",
"params",
")",
"{",
"try",
"{",
"Method",
"m"... | Changes the access level for the specified method for a class.
@param clazz the clazz
@param methodName the field name
@param srgName the srg name
@param silenced the silenced
@param params the params
@return the field | [
"Changes",
"the",
"access",
"level",
"for",
"the",
"specified",
"method",
"for",
"a",
"class",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/asm/AsmUtils.java#L424-L439 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/ScriptConverter.java | ScriptConverter._serializeDate | private void _serializeDate(Date date, StringBuilder sb) throws ConverterException {
"""
serialize a Date
@param date Date to serialize
@param sb
@throws ConverterException
"""
_serializeDateTime(new DateTimeImpl(date), sb);
} | java | private void _serializeDate(Date date, StringBuilder sb) throws ConverterException {
_serializeDateTime(new DateTimeImpl(date), sb);
} | [
"private",
"void",
"_serializeDate",
"(",
"Date",
"date",
",",
"StringBuilder",
"sb",
")",
"throws",
"ConverterException",
"{",
"_serializeDateTime",
"(",
"new",
"DateTimeImpl",
"(",
"date",
")",
",",
"sb",
")",
";",
"}"
] | serialize a Date
@param date Date to serialize
@param sb
@throws ConverterException | [
"serialize",
"a",
"Date"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/ScriptConverter.java#L115-L117 |
arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.deployApplication | public void deployApplication(String applicationName, URL... urls) throws IOException {
"""
Deploys application reading resources from specified URLs
@param applicationName to configure in cluster
@param urls where resources are read
@return the name of the application
@throws IOException
"""
... | java | public void deployApplication(String applicationName, URL... urls) throws IOException {
this.applicationName = applicationName;
for (URL url : urls) {
try (InputStream inputStream = url.openStream()) {
deploy(inputStream);
}
}
} | [
"public",
"void",
"deployApplication",
"(",
"String",
"applicationName",
",",
"URL",
"...",
"urls",
")",
"throws",
"IOException",
"{",
"this",
".",
"applicationName",
"=",
"applicationName",
";",
"for",
"(",
"URL",
"url",
":",
"urls",
")",
"{",
"try",
"(",
... | Deploys application reading resources from specified URLs
@param applicationName to configure in cluster
@param urls where resources are read
@return the name of the application
@throws IOException | [
"Deploys",
"application",
"reading",
"resources",
"from",
"specified",
"URLs"
] | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L136-L144 |
landawn/AbacusUtil | src/com/landawn/abacus/util/StringUtil.java | StringUtil.swapCase | public static String swapCase(final String str) {
"""
<p>
Swaps the case of a String changing upper and title case to lower case,
and lower case to upper case.
</p>
<ul>
<li>Upper case character converts to Lower case</li>
<li>Title case character converts to Lower case</li>
<li>Lower case character conve... | java | public static String swapCase(final String str) {
if (N.isNullOrEmpty(str)) {
return str;
}
final char[] cbuf = str.toCharArray();
char ch = 0;
for (int i = 0, len = cbuf.length; i < len; i++) {
ch = cbuf[i];
if (Character.isUpperCa... | [
"public",
"static",
"String",
"swapCase",
"(",
"final",
"String",
"str",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"str",
")",
")",
"{",
"return",
"str",
";",
"}",
"final",
"char",
"[",
"]",
"cbuf",
"=",
"str",
".",
"toCharArray",
"(",
"... | <p>
Swaps the case of a String changing upper and title case to lower case,
and lower case to upper case.
</p>
<ul>
<li>Upper case character converts to Lower case</li>
<li>Title case character converts to Lower case</li>
<li>Lower case character converts to Upper case</li>
</ul>
<p>
For a word based algorithm, see
{... | [
"<p",
">",
"Swaps",
"the",
"case",
"of",
"a",
"String",
"changing",
"upper",
"and",
"title",
"case",
"to",
"lower",
"case",
"and",
"lower",
"case",
"to",
"upper",
"case",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/StringUtil.java#L763-L781 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Node.java | Node.drawWithTransforms | @Override
public void drawWithTransforms(final Context2D context, final double alpha, final BoundingBox bounds) {
"""
Used internally. Applies the node's transform-related attributes
to the current context, draws the node (and it's children, if any)
and restores the context.
"""
if ((context.isSe... | java | @Override
public void drawWithTransforms(final Context2D context, final double alpha, final BoundingBox bounds)
{
if ((context.isSelection()) && (false == isListening()))
{
return;
}
if (context.isDrag() || isVisible())
{
context.saveContainer();
... | [
"@",
"Override",
"public",
"void",
"drawWithTransforms",
"(",
"final",
"Context2D",
"context",
",",
"final",
"double",
"alpha",
",",
"final",
"BoundingBox",
"bounds",
")",
"{",
"if",
"(",
"(",
"context",
".",
"isSelection",
"(",
")",
")",
"&&",
"(",
"false... | Used internally. Applies the node's transform-related attributes
to the current context, draws the node (and it's children, if any)
and restores the context. | [
"Used",
"internally",
".",
"Applies",
"the",
"node",
"s",
"transform",
"-",
"related",
"attributes",
"to",
"the",
"current",
"context",
"draws",
"the",
"node",
"(",
"and",
"it",
"s",
"children",
"if",
"any",
")",
"and",
"restores",
"the",
"context",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Node.java#L480-L501 |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/events/ContainerLifecycleEvents.java | ContainerLifecycleEvents.fireProcessAnnotatedType | private void fireProcessAnnotatedType(ProcessAnnotatedTypeImpl<?> event, BeanManagerImpl beanManager) {
"""
Fires a {@link ProcessAnnotatedType} or {@link ProcessSyntheticAnnotatedType} using the default event mechanism.
"""
final Resolvable resolvable = ProcessAnnotatedTypeEventResolvable.of(event, di... | java | private void fireProcessAnnotatedType(ProcessAnnotatedTypeImpl<?> event, BeanManagerImpl beanManager) {
final Resolvable resolvable = ProcessAnnotatedTypeEventResolvable.of(event, discovery);
try {
beanManager.getGlobalLenientObserverNotifier().fireEvent(event, resolvable);
} catch (... | [
"private",
"void",
"fireProcessAnnotatedType",
"(",
"ProcessAnnotatedTypeImpl",
"<",
"?",
">",
"event",
",",
"BeanManagerImpl",
"beanManager",
")",
"{",
"final",
"Resolvable",
"resolvable",
"=",
"ProcessAnnotatedTypeEventResolvable",
".",
"of",
"(",
"event",
",",
"dis... | Fires a {@link ProcessAnnotatedType} or {@link ProcessSyntheticAnnotatedType} using the default event mechanism. | [
"Fires",
"a",
"{"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/events/ContainerLifecycleEvents.java#L184-L191 |
structurizr/java | structurizr-core/src/com/structurizr/model/Model.java | Model.addSoftwareSystem | public SoftwareSystem addSoftwareSystem(@Nonnull String name, @Nullable String description) {
"""
Creates a software system (with an unspecified location) and adds it to the model.
@param name the name of the software system
@param description a short description of the software system
@return the Soft... | java | public SoftwareSystem addSoftwareSystem(@Nonnull String name, @Nullable String description) {
return addSoftwareSystem(Location.Unspecified, name, description);
} | [
"public",
"SoftwareSystem",
"addSoftwareSystem",
"(",
"@",
"Nonnull",
"String",
"name",
",",
"@",
"Nullable",
"String",
"description",
")",
"{",
"return",
"addSoftwareSystem",
"(",
"Location",
".",
"Unspecified",
",",
"name",
",",
"description",
")",
";",
"}"
] | Creates a software system (with an unspecified location) and adds it to the model.
@param name the name of the software system
@param description a short description of the software system
@return the SoftwareSystem instance created and added to the model (or null)
@throws IllegalArgumentException if a software... | [
"Creates",
"a",
"software",
"system",
"(",
"with",
"an",
"unspecified",
"location",
")",
"and",
"adds",
"it",
"to",
"the",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Model.java#L55-L57 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/ResponseImpl.java | ResponseImpl.getResponseText | public String getResponseText() {
"""
This method parses the response body as a String.
If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
will return null unless the {@link Request} was made using a <code>download()</code> method.
@return The bo... | java | public String getResponseText() {
if (this.bodyBytes == null) {
return "";
}
Charset charset = contentType != null ? contentType.charset(UTF_8) : UTF_8;
try {
return new String(this.bodyBytes, charset.name());
} catch (UnsupportedEncodingException e) {
... | [
"public",
"String",
"getResponseText",
"(",
")",
"{",
"if",
"(",
"this",
".",
"bodyBytes",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"Charset",
"charset",
"=",
"contentType",
"!=",
"null",
"?",
"contentType",
".",
"charset",
"(",
"UTF_8",
")",
... | This method parses the response body as a String.
If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
will return null unless the {@link Request} was made using a <code>download()</code> method.
@return The body of the response as a String. Empty string if... | [
"This",
"method",
"parses",
"the",
"response",
"body",
"as",
"a",
"String",
".",
"If",
"this",
"method",
"is",
"called",
"then",
"subsequent",
"calls",
"to",
"{",
"@link",
"#getResponseByteStream",
"()",
"}",
"or",
"{",
"@link",
"#getResponseBytes",
"()",
"}... | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/ResponseImpl.java#L115-L127 |
meertensinstituut/mtas | src/main/java/mtas/solr/handler/util/MtasSolrHistoryList.java | MtasSolrHistoryList.setLimits | public void setLimits(int softLimit, int hardLimit) {
"""
Sets the limits.
@param softLimit the soft limit
@param hardLimit the hard limit
"""
if ((softLimit > 0 && hardLimit > softLimit) || (softLimit == 0 && hardLimit == 0)) {
this.softLimit = softLimit;
this.hardLimit = hardLimit;
... | java | public void setLimits(int softLimit, int hardLimit) {
if ((softLimit > 0 && hardLimit > softLimit) || (softLimit == 0 && hardLimit == 0)) {
this.softLimit = softLimit;
this.hardLimit = hardLimit;
garbageCollect();
} else {
throw new IllegalArgumentException();
}
} | [
"public",
"void",
"setLimits",
"(",
"int",
"softLimit",
",",
"int",
"hardLimit",
")",
"{",
"if",
"(",
"(",
"softLimit",
">",
"0",
"&&",
"hardLimit",
">",
"softLimit",
")",
"||",
"(",
"softLimit",
"==",
"0",
"&&",
"hardLimit",
"==",
"0",
")",
")",
"{"... | Sets the limits.
@param softLimit the soft limit
@param hardLimit the hard limit | [
"Sets",
"the",
"limits",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/util/MtasSolrHistoryList.java#L61-L69 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/SchemaBuilders.java | SchemaBuilders.bitemporalMapper | public static BitemporalMapperBuilder bitemporalMapper(String vtFrom, String vtTo, String ttFrom, String ttTo) {
"""
Returns a new {@link BitemporalMapperBuilder}.
@param vtFrom the column name containing the valid time start
@param vtTo the column name containing the valid time stop
@param ttFrom the column ... | java | public static BitemporalMapperBuilder bitemporalMapper(String vtFrom, String vtTo, String ttFrom, String ttTo) {
return new BitemporalMapperBuilder(vtFrom, vtTo, ttFrom, ttTo);
} | [
"public",
"static",
"BitemporalMapperBuilder",
"bitemporalMapper",
"(",
"String",
"vtFrom",
",",
"String",
"vtTo",
",",
"String",
"ttFrom",
",",
"String",
"ttTo",
")",
"{",
"return",
"new",
"BitemporalMapperBuilder",
"(",
"vtFrom",
",",
"vtTo",
",",
"ttFrom",
",... | Returns a new {@link BitemporalMapperBuilder}.
@param vtFrom the column name containing the valid time start
@param vtTo the column name containing the valid time stop
@param ttFrom the column name containing the transaction time start
@param ttTo the column name containing the transaction time stop
@return a new bite... | [
"Returns",
"a",
"new",
"{",
"@link",
"BitemporalMapperBuilder",
"}",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/SchemaBuilders.java#L71-L73 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleryField.java | CmsGalleryField.setValue | protected void setValue(String value, boolean fireEvent) {
"""
Sets the widget value.<p>
@param value the value to set
@param fireEvent if the change event should be fired
"""
m_textbox.setValue(value);
updateUploadTarget(CmsResource.getFolderPath(value));
updateResourceInfo(value)... | java | protected void setValue(String value, boolean fireEvent) {
m_textbox.setValue(value);
updateUploadTarget(CmsResource.getFolderPath(value));
updateResourceInfo(value);
m_previousValue = value;
if (fireEvent) {
fireChange(true);
}
} | [
"protected",
"void",
"setValue",
"(",
"String",
"value",
",",
"boolean",
"fireEvent",
")",
"{",
"m_textbox",
".",
"setValue",
"(",
"value",
")",
";",
"updateUploadTarget",
"(",
"CmsResource",
".",
"getFolderPath",
"(",
"value",
")",
")",
";",
"updateResourceIn... | Sets the widget value.<p>
@param value the value to set
@param fireEvent if the change event should be fired | [
"Sets",
"the",
"widget",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleryField.java#L603-L612 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.shiftingWindowAveragingLong | public static <E> DoubleStream shiftingWindowAveragingLong(Stream<E> stream, int rollingFactor, ToLongFunction<? super E> mapper) {
"""
<p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>LongStream</code> that is then rolled follo... | java | public static <E> DoubleStream shiftingWindowAveragingLong(Stream<E> stream, int rollingFactor, ToLongFunction<? super E> mapper) {
Objects.requireNonNull(stream);
Objects.requireNonNull(mapper);
LongStream longStream = stream.mapToLong(mapper);
return shiftingWindowAveragingLong(longSt... | [
"public",
"static",
"<",
"E",
">",
"DoubleStream",
"shiftingWindowAveragingLong",
"(",
"Stream",
"<",
"E",
">",
"stream",
",",
"int",
"rollingFactor",
",",
"ToLongFunction",
"<",
"?",
"super",
"E",
">",
"mapper",
")",
"{",
"Objects",
".",
"requireNonNull",
"... | <p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>LongStream</code> that is then rolled following
the same principle as the <code>roll()</code> method. This steps builds a <code>Stream<LongStream></code>.
</p>
<p>Then the <code>a... | [
"<p",
">",
"Generates",
"a",
"stream",
"that",
"is",
"computed",
"from",
"a",
"provided",
"stream",
"following",
"two",
"steps",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"first",
"steps",
"maps",
"this",
"stream",
"to",
"an",
"<code",
">",
"LongStrea... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L606-L612 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeNotificationArea | public void writeNotificationArea(OutputStream out, NotificationArea value) throws IOException {
"""
Encode a NotificationArea instance as JSON:
{
"registrations" : URL,
"serverRegistrations" : URL,
"inbox" : URL
}
@param out The stream to write JSON to
@param value The NotificationArea instance to encode... | java | public void writeNotificationArea(OutputStream out, NotificationArea value) throws IOException {
writeStartObject(out);
writeStringField(out, OM_REGISTRATIONS, value.registrationsURL);
writeStringField(out, OM_SERVERREGISTRATIONS, value.serverRegistrationsURL);
writeStringField(out, OM_I... | [
"public",
"void",
"writeNotificationArea",
"(",
"OutputStream",
"out",
",",
"NotificationArea",
"value",
")",
"throws",
"IOException",
"{",
"writeStartObject",
"(",
"out",
")",
";",
"writeStringField",
"(",
"out",
",",
"OM_REGISTRATIONS",
",",
"value",
".",
"regis... | Encode a NotificationArea instance as JSON:
{
"registrations" : URL,
"serverRegistrations" : URL,
"inbox" : URL
}
@param out The stream to write JSON to
@param value The NotificationArea instance to encode. Can't be null.
@throws IOException If an I/O error occurs
@see #readNotificationArea(InputStream) | [
"Encode",
"a",
"NotificationArea",
"instance",
"as",
"JSON",
":",
"{",
"registrations",
":",
"URL",
"serverRegistrations",
":",
"URL",
"inbox",
":",
"URL",
"}"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1440-L1447 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/beans/AbstractBeanIntrospection.java | AbstractBeanIntrospection.indexProperty | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected final void indexProperty(
@Nonnull Class<? extends Annotation> annotationType,
@Nonnull String propertyName,
@Nonnull String annotationValue) {
"""
Used to produce an index for particular annotation... | java | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected final void indexProperty(
@Nonnull Class<? extends Annotation> annotationType,
@Nonnull String propertyName,
@Nonnull String annotationValue) {
indexProperty(annotationType, propertyName);
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"final",
"void",
"indexProperty",
"(",
"@",
"Nonnull",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
",",
"@",
"Nonnull",
"String",
"p... | Used to produce an index for particular annotation type. Method referenced by generated byte code and
not for public consumption. Should be called after {@link #addProperty(BeanProperty)} if required.
@param annotationType The annotation type
@param propertyName The property name
@param annotationValue The annotation ... | [
"Used",
"to",
"produce",
"an",
"index",
"for",
"particular",
"annotation",
"type",
".",
"Method",
"referenced",
"by",
"generated",
"byte",
"code",
"and",
"not",
"for",
"public",
"consumption",
".",
"Should",
"be",
"called",
"after",
"{",
"@link",
"#addProperty... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/beans/AbstractBeanIntrospection.java#L204-L219 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.readDataField | private Object readDataField(int bytes, int datalen)
throws IOException,
ClassNotFoundException {
"""
***********************************************************************
Read the data portion of the entry. This assumes that the caller as positioned
the seek point in th... | java | private Object readDataField(int bytes, int datalen)
throws IOException,
ClassNotFoundException {
Object value = null;
deserializeTimer.reset();
if (bytes == 0) { // yes, need to deserialize
if ((databuf == null) || (databuf.length < datalen)... | [
"private",
"Object",
"readDataField",
"(",
"int",
"bytes",
",",
"int",
"datalen",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"Object",
"value",
"=",
"null",
";",
"deserializeTimer",
".",
"reset",
"(",
")",
";",
"if",
"(",
"bytes",
"=="... | ***********************************************************************
Read the data portion of the entry. This assumes that the caller as positioned
the seek point in the file.
*********************************************************************** | [
"***********************************************************************",
"Read",
"the",
"data",
"portion",
"of",
"the",
"entry",
".",
"This",
"assumes",
"that",
"the",
"caller",
"as",
"positioned",
"the",
"seek",
"point",
"in",
"the",
"file",
".",
"*******************... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L1770-L1806 |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java | HBeanTable.getLazy | public Set<HBeanRow> getLazy(Set<HBeanRow> rows, FetchType... fetchType)
throws HBeanNotFoundException {
"""
Fetch a set of rows without fetching their references.
@param rows rows to fetch
@param fetchType data to fetch
@return rows found
"""
final List<Row> gets = new ArrayList<>(ro... | java | public Set<HBeanRow> getLazy(Set<HBeanRow> rows, FetchType... fetchType)
throws HBeanNotFoundException {
final List<Row> gets = new ArrayList<>(rows.size());
for (HBeanRow row : rows) {
final Get get = new Get(row.getRowKey());
HBeanRow.setColumnFilter(get, fetchType)... | [
"public",
"Set",
"<",
"HBeanRow",
">",
"getLazy",
"(",
"Set",
"<",
"HBeanRow",
">",
"rows",
",",
"FetchType",
"...",
"fetchType",
")",
"throws",
"HBeanNotFoundException",
"{",
"final",
"List",
"<",
"Row",
">",
"gets",
"=",
"new",
"ArrayList",
"<>",
"(",
... | Fetch a set of rows without fetching their references.
@param rows rows to fetch
@param fetchType data to fetch
@return rows found | [
"Fetch",
"a",
"set",
"of",
"rows",
"without",
"fetching",
"their",
"references",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanTable.java#L159-L189 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java | IdentityFactoryImpl.isOrdered | private boolean isOrdered(FieldDescriptor[] flds, String[] pkFieldNames) {
"""
Checks length and compare order of field names with declared PK fields in metadata.
"""
if((flds.length > 1 && pkFieldNames == null) || flds.length != pkFieldNames.length)
{
throw new PersistenceBroker... | java | private boolean isOrdered(FieldDescriptor[] flds, String[] pkFieldNames)
{
if((flds.length > 1 && pkFieldNames == null) || flds.length != pkFieldNames.length)
{
throw new PersistenceBrokerException("pkFieldName length does not match number of defined PK fields." +
... | [
"private",
"boolean",
"isOrdered",
"(",
"FieldDescriptor",
"[",
"]",
"flds",
",",
"String",
"[",
"]",
"pkFieldNames",
")",
"{",
"if",
"(",
"(",
"flds",
".",
"length",
">",
"1",
"&&",
"pkFieldNames",
"==",
"null",
")",
"||",
"flds",
".",
"length",
"!=",... | Checks length and compare order of field names with declared PK fields in metadata. | [
"Checks",
"length",
"and",
"compare",
"order",
"of",
"field",
"names",
"with",
"declared",
"PK",
"fields",
"in",
"metadata",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java#L217-L232 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.