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 |
|---|---|---|---|---|---|---|---|---|---|---|
matthewhorridge/mdock | src/main/java/org/coode/mdock/SplitterNode.java | SplitterNode.insertNodeBefore | public void insertNodeBefore(Node insert, Node before, int direction) {
"""
Inserts a node before (left of or top of) a given node by splitting the inserted
node with the given node.
@param insert The node to be inserted
@param before The node that the inserted node will be split with.
@param direction T... | java | public void insertNodeBefore(Node insert, Node before, int direction) {
if (isSplitterDirection(direction)) {
double split = getSplit(before) / 2;
setSplit(before, split);
addChild(insert, children.indexOf(before), split);
}
else {
pushDown(before,... | [
"public",
"void",
"insertNodeBefore",
"(",
"Node",
"insert",
",",
"Node",
"before",
",",
"int",
"direction",
")",
"{",
"if",
"(",
"isSplitterDirection",
"(",
"direction",
")",
")",
"{",
"double",
"split",
"=",
"getSplit",
"(",
"before",
")",
"/",
"2",
";... | Inserts a node before (left of or top of) a given node by splitting the inserted
node with the given node.
@param insert The node to be inserted
@param before The node that the inserted node will be split with.
@param direction The direction of the split | [
"Inserts",
"a",
"node",
"before",
"(",
"left",
"of",
"or",
"top",
"of",
")",
"a",
"given",
"node",
"by",
"splitting",
"the",
"inserted",
"node",
"with",
"the",
"given",
"node",
"."
] | train | https://github.com/matthewhorridge/mdock/blob/37839a56f30bdb73d56d82c4d1afe548d66b404b/src/main/java/org/coode/mdock/SplitterNode.java#L252-L262 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java | SocketGroovyMethods.withObjectStreams | public static <T> T withObjectStreams(Socket socket, @ClosureParams(value=SimpleType.class, options= {
"""
Creates an InputObjectStream and an OutputObjectStream from a Socket, and
passes them to the closure. The streams will be closed after the closure
returns, even if an exception is thrown.
@param socket ... | java | public static <T> T withObjectStreams(Socket socket, @ClosureParams(value=SimpleType.class, options={"java.io.ObjectInputStream","java.io.ObjectOutputStream"}) Closure<T> closure) throws IOException {
InputStream input = socket.getInputStream();
OutputStream output = socket.getOutputStream();
Ob... | [
"public",
"static",
"<",
"T",
">",
"T",
"withObjectStreams",
"(",
"Socket",
"socket",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"{",
"\"java.io.ObjectInputStream\"",
",",
"\"java.io.ObjectOutputStream\"",
"}",
... | Creates an InputObjectStream and an OutputObjectStream from a Socket, and
passes them to the closure. The streams will be closed after the closure
returns, even if an exception is thrown.
@param socket this Socket
@param closure a Closure
@return the value returned by the closure
@throws IOException if an IOExceptio... | [
"Creates",
"an",
"InputObjectStream",
"and",
"an",
"OutputObjectStream",
"from",
"a",
"Socket",
"and",
"passes",
"them",
"to",
"the",
"closure",
".",
"The",
"streams",
"will",
"be",
"closed",
"after",
"the",
"closure",
"returns",
"even",
"if",
"an",
"exception... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/SocketGroovyMethods.java#L92-L120 |
waldheinz/fat32-lib | src/main/java/de/waldheinz/fs/fat/ClusterChain.java | ClusterChain.writeData | public void writeData(long offset, ByteBuffer srcBuf) throws IOException {
"""
Writes data to this cluster chain, possibly growing the chain so it
can store the additional data. When this method returns without throwing
an exception, the buffer's {@link ByteBuffer#position() position} will
equal it's {@link Byt... | java | public void writeData(long offset, ByteBuffer srcBuf) throws IOException {
int len = srcBuf.remaining();
if (len == 0) return;
final long minSize = offset + len;
if (getLengthOnDisk() < minSize) {
setSize(minSize);
}
final long[] chain = fa... | [
"public",
"void",
"writeData",
"(",
"long",
"offset",
",",
"ByteBuffer",
"srcBuf",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"srcBuf",
".",
"remaining",
"(",
")",
";",
"if",
"(",
"len",
"==",
"0",
")",
"return",
";",
"final",
"long",
"minSi... | Writes data to this cluster chain, possibly growing the chain so it
can store the additional data. When this method returns without throwing
an exception, the buffer's {@link ByteBuffer#position() position} will
equal it's {@link ByteBuffer#limit() limit}, and the limit will not
have changed. This is not guaranteed if ... | [
"Writes",
"data",
"to",
"this",
"cluster",
"chain",
"possibly",
"growing",
"the",
"chain",
"so",
"it",
"can",
"store",
"the",
"additional",
"data",
".",
"When",
"this",
"method",
"returns",
"without",
"throwing",
"an",
"exception",
"the",
"buffer",
"s",
"{",... | train | https://github.com/waldheinz/fat32-lib/blob/3d8f1a986339573576e02eb0b6ea49bfdc9cce26/src/main/java/de/waldheinz/fs/fat/ClusterChain.java#L246-L283 |
cose-wg/COSE-JAVA | src/main/java/COSE/Attribute.java | Attribute.addAttribute | public void addAttribute(HeaderKeys label, CBORObject value, int where) throws CoseException {
"""
Set an attribute in the COSE object.
Setting an attribute in one map will remove it from all other maps as a side effect.
@param label HeaderKeys label which identifies the attribute in the map
@param value CBOR... | java | public void addAttribute(HeaderKeys label, CBORObject value, int where) throws CoseException {
addAttribute(label.AsCBOR(), value, where);
} | [
"public",
"void",
"addAttribute",
"(",
"HeaderKeys",
"label",
",",
"CBORObject",
"value",
",",
"int",
"where",
")",
"throws",
"CoseException",
"{",
"addAttribute",
"(",
"label",
".",
"AsCBOR",
"(",
")",
",",
"value",
",",
"where",
")",
";",
"}"
] | Set an attribute in the COSE object.
Setting an attribute in one map will remove it from all other maps as a side effect.
@param label HeaderKeys label which identifies the attribute in the map
@param value CBOR object which contains the value of the attribute
@param where Identifies which of the buckets to place the ... | [
"Set",
"an",
"attribute",
"in",
"the",
"COSE",
"object",
".",
"Setting",
"an",
"attribute",
"in",
"one",
"map",
"will",
"remove",
"it",
"from",
"all",
"other",
"maps",
"as",
"a",
"side",
"effect",
"."
] | train | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Attribute.java#L148-L150 |
protostuff/protostuff | protostuff-msgpack/src/main/java/io/protostuff/MsgpackXIOUtil.java | MsgpackXIOUtil.writeTo | public static <T> void writeTo(OutputStream out, T message, Schema<T> schema, boolean numeric,
LinkedBuffer buffer) throws IOException {
"""
Serializes the {@code message} into an {@link OutputStream} via {@link JsonXOutput} using the given
{@code schema}.
"""
if (buffer.start != buffer.of... | java | public static <T> void writeTo(OutputStream out, T message, Schema<T> schema, boolean numeric,
LinkedBuffer buffer) throws IOException
{
if (buffer.start != buffer.offset)
{
throw new IllegalArgumentException("Buffer previously used and had not been reset.");
}
... | [
"public",
"static",
"<",
"T",
">",
"void",
"writeTo",
"(",
"OutputStream",
"out",
",",
"T",
"message",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"boolean",
"numeric",
",",
"LinkedBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer... | Serializes the {@code message} into an {@link OutputStream} via {@link JsonXOutput} using the given
{@code schema}. | [
"Serializes",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-msgpack/src/main/java/io/protostuff/MsgpackXIOUtil.java#L111-L132 |
akamai/AkamaiOPEN-edgegrid-java | edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/EdgeGridV1Signer.java | EdgeGridV1Signer.getSignature | public String getSignature(Request request, ClientCredential credential)
throws RequestSigningException {
"""
Generates signature for a given HTTP request and client credential. The result of this method
call should be appended as the "Authorization" header to an HTTP request.
@param request a HTTP... | java | public String getSignature(Request request, ClientCredential credential)
throws RequestSigningException {
return getSignature(request, credential, System.currentTimeMillis(), generateNonce());
} | [
"public",
"String",
"getSignature",
"(",
"Request",
"request",
",",
"ClientCredential",
"credential",
")",
"throws",
"RequestSigningException",
"{",
"return",
"getSignature",
"(",
"request",
",",
"credential",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
",",
... | Generates signature for a given HTTP request and client credential. The result of this method
call should be appended as the "Authorization" header to an HTTP request.
@param request a HTTP request to sign
@param credential client credential used to sign a request
@return signature for Authorization HTTP header
@throw... | [
"Generates",
"signature",
"for",
"a",
"given",
"HTTP",
"request",
"and",
"client",
"credential",
".",
"The",
"result",
"of",
"this",
"method",
"call",
"should",
"be",
"appended",
"as",
"the",
"Authorization",
"header",
"to",
"an",
"HTTP",
"request",
"."
] | train | https://github.com/akamai/AkamaiOPEN-edgegrid-java/blob/29aa39f0f70f62503e6a434c4470ee25cb640f58/edgegrid-signer-core/src/main/java/com/akamai/edgegrid/signer/EdgeGridV1Signer.java#L111-L114 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java | LinearEquationSystem.permutePivot | private void permutePivot(IntIntPair pos1, IntIntPair pos2) {
"""
permutes two matrix rows and two matrix columns
@param pos1 the fist position for the permutation
@param pos2 the second position for the permutation
"""
int r1 = pos1.first;
int c1 = pos1.second;
int r2 = pos2.first;
int c2 ... | java | private void permutePivot(IntIntPair pos1, IntIntPair pos2) {
int r1 = pos1.first;
int c1 = pos1.second;
int r2 = pos2.first;
int c2 = pos2.second;
int index;
index = row[r2];
row[r2] = row[r1];
row[r1] = index;
index = col[c2];
col[c2] = col[c1];
col[c1] = index;
} | [
"private",
"void",
"permutePivot",
"(",
"IntIntPair",
"pos1",
",",
"IntIntPair",
"pos2",
")",
"{",
"int",
"r1",
"=",
"pos1",
".",
"first",
";",
"int",
"c1",
"=",
"pos1",
".",
"second",
";",
"int",
"r2",
"=",
"pos2",
".",
"first",
";",
"int",
"c2",
... | permutes two matrix rows and two matrix columns
@param pos1 the fist position for the permutation
@param pos2 the second position for the permutation | [
"permutes",
"two",
"matrix",
"rows",
"and",
"two",
"matrix",
"columns"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L526-L538 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java | Camera.setLimits | private void setLimits(Surface surface, int gridH, int gridV) {
"""
Define the maximum view limit.
@param surface The surface reference.
@param gridH The horizontal grid.
@param gridV The vertical grid.
@throws LionEngineException If <code>null</code> surface.
"""
Check.notNull(surface);
... | java | private void setLimits(Surface surface, int gridH, int gridV)
{
Check.notNull(surface);
if (gridH == 0)
{
limitRight = 0;
}
else
{
limitRight = Math.max(0, surface.getWidth() - UtilMath.getRounded(width, gridH));
}
if (gridV ==... | [
"private",
"void",
"setLimits",
"(",
"Surface",
"surface",
",",
"int",
"gridH",
",",
"int",
"gridV",
")",
"{",
"Check",
".",
"notNull",
"(",
"surface",
")",
";",
"if",
"(",
"gridH",
"==",
"0",
")",
"{",
"limitRight",
"=",
"0",
";",
"}",
"else",
"{"... | Define the maximum view limit.
@param surface The surface reference.
@param gridH The horizontal grid.
@param gridV The vertical grid.
@throws LionEngineException If <code>null</code> surface. | [
"Define",
"the",
"maximum",
"view",
"limit",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java#L263-L287 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.listFromComputeNodeAsync | public ServiceFuture<List<NodeFile>> listFromComputeNodeAsync(final String poolId, final String nodeId, final ListOperationCallback<NodeFile> serviceCallback) {
"""
Lists all of the files in task directories on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param ... | java | public ServiceFuture<List<NodeFile>> listFromComputeNodeAsync(final String poolId, final String nodeId, final ListOperationCallback<NodeFile> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listFromComputeNodeSinglePageAsync(poolId, nodeId),
new Func1<String,... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"NodeFile",
">",
">",
"listFromComputeNodeAsync",
"(",
"final",
"String",
"poolId",
",",
"final",
"String",
"nodeId",
",",
"final",
"ListOperationCallback",
"<",
"NodeFile",
">",
"serviceCallback",
")",
"{",
"return",
... | Lists all of the files in task directories on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node whose files you want to list.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalAr... | [
"Lists",
"all",
"of",
"the",
"files",
"in",
"task",
"directories",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L1937-L1947 |
maestrano/maestrano-java | src/main/java/com/maestrano/saml/Response.java | Response.loadFromBase64XML | public static Response loadFromBase64XML(Sso ssoService, String base64xml) throws CertificateException, ParserConfigurationException, SAXException, IOException {
"""
Load the response with the provided base64 encoded XML string
@param String
base64 encoded xml response provided by the SAML idp
@throws ParserC... | java | public static Response loadFromBase64XML(Sso ssoService, String base64xml) throws CertificateException, ParserConfigurationException, SAXException, IOException {
return loadFromBase64XML(ssoService.getSamlSettings().getIdpCertificate(), base64xml);
} | [
"public",
"static",
"Response",
"loadFromBase64XML",
"(",
"Sso",
"ssoService",
",",
"String",
"base64xml",
")",
"throws",
"CertificateException",
",",
"ParserConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"return",
"loadFromBase64XML",
"(",
"ssoS... | Load the response with the provided base64 encoded XML string
@param String
base64 encoded xml response provided by the SAML idp
@throws ParserConfigurationException
@throws SAXException
@throws IOException | [
"Load",
"the",
"response",
"with",
"the",
"provided",
"base64",
"encoded",
"XML",
"string"
] | train | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/saml/Response.java#L67-L69 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java | ElementFilter.typesIn | public static Set<TypeElement>
typesIn(Set<? extends Element> elements) {
"""
Returns a set of types in {@code elements}.
@return a set of types in {@code elements}
@param elements the elements to filter
"""
return setFilter(elements, TYPE_KINDS, TypeElement.class);
} | java | public static Set<TypeElement>
typesIn(Set<? extends Element> elements) {
return setFilter(elements, TYPE_KINDS, TypeElement.class);
} | [
"public",
"static",
"Set",
"<",
"TypeElement",
">",
"typesIn",
"(",
"Set",
"<",
"?",
"extends",
"Element",
">",
"elements",
")",
"{",
"return",
"setFilter",
"(",
"elements",
",",
"TYPE_KINDS",
",",
"TypeElement",
".",
"class",
")",
";",
"}"
] | Returns a set of types in {@code elements}.
@return a set of types in {@code elements}
@param elements the elements to filter | [
"Returns",
"a",
"set",
"of",
"types",
"in",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L162-L165 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.importDevicesAsync | public ServiceFuture<JobResponseInner> importDevicesAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, final ServiceCallback<JobResponseInner> serviceCallback) {
"""
Import, update, or delete device identities in the IoT hub identity registry from a blob. For more in... | java | public ServiceFuture<JobResponseInner> importDevicesAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, final ServiceCallback<JobResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(importDevicesWithServiceResponseAsync(resourceGroupName, resourceNam... | [
"public",
"ServiceFuture",
"<",
"JobResponseInner",
">",
"importDevicesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ImportDevicesRequest",
"importDevicesParameters",
",",
"final",
"ServiceCallback",
"<",
"JobResponseInner",
">",
"serviceC... | Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
Import, update, or delete device identities in the IoT hub identity registry from a blob. ... | [
"Import",
"update",
"or",
"delete",
"device",
"identities",
"in",
"the",
"IoT",
"hub",
"identity",
"registry",
"from",
"a",
"blob",
".",
"For",
"more",
"information",
"see",
":",
"https",
":",
"//",
"docs",
".",
"microsoft",
".",
"com",
"/",
"azure",
"/"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L3180-L3182 |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationGuessAndCheckFocus.java | SelfCalibrationGuessAndCheckFocus.setCamera | public void setCamera( double skew , double cx , double cy , int width , int height ) {
"""
Specifies known portions of camera intrinsic parameters
@param skew skew
@param cx image center x
@param cy image center y
@param width Image width
@param height Image height
"""
// Define normalization matrix
... | java | public void setCamera( double skew , double cx , double cy , int width , int height ) {
// Define normalization matrix
// center points, remove skew, scale coordinates
double d = Math.sqrt(width*width + height*height);
V.zero();
V.set(0,0,d/2); V.set(0,1,skew); V.set(0,2,cx);
V.set(1,1,d/2); V.set(1,2,cy);... | [
"public",
"void",
"setCamera",
"(",
"double",
"skew",
",",
"double",
"cx",
",",
"double",
"cy",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"// Define normalization matrix",
"// center points, remove skew, scale coordinates",
"double",
"d",
"=",
"Math",
"... | Specifies known portions of camera intrinsic parameters
@param skew skew
@param cx image center x
@param cy image center y
@param width Image width
@param height Image height | [
"Specifies",
"known",
"portions",
"of",
"camera",
"intrinsic",
"parameters"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/SelfCalibrationGuessAndCheckFocus.java#L134-L145 |
Alluxio/alluxio | core/base/src/main/java/alluxio/security/authorization/AccessControlList.java | AccessControlList.checkPermission | public boolean checkPermission(String user, List<String> groups, AclAction action) {
"""
Checks whether the user has the permission to perform the action.
1. If the user is the owner, then the owner entry determines the permission;
2. Else if the user matches the name of one of the named user entries, this ent... | java | public boolean checkPermission(String user, List<String> groups, AclAction action) {
return getPermission(user, groups).contains(action);
} | [
"public",
"boolean",
"checkPermission",
"(",
"String",
"user",
",",
"List",
"<",
"String",
">",
"groups",
",",
"AclAction",
"action",
")",
"{",
"return",
"getPermission",
"(",
"user",
",",
"groups",
")",
".",
"contains",
"(",
"action",
")",
";",
"}"
] | Checks whether the user has the permission to perform the action.
1. If the user is the owner, then the owner entry determines the permission;
2. Else if the user matches the name of one of the named user entries, this entry determines
the permission;
3. Else if one of the groups is the owning group and the owning gro... | [
"Checks",
"whether",
"the",
"user",
"has",
"the",
"permission",
"to",
"perform",
"the",
"action",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/security/authorization/AccessControlList.java#L310-L312 |
performancecopilot/parfait | parfait-agent/src/main/java/io/pcp/parfait/ParfaitAgent.java | ParfaitAgent.setupProperties | public static void setupProperties(String propertyAndValue, String separator) {
"""
extract properties from arguments, properties files, or intuition
"""
String[] tokens = propertyAndValue.split(separator, 2);
if (tokens.length == 2) {
String name = MonitoringViewProperties.PARFAIT ... | java | public static void setupProperties(String propertyAndValue, String separator) {
String[] tokens = propertyAndValue.split(separator, 2);
if (tokens.length == 2) {
String name = MonitoringViewProperties.PARFAIT + "." + tokens[0];
String value = tokens[1];
System.setProp... | [
"public",
"static",
"void",
"setupProperties",
"(",
"String",
"propertyAndValue",
",",
"String",
"separator",
")",
"{",
"String",
"[",
"]",
"tokens",
"=",
"propertyAndValue",
".",
"split",
"(",
"separator",
",",
"2",
")",
";",
"if",
"(",
"tokens",
".",
"le... | extract properties from arguments, properties files, or intuition | [
"extract",
"properties",
"from",
"arguments",
"properties",
"files",
"or",
"intuition"
] | train | https://github.com/performancecopilot/parfait/blob/33ed3aaa96ee3e0ab4c45791a7bd3e5cd443e94b/parfait-agent/src/main/java/io/pcp/parfait/ParfaitAgent.java#L57-L64 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentQuotaStatusInner.java | ComponentQuotaStatusInner.get | public ApplicationInsightsComponentQuotaStatusInner get(String resourceGroupName, String resourceName) {
"""
Returns daily data volume cap (quota) status for an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights comp... | java | public ApplicationInsightsComponentQuotaStatusInner get(String resourceGroupName, String resourceName) {
return getWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body();
} | [
"public",
"ApplicationInsightsComponentQuotaStatusInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"toBlocking",
"(",
")",
".",
"... | Returns daily data volume cap (quota) status for an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thro... | [
"Returns",
"daily",
"data",
"volume",
"cap",
"(",
"quota",
")",
"status",
"for",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentQuotaStatusInner.java#L70-L72 |
fhussonnois/storm-trident-elasticsearch | src/main/java/com/github/fhuss/storm/elasticsearch/mapper/impl/DefaultTupleMapper.java | DefaultTupleMapper.newBinaryDefaultTupleMapper | public static final DefaultTupleMapper newBinaryDefaultTupleMapper( ) {
"""
Returns a new {@link DefaultTupleMapper} that accept Byte[] as source field value.
"""
return new DefaultTupleMapper(new TupleMapper<String>() {
@Override
public String map(Tuple input) {
... | java | public static final DefaultTupleMapper newBinaryDefaultTupleMapper( ) {
return new DefaultTupleMapper(new TupleMapper<String>() {
@Override
public String map(Tuple input) {
try {
return new String(input.getBinaryByField(FIELD_SOURCE), "UTF-8");
... | [
"public",
"static",
"final",
"DefaultTupleMapper",
"newBinaryDefaultTupleMapper",
"(",
")",
"{",
"return",
"new",
"DefaultTupleMapper",
"(",
"new",
"TupleMapper",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"map",
"(",
"Tuple",
"input... | Returns a new {@link DefaultTupleMapper} that accept Byte[] as source field value. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/fhussonnois/storm-trident-elasticsearch/blob/1788157efff223800a92f17f79deb02c905230f7/src/main/java/com/github/fhuss/storm/elasticsearch/mapper/impl/DefaultTupleMapper.java#L63-L74 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.findAll | @Override
public List<CPDefinitionOptionRel> findAll(int start, int end) {
"""
Returns a range of all the cp definition option rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in th... | java | @Override
public List<CPDefinitionOptionRel> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp definition option rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"option",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L4588-L4591 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java | WorkflowTriggersInner.resetAsync | public Observable<Void> resetAsync(String resourceGroupName, String workflowName, String triggerName) {
"""
Resets a workflow trigger.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow trigger name.
@throws IllegalArgumentException thrown... | java | public Observable<Void> resetAsync(String resourceGroupName, String workflowName, String triggerName) {
return resetWithServiceResponseAsync(resourceGroupName, workflowName, triggerName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> respo... | [
"public",
"Observable",
"<",
"Void",
">",
"resetAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"String",
"triggerName",
")",
"{",
"return",
"resetWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
",",
"triggerNa... | Resets a workflow trigger.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow trigger name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Resets",
"a",
"workflow",
"trigger",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java#L480-L487 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/session/InMemoryDocumentSessionOperations.java | InMemoryDocumentSessionOperations.hasChanged | public boolean hasChanged(Object entity) {
"""
Determines whether the specified entity has changed.
@param entity Entity to check
@return true if entity has changed
"""
DocumentInfo documentInfo = documentsByEntity.get(entity);
if (documentInfo == null) {
return false;
... | java | public boolean hasChanged(Object entity) {
DocumentInfo documentInfo = documentsByEntity.get(entity);
if (documentInfo == null) {
return false;
}
ObjectNode document = entityToJson.convertEntityToJson(entity, documentInfo);
return entityChanged(document, documentInf... | [
"public",
"boolean",
"hasChanged",
"(",
"Object",
"entity",
")",
"{",
"DocumentInfo",
"documentInfo",
"=",
"documentsByEntity",
".",
"get",
"(",
"entity",
")",
";",
"if",
"(",
"documentInfo",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"ObjectNode",... | Determines whether the specified entity has changed.
@param entity Entity to check
@return true if entity has changed | [
"Determines",
"whether",
"the",
"specified",
"entity",
"has",
"changed",
"."
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/session/InMemoryDocumentSessionOperations.java#L1091-L1100 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java | FeatureMate.intersects | public boolean intersects( Geometry geometry, boolean usePrepared ) {
"""
Check for intersection.
@param geometry the geometry to check against.
@param usePrepared use prepared geometry.
@return true if the geometries intersect.
"""
if (!getEnvelope().intersects(geometry.getEnvelopeInternal())) {
... | java | public boolean intersects( Geometry geometry, boolean usePrepared ) {
if (!getEnvelope().intersects(geometry.getEnvelopeInternal())) {
return false;
}
if (usePrepared) {
if (preparedGeometry == null) {
preparedGeometry = PreparedGeometryFactory.prepare(get... | [
"public",
"boolean",
"intersects",
"(",
"Geometry",
"geometry",
",",
"boolean",
"usePrepared",
")",
"{",
"if",
"(",
"!",
"getEnvelope",
"(",
")",
".",
"intersects",
"(",
"geometry",
".",
"getEnvelopeInternal",
"(",
")",
")",
")",
"{",
"return",
"false",
";... | Check for intersection.
@param geometry the geometry to check against.
@param usePrepared use prepared geometry.
@return true if the geometries intersect. | [
"Check",
"for",
"intersection",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/features/FeatureMate.java#L186-L198 |
lamydev/Android-Notification | core/src/zemin/notification/NotificationEntry.java | NotificationEntry.setContentAction | public void setContentAction(Action.OnActionListener listener, ComponentName activity, Bundle extra) {
"""
Set a action to be fired when the notification content gets clicked.
@param listener
@param activity The activity to be started.
@param extra Intent extra.
"""
setContentAction(listener, acti... | java | public void setContentAction(Action.OnActionListener listener, ComponentName activity, Bundle extra) {
setContentAction(listener, activity, null, null, extra);
} | [
"public",
"void",
"setContentAction",
"(",
"Action",
".",
"OnActionListener",
"listener",
",",
"ComponentName",
"activity",
",",
"Bundle",
"extra",
")",
"{",
"setContentAction",
"(",
"listener",
",",
"activity",
",",
"null",
",",
"null",
",",
"extra",
")",
";"... | Set a action to be fired when the notification content gets clicked.
@param listener
@param activity The activity to be started.
@param extra Intent extra. | [
"Set",
"a",
"action",
"to",
"be",
"fired",
"when",
"the",
"notification",
"content",
"gets",
"clicked",
"."
] | train | https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationEntry.java#L419-L421 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/AtomicGrowingSparseHashMatrix.java | AtomicGrowingSparseHashMatrix.getColumnVector | private SparseDoubleVector getColumnVector(int column, boolean shouldLock) {
"""
Returns the column vector, locking the data if {@code shouldLock} is
{@code true}.
"""
int r = rows.get();
if (shouldLock)
lockColumn(column, r);
// Ensure that the column data is up to date
... | java | private SparseDoubleVector getColumnVector(int column, boolean shouldLock) {
int r = rows.get();
if (shouldLock)
lockColumn(column, r);
// Ensure that the column data is up to date
while (lastVectorCacheUpdate.get() != modifications.get())
updateVectorCache();
... | [
"private",
"SparseDoubleVector",
"getColumnVector",
"(",
"int",
"column",
",",
"boolean",
"shouldLock",
")",
"{",
"int",
"r",
"=",
"rows",
".",
"get",
"(",
")",
";",
"if",
"(",
"shouldLock",
")",
"lockColumn",
"(",
"column",
",",
"r",
")",
";",
"// Ensur... | Returns the column vector, locking the data if {@code shouldLock} is
{@code true}. | [
"Returns",
"the",
"column",
"vector",
"locking",
"the",
"data",
"if",
"{"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/AtomicGrowingSparseHashMatrix.java#L283-L297 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/memory/MemoryPool.java | MemoryPool.tryReserve | public boolean tryReserve(QueryId queryId, String allocationTag, long bytes) {
"""
Try to reserve the given number of bytes. Return value indicates whether the caller may use the requested memory.
"""
checkArgument(bytes >= 0, "bytes is negative");
synchronized (this) {
if (getFreeB... | java | public boolean tryReserve(QueryId queryId, String allocationTag, long bytes)
{
checkArgument(bytes >= 0, "bytes is negative");
synchronized (this) {
if (getFreeBytes() - bytes < 0) {
return false;
}
reservedBytes += bytes;
if (bytes != ... | [
"public",
"boolean",
"tryReserve",
"(",
"QueryId",
"queryId",
",",
"String",
"allocationTag",
",",
"long",
"bytes",
")",
"{",
"checkArgument",
"(",
"bytes",
">=",
"0",
",",
"\"bytes is negative\"",
")",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
... | Try to reserve the given number of bytes. Return value indicates whether the caller may use the requested memory. | [
"Try",
"to",
"reserve",
"the",
"given",
"number",
"of",
"bytes",
".",
"Return",
"value",
"indicates",
"whether",
"the",
"caller",
"may",
"use",
"the",
"requested",
"memory",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/memory/MemoryPool.java#L171-L187 |
scaleset/scaleset-geo | src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java | GoogleMapsTileMath.lngLatToMeters | public Coordinate lngLatToMeters(double lng, double lat) {
"""
Converts given coordinate in WGS84 Datum to XY in Spherical Mercator
EPSG:3857
@param lng the longitude of the coordinate
@param lat the latitude of the coordinate
@return The coordinate transformed to EPSG:3857
"""
double mx = lng * ... | java | public Coordinate lngLatToMeters(double lng, double lat) {
double mx = lng * originShift / 180.0;
double my = Math.log(Math.tan((90 + lat) * Math.PI / 360.0)) / (Math.PI / 180.0);
my *= originShift / 180.0;
return new Coordinate(mx, my);
} | [
"public",
"Coordinate",
"lngLatToMeters",
"(",
"double",
"lng",
",",
"double",
"lat",
")",
"{",
"double",
"mx",
"=",
"lng",
"*",
"originShift",
"/",
"180.0",
";",
"double",
"my",
"=",
"Math",
".",
"log",
"(",
"Math",
".",
"tan",
"(",
"(",
"90",
"+",
... | Converts given coordinate in WGS84 Datum to XY in Spherical Mercator
EPSG:3857
@param lng the longitude of the coordinate
@param lat the latitude of the coordinate
@return The coordinate transformed to EPSG:3857 | [
"Converts",
"given",
"coordinate",
"in",
"WGS84",
"Datum",
"to",
"XY",
"in",
"Spherical",
"Mercator",
"EPSG",
":",
"3857"
] | train | https://github.com/scaleset/scaleset-geo/blob/5cff2349668037dc287928a6c1a1f67c76d96b02/src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java#L79-L86 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java | Arc42DocumentationTemplate.addGlossarySection | public Section addGlossarySection(SoftwareSystem softwareSystem, File... files) throws IOException {
"""
Adds a "Glossary" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files one o... | java | public Section addGlossarySection(SoftwareSystem softwareSystem, File... files) throws IOException {
return addSection(softwareSystem, "Glossary", files);
} | [
"public",
"Section",
"addGlossarySection",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"addSection",
"(",
"softwareSystem",
",",
"\"Glossary\"",
",",
"files",
")",
";",
"}"
] | Adds a "Glossary" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files one or more File objects that point to the documentation content
@return a documentation {@link Secti... | [
"Adds",
"a",
"Glossary",
"section",
"relating",
"to",
"a",
"{",
"@link",
"SoftwareSystem",
"}",
"from",
"one",
"or",
"more",
"files",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/Arc42DocumentationTemplate.java#L313-L315 |
code4everything/util | src/main/java/com/zhazhapan/util/Checker.java | Checker.startsWith | public static boolean startsWith(String value, String... prefixes) {
"""
检查字符串是否以某个前缀开头
@param value 字符串
@param prefixes 前缀
@return {@link Boolean}
@since 1.1.0
"""
if (isNotEmpty(value) && isNotEmpty(prefixes)) {
for (String prefix : prefixes) {
if (value.startsWi... | java | public static boolean startsWith(String value, String... prefixes) {
if (isNotEmpty(value) && isNotEmpty(prefixes)) {
for (String prefix : prefixes) {
if (value.startsWith(prefix)) {
return true;
}
}
}
return false;
... | [
"public",
"static",
"boolean",
"startsWith",
"(",
"String",
"value",
",",
"String",
"...",
"prefixes",
")",
"{",
"if",
"(",
"isNotEmpty",
"(",
"value",
")",
"&&",
"isNotEmpty",
"(",
"prefixes",
")",
")",
"{",
"for",
"(",
"String",
"prefix",
":",
"prefixe... | 检查字符串是否以某个前缀开头
@param value 字符串
@param prefixes 前缀
@return {@link Boolean}
@since 1.1.0 | [
"检查字符串是否以某个前缀开头"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Checker.java#L111-L120 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Clamp | public static float Clamp(float x, FloatRange range) {
"""
Clamp values.
@param x Value.
@param range Range.
@return Value.
"""
return Clamp(x, range.getMin(), range.getMax());
} | java | public static float Clamp(float x, FloatRange range) {
return Clamp(x, range.getMin(), range.getMax());
} | [
"public",
"static",
"float",
"Clamp",
"(",
"float",
"x",
",",
"FloatRange",
"range",
")",
"{",
"return",
"Clamp",
"(",
"x",
",",
"range",
".",
"getMin",
"(",
")",
",",
"range",
".",
"getMax",
"(",
")",
")",
";",
"}"
] | Clamp values.
@param x Value.
@param range Range.
@return Value. | [
"Clamp",
"values",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L145-L147 |
azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java | HadoopConfigurationInjector.loadProp | public static void loadProp(Props props, Configuration conf, String name) {
"""
Loads an Azkaban property into the Hadoop configuration.
@param props The Azkaban properties
@param conf The Hadoop configuration
@param name The property name to load from the Azkaban properties into the Hadoop configuration
... | java | public static void loadProp(Props props, Configuration conf, String name) {
String prop = props.get(name);
if (prop != null) {
conf.set(name, prop);
}
} | [
"public",
"static",
"void",
"loadProp",
"(",
"Props",
"props",
",",
"Configuration",
"conf",
",",
"String",
"name",
")",
"{",
"String",
"prop",
"=",
"props",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"prop",
"!=",
"null",
")",
"{",
"conf",
".",
... | Loads an Azkaban property into the Hadoop configuration.
@param props The Azkaban properties
@param conf The Hadoop configuration
@param name The property name to load from the Azkaban properties into the Hadoop configuration | [
"Loads",
"an",
"Azkaban",
"property",
"into",
"the",
"Hadoop",
"configuration",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java#L199-L204 |
apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBIncrementalCheckpointUtils.java | RocksDBIncrementalCheckpointUtils.beforeThePrefixBytes | public static boolean beforeThePrefixBytes(@Nonnull byte[] bytes, @Nonnull byte[] prefixBytes) {
"""
check whether the bytes is before prefixBytes in the character order.
"""
final int prefixLength = prefixBytes.length;
for (int i = 0; i < prefixLength; ++i) {
int r = (char) prefixBytes[i] - (char) byte... | java | public static boolean beforeThePrefixBytes(@Nonnull byte[] bytes, @Nonnull byte[] prefixBytes) {
final int prefixLength = prefixBytes.length;
for (int i = 0; i < prefixLength; ++i) {
int r = (char) prefixBytes[i] - (char) bytes[i];
if (r != 0) {
return r > 0;
}
}
return false;
} | [
"public",
"static",
"boolean",
"beforeThePrefixBytes",
"(",
"@",
"Nonnull",
"byte",
"[",
"]",
"bytes",
",",
"@",
"Nonnull",
"byte",
"[",
"]",
"prefixBytes",
")",
"{",
"final",
"int",
"prefixLength",
"=",
"prefixBytes",
".",
"length",
";",
"for",
"(",
"int"... | check whether the bytes is before prefixBytes in the character order. | [
"check",
"whether",
"the",
"bytes",
"is",
"before",
"prefixBytes",
"in",
"the",
"character",
"order",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBIncrementalCheckpointUtils.java#L138-L147 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.writePropertyObjects | public void writePropertyObjects(CmsResource res, List<CmsProperty> properties) throws CmsException {
"""
Writes a list of properties for a specified resource.<p>
Code calling this method has to ensure that the no properties
<code>a, b</code> are contained in the specified list so that <code>a.equals(b)</code>... | java | public void writePropertyObjects(CmsResource res, List<CmsProperty> properties) throws CmsException {
getResourceType(res).writePropertyObjects(this, m_securityManager, res, properties);
} | [
"public",
"void",
"writePropertyObjects",
"(",
"CmsResource",
"res",
",",
"List",
"<",
"CmsProperty",
">",
"properties",
")",
"throws",
"CmsException",
"{",
"getResourceType",
"(",
"res",
")",
".",
"writePropertyObjects",
"(",
"this",
",",
"m_securityManager",
","... | Writes a list of properties for a specified resource.<p>
Code calling this method has to ensure that the no properties
<code>a, b</code> are contained in the specified list so that <code>a.equals(b)</code>,
otherwise an exception is thrown.<p>
@param res the resource
@param properties the list of properties to write
... | [
"Writes",
"a",
"list",
"of",
"properties",
"for",
"a",
"specified",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L4086-L4089 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java | DynamicEndpointUriResolver.resolveEndpointUri | public String resolveEndpointUri(Message message, String defaultUri) {
"""
Get the endpoint uri according to message header entry with fallback default uri.
"""
Map<String, Object> headers = message.getHeaders();
String requestUri;
if (headers.containsKey(ENDPOINT_URI_HEADER_NAME)) {
... | java | public String resolveEndpointUri(Message message, String defaultUri) {
Map<String, Object> headers = message.getHeaders();
String requestUri;
if (headers.containsKey(ENDPOINT_URI_HEADER_NAME)) {
requestUri = headers.get(ENDPOINT_URI_HEADER_NAME).toString();
} else if (String... | [
"public",
"String",
"resolveEndpointUri",
"(",
"Message",
"message",
",",
"String",
"defaultUri",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
"=",
"message",
".",
"getHeaders",
"(",
")",
";",
"String",
"requestUri",
";",
"if",
"(",
"head... | Get the endpoint uri according to message header entry with fallback default uri. | [
"Get",
"the",
"endpoint",
"uri",
"according",
"to",
"message",
"header",
"entry",
"with",
"fallback",
"default",
"uri",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java#L47-L68 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readLong | public static Long readLong(String value, Long defaultValue) {
"""
Read long.
@param value the value
@param defaultValue the default value
@return the long
"""
if (!StringUtils.hasText(value)) return defaultValue;
return Long.valueOf(value);
} | java | public static Long readLong(String value, Long defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Long.valueOf(value);
} | [
"public",
"static",
"Long",
"readLong",
"(",
"String",
"value",
",",
"Long",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Long",
".",
"valueOf",
"(",
"value",
"... | Read long.
@param value the value
@param defaultValue the default value
@return the long | [
"Read",
"long",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L152-L156 |
KostyaSha/yet-another-docker-plugin | yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/utils/HostAndPortChecker.java | HostAndPortChecker.bySshWithEveryRetryWaitFor | public void bySshWithEveryRetryWaitFor(int time, TimeUnit units) throws IOException {
"""
Connects to sshd on host:port
Retries while attempts reached with delay
First with tcp port wait, then with ssh connection wait
@throws IOException if no retries left
"""
checkState(withEveryRetryWaitFor(time... | java | public void bySshWithEveryRetryWaitFor(int time, TimeUnit units) throws IOException {
checkState(withEveryRetryWaitFor(time, units), "Port %s is not opened to connect to", hostAndPort.getPort());
for (int i = 1; i <= retries; i++) {
Connection connection = new Connection(hostAndPort.getHost... | [
"public",
"void",
"bySshWithEveryRetryWaitFor",
"(",
"int",
"time",
",",
"TimeUnit",
"units",
")",
"throws",
"IOException",
"{",
"checkState",
"(",
"withEveryRetryWaitFor",
"(",
"time",
",",
"units",
")",
",",
"\"Port %s is not opened to connect to\"",
",",
"hostAndPo... | Connects to sshd on host:port
Retries while attempts reached with delay
First with tcp port wait, then with ssh connection wait
@throws IOException if no retries left | [
"Connects",
"to",
"sshd",
"on",
"host",
":",
"port",
"Retries",
"while",
"attempts",
"reached",
"with",
"delay",
"First",
"with",
"tcp",
"port",
"wait",
"then",
"with",
"ssh",
"connection",
"wait"
] | train | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/utils/HostAndPortChecker.java#L83-L103 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/TimedInterface.java | TimedInterface.newProxy | public static <T> T newProxy(Class<T> ctype, T concrete) {
"""
Creates a new TimedInterface for a given interface <code>ctype</code> with a concrete class
<code>concrete</code>.
"""
return newProxy(ctype, concrete, null);
} | java | public static <T> T newProxy(Class<T> ctype, T concrete) {
return newProxy(ctype, concrete, null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"newProxy",
"(",
"Class",
"<",
"T",
">",
"ctype",
",",
"T",
"concrete",
")",
"{",
"return",
"newProxy",
"(",
"ctype",
",",
"concrete",
",",
"null",
")",
";",
"}"
] | Creates a new TimedInterface for a given interface <code>ctype</code> with a concrete class
<code>concrete</code>. | [
"Creates",
"a",
"new",
"TimedInterface",
"for",
"a",
"given",
"interface",
"<code",
">",
"ctype<",
"/",
"code",
">",
"with",
"a",
"concrete",
"class",
"<code",
">",
"concrete<",
"/",
"code",
">",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/TimedInterface.java#L147-L149 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsCore.java | OpenCmsCore.initCmsObject | protected CmsObject initCmsObject(CmsObject adminCms, CmsContextInfo contextInfo)
throws CmsRoleViolationException, CmsException {
"""
Returns an initialized CmsObject with the user and context initialized as provided.<p>
Note: Only if the provided <code>adminCms</code> CmsObject has admin permissions,
thi... | java | protected CmsObject initCmsObject(CmsObject adminCms, CmsContextInfo contextInfo)
throws CmsRoleViolationException, CmsException {
String userName = contextInfo.getUserName();
if ((adminCms == null) || !m_roleManager.hasRole(adminCms, CmsRole.ROOT_ADMIN)) {
if (!userName.endsWith(getDe... | [
"protected",
"CmsObject",
"initCmsObject",
"(",
"CmsObject",
"adminCms",
",",
"CmsContextInfo",
"contextInfo",
")",
"throws",
"CmsRoleViolationException",
",",
"CmsException",
"{",
"String",
"userName",
"=",
"contextInfo",
".",
"getUserName",
"(",
")",
";",
"if",
"(... | Returns an initialized CmsObject with the user and context initialized as provided.<p>
Note: Only if the provided <code>adminCms</code> CmsObject has admin permissions,
this method allows the creation a CmsObject for any existing user. Otherwise
only the default users 'Guest' and 'Export' can initialized with
this met... | [
"Returns",
"an",
"initialized",
"CmsObject",
"with",
"the",
"user",
"and",
"context",
"initialized",
"as",
"provided",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsCore.java#L1046-L1068 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/buffer/StreamEventBuffer.java | StreamEventBuffer.onSeqnoPersisted | void onSeqnoPersisted(final short vbucket, final long seqno) {
"""
Send to the wrapped handler all events with sequence numbers <= the given sequence number.
"""
final Queue<BufferedEvent> queue = partitionQueues.get(vbucket);
synchronized (queue) {
// while the head of the queue has a seqno <= ... | java | void onSeqnoPersisted(final short vbucket, final long seqno) {
final Queue<BufferedEvent> queue = partitionQueues.get(vbucket);
synchronized (queue) {
// while the head of the queue has a seqno <= the given seqno
while (!queue.isEmpty() && Long.compareUnsigned(queue.peek().seqno, seqno) < 1) {
... | [
"void",
"onSeqnoPersisted",
"(",
"final",
"short",
"vbucket",
",",
"final",
"long",
"seqno",
")",
"{",
"final",
"Queue",
"<",
"BufferedEvent",
">",
"queue",
"=",
"partitionQueues",
".",
"get",
"(",
"vbucket",
")",
";",
"synchronized",
"(",
"queue",
")",
"{... | Send to the wrapped handler all events with sequence numbers <= the given sequence number. | [
"Send",
"to",
"the",
"wrapped",
"handler",
"all",
"events",
"with",
"sequence",
"numbers",
"<",
"=",
"the",
"given",
"sequence",
"number",
"."
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/buffer/StreamEventBuffer.java#L216-L247 |
feedzai/pdb | src/main/java/com/feedzai/commons/sql/abstraction/dml/dialect/SqlBuilder.java | SqlBuilder.dbColumn | public static DbColumn.Builder dbColumn(String name, DbColumnType type, boolean autoInc) {
"""
Creates a Database Column builder.
@return A Database Column Key builder.
"""
return new DbColumn.Builder().name(name).type(type).autoInc(autoInc);
} | java | public static DbColumn.Builder dbColumn(String name, DbColumnType type, boolean autoInc) {
return new DbColumn.Builder().name(name).type(type).autoInc(autoInc);
} | [
"public",
"static",
"DbColumn",
".",
"Builder",
"dbColumn",
"(",
"String",
"name",
",",
"DbColumnType",
"type",
",",
"boolean",
"autoInc",
")",
"{",
"return",
"new",
"DbColumn",
".",
"Builder",
"(",
")",
".",
"name",
"(",
"name",
")",
".",
"type",
"(",
... | Creates a Database Column builder.
@return A Database Column Key builder. | [
"Creates",
"a",
"Database",
"Column",
"builder",
"."
] | train | https://github.com/feedzai/pdb/blob/fe07ca08417e0ddcd620a36aa1fdbca7f338be98/src/main/java/com/feedzai/commons/sql/abstraction/dml/dialect/SqlBuilder.java#L861-L863 |
apache/reef | lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ConfigurationModule.java | ConfigurationModule.setMultiple | public final <T> ConfigurationModule setMultiple(final Param<T> opt, final Iterable<String> values) {
"""
Binds a set of values to a Param using ConfigurationModule.
@param opt Target Param
@param values Values to bind to the Param
@param <T> type
@return the Configuration module
"""
Configuration... | java | public final <T> ConfigurationModule setMultiple(final Param<T> opt, final Iterable<String> values) {
ConfigurationModule c = deepCopy();
for (final String val : values) {
c = c.set(opt, val);
}
return c;
} | [
"public",
"final",
"<",
"T",
">",
"ConfigurationModule",
"setMultiple",
"(",
"final",
"Param",
"<",
"T",
">",
"opt",
",",
"final",
"Iterable",
"<",
"String",
">",
"values",
")",
"{",
"ConfigurationModule",
"c",
"=",
"deepCopy",
"(",
")",
";",
"for",
"(",... | Binds a set of values to a Param using ConfigurationModule.
@param opt Target Param
@param values Values to bind to the Param
@param <T> type
@return the Configuration module | [
"Binds",
"a",
"set",
"of",
"values",
"to",
"a",
"Param",
"using",
"ConfigurationModule",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ConfigurationModule.java#L164-L170 |
windup/windup | rules-xml/api/src/main/java/org/jboss/windup/rules/apps/xml/operation/xslt/XSLTTransformation.java | XSLTTransformation.perform | @Override
public void perform(GraphRewrite event, EvaluationContext context) {
"""
Set the payload to the fileModel of the given instance even though the variable is not directly of it's type. This is mainly to simplify the
creation of the rule, when the FileModel itself is not being iterated but just a model... | java | @Override
public void perform(GraphRewrite event, EvaluationContext context)
{
checkVariableName(event, context);
WindupVertexFrame payload = resolveVariable(event, getVariableName());
if (payload instanceof FileReferenceModel)
{
FileModel file = ((FileReferenceModel)... | [
"@",
"Override",
"public",
"void",
"perform",
"(",
"GraphRewrite",
"event",
",",
"EvaluationContext",
"context",
")",
"{",
"checkVariableName",
"(",
"event",
",",
"context",
")",
";",
"WindupVertexFrame",
"payload",
"=",
"resolveVariable",
"(",
"event",
",",
"ge... | Set the payload to the fileModel of the given instance even though the variable is not directly of it's type. This is mainly to simplify the
creation of the rule, when the FileModel itself is not being iterated but just a model referencing it. | [
"Set",
"the",
"payload",
"to",
"the",
"fileModel",
"of",
"the",
"given",
"instance",
"even",
"though",
"the",
"variable",
"is",
"not",
"directly",
"of",
"it",
"s",
"type",
".",
"This",
"is",
"mainly",
"to",
"simplify",
"the",
"creation",
"of",
"the",
"ru... | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-xml/api/src/main/java/org/jboss/windup/rules/apps/xml/operation/xslt/XSLTTransformation.java#L124-L139 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/tools/StringTools.java | StringTools.readStream | public static String readStream(InputStream stream, String encoding) throws IOException {
"""
Read the text stream using the given encoding.
@param stream InputStream the stream to be read
@param encoding the stream's character encoding, e.g. {@code utf-8}, or {@code null} to use the system encoding
@return a... | java | public static String readStream(InputStream stream, String encoding) throws IOException {
InputStreamReader isr = null;
StringBuilder sb = new StringBuilder();
try {
if (encoding == null) {
isr = new InputStreamReader(stream);
} else {
isr = new InputStreamReader(stream, encoding... | [
"public",
"static",
"String",
"readStream",
"(",
"InputStream",
"stream",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"InputStreamReader",
"isr",
"=",
"null",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",... | Read the text stream using the given encoding.
@param stream InputStream the stream to be read
@param encoding the stream's character encoding, e.g. {@code utf-8}, or {@code null} to use the system encoding
@return a string with the stream's content, lines separated by {@code \n} (note that {@code \n} will
be added to... | [
"Read",
"the",
"text",
"stream",
"using",
"the",
"given",
"encoding",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/tools/StringTools.java#L98-L120 |
io7m/jregions | com.io7m.jregions.generators/src/main/java/com/io7m/jregions/generators/PAreaSizeBIGenerator.java | PAreaSizeBIGenerator.create | public static <S> PAreaSizeBIGenerator<S> create() {
"""
@param <S> A phantom type parameter indicating the coordinate space of the
area
@return A generator initialized with useful defaults
"""
final LongGenerator gen = new LongGenerator(0L, Long.MAX_VALUE);
return new PAreaSizeBIGenerator<>(() -> ... | java | public static <S> PAreaSizeBIGenerator<S> create()
{
final LongGenerator gen = new LongGenerator(0L, Long.MAX_VALUE);
return new PAreaSizeBIGenerator<>(() -> new BigInteger(gen.next().toString()));
} | [
"public",
"static",
"<",
"S",
">",
"PAreaSizeBIGenerator",
"<",
"S",
">",
"create",
"(",
")",
"{",
"final",
"LongGenerator",
"gen",
"=",
"new",
"LongGenerator",
"(",
"0L",
",",
"Long",
".",
"MAX_VALUE",
")",
";",
"return",
"new",
"PAreaSizeBIGenerator",
"<... | @param <S> A phantom type parameter indicating the coordinate space of the
area
@return A generator initialized with useful defaults | [
"@param",
"<S",
">",
"A",
"phantom",
"type",
"parameter",
"indicating",
"the",
"coordinate",
"space",
"of",
"the",
"area"
] | train | https://github.com/io7m/jregions/blob/ae03850b5fa2a5fcbd8788953fba7897d4a88d7c/com.io7m.jregions.generators/src/main/java/com/io7m/jregions/generators/PAreaSizeBIGenerator.java#L56-L60 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java | DateTimesHelper.toDateTime | public T toDateTime(DateTime dateTime) {
"""
Converts a {@code DateTime} object to an API date time preserving the
time zone.
"""
try {
D dateObj = dateClass.newInstance();
PropertyUtils.setProperty(dateObj, "year", dateTime.getYear());
PropertyUtils.setProperty(dateObj, "month", dateTim... | java | public T toDateTime(DateTime dateTime) {
try {
D dateObj = dateClass.newInstance();
PropertyUtils.setProperty(dateObj, "year", dateTime.getYear());
PropertyUtils.setProperty(dateObj, "month", dateTime.getMonthOfYear());
PropertyUtils.setProperty(dateObj, "day", dateTime.getDayOfMonth());
... | [
"public",
"T",
"toDateTime",
"(",
"DateTime",
"dateTime",
")",
"{",
"try",
"{",
"D",
"dateObj",
"=",
"dateClass",
".",
"newInstance",
"(",
")",
";",
"PropertyUtils",
".",
"setProperty",
"(",
"dateObj",
",",
"\"year\"",
",",
"dateTime",
".",
"getYear",
"(",... | Converts a {@code DateTime} object to an API date time preserving the
time zone. | [
"Converts",
"a",
"{"
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java#L72-L103 |
alkacon/opencms-core | src/org/opencms/jlan/CmsJlanRepository.java | CmsJlanRepository.getCms | public CmsObjectWrapper getCms(SrvSession session, TreeConnection connection) throws CmsException {
"""
Creates a CmsObjectWrapper for the current session.<p>
@param session the current session
@param connection the tree connection
@return the correctly configured CmsObjectWrapper for this session
@throw... | java | public CmsObjectWrapper getCms(SrvSession session, TreeConnection connection) throws CmsException {
String userName = session.getClientInformation().getUserName();
userName = CmsJlanUsers.translateUser(userName);
CmsContextInfo contextInfo = new CmsContextInfo(m_cms.getRequestContext());
... | [
"public",
"CmsObjectWrapper",
"getCms",
"(",
"SrvSession",
"session",
",",
"TreeConnection",
"connection",
")",
"throws",
"CmsException",
"{",
"String",
"userName",
"=",
"session",
".",
"getClientInformation",
"(",
")",
".",
"getUserName",
"(",
")",
";",
"userName... | Creates a CmsObjectWrapper for the current session.<p>
@param session the current session
@param connection the tree connection
@return the correctly configured CmsObjectWrapper for this session
@throws CmsException if something goes wrong | [
"Creates",
"a",
"CmsObjectWrapper",
"for",
"the",
"current",
"session",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jlan/CmsJlanRepository.java#L217-L230 |
appium/java-client | src/main/java/io/appium/java_client/ScreenshotState.java | ScreenshotState.verifyChanged | public ScreenshotState verifyChanged(Duration timeout, double minScore) {
"""
Verifies whether the state of the screenshot provided by stateProvider lambda function
is changed within the given timeout.
@param timeout timeout value
@param minScore the value in range (0.0, 1.0)
@return self instance for chain... | java | public ScreenshotState verifyChanged(Duration timeout, double minScore) {
return checkState((x) -> x < minScore, timeout);
} | [
"public",
"ScreenshotState",
"verifyChanged",
"(",
"Duration",
"timeout",
",",
"double",
"minScore",
")",
"{",
"return",
"checkState",
"(",
"(",
"x",
")",
"-",
">",
"x",
"<",
"minScore",
",",
"timeout",
")",
";",
"}"
] | Verifies whether the state of the screenshot provided by stateProvider lambda function
is changed within the given timeout.
@param timeout timeout value
@param minScore the value in range (0.0, 1.0)
@return self instance for chaining
@throws ScreenshotComparisonTimeout if the calculated score is still
greater or equa... | [
"Verifies",
"whether",
"the",
"state",
"of",
"the",
"screenshot",
"provided",
"by",
"stateProvider",
"lambda",
"function",
"is",
"changed",
"within",
"the",
"given",
"timeout",
"."
] | train | https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/ScreenshotState.java#L186-L188 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.asOuterSuper | public Type asOuterSuper(Type t, Symbol sym) {
"""
Return the base type of t or any of its outer types that starts
with the given symbol. If none exists, return null.
@param t a type
@param sym a symbol
"""
switch (t.getTag()) {
case CLASS:
do {
Type s = asSupe... | java | public Type asOuterSuper(Type t, Symbol sym) {
switch (t.getTag()) {
case CLASS:
do {
Type s = asSuper(t, sym);
if (s != null) return s;
t = t.getEnclosingType();
} while (t.hasTag(CLASS));
return null;
case ARRA... | [
"public",
"Type",
"asOuterSuper",
"(",
"Type",
"t",
",",
"Symbol",
"sym",
")",
"{",
"switch",
"(",
"t",
".",
"getTag",
"(",
")",
")",
"{",
"case",
"CLASS",
":",
"do",
"{",
"Type",
"s",
"=",
"asSuper",
"(",
"t",
",",
"sym",
")",
";",
"if",
"(",
... | Return the base type of t or any of its outer types that starts
with the given symbol. If none exists, return null.
@param t a type
@param sym a symbol | [
"Return",
"the",
"base",
"type",
"of",
"t",
"or",
"any",
"of",
"its",
"outer",
"types",
"that",
"starts",
"with",
"the",
"given",
"symbol",
".",
"If",
"none",
"exists",
"return",
"null",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L1923-L1941 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.loginUser | public String loginUser(String username, String password, String remoteAddress) throws CmsException {
"""
Logs a user with a given ip address into the Cms, if the password is correct.<p>
@param username the name of the user
@param password the password of the user
@param remoteAddress the ip address
@retur... | java | public String loginUser(String username, String password, String remoteAddress) throws CmsException {
// login the user
CmsUser newUser = m_securityManager.loginUser(m_context, username, password, remoteAddress);
// set the project back to the "Online" project
CmsProject newProject = m_... | [
"public",
"String",
"loginUser",
"(",
"String",
"username",
",",
"String",
"password",
",",
"String",
"remoteAddress",
")",
"throws",
"CmsException",
"{",
"// login the user",
"CmsUser",
"newUser",
"=",
"m_securityManager",
".",
"loginUser",
"(",
"m_context",
",",
... | Logs a user with a given ip address into the Cms, if the password is correct.<p>
@param username the name of the user
@param password the password of the user
@param remoteAddress the ip address
@return the name of the logged in user
@throws CmsException if the login was not successful | [
"Logs",
"a",
"user",
"with",
"a",
"given",
"ip",
"address",
"into",
"the",
"Cms",
"if",
"the",
"password",
"is",
"correct",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L2186-L2200 |
enioka/jqm | jqm-all/jqm-client/jqm-api-client-core/src/main/java/com/enioka/jqm/api/JqmClientFactory.java | JqmClientFactory.getClient | public static JqmClient getClient(String name, Properties p, boolean cached) {
"""
Return a new client that may be cached or not. Given properties are always use when not cached, and only used at creation time for
cached clients.
@param name
if null, default client. Otherwise, helpful to retrieve cached clien... | java | public static JqmClient getClient(String name, Properties p, boolean cached)
{
Properties p2 = null;
if (binder == null)
{
bind();
}
if (p == null)
{
p2 = props;
}
else
{
p2 = new Properties(props);
... | [
"public",
"static",
"JqmClient",
"getClient",
"(",
"String",
"name",
",",
"Properties",
"p",
",",
"boolean",
"cached",
")",
"{",
"Properties",
"p2",
"=",
"null",
";",
"if",
"(",
"binder",
"==",
"null",
")",
"{",
"bind",
"(",
")",
";",
"}",
"if",
"(",... | Return a new client that may be cached or not. Given properties are always use when not cached, and only used at creation time for
cached clients.
@param name
if null, default client. Otherwise, helpful to retrieve cached clients later.
@param p
a set of properties. Implementation specific. Unknown properties are sile... | [
"Return",
"a",
"new",
"client",
"that",
"may",
"be",
"cached",
"or",
"not",
".",
"Given",
"properties",
"are",
"always",
"use",
"when",
"not",
"cached",
"and",
"only",
"used",
"at",
"creation",
"time",
"for",
"cached",
"clients",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-client/jqm-api-client-core/src/main/java/com/enioka/jqm/api/JqmClientFactory.java#L157-L174 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java | VirtualNetworkGatewayConnectionsInner.createOrUpdate | public VirtualNetworkGatewayConnectionInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) {
"""
Creates or updates a virtual network gateway connection in the specified resource group.
@param resourceGroupName The name of th... | java | public VirtualNetworkGatewayConnectionInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last(... | [
"public",
"VirtualNetworkGatewayConnectionInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
",",
"VirtualNetworkGatewayConnectionInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
... | Creates or updates a virtual network gateway connection in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
@param parameters Parameters supplied to the create or update virtual network ... | [
"Creates",
"or",
"updates",
"a",
"virtual",
"network",
"gateway",
"connection",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L139-L141 |
OpenTSDB/opentsdb | src/tsd/client/QueryUi.java | QueryUi.setOffsetHeight | private static void setOffsetHeight(final Widget widget, int height) {
"""
Properly sets the total height of a widget.
This takes into account decorations such as border, margin, and padding.
"""
widget.setHeight(height + "px");
final int offset = widget.getOffsetHeight();
if (offset > 0) {
... | java | private static void setOffsetHeight(final Widget widget, int height) {
widget.setHeight(height + "px");
final int offset = widget.getOffsetHeight();
if (offset > 0) {
height -= offset - height;
if (height > 0) {
widget.setHeight(height + "px");
}
}
} | [
"private",
"static",
"void",
"setOffsetHeight",
"(",
"final",
"Widget",
"widget",
",",
"int",
"height",
")",
"{",
"widget",
".",
"setHeight",
"(",
"height",
"+",
"\"px\"",
")",
";",
"final",
"int",
"offset",
"=",
"widget",
".",
"getOffsetHeight",
"(",
")",... | Properly sets the total height of a widget.
This takes into account decorations such as border, margin, and padding. | [
"Properly",
"sets",
"the",
"total",
"height",
"of",
"a",
"widget",
".",
"This",
"takes",
"into",
"account",
"decorations",
"such",
"as",
"border",
"margin",
"and",
"padding",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/QueryUi.java#L1428-L1437 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java | Frame.getInstanceStackLocation | public int getInstanceStackLocation(Instruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException {
"""
Get the stack location (counting down from top of stack, starting at 0)
containing the object instance referred to by given instruction. This
relies on the observation that in instructions which use a... | java | public int getInstanceStackLocation(Instruction ins, ConstantPoolGen cpg) throws DataflowAnalysisException {
int numConsumed = ins.consumeStack(cpg);
if (numConsumed == Const.UNPREDICTABLE) {
throw new DataflowAnalysisException("Unpredictable stack consumption in " + ins);
}
... | [
"public",
"int",
"getInstanceStackLocation",
"(",
"Instruction",
"ins",
",",
"ConstantPoolGen",
"cpg",
")",
"throws",
"DataflowAnalysisException",
"{",
"int",
"numConsumed",
"=",
"ins",
".",
"consumeStack",
"(",
"cpg",
")",
";",
"if",
"(",
"numConsumed",
"==",
"... | Get the stack location (counting down from top of stack, starting at 0)
containing the object instance referred to by given instruction. This
relies on the observation that in instructions which use an object
instance (such as getfield, invokevirtual, etc.), the object instance is
the first operand used by the instruct... | [
"Get",
"the",
"stack",
"location",
"(",
"counting",
"down",
"from",
"top",
"of",
"stack",
"starting",
"at",
"0",
")",
"containing",
"the",
"object",
"instance",
"referred",
"to",
"by",
"given",
"instruction",
".",
"This",
"relies",
"on",
"the",
"observation"... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L305-L311 |
alkacon/opencms-core | src/org/opencms/gwt/shared/CmsHistoryVersion.java | CmsHistoryVersion.fromString | public static CmsHistoryVersion fromString(String s) {
"""
Converts a string to a CmsHistoryVersion.<p>
This is the inverse of toString().
@param s the string from which to read the history version
@return the history version
"""
List<String> l = CmsStringUtil.splitAsList(s, ":");
if ... | java | public static CmsHistoryVersion fromString(String s) {
List<String> l = CmsStringUtil.splitAsList(s, ":");
if (l.size() == 2) {
Integer ver = null;
try {
ver = Integer.valueOf(l.get(0));
} catch (Exception e) {
//
}
... | [
"public",
"static",
"CmsHistoryVersion",
"fromString",
"(",
"String",
"s",
")",
"{",
"List",
"<",
"String",
">",
"l",
"=",
"CmsStringUtil",
".",
"splitAsList",
"(",
"s",
",",
"\":\"",
")",
";",
"if",
"(",
"l",
".",
"size",
"(",
")",
"==",
"2",
")",
... | Converts a string to a CmsHistoryVersion.<p>
This is the inverse of toString().
@param s the string from which to read the history version
@return the history version | [
"Converts",
"a",
"string",
"to",
"a",
"CmsHistoryVersion",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/shared/CmsHistoryVersion.java#L91-L107 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.setNetworkTimeout | public void setNetworkTimeout(Executor executor, final int milliseconds) throws SQLException {
"""
Change network timeout.
@param executor executor (can be null)
@param milliseconds network timeout in milliseconds.
@throws SQLException if security manager doesn't permit it.
"""
if (this.isClosed()... | java | public void setNetworkTimeout(Executor executor, final int milliseconds) throws SQLException {
if (this.isClosed()) {
throw ExceptionMapper
.getSqlException("Connection.setNetworkTimeout cannot be called on a closed connection");
}
if (milliseconds < 0) {
throw ExceptionMapper
... | [
"public",
"void",
"setNetworkTimeout",
"(",
"Executor",
"executor",
",",
"final",
"int",
"milliseconds",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"this",
".",
"isClosed",
"(",
")",
")",
"{",
"throw",
"ExceptionMapper",
".",
"getSqlException",
"(",
"\"Con... | Change network timeout.
@param executor executor (can be null)
@param milliseconds network timeout in milliseconds.
@throws SQLException if security manager doesn't permit it. | [
"Change",
"network",
"timeout",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L1700-L1720 |
google/closure-compiler | src/com/google/javascript/refactoring/Matchers.java | Matchers.not | public static Matcher not(final Matcher matcher) {
"""
Returns a Matcher that matches the opposite of the provided matcher.
"""
return new Matcher() {
@Override public boolean matches(Node node, NodeMetadata metadata) {
return !matcher.matches(node, metadata);
}
};
} | java | public static Matcher not(final Matcher matcher) {
return new Matcher() {
@Override public boolean matches(Node node, NodeMetadata metadata) {
return !matcher.matches(node, metadata);
}
};
} | [
"public",
"static",
"Matcher",
"not",
"(",
"final",
"Matcher",
"matcher",
")",
"{",
"return",
"new",
"Matcher",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"Node",
"node",
",",
"NodeMetadata",
"metadata",
")",
"{",
"return",
"!",
... | Returns a Matcher that matches the opposite of the provided matcher. | [
"Returns",
"a",
"Matcher",
"that",
"matches",
"the",
"opposite",
"of",
"the",
"provided",
"matcher",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/refactoring/Matchers.java#L81-L87 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/managers/GuildController.java | GuildController.createVoiceChannel | @CheckReturnValue
public ChannelAction createVoiceChannel(String name) {
"""
Creates a new {@link net.dv8tion.jda.core.entities.VoiceChannel VoiceChannel} in this Guild.
For this to be successful, the logged in account has to have the {@link net.dv8tion.jda.core.Permission#MANAGE_CHANNEL MANAGE_CHANNEL} Permi... | java | @CheckReturnValue
public ChannelAction createVoiceChannel(String name)
{
checkPermission(Permission.MANAGE_CHANNEL);
Checks.notBlank(name, "Name");
name = name.trim();
Checks.check(name.length() > 0 && name.length() <= 100, "Provided name must be 1 - 100 characters in length");
... | [
"@",
"CheckReturnValue",
"public",
"ChannelAction",
"createVoiceChannel",
"(",
"String",
"name",
")",
"{",
"checkPermission",
"(",
"Permission",
".",
"MANAGE_CHANNEL",
")",
";",
"Checks",
".",
"notBlank",
"(",
"name",
",",
"\"Name\"",
")",
";",
"name",
"=",
"n... | Creates a new {@link net.dv8tion.jda.core.entities.VoiceChannel VoiceChannel} in this Guild.
For this to be successful, the logged in account has to have the {@link net.dv8tion.jda.core.Permission#MANAGE_CHANNEL MANAGE_CHANNEL} Permission.
<p>Possible {@link net.dv8tion.jda.core.requests.ErrorResponse ErrorResponses} ... | [
"Creates",
"a",
"new",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"entities",
".",
"VoiceChannel",
"VoiceChannel",
"}",
"in",
"this",
"Guild",
".",
"For",
"this",
"to",
"be",
"successful",
"the",
"logged",
"in",
"account",
"has",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/managers/GuildController.java#L1797-L1808 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/StringUtil.java | StringUtil.startsWith | public static boolean startsWith(String str, char prefix) {
"""
Tests if this string starts with the specified prefix.
@param str string to check first char
@param prefix the prefix.
@return is first of given type
"""
return str != null && str.length() > 0 && str.charAt(0) == prefix;
} | java | public static boolean startsWith(String str, char prefix) {
return str != null && str.length() > 0 && str.charAt(0) == prefix;
} | [
"public",
"static",
"boolean",
"startsWith",
"(",
"String",
"str",
",",
"char",
"prefix",
")",
"{",
"return",
"str",
"!=",
"null",
"&&",
"str",
".",
"length",
"(",
")",
">",
"0",
"&&",
"str",
".",
"charAt",
"(",
"0",
")",
"==",
"prefix",
";",
"}"
] | Tests if this string starts with the specified prefix.
@param str string to check first char
@param prefix the prefix.
@return is first of given type | [
"Tests",
"if",
"this",
"string",
"starts",
"with",
"the",
"specified",
"prefix",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/StringUtil.java#L851-L853 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/DateControl.java | DateControl.showDateDetails | public void showDateDetails(Node owner, LocalDate date) {
"""
Creates a new {@link DatePopOver} and shows it attached to the given
owner node.
@param owner the owner node
@param date the date for which to display more detail
"""
maybeHidePopOvers();
datePopOver = new DatePopOver(this, date... | java | public void showDateDetails(Node owner, LocalDate date) {
maybeHidePopOvers();
datePopOver = new DatePopOver(this, date);
datePopOver.show(owner);
} | [
"public",
"void",
"showDateDetails",
"(",
"Node",
"owner",
",",
"LocalDate",
"date",
")",
"{",
"maybeHidePopOvers",
"(",
")",
";",
"datePopOver",
"=",
"new",
"DatePopOver",
"(",
"this",
",",
"date",
")",
";",
"datePopOver",
".",
"show",
"(",
"owner",
")",
... | Creates a new {@link DatePopOver} and shows it attached to the given
owner node.
@param owner the owner node
@param date the date for which to display more detail | [
"Creates",
"a",
"new",
"{",
"@link",
"DatePopOver",
"}",
"and",
"shows",
"it",
"attached",
"to",
"the",
"given",
"owner",
"node",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/DateControl.java#L714-L718 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getFirstToken | @Nullable
public static String getFirstToken (@Nullable final String sStr, @Nullable final String sSearch) {
"""
Get the first token up to (and excluding) the separating string.
@param sStr
The string to search. May be <code>null</code>.
@param sSearch
The search string. May be <code>null</code>.
@return ... | java | @Nullable
public static String getFirstToken (@Nullable final String sStr, @Nullable final String sSearch)
{
if (StringHelper.hasNoText (sSearch))
return sStr;
final int nIndex = getIndexOf (sStr, sSearch);
return nIndex == StringHelper.STRING_NOT_FOUND ? sStr : sStr.substring (0, nIndex);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getFirstToken",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sSearch",
")",
")",
"return",
... | Get the first token up to (and excluding) the separating string.
@param sStr
The string to search. May be <code>null</code>.
@param sSearch
The search string. May be <code>null</code>.
@return The passed string if no such separator token was found. | [
"Get",
"the",
"first",
"token",
"up",
"to",
"(",
"and",
"excluding",
")",
"the",
"separating",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5120-L5127 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedSasDefinitionAsync | public ServiceFuture<SasDefinitionBundle> recoverDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback<SasDefinitionBundle> serviceCallback) {
"""
Recovers the deleted SAS definition.
Recovers the deleted SAS definition for the specified storage ... | java | public ServiceFuture<SasDefinitionBundle> recoverDeletedSasDefinitionAsync(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, final ServiceCallback<SasDefinitionBundle> serviceCallback) {
return ServiceFuture.fromResponse(recoverDeletedSasDefinitionWithServiceResponseAsync(vaultBaseUrl, s... | [
"public",
"ServiceFuture",
"<",
"SasDefinitionBundle",
">",
"recoverDeletedSasDefinitionAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
",",
"final",
"ServiceCallback",
"<",
"SasDefinitionBundle",
">",
"service... | Recovers the deleted SAS definition.
Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@para... | [
"Recovers",
"the",
"deleted",
"SAS",
"definition",
".",
"Recovers",
"the",
"deleted",
"SAS",
"definition",
"for",
"the",
"specified",
"storage",
"account",
".",
"This",
"operation",
"can",
"only",
"be",
"performed",
"on",
"a",
"soft",
"-",
"delete",
"enabled",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L10990-L10992 |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java | CepOperator.advanceTime | private void advanceTime(NFAState nfaState, long timestamp) throws Exception {
"""
Advances the time for the given NFA to the given timestamp. This means that no more events with timestamp
<b>lower</b> than the given timestamp should be passed to the nfa, This can lead to pruning and timeouts.
"""
try (Shar... | java | private void advanceTime(NFAState nfaState, long timestamp) throws Exception {
try (SharedBufferAccessor<IN> sharedBufferAccessor = partialMatches.getAccessor()) {
Collection<Tuple2<Map<String, List<IN>>, Long>> timedOut =
nfa.advanceTime(sharedBufferAccessor, nfaState, timestamp);
if (!timedOut.isEmpty())... | [
"private",
"void",
"advanceTime",
"(",
"NFAState",
"nfaState",
",",
"long",
"timestamp",
")",
"throws",
"Exception",
"{",
"try",
"(",
"SharedBufferAccessor",
"<",
"IN",
">",
"sharedBufferAccessor",
"=",
"partialMatches",
".",
"getAccessor",
"(",
")",
")",
"{",
... | Advances the time for the given NFA to the given timestamp. This means that no more events with timestamp
<b>lower</b> than the given timestamp should be passed to the nfa, This can lead to pruning and timeouts. | [
"Advances",
"the",
"time",
"for",
"the",
"given",
"NFA",
"to",
"the",
"given",
"timestamp",
".",
"This",
"means",
"that",
"no",
"more",
"events",
"with",
"timestamp",
"<b",
">",
"lower<",
"/",
"b",
">",
"than",
"the",
"given",
"timestamp",
"should",
"be"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java#L434-L442 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java | GenericCollectionTypeResolver.getMapKeyFieldType | public static Class<?> getMapKeyFieldType(Field mapField, int nestingLevel, Map<Integer, Integer> typeIndexesPerLevel) {
"""
Determine the generic key type of the given Map field.
@param mapField the map field to introspect
@param nestingLevel the nesting level of the target type
(typically 1; e.g. in case of a... | java | public static Class<?> getMapKeyFieldType(Field mapField, int nestingLevel, Map<Integer, Integer> typeIndexesPerLevel) {
return getGenericFieldType(mapField, Map.class, 0, typeIndexesPerLevel, nestingLevel);
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getMapKeyFieldType",
"(",
"Field",
"mapField",
",",
"int",
"nestingLevel",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"typeIndexesPerLevel",
")",
"{",
"return",
"getGenericFieldType",
"(",
"mapField",
",",
"Ma... | Determine the generic key type of the given Map field.
@param mapField the map field to introspect
@param nestingLevel the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
nested List, whereas 2 would indicate the element of the nested List)
@param typeIndexesPerLevel... | [
"Determine",
"the",
"generic",
"key",
"type",
"of",
"the",
"given",
"Map",
"field",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java#L139-L141 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/CollidableConfig.java | CollidableConfig.exports | public static void exports(Xml root, Collidable collidable) {
"""
Create an XML node from a collidable.
@param root The node root (must not be <code>null</code>).
@param collidable The collidable reference (must not be <code>null</code>).
@throws LionEngineException If invalid argument.
"""
Check... | java | public static void exports(Xml root, Collidable collidable)
{
Check.notNull(root);
Check.notNull(collidable);
final Xml node = root.createChild(NODE_GROUP);
node.setText(collidable.getGroup().toString());
} | [
"public",
"static",
"void",
"exports",
"(",
"Xml",
"root",
",",
"Collidable",
"collidable",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"Check",
".",
"notNull",
"(",
"collidable",
")",
";",
"final",
"Xml",
"node",
"=",
"root",
".",
"creat... | Create an XML node from a collidable.
@param root The node root (must not be <code>null</code>).
@param collidable The collidable reference (must not be <code>null</code>).
@throws LionEngineException If invalid argument. | [
"Create",
"an",
"XML",
"node",
"from",
"a",
"collidable",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/CollidableConfig.java#L77-L84 |
mangstadt/biweekly | src/main/java/biweekly/io/xml/XCalElement.java | XCalElement.append | public Element append(ICalDataType dataType, String value) {
"""
Adds a value.
@param dataType the data type or null for the "unknown" data type
@param value the value
@return the created element
"""
String dataTypeStr = toLocalName(dataType);
return append(dataTypeStr, value);
} | java | public Element append(ICalDataType dataType, String value) {
String dataTypeStr = toLocalName(dataType);
return append(dataTypeStr, value);
} | [
"public",
"Element",
"append",
"(",
"ICalDataType",
"dataType",
",",
"String",
"value",
")",
"{",
"String",
"dataTypeStr",
"=",
"toLocalName",
"(",
"dataType",
")",
";",
"return",
"append",
"(",
"dataTypeStr",
",",
"value",
")",
";",
"}"
] | Adds a value.
@param dataType the data type or null for the "unknown" data type
@param value the value
@return the created element | [
"Adds",
"a",
"value",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L115-L118 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java | OrientedBox3f.setFirstAxis | @Override
public void setFirstAxis(double x, double y, double z, double extent) {
"""
Set the first axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param x
@param y
@param z
@param extent
"""
setFirstAxis(x, y, z, extent, CoordinateSystem3D.getDefaultCoordinateS... | java | @Override
public void setFirstAxis(double x, double y, double z, double extent) {
setFirstAxis(x, y, z, extent, CoordinateSystem3D.getDefaultCoordinateSystem());
} | [
"@",
"Override",
"public",
"void",
"setFirstAxis",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
",",
"double",
"extent",
")",
"{",
"setFirstAxis",
"(",
"x",
",",
"y",
",",
"z",
",",
"extent",
",",
"CoordinateSystem3D",
".",
"getDefaultCoor... | Set the first axis of the box.
The third axis is updated to be perpendicular to the two other axis.
@param x
@param y
@param z
@param extent | [
"Set",
"the",
"first",
"axis",
"of",
"the",
"box",
".",
"The",
"third",
"axis",
"is",
"updated",
"to",
"be",
"perpendicular",
"to",
"the",
"two",
"other",
"axis",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java#L439-L442 |
OpenVidu/openvidu | openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java | SessionManager.getParticipant | public Participant getParticipant(String sessionId, String participantPrivateId) throws OpenViduException {
"""
Returns a participant in a session
@param sessionId identifier of the session
@param participantPrivateId private identifier of the participant
@return {@link Participant}
@throws OpenVi... | java | public Participant getParticipant(String sessionId, String participantPrivateId) throws OpenViduException {
Session session = sessions.get(sessionId);
if (session == null) {
throw new OpenViduException(Code.ROOM_NOT_FOUND_ERROR_CODE, "Session '" + sessionId + "' not found");
}
Participant participant = sessi... | [
"public",
"Participant",
"getParticipant",
"(",
"String",
"sessionId",
",",
"String",
"participantPrivateId",
")",
"throws",
"OpenViduException",
"{",
"Session",
"session",
"=",
"sessions",
".",
"get",
"(",
"sessionId",
")",
";",
"if",
"(",
"session",
"==",
"nul... | Returns a participant in a session
@param sessionId identifier of the session
@param participantPrivateId private identifier of the participant
@return {@link Participant}
@throws OpenViduException in case the session doesn't exist or the
participant doesn't belong to it | [
"Returns",
"a",
"participant",
"in",
"a",
"session"
] | train | https://github.com/OpenVidu/openvidu/blob/89db47dd37949ceab29e5228371a8fcab04d8d55/openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java#L188-L199 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readAttributeList | public AttributeList readAttributeList(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
"""
Decode a JSON document to retrieve an AttributeList instance.
@param in The stream to read JSON from
@return The decoded AttributeList instance
@throws ConversionException If JSON uses ... | java | public AttributeList readAttributeList(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONArray json = parseArray(in);
AttributeList ret = new AttributeList();
for (Object item : json) {
if (!(item instanceof JSONObject)) {
throwConv... | [
"public",
"AttributeList",
"readAttributeList",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"JSONArray",
"json",
"=",
"parseArray",
"(",
"in",
")",
";",
"AttributeList",
"ret",
"=",
"new",
... | Decode a JSON document to retrieve an AttributeList instance.
@param in The stream to read JSON from
@return The decoded AttributeList instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If nee... | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"AttributeList",
"instance",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1375-L1388 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java | DurationField.compareTimeOfDates | private int compareTimeOfDates(final Date d1, final Date d2) {
"""
Because parsing done by base class returns a different date than parsing
done by the user or converting duration to a date. But for the
DurationField comparison only the time is important. This function helps
comparing the time and ignores the v... | java | private int compareTimeOfDates(final Date d1, final Date d2) {
final LocalTime lt1 = LocalDateTime.ofInstant(d1.toInstant(), ZONEID_UTC).toLocalTime();
final LocalTime lt2 = LocalDateTime.ofInstant(d2.toInstant(), ZONEID_UTC).toLocalTime();
return lt1.compareTo(lt2);
} | [
"private",
"int",
"compareTimeOfDates",
"(",
"final",
"Date",
"d1",
",",
"final",
"Date",
"d2",
")",
"{",
"final",
"LocalTime",
"lt1",
"=",
"LocalDateTime",
".",
"ofInstant",
"(",
"d1",
".",
"toInstant",
"(",
")",
",",
"ZONEID_UTC",
")",
".",
"toLocalTime"... | Because parsing done by base class returns a different date than parsing
done by the user or converting duration to a date. But for the
DurationField comparison only the time is important. This function helps
comparing the time and ignores the values for day, month and year.
@param d1
date, which time will compared wi... | [
"Because",
"parsing",
"done",
"by",
"base",
"class",
"returns",
"a",
"different",
"date",
"than",
"parsing",
"done",
"by",
"the",
"user",
"or",
"converting",
"duration",
"to",
"a",
"date",
".",
"But",
"for",
"the",
"DurationField",
"comparison",
"only",
"the... | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java#L222-L227 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.selectFrame | public void selectFrame() {
"""
Selects the frame represented by the element, but only if the element is
present and displayed. If these conditions are not met, the move action
will be logged, but skipped and the test will continue.
"""
String cantSelect = "Unable to focus on frame ";
String ... | java | public void selectFrame() {
String cantSelect = "Unable to focus on frame ";
String action = "Focusing on frame " + prettyOutput();
String expected = "Frame " + prettyOutput() + " is present, displayed, and focused";
try {
// wait for element to be present
if (isN... | [
"public",
"void",
"selectFrame",
"(",
")",
"{",
"String",
"cantSelect",
"=",
"\"Unable to focus on frame \"",
";",
"String",
"action",
"=",
"\"Focusing on frame \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"\"Frame \"",
"+",
"prettyOutput",
... | Selects the frame represented by the element, but only if the element is
present and displayed. If these conditions are not met, the move action
will be logged, but skipped and the test will continue. | [
"Selects",
"the",
"frame",
"represented",
"by",
"the",
"element",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"and",
"displayed",
".",
"If",
"these",
"conditions",
"are",
"not",
"met",
"the",
"move",
"action",
"will",
"be",
"logged",
"but",
"sk... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1231-L1253 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldOps.java | GaliosFieldOps.multiply | public static int multiply( int x , int y , int primitive , int domain ) {
"""
Implementation of multiplication with a primitive polynomial. The result will be a member of the same field
as the inputs, provided primitive is an appropriate irreducible polynomial for that field.
Uses 'Russian Peasant Multiplicat... | java | public static int multiply( int x , int y , int primitive , int domain ) {
int r = 0;
while( y > 0 ) {
if( (y&1) != 0 ) {
r = r ^ x;
}
y = y >> 1;
x = x << 1;
if( x >= domain) {
x ^= primitive;
}
}
return r;
} | [
"public",
"static",
"int",
"multiply",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"primitive",
",",
"int",
"domain",
")",
"{",
"int",
"r",
"=",
"0",
";",
"while",
"(",
"y",
">",
"0",
")",
"{",
"if",
"(",
"(",
"y",
"&",
"1",
")",
"!=",
"0... | Implementation of multiplication with a primitive polynomial. The result will be a member of the same field
as the inputs, provided primitive is an appropriate irreducible polynomial for that field.
Uses 'Russian Peasant Multiplication' that should be a faster algorithm.
@param x polynomial
@param y polynomial
@param... | [
"Implementation",
"of",
"multiplication",
"with",
"a",
"primitive",
"polynomial",
".",
"The",
"result",
"will",
"be",
"a",
"member",
"of",
"the",
"same",
"field",
"as",
"the",
"inputs",
"provided",
"primitive",
"is",
"an",
"appropriate",
"irreducible",
"polynomi... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/GaliosFieldOps.java#L76-L90 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java | ThreadedServer.stopJob | protected void stopJob(Thread thread, Object job) {
"""
Kill a job. This method closes IDLE and socket associated with a job
@param thread
@param job
"""
if (job instanceof Socket)
{
try
{
((Socket) job).close();
}
catch (Excep... | java | protected void stopJob(Thread thread, Object job)
{
if (job instanceof Socket)
{
try
{
((Socket) job).close();
}
catch (Exception e)
{
LogSupport.ignore(log, e);
}
}
super.stopJob(... | [
"protected",
"void",
"stopJob",
"(",
"Thread",
"thread",
",",
"Object",
"job",
")",
"{",
"if",
"(",
"job",
"instanceof",
"Socket",
")",
"{",
"try",
"{",
"(",
"(",
"Socket",
")",
"job",
")",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Exception... | Kill a job. This method closes IDLE and socket associated with a job
@param thread
@param job | [
"Kill",
"a",
"job",
".",
"This",
"method",
"closes",
"IDLE",
"and",
"socket",
"associated",
"with",
"a",
"job"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java#L591-L605 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.EL2_L3 | @Pure
public static Point2d EL2_L3(double x, double y) {
"""
This function convert extended France Lambert II coordinate to
France Lambert III coordinate.
@param x is the coordinate in extended France Lambert II
@param y is the coordinate in extended France Lambert II
@return the France Lambert III coordina... | java | @Pure
public static Point2d EL2_L3(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2E_N,
LAMBERT_2E_C,
LAMBERT_2E_XS,
LAMBERT_2E_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_3_N,
LAMBERT_3_C,
LAMBERT_... | [
"@",
"Pure",
"public",
"static",
"Point2d",
"EL2_L3",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2E_N",
",",
"LAMBERT_2E_C",
",",
"LAMBERT_2E_XS",
",... | This function convert extended France Lambert II coordinate to
France Lambert III coordinate.
@param x is the coordinate in extended France Lambert II
@param y is the coordinate in extended France Lambert II
@return the France Lambert III coordinate. | [
"This",
"function",
"convert",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"III",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L219-L232 |
voldemort/voldemort | src/java/voldemort/client/protocol/admin/SocketPool.java | SocketPool.checkin | public void checkin(SocketDestination destination, SocketAndStreams socket) {
"""
Check the socket back into the pool.
@param destination The socket destination of the socket
@param socket The socket to check back in
"""
try {
pool.checkin(destination, socket);
} catch(Exception... | java | public void checkin(SocketDestination destination, SocketAndStreams socket) {
try {
pool.checkin(destination, socket);
} catch(Exception e) {
throw new VoldemortException("Failure while checking in socket for " + destination
+ ": ", e);
... | [
"public",
"void",
"checkin",
"(",
"SocketDestination",
"destination",
",",
"SocketAndStreams",
"socket",
")",
"{",
"try",
"{",
"pool",
".",
"checkin",
"(",
"destination",
",",
"socket",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new... | Check the socket back into the pool.
@param destination The socket destination of the socket
@param socket The socket to check back in | [
"Check",
"the",
"socket",
"back",
"into",
"the",
"pool",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/client/protocol/admin/SocketPool.java#L118-L125 |
VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.addTokens | public ElasticHashinator addTokens(NavigableMap<Integer, Integer> tokensToAdd) {
"""
Add the given tokens to the ring and generate the new hashinator. The current hashinator is not changed.
@param tokensToAdd Tokens to add as a map of tokens to partitions
@return The new hashinator
"""
// figure o... | java | public ElasticHashinator addTokens(NavigableMap<Integer, Integer> tokensToAdd)
{
// figure out the interval
long interval = deriveTokenInterval(m_tokensMap.get().keySet());
Map<Integer, Integer> tokens = Maps.newTreeMap();
for (Map.Entry<Integer, Integer> e : m_tokensMap.get().entry... | [
"public",
"ElasticHashinator",
"addTokens",
"(",
"NavigableMap",
"<",
"Integer",
",",
"Integer",
">",
"tokensToAdd",
")",
"{",
"// figure out the interval",
"long",
"interval",
"=",
"deriveTokenInterval",
"(",
"m_tokensMap",
".",
"get",
"(",
")",
".",
"keySet",
"(... | Add the given tokens to the ring and generate the new hashinator. The current hashinator is not changed.
@param tokensToAdd Tokens to add as a map of tokens to partitions
@return The new hashinator | [
"Add",
"the",
"given",
"tokens",
"to",
"the",
"ring",
"and",
"generate",
"the",
"new",
"hashinator",
".",
"The",
"current",
"hashinator",
"is",
"not",
"changed",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L314-L342 |
pwittchen/NetworkEvents | network-events-library/src/main/java/com/github/pwittchen/networkevents/library/NetworkEvents.java | NetworkEvents.setPingParameters | public NetworkEvents setPingParameters(String host, int port, int timeoutInMs) {
"""
Sets ping parameters of the host used to check Internet connection.
If it's not set, library will use default ping parameters.
@param host host to be pinged
@param port port of the host
@param timeoutInMs timeout in millisec... | java | public NetworkEvents setPingParameters(String host, int port, int timeoutInMs) {
onlineChecker.setPingParameters(host, port, timeoutInMs);
return this;
} | [
"public",
"NetworkEvents",
"setPingParameters",
"(",
"String",
"host",
",",
"int",
"port",
",",
"int",
"timeoutInMs",
")",
"{",
"onlineChecker",
".",
"setPingParameters",
"(",
"host",
",",
"port",
",",
"timeoutInMs",
")",
";",
"return",
"this",
";",
"}"
] | Sets ping parameters of the host used to check Internet connection.
If it's not set, library will use default ping parameters.
@param host host to be pinged
@param port port of the host
@param timeoutInMs timeout in milliseconds
@return NetworkEvents object | [
"Sets",
"ping",
"parameters",
"of",
"the",
"host",
"used",
"to",
"check",
"Internet",
"connection",
".",
"If",
"it",
"s",
"not",
"set",
"library",
"will",
"use",
"default",
"ping",
"parameters",
"."
] | train | https://github.com/pwittchen/NetworkEvents/blob/6a76a75f95bff92ac3824275fd6b2f5d92db1c7d/network-events-library/src/main/java/com/github/pwittchen/networkevents/library/NetworkEvents.java#L117-L120 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/EventMessenger.java | EventMessenger.sendToDirect | public void sendToDirect(String topicURI, Object event,
Set<String> webSocketSessionIds) {
"""
Send an EventMessage directly to each client listed in the webSocketSessionId set
parameter. If parameter webSocketSessionIds is null or empty no messages are sent.
<p>
In contrast to {@link #sendTo(String, Object,... | java | public void sendToDirect(String topicURI, Object event,
Set<String> webSocketSessionIds) {
if (webSocketSessionIds != null) {
for (String webSocketSessionId : webSocketSessionIds) {
EventMessage eventMessage = new EventMessage(topicURI, event);
eventMessage.setWebSocketSessionId(webSocketSessionId);
... | [
"public",
"void",
"sendToDirect",
"(",
"String",
"topicURI",
",",
"Object",
"event",
",",
"Set",
"<",
"String",
">",
"webSocketSessionIds",
")",
"{",
"if",
"(",
"webSocketSessionIds",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"webSocketSessionId",
":",
"... | Send an EventMessage directly to each client listed in the webSocketSessionId set
parameter. If parameter webSocketSessionIds is null or empty no messages are sent.
<p>
In contrast to {@link #sendTo(String, Object, Set)} this method does not check if
the receivers are subscribed to the destination. The
{@link SimpleBro... | [
"Send",
"an",
"EventMessage",
"directly",
"to",
"each",
"client",
"listed",
"in",
"the",
"webSocketSessionId",
"set",
"parameter",
".",
"If",
"parameter",
"webSocketSessionIds",
"is",
"null",
"or",
"empty",
"no",
"messages",
"are",
"sent",
".",
"<p",
">",
"In"... | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/EventMessenger.java#L149-L158 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java | AbstractIndexWriter.addDescription | protected void addDescription(TypeElement typeElement, Content dlTree, SearchIndexItem si) {
"""
Add one line summary comment for the class.
@param typeElement the class being documented
@param dlTree the content tree to which the description will be added
@param si the search index item to be updated
"""... | java | protected void addDescription(TypeElement typeElement, Content dlTree, SearchIndexItem si) {
Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.INDEX, typeElement).strong(true));
si.setContainingPackage(utils.getPackageName(utils.containingPackage(typeElemen... | [
"protected",
"void",
"addDescription",
"(",
"TypeElement",
"typeElement",
",",
"Content",
"dlTree",
",",
"SearchIndexItem",
"si",
")",
"{",
"Content",
"link",
"=",
"getLink",
"(",
"new",
"LinkInfoImpl",
"(",
"configuration",
",",
"LinkInfoImpl",
".",
"Kind",
"."... | Add one line summary comment for the class.
@param typeElement the class being documented
@param dlTree the content tree to which the description will be added
@param si the search index item to be updated | [
"Add",
"one",
"line",
"summary",
"comment",
"for",
"the",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java#L272-L285 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java | JdbcCpoXaAdapter.updateObject | @Override
public <T> long updateObject(String name, T obj) throws CpoException {
"""
Update the Object in the datasource. The CpoAdapter will check to see if the object exists in the datasource. If it
exists then the object will be updated. If it does not exist, an exception will be thrown
<p>
<pre>Example:
... | java | @Override
public <T> long updateObject(String name, T obj) throws CpoException {
return getCurrentResource().updateObject(name, obj);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"updateObject",
"(",
"String",
"name",
",",
"T",
"obj",
")",
"throws",
"CpoException",
"{",
"return",
"getCurrentResource",
"(",
")",
".",
"updateObject",
"(",
"name",
",",
"obj",
")",
";",
"}"
] | Update the Object in the datasource. The CpoAdapter will check to see if the object exists in the datasource. If it
exists then the object will be updated. If it does not exist, an exception will be thrown
<p>
<pre>Example:
<code>
<p>
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
<p>
try {
cpo = ... | [
"Update",
"the",
"Object",
"in",
"the",
"datasource",
".",
"The",
"CpoAdapter",
"will",
"check",
"to",
"see",
"if",
"the",
"object",
"exists",
"in",
"the",
"datasource",
".",
"If",
"it",
"exists",
"then",
"the",
"object",
"will",
"be",
"updated",
".",
"I... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L1624-L1627 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/LevelRipConverter.java | LevelRipConverter.start | public static int start(Media levelrip, MapTile map, ProgressListener listener, Canceler canceler) {
"""
Run the converter.
@param levelrip The file containing the levelrip as an image.
@param map The destination map reference.
@param listener The progress listener.
@param canceler The canceler reference.
@... | java | public static int start(Media levelrip, MapTile map, ProgressListener listener, Canceler canceler)
{
final Sprite imageMap = Drawable.loadSprite(levelrip);
imageMap.load();
imageMap.prepare();
final int imageTilesInX = imageMap.getWidth() / map.getTileWidth();
final int imag... | [
"public",
"static",
"int",
"start",
"(",
"Media",
"levelrip",
",",
"MapTile",
"map",
",",
"ProgressListener",
"listener",
",",
"Canceler",
"canceler",
")",
"{",
"final",
"Sprite",
"imageMap",
"=",
"Drawable",
".",
"loadSprite",
"(",
"levelrip",
")",
";",
"im... | Run the converter.
@param levelrip The file containing the levelrip as an image.
@param map The destination map reference.
@param listener The progress listener.
@param canceler The canceler reference.
@return The total number of not found tiles.
@throws LionEngineException If media is <code>null</code> or image canno... | [
"Run",
"the",
"converter",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/LevelRipConverter.java#L73-L116 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java | TokenProvider.createSharedAccessSignatureTokenProvider | public static TokenProvider createSharedAccessSignatureTokenProvider(String sasKeyName, String sasKey) {
"""
Creates a Shared Access Signature token provider with the given key name and key value. Returned token provider creates tokens
with validity of 20 minutes. This is a utility method.
@param sasKeyName SAS ... | java | public static TokenProvider createSharedAccessSignatureTokenProvider(String sasKeyName, String sasKey)
{
return new SharedAccessSignatureTokenProvider(sasKeyName, sasKey, SecurityConstants.DEFAULT_SAS_TOKEN_VALIDITY_IN_SECONDS);
} | [
"public",
"static",
"TokenProvider",
"createSharedAccessSignatureTokenProvider",
"(",
"String",
"sasKeyName",
",",
"String",
"sasKey",
")",
"{",
"return",
"new",
"SharedAccessSignatureTokenProvider",
"(",
"sasKeyName",
",",
"sasKey",
",",
"SecurityConstants",
".",
"DEFAUL... | Creates a Shared Access Signature token provider with the given key name and key value. Returned token provider creates tokens
with validity of 20 minutes. This is a utility method.
@param sasKeyName SAS key name
@param sasKey SAS key value
@return an instance of Shared Access Signature token provider with the given ke... | [
"Creates",
"a",
"Shared",
"Access",
"Signature",
"token",
"provider",
"with",
"the",
"given",
"key",
"name",
"and",
"key",
"value",
".",
"Returned",
"token",
"provider",
"creates",
"tokens",
"with",
"validity",
"of",
"20",
"minutes",
".",
"This",
"is",
"a",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/security/TokenProvider.java#L34-L37 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/thread/BaseRecordOwner.java | BaseRecordOwner.addRecord | public void addRecord(Rec record, boolean bMainQuery) {
"""
Add this record to this screen.
@param record The record to add.
@param bMainQuery If this is the main record.
"""
if (m_vRecordList == null)
m_vRecordList = new RecordList(null);
if (record == null)
return;
... | java | public void addRecord(Rec record, boolean bMainQuery)
{
if (m_vRecordList == null)
m_vRecordList = new RecordList(null);
if (record == null)
return;
if (((Record)record).getRecordOwner() != null) // Screen already here?
if (((Record)record).getRecordO... | [
"public",
"void",
"addRecord",
"(",
"Rec",
"record",
",",
"boolean",
"bMainQuery",
")",
"{",
"if",
"(",
"m_vRecordList",
"==",
"null",
")",
"m_vRecordList",
"=",
"new",
"RecordList",
"(",
"null",
")",
";",
"if",
"(",
"record",
"==",
"null",
")",
"return"... | Add this record to this screen.
@param record The record to add.
@param bMainQuery If this is the main record. | [
"Add",
"this",
"record",
"to",
"this",
"screen",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/thread/BaseRecordOwner.java#L162-L174 |
apache/groovy | src/main/groovy/groovy/lang/GroovyClassLoader.java | GroovyClassLoader.createCollector | protected ClassCollector createCollector(CompilationUnit unit, SourceUnit su) {
"""
creates a ClassCollector for a new compilation.
@param unit the compilationUnit
@param su the SourceUnit
@return the ClassCollector
"""
InnerLoader loader = AccessController.doPrivileged(new PrivilegedAction<Inne... | java | protected ClassCollector createCollector(CompilationUnit unit, SourceUnit su) {
InnerLoader loader = AccessController.doPrivileged(new PrivilegedAction<InnerLoader>() {
public InnerLoader run() {
return new InnerLoader(GroovyClassLoader.this);
}
});
return... | [
"protected",
"ClassCollector",
"createCollector",
"(",
"CompilationUnit",
"unit",
",",
"SourceUnit",
"su",
")",
"{",
"InnerLoader",
"loader",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"InnerLoader",
">",
"(",
")",
"{",
"pub... | creates a ClassCollector for a new compilation.
@param unit the compilationUnit
@param su the SourceUnit
@return the ClassCollector | [
"creates",
"a",
"ClassCollector",
"for",
"a",
"new",
"compilation",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/GroovyClassLoader.java#L557-L564 |
cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java | CxSmilesParser.processRadicals | private static boolean processRadicals(CharIter iter, CxSmilesState state) {
"""
CXSMILES radicals.
@param iter input characters, iterator is progressed by this method
@param state output CXSMILES state
@return parse was a success (or not)
"""
if (state.atomRads == null)
state.atomRads... | java | private static boolean processRadicals(CharIter iter, CxSmilesState state) {
if (state.atomRads == null)
state.atomRads = new TreeMap<>();
CxSmilesState.Radical rad;
switch (iter.next()) {
case '1':
rad = CxSmilesState.Radical.Monovalent;
b... | [
"private",
"static",
"boolean",
"processRadicals",
"(",
"CharIter",
"iter",
",",
"CxSmilesState",
"state",
")",
"{",
"if",
"(",
"state",
".",
"atomRads",
"==",
"null",
")",
"state",
".",
"atomRads",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"CxSmilesStat... | CXSMILES radicals.
@param iter input characters, iterator is progressed by this method
@param state output CXSMILES state
@return parse was a success (or not) | [
"CXSMILES",
"radicals",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java#L364-L401 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java | GVRRenderData.bindShader | public synchronized void bindShader(GVRScene scene, boolean isMultiview) {
"""
Selects a specific vertex and fragment shader to use for rendering.
If a shader template has been specified, it is used to generate
a vertex and fragment shader based on mesh attributes, bound textures
and light sources. If the tex... | java | public synchronized void bindShader(GVRScene scene, boolean isMultiview)
{
GVRRenderPass pass = mRenderPassList.get(0);
GVRShaderId shader = pass.getMaterial().getShaderType();
GVRShader template = shader.getTemplate(getGVRContext());
if (template != null)
{
templ... | [
"public",
"synchronized",
"void",
"bindShader",
"(",
"GVRScene",
"scene",
",",
"boolean",
"isMultiview",
")",
"{",
"GVRRenderPass",
"pass",
"=",
"mRenderPassList",
".",
"get",
"(",
"0",
")",
";",
"GVRShaderId",
"shader",
"=",
"pass",
".",
"getMaterial",
"(",
... | Selects a specific vertex and fragment shader to use for rendering.
If a shader template has been specified, it is used to generate
a vertex and fragment shader based on mesh attributes, bound textures
and light sources. If the textures bound to the material are changed
or a new light source is added, this function mu... | [
"Selects",
"a",
"specific",
"vertex",
"and",
"fragment",
"shader",
"to",
"use",
"for",
"rendering",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java#L264-L283 |
craftercms/search | crafter-search-client/src/main/java/org/craftercms/search/service/utils/RestClientUtils.java | RestClientUtils.getSearchException | public static SearchException getSearchException(final String indexId, final String message,
final HttpStatusCodeException e) {
"""
Returns an instance of the appropriate {@link SearchException} depending on the value of the {@link HttpStatus}.
@param indexId t... | java | public static SearchException getSearchException(final String indexId, final String message,
final HttpStatusCodeException e) {
switch (e.getStatusCode()) {
case SERVICE_UNAVAILABLE:
return new SearchServerException(message, e);
... | [
"public",
"static",
"SearchException",
"getSearchException",
"(",
"final",
"String",
"indexId",
",",
"final",
"String",
"message",
",",
"final",
"HttpStatusCodeException",
"e",
")",
"{",
"switch",
"(",
"e",
".",
"getStatusCode",
"(",
")",
")",
"{",
"case",
"SE... | Returns an instance of the appropriate {@link SearchException} depending on the value of the {@link HttpStatus}.
@param indexId the id of the index
@param message the message for the exception
@param e the exception thrown by the http client
@return the instance of the exception | [
"Returns",
"an",
"instance",
"of",
"the",
"appropriate",
"{"
] | train | https://github.com/craftercms/search/blob/337ba446badbfbc4912cd8ccd7d50fd62d6be2cc/crafter-search-client/src/main/java/org/craftercms/search/service/utils/RestClientUtils.java#L107-L115 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/timeseries/Smoothing.java | Smoothing.simpleMovingAverageQuick | public static double simpleMovingAverageQuick(double Yt, double YtminusN, double Ft, int N) {
"""
Simple Moving Average: Calculates Ft+1 by using previous results. A quick version of the simpleMovingAverage
@param Yt
@param YtminusN
@param Ft
@param N
@return
"""
double SMA=(Yt-YtminusN)/N+Ft;
... | java | public static double simpleMovingAverageQuick(double Yt, double YtminusN, double Ft, int N) {
double SMA=(Yt-YtminusN)/N+Ft;
return SMA;
} | [
"public",
"static",
"double",
"simpleMovingAverageQuick",
"(",
"double",
"Yt",
",",
"double",
"YtminusN",
",",
"double",
"Ft",
",",
"int",
"N",
")",
"{",
"double",
"SMA",
"=",
"(",
"Yt",
"-",
"YtminusN",
")",
"/",
"N",
"+",
"Ft",
";",
"return",
"SMA",
... | Simple Moving Average: Calculates Ft+1 by using previous results. A quick version of the simpleMovingAverage
@param Yt
@param YtminusN
@param Ft
@param N
@return | [
"Simple",
"Moving",
"Average",
":",
"Calculates",
"Ft",
"+",
"1",
"by",
"using",
"previous",
"results",
".",
"A",
"quick",
"version",
"of",
"the",
"simpleMovingAverage"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/timeseries/Smoothing.java#L61-L65 |
google/auto | common/src/main/java/com/google/auto/common/MoreElements.java | MoreElements.isAnnotationPresent | public static boolean isAnnotationPresent(Element element,
Class<? extends Annotation> annotationClass) {
"""
Returns {@code true} iff the given element has an {@link AnnotationMirror} whose
{@linkplain AnnotationMirror#getAnnotationType() annotation type} has the same canonical name
as that of {@code anno... | java | public static boolean isAnnotationPresent(Element element,
Class<? extends Annotation> annotationClass) {
return getAnnotationMirror(element, annotationClass).isPresent();
} | [
"public",
"static",
"boolean",
"isAnnotationPresent",
"(",
"Element",
"element",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"return",
"getAnnotationMirror",
"(",
"element",
",",
"annotationClass",
")",
".",
"isPresent",
"(",... | Returns {@code true} iff the given element has an {@link AnnotationMirror} whose
{@linkplain AnnotationMirror#getAnnotationType() annotation type} has the same canonical name
as that of {@code annotationClass}. This method is a safer alternative to calling
{@link Element#getAnnotation} and checking for {@code null} as ... | [
"Returns",
"{"
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/common/src/main/java/com/google/auto/common/MoreElements.java#L220-L223 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/list/HeaderContentListPanel.java | HeaderContentListPanel.newListPanel | protected Component newListPanel(final String id, final IModel<ContentListModelBean> model) {
"""
Factory method for creating the new {@link Component} for the list panel. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new {@li... | java | protected Component newListPanel(final String id, final IModel<ContentListModelBean> model)
{
return new ResourceBundleKeysPanel(id, model.getObject().getContentResourceKeys())
{
private static final long serialVersionUID = 1L;
@Override
protected Component newListComponent(final String id,
final Li... | [
"protected",
"Component",
"newListPanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"ContentListModelBean",
">",
"model",
")",
"{",
"return",
"new",
"ResourceBundleKeysPanel",
"(",
"id",
",",
"model",
".",
"getObject",
"(",
")",
".",
"getConte... | Factory method for creating the new {@link Component} for the list panel. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new {@link Component} for the list panel.
@param id
the id
@param model
the model
@return the new {@link Compone... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"list",
"panel",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/list/HeaderContentListPanel.java#L147-L161 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.createReportHeader | private void createReportHeader (final ResourceBundle bundle, final Sink sink) {
"""
Create the header and title for the HTML report page.
@param bundle
The resource bundle with the text.
@param sink
The sink for writing to the main report file.
"""
sink.head ();
sink.title ();
sink.text (bun... | java | private void createReportHeader (final ResourceBundle bundle, final Sink sink)
{
sink.head ();
sink.title ();
sink.text (bundle.getString ("report.jjdoc.title"));
sink.title_ ();
sink.head_ ();
sink.body ();
sink.section1 ();
sink.sectionTitle1 ();
sink.text (bundle.getString ("r... | [
"private",
"void",
"createReportHeader",
"(",
"final",
"ResourceBundle",
"bundle",
",",
"final",
"Sink",
"sink",
")",
"{",
"sink",
".",
"head",
"(",
")",
";",
"sink",
".",
"title",
"(",
")",
";",
"sink",
".",
"text",
"(",
"bundle",
".",
"getString",
"(... | Create the header and title for the HTML report page.
@param bundle
The resource bundle with the text.
@param sink
The sink for writing to the main report file. | [
"Create",
"the",
"header",
"and",
"title",
"for",
"the",
"HTML",
"report",
"page",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L416-L440 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java | CommerceShippingMethodPersistenceImpl.findByGroupId | @Override
public List<CommerceShippingMethod> findByGroupId(long groupId) {
"""
Returns all the commerce shipping methods where groupId = ?.
@param groupId the group ID
@return the matching commerce shipping methods
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceShippingMethod> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShippingMethod",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}... | Returns all the commerce shipping methods where groupId = ?.
@param groupId the group ID
@return the matching commerce shipping methods | [
"Returns",
"all",
"the",
"commerce",
"shipping",
"methods",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java#L125-L128 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.orthoSymmetric | public Matrix4x3d orthoSymmetric(double width, double height, double zNear, double zFar, Matrix4x3d dest) {
"""
Apply a symmetric orthographic projection transformation for a right-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>... | java | public Matrix4x3d orthoSymmetric(double width, double height, double zNear, double zFar, Matrix4x3d dest) {
return orthoSymmetric(width, height, zNear, zFar, false, dest);
} | [
"public",
"Matrix4x3d",
"orthoSymmetric",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"Matrix4x3d",
"dest",
")",
"{",
"return",
"orthoSymmetric",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",... | Apply a symmetric orthographic projection transformation for a right-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
<p>
This method is equivalent to calling {@link #ortho(double, double, double, double, double, double, Matrix4x3d) o... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L7127-L7129 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPBatchClientConnectionInterceptor.java | HTTPBatchClientConnectionInterceptor.prepareClientSSL | public SSLConnectionSocketFactory prepareClientSSL() {
"""
Configures proxy if this is applicable to connection
@throws FMSException
"""
try {
String path = Config.getProperty(Config.PROXY_KEYSTORE_PATH);
String pass = Config.getProperty(Config.PROXY_KEYSTORE_PASSWORD);
KeyStore trustSt... | java | public SSLConnectionSocketFactory prepareClientSSL() {
try {
String path = Config.getProperty(Config.PROXY_KEYSTORE_PATH);
String pass = Config.getProperty(Config.PROXY_KEYSTORE_PASSWORD);
KeyStore trustStore = null;
if (path != null && pass != null) {
trustStore = KeyStore.getInstance(Ke... | [
"public",
"SSLConnectionSocketFactory",
"prepareClientSSL",
"(",
")",
"{",
"try",
"{",
"String",
"path",
"=",
"Config",
".",
"getProperty",
"(",
"Config",
".",
"PROXY_KEYSTORE_PATH",
")",
";",
"String",
"pass",
"=",
"Config",
".",
"getProperty",
"(",
"Config",
... | Configures proxy if this is applicable to connection
@throws FMSException | [
"Configures",
"proxy",
"if",
"this",
"is",
"applicable",
"to",
"connection"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPBatchClientConnectionInterceptor.java#L177-L200 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/tm/tmtrafficpolicy_binding.java | tmtrafficpolicy_binding.get | public static tmtrafficpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch tmtrafficpolicy_binding resource of given name .
"""
tmtrafficpolicy_binding obj = new tmtrafficpolicy_binding();
obj.set_name(name);
tmtrafficpolicy_binding response = (tmtrafficpol... | java | public static tmtrafficpolicy_binding get(nitro_service service, String name) throws Exception{
tmtrafficpolicy_binding obj = new tmtrafficpolicy_binding();
obj.set_name(name);
tmtrafficpolicy_binding response = (tmtrafficpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"tmtrafficpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"tmtrafficpolicy_binding",
"obj",
"=",
"new",
"tmtrafficpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"nam... | Use this API to fetch tmtrafficpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"tmtrafficpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/tm/tmtrafficpolicy_binding.java#L125-L130 |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java | HandlerManager.getMethodScope | private Scope getMethodScope(boolean isDestroy, Method method) {
"""
return the scope of a lifecycle method, or null if the method is not a lifecycle method
"""
Scope methodScope;
if ( isDestroy ) {
Destroy annotation = method.getAnnotation(Destroy.class);
methodScope = ... | java | private Scope getMethodScope(boolean isDestroy, Method method) {
Scope methodScope;
if ( isDestroy ) {
Destroy annotation = method.getAnnotation(Destroy.class);
methodScope = annotation != null ? annotation.scope() : null;
} else {
Initialize annotation = meth... | [
"private",
"Scope",
"getMethodScope",
"(",
"boolean",
"isDestroy",
",",
"Method",
"method",
")",
"{",
"Scope",
"methodScope",
";",
"if",
"(",
"isDestroy",
")",
"{",
"Destroy",
"annotation",
"=",
"method",
".",
"getAnnotation",
"(",
"Destroy",
".",
"class",
"... | return the scope of a lifecycle method, or null if the method is not a lifecycle method | [
"return",
"the",
"scope",
"of",
"a",
"lifecycle",
"method",
"or",
"null",
"if",
"the",
"method",
"is",
"not",
"a",
"lifecycle",
"method"
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java#L190-L200 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/util/ArrayUtil.java | ArrayUtil.readLong | public static long readLong(byte b[], int offset) {
"""
Unserializes a long from a byte array at a specific offset in big-endian order
@param b byte array from which to read a long value.
@param offset offset within byte array to start reading.
@return long read from byte array.
"""
long retValue;
... | java | public static long readLong(byte b[], int offset) {
long retValue;
retValue = ((long)b[offset++]) << 56;
retValue |= ((long)b[offset++] & 0xff) << 48;
retValue |= ((long)b[offset++] & 0xff) << 40;
retValue |= ((long)b[offset++] & 0xff) << 32;
retValue |= ((long)b[offset++] & 0xff) << 24;
re... | [
"public",
"static",
"long",
"readLong",
"(",
"byte",
"b",
"[",
"]",
",",
"int",
"offset",
")",
"{",
"long",
"retValue",
";",
"retValue",
"=",
"(",
"(",
"long",
")",
"b",
"[",
"offset",
"++",
"]",
")",
"<<",
"56",
";",
"retValue",
"|=",
"(",
"(",
... | Unserializes a long from a byte array at a specific offset in big-endian order
@param b byte array from which to read a long value.
@param offset offset within byte array to start reading.
@return long read from byte array. | [
"Unserializes",
"a",
"long",
"from",
"a",
"byte",
"array",
"at",
"a",
"specific",
"offset",
"in",
"big",
"-",
"endian",
"order"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/util/ArrayUtil.java#L46-L59 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.generate | public static File generate(String content, int width, int height, File targetFile) {
"""
生成二维码到文件,二维码图片格式取决于文件的扩展名
@param content 文本内容
@param width 宽度
@param height 高度
@param targetFile 目标文件,扩展名决定输出格式
@return 目标文件
"""
final BufferedImage image = generate(content, width, height);
ImgUtil.write(ima... | java | public static File generate(String content, int width, int height, File targetFile) {
final BufferedImage image = generate(content, width, height);
ImgUtil.write(image, targetFile);
return targetFile;
} | [
"public",
"static",
"File",
"generate",
"(",
"String",
"content",
",",
"int",
"width",
",",
"int",
"height",
",",
"File",
"targetFile",
")",
"{",
"final",
"BufferedImage",
"image",
"=",
"generate",
"(",
"content",
",",
"width",
",",
"height",
")",
";",
"... | 生成二维码到文件,二维码图片格式取决于文件的扩展名
@param content 文本内容
@param width 宽度
@param height 高度
@param targetFile 目标文件,扩展名决定输出格式
@return 目标文件 | [
"生成二维码到文件,二维码图片格式取决于文件的扩展名"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L76-L80 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/SmartsheetFactory.java | SmartsheetFactory.createDefaultClient | public static Smartsheet createDefaultClient() {
"""
<p>Creates a Smartsheet client with default parameters. SMARTSHEET_ACCESS_TOKEN
must be set in the environment.</p>
@return the Smartsheet client
"""
String accessToken = System.getenv("SMARTSHEET_ACCESS_TOKEN");
SmartsheetImpl smartsheet... | java | public static Smartsheet createDefaultClient() {
String accessToken = System.getenv("SMARTSHEET_ACCESS_TOKEN");
SmartsheetImpl smartsheet = new SmartsheetImpl(DEFAULT_BASE_URI, accessToken);
return smartsheet;
} | [
"public",
"static",
"Smartsheet",
"createDefaultClient",
"(",
")",
"{",
"String",
"accessToken",
"=",
"System",
".",
"getenv",
"(",
"\"SMARTSHEET_ACCESS_TOKEN\"",
")",
";",
"SmartsheetImpl",
"smartsheet",
"=",
"new",
"SmartsheetImpl",
"(",
"DEFAULT_BASE_URI",
",",
"... | <p>Creates a Smartsheet client with default parameters. SMARTSHEET_ACCESS_TOKEN
must be set in the environment.</p>
@return the Smartsheet client | [
"<p",
">",
"Creates",
"a",
"Smartsheet",
"client",
"with",
"default",
"parameters",
".",
"SMARTSHEET_ACCESS_TOKEN",
"must",
"be",
"set",
"in",
"the",
"environment",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/SmartsheetFactory.java#L47-L51 |
aws/aws-sdk-java | aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/LaunchConfig.java | LaunchConfig.withEnvironmentVariables | public LaunchConfig withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
"""
<p>
The environment variables for the application launch.
</p>
@param environmentVariables
The environment variables for the application launch.
@return Returns a reference to this object so that method ca... | java | public LaunchConfig withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
setEnvironmentVariables(environmentVariables);
return this;
} | [
"public",
"LaunchConfig",
"withEnvironmentVariables",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"environmentVariables",
")",
"{",
"setEnvironmentVariables",
"(",
"environmentVariables",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The environment variables for the application launch.
</p>
@param environmentVariables
The environment variables for the application launch.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"environment",
"variables",
"for",
"the",
"application",
"launch",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/LaunchConfig.java#L165-L168 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/Streams.java | Streams.skipByReading | public static long skipByReading(InputStream in, long byteCount) throws IOException {
"""
Skip <b>at most</b> {@code byteCount} bytes from {@code in} by calling read
repeatedly until either the stream is exhausted or we read fewer bytes than
we ask for.
<p>This method reuses the skip buffer but is careful to ... | java | public static long skipByReading(InputStream in, long byteCount) throws IOException {
// acquire the shared skip buffer.
byte[] buffer = skipBuffer.getAndSet(null);
if (buffer == null) {
buffer = new byte[4096];
}
long skipped = 0;
while (skipped < byteCount)... | [
"public",
"static",
"long",
"skipByReading",
"(",
"InputStream",
"in",
",",
"long",
"byteCount",
")",
"throws",
"IOException",
"{",
"// acquire the shared skip buffer.",
"byte",
"[",
"]",
"buffer",
"=",
"skipBuffer",
".",
"getAndSet",
"(",
"null",
")",
";",
"if"... | Skip <b>at most</b> {@code byteCount} bytes from {@code in} by calling read
repeatedly until either the stream is exhausted or we read fewer bytes than
we ask for.
<p>This method reuses the skip buffer but is careful to never use it at
the same time that another stream is using it. Otherwise streams that use
the calle... | [
"Skip",
"<b",
">",
"at",
"most<",
"/",
"b",
">",
"{",
"@code",
"byteCount",
"}",
"bytes",
"from",
"{",
"@code",
"in",
"}",
"by",
"calling",
"read",
"repeatedly",
"until",
"either",
"the",
"stream",
"is",
"exhausted",
"or",
"we",
"read",
"fewer",
"bytes... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/Streams.java#L149-L173 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ClustersInner.java | ClustersInner.beginCreate | public ClusterInner beginCreate(String resourceGroupName, String workspaceName, String clusterName, ClusterCreateParameters parameters) {
"""
Creates a Cluster in the given Workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspa... | java | public ClusterInner beginCreate(String resourceGroupName, String workspaceName, String clusterName, ClusterCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, clusterName, parameters).toBlocking().single().body();
} | [
"public",
"ClusterInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"clusterName",
",",
"ClusterCreateParameters",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Creates a Cluster in the given Workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through ... | [
"Creates",
"a",
"Cluster",
"in",
"the",
"given",
"Workspace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ClustersInner.java#L680-L682 |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java | ClientFactory.getNamedConfig | public static IClientConfig getNamedConfig(String name, Class<? extends IClientConfig> clientConfigClass) {
"""
Get the client configuration given the name or create one with clientConfigClass if it does not exist. An instance of IClientConfig
is created and {@link IClientConfig#loadProperties(String)} will be ca... | java | public static IClientConfig getNamedConfig(String name, Class<? extends IClientConfig> clientConfigClass) {
return getNamedConfig(name, factoryFromConfigType(clientConfigClass));
} | [
"public",
"static",
"IClientConfig",
"getNamedConfig",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
"extends",
"IClientConfig",
">",
"clientConfigClass",
")",
"{",
"return",
"getNamedConfig",
"(",
"name",
",",
"factoryFromConfigType",
"(",
"clientConfigClass",
")"... | Get the client configuration given the name or create one with clientConfigClass if it does not exist. An instance of IClientConfig
is created and {@link IClientConfig#loadProperties(String)} will be called. | [
"Get",
"the",
"client",
"configuration",
"given",
"the",
"name",
"or",
"create",
"one",
"with",
"clientConfigClass",
"if",
"it",
"does",
"not",
"exist",
".",
"An",
"instance",
"of",
"IClientConfig",
"is",
"created",
"and",
"{"
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java#L253-L255 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.