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 |
|---|---|---|---|---|---|---|---|---|---|---|
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/search/FileSearchExtensions.java | FileSearchExtensions.containsFile | public static boolean containsFile(final File parent, final File search) {
"""
Checks if the given file contains only in the parent file, not in the subdirectories.
@param parent
The parent directory to search.
@param search
The file to search.
@return 's true if the file exists in the parent directory othe... | java | public static boolean containsFile(final File parent, final File search)
{
boolean exists = false;
final String[] children = parent.list();
if (children == null)
{
return false;
}
final List<String> fileList = Arrays.asList(children);
if (fileList.contains(search.getName()))
{
exists = true;
}
... | [
"public",
"static",
"boolean",
"containsFile",
"(",
"final",
"File",
"parent",
",",
"final",
"File",
"search",
")",
"{",
"boolean",
"exists",
"=",
"false",
";",
"final",
"String",
"[",
"]",
"children",
"=",
"parent",
".",
"list",
"(",
")",
";",
"if",
"... | Checks if the given file contains only in the parent file, not in the subdirectories.
@param parent
The parent directory to search.
@param search
The file to search.
@return 's true if the file exists in the parent directory otherwise false. | [
"Checks",
"if",
"the",
"given",
"file",
"contains",
"only",
"in",
"the",
"parent",
"file",
"not",
"in",
"the",
"subdirectories",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/search/FileSearchExtensions.java#L55-L69 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.GT | public static void GT(char parameter, char expected, String name) throws IllegalArgumentException {
"""
Test if character parameter is strictly greater than given character value.
@param parameter invocation character parameter,
@param expected expected character value,
@param name the name of invocation para... | java | public static void GT(char parameter, char expected, String name) throws IllegalArgumentException {
if (parameter <= expected) {
throw new IllegalArgumentException(String.format("%s is not greater than %c.", name, expected));
}
} | [
"public",
"static",
"void",
"GT",
"(",
"char",
"parameter",
",",
"char",
"expected",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"parameter",
"<=",
"expected",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"St... | Test if character parameter is strictly greater than given character value.
@param parameter invocation character parameter,
@param expected expected character value,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> is not greater than threshold character. | [
"Test",
"if",
"character",
"parameter",
"is",
"strictly",
"greater",
"than",
"given",
"character",
"value",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L373-L377 |
qiujuer/Genius-Android | caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/StatePaintDrawable.java | StatePaintDrawable.updateTintFilter | PorterDuffColorFilter updateTintFilter(PorterDuffColorFilter tintFilter, ColorStateList tint,
PorterDuff.Mode tintMode) {
"""
Ensures the tint filter is consistent with the current tint color and
mode.
"""
if (tint == null || tintMode == null) {
r... | java | PorterDuffColorFilter updateTintFilter(PorterDuffColorFilter tintFilter, ColorStateList tint,
PorterDuff.Mode tintMode) {
if (tint == null || tintMode == null) {
return null;
}
final int color = tint.getColorForState(getState(), Color.TRANS... | [
"PorterDuffColorFilter",
"updateTintFilter",
"(",
"PorterDuffColorFilter",
"tintFilter",
",",
"ColorStateList",
"tint",
",",
"PorterDuff",
".",
"Mode",
"tintMode",
")",
"{",
"if",
"(",
"tint",
"==",
"null",
"||",
"tintMode",
"==",
"null",
")",
"{",
"return",
"nu... | Ensures the tint filter is consistent with the current tint color and
mode. | [
"Ensures",
"the",
"tint",
"filter",
"is",
"consistent",
"with",
"the",
"current",
"tint",
"color",
"and",
"mode",
"."
] | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/drawable/StatePaintDrawable.java#L187-L212 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java | AbstractMemberWriter.addModifiers | protected void addModifiers(MemberDoc member, Content htmltree) {
"""
Add the modifier for the member.
@param member the member for which teh modifier will be added.
@param htmltree the content tree to which the modifier information will be added.
"""
String mod = modifierString(member);
//... | java | protected void addModifiers(MemberDoc member, Content htmltree) {
String mod = modifierString(member);
// According to JLS, we should not be showing public modifier for
// interface methods.
if ((member.isField() || member.isMethod()) &&
writer instanceof ClassWriterImpl &&
... | [
"protected",
"void",
"addModifiers",
"(",
"MemberDoc",
"member",
",",
"Content",
"htmltree",
")",
"{",
"String",
"mod",
"=",
"modifierString",
"(",
"member",
")",
";",
"// According to JLS, we should not be showing public modifier for",
"// interface methods.",
"if",
"(",... | Add the modifier for the member.
@param member the member for which teh modifier will be added.
@param htmltree the content tree to which the modifier information will be added. | [
"Add",
"the",
"modifier",
"for",
"the",
"member",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java#L234-L254 |
xiancloud/xian | xian-cache/xian-redis/src/main/java/info/xiancloud/cache/redis/operate/ServerOperate.java | ServerOperate.getAttributeInInfo | public static String getAttributeInInfo(String info, String attribute) {
"""
根据 info 获取具体属性的值
@param info info
@param attribute attribute name
@return attribute in info
"""
if (info == null || "".equals(info))
return null;
if (attribute == null || "".equals(attribute))
... | java | public static String getAttributeInInfo(String info, String attribute) {
if (info == null || "".equals(info))
return null;
if (attribute == null || "".equals(attribute))
return null;
String[] infos = info.split("\r\n");
for (String _info : infos) {
i... | [
"public",
"static",
"String",
"getAttributeInInfo",
"(",
"String",
"info",
",",
"String",
"attribute",
")",
"{",
"if",
"(",
"info",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"info",
")",
")",
"return",
"null",
";",
"if",
"(",
"attribute",
"==",
"... | 根据 info 获取具体属性的值
@param info info
@param attribute attribute name
@return attribute in info | [
"根据",
"info",
"获取具体属性的值"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-cache/xian-redis/src/main/java/info/xiancloud/cache/redis/operate/ServerOperate.java#L34-L51 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.beginCreateOrUpdateByIdAsync | public Observable<GenericResourceInner> beginCreateOrUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
"""
Create a resource by ID.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid... | java | public Observable<GenericResourceInner> beginCreateOrUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
return beginCreateOrUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
... | [
"public",
"Observable",
"<",
"GenericResourceInner",
">",
"beginCreateOrUpdateByIdAsync",
"(",
"String",
"resourceId",
",",
"String",
"apiVersion",
",",
"GenericResourceInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateByIdWithServiceResponseAsync",
"(",
"resource... | Create a resource by ID.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
@param apiVersion The API version to use for the ope... | [
"Create",
"a",
"resource",
"by",
"ID",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L2168-L2175 |
junit-team/junit4 | src/main/java/org/junit/Assert.java | Assert.assertNull | public static void assertNull(String message, Object object) {
"""
Asserts that an object is null. If it is not, an {@link AssertionError}
is thrown with the given message.
@param message the identifying message for the {@link AssertionError} (<code>null</code>
okay)
@param object Object to check or <code>nu... | java | public static void assertNull(String message, Object object) {
if (object == null) {
return;
}
failNotNull(message, object);
} | [
"public",
"static",
"void",
"assertNull",
"(",
"String",
"message",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
";",
"}",
"failNotNull",
"(",
"message",
",",
"object",
")",
";",
"}"
] | Asserts that an object is null. If it is not, an {@link AssertionError}
is thrown with the given message.
@param message the identifying message for the {@link AssertionError} (<code>null</code>
okay)
@param object Object to check or <code>null</code> | [
"Asserts",
"that",
"an",
"object",
"is",
"null",
".",
"If",
"it",
"is",
"not",
"an",
"{",
"@link",
"AssertionError",
"}",
"is",
"thrown",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/Assert.java#L734-L739 |
Jasig/uPortal | uPortal-api/uPortal-api-platform-impl/src/main/java/org/apereo/portal/api/groups/EntityService.java | EntityService.lookupEntityName | public String lookupEntityName(Entity entity) {
"""
Convenience method that looks up the name of the given group member. Used for person types.
@param entity Entity to look up
@return groupMember's name or null if there's an error
"""
if (entity == null) {
return null;
}
... | java | public String lookupEntityName(Entity entity) {
if (entity == null) {
return null;
}
EntityEnum entityEnum = EntityEnum.getEntityEnum(entity.getEntityType());
return lookupEntityName(entityEnum, entity.getId());
} | [
"public",
"String",
"lookupEntityName",
"(",
"Entity",
"entity",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"EntityEnum",
"entityEnum",
"=",
"EntityEnum",
".",
"getEntityEnum",
"(",
"entity",
".",
"getEntityType",
"(",... | Convenience method that looks up the name of the given group member. Used for person types.
@param entity Entity to look up
@return groupMember's name or null if there's an error | [
"Convenience",
"method",
"that",
"looks",
"up",
"the",
"name",
"of",
"the",
"given",
"group",
"member",
".",
"Used",
"for",
"person",
"types",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-platform-impl/src/main/java/org/apereo/portal/api/groups/EntityService.java#L205-L211 |
MenoData/Time4J | base/src/main/java/net/time4j/calendar/astro/JulianDay.java | JulianDay.ofEphemerisTime | public static JulianDay ofEphemerisTime(Moment moment) {
"""
/*[deutsch]
<p>Erzeugt einen julianischen Tag auf der Zeitskala {@link TimeScale#TT},
manchmal auch <em>Julian Ephemeris Day</em> genannt. </p>
<p>Diese Art des julianischen Tages repräsentiert den aktuellen astronomischen Standard.
Die Zeit T... | java | public static JulianDay ofEphemerisTime(Moment moment) {
return new JulianDay(getValue(moment, TimeScale.TT), TimeScale.TT);
} | [
"public",
"static",
"JulianDay",
"ofEphemerisTime",
"(",
"Moment",
"moment",
")",
"{",
"return",
"new",
"JulianDay",
"(",
"getValue",
"(",
"moment",
",",
"TimeScale",
".",
"TT",
")",
",",
"TimeScale",
".",
"TT",
")",
";",
"}"
] | /*[deutsch]
<p>Erzeugt einen julianischen Tag auf der Zeitskala {@link TimeScale#TT},
manchmal auch <em>Julian Ephemeris Day</em> genannt. </p>
<p>Diese Art des julianischen Tages repräsentiert den aktuellen astronomischen Standard.
Die Zeit TT-2000-01-01T12:00Z entspricht JD(TT)2451545.0 </p>
@param moment ... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Erzeugt",
"einen",
"julianischen",
"Tag",
"auf",
"der",
"Zeitskala",
"{",
"@link",
"TimeScale#TT",
"}",
"manchmal",
"auch",
"<em",
">",
"Julian",
"Ephemeris",
"Day<",
"/",
"em",
">",
"genannt",
".",
"<",
"/",
... | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/astro/JulianDay.java#L185-L189 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJLineChartBuilder.java | DJLineChartBuilder.addSerie | public DJLineChartBuilder addSerie(AbstractColumn column, String label) {
"""
Adds the specified serie column to the dataset with custom label.
@param column the serie column
@param label column the custom label
"""
getDataset().addSerie(column, label);
return this;
} | java | public DJLineChartBuilder addSerie(AbstractColumn column, String label) {
getDataset().addSerie(column, label);
return this;
} | [
"public",
"DJLineChartBuilder",
"addSerie",
"(",
"AbstractColumn",
"column",
",",
"String",
"label",
")",
"{",
"getDataset",
"(",
")",
".",
"addSerie",
"(",
"column",
",",
"label",
")",
";",
"return",
"this",
";",
"}"
] | Adds the specified serie column to the dataset with custom label.
@param column the serie column
@param label column the custom label | [
"Adds",
"the",
"specified",
"serie",
"column",
"to",
"the",
"dataset",
"with",
"custom",
"label",
"."
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJLineChartBuilder.java#L366-L369 |
litsec/eidas-opensaml | opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java | RequestedAttributeTemplates.CURRENT_FAMILY_NAME | public static RequestedAttribute CURRENT_FAMILY_NAME(Boolean isRequired, boolean includeFriendlyName) {
"""
Creates a {@code RequestedAttribute} object for the CurrentFamilyName attribute.
@param isRequired
flag to tell whether the attribute is required
@param includeFriendlyName
flag that tells whether the ... | java | public static RequestedAttribute CURRENT_FAMILY_NAME(Boolean isRequired, boolean includeFriendlyName) {
return create(AttributeConstants.EIDAS_CURRENT_FAMILY_NAME_ATTRIBUTE_NAME,
includeFriendlyName ? AttributeConstants.EIDAS_CURRENT_FAMILY_NAME_ATTRIBUTE_FRIENDLY_NAME : null,
Attribute.URI_REFERENCE, i... | [
"public",
"static",
"RequestedAttribute",
"CURRENT_FAMILY_NAME",
"(",
"Boolean",
"isRequired",
",",
"boolean",
"includeFriendlyName",
")",
"{",
"return",
"create",
"(",
"AttributeConstants",
".",
"EIDAS_CURRENT_FAMILY_NAME_ATTRIBUTE_NAME",
",",
"includeFriendlyName",
"?",
"... | Creates a {@code RequestedAttribute} object for the CurrentFamilyName attribute.
@param isRequired
flag to tell whether the attribute is required
@param includeFriendlyName
flag that tells whether the friendly name should be included
@return a {@code RequestedAttribute} object representing the CurrentFamilyName attrib... | [
"Creates",
"a",
"{",
"@code",
"RequestedAttribute",
"}",
"object",
"for",
"the",
"CurrentFamilyName",
"attribute",
"."
] | train | https://github.com/litsec/eidas-opensaml/blob/522ba6dba433a9524cb8a02464cc3b087b47a2b7/opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java#L56-L60 |
cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/RotatableBondsCountDescriptor.java | RotatableBondsCountDescriptor.isAmide | private boolean isAmide(IAtom atom0, IAtom atom1, IAtomContainer ac) {
"""
Checks whether both atoms are involved in an amide C-N bond: *N(*)C(*)=O.
Only the most common constitution is considered. Tautomeric, O\C(*)=N\*,
and charged forms, [O-]\C(*)=N\*, are ignored.
@param atom0 the first bonding partner
... | java | private boolean isAmide(IAtom atom0, IAtom atom1, IAtomContainer ac) {
if (atom0.getSymbol().equals("C") && atom1.getSymbol().equals("N")) {
for (IAtom neighbor : ac.getConnectedAtomsList(atom0)) {
if (neighbor.getSymbol().equals("O")
&& ac.getBond(atom0, nei... | [
"private",
"boolean",
"isAmide",
"(",
"IAtom",
"atom0",
",",
"IAtom",
"atom1",
",",
"IAtomContainer",
"ac",
")",
"{",
"if",
"(",
"atom0",
".",
"getSymbol",
"(",
")",
".",
"equals",
"(",
"\"C\"",
")",
"&&",
"atom1",
".",
"getSymbol",
"(",
")",
".",
"e... | Checks whether both atoms are involved in an amide C-N bond: *N(*)C(*)=O.
Only the most common constitution is considered. Tautomeric, O\C(*)=N\*,
and charged forms, [O-]\C(*)=N\*, are ignored.
@param atom0 the first bonding partner
@param atom1 the second bonding partner
@param ac the parent container
@return if bo... | [
"Checks",
"whether",
"both",
"atoms",
"are",
"involved",
"in",
"an",
"amide",
"C",
"-",
"N",
"bond",
":",
"*",
"N",
"(",
"*",
")",
"C",
"(",
"*",
")",
"=",
"O",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/RotatableBondsCountDescriptor.java#L203-L214 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/TraceId.java | TraceId.fromLowerBase16 | public static TraceId fromLowerBase16(CharSequence src, int srcOffset) {
"""
Returns a {@code TraceId} built from a lowercase base16 representation.
@param src the lowercase base16 representation.
@param srcOffset the offset in the buffer where the representation of the {@code TraceId}
begins.
@return a {@co... | java | public static TraceId fromLowerBase16(CharSequence src, int srcOffset) {
Utils.checkNotNull(src, "src");
return new TraceId(
BigendianEncoding.longFromBase16String(src, srcOffset),
BigendianEncoding.longFromBase16String(src, srcOffset + BigendianEncoding.LONG_BASE16));
} | [
"public",
"static",
"TraceId",
"fromLowerBase16",
"(",
"CharSequence",
"src",
",",
"int",
"srcOffset",
")",
"{",
"Utils",
".",
"checkNotNull",
"(",
"src",
",",
"\"src\"",
")",
";",
"return",
"new",
"TraceId",
"(",
"BigendianEncoding",
".",
"longFromBase16String"... | Returns a {@code TraceId} built from a lowercase base16 representation.
@param src the lowercase base16 representation.
@param srcOffset the offset in the buffer where the representation of the {@code TraceId}
begins.
@return a {@code TraceId} built from a lowercase base16 representation.
@throws NullPointerException ... | [
"Returns",
"a",
"{",
"@code",
"TraceId",
"}",
"built",
"from",
"a",
"lowercase",
"base16",
"representation",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/TraceId.java#L126-L131 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.simpleFormat | public static String simpleFormat(final String format, final Object... args) {
"""
Simple replacement for String.format(), works only with %s but it's enough for logging or exceptions.
@param format
A <a href="../util/Formatter.html#syntax">format string</a>
@param args
Arguments referenced by the format... | java | public static String simpleFormat(final String format, final Object... args) {
String retVal = format;
for (final Object current : args) {
String argString = null;
try {
argString = StringUtils.substring(java.util.Objects.toString(current), 0, 256);
... | [
"public",
"static",
"String",
"simpleFormat",
"(",
"final",
"String",
"format",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"String",
"retVal",
"=",
"format",
";",
"for",
"(",
"final",
"Object",
"current",
":",
"args",
")",
"{",
"String",
"argString",... | Simple replacement for String.format(), works only with %s but it's enough for logging or exceptions.
@param format
A <a href="../util/Formatter.html#syntax">format string</a>
@param args
Arguments referenced by the format specifiers in the format
string. If there are more arguments than format specifiers, the
ext... | [
"Simple",
"replacement",
"for",
"String",
".",
"format",
"()",
"works",
"only",
"with",
"%s",
"but",
"it",
"s",
"enough",
"for",
"logging",
"or",
"exceptions",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L9283-L9296 |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java | SoapParser.parseSoap11Fault | private void parseSoap11Fault(Document soapMessage, PrintWriter logger)
throws Exception {
"""
A method to parse a SOAP 1.1 fault message.
@param soapMessage
the SOAP 1.1 fault message to parse
@param logger
the PrintWriter to log all results to
@return void
@author Simone Gianfranceschi
... | java | private void parseSoap11Fault(Document soapMessage, PrintWriter logger)
throws Exception {
Element envelope = soapMessage.getDocumentElement();
Element element = DomUtils.getElementByTagName(envelope, "faultcode");
if (element == null) {
element = DomUtils.getElementByTag... | [
"private",
"void",
"parseSoap11Fault",
"(",
"Document",
"soapMessage",
",",
"PrintWriter",
"logger",
")",
"throws",
"Exception",
"{",
"Element",
"envelope",
"=",
"soapMessage",
".",
"getDocumentElement",
"(",
")",
";",
"Element",
"element",
"=",
"DomUtils",
".",
... | A method to parse a SOAP 1.1 fault message.
@param soapMessage
the SOAP 1.1 fault message to parse
@param logger
the PrintWriter to log all results to
@return void
@author Simone Gianfranceschi | [
"A",
"method",
"to",
"parse",
"a",
"SOAP",
"1",
".",
"1",
"fault",
"message",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java#L282-L303 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.MAIN | public static HtmlTree MAIN(Content body) {
"""
Generates a MAIN tag with role attribute and some content.
@param body content of the MAIN tag
@return an HtmlTree object for the MAIN tag
"""
HtmlTree htmltree = new HtmlTree(HtmlTag.MAIN, nullCheck(body));
htmltree.setRole(Role.MAIN);
... | java | public static HtmlTree MAIN(Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.MAIN, nullCheck(body));
htmltree.setRole(Role.MAIN);
return htmltree;
} | [
"public",
"static",
"HtmlTree",
"MAIN",
"(",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"MAIN",
",",
"nullCheck",
"(",
"body",
")",
")",
";",
"htmltree",
".",
"setRole",
"(",
"Role",
".",
"MAIN",
"... | Generates a MAIN tag with role attribute and some content.
@param body content of the MAIN tag
@return an HtmlTree object for the MAIN tag | [
"Generates",
"a",
"MAIN",
"tag",
"with",
"role",
"attribute",
"and",
"some",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L547-L551 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java | CmsContainerpageHandler.createMenuEntryForElementView | private CmsContextMenuEntry createMenuEntryForElementView(
final CmsElementViewInfo elementView,
boolean isActive,
I_CmsContextMenuHandler handler) {
"""
Creates the menu entry for a single element view.<p>
@param elementView the element view
@param isActive if the group is the currentl... | java | private CmsContextMenuEntry createMenuEntryForElementView(
final CmsElementViewInfo elementView,
boolean isActive,
I_CmsContextMenuHandler handler) {
CmsContextMenuEntry menuEntry = new CmsContextMenuEntry(handler, null, new I_CmsContextMenuCommand() {
public void execute(
... | [
"private",
"CmsContextMenuEntry",
"createMenuEntryForElementView",
"(",
"final",
"CmsElementViewInfo",
"elementView",
",",
"boolean",
"isActive",
",",
"I_CmsContextMenuHandler",
"handler",
")",
"{",
"CmsContextMenuEntry",
"menuEntry",
"=",
"new",
"CmsContextMenuEntry",
"(",
... | Creates the menu entry for a single element view.<p>
@param elementView the element view
@param isActive if the group is the currently active group
@param handler the menu handler
@return the menu entry | [
"Creates",
"the",
"menu",
"entry",
"for",
"a",
"single",
"element",
"view",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java#L1598-L1636 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/TopScreen.java | TopScreen.checkSecurity | public ScreenModel checkSecurity(ScreenModel screen, ScreenModel parentScreen) {
"""
Make sure I am allowed access to this screen.
@param strClassResource
@return
"""
int iErrorCode = DBConstants.NORMAL_RETURN;
if (screen != null)
iErrorCode = ((BaseScreen)screen).checkSecurity();... | java | public ScreenModel checkSecurity(ScreenModel screen, ScreenModel parentScreen)
{
int iErrorCode = DBConstants.NORMAL_RETURN;
if (screen != null)
iErrorCode = ((BaseScreen)screen).checkSecurity();
if (iErrorCode == Constants.READ_ACCESS)
{
((BaseScreen)screen).... | [
"public",
"ScreenModel",
"checkSecurity",
"(",
"ScreenModel",
"screen",
",",
"ScreenModel",
"parentScreen",
")",
"{",
"int",
"iErrorCode",
"=",
"DBConstants",
".",
"NORMAL_RETURN",
";",
"if",
"(",
"screen",
"!=",
"null",
")",
"iErrorCode",
"=",
"(",
"(",
"Base... | Make sure I am allowed access to this screen.
@param strClassResource
@return | [
"Make",
"sure",
"I",
"am",
"allowed",
"access",
"to",
"this",
"screen",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/TopScreen.java#L370-L389 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/PropertiesField.java | PropertiesField.setProperties | public int setProperties(Map<String,Object> properties) {
"""
Set this property in the user's property area.
@param strProperty The property key.
@param strValue The property value.
"""
return this.setProperties(properties, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
} | java | public int setProperties(Map<String,Object> properties)
{
return this.setProperties(properties, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
} | [
"public",
"int",
"setProperties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"return",
"this",
".",
"setProperties",
"(",
"properties",
",",
"DBConstants",
".",
"DISPLAY",
",",
"DBConstants",
".",
"SCREEN_MOVE",
")",
";",
"}"
] | Set this property in the user's property area.
@param strProperty The property key.
@param strValue The property value. | [
"Set",
"this",
"property",
"in",
"the",
"user",
"s",
"property",
"area",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PropertiesField.java#L177-L180 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.validState | public void validState(final boolean expression, final String message, final Object... values) {
"""
<p>Validate that the stateful condition is {@code true}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as vali... | java | public void validState(final boolean expression, final String message, final Object... values) {
if (!expression) {
failIllegalState(String.format(message, values));
}
} | [
"public",
"void",
"validState",
"(",
"final",
"boolean",
"expression",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"failIllegalState",
"(",
"String",
".",
"format",
"(",
"mes... | <p>Validate that the stateful condition is {@code true}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as validating a primitive number or using your own custom validation expression.</p>
<pre>Validate.validState(this... | [
"<p",
">",
"Validate",
"that",
"the",
"stateful",
"condition",
"is",
"{",
"@code",
"true",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",
"according",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1145-L1149 |
knightliao/disconf | disconf-core/src/main/java/com/baidu/disconf/core/common/utils/OsUtil.java | OsUtil.transferFile | public static void transferFile(File src, File dest) throws Exception {
"""
@param src
@param dest
@return void
@Description: 转移文件
@author liaoqiqi
@date 2013-6-20
"""
// 删除文件
// LOGGER.info("start to remove download file: " + ""
// + dest.getAbsolutePath());
if (dest.... | java | public static void transferFile(File src, File dest) throws Exception {
// 删除文件
// LOGGER.info("start to remove download file: " + ""
// + dest.getAbsolutePath());
if (dest.exists()) {
dest.delete();
}
// 转移临时下载文件至下载文件夹
FileUtils.copyFile(src, dest);... | [
"public",
"static",
"void",
"transferFile",
"(",
"File",
"src",
",",
"File",
"dest",
")",
"throws",
"Exception",
"{",
"// 删除文件",
"// LOGGER.info(\"start to remove download file: \" + \"\"",
"// + dest.getAbsolutePath());",
"if",
"(",
"dest",
".",
"exists",
"(",
")",
"... | @param src
@param dest
@return void
@Description: 转移文件
@author liaoqiqi
@date 2013-6-20 | [
"@param",
"src",
"@param",
"dest"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-core/src/main/java/com/baidu/disconf/core/common/utils/OsUtil.java#L127-L138 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/FileListUtils.java | FileListUtils.listFilesToCopyAtPath | public static List<FileStatus> listFilesToCopyAtPath(FileSystem fs, Path path, PathFilter fileFilter,
boolean includeEmptyDirectories) throws IOException {
"""
Given a path to copy, list all files rooted at the given path to copy
@param fs the file system of the path
@param path root path to copy
@param... | java | public static List<FileStatus> listFilesToCopyAtPath(FileSystem fs, Path path, PathFilter fileFilter,
boolean includeEmptyDirectories) throws IOException {
return listFilesToCopyAtPath(fs, path, fileFilter, false, includeEmptyDirectories);
} | [
"public",
"static",
"List",
"<",
"FileStatus",
">",
"listFilesToCopyAtPath",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"PathFilter",
"fileFilter",
",",
"boolean",
"includeEmptyDirectories",
")",
"throws",
"IOException",
"{",
"return",
"listFilesToCopyAtPath",... | Given a path to copy, list all files rooted at the given path to copy
@param fs the file system of the path
@param path root path to copy
@param fileFilter a filter only applied to root
@param includeEmptyDirectories a control to include empty directories for copy | [
"Given",
"a",
"path",
"to",
"copy",
"list",
"all",
"files",
"rooted",
"at",
"the",
"given",
"path",
"to",
"copy"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/FileListUtils.java#L84-L87 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.shiftReactionVertical | public static double[] shiftReactionVertical(IReaction reaction, double[] bounds, double[] last, double gap) {
"""
Shift the containers in a reaction vertically upwards to not overlap with the reference
rectangle. The shift is such that the given gap is realized, but only if the reactions are
actually overlappin... | java | public static double[] shiftReactionVertical(IReaction reaction, double[] bounds, double[] last, double gap) {
assert bounds.length == 4;
assert last.length == 4;
final double boundsMinX = bounds[0];
final double boundsMinY = bounds[1];
final double boundsMaxX = bounds[2];
... | [
"public",
"static",
"double",
"[",
"]",
"shiftReactionVertical",
"(",
"IReaction",
"reaction",
",",
"double",
"[",
"]",
"bounds",
",",
"double",
"[",
"]",
"last",
",",
"double",
"gap",
")",
"{",
"assert",
"bounds",
".",
"length",
"==",
"4",
";",
"assert"... | Shift the containers in a reaction vertically upwards to not overlap with the reference
rectangle. The shift is such that the given gap is realized, but only if the reactions are
actually overlapping. To avoid dependence on Java AWT, rectangles are described by
arrays of double. Each rectangle is specified by {minX, mi... | [
"Shift",
"the",
"containers",
"in",
"a",
"reaction",
"vertically",
"upwards",
"to",
"not",
"overlap",
"with",
"the",
"reference",
"rectangle",
".",
"The",
"shift",
"is",
"such",
"that",
"the",
"given",
"gap",
"is",
"realized",
"but",
"only",
"if",
"the",
"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L1716-L1744 |
alkacon/opencms-core | src/org/opencms/security/CmsRoleManager.java | CmsRoleManager.hasRole | public boolean hasRole(CmsObject cms, String userName, CmsRole role) {
"""
Checks if the given user has the given role in the given organizational unit.<p>
@param cms the opencms context
@param userName the name of the user to check the role for
@param role the role to check
@return <code>true</code> if th... | java | public boolean hasRole(CmsObject cms, String userName, CmsRole role) {
CmsUser user;
try {
user = cms.readUser(userName);
} catch (CmsException e) {
// ignore
return false;
}
return m_securityManager.hasRole(cms.getRequestContext(), user, role... | [
"public",
"boolean",
"hasRole",
"(",
"CmsObject",
"cms",
",",
"String",
"userName",
",",
"CmsRole",
"role",
")",
"{",
"CmsUser",
"user",
";",
"try",
"{",
"user",
"=",
"cms",
".",
"readUser",
"(",
"userName",
")",
";",
"}",
"catch",
"(",
"CmsException",
... | Checks if the given user has the given role in the given organizational unit.<p>
@param cms the opencms context
@param userName the name of the user to check the role for
@param role the role to check
@return <code>true</code> if the given user has the given role in the given organizational unit | [
"Checks",
"if",
"the",
"given",
"user",
"has",
"the",
"given",
"role",
"in",
"the",
"given",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsRoleManager.java#L440-L450 |
alkacon/opencms-core | src/org/opencms/search/fields/CmsSearchFieldConfiguration.java | CmsSearchFieldConfiguration.addUninvertingMappings | @Override
public void addUninvertingMappings(Map<String, Type> uninvertingMap) {
"""
To allow sorting on a field the field must be added to the map given to {@link org.apache.solr.uninverting.UninvertingReader#wrap(org.apache.lucene.index.DirectoryReader, Map)}.
The method adds the configured fields.
@param ... | java | @Override
public void addUninvertingMappings(Map<String, Type> uninvertingMap) {
for (String fieldName : getFieldNames()) {
uninvertingMap.put(fieldName, Type.SORTED);
}
} | [
"@",
"Override",
"public",
"void",
"addUninvertingMappings",
"(",
"Map",
"<",
"String",
",",
"Type",
">",
"uninvertingMap",
")",
"{",
"for",
"(",
"String",
"fieldName",
":",
"getFieldNames",
"(",
")",
")",
"{",
"uninvertingMap",
".",
"put",
"(",
"fieldName",... | To allow sorting on a field the field must be added to the map given to {@link org.apache.solr.uninverting.UninvertingReader#wrap(org.apache.lucene.index.DirectoryReader, Map)}.
The method adds the configured fields.
@param uninvertingMap the map to which the fields are added. | [
"To",
"allow",
"sorting",
"on",
"a",
"field",
"the",
"field",
"must",
"be",
"added",
"to",
"the",
"map",
"given",
"to",
"{"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/fields/CmsSearchFieldConfiguration.java#L150-L157 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/document/json/JsonObject.java | JsonObject.getAndDecryptInt | @InterfaceStability.Committed
public Integer getAndDecryptInt(String name, String providerName) throws Exception {
"""
Retrieves the decrypted value from the field name and casts it to {@link Integer}.
Note that if value was stored as another numerical type, some truncation or rounding may occur.
@param ... | java | @InterfaceStability.Committed
public Integer getAndDecryptInt(String name, String providerName) throws Exception {
//let it fail in the more general case where it isn't actually a number
Number number = (Number) getAndDecrypt(name, providerName);
if (number == null) {
return null... | [
"@",
"InterfaceStability",
".",
"Committed",
"public",
"Integer",
"getAndDecryptInt",
"(",
"String",
"name",
",",
"String",
"providerName",
")",
"throws",
"Exception",
"{",
"//let it fail in the more general case where it isn't actually a number",
"Number",
"number",
"=",
"... | Retrieves the decrypted value from the field name and casts it to {@link Integer}.
Note that if value was stored as another numerical type, some truncation or rounding may occur.
@param name the name of the field.
@param providerName crypto provider name for decryption.
@return the result or null if it does not exist... | [
"Retrieves",
"the",
"decrypted",
"value",
"from",
"the",
"field",
"name",
"and",
"casts",
"it",
"to",
"{",
"@link",
"Integer",
"}",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L444-L455 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getFeatureLicense | public Set<InstallLicense> getFeatureLicense(String esaLocation, Locale locale) throws InstallException {
"""
Gets the licenses for the specified esa location.
@param esaLocation location of esa
@param locale Locale for the license
@return A set of InstallLicenses for the features at the esa location
@throws... | java | public Set<InstallLicense> getFeatureLicense(String esaLocation, Locale locale) throws InstallException {
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>();
getResolveDirector().resolve(esaLocation, "", product.get... | [
"public",
"Set",
"<",
"InstallLicense",
">",
"getFeatureLicense",
"(",
"String",
"esaLocation",
",",
"Locale",
"locale",
")",
"throws",
"InstallException",
"{",
"Set",
"<",
"InstallLicense",
">",
"licenses",
"=",
"new",
"HashSet",
"<",
"InstallLicense",
">",
"("... | Gets the licenses for the specified esa location.
@param esaLocation location of esa
@param locale Locale for the license
@return A set of InstallLicenses for the features at the esa location
@throws InstallException | [
"Gets",
"the",
"licenses",
"for",
"the",
"specified",
"esa",
"location",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L601-L627 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/scheduler/TriggerBasedScheduleLoader.java | TriggerBasedScheduleLoader.getBasicTimeChecker | private BasicTimeChecker getBasicTimeChecker(final Map<String, ConditionChecker> checkers) {
"""
expirecheckers or triggerCheckers only have BasicTimeChecker today. This should be refactored in future.
"""
for (final ConditionChecker checker : checkers.values()) {
if (checker.getType().equals(BasicTi... | java | private BasicTimeChecker getBasicTimeChecker(final Map<String, ConditionChecker> checkers) {
for (final ConditionChecker checker : checkers.values()) {
if (checker.getType().equals(BasicTimeChecker.type)) {
return (BasicTimeChecker) checker;
}
}
return null;
} | [
"private",
"BasicTimeChecker",
"getBasicTimeChecker",
"(",
"final",
"Map",
"<",
"String",
",",
"ConditionChecker",
">",
"checkers",
")",
"{",
"for",
"(",
"final",
"ConditionChecker",
"checker",
":",
"checkers",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"... | expirecheckers or triggerCheckers only have BasicTimeChecker today. This should be refactored in future. | [
"expirecheckers",
"or",
"triggerCheckers",
"only",
"have",
"BasicTimeChecker",
"today",
".",
"This",
"should",
"be",
"refactored",
"in",
"future",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/scheduler/TriggerBasedScheduleLoader.java#L170-L177 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/SparseIntArray.java | SparseIntArray.append | public void append(int key, int value) {
"""
Puts a key/value pair into the array, optimizing for the case where
the key is greater than all existing keys in the array.
"""
if (mSize != 0 && key <= mKeys[mSize - 1]) {
put(key, value);
return;
}
int pos = mSize;... | java | public void append(int key, int value) {
if (mSize != 0 && key <= mKeys[mSize - 1]) {
put(key, value);
return;
}
int pos = mSize;
if (pos >= mKeys.length) {
int n = ArrayUtils.idealIntArraySize(pos + 1);
int[] nkeys = new int[n];
... | [
"public",
"void",
"append",
"(",
"int",
"key",
",",
"int",
"value",
")",
"{",
"if",
"(",
"mSize",
"!=",
"0",
"&&",
"key",
"<=",
"mKeys",
"[",
"mSize",
"-",
"1",
"]",
")",
"{",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
";",
"}",
"in... | Puts a key/value pair into the array, optimizing for the case where
the key is greater than all existing keys in the array. | [
"Puts",
"a",
"key",
"/",
"value",
"pair",
"into",
"the",
"array",
"optimizing",
"for",
"the",
"case",
"where",
"the",
"key",
"is",
"greater",
"than",
"all",
"existing",
"keys",
"in",
"the",
"array",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/SparseIntArray.java#L240-L264 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/concurrent/SEPWorker.java | SEPWorker.assign | boolean assign(Work work, boolean self) {
"""
restores invariants of the various states (e.g. spinningCount, descheduled collection and thread park status)
"""
Work state = get();
while (state.canAssign(self))
{
if (!compareAndSet(state, work))
{
... | java | boolean assign(Work work, boolean self)
{
Work state = get();
while (state.canAssign(self))
{
if (!compareAndSet(state, work))
{
state = get();
continue;
}
// if we were spinning, exit the state (decrement the co... | [
"boolean",
"assign",
"(",
"Work",
"work",
",",
"boolean",
"self",
")",
"{",
"Work",
"state",
"=",
"get",
"(",
")",
";",
"while",
"(",
"state",
".",
"canAssign",
"(",
"self",
")",
")",
"{",
"if",
"(",
"!",
"compareAndSet",
"(",
"state",
",",
"work",... | restores invariants of the various states (e.g. spinningCount, descheduled collection and thread park status) | [
"restores",
"invariants",
"of",
"the",
"various",
"states",
"(",
"e",
".",
"g",
".",
"spinningCount",
"descheduled",
"collection",
"and",
"thread",
"park",
"status",
")"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/SEPWorker.java#L150-L176 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java | SessionDataManager.getItemByIdentifier | public ItemImpl getItemByIdentifier(String identifier, boolean pool) throws RepositoryException {
"""
Return item by identifier in this transient storage then in workspace container.
@param identifier
- identifier of searched item
@param pool
- indicates does the item fall in pool
@return existed item data ... | java | public ItemImpl getItemByIdentifier(String identifier, boolean pool) throws RepositoryException
{
return getItemByIdentifier(identifier, pool, true);
} | [
"public",
"ItemImpl",
"getItemByIdentifier",
"(",
"String",
"identifier",
",",
"boolean",
"pool",
")",
"throws",
"RepositoryException",
"{",
"return",
"getItemByIdentifier",
"(",
"identifier",
",",
"pool",
",",
"true",
")",
";",
"}"
] | Return item by identifier in this transient storage then in workspace container.
@param identifier
- identifier of searched item
@param pool
- indicates does the item fall in pool
@return existed item data or null if not found
@throws RepositoryException | [
"Return",
"item",
"by",
"identifier",
"in",
"this",
"transient",
"storage",
"then",
"in",
"workspace",
"container",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java#L650-L653 |
windup/windup | forks/jdt/src/main/java/org/eclipse/jdt/internal/compiler/Compiler.java | Compiler.reportProgress | protected void reportProgress(String taskDecription) {
"""
Checks whether the compilation has been canceled and reports the given progress to the compiler progress.
"""
if (this.progress != null) {
if (this.progress.isCanceled()) {
// Only AbortCompilation can stop the compi... | java | protected void reportProgress(String taskDecription) {
if (this.progress != null) {
if (this.progress.isCanceled()) {
// Only AbortCompilation can stop the compiler cleanly.
// We check cancellation again following the call to compile.
throw new AbortC... | [
"protected",
"void",
"reportProgress",
"(",
"String",
"taskDecription",
")",
"{",
"if",
"(",
"this",
".",
"progress",
"!=",
"null",
")",
"{",
"if",
"(",
"this",
".",
"progress",
".",
"isCanceled",
"(",
")",
")",
"{",
"// Only AbortCompilation can stop the comp... | Checks whether the compilation has been canceled and reports the given progress to the compiler progress. | [
"Checks",
"whether",
"the",
"compilation",
"has",
"been",
"canceled",
"and",
"reports",
"the",
"given",
"progress",
"to",
"the",
"compiler",
"progress",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/forks/jdt/src/main/java/org/eclipse/jdt/internal/compiler/Compiler.java#L414-L423 |
openbase/jul | extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/BuilderSyncSetup.java | BuilderSyncSetup.unlockWrite | public void unlockWrite(boolean notifyChange) {
"""
Method unlocks the write lock and notifies the change to the internal data holder.
In case the thread is externally interrupted, no InterruptedException is thrown but instead the interrupted flag is set for the corresponding thread.
Please use the service metho... | java | public void unlockWrite(boolean notifyChange) {
logger.debug("order write unlock");
writeLockTimeout.cancel();
writeLock.unlock();
writeLockConsumer = "Unknown";
logger.debug("write unlocked");
if (notifyChange) {
try {
try {
... | [
"public",
"void",
"unlockWrite",
"(",
"boolean",
"notifyChange",
")",
"{",
"logger",
".",
"debug",
"(",
"\"order write unlock\"",
")",
";",
"writeLockTimeout",
".",
"cancel",
"(",
")",
";",
"writeLock",
".",
"unlock",
"(",
")",
";",
"writeLockConsumer",
"=",
... | Method unlocks the write lock and notifies the change to the internal data holder.
In case the thread is externally interrupted, no InterruptedException is thrown but instead the interrupted flag is set for the corresponding thread.
Please use the service method Thread.currentThread().isInterrupted() to get informed ab... | [
"Method",
"unlocks",
"the",
"write",
"lock",
"and",
"notifies",
"the",
"change",
"to",
"the",
"internal",
"data",
"holder",
".",
"In",
"case",
"the",
"thread",
"is",
"externally",
"interrupted",
"no",
"InterruptedException",
"is",
"thrown",
"but",
"instead",
"... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/BuilderSyncSetup.java#L185-L202 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java | ExpressRouteCrossConnectionsInner.beginListRoutesTable | public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
"""
Gets the currently advertised routes table associated with the express route cross connection in a resource group.
@param resourceGroupNam... | java | public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBlocking().single().bod... | [
"public",
"ExpressRouteCircuitsRoutesTableListResultInner",
"beginListRoutesTable",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
",",
"String",
"peeringName",
",",
"String",
"devicePath",
")",
"{",
"return",
"beginListRoutesTableWithServiceResponseAsy... | Gets the currently advertised routes table associated with the express route cross connection in a resource group.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the ExpressRouteCrossConnection.
@param peeringName The name of the peering.
@param devicePath The path of t... | [
"Gets",
"the",
"currently",
"advertised",
"routes",
"table",
"associated",
"with",
"the",
"express",
"route",
"cross",
"connection",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java#L1367-L1369 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/comparators/AbsComparator.java | AbsComparator.getComparator | public static final AbsComparator getComparator(final INodeReadTrx paramRtx,
final AbsAxis paramOperandOne, final AbsAxis paramOperandTwo, final CompKind paramKind,
final String paramVal) {
"""
Factory method to implement the comparator.
@param paramRtx
rtx for accessing data
@param paramOpera... | java | public static final AbsComparator getComparator(final INodeReadTrx paramRtx,
final AbsAxis paramOperandOne, final AbsAxis paramOperandTwo, final CompKind paramKind,
final String paramVal) {
if ("eq".equals(paramVal) || "lt".equals(paramVal) || "le".equals(paramVal) || "gt".equals(paramVal)
... | [
"public",
"static",
"final",
"AbsComparator",
"getComparator",
"(",
"final",
"INodeReadTrx",
"paramRtx",
",",
"final",
"AbsAxis",
"paramOperandOne",
",",
"final",
"AbsAxis",
"paramOperandTwo",
",",
"final",
"CompKind",
"paramKind",
",",
"final",
"String",
"paramVal",
... | Factory method to implement the comparator.
@param paramRtx
rtx for accessing data
@param paramOperandOne
operand one to be compared
@param paramOperandTwo
operand two to be compared
@param paramKind
kind of comparison
@param paramVal
string value to estimate
@return AbsComparator the comparator of two axis | [
"Factory",
"method",
"to",
"implement",
"the",
"comparator",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/comparators/AbsComparator.java#L227-L240 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java | FtpFileUtil.deleteDirectoryFromFTPServer | public static boolean deleteDirectoryFromFTPServer(String hostName, Integer port, String userName, String password, String remotePath) {
"""
Delete given directory from FTP server (directory must be empty).
@param hostName the FTP server host name to connect
@param port the port to connect
@param userName the u... | java | public static boolean deleteDirectoryFromFTPServer(String hostName, Integer port, String userName, String password, String remotePath) {
boolean deleted = false;
FTPClient ftpClient = new FTPClient();
String errorMessage = "Could not delete the directory '%s' from FTP server '%s'. Cause: %s";
... | [
"public",
"static",
"boolean",
"deleteDirectoryFromFTPServer",
"(",
"String",
"hostName",
",",
"Integer",
"port",
",",
"String",
"userName",
",",
"String",
"password",
",",
"String",
"remotePath",
")",
"{",
"boolean",
"deleted",
"=",
"false",
";",
"FTPClient",
"... | Delete given directory from FTP server (directory must be empty).
@param hostName the FTP server host name to connect
@param port the port to connect
@param userName the user name
@param password the password
@param remotePath the path to the directory on the FTP to be removed
@return true if file has been removed and... | [
"Delete",
"given",
"directory",
"from",
"FTP",
"server",
"(",
"directory",
"must",
"be",
"empty",
")",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FtpFileUtil.java#L142-L157 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java | GlobalAddressClient.insertGlobalAddress | @BetaApi
public final Operation insertGlobalAddress(String project, Address addressResource) {
"""
Creates an address resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
Projec... | java | @BetaApi
public final Operation insertGlobalAddress(String project, Address addressResource) {
InsertGlobalAddressHttpRequest request =
InsertGlobalAddressHttpRequest.newBuilder()
.setProject(project)
.setAddressResource(addressResource)
.build();
return insertGlob... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertGlobalAddress",
"(",
"String",
"project",
",",
"Address",
"addressResource",
")",
"{",
"InsertGlobalAddressHttpRequest",
"request",
"=",
"InsertGlobalAddressHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjec... | Creates an address resource in the specified project using the data included in the request.
<p>Sample code:
<pre><code>
try (GlobalAddressClient globalAddressClient = GlobalAddressClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
Address addressResource = Address.newBuilder().build();
Operation r... | [
"Creates",
"an",
"address",
"resource",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/GlobalAddressClient.java#L406-L415 |
unbescape/unbescape | src/main/java/org/unbescape/xml/XmlEscape.java | XmlEscape.escapeXml10 | public static void escapeXml10(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform an XML 1.0 level 2 (markup-significant and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
... | java | public static void escapeXml10(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeXml(text, offset, len, writer, XmlEscapeSymbols.XML10_SYMBOLS,
XmlEscapeType.CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA,
... | [
"public",
"static",
"void",
"escapeXml10",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeXml",
"(",
"text",
",",
"offset",
",... | <p>
Perform an XML 1.0 level 2 (markup-significant and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The five markup-significant characters: <tt><</tt>, <tt>></tt>, <tt>&</tt>,
<tt>"</tt> and <tt>&... | [
"<p",
">",
"Perform",
"an",
"XML",
"1",
".",
"0",
"level",
"2",
"(",
"markup",
"-",
"significant",
"and",
"all",
"non",
"-",
"ASCII",
"chars",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L1945-L1950 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java | EurekaClinicalClient.doPostForm | protected void doPostForm(String path, MultivaluedMap<String, String> formParams) throws ClientException {
"""
Submits a form. Adds appropriate Accepts and Content Type headers.
@param path the API to call.
@param formParams the form parameters to send.
@throws ClientException if a status code other than 20... | java | protected void doPostForm(String path, MultivaluedMap<String, String> formParams) throws ClientException {
doPostForm(path, formParams, null);
} | [
"protected",
"void",
"doPostForm",
"(",
"String",
"path",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"formParams",
")",
"throws",
"ClientException",
"{",
"doPostForm",
"(",
"path",
",",
"formParams",
",",
"null",
")",
";",
"}"
] | Submits a form. Adds appropriate Accepts and Content Type headers.
@param path the API to call.
@param formParams the form parameters to send.
@throws ClientException if a status code other than 200 (OK) and 204 (No
Content) is returned. | [
"Submits",
"a",
"form",
".",
"Adds",
"appropriate",
"Accepts",
"and",
"Content",
"Type",
"headers",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L550-L552 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java | StringToObjectConverter.convertFromString | public Object convertFromString(String pType, String pValue) {
"""
Deserialize a string representation to an object for a given type
@param pType type to convert to
@param pValue the value to convert from
@return the converted value
"""
String value = convertSpecialStringTags(pValue);
if ... | java | public Object convertFromString(String pType, String pValue) {
String value = convertSpecialStringTags(pValue);
if (value == null) {
return null;
}
if (pType.startsWith("[") && pType.length() >= 2) {
return convertToArray(pType, value);
}
Parser ... | [
"public",
"Object",
"convertFromString",
"(",
"String",
"pType",
",",
"String",
"pValue",
")",
"{",
"String",
"value",
"=",
"convertSpecialStringTags",
"(",
"pValue",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
... | Deserialize a string representation to an object for a given type
@param pType type to convert to
@param pValue the value to convert from
@return the converted value | [
"Deserialize",
"a",
"string",
"representation",
"to",
"an",
"object",
"for",
"a",
"given",
"type"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/object/StringToObjectConverter.java#L203-L226 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSTransactionFactory.java | MSTransactionFactory.createAutoCommitTransaction | public ExternalAutoCommitTransaction createAutoCommitTransaction() {
"""
This method returns an object that represents a zero-phase or AutoCommit
transaction. It can be used to ensure that a piece of work is carried out
at once, essentially outside of a transaction coordination scope.
@return An instance of A... | java | public ExternalAutoCommitTransaction createAutoCommitTransaction()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createAutoCommitTransaction");
ExternalAutoCommitTransaction instance = new MSAutoCommitTransaction(_ms, _persistence, getMaximumTransactionSize());... | [
"public",
"ExternalAutoCommitTransaction",
"createAutoCommitTransaction",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createAutoCommit... | This method returns an object that represents a zero-phase or AutoCommit
transaction. It can be used to ensure that a piece of work is carried out
at once, essentially outside of a transaction coordination scope.
@return An instance of AutoCommitTransaction | [
"This",
"method",
"returns",
"an",
"object",
"that",
"represents",
"a",
"zero",
"-",
"phase",
"or",
"AutoCommit",
"transaction",
".",
"It",
"can",
"be",
"used",
"to",
"ensure",
"that",
"a",
"piece",
"of",
"work",
"is",
"carried",
"out",
"at",
"once",
"es... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSTransactionFactory.java#L59-L67 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsResourceTypeConfig.java | CmsResourceTypeConfig.getFolderPath | public String getFolderPath(CmsObject cms, String pageFolderRootPath) {
"""
Computes the folder path for this resource type.<p>
@param cms the cms context to use
@param pageFolderRootPath root path of the folder containing the current container page
@return the folder root path for this resource type
""... | java | public String getFolderPath(CmsObject cms, String pageFolderRootPath) {
checkInitialized();
if (m_folderOrName != null) {
return m_folderOrName.getFolderPath(cms, pageFolderRootPath);
} else {
String siteRoot = null;
if (pageFolderRootPath != null) {
... | [
"public",
"String",
"getFolderPath",
"(",
"CmsObject",
"cms",
",",
"String",
"pageFolderRootPath",
")",
"{",
"checkInitialized",
"(",
")",
";",
"if",
"(",
"m_folderOrName",
"!=",
"null",
")",
"{",
"return",
"m_folderOrName",
".",
"getFolderPath",
"(",
"cms",
"... | Computes the folder path for this resource type.<p>
@param cms the cms context to use
@param pageFolderRootPath root path of the folder containing the current container page
@return the folder root path for this resource type | [
"Computes",
"the",
"folder",
"path",
"for",
"this",
"resource",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsResourceTypeConfig.java#L474-L489 |
elvishew/xLog | library/src/main/java/com/elvishew/xlog/Logger.java | Logger.formatArgs | private String formatArgs(String format, Object... args) {
"""
Format a string with arguments.
@param format the format string, null if just to concat the arguments
@param args the arguments
@return the formatted string
"""
if (format != null) {
return String.format(format, args);
} else {... | java | private String formatArgs(String format, Object... args) {
if (format != null) {
return String.format(format, args);
} else {
StringBuilder sb = new StringBuilder();
for (int i = 0, N = args.length; i < N; i++) {
if (i != 0) {
sb.append(", ");
}
sb.append(args... | [
"private",
"String",
"formatArgs",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"format",
"!=",
"null",
")",
"{",
"return",
"String",
".",
"format",
"(",
"format",
",",
"args",
")",
";",
"}",
"else",
"{",
"StringBuilder",... | Format a string with arguments.
@param format the format string, null if just to concat the arguments
@param args the arguments
@return the formatted string | [
"Format",
"a",
"string",
"with",
"arguments",
"."
] | train | https://github.com/elvishew/xLog/blob/c6fb95555ce619d3e527f5ba6c45d4d247c5a838/library/src/main/java/com/elvishew/xlog/Logger.java#L609-L622 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java | ExceptionFactory.planVersionAlreadyExistsException | public static final PlanVersionAlreadyExistsException planVersionAlreadyExistsException(String planName, String version) {
"""
Creates an exception from an plan name.
@param planName the plan name
@param version the version
@return the exception
"""
return new PlanVersionAlreadyExistsException(Messa... | java | public static final PlanVersionAlreadyExistsException planVersionAlreadyExistsException(String planName, String version) {
return new PlanVersionAlreadyExistsException(Messages.i18n.format("PlanVersionAlreadyExists", planName, version)); //$NON-NLS-1$
} | [
"public",
"static",
"final",
"PlanVersionAlreadyExistsException",
"planVersionAlreadyExistsException",
"(",
"String",
"planName",
",",
"String",
"version",
")",
"{",
"return",
"new",
"PlanVersionAlreadyExistsException",
"(",
"Messages",
".",
"i18n",
".",
"format",
"(",
... | Creates an exception from an plan name.
@param planName the plan name
@param version the version
@return the exception | [
"Creates",
"an",
"exception",
"from",
"an",
"plan",
"name",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/util/ExceptionFactory.java#L292-L294 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java | BigDecimalMath.asinh | public static BigDecimal asinh(BigDecimal x, MathContext mathContext) {
"""
Calculates the arc hyperbolic sine (inverse hyperbolic sine) of {@link BigDecimal} x.
<p>See: <a href="https://en.wikipedia.org/wiki/Hyperbolic_function">Wikipedia: Hyperbolic function</a></p>
@param x the {@link BigDecimal} to calcu... | java | public static BigDecimal asinh(BigDecimal x, MathContext mathContext) {
checkMathContext(mathContext);
MathContext mc = new MathContext(mathContext.getPrecision() + 10, mathContext.getRoundingMode());
BigDecimal result = log(x.add(sqrt(x.multiply(x, mc).add(ONE, mc), mc), mc), mc);
return round(result, mathCont... | [
"public",
"static",
"BigDecimal",
"asinh",
"(",
"BigDecimal",
"x",
",",
"MathContext",
"mathContext",
")",
"{",
"checkMathContext",
"(",
"mathContext",
")",
";",
"MathContext",
"mc",
"=",
"new",
"MathContext",
"(",
"mathContext",
".",
"getPrecision",
"(",
")",
... | Calculates the arc hyperbolic sine (inverse hyperbolic sine) of {@link BigDecimal} x.
<p>See: <a href="https://en.wikipedia.org/wiki/Hyperbolic_function">Wikipedia: Hyperbolic function</a></p>
@param x the {@link BigDecimal} to calculate the arc hyperbolic sine for
@param mathContext the {@link MathContext} used for ... | [
"Calculates",
"the",
"arc",
"hyperbolic",
"sine",
"(",
"inverse",
"hyperbolic",
"sine",
")",
"of",
"{",
"@link",
"BigDecimal",
"}",
"x",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L1601-L1606 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/OListOperator.java | OListOperator.doExec | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws IOException, TemplateException {
"""
Execute OLIST operator. Behaves like {@link ListOperator#doExec(Element, Object, String, Object...)} counterpart but
takes care to create index and increment it ... | java | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws IOException, TemplateException {
if (!propertyPath.equals(".") && ConverterRegistry.hasType(scope.getClass())) {
throw new TemplateException("Operand is property path but scope is not an object.");... | [
"@",
"Override",
"protected",
"Object",
"doExec",
"(",
"Element",
"element",
",",
"Object",
"scope",
",",
"String",
"propertyPath",
",",
"Object",
"...",
"arguments",
")",
"throws",
"IOException",
",",
"TemplateException",
"{",
"if",
"(",
"!",
"propertyPath",
... | Execute OLIST operator. Behaves like {@link ListOperator#doExec(Element, Object, String, Object...)} counterpart but
takes care to create index and increment it before every item processing.
@param element context element,
@param scope scope object,
@param propertyPath property path,
@param arguments optional argument... | [
"Execute",
"OLIST",
"operator",
".",
"Behaves",
"like",
"{",
"@link",
"ListOperator#doExec",
"(",
"Element",
"Object",
"String",
"Object",
"...",
")",
"}",
"counterpart",
"but",
"takes",
"care",
"to",
"create",
"index",
"and",
"increment",
"it",
"before",
"eve... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/OListOperator.java#L59-L77 |
apache/incubator-druid | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java | TaskQueue.shutdown | public void shutdown(final String taskId, String reasonFormat, Object... args) {
"""
Shuts down a task if it has not yet finished.
@param taskId task to kill
"""
giant.lock();
try {
Preconditions.checkNotNull(taskId, "taskId");
for (final Task task : tasks) {
if (task.getId().eq... | java | public void shutdown(final String taskId, String reasonFormat, Object... args)
{
giant.lock();
try {
Preconditions.checkNotNull(taskId, "taskId");
for (final Task task : tasks) {
if (task.getId().equals(taskId)) {
notifyStatus(task, TaskStatus.failure(taskId), reasonFormat, args... | [
"public",
"void",
"shutdown",
"(",
"final",
"String",
"taskId",
",",
"String",
"reasonFormat",
",",
"Object",
"...",
"args",
")",
"{",
"giant",
".",
"lock",
"(",
")",
";",
"try",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"taskId",
",",
"\"taskId\"",
... | Shuts down a task if it has not yet finished.
@param taskId task to kill | [
"Shuts",
"down",
"a",
"task",
"if",
"it",
"has",
"not",
"yet",
"finished",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java#L383-L399 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/streaming/StreamTransferTask.java | StreamTransferTask.scheduleTimeout | public synchronized ScheduledFuture scheduleTimeout(final int sequenceNumber, long time, TimeUnit unit) {
"""
Schedule timeout task to release reference for file sent.
When not receiving ACK after sending to receiver in given time,
the task will release reference.
@param sequenceNumber sequence number of file... | java | public synchronized ScheduledFuture scheduleTimeout(final int sequenceNumber, long time, TimeUnit unit)
{
if (!files.containsKey(sequenceNumber))
return null;
ScheduledFuture future = timeoutExecutor.schedule(new Runnable()
{
public void run()
{
... | [
"public",
"synchronized",
"ScheduledFuture",
"scheduleTimeout",
"(",
"final",
"int",
"sequenceNumber",
",",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"!",
"files",
".",
"containsKey",
"(",
"sequenceNumber",
")",
")",
"return",
"null",
";",
... | Schedule timeout task to release reference for file sent.
When not receiving ACK after sending to receiver in given time,
the task will release reference.
@param sequenceNumber sequence number of file sent.
@param time time to timeout
@param unit unit of given time
@return scheduled future for timeout task | [
"Schedule",
"timeout",
"task",
"to",
"release",
"reference",
"for",
"file",
"sent",
".",
"When",
"not",
"receiving",
"ACK",
"after",
"sending",
"to",
"receiver",
"in",
"given",
"time",
"the",
"task",
"will",
"release",
"reference",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/StreamTransferTask.java#L153-L174 |
andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getItem | public <T> T getItem(final List<T> items, final int probability, final T defaultItem) {
"""
Returns a random item from a list of items or the defaultItem depending on the probability parameter. The
probability determines the chance (in %) of returning an item off the list versus the default value.
@param <T> I... | java | public <T> T getItem(final List<T> items, final int probability, final T defaultItem) {
if (items == null) {
throw new IllegalArgumentException("Item list cannot be null");
}
if (items.isEmpty()) {
throw new IllegalArgumentException("Item list cannot be empty");
}
return chance(... | [
"public",
"<",
"T",
">",
"T",
"getItem",
"(",
"final",
"List",
"<",
"T",
">",
"items",
",",
"final",
"int",
"probability",
",",
"final",
"T",
"defaultItem",
")",
"{",
"if",
"(",
"items",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Returns a random item from a list of items or the defaultItem depending on the probability parameter. The
probability determines the chance (in %) of returning an item off the list versus the default value.
@param <T> Item type in the list and to return
@param items List of items to choose from
@param probability chan... | [
"Returns",
"a",
"random",
"item",
"from",
"a",
"list",
"of",
"items",
"or",
"the",
"defaultItem",
"depending",
"on",
"the",
"probability",
"parameter",
".",
"The",
"probability",
"determines",
"the",
"chance",
"(",
"in",
"%",
")",
"of",
"returning",
"an",
... | train | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L137-L146 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optShort | public static short optShort(@Nullable Bundle bundle, @Nullable String key) {
"""
Returns a optional short value. In other words, returns the value mapped by key if it exists and is a short.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns (short) 0.
@param bundle a b... | java | public static short optShort(@Nullable Bundle bundle, @Nullable String key) {
return optShort(bundle, key, (short) 0);
} | [
"public",
"static",
"short",
"optShort",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
")",
"{",
"return",
"optShort",
"(",
"bundle",
",",
"key",
",",
"(",
"short",
")",
"0",
")",
";",
"}"
] | Returns a optional short value. In other words, returns the value mapped by key if it exists and is a short.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns (short) 0.
@param bundle a bundle. If the bundle is null, this method will return (short) 0.
@param key a key for the... | [
"Returns",
"a",
"optional",
"short",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"short",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"be",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L814-L816 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.getTrace | public String getTrace(Object projectIdOrPath, int jobId) throws GitLabApiException {
"""
Get a trace of a specific job of a project
<pre><code>GitLab Endpoint: GET /projects/:id/jobs/:id/trace</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
... | java | public String getTrace(Object projectIdOrPath, int jobId) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "trace");
return (response.readEntity(String.class));
} | [
"public",
"String",
"getTrace",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"jobId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"getDefaultPerPageParam",
"(",
")",
",",
"\"pro... | Get a trace of a specific job of a project
<pre><code>GitLab Endpoint: GET /projects/:id/jobs/:id/trace</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
to get the specified job's trace for
@param jobId the job ID to get the trace for
@return a String c... | [
"Get",
"a",
"trace",
"of",
"a",
"specific",
"job",
"of",
"a",
"project"
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L425-L429 |
structr/structr | structr-ui/src/main/java/org/structr/web/common/FileHelper.java | FileHelper.createFile | public static <T extends File> T createFile(final SecurityContext securityContext, final InputStream fileStream, final String contentType, final Class<T> fileType, final String name, final Folder parentFolder)
throws FrameworkException, IOException {
"""
Create a new file node from the given input stream and set... | java | public static <T extends File> T createFile(final SecurityContext securityContext, final InputStream fileStream, final String contentType, final Class<T> fileType, final String name, final Folder parentFolder)
throws FrameworkException, IOException {
final PropertyMap props = new PropertyMap();
props.put(Struct... | [
"public",
"static",
"<",
"T",
"extends",
"File",
">",
"T",
"createFile",
"(",
"final",
"SecurityContext",
"securityContext",
",",
"final",
"InputStream",
"fileStream",
",",
"final",
"String",
"contentType",
",",
"final",
"Class",
"<",
"T",
">",
"fileType",
","... | Create a new file node from the given input stream and sets the parentFolder
@param <T>
@param securityContext
@param fileStream
@param contentType
@param fileType defaults to File.class if null
@param name
@param parentFolder
@return file
@throws FrameworkException
@throws IOException | [
"Create",
"a",
"new",
"file",
"node",
"from",
"the",
"given",
"input",
"stream",
"and",
"sets",
"the",
"parentFolder"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L152-L168 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java | GVRAssetLoader.loadScene | public void loadScene(final GVRSceneObject model, final GVRResourceVolume volume, final GVRScene scene, final IAssetEvents handler) {
"""
Loads a hierarchy of scene objects {@link GVRSceneObject} from a 3D model
replaces the current scene with it.
<p>
This function loads the model and its textures asynchronousl... | java | public void loadScene(final GVRSceneObject model, final GVRResourceVolume volume, final GVRScene scene, final IAssetEvents handler)
{
Threads.spawn(new Runnable()
{
public void run()
{
AssetRequest assetRequest = new AssetRequest(model, volume, scene, handler,... | [
"public",
"void",
"loadScene",
"(",
"final",
"GVRSceneObject",
"model",
",",
"final",
"GVRResourceVolume",
"volume",
",",
"final",
"GVRScene",
"scene",
",",
"final",
"IAssetEvents",
"handler",
")",
"{",
"Threads",
".",
"spawn",
"(",
"new",
"Runnable",
"(",
")"... | Loads a hierarchy of scene objects {@link GVRSceneObject} from a 3D model
replaces the current scene with it.
<p>
This function loads the model and its textures asynchronously in the background
and will return before the model is loaded.
IAssetEvents are emitted to event listener attached to the context.
@param model
... | [
"Loads",
"a",
"hierarchy",
"of",
"scene",
"objects",
"{",
"@link",
"GVRSceneObject",
"}",
"from",
"a",
"3D",
"model",
"replaces",
"the",
"current",
"scene",
"with",
"it",
".",
"<p",
">",
"This",
"function",
"loads",
"the",
"model",
"and",
"its",
"textures"... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java#L1176-L1205 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java | HeaderElement.setParseInformation | protected void setParseInformation(int index, int start) {
"""
Set the information about the WsByteBuffer parsing. This is
intended to be used during the parsing of the wsbb but prior
to actually pulling the value out into the byte[] or String
storage.
@param index
@param start
"""
this.buffInde... | java | protected void setParseInformation(int index, int start) {
this.buffIndex = index;
this.offset = start;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Set parse information " + this.buffIndex + " " + this.offset);
}
} | [
"protected",
"void",
"setParseInformation",
"(",
"int",
"index",
",",
"int",
"start",
")",
"{",
"this",
".",
"buffIndex",
"=",
"index",
";",
"this",
".",
"offset",
"=",
"start",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
... | Set the information about the WsByteBuffer parsing. This is
intended to be used during the parsing of the wsbb but prior
to actually pulling the value out into the byte[] or String
storage.
@param index
@param start | [
"Set",
"the",
"information",
"about",
"the",
"WsByteBuffer",
"parsing",
".",
"This",
"is",
"intended",
"to",
"be",
"used",
"during",
"the",
"parsing",
"of",
"the",
"wsbb",
"but",
"prior",
"to",
"actually",
"pulling",
"the",
"value",
"out",
"into",
"the",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java#L110-L117 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java | ParserDQL.readWindowSpecification | private Expression readWindowSpecification(int tokenT, Expression aggExpr) {
"""
This is a minimal parsing of the Window Specification. We only use
partition by and order by lists. There is a lot of complexity in the
full SQL specification which we don't parse at all.
@param tokenT
@param aggExpr
@return
... | java | private Expression readWindowSpecification(int tokenT, Expression aggExpr) {
SortAndSlice sortAndSlice = null;
readThis(Tokens.OPENBRACKET);
List<Expression> partitionByList = new ArrayList<>();
if (token.tokenType == Tokens.PARTITION) {
read();
readThis(Tokens.... | [
"private",
"Expression",
"readWindowSpecification",
"(",
"int",
"tokenT",
",",
"Expression",
"aggExpr",
")",
"{",
"SortAndSlice",
"sortAndSlice",
"=",
"null",
";",
"readThis",
"(",
"Tokens",
".",
"OPENBRACKET",
")",
";",
"List",
"<",
"Expression",
">",
"partitio... | This is a minimal parsing of the Window Specification. We only use
partition by and order by lists. There is a lot of complexity in the
full SQL specification which we don't parse at all.
@param tokenT
@param aggExpr
@return | [
"This",
"is",
"a",
"minimal",
"parsing",
"of",
"the",
"Window",
"Specification",
".",
"We",
"only",
"use",
"partition",
"by",
"and",
"order",
"by",
"lists",
".",
"There",
"is",
"a",
"lot",
"of",
"complexity",
"in",
"the",
"full",
"SQL",
"specification",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ParserDQL.java#L1734-L1786 |
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.createPatternAnyEntityRole | public UUID createPatternAnyEntityRole(UUID appId, String versionId, UUID entityId, CreatePatternAnyEntityRoleOptionalParameter createPatternAnyEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param en... | java | public UUID createPatternAnyEntityRole(UUID appId, String versionId, UUID entityId, CreatePatternAnyEntityRoleOptionalParameter createPatternAnyEntityRoleOptionalParameter) {
return createPatternAnyEntityRoleWithServiceResponseAsync(appId, versionId, entityId, createPatternAnyEntityRoleOptionalParameter).toBloc... | [
"public",
"UUID",
"createPatternAnyEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreatePatternAnyEntityRoleOptionalParameter",
"createPatternAnyEntityRoleOptionalParameter",
")",
"{",
"return",
"createPatternAnyEntityRoleWithService... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@param createPatternAnyEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentExce... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | 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#L9152-L9154 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/SpaceRepository.java | SpaceRepository.ensureLocalSpaceDefinition | @SuppressWarnings( {
"""
Add the existing, but not yet known, spaces into this repository.
@param id identifier of the space
@param initializationParameters parameters for initialization.
""" "unchecked", "rawtypes" })
protected void ensureLocalSpaceDefinition(SpaceID id, Object[] initializationParameters... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
protected void ensureLocalSpaceDefinition(SpaceID id, Object[] initializationParameters) {
synchronized (getSpaceRepositoryMutex()) {
if (!this.spaces.containsKey(id)) {
createSpaceInstance((Class) id.getSpaceSpecification(), id, false, initializationParameters);... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"protected",
"void",
"ensureLocalSpaceDefinition",
"(",
"SpaceID",
"id",
",",
"Object",
"[",
"]",
"initializationParameters",
")",
"{",
"synchronized",
"(",
"getSpaceRepositoryMutex",
... | Add the existing, but not yet known, spaces into this repository.
@param id identifier of the space
@param initializationParameters parameters for initialization. | [
"Add",
"the",
"existing",
"but",
"not",
"yet",
"known",
"spaces",
"into",
"this",
"repository",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/jdk/contextspace/SpaceRepository.java#L209-L216 |
alkacon/opencms-core | src/org/opencms/relations/CmsLinkUpdateUtil.java | CmsLinkUpdateUtil.updateXml | public static void updateXml(CmsLink link, Element element, boolean updateOnly) {
"""
Updates the link node in the underlying XML page document.<p>
@param link the link to update
@param element the <link> element to update
@param updateOnly if set and the element has no {@link CmsLink#NODE_TARGET} subel... | java | public static void updateXml(CmsLink link, Element element, boolean updateOnly) {
// if element is not null
if (element != null) {
if (!updateOnly || (element.element(CmsLink.NODE_TARGET) != null)) {
String strId = (link.getStructureId() == null ? null : link.getStructureId(... | [
"public",
"static",
"void",
"updateXml",
"(",
"CmsLink",
"link",
",",
"Element",
"element",
",",
"boolean",
"updateOnly",
")",
"{",
"// if element is not null",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"updateOnly",
"||",
"(",
"element",... | Updates the link node in the underlying XML page document.<p>
@param link the link to update
@param element the <link> element to update
@param updateOnly if set and the element has no {@link CmsLink#NODE_TARGET} subelement, so no action if executed at all | [
"Updates",
"the",
"link",
"node",
"in",
"the",
"underlying",
"XML",
"page",
"document",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsLinkUpdateUtil.java#L67-L80 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/RolesInner.java | RolesInner.getAsync | public Observable<RoleInner> getAsync(String deviceName, String name, String resourceGroupName) {
"""
Gets a specific role by name.
@param deviceName The device name.
@param name The role name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the va... | java | public Observable<RoleInner> getAsync(String deviceName, String name, String resourceGroupName) {
return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1<ServiceResponse<RoleInner>, RoleInner>() {
@Override
public RoleInner call(ServiceResponse<RoleInner> re... | [
"public",
"Observable",
"<",
"RoleInner",
">",
"getAsync",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"deviceName",
",",
"name",
",",
"resourceGroupName",
")",
"."... | Gets a specific role by name.
@param deviceName The device name.
@param name The role name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RoleInner object | [
"Gets",
"a",
"specific",
"role",
"by",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/RolesInner.java#L255-L262 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/util/GraphicUtils.java | GraphicUtils.drawArrow | public static void drawArrow(Graphics g, double x0, double y0, double x1, double y1, double weight) {
"""
Draws an arrow between two points (specified by their coordinates) using the specified weight.<br>
The arrow is leading from point <code>from</code> to point <code>to</code>.
@param g Graphics context
@para... | java | public static void drawArrow(Graphics g, double x0, double y0, double x1, double y1, double weight){
int ix2,iy2,ix3,iy3;
double sinPhi,cosPhi,dx,dy,xk1,yk1,xk2,yk2,s;
dx=x1-x0;
dy=y1-y0;
int maxArrowWidth = 10;
//arrow length
s=Math.sqrt(dy*dy+dx*dx);
//arrow head ... | [
"public",
"static",
"void",
"drawArrow",
"(",
"Graphics",
"g",
",",
"double",
"x0",
",",
"double",
"y0",
",",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"weight",
")",
"{",
"int",
"ix2",
",",
"iy2",
",",
"ix3",
",",
"iy3",
";",
"double",
"... | Draws an arrow between two points (specified by their coordinates) using the specified weight.<br>
The arrow is leading from point <code>from</code> to point <code>to</code>.
@param g Graphics context
@param x0 X coordinate of arrow starting point
@param y0 Y coordinate of arrow starting point
@param x1 X coordinate of... | [
"Draws",
"an",
"arrow",
"between",
"two",
"points",
"(",
"specified",
"by",
"their",
"coordinates",
")",
"using",
"the",
"specified",
"weight",
".",
"<br",
">",
"The",
"arrow",
"is",
"leading",
"from",
"point",
"<code",
">",
"from<",
"/",
"code",
">",
"t... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/util/GraphicUtils.java#L111-L152 |
matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.getCustomVariable | private CustomVariable getCustomVariable(String parameter, int index) {
"""
Get a value that is stored in a json object at the specified parameter.
@param parameter the parameter to retrieve the json object from
@param key the key of the value. Cannot be null
@return the value
"""
CustomVar... | java | private CustomVariable getCustomVariable(String parameter, int index){
CustomVariableList cvl = (CustomVariableList)parameters.get(parameter);
if (cvl == null){
return null;
}
return cvl.get(index);
} | [
"private",
"CustomVariable",
"getCustomVariable",
"(",
"String",
"parameter",
",",
"int",
"index",
")",
"{",
"CustomVariableList",
"cvl",
"=",
"(",
"CustomVariableList",
")",
"parameters",
".",
"get",
"(",
"parameter",
")",
";",
"if",
"(",
"cvl",
"==",
"null",... | Get a value that is stored in a json object at the specified parameter.
@param parameter the parameter to retrieve the json object from
@param key the key of the value. Cannot be null
@return the value | [
"Get",
"a",
"value",
"that",
"is",
"stored",
"in",
"a",
"json",
"object",
"at",
"the",
"specified",
"parameter",
"."
] | train | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1830-L1837 |
Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java | CompositeColumnEntityMapper.fillMutationBatch | public void fillMutationBatch(ColumnListMutation<ByteBuffer> clm, Object entity) throws IllegalArgumentException, IllegalAccessException {
"""
Iterate through the list and create a column for each element
@param clm
@param entity
@throws IllegalArgumentException
@throws IllegalAccessException
"""
L... | java | public void fillMutationBatch(ColumnListMutation<ByteBuffer> clm, Object entity) throws IllegalArgumentException, IllegalAccessException {
List<?> list = (List<?>) containerField.get(entity);
if (list != null) {
for (Object element : list) {
fillColumnMutation(clm, element);
... | [
"public",
"void",
"fillMutationBatch",
"(",
"ColumnListMutation",
"<",
"ByteBuffer",
">",
"clm",
",",
"Object",
"entity",
")",
"throws",
"IllegalArgumentException",
",",
"IllegalAccessException",
"{",
"List",
"<",
"?",
">",
"list",
"=",
"(",
"List",
"<",
"?",
... | Iterate through the list and create a column for each element
@param clm
@param entity
@throws IllegalArgumentException
@throws IllegalAccessException | [
"Iterate",
"through",
"the",
"list",
"and",
"create",
"a",
"column",
"for",
"each",
"element"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java#L111-L118 |
Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java | ConfigurationColumnWriter.build | private ColumnPrinter build(Map<String, Entry> entries) {
"""
Construct a ColumnPrinter using the entries
@param entries
@return
"""
ColumnPrinter printer = new ColumnPrinter();
printer.addColumn("PROPERTY");
printer.addColumn("FIELD");
printer.addColumn("DEFAULT");
... | java | private ColumnPrinter build(Map<String, Entry> entries)
{
ColumnPrinter printer = new ColumnPrinter();
printer.addColumn("PROPERTY");
printer.addColumn("FIELD");
printer.addColumn("DEFAULT");
printer.addColumn("VALUE");
printer.addColumn("DESCRIPTION");
Map<... | [
"private",
"ColumnPrinter",
"build",
"(",
"Map",
"<",
"String",
",",
"Entry",
">",
"entries",
")",
"{",
"ColumnPrinter",
"printer",
"=",
"new",
"ColumnPrinter",
"(",
")",
";",
"printer",
".",
"addColumn",
"(",
"\"PROPERTY\"",
")",
";",
"printer",
".",
"add... | Construct a ColumnPrinter using the entries
@param entries
@return | [
"Construct",
"a",
"ColumnPrinter",
"using",
"the",
"entries"
] | train | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java#L82-L104 |
JoeKerouac/utils | src/main/java/com/joe/utils/secure/impl/AsymmetricCipher.java | AsymmetricCipher.buildInstance | public static CipherUtil buildInstance(PrivateKey privateKey, PublicKey publicKey) {
"""
非对称加密构造器
@param privateKey PKCS8格式的私钥
@param publicKey X509格式的公钥
@return AsymmetricCipher
"""
return new AsymmetricCipher(new String(BASE_64.encrypt(privateKey.getEncoded())) + ":"
... | java | public static CipherUtil buildInstance(PrivateKey privateKey, PublicKey publicKey) {
return new AsymmetricCipher(new String(BASE_64.encrypt(privateKey.getEncoded())) + ":"
+ new String(BASE_64.encrypt(publicKey.getEncoded())),
Algorithms.RSA, privateKey, publicKey... | [
"public",
"static",
"CipherUtil",
"buildInstance",
"(",
"PrivateKey",
"privateKey",
",",
"PublicKey",
"publicKey",
")",
"{",
"return",
"new",
"AsymmetricCipher",
"(",
"new",
"String",
"(",
"BASE_64",
".",
"encrypt",
"(",
"privateKey",
".",
"getEncoded",
"(",
")"... | 非对称加密构造器
@param privateKey PKCS8格式的私钥
@param publicKey X509格式的公钥
@return AsymmetricCipher | [
"非对称加密构造器"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/secure/impl/AsymmetricCipher.java#L69-L73 |
hibernate/hibernate-metamodelgen | src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java | MetaAttributeGenerationVisitor.getTargetEntity | private String getTargetEntity(List<? extends AnnotationMirror> annotations) {
"""
@param annotations list of annotation mirrors.
@return target entity class name as string or {@code null} if no targetEntity is here or if equals to void
"""
String fullyQualifiedTargetEntityName = null;
for ( AnnotationM... | java | private String getTargetEntity(List<? extends AnnotationMirror> annotations) {
String fullyQualifiedTargetEntityName = null;
for ( AnnotationMirror mirror : annotations ) {
if ( TypeUtils.isAnnotationMirrorOfType( mirror, Constants.ELEMENT_COLLECTION ) ) {
fullyQualifiedTargetEntityName = getFullyQualifiedCl... | [
"private",
"String",
"getTargetEntity",
"(",
"List",
"<",
"?",
"extends",
"AnnotationMirror",
">",
"annotations",
")",
"{",
"String",
"fullyQualifiedTargetEntityName",
"=",
"null",
";",
"for",
"(",
"AnnotationMirror",
"mirror",
":",
"annotations",
")",
"{",
"if",
... | @param annotations list of annotation mirrors.
@return target entity class name as string or {@code null} if no targetEntity is here or if equals to void | [
"@param",
"annotations",
"list",
"of",
"annotation",
"mirrors",
"."
] | train | https://github.com/hibernate/hibernate-metamodelgen/blob/2c87b262bc03b1a5a541789fc00c54e0531a36b2/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java#L246-L263 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.existsResourceId | public boolean existsResourceId(CmsDbContext dbc, CmsUUID resourceId) throws CmsException {
"""
Tests if a resource with the given resourceId does already exist in the Database.<p>
@param dbc the current database context
@param resourceId the resource id to test for
@return true if a resource with the given i... | java | public boolean existsResourceId(CmsDbContext dbc, CmsUUID resourceId) throws CmsException {
return getVfsDriver(dbc).validateResourceIdExists(dbc, dbc.currentProject().getUuid(), resourceId);
} | [
"public",
"boolean",
"existsResourceId",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"resourceId",
")",
"throws",
"CmsException",
"{",
"return",
"getVfsDriver",
"(",
"dbc",
")",
".",
"validateResourceIdExists",
"(",
"dbc",
",",
"dbc",
".",
"currentProject",
"(",
... | Tests if a resource with the given resourceId does already exist in the Database.<p>
@param dbc the current database context
@param resourceId the resource id to test for
@return true if a resource with the given id was found, false otherweise
@throws CmsException if something goes wrong | [
"Tests",
"if",
"a",
"resource",
"with",
"the",
"given",
"resourceId",
"does",
"already",
"exist",
"in",
"the",
"Database",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L3246-L3249 |
vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.replaceAllEmojis | public static String replaceAllEmojis(String str, final String replacementString) {
"""
Replace all emojis with character
@param str the string to process
@param replacementString replacement the string that will replace all the emojis
@return the string with replaced character
"""
EmojiParser.EmojiTr... | java | public static String replaceAllEmojis(String str, final String replacementString) {
EmojiParser.EmojiTransformer emojiTransformer = new EmojiParser.EmojiTransformer() {
public String transform(EmojiParser.UnicodeCandidate unicodeCandidate) {
return replacementString;
}
};
return parseFr... | [
"public",
"static",
"String",
"replaceAllEmojis",
"(",
"String",
"str",
",",
"final",
"String",
"replacementString",
")",
"{",
"EmojiParser",
".",
"EmojiTransformer",
"emojiTransformer",
"=",
"new",
"EmojiParser",
".",
"EmojiTransformer",
"(",
")",
"{",
"public",
... | Replace all emojis with character
@param str the string to process
@param replacementString replacement the string that will replace all the emojis
@return the string with replaced character | [
"Replace",
"all",
"emojis",
"with",
"character"
] | train | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L94-L102 |
w3c/epubcheck | src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java | CSSCheckerFactory.newInstance | public ContentChecker newInstance(ValidationContext context, String value, int line,
boolean isStyleAttribute) {
"""
Additional constructor for validating CSS strings (style attributes and elements)
"""
return new CSSChecker(context, value, line, isStyleAttribute);
} | java | public ContentChecker newInstance(ValidationContext context, String value, int line,
boolean isStyleAttribute)
{
return new CSSChecker(context, value, line, isStyleAttribute);
} | [
"public",
"ContentChecker",
"newInstance",
"(",
"ValidationContext",
"context",
",",
"String",
"value",
",",
"int",
"line",
",",
"boolean",
"isStyleAttribute",
")",
"{",
"return",
"new",
"CSSChecker",
"(",
"context",
",",
"value",
",",
"line",
",",
"isStyleAttri... | Additional constructor for validating CSS strings (style attributes and elements) | [
"Additional",
"constructor",
"for",
"validating",
"CSS",
"strings",
"(",
"style",
"attributes",
"and",
"elements",
")"
] | train | https://github.com/w3c/epubcheck/blob/4d5a24d9f2878a2a5497eb11c036cc18fe2c0a78/src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java#L43-L47 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.subtractEquals | public static void subtractEquals( DMatrix2x2 a , DMatrix2x2 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a - b <br>
a<sub>ij</sub> = a<sub>ij</sub> - b<sub>ij</sub> <br>
</p>
@param a A Matrix. Modified.
@param b A Matrix. Not modified.
"""
a.a11 -= b.a11;
a.a12 -= b.a12... | java | public static void subtractEquals( DMatrix2x2 a , DMatrix2x2 b ) {
a.a11 -= b.a11;
a.a12 -= b.a12;
a.a21 -= b.a21;
a.a22 -= b.a22;
} | [
"public",
"static",
"void",
"subtractEquals",
"(",
"DMatrix2x2",
"a",
",",
"DMatrix2x2",
"b",
")",
"{",
"a",
".",
"a11",
"-=",
"b",
".",
"a11",
";",
"a",
".",
"a12",
"-=",
"b",
".",
"a12",
";",
"a",
".",
"a21",
"-=",
"b",
".",
"a21",
";",
"a",
... | <p>Performs the following operation:<br>
<br>
a = a - b <br>
a<sub>ij</sub> = a<sub>ij</sub> - b<sub>ij</sub> <br>
</p>
@param a A Matrix. Modified.
@param b A Matrix. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"-",
"b",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"-",
"b<sub",
">",
"ij<",
"/",
"sub",
"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L158-L163 |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParser.java | CfgParser.createParseChart | private CfgParseChart createParseChart(List<?> terminals, boolean useSumProduct) {
"""
Initializes parse charts with the correct variable arguments.
@param terminals
@param useSumProduct
@return
"""
return new CfgParseChart(terminals, parentVar, leftVar, rightVar, terminalVar, ruleTypeVar,
bin... | java | private CfgParseChart createParseChart(List<?> terminals, boolean useSumProduct) {
return new CfgParseChart(terminals, parentVar, leftVar, rightVar, terminalVar, ruleTypeVar,
binaryDistribution, useSumProduct);
} | [
"private",
"CfgParseChart",
"createParseChart",
"(",
"List",
"<",
"?",
">",
"terminals",
",",
"boolean",
"useSumProduct",
")",
"{",
"return",
"new",
"CfgParseChart",
"(",
"terminals",
",",
"parentVar",
",",
"leftVar",
",",
"rightVar",
",",
"terminalVar",
",",
... | Initializes parse charts with the correct variable arguments.
@param terminals
@param useSumProduct
@return | [
"Initializes",
"parse",
"charts",
"with",
"the",
"correct",
"variable",
"arguments",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParser.java#L393-L396 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.isInstanceOf | public static void isInstanceOf(Object obj, Class<?> type, String message, Object... arguments) {
"""
Asserts that the given {@link Object} is an instance of the specified {@link Class type}.
The assertion holds if and only if the {@link Object} is not {@literal null} and is an instance of
the specified {@link... | java | public static void isInstanceOf(Object obj, Class<?> type, String message, Object... arguments) {
isInstanceOf(obj, type, new IllegalTypeException(format(message, arguments)));
} | [
"public",
"static",
"void",
"isInstanceOf",
"(",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"message",
",",
"Object",
"...",
"arguments",
")",
"{",
"isInstanceOf",
"(",
"obj",
",",
"type",
",",
"new",
"IllegalTypeException",
"(",
... | Asserts that the given {@link Object} is an instance of the specified {@link Class type}.
The assertion holds if and only if the {@link Object} is not {@literal null} and is an instance of
the specified {@link Class type}. This assertion functions exactly the same as
the Java {@literal instanceof} operator.
@param o... | [
"Asserts",
"that",
"the",
"given",
"{",
"@link",
"Object",
"}",
"is",
"an",
"instance",
"of",
"the",
"specified",
"{",
"@link",
"Class",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L719-L721 |
elki-project/elki | addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/util/Simple1DOFCamera.java | Simple1DOFCamera.squaredDistanceFromCamera | public double squaredDistanceFromCamera(double x, double y) {
"""
Distance from camera
@param x X position
@param y Y position
@return Squared distance
"""
double dx = (distance * sinZ) - x;
double dy = (distance * -cosZ) - y;
return dx * dx + dy * dy;
} | java | public double squaredDistanceFromCamera(double x, double y) {
double dx = (distance * sinZ) - x;
double dy = (distance * -cosZ) - y;
return dx * dx + dy * dy;
} | [
"public",
"double",
"squaredDistanceFromCamera",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"double",
"dx",
"=",
"(",
"distance",
"*",
"sinZ",
")",
"-",
"x",
";",
"double",
"dy",
"=",
"(",
"distance",
"*",
"-",
"cosZ",
")",
"-",
"y",
";",
"r... | Distance from camera
@param x X position
@param y Y position
@return Squared distance | [
"Distance",
"from",
"camera"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/util/Simple1DOFCamera.java#L291-L295 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java | AbstractSecurityController.updateControlledObject | protected void updateControlledObject(Authorizable controlledObject, boolean authorized) {
"""
Update a controlled object based on the given authorization state.
@param controlledObject Object being controlled
@param authorized state that has been installed on controlledObject
"""
if( logger.isDebugE... | java | protected void updateControlledObject(Authorizable controlledObject, boolean authorized) {
if( logger.isDebugEnabled() ) {
logger.debug( "setAuthorized( " + authorized + ") on: " + controlledObject );
}
controlledObject.setAuthorized( authorized );
runPostProcessorActions( co... | [
"protected",
"void",
"updateControlledObject",
"(",
"Authorizable",
"controlledObject",
",",
"boolean",
"authorized",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"setAuthorized( \"",
"+",
"authorized",
... | Update a controlled object based on the given authorization state.
@param controlledObject Object being controlled
@param authorized state that has been installed on controlledObject | [
"Update",
"a",
"controlled",
"object",
"based",
"on",
"the",
"given",
"authorization",
"state",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L174-L180 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/KeenClient.java | KeenClient.publishObject | private synchronized String publishObject(KeenProject project, URL url,
final Map<String, ?> requestData) throws IOException {
"""
Posts a request to the server in the specified project, using the given URL and request data.
The request data will be serialized into JS... | java | private synchronized String publishObject(KeenProject project, URL url,
final Map<String, ?> requestData) throws IOException {
if (requestData == null || requestData.size() == 0) {
KeenLogging.log("No API calls were made because there were no events to u... | [
"private",
"synchronized",
"String",
"publishObject",
"(",
"KeenProject",
"project",
",",
"URL",
"url",
",",
"final",
"Map",
"<",
"String",
",",
"?",
">",
"requestData",
")",
"throws",
"IOException",
"{",
"if",
"(",
"requestData",
"==",
"null",
"||",
"reques... | Posts a request to the server in the specified project, using the given URL and request data.
The request data will be serialized into JSON using the client's
{@link io.keen.client.java.KeenJsonHandler}.
@param project The project in which the event(s) will be published; this is used to
determine the write key to ... | [
"Posts",
"a",
"request",
"to",
"the",
"server",
"in",
"the",
"specified",
"project",
"using",
"the",
"given",
"URL",
"and",
"request",
"data",
".",
"The",
"request",
"data",
"will",
"be",
"serialized",
"into",
"JSON",
"using",
"the",
"client",
"s",
"{",
... | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/KeenClient.java#L1447-L1494 |
google/closure-templates | java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java | GenJsCodeVisitorAssistantForMsgs.generateSingleMsgVariable | private Expression generateSingleMsgVariable(MsgNode msgNode, String tmpVarName) {
"""
Returns a code chunk representing a variable declaration for an {@link MsgNode} with no
fallback messages.
"""
String googMsgVarName = buildGoogMsgVarNameHelper(msgNode);
// Generate the goog.getMsg call.
GoogM... | java | private Expression generateSingleMsgVariable(MsgNode msgNode, String tmpVarName) {
String googMsgVarName = buildGoogMsgVarNameHelper(msgNode);
// Generate the goog.getMsg call.
GoogMsgCodeGenInfo googMsgCodeGenInfo = genGoogGetMsgCallHelper(googMsgVarName, msgNode);
if (!msgNode.isPlrselMsg()) {
... | [
"private",
"Expression",
"generateSingleMsgVariable",
"(",
"MsgNode",
"msgNode",
",",
"String",
"tmpVarName",
")",
"{",
"String",
"googMsgVarName",
"=",
"buildGoogMsgVarNameHelper",
"(",
"msgNode",
")",
";",
"// Generate the goog.getMsg call.",
"GoogMsgCodeGenInfo",
"googMs... | Returns a code chunk representing a variable declaration for an {@link MsgNode} with no
fallback messages. | [
"Returns",
"a",
"code",
"chunk",
"representing",
"a",
"variable",
"declaration",
"for",
"an",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java#L185-L204 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/ui/groupeditor/CmsGroupContainerEditor.java | CmsGroupContainerEditor.setGroupContainerData | protected void setGroupContainerData(Map<String, CmsContainerElementData> elementsData) {
"""
Sets the data of the group-container to edit.<p>
@param elementsData the data of all contained elements and the group-container itself
"""
m_elementData = elementsData.get(getGroupContainerWidget().getId... | java | protected void setGroupContainerData(Map<String, CmsContainerElementData> elementsData) {
m_elementData = elementsData.get(getGroupContainerWidget().getId());
if (m_elementData != null) {
setSaveEnabled(true, null);
m_groupContainerBean = new CmsGroupContainer();
... | [
"protected",
"void",
"setGroupContainerData",
"(",
"Map",
"<",
"String",
",",
"CmsContainerElementData",
">",
"elementsData",
")",
"{",
"m_elementData",
"=",
"elementsData",
".",
"get",
"(",
"getGroupContainerWidget",
"(",
")",
".",
"getId",
"(",
")",
")",
";",
... | Sets the data of the group-container to edit.<p>
@param elementsData the data of all contained elements and the group-container itself | [
"Sets",
"the",
"data",
"of",
"the",
"group",
"-",
"container",
"to",
"edit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/ui/groupeditor/CmsGroupContainerEditor.java#L316-L341 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_monitoringNotifications_POST | public OvhMonitoringNotification serviceName_monitoringNotifications_POST(String serviceName, Boolean allowIncident, Long downThreshold, String email, OvhFrequencyEnum frequency, String phone, String smsAccount, OvhTypeEnum type) throws IOException {
"""
Add a notification
REST: POST /xdsl/{serviceName}/monitor... | java | public OvhMonitoringNotification serviceName_monitoringNotifications_POST(String serviceName, Boolean allowIncident, Long downThreshold, String email, OvhFrequencyEnum frequency, String phone, String smsAccount, OvhTypeEnum type) throws IOException {
String qPath = "/xdsl/{serviceName}/monitoringNotifications";
Str... | [
"public",
"OvhMonitoringNotification",
"serviceName_monitoringNotifications_POST",
"(",
"String",
"serviceName",
",",
"Boolean",
"allowIncident",
",",
"Long",
"downThreshold",
",",
"String",
"email",
",",
"OvhFrequencyEnum",
"frequency",
",",
"String",
"phone",
",",
"Stri... | Add a notification
REST: POST /xdsl/{serviceName}/monitoringNotifications
@param frequency [required]
@param downThreshold [required] [default=120] The number of seconds the access has to be down to trigger the alert
@param phone [required] The phone number, if type is sms
@param type [required]
@param smsAccount [req... | [
"Add",
"a",
"notification"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1445-L1458 |
amaembo/streamex | src/main/java/one/util/streamex/DoubleStreamEx.java | DoubleStreamEx.chain | @Override
public <U> U chain(Function<? super DoubleStreamEx, U> mapper) {
"""
does not add overhead as it appears in bytecode anyways as bridge method
"""
return mapper.apply(this);
} | java | @Override
public <U> U chain(Function<? super DoubleStreamEx, U> mapper) {
return mapper.apply(this);
} | [
"@",
"Override",
"public",
"<",
"U",
">",
"U",
"chain",
"(",
"Function",
"<",
"?",
"super",
"DoubleStreamEx",
",",
"U",
">",
"mapper",
")",
"{",
"return",
"mapper",
".",
"apply",
"(",
"this",
")",
";",
"}"
] | does not add overhead as it appears in bytecode anyways as bridge method | [
"does",
"not",
"add",
"overhead",
"as",
"it",
"appears",
"in",
"bytecode",
"anyways",
"as",
"bridge",
"method"
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L1473-L1476 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.setTimestamp | public <T extends Model> T setTimestamp(String attributeName, Object value) {
"""
Sets attribute value as <code>java.sql.Timestamp</code>.
If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class
<code>java.sql.Timestamp</code>, given the value is an instance ... | java | public <T extends Model> T setTimestamp(String attributeName, Object value) {
Converter<Object, Timestamp> converter = modelRegistryLocal.converterForValue(
attributeName, value, Timestamp.class);
return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toTimes... | [
"public",
"<",
"T",
"extends",
"Model",
">",
"T",
"setTimestamp",
"(",
"String",
"attributeName",
",",
"Object",
"value",
")",
"{",
"Converter",
"<",
"Object",
",",
"Timestamp",
">",
"converter",
"=",
"modelRegistryLocal",
".",
"converterForValue",
"(",
"attri... | Sets attribute value as <code>java.sql.Timestamp</code>.
If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class
<code>java.sql.Timestamp</code>, given the value is an instance of <code>S</code>, then it will be used,
otherwise performs a conversion using {@link Con... | [
"Sets",
"attribute",
"value",
"as",
"<code",
">",
"java",
".",
"sql",
".",
"Timestamp<",
"/",
"code",
">",
".",
"If",
"there",
"is",
"a",
"{",
"@link",
"Converter",
"}",
"registered",
"for",
"the",
"attribute",
"that",
"converts",
"from",
"Class",
"<code... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1817-L1821 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/configuration/PluginAdapterUtility.java | PluginAdapterUtility.mapDescribedProperties | public static Map<String, Object> mapDescribedProperties(final PropertyResolver resolver,
final Description description) {
"""
Retrieve the Description's Properties mapped to resolved values given the resolver, using InsanceOnly default scope.
@param re... | java | public static Map<String, Object> mapDescribedProperties(final PropertyResolver resolver,
final Description description) {
//use a default scope of InstanceOnly if the Property doesn't specify it
//use property default value if otherwise not r... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"mapDescribedProperties",
"(",
"final",
"PropertyResolver",
"resolver",
",",
"final",
"Description",
"description",
")",
"{",
"//use a default scope of InstanceOnly if the Property doesn't specify it",
"//use prope... | Retrieve the Description's Properties mapped to resolved values given the resolver, using InsanceOnly default scope.
@param resolver property resolver
@param description plugin description
@return All mapped properties by name and value. | [
"Retrieve",
"the",
"Description",
"s",
"Properties",
"mapped",
"to",
"resolved",
"values",
"given",
"the",
"resolver",
"using",
"InsanceOnly",
"default",
"scope",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/configuration/PluginAdapterUtility.java#L437-L442 |
VoltDB/voltdb | src/frontend/org/voltdb/DeprecatedProcedureAPIAccess.java | DeprecatedProcedureAPIAccess.voltLoadTable | @Deprecated
public static byte[] voltLoadTable(VoltProcedure procedure,
String clusterName,
String databaseName,
String tableName,
VoltTable data,
boolean r... | java | @Deprecated
public static byte[] voltLoadTable(VoltProcedure procedure,
String clusterName,
String databaseName,
String tableName,
VoltTable data,
boolean r... | [
"@",
"Deprecated",
"public",
"static",
"byte",
"[",
"]",
"voltLoadTable",
"(",
"VoltProcedure",
"procedure",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
",",
"String",
"tableName",
",",
"VoltTable",
"data",
",",
"boolean",
"returnUniqueViolations",
... | <p>Currently unsupported in VoltDB.</p>
<p>Batch load method for populating a table with a large number of records.</p>
<p>Faster than calling {@link #voltQueueSQL(SQLStmt, Expectation, Object...)} and {@link #voltExecuteSQL()} to
insert one row at a time.</p>
@deprecated This method is not fully tested to be used in... | [
"<p",
">",
"Currently",
"unsupported",
"in",
"VoltDB",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Batch",
"load",
"method",
"for",
"populating",
"a",
"table",
"with",
"a",
"large",
"number",
"of",
"records",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/DeprecatedProcedureAPIAccess.java#L85-L96 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java | LiveEventsInner.beginStop | public void beginStop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) {
"""
Stop Live Event.
Stops an existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.... | java | public void beginStop(String resourceGroupName, String accountName, String liveEventName, Boolean removeOutputsOnStop) {
beginStopWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, removeOutputsOnStop).toBlocking().single().body();
} | [
"public",
"void",
"beginStop",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
",",
"Boolean",
"removeOutputsOnStop",
")",
"{",
"beginStopWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"liv... | Stop Live Event.
Stops an existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@param removeOutputsOnStop The flag indicates if remove LiveOutputs on Stop.
@throws... | [
"Stop",
"Live",
"Event",
".",
"Stops",
"an",
"existing",
"Live",
"Event",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java#L1553-L1555 |
aoindustries/aoweb-framework | src/main/java/com/aoindustries/website/framework/TextOnlyLayout.java | TextOnlyLayout.startContentLine | @Override
public void startContentLine(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int colspan, String align, String width) {
"""
Starts one line of content with the initial colspan set to the provided colspan.
"""
out.print(" <tr>\n"
+ " <td");
if(width!=null && width.length()>... | java | @Override
public void startContentLine(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int colspan, String align, String width) {
out.print(" <tr>\n"
+ " <td");
if(width!=null && width.length()>0) {
out.append(" style='width:");
out.append(width);
out.append('\'');
}
out.print("... | [
"@",
"Override",
"public",
"void",
"startContentLine",
"(",
"ChainWriter",
"out",
",",
"WebSiteRequest",
"req",
",",
"HttpServletResponse",
"resp",
",",
"int",
"colspan",
",",
"String",
"align",
",",
"String",
"width",
")",
"{",
"out",
".",
"print",
"(",
"\"... | Starts one line of content with the initial colspan set to the provided colspan. | [
"Starts",
"one",
"line",
"of",
"content",
"with",
"the",
"initial",
"colspan",
"set",
"to",
"the",
"provided",
"colspan",
"."
] | train | https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/TextOnlyLayout.java#L383-L396 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbWrapper.java | RocksDbWrapper.openReadWrite | public static RocksDbWrapper openReadWrite(File directory, DBOptions dbOptions,
ReadOptions readOptions, WriteOptions writeOptions, String... columnFamilies)
throws RocksDbException, IOException {
"""
Open a {@link RocksDB} with specified options in read/write mode.
@param directory
dir... | java | public static RocksDbWrapper openReadWrite(File directory, DBOptions dbOptions,
ReadOptions readOptions, WriteOptions writeOptions, String... columnFamilies)
throws RocksDbException, IOException {
RocksDbWrapper rocksDbWrapper = new RocksDbWrapper(directory, false);
rocksDbWrappe... | [
"public",
"static",
"RocksDbWrapper",
"openReadWrite",
"(",
"File",
"directory",
",",
"DBOptions",
"dbOptions",
",",
"ReadOptions",
"readOptions",
",",
"WriteOptions",
"writeOptions",
",",
"String",
"...",
"columnFamilies",
")",
"throws",
"RocksDbException",
",",
"IOE... | Open a {@link RocksDB} with specified options in read/write mode.
@param directory
directory to store {@link RocksDB} data
@param dbOptions
@param readOptions
@param writeOptions
@param columnFamilies
list of column families to store key/value (the column family
"default" will be automatically added)
@return
@throws R... | [
"Open",
"a",
"{",
"@link",
"RocksDB",
"}",
"with",
"specified",
"options",
"in",
"read",
"/",
"write",
"mode",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbWrapper.java#L167-L176 |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java | EmoTableAllTablesReportDAO.getReportEntries | @Override
public Iterable<TableReportEntry> getReportEntries(String reportId, final AllTablesReportQuery query) {
"""
Returns the matching table report entries for a report ID and query parameters.
"""
checkNotNull(reportId, "reportId");
final String reportTable = getTableName(reportId);
... | java | @Override
public Iterable<TableReportEntry> getReportEntries(String reportId, final AllTablesReportQuery query) {
checkNotNull(reportId, "reportId");
final String reportTable = getTableName(reportId);
// Set up several filters based on the query attributes
final Predicate<String> ... | [
"@",
"Override",
"public",
"Iterable",
"<",
"TableReportEntry",
">",
"getReportEntries",
"(",
"String",
"reportId",
",",
"final",
"AllTablesReportQuery",
"query",
")",
"{",
"checkNotNull",
"(",
"reportId",
",",
"\"reportId\"",
")",
";",
"final",
"String",
"reportT... | Returns the matching table report entries for a report ID and query parameters. | [
"Returns",
"the",
"matching",
"table",
"report",
"entries",
"for",
"a",
"report",
"ID",
"and",
"query",
"parameters",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java#L204-L249 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/cloning/implementor/AbstractCloneStrategy.java | AbstractCloneStrategy.handleCloneField | protected <T> void handleCloneField(T obj, T copy, CloneDriver driver, FieldModel<T> f, IdentityHashMap<Object, Object> referencesToReuse, long stackDepth) {
"""
Clone a Field
@param obj The original object
@param copy The destination object
@param driver The CloneDriver
@param f The FieldModel for the target ... | java | protected <T> void handleCloneField(T obj, T copy, CloneDriver driver, FieldModel<T> f, IdentityHashMap<Object, Object> referencesToReuse, long stackDepth) {
final Class<?> clazz = f.getFieldClass();
if (clazz.isPrimitive()) {
handleClonePrimitiveField(obj, copy, driver, f, referencesToReuse);
} else if (!dr... | [
"protected",
"<",
"T",
">",
"void",
"handleCloneField",
"(",
"T",
"obj",
",",
"T",
"copy",
",",
"CloneDriver",
"driver",
",",
"FieldModel",
"<",
"T",
">",
"f",
",",
"IdentityHashMap",
"<",
"Object",
",",
"Object",
">",
"referencesToReuse",
",",
"long",
"... | Clone a Field
@param obj The original object
@param copy The destination object
@param driver The CloneDriver
@param f The FieldModel for the target field
@param referencesToReuse Used for tracking objects that have already been seen
@param stackDepth The current depth of the stack - used to switch from recursion to it... | [
"Clone",
"a",
"Field"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/cloning/implementor/AbstractCloneStrategy.java#L375-L389 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RelativeDateTimeFormatter.java | RelativeDateTimeFormatter.getInstance | public static RelativeDateTimeFormatter getInstance(ULocale locale) {
"""
Returns a RelativeDateTimeFormatter for a particular locale.
@param locale the locale.
@return An instance of RelativeDateTimeFormatter.
"""
return getInstance(locale, null, Style.LONG, DisplayContext.CAPITALIZATION_NONE);
... | java | public static RelativeDateTimeFormatter getInstance(ULocale locale) {
return getInstance(locale, null, Style.LONG, DisplayContext.CAPITALIZATION_NONE);
} | [
"public",
"static",
"RelativeDateTimeFormatter",
"getInstance",
"(",
"ULocale",
"locale",
")",
"{",
"return",
"getInstance",
"(",
"locale",
",",
"null",
",",
"Style",
".",
"LONG",
",",
"DisplayContext",
".",
"CAPITALIZATION_NONE",
")",
";",
"}"
] | Returns a RelativeDateTimeFormatter for a particular locale.
@param locale the locale.
@return An instance of RelativeDateTimeFormatter. | [
"Returns",
"a",
"RelativeDateTimeFormatter",
"for",
"a",
"particular",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RelativeDateTimeFormatter.java#L370-L372 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java | ZooKeeperMasterModel.undeployJob | @Override
public Deployment undeployJob(final String host, final JobId jobId, final String token)
throws HostNotFoundException, JobNotDeployedException, TokenVerificationException {
"""
Undeploys the job specified by {@code jobId} on {@code host}.
"""
log.info("undeploying {}: {}", jobId, host);
... | java | @Override
public Deployment undeployJob(final String host, final JobId jobId, final String token)
throws HostNotFoundException, JobNotDeployedException, TokenVerificationException {
log.info("undeploying {}: {}", jobId, host);
final ZooKeeperClient client = provider.get("undeployJob");
assertHostEx... | [
"@",
"Override",
"public",
"Deployment",
"undeployJob",
"(",
"final",
"String",
"host",
",",
"final",
"JobId",
"jobId",
",",
"final",
"String",
"token",
")",
"throws",
"HostNotFoundException",
",",
"JobNotDeployedException",
",",
"TokenVerificationException",
"{",
"... | Undeploys the job specified by {@code jobId} on {@code host}. | [
"Undeploys",
"the",
"job",
"specified",
"by",
"{"
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L1930-L1968 |
orbisgis/h2gis | postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java | JtsBinaryParser.parseCollection | private GeometryCollection parseCollection(ValueGetter data, int srid) {
"""
Parse the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.GeometryCollection}.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param srid SRID of the parsed geometries.
@retur... | java | private GeometryCollection parseCollection(ValueGetter data, int srid) {
int count = data.getInt();
Geometry[] geoms = new Geometry[count];
this.parseGeometryArray(data, geoms, srid);
return JtsGeometry.geofac.createGeometryCollection(geoms);
} | [
"private",
"GeometryCollection",
"parseCollection",
"(",
"ValueGetter",
"data",
",",
"int",
"srid",
")",
"{",
"int",
"count",
"=",
"data",
".",
"getInt",
"(",
")",
";",
"Geometry",
"[",
"]",
"geoms",
"=",
"new",
"Geometry",
"[",
"count",
"]",
";",
"this"... | Parse the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.GeometryCollection}.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param srid SRID of the parsed geometries.
@return The parsed {@link org.locationtech.jts.geom.GeometryCollection}. | [
"Parse",
"the",
"given",
"{",
"@link",
"org",
".",
"postgis",
".",
"binary",
".",
"ValueGetter",
"}",
"into",
"a",
"JTS",
"{",
"@link",
"org",
".",
"locationtech",
".",
"jts",
".",
"geom",
".",
"GeometryCollection",
"}",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java#L337-L342 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.activateFactor | public FactorEnrollmentResponse activateFactor(long userId, long deviceId) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Triggers an SMS or Push notification containing a One-Time Password (OTP)
that can be used to authenticate a user with the Verify Factor call.
@param userId
T... | java | public FactorEnrollmentResponse activateFactor(long userId, long deviceId) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.ACTIVATE_FACTOR_URL, userId, deviceId));
OneloginURLConnectionClien... | [
"public",
"FactorEnrollmentResponse",
"activateFactor",
"(",
"long",
"userId",
",",
"long",
"deviceId",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"... | Triggers an SMS or Push notification containing a One-Time Password (OTP)
that can be used to authenticate a user with the Verify Factor call.
@param userId
The id of the user.
@param deviceId
the id of the MFA device.
@return FactorEnrollmentResponse Info with User Id, Device Id, and OTP Device
@throws OAuthSystemE... | [
"Triggers",
"an",
"SMS",
"or",
"Push",
"notification",
"containing",
"a",
"One",
"-",
"Time",
"Password",
"(",
"OTP",
")",
"that",
"can",
"be",
"used",
"to",
"authenticate",
"a",
"user",
"with",
"the",
"Verify",
"Factor",
"call",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2785-L2811 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.getConsumerDisclosure | public ConsumerDisclosure getConsumerDisclosure(String accountId, String envelopeId, String recipientId, String langCode) throws ApiException {
"""
Reserved: Gets the Electronic Record and Signature Disclosure associated with the account.
Reserved: Retrieves the Electronic Record and Signature Disclosure, with HT... | java | public ConsumerDisclosure getConsumerDisclosure(String accountId, String envelopeId, String recipientId, String langCode) throws ApiException {
return getConsumerDisclosure(accountId, envelopeId, recipientId, langCode, null);
} | [
"public",
"ConsumerDisclosure",
"getConsumerDisclosure",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"String",
"recipientId",
",",
"String",
"langCode",
")",
"throws",
"ApiException",
"{",
"return",
"getConsumerDisclosure",
"(",
"accountId",
",",
"en... | Reserved: Gets the Electronic Record and Signature Disclosure associated with the account.
Reserved: Retrieves the Electronic Record and Signature Disclosure, with HTML formatting, associated with the account.
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelo... | [
"Reserved",
":",
"Gets",
"the",
"Electronic",
"Record",
"and",
"Signature",
"Disclosure",
"associated",
"with",
"the",
"account",
".",
"Reserved",
":",
"Retrieves",
"the",
"Electronic",
"Record",
"and",
"Signature",
"Disclosure",
"with",
"HTML",
"formatting",
"ass... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L1966-L1968 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/weights/WeightInitIdentity.java | WeightInitIdentity.setIdentityConv | private INDArray setIdentityConv(long[] shape, char order, INDArray paramView) {
"""
Set identity mapping for convolution layers. When viewed as an NxM matrix of kernel tensors,
identity mapping is when parameters is a diagonal matrix of identity kernels.
@param shape Shape of parameters
@param order Order of p... | java | private INDArray setIdentityConv(long[] shape, char order, INDArray paramView) {
final INDArrayIndex[] indArrayIndices = new INDArrayIndex[shape.length];
for(int i = 2; i < shape.length; i++) {
if(shape[i] % 2 == 0) {
throw new IllegalStateException("Cannot use IDENTITY init ... | [
"private",
"INDArray",
"setIdentityConv",
"(",
"long",
"[",
"]",
"shape",
",",
"char",
"order",
",",
"INDArray",
"paramView",
")",
"{",
"final",
"INDArrayIndex",
"[",
"]",
"indArrayIndices",
"=",
"new",
"INDArrayIndex",
"[",
"shape",
".",
"length",
"]",
";",... | Set identity mapping for convolution layers. When viewed as an NxM matrix of kernel tensors,
identity mapping is when parameters is a diagonal matrix of identity kernels.
@param shape Shape of parameters
@param order Order of parameters
@param paramView View of parameters
@return A reshaped view of paramView which resu... | [
"Set",
"identity",
"mapping",
"for",
"convolution",
"layers",
".",
"When",
"viewed",
"as",
"an",
"NxM",
"matrix",
"of",
"kernel",
"tensors",
"identity",
"mapping",
"is",
"when",
"parameters",
"is",
"a",
"diagonal",
"matrix",
"of",
"identity",
"kernels",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/weights/WeightInitIdentity.java#L59-L77 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getRetRequiredCheck | public static String getRetRequiredCheck(String express, Field field) {
"""
get return required field check java expression.
@param express java expression
@param field java field
@return full java expression
"""
String code = "if (CodedConstant.isNull(" + express + ")) {\n";
code += "thro... | java | public static String getRetRequiredCheck(String express, Field field) {
String code = "if (CodedConstant.isNull(" + express + ")) {\n";
code += "throw new UninitializedMessageException(CodedConstant.asList(\"" + field.getName() + "\"))"
+ ClassCode.JAVA_LINE_BREAK;
code += "}\n";... | [
"public",
"static",
"String",
"getRetRequiredCheck",
"(",
"String",
"express",
",",
"Field",
"field",
")",
"{",
"String",
"code",
"=",
"\"if (CodedConstant.isNull(\"",
"+",
"express",
"+",
"\")) {\\n\"",
";",
"code",
"+=",
"\"throw new UninitializedMessageException(Code... | get return required field check java expression.
@param express java expression
@param field java field
@return full java expression | [
"get",
"return",
"required",
"field",
"check",
"java",
"expression",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L494-L501 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.makeIntersectionType | public IntersectionClassType makeIntersectionType(List<Type> bounds) {
"""
Make an intersection type from non-empty list of types. The list should be ordered according to
{@link TypeSymbol#precedes(TypeSymbol, Types)}. Note that this might cause a symbol completion.
Hence, this version of makeIntersectionType m... | java | public IntersectionClassType makeIntersectionType(List<Type> bounds) {
return makeIntersectionType(bounds, bounds.head.tsym.isInterface());
} | [
"public",
"IntersectionClassType",
"makeIntersectionType",
"(",
"List",
"<",
"Type",
">",
"bounds",
")",
"{",
"return",
"makeIntersectionType",
"(",
"bounds",
",",
"bounds",
".",
"head",
".",
"tsym",
".",
"isInterface",
"(",
")",
")",
";",
"}"
] | Make an intersection type from non-empty list of types. The list should be ordered according to
{@link TypeSymbol#precedes(TypeSymbol, Types)}. Note that this might cause a symbol completion.
Hence, this version of makeIntersectionType may not be called during a classfile read.
@param bounds the types from which t... | [
"Make",
"an",
"intersection",
"type",
"from",
"non",
"-",
"empty",
"list",
"of",
"types",
".",
"The",
"list",
"should",
"be",
"ordered",
"according",
"to",
"{",
"@link",
"TypeSymbol#precedes",
"(",
"TypeSymbol",
"Types",
")",
"}",
".",
"Note",
"that",
"thi... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L2175-L2177 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_farm_farmId_GET | public OvhBackendTcp serviceName_tcp_farm_farmId_GET(String serviceName, Long farmId) throws IOException {
"""
Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}
@param serviceName [required] The internal name of your IP load balancing
@param farmId [required] Id of your far... | java | public OvhBackendTcp serviceName_tcp_farm_farmId_GET(String serviceName, Long farmId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/farm/{farmId}";
StringBuilder sb = path(qPath, serviceName, farmId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhBack... | [
"public",
"OvhBackendTcp",
"serviceName_tcp_farm_farmId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"farmId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/tcp/farm/{farmId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"... | Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}
@param serviceName [required] The internal name of your IP load balancing
@param farmId [required] Id of your farm | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1569-L1574 |
jenkinsci/github-plugin | src/main/java/org/jenkinsci/plugins/github/webhook/WebhookManager.java | WebhookManager.createHookSubscribedTo | protected Function<GitHubRepositoryName, GHHook> createHookSubscribedTo(final List<GHEvent> events) {
"""
Main logic of {@link #registerFor(Item)}.
Updates hooks with replacing old ones with merged new ones
@param events calculated events list to be registered in hook
@return function to register hooks for ... | java | protected Function<GitHubRepositoryName, GHHook> createHookSubscribedTo(final List<GHEvent> events) {
return new NullSafeFunction<GitHubRepositoryName, GHHook>() {
@Override
protected GHHook applyNullSafe(@Nonnull GitHubRepositoryName name) {
try {
GHR... | [
"protected",
"Function",
"<",
"GitHubRepositoryName",
",",
"GHHook",
">",
"createHookSubscribedTo",
"(",
"final",
"List",
"<",
"GHEvent",
">",
"events",
")",
"{",
"return",
"new",
"NullSafeFunction",
"<",
"GitHubRepositoryName",
",",
"GHHook",
">",
"(",
")",
"{"... | Main logic of {@link #registerFor(Item)}.
Updates hooks with replacing old ones with merged new ones
@param events calculated events list to be registered in hook
@return function to register hooks for given events | [
"Main",
"logic",
"of",
"{",
"@link",
"#registerFor",
"(",
"Item",
")",
"}",
".",
"Updates",
"hooks",
"with",
"replacing",
"old",
"ones",
"with",
"merged",
"new",
"ones"
] | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/org/jenkinsci/plugins/github/webhook/WebhookManager.java#L174-L212 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.userInGroup | public boolean userInGroup(CmsRequestContext context, String username, String groupname) throws CmsException {
"""
Tests if a user is member of the given group.<p>
@param context the current request context
@param username the name of the user to check
@param groupname the name of the group to check
@retur... | java | public boolean userInGroup(CmsRequestContext context, String username, String groupname) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
boolean result = false;
try {
result = m_driverManager.userInGroup(
dbc,
CmsOrg... | [
"public",
"boolean",
"userInGroup",
"(",
"CmsRequestContext",
"context",
",",
"String",
"username",
",",
"String",
"groupname",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"bo... | Tests if a user is member of the given group.<p>
@param context the current request context
@param username the name of the user to check
@param groupname the name of the group to check
@return <code>true</code>, if the user is in the group; or <code>false</code> otherwise
@throws CmsException if operation was not s... | [
"Tests",
"if",
"a",
"user",
"is",
"member",
"of",
"the",
"given",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6517-L6533 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/index/LocationIndexTree.java | LocationIndexTree.fillIDs | final void fillIDs(long keyPart, int intIndex, GHIntHashSet set, int depth) {
"""
This method fills the set with stored node IDs from the given spatial key part (a latitude-longitude prefix).
"""
long pointer = (long) intIndex << 2;
if (depth == entries.length) {
int nextIntPointer ... | java | final void fillIDs(long keyPart, int intIndex, GHIntHashSet set, int depth) {
long pointer = (long) intIndex << 2;
if (depth == entries.length) {
int nextIntPointer = dataAccess.getInt(pointer);
if (nextIntPointer < 0) {
// single data entries (less disc space)
... | [
"final",
"void",
"fillIDs",
"(",
"long",
"keyPart",
",",
"int",
"intIndex",
",",
"GHIntHashSet",
"set",
",",
"int",
"depth",
")",
"{",
"long",
"pointer",
"=",
"(",
"long",
")",
"intIndex",
"<<",
"2",
";",
"if",
"(",
"depth",
"==",
"entries",
".",
"le... | This method fills the set with stored node IDs from the given spatial key part (a latitude-longitude prefix). | [
"This",
"method",
"fills",
"the",
"set",
"with",
"stored",
"node",
"IDs",
"from",
"the",
"given",
"spatial",
"key",
"part",
"(",
"a",
"latitude",
"-",
"longitude",
"prefix",
")",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/index/LocationIndexTree.java#L352-L374 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.maxLength | public static Validator<CharSequence> maxLength(@NonNull final Context context,
final int maxLength) {
"""
Creates and returns a validator, which allows to validate texts to ensure, that they are not
longer than a specific length.
@param context
The context,... | java | public static Validator<CharSequence> maxLength(@NonNull final Context context,
final int maxLength) {
return new MaxLengthValidator(context, R.string.default_error_message, maxLength);
} | [
"public",
"static",
"Validator",
"<",
"CharSequence",
">",
"maxLength",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"final",
"int",
"maxLength",
")",
"{",
"return",
"new",
"MaxLengthValidator",
"(",
"context",
",",
"R",
".",
"string",
".",
"defa... | Creates and returns a validator, which allows to validate texts to ensure, that they are not
longer than a specific length.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}. The context may not be null
@param maxLength
The maximum length a text... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"validate",
"texts",
"to",
"ensure",
"that",
"they",
"are",
"not",
"longer",
"than",
"a",
"specific",
"length",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L500-L503 |
JOML-CI/JOML | src/org/joml/Vector3d.java | Vector3d.fma | public Vector3d fma(Vector3fc a, Vector3fc b) {
"""
Add the component-wise multiplication of <code>a * b</code> to this vector.
@param a
the first multiplicand
@param b
the second multiplicand
@return a vector holding the result
"""
return fma(a, b, thisOrNew());
} | java | public Vector3d fma(Vector3fc a, Vector3fc b) {
return fma(a, b, thisOrNew());
} | [
"public",
"Vector3d",
"fma",
"(",
"Vector3fc",
"a",
",",
"Vector3fc",
"b",
")",
"{",
"return",
"fma",
"(",
"a",
",",
"b",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Add the component-wise multiplication of <code>a * b</code> to this vector.
@param a
the first multiplicand
@param b
the second multiplicand
@return a vector holding the result | [
"Add",
"the",
"component",
"-",
"wise",
"multiplication",
"of",
"<code",
">",
"a",
"*",
"b<",
"/",
"code",
">",
"to",
"this",
"vector",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector3d.java#L692-L694 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.