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 |
|---|---|---|---|---|---|---|---|---|---|---|
knightliao/disconf | disconf-client/src/main/java/com/baidu/disconf/client/support/utils/StringUtil.java | StringUtil.defaultIfEmpty | public static String defaultIfEmpty(String str, String defaultStr) {
"""
如果字符串是<code>null</code>或空字符串<code>""</code>,则返回指定默认字符串,否则返回字符串本身。
<p/>
<p/>
<pre>
StringUtil.defaultIfEmpty(null, "default") = "default"
StringUtil.defaultIfEmpty("", "default") = "default"
StringUtil.defaultIfEmpty(" ", "default")... | java | public static String defaultIfEmpty(String str, String defaultStr) {
return str == null || str.length() == 0 ? defaultStr : str;
} | [
"public",
"static",
"String",
"defaultIfEmpty",
"(",
"String",
"str",
",",
"String",
"defaultStr",
")",
"{",
"return",
"str",
"==",
"null",
"||",
"str",
".",
"length",
"(",
")",
"==",
"0",
"?",
"defaultStr",
":",
"str",
";",
"}"
] | 如果字符串是<code>null</code>或空字符串<code>""</code>,则返回指定默认字符串,否则返回字符串本身。
<p/>
<p/>
<pre>
StringUtil.defaultIfEmpty(null, "default") = "default"
StringUtil.defaultIfEmpty("", "default") = "default"
StringUtil.defaultIfEmpty(" ", "default") = " "
StringUtil.defaultIfEmpty("bat", "default") = "bat"
</pre>
@param str ... | [
"如果字符串是<code",
">",
"null<",
"/",
"code",
">",
"或空字符串<code",
">",
"<",
"/",
"code",
">",
",则返回指定默认字符串,否则返回字符串本身。",
"<p",
"/",
">",
"<p",
"/",
">",
"<pre",
">",
"StringUtil",
".",
"defaultIfEmpty",
"(",
"null",
"default",
")",
"=",
"default",
"StringUtil",
... | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-client/src/main/java/com/baidu/disconf/client/support/utils/StringUtil.java#L119-L121 |
javamonkey/beetl2.0 | beetl-core/src/main/java/org/beetl/core/GroupTemplate.java | GroupTemplate.runScript | public Map runScript(String key, Map<String, Object> paras, Writer w, ResourceLoader loader) throws ScriptEvalError {
"""
执行某个脚本,参数是paras,返回的是顶级变量
@param key
@param paras
@param w
@param loader 额外的资源管理器就在脚本
@return
@throws ScriptEvalError
"""
Template t = loadScriptTemplate(key, loader);
t.fastBind... | java | public Map runScript(String key, Map<String, Object> paras, Writer w, ResourceLoader loader) throws ScriptEvalError
{
Template t = loadScriptTemplate(key, loader);
t.fastBinding(paras);
if (w == null)
{
t.render();
}
else
{
t.renderTo(w);
}
try
{
Map map = getSrirptTopScope... | [
"public",
"Map",
"runScript",
"(",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paras",
",",
"Writer",
"w",
",",
"ResourceLoader",
"loader",
")",
"throws",
"ScriptEvalError",
"{",
"Template",
"t",
"=",
"loadScriptTemplate",
"(",
"key",
... | 执行某个脚本,参数是paras,返回的是顶级变量
@param key
@param paras
@param w
@param loader 额外的资源管理器就在脚本
@return
@throws ScriptEvalError | [
"执行某个脚本,参数是paras,返回的是顶级变量"
] | train | https://github.com/javamonkey/beetl2.0/blob/f32f729ad238079df5aca6e38a3c3ba0a55c78d6/beetl-core/src/main/java/org/beetl/core/GroupTemplate.java#L389-L420 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/NotImplemented.java | NotImplemented.of | public static NotImplemented of(Throwable cause) {
"""
Returns a static NotImplemented instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cau... | java | public static NotImplemented of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(NOT_IMPLEMENTED));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"NotImplemented",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"NOT_IMPLEMENTED",
")",
")",
";",
"}",
"else",
"{",
"touchPayloa... | Returns a static NotImplemented instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static NotImplemented instance as described above | [
"Returns",
"a",
"static",
"NotImplemented",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/NotImplemented.java#L128-L135 |
alkacon/opencms-core | src/org/opencms/workplace/comparison/CmsHistoryListUtil.java | CmsHistoryListUtil.getHistoryLink | public static String getHistoryLink(CmsObject cms, CmsUUID structureId, String version) {
"""
Returns the link to an historical file.<p>
@param cms the cms context
@param structureId the structure id of the file
@param version the version number of the file
@return the link to an historical file
"""
... | java | public static String getHistoryLink(CmsObject cms, CmsUUID structureId, String version) {
String resourcePath;
CmsResource resource;
try {
resource = cms.readResource(structureId, CmsResourceFilter.ALL);
resourcePath = resource.getRootPath();
} catch (CmsExceptio... | [
"public",
"static",
"String",
"getHistoryLink",
"(",
"CmsObject",
"cms",
",",
"CmsUUID",
"structureId",
",",
"String",
"version",
")",
"{",
"String",
"resourcePath",
";",
"CmsResource",
"resource",
";",
"try",
"{",
"resource",
"=",
"cms",
".",
"readResource",
... | Returns the link to an historical file.<p>
@param cms the cms context
@param structureId the structure id of the file
@param version the version number of the file
@return the link to an historical file | [
"Returns",
"the",
"link",
"to",
"an",
"historical",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/comparison/CmsHistoryListUtil.java#L85-L103 |
mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/scalebar/MapScaleBar.java | MapScaleBar.calculateScaleBarLengthAndValue | protected ScaleBarLengthAndValue calculateScaleBarLengthAndValue(DistanceUnitAdapter unitAdapter) {
"""
Calculates the required length and value of the scalebar
@param unitAdapter the DistanceUnitAdapter to calculate for
@return a {@link ScaleBarLengthAndValue} object containing the required scaleBarLength and... | java | protected ScaleBarLengthAndValue calculateScaleBarLengthAndValue(DistanceUnitAdapter unitAdapter) {
this.prevMapPosition = this.mapViewPosition.getMapPosition();
double groundResolution = MercatorProjection.calculateGroundResolution(this.prevMapPosition.latLong.latitude,
MercatorProjecti... | [
"protected",
"ScaleBarLengthAndValue",
"calculateScaleBarLengthAndValue",
"(",
"DistanceUnitAdapter",
"unitAdapter",
")",
"{",
"this",
".",
"prevMapPosition",
"=",
"this",
".",
"mapViewPosition",
".",
"getMapPosition",
"(",
")",
";",
"double",
"groundResolution",
"=",
"... | Calculates the required length and value of the scalebar
@param unitAdapter the DistanceUnitAdapter to calculate for
@return a {@link ScaleBarLengthAndValue} object containing the required scaleBarLength and scaleBarValue | [
"Calculates",
"the",
"required",
"length",
"and",
"value",
"of",
"the",
"scalebar"
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/scalebar/MapScaleBar.java#L205-L225 |
Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.parseList | private static List<String> parseList(String input, String delim) {
"""
Create a List from a delimited string
@param input
@param delim
"""
List<String> result = new ArrayList<>();
StringTokenizer st = new StringTokenizer(input, delim);
while (st.hasMoreTokens()) {
Stri... | java | private static List<String> parseList(String input, String delim) {
List<String> result = new ArrayList<>();
StringTokenizer st = new StringTokenizer(input, delim);
while (st.hasMoreTokens()) {
String token = st.nextToken().trim();
if (token.length() > 0) {
... | [
"private",
"static",
"List",
"<",
"String",
">",
"parseList",
"(",
"String",
"input",
",",
"String",
"delim",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokeni... | Create a List from a delimited string
@param input
@param delim | [
"Create",
"a",
"List",
"from",
"a",
"delimited",
"string"
] | train | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L421-L433 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java | SecurityRulesInner.getAsync | public Observable<SecurityRuleInner> getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) {
"""
Get the specified network security rule.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@par... | java | public Observable<SecurityRuleInner> getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) {
return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1<ServiceResponse<SecurityRuleInner>, SecurityRuleInner>() {
... | [
"public",
"Observable",
"<",
"SecurityRuleInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkSecurityGroupName",
",",
"String",
"securityRuleName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkS... | Get the specified network security rule.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@param securityRuleName The name of the security rule.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observab... | [
"Get",
"the",
"specified",
"network",
"security",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java#L297-L304 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java | UserDao.selectByLogins | public List<UserDto> selectByLogins(DbSession session, Collection<String> logins) {
"""
Select users by logins, including disabled users. An empty list is returned
if list of logins is empty, without any db round trips.
"""
return executeLargeInputs(logins, mapper(session)::selectByLogins);
} | java | public List<UserDto> selectByLogins(DbSession session, Collection<String> logins) {
return executeLargeInputs(logins, mapper(session)::selectByLogins);
} | [
"public",
"List",
"<",
"UserDto",
">",
"selectByLogins",
"(",
"DbSession",
"session",
",",
"Collection",
"<",
"String",
">",
"logins",
")",
"{",
"return",
"executeLargeInputs",
"(",
"logins",
",",
"mapper",
"(",
"session",
")",
"::",
"selectByLogins",
")",
"... | Select users by logins, including disabled users. An empty list is returned
if list of logins is empty, without any db round trips. | [
"Select",
"users",
"by",
"logins",
"including",
"disabled",
"users",
".",
"An",
"empty",
"list",
"is",
"returned",
"if",
"list",
"of",
"logins",
"is",
"empty",
"without",
"any",
"db",
"round",
"trips",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/user/UserDao.java#L85-L87 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java | OtpInputStream.read_double | public double read_double() throws OtpErlangDecodeException {
"""
Read an Erlang float from the stream.
@return the float value, as a double.
@exception OtpErlangDecodeException
if the next term in the stream is not a float.
"""
int tag;
// parse the stream
tag = read1skip_versi... | java | public double read_double() throws OtpErlangDecodeException {
int tag;
// parse the stream
tag = read1skip_version();
switch (tag) {
case OtpExternal.newFloatTag: {
return Double.longBitsToDouble(readBE(8));
}
case OtpExternal.floatTag: {
... | [
"public",
"double",
"read_double",
"(",
")",
"throws",
"OtpErlangDecodeException",
"{",
"int",
"tag",
";",
"// parse the stream",
"tag",
"=",
"read1skip_version",
"(",
")",
";",
"switch",
"(",
"tag",
")",
"{",
"case",
"OtpExternal",
".",
"newFloatTag",
":",
"{... | Read an Erlang float from the stream.
@return the float value, as a double.
@exception OtpErlangDecodeException
if the next term in the stream is not a float. | [
"Read",
"an",
"Erlang",
"float",
"from",
"the",
"stream",
"."
] | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java#L508-L555 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/app/ActivityManagerUtils.java | ActivityManagerUtils.isServiceRunning | public static boolean isServiceRunning(Context context, Class<? extends Service> service) {
"""
Checks if the specified service is currently running or not.
@param context the context.
@param service the {@link java.lang.Class} of the service.
@return true if the service is running, false otherwise.
"""
... | java | public static boolean isServiceRunning(Context context, Class<? extends Service> service) {
return isServiceRunning(context, service, Integer.MAX_VALUE);
} | [
"public",
"static",
"boolean",
"isServiceRunning",
"(",
"Context",
"context",
",",
"Class",
"<",
"?",
"extends",
"Service",
">",
"service",
")",
"{",
"return",
"isServiceRunning",
"(",
"context",
",",
"service",
",",
"Integer",
".",
"MAX_VALUE",
")",
";",
"}... | Checks if the specified service is currently running or not.
@param context the context.
@param service the {@link java.lang.Class} of the service.
@return true if the service is running, false otherwise. | [
"Checks",
"if",
"the",
"specified",
"service",
"is",
"currently",
"running",
"or",
"not",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/ActivityManagerUtils.java#L49-L51 |
datasift/datasift-java | src/main/java/com/datasift/client/accounts/DataSiftAccount.java | DataSiftAccount.listTokens | public FutureData<TokenList> listTokens(String identity, int page, int perPage) {
"""
/*
List tokens associated with an identity
@param identity which identity you want to list the tokens of
@param page page number (can be 0)
@param perPage items per page (can be 0)
@return List of identities
"""
... | java | public FutureData<TokenList> listTokens(String identity, int page, int perPage) {
if (identity == null) {
throw new IllegalArgumentException("An identity is required");
}
FutureData<TokenList> future = new FutureData<>();
ParamBuilder b = newParams();
if (page > 0) {
... | [
"public",
"FutureData",
"<",
"TokenList",
">",
"listTokens",
"(",
"String",
"identity",
",",
"int",
"page",
",",
"int",
"perPage",
")",
"{",
"if",
"(",
"identity",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"An identity is requi... | /*
List tokens associated with an identity
@param identity which identity you want to list the tokens of
@param page page number (can be 0)
@param perPage items per page (can be 0)
@return List of identities | [
"/",
"*",
"List",
"tokens",
"associated",
"with",
"an",
"identity"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/accounts/DataSiftAccount.java#L183-L200 |
johncarl81/transfuse | transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java | Contract.notEmpty | public static void notEmpty(final Object[] array, final String arrayName) {
"""
Check that an array is not empty
@param array the array to check
@param arrayName the name of the array
@throws IllegalArgumentException if array is null or if the array is empty
"""
notNull(array, arrayName);
i... | java | public static void notEmpty(final Object[] array, final String arrayName) {
notNull(array, arrayName);
if (array.length == 0) {
throw new IllegalArgumentException("expecting " + maskNullArgument(arrayName) + " to contain 1 or more elements");
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"final",
"Object",
"[",
"]",
"array",
",",
"final",
"String",
"arrayName",
")",
"{",
"notNull",
"(",
"array",
",",
"arrayName",
")",
";",
"if",
"(",
"array",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"n... | Check that an array is not empty
@param array the array to check
@param arrayName the name of the array
@throws IllegalArgumentException if array is null or if the array is empty | [
"Check",
"that",
"an",
"array",
"is",
"not",
"empty"
] | train | https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java#L96-L102 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml | public static void escapeHtml(final String text, final Writer writer, final HtmlEscapeType type, final HtmlEscapeLevel level)
throws IOException {
"""
<p>
Perform a (configurable) HTML <strong>escape</strong> operation on a <tt>String</tt> input, writing
results to a <tt>Writer</tt>.
</p>
<p>
This... | java | public static void escapeHtml(final String text, final Writer writer, final HtmlEscapeType type, final HtmlEscapeLevel level)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (type == null) {
... | [
"public",
"static",
"void",
"escapeHtml",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
",",
"final",
"HtmlEscapeType",
"type",
",",
"final",
"HtmlEscapeLevel",
"level",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
... | <p>
Perform a (configurable) HTML <strong>escape</strong> operation on a <tt>String</tt> input, writing
results to a <tt>Writer</tt>.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbescape.html.HtmlEscapeType} and {@link org.unbescape.html.HtmlEscapeLevel}
argument values.... | [
"<p",
">",
"Perform",
"a",
"(",
"configurable",
")",
"HTML",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L573-L590 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseByte | public static byte parseByte (@Nullable final Object aObject, @Nonnegative final int nRadix, final byte nDefault) {
"""
Parse the given {@link Object} as byte with the specified radix.
@param aObject
The Object to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#... | java | public static byte parseByte (@Nullable final Object aObject, @Nonnegative final int nRadix, final byte nDefault)
{
if (aObject == null)
return nDefault;
if (aObject instanceof Number)
return ((Number) aObject).byteValue ();
return parseByte (aObject.toString (), nRadix, nDefault);
} | [
"public",
"static",
"byte",
"parseByte",
"(",
"@",
"Nullable",
"final",
"Object",
"aObject",
",",
"@",
"Nonnegative",
"final",
"int",
"nRadix",
",",
"final",
"byte",
"nDefault",
")",
"{",
"if",
"(",
"aObject",
"==",
"null",
")",
"return",
"nDefault",
";",
... | Parse the given {@link Object} as byte with the specified radix.
@param aObject
The Object to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#MIN_RADIX} and ≤
{@link Character#MAX_RADIX}.
@param nDefault
The default value to be returned if the passed object could not b... | [
"Parse",
"the",
"given",
"{",
"@link",
"Object",
"}",
"as",
"byte",
"with",
"the",
"specified",
"radix",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L277-L284 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java | DiskTypeId.of | public static DiskTypeId of(String zone, String type) {
"""
Returns a disk type identity given the zone and disk type names.
"""
return of(ZoneId.of(null, zone), type);
} | java | public static DiskTypeId of(String zone, String type) {
return of(ZoneId.of(null, zone), type);
} | [
"public",
"static",
"DiskTypeId",
"of",
"(",
"String",
"zone",
",",
"String",
"type",
")",
"{",
"return",
"of",
"(",
"ZoneId",
".",
"of",
"(",
"null",
",",
"zone",
")",
",",
"type",
")",
";",
"}"
] | Returns a disk type identity given the zone and disk type names. | [
"Returns",
"a",
"disk",
"type",
"identity",
"given",
"the",
"zone",
"and",
"disk",
"type",
"names",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java#L116-L118 |
lastaflute/lastaflute | src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java | LaTypicalPostcard.dryrunByGivenText | public void dryrunByGivenText(String subject, String plainBody, String htmlBody) {
"""
Set up as dry-run by given text. <br>
Not send it actually, only preparation, e.g. for preview. <br>
You can get complete plain or HTML text from postcard.
@param subject The subject as given text. (NotNull)
@param plainBody... | java | public void dryrunByGivenText(String subject, String plainBody, String htmlBody) {
postcard.dryrun();
postcard.overrideBodyFile(subject, plainBody).alsoHtmlBody(htmlBody);
} | [
"public",
"void",
"dryrunByGivenText",
"(",
"String",
"subject",
",",
"String",
"plainBody",
",",
"String",
"htmlBody",
")",
"{",
"postcard",
".",
"dryrun",
"(",
")",
";",
"postcard",
".",
"overrideBodyFile",
"(",
"subject",
",",
"plainBody",
")",
".",
"also... | Set up as dry-run by given text. <br>
Not send it actually, only preparation, e.g. for preview. <br>
You can get complete plain or HTML text from postcard.
@param subject The subject as given text. (NotNull)
@param plainBody The plain body (template) as given text. (NotNull)
@param htmlBody The HTML body (template) as ... | [
"Set",
"up",
"as",
"dry",
"-",
"run",
"by",
"given",
"text",
".",
"<br",
">",
"Not",
"send",
"it",
"actually",
"only",
"preparation",
"e",
".",
"g",
".",
"for",
"preview",
".",
"<br",
">",
"You",
"can",
"get",
"complete",
"plain",
"or",
"HTML",
"te... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java#L340-L343 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.notEmpty | public static <T extends Collection<?>> T notEmpty(final T collection, final String message, final Object... values) {
"""
<p>Validate that the specified argument collection is neither {@code null}
nor a size of zero (no elements); otherwise throwing an exception
with the specified message.
<pre>Validate.notE... | java | public static <T extends Collection<?>> T notEmpty(final T collection, final String message, final Object... values) {
if (collection == null) {
throw new NullPointerException(StringUtils.simpleFormat(message, values));
}
if (collection.isEmpty()) {
throw new IllegalArgum... | [
"public",
"static",
"<",
"T",
"extends",
"Collection",
"<",
"?",
">",
">",
"T",
"notEmpty",
"(",
"final",
"T",
"collection",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"collection",
"==",
"null",
")... | <p>Validate that the specified argument collection is neither {@code null}
nor a size of zero (no elements); otherwise throwing an exception
with the specified message.
<pre>Validate.notEmpty(myCollection, "The collection must not be empty");</pre>
@param <T> the collection type
@param collection the collection to c... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"collection",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"a",
"size",
"of",
"zero",
"(",
"no",
"elements",
")",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specifie... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L300-L308 |
alkacon/opencms-core | src/org/opencms/security/CmsOrgUnitManager.java | CmsOrgUnitManager.deleteOrganizationalUnit | public void deleteOrganizationalUnit(CmsObject cms, String ouFqn) throws CmsException {
"""
Deletes an organizational unit.<p>
Only organizational units that contain no sub units can be deleted.<p>
The organizational unit can not be delete if it is used in the request context,
or if the current user belongs... | java | public void deleteOrganizationalUnit(CmsObject cms, String ouFqn) throws CmsException {
CmsOrganizationalUnit orgUnit = readOrganizationalUnit(cms, ouFqn);
m_securityManager.deleteOrganizationalUnit(cms.getRequestContext(), orgUnit);
} | [
"public",
"void",
"deleteOrganizationalUnit",
"(",
"CmsObject",
"cms",
",",
"String",
"ouFqn",
")",
"throws",
"CmsException",
"{",
"CmsOrganizationalUnit",
"orgUnit",
"=",
"readOrganizationalUnit",
"(",
"cms",
",",
"ouFqn",
")",
";",
"m_securityManager",
".",
"delet... | Deletes an organizational unit.<p>
Only organizational units that contain no sub units can be deleted.<p>
The organizational unit can not be delete if it is used in the request context,
or if the current user belongs to it.<p>
All users and groups in the given organizational unit will be deleted.<p>
@param cms the ... | [
"Deletes",
"an",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsOrgUnitManager.java#L146-L150 |
facebookarchive/hive-dwrf | hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java | Slice.setBytes | public int setBytes(int index, InputStream in, int length)
throws IOException {
"""
Transfers data from the specified input stream into this slice starting at
the specified absolute {@code index}.
"""
checkIndexLength(index, length);
byte[] bytes = new byte[4096];
int remai... | java | public int setBytes(int index, InputStream in, int length)
throws IOException
{
checkIndexLength(index, length);
byte[] bytes = new byte[4096];
int remaining = length;
while (remaining > 0) {
int bytesRead = in.read(bytes, 0, Math.min(bytes.length, remaining))... | [
"public",
"int",
"setBytes",
"(",
"int",
"index",
",",
"InputStream",
"in",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"checkIndexLength",
"(",
"index",
",",
"length",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"4096",
... | Transfers data from the specified input stream into this slice starting at
the specified absolute {@code index}. | [
"Transfers",
"data",
"from",
"the",
"specified",
"input",
"stream",
"into",
"this",
"slice",
"starting",
"at",
"the",
"specified",
"absolute",
"{"
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java#L543-L563 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java | AmazonS3Client.setBucketAcl | public void setBucketAcl(String bucketName, CannedAccessControlList cannedAcl,
RequestMetricCollector requestMetricCollector) throws SdkClientException,
AmazonServiceException {
"""
Same as {@link #setBucketAcl(String, CannedAccessControlList)}
but allows specifying a request metric collec... | java | public void setBucketAcl(String bucketName, CannedAccessControlList cannedAcl,
RequestMetricCollector requestMetricCollector) throws SdkClientException,
AmazonServiceException {
SetBucketAclRequest request = new SetBucketAclRequest(bucketName, cannedAcl)
.withRequestMetricCol... | [
"public",
"void",
"setBucketAcl",
"(",
"String",
"bucketName",
",",
"CannedAccessControlList",
"cannedAcl",
",",
"RequestMetricCollector",
"requestMetricCollector",
")",
"throws",
"SdkClientException",
",",
"AmazonServiceException",
"{",
"SetBucketAclRequest",
"request",
"=",... | Same as {@link #setBucketAcl(String, CannedAccessControlList)}
but allows specifying a request metric collector. | [
"Same",
"as",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L1256-L1262 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_specifications_network_GET | public OvhNetworkSpecifications serviceName_specifications_network_GET(String serviceName) throws IOException {
"""
Retrieve network informations about this dedicated server
REST: GET /dedicated/server/{serviceName}/specifications/network
@param serviceName [required] The internal name of your dedicated server... | java | public OvhNetworkSpecifications serviceName_specifications_network_GET(String serviceName) throws IOException {
String qPath = "/dedicated/server/{serviceName}/specifications/network";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhN... | [
"public",
"OvhNetworkSpecifications",
"serviceName_specifications_network_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/specifications/network\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Retrieve network informations about this dedicated server
REST: GET /dedicated/server/{serviceName}/specifications/network
@param serviceName [required] The internal name of your dedicated server | [
"Retrieve",
"network",
"informations",
"about",
"this",
"dedicated",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1729-L1734 |
apache/incubator-gobblin | gobblin-modules/gobblin-parquet/src/main/java/org/apache/gobblin/converter/parquet/JsonElementConversionFactory.java | JsonElementConversionFactory.getConverter | public static JsonElementConverter getConverter(JsonSchema schema, boolean repeated) {
"""
Use to create a converter for a single field from a parquetSchema.
@param schema
@param repeated - Is the {@link Type} repeated in the parent {@link Group}
@return
"""
InputType fieldType = schema.getInputType(... | java | public static JsonElementConverter getConverter(JsonSchema schema, boolean repeated) {
InputType fieldType = schema.getInputType();
switch (fieldType) {
case INT:
return new IntConverter(schema, repeated);
case LONG:
return new LongConverter(schema, repeated);
case FLOAT:
... | [
"public",
"static",
"JsonElementConverter",
"getConverter",
"(",
"JsonSchema",
"schema",
",",
"boolean",
"repeated",
")",
"{",
"InputType",
"fieldType",
"=",
"schema",
".",
"getInputType",
"(",
")",
";",
"switch",
"(",
"fieldType",
")",
"{",
"case",
"INT",
":"... | Use to create a converter for a single field from a parquetSchema.
@param schema
@param repeated - Is the {@link Type} repeated in the parent {@link Group}
@return | [
"Use",
"to",
"create",
"a",
"converter",
"for",
"a",
"single",
"field",
"from",
"a",
"parquetSchema",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-parquet/src/main/java/org/apache/gobblin/converter/parquet/JsonElementConversionFactory.java#L74-L115 |
samskivert/pythagoras | src/main/java/pythagoras/f/Box.java | Box.intersectionY | protected float intersectionY (IRay3 ray, float y) {
"""
Helper method for {@link #intersection}. Finds the <code>t</code> value where the ray
intersects the box at the plane where y equals the value specified, or returns
{@link Float#MAX_VALUE} if there is no such intersection.
"""
IVector3 origin =... | java | protected float intersectionY (IRay3 ray, float y) {
IVector3 origin = ray.origin(), dir = ray.direction();
float t = (y - origin.y()) / dir.y();
if (t < 0f) {
return Float.MAX_VALUE;
}
float ix = origin.x() + t*dir.x(), iz = origin.z() + t*dir.z();
return (ix... | [
"protected",
"float",
"intersectionY",
"(",
"IRay3",
"ray",
",",
"float",
"y",
")",
"{",
"IVector3",
"origin",
"=",
"ray",
".",
"origin",
"(",
")",
",",
"dir",
"=",
"ray",
".",
"direction",
"(",
")",
";",
"float",
"t",
"=",
"(",
"y",
"-",
"origin",... | Helper method for {@link #intersection}. Finds the <code>t</code> value where the ray
intersects the box at the plane where y equals the value specified, or returns
{@link Float#MAX_VALUE} if there is no such intersection. | [
"Helper",
"method",
"for",
"{"
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Box.java#L496-L505 |
networknt/light-4j | utility/src/main/java/com/networknt/utility/RegExUtils.java | RegExUtils.removePattern | public static String removePattern(final String text, final String regex) {
"""
<p>Removes each substring of the source String that matches the given regular expression using the DOTALL option.</p>
This call is a {@code null} safe equivalent to:
<ul>
<li>{@code text.replaceAll("(?s)" + regex, String... | java | public static String removePattern(final String text, final String regex) {
return replacePattern(text, regex, StringUtils.EMPTY);
} | [
"public",
"static",
"String",
"removePattern",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"regex",
")",
"{",
"return",
"replacePattern",
"(",
"text",
",",
"regex",
",",
"StringUtils",
".",
"EMPTY",
")",
";",
"}"
] | <p>Removes each substring of the source String that matches the given regular expression using the DOTALL option.</p>
This call is a {@code null} safe equivalent to:
<ul>
<li>{@code text.replaceAll("(?s)" + regex, StringUtils.EMPTY)}</li>
<li>{@code Pattern.compile(regex, Pattern.DOTALL).matcher(text).replac... | [
"<p",
">",
"Removes",
"each",
"substring",
"of",
"the",
"source",
"String",
"that",
"matches",
"the",
"given",
"regular",
"expression",
"using",
"the",
"DOTALL",
"option",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/RegExUtils.java#L218-L220 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/FileSystem.java | FileSystem.uriCaseCheck | public static boolean uriCaseCheck(File file, String matchString) throws java.io.IOException {
"""
Not a problem on UNIX type systems since the OS handles is case sensitive.
"""
if (isCaseInsensitive || isWindows) { // security measure to ensure that this check is only performed on case
//... | java | public static boolean uriCaseCheck(File file, String matchString) throws java.io.IOException {
if (isCaseInsensitive || isWindows) { // security measure to ensure that this check is only performed on case
// sensitive servers
// begin 154268
matchString = WSUtil.resolveURI(... | [
"public",
"static",
"boolean",
"uriCaseCheck",
"(",
"File",
"file",
",",
"String",
"matchString",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"if",
"(",
"isCaseInsensitive",
"||",
"isWindows",
")",
"{",
"// security measure to ensure that this check i... | Not a problem on UNIX type systems since the OS handles is case sensitive. | [
"Not",
"a",
"problem",
"on",
"UNIX",
"type",
"systems",
"since",
"the",
"OS",
"handles",
"is",
"case",
"sensitive",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/FileSystem.java#L35-L66 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/OrientedRectangle2dfx.java | OrientedRectangle2dfx.firstAxisProperty | @Pure
public UnitVectorProperty firstAxisProperty() {
"""
Replies the property for the first rectangle axis.
@return the firstAxis property.
"""
if (this.raxis == null) {
this.raxis = new UnitVectorProperty(this, MathFXAttributeNames.FIRST_AXIS, getGeomFactory());
}
return this.raxis;
} | java | @Pure
public UnitVectorProperty firstAxisProperty() {
if (this.raxis == null) {
this.raxis = new UnitVectorProperty(this, MathFXAttributeNames.FIRST_AXIS, getGeomFactory());
}
return this.raxis;
} | [
"@",
"Pure",
"public",
"UnitVectorProperty",
"firstAxisProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"raxis",
"==",
"null",
")",
"{",
"this",
".",
"raxis",
"=",
"new",
"UnitVectorProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"FIRST_AXIS",
","... | Replies the property for the first rectangle axis.
@return the firstAxis property. | [
"Replies",
"the",
"property",
"for",
"the",
"first",
"rectangle",
"axis",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/OrientedRectangle2dfx.java#L271-L277 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getRevisionIdsContainingTemplateNames | public List<Integer> getRevisionIdsContainingTemplateNames(List<String> templateNames) throws WikiApiException {
"""
Returns a list containing the ids of all revisions that contain a template
the name of which equals any of the given Strings.
@param templateNames
the names of the template that we want to matc... | java | public List<Integer> getRevisionIdsContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredRevisionIds(templateNames, true);
} | [
"public",
"List",
"<",
"Integer",
">",
"getRevisionIdsContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredRevisionIds",
"(",
"templateNames",
",",
"true",
")",
";",
"}"
] | Returns a list containing the ids of all revisions that contain a template
the name of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return A list with the ids of all revisions that contain any of the the
specified templates
@throws WikiApiException
If the... | [
"Returns",
"a",
"list",
"containing",
"the",
"ids",
"of",
"all",
"revisions",
"that",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"any",
"of",
"the",
"given",
"Strings",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1080-L1082 |
ardoq/ardoq-java-client | src/main/java/com/ardoq/service/SimpleModelService.java | SimpleModelService.findOrCreateTemplate | public Model findOrCreateTemplate(String name, InputStream modelJson) throws IOException {
"""
Tries to lookup the model by name, and returns it if it's found.
If not, it is created from the provided JSON input stream.
@param name
@param modelJson
@return model
@throws IOException
"""
try {
... | java | public Model findOrCreateTemplate(String name, InputStream modelJson) throws IOException {
try {
Model m = getTemplateByName(name);
return m;
} catch (IllegalArgumentException ignore) {
}
String modelStr = IOUtils.toString(modelJson, "UTF-8");
return mode... | [
"public",
"Model",
"findOrCreateTemplate",
"(",
"String",
"name",
",",
"InputStream",
"modelJson",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Model",
"m",
"=",
"getTemplateByName",
"(",
"name",
")",
";",
"return",
"m",
";",
"}",
"catch",
"(",
"IllegalAr... | Tries to lookup the model by name, and returns it if it's found.
If not, it is created from the provided JSON input stream.
@param name
@param modelJson
@return model
@throws IOException | [
"Tries",
"to",
"lookup",
"the",
"model",
"by",
"name",
"and",
"returns",
"it",
"if",
"it",
"s",
"found",
".",
"If",
"not",
"it",
"is",
"created",
"from",
"the",
"provided",
"JSON",
"input",
"stream",
"."
] | train | https://github.com/ardoq/ardoq-java-client/blob/03731c3df864d850ef41b252364a104376dde983/src/main/java/com/ardoq/service/SimpleModelService.java#L91-L100 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_pay_POST | public void order_orderId_pay_POST(Long orderId, OvhPayWithPaymentMethod paymentMethod) throws IOException {
"""
Pay with a payment method reference
REST: POST /me/order/{orderId}/pay
@param paymentMethod [required] Payment method informations for pay
@param orderId [required]
API beta
"""
String qPa... | java | public void order_orderId_pay_POST(Long orderId, OvhPayWithPaymentMethod paymentMethod) throws IOException {
String qPath = "/me/order/{orderId}/pay";
StringBuilder sb = path(qPath, orderId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "paymentMethod", paymentMethod);
exec(qPath, "POS... | [
"public",
"void",
"order_orderId_pay_POST",
"(",
"Long",
"orderId",
",",
"OvhPayWithPaymentMethod",
"paymentMethod",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/pay\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
... | Pay with a payment method reference
REST: POST /me/order/{orderId}/pay
@param paymentMethod [required] Payment method informations for pay
@param orderId [required]
API beta | [
"Pay",
"with",
"a",
"payment",
"method",
"reference"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1844-L1850 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppTree.java | MkAppTree.createNewDirectoryEntry | @Override
protected MkAppEntry createNewDirectoryEntry(MkAppTreeNode<O> node, DBID routingObjectID, double parentDistance) {
"""
Creates a new directory entry representing the specified node.
@param node the node to be represented by the new entry
@param routingObjectID the id of the routing object of the no... | java | @Override
protected MkAppEntry createNewDirectoryEntry(MkAppTreeNode<O> node, DBID routingObjectID, double parentDistance) {
return new MkAppDirectoryEntry(routingObjectID, parentDistance, node.getPageID(), node.coveringRadiusFromEntries(routingObjectID, this), null);
} | [
"@",
"Override",
"protected",
"MkAppEntry",
"createNewDirectoryEntry",
"(",
"MkAppTreeNode",
"<",
"O",
">",
"node",
",",
"DBID",
"routingObjectID",
",",
"double",
"parentDistance",
")",
"{",
"return",
"new",
"MkAppDirectoryEntry",
"(",
"routingObjectID",
",",
"paren... | Creates a new directory entry representing the specified node.
@param node the node to be represented by the new entry
@param routingObjectID the id of the routing object of the node
@param parentDistance the distance from the routing object of the node to
the routing object of the parent node | [
"Creates",
"a",
"new",
"directory",
"entry",
"representing",
"the",
"specified",
"node",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppTree.java#L395-L398 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/pascal/AcronymModel.java | AcronymModel.computeProb | public double computeProb(PascalTemplate temp) {
"""
Scores the {@link PascalTemplate} using the fields it contains which are relevant to the score.
(Ignores location and date fields.)
@param temp the full {@link PascalTemplate} to be scored
@return the model's score
"""
double prob = 1.0;
Strin... | java | public double computeProb(PascalTemplate temp) {
double prob = 1.0;
String wsname = temp.getValue("workshopname");
String confname = temp.getValue("conferencename");
String wsacronym = temp.getValue("workshopacronym");
String confacronym = temp.getValue("conferenceacronym");
String wsurl... | [
"public",
"double",
"computeProb",
"(",
"PascalTemplate",
"temp",
")",
"{",
"double",
"prob",
"=",
"1.0",
";",
"String",
"wsname",
"=",
"temp",
".",
"getValue",
"(",
"\"workshopname\"",
")",
";",
"String",
"confname",
"=",
"temp",
".",
"getValue",
"(",
"\"... | Scores the {@link PascalTemplate} using the fields it contains which are relevant to the score.
(Ignores location and date fields.)
@param temp the full {@link PascalTemplate} to be scored
@return the model's score | [
"Scores",
"the",
"{"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/pascal/AcronymModel.java#L104-L114 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/ClassUtils.java | ClassUtils.isAssignable | public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) {
"""
Check if the right-hand side type may be assigned to the left-hand side
type, assuming setting by reflection. Considers primitive wrapper
classes as assignable to the corresponding primitive types.
@param lhsType the target type
@pa... | java | public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) {
Assert.notNull(lhsType, "Left-hand side type must not be null");
Assert.notNull(rhsType, "Right-hand side type must not be null");
if (lhsType.isAssignableFrom(rhsType)) {
return true;
}
if (lhsT... | [
"public",
"static",
"boolean",
"isAssignable",
"(",
"Class",
"<",
"?",
">",
"lhsType",
",",
"Class",
"<",
"?",
">",
"rhsType",
")",
"{",
"Assert",
".",
"notNull",
"(",
"lhsType",
",",
"\"Left-hand side type must not be null\"",
")",
";",
"Assert",
".",
"notN... | Check if the right-hand side type may be assigned to the left-hand side
type, assuming setting by reflection. Considers primitive wrapper
classes as assignable to the corresponding primitive types.
@param lhsType the target type
@param rhsType the value type that should be assigned to the target type
@return if the ta... | [
"Check",
"if",
"the",
"right",
"-",
"hand",
"side",
"type",
"may",
"be",
"assigned",
"to",
"the",
"left",
"-",
"hand",
"side",
"type",
"assuming",
"setting",
"by",
"reflection",
".",
"Considers",
"primitive",
"wrapper",
"classes",
"as",
"assignable",
"to",
... | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/ClassUtils.java#L842-L860 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.getFace | public PersistedFace getFace(String personGroupId, UUID personId, UUID persistedFaceId) {
"""
Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId).
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a par... | java | public PersistedFace getFace(String personGroupId, UUID personId, UUID persistedFaceId) {
return getFaceWithServiceResponseAsync(personGroupId, personId, persistedFaceId).toBlocking().single().body();
} | [
"public",
"PersistedFace",
"getFace",
"(",
"String",
"personGroupId",
",",
"UUID",
"personId",
",",
"UUID",
"persistedFaceId",
")",
"{",
"return",
"getFaceWithServiceResponseAsync",
"(",
"personGroupId",
",",
"personId",
",",
"persistedFaceId",
")",
".",
"toBlocking",... | Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId).
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@param persistedFaceId Id referencing a particular persistedFaceId of an existing face... | [
"Retrieve",
"information",
"about",
"a",
"persisted",
"face",
"(",
"specified",
"by",
"persistedFaceId",
"personId",
"and",
"its",
"belonging",
"personGroupId",
")",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L890-L892 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java | TermOfUsePanel.newLegalReferencesPanel | protected Component newLegalReferencesPanel(final String id,
final IModel<HeaderContentListModelBean> model) {
"""
Factory method for creating the new {@link Component} for the legal references. This method
is invoked in the constructor from the derived classes and can be overridden so users can
provide their ... | java | protected Component newLegalReferencesPanel(final String id,
final IModel<HeaderContentListModelBean> model)
{
return new LegalReferencesPanel(id, Model.of(model.getObject()));
} | [
"protected",
"Component",
"newLegalReferencesPanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"HeaderContentListModelBean",
">",
"model",
")",
"{",
"return",
"new",
"LegalReferencesPanel",
"(",
"id",
",",
"Model",
".",
"of",
"(",
"model",
".",
... | Factory method for creating the new {@link Component} for the legal references. This method
is invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new {@link Component} for the legal references.
@param id
the id
@param model
the model
@return the new {@... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"legal",
"references",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridde... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java#L295-L299 |
rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__triggerRenderEvent | protected void __triggerRenderEvent(IEvent<Void, ITemplate> event, RythmEngine engine) {
"""
Trigger render events.
<p>Not an API for user application</p>
@param event
@param engine
"""
event.trigger(engine, this);
} | java | protected void __triggerRenderEvent(IEvent<Void, ITemplate> event, RythmEngine engine) {
event.trigger(engine, this);
} | [
"protected",
"void",
"__triggerRenderEvent",
"(",
"IEvent",
"<",
"Void",
",",
"ITemplate",
">",
"event",
",",
"RythmEngine",
"engine",
")",
"{",
"event",
".",
"trigger",
"(",
"engine",
",",
"this",
")",
";",
"}"
] | Trigger render events.
<p>Not an API for user application</p>
@param event
@param engine | [
"Trigger",
"render",
"events",
".",
"<p",
">",
"Not",
"an",
"API",
"for",
"user",
"application<",
"/",
"p",
">"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L562-L564 |
Trilarion/java-vorbis-support | src/main/java/com/github/trilarion/sound/sampled/spi/TAudioFileReader.java | TAudioFileReader.getAudioInputStream | @Override
public AudioInputStream getAudioInputStream(InputStream inputStream)
throws UnsupportedAudioFileException, IOException {
"""
Get an AudioInputStream object for an InputStream. This method calls
getAudioInputStream(InputStream, long). Subclasses should not override
this method unless the... | java | @Override
public AudioInputStream getAudioInputStream(InputStream inputStream)
throws UnsupportedAudioFileException, IOException {
LOG.log(Level.FINE, "TAudioFileReader.getAudioInputStream(InputStream): begin (class: {0})", getClass().getSimpleName());
long lFileLengthInBytes = AudioSyst... | [
"@",
"Override",
"public",
"AudioInputStream",
"getAudioInputStream",
"(",
"InputStream",
"inputStream",
")",
"throws",
"UnsupportedAudioFileException",
",",
"IOException",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"TAudioFileReader.getAudioInputStream(Inp... | Get an AudioInputStream object for an InputStream. This method calls
getAudioInputStream(InputStream, long). Subclasses should not override
this method unless there are really severe reasons. Normally, it is
sufficient to implement getAudioFileFormat(InputStream, long) and perhaps
override getAudioInputStream(InputStre... | [
"Get",
"an",
"AudioInputStream",
"object",
"for",
"an",
"InputStream",
".",
"This",
"method",
"calls",
"getAudioInputStream",
"(",
"InputStream",
"long",
")",
".",
"Subclasses",
"should",
"not",
"override",
"this",
"method",
"unless",
"there",
"are",
"really",
"... | train | https://github.com/Trilarion/java-vorbis-support/blob/f72aba7d97167fe0ff20b1b719fdb5bb662ff736/src/main/java/com/github/trilarion/sound/sampled/spi/TAudioFileReader.java#L251-L279 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.getByResourceGroup | public VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName) {
"""
Retrieves information about the model view or the instance view of a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@throws IllegalArgumentExce... | java | public VirtualMachineInner getByResourceGroup(String resourceGroupName, String vmName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().body();
} | [
"public",
"VirtualMachineInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
")",
".",
"toBlocking",
"(",
")",
".",
"single"... | Retrieves information about the model view or the instance view of a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejecte... | [
"Retrieves",
"information",
"about",
"the",
"model",
"view",
"or",
"the",
"instance",
"view",
"of",
"a",
"virtual",
"machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L878-L880 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/ResultUtil.java | ResultUtil.getDate | static public Date getDate(String str, TimeZone tz, SFSession session) throws SFException {
"""
Convert a date internal object to a Date object in specified timezone.
@param str snowflake date object
@param tz timezone we want convert to
@param session snowflake session object
@return java date obje... | java | static public Date getDate(String str, TimeZone tz, SFSession session) throws SFException
{
try
{
long milliSecsSinceEpoch = Long.valueOf(str) * 86400000;
SFTimestamp tsInUTC = SFTimestamp.fromDate(new Date(milliSecsSinceEpoch),
0, TimeZone.getTime... | [
"static",
"public",
"Date",
"getDate",
"(",
"String",
"str",
",",
"TimeZone",
"tz",
",",
"SFSession",
"session",
")",
"throws",
"SFException",
"{",
"try",
"{",
"long",
"milliSecsSinceEpoch",
"=",
"Long",
".",
"valueOf",
"(",
"str",
")",
"*",
"86400000",
";... | Convert a date internal object to a Date object in specified timezone.
@param str snowflake date object
@param tz timezone we want convert to
@param session snowflake session object
@return java date object
@throws SFException if date is invalid | [
"Convert",
"a",
"date",
"internal",
"object",
"to",
"a",
"Date",
"object",
"in",
"specified",
"timezone",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/ResultUtil.java#L890-L929 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java | DatabasesInner.updateAsync | public Observable<DatabaseInner> updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdate parameters) {
"""
Updates an existing database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Mana... | java | public Observable<DatabaseInner> updateAsync(String resourceGroupName, String serverName, String databaseName, DatabaseUpdate parameters) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() {
... | [
"public",
"Observable",
"<",
"DatabaseInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"DatabaseUpdate",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGro... | Updates an existing database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param parameters The requested database... | [
"Updates",
"an",
"existing",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L756-L763 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/VoiceApi.java | VoiceApi.stopRecording | public ApiSuccessResponse stopRecording(String id, StopRecordingBody stopRecordingBody) throws ApiException {
"""
Stop recording a call
Stop recording the specified call.
@param id The connection ID of the call. (required)
@param stopRecordingBody Request parameters. (optional)
@return ApiSuccessResponse
@thr... | java | public ApiSuccessResponse stopRecording(String id, StopRecordingBody stopRecordingBody) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = stopRecordingWithHttpInfo(id, stopRecordingBody);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"stopRecording",
"(",
"String",
"id",
",",
"StopRecordingBody",
"stopRecordingBody",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"stopRecordingWithHttpInfo",
"(",
"id",
",",
"stopRecordi... | Stop recording a call
Stop recording the specified call.
@param id The connection ID of the call. (required)
@param stopRecordingBody Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Stop",
"recording",
"a",
"call",
"Stop",
"recording",
"the",
"specified",
"call",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/VoiceApi.java#L4845-L4848 |
linkhub-sdk/popbill.sdk.java | src/main/java/com/popbill/api/taxinvoice/TaxinvoiceServiceImp.java | TaxinvoiceServiceImp.sendFAX | @Override
public Response sendFAX(String CorpNum, MgtKeyType KeyType, String MgtKey,
String Sender, String Receiver) throws PopbillException {
"""
/* (non-Javadoc)
@see com.popbill.api.TaxinvoiceService#sendFAX(java.lang.String, com.popbill.api.taxinvoice.MgtKeyType, java.lang.Stri... | java | @Override
public Response sendFAX(String CorpNum, MgtKeyType KeyType, String MgtKey,
String Sender, String Receiver) throws PopbillException {
return sendFAX(CorpNum, KeyType, MgtKey, Sender, Receiver, null);
} | [
"@",
"Override",
"public",
"Response",
"sendFAX",
"(",
"String",
"CorpNum",
",",
"MgtKeyType",
"KeyType",
",",
"String",
"MgtKey",
",",
"String",
"Sender",
",",
"String",
"Receiver",
")",
"throws",
"PopbillException",
"{",
"return",
"sendFAX",
"(",
"CorpNum",
... | /* (non-Javadoc)
@see com.popbill.api.TaxinvoiceService#sendFAX(java.lang.String, com.popbill.api.taxinvoice.MgtKeyType, java.lang.String, java.lang.String, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/linkhub-sdk/popbill.sdk.java/blob/63a341fefe96d60a368776638f3d4c81888238b7/src/main/java/com/popbill/api/taxinvoice/TaxinvoiceServiceImp.java#L599-L603 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.scanJarManifestForClassPathEntries | private void scanJarManifestForClassPathEntries(LinkedList<WorkListItem> workList, ICodeBase codeBase) throws IOException {
"""
Check a codebase for a Jar manifest to examine for Class-Path entries.
@param workList
the worklist
@param codeBase
the codebase for examine for a Jar manifest
@throws IOException
... | java | private void scanJarManifestForClassPathEntries(LinkedList<WorkListItem> workList, ICodeBase codeBase) throws IOException {
// See if this codebase has a jar manifest
ICodeBaseEntry manifestEntry = codeBase.lookupResource("META-INF/MANIFEST.MF");
if (manifestEntry == null) {
// Do no... | [
"private",
"void",
"scanJarManifestForClassPathEntries",
"(",
"LinkedList",
"<",
"WorkListItem",
">",
"workList",
",",
"ICodeBase",
"codeBase",
")",
"throws",
"IOException",
"{",
"// See if this codebase has a jar manifest",
"ICodeBaseEntry",
"manifestEntry",
"=",
"codeBase",... | Check a codebase for a Jar manifest to examine for Class-Path entries.
@param workList
the worklist
@param codeBase
the codebase for examine for a Jar manifest
@throws IOException | [
"Check",
"a",
"codebase",
"for",
"a",
"Jar",
"manifest",
"to",
"examine",
"for",
"Class",
"-",
"Path",
"entries",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L757-L792 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/DevEndpoint.java | DevEndpoint.withArguments | public DevEndpoint withArguments(java.util.Map<String, String> arguments) {
"""
<p>
A map of arguments used to configure the DevEndpoint.
</p>
<p>
Note that currently, we only support "--enable-glue-datacatalog": "" as a valid argument.
</p>
@param arguments
A map of arguments used to configure the DevEnd... | java | public DevEndpoint withArguments(java.util.Map<String, String> arguments) {
setArguments(arguments);
return this;
} | [
"public",
"DevEndpoint",
"withArguments",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"arguments",
")",
"{",
"setArguments",
"(",
"arguments",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of arguments used to configure the DevEndpoint.
</p>
<p>
Note that currently, we only support "--enable-glue-datacatalog": "" as a valid argument.
</p>
@param arguments
A map of arguments used to configure the DevEndpoint.</p>
<p>
Note that currently, we only support "--enable-glue-datacatalog": "" as a vali... | [
"<p",
">",
"A",
"map",
"of",
"arguments",
"used",
"to",
"configure",
"the",
"DevEndpoint",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Note",
"that",
"currently",
"we",
"only",
"support",
"--",
"enable",
"-",
"glue",
"-",
"datacatalog",
":",
"as",
"a",
"val... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/DevEndpoint.java#L1270-L1273 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java | HtmlWriter.addStyles | public void addStyles(HtmlStyle style, StringBuilder vars) {
"""
Adds javascript style variables to the document.
@param style style to be added as a javascript variable
@param vars variable string to which the style variable will be added
"""
vars.append("var ").append(style).append(" = \"").appen... | java | public void addStyles(HtmlStyle style, StringBuilder vars) {
vars.append("var ").append(style).append(" = \"").append(style)
.append("\";").append(DocletConstants.NL);
} | [
"public",
"void",
"addStyles",
"(",
"HtmlStyle",
"style",
",",
"StringBuilder",
"vars",
")",
"{",
"vars",
".",
"append",
"(",
"\"var \"",
")",
".",
"append",
"(",
"style",
")",
".",
"append",
"(",
"\" = \\\"\"",
")",
".",
"append",
"(",
"style",
")",
"... | Adds javascript style variables to the document.
@param style style to be added as a javascript variable
@param vars variable string to which the style variable will be added | [
"Adds",
"javascript",
"style",
"variables",
"to",
"the",
"document",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java#L381-L384 |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/rest/RestClient.java | RestClient.setProxyCfg | public static ProxyInfo setProxyCfg(String host, String port, String userName, String password) {
"""
Set proxy configuration.
@param host
@param port
@param userName
@param password
@return proxyinfo instance
"""
return new ProxyInfo(host, port, userName, password);
} | java | public static ProxyInfo setProxyCfg(String host, String port, String userName, String password) {
return new ProxyInfo(host, port, userName, password);
} | [
"public",
"static",
"ProxyInfo",
"setProxyCfg",
"(",
"String",
"host",
",",
"String",
"port",
",",
"String",
"userName",
",",
"String",
"password",
")",
"{",
"return",
"new",
"ProxyInfo",
"(",
"host",
",",
"port",
",",
"userName",
",",
"password",
")",
";"... | Set proxy configuration.
@param host
@param port
@param userName
@param password
@return proxyinfo instance | [
"Set",
"proxy",
"configuration",
"."
] | train | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/rest/RestClient.java#L422-L424 |
wcm-io/wcm-io-handler | commons/src/main/java/io/wcm/handler/commons/dom/HtmlElement.java | HtmlElement.setStyle | public final T setStyle(String styleAttribute, String styleValue) {
"""
Html "style" attribute. Sets single style attribute value.
@param styleAttribute Style attribute name
@param styleValue Style attribute value
@return Self reference
"""
// Add style to style map
Map<String, String> styleMap = g... | java | public final T setStyle(String styleAttribute, String styleValue) {
// Add style to style map
Map<String, String> styleMap = getStyles();
styleMap.put(styleAttribute, styleValue);
// Serialize style string
StringBuilder styleString = new StringBuilder();
for (Map.Entry style : styleMap.entrySe... | [
"public",
"final",
"T",
"setStyle",
"(",
"String",
"styleAttribute",
",",
"String",
"styleValue",
")",
"{",
"// Add style to style map",
"Map",
"<",
"String",
",",
"String",
">",
"styleMap",
"=",
"getStyles",
"(",
")",
";",
"styleMap",
".",
"put",
"(",
"styl... | Html "style" attribute. Sets single style attribute value.
@param styleAttribute Style attribute name
@param styleValue Style attribute value
@return Self reference | [
"Html",
"style",
"attribute",
".",
"Sets",
"single",
"style",
"attribute",
"value",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/HtmlElement.java#L195-L211 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.createVisibilityConfiguration | protected VisibilityConfiguration createVisibilityConfiguration(String className, String params) {
"""
Helper method to create a visibility configuration.<p>
@param className the visibility handler class name
@param params the parameters for the visibility
@return the visibility configuration
"""
... | java | protected VisibilityConfiguration createVisibilityConfiguration(String className, String params) {
I_CmsXmlContentVisibilityHandler handler = this;
if (className != null) {
try {
handler = (I_CmsXmlContentVisibilityHandler)(Class.forName(className).newInstance());
... | [
"protected",
"VisibilityConfiguration",
"createVisibilityConfiguration",
"(",
"String",
"className",
",",
"String",
"params",
")",
"{",
"I_CmsXmlContentVisibilityHandler",
"handler",
"=",
"this",
";",
"if",
"(",
"className",
"!=",
"null",
")",
"{",
"try",
"{",
"hand... | Helper method to create a visibility configuration.<p>
@param className the visibility handler class name
@param params the parameters for the visibility
@return the visibility configuration | [
"Helper",
"method",
"to",
"create",
"a",
"visibility",
"configuration",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L2242-L2254 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java | FrontUtils.distanceToNearestPoint | public static double distanceToNearestPoint(Point point, Front front, PointDistance distance) {
"""
Gets the distance between a point and the nearest one in a front. If a distance equals to 0
is found, that means that the point is in the front, so it is excluded
@param point The point
@param front The front t... | java | public static double distanceToNearestPoint(Point point, Front front, PointDistance distance) {
if (front == null) {
throw new NullFrontException();
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException();
} else if (point == null) {
throw new JMetalException("The poin... | [
"public",
"static",
"double",
"distanceToNearestPoint",
"(",
"Point",
"point",
",",
"Front",
"front",
",",
"PointDistance",
"distance",
")",
"{",
"if",
"(",
"front",
"==",
"null",
")",
"{",
"throw",
"new",
"NullFrontException",
"(",
")",
";",
"}",
"else",
... | Gets the distance between a point and the nearest one in a front. If a distance equals to 0
is found, that means that the point is in the front, so it is excluded
@param point The point
@param front The front that contains the other points to calculate the distances
@return The minimum distance between the point and t... | [
"Gets",
"the",
"distance",
"between",
"a",
"point",
"and",
"the",
"nearest",
"one",
"in",
"a",
"front",
".",
"If",
"a",
"distance",
"equals",
"to",
"0",
"is",
"found",
"that",
"means",
"that",
"the",
"point",
"is",
"in",
"the",
"front",
"so",
"it",
"... | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java#L104-L123 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java | SeaGlassLookAndFeel.paintRegion | private static void paintRegion(SynthContext state, Graphics g, Rectangle bounds) {
"""
Paint a region.
@param state the SynthContext describing the current component, region,
and state.
@param g the Graphics context used to paint the subregion.
@param bounds the bounds to paint in.
"""
JCo... | java | private static void paintRegion(SynthContext state, Graphics g, Rectangle bounds) {
JComponent c = state.getComponent();
SynthStyle style = state.getStyle();
int x;
int y;
int width;
int height;
if (bounds == null) {
... | [
"private",
"static",
"void",
"paintRegion",
"(",
"SynthContext",
"state",
",",
"Graphics",
"g",
",",
"Rectangle",
"bounds",
")",
"{",
"JComponent",
"c",
"=",
"state",
".",
"getComponent",
"(",
")",
";",
"SynthStyle",
"style",
"=",
"state",
".",
"getStyle",
... | Paint a region.
@param state the SynthContext describing the current component, region,
and state.
@param g the Graphics context used to paint the subregion.
@param bounds the bounds to paint in. | [
"Paint",
"a",
"region",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L2804-L2831 |
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.getPrebuiltEntityRoleAsync | public Observable<EntityRole> getPrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumentE... | java | public Observable<EntityRole> getPrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {
return getPrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).map(new Func1<ServiceResponse<EntityRole>, EntityRole>() {
@Override
public Entity... | [
"public",
"Observable",
"<",
"EntityRole",
">",
"getPrebuiltEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"getPrebuiltEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"v... | Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the EntityRole object | [
"Get",
"one",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L11174-L11181 |
gwtbootstrap3/gwtbootstrap3 | gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Column.java | Column.setSize | public void setSize(final ColumnSize firstSize, final ColumnSize... otherSizes) {
"""
Adds one or more additional column sizes.
@param firstSize Column size
@param otherSizes Additional column sizes
"""
addEnumVarargsValues(new ColumnSize[]{firstSize}, ColumnSize.class, true);
addEnumVarar... | java | public void setSize(final ColumnSize firstSize, final ColumnSize... otherSizes) {
addEnumVarargsValues(new ColumnSize[]{firstSize}, ColumnSize.class, true);
addEnumVarargsValues(otherSizes, ColumnSize.class, false);
} | [
"public",
"void",
"setSize",
"(",
"final",
"ColumnSize",
"firstSize",
",",
"final",
"ColumnSize",
"...",
"otherSizes",
")",
"{",
"addEnumVarargsValues",
"(",
"new",
"ColumnSize",
"[",
"]",
"{",
"firstSize",
"}",
",",
"ColumnSize",
".",
"class",
",",
"true",
... | Adds one or more additional column sizes.
@param firstSize Column size
@param otherSizes Additional column sizes | [
"Adds",
"one",
"or",
"more",
"additional",
"column",
"sizes",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3/blob/54bdbd0b12ba7a436b278c007df960d1adf2e641/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Column.java#L98-L101 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java | FeatureShapes.addMapShape | public void addMapShape(GoogleMapShape mapShape, long featureId, String database, String table) {
"""
Add a map shape with the feature id, database, and table
@param mapShape map shape
@param featureId feature id
@param database GeoPackage database
@param table table name
"""
FeatureShape f... | java | public void addMapShape(GoogleMapShape mapShape, long featureId, String database, String table) {
FeatureShape featureShape = getFeatureShape(database, table, featureId);
featureShape.addShape(mapShape);
} | [
"public",
"void",
"addMapShape",
"(",
"GoogleMapShape",
"mapShape",
",",
"long",
"featureId",
",",
"String",
"database",
",",
"String",
"table",
")",
"{",
"FeatureShape",
"featureShape",
"=",
"getFeatureShape",
"(",
"database",
",",
"table",
",",
"featureId",
")... | Add a map shape with the feature id, database, and table
@param mapShape map shape
@param featureId feature id
@param database GeoPackage database
@param table table name | [
"Add",
"a",
"map",
"shape",
"with",
"the",
"feature",
"id",
"database",
"and",
"table"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/FeatureShapes.java#L180-L183 |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/transaction/compensating/manager/TransactionAwareDirContextInvocationHandler.java | TransactionAwareDirContextInvocationHandler.doCloseConnection | void doCloseConnection(DirContext context, ContextSource contextSource)
throws javax.naming.NamingException {
"""
Close the supplied context, but only if it is not associated with the
current transaction.
@param context
the DirContext to close.
@param contextSource
the ContextSource bound to the... | java | void doCloseConnection(DirContext context, ContextSource contextSource)
throws javax.naming.NamingException {
DirContextHolder transactionContextHolder = (DirContextHolder) TransactionSynchronizationManager
.getResource(contextSource);
if (transactionContextHolder == null
... | [
"void",
"doCloseConnection",
"(",
"DirContext",
"context",
",",
"ContextSource",
"contextSource",
")",
"throws",
"javax",
".",
"naming",
".",
"NamingException",
"{",
"DirContextHolder",
"transactionContextHolder",
"=",
"(",
"DirContextHolder",
")",
"TransactionSynchroniza... | Close the supplied context, but only if it is not associated with the
current transaction.
@param context
the DirContext to close.
@param contextSource
the ContextSource bound to the transaction.
@throws NamingException | [
"Close",
"the",
"supplied",
"context",
"but",
"only",
"if",
"it",
"is",
"not",
"associated",
"with",
"the",
"current",
"transaction",
"."
] | train | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/transaction/compensating/manager/TransactionAwareDirContextInvocationHandler.java#L107-L120 |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java | WebDriverTool.openNewWindow | public String openNewWindow(final String url, final long timeoutSeconds) {
"""
Opens a new window, switches to it, and loads the given URL in the new window.
@param url
the url to open
@param timeoutSeconds
the timeout in seconds to wait for the new window to open
@return the handle of the window that opene... | java | public String openNewWindow(final String url, final long timeoutSeconds) {
String oldHandle = openNewWindow(timeoutSeconds);
get(url);
return oldHandle;
} | [
"public",
"String",
"openNewWindow",
"(",
"final",
"String",
"url",
",",
"final",
"long",
"timeoutSeconds",
")",
"{",
"String",
"oldHandle",
"=",
"openNewWindow",
"(",
"timeoutSeconds",
")",
";",
"get",
"(",
"url",
")",
";",
"return",
"oldHandle",
";",
"}"
] | Opens a new window, switches to it, and loads the given URL in the new window.
@param url
the url to open
@param timeoutSeconds
the timeout in seconds to wait for the new window to open
@return the handle of the window that opened the new window | [
"Opens",
"a",
"new",
"window",
"switches",
"to",
"it",
"and",
"loads",
"the",
"given",
"URL",
"in",
"the",
"new",
"window",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L791-L795 |
remkop/picocli | src/main/java/picocli/CommandLine.java | CommandLine.addMixin | public CommandLine addMixin(String name, Object mixin) {
"""
Adds the options and positional parameters in the specified mixin to this command.
<p>The specified object may be a {@link CommandSpec CommandSpec} object, or it may be a user object with
{@code @Option} and {@code @Parameters}-annotated fields, in whi... | java | public CommandLine addMixin(String name, Object mixin) {
getCommandSpec().addMixin(name, CommandSpec.forAnnotatedObject(mixin, factory));
return this;
} | [
"public",
"CommandLine",
"addMixin",
"(",
"String",
"name",
",",
"Object",
"mixin",
")",
"{",
"getCommandSpec",
"(",
")",
".",
"addMixin",
"(",
"name",
",",
"CommandSpec",
".",
"forAnnotatedObject",
"(",
"mixin",
",",
"factory",
")",
")",
";",
"return",
"t... | Adds the options and positional parameters in the specified mixin to this command.
<p>The specified object may be a {@link CommandSpec CommandSpec} object, or it may be a user object with
{@code @Option} and {@code @Parameters}-annotated fields, in which case picocli automatically
constructs a {@code CommandSpec} from ... | [
"Adds",
"the",
"options",
"and",
"positional",
"parameters",
"in",
"the",
"specified",
"mixin",
"to",
"this",
"command",
".",
"<p",
">",
"The",
"specified",
"object",
"may",
"be",
"a",
"{"
] | train | https://github.com/remkop/picocli/blob/3c5384f0d12817401d1921c3013c1282e2edcab2/src/main/java/picocli/CommandLine.java#L240-L243 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java | TemplateSubPatternAssociation.matchModes | private boolean matchModes(QName m1, QName m2) {
"""
Tell if two modes match according to the rules of XSLT.
@param m1 First mode to match
@param m2 Second mode to match
@return True if the two given modes match
"""
return (((null == m1) && (null == m2))
|| ((null != m1) && (null != m2) ... | java | private boolean matchModes(QName m1, QName m2)
{
return (((null == m1) && (null == m2))
|| ((null != m1) && (null != m2) && m1.equals(m2)));
} | [
"private",
"boolean",
"matchModes",
"(",
"QName",
"m1",
",",
"QName",
"m2",
")",
"{",
"return",
"(",
"(",
"(",
"null",
"==",
"m1",
")",
"&&",
"(",
"null",
"==",
"m2",
")",
")",
"||",
"(",
"(",
"null",
"!=",
"m1",
")",
"&&",
"(",
"null",
"!=",
... | Tell if two modes match according to the rules of XSLT.
@param m1 First mode to match
@param m2 Second mode to match
@return True if the two given modes match | [
"Tell",
"if",
"two",
"modes",
"match",
"according",
"to",
"the",
"rules",
"of",
"XSLT",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java#L134-L138 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.getAt | public static String getAt(String text, IntRange range) {
"""
Support the range subscript operator for String with IntRange
@param text a String
@param range an IntRange
@return the resulting String
@since 1.0
"""
return getAt(text, (Range) range);
} | java | public static String getAt(String text, IntRange range) {
return getAt(text, (Range) range);
} | [
"public",
"static",
"String",
"getAt",
"(",
"String",
"text",
",",
"IntRange",
"range",
")",
"{",
"return",
"getAt",
"(",
"text",
",",
"(",
"Range",
")",
"range",
")",
";",
"}"
] | Support the range subscript operator for String with IntRange
@param text a String
@param range an IntRange
@return the resulting String
@since 1.0 | [
"Support",
"the",
"range",
"subscript",
"operator",
"for",
"String",
"with",
"IntRange"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1462-L1464 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/loader/PersistenceXMLLoader.java | PersistenceXMLLoader.validateDocumentAgainstSchema | private static void validateDocumentAgainstSchema(final Document xmlRootNode) throws InvalidConfigurationException {
"""
Validates an xml object graph against its schema. Therefore it reads the
version from the root tag and tries to load the related xsd file from the
classpath.
@param xmlRootNode
root xml no... | java | private static void validateDocumentAgainstSchema(final Document xmlRootNode) throws InvalidConfigurationException
{
final Element rootElement = xmlRootNode.getDocumentElement();
final String version = rootElement.getAttribute("version");
String schemaFileName = "persistence_" + version.... | [
"private",
"static",
"void",
"validateDocumentAgainstSchema",
"(",
"final",
"Document",
"xmlRootNode",
")",
"throws",
"InvalidConfigurationException",
"{",
"final",
"Element",
"rootElement",
"=",
"xmlRootNode",
".",
"getDocumentElement",
"(",
")",
";",
"final",
"String"... | Validates an xml object graph against its schema. Therefore it reads the
version from the root tag and tries to load the related xsd file from the
classpath.
@param xmlRootNode
root xml node of the document to validate
@throws InvalidConfigurationException
if the validation could not be performed or the xml graph is
i... | [
"Validates",
"an",
"xml",
"object",
"graph",
"against",
"its",
"schema",
".",
"Therefore",
"it",
"reads",
"the",
"version",
"from",
"the",
"root",
"tag",
"and",
"tries",
"to",
"load",
"the",
"related",
"xsd",
"file",
"from",
"the",
"classpath",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/loader/PersistenceXMLLoader.java#L186-L220 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java | ResolvableType.forType | static ResolvableType forType(Type type, TypeProvider typeProvider, VariableResolver variableResolver) {
"""
Return a {@link ResolvableType} for the specified {@link Type} backed by a given {@link VariableResolver}.
@param type the source type or {@code null}
@param typeProvider the type provider or {@code nul... | java | static ResolvableType forType(Type type, TypeProvider typeProvider, VariableResolver variableResolver) {
if (type == null && typeProvider != null) {
type = TypeWrapper.forTypeProvider(typeProvider);
}
if (type == null) {
return NONE;
}
// For simple Class... | [
"static",
"ResolvableType",
"forType",
"(",
"Type",
"type",
",",
"TypeProvider",
"typeProvider",
",",
"VariableResolver",
"variableResolver",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"&&",
"typeProvider",
"!=",
"null",
")",
"{",
"type",
"=",
"TypeWrapper",
"... | Return a {@link ResolvableType} for the specified {@link Type} backed by a given {@link VariableResolver}.
@param type the source type or {@code null}
@param typeProvider the type provider or {@code null}
@param variableResolver the variable resolver or {@code null}
@return a {@link ResolvableType} for the specified {... | [
"Return",
"a",
"{",
"@link",
"ResolvableType",
"}",
"for",
"the",
"specified",
"{",
"@link",
"Type",
"}",
"backed",
"by",
"a",
"given",
"{",
"@link",
"VariableResolver",
"}",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java#L1099-L1114 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DateUtil.java | DateUtil.parseTimestamp | public static Timestamp parseTimestamp(final String date, final String format, final TimeZone timeZone) {
"""
Converts the specified <code>date</code> with the specified {@code format} to a new instance of Timestamp.
<code>null</code> is returned if the specified <code>date</code> is null or empty.
@param date... | java | public static Timestamp parseTimestamp(final String date, final String format, final TimeZone timeZone) {
if (N.isNullOrEmpty(date) || (date.length() == 4 && "null".equalsIgnoreCase(date))) {
return null;
}
return createTimestamp(parse(date, format, timeZone));
} | [
"public",
"static",
"Timestamp",
"parseTimestamp",
"(",
"final",
"String",
"date",
",",
"final",
"String",
"format",
",",
"final",
"TimeZone",
"timeZone",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"date",
")",
"||",
"(",
"date",
".",
"length",
... | Converts the specified <code>date</code> with the specified {@code format} to a new instance of Timestamp.
<code>null</code> is returned if the specified <code>date</code> is null or empty.
@param date
@param format
@param timeZone
@return | [
"Converts",
"the",
"specified",
"<code",
">",
"date<",
"/",
"code",
">",
"with",
"the",
"specified",
"{",
"@code",
"format",
"}",
"to",
"a",
"new",
"instance",
"of",
"Timestamp",
".",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"returned",
"if",
"th... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L458-L464 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.setSize | public void setSize(int newWidth, int newHeight) {
"""
Set the size of the map in pixels.
@param newWidth
The map's width.
@param newHeight
The map's height.
"""
saveState();
Bbox bbox = getBounds();
if (width != newWidth || height != newHeight) {
this.width = newWidth;
this.height = newHeigh... | java | public void setSize(int newWidth, int newHeight) {
saveState();
Bbox bbox = getBounds();
if (width != newWidth || height != newHeight) {
this.width = newWidth;
this.height = newHeight;
if (viewState.getScale() < getMinimumScale()) {
// The new scale is too low, re-apply old values:
double scale =... | [
"public",
"void",
"setSize",
"(",
"int",
"newWidth",
",",
"int",
"newHeight",
")",
"{",
"saveState",
"(",
")",
";",
"Bbox",
"bbox",
"=",
"getBounds",
"(",
")",
";",
"if",
"(",
"width",
"!=",
"newWidth",
"||",
"height",
"!=",
"newHeight",
")",
"{",
"t... | Set the size of the map in pixels.
@param newWidth
The map's width.
@param newHeight
The map's height. | [
"Set",
"the",
"size",
"of",
"the",
"map",
"in",
"pixels",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L306-L321 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLightManager.java | MultiUserChatLightManager.unblockRooms | public void unblockRooms(DomainBareJid mucLightService, List<Jid> roomsJids)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Unblock rooms.
@param mucLightService
@param roomsJids
@throws NoResponseException
@throws XMPPErrorException
@throws Not... | java | public void unblockRooms(DomainBareJid mucLightService, List<Jid> roomsJids)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
HashMap<Jid, Boolean> rooms = new HashMap<>();
for (Jid jid : roomsJids) {
rooms.put(jid, true);
}
... | [
"public",
"void",
"unblockRooms",
"(",
"DomainBareJid",
"mucLightService",
",",
"List",
"<",
"Jid",
">",
"roomsJids",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"HashMap",
"<",
"Jid"... | Unblock rooms.
@param mucLightService
@param roomsJids
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedException | [
"Unblock",
"rooms",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLightManager.java#L357-L364 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/temporal/ValueRange.java | ValueRange.checkValidValue | public long checkValidValue(long value, TemporalField field) {
"""
Checks that the specified value is valid.
<p>
This validates that the value is within the valid range of values.
The field is only used to improve the error message.
@param value the value to check
@param field the field being checked, may... | java | public long checkValidValue(long value, TemporalField field) {
if (isValidValue(value) == false) {
throw new DateTimeException(genInvalidFieldMessage(field, value));
}
return value;
} | [
"public",
"long",
"checkValidValue",
"(",
"long",
"value",
",",
"TemporalField",
"field",
")",
"{",
"if",
"(",
"isValidValue",
"(",
"value",
")",
"==",
"false",
")",
"{",
"throw",
"new",
"DateTimeException",
"(",
"genInvalidFieldMessage",
"(",
"field",
",",
... | Checks that the specified value is valid.
<p>
This validates that the value is within the valid range of values.
The field is only used to improve the error message.
@param value the value to check
@param field the field being checked, may be null
@return the value that was passed in
@see #isValidValue(long) | [
"Checks",
"that",
"the",
"specified",
"value",
"is",
"valid",
".",
"<p",
">",
"This",
"validates",
"that",
"the",
"value",
"is",
"within",
"the",
"valid",
"range",
"of",
"values",
".",
"The",
"field",
"is",
"only",
"used",
"to",
"improve",
"the",
"error"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/temporal/ValueRange.java#L309-L314 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityListenersMetadata.java | EntityListenersMetadata.put | public void put(CallbackType callbackType, CallbackMetadata callbackMetadata) {
"""
Adds the given CallbackEventMetadata.
@param callbackType
the callback type
@param callbackMetadata
the metadata of the callback
"""
if (callbacks == null) {
callbacks = new EnumMap<>(CallbackType.class);
}
... | java | public void put(CallbackType callbackType, CallbackMetadata callbackMetadata) {
if (callbacks == null) {
callbacks = new EnumMap<>(CallbackType.class);
}
List<CallbackMetadata> callbackMetadataList = callbacks.get(callbackType);
if (callbackMetadataList == null) {
callbackMetadataList = new ... | [
"public",
"void",
"put",
"(",
"CallbackType",
"callbackType",
",",
"CallbackMetadata",
"callbackMetadata",
")",
"{",
"if",
"(",
"callbacks",
"==",
"null",
")",
"{",
"callbacks",
"=",
"new",
"EnumMap",
"<>",
"(",
"CallbackType",
".",
"class",
")",
";",
"}",
... | Adds the given CallbackEventMetadata.
@param callbackType
the callback type
@param callbackMetadata
the metadata of the callback | [
"Adds",
"the",
"given",
"CallbackEventMetadata",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityListenersMetadata.java#L122-L132 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/utils/ZipUtil.java | ZipUtil.extractZip | public static void extractZip(final String path, final File dest) throws IOException {
"""
Extracts all contents of the file to the destination directory
@param path zip file path
@param dest destination directory
@throws IOException on io error
"""
extractZip(path, dest, null);
} | java | public static void extractZip(final String path, final File dest) throws IOException {
extractZip(path, dest, null);
} | [
"public",
"static",
"void",
"extractZip",
"(",
"final",
"String",
"path",
",",
"final",
"File",
"dest",
")",
"throws",
"IOException",
"{",
"extractZip",
"(",
"path",
",",
"dest",
",",
"null",
")",
";",
"}"
] | Extracts all contents of the file to the destination directory
@param path zip file path
@param dest destination directory
@throws IOException on io error | [
"Extracts",
"all",
"contents",
"of",
"the",
"file",
"to",
"the",
"destination",
"directory"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/utils/ZipUtil.java#L45-L47 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/descriptors/tensorflow/TensorflowDescriptorParser.java | TensorflowDescriptorParser.opDescs | public static synchronized Map<String,OpDef> opDescs() {
"""
Get the op descriptors for tensorflow
@return the op descriptors for tensorflow
@throws Exception
"""
if(DESCRIPTORS != null){
return DESCRIPTORS;
}
try (InputStream contents = new ClassPathResource("ops.proto")... | java | public static synchronized Map<String,OpDef> opDescs() {
if(DESCRIPTORS != null){
return DESCRIPTORS;
}
try (InputStream contents = new ClassPathResource("ops.proto").getInputStream(); BufferedInputStream bis2 = new BufferedInputStream(contents); BufferedReader reader = new Buffered... | [
"public",
"static",
"synchronized",
"Map",
"<",
"String",
",",
"OpDef",
">",
"opDescs",
"(",
")",
"{",
"if",
"(",
"DESCRIPTORS",
"!=",
"null",
")",
"{",
"return",
"DESCRIPTORS",
";",
"}",
"try",
"(",
"InputStream",
"contents",
"=",
"new",
"ClassPathResourc... | Get the op descriptors for tensorflow
@return the op descriptors for tensorflow
@throws Exception | [
"Get",
"the",
"op",
"descriptors",
"for",
"tensorflow"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/descriptors/tensorflow/TensorflowDescriptorParser.java#L41-L69 |
lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLib.java | FunctionLib.duplicate | private HashMap duplicate(HashMap funcs, boolean deepCopy) {
"""
duplcate a hashmap with FunctionLibFunction's
@param funcs
@param deepCopy
@return cloned map
"""
if (deepCopy) throw new PageRuntimeException(new ExpressionException("deep copy not supported"));
Iterator it = funcs.entrySet().iterator();... | java | private HashMap duplicate(HashMap funcs, boolean deepCopy) {
if (deepCopy) throw new PageRuntimeException(new ExpressionException("deep copy not supported"));
Iterator it = funcs.entrySet().iterator();
Map.Entry entry;
HashMap cm = new HashMap();
while (it.hasNext()) {
entry = (Entry) it.next();
cm.put(... | [
"private",
"HashMap",
"duplicate",
"(",
"HashMap",
"funcs",
",",
"boolean",
"deepCopy",
")",
"{",
"if",
"(",
"deepCopy",
")",
"throw",
"new",
"PageRuntimeException",
"(",
"new",
"ExpressionException",
"(",
"\"deep copy not supported\"",
")",
")",
";",
"Iterator",
... | duplcate a hashmap with FunctionLibFunction's
@param funcs
@param deepCopy
@return cloned map | [
"duplcate",
"a",
"hashmap",
"with",
"FunctionLibFunction",
"s"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLib.java#L239-L251 |
OpenTSDB/opentsdb | src/tsd/HttpJsonSerializer.java | HttpJsonSerializer.parseUidRenameV1 | public HashMap<String, String> parseUidRenameV1() {
"""
Parses metric, tagk or tagv, and name to rename UID
@return as hash map of type and name
@throws JSONException if parsing failed
@throws BadRequestException if the content was missing or parsing failed
"""
final String json = query.getContent();
... | java | public HashMap<String, String> parseUidRenameV1() {
final String json = query.getContent();
if (json == null || json.isEmpty()) {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Missing message content",
"Supply valid JSON formatted data in the body of your request");
... | [
"public",
"HashMap",
"<",
"String",
",",
"String",
">",
"parseUidRenameV1",
"(",
")",
"{",
"final",
"String",
"json",
"=",
"query",
".",
"getContent",
"(",
")",
";",
"if",
"(",
"json",
"==",
"null",
"||",
"json",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Parses metric, tagk or tagv, and name to rename UID
@return as hash map of type and name
@throws JSONException if parsing failed
@throws BadRequestException if the content was missing or parsing failed | [
"Parses",
"metric",
"tagk",
"or",
"tagv",
"and",
"name",
"to",
"rename",
"UID"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L244-L256 |
camunda/camunda-bpmn-model | src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractSignalEventDefinitionBuilder.java | AbstractSignalEventDefinitionBuilder.camundaInSourceTarget | public B camundaInSourceTarget(String source, String target) {
"""
Sets a "camunda:in" parameter to pass a variable from the signal-throwing
process instance to the signal-catching process instance
@param source the name of the variable in the signal-throwing process instance
@param target the name of the var... | java | public B camundaInSourceTarget(String source, String target) {
CamundaIn param = modelInstance.newInstance(CamundaIn.class);
param.setCamundaSource(source);
param.setCamundaTarget(target);
addExtensionElement(param);
return myself;
} | [
"public",
"B",
"camundaInSourceTarget",
"(",
"String",
"source",
",",
"String",
"target",
")",
"{",
"CamundaIn",
"param",
"=",
"modelInstance",
".",
"newInstance",
"(",
"CamundaIn",
".",
"class",
")",
";",
"param",
".",
"setCamundaSource",
"(",
"source",
")",
... | Sets a "camunda:in" parameter to pass a variable from the signal-throwing
process instance to the signal-catching process instance
@param source the name of the variable in the signal-throwing process instance
@param target the name of the variable in the signal-catching process instance
@return the builder object | [
"Sets",
"a",
"camunda",
":",
"in",
"parameter",
"to",
"pass",
"a",
"variable",
"from",
"the",
"signal",
"-",
"throwing",
"process",
"instance",
"to",
"the",
"signal",
"-",
"catching",
"process",
"instance"
] | train | https://github.com/camunda/camunda-bpmn-model/blob/debcadf041d10fa62b799de0307b832cea84e5d4/src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractSignalEventDefinitionBuilder.java#L40-L49 |
tvesalainen/util | security/src/main/java/org/vesalainen/security/cert/X509Generator.java | X509Generator.generateSelfSignedCertificate | public X509Certificate generateSelfSignedCertificate(String subjectDN, KeyPair pair, int days, String algorithm) throws CertificateException {
"""
Create a self-signed X.509 Certificate
@param subjectDN the X.509 Distinguished Name, eg "CN=Test, L=London, C=GB"
@param pair the KeyPair
@param days how many day... | java | public X509Certificate generateSelfSignedCertificate(String subjectDN, KeyPair pair, int days, String algorithm) throws CertificateException
{
return generateCertificate(subjectDN, null, pair, null, days, algorithm);
} | [
"public",
"X509Certificate",
"generateSelfSignedCertificate",
"(",
"String",
"subjectDN",
",",
"KeyPair",
"pair",
",",
"int",
"days",
",",
"String",
"algorithm",
")",
"throws",
"CertificateException",
"{",
"return",
"generateCertificate",
"(",
"subjectDN",
",",
"null"... | Create a self-signed X.509 Certificate
@param subjectDN the X.509 Distinguished Name, eg "CN=Test, L=London, C=GB"
@param pair the KeyPair
@param days how many days from now the Certificate is valid for
@param algorithm the signing algorithm, e.g. "SHA1withRSA"
@return
@throws java.security.cert.CertificateException | [
"Create",
"a",
"self",
"-",
"signed",
"X",
".",
"509",
"Certificate"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/security/src/main/java/org/vesalainen/security/cert/X509Generator.java#L58-L61 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/dest/table/AbstractTabularWriter.java | AbstractTabularWriter.writeValue | @Override
public final void writeValue(Value inValue, Format inFormat) throws TabularWriterException {
"""
Writes the provided value, taking into account the type of value that it
is and the provided formatter.
@param inValue the value to write. Cannot be <code>null</code>.
@param inFormat the formatter t... | java | @Override
public final void writeValue(Value inValue, Format inFormat) throws TabularWriterException {
this.valueVisitor.setFormat(inFormat);
inValue.accept(this.valueVisitor);
TabularWriterException exception = this.valueVisitor.getException();
this.valueVisitor.clear();
if ... | [
"@",
"Override",
"public",
"final",
"void",
"writeValue",
"(",
"Value",
"inValue",
",",
"Format",
"inFormat",
")",
"throws",
"TabularWriterException",
"{",
"this",
".",
"valueVisitor",
".",
"setFormat",
"(",
"inFormat",
")",
";",
"inValue",
".",
"accept",
"(",... | Writes the provided value, taking into account the type of value that it
is and the provided formatter.
@param inValue the value to write. Cannot be <code>null</code>.
@param inFormat the formatter to use.
@throws TabularWriterException if an error occurs trying to write the
value. | [
"Writes",
"the",
"provided",
"value",
"taking",
"into",
"account",
"the",
"type",
"of",
"value",
"that",
"it",
"is",
"and",
"the",
"provided",
"formatter",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/dest/table/AbstractTabularWriter.java#L119-L128 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.dialogContent | public String dialogContent(int segment, String title) {
"""
Builds the content area of the dialog window.<p>
@param segment the HTML segment (START / END)
@param title the title String for the dialog window
@return a content area start / end segment
"""
if (segment == HTML_START) {
... | java | public String dialogContent(int segment, String title) {
if (segment == HTML_START) {
StringBuffer result = new StringBuffer(512);
// null title is ok, we always want the title headline
result.append(dialogHead(title));
result.append("<div class=\"dialogcontent\"... | [
"public",
"String",
"dialogContent",
"(",
"int",
"segment",
",",
"String",
"title",
")",
"{",
"if",
"(",
"segment",
"==",
"HTML_START",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"512",
")",
";",
"// null title is ok, we always want the... | Builds the content area of the dialog window.<p>
@param segment the HTML segment (START / END)
@param title the title String for the dialog window
@return a content area start / end segment | [
"Builds",
"the",
"content",
"area",
"of",
"the",
"dialog",
"window",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L769-L781 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.writeStaticField | public static void writeStaticField(final Class<?> cls, final String fieldName, final Object value, final boolean forceAccess)
throws IllegalAccessException {
"""
Writes a named {@code static} {@link Field}. Superclasses will be considered.
@param cls
{@link Class} on which the field is to be found... | java | public static void writeStaticField(final Class<?> cls, final String fieldName, final Object value, final boolean forceAccess)
throws IllegalAccessException {
final Field field = getField(cls, fieldName, forceAccess);
Validate.isTrue(field != null, "Cannot locate field %s on %s", fieldName, ... | [
"public",
"static",
"void",
"writeStaticField",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"fieldName",
",",
"final",
"Object",
"value",
",",
"final",
"boolean",
"forceAccess",
")",
"throws",
"IllegalAccessException",
"{",
"final",
"F... | Writes a named {@code static} {@link Field}. Superclasses will be considered.
@param cls
{@link Class} on which the field is to be found
@param fieldName
to write
@param value
to set
@param forceAccess
whether to break scope restrictions using the
{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} metho... | [
"Writes",
"a",
"named",
"{",
"@code",
"static",
"}",
"{",
"@link",
"Field",
"}",
".",
"Superclasses",
"will",
"be",
"considered",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L595-L601 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java | AttributeConstraintRule.validateFuture | private boolean validateFuture(Object validationObject, Annotation annotate) {
"""
Checks whether a given date is that in future or not
@param validationObject
@param annotate
@return
"""
if (checkNullObject(validationObject))
{
return true;
}
int res = 0;
... | java | private boolean validateFuture(Object validationObject, Annotation annotate)
{
if (checkNullObject(validationObject))
{
return true;
}
int res = 0;
if (validationObject.getClass().isAssignableFrom(java.util.Date.class))
{
Date today = new Dat... | [
"private",
"boolean",
"validateFuture",
"(",
"Object",
"validationObject",
",",
"Annotation",
"annotate",
")",
"{",
"if",
"(",
"checkNullObject",
"(",
"validationObject",
")",
")",
"{",
"return",
"true",
";",
"}",
"int",
"res",
"=",
"0",
";",
"if",
"(",
"v... | Checks whether a given date is that in future or not
@param validationObject
@param annotate
@return | [
"Checks",
"whether",
"a",
"given",
"date",
"is",
"that",
"in",
"future",
"or",
"not"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/validation/rules/AttributeConstraintRule.java#L316-L352 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.regenerateKey | public void regenerateKey(String resourceGroupName, String accountName, KeyKind keyKind) {
"""
Regenerates an access key for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param keyKind The access k... | java | public void regenerateKey(String resourceGroupName, String accountName, KeyKind keyKind) {
regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).toBlocking().last().body();
} | [
"public",
"void",
"regenerateKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"KeyKind",
"keyKind",
")",
"{",
"regenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"keyKind",
")",
".",
"toBlocking",
"("... | Regenerates an access key for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly... | [
"Regenerates",
"an",
"access",
"key",
"for",
"the",
"specified",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L1800-L1802 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GroupApi.java | GroupApi.getMember | public Member getMember(Object groupIdOrPath, int userId) throws GitLabApiException {
"""
Get a group member viewable by the authenticated user.
<pre><code>GitLab Endpoint: GET /groups/:id/members/:id</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID ... | java | public Member getMember(Object groupIdOrPath, int userId) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(), "groups", getGroupIdOrPath(groupIdOrPath), "members", userId);
return (response.readEntity(new GenericType<Member>() {}));
} | [
"public",
"Member",
"getMember",
"(",
"Object",
"groupIdOrPath",
",",
"int",
"userId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"getDefaultPerPageParam",
"(",
")",
",",
"\"gro... | Get a group member viewable by the authenticated user.
<pre><code>GitLab Endpoint: GET /groups/:id/members/:id</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
@param userId the member ID of the member to get
@return a member viewable by the authentic... | [
"Get",
"a",
"group",
"member",
"viewable",
"by",
"the",
"authenticated",
"user",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GroupApi.java#L731-L734 |
grycap/coreutils | coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java | Http2Client.asyncGetJson | public void asyncGetJson(final String url, final boolean nocache, final Callback callback) {
"""
Retrieve information from a server via a HTTP GET request.
@param url - URL target of this request
@param nocache - don't accept an invalidated cached response, and don't store the server's response in any cache
@pa... | java | public void asyncGetJson(final String url, final boolean nocache, final Callback callback) {
asyncGet(url, newArrayList("application/json"), nocache, callback);
} | [
"public",
"void",
"asyncGetJson",
"(",
"final",
"String",
"url",
",",
"final",
"boolean",
"nocache",
",",
"final",
"Callback",
"callback",
")",
"{",
"asyncGet",
"(",
"url",
",",
"newArrayList",
"(",
"\"application/json\"",
")",
",",
"nocache",
",",
"callback",... | Retrieve information from a server via a HTTP GET request.
@param url - URL target of this request
@param nocache - don't accept an invalidated cached response, and don't store the server's response in any cache
@param callback - is called back when the response is readable | [
"Retrieve",
"information",
"from",
"a",
"server",
"via",
"a",
"HTTP",
"GET",
"request",
"."
] | train | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java#L82-L84 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.randomSample | public static ModifiableDBIDs randomSample(DBIDs source, int k, RandomFactory rnd) {
"""
Produce a random sample of the given DBIDs.
@param source Original DBIDs, no duplicates allowed
@param k k Parameter
@param rnd Random generator
@return new DBIDs
"""
return randomSample(source, k, rnd.getSingleT... | java | public static ModifiableDBIDs randomSample(DBIDs source, int k, RandomFactory rnd) {
return randomSample(source, k, rnd.getSingleThreadedRandom());
} | [
"public",
"static",
"ModifiableDBIDs",
"randomSample",
"(",
"DBIDs",
"source",
",",
"int",
"k",
",",
"RandomFactory",
"rnd",
")",
"{",
"return",
"randomSample",
"(",
"source",
",",
"k",
",",
"rnd",
".",
"getSingleThreadedRandom",
"(",
")",
")",
";",
"}"
] | Produce a random sample of the given DBIDs.
@param source Original DBIDs, no duplicates allowed
@param k k Parameter
@param rnd Random generator
@return new DBIDs | [
"Produce",
"a",
"random",
"sample",
"of",
"the",
"given",
"DBIDs",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L573-L575 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java | FDBigInteger.mult | private FDBigInteger mult(int i) {
"""
/*@
@ requires this.value() == 0;
@ assignable \nothing;
@ ensures \result == this;
@
@ also
@
@ requires this.value() != 0;
@ assignable \nothing;
@ ensures \result.value() == \old(this.value() * UNSIGNED(i));
@
"""
if (this.nWords == 0) {
... | java | private FDBigInteger mult(int i) {
if (this.nWords == 0) {
return this;
}
int[] r = new int[nWords + 1];
mult(data, nWords, i, r);
return new FDBigInteger(r, offset);
} | [
"private",
"FDBigInteger",
"mult",
"(",
"int",
"i",
")",
"{",
"if",
"(",
"this",
".",
"nWords",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"r",
"=",
"new",
"int",
"[",
"nWords",
"+",
"1",
"]",
";",
"mult",
"(",
"data",
... | /*@
@ requires this.value() == 0;
@ assignable \nothing;
@ ensures \result == this;
@
@ also
@
@ requires this.value() != 0;
@ assignable \nothing;
@ ensures \result.value() == \old(this.value() * UNSIGNED(i));
@ | [
"/",
"*"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L1121-L1128 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/accounts/A_CmsUsersList.java | A_CmsUsersList.addEnabledColumn | private void addEnabledColumn(
CmsListMetadata metadata,
CmsListDirectAction enable,
CmsListDirectAction deactivate) {
"""
Adds an "enabled" column.<p>
@param metadata the list metadata
@param enable the list action for enabling
@param deactivate the list action for disabling
"""
... | java | private void addEnabledColumn(
CmsListMetadata metadata,
CmsListDirectAction enable,
CmsListDirectAction deactivate) {
// create column for activation/deactivation
CmsListColumnDefinition enaCol = new CmsListColumnDefinition(LIST_COLUMN_ENABLED);
enaCol.setName(Messages.... | [
"private",
"void",
"addEnabledColumn",
"(",
"CmsListMetadata",
"metadata",
",",
"CmsListDirectAction",
"enable",
",",
"CmsListDirectAction",
"deactivate",
")",
"{",
"// create column for activation/deactivation",
"CmsListColumnDefinition",
"enaCol",
"=",
"new",
"CmsListColumnDe... | Adds an "enabled" column.<p>
@param metadata the list metadata
@param enable the list action for enabling
@param deactivate the list action for disabling | [
"Adds",
"an",
"enabled",
"column",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/accounts/A_CmsUsersList.java#L773-L796 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/db/operation/hsql/HSQLDeleteOperation.java | HSQLDeleteOperation.deleteContent | protected void deleteContent(final List<String> tables, final Statement statement) throws SQLException {
"""
Deletes all contents from the given tables.
@param tables
a {@link List} of table names who are to be deleted.
@param statement
the {@link Statement} to be used for executing a SQL statement.
@... | java | protected void deleteContent(final List<String> tables, final Statement statement) throws SQLException {
final ArrayList<String> tempTables = new ArrayList<String>(tables);
// Loop until all data is deleted: we don't know the correct DROP
// order, so we have to retry upon failure
while (!tempTables.isEmpty()... | [
"protected",
"void",
"deleteContent",
"(",
"final",
"List",
"<",
"String",
">",
"tables",
",",
"final",
"Statement",
"statement",
")",
"throws",
"SQLException",
"{",
"final",
"ArrayList",
"<",
"String",
">",
"tempTables",
"=",
"new",
"ArrayList",
"<",
"String"... | Deletes all contents from the given tables.
@param tables
a {@link List} of table names who are to be deleted.
@param statement
the {@link Statement} to be used for executing a SQL statement.
@throws SQLException
- if a database access error occurs | [
"Deletes",
"all",
"contents",
"from",
"the",
"given",
"tables",
"."
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/db/operation/hsql/HSQLDeleteOperation.java#L123-L147 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/Variable.java | Variable.haveMember | public boolean haveMember(String hedgeName, String memberName) {
"""
Test if we have a hedged member
<p>
@param hedgeName is the hedge name
@param memberName is the member name
@return true/false
"""
String fullName = hedgeName + "$" + memberName;
return haveMember(fullName);
} | java | public boolean haveMember(String hedgeName, String memberName) {
String fullName = hedgeName + "$" + memberName;
return haveMember(fullName);
} | [
"public",
"boolean",
"haveMember",
"(",
"String",
"hedgeName",
",",
"String",
"memberName",
")",
"{",
"String",
"fullName",
"=",
"hedgeName",
"+",
"\"$\"",
"+",
"memberName",
";",
"return",
"haveMember",
"(",
"fullName",
")",
";",
"}"
] | Test if we have a hedged member
<p>
@param hedgeName is the hedge name
@param memberName is the member name
@return true/false | [
"Test",
"if",
"we",
"have",
"a",
"hedged",
"member",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/Variable.java#L188-L191 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.copyStream | public static void copyStream( File inputFile, File outputFile ) throws IOException {
"""
Copies the content from inputFile into outputFile.
@param inputFile an input file (must be a file and exist)
@param outputFile will be created if it does not exist
@throws IOException if something went wrong
"""
In... | java | public static void copyStream( File inputFile, File outputFile ) throws IOException {
InputStream is = new FileInputStream( inputFile );
try {
copyStream( is, outputFile );
} finally {
is.close();
}
} | [
"public",
"static",
"void",
"copyStream",
"(",
"File",
"inputFile",
",",
"File",
"outputFile",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"new",
"FileInputStream",
"(",
"inputFile",
")",
";",
"try",
"{",
"copyStream",
"(",
"is",
",",
"outpu... | Copies the content from inputFile into outputFile.
@param inputFile an input file (must be a file and exist)
@param outputFile will be created if it does not exist
@throws IOException if something went wrong | [
"Copies",
"the",
"content",
"from",
"inputFile",
"into",
"outputFile",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L371-L378 |
amzn/ion-java | src/com/amazon/ion/impl/lite/IonLoaderLite.java | IonLoaderLite.load_helper | private IonDatagramLite load_helper(IonReader reader)
throws IOException {
"""
This doesn't wrap IOException because some callers need to propagate it.
@return a new datagram; not null.
"""
IonDatagramLite datagram = new IonDatagramLite(_system, _catalog);
IonWriter writer = _Private_Ion... | java | private IonDatagramLite load_helper(IonReader reader)
throws IOException
{
IonDatagramLite datagram = new IonDatagramLite(_system, _catalog);
IonWriter writer = _Private_IonWriterFactory.makeWriter(datagram);
writer.writeValues(reader);
return datagram;
} | [
"private",
"IonDatagramLite",
"load_helper",
"(",
"IonReader",
"reader",
")",
"throws",
"IOException",
"{",
"IonDatagramLite",
"datagram",
"=",
"new",
"IonDatagramLite",
"(",
"_system",
",",
"_catalog",
")",
";",
"IonWriter",
"writer",
"=",
"_Private_IonWriterFactory"... | This doesn't wrap IOException because some callers need to propagate it.
@return a new datagram; not null. | [
"This",
"doesn",
"t",
"wrap",
"IOException",
"because",
"some",
"callers",
"need",
"to",
"propagate",
"it",
"."
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/lite/IonLoaderLite.java#L76-L83 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java | ZooKeeperUtils.useNamespaceAndEnsurePath | public static CuratorFramework useNamespaceAndEnsurePath(final CuratorFramework client, final String path) throws Exception {
"""
Returns a facade of the client that uses the specified namespace, and ensures that all nodes
in the path exist.
@param client ZK client
@param path the new namespace
@return ZK Cl... | java | public static CuratorFramework useNamespaceAndEnsurePath(final CuratorFramework client, final String path) throws Exception {
Preconditions.checkNotNull(client, "client must not be null");
Preconditions.checkNotNull(path, "path must not be null");
// Ensure that the checkpoints path exists
client.newNamespaceA... | [
"public",
"static",
"CuratorFramework",
"useNamespaceAndEnsurePath",
"(",
"final",
"CuratorFramework",
"client",
",",
"final",
"String",
"path",
")",
"throws",
"Exception",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"client",
",",
"\"client must not be null\"",
")"... | Returns a facade of the client that uses the specified namespace, and ensures that all nodes
in the path exist.
@param client ZK client
@param path the new namespace
@return ZK Client that uses the new namespace
@throws Exception ZK errors | [
"Returns",
"a",
"facade",
"of",
"the",
"client",
"that",
"uses",
"the",
"specified",
"namespace",
"and",
"ensures",
"that",
"all",
"nodes",
"in",
"the",
"path",
"exist",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java#L392-L402 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java | DeferredAttr.isDeferred | boolean isDeferred(Env<AttrContext> env, JCExpression expr) {
"""
Does the argument expression {@code expr} need speculative type-checking?
"""
DeferredChecker dc = new DeferredChecker(env);
dc.scan(expr);
return dc.result.isPoly();
} | java | boolean isDeferred(Env<AttrContext> env, JCExpression expr) {
DeferredChecker dc = new DeferredChecker(env);
dc.scan(expr);
return dc.result.isPoly();
} | [
"boolean",
"isDeferred",
"(",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"JCExpression",
"expr",
")",
"{",
"DeferredChecker",
"dc",
"=",
"new",
"DeferredChecker",
"(",
"env",
")",
";",
"dc",
".",
"scan",
"(",
"expr",
")",
";",
"return",
"dc",
".",
"re... | Does the argument expression {@code expr} need speculative type-checking? | [
"Does",
"the",
"argument",
"expression",
"{"
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java#L1098-L1102 |
Clivern/Racter | src/main/java/com/clivern/racter/senders/templates/ReceiptTemplate.java | ReceiptTemplate.setAddress | public void setAddress(String street_1, String street_2, String city, String postal_code, String state, String country) {
"""
Set Address
@param street_1 the street address 1
@param street_2 the street address 2
@param city the city
@param postal_code the postal code
@param state the state
@param country t... | java | public void setAddress(String street_1, String street_2, String city, String postal_code, String state, String country)
{
this.address.put("street_1", street_1);
this.address.put("street_2", street_2);
this.address.put("city", city);
this.address.put("postal_code", postal_code);
... | [
"public",
"void",
"setAddress",
"(",
"String",
"street_1",
",",
"String",
"street_2",
",",
"String",
"city",
",",
"String",
"postal_code",
",",
"String",
"state",
",",
"String",
"country",
")",
"{",
"this",
".",
"address",
".",
"put",
"(",
"\"street_1\"",
... | Set Address
@param street_1 the street address 1
@param street_2 the street address 2
@param city the city
@param postal_code the postal code
@param state the state
@param country the country | [
"Set",
"Address"
] | train | https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/ReceiptTemplate.java#L154-L162 |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/net/SslCodec.java | SslCodec.onClose | @Handler
public void onClose(Close event, PlainChannel plainChannel)
throws InterruptedException, SSLException {
"""
Forwards a close event upstream.
@param event
the close event
@throws SSLException if an SSL related problem occurs
@throws InterruptedException if the execution was interrupte... | java | @Handler
public void onClose(Close event, PlainChannel plainChannel)
throws InterruptedException, SSLException {
if (plainChannel.hub() != this) {
return;
}
plainChannel.close(event);
} | [
"@",
"Handler",
"public",
"void",
"onClose",
"(",
"Close",
"event",
",",
"PlainChannel",
"plainChannel",
")",
"throws",
"InterruptedException",
",",
"SSLException",
"{",
"if",
"(",
"plainChannel",
".",
"hub",
"(",
")",
"!=",
"this",
")",
"{",
"return",
";",
... | Forwards a close event upstream.
@param event
the close event
@throws SSLException if an SSL related problem occurs
@throws InterruptedException if the execution was interrupted | [
"Forwards",
"a",
"close",
"event",
"upstream",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/net/SslCodec.java#L290-L297 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICULocaleService.java | ICULocaleService.registerObject | public Factory registerObject(Object obj, ULocale locale, int kind) {
"""
Convenience function for callers using locales. This calls
registerObject(Object, ULocale, int kind, boolean visible)
passing true for the visibility.
"""
return registerObject(obj, locale, kind, true);
} | java | public Factory registerObject(Object obj, ULocale locale, int kind) {
return registerObject(obj, locale, kind, true);
} | [
"public",
"Factory",
"registerObject",
"(",
"Object",
"obj",
",",
"ULocale",
"locale",
",",
"int",
"kind",
")",
"{",
"return",
"registerObject",
"(",
"obj",
",",
"locale",
",",
"kind",
",",
"true",
")",
";",
"}"
] | Convenience function for callers using locales. This calls
registerObject(Object, ULocale, int kind, boolean visible)
passing true for the visibility. | [
"Convenience",
"function",
"for",
"callers",
"using",
"locales",
".",
"This",
"calls",
"registerObject",
"(",
"Object",
"ULocale",
"int",
"kind",
"boolean",
"visible",
")",
"passing",
"true",
"for",
"the",
"visibility",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICULocaleService.java#L111-L113 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java | AdHocCommandManager.registerCommand | public void registerCommand(String node, String name, final Class<? extends LocalCommand> clazz) {
"""
Registers a new command with this command manager, which is related to a
connection. The <tt>node</tt> is an unique identifier of that command for
the connection related to this command manager. The <tt>name</t... | java | public void registerCommand(String node, String name, final Class<? extends LocalCommand> clazz) {
registerCommand(node, name, new LocalCommandFactory() {
@Override
public LocalCommand getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, Invocati... | [
"public",
"void",
"registerCommand",
"(",
"String",
"node",
",",
"String",
"name",
",",
"final",
"Class",
"<",
"?",
"extends",
"LocalCommand",
">",
"clazz",
")",
"{",
"registerCommand",
"(",
"node",
",",
"name",
",",
"new",
"LocalCommandFactory",
"(",
")",
... | Registers a new command with this command manager, which is related to a
connection. The <tt>node</tt> is an unique identifier of that command for
the connection related to this command manager. The <tt>name</tt> is the
human readable name of the command. The <tt>class</tt> is the class of
the command, which must exten... | [
"Registers",
"a",
"new",
"command",
"with",
"this",
"command",
"manager",
"which",
"is",
"related",
"to",
"a",
"connection",
".",
"The",
"<tt",
">",
"node<",
"/",
"tt",
">",
"is",
"an",
"unique",
"identifier",
"of",
"that",
"command",
"for",
"the",
"conn... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandManager.java#L205-L212 |
samskivert/pythagoras | src/main/java/pythagoras/f/Lines.java | Lines.pointLineDist | public static float pointLineDist (float px, float py, float x1, float y1, float x2, float y2) {
"""
Returns the distance from the specified point to the specified line.
"""
return FloatMath.sqrt(pointLineDistSq(px, py, x1, y1, x2, y2));
} | java | public static float pointLineDist (float px, float py, float x1, float y1, float x2, float y2) {
return FloatMath.sqrt(pointLineDistSq(px, py, x1, y1, x2, y2));
} | [
"public",
"static",
"float",
"pointLineDist",
"(",
"float",
"px",
",",
"float",
"py",
",",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
")",
"{",
"return",
"FloatMath",
".",
"sqrt",
"(",
"pointLineDistSq",
"(",
"px",
",",
... | Returns the distance from the specified point to the specified line. | [
"Returns",
"the",
"distance",
"from",
"the",
"specified",
"point",
"to",
"the",
"specified",
"line",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/Lines.java#L83-L85 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/trustregion/TrustRegionBase_F64.java | TrustRegionBase_F64.initialize | public void initialize(double initial[] , int numberOfParameters , double minimumFunctionValue ) {
"""
Specifies initial state of the search and completion criteria
@param initial Initial parameter state
@param numberOfParameters Number many parameters are being optimized.
@param minimumFunctionValue The mini... | java | public void initialize(double initial[] , int numberOfParameters , double minimumFunctionValue ) {
super.initialize(initial,numberOfParameters);
tmp_p.reshape(numberOfParameters,1);
regionRadius = config.regionInitial;
fx = cost(x);
if( verbose != null ) {
verbose.println("Steps fx change ... | [
"public",
"void",
"initialize",
"(",
"double",
"initial",
"[",
"]",
",",
"int",
"numberOfParameters",
",",
"double",
"minimumFunctionValue",
")",
"{",
"super",
".",
"initialize",
"(",
"initial",
",",
"numberOfParameters",
")",
";",
"tmp_p",
".",
"reshape",
"("... | Specifies initial state of the search and completion criteria
@param initial Initial parameter state
@param numberOfParameters Number many parameters are being optimized.
@param minimumFunctionValue The minimum possible value that the function can output | [
"Specifies",
"initial",
"state",
"of",
"the",
"search",
"and",
"completion",
"criteria"
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/trustregion/TrustRegionBase_F64.java#L91-L117 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/collection/LazyList.java | LazyList.toArray | public static Object toArray(Object list, Class<?> clazz) {
"""
Convert a lazylist to an array
@param list The list to convert
@param clazz The class of the array, which may be a primitive type
@return array of the lazylist entries passed in
"""
if (list == null)
return Array.newInsta... | java | public static Object toArray(Object list, Class<?> clazz) {
if (list == null)
return Array.newInstance(clazz, 0);
if (list instanceof List) {
List<?> l = (List<?>) list;
if (clazz.isPrimitive()) {
Object a = Array.newInstance(clazz, l.size());
... | [
"public",
"static",
"Object",
"toArray",
"(",
"Object",
"list",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"return",
"Array",
".",
"newInstance",
"(",
"clazz",
",",
"0",
")",
";",
"if",
"(",
"list",
"insta... | Convert a lazylist to an array
@param list The list to convert
@param clazz The class of the array, which may be a primitive type
@return array of the lazylist entries passed in | [
"Convert",
"a",
"lazylist",
"to",
"an",
"array"
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/collection/LazyList.java#L276-L295 |
greatman/craftconomy3 | src/main/java/com/greatmancode/craftconomy3/account/Account.java | Account.getBalance | public double getBalance(String world, String currencyName) {
"""
Get's the player balance. Sends double.MIN_NORMAL in case of a error
@param world The world / world group to search in
@param currencyName The currency Name
@return The balance. If the account has infinite money. Double.MAX_VALUE is retu... | java | public double getBalance(String world, String currencyName) {
double balance = Double.MIN_NORMAL;
if (!Common.getInstance().getWorldGroupManager().worldGroupExist(world)) {
world = Common.getInstance().getWorldGroupManager().getWorldGroupName(world);
}
Currency currency = Com... | [
"public",
"double",
"getBalance",
"(",
"String",
"world",
",",
"String",
"currencyName",
")",
"{",
"double",
"balance",
"=",
"Double",
".",
"MIN_NORMAL",
";",
"if",
"(",
"!",
"Common",
".",
"getInstance",
"(",
")",
".",
"getWorldGroupManager",
"(",
")",
".... | Get's the player balance. Sends double.MIN_NORMAL in case of a error
@param world The world / world group to search in
@param currencyName The currency Name
@return The balance. If the account has infinite money. Double.MAX_VALUE is returned. | [
"Get",
"s",
"the",
"player",
"balance",
".",
"Sends",
"double",
".",
"MIN_NORMAL",
"in",
"case",
"of",
"a",
"error"
] | train | https://github.com/greatman/craftconomy3/blob/51b1b3de7d039e20c7418d1e70b8c4b02b8cf840/src/main/java/com/greatmancode/craftconomy3/account/Account.java#L121-L135 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/scroll/EndlessScrollHelper.java | EndlessScrollHelper.onLoadMore | protected void onLoadMore(@NonNull ResultReceiver<Model> out, int currentPage) {
"""
The default implementation takes care of calling the previously set
{@link OnLoadMoreHandler OnLoadMoreHandler}.
@param out
@param currentPage
@see #withOnLoadMoreHandler(OnLoadMoreHandler) withOnLoadMoreHandler(OnLoadMoreHa... | java | protected void onLoadMore(@NonNull ResultReceiver<Model> out, int currentPage) {
OnLoadMoreHandler<Model> loadMoreHandler = this.mOnLoadMoreHandler;
try {
loadMoreHandler.onLoadMore(out, currentPage);
} catch (NullPointerException npe) {
// Lazy null checking! If this was... | [
"protected",
"void",
"onLoadMore",
"(",
"@",
"NonNull",
"ResultReceiver",
"<",
"Model",
">",
"out",
",",
"int",
"currentPage",
")",
"{",
"OnLoadMoreHandler",
"<",
"Model",
">",
"loadMoreHandler",
"=",
"this",
".",
"mOnLoadMoreHandler",
";",
"try",
"{",
"loadMo... | The default implementation takes care of calling the previously set
{@link OnLoadMoreHandler OnLoadMoreHandler}.
@param out
@param currentPage
@see #withOnLoadMoreHandler(OnLoadMoreHandler) withOnLoadMoreHandler(OnLoadMoreHandler) | [
"The",
"default",
"implementation",
"takes",
"care",
"of",
"calling",
"the",
"previously",
"set",
"{",
"@link",
"OnLoadMoreHandler",
"OnLoadMoreHandler",
"}",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/scroll/EndlessScrollHelper.java#L222-L231 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java | ExceptionUtils.firstOrSuppressed | public static <T extends Throwable> T firstOrSuppressed(T newException, @Nullable T previous) {
"""
Adds a new exception as a {@link Throwable#addSuppressed(Throwable) suppressed exception}
to a prior exception, or returns the new exception, if no prior exception exists.
<pre>{@code
public void closeAllThin... | java | public static <T extends Throwable> T firstOrSuppressed(T newException, @Nullable T previous) {
checkNotNull(newException, "newException");
if (previous == null) {
return newException;
} else {
previous.addSuppressed(newException);
return previous;
}
} | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"T",
"firstOrSuppressed",
"(",
"T",
"newException",
",",
"@",
"Nullable",
"T",
"previous",
")",
"{",
"checkNotNull",
"(",
"newException",
",",
"\"newException\"",
")",
";",
"if",
"(",
"previous",
"==... | Adds a new exception as a {@link Throwable#addSuppressed(Throwable) suppressed exception}
to a prior exception, or returns the new exception, if no prior exception exists.
<pre>{@code
public void closeAllThings() throws Exception {
Exception ex = null;
try {
component.shutdown();
} catch (Exception e) {
ex = firstOrS... | [
"Adds",
"a",
"new",
"exception",
"as",
"a",
"{",
"@link",
"Throwable#addSuppressed",
"(",
"Throwable",
")",
"suppressed",
"exception",
"}",
"to",
"a",
"prior",
"exception",
"or",
"returns",
"the",
"new",
"exception",
"if",
"no",
"prior",
"exception",
"exists",... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java#L173-L182 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.deleteMediaUserData | public ApiSuccessResponse deleteMediaUserData(String mediatype, String id, UserData1 userData) throws ApiException {
"""
Remove key/value pairs from user data
Delete data with the specified keys from the interaction's user data.
@param mediatype The media channel. (required)
@param id The ID of the interact... | java | public ApiSuccessResponse deleteMediaUserData(String mediatype, String id, UserData1 userData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = deleteMediaUserDataWithHttpInfo(mediatype, id, userData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"deleteMediaUserData",
"(",
"String",
"mediatype",
",",
"String",
"id",
",",
"UserData1",
"userData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"deleteMediaUserDataWithHttpInfo",
"(",
... | Remove key/value pairs from user data
Delete data with the specified keys from the interaction's user data.
@param mediatype The media channel. (required)
@param id The ID of the interaction. (required)
@param userData The keys of the data to remove. (required)
@return ApiSuccessResponse
@throws ApiException If fai... | [
"Remove",
"key",
"/",
"value",
"pairs",
"from",
"user",
"data",
"Delete",
"data",
"with",
"the",
"specified",
"keys",
"from",
"the",
"interaction'",
";",
"s",
"user",
"data",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L1569-L1572 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexInfos.java | ISPNIndexInfos.cacheEntryModified | @SuppressWarnings("unchecked")
@CacheEntryModified
public void cacheEntryModified(CacheEntryModifiedEvent<Serializable, Object> event) {
"""
Method will be invoked when a cache entry has been modified only in READ_ONLY mode.
@param event
CacheEntryModifiedEvent
"""
if (!event.isPre() && even... | java | @SuppressWarnings("unchecked")
@CacheEntryModified
public void cacheEntryModified(CacheEntryModifiedEvent<Serializable, Object> event)
{
if (!event.isPre() && event.getKey().equals(namesKey))
{
Set<String> set = (Set<String>)event.getValue();
if (set != null)
{
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"CacheEntryModified",
"public",
"void",
"cacheEntryModified",
"(",
"CacheEntryModifiedEvent",
"<",
"Serializable",
",",
"Object",
">",
"event",
")",
"{",
"if",
"(",
"!",
"event",
".",
"isPre",
"(",
")",
... | Method will be invoked when a cache entry has been modified only in READ_ONLY mode.
@param event
CacheEntryModifiedEvent | [
"Method",
"will",
"be",
"invoked",
"when",
"a",
"cache",
"entry",
"has",
"been",
"modified",
"only",
"in",
"READ_ONLY",
"mode",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexInfos.java#L212-L224 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExpandedNameTable.java | ExpandedNameTable.getExpandedTypeID | public int getExpandedTypeID(String namespace, String localName, int type) {
"""
Given an expanded name represented by namespace, local name and node type,
return an ID. If the expanded-name does not exist in the internal tables,
the entry will be created, and the ID will be returned. Any additional
nodes tha... | java | public int getExpandedTypeID(String namespace, String localName, int type)
{
return getExpandedTypeID(namespace, localName, type, false);
} | [
"public",
"int",
"getExpandedTypeID",
"(",
"String",
"namespace",
",",
"String",
"localName",
",",
"int",
"type",
")",
"{",
"return",
"getExpandedTypeID",
"(",
"namespace",
",",
"localName",
",",
"type",
",",
"false",
")",
";",
"}"
] | Given an expanded name represented by namespace, local name and node type,
return an ID. If the expanded-name does not exist in the internal tables,
the entry will be created, and the ID will be returned. Any additional
nodes that are created that have this expanded name will use this ID.
@param namespace The namesp... | [
"Given",
"an",
"expanded",
"name",
"represented",
"by",
"namespace",
"local",
"name",
"and",
"node",
"type",
"return",
"an",
"ID",
".",
"If",
"the",
"expanded",
"-",
"name",
"does",
"not",
"exist",
"in",
"the",
"internal",
"tables",
"the",
"entry",
"will",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExpandedNameTable.java#L156-L159 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java | Cells.replaceByName | public boolean replaceByName(String table, Cell c) {
"""
Replaces the cell (belonging to <i>table</i>) having the same name that the given one with the given Cell object.
@param c the Cell to replace the one in the Cells object.
@return either true/false if the Cell has been successfully replace or not.
""... | java | public boolean replaceByName(String table, Cell c) {
if (c == null) {
throw new DeepGenericException(new IllegalArgumentException("cell parameter cannot be null"));
}
boolean cellFound = false;
int position = 0;
List<Cell> localCells = getCellsByTable(table);
... | [
"public",
"boolean",
"replaceByName",
"(",
"String",
"table",
",",
"Cell",
"c",
")",
"{",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"throw",
"new",
"DeepGenericException",
"(",
"new",
"IllegalArgumentException",
"(",
"\"cell parameter cannot be null\"",
")",
")",
... | Replaces the cell (belonging to <i>table</i>) having the same name that the given one with the given Cell object.
@param c the Cell to replace the one in the Cells object.
@return either true/false if the Cell has been successfully replace or not. | [
"Replaces",
"the",
"cell",
"(",
"belonging",
"to",
"<i",
">",
"table<",
"/",
"i",
">",
")",
"having",
"the",
"same",
"name",
"that",
"the",
"given",
"one",
"with",
"the",
"given",
"Cell",
"object",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L172-L200 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.