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 |
|---|---|---|---|---|---|---|---|---|---|---|
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.getBoundingBox | public static BoundingBox getBoundingBox(int x, int y, int zoom) {
"""
Get the tile bounding box from the Google Maps API tile coordinates and
zoom level
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return bounding box
"""
int tilesPerSide = tilesPerSide(zoom);
double tile... | java | public static BoundingBox getBoundingBox(int x, int y, int zoom) {
int tilesPerSide = tilesPerSide(zoom);
double tileWidthDegrees = tileWidthDegrees(tilesPerSide);
double tileHeightDegrees = tileHeightDegrees(tilesPerSide);
double minLon = -180.0 + (x * tileWidthDegrees);
double maxLon = minLon + tileWidthD... | [
"public",
"static",
"BoundingBox",
"getBoundingBox",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
")",
"{",
"int",
"tilesPerSide",
"=",
"tilesPerSide",
"(",
"zoom",
")",
";",
"double",
"tileWidthDegrees",
"=",
"tileWidthDegrees",
"(",
"tilesPerSide",
... | Get the tile bounding box from the Google Maps API tile coordinates and
zoom level
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return bounding box | [
"Get",
"the",
"tile",
"bounding",
"box",
"from",
"the",
"Google",
"Maps",
"API",
"tile",
"coordinates",
"and",
"zoom",
"level"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L318-L333 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java | PickerUtilities.isSameYearMonth | public static boolean isSameYearMonth(YearMonth first, YearMonth second) {
"""
isSameYearMonth, This compares two YearMonth variables to see if their values are equal.
Returns true if the values are equal, otherwise returns false.
More specifically: This returns true if both values are null (an empty YearMonth... | java | public static boolean isSameYearMonth(YearMonth first, YearMonth second) {
// If both values are null, return true.
if (first == null && second == null) {
return true;
}
// At least one value contains a YearMonth. If the other value is null, then return false.
if (fir... | [
"public",
"static",
"boolean",
"isSameYearMonth",
"(",
"YearMonth",
"first",
",",
"YearMonth",
"second",
")",
"{",
"// If both values are null, return true.",
"if",
"(",
"first",
"==",
"null",
"&&",
"second",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
... | isSameYearMonth, This compares two YearMonth variables to see if their values are equal.
Returns true if the values are equal, otherwise returns false.
More specifically: This returns true if both values are null (an empty YearMonth). Or, this
returns true if both of the supplied YearMonths contain a YearMonth and rep... | [
"isSameYearMonth",
"This",
"compares",
"two",
"YearMonth",
"variables",
"to",
"see",
"if",
"their",
"values",
"are",
"equal",
".",
"Returns",
"true",
"if",
"the",
"values",
"are",
"equal",
"otherwise",
"returns",
"false",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java#L99-L111 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/World.java | World.actorFor | public <T> T actorFor(final Class<T> protocol, final Definition definition) {
"""
Answers the {@code T} protocol of the newly created {@code Actor} that is defined by
the parameters of {@code definition} that implements the {@code protocol}.
@param protocol the {@code Class<T>} protocol that the {@code Actor} su... | java | public <T> T actorFor(final Class<T> protocol, final Definition definition) {
if (isTerminated()) {
throw new IllegalStateException("vlingo/actors: Stopped.");
}
return stage().actorFor(protocol, definition);
} | [
"public",
"<",
"T",
">",
"T",
"actorFor",
"(",
"final",
"Class",
"<",
"T",
">",
"protocol",
",",
"final",
"Definition",
"definition",
")",
"{",
"if",
"(",
"isTerminated",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"vlingo/actors: S... | Answers the {@code T} protocol of the newly created {@code Actor} that is defined by
the parameters of {@code definition} that implements the {@code protocol}.
@param protocol the {@code Class<T>} protocol that the {@code Actor} supports
@param <T> the protocol type
@param definition the {@code Definition} providing pa... | [
"Answers",
"the",
"{"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/World.java#L120-L126 |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java | MoreInetAddresses.parseCIDR | public static CidrInfo parseCIDR(String cidr) {
"""
Examines a CIDR {@code 192.168.0.0/16} or {@code 1234::/16} string representation and calculates the network and
broadcast IP addresses for that subnet. This accepts both IPv4 and IPv6 representations of a CIDR and will return
the appropriate {@link InetAddres... | java | public static CidrInfo parseCIDR(String cidr) {
requireNonNull(cidr);
try {
String[] parts = cidr.split("/");
checkArgument(parts.length == 2);
byte[] bytes = forString(parts[0]).getAddress();
int maskBits = parseInt(parts[1]);
checkArgument(m... | [
"public",
"static",
"CidrInfo",
"parseCIDR",
"(",
"String",
"cidr",
")",
"{",
"requireNonNull",
"(",
"cidr",
")",
";",
"try",
"{",
"String",
"[",
"]",
"parts",
"=",
"cidr",
".",
"split",
"(",
"\"/\"",
")",
";",
"checkArgument",
"(",
"parts",
".",
"leng... | Examines a CIDR {@code 192.168.0.0/16} or {@code 1234::/16} string representation and calculates the network and
broadcast IP addresses for that subnet. This accepts both IPv4 and IPv6 representations of a CIDR and will return
the appropriate {@link InetAddress} classes for the provided value.
<p>Note: This supports ... | [
"Examines",
"a",
"CIDR",
"{",
"@code",
"192",
".",
"168",
".",
"0",
".",
"0",
"/",
"16",
"}",
"or",
"{",
"@code",
"1234",
"::",
"/",
"16",
"}",
"string",
"representation",
"and",
"calculates",
"the",
"network",
"and",
"broadcast",
"IP",
"addresses",
... | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java#L335-L368 |
Red5/red5-server-common | src/main/java/org/red5/server/net/remoting/RemotingClient.java | RemotingClient.setCredentials | public void setCredentials(String userid, String password) {
"""
Send authentication data with each remoting request.
@param userid
User identifier
@param password
Password
"""
Map<String, String> data = new HashMap<String, String>();
data.put("userid", userid);
data.put("passw... | java | public void setCredentials(String userid, String password) {
Map<String, String> data = new HashMap<String, String>();
data.put("userid", userid);
data.put("password", password);
RemotingHeader header = new RemotingHeader(RemotingHeader.CREDENTIALS, true, data);
headers.put(... | [
"public",
"void",
"setCredentials",
"(",
"String",
"userid",
",",
"String",
"password",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"data",
".",
"put",
"(",
"\"u... | Send authentication data with each remoting request.
@param userid
User identifier
@param password
Password | [
"Send",
"authentication",
"data",
"with",
"each",
"remoting",
"request",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/remoting/RemotingClient.java#L265-L271 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/CriteriaReader.java | CriteriaReader.getConstantValue | private Object getConstantValue(FieldType type, byte[] block) {
"""
Retrieves a constant value.
@param type field type
@param block criteria data block
@return constant value
"""
Object value;
DataType dataType = type.getDataType();
if (dataType == null)
{
value = null;
... | java | private Object getConstantValue(FieldType type, byte[] block)
{
Object value;
DataType dataType = type.getDataType();
if (dataType == null)
{
value = null;
}
else
{
switch (dataType)
{
case DURATION:
{
value ... | [
"private",
"Object",
"getConstantValue",
"(",
"FieldType",
"type",
",",
"byte",
"[",
"]",
"block",
")",
"{",
"Object",
"value",
";",
"DataType",
"dataType",
"=",
"type",
".",
"getDataType",
"(",
")",
";",
"if",
"(",
"dataType",
"==",
"null",
")",
"{",
... | Retrieves a constant value.
@param type field type
@param block criteria data block
@return constant value | [
"Retrieves",
"a",
"constant",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L340-L406 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.setUserAvatar | public User setUserAvatar(final Object userIdOrUsername, File avatarFile) throws GitLabApiException {
"""
Uploads and sets the user's avatar for the specified user.
<pre><code>PUT /users/:id</code></pre>
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@para... | java | public User setUserAvatar(final Object userIdOrUsername, File avatarFile) throws GitLabApiException {
Response response = putUpload(Response.Status.OK, "avatar", avatarFile, "users", getUserIdOrUsername(userIdOrUsername));
return (response.readEntity(User.class));
} | [
"public",
"User",
"setUserAvatar",
"(",
"final",
"Object",
"userIdOrUsername",
",",
"File",
"avatarFile",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"putUpload",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"\"avatar\"",
",",
"avat... | Uploads and sets the user's avatar for the specified user.
<pre><code>PUT /users/:id</code></pre>
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param avatarFile the File instance of the avatar file to upload
@return the updated User instance
@throws GitLabApiExcep... | [
"Uploads",
"and",
"sets",
"the",
"user",
"s",
"avatar",
"for",
"the",
"specified",
"user",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L1011-L1014 |
alkacon/opencms-core | src/org/opencms/workplace/explorer/CmsResourceUtil.java | CmsResourceUtil.getSmallIconResource | public Resource getSmallIconResource() {
"""
Returns the small icon resource of the current resource.<p>
@return the icon resource
"""
if ((m_cms != null) && CmsJspNavBuilder.isNavLevelFolder(m_cms, m_resource)) {
return new CmsCssIcon(CmsExplorerTypeSettings.ICON_STYLE_NAV_LEVEL_BIG);
... | java | public Resource getSmallIconResource() {
if ((m_cms != null) && CmsJspNavBuilder.isNavLevelFolder(m_cms, m_resource)) {
return new CmsCssIcon(CmsExplorerTypeSettings.ICON_STYLE_NAV_LEVEL_BIG);
}
if ((m_cms != null) && CmsResourceTypeXmlContainerPage.isModelCopyGroup(m_cms, m_resourc... | [
"public",
"Resource",
"getSmallIconResource",
"(",
")",
"{",
"if",
"(",
"(",
"m_cms",
"!=",
"null",
")",
"&&",
"CmsJspNavBuilder",
".",
"isNavLevelFolder",
"(",
"m_cms",
",",
"m_resource",
")",
")",
"{",
"return",
"new",
"CmsCssIcon",
"(",
"CmsExplorerTypeSett... | Returns the small icon resource of the current resource.<p>
@return the icon resource | [
"Returns",
"the",
"small",
"icon",
"resource",
"of",
"the",
"current",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsResourceUtil.java#L1083-L1094 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/BlocksMap.java | BlocksMap.addINodeForLoading | BlockInfo addINodeForLoading(Block b, INodeFile iNode) {
"""
Add block b belonging to the specified file inode to the map.
Does not check for block existence, for non-hardlinked files.
"""
// allocate new block when loading the image
// for hardlinked files, we need to check if the blocks are already ... | java | BlockInfo addINodeForLoading(Block b, INodeFile iNode) {
// allocate new block when loading the image
// for hardlinked files, we need to check if the blocks are already there
BlockInfo info = checkBlockInfo(b, iNode.getReplication(),
iNode.isHardlinkFile());
info.inode = iNode;
return info;... | [
"BlockInfo",
"addINodeForLoading",
"(",
"Block",
"b",
",",
"INodeFile",
"iNode",
")",
"{",
"// allocate new block when loading the image",
"// for hardlinked files, we need to check if the blocks are already there",
"BlockInfo",
"info",
"=",
"checkBlockInfo",
"(",
"b",
",",
"iN... | Add block b belonging to the specified file inode to the map.
Does not check for block existence, for non-hardlinked files. | [
"Add",
"block",
"b",
"belonging",
"to",
"the",
"specified",
"file",
"inode",
"to",
"the",
"map",
".",
"Does",
"not",
"check",
"for",
"block",
"existence",
"for",
"non",
"-",
"hardlinked",
"files",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/BlocksMap.java#L435-L442 |
structr/structr | structr-core/src/main/java/org/structr/core/entity/AbstractNode.java | AbstractNode.getSecurityRelationship | @Override
public final Security getSecurityRelationship(final Principal p) {
"""
Return the (cached) incoming relationship between this node and the
given principal which holds the security information.
@param p
@return incoming security relationship
"""
if (p != null) {
// try filter predicate to... | java | @Override
public final Security getSecurityRelationship(final Principal p) {
if (p != null) {
// try filter predicate to speed up things
final Predicate<GraphObject> principalFilter = (GraphObject value) -> {
return (p.getUuid().equals(value.getUuid()));
};
return getSecurityRelationship(p, mapSec... | [
"@",
"Override",
"public",
"final",
"Security",
"getSecurityRelationship",
"(",
"final",
"Principal",
"p",
")",
"{",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"// try filter predicate to speed up things",
"final",
"Predicate",
"<",
"GraphObject",
">",
"principalFilter... | Return the (cached) incoming relationship between this node and the
given principal which holds the security information.
@param p
@return incoming security relationship | [
"Return",
"the",
"(",
"cached",
")",
"incoming",
"relationship",
"between",
"this",
"node",
"and",
"the",
"given",
"principal",
"which",
"holds",
"the",
"security",
"information",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractNode.java#L1228-L1242 |
Bedework/bw-util | bw-util-directory/src/main/java/org/bedework/util/directory/ldap/LdapDirectory.java | LdapDirectory.checkProp | public String checkProp(final Properties pr, final String name, final String defaultVal) {
"""
If the named property is present and has a value use that.
Otherwise, set the value to the given default and use that.
@param pr
@param name
@param defaultVal
@return String
"""
String val = pr.getProperty... | java | public String checkProp(final Properties pr, final String name, final String defaultVal) {
String val = pr.getProperty(name);
if (val == null) {
pr.put(name, defaultVal);
val = defaultVal;
}
return val;
} | [
"public",
"String",
"checkProp",
"(",
"final",
"Properties",
"pr",
",",
"final",
"String",
"name",
",",
"final",
"String",
"defaultVal",
")",
"{",
"String",
"val",
"=",
"pr",
".",
"getProperty",
"(",
"name",
")",
";",
"if",
"(",
"val",
"==",
"null",
")... | If the named property is present and has a value use that.
Otherwise, set the value to the given default and use that.
@param pr
@param name
@param defaultVal
@return String | [
"If",
"the",
"named",
"property",
"is",
"present",
"and",
"has",
"a",
"value",
"use",
"that",
".",
"Otherwise",
"set",
"the",
"value",
"to",
"the",
"given",
"default",
"and",
"use",
"that",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-directory/src/main/java/org/bedework/util/directory/ldap/LdapDirectory.java#L305-L314 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/function/Actions.java | Actions.toFunc | public static <T1> Func1<T1, Void> toFunc(final Action1<T1> action) {
"""
Converts an {@link Action1} to a function that calls the action and returns {@code null}.
@param action the {@link Action1} to convert
@return a {@link Func1} that calls {@code action} and returns {@code null}
"""
return toFu... | java | public static <T1> Func1<T1, Void> toFunc(final Action1<T1> action) {
return toFunc(action, (Void) null);
} | [
"public",
"static",
"<",
"T1",
">",
"Func1",
"<",
"T1",
",",
"Void",
">",
"toFunc",
"(",
"final",
"Action1",
"<",
"T1",
">",
"action",
")",
"{",
"return",
"toFunc",
"(",
"action",
",",
"(",
"Void",
")",
"null",
")",
";",
"}"
] | Converts an {@link Action1} to a function that calls the action and returns {@code null}.
@param action the {@link Action1} to convert
@return a {@link Func1} that calls {@code action} and returns {@code null} | [
"Converts",
"an",
"{",
"@link",
"Action1",
"}",
"to",
"a",
"function",
"that",
"calls",
"the",
"action",
"and",
"returns",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/function/Actions.java#L95-L97 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java | KeyVaultClientCustomImpl.listKeys | public PagedList<KeyItem> listKeys(final String vaultBaseUrl, final Integer maxresults) {
"""
List keys in the specified vault.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param maxresults
Maximum number of results to return in a page. If not specified
the service will return u... | java | public PagedList<KeyItem> listKeys(final String vaultBaseUrl, final Integer maxresults) {
return getKeys(vaultBaseUrl, maxresults);
} | [
"public",
"PagedList",
"<",
"KeyItem",
">",
"listKeys",
"(",
"final",
"String",
"vaultBaseUrl",
",",
"final",
"Integer",
"maxresults",
")",
"{",
"return",
"getKeys",
"(",
"vaultBaseUrl",
",",
"maxresults",
")",
";",
"}"
] | List keys in the specified vault.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param maxresults
Maximum number of results to return in a page. If not specified
the service will return up to 25 results.
@return the PagedList<KeyItem> if successful. | [
"List",
"keys",
"in",
"the",
"specified",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L882-L884 |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java | ChatService.createSessionListener | public ParticipantListener createSessionListener(String sessionId, ISessionUpdate callback) {
"""
Creates a session listener.
@param sessionId Chat session identifier.
@param callback The callback interface to invoke when a session update event has been
received.
@return The newly created session listener.
... | java | public ParticipantListener createSessionListener(String sessionId, ISessionUpdate callback) {
return SessionService.create(self, sessionId, eventManager, callback);
} | [
"public",
"ParticipantListener",
"createSessionListener",
"(",
"String",
"sessionId",
",",
"ISessionUpdate",
"callback",
")",
"{",
"return",
"SessionService",
".",
"create",
"(",
"self",
",",
"sessionId",
",",
"eventManager",
",",
"callback",
")",
";",
"}"
] | Creates a session listener.
@param sessionId Chat session identifier.
@param callback The callback interface to invoke when a session update event has been
received.
@return The newly created session listener. | [
"Creates",
"a",
"session",
"listener",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ChatService.java#L166-L168 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.dscal | @Override
protected void dscal(long N, double a, INDArray X, int incx) {
"""
Computes the product of a double vector by a scalar.
@param N The number of elements of the vector X
@param a a scalar
@param X a vector
@param incx the increment of the vector X
"""
cblas_dscal((int) N, a, (DoublePo... | java | @Override
protected void dscal(long N, double a, INDArray X, int incx) {
cblas_dscal((int) N, a, (DoublePointer) X.data().addressPointer(), incx);
} | [
"@",
"Override",
"protected",
"void",
"dscal",
"(",
"long",
"N",
",",
"double",
"a",
",",
"INDArray",
"X",
",",
"int",
"incx",
")",
"{",
"cblas_dscal",
"(",
"(",
"int",
")",
"N",
",",
"a",
",",
"(",
"DoublePointer",
")",
"X",
".",
"data",
"(",
")... | Computes the product of a double vector by a scalar.
@param N The number of elements of the vector X
@param a a scalar
@param X a vector
@param incx the increment of the vector X | [
"Computes",
"the",
"product",
"of",
"a",
"double",
"vector",
"by",
"a",
"scalar",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L267-L270 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginReimageAsync | public Observable<OperationStatusResponseInner> beginReimageAsync(String resourceGroupName, String vmScaleSetName) {
"""
Reimages (upgrade the operating system) one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scal... | java | public Observable<OperationStatusResponseInner> beginReimageAsync(String resourceGroupName, String vmScaleSetName) {
return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"beginReimageAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"beginReimageWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".",... | Reimages (upgrade the operating system) one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatusRes... | [
"Reimages",
"(",
"upgrade",
"the",
"operating",
"system",
")",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | 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/VirtualMachineScaleSetsInner.java#L3064-L3071 |
playn/playn | java-base/src/playn/java/JavaGraphics.java | JavaGraphics.aaFontContext | FontRenderContext aaFontContext() {
"""
these are initialized lazily to avoid doing any AWT stuff during startup
"""
if (aaFontContext == null) {
// set up the dummy font contexts
Graphics2D aaGfx = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).createGraphics();
aaGfx.setRenderingH... | java | FontRenderContext aaFontContext() {
if (aaFontContext == null) {
// set up the dummy font contexts
Graphics2D aaGfx = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).createGraphics();
aaGfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
aaFontConte... | [
"FontRenderContext",
"aaFontContext",
"(",
")",
"{",
"if",
"(",
"aaFontContext",
"==",
"null",
")",
"{",
"// set up the dummy font contexts",
"Graphics2D",
"aaGfx",
"=",
"new",
"BufferedImage",
"(",
"1",
",",
"1",
",",
"BufferedImage",
".",
"TYPE_INT_ARGB",
")",
... | these are initialized lazily to avoid doing any AWT stuff during startup | [
"these",
"are",
"initialized",
"lazily",
"to",
"avoid",
"doing",
"any",
"AWT",
"stuff",
"during",
"startup"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/java-base/src/playn/java/JavaGraphics.java#L47-L55 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterhtmlinjectionvariable.java | filterhtmlinjectionvariable.get | public static filterhtmlinjectionvariable get(nitro_service service, String variable) throws Exception {
"""
Use this API to fetch filterhtmlinjectionvariable resource of given name .
"""
filterhtmlinjectionvariable obj = new filterhtmlinjectionvariable();
obj.set_variable(variable);
filterhtmlinjectionv... | java | public static filterhtmlinjectionvariable get(nitro_service service, String variable) throws Exception{
filterhtmlinjectionvariable obj = new filterhtmlinjectionvariable();
obj.set_variable(variable);
filterhtmlinjectionvariable response = (filterhtmlinjectionvariable) obj.get_resource(service);
return response... | [
"public",
"static",
"filterhtmlinjectionvariable",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"variable",
")",
"throws",
"Exception",
"{",
"filterhtmlinjectionvariable",
"obj",
"=",
"new",
"filterhtmlinjectionvariable",
"(",
")",
";",
"obj",
".",
"set_vari... | Use this API to fetch filterhtmlinjectionvariable resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"filterhtmlinjectionvariable",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/filter/filterhtmlinjectionvariable.java#L299-L304 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/JavacTask.java | JavacTask.instance | public static JavacTask instance(ProcessingEnvironment processingEnvironment) {
"""
Returns the {@code JavacTask} for a {@code ProcessingEnvironment}.
If the compiler is being invoked using a
{@link javax.tools.JavaCompiler.CompilationTask CompilationTask},
then that task will be returned.
@param processingEnv... | java | public static JavacTask instance(ProcessingEnvironment processingEnvironment) {
if (!processingEnvironment.getClass().getName().equals(
"com.sun.tools.javac.processing.JavacProcessingEnvironment"))
throw new IllegalArgumentException();
Context c = ((JavacProcessingEnvironment... | [
"public",
"static",
"JavacTask",
"instance",
"(",
"ProcessingEnvironment",
"processingEnvironment",
")",
"{",
"if",
"(",
"!",
"processingEnvironment",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"\"com.sun.tools.javac.processing.JavacProce... | Returns the {@code JavacTask} for a {@code ProcessingEnvironment}.
If the compiler is being invoked using a
{@link javax.tools.JavaCompiler.CompilationTask CompilationTask},
then that task will be returned.
@param processingEnvironment the processing environment
@return the {@code JavacTask} for a {@code ProcessingEnvi... | [
"Returns",
"the",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/JavacTask.java#L62-L69 |
vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/shell/Ci_ScRun.java | Ci_ScRun.interpretRun | protected int interpretRun(LineParser lp, MessageMgr mm) {
"""
Interprets the actual run command
@param lp line parser
@param mm the message manager to use for reporting errors, warnings, and infos
@return 0 for success, non-zero otherwise
"""
String fileName = this.getFileName(lp);
String content = thi... | java | protected int interpretRun(LineParser lp, MessageMgr mm){
String fileName = this.getFileName(lp);
String content = this.getContent(fileName, mm);
if(content==null){
return 1;
}
mm.report(MessageMgr.createInfoMessage(""));
mm.report(MessageMgr.createInfoMessage("running file {}", fileName));
for(Strin... | [
"protected",
"int",
"interpretRun",
"(",
"LineParser",
"lp",
",",
"MessageMgr",
"mm",
")",
"{",
"String",
"fileName",
"=",
"this",
".",
"getFileName",
"(",
"lp",
")",
";",
"String",
"content",
"=",
"this",
".",
"getContent",
"(",
"fileName",
",",
"mm",
"... | Interprets the actual run command
@param lp line parser
@param mm the message manager to use for reporting errors, warnings, and infos
@return 0 for success, non-zero otherwise | [
"Interprets",
"the",
"actual",
"run",
"command"
] | train | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/shell/Ci_ScRun.java#L190-L209 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/webhook/WebhookUpdater.java | WebhookUpdater.setAvatar | public WebhookUpdater setAvatar(InputStream avatar, String fileType) {
"""
Queues the avatar to be updated.
@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods.
"""
delegate.setAvatar(avatar, file... | java | public WebhookUpdater setAvatar(InputStream avatar, String fileType) {
delegate.setAvatar(avatar, fileType);
return this;
} | [
"public",
"WebhookUpdater",
"setAvatar",
"(",
"InputStream",
"avatar",
",",
"String",
"fileType",
")",
"{",
"delegate",
".",
"setAvatar",
"(",
"avatar",
",",
"fileType",
")",
";",
"return",
"this",
";",
"}"
] | Queues the avatar to be updated.
@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods. | [
"Queues",
"the",
"avatar",
"to",
"be",
"updated",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/webhook/WebhookUpdater.java#L166-L169 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.populateLineString | public void populateLineString(LineString lineString, List<LatLng> latLngs) {
"""
Convert a list of {@link LatLng} to a {@link LineString}
@param lineString line string
@param latLngs lat lngs
"""
for (LatLng latLng : latLngs) {
Point point = toPoint(latLng, lineString.hasZ(), lineS... | java | public void populateLineString(LineString lineString, List<LatLng> latLngs) {
for (LatLng latLng : latLngs) {
Point point = toPoint(latLng, lineString.hasZ(), lineString.hasM());
lineString.addPoint(point);
}
} | [
"public",
"void",
"populateLineString",
"(",
"LineString",
"lineString",
",",
"List",
"<",
"LatLng",
">",
"latLngs",
")",
"{",
"for",
"(",
"LatLng",
"latLng",
":",
"latLngs",
")",
"{",
"Point",
"point",
"=",
"toPoint",
"(",
"latLng",
",",
"lineString",
"."... | Convert a list of {@link LatLng} to a {@link LineString}
@param lineString line string
@param latLngs lat lngs | [
"Convert",
"a",
"list",
"of",
"{",
"@link",
"LatLng",
"}",
"to",
"a",
"{",
"@link",
"LineString",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L391-L397 |
mjdbc/mjdbc | src/main/java/com/github/mjdbc/DbPreparedStatement.java | DbPreparedStatement.bindBean | public DbPreparedStatement<T> bindBean(@NotNull Object bean) throws SQLException {
"""
Sets all bean properties to named parameters.
@param bean bean to map to named SQL parameters.
@return this.
@throws SQLException if anything bad happens during SQL operations or bean field accessors calls.
"""
... | java | public DbPreparedStatement<T> bindBean(@NotNull Object bean) throws SQLException {
return bindBean(dbConnection.db, bean, true);
} | [
"public",
"DbPreparedStatement",
"<",
"T",
">",
"bindBean",
"(",
"@",
"NotNull",
"Object",
"bean",
")",
"throws",
"SQLException",
"{",
"return",
"bindBean",
"(",
"dbConnection",
".",
"db",
",",
"bean",
",",
"true",
")",
";",
"}"
] | Sets all bean properties to named parameters.
@param bean bean to map to named SQL parameters.
@return this.
@throws SQLException if anything bad happens during SQL operations or bean field accessors calls. | [
"Sets",
"all",
"bean",
"properties",
"to",
"named",
"parameters",
"."
] | train | https://github.com/mjdbc/mjdbc/blob/9db720a5b3218df38a1e5e59459045234bb6386b/src/main/java/com/github/mjdbc/DbPreparedStatement.java#L242-L244 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/triplet/RandomMatrices_DSTL.java | RandomMatrices_DSTL.uniform | public static DMatrixSparseTriplet uniform(int numRows , int numCols , int nz_total ,
double min , double max , Random rand ) {
"""
Randomly generates matrix with the specified number of matrix elements filled with values from min to max.
@param numRows Number of r... | java | public static DMatrixSparseTriplet uniform(int numRows , int numCols , int nz_total ,
double min , double max , Random rand ) {
// Create a list of all the possible element values
int N = numCols*numRows;
if( N < 0 )
throw new IllegalArg... | [
"public",
"static",
"DMatrixSparseTriplet",
"uniform",
"(",
"int",
"numRows",
",",
"int",
"numCols",
",",
"int",
"nz_total",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"rand",
")",
"{",
"// Create a list of all the possible element values",
"int",
... | Randomly generates matrix with the specified number of matrix elements filled with values from min to max.
@param numRows Number of rows
@param numCols Number of columns
@param nz_total Total number of non-zero elements in the matrix
@param min Minimum value
@param max maximum value
@param rand Random number generated... | [
"Randomly",
"generates",
"matrix",
"with",
"the",
"specified",
"number",
"of",
"matrix",
"elements",
"filled",
"with",
"values",
"from",
"min",
"to",
"max",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/triplet/RandomMatrices_DSTL.java#L40-L73 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DependencyFinder.java | DependencyFinder.parseExportedAPIs | public Set<Location> parseExportedAPIs(Archive archive, String name) {
"""
Parses the exported API of the named class from the given archive and
returns all target locations the named class references.
"""
try {
return parse(archive, API_FINDER, name);
} catch (IOException e) {
... | java | public Set<Location> parseExportedAPIs(Archive archive, String name)
{
try {
return parse(archive, API_FINDER, name);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
} | [
"public",
"Set",
"<",
"Location",
">",
"parseExportedAPIs",
"(",
"Archive",
"archive",
",",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"parse",
"(",
"archive",
",",
"API_FINDER",
",",
"name",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
... | Parses the exported API of the named class from the given archive and
returns all target locations the named class references. | [
"Parses",
"the",
"exported",
"API",
"of",
"the",
"named",
"class",
"from",
"the",
"given",
"archive",
"and",
"returns",
"all",
"target",
"locations",
"the",
"named",
"class",
"references",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DependencyFinder.java#L160-L167 |
apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java | Selector.getMetaClassImpl | private static MetaClassImpl getMetaClassImpl(MetaClass mc, boolean includeEMC) {
"""
Returns the MetaClassImpl if the given MetaClass is one of
MetaClassImpl, AdaptingMetaClass or ClosureMetaClass. If
none of these cases matches, this method returns null.
"""
Class mcc = mc.getClass();
boole... | java | private static MetaClassImpl getMetaClassImpl(MetaClass mc, boolean includeEMC) {
Class mcc = mc.getClass();
boolean valid = mcc == MetaClassImpl.class ||
mcc == AdaptingMetaClass.class ||
mcc == ClosureMetaClass.class ||
(includ... | [
"private",
"static",
"MetaClassImpl",
"getMetaClassImpl",
"(",
"MetaClass",
"mc",
",",
"boolean",
"includeEMC",
")",
"{",
"Class",
"mcc",
"=",
"mc",
".",
"getClass",
"(",
")",
";",
"boolean",
"valid",
"=",
"mcc",
"==",
"MetaClassImpl",
".",
"class",
"||",
... | Returns the MetaClassImpl if the given MetaClass is one of
MetaClassImpl, AdaptingMetaClass or ClosureMetaClass. If
none of these cases matches, this method returns null. | [
"Returns",
"the",
"MetaClassImpl",
"if",
"the",
"given",
"MetaClass",
"is",
"one",
"of",
"MetaClassImpl",
"AdaptingMetaClass",
"or",
"ClosureMetaClass",
".",
"If",
"none",
"of",
"these",
"cases",
"matches",
"this",
"method",
"returns",
"null",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/Selector.java#L1045-L1057 |
RallyTools/RallyRestToolkitForJava | src/main/java/com/rallydev/rest/client/HttpClient.java | HttpClient.doPut | public String doPut(String url, String body) throws IOException {
"""
Perform a put against the WSAPI
@param url the request url
@param body the body of the put
@return the JSON encoded string response
@throws IOException if a non-200 response code is returned or if some other
problem occurs while executin... | java | public String doPut(String url, String body) throws IOException {
HttpPut httpPut = new HttpPut(getWsapiUrl() + url);
httpPut.setEntity(new StringEntity(body, "utf-8"));
return doRequest(httpPut);
} | [
"public",
"String",
"doPut",
"(",
"String",
"url",
",",
"String",
"body",
")",
"throws",
"IOException",
"{",
"HttpPut",
"httpPut",
"=",
"new",
"HttpPut",
"(",
"getWsapiUrl",
"(",
")",
"+",
"url",
")",
";",
"httpPut",
".",
"setEntity",
"(",
"new",
"String... | Perform a put against the WSAPI
@param url the request url
@param body the body of the put
@return the JSON encoded string response
@throws IOException if a non-200 response code is returned or if some other
problem occurs while executing the request | [
"Perform",
"a",
"put",
"against",
"the",
"WSAPI"
] | train | https://github.com/RallyTools/RallyRestToolkitForJava/blob/542afa16ea44c9c64cebb0299500dcbbb50b6d7d/src/main/java/com/rallydev/rest/client/HttpClient.java#L192-L196 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixInteraceExpected | @Fix(IssueCodes.INTERFACE_EXPECTED)
public void fixInteraceExpected(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Interface expected".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
ExtendedTypeRemoveModification.accept(this, issue, acceptor);
} | java | @Fix(IssueCodes.INTERFACE_EXPECTED)
public void fixInteraceExpected(final Issue issue, IssueResolutionAcceptor acceptor) {
ExtendedTypeRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"IssueCodes",
".",
"INTERFACE_EXPECTED",
")",
"public",
"void",
"fixInteraceExpected",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"ExtendedTypeRemoveModification",
".",
"accept",
"(",
"this",
",",
"issue",
... | Quick fix for "Interface expected".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Interface",
"expected",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L835-L838 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendValue | public DateTimeFormatterBuilder appendValue(
TemporalField field, int minWidth, int maxWidth, SignStyle signStyle) {
"""
Appends the value of a date-time field to the formatter providing full
control over printing.
<p>
The value of the field will be output during a print.
If the value cannot be obt... | java | public DateTimeFormatterBuilder appendValue(
TemporalField field, int minWidth, int maxWidth, SignStyle signStyle) {
if (minWidth == maxWidth && signStyle == SignStyle.NOT_NEGATIVE) {
return appendValue(field, maxWidth);
}
Jdk8Methods.requireNonNull(field, "field");
... | [
"public",
"DateTimeFormatterBuilder",
"appendValue",
"(",
"TemporalField",
"field",
",",
"int",
"minWidth",
",",
"int",
"maxWidth",
",",
"SignStyle",
"signStyle",
")",
"{",
"if",
"(",
"minWidth",
"==",
"maxWidth",
"&&",
"signStyle",
"==",
"SignStyle",
".",
"NOT_... | Appends the value of a date-time field to the formatter providing full
control over printing.
<p>
The value of the field will be output during a print.
If the value cannot be obtained then an exception will be thrown.
<p>
This method provides full control of the numeric formatting, including
zero-padding and the positi... | [
"Appends",
"the",
"value",
"of",
"a",
"date",
"-",
"time",
"field",
"to",
"the",
"formatter",
"providing",
"full",
"control",
"over",
"printing",
".",
"<p",
">",
"The",
"value",
"of",
"the",
"field",
"will",
"be",
"output",
"during",
"a",
"print",
".",
... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java#L440-L460 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/ssh/ProxyEnabler.java | ProxyEnabler.enableProxy | public static void enableProxy( String url, String port, String user, String pwd, String nonProxyHosts ) {
"""
Enable the proxy usage based on the url, user and pwd.
@param url the proxy server url.
@param port the server port.
@param user the proxy user.
@param pwd the proxy password.
@param nonProxyHosts ... | java | public static void enableProxy( String url, String port, String user, String pwd, String nonProxyHosts ) {
_url = url;
_port = port;
_user = user;
_pwd = pwd;
System.setProperty("http.proxyHost", url);
System.setProperty("https.proxyHost", url);
if (port != null ... | [
"public",
"static",
"void",
"enableProxy",
"(",
"String",
"url",
",",
"String",
"port",
",",
"String",
"user",
",",
"String",
"pwd",
",",
"String",
"nonProxyHosts",
")",
"{",
"_url",
"=",
"url",
";",
"_port",
"=",
"port",
";",
"_user",
"=",
"user",
";"... | Enable the proxy usage based on the url, user and pwd.
@param url the proxy server url.
@param port the server port.
@param user the proxy user.
@param pwd the proxy password.
@param nonProxyHosts hosts that do not go through proxy.
<p>Default is: <code>localhost|127.*|[::1]</code>.</p>
<p>Other example: *.foo.com|loc... | [
"Enable",
"the",
"proxy",
"usage",
"based",
"on",
"the",
"url",
"user",
"and",
"pwd",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/ssh/ProxyEnabler.java#L48-L77 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UIData.java | UIData.setValueExpression | public void setValueExpression(String name, ValueExpression binding) {
"""
<p>Set the {@link ValueExpression} used to calculate the value for the
specified attribute or property name, if any. In addition, if a {@link
ValueExpression} is set for the <code>value</code> property, remove any
synthesized {@link Dat... | java | public void setValueExpression(String name, ValueExpression binding) {
if ("value".equals(name)) {
this.model = null;
} else if ("var".equals(name) || "rowIndex".equals(name)) {
throw new IllegalArgumentException();
}
super.setValueExpression(name, binding);
... | [
"public",
"void",
"setValueExpression",
"(",
"String",
"name",
",",
"ValueExpression",
"binding",
")",
"{",
"if",
"(",
"\"value\"",
".",
"equals",
"(",
"name",
")",
")",
"{",
"this",
".",
"model",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"\"var\"",
".... | <p>Set the {@link ValueExpression} used to calculate the value for the
specified attribute or property name, if any. In addition, if a {@link
ValueExpression} is set for the <code>value</code> property, remove any
synthesized {@link DataModel} for the data previously bound to this
component.</p>
@param name Name o... | [
"<p",
">",
"Set",
"the",
"{",
"@link",
"ValueExpression",
"}",
"used",
"to",
"calculate",
"the",
"value",
"for",
"the",
"specified",
"attribute",
"or",
"property",
"name",
"if",
"any",
".",
"In",
"addition",
"if",
"a",
"{",
"@link",
"ValueExpression",
"}",... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIData.java#L799-L808 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeScannerContextDao.java | CeScannerContextDao.selectScannerContext | public Optional<String> selectScannerContext(DbSession dbSession, String taskUuid) {
"""
The scanner context is very likely to contain lines, which are forcefully separated by {@code \n} characters,
whichever the platform SQ is running on ({@see LogsIteratorInputStream}).
"""
try (PreparedStatement stmt =... | java | public Optional<String> selectScannerContext(DbSession dbSession, String taskUuid) {
try (PreparedStatement stmt = dbSession.getConnection().prepareStatement("select context_data from ce_scanner_context where task_uuid=?")) {
stmt.setString(1, taskUuid);
try (ResultSet rs = stmt.executeQuery()) {
... | [
"public",
"Optional",
"<",
"String",
">",
"selectScannerContext",
"(",
"DbSession",
"dbSession",
",",
"String",
"taskUuid",
")",
"{",
"try",
"(",
"PreparedStatement",
"stmt",
"=",
"dbSession",
".",
"getConnection",
"(",
")",
".",
"prepareStatement",
"(",
"\"sele... | The scanner context is very likely to contain lines, which are forcefully separated by {@code \n} characters,
whichever the platform SQ is running on ({@see LogsIteratorInputStream}). | [
"The",
"scanner",
"context",
"is",
"very",
"likely",
"to",
"contain",
"lines",
"which",
"are",
"forcefully",
"separated",
"by",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/ce/CeScannerContextDao.java#L74-L86 |
fernandospr/javapns-jdk16 | src/main/java/javapns/notification/Payload.java | Payload.estimatePayloadSizeAfterAdding | public int estimatePayloadSizeAfterAdding(String propertyName, Object propertyValue) {
"""
Estimate the size that this payload will take after adding a given property.
For performance reasons, this estimate is not as reliable as actually adding
the property and checking the payload size afterwards.
Currently ... | java | public int estimatePayloadSizeAfterAdding(String propertyName, Object propertyValue) {
try {
int maximumPayloadSize = getMaximumPayloadSize();
int currentPayloadSize = getPayloadAsBytesUnchecked().length;
int estimatedSize = currentPayloadSize;
if (propertyName != null && propertyValue != null) {
esti... | [
"public",
"int",
"estimatePayloadSizeAfterAdding",
"(",
"String",
"propertyName",
",",
"Object",
"propertyValue",
")",
"{",
"try",
"{",
"int",
"maximumPayloadSize",
"=",
"getMaximumPayloadSize",
"(",
")",
";",
"int",
"currentPayloadSize",
"=",
"getPayloadAsBytesUnchecke... | Estimate the size that this payload will take after adding a given property.
For performance reasons, this estimate is not as reliable as actually adding
the property and checking the payload size afterwards.
Currently works well with strings and numbers.
@param propertyName the name of the property to use for calcul... | [
"Estimate",
"the",
"size",
"that",
"this",
"payload",
"will",
"take",
"after",
"adding",
"a",
"given",
"property",
".",
"For",
"performance",
"reasons",
"this",
"estimate",
"is",
"not",
"as",
"reliable",
"as",
"actually",
"adding",
"the",
"property",
"and",
... | train | https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L200-L222 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeStepExecution.java | RuntimeStepExecution.setCommittedMetrics | public void setCommittedMetrics() {
"""
Creates/Updates the committedMetrics variable using the passed in metric types
"""
for (MetricImpl.MetricType metricType : this.tranCoordinatedMetricTypes) {
committedMetrics.put(metricType.name(), new MetricImpl(metricType, this.getMetric(metricType).getValue... | java | public void setCommittedMetrics() {
for (MetricImpl.MetricType metricType : this.tranCoordinatedMetricTypes) {
committedMetrics.put(metricType.name(), new MetricImpl(metricType, this.getMetric(metricType).getValue()));
}
} | [
"public",
"void",
"setCommittedMetrics",
"(",
")",
"{",
"for",
"(",
"MetricImpl",
".",
"MetricType",
"metricType",
":",
"this",
".",
"tranCoordinatedMetricTypes",
")",
"{",
"committedMetrics",
".",
"put",
"(",
"metricType",
".",
"name",
"(",
")",
",",
"new",
... | Creates/Updates the committedMetrics variable using the passed in metric types | [
"Creates",
"/",
"Updates",
"the",
"committedMetrics",
"variable",
"using",
"the",
"passed",
"in",
"metric",
"types"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeStepExecution.java#L137-L141 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optSerializable | @Nullable
@SuppressWarnings("unchecked") // Bundle#getSerializable(String) returns Serializable object so it is safe to cast to a type which extends Serializable.
public static <T extends Serializable> T optSerializable(@Nullable Bundle bundle, @Nullable String key, @Nullable T fallback) {
"""
Returns a op... | java | @Nullable
@SuppressWarnings("unchecked") // Bundle#getSerializable(String) returns Serializable object so it is safe to cast to a type which extends Serializable.
public static <T extends Serializable> T optSerializable(@Nullable Bundle bundle, @Nullable String key, @Nullable T fallback) {
if (bundle ==... | [
"@",
"Nullable",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// Bundle#getSerializable(String) returns Serializable object so it is safe to cast to a type which extends Serializable.",
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"optSerializable",
"(... | Returns a optional {@link java.io.Serializable}. In other words, returns the value mapped by key if it exists and is a {@link java.io.Serializable}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will return ... | [
"Returns",
"a",
"optional",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L796-L803 |
apereo/cas | support/cas-server-support-saml/src/main/java/org/apereo/cas/support/saml/authentication/SamlResponseBuilder.java | SamlResponseBuilder.encodeSamlResponse | public void encodeSamlResponse(final Response samlResponse, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
"""
Encode saml response.
@param samlResponse the saml response
@param request the request
@param response the response
@throws Exception the exception... | java | public void encodeSamlResponse(final Response samlResponse, final HttpServletRequest request, final HttpServletResponse response) throws Exception {
this.samlObjectBuilder.encodeSamlResponse(response, request, samlResponse);
} | [
"public",
"void",
"encodeSamlResponse",
"(",
"final",
"Response",
"samlResponse",
",",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"throws",
"Exception",
"{",
"this",
".",
"samlObjectBuilder",
".",
"encodeSamlResponse"... | Encode saml response.
@param samlResponse the saml response
@param request the request
@param response the response
@throws Exception the exception | [
"Encode",
"saml",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml/src/main/java/org/apereo/cas/support/saml/authentication/SamlResponseBuilder.java#L145-L147 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java | Agg.maxAll | public static <T, U> Collector<T, ?, Seq<U>> maxAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
"""
Get a {@link Collector} that calculates the <code>MAX()</code> function, producing multiple results.
"""
return collectingAndThen(maxAllBy(function, comparator), t -> t... | java | public static <T, U> Collector<T, ?, Seq<U>> maxAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
return collectingAndThen(maxAllBy(function, comparator), t -> t.map(function));
} | [
"public",
"static",
"<",
"T",
",",
"U",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Seq",
"<",
"U",
">",
">",
"maxAll",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"U",
">",
"function",
",",
"Comparator",
"<",
"?",
"super",
"U... | Get a {@link Collector} that calculates the <code>MAX()</code> function, producing multiple results. | [
"Get",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L350-L352 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/util/IntSets.java | IntSets.concurrentCopyFrom | public static IntSet concurrentCopyFrom(IntSet intSet, int maxExclusive) {
"""
Returns a copy of the given set that supports concurrent operations. The returned set will contain all of the
ints the provided set contained. The returned set only supports up to the maximum size the previous int set
supported when t... | java | public static IntSet concurrentCopyFrom(IntSet intSet, int maxExclusive) {
ConcurrentSmallIntSet cis = new ConcurrentSmallIntSet(maxExclusive);
intSet.forEach((IntConsumer) cis::set);
return cis;
} | [
"public",
"static",
"IntSet",
"concurrentCopyFrom",
"(",
"IntSet",
"intSet",
",",
"int",
"maxExclusive",
")",
"{",
"ConcurrentSmallIntSet",
"cis",
"=",
"new",
"ConcurrentSmallIntSet",
"(",
"maxExclusive",
")",
";",
"intSet",
".",
"forEach",
"(",
"(",
"IntConsumer"... | Returns a copy of the given set that supports concurrent operations. The returned set will contain all of the
ints the provided set contained. The returned set only supports up to the maximum size the previous int set
supported when this method is invoked or the largest int it held.
@param intSet set to copy from
@para... | [
"Returns",
"a",
"copy",
"of",
"the",
"given",
"set",
"that",
"supports",
"concurrent",
"operations",
".",
"The",
"returned",
"set",
"will",
"contain",
"all",
"of",
"the",
"ints",
"the",
"provided",
"set",
"contained",
".",
"The",
"returned",
"set",
"only",
... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/IntSets.java#L181-L185 |
sahan/IckleBot | icklebot/src/main/java/com/lonepulse/icklebot/fragment/NetworkFragment.java | NetworkFragment.onResume | @Override
public void onResume() {
"""
<p>Registers a {@link BroadcastReceiver} to listen for changes in the data
connection state and invoke the appropriate callbacks.
"""
super.onResume();
if(ProfileService.getInstance(getActivity().getApplicationContext()).isActive(this, Profile.NETWORK)) {
... | java | @Override
public void onResume() {
super.onResume();
if(ProfileService.getInstance(getActivity().getApplicationContext()).isActive(this, Profile.NETWORK)) {
if(!PermissionUtils.isGranted(this, Manifest.permission.ACCESS_NETWORK_STATE)) {
Log.e(getClass().getSimpleName(), "Failed to register a ... | [
"@",
"Override",
"public",
"void",
"onResume",
"(",
")",
"{",
"super",
".",
"onResume",
"(",
")",
";",
"if",
"(",
"ProfileService",
".",
"getInstance",
"(",
"getActivity",
"(",
")",
".",
"getApplicationContext",
"(",
")",
")",
".",
"isActive",
"(",
"this... | <p>Registers a {@link BroadcastReceiver} to listen for changes in the data
connection state and invoke the appropriate callbacks. | [
"<p",
">",
"Registers",
"a",
"{"
] | train | https://github.com/sahan/IckleBot/blob/a19003ceb3ad7c7ee508dc23a8cb31b5676aa499/icklebot/src/main/java/com/lonepulse/icklebot/fragment/NetworkFragment.java#L110-L131 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/ServerHandle.java | ServerHandle.registerMBeanAtServer | public ObjectName registerMBeanAtServer(MBeanServer pServer, Object pMBean, String pName)
throws MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, MalformedObjectNameException {
"""
Register a MBean at the dedicated server. This method can be overridden if
somethi... | java | public ObjectName registerMBeanAtServer(MBeanServer pServer, Object pMBean, String pName)
throws MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, MalformedObjectNameException {
if (pName != null) {
ObjectName oName = new ObjectName(pName);
... | [
"public",
"ObjectName",
"registerMBeanAtServer",
"(",
"MBeanServer",
"pServer",
",",
"Object",
"pMBean",
",",
"String",
"pName",
")",
"throws",
"MBeanRegistrationException",
",",
"InstanceAlreadyExistsException",
",",
"NotCompliantMBeanException",
",",
"MalformedObjectNameExc... | Register a MBean at the dedicated server. This method can be overridden if
something special registration procedure is required, like for using the
specific name for the registration or deligating the namin to MBean to register.
@param pServer server an MBean should be registered
@param pMBean the MBean to register
@p... | [
"Register",
"a",
"MBean",
"at",
"the",
"dedicated",
"server",
".",
"This",
"method",
"can",
"be",
"overridden",
"if",
"something",
"special",
"registration",
"procedure",
"is",
"required",
"like",
"for",
"using",
"the",
"specific",
"name",
"for",
"the",
"regis... | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/ServerHandle.java#L144-L153 |
shinesolutions/swagger-aem | java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java | SlingApi.postTreeActivationAsync | public com.squareup.okhttp.Call postTreeActivationAsync(Boolean ignoredeactivated, Boolean onlymodified, String path, final ApiCallback<Void> callback) throws ApiException {
"""
(asynchronously)
@param ignoredeactivated (required)
@param onlymodified (required)
@param path (required)
@param callback The c... | java | public com.squareup.okhttp.Call postTreeActivationAsync(Boolean ignoredeactivated, Boolean onlymodified, String path, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListene... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"postTreeActivationAsync",
"(",
"Boolean",
"ignoredeactivated",
",",
"Boolean",
"onlymodified",
",",
"String",
"path",
",",
"final",
"ApiCallback",
"<",
"Void",
">",
"callback",
")",
"throws",
"ApiExc... | (asynchronously)
@param ignoredeactivated (required)
@param onlymodified (required)
@param path (required)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If fail to process the API call, e.g. serializing the request body object | [
"(",
"asynchronously",
")"
] | train | https://github.com/shinesolutions/swagger-aem/blob/ae7da4df93e817dc2bad843779b2069d9c4e7c6b/java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java#L4343-L4367 |
d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixdownMinWithComparator | private void fixdownMinWithComparator(int k) {
"""
Downwards fix starting from a particular element at a minimum level.
Performs comparisons using the comparator.
@param k
the index of the starting element
"""
int c = 2 * k;
while (c <= size) {
int m = minChildOrGrandchildWithC... | java | private void fixdownMinWithComparator(int k) {
int c = 2 * k;
while (c <= size) {
int m = minChildOrGrandchildWithComparator(k);
if (m > c + 1) { // grandchild
if (comparator.compare(array[m], array[k]) >= 0) {
break;
}
... | [
"private",
"void",
"fixdownMinWithComparator",
"(",
"int",
"k",
")",
"{",
"int",
"c",
"=",
"2",
"*",
"k",
";",
"while",
"(",
"c",
"<=",
"size",
")",
"{",
"int",
"m",
"=",
"minChildOrGrandchildWithComparator",
"(",
"k",
")",
";",
"if",
"(",
"m",
">",
... | Downwards fix starting from a particular element at a minimum level.
Performs comparisons using the comparator.
@param k
the index of the starting element | [
"Downwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"minimum",
"level",
".",
"Performs",
"comparisons",
"using",
"the",
"comparator",
"."
] | train | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L565-L593 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/proxy/transport/ProxyTask.java | ProxyTask.getNextObjectParam | public Object getNextObjectParam(InputStream in, String strName, Map<String, Object> properties) {
"""
Get the next (String) param.
@param strName The param name (in most implementations this is optional).
@param properties The temporary remote session properties
@return The next param as a string.
"""
... | java | public Object getNextObjectParam(InputStream in, String strName, Map<String, Object> properties)
{
String strParam = this.getNextStringParam(in, strName, properties);
strParam = Base64.decode(strParam);
return org.jbundle.thin.base.remote.proxy.transport.BaseTransport.convertStringToObject(s... | [
"public",
"Object",
"getNextObjectParam",
"(",
"InputStream",
"in",
",",
"String",
"strName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strParam",
"=",
"this",
".",
"getNextStringParam",
"(",
"in",
",",
"strName",
",",... | Get the next (String) param.
@param strName The param name (in most implementations this is optional).
@param properties The temporary remote session properties
@return The next param as a string. | [
"Get",
"the",
"next",
"(",
"String",
")",
"param",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/transport/ProxyTask.java#L294-L299 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.sadd | @Override
public Long sadd(final byte[] key, final byte[]... members) {
"""
Add the specified member to the set value stored at key. If member is already a member of the
set no operation is performed. If key does not exist a new set with the specified member as
sole member is created. If the key exists but doe... | java | @Override
public Long sadd(final byte[] key, final byte[]... members) {
checkIsInMultiOrPipeline();
client.sadd(key, members);
return client.getIntegerReply();
} | [
"@",
"Override",
"public",
"Long",
"sadd",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"byte",
"[",
"]",
"...",
"members",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"sadd",
"(",
"key",
",",
"members",
")",
";",
"ret... | Add the specified member to the set value stored at key. If member is already a member of the
set no operation is performed. If key does not exist a new set with the specified member as
sole member is created. If the key exists but does not hold a set value an error is returned.
<p>
Time complexity O(1)
@param key
@par... | [
"Add",
"the",
"specified",
"member",
"to",
"the",
"set",
"value",
"stored",
"at",
"key",
".",
"If",
"member",
"is",
"already",
"a",
"member",
"of",
"the",
"set",
"no",
"operation",
"is",
"performed",
".",
"If",
"key",
"does",
"not",
"exist",
"a",
"new"... | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L1383-L1388 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/TranscriptManager.java | TranscriptManager.getTranscript | public Transcript getTranscript(EntityBareJid workgroupJID, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Returns the full conversation transcript of a given session.
@param sessionID the id of the session to get the full transcript.
@param ... | java | public Transcript getTranscript(EntityBareJid workgroupJID, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
Transcript request = new Transcript(sessionID);
request.setTo(workgroupJID);
Transcript response = connection.createStanzaCo... | [
"public",
"Transcript",
"getTranscript",
"(",
"EntityBareJid",
"workgroupJID",
",",
"String",
"sessionID",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"Transcript",
"request",
"=",
"new",... | Returns the full conversation transcript of a given session.
@param sessionID the id of the session to get the full transcript.
@param workgroupJID the JID of the workgroup that will process the request.
@return the full conversation transcript of a given session.
@throws XMPPErrorException
@throws NoResponseException... | [
"Returns",
"the",
"full",
"conversation",
"transcript",
"of",
"a",
"given",
"session",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/TranscriptManager.java#L56-L61 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/TextArea.java | TextArea.setAttribute | public void setAttribute(String name, String value, String facet)
throws JspException {
"""
Base support for the attribute tag.
@param name The name of the attribute. This value may not be null or the empty string.
@param value The value of the attribute. This may contain an expression.
@param fa... | java | public void setAttribute(String name, String value, String facet)
throws JspException
{
if (name != null) {
if (name.equals(DISABLED)) {
setDisabled(Boolean.parseBoolean(value));
return;
}
else if (name.equals(READONLY)) {
... | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"DISABLED",
")",
")",
"{",
... | Base support for the attribute tag.
@param name The name of the attribute. This value may not be null or the empty string.
@param value The value of the attribute. This may contain an expression.
@param facet The name of a facet to which the attribute will be applied. This is optional.
@throws JspException A JspExc... | [
"Base",
"support",
"for",
"the",
"attribute",
"tag",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/TextArea.java#L79-L102 |
chemouna/Decor | decorators/src/main/java/com/mounacheikhna/decorators/AutofitDecorator.java | AutofitDecorator.setTextSize | public void setTextSize(int unit, float size) {
"""
probably it wont work (is there a way to have a delegate for mTextView to pass to this when setTextSize is called on it)
"""
if (!mSizeToFit) {
mTextView.setTextSize(unit, size);
}
Context context = mTextView.getContext();... | java | public void setTextSize(int unit, float size) {
if (!mSizeToFit) {
mTextView.setTextSize(unit, size);
}
Context context = mTextView.getContext();
Resources r = Resources.getSystem();
if (context != null) {
r = context.getResources();
}
s... | [
"public",
"void",
"setTextSize",
"(",
"int",
"unit",
",",
"float",
"size",
")",
"{",
"if",
"(",
"!",
"mSizeToFit",
")",
"{",
"mTextView",
".",
"setTextSize",
"(",
"unit",
",",
"size",
")",
";",
"}",
"Context",
"context",
"=",
"mTextView",
".",
"getCont... | probably it wont work (is there a way to have a delegate for mTextView to pass to this when setTextSize is called on it) | [
"probably",
"it",
"wont",
"work",
"(",
"is",
"there",
"a",
"way",
"to",
"have",
"a",
"delegate",
"for",
"mTextView",
"to",
"pass",
"to",
"this",
"when",
"setTextSize",
"is",
"called",
"on",
"it",
")"
] | train | https://github.com/chemouna/Decor/blob/82b1c1be3c7769e0b63c6eb16f0c01055fb3e4ca/decorators/src/main/java/com/mounacheikhna/decorators/AutofitDecorator.java#L238-L251 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java | DSSPParser.parseInputStream | public static List<SecStrucState> parseInputStream(InputStream dsspIs,
Structure structure, boolean assign)
throws IOException, StructureException {
"""
Parse a DSSP output file and return the secondary structure
annotation as a List of {@link SecStrucState} objects.
@param dsspIs an InputStream to a D... | java | public static List<SecStrucState> parseInputStream(InputStream dsspIs,
Structure structure, boolean assign)
throws IOException, StructureException {
BufferedReader reader = new BufferedReader(new InputStreamReader(dsspIs));
return generalParse(reader, structure, assign);
} | [
"public",
"static",
"List",
"<",
"SecStrucState",
">",
"parseInputStream",
"(",
"InputStream",
"dsspIs",
",",
"Structure",
"structure",
",",
"boolean",
"assign",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"BufferedReader",
"reader",
"=",
"new",
... | Parse a DSSP output file and return the secondary structure
annotation as a List of {@link SecStrucState} objects.
@param dsspIs an InputStream to a DSSP file
@param structure Structure object associated to the dssp
@param assign assigns the SS to the structure if true
@return a List of SS annotation objects
@throws S... | [
"Parse",
"a",
"DSSP",
"output",
"file",
"and",
"return",
"the",
"secondary",
"structure",
"annotation",
"as",
"a",
"List",
"of",
"{",
"@link",
"SecStrucState",
"}",
"objects",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/DSSPParser.java#L73-L79 |
lisicnu/droidUtil | src/main/java/com/github/lisicnu/libDroid/util/DateUtils.java | DateUtils.getShortDateString | public static String getShortDateString(long time, String format) {
"""
get formated date String
@param time
@param format if is null or empty, will use "yyyy-MM-dd"
"""
if (format == null || format.isEmpty()) {
format = "yyyy-MM-dd";
}
SimpleDateFormat smpf = new Simpl... | java | public static String getShortDateString(long time, String format) {
if (format == null || format.isEmpty()) {
format = "yyyy-MM-dd";
}
SimpleDateFormat smpf = new SimpleDateFormat(format);
return smpf.format(new Date(time));
} | [
"public",
"static",
"String",
"getShortDateString",
"(",
"long",
"time",
",",
"String",
"format",
")",
"{",
"if",
"(",
"format",
"==",
"null",
"||",
"format",
".",
"isEmpty",
"(",
")",
")",
"{",
"format",
"=",
"\"yyyy-MM-dd\"",
";",
"}",
"SimpleDateFormat"... | get formated date String
@param time
@param format if is null or empty, will use "yyyy-MM-dd" | [
"get",
"formated",
"date",
"String"
] | train | https://github.com/lisicnu/droidUtil/blob/e4d6cf3e3f60e5efb5a75672607ded94d1725519/src/main/java/com/github/lisicnu/libDroid/util/DateUtils.java#L23-L30 |
HubSpot/Singularity | SingularityService/src/main/java/com/hubspot/singularity/async/AsyncSemaphore.java | AsyncSemaphore.callWithQueueTimeout | public CompletableFuture<T> callWithQueueTimeout(Callable<CompletableFuture<T>> execution, long timeout, TimeUnit timeUnit) {
"""
Try to execute the supplier if there are enough permits available.
If not, add the execution to a queue (if there is room).
If the queue attempts to start the execution after the time... | java | public CompletableFuture<T> callWithQueueTimeout(Callable<CompletableFuture<T>> execution, long timeout, TimeUnit timeUnit) {
return callWithQueueTimeout(execution, Optional.of(TimeUnit.MILLISECONDS.convert(timeout, timeUnit)));
} | [
"public",
"CompletableFuture",
"<",
"T",
">",
"callWithQueueTimeout",
"(",
"Callable",
"<",
"CompletableFuture",
"<",
"T",
">",
">",
"execution",
",",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"callWithQueueTimeout",
"(",
"execution",
"... | Try to execute the supplier if there are enough permits available.
If not, add the execution to a queue (if there is room).
If the queue attempts to start the execution after the timeout
has passed, short circuit the execution and complete the future
exceptionally with TimeoutException
@param execution - The execution... | [
"Try",
"to",
"execute",
"the",
"supplier",
"if",
"there",
"are",
"enough",
"permits",
"available",
".",
"If",
"not",
"add",
"the",
"execution",
"to",
"a",
"queue",
"(",
"if",
"there",
"is",
"room",
")",
".",
"If",
"the",
"queue",
"attempts",
"to",
"sta... | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityService/src/main/java/com/hubspot/singularity/async/AsyncSemaphore.java#L91-L93 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/util/PackageInfoLookup.java | PackageInfoLookup.hasAnnotation | private static boolean hasAnnotation(String pkgInfo, String annotation) {
"""
Return true if pkgInfo has the specified annotation.
@param pkgInfo package-info source code
@param annotation fully qualified name of the annotation
"""
if (!annotation.contains(".")) {
ErrorUtil.warning(annotation + "... | java | private static boolean hasAnnotation(String pkgInfo, String annotation) {
if (!annotation.contains(".")) {
ErrorUtil.warning(annotation + " is not a fully qualified name");
}
if (pkgInfo.contains("@" + annotation)) {
return true;
}
int idx = annotation.lastIndexOf(".");
String annota... | [
"private",
"static",
"boolean",
"hasAnnotation",
"(",
"String",
"pkgInfo",
",",
"String",
"annotation",
")",
"{",
"if",
"(",
"!",
"annotation",
".",
"contains",
"(",
"\".\"",
")",
")",
"{",
"ErrorUtil",
".",
"warning",
"(",
"annotation",
"+",
"\" is not a fu... | Return true if pkgInfo has the specified annotation.
@param pkgInfo package-info source code
@param annotation fully qualified name of the annotation | [
"Return",
"true",
"if",
"pkgInfo",
"has",
"the",
"specified",
"annotation",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/PackageInfoLookup.java#L134-L154 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/util/FeatureCallAsTypeLiteralHelper.java | FeatureCallAsTypeLiteralHelper.isPotentialTypeLiteral | public boolean isPotentialTypeLiteral(XExpression featureCall, /* @Nullable */ IResolvedTypes resolvedTypes) {
"""
Returns <code>true</code> if the given feature call can be a type literal (structurally).
Otherwise <code>false</code>.
"""
if (featureCall instanceof XMemberFeatureCall) {
return isPotentia... | java | public boolean isPotentialTypeLiteral(XExpression featureCall, /* @Nullable */ IResolvedTypes resolvedTypes) {
if (featureCall instanceof XMemberFeatureCall) {
return isPotentialTypeLiteralImpl(featureCall, resolvedTypes, ((XMemberFeatureCall) featureCall).isExplicitStatic());
}
return isPotentialTypeLiteralI... | [
"public",
"boolean",
"isPotentialTypeLiteral",
"(",
"XExpression",
"featureCall",
",",
"/* @Nullable */",
"IResolvedTypes",
"resolvedTypes",
")",
"{",
"if",
"(",
"featureCall",
"instanceof",
"XMemberFeatureCall",
")",
"{",
"return",
"isPotentialTypeLiteralImpl",
"(",
"fea... | Returns <code>true</code> if the given feature call can be a type literal (structurally).
Otherwise <code>false</code>. | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"given",
"feature",
"call",
"can",
"be",
"a",
"type",
"literal",
"(",
"structurally",
")",
".",
"Otherwise",
"<code",
">",
"false<",
"/",
"code",
">",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/util/FeatureCallAsTypeLiteralHelper.java#L37-L42 |
kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.updateParamsForAuth | public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
"""
Update query and header parameters based on authentication settings.
@param authNames The authentications to apply
@param queryParams List of query parameters
@param headerParams Map of header... | java | public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
... | [
"public",
"void",
"updateParamsForAuth",
"(",
"String",
"[",
"]",
"authNames",
",",
"List",
"<",
"Pair",
">",
"queryParams",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headerParams",
")",
"{",
"for",
"(",
"String",
"authName",
":",
"authNames",
")",
... | Update query and header parameters based on authentication settings.
@param authNames The authentications to apply
@param queryParams List of query parameters
@param headerParams Map of header parameters | [
"Update",
"query",
"and",
"header",
"parameters",
"based",
"on",
"authentication",
"settings",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L1043-L1049 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/AnnotatorCache.java | AnnotatorCache.remove | public void remove(@NonNull AnnotationType annotationType, @NonNull Language language) {
"""
Invalidates an item in the cache of
@param annotationType the annotation type
@param language The language
"""
cache.invalidate(createKey(annotationType, language));
} | java | public void remove(@NonNull AnnotationType annotationType, @NonNull Language language) {
cache.invalidate(createKey(annotationType, language));
} | [
"public",
"void",
"remove",
"(",
"@",
"NonNull",
"AnnotationType",
"annotationType",
",",
"@",
"NonNull",
"Language",
"language",
")",
"{",
"cache",
".",
"invalidate",
"(",
"createKey",
"(",
"annotationType",
",",
"language",
")",
")",
";",
"}"
] | Invalidates an item in the cache of
@param annotationType the annotation type
@param language The language | [
"Invalidates",
"an",
"item",
"in",
"the",
"cache",
"of"
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/AnnotatorCache.java#L96-L98 |
h2oai/h2o-2 | src/main/java/water/ga/GoogleAnalyticsRequest.java | GoogleAnalyticsRequest.customDimension | public T customDimension(int index, String value) {
"""
<div class="ind">
<p>
Optional.
</p>
<p>Each custom dimension has an associated index. There is a maximum of 20 custom dimensions (200 for Premium accounts). The name suffix must be a positive integer between 1 and 200, inclusive.</p>
<table border="1">
... | java | public T customDimension(int index, String value) {
customDimentions.put("cd" + index, value);
return (T) this;
} | [
"public",
"T",
"customDimension",
"(",
"int",
"index",
",",
"String",
"value",
")",
"{",
"customDimentions",
".",
"put",
"(",
"\"cd\"",
"+",
"index",
",",
"value",
")",
";",
"return",
"(",
"T",
")",
"this",
";",
"}"
] | <div class="ind">
<p>
Optional.
</p>
<p>Each custom dimension has an associated index. There is a maximum of 20 custom dimensions (200 for Premium accounts). The name suffix must be a positive integer between 1 and 200, inclusive.</p>
<table border="1">
<tbody>
<tr>
<th>Parameter</th>
<th>Value Type</th>
<th>Default Va... | [
"<div",
"class",
"=",
"ind",
">",
"<p",
">",
"Optional",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Each",
"custom",
"dimension",
"has",
"an",
"associated",
"index",
".",
"There",
"is",
"a",
"maximum",
"of",
"20",
"custom",
"dimensions",
"(",
"200",
"for",... | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/ga/GoogleAnalyticsRequest.java#L227-L230 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/ocr/AipOcr.java | AipOcr.enhancedGeneralUrl | public JSONObject enhancedGeneralUrl(String url, HashMap<String, String> options) {
"""
通用文字识别(含生僻字版)接口
某些场景中,图片中的中文不光有常用字,还包含了生僻字,这时用户需要对该图进行文字识别,应使用通用文字识别(含生僻字版)。
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key... | java | public JSONObject enhancedGeneralUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(OcrConsts.... | [
"public",
"JSONObject",
"enhancedGeneralUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",... | 通用文字识别(含生僻字版)接口
某些场景中,图片中的中文不光有常用字,还包含了生僻字,这时用户需要对该图进行文字识别,应使用通用文字识别(含生僻字版)。
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
language_type 识别语言类型,默认为CHN_ENG。可选值包括:<br>- CHN_ENG:中英文混合;... | [
"通用文字识别(含生僻字版)接口",
"某些场景中,图片中的中文不光有常用字,还包含了生僻字,这时用户需要对该图进行文字识别,应使用通用文字识别(含生僻字版)。"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/ocr/AipOcr.java#L350-L361 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/N1qlParams.java | N1qlParams.rawParam | @InterfaceStability.Uncommitted
public N1qlParams rawParam(String name, Object value) {
"""
Allows to specify an arbitrary, raw N1QL param.
Use with care and only provide options that are supported by the server and are not exposed as part of the
overall stable API in the {@link N1qlParams} class.
@para... | java | @InterfaceStability.Uncommitted
public N1qlParams rawParam(String name, Object value) {
if (this.rawParams == null) {
this.rawParams = new HashMap<String, Object>();
}
if (!JsonValue.checkType(value)) {
throw new IllegalArgumentException("Only JSON types are supporte... | [
"@",
"InterfaceStability",
".",
"Uncommitted",
"public",
"N1qlParams",
"rawParam",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"this",
".",
"rawParams",
"==",
"null",
")",
"{",
"this",
".",
"rawParams",
"=",
"new",
"HashMap",
"<",
... | Allows to specify an arbitrary, raw N1QL param.
Use with care and only provide options that are supported by the server and are not exposed as part of the
overall stable API in the {@link N1qlParams} class.
@param name the name of the property.
@param value the value of the property, only JSON value types are support... | [
"Allows",
"to",
"specify",
"an",
"arbitrary",
"raw",
"N1QL",
"param",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/N1qlParams.java#L448-L460 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.ne | public static <D> Predicate ne(Expression<D> left, Expression<? super D> right) {
"""
Create a {@code left != right} expression
@param <D> type of expressions
@param left lhs of expression
@param right rhs of expression
@return left != right
"""
return predicate(Ops.NE, left, right);
} | java | public static <D> Predicate ne(Expression<D> left, Expression<? super D> right) {
return predicate(Ops.NE, left, right);
} | [
"public",
"static",
"<",
"D",
">",
"Predicate",
"ne",
"(",
"Expression",
"<",
"D",
">",
"left",
",",
"Expression",
"<",
"?",
"super",
"D",
">",
"right",
")",
"{",
"return",
"predicate",
"(",
"Ops",
".",
"NE",
",",
"left",
",",
"right",
")",
";",
... | Create a {@code left != right} expression
@param <D> type of expressions
@param left lhs of expression
@param right rhs of expression
@return left != right | [
"Create",
"a",
"{",
"@code",
"left",
"!",
"=",
"right",
"}",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L719-L721 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.listTemplates | public TemplateInformation listTemplates(String accountId, String envelopeId) throws ApiException {
"""
Get List of Templates used in an Envelope
This returns a list of the server-side templates, their name and ID, used in an envelope.
@param accountId The external account number (int) or account ID Guid. (requi... | java | public TemplateInformation listTemplates(String accountId, String envelopeId) throws ApiException {
return listTemplates(accountId, envelopeId, null);
} | [
"public",
"TemplateInformation",
"listTemplates",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
")",
"throws",
"ApiException",
"{",
"return",
"listTemplates",
"(",
"accountId",
",",
"envelopeId",
",",
"null",
")",
";",
"}"
] | Get List of Templates used in an Envelope
This returns a list of the server-side templates, their name and ID, used in an envelope.
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelopeId Guid of the envelope being accessed. (required)
@return TemplateInformati... | [
"Get",
"List",
"of",
"Templates",
"used",
"in",
"an",
"Envelope",
"This",
"returns",
"a",
"list",
"of",
"the",
"server",
"-",
"side",
"templates",
"their",
"name",
"and",
"ID",
"used",
"in",
"an",
"envelope",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L4344-L4346 |
aerogear/aerogear-unifiedpush-server | common/src/main/java/org/jboss/aerogear/unifiedpush/system/ConfigurationUtils.java | ConfigurationUtils.tryGetIntegerProperty | private static Integer tryGetIntegerProperty(String key, Integer defaultValue) {
"""
Try to retrieve a system property and returns the defaultValue if SecurityManager blocks it.
@param key Name of the system property to get the integer for.
@param defaultValue Value to be returned on unsuccessful operation or ... | java | private static Integer tryGetIntegerProperty(String key, Integer defaultValue) {
try {
return Integer.getInteger(key, defaultValue);
} catch (SecurityException e) {
logger.error("Could not get value of property {} due to SecurityManager. Using default value.", key, e);
... | [
"private",
"static",
"Integer",
"tryGetIntegerProperty",
"(",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"getInteger",
"(",
"key",
",",
"defaultValue",
")",
";",
"}",
"catch",
"(",
"SecurityException",
"e",... | Try to retrieve a system property and returns the defaultValue if SecurityManager blocks it.
@param key Name of the system property to get the integer for.
@param defaultValue Value to be returned on unsuccessful operation or if the propety is not set.
@return the value of the System property | [
"Try",
"to",
"retrieve",
"a",
"system",
"property",
"and",
"returns",
"the",
"defaultValue",
"if",
"SecurityManager",
"blocks",
"it",
"."
] | train | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/common/src/main/java/org/jboss/aerogear/unifiedpush/system/ConfigurationUtils.java#L54-L61 |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/main/java/com/github/kostyasha/it/utils/TempFileHelper.java | TempFileHelper.createTempDirectory | public static File createTempDirectory(String prefix, Path dir) throws IOException {
"""
Creates a temporary directory in the given directory, or in in the
temporary directory if dir is {@code null}.
"""
if (prefix == null) {
prefix = "";
}
final File file = generatePath(pr... | java | public static File createTempDirectory(String prefix, Path dir) throws IOException {
if (prefix == null) {
prefix = "";
}
final File file = generatePath(prefix, dir).toFile();
if (!file.mkdirs()) {
throw new IOException("Can't create dir " + file.getAbsolutePath()... | [
"public",
"static",
"File",
"createTempDirectory",
"(",
"String",
"prefix",
",",
"Path",
"dir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"prefix",
"==",
"null",
")",
"{",
"prefix",
"=",
"\"\"",
";",
"}",
"final",
"File",
"file",
"=",
"generatePath",
... | Creates a temporary directory in the given directory, or in in the
temporary directory if dir is {@code null}. | [
"Creates",
"a",
"temporary",
"directory",
"in",
"the",
"given",
"directory",
"or",
"in",
"in",
"the",
"temporary",
"directory",
"if",
"dir",
"is",
"{"
] | train | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-its/src/main/java/com/github/kostyasha/it/utils/TempFileHelper.java#L23-L32 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java | UriEscaper.encodeCharAtIndex | private String encodeCharAtIndex(final String string, final int index, final State state) {
"""
Encodes the character at the given index, and returns the resulting string. If the character does not need to
be encoded, this function returns null
"""
final char c = string.charAt(index);
/* Spe... | java | private String encodeCharAtIndex(final String string, final int index, final State state) {
final char c = string.charAt(index);
/* Special-case: spaces are "%20" when not within query string, or when doing strict mode */
if ((SPACE.matches(c) && ((state != State.QUERY && state != State.QUERY_P... | [
"private",
"String",
"encodeCharAtIndex",
"(",
"final",
"String",
"string",
",",
"final",
"int",
"index",
",",
"final",
"State",
"state",
")",
"{",
"final",
"char",
"c",
"=",
"string",
".",
"charAt",
"(",
"index",
")",
";",
"/* Special-case: spaces are \"%20\"... | Encodes the character at the given index, and returns the resulting string. If the character does not need to
be encoded, this function returns null | [
"Encodes",
"the",
"character",
"at",
"the",
"given",
"index",
"and",
"returns",
"the",
"resulting",
"string",
".",
"If",
"the",
"character",
"does",
"not",
"need",
"to",
"be",
"encoded",
"this",
"function",
"returns",
"null"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java#L172-L203 |
weld/core | impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java | AnnotatedTypes.compareAnnotatedParameters | public static boolean compareAnnotatedParameters(AnnotatedParameter<?> p1, AnnotatedParameter<?> p2) {
"""
Compares two annotated parameters and returns true if they are equal
"""
return compareAnnotatedCallable(p1.getDeclaringCallable(), p2.getDeclaringCallable()) && p1.getPosition() == p2.getPosition... | java | public static boolean compareAnnotatedParameters(AnnotatedParameter<?> p1, AnnotatedParameter<?> p2) {
return compareAnnotatedCallable(p1.getDeclaringCallable(), p2.getDeclaringCallable()) && p1.getPosition() == p2.getPosition() && compareAnnotated(p1, p2);
} | [
"public",
"static",
"boolean",
"compareAnnotatedParameters",
"(",
"AnnotatedParameter",
"<",
"?",
">",
"p1",
",",
"AnnotatedParameter",
"<",
"?",
">",
"p2",
")",
"{",
"return",
"compareAnnotatedCallable",
"(",
"p1",
".",
"getDeclaringCallable",
"(",
")",
",",
"p... | Compares two annotated parameters and returns true if they are equal | [
"Compares",
"two",
"annotated",
"parameters",
"and",
"returns",
"true",
"if",
"they",
"are",
"equal"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/AnnotatedTypes.java#L450-L452 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/ParseUtil.java | ParseUtil.convertSet | static Selector convertSet(Selector expr, List set) {
"""
Convert a partially parsed set expression into its more primitive form as a
disjunction of equalities.
@param expr the expression whose set membership is being tested
@param set the set itself, as a FastVector containing Selector trees representing
... | java | static Selector convertSet(Selector expr, List set) {
Selector ans = null;
for (int i = 0; i < set.size(); i++) {
Selector comparand = (Selector) set.get(i);
Selector comparison = new OperatorImpl(Operator.EQ, (Selector) expr.clone(), comparand);
if (ans == null)
ans = comparison;
... | [
"static",
"Selector",
"convertSet",
"(",
"Selector",
"expr",
",",
"List",
"set",
")",
"{",
"Selector",
"ans",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"set",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Selector",
... | Convert a partially parsed set expression into its more primitive form as a
disjunction of equalities.
@param expr the expression whose set membership is being tested
@param set the set itself, as a FastVector containing Selector trees representing
expressions
@return a Selector representing the set expression its m... | [
"Convert",
"a",
"partially",
"parsed",
"set",
"expression",
"into",
"its",
"more",
"primitive",
"form",
"as",
"a",
"disjunction",
"of",
"equalities",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/ParseUtil.java#L100-L111 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.transposeTimesTimes | public static double transposeTimesTimes(final double[] v1, final double[][] m2, final double[] v3) {
"""
Matrix multiplication, v1<sup>T</sup> * m2 * v3
@param v1 vector on the left
@param m2 matrix
@param v3 vector on the right
@return Matrix product, v1<sup>T</sup> * m2 * v3
"""
final int rowdim =... | java | public static double transposeTimesTimes(final double[] v1, final double[][] m2, final double[] v3) {
final int rowdim = m2.length, coldim = getColumnDimensionality(m2);
assert rowdim == v1.length : ERR_MATRIX_INNERDIM;
assert coldim == v3.length : ERR_MATRIX_INNERDIM;
double sum = 0.0;
for(int k = ... | [
"public",
"static",
"double",
"transposeTimesTimes",
"(",
"final",
"double",
"[",
"]",
"v1",
",",
"final",
"double",
"[",
"]",
"[",
"]",
"m2",
",",
"final",
"double",
"[",
"]",
"v3",
")",
"{",
"final",
"int",
"rowdim",
"=",
"m2",
".",
"length",
",",
... | Matrix multiplication, v1<sup>T</sup> * m2 * v3
@param v1 vector on the left
@param m2 matrix
@param v3 vector on the right
@return Matrix product, v1<sup>T</sup> * m2 * v3 | [
"Matrix",
"multiplication",
"v1<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"m2",
"*",
"v3"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1405-L1419 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/Ordering.java | Ordering.appendOrdering | public Ordering appendOrdering(Integer index, Class<? extends Key<?>> type, Order order) {
"""
Extends this ordering by appending an additional order requirement.
@param index Field index of the appended order requirement.
@param type Type of the appended order requirement.
@param order Order of the appended ... | java | public Ordering appendOrdering(Integer index, Class<? extends Key<?>> type, Order order) {
if (index.intValue() < 0) {
throw new IllegalArgumentException("The key index must not be negative.");
}
if (order == null) {
throw new NullPointerException();
}
if (order == Order.NONE) {
throw new IllegalArgu... | [
"public",
"Ordering",
"appendOrdering",
"(",
"Integer",
"index",
",",
"Class",
"<",
"?",
"extends",
"Key",
"<",
"?",
">",
">",
"type",
",",
"Order",
"order",
")",
"{",
"if",
"(",
"index",
".",
"intValue",
"(",
")",
"<",
"0",
")",
"{",
"throw",
"new... | Extends this ordering by appending an additional order requirement.
@param index Field index of the appended order requirement.
@param type Type of the appended order requirement.
@param order Order of the appended order requirement.
@return This ordering with an additional appended order requirement. | [
"Extends",
"this",
"ordering",
"by",
"appending",
"an",
"additional",
"order",
"requirement",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/Ordering.java#L58-L73 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Dict.java | Dict.removeEqual | public <T extends Dict> void removeEqual(T dict, String... withoutNames) {
"""
与给定实体对比并去除相同的部分<br>
此方法用于在更新操作时避免所有字段被更新,跳过不需要更新的字段 version from 2.0.0
@param <T> 字典对象类型
@param dict 字典对象
@param withoutNames 不需要去除的字段名
"""
HashSet<String> withoutSet = CollectionUtil.newHashSet(withoutNames);
for (Map.E... | java | public <T extends Dict> void removeEqual(T dict, String... withoutNames) {
HashSet<String> withoutSet = CollectionUtil.newHashSet(withoutNames);
for (Map.Entry<String, Object> entry : dict.entrySet()) {
if (withoutSet.contains(entry.getKey())) {
continue;
}
final Object value = this.get(entry.g... | [
"public",
"<",
"T",
"extends",
"Dict",
">",
"void",
"removeEqual",
"(",
"T",
"dict",
",",
"String",
"...",
"withoutNames",
")",
"{",
"HashSet",
"<",
"String",
">",
"withoutSet",
"=",
"CollectionUtil",
".",
"newHashSet",
"(",
"withoutNames",
")",
";",
"for"... | 与给定实体对比并去除相同的部分<br>
此方法用于在更新操作时避免所有字段被更新,跳过不需要更新的字段 version from 2.0.0
@param <T> 字典对象类型
@param dict 字典对象
@param withoutNames 不需要去除的字段名 | [
"与给定实体对比并去除相同的部分<br",
">",
"此方法用于在更新操作时避免所有字段被更新,跳过不需要更新的字段",
"version",
"from",
"2",
".",
"0",
".",
"0"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Dict.java#L195-L207 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/stat/BasicFrequencyCounter.java | BasicFrequencyCounter.getCount | @Override
public long getCount(long fromWhen, long toWhen, boolean fromInclusive, boolean toInclusive) {
"""
获得在指定时间范围内的总频次.
Please not that this method is not usable if the counter was created with a zero purgePeriod.
@param fromWhen 开始时间
@param toWhen 结束时间
@param fromInclusive 是否包含开始时间
@param toInclusi... | java | @Override
public long getCount(long fromWhen, long toWhen, boolean fromInclusive, boolean toInclusive){
NavigableMap<Long, AtomicLong> range = ((NavigableMap<Long, AtomicLong>)counters.getMap()).subMap(fromWhen, fromInclusive, toWhen, toInclusive);
long count = 0;
for(AtomicLong c: range.values()){
coun... | [
"@",
"Override",
"public",
"long",
"getCount",
"(",
"long",
"fromWhen",
",",
"long",
"toWhen",
",",
"boolean",
"fromInclusive",
",",
"boolean",
"toInclusive",
")",
"{",
"NavigableMap",
"<",
"Long",
",",
"AtomicLong",
">",
"range",
"=",
"(",
"(",
"NavigableMa... | 获得在指定时间范围内的总频次.
Please not that this method is not usable if the counter was created with a zero purgePeriod.
@param fromWhen 开始时间
@param toWhen 结束时间
@param fromInclusive 是否包含开始时间
@param toInclusive 是否包含结束时间
@return 统计数 | [
"获得在指定时间范围内的总频次",
".",
"Please",
"not",
"that",
"this",
"method",
"is",
"not",
"usable",
"if",
"the",
"counter",
"was",
"created",
"with",
"a",
"zero",
"purgePeriod",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/stat/BasicFrequencyCounter.java#L151-L159 |
sdl/odata | odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java | EntityDataModelUtil.getAndCheckStructuredType | public static StructuredType getAndCheckStructuredType(EntityDataModel entityDataModel, String typeName) {
"""
Gets the OData type with a specified name and checks if the OData type is a structured type; throws an exception
if the OData type is not a structured type.
@param entityDataModel The entity data mode... | java | public static StructuredType getAndCheckStructuredType(EntityDataModel entityDataModel, String typeName) {
return checkIsStructuredType(getAndCheckType(entityDataModel, typeName));
} | [
"public",
"static",
"StructuredType",
"getAndCheckStructuredType",
"(",
"EntityDataModel",
"entityDataModel",
",",
"String",
"typeName",
")",
"{",
"return",
"checkIsStructuredType",
"(",
"getAndCheckType",
"(",
"entityDataModel",
",",
"typeName",
")",
")",
";",
"}"
] | Gets the OData type with a specified name and checks if the OData type is a structured type; throws an exception
if the OData type is not a structured type.
@param entityDataModel The entity data model.
@param typeName The type name.
@return The OData structured type with the specified name.
@throws ODataSystem... | [
"Gets",
"the",
"OData",
"type",
"with",
"a",
"specified",
"name",
"and",
"checks",
"if",
"the",
"OData",
"type",
"is",
"a",
"structured",
"type",
";",
"throws",
"an",
"exception",
"if",
"the",
"OData",
"type",
"is",
"not",
"a",
"structured",
"type",
"."
... | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L169-L171 |
juebanlin/util4j | util4j/src/main/java/net/jueb/util4j/security/AesUtil.java | AesUtil.AesDecryptByBase64Str | public static byte[] AesDecryptByBase64Str(String base64String,byte[] decryptKey) throws Exception {
"""
将base 64 code AES解密
@param encryptStr 待解密的base 64 code
@param decryptKey 解密密钥
@return 解密后的
@throws Exception
"""
byte[] content=Base64Decode(base64String);
return AesDecryptByBytes(content, decryptK... | java | public static byte[] AesDecryptByBase64Str(String base64String,byte[] decryptKey) throws Exception {
byte[] content=Base64Decode(base64String);
return AesDecryptByBytes(content, decryptKey);
} | [
"public",
"static",
"byte",
"[",
"]",
"AesDecryptByBase64Str",
"(",
"String",
"base64String",
",",
"byte",
"[",
"]",
"decryptKey",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"content",
"=",
"Base64Decode",
"(",
"base64String",
")",
";",
"return",
"Ae... | 将base 64 code AES解密
@param encryptStr 待解密的base 64 code
@param decryptKey 解密密钥
@return 解密后的
@throws Exception | [
"将base",
"64",
"code",
"AES解密"
] | train | https://github.com/juebanlin/util4j/blob/c404b2dbdedf7a8890533b351257fa8af4f1439f/util4j/src/main/java/net/jueb/util4j/security/AesUtil.java#L77-L80 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/SupportAction.java | SupportAction.doDownload | @RequirePOST
public void doDownload(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
"""
Generates a support bundle.
@param req The stapler request
@param rsp The stapler response
@throws ServletException
@throws IOException
"""
doGenerateAllBundles(req, rsp);
... | java | @RequirePOST
public void doDownload(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
doGenerateAllBundles(req, rsp);
} | [
"@",
"RequirePOST",
"public",
"void",
"doDownload",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"doGenerateAllBundles",
"(",
"req",
",",
"rsp",
")",
";",
"}"
] | Generates a support bundle.
@param req The stapler request
@param rsp The stapler response
@throws ServletException
@throws IOException | [
"Generates",
"a",
"support",
"bundle",
"."
] | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/SupportAction.java#L165-L168 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/mysql/MySQLQueryFactory.java | MySQLQueryFactory.insertOnDuplicateKeyUpdate | public SQLInsertClause insertOnDuplicateKeyUpdate(RelationalPath<?> entity, String clause) {
"""
Create a INSERT ... ON DUPLICATE KEY UPDATE clause
@param entity table to insert to
@param clause clause
@return insert clause
"""
SQLInsertClause insert = insert(entity);
insert.addFlag(Positi... | java | public SQLInsertClause insertOnDuplicateKeyUpdate(RelationalPath<?> entity, String clause) {
SQLInsertClause insert = insert(entity);
insert.addFlag(Position.END, " on duplicate key update " + clause);
return insert;
} | [
"public",
"SQLInsertClause",
"insertOnDuplicateKeyUpdate",
"(",
"RelationalPath",
"<",
"?",
">",
"entity",
",",
"String",
"clause",
")",
"{",
"SQLInsertClause",
"insert",
"=",
"insert",
"(",
"entity",
")",
";",
"insert",
".",
"addFlag",
"(",
"Position",
".",
"... | Create a INSERT ... ON DUPLICATE KEY UPDATE clause
@param entity table to insert to
@param clause clause
@return insert clause | [
"Create",
"a",
"INSERT",
"...",
"ON",
"DUPLICATE",
"KEY",
"UPDATE",
"clause"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/mysql/MySQLQueryFactory.java#L67-L71 |
ReactiveX/RxJavaGuava | src/main/java/rx/transformer/GuavaTransformers.java | GuavaTransformers.toImmutableList | public static <T> Observable.Transformer<T,ImmutableList<T>> toImmutableList() {
"""
Returns a Transformer<T,ImmutableList<T>> that maps an Observable<T> to an Observable<ImmutableList<T>>
"""
return new Observable.Transformer<T, ImmutableList<T>>() {
@Override
... | java | public static <T> Observable.Transformer<T,ImmutableList<T>> toImmutableList() {
return new Observable.Transformer<T, ImmutableList<T>>() {
@Override
public Observable<ImmutableList<T>> call(Observable<T> source) {
return source.collect(new Func0<ImmutableList.Builder<T>>... | [
"public",
"static",
"<",
"T",
">",
"Observable",
".",
"Transformer",
"<",
"T",
",",
"ImmutableList",
"<",
"T",
">",
">",
"toImmutableList",
"(",
")",
"{",
"return",
"new",
"Observable",
".",
"Transformer",
"<",
"T",
",",
"ImmutableList",
"<",
"T",
">",
... | Returns a Transformer<T,ImmutableList<T>> that maps an Observable<T> to an Observable<ImmutableList<T>> | [
"Returns",
"a",
"Transformer<",
";",
"T",
"ImmutableList<",
";",
"T>",
";",
">",
"that",
"maps",
"an",
"Observable<",
";",
"T>",
";",
"to",
"an",
"Observable<",
";",
"ImmutableList<",
";",
"T>",
";",
">",
";"
] | train | https://github.com/ReactiveX/RxJavaGuava/blob/bfb5da6e073364a96da23d57f47c6b706fb733aa/src/main/java/rx/transformer/GuavaTransformers.java#L38-L61 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ref/Finalizer.java | Finalizer.trackGC | public void trackGC(Object obj, String message) {
"""
Prints {@code message} to {@code System.out} when {@code obj} gets garbage collected
@param obj object needs to be tracked
@param message message to be printed when {@code obj} gets garbage collected.
if null, the message will be {@code obj.getClas... | java | public void trackGC(Object obj, String message){
if(message==null)
message = obj.getClass().getName()+'@'+System.identityHashCode(obj);
track(obj, new MessagePrinter(message));
} | [
"public",
"void",
"trackGC",
"(",
"Object",
"obj",
",",
"String",
"message",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"message",
"=",
"obj",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"'",
"'",
"+",
"System",
".",
"identity... | Prints {@code message} to {@code System.out} when {@code obj} gets garbage collected
@param obj object needs to be tracked
@param message message to be printed when {@code obj} gets garbage collected.
if null, the message will be {@code obj.getClass().getName()+'@'+System.identityHashCode(obj)} | [
"Prints",
"{",
"@code",
"message",
"}",
"to",
"{",
"@code",
"System",
".",
"out",
"}",
"when",
"{",
"@code",
"obj",
"}",
"gets",
"garbage",
"collected"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ref/Finalizer.java#L164-L168 |
structurizr/java | structurizr-core/src/com/structurizr/model/ModelItem.java | ModelItem.addProperty | public void addProperty(String name, String value) {
"""
Adds a name-value pair property to this element.
@param name the name of the property
@param value the value of the property
"""
if (name == null || name.trim().length() == 0) {
throw new IllegalArgumentException("A prope... | java | public void addProperty(String name, String value) {
if (name == null || name.trim().length() == 0) {
throw new IllegalArgumentException("A property name must be specified.");
}
if (value == null || value.trim().length() == 0) {
throw new IllegalArgumentException("A prop... | [
"public",
"void",
"addProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Adds a name-value pair property to this element.
@param name the name of the property
@param value the value of the property | [
"Adds",
"a",
"name",
"-",
"value",
"pair",
"property",
"to",
"this",
"element",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/ModelItem.java#L111-L121 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java | ContainerGroupsInner.beginRestartAsync | public Observable<Void> beginRestartAsync(String resourceGroupName, String containerGroupName) {
"""
Restarts all containers in a container group.
Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.
@param resourceGroupName The name of the resour... | java | public Observable<Void> beginRestartAsync(String resourceGroupName, String containerGroupName) {
return beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"beginRestartAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
")",
"{",
"return",
"beginRestartWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerGroupName",
")",
".",
"map",
"(",... | Restarts all containers in a container group.
Restarts all containers in a container group in place. If container image has updates, new image will be downloaded.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@throws IllegalArgumentException thrown ... | [
"Restarts",
"all",
"containers",
"in",
"a",
"container",
"group",
".",
"Restarts",
"all",
"containers",
"in",
"a",
"container",
"group",
"in",
"place",
".",
"If",
"container",
"image",
"has",
"updates",
"new",
"image",
"will",
"be",
"downloaded",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainerGroupsInner.java#L920-L927 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml5Xml | public static void escapeHtml5Xml(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform an HTML5 level 1 (XML-style) <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only es... | java | public static void escapeHtml5Xml(final Reader reader, final Writer writer)
throws IOException {
escapeHtml(reader, writer, HtmlEscapeType.HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT);
} | [
"public",
"static",
"void",
"escapeHtml5Xml",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeHtml",
"(",
"reader",
",",
"writer",
",",
"HtmlEscapeType",
".",
"HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL",
... | <p>
Perform an HTML5 level 1 (XML-style) <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only escape the five markup-significant characters:
<tt><</tt>, <tt>></tt>, <tt>&</tt>, <tt>"</tt> and <tt>'</t... | [
"<p",
">",
"Perform",
"an",
"HTML5",
"level",
"1",
"(",
"XML",
"-",
"style",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"W... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L681-L685 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java | ResourceUtil.isChildOf | public static boolean isChildOf(Resource file, Resource dir) {
"""
check if file is a child of given directory
@param file file to search
@param dir directory to search
@return is inside or not
"""
while (file != null) {
if (file.equals(dir)) return true;
file = file.getParentResource();
}
re... | java | public static boolean isChildOf(Resource file, Resource dir) {
while (file != null) {
if (file.equals(dir)) return true;
file = file.getParentResource();
}
return false;
} | [
"public",
"static",
"boolean",
"isChildOf",
"(",
"Resource",
"file",
",",
"Resource",
"dir",
")",
"{",
"while",
"(",
"file",
"!=",
"null",
")",
"{",
"if",
"(",
"file",
".",
"equals",
"(",
"dir",
")",
")",
"return",
"true",
";",
"file",
"=",
"file",
... | check if file is a child of given directory
@param file file to search
@param dir directory to search
@return is inside or not | [
"check",
"if",
"file",
"is",
"a",
"child",
"of",
"given",
"directory"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java#L805-L811 |
nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapConsumer.java | SourceMapConsumer._findMapping | <T> int _findMapping(T aNeedle, List<T> aMappings, Object aLineName, Object aColumnName, BinarySearch.Comparator<T> aComparator,
BinarySearch.Bias aBias) {
"""
Find the mapping that best matches the hypothetical "needle" mapping that we are searching for in the given "haystack" of mappings.
"""
... | java | <T> int _findMapping(T aNeedle, List<T> aMappings, Object aLineName, Object aColumnName, BinarySearch.Comparator<T> aComparator,
BinarySearch.Bias aBias) {
// To return the position we are searching for, we must first find the
// mapping for the given position and then return the opposite po... | [
"<",
"T",
">",
"int",
"_findMapping",
"(",
"T",
"aNeedle",
",",
"List",
"<",
"T",
">",
"aMappings",
",",
"Object",
"aLineName",
",",
"Object",
"aColumnName",
",",
"BinarySearch",
".",
"Comparator",
"<",
"T",
">",
"aComparator",
",",
"BinarySearch",
".",
... | Find the mapping that best matches the hypothetical "needle" mapping that we are searching for in the given "haystack" of mappings. | [
"Find",
"the",
"mapping",
"that",
"best",
"matches",
"the",
"hypothetical",
"needle",
"mapping",
"that",
"we",
"are",
"searching",
"for",
"in",
"the",
"given",
"haystack",
"of",
"mappings",
"."
] | train | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapConsumer.java#L299-L314 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/V1Instance.java | V1Instance.executeOperation | Oid executeOperation(Entity subject, String operationName)
throws UnsupportedOperationException {
"""
Be sure to call Entity.Save() before or after calling this depending on
the operation result.
@param subject asset will be found for.
@param operationName operator name.
@return object iden... | java | Oid executeOperation(Entity subject, String operationName)
throws UnsupportedOperationException {
Asset asset = getAsset(subject);
return executeOperation(asset, operationName);
} | [
"Oid",
"executeOperation",
"(",
"Entity",
"subject",
",",
"String",
"operationName",
")",
"throws",
"UnsupportedOperationException",
"{",
"Asset",
"asset",
"=",
"getAsset",
"(",
"subject",
")",
";",
"return",
"executeOperation",
"(",
"asset",
",",
"operationName",
... | Be sure to call Entity.Save() before or after calling this depending on
the operation result.
@param subject asset will be found for.
@param operationName operator name.
@return object identifier.
@throws UnsupportedOperationException in case invalid state for the
Operation. | [
"Be",
"sure",
"to",
"call",
"Entity",
".",
"Save",
"()",
"before",
"or",
"after",
"calling",
"this",
"depending",
"on",
"the",
"operation",
"result",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/V1Instance.java#L504-L509 |
mapsforge/mapsforge | mapsforge-poi/src/main/java/org/mapsforge/poi/storage/AbstractPoiPersistenceManager.java | AbstractPoiPersistenceManager.getSQLSelectString | protected static String getSQLSelectString(PoiCategoryFilter filter, int count, int version) {
"""
Gets the SQL query that looks up POI entries.
@param filter The filter object for determining all wanted categories (may be null).
@param count Count of patterns to search in points of interest data (may be 0)... | java | protected static String getSQLSelectString(PoiCategoryFilter filter, int count, int version) {
if (filter != null) {
return PoiCategoryRangeQueryGenerator.getSQLSelectString(filter, count, version);
}
StringBuilder sb = new StringBuilder();
sb.append(DbConstants.FIND_IN_BOX_C... | [
"protected",
"static",
"String",
"getSQLSelectString",
"(",
"PoiCategoryFilter",
"filter",
",",
"int",
"count",
",",
"int",
"version",
")",
"{",
"if",
"(",
"filter",
"!=",
"null",
")",
"{",
"return",
"PoiCategoryRangeQueryGenerator",
".",
"getSQLSelectString",
"("... | Gets the SQL query that looks up POI entries.
@param filter The filter object for determining all wanted categories (may be null).
@param count Count of patterns to search in points of interest data (may be 0).
@param version POI specification version.
@return The SQL query. | [
"Gets",
"the",
"SQL",
"query",
"that",
"looks",
"up",
"POI",
"entries",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-poi/src/main/java/org/mapsforge/poi/storage/AbstractPoiPersistenceManager.java#L97-L111 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByCountry | public Iterable<DUser> queryByCountry(java.lang.String country) {
"""
query-by method for field country
@param country the specified attribute
@return an Iterable of DUsers for the specified country
"""
return queryByField(null, DUserMapper.Field.COUNTRY.getFieldName(), country);
} | java | public Iterable<DUser> queryByCountry(java.lang.String country) {
return queryByField(null, DUserMapper.Field.COUNTRY.getFieldName(), country);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByCountry",
"(",
"java",
".",
"lang",
".",
"String",
"country",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"COUNTRY",
".",
"getFieldName",
"(",
")",
",",
"country",... | query-by method for field country
@param country the specified attribute
@return an Iterable of DUsers for the specified country | [
"query",
"-",
"by",
"method",
"for",
"field",
"country"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L106-L108 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/servlet/JawrRequestHandler.java | JawrRequestHandler.initResourceReaderHandler | protected ResourceReaderHandler initResourceReaderHandler() {
"""
Initialize the resource reader handler
@return the resource reader handler
"""
ResourceReaderHandler rsHandler = null;
if (servletContext != null) {
try {
rsHandler = new ServletContextResourceReaderHandler(servletContext, jawrConf... | java | protected ResourceReaderHandler initResourceReaderHandler() {
ResourceReaderHandler rsHandler = null;
if (servletContext != null) {
try {
rsHandler = new ServletContextResourceReaderHandler(servletContext, jawrConfig, generatorRegistry);
} catch (IOException e) {
throw new BundlingProcessException(e);... | [
"protected",
"ResourceReaderHandler",
"initResourceReaderHandler",
"(",
")",
"{",
"ResourceReaderHandler",
"rsHandler",
"=",
"null",
";",
"if",
"(",
"servletContext",
"!=",
"null",
")",
"{",
"try",
"{",
"rsHandler",
"=",
"new",
"ServletContextResourceReaderHandler",
"... | Initialize the resource reader handler
@return the resource reader handler | [
"Initialize",
"the",
"resource",
"reader",
"handler"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/servlet/JawrRequestHandler.java#L582-L593 |
JohnPersano/SuperToasts | library/src/main/java/com/github/johnpersano/supertoasts/library/utils/ListenerUtils.java | ListenerUtils.putListener | public ListenerUtils putListener(String tag, SuperToast.OnDismissListener onDismissListener) {
"""
Add either an {@link SuperToast.OnDismissListener}
or a {@link SuperActivityToast.OnButtonClickListener}
to a stored HashMap along with a String tag. This is used to reattach listeners to a
{@link SuperActivityToa... | java | public ListenerUtils putListener(String tag, SuperToast.OnDismissListener onDismissListener) {
this.mOnDismissListenerHashMap.put(tag, onDismissListener);
return this;
} | [
"public",
"ListenerUtils",
"putListener",
"(",
"String",
"tag",
",",
"SuperToast",
".",
"OnDismissListener",
"onDismissListener",
")",
"{",
"this",
".",
"mOnDismissListenerHashMap",
".",
"put",
"(",
"tag",
",",
"onDismissListener",
")",
";",
"return",
"this",
";",... | Add either an {@link SuperToast.OnDismissListener}
or a {@link SuperActivityToast.OnButtonClickListener}
to a stored HashMap along with a String tag. This is used to reattach listeners to a
{@link SuperActivityToast} when recreated from an
orientation change.
@param tag A unique tag for the listener
@param onDismissLi... | [
"Add",
"either",
"an",
"{",
"@link",
"SuperToast",
".",
"OnDismissListener",
"}",
"or",
"a",
"{",
"@link",
"SuperActivityToast",
".",
"OnButtonClickListener",
"}",
"to",
"a",
"stored",
"HashMap",
"along",
"with",
"a",
"String",
"tag",
".",
"This",
"is",
"use... | train | https://github.com/JohnPersano/SuperToasts/blob/5394db6a2f5c38410586d5d001d61f731da1132a/library/src/main/java/com/github/johnpersano/supertoasts/library/utils/ListenerUtils.java#L55-L58 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.enableRequestResponseLogging | public void enableRequestResponseLogging(Level level, int maxEntitySize, List<String> maskedHeaderNames) {
"""
Enable the logging of the requests to and the responses from the GitLab server API using the
GitLab4J shared Logger instance.
@param level the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER... | java | public void enableRequestResponseLogging(Level level, int maxEntitySize, List<String> maskedHeaderNames) {
apiClient.enableRequestResponseLogging(LOGGER, level, maxEntitySize, maskedHeaderNames);
} | [
"public",
"void",
"enableRequestResponseLogging",
"(",
"Level",
"level",
",",
"int",
"maxEntitySize",
",",
"List",
"<",
"String",
">",
"maskedHeaderNames",
")",
"{",
"apiClient",
".",
"enableRequestResponseLogging",
"(",
"LOGGER",
",",
"level",
",",
"maxEntitySize",... | Enable the logging of the requests to and the responses from the GitLab server API using the
GitLab4J shared Logger instance.
@param level the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
@param maxEntitySize maximum number of entity bytes to be logged. When logging if the maxEntitySize
is reach... | [
"Enable",
"the",
"logging",
"of",
"the",
"requests",
"to",
"and",
"the",
"responses",
"from",
"the",
"GitLab",
"server",
"API",
"using",
"the",
"GitLab4J",
"shared",
"Logger",
"instance",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L704-L706 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageContentHelper.java | PageContentHelper.addHeadlines | public static void addHeadlines(final PrintWriter writer, final List headlines) {
"""
Add a list of html headline entries intended to be added only once to the page.
@param writer the writer to write to.
@param headlines a list of html entries to be added to the page as a whole.
"""
if (headlines == null... | java | public static void addHeadlines(final PrintWriter writer, final List headlines) {
if (headlines == null || headlines.isEmpty()) {
return;
}
writer.write("\n<!-- Start general headlines -->");
Iterator iter = headlines.iterator();
while (iter.hasNext()) {
String line = (String) iter.next();
writer.w... | [
"public",
"static",
"void",
"addHeadlines",
"(",
"final",
"PrintWriter",
"writer",
",",
"final",
"List",
"headlines",
")",
"{",
"if",
"(",
"headlines",
"==",
"null",
"||",
"headlines",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"writer",
"."... | Add a list of html headline entries intended to be added only once to the page.
@param writer the writer to write to.
@param headlines a list of html entries to be added to the page as a whole. | [
"Add",
"a",
"list",
"of",
"html",
"headline",
"entries",
"intended",
"to",
"be",
"added",
"only",
"once",
"to",
"the",
"page",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageContentHelper.java#L45-L59 |
alkacon/opencms-core | src/org/opencms/loader/CmsImageScaler.java | CmsImageScaler.calculateClosest | private int calculateClosest(float base, float[] others) {
"""
Calculate the closest match of the given base float with the list of others.<p>
@param base the base float to compare the other with
@param others the list of floats to compate to the base
@return the array index of the closest match
"""
... | java | private int calculateClosest(float base, float[] others) {
int result = -1;
float bestMatch = Float.MAX_VALUE;
for (int count = 0; count < others.length; count++) {
float difference = Math.abs(base - others[count]);
if (difference < bestMatch) {
// new be... | [
"private",
"int",
"calculateClosest",
"(",
"float",
"base",
",",
"float",
"[",
"]",
"others",
")",
"{",
"int",
"result",
"=",
"-",
"1",
";",
"float",
"bestMatch",
"=",
"Float",
".",
"MAX_VALUE",
";",
"for",
"(",
"int",
"count",
"=",
"0",
";",
"count"... | Calculate the closest match of the given base float with the list of others.<p>
@param base the base float to compare the other with
@param others the list of floats to compate to the base
@return the array index of the closest match | [
"Calculate",
"the",
"closest",
"match",
"of",
"the",
"given",
"base",
"float",
"with",
"the",
"list",
"of",
"others",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsImageScaler.java#L1602-L1619 |
eserating/siren4j | src/main/java/com/google/code/siren4j/component/builder/EntityBuilder.java | EntityBuilder.addProperties | public EntityBuilder addProperties(Map<String, Object> properties) {
"""
Adds a map of properties to the entity to be built.
Properties are optional according to the Siren specification.
@param properties cannot be <code>null</code>.
@return <code>this</code> builder, never <code>null</code>.
"""
if(M... | java | public EntityBuilder addProperties(Map<String, Object> properties) {
if(MapUtils.isEmpty(properties)) {
throw new IllegalArgumentException("properties cannot be null or empty.");
}
for (String key : properties.keySet()) {
addProperty(key, properties.get(key));
}
... | [
"public",
"EntityBuilder",
"addProperties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"MapUtils",
".",
"isEmpty",
"(",
"properties",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"properties cannot be n... | Adds a map of properties to the entity to be built.
Properties are optional according to the Siren specification.
@param properties cannot be <code>null</code>.
@return <code>this</code> builder, never <code>null</code>. | [
"Adds",
"a",
"map",
"of",
"properties",
"to",
"the",
"entity",
"to",
"be",
"built",
".",
"Properties",
"are",
"optional",
"according",
"to",
"the",
"Siren",
"specification",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/component/builder/EntityBuilder.java#L175-L183 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.tracef | public void tracef(String format, Object... params) {
"""
Issue a formatted log message with a level of TRACE.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param params the parameters
"""
doLogf(Level.TRACE, FQCN, format, params, n... | java | public void tracef(String format, Object... params) {
doLogf(Level.TRACE, FQCN, format, params, null);
} | [
"public",
"void",
"tracef",
"(",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLogf",
"(",
"Level",
".",
"TRACE",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"null",
")",
";",
"}"
] | Issue a formatted log message with a level of TRACE.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param params the parameters | [
"Issue",
"a",
"formatted",
"log",
"message",
"with",
"a",
"level",
"of",
"TRACE",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L276-L278 |
ben-manes/caffeine | simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/product/OhcPolicy.java | OhcPolicy.policies | public static Set<Policy> policies(Config config) {
"""
Returns all variations of this policy based on the configuration parameters.
"""
OhcSettings settings = new OhcSettings(config);
return settings.policy().stream()
.map(policy -> new OhcPolicy(settings, policy))
.collect(toSet());
... | java | public static Set<Policy> policies(Config config) {
OhcSettings settings = new OhcSettings(config);
return settings.policy().stream()
.map(policy -> new OhcPolicy(settings, policy))
.collect(toSet());
} | [
"public",
"static",
"Set",
"<",
"Policy",
">",
"policies",
"(",
"Config",
"config",
")",
"{",
"OhcSettings",
"settings",
"=",
"new",
"OhcSettings",
"(",
"config",
")",
";",
"return",
"settings",
".",
"policy",
"(",
")",
".",
"stream",
"(",
")",
".",
"m... | Returns all variations of this policy based on the configuration parameters. | [
"Returns",
"all",
"variations",
"of",
"this",
"policy",
"based",
"on",
"the",
"configuration",
"parameters",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/product/OhcPolicy.java#L62-L67 |
gallandarakhneorg/afc | advanced/gis/giscorefx/src/main/java/org/arakhne/afc/gis/ui/drawers/AbstractMapPointDrawer.java | AbstractMapPointDrawer.defineSmallRectangle | protected void defineSmallRectangle(ZoomableGraphicsContext gc, T element) {
"""
Define a path that corresponds to the small rectangle around a point.
@param gc the graphics context that must be used for drawing.
@param element the map element.
"""
final double ptsSize = element.getPointSize() / 2.;
fi... | java | protected void defineSmallRectangle(ZoomableGraphicsContext gc, T element) {
final double ptsSize = element.getPointSize() / 2.;
final double x = element.getX() - ptsSize;
final double y = element.getY() - ptsSize;
final double mx = element.getX() + ptsSize;
final double my = element.getY() + ptsSize;
gc.mo... | [
"protected",
"void",
"defineSmallRectangle",
"(",
"ZoomableGraphicsContext",
"gc",
",",
"T",
"element",
")",
"{",
"final",
"double",
"ptsSize",
"=",
"element",
".",
"getPointSize",
"(",
")",
"/",
"2.",
";",
"final",
"double",
"x",
"=",
"element",
".",
"getX"... | Define a path that corresponds to the small rectangle around a point.
@param gc the graphics context that must be used for drawing.
@param element the map element. | [
"Define",
"a",
"path",
"that",
"corresponds",
"to",
"the",
"small",
"rectangle",
"around",
"a",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscorefx/src/main/java/org/arakhne/afc/gis/ui/drawers/AbstractMapPointDrawer.java#L42-L53 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/stax/StAXUtils.java | StAXUtils.getXMLStreamWriter | public static XMLStreamWriter getXMLStreamWriter(XMLOutputFactory factory, Result result) throws XMLStreamException {
"""
Extract or create an instance of {@link XMLStreamWriter} from the provided {@link Result}.
@param factory the {@link XMLOutputFactory} to use (if needed)
@param result the result
@return t... | java | public static XMLStreamWriter getXMLStreamWriter(XMLOutputFactory factory, Result result) throws XMLStreamException
{
XMLStreamWriter xmlStreamWriter;
if (result instanceof SAXResult) {
// SAXResult is not supported by the standard XMLOutputFactory
xmlStreamWriter =
... | [
"public",
"static",
"XMLStreamWriter",
"getXMLStreamWriter",
"(",
"XMLOutputFactory",
"factory",
",",
"Result",
"result",
")",
"throws",
"XMLStreamException",
"{",
"XMLStreamWriter",
"xmlStreamWriter",
";",
"if",
"(",
"result",
"instanceof",
"SAXResult",
")",
"{",
"//... | Extract or create an instance of {@link XMLStreamWriter} from the provided {@link Result}.
@param factory the {@link XMLOutputFactory} to use (if needed)
@param result the result
@return the {@link XMLStreamWriter}
@throws XMLStreamException when failing to extract xml stream writer
@since 9.5.2
@since 9.6RC1 | [
"Extract",
"or",
"create",
"an",
"instance",
"of",
"{",
"@link",
"XMLStreamWriter",
"}",
"from",
"the",
"provided",
"{",
"@link",
"Result",
"}",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/stax/StAXUtils.java#L159-L180 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/document/RtfDocument.java | RtfDocument.subMatch | private static boolean subMatch(final String str, int soff, final byte[] m) {
"""
Returns <code>true</code> if <tt>m.length</tt> characters in <tt>str</tt>, starting at offset <tt>soff</tt>
match the bytes in the given array <tt>m</tt>.
@param str the string to search for a match
@param soff the starting offs... | java | private static boolean subMatch(final String str, int soff, final byte[] m)
{
for(int k = 0; k < m.length; k++) {
if(str.charAt(soff++) != m[k]) {
return false;
}
}
return true;
} | [
"private",
"static",
"boolean",
"subMatch",
"(",
"final",
"String",
"str",
",",
"int",
"soff",
",",
"final",
"byte",
"[",
"]",
"m",
")",
"{",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<",
"m",
".",
"length",
";",
"k",
"++",
")",
"{",
"if",
... | Returns <code>true</code> if <tt>m.length</tt> characters in <tt>str</tt>, starting at offset <tt>soff</tt>
match the bytes in the given array <tt>m</tt>.
@param str the string to search for a match
@param soff the starting offset in str
@param m the array to match
@return <code>true</code> if there is match | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"<tt",
">",
"m",
".",
"length<",
"/",
"tt",
">",
"characters",
"in",
"<tt",
">",
"str<",
"/",
"tt",
">",
"starting",
"at",
"offset",
"<tt",
">",
"soff<",
"/",
"tt",
">",
"match",
"the",
"b... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/document/RtfDocument.java#L314-L322 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/TextCharacter.java | TextCharacter.withModifier | public TextCharacter withModifier(SGR modifier) {
"""
Returns a copy of this TextCharacter with an additional SGR modifier. All of the currently active SGR codes
will be carried over to the copy, in addition to the one specified.
@param modifier SGR modifiers the copy should have in additional to all currently p... | java | public TextCharacter withModifier(SGR modifier) {
if(modifiers.contains(modifier)) {
return this;
}
EnumSet<SGR> newSet = EnumSet.copyOf(this.modifiers);
newSet.add(modifier);
return new TextCharacter(character, foregroundColor, backgroundColor, newSet);
} | [
"public",
"TextCharacter",
"withModifier",
"(",
"SGR",
"modifier",
")",
"{",
"if",
"(",
"modifiers",
".",
"contains",
"(",
"modifier",
")",
")",
"{",
"return",
"this",
";",
"}",
"EnumSet",
"<",
"SGR",
">",
"newSet",
"=",
"EnumSet",
".",
"copyOf",
"(",
... | Returns a copy of this TextCharacter with an additional SGR modifier. All of the currently active SGR codes
will be carried over to the copy, in addition to the one specified.
@param modifier SGR modifiers the copy should have in additional to all currently present
@return Copy of the TextCharacter with a new SGR modif... | [
"Returns",
"a",
"copy",
"of",
"this",
"TextCharacter",
"with",
"an",
"additional",
"SGR",
"modifier",
".",
"All",
"of",
"the",
"currently",
"active",
"SGR",
"codes",
"will",
"be",
"carried",
"over",
"to",
"the",
"copy",
"in",
"addition",
"to",
"the",
"one"... | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/TextCharacter.java#L264-L271 |
line/armeria | examples/grpc-service/src/main/java/example/armeria/grpc/HelloServiceImpl.java | HelloServiceImpl.blockingHello | @Override
public void blockingHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
"""
Sends a {@link HelloReply} using {@code blockingTaskExecutor}.
@see <a href="https://line.github.io/armeria/server-grpc.html#blocking-service-implementation">Blocking
service implementation</a>
... | java | @Override
public void blockingHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
// Unlike upstream gRPC-Java, Armeria does not run service logic in a separate thread pool by default.
// Therefore, this method will run in the event loop, which means that you can suffer the pe... | [
"@",
"Override",
"public",
"void",
"blockingHello",
"(",
"HelloRequest",
"request",
",",
"StreamObserver",
"<",
"HelloReply",
">",
"responseObserver",
")",
"{",
"// Unlike upstream gRPC-Java, Armeria does not run service logic in a separate thread pool by default.",
"// Therefore, ... | Sends a {@link HelloReply} using {@code blockingTaskExecutor}.
@see <a href="https://line.github.io/armeria/server-grpc.html#blocking-service-implementation">Blocking
service implementation</a> | [
"Sends",
"a",
"{",
"@link",
"HelloReply",
"}",
"using",
"{",
"@code",
"blockingTaskExecutor",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/examples/grpc-service/src/main/java/example/armeria/grpc/HelloServiceImpl.java#L46-L68 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java | DomainsInner.listSharedAccessKeys | public DomainSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String domainName) {
"""
List keys for a domain.
List the two keys used to publish to a domain.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@throw... | java | public DomainSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String domainName) {
return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body();
} | [
"public",
"DomainSharedAccessKeysInner",
"listSharedAccessKeys",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
")",
"{",
"return",
"listSharedAccessKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainName",
")",
".",
"toBlocking",
"(",
")... | List keys for a domain.
List the two keys used to publish to a domain.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is r... | [
"List",
"keys",
"for",
"a",
"domain",
".",
"List",
"the",
"two",
"keys",
"used",
"to",
"publish",
"to",
"a",
"domain",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L1072-L1074 |
forge/core | parser-java/impl/src/main/java/org/jboss/forge/addon/parser/java/ui/methods/JavaNewMethodCommandImpl.java | JavaNewMethodCommandImpl.inspectSuperClasses | private MethodSource<JavaClassSource> inspectSuperClasses(UIExecutionContext context, final String type,
String name,
String[] paramTypes) {
"""
/*
Recursively scans the super class hierarchy to find already existing methods with similar signatures in super
classes. If an existing method ... | java | private MethodSource<JavaClassSource> inspectSuperClasses(UIExecutionContext context, final String type,
String name,
String[] paramTypes)
{
Project project = getSelectedProject(context);
JavaSource<?> clazz = sourceForName(project, type);
if (clazz instanceof JavaClass)
... | [
"private",
"MethodSource",
"<",
"JavaClassSource",
">",
"inspectSuperClasses",
"(",
"UIExecutionContext",
"context",
",",
"final",
"String",
"type",
",",
"String",
"name",
",",
"String",
"[",
"]",
"paramTypes",
")",
"{",
"Project",
"project",
"=",
"getSelectedProj... | /*
Recursively scans the super class hierarchy to find already existing methods with similar signatures in super
classes. If an existing method with similar signature is found in super classes returns
MethodSource<JavaClassSource> object corresponding to that method. Otherwise null is returned. | [
"/",
"*",
"Recursively",
"scans",
"the",
"super",
"class",
"hierarchy",
"to",
"find",
"already",
"existing",
"methods",
"with",
"similar",
"signatures",
"in",
"super",
"classes",
".",
"If",
"an",
"existing",
"method",
"with",
"similar",
"signature",
"is",
"fou... | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/parser-java/impl/src/main/java/org/jboss/forge/addon/parser/java/ui/methods/JavaNewMethodCommandImpl.java#L206-L231 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.updateApiKey | public JSONObject updateApiKey(String key, JSONObject params, RequestOptions requestOptions) throws AlgoliaException {
"""
Update a new api key
@param params the list of parameters for this key. Defined by a JSONObject that
can contains the following values:
- acl: array of string
- indices: array of... | java | public JSONObject updateApiKey(String key, JSONObject params, RequestOptions requestOptions) throws AlgoliaException {
return client.putRequest("/1/indexes/" + encodedIndexName + "/keys/" + key, params.toString(), requestOptions);
} | [
"public",
"JSONObject",
"updateApiKey",
"(",
"String",
"key",
",",
"JSONObject",
"params",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"return",
"client",
".",
"putRequest",
"(",
"\"/1/indexes/\"",
"+",
"encodedIndexName",
"+",
"... | Update a new api key
@param params the list of parameters for this key. Defined by a JSONObject that
can contains the following values:
- acl: array of string
- indices: array of string
- validity: int
- referers: array of string
- description: string
- maxHitsPerQuery: integer
- queryParameters: string
- maxQ... | [
"Update",
"a",
"new",
"api",
"key"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1135-L1137 |
lucee/Lucee | core/src/main/java/lucee/commons/collection/concurrent/ConcurrentLinkedHashMapPro.java | ConcurrentLinkedHashMapPro.put | @Override
public V put(K key, V value) {
"""
Maps the specified key to the specified value in this table. Neither the key nor the value can be
null.
<p>
The value can be retrieved by calling the <tt>get</tt> method with a key that is equal to the
original key.
@param key key with which the specified v... | java | @Override
public V put(K key, V value) {
HashEntry<K, V> evictEntry = (HashEntry<K, V>) evictionPolicy.evictElement(header);
if (evictEntry != null && size() >= maxSize) segmentFor(evictEntry.hash).remove(evictEntry.key, evictEntry.hash, evictEntry.value, header, null);
int hash = hash(key);
return segmentFor... | [
"@",
"Override",
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"HashEntry",
"<",
"K",
",",
"V",
">",
"evictEntry",
"=",
"(",
"HashEntry",
"<",
"K",
",",
"V",
">",
")",
"evictionPolicy",
".",
"evictElement",
"(",
"header",
")",... | Maps the specified key to the specified value in this table. Neither the key nor the value can be
null.
<p>
The value can be retrieved by calling the <tt>get</tt> method with a key that is equal to the
original key.
@param key key with which the specified value is to be associated
@param value value to be associated ... | [
"Maps",
"the",
"specified",
"key",
"to",
"the",
"specified",
"value",
"in",
"this",
"table",
".",
"Neither",
"the",
"key",
"nor",
"the",
"value",
"can",
"be",
"null",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/collection/concurrent/ConcurrentLinkedHashMapPro.java#L1132-L1140 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.addHeader | @Deprecated
public static void addHeader(HttpMessage message, String name, Object value) {
"""
@deprecated Use {@link #add(CharSequence, Object)} instead.
@see #addHeader(HttpMessage, CharSequence, Object)
"""
message.headers().add(name, value);
} | java | @Deprecated
public static void addHeader(HttpMessage message, String name, Object value) {
message.headers().add(name, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"addHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"add",
"(",
"name",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #add(CharSequence, Object)} instead.
@see #addHeader(HttpMessage, CharSequence, Object) | [
"@deprecated",
"Use",
"{",
"@link",
"#add",
"(",
"CharSequence",
"Object",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L655-L658 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.