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 |
|---|---|---|---|---|---|---|---|---|---|---|
line/armeria | core/src/main/java/com/linecorp/armeria/common/logging/LoggingDecoratorBuilder.java | LoggingDecoratorBuilder.responseCauseSanitizer | public T responseCauseSanitizer(Function<? super Throwable, ? extends Throwable> responseCauseSanitizer) {
"""
Sets the {@link Function} to use to sanitize a response cause before logging. You can
sanitize the stack trace of the exception to remove sensitive information, or prevent from logging
the stack trace c... | java | public T responseCauseSanitizer(Function<? super Throwable, ? extends Throwable> responseCauseSanitizer) {
this.responseCauseSanitizer = requireNonNull(responseCauseSanitizer, "responseCauseSanitizer");
return self();
} | [
"public",
"T",
"responseCauseSanitizer",
"(",
"Function",
"<",
"?",
"super",
"Throwable",
",",
"?",
"extends",
"Throwable",
">",
"responseCauseSanitizer",
")",
"{",
"this",
".",
"responseCauseSanitizer",
"=",
"requireNonNull",
"(",
"responseCauseSanitizer",
",",
"\"... | Sets the {@link Function} to use to sanitize a response cause before logging. You can
sanitize the stack trace of the exception to remove sensitive information, or prevent from logging
the stack trace completely by returning {@code null} in the {@link Function}. If unset, will use
{@link Function#identity()}. | [
"Sets",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/logging/LoggingDecoratorBuilder.java#L256-L259 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addExplicitListItem | public int addExplicitListItem(UUID appId, String versionId, UUID entityId, AddExplicitListItemOptionalParameter addExplicitListItemOptionalParameter) {
"""
Add a new item to the explicit list for the Pattern.Any entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pat... | java | public int addExplicitListItem(UUID appId, String versionId, UUID entityId, AddExplicitListItemOptionalParameter addExplicitListItemOptionalParameter) {
return addExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, addExplicitListItemOptionalParameter).toBlocking().single().body();
} | [
"public",
"int",
"addExplicitListItem",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"AddExplicitListItemOptionalParameter",
"addExplicitListItemOptionalParameter",
")",
"{",
"return",
"addExplicitListItemWithServiceResponseAsync",
"(",
"app... | Add a new item to the explicit list for the Pattern.Any entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The Pattern.Any entity extractor ID.
@param addExplicitListItemOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Il... | [
"Add",
"a",
"new",
"item",
"to",
"the",
"explicit",
"list",
"for",
"the",
"Pattern",
".",
"Any",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L9992-L9994 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java | ConfigClient.updateSink | public final LogSink updateSink(String sinkName, LogSink sink, FieldMask updateMask) {
"""
Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: `destination`, and `filter`. The updated sink might also have a new
`writer_identity`; see the `unique_writer_id... | java | public final LogSink updateSink(String sinkName, LogSink sink, FieldMask updateMask) {
UpdateSinkRequest request =
UpdateSinkRequest.newBuilder()
.setSinkName(sinkName)
.setSink(sink)
.setUpdateMask(updateMask)
.build();
return updateSink(request);
} | [
"public",
"final",
"LogSink",
"updateSink",
"(",
"String",
"sinkName",
",",
"LogSink",
"sink",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateSinkRequest",
"request",
"=",
"UpdateSinkRequest",
".",
"newBuilder",
"(",
")",
".",
"setSinkName",
"(",
"sinkName",
"... | Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: `destination`, and `filter`. The updated sink might also have a new
`writer_identity`; see the `unique_writer_identity` field.
<p>Sample code:
<pre><code>
try (ConfigClient configClient = ConfigClient.create(... | [
"Updates",
"a",
"sink",
".",
"This",
"method",
"replaces",
"the",
"following",
"fields",
"in",
"the",
"existing",
"sink",
"with",
"values",
"from",
"the",
"new",
"sink",
":",
"destination",
"and",
"filter",
".",
"The",
"updated",
"sink",
"might",
"also",
"... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java#L613-L622 |
bwkimmel/jdcp | jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java | JobStatus.withIndeterminantProgress | public JobStatus withIndeterminantProgress() {
"""
Creates a copy of this <code>JobStatus</code> with the progress set to
an indeterminant value (<code>Double.NaN</code>).
@return A copy of this <code>JobStatus</code> with the progress set to
indeterminant.
"""
return new JobStatus(jobId, description, s... | java | public JobStatus withIndeterminantProgress() {
return new JobStatus(jobId, description, state, Double.NaN, status, eventId);
} | [
"public",
"JobStatus",
"withIndeterminantProgress",
"(",
")",
"{",
"return",
"new",
"JobStatus",
"(",
"jobId",
",",
"description",
",",
"state",
",",
"Double",
".",
"NaN",
",",
"status",
",",
"eventId",
")",
";",
"}"
] | Creates a copy of this <code>JobStatus</code> with the progress set to
an indeterminant value (<code>Double.NaN</code>).
@return A copy of this <code>JobStatus</code> with the progress set to
indeterminant. | [
"Creates",
"a",
"copy",
"of",
"this",
"<code",
">",
"JobStatus<",
"/",
"code",
">",
"with",
"the",
"progress",
"set",
"to",
"an",
"indeterminant",
"value",
"(",
"<code",
">",
"Double",
".",
"NaN<",
"/",
"code",
">",
")",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java#L163-L165 |
petergeneric/stdlib | guice/common/src/main/java/com/peterphi/std/guice/common/serviceprops/ConfigurationPropertyRegistry.java | ConfigurationPropertyRegistry.addInstance | void addInstance(final Class<?> discoveredType, final Object newlyConstructed) {
"""
Register an instance of a property-consuming type; the registry will use a weak reference to hold on to this instance, so
that it can be discarded if it has a short lifespan
@param discoveredType
@param newlyConstructed
"... | java | void addInstance(final Class<?> discoveredType, final Object newlyConstructed)
{
WeakHashMap<Object, Void> map;
synchronized (instances)
{
map = instances.get(discoveredType);
if (map == null)
{
map = new WeakHashMap<>();
instances.put(discoveredType, map);
}
}
synchronized (map)
{
... | [
"void",
"addInstance",
"(",
"final",
"Class",
"<",
"?",
">",
"discoveredType",
",",
"final",
"Object",
"newlyConstructed",
")",
"{",
"WeakHashMap",
"<",
"Object",
",",
"Void",
">",
"map",
";",
"synchronized",
"(",
"instances",
")",
"{",
"map",
"=",
"instan... | Register an instance of a property-consuming type; the registry will use a weak reference to hold on to this instance, so
that it can be discarded if it has a short lifespan
@param discoveredType
@param newlyConstructed | [
"Register",
"an",
"instance",
"of",
"a",
"property",
"-",
"consuming",
"type",
";",
"the",
"registry",
"will",
"use",
"a",
"weak",
"reference",
"to",
"hold",
"on",
"to",
"this",
"instance",
"so",
"that",
"it",
"can",
"be",
"discarded",
"if",
"it",
"has",... | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/common/src/main/java/com/peterphi/std/guice/common/serviceprops/ConfigurationPropertyRegistry.java#L112-L131 |
domaframework/doma-gen | src/main/java/org/seasar/doma/extension/gen/ClassDescSupport.java | ClassDescSupport.isImportTargetPackage | protected boolean isImportTargetPackage(ClassDesc classDesc, String importPackageName) {
"""
インポート対象のパッケージの場合 {@code true} を返します。
@param classDesc クラス記述
@param importPackageName インポートするパッケージ名
@return インポート対象のパッケージの場合 {@code true}
"""
if (importPackageName == null) {
return false;
}
if (i... | java | protected boolean isImportTargetPackage(ClassDesc classDesc, String importPackageName) {
if (importPackageName == null) {
return false;
}
if (importPackageName.isEmpty()) {
return false;
}
if (importPackageName.equals(classDesc.getPackageName())) {
return false;
}
if (impor... | [
"protected",
"boolean",
"isImportTargetPackage",
"(",
"ClassDesc",
"classDesc",
",",
"String",
"importPackageName",
")",
"{",
"if",
"(",
"importPackageName",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"importPackageName",
".",
"isEmpty",
"("... | インポート対象のパッケージの場合 {@code true} を返します。
@param classDesc クラス記述
@param importPackageName インポートするパッケージ名
@return インポート対象のパッケージの場合 {@code true} | [
"インポート対象のパッケージの場合",
"{",
"@code",
"true",
"}",
"を返します。"
] | train | https://github.com/domaframework/doma-gen/blob/8046e0b28d2167d444125f206ce36e554b3ee616/src/main/java/org/seasar/doma/extension/gen/ClassDescSupport.java#L73-L87 |
nilsreiter/uima-util | src/main/java/de/unistuttgart/ims/uimautil/AnnotationUtil.java | AnnotationUtil.trimBegin | public static <T extends Annotation> T trimBegin(T annotation, char... ws) {
"""
Moves the begin-index as long as a character contain in the array is at
the beginning.
@param annotation
the annotation to be trimmed
@param ws
an array of chars to be trimmed
@param <T>
the annotation type
@return the trimm... | java | public static <T extends Annotation> T trimBegin(T annotation, char... ws) {
char[] s = annotation.getCoveredText().toCharArray();
if (s.length == 0)
return annotation;
int b = 0;
while (ArrayUtils.contains(ws, s[b])) {
b++;
}
annotation.setBegin(annotation.getBegin() + b);
return annotation;
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"trimBegin",
"(",
"T",
"annotation",
",",
"char",
"...",
"ws",
")",
"{",
"char",
"[",
"]",
"s",
"=",
"annotation",
".",
"getCoveredText",
"(",
")",
".",
"toCharArray",
"(",
")",
";",
"i... | Moves the begin-index as long as a character contain in the array is at
the beginning.
@param annotation
the annotation to be trimmed
@param ws
an array of chars to be trimmed
@param <T>
the annotation type
@return the trimmed annotation
@since 0.4.2 | [
"Moves",
"the",
"begin",
"-",
"index",
"as",
"long",
"as",
"a",
"character",
"contain",
"in",
"the",
"array",
"is",
"at",
"the",
"beginning",
"."
] | train | https://github.com/nilsreiter/uima-util/blob/6f3bc3b8785702fe4ab9b670b87eaa215006f593/src/main/java/de/unistuttgart/ims/uimautil/AnnotationUtil.java#L147-L159 |
elki-project/elki | elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java | AbstractNode.splitTo | public final void splitTo(AbstractNode<E> newNode, List<E> sorting, int splitPoint) {
"""
Redistribute entries according to the given sorting.
@param newNode Node to split to
@param sorting Sorting to use
@param splitPoint Split point
"""
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
... | java | public final void splitTo(AbstractNode<E> newNode, List<E> sorting, int splitPoint) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder(1000) : null;
for(int i = 0; i < splitPoint; i++) {
addEntry(sorting.get(i));
i... | [
"public",
"final",
"void",
"splitTo",
"(",
"AbstractNode",
"<",
"E",
">",
"newNode",
",",
"List",
"<",
"E",
">",
"sorting",
",",
"int",
"splitPoint",
")",
"{",
"assert",
"(",
"isLeaf",
"(",
")",
"==",
"newNode",
".",
"isLeaf",
"(",
")",
")",
";",
"... | Redistribute entries according to the given sorting.
@param newNode Node to split to
@param sorting Sorting to use
@param splitPoint Split point | [
"Redistribute",
"entries",
"according",
"to",
"the",
"given",
"sorting",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java#L302-L323 |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/css/LineHeightProperty.java | LineHeightProperty.with | public CssSetter with(Integer value) {
"""
The used value of the property is this <code>value</code> multiplied by the
element's font size. Negative values are illegal.
"""
return new SimpleCssSetter(CSS_PROPERTY, value != null ? "" + value : null);
} | java | public CssSetter with(Integer value) {
return new SimpleCssSetter(CSS_PROPERTY, value != null ? "" + value : null);
} | [
"public",
"CssSetter",
"with",
"(",
"Integer",
"value",
")",
"{",
"return",
"new",
"SimpleCssSetter",
"(",
"CSS_PROPERTY",
",",
"value",
"!=",
"null",
"?",
"\"\"",
"+",
"value",
":",
"null",
")",
";",
"}"
] | The used value of the property is this <code>value</code> multiplied by the
element's font size. Negative values are illegal. | [
"The",
"used",
"value",
"of",
"the",
"property",
"is",
"this",
"<code",
">",
"value<",
"/",
"code",
">",
"multiplied",
"by",
"the",
"element",
"s",
"font",
"size",
".",
"Negative",
"values",
"are",
"illegal",
"."
] | train | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/css/LineHeightProperty.java#L49-L51 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentObjectPropertiesAxiomImpl_CustomFieldSerializer.java | OWLEquivalentObjectPropertiesAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLEquivalentObjectPropertiesAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLEquivalentObjectPropertiesAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLEquivalentObjectPropertiesAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
... | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLEquivalentObjectPropertiesAxiomImpl_CustomFieldSerializer.java#L75-L78 |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/impl/MultiqueryRequest.java | MultiqueryRequest.getParams | @Override
@JsonIgnore
protected Param[] getParams() {
"""
Generate the parameters approprate to a multiquery from the registered queries
"""
Map<String, String> queries = new LinkedHashMap<String, String>();
for (QueryRequest<?> req: this.queryRequests)
queries.put(req.getName(), req.getFQL());
S... | java | @Override
@JsonIgnore
protected Param[] getParams() {
Map<String, String> queries = new LinkedHashMap<String, String>();
for (QueryRequest<?> req: this.queryRequests)
queries.put(req.getName(), req.getFQL());
String json = JSONUtils.toJSON(queries, this.mapper);
return new Param[] { new Param("querie... | [
"@",
"Override",
"@",
"JsonIgnore",
"protected",
"Param",
"[",
"]",
"getParams",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"queries",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"for",
"(",
"QueryReques... | Generate the parameters approprate to a multiquery from the registered queries | [
"Generate",
"the",
"parameters",
"approprate",
"to",
"a",
"multiquery",
"from",
"the",
"registered",
"queries"
] | train | https://github.com/stickfigure/batchfb/blob/ceeda78aa6d8397eec032ab1d8997adb7378e9e2/src/main/java/com/googlecode/batchfb/impl/MultiqueryRequest.java#L38-L48 |
BrunoEberhard/minimal-j | src/main/java/org/minimalj/util/DateUtils.java | DateUtils.parseCH | public static String parseCH(String inputText, boolean partialAllowed) {
"""
Converts a CH - Date String in a yyyy-mm-dd String. The conversion
is very lenient and tries to convert as long as its somehow clear
what the user may have wanted.
@param inputText The input text. Maybe empty or <code>null</code>.
@... | java | public static String parseCH(String inputText, boolean partialAllowed) {
if (StringUtils.isEmpty(inputText)) return null;
String text = cutNonDigitsAtBegin(inputText);
if (StringUtils.isEmpty(text)) return "";
text = cutNonDigitsAtEnd(text);
if (StringUtils.isEmpty(text)) return "";
// Nun hat der String... | [
"public",
"static",
"String",
"parseCH",
"(",
"String",
"inputText",
",",
"boolean",
"partialAllowed",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"inputText",
")",
")",
"return",
"null",
";",
"String",
"text",
"=",
"cutNonDigitsAtBegin",
"(",
"... | Converts a CH - Date String in a yyyy-mm-dd String. The conversion
is very lenient and tries to convert as long as its somehow clear
what the user may have wanted.
@param inputText The input text. Maybe empty or <code>null</code>.
@param partialAllowed false if the inputText has to be a complete date with month and da... | [
"Converts",
"a",
"CH",
"-",
"Date",
"String",
"in",
"a",
"yyyy",
"-",
"mm",
"-",
"dd",
"String",
".",
"The",
"conversion",
"is",
"very",
"lenient",
"and",
"tries",
"to",
"convert",
"as",
"long",
"as",
"its",
"somehow",
"clear",
"what",
"the",
"user",
... | train | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/util/DateUtils.java#L80-L94 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/MinecraftTypeHelper.java | MinecraftTypeHelper.applyColour | static IBlockState applyColour(IBlockState state, Colour colour) {
"""
Recolour the Minecraft block
@param state The block to be recoloured
@param colour The new colour
@return A new blockstate which is a recoloured version of the original
"""
for (IProperty prop : state.getProperties().keySet())
... | java | static IBlockState applyColour(IBlockState state, Colour colour)
{
for (IProperty prop : state.getProperties().keySet())
{
if (prop.getName().equals("color") && prop.getValueClass() == net.minecraft.item.EnumDyeColor.class)
{
net.minecraft.item.EnumDyeColor current = (net.minec... | [
"static",
"IBlockState",
"applyColour",
"(",
"IBlockState",
"state",
",",
"Colour",
"colour",
")",
"{",
"for",
"(",
"IProperty",
"prop",
":",
"state",
".",
"getProperties",
"(",
")",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"prop",
".",
"getName",
... | Recolour the Minecraft block
@param state The block to be recoloured
@param colour The new colour
@return A new blockstate which is a recoloured version of the original | [
"Recolour",
"the",
"Minecraft",
"block"
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/MinecraftTypeHelper.java#L560-L574 |
UrielCh/ovh-java-sdk | ovh-java-sdk-core/src/main/java/net/minidev/ovh/api/ApiOvhAuth.java | ApiOvhAuth.time_GET | public Long time_GET() throws IOException {
"""
Get the current time of the OVH servers, since UNIX epoch
REST: GET /auth/time
"""
String qPath = "/auth/time";
StringBuilder sb = path(qPath);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, Long.class);
} | java | public Long time_GET() throws IOException {
String qPath = "/auth/time";
StringBuilder sb = path(qPath);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, Long.class);
} | [
"public",
"Long",
"time_GET",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/auth/time\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
"resp",
"=",
"execN",
"(",
"qPath",
",",
"\"GET\"",
",",
"sb",
".",... | Get the current time of the OVH servers, since UNIX epoch
REST: GET /auth/time | [
"Get",
"the",
"current",
"time",
"of",
"the",
"OVH",
"servers",
"since",
"UNIX",
"epoch"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-core/src/main/java/net/minidev/ovh/api/ApiOvhAuth.java#L48-L53 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java | ApiOvhHostingprivateDatabase.serviceName_database_databaseName_extension_extensionName_GET | public OvhDatabaseExtension serviceName_database_databaseName_extension_extensionName_GET(String serviceName, String databaseName, String extensionName) throws IOException {
"""
Get this object properties
REST: GET /hosting/privateDatabase/{serviceName}/database/{databaseName}/extension/{extensionName}
@param ... | java | public OvhDatabaseExtension serviceName_database_databaseName_extension_extensionName_GET(String serviceName, String databaseName, String extensionName) throws IOException {
String qPath = "/hosting/privateDatabase/{serviceName}/database/{databaseName}/extension/{extensionName}";
StringBuilder sb = path(qPath, serv... | [
"public",
"OvhDatabaseExtension",
"serviceName_database_databaseName_extension_extensionName_GET",
"(",
"String",
"serviceName",
",",
"String",
"databaseName",
",",
"String",
"extensionName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/privateDatabase... | Get this object properties
REST: GET /hosting/privateDatabase/{serviceName}/database/{databaseName}/extension/{extensionName}
@param serviceName [required] The internal name of your private database
@param databaseName [required] Database name
@param extensionName [required] Extension name | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L430-L435 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.isAssignable | public boolean isAssignable(Type t, Type s, Warner warn) {
"""
Is t assignable to s?<br>
Equivalent to subtype except for constant values and raw
types.<br>
(not defined for Method and ForAll types)
"""
if (t.hasTag(ERROR))
return true;
if (t.getTag().isSubRangeOf(INT) && t.const... | java | public boolean isAssignable(Type t, Type s, Warner warn) {
if (t.hasTag(ERROR))
return true;
if (t.getTag().isSubRangeOf(INT) && t.constValue() != null) {
int value = ((Number)t.constValue()).intValue();
switch (s.getTag()) {
case BYTE:
case CH... | [
"public",
"boolean",
"isAssignable",
"(",
"Type",
"t",
",",
"Type",
"s",
",",
"Warner",
"warn",
")",
"{",
"if",
"(",
"t",
".",
"hasTag",
"(",
"ERROR",
")",
")",
"return",
"true",
";",
"if",
"(",
"t",
".",
"getTag",
"(",
")",
".",
"isSubRangeOf",
... | Is t assignable to s?<br>
Equivalent to subtype except for constant values and raw
types.<br>
(not defined for Method and ForAll types) | [
"Is",
"t",
"assignable",
"to",
"s?<br",
">",
"Equivalent",
"to",
"subtype",
"except",
"for",
"constant",
"values",
"and",
"raw",
"types",
".",
"<br",
">",
"(",
"not",
"defined",
"for",
"Method",
"and",
"ForAll",
"types",
")"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L2047-L2071 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/DeploymentOperations.java | DeploymentOperations.addDeploymentOperationStep | static void addDeploymentOperationStep(final CompositeOperationBuilder builder, final Deployment deployment) {
"""
Creates an add operation on the deployment resource to the composite operation.
<p>
If the {@link Deployment#isEnabled()} is {@code false} a step to
{@linkplain #addDeployOperationStep(CompositeOpe... | java | static void addDeploymentOperationStep(final CompositeOperationBuilder builder, final Deployment deployment) {
final String name = deployment.getName();
final ModelNode address = createAddress(DEPLOYMENT, name);
final String runtimeName = deployment.getRuntimeName();
final ModelNode addO... | [
"static",
"void",
"addDeploymentOperationStep",
"(",
"final",
"CompositeOperationBuilder",
"builder",
",",
"final",
"Deployment",
"deployment",
")",
"{",
"final",
"String",
"name",
"=",
"deployment",
".",
"getName",
"(",
")",
";",
"final",
"ModelNode",
"address",
... | Creates an add operation on the deployment resource to the composite operation.
<p>
If the {@link Deployment#isEnabled()} is {@code false} a step to
{@linkplain #addDeployOperationStep(CompositeOperationBuilder, DeploymentDescription) deploy} the content may be
required.
</p>
@param builder the builder to add the s... | [
"Creates",
"an",
"add",
"operation",
"on",
"the",
"deployment",
"resource",
"to",
"the",
"composite",
"operation",
".",
"<p",
">",
"If",
"the",
"{",
"@link",
"Deployment#isEnabled",
"()",
"}",
"is",
"{",
"@code",
"false",
"}",
"a",
"step",
"to",
"{",
"@l... | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/DeploymentOperations.java#L302-L328 |
OpenLiberty/open-liberty | dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ConfigurationAdminImpl.java | ConfigurationAdminImpl.getConfiguration | @Override
public ExtendedConfiguration getConfiguration(String pid, String location) throws IOException {
"""
/*
(non-Javadoc)
@see
org.osgi.service.cm.ConfigurationAdmin#getConfiguration(java.lang.String,
java.lang.String)
If Configuration already exists(exists in table, or serialized), return the
e... | java | @Override
public ExtendedConfiguration getConfiguration(String pid, String location) throws IOException {
this.caFactory.checkConfigurationPermission();
return caFactory.getConfigurationStore().getConfiguration(pid, location);
} | [
"@",
"Override",
"public",
"ExtendedConfiguration",
"getConfiguration",
"(",
"String",
"pid",
",",
"String",
"location",
")",
"throws",
"IOException",
"{",
"this",
".",
"caFactory",
".",
"checkConfigurationPermission",
"(",
")",
";",
"return",
"caFactory",
".",
"g... | /*
(non-Javadoc)
@see
org.osgi.service.cm.ConfigurationAdmin#getConfiguration(java.lang.String,
java.lang.String)
If Configuration already exists(exists in table, or serialized), return the
existing configuration.
If existing configuration's location is null, set it with specified
location before returning it.
If Co... | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ConfigurationAdminImpl.java#L147-L151 |
kenyee/android-ddp-client | src/com/keysolutions/ddpclient/android/DDPStateSingleton.java | DDPStateSingleton.sendOAuthHTTPRequest | private void sendOAuthHTTPRequest(String serviceName, String accessToken, String credentialToken, Response.Listener listener) {
"""
/*
Login with OAuth requires the priming of "pending credentials" on the server to receive a secret
"""
RequestQueue queue = Volley.newRequestQueue(mContext);
Str... | java | private void sendOAuthHTTPRequest(String serviceName, String accessToken, String credentialToken, Response.Listener listener) {
RequestQueue queue = Volley.newRequestQueue(mContext);
String url = "http://" + getServerHostname() + ":" + getServerPort() + "/_oauth/" + serviceName + "/";
//as far a... | [
"private",
"void",
"sendOAuthHTTPRequest",
"(",
"String",
"serviceName",
",",
"String",
"accessToken",
",",
"String",
"credentialToken",
",",
"Response",
".",
"Listener",
"listener",
")",
"{",
"RequestQueue",
"queue",
"=",
"Volley",
".",
"newRequestQueue",
"(",
"m... | /*
Login with OAuth requires the priming of "pending credentials" on the server to receive a secret | [
"/",
"*",
"Login",
"with",
"OAuth",
"requires",
"the",
"priming",
"of",
"pending",
"credentials",
"on",
"the",
"server",
"to",
"receive",
"a",
"secret"
] | train | https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/DDPStateSingleton.java#L472-L499 |
mfornos/humanize | humanize-icu/src/main/java/humanize/ICUHumanize.java | ICUHumanize.parseNumber | public static Number parseNumber(final String text, final Locale locale) throws ParseException {
"""
<p>
Same as {@link #parseNumber(String) parseNumber} for the specified
locale.
</p>
@param text
String containing a spelled out number.
@param locale
Target locale
@return Text converted to Number
@throw... | java | public static Number parseNumber(final String text, final Locale locale) throws ParseException
{
return withinLocale(new Callable<Number>()
{
public Number call() throws Exception
{
return parseNumber(text);
}
}, locale);
} | [
"public",
"static",
"Number",
"parseNumber",
"(",
"final",
"String",
"text",
",",
"final",
"Locale",
"locale",
")",
"throws",
"ParseException",
"{",
"return",
"withinLocale",
"(",
"new",
"Callable",
"<",
"Number",
">",
"(",
")",
"{",
"public",
"Number",
"cal... | <p>
Same as {@link #parseNumber(String) parseNumber} for the specified
locale.
</p>
@param text
String containing a spelled out number.
@param locale
Target locale
@return Text converted to Number
@throws ParseException | [
"<p",
">",
"Same",
"as",
"{",
"@link",
"#parseNumber",
"(",
"String",
")",
"parseNumber",
"}",
"for",
"the",
"specified",
"locale",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-icu/src/main/java/humanize/ICUHumanize.java#L1476-L1485 |
aws/aws-sdk-java | aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java | ReceiveQueueBuffer.issueFuture | private ReceiveMessageFuture issueFuture(int size,
QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback) {
"""
Creates and returns a new future object. Sleeps if the list of already-issued but as yet
unsatisfied futures is over a throttle limit.
... | java | private ReceiveMessageFuture issueFuture(int size,
QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback) {
synchronized (futures) {
ReceiveMessageFuture theFuture = new ReceiveMessageFuture(callback, size);
futures.addLast... | [
"private",
"ReceiveMessageFuture",
"issueFuture",
"(",
"int",
"size",
",",
"QueueBufferCallback",
"<",
"ReceiveMessageRequest",
",",
"ReceiveMessageResult",
">",
"callback",
")",
"{",
"synchronized",
"(",
"futures",
")",
"{",
"ReceiveMessageFuture",
"theFuture",
"=",
... | Creates and returns a new future object. Sleeps if the list of already-issued but as yet
unsatisfied futures is over a throttle limit.
@return never null | [
"Creates",
"and",
"returns",
"a",
"new",
"future",
"object",
".",
"Sleeps",
"if",
"the",
"list",
"of",
"already",
"-",
"issued",
"but",
"as",
"yet",
"unsatisfied",
"futures",
"is",
"over",
"a",
"throttle",
"limit",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L161-L168 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/file/tfile/Utils.java | Utils.writeVLong | @SuppressWarnings("fallthrough")
public static void writeVLong(DataOutput out, long n) throws IOException {
"""
Encoding a Long integer into a variable-length encoding format.
<ul>
<li>if n in [-32, 127): encode in one byte with the actual value.
Otherwise,
<li>if n in [-20*2^8, 20*2^8): encode in two bytes:... | java | @SuppressWarnings("fallthrough")
public static void writeVLong(DataOutput out, long n) throws IOException {
if ((n < 128) && (n >= -32)) {
out.writeByte((int) n);
return;
}
long un = (n < 0) ? ~n : n;
// how many bytes do we need to represent the number with sign bit?
int len = (Long.... | [
"@",
"SuppressWarnings",
"(",
"\"fallthrough\"",
")",
"public",
"static",
"void",
"writeVLong",
"(",
"DataOutput",
"out",
",",
"long",
"n",
")",
"throws",
"IOException",
"{",
"if",
"(",
"(",
"n",
"<",
"128",
")",
"&&",
"(",
"n",
">=",
"-",
"32",
")",
... | Encoding a Long integer into a variable-length encoding format.
<ul>
<li>if n in [-32, 127): encode in one byte with the actual value.
Otherwise,
<li>if n in [-20*2^8, 20*2^8): encode in two bytes: byte[0] = n/256 - 52;
byte[1]=n&0xff. Otherwise,
<li>if n IN [-16*2^16, 16*2^16): encode in three bytes: byte[0]=n/2^16 -
... | [
"Encoding",
"a",
"Long",
"integer",
"into",
"a",
"variable",
"-",
"length",
"encoding",
"format",
".",
"<ul",
">",
"<li",
">",
"if",
"n",
"in",
"[",
"-",
"32",
"127",
")",
":",
"encode",
"in",
"one",
"byte",
"with",
"the",
"actual",
"value",
".",
"... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/file/tfile/Utils.java#L90-L154 |
ldapchai/ldapchai | src/main/java/com/novell/ldapchai/impl/edir/NmasCrFactory.java | NmasCrFactory.readAssignedChallengeSet | public static ChallengeSet readAssignedChallengeSet( final ChaiUser theUser )
throws ChaiUnavailableException, ChaiOperationException, ChaiValidationException {
"""
This method will first read the user's assigned password challenge set policy.
@param theUser ChaiUser to read policy for
@return A va... | java | public static ChallengeSet readAssignedChallengeSet( final ChaiUser theUser )
throws ChaiUnavailableException, ChaiOperationException, ChaiValidationException
{
return readAssignedChallengeSet( theUser, Locale.getDefault() );
} | [
"public",
"static",
"ChallengeSet",
"readAssignedChallengeSet",
"(",
"final",
"ChaiUser",
"theUser",
")",
"throws",
"ChaiUnavailableException",
",",
"ChaiOperationException",
",",
"ChaiValidationException",
"{",
"return",
"readAssignedChallengeSet",
"(",
"theUser",
",",
"Lo... | This method will first read the user's assigned password challenge set policy.
@param theUser ChaiUser to read policy for
@return A valid ChallengeSet if found, otherwise null.
@throws ChaiOperationException If there is an error during the operation
@throws ChaiUnavailableException If the directory server(s) are una... | [
"This",
"method",
"will",
"first",
"read",
"the",
"user",
"s",
"assigned",
"password",
"challenge",
"set",
"policy",
"."
] | train | https://github.com/ldapchai/ldapchai/blob/a6d4b5dbfa4e270db0ce70892512cbe39e64b874/src/main/java/com/novell/ldapchai/impl/edir/NmasCrFactory.java#L188-L192 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.getByResourceGroupAsync | public Observable<DataMigrationServiceInner> getByResourceGroupAsync(String groupName, String serviceName) {
"""
Get DMS Service Instance.
The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance.
@param groupName ... | java | public Observable<DataMigrationServiceInner> getByResourceGroupAsync(String groupName, String serviceName) {
return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).map(new Func1<ServiceResponse<DataMigrationServiceInner>, DataMigrationServiceInner>() {
@Override
public... | [
"public",
"Observable",
"<",
"DataMigrationServiceInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
")",
".",
"map",
"... | Get DMS Service Instance.
The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance.
@param groupName Name of the resource group
@param serviceName Name of the service
@throws IllegalArgumentException thrown if parameters f... | [
"Get",
"DMS",
"Service",
"Instance",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"The",
"GET",
"method",
"retrieves",
"information",
"about",
"a",
"service"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L371-L378 |
tvesalainen/util | vfs/src/main/java/org/vesalainen/vfs/VirtualFileChannel.java | VirtualFileChannel.tryLock | @Override
public FileLock tryLock(long position, long size, boolean shared) throws IOException {
"""
Returns always a lock. Locking virtual file makes no sense. Dummy
implementation is provided so that existing applications don't throw
exception.
@param position
@param size
@param shared
@return
@throw... | java | @Override
public FileLock tryLock(long position, long size, boolean shared) throws IOException
{
return new FileLockImpl(this, position, size, shared);
} | [
"@",
"Override",
"public",
"FileLock",
"tryLock",
"(",
"long",
"position",
",",
"long",
"size",
",",
"boolean",
"shared",
")",
"throws",
"IOException",
"{",
"return",
"new",
"FileLockImpl",
"(",
"this",
",",
"position",
",",
"size",
",",
"shared",
")",
";"... | Returns always a lock. Locking virtual file makes no sense. Dummy
implementation is provided so that existing applications don't throw
exception.
@param position
@param size
@param shared
@return
@throws IOException | [
"Returns",
"always",
"a",
"lock",
".",
"Locking",
"virtual",
"file",
"makes",
"no",
"sense",
".",
"Dummy",
"implementation",
"is",
"provided",
"so",
"that",
"existing",
"applications",
"don",
"t",
"throw",
"exception",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/vfs/src/main/java/org/vesalainen/vfs/VirtualFileChannel.java#L399-L403 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/ui/groupeditor/A_CmsGroupEditor.java | A_CmsGroupEditor.setSaveEnabled | protected void setSaveEnabled(boolean enabled, String disabledMessage) {
"""
Enables or disables the save button.<p>
@param enabled <code>true</code> to enable the save button
@param disabledMessage the message to display when the button is disabled
"""
if (m_saveButton != null) {
if (... | java | protected void setSaveEnabled(boolean enabled, String disabledMessage) {
if (m_saveButton != null) {
if (enabled) {
m_saveButton.enable();
} else {
m_saveButton.disable(disabledMessage);
}
}
} | [
"protected",
"void",
"setSaveEnabled",
"(",
"boolean",
"enabled",
",",
"String",
"disabledMessage",
")",
"{",
"if",
"(",
"m_saveButton",
"!=",
"null",
")",
"{",
"if",
"(",
"enabled",
")",
"{",
"m_saveButton",
".",
"enable",
"(",
")",
";",
"}",
"else",
"{... | Enables or disables the save button.<p>
@param enabled <code>true</code> to enable the save button
@param disabledMessage the message to display when the button is disabled | [
"Enables",
"or",
"disables",
"the",
"save",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/ui/groupeditor/A_CmsGroupEditor.java#L615-L624 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/htmlcleaner/XWikiDOMSerializer.java | XWikiDOMSerializer.createDOM | public Document createDOM(DocumentBuilder documentBuilder, TagNode rootNode) throws ParserConfigurationException {
"""
Create the DOM given a rootNode and a document builder.
This method is a replica of {@link DomSerializer#createDOM(TagNode)} excepts that it requires to give a
DocumentBuilder.
@param documentB... | java | public Document createDOM(DocumentBuilder documentBuilder, TagNode rootNode) throws ParserConfigurationException
{
Document document = createDocument(documentBuilder, rootNode);
createSubnodes(document, document.getDocumentElement(), rootNode.getAllChildren());
return document;
} | [
"public",
"Document",
"createDOM",
"(",
"DocumentBuilder",
"documentBuilder",
",",
"TagNode",
"rootNode",
")",
"throws",
"ParserConfigurationException",
"{",
"Document",
"document",
"=",
"createDocument",
"(",
"documentBuilder",
",",
"rootNode",
")",
";",
"createSubnode... | Create the DOM given a rootNode and a document builder.
This method is a replica of {@link DomSerializer#createDOM(TagNode)} excepts that it requires to give a
DocumentBuilder.
@param documentBuilder the {@link DocumentBuilder} instance to use, DocumentBuilder is not guaranteed to
be thread safe so at most the safe ins... | [
"Create",
"the",
"DOM",
"given",
"a",
"rootNode",
"and",
"a",
"document",
"builder",
".",
"This",
"method",
"is",
"a",
"replica",
"of",
"{"
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/htmlcleaner/XWikiDOMSerializer.java#L167-L174 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.executeSearchOperation | public static Response<SearchResult> executeSearchOperation(final ConnectionFactory connectionFactory,
final String baseDn,
final SearchFilter filter,
... | java | public static Response<SearchResult> executeSearchOperation(final ConnectionFactory connectionFactory,
final String baseDn,
final SearchFilter filter,
... | [
"public",
"static",
"Response",
"<",
"SearchResult",
">",
"executeSearchOperation",
"(",
"final",
"ConnectionFactory",
"connectionFactory",
",",
"final",
"String",
"baseDn",
",",
"final",
"SearchFilter",
"filter",
",",
"final",
"String",
"...",
"returnAttributes",
")"... | Execute search operation.
@param connectionFactory the connection factory
@param baseDn the base dn
@param filter the filter
@param returnAttributes the return attributes
@return the response
@throws LdapException the ldap exception | [
"Execute",
"search",
"operation",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L228-L233 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java | ParseUtils.duplicateNamedElement | public static XMLStreamException duplicateNamedElement(final XMLExtendedStreamReader reader, final String name) {
"""
Get an exception reporting that an element of a given type and name has
already been declared in this scope.
@param reader the stream reader
@param name the name that was redeclared
@return the... | java | public static XMLStreamException duplicateNamedElement(final XMLExtendedStreamReader reader, final String name) {
final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.duplicateNamedElement(name, reader.getLocation());
return new XMLStreamValidationException(ex.getMessage(),
... | [
"public",
"static",
"XMLStreamException",
"duplicateNamedElement",
"(",
"final",
"XMLExtendedStreamReader",
"reader",
",",
"final",
"String",
"name",
")",
"{",
"final",
"XMLStreamException",
"ex",
"=",
"ControllerLogger",
".",
"ROOT_LOGGER",
".",
"duplicateNamedElement",
... | Get an exception reporting that an element of a given type and name has
already been declared in this scope.
@param reader the stream reader
@param name the name that was redeclared
@return the exception | [
"Get",
"an",
"exception",
"reporting",
"that",
"an",
"element",
"of",
"a",
"given",
"type",
"and",
"name",
"has",
"already",
"been",
"declared",
"in",
"this",
"scope",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L364-L373 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/PayMchAPI.java | PayMchAPI.sandboxnewPayGetsignkey | public static SandboxSignkey sandboxnewPayGetsignkey(String mch_id,String key) {
"""
获取仿真测试验签秘钥
@param mch_id mch_id
@param key key
@return sandbox_signkey
@since 2.8.13
"""
MchBaseResult mchBaseResult = new MchBaseResult();
mchBaseResult.setMch_id(mch_id);
mchBaseResult.setNonce_str(UUID.randomUUID(... | java | public static SandboxSignkey sandboxnewPayGetsignkey(String mch_id,String key){
MchBaseResult mchBaseResult = new MchBaseResult();
mchBaseResult.setMch_id(mch_id);
mchBaseResult.setNonce_str(UUID.randomUUID().toString().replace("-", ""));
Map<String,String> map = MapUtil.objectToMap(mchBaseResult);
String sig... | [
"public",
"static",
"SandboxSignkey",
"sandboxnewPayGetsignkey",
"(",
"String",
"mch_id",
",",
"String",
"key",
")",
"{",
"MchBaseResult",
"mchBaseResult",
"=",
"new",
"MchBaseResult",
"(",
")",
";",
"mchBaseResult",
".",
"setMch_id",
"(",
"mch_id",
")",
";",
"m... | 获取仿真测试验签秘钥
@param mch_id mch_id
@param key key
@return sandbox_signkey
@since 2.8.13 | [
"获取仿真测试验签秘钥"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/PayMchAPI.java#L71-L85 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/QueryBuilder.java | QueryBuilder.leftJoin | public QueryBuilder<T, ID> leftJoin(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
"""
Similar to {@link #join(QueryBuilder)} but it will use "LEFT JOIN" instead.
See: <a href="http://www.w3schools.com/sql/sql_join_left.asp" >LEFT JOIN SQL docs</a>
<p>
<b>NOTE:</b> RIGHT and FULL JOIN SQL comm... | java | public QueryBuilder<T, ID> leftJoin(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
addJoinInfo(JoinType.LEFT, null, null, joinedQueryBuilder, JoinWhereOperation.AND);
return this;
} | [
"public",
"QueryBuilder",
"<",
"T",
",",
"ID",
">",
"leftJoin",
"(",
"QueryBuilder",
"<",
"?",
",",
"?",
">",
"joinedQueryBuilder",
")",
"throws",
"SQLException",
"{",
"addJoinInfo",
"(",
"JoinType",
".",
"LEFT",
",",
"null",
",",
"null",
",",
"joinedQuery... | Similar to {@link #join(QueryBuilder)} but it will use "LEFT JOIN" instead.
See: <a href="http://www.w3schools.com/sql/sql_join_left.asp" >LEFT JOIN SQL docs</a>
<p>
<b>NOTE:</b> RIGHT and FULL JOIN SQL commands are not supported because we are only returning objects from the
"left" table.
</p>
<p>
<b>NOTE:</b> This... | [
"Similar",
"to",
"{",
"@link",
"#join",
"(",
"QueryBuilder",
")",
"}",
"but",
"it",
"will",
"use",
"LEFT",
"JOIN",
"instead",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L327-L330 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/EntityManagerFactoryImpl.java | EntityManagerFactoryImpl.createEntityManager | @Override
public final EntityManager createEntityManager(Map map) {
"""
Create a new application-managed EntityManager with the specified Map of
properties. This method returns a new EntityManager instance each time it
is invoked. The isOpen method will return true on the returned instance.
@param map
p... | java | @Override
public final EntityManager createEntityManager(Map map)
{
// For Application managed persistence context, type is always EXTENDED
if (isOpen())
{
return new EntityManagerImpl(this, map, transactionType, PersistenceContextType.EXTENDED);
}
thr... | [
"@",
"Override",
"public",
"final",
"EntityManager",
"createEntityManager",
"(",
"Map",
"map",
")",
"{",
"// For Application managed persistence context, type is always EXTENDED\r",
"if",
"(",
"isOpen",
"(",
")",
")",
"{",
"return",
"new",
"EntityManagerImpl",
"(",
"thi... | Create a new application-managed EntityManager with the specified Map of
properties. This method returns a new EntityManager instance each time it
is invoked. The isOpen method will return true on the returned instance.
@param map
properties for entity manager
@return entity manager instance
@throws IllegalStateExcept... | [
"Create",
"a",
"new",
"application",
"-",
"managed",
"EntityManager",
"with",
"the",
"specified",
"Map",
"of",
"properties",
".",
"This",
"method",
"returns",
"a",
"new",
"EntityManager",
"instance",
"each",
"time",
"it",
"is",
"invoked",
".",
"The",
"isOpen",... | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/EntityManagerFactoryImpl.java#L266-L275 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setByte | public static void setByte(MemorySegment[] segments, int offset, byte value) {
"""
set byte from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 1)) {
segments[0].put(offset, value);
} else {
setByteMultiSegments(segments, offset, va... | java | public static void setByte(MemorySegment[] segments, int offset, byte value) {
if (inFirstSegment(segments, offset, 1)) {
segments[0].put(offset, value);
} else {
setByteMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setByte",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"byte",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"1",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set byte from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"byte",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L597-L603 |
roboconf/roboconf-platform | core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java | DockerMachineConfigurator.createImage | void createImage( String imageId ) throws TargetException {
"""
Creates an image.
@param imageId the image ID
@throws TargetException if something went wrong
"""
// If there is no Dockerfile, this method will do nothing
File targetDirectory = this.parameters.getTargetPropertiesDirectory();
String dock... | java | void createImage( String imageId ) throws TargetException {
// If there is no Dockerfile, this method will do nothing
File targetDirectory = this.parameters.getTargetPropertiesDirectory();
String dockerFilePath = this.parameters.getTargetProperties().get( GENERATE_IMAGE_FROM );
if( ! Utils.isEmptyOrWhitespaces... | [
"void",
"createImage",
"(",
"String",
"imageId",
")",
"throws",
"TargetException",
"{",
"// If there is no Dockerfile, this method will do nothing",
"File",
"targetDirectory",
"=",
"this",
".",
"parameters",
".",
"getTargetPropertiesDirectory",
"(",
")",
";",
"String",
"d... | Creates an image.
@param imageId the image ID
@throws TargetException if something went wrong | [
"Creates",
"an",
"image",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java#L260-L294 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/trait/Traits.java | Traits.collectSelfTypes | public static LinkedHashSet<ClassNode> collectSelfTypes(
ClassNode receiver,
LinkedHashSet<ClassNode> selfTypes) {
"""
Collects all the self types that a type should extend or implement, given
the traits is implements. Collects from interfaces and superclasses too.
@param receiver a class... | java | public static LinkedHashSet<ClassNode> collectSelfTypes(
ClassNode receiver,
LinkedHashSet<ClassNode> selfTypes) {
return collectSelfTypes(receiver, selfTypes, true, true);
} | [
"public",
"static",
"LinkedHashSet",
"<",
"ClassNode",
">",
"collectSelfTypes",
"(",
"ClassNode",
"receiver",
",",
"LinkedHashSet",
"<",
"ClassNode",
">",
"selfTypes",
")",
"{",
"return",
"collectSelfTypes",
"(",
"receiver",
",",
"selfTypes",
",",
"true",
",",
"... | Collects all the self types that a type should extend or implement, given
the traits is implements. Collects from interfaces and superclasses too.
@param receiver a class node that may implement a trait
@param selfTypes a collection where the list of self types will be written
@return the selfTypes collection itself
@s... | [
"Collects",
"all",
"the",
"self",
"types",
"that",
"a",
"type",
"should",
"extend",
"or",
"implement",
"given",
"the",
"traits",
"is",
"implements",
".",
"Collects",
"from",
"interfaces",
"and",
"superclasses",
"too",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/trait/Traits.java#L308-L312 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/AdapterUtil.java | AdapterUtil.createXAException | public static XAException createXAException(String key, Object args, int xaErrorCode) {
"""
Create an XAException with a translated error message and an XA error code.
The XAException constructors provided by the XAException API allow only for either an
error message or an XA error code to be specified. This met... | java | public static XAException createXAException(String key, Object args, int xaErrorCode) {
XAException xaX = new XAException(
args == null ?
getNLSMessage(key) :
getNLSMessage(key, args));
xaX.errorCode... | [
"public",
"static",
"XAException",
"createXAException",
"(",
"String",
"key",
",",
"Object",
"args",
",",
"int",
"xaErrorCode",
")",
"{",
"XAException",
"xaX",
"=",
"new",
"XAException",
"(",
"args",
"==",
"null",
"?",
"getNLSMessage",
"(",
"key",
")",
":",
... | Create an XAException with a translated error message and an XA error code.
The XAException constructors provided by the XAException API allow only for either an
error message or an XA error code to be specified. This method constructs an
XAException with both. The error message is created from the NLS key and argument... | [
"Create",
"an",
"XAException",
"with",
"a",
"translated",
"error",
"message",
"and",
"an",
"XA",
"error",
"code",
".",
"The",
"XAException",
"constructors",
"provided",
"by",
"the",
"XAException",
"API",
"allow",
"only",
"for",
"either",
"an",
"error",
"messag... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/AdapterUtil.java#L142-L151 |
kamcpp/avicenna | src/avicenna/src/main/java/org/labcrypto/avicenna/Avicenna.java | Avicenna.get | public static <T> T get(Class<T> clazz, Collection<String> qualifiers) {
"""
Retrieves a stored dependnecy using class object and qualifiers.
@param clazz Class type which its related dependency reference should be retrieved.
@param qualifiers List of qualifiers to distinguish between similar types.
"... | java | public static <T> T get(Class<T> clazz, Collection<String> qualifiers) {
SortedSet<String> qs = new TreeSet<String>();
if (qualifiers != null) {
qs.addAll(qualifiers);
}
return dependencyContainer.get(DependencyIdentifier.getDependencyIdentifierForClass(clazz, qs));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"get",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Collection",
"<",
"String",
">",
"qualifiers",
")",
"{",
"SortedSet",
"<",
"String",
">",
"qs",
"=",
"new",
"TreeSet",
"<",
"String",
">",
"(",
")",
";",
"... | Retrieves a stored dependnecy using class object and qualifiers.
@param clazz Class type which its related dependency reference should be retrieved.
@param qualifiers List of qualifiers to distinguish between similar types. | [
"Retrieves",
"a",
"stored",
"dependnecy",
"using",
"class",
"object",
"and",
"qualifiers",
"."
] | train | https://github.com/kamcpp/avicenna/blob/0fc4eff447761140cd3799287427d99c63ea6e6e/src/avicenna/src/main/java/org/labcrypto/avicenna/Avicenna.java#L181-L187 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/IdGenerator.java | IdGenerator.onAutoGenerator | private Object onAutoGenerator(EntityMetadata m, Client<?> client, Object e) {
"""
Generate Id when given auto generation strategy.
@param m
@param client
@param e
@param kunderaMetadata
"""
Object autogenerator = getAutoGenClazz(client);
if (autogenerator instanceof AutoGenerato... | java | private Object onAutoGenerator(EntityMetadata m, Client<?> client, Object e)
{
Object autogenerator = getAutoGenClazz(client);
if (autogenerator instanceof AutoGenerator)
{
Object generatedId = ((AutoGenerator)autogenerator).generate(client, m.getIdAttribute... | [
"private",
"Object",
"onAutoGenerator",
"(",
"EntityMetadata",
"m",
",",
"Client",
"<",
"?",
">",
"client",
",",
"Object",
"e",
")",
"{",
"Object",
"autogenerator",
"=",
"getAutoGenClazz",
"(",
"client",
")",
";",
"if",
"(",
"autogenerator",
"instanceof",
"A... | Generate Id when given auto generation strategy.
@param m
@param client
@param e
@param kunderaMetadata | [
"Generate",
"Id",
"when",
"given",
"auto",
"generation",
"strategy",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/IdGenerator.java#L109-L132 |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/support/LdapUtils.java | LdapUtils.removeFirst | public static LdapName removeFirst(Name dn, Name pathToRemove) {
"""
Remove the supplied path from the beginning the specified
<code>Name</code> if the name instance starts with
<code>path</code>. Useful for stripping base path suffix from a
<code>Name</code>. The original Name will not be affected.
@param d... | java | public static LdapName removeFirst(Name dn, Name pathToRemove) {
Assert.notNull(dn, "dn must not be null");
Assert.notNull(pathToRemove, "pathToRemove must not be null");
LdapName result = newLdapName(dn);
LdapName path = returnOrConstructLdapNameFromName(pathToRemove);
if(path... | [
"public",
"static",
"LdapName",
"removeFirst",
"(",
"Name",
"dn",
",",
"Name",
"pathToRemove",
")",
"{",
"Assert",
".",
"notNull",
"(",
"dn",
",",
"\"dn must not be null\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"pathToRemove",
",",
"\"pathToRemove must not b... | Remove the supplied path from the beginning the specified
<code>Name</code> if the name instance starts with
<code>path</code>. Useful for stripping base path suffix from a
<code>Name</code>. The original Name will not be affected.
@param dn the dn to strip from.
@param pathToRemove the path to remove from the beginni... | [
"Remove",
"the",
"supplied",
"path",
"from",
"the",
"beginning",
"the",
"specified",
"<code",
">",
"Name<",
"/",
"code",
">",
"if",
"the",
"name",
"instance",
"starts",
"with",
"<code",
">",
"path<",
"/",
"code",
">",
".",
"Useful",
"for",
"stripping",
"... | train | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/support/LdapUtils.java#L441-L461 |
seedstack/i18n-addon | core/src/main/java/org/seedstack/i18n/internal/domain/model/key/Key.java | Key.addTranslation | public Translation addTranslation(String locale, String value) {
"""
Saves or updates the translation for the specified locale.
If the key was outdated, checks if the key is still outdated.
@param locale specified the translation locale
@param value translation value
@return the new translation
@throws jav... | java | public Translation addTranslation(String locale, String value) {
return addTranslation(locale, value, false);
} | [
"public",
"Translation",
"addTranslation",
"(",
"String",
"locale",
",",
"String",
"value",
")",
"{",
"return",
"addTranslation",
"(",
"locale",
",",
"value",
",",
"false",
")",
";",
"}"
] | Saves or updates the translation for the specified locale.
If the key was outdated, checks if the key is still outdated.
@param locale specified the translation locale
@param value translation value
@return the new translation
@throws java.lang.IllegalArgumentException if the locale is null or empty
or contains other... | [
"Saves",
"or",
"updates",
"the",
"translation",
"for",
"the",
"specified",
"locale",
".",
"If",
"the",
"key",
"was",
"outdated",
"checks",
"if",
"the",
"key",
"is",
"still",
"outdated",
"."
] | train | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/core/src/main/java/org/seedstack/i18n/internal/domain/model/key/Key.java#L70-L72 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/access/AuthorizationResult.java | AuthorizationResult.failIfDenied | public void failIfDenied(ModelNode operation, PathAddress targetAddress) throws OperationFailedException {
"""
Utility method to throw a standard failure if {@link #getDecision()} is
{@link org.jboss.as.controller.access.AuthorizationResult.Decision#DENY}.
@param operation the operation the triggered this auth... | java | public void failIfDenied(ModelNode operation, PathAddress targetAddress) throws OperationFailedException {
if (decision == AuthorizationResult.Decision.DENY) {
throw ControllerLogger.ACCESS_LOGGER.unauthorized(operation.get(OP).asString(),
targetAddress, explanation);
}
... | [
"public",
"void",
"failIfDenied",
"(",
"ModelNode",
"operation",
",",
"PathAddress",
"targetAddress",
")",
"throws",
"OperationFailedException",
"{",
"if",
"(",
"decision",
"==",
"AuthorizationResult",
".",
"Decision",
".",
"DENY",
")",
"{",
"throw",
"ControllerLogg... | Utility method to throw a standard failure if {@link #getDecision()} is
{@link org.jboss.as.controller.access.AuthorizationResult.Decision#DENY}.
@param operation the operation the triggered this authorization result. Cannot be {@code null}
@param targetAddress the target address of the request that triggered this aut... | [
"Utility",
"method",
"to",
"throw",
"a",
"standard",
"failure",
"if",
"{",
"@link",
"#getDecision",
"()",
"}",
"is",
"{",
"@link",
"org",
".",
"jboss",
".",
"as",
".",
"controller",
".",
"access",
".",
"AuthorizationResult",
".",
"Decision#DENY",
"}",
"."
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/access/AuthorizationResult.java#L119-L125 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java | MockHttpServletRequest.setCookie | public void setCookie(final String name, final String value) {
"""
Sets a cookie on this request instance.
@param name The cookie name.
@param value The value of the cookie to set.
"""
if (name != null) {
Cookie cookie = new Cookie(name, value);
cookies.put(name, cookie);
}
} | java | public void setCookie(final String name, final String value) {
if (name != null) {
Cookie cookie = new Cookie(name, value);
cookies.put(name, cookie);
}
} | [
"public",
"void",
"setCookie",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"name",
",",
"value",
")",
";",
"cookies",
".",
"put",... | Sets a cookie on this request instance.
@param name The cookie name.
@param value The value of the cookie to set. | [
"Sets",
"a",
"cookie",
"on",
"this",
"request",
"instance",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java#L94-L99 |
amaembo/streamex | src/main/java/one/util/streamex/AbstractStreamEx.java | AbstractStreamEx.toListAndThen | public <R> R toListAndThen(Function<? super List<T>, R> finisher) {
"""
Creates a {@link List} containing the elements of this stream, then
performs finishing transformation and returns its result. There are no
guarantees on the type, serializability or thread-safety of the
{@code List} created.
<p>
This is... | java | public <R> R toListAndThen(Function<? super List<T>, R> finisher) {
if (context.fjp != null)
return context.terminate(() -> finisher.apply(toList()));
return finisher.apply(toList());
} | [
"public",
"<",
"R",
">",
"R",
"toListAndThen",
"(",
"Function",
"<",
"?",
"super",
"List",
"<",
"T",
">",
",",
"R",
">",
"finisher",
")",
"{",
"if",
"(",
"context",
".",
"fjp",
"!=",
"null",
")",
"return",
"context",
".",
"terminate",
"(",
"(",
"... | Creates a {@link List} containing the elements of this stream, then
performs finishing transformation and returns its result. There are no
guarantees on the type, serializability or thread-safety of the
{@code List} created.
<p>
This is a terminal operation.
@param <R> the type of the result
@param finisher a functio... | [
"Creates",
"a",
"{",
"@link",
"List",
"}",
"containing",
"the",
"elements",
"of",
"this",
"stream",
"then",
"performs",
"finishing",
"transformation",
"and",
"returns",
"its",
"result",
".",
"There",
"are",
"no",
"guarantees",
"on",
"the",
"type",
"serializabi... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/AbstractStreamEx.java#L1231-L1235 |
joniles/mpxj | src/main/java/net/sf/mpxj/common/InputStreamHelper.java | InputStreamHelper.processZipStream | private static void processZipStream(File dir, InputStream inputStream) throws IOException {
"""
Expands a zip file input stream into a temporary directory.
@param dir temporary directory
@param inputStream zip file input stream
"""
ZipInputStream zip = new ZipInputStream(inputStream);
while (t... | java | private static void processZipStream(File dir, InputStream inputStream) throws IOException
{
ZipInputStream zip = new ZipInputStream(inputStream);
while (true)
{
ZipEntry entry = zip.getNextEntry();
if (entry == null)
{
break;
}
File file = ... | [
"private",
"static",
"void",
"processZipStream",
"(",
"File",
"dir",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"ZipInputStream",
"zip",
"=",
"new",
"ZipInputStream",
"(",
"inputStream",
")",
";",
"while",
"(",
"true",
")",
"{",
"Zip... | Expands a zip file input stream into a temporary directory.
@param dir temporary directory
@param inputStream zip file input stream | [
"Expands",
"a",
"zip",
"file",
"input",
"stream",
"into",
"a",
"temporary",
"directory",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/InputStreamHelper.java#L115-L148 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.generateSecuredApiKey | @Deprecated
public String generateSecuredApiKey(String privateApiKey, String tagFilters) throws NoSuchAlgorithmException, InvalidKeyException {
"""
Generate a secured and public API Key from a list of tagFilters and an
optional user token identifying the current user
@param privateApiKey your private API Key... | java | @Deprecated
public String generateSecuredApiKey(String privateApiKey, String tagFilters) throws NoSuchAlgorithmException, InvalidKeyException {
if (!tagFilters.contains("="))
return generateSecuredApiKey(privateApiKey, new Query().setTagFilters(tagFilters), null);
else {
return Base64.encodeBase64... | [
"@",
"Deprecated",
"public",
"String",
"generateSecuredApiKey",
"(",
"String",
"privateApiKey",
",",
"String",
"tagFilters",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"if",
"(",
"!",
"tagFilters",
".",
"contains",
"(",
"\"=\"",
")",... | Generate a secured and public API Key from a list of tagFilters and an
optional user token identifying the current user
@param privateApiKey your private API Key
@param tagFilters the list of tags applied to the query (used as security)
@deprecated Use `generateSecuredApiKey(String privateApiKey, Query query)` vers... | [
"Generate",
"a",
"secured",
"and",
"public",
"API",
"Key",
"from",
"a",
"list",
"of",
"tagFilters",
"and",
"an",
"optional",
"user",
"token",
"identifying",
"the",
"current",
"user"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L977-L984 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.toDate | public Date toDate(Element el, String attributeName, Date defaultValue) {
"""
reads a XML Element Attribute ans cast it to a Date
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@param defaultValue if attribute doesn't exist return default value
@return Attr... | java | public Date toDate(Element el, String attributeName, Date defaultValue) {
return new DateImpl(toDateTime(el, attributeName, defaultValue));
} | [
"public",
"Date",
"toDate",
"(",
"Element",
"el",
",",
"String",
"attributeName",
",",
"Date",
"defaultValue",
")",
"{",
"return",
"new",
"DateImpl",
"(",
"toDateTime",
"(",
"el",
",",
"attributeName",
",",
"defaultValue",
")",
")",
";",
"}"
] | reads a XML Element Attribute ans cast it to a Date
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@param defaultValue if attribute doesn't exist return default value
@return Attribute Value | [
"reads",
"a",
"XML",
"Element",
"Attribute",
"ans",
"cast",
"it",
"to",
"a",
"Date"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L287-L289 |
fabric8io/fabric8-forge | addons/utils/src/main/java/io/fabric8/forge/addon/utils/CommandHelpers.java | CommandHelpers.setInitialComponentValue | public static <T> void setInitialComponentValue(UIInput<T> inputComponent, T value) {
"""
If the initial value is not blank lets set the value on the underlying component
"""
if (value != null) {
inputComponent.setValue(value);
}
} | java | public static <T> void setInitialComponentValue(UIInput<T> inputComponent, T value) {
if (value != null) {
inputComponent.setValue(value);
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"setInitialComponentValue",
"(",
"UIInput",
"<",
"T",
">",
"inputComponent",
",",
"T",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"inputComponent",
".",
"setValue",
"(",
"value",
")",
";",
... | If the initial value is not blank lets set the value on the underlying component | [
"If",
"the",
"initial",
"value",
"is",
"not",
"blank",
"lets",
"set",
"the",
"value",
"on",
"the",
"underlying",
"component"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/CommandHelpers.java#L74-L78 |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/Generators.java | Generators.byYearDayGenerator | static Generator byYearDayGenerator(int[] yearDays, final DateValue dtStart) {
"""
constructs a day generator that generates dates in the current month that
fall on one of the given days of the year.
@param yearDays elements in [-366,366] != 0
"""
final int[] uYearDays = Util.uniquify(yearDays);
... | java | static Generator byYearDayGenerator(int[] yearDays, final DateValue dtStart) {
final int[] uYearDays = Util.uniquify(yearDays);
return new Generator() {
int year = dtStart.year();
int month = dtStart.month();
int[] dates;
int i = 0;
{
... | [
"static",
"Generator",
"byYearDayGenerator",
"(",
"int",
"[",
"]",
"yearDays",
",",
"final",
"DateValue",
"dtStart",
")",
"{",
"final",
"int",
"[",
"]",
"uYearDays",
"=",
"Util",
".",
"uniquify",
"(",
"yearDays",
")",
";",
"return",
"new",
"Generator",
"("... | constructs a day generator that generates dates in the current month that
fall on one of the given days of the year.
@param yearDays elements in [-366,366] != 0 | [
"constructs",
"a",
"day",
"generator",
"that",
"generates",
"dates",
"in",
"the",
"current",
"month",
"that",
"fall",
"on",
"one",
"of",
"the",
"given",
"days",
"of",
"the",
"year",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/Generators.java#L993-L1047 |
Azure/azure-sdk-for-java | mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ConfigurationsInner.java | ConfigurationsInner.beginCreateOrUpdate | public ConfigurationInner beginCreateOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) {
"""
Updates a configuration of a server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Az... | java | public ConfigurationInner beginCreateOrUpdate(String resourceGroupName, String serverName, String configurationName, ConfigurationInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, configurationName, parameters).toBlocking().single().body();
} | [
"public",
"ConfigurationInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"configurationName",
",",
"ConfigurationInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resour... | Updates a configuration of a server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param configurationName The name of the server configuration.
@param parameter... | [
"Updates",
"a",
"configuration",
"of",
"a",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ConfigurationsInner.java#L172-L174 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java | BaseNDArrayFactory.arange | @Override
public INDArray arange(double begin, double end, double step) {
"""
Array of evenly spaced values.
@param begin the begin of the range
@param end the end of the range
@return the range vector
"""
return Nd4j.create(ArrayUtil.toDoubles(ArrayUtil.range((int) begin, (int) end, (int)s... | java | @Override
public INDArray arange(double begin, double end, double step) {
return Nd4j.create(ArrayUtil.toDoubles(ArrayUtil.range((int) begin, (int) end, (int)step)));
} | [
"@",
"Override",
"public",
"INDArray",
"arange",
"(",
"double",
"begin",
",",
"double",
"end",
",",
"double",
"step",
")",
"{",
"return",
"Nd4j",
".",
"create",
"(",
"ArrayUtil",
".",
"toDoubles",
"(",
"ArrayUtil",
".",
"range",
"(",
"(",
"int",
")",
"... | Array of evenly spaced values.
@param begin the begin of the range
@param end the end of the range
@return the range vector | [
"Array",
"of",
"evenly",
"spaced",
"values",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java#L350-L353 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzleDataSource.java | DrizzleDataSource.getConnection | public Connection getConnection() throws SQLException {
"""
<p>Attempts to establish a connection with the data source that this <code>DataSource</code> object represents.
@return a connection to the data source
@throws java.sql.SQLException if a database access error occurs
"""
try {
r... | java | public Connection getConnection() throws SQLException {
try {
return new DrizzleConnection(new MySQLProtocol(hostname, port, database, null, null, new Properties()),
new DrizzleQueryFactory());
} catch (QueryException e) {
throw SQLExceptionMapper.get(e);
... | [
"public",
"Connection",
"getConnection",
"(",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"return",
"new",
"DrizzleConnection",
"(",
"new",
"MySQLProtocol",
"(",
"hostname",
",",
"port",
",",
"database",
",",
"null",
",",
"null",
",",
"new",
"Properties",
... | <p>Attempts to establish a connection with the data source that this <code>DataSource</code> object represents.
@return a connection to the data source
@throws java.sql.SQLException if a database access error occurs | [
"<p",
">",
"Attempts",
"to",
"establish",
"a",
"connection",
"with",
"the",
"data",
"source",
"that",
"this",
"<code",
">",
"DataSource<",
"/",
"code",
">",
"object",
"represents",
"."
] | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleDataSource.java#L60-L67 |
primefaces/primefaces | src/main/java/org/primefaces/util/LocaleUtils.java | LocaleUtils.resolveLocale | public static Locale resolveLocale(Object locale, String clientId) {
"""
Gets a {@link Locale} instance by the value of the component attribute "locale" which can be String or {@link Locale} or null.
<p>
If NULL is passed the view root default locale is used.
@param locale given locale
@return resolved Local... | java | public static Locale resolveLocale(Object locale, String clientId) {
Locale result = null;
if (locale != null) {
if (locale instanceof String) {
result = toLocale((String) locale);
}
else if (locale instanceof java.util.Locale) {
resul... | [
"public",
"static",
"Locale",
"resolveLocale",
"(",
"Object",
"locale",
",",
"String",
"clientId",
")",
"{",
"Locale",
"result",
"=",
"null",
";",
"if",
"(",
"locale",
"!=",
"null",
")",
"{",
"if",
"(",
"locale",
"instanceof",
"String",
")",
"{",
"result... | Gets a {@link Locale} instance by the value of the component attribute "locale" which can be String or {@link Locale} or null.
<p>
If NULL is passed the view root default locale is used.
@param locale given locale
@return resolved Locale | [
"Gets",
"a",
"{",
"@link",
"Locale",
"}",
"instance",
"by",
"the",
"value",
"of",
"the",
"component",
"attribute",
"locale",
"which",
"can",
"be",
"String",
"or",
"{",
"@link",
"Locale",
"}",
"or",
"null",
".",
"<p",
">",
"If",
"NULL",
"is",
"passed",
... | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/util/LocaleUtils.java#L86-L106 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.isDirectory | public static boolean isDirectory(Path path, boolean isFollowLinks) {
"""
判断是否为目录,如果file为null,则返回false
@param path {@link Path}
@param isFollowLinks 是否追踪到软链对应的真实地址
@return 如果为目录true
@since 3.1.0
"""
if (null == path) {
return false;
}
final LinkOption[] options = isFollowLinks ? new LinkOpti... | java | public static boolean isDirectory(Path path, boolean isFollowLinks) {
if (null == path) {
return false;
}
final LinkOption[] options = isFollowLinks ? new LinkOption[0] : new LinkOption[] { LinkOption.NOFOLLOW_LINKS };
return Files.isDirectory(path, options);
} | [
"public",
"static",
"boolean",
"isDirectory",
"(",
"Path",
"path",
",",
"boolean",
"isFollowLinks",
")",
"{",
"if",
"(",
"null",
"==",
"path",
")",
"{",
"return",
"false",
";",
"}",
"final",
"LinkOption",
"[",
"]",
"options",
"=",
"isFollowLinks",
"?",
"... | 判断是否为目录,如果file为null,则返回false
@param path {@link Path}
@param isFollowLinks 是否追踪到软链对应的真实地址
@return 如果为目录true
@since 3.1.0 | [
"判断是否为目录,如果file为null,则返回false"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1257-L1263 |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/util/TextureAtlas.java | TextureAtlas.addTexture | public void addTexture(String name, InputStream input) throws TextureTooBigException, IOException {
"""
Adds the provided texture from the {@link java.io.InputStream} into this {@link TextureAtlas}.
@param name The name of this {@link Texture}
@param input The {@link java.io.InputStream} of the texture
@throw... | java | public void addTexture(String name, InputStream input) throws TextureTooBigException, IOException {
addTexture(name, ImageIO.read(input));
input.close();
} | [
"public",
"void",
"addTexture",
"(",
"String",
"name",
",",
"InputStream",
"input",
")",
"throws",
"TextureTooBigException",
",",
"IOException",
"{",
"addTexture",
"(",
"name",
",",
"ImageIO",
".",
"read",
"(",
"input",
")",
")",
";",
"input",
".",
"close",
... | Adds the provided texture from the {@link java.io.InputStream} into this {@link TextureAtlas}.
@param name The name of this {@link Texture}
@param input The {@link java.io.InputStream} of the texture
@throws com.flowpowered.caustic.api.util.TextureAtlas.TextureTooBigException
@throws java.io.IOException | [
"Adds",
"the",
"provided",
"texture",
"from",
"the",
"{",
"@link",
"java",
".",
"io",
".",
"InputStream",
"}",
"into",
"this",
"{",
"@link",
"TextureAtlas",
"}",
"."
] | train | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/TextureAtlas.java#L78-L81 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/chatroom/ChatRoomClient.java | ChatRoomClient.getChatRoomMembers | public ChatRoomMemberList getChatRoomMembers(long roomId, int start, int count)
throws APIConnectionException, APIRequestException {
"""
Get all member info of chat room
@param roomId chat room id
@param start start index
@param count member count
@return {@link ChatRoomMemberList}
@throws APIC... | java | public ChatRoomMemberList getChatRoomMembers(long roomId, int start, int count)
throws APIConnectionException, APIRequestException {
Preconditions.checkArgument(roomId > 0, "room id is invalid");
Preconditions.checkArgument(start >= 0 && count > 0, "Illegal argument");
ResponseWrappe... | [
"public",
"ChatRoomMemberList",
"getChatRoomMembers",
"(",
"long",
"roomId",
",",
"int",
"start",
",",
"int",
"count",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"roomId",
">",
"0",
",",
"\... | Get all member info of chat room
@param roomId chat room id
@param start start index
@param count member count
@return {@link ChatRoomMemberList}
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Get",
"all",
"member",
"info",
"of",
"chat",
"room"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/chatroom/ChatRoomClient.java#L172-L179 |
ops4j/org.ops4j.pax.web | pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/util/ServicePropertiesUtils.java | ServicePropertiesUtils.getIntegerProperty | public static Integer getIntegerProperty(final ServiceReference<?> serviceReference, final String key) {
"""
Returns a property as Integer.
@param serviceReference service reference; cannot be null
@param key property key; cannot be null
@return property value; null if property is not set or prop... | java | public static Integer getIntegerProperty(final ServiceReference<?> serviceReference, final String key) {
NullArgumentException.validateNotNull(serviceReference, "Service reference");
NullArgumentException.validateNotEmpty(key, true, "Property key");
final Object value = serviceReference.getProperty(key);
if... | [
"public",
"static",
"Integer",
"getIntegerProperty",
"(",
"final",
"ServiceReference",
"<",
"?",
">",
"serviceReference",
",",
"final",
"String",
"key",
")",
"{",
"NullArgumentException",
".",
"validateNotNull",
"(",
"serviceReference",
",",
"\"Service reference\"",
"... | Returns a property as Integer.
@param serviceReference service reference; cannot be null
@param key property key; cannot be null
@return property value; null if property is not set or property value is
not an Integer
@throws NullArgumentException - If service reference is null - If key is null | [
"Returns",
"a",
"property",
"as",
"Integer",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/util/ServicePropertiesUtils.java#L93-L110 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/ResourceLoader.java | ResourceLoader.await | public synchronized void await() {
"""
Wait for load to finish. Can be called only if {@link #start()} were performed somewhere before.
@throws LionEngineException If loading skipped or loader has not been started.
"""
if (!started.get())
{
throw new LionEngineException(ERROR_... | java | public synchronized void await()
{
if (!started.get())
{
throw new LionEngineException(ERROR_NOT_STARTED);
}
try
{
thread.join();
}
catch (final InterruptedException exception)
{
Thread.currentThread().in... | [
"public",
"synchronized",
"void",
"await",
"(",
")",
"{",
"if",
"(",
"!",
"started",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"LionEngineException",
"(",
"ERROR_NOT_STARTED",
")",
";",
"}",
"try",
"{",
"thread",
".",
"join",
"(",
")",
";",
"}"... | Wait for load to finish. Can be called only if {@link #start()} were performed somewhere before.
@throws LionEngineException If loading skipped or loader has not been started. | [
"Wait",
"for",
"load",
"to",
"finish",
".",
"Can",
"be",
"called",
"only",
"if",
"{",
"@link",
"#start",
"()",
"}",
"were",
"performed",
"somewhere",
"before",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/ResourceLoader.java#L107-L126 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/MessageAPI.java | MessageAPI.messageCustomSend | public static BaseResult messageCustomSend(String access_token, Message message) {
"""
消息发送
@param access_token access_token
@param message message
@return BaseResult
"""
String str = JsonUtil.toJSONString(message);
return messageCustomSend(access_token, str);
} | java | public static BaseResult messageCustomSend(String access_token, Message message) {
String str = JsonUtil.toJSONString(message);
return messageCustomSend(access_token, str);
} | [
"public",
"static",
"BaseResult",
"messageCustomSend",
"(",
"String",
"access_token",
",",
"Message",
"message",
")",
"{",
"String",
"str",
"=",
"JsonUtil",
".",
"toJSONString",
"(",
"message",
")",
";",
"return",
"messageCustomSend",
"(",
"access_token",
",",
"... | 消息发送
@param access_token access_token
@param message message
@return BaseResult | [
"消息发送"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MessageAPI.java#L68-L71 |
samskivert/pythagoras | src/main/java/pythagoras/d/Matrix4.java | Matrix4.setTranslation | public Matrix4 setTranslation (double x, double y, double z) {
"""
Sets the translation component of this matrix.
@return a reference to this matrix, for chaining.
"""
m30 = x;
m31 = y;
m32 = z;
return this;
} | java | public Matrix4 setTranslation (double x, double y, double z) {
m30 = x;
m31 = y;
m32 = z;
return this;
} | [
"public",
"Matrix4",
"setTranslation",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"m30",
"=",
"x",
";",
"m31",
"=",
"y",
";",
"m32",
"=",
"z",
";",
"return",
"this",
";",
"}"
] | Sets the translation component of this matrix.
@return a reference to this matrix, for chaining. | [
"Sets",
"the",
"translation",
"component",
"of",
"this",
"matrix",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Matrix4.java#L169-L174 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/config/WebClientConfigurer.java | WebClientConfigurer.hypermediaExchangeStrategies | public ExchangeStrategies hypermediaExchangeStrategies() {
"""
Return a set of {@link ExchangeStrategies} driven by registered {@link HypermediaType}s.
@return a collection of {@link Encoder}s and {@link Decoder} assembled into a {@link ExchangeStrategies}.
"""
List<Encoder<?>> encoders = new ArrayList<>... | java | public ExchangeStrategies hypermediaExchangeStrategies() {
List<Encoder<?>> encoders = new ArrayList<>();
List<Decoder<?>> decoders = new ArrayList<>();
this.hypermediaTypes.forEach(hypermedia -> {
ObjectMapper objectMapper = hypermedia.configureObjectMapper(this.mapper.copy());
MimeType[] mimeTypes = hy... | [
"public",
"ExchangeStrategies",
"hypermediaExchangeStrategies",
"(",
")",
"{",
"List",
"<",
"Encoder",
"<",
"?",
">",
">",
"encoders",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"Decoder",
"<",
"?",
">",
">",
"decoders",
"=",
"new",
"Arra... | Return a set of {@link ExchangeStrategies} driven by registered {@link HypermediaType}s.
@return a collection of {@link Encoder}s and {@link Decoder} assembled into a {@link ExchangeStrategies}. | [
"Return",
"a",
"set",
"of",
"{",
"@link",
"ExchangeStrategies",
"}",
"driven",
"by",
"registered",
"{",
"@link",
"HypermediaType",
"}",
"s",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/config/WebClientConfigurer.java#L54-L74 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/X509CertPath.java | X509CertPath.encodePKCS7 | private byte[] encodePKCS7() throws CertificateEncodingException {
"""
Encode the CertPath using PKCS#7 format.
@return a byte array containing the binary encoding of the PKCS#7 object
@exception CertificateEncodingException if an exception occurs
"""
PKCS7 p7 = new PKCS7(new AlgorithmId[0],
... | java | private byte[] encodePKCS7() throws CertificateEncodingException {
PKCS7 p7 = new PKCS7(new AlgorithmId[0],
new ContentInfo(ContentInfo.DATA_OID, null),
certs.toArray(new X509Certificate[certs.size()]),
new SignerInfo[0]);
... | [
"private",
"byte",
"[",
"]",
"encodePKCS7",
"(",
")",
"throws",
"CertificateEncodingException",
"{",
"PKCS7",
"p7",
"=",
"new",
"PKCS7",
"(",
"new",
"AlgorithmId",
"[",
"0",
"]",
",",
"new",
"ContentInfo",
"(",
"ContentInfo",
".",
"DATA_OID",
",",
"null",
... | Encode the CertPath using PKCS#7 format.
@return a byte array containing the binary encoding of the PKCS#7 object
@exception CertificateEncodingException if an exception occurs | [
"Encode",
"the",
"CertPath",
"using",
"PKCS#7",
"format",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/X509CertPath.java#L323-L335 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Cluster.java | Cluster.get_topology_id | public static String get_topology_id(StormClusterState zkCluster, String storm_name) throws Exception {
"""
if a topology's name is equal to the input storm_name, then return the topology id, otherwise return null
"""
List<String> active_storms = zkCluster.active_storms();
String rtn = null;
... | java | public static String get_topology_id(StormClusterState zkCluster, String storm_name) throws Exception {
List<String> active_storms = zkCluster.active_storms();
String rtn = null;
if (active_storms != null) {
for (String topology_id : active_storms) {
if (!topology_id... | [
"public",
"static",
"String",
"get_topology_id",
"(",
"StormClusterState",
"zkCluster",
",",
"String",
"storm_name",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"active_storms",
"=",
"zkCluster",
".",
"active_storms",
"(",
")",
";",
"String",
"r... | if a topology's name is equal to the input storm_name, then return the topology id, otherwise return null | [
"if",
"a",
"topology",
"s",
"name",
"is",
"equal",
"to",
"the",
"input",
"storm_name",
"then",
"return",
"the",
"topology",
"id",
"otherwise",
"return",
"null"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Cluster.java#L224-L241 |
hal/core | gui/src/main/java/org/jboss/as/console/mbui/behaviour/LoadResourceProcedure.java | LoadResourceProcedure.assignKeyFromAddressNode | private static void assignKeyFromAddressNode(ModelNode payload, ModelNode address) {
"""
the model representations we use internally carry along the entity keys.
these are derived from the resource address, but will be available as synthetic resource attributes.
@param payload
@param address
"""
L... | java | private static void assignKeyFromAddressNode(ModelNode payload, ModelNode address) {
List<Property> props = address.asPropertyList();
Property lastToken = props.get(props.size()-1);
payload.get("entity.key").set(lastToken.getValue().asString());
} | [
"private",
"static",
"void",
"assignKeyFromAddressNode",
"(",
"ModelNode",
"payload",
",",
"ModelNode",
"address",
")",
"{",
"List",
"<",
"Property",
">",
"props",
"=",
"address",
".",
"asPropertyList",
"(",
")",
";",
"Property",
"lastToken",
"=",
"props",
"."... | the model representations we use internally carry along the entity keys.
these are derived from the resource address, but will be available as synthetic resource attributes.
@param payload
@param address | [
"the",
"model",
"representations",
"we",
"use",
"internally",
"carry",
"along",
"the",
"entity",
"keys",
".",
"these",
"are",
"derived",
"from",
"the",
"resource",
"address",
"but",
"will",
"be",
"available",
"as",
"synthetic",
"resource",
"attributes",
"."
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/mbui/behaviour/LoadResourceProcedure.java#L179-L183 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/helper/JMOptional.java | JMOptional.ifNotNull | public static <T> void ifNotNull(T object, Consumer<T> consumer) {
"""
If not null.
@param <T> the type parameter
@param object the object
@param consumer the consumer
"""
Optional.ofNullable(object).ifPresent(consumer);
} | java | public static <T> void ifNotNull(T object, Consumer<T> consumer) {
Optional.ofNullable(object).ifPresent(consumer);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"ifNotNull",
"(",
"T",
"object",
",",
"Consumer",
"<",
"T",
">",
"consumer",
")",
"{",
"Optional",
".",
"ofNullable",
"(",
"object",
")",
".",
"ifPresent",
"(",
"consumer",
")",
";",
"}"
] | If not null.
@param <T> the type parameter
@param object the object
@param consumer the consumer | [
"If",
"not",
"null",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMOptional.java#L217-L219 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java | Evaluation.fBeta | public double fBeta(double beta, int classLabel, double defaultValue) {
"""
Calculate the f_beta for a given class, where f_beta is defined as:<br>
(1+beta^2) * (precision * recall) / (beta^2 * precision + recall).<br>
F1 is a special case of f_beta, with beta=1.0
@param beta Beta value to use
@param c... | java | public double fBeta(double beta, int classLabel, double defaultValue) {
double precision = precision(classLabel, -1);
double recall = recall(classLabel, -1);
if (precision == -1 || recall == -1) {
return defaultValue;
}
return EvaluationUtils.fBeta(beta, precision, re... | [
"public",
"double",
"fBeta",
"(",
"double",
"beta",
",",
"int",
"classLabel",
",",
"double",
"defaultValue",
")",
"{",
"double",
"precision",
"=",
"precision",
"(",
"classLabel",
",",
"-",
"1",
")",
";",
"double",
"recall",
"=",
"recall",
"(",
"classLabel"... | Calculate the f_beta for a given class, where f_beta is defined as:<br>
(1+beta^2) * (precision * recall) / (beta^2 * precision + recall).<br>
F1 is a special case of f_beta, with beta=1.0
@param beta Beta value to use
@param classLabel Class label
@param defaultValue Default value to use when precision or recal... | [
"Calculate",
"the",
"f_beta",
"for",
"a",
"given",
"class",
"where",
"f_beta",
"is",
"defined",
"as",
":",
"<br",
">",
"(",
"1",
"+",
"beta^2",
")",
"*",
"(",
"precision",
"*",
"recall",
")",
"/",
"(",
"beta^2",
"*",
"precision",
"+",
"recall",
")",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/Evaluation.java#L1225-L1232 |
windup/windup | config/impl/src/main/java/org/jboss/windup/config/loader/RuleProviderSorter.java | RuleProviderSorter.checkForCycles | private void checkForCycles(DefaultDirectedWeightedGraph<RuleProvider, DefaultEdge> graph) {
"""
Use the jgrapht cycle checker to detect any cycles in the provided dependency graph.
"""
CycleDetector<RuleProvider, DefaultEdge> cycleDetector = new CycleDetector<>(graph);
if (cycleDetector.detec... | java | private void checkForCycles(DefaultDirectedWeightedGraph<RuleProvider, DefaultEdge> graph)
{
CycleDetector<RuleProvider, DefaultEdge> cycleDetector = new CycleDetector<>(graph);
if (cycleDetector.detectCycles())
{
// if we have cycles, then try to throw an exception with some us... | [
"private",
"void",
"checkForCycles",
"(",
"DefaultDirectedWeightedGraph",
"<",
"RuleProvider",
",",
"DefaultEdge",
">",
"graph",
")",
"{",
"CycleDetector",
"<",
"RuleProvider",
",",
"DefaultEdge",
">",
"cycleDetector",
"=",
"new",
"CycleDetector",
"<>",
"(",
"graph"... | Use the jgrapht cycle checker to detect any cycles in the provided dependency graph. | [
"Use",
"the",
"jgrapht",
"cycle",
"checker",
"to",
"detect",
"any",
"cycles",
"in",
"the",
"provided",
"dependency",
"graph",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/impl/src/main/java/org/jboss/windup/config/loader/RuleProviderSorter.java#L267-L287 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/client/util/UrlUtils.java | UrlUtils.toJsonApiUri | public static URI toJsonApiUri(final URI uri, final String context, final String path) {
"""
Create a JSON URI from the supplied parameters.
@param uri the server URI
@param context the server context if any
@param path the specific API path
@return new full URI instance
"""
String p = path;
... | java | public static URI toJsonApiUri(final URI uri, final String context, final String path) {
String p = path;
if (!p.matches("(?i)https?://.*")) p = join(context, p);
if (!p.contains("?")) {
p = join(p, "api/json");
} else {
final String[] components = p.split("\\?"... | [
"public",
"static",
"URI",
"toJsonApiUri",
"(",
"final",
"URI",
"uri",
",",
"final",
"String",
"context",
",",
"final",
"String",
"path",
")",
"{",
"String",
"p",
"=",
"path",
";",
"if",
"(",
"!",
"p",
".",
"matches",
"(",
"\"(?i)https?://.*\"",
")",
"... | Create a JSON URI from the supplied parameters.
@param uri the server URI
@param context the server context if any
@param path the specific API path
@return new full URI instance | [
"Create",
"a",
"JSON",
"URI",
"from",
"the",
"supplied",
"parameters",
"."
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/client/util/UrlUtils.java#L127-L138 |
phax/ph-oton | ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5DeleteFile.java | FineUploader5DeleteFile.addCustomHeaders | @Nonnull
public FineUploader5DeleteFile addCustomHeaders (@Nullable final Map <String, String> aCustomHeaders) {
"""
Any additional headers to attach to all delete file requests.
@param aCustomHeaders
Custom headers to be added.
@return this
"""
m_aDeleteFileCustomHeaders.addAll (aCustomHeaders);
... | java | @Nonnull
public FineUploader5DeleteFile addCustomHeaders (@Nullable final Map <String, String> aCustomHeaders)
{
m_aDeleteFileCustomHeaders.addAll (aCustomHeaders);
return this;
} | [
"@",
"Nonnull",
"public",
"FineUploader5DeleteFile",
"addCustomHeaders",
"(",
"@",
"Nullable",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"aCustomHeaders",
")",
"{",
"m_aDeleteFileCustomHeaders",
".",
"addAll",
"(",
"aCustomHeaders",
")",
";",
"return",
"t... | Any additional headers to attach to all delete file requests.
@param aCustomHeaders
Custom headers to be added.
@return this | [
"Any",
"additional",
"headers",
"to",
"attach",
"to",
"all",
"delete",
"file",
"requests",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5DeleteFile.java#L82-L87 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.appendResponse | public static void appendResponse(StringBuilder buffer, String response) {
"""
Accumulate response values in string buffer.
@param buffer StringBuilder to which to append response
@param response Appended to buffer
"""
if (response != null && !response.isEmpty()) {
if (buffer.length() >... | java | public static void appendResponse(StringBuilder buffer, String response) {
if (response != null && !response.isEmpty()) {
if (buffer.length() > 0) {
buffer.append("\r\n");
}
buffer.append(response);
}
} | [
"public",
"static",
"void",
"appendResponse",
"(",
"StringBuilder",
"buffer",
",",
"String",
"response",
")",
"{",
"if",
"(",
"response",
"!=",
"null",
"&&",
"!",
"response",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"buffer",
".",
"length",
"(",
... | Accumulate response values in string buffer.
@param buffer StringBuilder to which to append response
@param response Appended to buffer | [
"Accumulate",
"response",
"values",
"in",
"string",
"buffer",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L89-L97 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setFeatureStyle | public static boolean setFeatureStyle(PolylineOptions polylineOptions, FeatureStyleExtension featureStyleExtension, FeatureRow featureRow, float density) {
"""
Set the feature row style into the polyline options
@param polylineOptions polyline options
@param featureStyleExtension feature style extension
... | java | public static boolean setFeatureStyle(PolylineOptions polylineOptions, FeatureStyleExtension featureStyleExtension, FeatureRow featureRow, float density) {
FeatureStyle featureStyle = featureStyleExtension.getFeatureStyle(featureRow);
return setFeatureStyle(polylineOptions, featureStyle, density);
... | [
"public",
"static",
"boolean",
"setFeatureStyle",
"(",
"PolylineOptions",
"polylineOptions",
",",
"FeatureStyleExtension",
"featureStyleExtension",
",",
"FeatureRow",
"featureRow",
",",
"float",
"density",
")",
"{",
"FeatureStyle",
"featureStyle",
"=",
"featureStyleExtensio... | Set the feature row style into the polyline options
@param polylineOptions polyline options
@param featureStyleExtension feature style extension
@param featureRow feature row
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if style was set into th... | [
"Set",
"the",
"feature",
"row",
"style",
"into",
"the",
"polyline",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L399-L404 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsAdvancedLinkSubstitutionHandler.java | CmsAdvancedLinkSubstitutionHandler.isExcluded | protected boolean isExcluded(CmsObject cms, String path) {
"""
Returns if the given path starts with an exclude prefix.<p>
@param cms the cms context
@param path the path to check
@return <code>true</code> if the given path starts with an exclude prefix
"""
List<String> excludes = getExcludes(c... | java | protected boolean isExcluded(CmsObject cms, String path) {
List<String> excludes = getExcludes(cms);
// now check if the current link start with one of the exclude links
for (int i = 0; i < excludes.size(); i++) {
if (path.startsWith(excludes.get(i))) {
return true;
... | [
"protected",
"boolean",
"isExcluded",
"(",
"CmsObject",
"cms",
",",
"String",
"path",
")",
"{",
"List",
"<",
"String",
">",
"excludes",
"=",
"getExcludes",
"(",
"cms",
")",
";",
"// now check if the current link start with one of the exclude links",
"for",
"(",
"int... | Returns if the given path starts with an exclude prefix.<p>
@param cms the cms context
@param path the path to check
@return <code>true</code> if the given path starts with an exclude prefix | [
"Returns",
"if",
"the",
"given",
"path",
"starts",
"with",
"an",
"exclude",
"prefix",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsAdvancedLinkSubstitutionHandler.java#L128-L138 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/CodeBuilderUtil.java | CodeBuilderUtil.blankValue | public static void blankValue(CodeBuilder b, TypeDesc type) {
"""
Generates code to push a blank value to the stack. For objects, it is
null, and for primitive types it is zero or false.
"""
switch (type.getTypeCode()) {
default:
b.loadNull();
break;
case... | java | public static void blankValue(CodeBuilder b, TypeDesc type) {
switch (type.getTypeCode()) {
default:
b.loadNull();
break;
case TypeDesc.BYTE_CODE:
case TypeDesc.CHAR_CODE:
case TypeDesc.SHORT_CODE:
case TypeDesc.INT_CODE:
b.l... | [
"public",
"static",
"void",
"blankValue",
"(",
"CodeBuilder",
"b",
",",
"TypeDesc",
"type",
")",
"{",
"switch",
"(",
"type",
".",
"getTypeCode",
"(",
")",
")",
"{",
"default",
":",
"b",
".",
"loadNull",
"(",
")",
";",
"break",
";",
"case",
"TypeDesc",
... | Generates code to push a blank value to the stack. For objects, it is
null, and for primitive types it is zero or false. | [
"Generates",
"code",
"to",
"push",
"a",
"blank",
"value",
"to",
"the",
"stack",
".",
"For",
"objects",
"it",
"is",
"null",
"and",
"for",
"primitive",
"types",
"it",
"is",
"zero",
"or",
"false",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/CodeBuilderUtil.java#L756-L786 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/statistics/ConfidenceInterval.java | ConfidenceInterval.getConfidenceInterval | public double[] getConfidenceInterval(final double alpha, final Map<?, Double> metricValuesPerDimension) {
"""
Method that takes only one metric as parameter. It is useful when
comparing more than two metrics (so that a confidence interval is
computed for each of them), as suggested in [Sakai, 2014]
@param al... | java | public double[] getConfidenceInterval(final double alpha, final Map<?, Double> metricValuesPerDimension) {
SummaryStatistics differences = new SummaryStatistics();
for (Double d : metricValuesPerDimension.values()) {
differences.addValue(d);
}
return getConfidenceInterval(alp... | [
"public",
"double",
"[",
"]",
"getConfidenceInterval",
"(",
"final",
"double",
"alpha",
",",
"final",
"Map",
"<",
"?",
",",
"Double",
">",
"metricValuesPerDimension",
")",
"{",
"SummaryStatistics",
"differences",
"=",
"new",
"SummaryStatistics",
"(",
")",
";",
... | Method that takes only one metric as parameter. It is useful when
comparing more than two metrics (so that a confidence interval is
computed for each of them), as suggested in [Sakai, 2014]
@param alpha probability of incorrectly rejecting the null hypothesis (1
- confidence_level)
@param metricValuesPerDimension one ... | [
"Method",
"that",
"takes",
"only",
"one",
"metric",
"as",
"parameter",
".",
"It",
"is",
"useful",
"when",
"comparing",
"more",
"than",
"two",
"metrics",
"(",
"so",
"that",
"a",
"confidence",
"interval",
"is",
"computed",
"for",
"each",
"of",
"them",
")",
... | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/statistics/ConfidenceInterval.java#L169-L175 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/datatype/xsd/DurationDatatype.java | DurationDatatype.computeDays | private static BigInteger computeDays(BigInteger months, int refYear, int refMonth) {
"""
Returns the number of days spanned by a period of months starting with a particular
reference year and month.
"""
switch (months.signum()) {
case 0:
return BigInteger.valueOf(0);
case -1:
return c... | java | private static BigInteger computeDays(BigInteger months, int refYear, int refMonth) {
switch (months.signum()) {
case 0:
return BigInteger.valueOf(0);
case -1:
return computeDays(months.negate(), refYear, refMonth).negate();
}
// Complete cycle of Gregorian calendar is 400 years
BigI... | [
"private",
"static",
"BigInteger",
"computeDays",
"(",
"BigInteger",
"months",
",",
"int",
"refYear",
",",
"int",
"refMonth",
")",
"{",
"switch",
"(",
"months",
".",
"signum",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"BigInteger",
".",
"valueOf",
... | Returns the number of days spanned by a period of months starting with a particular
reference year and month. | [
"Returns",
"the",
"number",
"of",
"days",
"spanned",
"by",
"a",
"period",
"of",
"months",
"starting",
"with",
"a",
"particular",
"reference",
"year",
"and",
"month",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/datatype/xsd/DurationDatatype.java#L179-L199 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDisplayLayoutPersistenceImpl.java | CPDisplayLayoutPersistenceImpl.findByUUID_G | @Override
public CPDisplayLayout findByUUID_G(String uuid, long groupId)
throws NoSuchCPDisplayLayoutException {
"""
Returns the cp display layout where uuid = ? and groupId = ? or throws a {@link NoSuchCPDisplayLayoutException} if it could not be found.
@param uuid the uuid
@param groupId the group... | java | @Override
public CPDisplayLayout findByUUID_G(String uuid, long groupId)
throws NoSuchCPDisplayLayoutException {
CPDisplayLayout cpDisplayLayout = fetchByUUID_G(uuid, groupId);
if (cpDisplayLayout == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("u... | [
"@",
"Override",
"public",
"CPDisplayLayout",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPDisplayLayoutException",
"{",
"CPDisplayLayout",
"cpDisplayLayout",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"if"... | Returns the cp display layout where uuid = ? and groupId = ? or throws a {@link NoSuchCPDisplayLayoutException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp display layout
@throws NoSuchCPDisplayLayoutException if a matching cp display layout could not be f... | [
"Returns",
"the",
"cp",
"display",
"layout",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDisplayLayoutException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDisplayLayoutPersistenceImpl.java#L665-L691 |
udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/CodedInputStream.java | CodedInputStream.readRawVarint32 | static int readRawVarint32(final InputStream input) throws IOException {
"""
Reads a varint from the input one byte at a time, so that it does not
read any bytes after the end of the varint. If you simply wrapped the
stream in a CodedInputStream and used {@link #readRawVarint32(InputStream)}
then you would pro... | java | static int readRawVarint32(final InputStream input) throws IOException {
final int firstByte = input.read();
if (firstByte == -1) {
throw InvalidProtocolBufferException.truncatedMessage();
}
return readRawVarint32(firstByte, input);
} | [
"static",
"int",
"readRawVarint32",
"(",
"final",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"final",
"int",
"firstByte",
"=",
"input",
".",
"read",
"(",
")",
";",
"if",
"(",
"firstByte",
"==",
"-",
"1",
")",
"{",
"throw",
"InvalidProtocolB... | Reads a varint from the input one byte at a time, so that it does not
read any bytes after the end of the varint. If you simply wrapped the
stream in a CodedInputStream and used {@link #readRawVarint32(InputStream)}
then you would probably end up reading past the end of the varint since
CodedInputStream buffers its in... | [
"Reads",
"a",
"varint",
"from",
"the",
"input",
"one",
"byte",
"at",
"a",
"time",
"so",
"that",
"it",
"does",
"not",
"read",
"any",
"bytes",
"after",
"the",
"end",
"of",
"the",
"varint",
".",
"If",
"you",
"simply",
"wrapped",
"the",
"stream",
"in",
"... | train | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/CodedInputStream.java#L413-L419 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/MatrixFeatures_ZDRM.java | MatrixFeatures_ZDRM.isZeros | public static boolean isZeros(ZMatrixD1 m , double tol ) {
"""
Checks to see all the elements in the matrix are zeros
@param m A matrix. Not modified.
@return True if all elements are zeros or false if not
"""
int length = m.getNumElements()*2;
for( int i = 0; i < length; i++ ) {
... | java | public static boolean isZeros(ZMatrixD1 m , double tol )
{
int length = m.getNumElements()*2;
for( int i = 0; i < length; i++ ) {
if( Math.abs(m.data[i]) > tol )
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isZeros",
"(",
"ZMatrixD1",
"m",
",",
"double",
"tol",
")",
"{",
"int",
"length",
"=",
"m",
".",
"getNumElements",
"(",
")",
"*",
"2",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",... | Checks to see all the elements in the matrix are zeros
@param m A matrix. Not modified.
@return True if all elements are zeros or false if not | [
"Checks",
"to",
"see",
"all",
"the",
"elements",
"in",
"the",
"matrix",
"are",
"zeros"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/MatrixFeatures_ZDRM.java#L423-L432 |
ag-gipp/MathMLTools | mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/XMLHelper.java | XMLHelper.getElementB | public static Node getElementB(Node node, String xPath) throws XPathExpressionException {
"""
Helper program: Extracts the specified XPATH expression
from an XML-String.
@param node the node
@param xPath the x path
@return NodeList
@throws XPathExpressionException the x path expression exception
"""
... | java | public static Node getElementB(Node node, String xPath) throws XPathExpressionException {
XPathExpression expr = xpath.compile(xPath);
return getElementB(node, expr);
} | [
"public",
"static",
"Node",
"getElementB",
"(",
"Node",
"node",
",",
"String",
"xPath",
")",
"throws",
"XPathExpressionException",
"{",
"XPathExpression",
"expr",
"=",
"xpath",
".",
"compile",
"(",
"xPath",
")",
";",
"return",
"getElementB",
"(",
"node",
",",
... | Helper program: Extracts the specified XPATH expression
from an XML-String.
@param node the node
@param xPath the x path
@return NodeList
@throws XPathExpressionException the x path expression exception | [
"Helper",
"program",
":",
"Extracts",
"the",
"specified",
"XPATH",
"expression",
"from",
"an",
"XML",
"-",
"String",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/XMLHelper.java#L140-L143 |
alb-i986/selenium-tinafw | src/main/java/me/alb_i986/selenium/tinafw/ui/PageHelper.java | PageHelper.hitKeys | public static void hitKeys(WebDriver driver, CharSequence keys) {
"""
Typical use is to simulate hitting ESCAPE or ENTER.
@param driver
@param keys
@see Actions#sendKeys(CharSequence...)
"""
new Actions(driver)
.sendKeys(keys)
.perform()
;
} | java | public static void hitKeys(WebDriver driver, CharSequence keys) {
new Actions(driver)
.sendKeys(keys)
.perform()
;
} | [
"public",
"static",
"void",
"hitKeys",
"(",
"WebDriver",
"driver",
",",
"CharSequence",
"keys",
")",
"{",
"new",
"Actions",
"(",
"driver",
")",
".",
"sendKeys",
"(",
"keys",
")",
".",
"perform",
"(",
")",
";",
"}"
] | Typical use is to simulate hitting ESCAPE or ENTER.
@param driver
@param keys
@see Actions#sendKeys(CharSequence...) | [
"Typical",
"use",
"is",
"to",
"simulate",
"hitting",
"ESCAPE",
"or",
"ENTER",
"."
] | train | https://github.com/alb-i986/selenium-tinafw/blob/91c66720cda9f69751f96c58c0a0624b2222186e/src/main/java/me/alb_i986/selenium/tinafw/ui/PageHelper.java#L245-L250 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/query/QueryImpl.java | QueryImpl.listIndexes | @Override
public List<Index> listIndexes() throws QueryException {
"""
Get a list of indexes and their definitions as a Map.
Returns:
{ indexName: { type: json,
name: indexName,
fields: [field1, field2]
}
@return Map of indexes in the database.
"""
try {
return DatabaseImpl.... | java | @Override
public List<Index> listIndexes() throws QueryException {
try {
return DatabaseImpl.get(dbQueue.submit(new ListIndexesCallable()));
} catch (ExecutionException e) {
String msg = "Failed to list indexes";
logger.log(Level.SEVERE, msg, e);
thro... | [
"@",
"Override",
"public",
"List",
"<",
"Index",
">",
"listIndexes",
"(",
")",
"throws",
"QueryException",
"{",
"try",
"{",
"return",
"DatabaseImpl",
".",
"get",
"(",
"dbQueue",
".",
"submit",
"(",
"new",
"ListIndexesCallable",
"(",
")",
")",
")",
";",
"... | Get a list of indexes and their definitions as a Map.
Returns:
{ indexName: { type: json,
name: indexName,
fields: [field1, field2]
}
@return Map of indexes in the database. | [
"Get",
"a",
"list",
"of",
"indexes",
"and",
"their",
"definitions",
"as",
"a",
"Map",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/query/QueryImpl.java#L124-L134 |
graknlabs/grakn | server/src/graql/analytics/KCoreVertexProgram.java | KCoreVertexProgram.getMessageCountExcludeSelf | private static int getMessageCountExcludeSelf(Messenger<String> messenger, String id) {
"""
count the messages from relations, so need to filter its own msg
"""
Set<String> messageSet = newHashSet(messenger.receiveMessages());
messageSet.remove(id);
return messageSet.size();
} | java | private static int getMessageCountExcludeSelf(Messenger<String> messenger, String id) {
Set<String> messageSet = newHashSet(messenger.receiveMessages());
messageSet.remove(id);
return messageSet.size();
} | [
"private",
"static",
"int",
"getMessageCountExcludeSelf",
"(",
"Messenger",
"<",
"String",
">",
"messenger",
",",
"String",
"id",
")",
"{",
"Set",
"<",
"String",
">",
"messageSet",
"=",
"newHashSet",
"(",
"messenger",
".",
"receiveMessages",
"(",
")",
")",
"... | count the messages from relations, so need to filter its own msg | [
"count",
"the",
"messages",
"from",
"relations",
"so",
"need",
"to",
"filter",
"its",
"own",
"msg"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/analytics/KCoreVertexProgram.java#L215-L219 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java | DelaunayData.addGeometry | private void addGeometry(Geometry geom) throws IllegalArgumentException {
"""
Add a geometry to the list of points and edges used by the triangulation.
@param geom Any geometry
@throws IllegalArgumentException
"""
if(!geom.isValid()) {
throw new IllegalArgumentException("Provided geometry... | java | private void addGeometry(Geometry geom) throws IllegalArgumentException {
if(!geom.isValid()) {
throw new IllegalArgumentException("Provided geometry is not valid !");
}
if(geom instanceof GeometryCollection) {
Map<TriangulationPoint, Integer> pts = new HashMap<Triangulat... | [
"private",
"void",
"addGeometry",
"(",
"Geometry",
"geom",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"!",
"geom",
".",
"isValid",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Provided geometry is not valid !\"",
")",
";"... | Add a geometry to the list of points and edges used by the triangulation.
@param geom Any geometry
@throws IllegalArgumentException | [
"Add",
"a",
"geometry",
"to",
"the",
"list",
"of",
"points",
"and",
"edges",
"used",
"by",
"the",
"triangulation",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/DelaunayData.java#L288-L315 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.approveLicense | public void approveLicense(final String licenseId, final Boolean approve, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
"""
Approve or reject a license
@param licenseId
@param approve
@throws GrapesCommunicationException
@throws javax.naming.Authenti... | java | public void approveLicense(final String licenseId, final Boolean approve, final String user, final String password) throws GrapesCommunicationException, AuthenticationException{
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.get... | [
"public",
"void",
"approveLicense",
"(",
"final",
"String",
"licenseId",
",",
"final",
"Boolean",
"approve",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"throws",
"GrapesCommunicationException",
",",
"AuthenticationException",
"{",
"fina... | Approve or reject a license
@param licenseId
@param approve
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException | [
"Approve",
"or",
"reject",
"a",
"license"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L737-L750 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/IOUtil.java | IOUtil.readMap | public static Map<String, String[]> readMap(String filename)
throws IOException {
"""
Reads the specified file into a map. The first value is used as key. The
rest is put into a list and used as map value. Each entry is one line of
the file.
<p>
Ensures that no null value is returned.
<p>
Uses the default... | java | public static Map<String, String[]> readMap(String filename)
throws IOException {
return readMap(filename, DEFAULT_DELIMITER);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"readMap",
"(",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"return",
"readMap",
"(",
"filename",
",",
"DEFAULT_DELIMITER",
")",
";",
"}"
] | Reads the specified file into a map. The first value is used as key. The
rest is put into a list and used as map value. Each entry is one line of
the file.
<p>
Ensures that no null value is returned.
<p>
Uses the default {@link #DEFAULT_DELIMITER}
@param filename
the name of the specification file (not the path to it)... | [
"Reads",
"the",
"specified",
"file",
"into",
"a",
"map",
".",
"The",
"first",
"value",
"is",
"used",
"as",
"key",
".",
"The",
"rest",
"is",
"put",
"into",
"a",
"list",
"and",
"used",
"as",
"map",
"value",
".",
"Each",
"entry",
"is",
"one",
"line",
... | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/IOUtil.java#L367-L370 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.getDate | @Override
public Date getDate(int parameterIndex, Calendar cal) throws SQLException {
"""
Retrieves the value of the designated JDBC DATE parameter as a java.sql.Date object, using the given Calendar object to construct the date.
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public Date getDate(int parameterIndex, Calendar cal) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"Date",
"getDate",
"(",
"int",
"parameterIndex",
",",
"Calendar",
"cal",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Retrieves the value of the designated JDBC DATE parameter as a java.sql.Date object, using the given Calendar object to construct the date. | [
"Retrieves",
"the",
"value",
"of",
"the",
"designated",
"JDBC",
"DATE",
"parameter",
"as",
"a",
"java",
".",
"sql",
".",
"Date",
"object",
"using",
"the",
"given",
"Calendar",
"object",
"to",
"construct",
"the",
"date",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L191-L196 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/protocol/platform/OshiPlatformCache.java | OshiPlatformCache.getMetric | public Double getMetric(PlatformResourceType type, String name, ID metricToCollect) {
"""
Given a platform resource type, a name, and a metric name, this will return that metric's value,
or null if there is no resource that can be identified by the name and type.
@param type identifies the platform resource wh... | java | public Double getMetric(PlatformResourceType type, String name, ID metricToCollect) {
switch (type) {
case OPERATING_SYSTEM: {
return getOperatingSystemMetric(metricToCollect);
}
case MEMORY: {
return getMemoryMetric(metricToCollect);
... | [
"public",
"Double",
"getMetric",
"(",
"PlatformResourceType",
"type",
",",
"String",
"name",
",",
"ID",
"metricToCollect",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"OPERATING_SYSTEM",
":",
"{",
"return",
"getOperatingSystemMetric",
"(",
"metricToCollect"... | Given a platform resource type, a name, and a metric name, this will return that metric's value,
or null if there is no resource that can be identified by the name and type.
@param type identifies the platform resource whose metric is to be collected
@param name name of the resource whose metric is to be collected
@pa... | [
"Given",
"a",
"platform",
"resource",
"type",
"a",
"name",
"and",
"a",
"metric",
"name",
"this",
"will",
"return",
"that",
"metric",
"s",
"value",
"or",
"null",
"if",
"there",
"is",
"no",
"resource",
"that",
"can",
"be",
"identified",
"by",
"the",
"name"... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/protocol/platform/OshiPlatformCache.java#L372-L394 |
Mthwate/DatLib | src/main/java/com/mthwate/datlib/HashUtils.java | HashUtils.md2Hex | public static String md2Hex(String data, Charset charset) throws NoSuchAlgorithmException {
"""
Hashes a string using the MD2 algorithm. Returns a hexadecimal result.
@since 1.1
@param data the string to hash
@param charset the charset of the string
@return the hexadecimal MD2 hash of the string
@throws NoS... | java | public static String md2Hex(String data, Charset charset) throws NoSuchAlgorithmException {
return md2Hex(data.getBytes(charset));
} | [
"public",
"static",
"String",
"md2Hex",
"(",
"String",
"data",
",",
"Charset",
"charset",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"return",
"md2Hex",
"(",
"data",
".",
"getBytes",
"(",
"charset",
")",
")",
";",
"}"
] | Hashes a string using the MD2 algorithm. Returns a hexadecimal result.
@since 1.1
@param data the string to hash
@param charset the charset of the string
@return the hexadecimal MD2 hash of the string
@throws NoSuchAlgorithmException the algorithm is not supported by existing providers | [
"Hashes",
"a",
"string",
"using",
"the",
"MD2",
"algorithm",
".",
"Returns",
"a",
"hexadecimal",
"result",
"."
] | train | https://github.com/Mthwate/DatLib/blob/f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077/src/main/java/com/mthwate/datlib/HashUtils.java#L138-L140 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.saveRule | public JSONObject saveRule(String objectID, JSONObject rule, boolean forwardToReplicas, RequestOptions requestOptions) throws AlgoliaException {
"""
Save a query rule
@param objectID the objectId of the query rule to save
@param rule the content of this query rule
@param forwardToReplica... | java | public JSONObject saveRule(String objectID, JSONObject rule, boolean forwardToReplicas, RequestOptions requestOptions) throws AlgoliaException {
try {
return client.putRequest("/1/indexes/" + encodedIndexName + "/rules/" + URLEncoder.encode(objectID, "UTF-8") + "?forwardToReplicas=" + forwardToReplicas, rule.... | [
"public",
"JSONObject",
"saveRule",
"(",
"String",
"objectID",
",",
"JSONObject",
"rule",
",",
"boolean",
"forwardToReplicas",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"try",
"{",
"return",
"client",
".",
"putRequest",
"(",
... | Save a query rule
@param objectID the objectId of the query rule to save
@param rule the content of this query rule
@param forwardToReplicas Forward this operation to the replica indices
@param requestOptions Options to pass to this request | [
"Save",
"a",
"query",
"rule"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1699-L1705 |
RKumsher/utils | src/main/java/com/github/rkumsher/date/RandomDateUtils.java | RandomDateUtils.randomYear | public static Year randomYear(int startInclusive, int endExclusive) {
"""
Returns a random {@link Year} within the specified range.
@param startInclusive the earliest {@link Year} that can be returned
@param endExclusive the upper bound (not included)
@return the random {@link Year}
@throws IllegalArgumentEx... | java | public static Year randomYear(int startInclusive, int endExclusive) {
checkArgument(startInclusive < MAX_YEAR, "Start must be before %s", MAX_YEAR);
checkArgument(startInclusive >= MIN_YEAR, "Start must be on or after %s", MIN_YEAR);
checkArgument(endExclusive > MIN_YEAR, "End must be after %s", MIN_YEAR);
... | [
"public",
"static",
"Year",
"randomYear",
"(",
"int",
"startInclusive",
",",
"int",
"endExclusive",
")",
"{",
"checkArgument",
"(",
"startInclusive",
"<",
"MAX_YEAR",
",",
"\"Start must be before %s\"",
",",
"MAX_YEAR",
")",
";",
"checkArgument",
"(",
"startInclusiv... | Returns a random {@link Year} within the specified range.
@param startInclusive the earliest {@link Year} that can be returned
@param endExclusive the upper bound (not included)
@return the random {@link Year}
@throws IllegalArgumentException if endExclusive is earlier than startInclusive, if end is
before {@link Rand... | [
"Returns",
"a",
"random",
"{",
"@link",
"Year",
"}",
"within",
"the",
"specified",
"range",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/date/RandomDateUtils.java#L895-L902 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java | SeaGlassSynthPainterImpl.paintBackground | private void paintBackground(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation) {
"""
Paint the object's background.
@param ctx the SynthContext.
@param g the Graphics context.
@param x the x location corresponding to the upper-left
coordinate to paint.
@p... | java | private void paintBackground(SynthContext ctx, Graphics g, int x, int y, int w, int h, int orientation) {
Component c = ctx.getComponent();
boolean ltr = c.getComponentOrientation().isLeftToRight();
// Don't RTL flip JSpliders as they handle it internaly
if (ctx.getComponent() insta... | [
"private",
"void",
"paintBackground",
"(",
"SynthContext",
"ctx",
",",
"Graphics",
"g",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
",",
"int",
"orientation",
")",
"{",
"Component",
"c",
"=",
"ctx",
".",
"getComponent",
"(",
"... | Paint the object's background.
@param ctx the SynthContext.
@param g the Graphics context.
@param x the x location corresponding to the upper-left
coordinate to paint.
@param y the y location corresponding to the upper left
coordinate to paint.
@param w the width to pain... | [
"Paint",
"the",
"object",
"s",
"background",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java#L208-L240 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/searchindex/CmsHookListSearchCategory.java | CmsHookListSearchCategory.onGetCall | @Override
protected void onGetCall(Object peer, int index) {
"""
Set the search page of the peer Object
(<code>{@link org.opencms.search.CmsSearch#setSearchPage(int)}</code>)
to zero if the internal backup list of categories (taken at clear time which
is triggered by <code>{@link org.opencms.workplace.CmsWi... | java | @Override
protected void onGetCall(Object peer, int index) {
// zero categories are all (first condition)
if (((m_backupCategories.size() == 0) && (size() != 0)) || !(containsAll(m_backupCategories))) {
((CmsSearchParameters)peer).setSearchPage(1);
}
} | [
"@",
"Override",
"protected",
"void",
"onGetCall",
"(",
"Object",
"peer",
",",
"int",
"index",
")",
"{",
"// zero categories are all (first condition)",
"if",
"(",
"(",
"(",
"m_backupCategories",
".",
"size",
"(",
")",
"==",
"0",
")",
"&&",
"(",
"size",
"(",... | Set the search page of the peer Object
(<code>{@link org.opencms.search.CmsSearch#setSearchPage(int)}</code>)
to zero if the internal backup list of categories (taken at clear time which
is triggered by <code>{@link org.opencms.workplace.CmsWidgetDialog#ACTION_SAVE}</code>)
was empty (no restriction) and now categories... | [
"Set",
"the",
"search",
"page",
"of",
"the",
"peer",
"Object",
"(",
"<code",
">",
"{",
"@link",
"org",
".",
"opencms",
".",
"search",
".",
"CmsSearch#setSearchPage",
"(",
"int",
")",
"}",
"<",
"/",
"code",
">",
")",
"to",
"zero",
"if",
"the",
"intern... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsHookListSearchCategory.java#L155-L162 |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/servlet/WeixinControllerSupport.java | WeixinControllerSupport.process | @RequestMapping(method = RequestMethod.POST)
protected final void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
"""
微信消息交互处理
@param request http 请求对象
@param response http 响应对象
@throws ServletException 异常
@throws IOException IO异常
"""
... | java | @RequestMapping(method = RequestMethod.POST)
protected final void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (isLegal(request)) {
String result = processRequest(request);
//设置正确的 content-type 以防止中文乱码
respons... | [
"@",
"RequestMapping",
"(",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"protected",
"final",
"void",
"process",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"if",
"... | 微信消息交互处理
@param request http 请求对象
@param response http 响应对象
@throws ServletException 异常
@throws IOException IO异常 | [
"微信消息交互处理"
] | train | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/servlet/WeixinControllerSupport.java#L49-L59 |
hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java | DefaultBeanProcessor.createBean | private <T> T createBean(ResultSet rs, Class<T> type,
PropertyDescriptor[] props, int[] columnToProperty)
throws SQLException {
"""
Creates a new object and initializes its fields from the ResultSet.
@param <T> The type of bean to create
@param rs ... | java | private <T> T createBean(ResultSet rs, Class<T> type,
PropertyDescriptor[] props, int[] columnToProperty)
throws SQLException {
T bean = this.newInstance(type);
return populateBean(rs, bean, props, columnToProperty);
} | [
"private",
"<",
"T",
">",
"T",
"createBean",
"(",
"ResultSet",
"rs",
",",
"Class",
"<",
"T",
">",
"type",
",",
"PropertyDescriptor",
"[",
"]",
"props",
",",
"int",
"[",
"]",
"columnToProperty",
")",
"throws",
"SQLException",
"{",
"T",
"bean",
"=",
"thi... | Creates a new object and initializes its fields from the ResultSet.
@param <T> The type of bean to create
@param rs The result set.
@param type The bean type (the return type of the object).
@param props The property descriptors.
@param columnToProperty The column indi... | [
"Creates",
"a",
"new",
"object",
"and",
"initializes",
"its",
"fields",
"from",
"the",
"ResultSet",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java#L93-L99 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java | BigtableSession.createChannelPool | protected ManagedChannel createChannelPool(final ChannelPool.ChannelFactory channelFactory, int count)
throws IOException {
"""
Create a new {@link com.google.cloud.bigtable.grpc.io.ChannelPool}, with auth headers. This
method allows users to override the default implementation with their own.
@param ch... | java | protected ManagedChannel createChannelPool(final ChannelPool.ChannelFactory channelFactory, int count)
throws IOException {
return new ChannelPool(channelFactory, count);
} | [
"protected",
"ManagedChannel",
"createChannelPool",
"(",
"final",
"ChannelPool",
".",
"ChannelFactory",
"channelFactory",
",",
"int",
"count",
")",
"throws",
"IOException",
"{",
"return",
"new",
"ChannelPool",
"(",
"channelFactory",
",",
"count",
")",
";",
"}"
] | Create a new {@link com.google.cloud.bigtable.grpc.io.ChannelPool}, with auth headers. This
method allows users to override the default implementation with their own.
@param channelFactory a {@link ChannelPool.ChannelFactory} object.
@param count The number of channels in the pool.
@return a {@link com.google.cloud.b... | [
"Create",
"a",
"new",
"{",
"@link",
"com",
".",
"google",
".",
"cloud",
".",
"bigtable",
".",
"grpc",
".",
"io",
".",
"ChannelPool",
"}",
"with",
"auth",
"headers",
".",
"This",
"method",
"allows",
"users",
"to",
"override",
"the",
"default",
"implementa... | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java#L520-L523 |
atomix/atomix | cluster/src/main/java/io/atomix/cluster/MulticastConfig.java | MulticastConfig.setGroup | public MulticastConfig setGroup(String group) {
"""
Sets the multicast group.
@param group the multicast group
@return the multicast configuration
@throws ConfigurationException if the group is invalid
"""
try {
InetAddress address = InetAddress.getByName(group);
if (!address.isMulticastAd... | java | public MulticastConfig setGroup(String group) {
try {
InetAddress address = InetAddress.getByName(group);
if (!address.isMulticastAddress()) {
throw new ConfigurationException("Invalid multicast group " + group);
}
return setGroup(address);
} catch (UnknownHostException e) {
... | [
"public",
"MulticastConfig",
"setGroup",
"(",
"String",
"group",
")",
"{",
"try",
"{",
"InetAddress",
"address",
"=",
"InetAddress",
".",
"getByName",
"(",
"group",
")",
";",
"if",
"(",
"!",
"address",
".",
"isMulticastAddress",
"(",
")",
")",
"{",
"throw"... | Sets the multicast group.
@param group the multicast group
@return the multicast configuration
@throws ConfigurationException if the group is invalid | [
"Sets",
"the",
"multicast",
"group",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/cluster/src/main/java/io/atomix/cluster/MulticastConfig.java#L81-L91 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/dialogs/ListSelectDialog.java | ListSelectDialog.showDialog | public static <T> T showDialog(WindowBasedTextGUI textGUI, String title, String description, int listBoxHeight, T... items) {
"""
Shortcut for quickly creating a new dialog
@param textGUI Text GUI to add the dialog to
@param title Title of the dialog
@param description Description of the dialog
@param listBoxH... | java | public static <T> T showDialog(WindowBasedTextGUI textGUI, String title, String description, int listBoxHeight, T... items) {
int width = 0;
for(T item: items) {
width = Math.max(width, TerminalTextUtils.getColumnWidth(item.toString()));
}
width += 2;
return showDialo... | [
"public",
"static",
"<",
"T",
">",
"T",
"showDialog",
"(",
"WindowBasedTextGUI",
"textGUI",
",",
"String",
"title",
",",
"String",
"description",
",",
"int",
"listBoxHeight",
",",
"T",
"...",
"items",
")",
"{",
"int",
"width",
"=",
"0",
";",
"for",
"(",
... | Shortcut for quickly creating a new dialog
@param textGUI Text GUI to add the dialog to
@param title Title of the dialog
@param description Description of the dialog
@param listBoxHeight Maximum height of the list box, scrollbars will be used if there are more items
@param items Items in the dialog
@param <T> Type of i... | [
"Shortcut",
"for",
"quickly",
"creating",
"a",
"new",
"dialog"
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/dialogs/ListSelectDialog.java#L142-L149 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/reporter/JdtUtils.java | JdtUtils.sortAnonymous | private static void sortAnonymous(List<IType> anonymous, IType anonType) {
"""
Sort given anonymous classes in order like java compiler would generate
output classes, in context of given anonymous type
@param anonymous
"""
SourceOffsetComparator sourceComparator = new SourceOffsetComparator();
... | java | private static void sortAnonymous(List<IType> anonymous, IType anonType) {
SourceOffsetComparator sourceComparator = new SourceOffsetComparator();
final AnonymClassComparator classComparator = new AnonymClassComparator(anonType, sourceComparator);
Collections.sort(anonymous, classComparator);
... | [
"private",
"static",
"void",
"sortAnonymous",
"(",
"List",
"<",
"IType",
">",
"anonymous",
",",
"IType",
"anonType",
")",
"{",
"SourceOffsetComparator",
"sourceComparator",
"=",
"new",
"SourceOffsetComparator",
"(",
")",
";",
"final",
"AnonymClassComparator",
"class... | Sort given anonymous classes in order like java compiler would generate
output classes, in context of given anonymous type
@param anonymous | [
"Sort",
"given",
"anonymous",
"classes",
"in",
"order",
"like",
"java",
"compiler",
"would",
"generate",
"output",
"classes",
"in",
"context",
"of",
"given",
"anonymous",
"type"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/JdtUtils.java#L333-L342 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/repair/RepairJob.java | RepairJob.submitDifferencers | public void submitDifferencers() {
"""
Submit differencers for running.
All tree *must* have been received before this is called.
"""
assert !failed;
List<Differencer> differencers = new ArrayList<>();
// We need to difference all trees one against another
for (int i = 0; i < t... | java | public void submitDifferencers()
{
assert !failed;
List<Differencer> differencers = new ArrayList<>();
// We need to difference all trees one against another
for (int i = 0; i < trees.size() - 1; ++i)
{
TreeResponse r1 = trees.get(i);
for (int j = i + ... | [
"public",
"void",
"submitDifferencers",
"(",
")",
"{",
"assert",
"!",
"failed",
";",
"List",
"<",
"Differencer",
">",
"differencers",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// We need to difference all trees one against another",
"for",
"(",
"int",
"i",
... | Submit differencers for running.
All tree *must* have been received before this is called. | [
"Submit",
"differencers",
"for",
"running",
".",
"All",
"tree",
"*",
"must",
"*",
"have",
"been",
"received",
"before",
"this",
"is",
"called",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/RepairJob.java#L201-L222 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/FieldMap.java | FieldMap.populateContainer | public void populateContainer(Class<? extends FieldType> type, FieldContainer container, Integer id, byte[][] fixedData, Var2Data varData) {
"""
Given a container, and a set of raw data blocks, this method extracts
the field data and writes it into the container.
@param type expected type
@param container fie... | java | public void populateContainer(Class<? extends FieldType> type, FieldContainer container, Integer id, byte[][] fixedData, Var2Data varData)
{
//System.out.println(container.getClass().getSimpleName()+": " + id);
for (FieldItem item : m_map.values())
{
if (item.getType().getClass().equals(ty... | [
"public",
"void",
"populateContainer",
"(",
"Class",
"<",
"?",
"extends",
"FieldType",
">",
"type",
",",
"FieldContainer",
"container",
",",
"Integer",
"id",
",",
"byte",
"[",
"]",
"[",
"]",
"fixedData",
",",
"Var2Data",
"varData",
")",
"{",
"//System.out.pr... | Given a container, and a set of raw data blocks, this method extracts
the field data and writes it into the container.
@param type expected type
@param container field container
@param id entity ID
@param fixedData fixed data block
@param varData var data block | [
"Given",
"a",
"container",
"and",
"a",
"set",
"of",
"raw",
"data",
"blocks",
"this",
"method",
"extracts",
"the",
"field",
"data",
"and",
"writes",
"it",
"into",
"the",
"container",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L430-L443 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java | KickflipApiClient.loginUser | public void loginUser(String username, final String password, final KickflipCallback cb) {
"""
Login an exiting Kickflip User and make it active.
@param username The Kickflip user's username
@param password The Kickflip user's password
@param cb This callback will receive a User in {@link io.kickflip.sd... | java | public void loginUser(String username, final String password, final KickflipCallback cb) {
GenericData data = new GenericData();
data.put("username", username);
data.put("password", password);
post(GET_USER_PRIVATE, new UrlEncodedContent(data), User.class, new KickflipCallback() {
... | [
"public",
"void",
"loginUser",
"(",
"String",
"username",
",",
"final",
"String",
"password",
",",
"final",
"KickflipCallback",
"cb",
")",
"{",
"GenericData",
"data",
"=",
"new",
"GenericData",
"(",
")",
";",
"data",
".",
"put",
"(",
"\"username\"",
",",
"... | Login an exiting Kickflip User and make it active.
@param username The Kickflip user's username
@param password The Kickflip user's password
@param cb This callback will receive a User in {@link io.kickflip.sdk.api.KickflipCallback#onSuccess(io.kickflip.sdk.api.json.Response)}
or an Exception {@link io.kickflip.... | [
"Login",
"an",
"exiting",
"Kickflip",
"User",
"and",
"make",
"it",
"active",
"."
] | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L214-L234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.