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 |
|---|---|---|---|---|---|---|---|---|---|---|
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java | Cells.getBigInteger | public BigInteger getBigInteger(String nameSpace, String cellName) {
"""
Returns the {@code BigInteger} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or
null if this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cell... | java | public BigInteger getBigInteger(String nameSpace, String cellName) {
return getValue(nameSpace, cellName, BigInteger.class);
} | [
"public",
"BigInteger",
"getBigInteger",
"(",
"String",
"nameSpace",
",",
"String",
"cellName",
")",
"{",
"return",
"getValue",
"(",
"nameSpace",
",",
"cellName",
",",
"BigInteger",
".",
"class",
")",
";",
"}"
] | Returns the {@code BigInteger} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or
null if this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the name of the Cell we want to retrieve from this Cells object.
@return the... | [
"Returns",
"the",
"{",
"@code",
"BigInteger",
"}",
"value",
"of",
"the",
"{",
"@link",
"Cell",
"}",
"(",
"associated",
"to",
"{",
"@code",
"table",
"}",
")",
"whose",
"name",
"iscellName",
"or",
"null",
"if",
"this",
"Cells",
"object",
"contains",
"no",
... | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1219-L1221 |
arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java | KubernetesAssistant.deployAll | public void deployAll(String applicationName, Path directory) throws IOException {
"""
Deploys all y(a)ml and json files located at given directory.
@param applicationName to configure in cluster
@param directory where resources files are stored
@throws IOException
"""
this.applicationName =... | java | public void deployAll(String applicationName, Path directory) throws IOException {
this.applicationName = applicationName;
if (Files.isDirectory(directory)) {
Files.list(directory)
.filter(ResourceFilter::filterKubernetesResource)
.map(p -> {
... | [
"public",
"void",
"deployAll",
"(",
"String",
"applicationName",
",",
"Path",
"directory",
")",
"throws",
"IOException",
"{",
"this",
".",
"applicationName",
"=",
"applicationName",
";",
"if",
"(",
"Files",
".",
"isDirectory",
"(",
"directory",
")",
")",
"{",
... | Deploys all y(a)ml and json files located at given directory.
@param applicationName to configure in cluster
@param directory where resources files are stored
@throws IOException | [
"Deploys",
"all",
"y",
"(",
"a",
")",
"ml",
"and",
"json",
"files",
"located",
"at",
"given",
"directory",
"."
] | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L199-L223 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.getObjectProp | public static Object getObjectProp(Object obj, String property,
Context cx, Scriptable scope) {
"""
Version of getObjectElem when elem is a valid JS identifier name.
@param scope the scope that should be used to resolve primitive prototype
"""
Scriptable sobj =... | java | public static Object getObjectProp(Object obj, String property,
Context cx, Scriptable scope)
{
Scriptable sobj = toObjectOrNull(cx, obj, scope);
if (sobj == null) {
throw undefReadError(obj, property);
}
return getObjectProp(sobj, p... | [
"public",
"static",
"Object",
"getObjectProp",
"(",
"Object",
"obj",
",",
"String",
"property",
",",
"Context",
"cx",
",",
"Scriptable",
"scope",
")",
"{",
"Scriptable",
"sobj",
"=",
"toObjectOrNull",
"(",
"cx",
",",
"obj",
",",
"scope",
")",
";",
"if",
... | Version of getObjectElem when elem is a valid JS identifier name.
@param scope the scope that should be used to resolve primitive prototype | [
"Version",
"of",
"getObjectElem",
"when",
"elem",
"is",
"a",
"valid",
"JS",
"identifier",
"name",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1575-L1583 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/nfs/nfs3/Nfs3.java | Nfs3.makeReaddirplusRequest | public NfsReaddirplusRequest makeReaddirplusRequest(byte[] directoryFileHandle, long cookie, long cookieverf,
int dircount, int maxcount) throws FileNotFoundException {
"""
/* (non-Javadoc)
@see com.emc.ecs.nfsclient.nfs.Nfs#makeReaddirplusRequest(byte[], long, long, int, int)
"""
return n... | java | public NfsReaddirplusRequest makeReaddirplusRequest(byte[] directoryFileHandle, long cookie, long cookieverf,
int dircount, int maxcount) throws FileNotFoundException {
return new Nfs3ReaddirplusRequest(directoryFileHandle, cookie, cookieverf, dircount, maxcount, _credential);
} | [
"public",
"NfsReaddirplusRequest",
"makeReaddirplusRequest",
"(",
"byte",
"[",
"]",
"directoryFileHandle",
",",
"long",
"cookie",
",",
"long",
"cookieverf",
",",
"int",
"dircount",
",",
"int",
"maxcount",
")",
"throws",
"FileNotFoundException",
"{",
"return",
"new",... | /* (non-Javadoc)
@see com.emc.ecs.nfsclient.nfs.Nfs#makeReaddirplusRequest(byte[], long, long, int, int) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/nfs/nfs3/Nfs3.java#L1130-L1133 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/AccountsApi.java | AccountsApi.deleteCustomField | public void deleteCustomField(String accountId, String customFieldId, AccountsApi.DeleteCustomFieldOptions options) throws ApiException {
"""
Delete an existing account custom field.
@param accountId The external account number (int) or account ID Guid. (required)
@param customFieldId (required)
@param optio... | java | public void deleteCustomField(String accountId, String customFieldId, AccountsApi.DeleteCustomFieldOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the requi... | [
"public",
"void",
"deleteCustomField",
"(",
"String",
"accountId",
",",
"String",
"customFieldId",
",",
"AccountsApi",
".",
"DeleteCustomFieldOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"\"{}\"",
";",
"// verify the requir... | Delete an existing account custom field.
@param accountId The external account number (int) or account ID Guid. (required)
@param customFieldId (required)
@param options for modifying the method behavior.
@throws ApiException if fails to make API call | [
"Delete",
"an",
"existing",
"account",
"custom",
"field",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/AccountsApi.java#L603-L645 |
BradleyWood/Software-Quality-Test-Framework | sqtf-core/src/main/java/org/sqtf/assertions/Assert.java | Assert.assertEquals | public static void assertEquals(float expected, float actual, float delta) {
"""
Asserts that the two floats are equal. If they are not
the test will fail
@param expected The expected value
@param actual The actual value
@param delta The maximum amount that expected and actual values may deviate by
... | java | public static void assertEquals(float expected, float actual, float delta) {
assertEquals(expected, actual, delta, "Expected " + expected + " +- " + delta + " but got " + actual);
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"float",
"expected",
",",
"float",
"actual",
",",
"float",
"delta",
")",
"{",
"assertEquals",
"(",
"expected",
",",
"actual",
",",
"delta",
",",
"\"Expected \"",
"+",
"expected",
"+",
"\" +- \"",
"+",
"delta",... | Asserts that the two floats are equal. If they are not
the test will fail
@param expected The expected value
@param actual The actual value
@param delta The maximum amount that expected and actual values may deviate by | [
"Asserts",
"that",
"the",
"two",
"floats",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"the",
"test",
"will",
"fail"
] | train | https://github.com/BradleyWood/Software-Quality-Test-Framework/blob/010dea3bfc8e025a4304ab9ef4a213c1adcb1aa0/sqtf-core/src/main/java/org/sqtf/assertions/Assert.java#L125-L127 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java | FilesInner.readWriteAsync | public Observable<FileStorageInfoInner> readWriteAsync(String groupName, String serviceName, String projectName, String fileName) {
"""
Request information for reading and writing file content.
This method is used for requesting information for reading and writing the file content.
@param groupName Name of the... | java | public Observable<FileStorageInfoInner> readWriteAsync(String groupName, String serviceName, String projectName, String fileName) {
return readWriteWithServiceResponseAsync(groupName, serviceName, projectName, fileName).map(new Func1<ServiceResponse<FileStorageInfoInner>, FileStorageInfoInner>() {
@... | [
"public",
"Observable",
"<",
"FileStorageInfoInner",
">",
"readWriteAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"String",
"fileName",
")",
"{",
"return",
"readWriteWithServiceResponseAsync",
"(",
"groupName",
",... | Request information for reading and writing file content.
This method is used for requesting information for reading and writing the file content.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param fileName Name of the File
@throws IllegalAr... | [
"Request",
"information",
"for",
"reading",
"and",
"writing",
"file",
"content",
".",
"This",
"method",
"is",
"used",
"for",
"requesting",
"information",
"for",
"reading",
"and",
"writing",
"the",
"file",
"content",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java#L817-L824 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/RandomMatrices_DDRM.java | RandomMatrices_DDRM.symmetricWithEigenvalues | public static DMatrixRMaj symmetricWithEigenvalues(int num, Random rand , double ...eigenvalues ) {
"""
Creates a new random symmetric matrix that will have the specified real eigenvalues.
@param num Dimension of the resulting matrix.
@param rand Random number generator.
@param eigenvalues Set of real eigenva... | java | public static DMatrixRMaj symmetricWithEigenvalues(int num, Random rand , double ...eigenvalues ) {
DMatrixRMaj V = RandomMatrices_DDRM.orthogonal(num,num,rand);
DMatrixRMaj D = CommonOps_DDRM.diag(eigenvalues);
DMatrixRMaj temp = new DMatrixRMaj(num,num);
CommonOps_DDRM.mult(V,D,temp)... | [
"public",
"static",
"DMatrixRMaj",
"symmetricWithEigenvalues",
"(",
"int",
"num",
",",
"Random",
"rand",
",",
"double",
"...",
"eigenvalues",
")",
"{",
"DMatrixRMaj",
"V",
"=",
"RandomMatrices_DDRM",
".",
"orthogonal",
"(",
"num",
",",
"num",
",",
"rand",
")",... | Creates a new random symmetric matrix that will have the specified real eigenvalues.
@param num Dimension of the resulting matrix.
@param rand Random number generator.
@param eigenvalues Set of real eigenvalues that the matrix will have.
@return A random matrix with the specified eigenvalues. | [
"Creates",
"a",
"new",
"random",
"symmetric",
"matrix",
"that",
"will",
"have",
"the",
"specified",
"real",
"eigenvalues",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/RandomMatrices_DDRM.java#L247-L257 |
tvesalainen/util | rpm/src/main/java/org/vesalainen/pm/rpm/RPMBuilder.java | RPMBuilder.addSymbolicLink | @Override
public FileBuilder addSymbolicLink(Path target, Path linkTarget) throws IOException {
"""
Add symbolic link to package.
@param target Target path like /opt/application/bin/foo
@param linkTarget Link target like ../lib/bar
@return
@throws IOException
"""
checkTarget(target);
ch... | java | @Override
public FileBuilder addSymbolicLink(Path target, Path linkTarget) throws IOException
{
checkTarget(target);
checkTarget(linkTarget);
FileBuilder fb = new FileBuilder();
fb.target = target;
fb.linkTo = linkTarget;
fb.content = ByteBuffer.wrap(PathHelper.po... | [
"@",
"Override",
"public",
"FileBuilder",
"addSymbolicLink",
"(",
"Path",
"target",
",",
"Path",
"linkTarget",
")",
"throws",
"IOException",
"{",
"checkTarget",
"(",
"target",
")",
";",
"checkTarget",
"(",
"linkTarget",
")",
";",
"FileBuilder",
"fb",
"=",
"new... | Add symbolic link to package.
@param target Target path like /opt/application/bin/foo
@param linkTarget Link target like ../lib/bar
@return
@throws IOException | [
"Add",
"symbolic",
"link",
"to",
"package",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/rpm/src/main/java/org/vesalainen/pm/rpm/RPMBuilder.java#L402-L416 |
JOML-CI/JOML | src/org/joml/Matrix3f.java | Matrix3f.rotateXYZ | public Matrix3f rotateXYZ(Vector3f angles) {
"""
Apply rotation of <code>angles.x</code> radians about the X axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate s... | java | public Matrix3f rotateXYZ(Vector3f angles) {
return rotateXYZ(angles.x, angles.y, angles.z);
} | [
"public",
"Matrix3f",
"rotateXYZ",
"(",
"Vector3f",
"angles",
")",
"{",
"return",
"rotateXYZ",
"(",
"angles",
".",
"x",
",",
"angles",
".",
"y",
",",
"angles",
".",
"z",
")",
";",
"}"
] | Apply rotation of <code>angles.x</code> radians about the X axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"x<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L2019-L2021 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/OrdersInner.java | OrdersInner.beginCreateOrUpdate | public OrderInner beginCreateOrUpdate(String deviceName, String resourceGroupName, OrderInner order) {
"""
Creates or updates an order.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param order The order to be created or updated.
@throws IllegalArgumentException thrown... | java | public OrderInner beginCreateOrUpdate(String deviceName, String resourceGroupName, OrderInner order) {
return beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order).toBlocking().single().body();
} | [
"public",
"OrderInner",
"beginCreateOrUpdate",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
",",
"OrderInner",
"order",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGroupName",
",",
"order",
")",
... | Creates or updates an order.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param order The order to be created or updated.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws Runtime... | [
"Creates",
"or",
"updates",
"an",
"order",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/OrdersInner.java#L392-L394 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/SnsAPI.java | SnsAPI.oauth2ComponentRefreshToken | public static SnsToken oauth2ComponentRefreshToken(String appid,String refresh_token,String component_appid,String component_access_token) {
"""
刷新access_token (第三方平台开发)
@param appid appid
@param refresh_token refresh_token
@param component_appid 服务开发商的appid
@param component_access_token 服务开发方的access_token
@r... | java | public static SnsToken oauth2ComponentRefreshToken(String appid,String refresh_token,String component_appid,String component_access_token){
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setUri(BASE_URI + "/sns/oauth2/component/refresh_token")
.addParameter("appid", appid)
.addParameter("refresh_t... | [
"public",
"static",
"SnsToken",
"oauth2ComponentRefreshToken",
"(",
"String",
"appid",
",",
"String",
"refresh_token",
",",
"String",
"component_appid",
",",
"String",
"component_access_token",
")",
"{",
"HttpUriRequest",
"httpUriRequest",
"=",
"RequestBuilder",
".",
"p... | 刷新access_token (第三方平台开发)
@param appid appid
@param refresh_token refresh_token
@param component_appid 服务开发商的appid
@param component_access_token 服务开发方的access_token
@return SnsToken | [
"刷新access_token",
"(",
"第三方平台开发",
")"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/SnsAPI.java#L90-L100 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfCell.java | PdfCell.getImages | public ArrayList getImages(float top, float bottom) {
"""
Gets the images of a cell that can be drawn between certain limits.
<P>
Remark: all the lines that can be drawn are removed from the object!
@param top the top of the part of the table that can be drawn
@param bottom the bottom of the part of the tab... | java | public ArrayList getImages(float top, float bottom) {
// if the bottom of the page is higher than the top of the cell: do nothing
if (getTop() < bottom) {
return new ArrayList();
}
top = Math.min(getTop(), top);
// initializations
Image image;
float h... | [
"public",
"ArrayList",
"getImages",
"(",
"float",
"top",
",",
"float",
"bottom",
")",
"{",
"// if the bottom of the page is higher than the top of the cell: do nothing",
"if",
"(",
"getTop",
"(",
")",
"<",
"bottom",
")",
"{",
"return",
"new",
"ArrayList",
"(",
")",
... | Gets the images of a cell that can be drawn between certain limits.
<P>
Remark: all the lines that can be drawn are removed from the object!
@param top the top of the part of the table that can be drawn
@param bottom the bottom of the part of the table that can be drawn
@return an <CODE>ArrayList</CODE> of <CODE>Imag... | [
"Gets",
"the",
"images",
"of",
"a",
"cell",
"that",
"can",
"be",
"drawn",
"between",
"certain",
"limits",
".",
"<P",
">",
"Remark",
":",
"all",
"the",
"lines",
"that",
"can",
"be",
"drawn",
"are",
"removed",
"from",
"the",
"object!"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfCell.java#L624-L647 |
undertow-io/undertow | core/src/main/java/io/undertow/server/Connectors.java | Connectors.setExchangeRequestPath | @Deprecated
public static void setExchangeRequestPath(final HttpServerExchange exchange, final String encodedPath, final String charset, boolean decode, final boolean allowEncodedSlash, StringBuilder decodeBuffer) {
"""
Sets the request path and query parameters, decoding to the requested charset.
@param ex... | java | @Deprecated
public static void setExchangeRequestPath(final HttpServerExchange exchange, final String encodedPath, final String charset, boolean decode, final boolean allowEncodedSlash, StringBuilder decodeBuffer) {
try {
setExchangeRequestPath(exchange, encodedPath, charset, decode, allowEncode... | [
"@",
"Deprecated",
"public",
"static",
"void",
"setExchangeRequestPath",
"(",
"final",
"HttpServerExchange",
"exchange",
",",
"final",
"String",
"encodedPath",
",",
"final",
"String",
"charset",
",",
"boolean",
"decode",
",",
"final",
"boolean",
"allowEncodedSlash",
... | Sets the request path and query parameters, decoding to the requested charset.
@param exchange The exchange
@param encodedPath The encoded path
@param charset The charset | [
"Sets",
"the",
"request",
"path",
"and",
"query",
"parameters",
"decoding",
"to",
"the",
"requested",
"charset",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/Connectors.java#L415-L422 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java | SpiceManager.removeDataFromCache | public <T> Future<?> removeDataFromCache(final Class<T> clazz) {
"""
Remove some specific content from cache
@param clazz
the type of data you want to remove from cache.
"""
if (clazz == null) {
throw new IllegalArgumentException("Clazz must be non null.");
}
return execut... | java | public <T> Future<?> removeDataFromCache(final Class<T> clazz) {
if (clazz == null) {
throw new IllegalArgumentException("Clazz must be non null.");
}
return executeCommand(new RemoveDataClassFromCacheCommand(this, clazz));
} | [
"public",
"<",
"T",
">",
"Future",
"<",
"?",
">",
"removeDataFromCache",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Clazz must be non null.\"",
")... | Remove some specific content from cache
@param clazz
the type of data you want to remove from cache. | [
"Remove",
"some",
"specific",
"content",
"from",
"cache"
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L989-L994 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/GISTreeSetUtil.java | GISTreeSetUtil.addInside | static <P extends GISPrimitive, N extends AbstractGISTreeSetNode<P, N>>
boolean addInside(AbstractGISTreeSet<P, N> tree,
N insertionNode,
P element,
GISTreeSetNodeFactory<P, N> builder) {
"""
Add the given element inside the given node (or one of its children).
@param <P> is the type of the primitive... | java | static <P extends GISPrimitive, N extends AbstractGISTreeSetNode<P, N>>
boolean addInside(AbstractGISTreeSet<P, N> tree,
N insertionNode,
P element,
GISTreeSetNodeFactory<P, N> builder) {
return addInside(tree, insertionNode, element, builder, true);
} | [
"static",
"<",
"P",
"extends",
"GISPrimitive",
",",
"N",
"extends",
"AbstractGISTreeSetNode",
"<",
"P",
",",
"N",
">",
">",
"boolean",
"addInside",
"(",
"AbstractGISTreeSet",
"<",
"P",
",",
"N",
">",
"tree",
",",
"N",
"insertionNode",
",",
"P",
"element",
... | Add the given element inside the given node (or one of its children).
@param <P> is the type of the primitives.
@param <N> is the type of the nodes.
@param tree is the tree to update.
@param insertionNode the receiving node.
@param element the element to insert.
@param builder is the node factory.
@return success stat... | [
"Add",
"the",
"given",
"element",
"inside",
"the",
"given",
"node",
"(",
"or",
"one",
"of",
"its",
"children",
")",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/GISTreeSetUtil.java#L157-L163 |
ragunathjawahar/adapter-kit | samples/src/com/mobsandgeeks/adapters/samples/TabListener.java | TabListener.onTabSelected | public void onTabSelected(Tab tab, FragmentTransaction ft) {
"""
/* The following are each of the ActionBar.TabListener callbacks
"""
// Check if the fragment is already initialized
if (mFragment == null) {
// If not, instantiate and add it to the activity
mFragment = Fragment.instantiate(mActivity, ... | java | public void onTabSelected(Tab tab, FragmentTransaction ft) {
// Check if the fragment is already initialized
if (mFragment == null) {
// If not, instantiate and add it to the activity
mFragment = Fragment.instantiate(mActivity, mClass.getName());
ft.add(android.R.id.content, mFragment, mTag);
} else {
... | [
"public",
"void",
"onTabSelected",
"(",
"Tab",
"tab",
",",
"FragmentTransaction",
"ft",
")",
"{",
"// Check if the fragment is already initialized",
"if",
"(",
"mFragment",
"==",
"null",
")",
"{",
"// If not, instantiate and add it to the activity",
"mFragment",
"=",
"Fra... | /* The following are each of the ActionBar.TabListener callbacks | [
"/",
"*",
"The",
"following",
"are",
"each",
"of",
"the",
"ActionBar",
".",
"TabListener",
"callbacks"
] | train | https://github.com/ragunathjawahar/adapter-kit/blob/e5c13458c7f6dcc1c61410f9cfb55cd24bd31ca2/samples/src/com/mobsandgeeks/adapters/samples/TabListener.java#L33-L43 |
lessthanoptimal/BoofCV | integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java | StreamOpenKinectRgbDepth.start | public void start( Device device , Resolution resolution , Listener listener ) {
"""
Adds listeners to the device and sets its resolutions.
@param device Kinect device
@param resolution Resolution that images are being processed at. Must be medium for now
@param listener Listener for data
"""
if( resolut... | java | public void start( Device device , Resolution resolution , Listener listener )
{
if( resolution != Resolution.MEDIUM ) {
throw new IllegalArgumentException("Depth image is always at medium resolution. Possible bug in kinect driver");
}
this.device = device;
this.listener = listener;
// Configure the ki... | [
"public",
"void",
"start",
"(",
"Device",
"device",
",",
"Resolution",
"resolution",
",",
"Listener",
"listener",
")",
"{",
"if",
"(",
"resolution",
"!=",
"Resolution",
".",
"MEDIUM",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Depth image is a... | Adds listeners to the device and sets its resolutions.
@param device Kinect device
@param resolution Resolution that images are being processed at. Must be medium for now
@param listener Listener for data | [
"Adds",
"listeners",
"to",
"the",
"device",
"and",
"sets",
"its",
"resolutions",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-openkinect/src/main/java/boofcv/openkinect/StreamOpenKinectRgbDepth.java#L66-L108 |
doubledutch/LazyJSON | src/main/java/me/doubledutch/lazyjson/LazyArray.java | LazyArray.getJSONObject | public LazyObject getJSONObject(int index) throws LazyException {
"""
Returns the JSON object stored at the given index.
@param index the location of the value in this array
@return the value if it could be parsed as a JSON object
@throws LazyException if the index is out of bounds
"""
LazyNode token=ge... | java | public LazyObject getJSONObject(int index) throws LazyException{
LazyNode token=getValueToken(index);
if(token.type!=LazyNode.OBJECT)throw new LazyException("Requested value is not an object",token);
LazyObject obj= new LazyObject(token);
obj.parent=this;
return obj;
} | [
"public",
"LazyObject",
"getJSONObject",
"(",
"int",
"index",
")",
"throws",
"LazyException",
"{",
"LazyNode",
"token",
"=",
"getValueToken",
"(",
"index",
")",
";",
"if",
"(",
"token",
".",
"type",
"!=",
"LazyNode",
".",
"OBJECT",
")",
"throw",
"new",
"La... | Returns the JSON object stored at the given index.
@param index the location of the value in this array
@return the value if it could be parsed as a JSON object
@throws LazyException if the index is out of bounds | [
"Returns",
"the",
"JSON",
"object",
"stored",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/doubledutch/LazyJSON/blob/1a223f57fc0cb9941bc175739697ac95da5618cc/src/main/java/me/doubledutch/lazyjson/LazyArray.java#L468-L474 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/Chronology.java | Chronology.getDisplayName | public String getDisplayName(TextStyle style, Locale locale) {
"""
Gets the textual representation of this chronology.
<p>
This returns the textual name used to identify the chronology.
The parameters control the style of the returned text and the locale.
@param style the style of the text required, not nul... | java | public String getDisplayName(TextStyle style, Locale locale) {
return new DateTimeFormatterBuilder().appendChronologyText(style).toFormatter(locale).format(new DefaultInterfaceTemporalAccessor() {
@Override
public boolean isSupported(TemporalField field) {
return false;
... | [
"public",
"String",
"getDisplayName",
"(",
"TextStyle",
"style",
",",
"Locale",
"locale",
")",
"{",
"return",
"new",
"DateTimeFormatterBuilder",
"(",
")",
".",
"appendChronologyText",
"(",
"style",
")",
".",
"toFormatter",
"(",
"locale",
")",
".",
"format",
"(... | Gets the textual representation of this chronology.
<p>
This returns the textual name used to identify the chronology.
The parameters control the style of the returned text and the locale.
@param style the style of the text required, not null
@param locale the locale to use, not null
@return the text value of the ch... | [
"Gets",
"the",
"textual",
"representation",
"of",
"this",
"chronology",
".",
"<p",
">",
"This",
"returns",
"the",
"textual",
"name",
"used",
"to",
"identify",
"the",
"chronology",
".",
"The",
"parameters",
"control",
"the",
"style",
"of",
"the",
"returned",
... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/Chronology.java#L753-L772 |
recruit-mp/android-RMP-Appirater | library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java | RmpAppirater.tryToShowPrompt | public static void tryToShowPrompt(Context context, Options options, OnCompleteListener onCompleteListener) {
"""
Show rating dialog.
<p/>
The dialog will be showed if the user hasn't declined to rate or hasn't rated current version.
@param context Context
@param options RMP-Appirater o... | java | public static void tryToShowPrompt(Context context, Options options, OnCompleteListener onCompleteListener) {
tryToShowPrompt(context, null, options, onCompleteListener);
} | [
"public",
"static",
"void",
"tryToShowPrompt",
"(",
"Context",
"context",
",",
"Options",
"options",
",",
"OnCompleteListener",
"onCompleteListener",
")",
"{",
"tryToShowPrompt",
"(",
"context",
",",
"null",
",",
"options",
",",
"onCompleteListener",
")",
";",
"}"... | Show rating dialog.
<p/>
The dialog will be showed if the user hasn't declined to rate or hasn't rated current version.
@param context Context
@param options RMP-Appirater options.
@param onCompleteListener Listener which be called after process of review dialog finished. | [
"Show",
"rating",
"dialog",
".",
"<p",
"/",
">",
"The",
"dialog",
"will",
"be",
"showed",
"if",
"the",
"user",
"hasn",
"t",
"declined",
"to",
"rate",
"or",
"hasn",
"t",
"rated",
"current",
"version",
"."
] | train | https://github.com/recruit-mp/android-RMP-Appirater/blob/14fcdf110dfb97120303f39aab1de9393e84b90a/library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java#L205-L207 |
Waikato/moa | moa/src/main/java/weka/core/MOAUtils.java | MOAUtils.fromCommandLine | public static MOAObject fromCommandLine(ClassOption option, String commandline) {
"""
Turns a commandline into an object (classname + optional options).
@param option the corresponding class option
@param commandline the commandline to turn into an object
@return the generated oblect
"""
return fromCom... | java | public static MOAObject fromCommandLine(ClassOption option, String commandline) {
return fromCommandLine(option.getRequiredType(), commandline);
} | [
"public",
"static",
"MOAObject",
"fromCommandLine",
"(",
"ClassOption",
"option",
",",
"String",
"commandline",
")",
"{",
"return",
"fromCommandLine",
"(",
"option",
".",
"getRequiredType",
"(",
")",
",",
"commandline",
")",
";",
"}"
] | Turns a commandline into an object (classname + optional options).
@param option the corresponding class option
@param commandline the commandline to turn into an object
@return the generated oblect | [
"Turns",
"a",
"commandline",
"into",
"an",
"object",
"(",
"classname",
"+",
"optional",
"options",
")",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/weka/core/MOAUtils.java#L43-L45 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/utilities/FileUtils.java | FileUtils.createTempDir | public static File createTempDir(String prefix, File directory) throws IOException {
"""
Create a temporary directory.
@param prefix
@param directory
@return java.io.File temporary directory
@throws IOException
"""
File tempFile = File.createTempFile(prefix, "", directory);
if (!tempFile.... | java | public static File createTempDir(String prefix, File directory) throws IOException {
File tempFile = File.createTempFile(prefix, "", directory);
if (!tempFile.delete())
throw new IOException();
if (!tempFile.mkdir())
throw new IOException();
return tempFile;
} | [
"public",
"static",
"File",
"createTempDir",
"(",
"String",
"prefix",
",",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"File",
"tempFile",
"=",
"File",
".",
"createTempFile",
"(",
"prefix",
",",
"\"\"",
",",
"directory",
")",
";",
"if",
"(",
"!... | Create a temporary directory.
@param prefix
@param directory
@return java.io.File temporary directory
@throws IOException | [
"Create",
"a",
"temporary",
"directory",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/FileUtils.java#L117-L124 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/AbstractTypeCheckingExtension.java | AbstractTypeCheckingExtension.makeDynamic | public void makeDynamic(PropertyExpression pexp, ClassNode returnType) {
"""
Instructs the type checker that a property access is dynamic.
Calling this method automatically sets the handled flag to true.
@param pexp the property or attribute expression
@param returnType the type of the property
"""
... | java | public void makeDynamic(PropertyExpression pexp, ClassNode returnType) {
context.getEnclosingMethod().putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, Boolean.TRUE);
pexp.putNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION, returnType);
storeType(pexp, returnType);
setHandled(true)... | [
"public",
"void",
"makeDynamic",
"(",
"PropertyExpression",
"pexp",
",",
"ClassNode",
"returnType",
")",
"{",
"context",
".",
"getEnclosingMethod",
"(",
")",
".",
"putNodeMetaData",
"(",
"StaticTypesMarker",
".",
"DYNAMIC_RESOLUTION",
",",
"Boolean",
".",
"TRUE",
... | Instructs the type checker that a property access is dynamic.
Calling this method automatically sets the handled flag to true.
@param pexp the property or attribute expression
@param returnType the type of the property | [
"Instructs",
"the",
"type",
"checker",
"that",
"a",
"property",
"access",
"is",
"dynamic",
".",
"Calling",
"this",
"method",
"automatically",
"sets",
"the",
"handled",
"flag",
"to",
"true",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/AbstractTypeCheckingExtension.java#L306-L314 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.updateBugCollection | private void updateBugCollection(Project findBugsProject, Reporter bugReporter, boolean incremental) {
"""
Update the BugCollection for the project.
@param findBugsProject
FindBugs project representing analyzed classes
@param bugReporter
Reporter used to collect the new warnings
"""
SortedBugColl... | java | private void updateBugCollection(Project findBugsProject, Reporter bugReporter, boolean incremental) {
SortedBugCollection newBugCollection = bugReporter.getBugCollection();
try {
st.newPoint("getBugCollection");
SortedBugCollection oldBugCollection = FindbugsPlugin.getBugCollect... | [
"private",
"void",
"updateBugCollection",
"(",
"Project",
"findBugsProject",
",",
"Reporter",
"bugReporter",
",",
"boolean",
"incremental",
")",
"{",
"SortedBugCollection",
"newBugCollection",
"=",
"bugReporter",
".",
"getBugCollection",
"(",
")",
";",
"try",
"{",
"... | Update the BugCollection for the project.
@param findBugsProject
FindBugs project representing analyzed classes
@param bugReporter
Reporter used to collect the new warnings | [
"Update",
"the",
"BugCollection",
"for",
"the",
"project",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L334-L358 |
JM-Lab/utils-elasticsearch | src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java | JMElasticsearchSearchAndCount.searchAllWithTargetCount | public SearchResponse searchAllWithTargetCount(String index, String type) {
"""
Search all with target count search response.
@param index the index
@param type the type
@return the search response
"""
return searchAllWithTargetCount(index, type, null, null);
} | java | public SearchResponse searchAllWithTargetCount(String index, String type) {
return searchAllWithTargetCount(index, type, null, null);
} | [
"public",
"SearchResponse",
"searchAllWithTargetCount",
"(",
"String",
"index",
",",
"String",
"type",
")",
"{",
"return",
"searchAllWithTargetCount",
"(",
"index",
",",
"type",
",",
"null",
",",
"null",
")",
";",
"}"
] | Search all with target count search response.
@param index the index
@param type the type
@return the search response | [
"Search",
"all",
"with",
"target",
"count",
"search",
"response",
"."
] | train | https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java#L676-L678 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.replaceFirst | public StrBuilder replaceFirst(final char search, final char replace) {
"""
Replaces the first instance of the search character with the
replace character in the builder.
@param search the search character
@param replace the replace character
@return this, to enable chaining
"""
if (search != r... | java | public StrBuilder replaceFirst(final char search, final char replace) {
if (search != replace) {
for (int i = 0; i < size; i++) {
if (buffer[i] == search) {
buffer[i] = replace;
break;
}
}
}
return th... | [
"public",
"StrBuilder",
"replaceFirst",
"(",
"final",
"char",
"search",
",",
"final",
"char",
"replace",
")",
"{",
"if",
"(",
"search",
"!=",
"replace",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
... | Replaces the first instance of the search character with the
replace character in the builder.
@param search the search character
@param replace the replace character
@return this, to enable chaining | [
"Replaces",
"the",
"first",
"instance",
"of",
"the",
"search",
"character",
"with",
"the",
"replace",
"character",
"in",
"the",
"builder",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1986-L1996 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java | Log.printVerbose | public void printVerbose(String key, Object... args) {
"""
Print the localized text of a "verbose" message to the
noticeWriter stream.
"""
PrintWriter noticeWriter = writers.get(WriterKind.NOTICE);
printRawLines(noticeWriter, localize("verbose." + key, args));
} | java | public void printVerbose(String key, Object... args) {
PrintWriter noticeWriter = writers.get(WriterKind.NOTICE);
printRawLines(noticeWriter, localize("verbose." + key, args));
} | [
"public",
"void",
"printVerbose",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"PrintWriter",
"noticeWriter",
"=",
"writers",
".",
"get",
"(",
"WriterKind",
".",
"NOTICE",
")",
";",
"printRawLines",
"(",
"noticeWriter",
",",
"localize",
"(",... | Print the localized text of a "verbose" message to the
noticeWriter stream. | [
"Print",
"the",
"localized",
"text",
"of",
"a",
"verbose",
"message",
"to",
"the",
"noticeWriter",
"stream",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java#L628-L631 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/FrameSet.java | FrameSet.nameFrame | public Frame nameFrame(String name,int col, int row) {
"""
Name a frame.
By convention, frame names match Page section names
"""
if (frameMap==null)
{
frameMap=new Hashtable(10);
frameNames=new Vector(10);
}
Frame frame = frames[col][row];
... | java | public Frame nameFrame(String name,int col, int row)
{
if (frameMap==null)
{
frameMap=new Hashtable(10);
frameNames=new Vector(10);
}
Frame frame = frames[col][row];
if (frame==null)
frame = frames[col][row] = new Frame();
... | [
"public",
"Frame",
"nameFrame",
"(",
"String",
"name",
",",
"int",
"col",
",",
"int",
"row",
")",
"{",
"if",
"(",
"frameMap",
"==",
"null",
")",
"{",
"frameMap",
"=",
"new",
"Hashtable",
"(",
"10",
")",
";",
"frameNames",
"=",
"new",
"Vector",
"(",
... | Name a frame.
By convention, frame names match Page section names | [
"Name",
"a",
"frame",
".",
"By",
"convention",
"frame",
"names",
"match",
"Page",
"section",
"names"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/FrameSet.java#L116-L134 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/management/BasicPIDGenerator.java | BasicPIDGenerator.postInitModule | @Override
public void postInitModule() throws ModuleInitializationException {
"""
Get a reference to the ConnectionPoolManager so we can give the instance
constructor a ConnectionPool later in initializeIfNeeded().
"""
ConnectionPoolManager mgr =
(ConnectionPoolManager) getServer()... | java | @Override
public void postInitModule() throws ModuleInitializationException {
ConnectionPoolManager mgr =
(ConnectionPoolManager) getServer()
.getModule("org.fcrepo.server.storage.ConnectionPoolManager");
if (mgr == null) {
throw new ModuleInitiali... | [
"@",
"Override",
"public",
"void",
"postInitModule",
"(",
")",
"throws",
"ModuleInitializationException",
"{",
"ConnectionPoolManager",
"mgr",
"=",
"(",
"ConnectionPoolManager",
")",
"getServer",
"(",
")",
".",
"getModule",
"(",
"\"org.fcrepo.server.storage.ConnectionPool... | Get a reference to the ConnectionPoolManager so we can give the instance
constructor a ConnectionPool later in initializeIfNeeded(). | [
"Get",
"a",
"reference",
"to",
"the",
"ConnectionPoolManager",
"so",
"we",
"can",
"give",
"the",
"instance",
"constructor",
"a",
"ConnectionPool",
"later",
"in",
"initializeIfNeeded",
"()",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/management/BasicPIDGenerator.java#L75-L91 |
amzn/ion-java | src/com/amazon/ion/facet/Facets.java | Facets.asFacet | public static <T> T asFacet(Class<T> facetType, Object subject) {
"""
Returns a facet of the given subject if supported, returning null
otherwise.
<p>
If the subject implements {@link Faceted}, then this conversion is
delegated to {@link Faceted#asFacet(Class)}. Otherwise, a simple
cast of the subject is atte... | java | public static <T> T asFacet(Class<T> facetType, Object subject)
{
T facet = null;
if (subject instanceof Faceted)
{
facet = ((Faceted)subject).asFacet(facetType);
}
else if (facetType.isInstance(subject))
{
facet = facetType.cast(subject);
... | [
"public",
"static",
"<",
"T",
">",
"T",
"asFacet",
"(",
"Class",
"<",
"T",
">",
"facetType",
",",
"Object",
"subject",
")",
"{",
"T",
"facet",
"=",
"null",
";",
"if",
"(",
"subject",
"instanceof",
"Faceted",
")",
"{",
"facet",
"=",
"(",
"(",
"Facet... | Returns a facet of the given subject if supported, returning null
otherwise.
<p>
If the subject implements {@link Faceted}, then this conversion is
delegated to {@link Faceted#asFacet(Class)}. Otherwise, a simple
cast of the subject is attempted.
@return the requested facet, or null if {@code subject} is null or if
su... | [
"Returns",
"a",
"facet",
"of",
"the",
"given",
"subject",
"if",
"supported",
"returning",
"null",
"otherwise",
".",
"<p",
">",
"If",
"the",
"subject",
"implements",
"{",
"@link",
"Faceted",
"}",
"then",
"this",
"conversion",
"is",
"delegated",
"to",
"{",
"... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/facet/Facets.java#L61-L74 |
alkacon/opencms-core | src/org/opencms/security/CmsOrgUnitManager.java | CmsOrgUnitManager.countUsers | public long countUsers(CmsObject cms, CmsUserSearchParameters params) throws CmsException {
"""
Counts the users which fit the given search criteria.<p>
@param cms the current CMS context
@param params the user search parameters
@return the total number of users which fit the given search parameters
@thr... | java | public long countUsers(CmsObject cms, CmsUserSearchParameters params) throws CmsException {
return m_securityManager.countUsers(cms.getRequestContext(), params);
} | [
"public",
"long",
"countUsers",
"(",
"CmsObject",
"cms",
",",
"CmsUserSearchParameters",
"params",
")",
"throws",
"CmsException",
"{",
"return",
"m_securityManager",
".",
"countUsers",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
",",
"params",
")",
";",
"}"
... | Counts the users which fit the given search criteria.<p>
@param cms the current CMS context
@param params the user search parameters
@return the total number of users which fit the given search parameters
@throws CmsException if something goes wrong | [
"Counts",
"the",
"users",
"which",
"fit",
"the",
"given",
"search",
"criteria",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsOrgUnitManager.java#L95-L98 |
windup/windup | graph/api/src/main/java/org/jboss/windup/graph/service/OrganizationService.java | OrganizationService.attachOrganization | public OrganizationModel attachOrganization(OrganizationModel organizationModel, ArchiveModel archiveModel) {
"""
This method just attaches the {@link OrganizationModel} to the {@link FileModel}. It will only do so if this link is not already
present.
"""
for (OrganizationModel existingOrganizationMod... | java | public OrganizationModel attachOrganization(OrganizationModel organizationModel, ArchiveModel archiveModel)
{
for (OrganizationModel existingOrganizationModel : archiveModel.getOrganizationModels())
{
if (existingOrganizationModel.equals(organizationModel))
return organiz... | [
"public",
"OrganizationModel",
"attachOrganization",
"(",
"OrganizationModel",
"organizationModel",
",",
"ArchiveModel",
"archiveModel",
")",
"{",
"for",
"(",
"OrganizationModel",
"existingOrganizationModel",
":",
"archiveModel",
".",
"getOrganizationModels",
"(",
")",
")",... | This method just attaches the {@link OrganizationModel} to the {@link FileModel}. It will only do so if this link is not already
present. | [
"This",
"method",
"just",
"attaches",
"the",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/OrganizationService.java#L47-L56 |
apereo/cas | support/cas-server-support-validation/src/main/java/org/apereo/cas/web/ServiceValidationViewFactory.java | ServiceValidationViewFactory.registerView | public void registerView(final Class ownerClass, final Pair<View, View> view) {
"""
Register view.
@param ownerClass the owner class
@param view the view
"""
registerView(ownerClass.getSimpleName(), view);
} | java | public void registerView(final Class ownerClass, final Pair<View, View> view) {
registerView(ownerClass.getSimpleName(), view);
} | [
"public",
"void",
"registerView",
"(",
"final",
"Class",
"ownerClass",
",",
"final",
"Pair",
"<",
"View",
",",
"View",
">",
"view",
")",
"{",
"registerView",
"(",
"ownerClass",
".",
"getSimpleName",
"(",
")",
",",
"view",
")",
";",
"}"
] | Register view.
@param ownerClass the owner class
@param view the view | [
"Register",
"view",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/ServiceValidationViewFactory.java#L50-L52 |
google/closure-compiler | src/com/google/debugging/sourcemap/SourceMapConsumerV3.java | SourceMapConsumerV3.compareEntry | private static int compareEntry(ArrayList<Entry> entries, int entry, int target) {
"""
Compare an array entry's column value to the target column value.
"""
return entries.get(entry).getGeneratedColumn() - target;
} | java | private static int compareEntry(ArrayList<Entry> entries, int entry, int target) {
return entries.get(entry).getGeneratedColumn() - target;
} | [
"private",
"static",
"int",
"compareEntry",
"(",
"ArrayList",
"<",
"Entry",
">",
"entries",
",",
"int",
"entry",
",",
"int",
"target",
")",
"{",
"return",
"entries",
".",
"get",
"(",
"entry",
")",
".",
"getGeneratedColumn",
"(",
")",
"-",
"target",
";",
... | Compare an array entry's column value to the target column value. | [
"Compare",
"an",
"array",
"entry",
"s",
"column",
"value",
"to",
"the",
"target",
"column",
"value",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/debugging/sourcemap/SourceMapConsumerV3.java#L421-L423 |
Waikato/moa | moa/src/main/java/moa/gui/GUIDefaults.java | GUIDefaults.get | public static String get(String property, String defaultValue) {
"""
returns the value for the specified property, if non-existent then the
default value.
@param property the property to retrieve the value for
@param defaultValue the default value for the property
@return the value of the ... | java | public static String get(String property, String defaultValue) {
return PROPERTIES.getProperty(property, defaultValue);
} | [
"public",
"static",
"String",
"get",
"(",
"String",
"property",
",",
"String",
"defaultValue",
")",
"{",
"return",
"PROPERTIES",
".",
"getProperty",
"(",
"property",
",",
"defaultValue",
")",
";",
"}"
] | returns the value for the specified property, if non-existent then the
default value.
@param property the property to retrieve the value for
@param defaultValue the default value for the property
@return the value of the specified property | [
"returns",
"the",
"value",
"for",
"the",
"specified",
"property",
"if",
"non",
"-",
"existent",
"then",
"the",
"default",
"value",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/GUIDefaults.java#L69-L71 |
Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.nonPipelineZADD | public String nonPipelineZADD(String key, DataGenerator dataGenerator, String z_key_prefix, int max_score)
throws Exception {
"""
This adds MAX_SCORE of elements in a sorted set
@param key
@return "OK" if all write operations have succeeded
@throws Exception
"""
String zKey = z_key_pr... | java | public String nonPipelineZADD(String key, DataGenerator dataGenerator, String z_key_prefix, int max_score)
throws Exception {
String zKey = z_key_prefix + key;
int success = 0;
long returnOp = 0;
for (int i = 0; i < max_score; i++) {
returnOp = jedisClient.get().... | [
"public",
"String",
"nonPipelineZADD",
"(",
"String",
"key",
",",
"DataGenerator",
"dataGenerator",
",",
"String",
"z_key_prefix",
",",
"int",
"max_score",
")",
"throws",
"Exception",
"{",
"String",
"zKey",
"=",
"z_key_prefix",
"+",
"key",
";",
"int",
"success",... | This adds MAX_SCORE of elements in a sorted set
@param key
@return "OK" if all write operations have succeeded
@throws Exception | [
"This",
"adds",
"MAX_SCORE",
"of",
"elements",
"in",
"a",
"sorted",
"set"
] | train | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L238-L253 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java | UriUtils.encodeHttpUrl | @Deprecated
public static String encodeHttpUrl(String httpUrl, String encoding) throws UnsupportedEncodingException {
"""
Encodes the given HTTP URI into an encoded String. All various URI components are
encoded according to their respective valid character sets.
<p><strong>Note</strong> that this method does n... | java | @Deprecated
public static String encodeHttpUrl(String httpUrl, String encoding) throws UnsupportedEncodingException {
Assert.notNull(httpUrl, "HTTP URL must not be null");
Assert.hasLength(encoding, "Encoding must not be empty");
Matcher matcher = HTTP_URL_PATTERN.matcher(httpUrl);
if (matcher.matches()) {
... | [
"@",
"Deprecated",
"public",
"static",
"String",
"encodeHttpUrl",
"(",
"String",
"httpUrl",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"Assert",
".",
"notNull",
"(",
"httpUrl",
",",
"\"HTTP URL must not be null\"",
")",
";",
"Asse... | Encodes the given HTTP URI into an encoded String. All various URI components are
encoded according to their respective valid character sets.
<p><strong>Note</strong> that this method does not support fragments ({@code #}),
as these are not supposed to be sent to the server, but retained by the client.
<p><strong>Note<... | [
"Encodes",
"the",
"given",
"HTTP",
"URI",
"into",
"an",
"encoded",
"String",
".",
"All",
"various",
"URI",
"components",
"are",
"encoded",
"according",
"to",
"their",
"respective",
"valid",
"character",
"sets",
".",
"<p",
">",
"<strong",
">",
"Note<",
"/",
... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java#L129-L147 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPD9DatabaseReader.java | MPD9DatabaseReader.listProjects | public Map<Integer, String> listProjects() throws MPXJException {
"""
Populates a Map instance representing the IDs and names of
projects available in the current database.
@return Map instance containing ID and name pairs
@throws MPXJException
"""
try
{
Map<Integer, String> result = ... | java | public Map<Integer, String> listProjects() throws MPXJException
{
try
{
Map<Integer, String> result = new HashMap<Integer, String>();
List<ResultSetRow> rows = getRows("SELECT PROJ_ID, PROJ_NAME FROM MSP_PROJECTS");
for (ResultSetRow row : rows)
{
processP... | [
"public",
"Map",
"<",
"Integer",
",",
"String",
">",
"listProjects",
"(",
")",
"throws",
"MPXJException",
"{",
"try",
"{",
"Map",
"<",
"Integer",
",",
"String",
">",
"result",
"=",
"new",
"HashMap",
"<",
"Integer",
",",
"String",
">",
"(",
")",
";",
... | Populates a Map instance representing the IDs and names of
projects available in the current database.
@return Map instance containing ID and name pairs
@throws MPXJException | [
"Populates",
"a",
"Map",
"instance",
"representing",
"the",
"IDs",
"and",
"names",
"of",
"projects",
"available",
"in",
"the",
"current",
"database",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9DatabaseReader.java#L76-L95 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getTPListingInfo | public void getTPListingInfo(int[] ids, Callback<List<Listing>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Listing Price API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/prices">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} ... | java | public void getTPListingInfo(int[] ids, Callback<List<Listing>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getTPListingInfo(processIds(ids)).enqueue(callback);
} | [
"public",
"void",
"getTPListingInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Listing",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids... | For more info on Listing Price API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/prices">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of item id
@param callback callba... | [
"For",
"more",
"info",
"on",
"Listing",
"Price",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"commerce",
"/",
"prices",
">",
"here<",
"/",
"a",
">",
"<br",
"/"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L959-L962 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/util/LinkProperties.java | LinkProperties.addControlParameter | public LinkProperties addControlParameter(String key, String value) {
"""
<p>Adds any control params that control the behaviour of the link.
Control parameters include Custom redirect url ($android_url,$ios_url),
path for auto deep linking($android_deeplink_path,$deeplink_path) etc </p>
@param key A {@link ... | java | public LinkProperties addControlParameter(String key, String value) {
this.controlParams_.put(key, value);
return this;
} | [
"public",
"LinkProperties",
"addControlParameter",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"controlParams_",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | <p>Adds any control params that control the behaviour of the link.
Control parameters include Custom redirect url ($android_url,$ios_url),
path for auto deep linking($android_deeplink_path,$deeplink_path) etc </p>
@param key A {@link String} with value of key for the parameter
@param value A {@link String} with valu... | [
"<p",
">",
"Adds",
"any",
"control",
"params",
"that",
"control",
"the",
"behaviour",
"of",
"the",
"link",
".",
"Control",
"parameters",
"include",
"Custom",
"redirect",
"url",
"(",
"$android_url",
"$ios_url",
")",
"path",
"for",
"auto",
"deep",
"linking",
"... | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/LinkProperties.java#L89-L92 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/service/RowService.java | RowService.accepted | private boolean accepted(Columns columns, IndexExpression expression) {
"""
Returns {@code true} if the specified {@link Columns} satisfies the the specified {@link IndexExpression}, {@code
false} otherwise.
@param columns A {@link Columns}
@param expression A {@link IndexExpression}s to be satisfied by {@... | java | private boolean accepted(Columns columns, IndexExpression expression) {
ByteBuffer expectedValue = expression.value;
ColumnDefinition def = metadata.getColumnDefinition(expression.column);
String name = def.name.toString();
Column column = columns.getColumn(name);
if (column =... | [
"private",
"boolean",
"accepted",
"(",
"Columns",
"columns",
",",
"IndexExpression",
"expression",
")",
"{",
"ByteBuffer",
"expectedValue",
"=",
"expression",
".",
"value",
";",
"ColumnDefinition",
"def",
"=",
"metadata",
".",
"getColumnDefinition",
"(",
"expression... | Returns {@code true} if the specified {@link Columns} satisfies the the specified {@link IndexExpression}, {@code
false} otherwise.
@param columns A {@link Columns}
@param expression A {@link IndexExpression}s to be satisfied by {@code columns}.
@return {@code true} if the specified {@link Columns} satisfies the th... | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"specified",
"{",
"@link",
"Columns",
"}",
"satisfies",
"the",
"the",
"specified",
"{",
"@link",
"IndexExpression",
"}",
"{",
"@code",
"false",
"}",
"otherwise",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/RowService.java#L326-L359 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.copy | public static long copy(Reader input, StringBuilder output)
throws IOException {
"""
Transfers data from Reader into StringBuilder
Uses {@link #DEFAULT_BUFFER_SIZE} to define buffer size
@param input Reader which would be read
@param output StringBuilder which would be filled
@return amount of b... | java | public static long copy(Reader input, StringBuilder output)
throws IOException {
return copy(input, output, new char[DEFAULT_BUFFER_SIZE]);
} | [
"public",
"static",
"long",
"copy",
"(",
"Reader",
"input",
",",
"StringBuilder",
"output",
")",
"throws",
"IOException",
"{",
"return",
"copy",
"(",
"input",
",",
"output",
",",
"new",
"char",
"[",
"DEFAULT_BUFFER_SIZE",
"]",
")",
";",
"}"
] | Transfers data from Reader into StringBuilder
Uses {@link #DEFAULT_BUFFER_SIZE} to define buffer size
@param input Reader which would be read
@param output StringBuilder which would be filled
@return amount of bytes transferred
@throws IOException | [
"Transfers",
"data",
"from",
"Reader",
"into",
"StringBuilder",
"Uses",
"{",
"@link",
"#DEFAULT_BUFFER_SIZE",
"}",
"to",
"define",
"buffer",
"size"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L595-L598 |
jenkinsci/jenkins | core/src/main/java/jenkins/util/xml/XMLUtils.java | XMLUtils.safeTransform | public static void safeTransform(@Nonnull Source source, @Nonnull Result out) throws TransformerException,
SAXException {
"""
Transform the source to the output in a manner that is protected against XXE attacks.
If the transform can not be completed safely then an IOException is thrown.
Note - to tur... | java | public static void safeTransform(@Nonnull Source source, @Nonnull Result out) throws TransformerException,
SAXException {
InputSource src = SAXSource.sourceToInputSource(source);
if (src != null) {
SAXTransformerFactory stFactory = (SAXTransformerFactory) TransformerFactory.newI... | [
"public",
"static",
"void",
"safeTransform",
"(",
"@",
"Nonnull",
"Source",
"source",
",",
"@",
"Nonnull",
"Result",
"out",
")",
"throws",
"TransformerException",
",",
"SAXException",
"{",
"InputSource",
"src",
"=",
"SAXSource",
".",
"sourceToInputSource",
"(",
... | Transform the source to the output in a manner that is protected against XXE attacks.
If the transform can not be completed safely then an IOException is thrown.
Note - to turn off safety set the system property <code>disableXXEPrevention</code> to <code>true</code>.
@param source The XML input to transform. - This sho... | [
"Transform",
"the",
"source",
"to",
"the",
"output",
"in",
"a",
"manner",
"that",
"is",
"protected",
"against",
"XXE",
"attacks",
".",
"If",
"the",
"transform",
"can",
"not",
"be",
"completed",
"safely",
"then",
"an",
"IOException",
"is",
"thrown",
".",
"N... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/xml/XMLUtils.java#L59-L101 |
citrusframework/citrus | modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java | CitrusConfiguration.getProperty | private static String getProperty(Properties extensionProperties, String propertyName) {
"""
Try to read property from property set. When not set or null value return null else
return String representation of value object.
@param extensionProperties
@param propertyName
@return
"""
if (extensionProp... | java | private static String getProperty(Properties extensionProperties, String propertyName) {
if (extensionProperties.containsKey(propertyName)) {
Object value = extensionProperties.get(propertyName);
if (value != null) {
return value.toString();
}
}
... | [
"private",
"static",
"String",
"getProperty",
"(",
"Properties",
"extensionProperties",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"extensionProperties",
".",
"containsKey",
"(",
"propertyName",
")",
")",
"{",
"Object",
"value",
"=",
"extensionProperties",
... | Try to read property from property set. When not set or null value return null else
return String representation of value object.
@param extensionProperties
@param propertyName
@return | [
"Try",
"to",
"read",
"property",
"from",
"property",
"set",
".",
"When",
"not",
"set",
"or",
"null",
"value",
"return",
"null",
"else",
"return",
"String",
"representation",
"of",
"value",
"object",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java#L114-L123 |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.update | protected void update (Map<Integer, SceneBlock> blocks) {
"""
Links this block to its neighbors; informs neighboring blocks of
object coverage.
"""
boolean recover = false;
// link up to our neighbors
for (int ii = 0; ii < DX.length; ii++) {
SceneBlock neigh = blocks.get(n... | java | protected void update (Map<Integer, SceneBlock> blocks)
{
boolean recover = false;
// link up to our neighbors
for (int ii = 0; ii < DX.length; ii++) {
SceneBlock neigh = blocks.get(neighborKey(DX[ii], DY[ii]));
if (neigh != _neighbors[ii]) {
_neighbo... | [
"protected",
"void",
"update",
"(",
"Map",
"<",
"Integer",
",",
"SceneBlock",
">",
"blocks",
")",
"{",
"boolean",
"recover",
"=",
"false",
";",
"// link up to our neighbors",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"DX",
".",
"length",
";",
... | Links this block to its neighbors; informs neighboring blocks of
object coverage. | [
"Links",
"this",
"block",
"to",
"its",
"neighbors",
";",
"informs",
"neighboring",
"blocks",
"of",
"object",
"coverage",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L513-L536 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/bytebuffer/WsByteBufferUtils.java | WsByteBufferUtils.asString | public static final String asString(WsByteBuffer[] list, int[] positions, int[] limits) {
"""
Convert an array of buffers to a string using the input starting positions
and ending limits.
@param list
@param positions
@param limits
@return String
"""
byte[] data = asByteArray(list, positions, lim... | java | public static final String asString(WsByteBuffer[] list, int[] positions, int[] limits) {
byte[] data = asByteArray(list, positions, limits);
return (null != data) ? new String(data) : null;
} | [
"public",
"static",
"final",
"String",
"asString",
"(",
"WsByteBuffer",
"[",
"]",
"list",
",",
"int",
"[",
"]",
"positions",
",",
"int",
"[",
"]",
"limits",
")",
"{",
"byte",
"[",
"]",
"data",
"=",
"asByteArray",
"(",
"list",
",",
"positions",
",",
"... | Convert an array of buffers to a string using the input starting positions
and ending limits.
@param list
@param positions
@param limits
@return String | [
"Convert",
"an",
"array",
"of",
"buffers",
"to",
"a",
"string",
"using",
"the",
"input",
"starting",
"positions",
"and",
"ending",
"limits",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/bytebuffer/WsByteBufferUtils.java#L106-L109 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.replaceNovalue | public static WritableRaster replaceNovalue( RenderedImage renderedImage, double newValue ) {
"""
Replace the current internal novalue with a given value.
@param renderedImage a {@link RenderedImage}.
@param newValue the value to put in instead of the novalue.
@return the rendered image with the substituted n... | java | public static WritableRaster replaceNovalue( RenderedImage renderedImage, double newValue ) {
WritableRaster tmpWR = (WritableRaster) renderedImage.getData();
RandomIter pitTmpIterator = RandomIterFactory.create(renderedImage, null);
int height = renderedImage.getHeight();
int width = r... | [
"public",
"static",
"WritableRaster",
"replaceNovalue",
"(",
"RenderedImage",
"renderedImage",
",",
"double",
"newValue",
")",
"{",
"WritableRaster",
"tmpWR",
"=",
"(",
"WritableRaster",
")",
"renderedImage",
".",
"getData",
"(",
")",
";",
"RandomIter",
"pitTmpItera... | Replace the current internal novalue with a given value.
@param renderedImage a {@link RenderedImage}.
@param newValue the value to put in instead of the novalue.
@return the rendered image with the substituted novalue. | [
"Replace",
"the",
"current",
"internal",
"novalue",
"with",
"a",
"given",
"value",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1256-L1271 |
netty/netty | codec-redis/src/main/java/io/netty/handler/codec/redis/RedisEncoder.java | RedisEncoder.writeArrayHeader | private void writeArrayHeader(ByteBufAllocator allocator, ArrayHeaderRedisMessage msg, List<Object> out) {
"""
Write array header only without body. Use this if you want to write arrays as streaming.
"""
writeArrayHeader(allocator, msg.isNull(), msg.length(), out);
} | java | private void writeArrayHeader(ByteBufAllocator allocator, ArrayHeaderRedisMessage msg, List<Object> out) {
writeArrayHeader(allocator, msg.isNull(), msg.length(), out);
} | [
"private",
"void",
"writeArrayHeader",
"(",
"ByteBufAllocator",
"allocator",
",",
"ArrayHeaderRedisMessage",
"msg",
",",
"List",
"<",
"Object",
">",
"out",
")",
"{",
"writeArrayHeader",
"(",
"allocator",
",",
"msg",
".",
"isNull",
"(",
")",
",",
"msg",
".",
... | Write array header only without body. Use this if you want to write arrays as streaming. | [
"Write",
"array",
"header",
"only",
"without",
"body",
".",
"Use",
"this",
"if",
"you",
"want",
"to",
"write",
"arrays",
"as",
"streaming",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-redis/src/main/java/io/netty/handler/codec/redis/RedisEncoder.java#L167-L169 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/EndpointActivationService.java | EndpointActivationService.endpointDeactivation | void endpointDeactivation(ActivationSpec activationSpec, WSMessageEndpointFactory messageEndpointFactory) {
"""
Utility method to perform endpoint deactivation.
@param activationSpec activation specification
@param messageEndpointFactory message endpoint factory
"""
ClassLoader previousClassLoader ... | java | void endpointDeactivation(ActivationSpec activationSpec, WSMessageEndpointFactory messageEndpointFactory) {
ClassLoader previousClassLoader = jcasu.beginContextClassLoader(raClassLoader);
try {
BootstrapContextImpl bootstrapContext = bootstrapContextRef.getServiceWithException();
... | [
"void",
"endpointDeactivation",
"(",
"ActivationSpec",
"activationSpec",
",",
"WSMessageEndpointFactory",
"messageEndpointFactory",
")",
"{",
"ClassLoader",
"previousClassLoader",
"=",
"jcasu",
".",
"beginContextClassLoader",
"(",
"raClassLoader",
")",
";",
"try",
"{",
"B... | Utility method to perform endpoint deactivation.
@param activationSpec activation specification
@param messageEndpointFactory message endpoint factory | [
"Utility",
"method",
"to",
"perform",
"endpoint",
"deactivation",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/EndpointActivationService.java#L649-L658 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CProductPersistenceImpl.java | CProductPersistenceImpl.fetchByUUID_G | @Override
public CProduct fetchByUUID_G(String uuid, long groupId) {
"""
Returns the c product where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching c product, or <code>null</c... | java | @Override
public CProduct fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CProduct",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the c product where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching c product, or <code>null</code> if a matching c product could not be found | [
"Returns",
"the",
"c",
"product",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"cache",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CProductPersistenceImpl.java#L693-L696 |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java | AllureResultsUtils.writeAttachmentSafely | public static Attachment writeAttachmentSafely(byte[] attachment, String title, String type) {
"""
Write attachment uses {@link #writeAttachment(byte[], String, String)} (if
specified attachment type not empty) or {@link #writeAttachment(byte[], String)}
otherwise. If something went wrong uses
{@link #writeAtta... | java | public static Attachment writeAttachmentSafely(byte[] attachment, String title, String type) {
try {
return type == null || type.isEmpty()
? writeAttachment(attachment, title)
: writeAttachment(attachment, title, type);
} catch (Exception e) {
... | [
"public",
"static",
"Attachment",
"writeAttachmentSafely",
"(",
"byte",
"[",
"]",
"attachment",
",",
"String",
"title",
",",
"String",
"type",
")",
"{",
"try",
"{",
"return",
"type",
"==",
"null",
"||",
"type",
".",
"isEmpty",
"(",
")",
"?",
"writeAttachme... | Write attachment uses {@link #writeAttachment(byte[], String, String)} (if
specified attachment type not empty) or {@link #writeAttachment(byte[], String)}
otherwise. If something went wrong uses
{@link #writeAttachmentWithErrorMessage(Throwable, String)}
@param attachment which will write
@param title attachment... | [
"Write",
"attachment",
"uses",
"{",
"@link",
"#writeAttachment",
"(",
"byte",
"[]",
"String",
"String",
")",
"}",
"(",
"if",
"specified",
"attachment",
"type",
"not",
"empty",
")",
"or",
"{",
"@link",
"#writeAttachment",
"(",
"byte",
"[]",
"String",
")",
"... | train | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java#L224-L234 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/config/EntityDeepJobConfig.java | EntityDeepJobConfig.setInstancePropertyFromDbName | public void setInstancePropertyFromDbName(T instance, String dbName, Object value) {
"""
Given an instance of the generic object mapped to this configurtion object,
sets the instance property whose name is the name specified by dbName.
Since the provided dbName is the name of the field in the database, we first ... | java | public void setInstancePropertyFromDbName(T instance, String dbName, Object value) {
Map<String, Cell> cfs = columnDefinitions();
Cell metadataCell = cfs.get(dbName);
String f = mapDBNameToEntityName.get(dbName);
if (StringUtils.isEmpty(f)) {
// DB column is not mapped in t... | [
"public",
"void",
"setInstancePropertyFromDbName",
"(",
"T",
"instance",
",",
"String",
"dbName",
",",
"Object",
"value",
")",
"{",
"Map",
"<",
"String",
",",
"Cell",
">",
"cfs",
"=",
"columnDefinitions",
"(",
")",
";",
"Cell",
"metadataCell",
"=",
"cfs",
... | Given an instance of the generic object mapped to this configurtion object,
sets the instance property whose name is the name specified by dbName.
Since the provided dbName is the name of the field in the database, we first try
to resolve the property name using the fieldName property of the DeepField annotation.
If we... | [
"Given",
"an",
"instance",
"of",
"the",
"generic",
"object",
"mapped",
"to",
"this",
"configurtion",
"object",
"sets",
"the",
"instance",
"property",
"whose",
"name",
"is",
"the",
"name",
"specified",
"by",
"dbName",
".",
"Since",
"the",
"provided",
"dbName",
... | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/config/EntityDeepJobConfig.java#L150-L171 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/js/JSEventMap.java | JSEventMap.addHandler | public void addHandler (@Nonnull final EJSEvent eJSEvent, @Nonnull final IHasJSCode aNewHandler) {
"""
Add an additional handler for the given JS event. If an existing handler is
present, the new handler is appended at the end.
@param eJSEvent
The JS event. May not be <code>null</code>.
@param aNewHandler
T... | java | public void addHandler (@Nonnull final EJSEvent eJSEvent, @Nonnull final IHasJSCode aNewHandler)
{
ValueEnforcer.notNull (eJSEvent, "JSEvent");
ValueEnforcer.notNull (aNewHandler, "NewHandler");
CollectingJSCodeProvider aCode = m_aEvents.get (eJSEvent);
if (aCode == null)
{
aCode = new Coll... | [
"public",
"void",
"addHandler",
"(",
"@",
"Nonnull",
"final",
"EJSEvent",
"eJSEvent",
",",
"@",
"Nonnull",
"final",
"IHasJSCode",
"aNewHandler",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"eJSEvent",
",",
"\"JSEvent\"",
")",
";",
"ValueEnforcer",
".",
"no... | Add an additional handler for the given JS event. If an existing handler is
present, the new handler is appended at the end.
@param eJSEvent
The JS event. May not be <code>null</code>.
@param aNewHandler
The new handler to be added. May not be <code>null</code>. | [
"Add",
"an",
"additional",
"handler",
"for",
"the",
"given",
"JS",
"event",
".",
"If",
"an",
"existing",
"handler",
"is",
"present",
"the",
"new",
"handler",
"is",
"appended",
"at",
"the",
"end",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/js/JSEventMap.java#L53-L65 |
sangupta/jerry-services | src/main/java/com/sangupta/jerry/quartz/service/impl/DefaultQuartzServiceImpl.java | DefaultQuartzServiceImpl.pauseQuartzJob | public boolean pauseQuartzJob(String jobName, String jobGroupName) {
"""
Pause the job with given name in given group
@param jobName
the job name
@param jobGroupName
the job group name
@return <code>true</code> if job was paused, <code>false</code> otherwise
@see QuartzService#pauseQuartzJob(String, ... | java | public boolean pauseQuartzJob(String jobName, String jobGroupName) {
try {
this.scheduler.pauseJob(new JobKey(jobName, jobGroupName));
return true;
} catch (SchedulerException e) {
logger.error("error pausing job: " + jobName + " in group: " + jobGroupName, e);
... | [
"public",
"boolean",
"pauseQuartzJob",
"(",
"String",
"jobName",
",",
"String",
"jobGroupName",
")",
"{",
"try",
"{",
"this",
".",
"scheduler",
".",
"pauseJob",
"(",
"new",
"JobKey",
"(",
"jobName",
",",
"jobGroupName",
")",
")",
";",
"return",
"true",
";"... | Pause the job with given name in given group
@param jobName
the job name
@param jobGroupName
the job group name
@return <code>true</code> if job was paused, <code>false</code> otherwise
@see QuartzService#pauseQuartzJob(String, String) | [
"Pause",
"the",
"job",
"with",
"given",
"name",
"in",
"given",
"group"
] | train | https://github.com/sangupta/jerry-services/blob/25ff6577445850916425c72068d654c08eba9bcc/src/main/java/com/sangupta/jerry/quartz/service/impl/DefaultQuartzServiceImpl.java#L129-L137 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryLockManager.java | RepositoryLockManager.cleanLocks | Set<String> cleanLocks( JcrSession session ) throws RepositoryException {
"""
Unlocks all locks corresponding to the tokens held by the supplied session.
@param session the session on behalf of which the lock operation is being performed
@return a {@link Set} of the lock tokens that have been cleaned (removed ... | java | Set<String> cleanLocks( JcrSession session ) throws RepositoryException {
Set<String> lockTokens = session.lockManager().lockTokens();
List<ModeShapeLock> locks = null;
for (ModeShapeLock lock : locksByNodeKey.values()) {
if (lock.isSessionScoped() && lockTokens.contains(lock.getLock... | [
"Set",
"<",
"String",
">",
"cleanLocks",
"(",
"JcrSession",
"session",
")",
"throws",
"RepositoryException",
"{",
"Set",
"<",
"String",
">",
"lockTokens",
"=",
"session",
".",
"lockManager",
"(",
")",
".",
"lockTokens",
"(",
")",
";",
"List",
"<",
"ModeSha... | Unlocks all locks corresponding to the tokens held by the supplied session.
@param session the session on behalf of which the lock operation is being performed
@return a {@link Set} of the lock tokens that have been cleaned (removed from the system area and the corresponding nodes
unlocked)
@throws RepositoryException... | [
"Unlocks",
"all",
"locks",
"corresponding",
"to",
"the",
"tokens",
"held",
"by",
"the",
"supplied",
"session",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryLockManager.java#L493-L514 |
EdwardRaff/JSAT | JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java | OnlineLDAsvi.setEta | public void setEta(double eta) {
"""
Prior on topics. 1/{@link #setK(int) K} is a common choice.
@param eta the positive prior for topics
"""
if(eta <= 0 || Double.isInfinite(eta) || Double.isNaN(eta))
throw new IllegalArgumentException("Eta must be a positive constant, not " + eta);
... | java | public void setEta(double eta)
{
if(eta <= 0 || Double.isInfinite(eta) || Double.isNaN(eta))
throw new IllegalArgumentException("Eta must be a positive constant, not " + eta);
this.eta = eta;
} | [
"public",
"void",
"setEta",
"(",
"double",
"eta",
")",
"{",
"if",
"(",
"eta",
"<=",
"0",
"||",
"Double",
".",
"isInfinite",
"(",
"eta",
")",
"||",
"Double",
".",
"isNaN",
"(",
"eta",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Eta mus... | Prior on topics. 1/{@link #setK(int) K} is a common choice.
@param eta the positive prior for topics | [
"Prior",
"on",
"topics",
".",
"1",
"/",
"{"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java#L277-L282 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WSkipLinksExample.java | WSkipLinksExample.buildPanel | private WPanel buildPanel(final String title) {
"""
Creates a panel for the example.
@param title the panel title.
@return a panel for use in the example.
"""
WPanel panel = new WPanel(WPanel.Type.CHROME);
panel.setTitleText(title);
WProgressBar progress = new WProgressBar(18);
progress.setValue(15... | java | private WPanel buildPanel(final String title) {
WPanel panel = new WPanel(WPanel.Type.CHROME);
panel.setTitleText(title);
WProgressBar progress = new WProgressBar(18);
progress.setValue(15);
panel.add(progress);
panel.add(new WHorizontalRule());
WTextField input = new WTextField();
WLabel label = new W... | [
"private",
"WPanel",
"buildPanel",
"(",
"final",
"String",
"title",
")",
"{",
"WPanel",
"panel",
"=",
"new",
"WPanel",
"(",
"WPanel",
".",
"Type",
".",
"CHROME",
")",
";",
"panel",
".",
"setTitleText",
"(",
"title",
")",
";",
"WProgressBar",
"progress",
... | Creates a panel for the example.
@param title the panel title.
@return a panel for use in the example. | [
"Creates",
"a",
"panel",
"for",
"the",
"example",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WSkipLinksExample.java#L47-L61 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java | WebUtilities.getComponentById | public static ComponentWithContext getComponentById(final String id, final boolean visibleOnly) {
"""
Finds a component by its id.
@param id the id of the component to search for.
@param visibleOnly true if process visible only
@return the component and context for the given id, or null if not found.
"""
... | java | public static ComponentWithContext getComponentById(final String id, final boolean visibleOnly) {
UIContext uic = UIContextHolder.getCurrent();
WComponent root = uic.getUI();
ComponentWithContext comp = TreeUtil.getComponentWithContextForId(root, id, visibleOnly);
return comp;
} | [
"public",
"static",
"ComponentWithContext",
"getComponentById",
"(",
"final",
"String",
"id",
",",
"final",
"boolean",
"visibleOnly",
")",
"{",
"UIContext",
"uic",
"=",
"UIContextHolder",
".",
"getCurrent",
"(",
")",
";",
"WComponent",
"root",
"=",
"uic",
".",
... | Finds a component by its id.
@param id the id of the component to search for.
@param visibleOnly true if process visible only
@return the component and context for the given id, or null if not found. | [
"Finds",
"a",
"component",
"by",
"its",
"id",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java#L645-L650 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/Properties.java | Properties.putProducts | public Properties putProducts(Product... products) {
"""
Set the individual products for an order associated with an event.
@see <a href="https://segment.com/docs/api/tracking/ecommerce/">Ecommerce API</a>
"""
if (isNullOrEmpty(products)) {
throw new IllegalArgumentException("products cannot be nu... | java | public Properties putProducts(Product... products) {
if (isNullOrEmpty(products)) {
throw new IllegalArgumentException("products cannot be null or empty.");
}
List<Product> productList = new ArrayList<>(products.length);
Collections.addAll(productList, products);
return putValue(PRODUCTS_KEY, ... | [
"public",
"Properties",
"putProducts",
"(",
"Product",
"...",
"products",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"products",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"products cannot be null or empty.\"",
")",
";",
"}",
"List",
"<",
... | Set the individual products for an order associated with an event.
@see <a href="https://segment.com/docs/api/tracking/ecommerce/">Ecommerce API</a> | [
"Set",
"the",
"individual",
"products",
"for",
"an",
"order",
"associated",
"with",
"an",
"event",
"."
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/Properties.java#L351-L358 |
j256/simplecsv | src/main/java/com/j256/simplecsv/processor/CsvProcessor.java | CsvProcessor.readHeader | public String[] readHeader(BufferedReader bufferedReader, ParseError parseError)
throws ParseException, IOException {
"""
Read in a line and process it as a CSV header.
@param bufferedReader
Where to read the header from. It needs to be closed by the caller. Consider using
{@link BufferedReaderLineCounter}... | java | public String[] readHeader(BufferedReader bufferedReader, ParseError parseError)
throws ParseException, IOException {
checkEntityConfig();
String header = bufferedReader.readLine();
if (header == null) {
if (parseError == null) {
throw new ParseException("no header line read", 0);
} else {
parseE... | [
"public",
"String",
"[",
"]",
"readHeader",
"(",
"BufferedReader",
"bufferedReader",
",",
"ParseError",
"parseError",
")",
"throws",
"ParseException",
",",
"IOException",
"{",
"checkEntityConfig",
"(",
")",
";",
"String",
"header",
"=",
"bufferedReader",
".",
"rea... | Read in a line and process it as a CSV header.
@param bufferedReader
Where to read the header from. It needs to be closed by the caller. Consider using
{@link BufferedReaderLineCounter} to populate the line-number for parse errors.
@param parseError
If not null, this will be set with the first parse error and it will ... | [
"Read",
"in",
"a",
"line",
"and",
"process",
"it",
"as",
"a",
"CSV",
"header",
"."
] | train | https://github.com/j256/simplecsv/blob/964fe53073c43e2a311341e3f8fd2c94372f60cb/src/main/java/com/j256/simplecsv/processor/CsvProcessor.java#L216-L240 |
FDMediagroep/hamcrest-jsoup | src/main/java/nl/fd/hamcrest/jsoup/ElementWithAttribute.java | ElementWithAttribute.hasHref | @Factory
public static Matcher<Element> hasHref(final String expectedValue) {
"""
Creates a {@link org.hamcrest.Matcher} for a JSoup {@link org.jsoup.nodes.Element} with the given {@code expectedValue} for the "href"
attribute. See {@link #hasAttribute(String, org.hamcrest.Matcher)} for use with Matchers.
... | java | @Factory
public static Matcher<Element> hasHref(final String expectedValue) {
return hasAttribute("href", Matchers.is(expectedValue));
} | [
"@",
"Factory",
"public",
"static",
"Matcher",
"<",
"Element",
">",
"hasHref",
"(",
"final",
"String",
"expectedValue",
")",
"{",
"return",
"hasAttribute",
"(",
"\"href\"",
",",
"Matchers",
".",
"is",
"(",
"expectedValue",
")",
")",
";",
"}"
] | Creates a {@link org.hamcrest.Matcher} for a JSoup {@link org.jsoup.nodes.Element} with the given {@code expectedValue} for the "href"
attribute. See {@link #hasAttribute(String, org.hamcrest.Matcher)} for use with Matchers.
@param expectedValue The attribute value that is expected
@return a {@link org.hamcrest.Matche... | [
"Creates",
"a",
"{",
"@link",
"org",
".",
"hamcrest",
".",
"Matcher",
"}",
"for",
"a",
"JSoup",
"{",
"@link",
"org",
".",
"jsoup",
".",
"nodes",
".",
"Element",
"}",
"with",
"the",
"given",
"{",
"@code",
"expectedValue",
"}",
"for",
"the",
"href",
"a... | train | https://github.com/FDMediagroep/hamcrest-jsoup/blob/b7152dac6f834e40117fb7cfdd3149a268d95f7b/src/main/java/nl/fd/hamcrest/jsoup/ElementWithAttribute.java#L83-L86 |
liuyukuai/commons | commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateTimeUtil.java | LocalDateTimeUtil.addDays | public static LocalDateTime addDays(String localDate, long days) {
"""
addDays
@param localDate 时间
@param days 天数
@return localDate
"""
LocalDateTime parse = parse(localDate, DEFAULT_PATTERN);
return parse.plusDays(days);
} | java | public static LocalDateTime addDays(String localDate, long days) {
LocalDateTime parse = parse(localDate, DEFAULT_PATTERN);
return parse.plusDays(days);
} | [
"public",
"static",
"LocalDateTime",
"addDays",
"(",
"String",
"localDate",
",",
"long",
"days",
")",
"{",
"LocalDateTime",
"parse",
"=",
"parse",
"(",
"localDate",
",",
"DEFAULT_PATTERN",
")",
";",
"return",
"parse",
".",
"plusDays",
"(",
"days",
")",
";",
... | addDays
@param localDate 时间
@param days 天数
@return localDate | [
"addDays"
] | train | https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateTimeUtil.java#L92-L95 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/FileTransferHandlerVaadinUpload.java | FileTransferHandlerVaadinUpload.uploadStarted | @Override
public void uploadStarted(final StartedEvent event) {
"""
Upload started for {@link Upload} variant.
@see com.vaadin.ui.Upload.StartedListener#uploadStarted(com.vaadin.ui.Upload.StartedEvent)
"""
// reset internal state here because instance is reused for next upload!
resetStat... | java | @Override
public void uploadStarted(final StartedEvent event) {
// reset internal state here because instance is reused for next upload!
resetState();
final SoftwareModule softwareModule = getSelectedSoftwareModule();
this.fileUploadId = new FileUploadId(event.getFilename(), softwa... | [
"@",
"Override",
"public",
"void",
"uploadStarted",
"(",
"final",
"StartedEvent",
"event",
")",
"{",
"// reset internal state here because instance is reused for next upload!",
"resetState",
"(",
")",
";",
"final",
"SoftwareModule",
"softwareModule",
"=",
"getSelectedSoftware... | Upload started for {@link Upload} variant.
@see com.vaadin.ui.Upload.StartedListener#uploadStarted(com.vaadin.ui.Upload.StartedEvent) | [
"Upload",
"started",
"for",
"{",
"@link",
"Upload",
"}",
"variant",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/FileTransferHandlerVaadinUpload.java#L69-L98 |
cdapio/tephra | tephra-core/src/main/java/co/cask/tephra/TransactionManager.java | TransactionManager.createTransaction | private Transaction createTransaction(long writePointer, TransactionType type) {
"""
Creates a new Transaction. This method only get called from start transaction, which is already
synchronized.
"""
// For holding the first in progress short transaction Id (with timeout >= 0).
long firstShortTx = Tran... | java | private Transaction createTransaction(long writePointer, TransactionType type) {
// For holding the first in progress short transaction Id (with timeout >= 0).
long firstShortTx = Transaction.NO_TX_IN_PROGRESS;
LongArrayList inProgressIds = new LongArrayList(inProgress.size());
for (Map.Entry<Long, InPr... | [
"private",
"Transaction",
"createTransaction",
"(",
"long",
"writePointer",
",",
"TransactionType",
"type",
")",
"{",
"// For holding the first in progress short transaction Id (with timeout >= 0).",
"long",
"firstShortTx",
"=",
"Transaction",
".",
"NO_TX_IN_PROGRESS",
";",
"Lo... | Creates a new Transaction. This method only get called from start transaction, which is already
synchronized. | [
"Creates",
"a",
"new",
"Transaction",
".",
"This",
"method",
"only",
"get",
"called",
"from",
"start",
"transaction",
"which",
"is",
"already",
"synchronized",
"."
] | train | https://github.com/cdapio/tephra/blob/082c56c15c6ece15002631ff6f89206a00d8915c/tephra-core/src/main/java/co/cask/tephra/TransactionManager.java#L1210-L1230 |
gallandarakhneorg/afc | core/util/src/main/java/org/arakhne/afc/progress/ProgressionUtil.java | ProgressionUtil.setValue | public static void setValue(Progression model, int value) {
"""
Set the value of the given task progression,
if not <code>null</code>.
The value must be greater than the current progression value.
@param model is the progression to change
@param value is the value to add to the progression value.
"""
i... | java | public static void setValue(Progression model, int value) {
if (model != null && value > model.getValue()) {
model.setValue(value);
}
} | [
"public",
"static",
"void",
"setValue",
"(",
"Progression",
"model",
",",
"int",
"value",
")",
"{",
"if",
"(",
"model",
"!=",
"null",
"&&",
"value",
">",
"model",
".",
"getValue",
"(",
")",
")",
"{",
"model",
".",
"setValue",
"(",
"value",
")",
";",
... | Set the value of the given task progression,
if not <code>null</code>.
The value must be greater than the current progression value.
@param model is the progression to change
@param value is the value to add to the progression value. | [
"Set",
"the",
"value",
"of",
"the",
"given",
"task",
"progression",
"if",
"not",
"<code",
">",
"null<",
"/",
"code",
">",
".",
"The",
"value",
"must",
"be",
"greater",
"than",
"the",
"current",
"progression",
"value",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/progress/ProgressionUtil.java#L313-L317 |
osmdroid/osmdroid | osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java | SphericalUtil.distanceRadians | private static double distanceRadians(double lat1, double lng1, double lat2, double lng2) {
"""
Returns distance on the unit sphere; the arguments are in radians.
"""
return arcHav(havDistance(lat1, lat2, lng1 - lng2));
} | java | private static double distanceRadians(double lat1, double lng1, double lat2, double lng2) {
return arcHav(havDistance(lat1, lat2, lng1 - lng2));
} | [
"private",
"static",
"double",
"distanceRadians",
"(",
"double",
"lat1",
",",
"double",
"lng1",
",",
"double",
"lat2",
",",
"double",
"lng2",
")",
"{",
"return",
"arcHav",
"(",
"havDistance",
"(",
"lat1",
",",
"lat2",
",",
"lng1",
"-",
"lng2",
")",
")",
... | Returns distance on the unit sphere; the arguments are in radians. | [
"Returns",
"distance",
"on",
"the",
"unit",
"sphere",
";",
"the",
"arguments",
"are",
"in",
"radians",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L257-L259 |
baratine/baratine | framework/src/main/java/com/caucho/v5/ramp/db/DatabaseServiceRamp.java | DatabaseServiceRamp.findAll | @Override
public void findAll(String sql, Result<Iterable<Cursor>> result, Object ...args) {
"""
Queries the database, returning an iterator of results.
@param sql the select query for the search
@param result callback for the result iterator
@param args arguments to the sql
"""
_kraken.query(sql).f... | java | @Override
public void findAll(String sql, Result<Iterable<Cursor>> result, Object ...args)
{
_kraken.query(sql).findAll(result, args);
} | [
"@",
"Override",
"public",
"void",
"findAll",
"(",
"String",
"sql",
",",
"Result",
"<",
"Iterable",
"<",
"Cursor",
">",
">",
"result",
",",
"Object",
"...",
"args",
")",
"{",
"_kraken",
".",
"query",
"(",
"sql",
")",
".",
"findAll",
"(",
"result",
",... | Queries the database, returning an iterator of results.
@param sql the select query for the search
@param result callback for the result iterator
@param args arguments to the sql | [
"Queries",
"the",
"database",
"returning",
"an",
"iterator",
"of",
"results",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/ramp/db/DatabaseServiceRamp.java#L131-L135 |
j256/simplejmx | src/main/java/com/j256/simplejmx/common/ObjectNameUtil.java | ObjectNameUtil.makeObjectName | public static ObjectName makeObjectName(JmxSelfNaming selfNamingObj) {
"""
Constructs an object-name from a self naming object only.
@param selfNamingObj
Object that implements the self-naming interface.
@throws IllegalArgumentException
If we had problems building the name
"""
JmxResource jmxResource =... | java | public static ObjectName makeObjectName(JmxSelfNaming selfNamingObj) {
JmxResource jmxResource = selfNamingObj.getClass().getAnnotation(JmxResource.class);
return makeObjectName(jmxResource, selfNamingObj);
} | [
"public",
"static",
"ObjectName",
"makeObjectName",
"(",
"JmxSelfNaming",
"selfNamingObj",
")",
"{",
"JmxResource",
"jmxResource",
"=",
"selfNamingObj",
".",
"getClass",
"(",
")",
".",
"getAnnotation",
"(",
"JmxResource",
".",
"class",
")",
";",
"return",
"makeObj... | Constructs an object-name from a self naming object only.
@param selfNamingObj
Object that implements the self-naming interface.
@throws IllegalArgumentException
If we had problems building the name | [
"Constructs",
"an",
"object",
"-",
"name",
"from",
"a",
"self",
"naming",
"object",
"only",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/common/ObjectNameUtil.java#L61-L64 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapDNDController.java | CmsSitemapDNDController.isChangedPosition | boolean isChangedPosition(I_CmsDraggable draggable, I_CmsDropTarget target, boolean strict) {
"""
Checks whether the current placeholder position represents a change to the original draggable position within the tree.<p>
@param draggable the draggable
@param target the current drop target
@param strict if <co... | java | boolean isChangedPosition(I_CmsDraggable draggable, I_CmsDropTarget target, boolean strict) {
// if draggable is not a sitemap item, any valid position is a changed position
if (!((draggable instanceof CmsSitemapTreeItem) && (target instanceof CmsTree<?>))) {
return true;
}
... | [
"boolean",
"isChangedPosition",
"(",
"I_CmsDraggable",
"draggable",
",",
"I_CmsDropTarget",
"target",
",",
"boolean",
"strict",
")",
"{",
"// if draggable is not a sitemap item, any valid position is a changed position",
"if",
"(",
"!",
"(",
"(",
"draggable",
"instanceof",
... | Checks whether the current placeholder position represents a change to the original draggable position within the tree.<p>
@param draggable the draggable
@param target the current drop target
@param strict if <code>false</code> only the parent path is considered, the index position will be ignored
@return <code>true<... | [
"Checks",
"whether",
"the",
"current",
"placeholder",
"position",
"represents",
"a",
"change",
"to",
"the",
"original",
"draggable",
"position",
"within",
"the",
"tree",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapDNDController.java#L253-L275 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java | GeneralStorable.setValue | public void setValue(int index, byte[] value) throws IOException {
"""
Sets the value belonging to the given field.
@param index
the index of the requested field
@param value
the value to set
@throws IOException
"""
if (index >= structure.valueSizes.size()) {
throw new IOException("I... | java | public void setValue(int index, byte[] value) throws IOException {
if (index >= structure.valueSizes.size()) {
throw new IOException("Index " + index + " is out of range.");
}
int length = structure.valueSizes.get(index);
if (value.length != length) {
throw new IO... | [
"public",
"void",
"setValue",
"(",
"int",
"index",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"index",
">=",
"structure",
".",
"valueSizes",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Inde... | Sets the value belonging to the given field.
@param index
the index of the requested field
@param value
the value to set
@throws IOException | [
"Sets",
"the",
"value",
"belonging",
"to",
"the",
"given",
"field",
"."
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java#L137-L147 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/LogAnalyticsInner.java | LogAnalyticsInner.exportRequestRateByInterval | public LogAnalyticsOperationResultInner exportRequestRateByInterval(String location, RequestRateByIntervalInput parameters) {
"""
Export logs that show Api requests made by this subscription in the given time window to show throttling activities.
@param location The location upon which virtual-machine-sizes is ... | java | public LogAnalyticsOperationResultInner exportRequestRateByInterval(String location, RequestRateByIntervalInput parameters) {
return exportRequestRateByIntervalWithServiceResponseAsync(location, parameters).toBlocking().last().body();
} | [
"public",
"LogAnalyticsOperationResultInner",
"exportRequestRateByInterval",
"(",
"String",
"location",
",",
"RequestRateByIntervalInput",
"parameters",
")",
"{",
"return",
"exportRequestRateByIntervalWithServiceResponseAsync",
"(",
"location",
",",
"parameters",
")",
".",
"toB... | Export logs that show Api requests made by this subscription in the given time window to show throttling activities.
@param location The location upon which virtual-machine-sizes is queried.
@param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api.
@throws IllegalArgumentException thrown ... | [
"Export",
"logs",
"that",
"show",
"Api",
"requests",
"made",
"by",
"this",
"subscription",
"in",
"the",
"given",
"time",
"window",
"to",
"show",
"throttling",
"activities",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/LogAnalyticsInner.java#L86-L88 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/context/ResponseWriterWrapper.java | ResponseWriterWrapper.writeText | @Override
public void writeText(Object text, UIComponent component, String property)
throws IOException {
"""
<p>The default behavior of this method is to
call {@link ResponseWriter#writeText(Object, UIComponent, String)}
on the wrapped {@link ResponseWriter} object.</p>
@see ResponseWriter#wr... | java | @Override
public void writeText(Object text, UIComponent component, String property)
throws IOException {
getWrapped().writeText(text, component, property);
} | [
"@",
"Override",
"public",
"void",
"writeText",
"(",
"Object",
"text",
",",
"UIComponent",
"component",
",",
"String",
"property",
")",
"throws",
"IOException",
"{",
"getWrapped",
"(",
")",
".",
"writeText",
"(",
"text",
",",
"component",
",",
"property",
")... | <p>The default behavior of this method is to
call {@link ResponseWriter#writeText(Object, UIComponent, String)}
on the wrapped {@link ResponseWriter} object.</p>
@see ResponseWriter#writeText(Object, String)
@since 1.2 | [
"<p",
">",
"The",
"default",
"behavior",
"of",
"this",
"method",
"is",
"to",
"call",
"{",
"@link",
"ResponseWriter#writeText",
"(",
"Object",
"UIComponent",
"String",
")",
"}",
"on",
"the",
"wrapped",
"{",
"@link",
"ResponseWriter",
"}",
"object",
".",
"<",
... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/context/ResponseWriterWrapper.java#L311-L315 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListAccountRelPersistenceImpl.java | CommercePriceListAccountRelPersistenceImpl.findAll | @Override
public List<CommercePriceListAccountRel> findAll(int start, int end) {
"""
Returns a range of all the commerce price list account 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 ... | java | @Override
public List<CommercePriceListAccountRel> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceListAccountRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce price list account 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... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"price",
"list",
"account",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListAccountRelPersistenceImpl.java#L2974-L2977 |
biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java | Utils.getNumberOfInvalidChar | public final static int getNumberOfInvalidChar(String sequence, Set<Character> cSet, boolean ignoreCase) {
"""
Return the number of invalid characters in sequence.
@param sequence
protein sequence to count for invalid characters.
@param cSet
the set of characters that are deemed valid.
@param ignoreCase
in... | java | public final static int getNumberOfInvalidChar(String sequence, Set<Character> cSet, boolean ignoreCase){
int total = 0;
char[] cArray;
if(ignoreCase) cArray = sequence.toUpperCase().toCharArray();
else cArray = sequence.toCharArray();
if(cSet == null) cSet = PeptideProperties.standardAASet;
for(char c:cArr... | [
"public",
"final",
"static",
"int",
"getNumberOfInvalidChar",
"(",
"String",
"sequence",
",",
"Set",
"<",
"Character",
">",
"cSet",
",",
"boolean",
"ignoreCase",
")",
"{",
"int",
"total",
"=",
"0",
";",
"char",
"[",
"]",
"cArray",
";",
"if",
"(",
"ignore... | Return the number of invalid characters in sequence.
@param sequence
protein sequence to count for invalid characters.
@param cSet
the set of characters that are deemed valid.
@param ignoreCase
indicates if cases should be ignored
@return
the number of invalid characters in sequence. | [
"Return",
"the",
"number",
"of",
"invalid",
"characters",
"in",
"sequence",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L89-L99 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.outputSingle | public INDArray outputSingle(boolean train, boolean clearInputs, INDArray... input) {
"""
Identical to {@link #outputSingle(boolean, boolean, INDArray...)} but has the option of not clearing the input
arrays (useful when later backpropagating external errors). Most users should use {@link #outputSingle(boolean, I... | java | public INDArray outputSingle(boolean train, boolean clearInputs, INDArray... input){
if (numOutputArrays != 1) {
throw new IllegalStateException(
"Cannot use outputSingle with ComputationGraph that does not have exactly 1 output. nOutputs: "
+ numOutpu... | [
"public",
"INDArray",
"outputSingle",
"(",
"boolean",
"train",
",",
"boolean",
"clearInputs",
",",
"INDArray",
"...",
"input",
")",
"{",
"if",
"(",
"numOutputArrays",
"!=",
"1",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot use outputSingle wit... | Identical to {@link #outputSingle(boolean, boolean, INDArray...)} but has the option of not clearing the input
arrays (useful when later backpropagating external errors). Most users should use {@link #outputSingle(boolean, INDArray...)}
in preference to this method. | [
"Identical",
"to",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L1765-L1772 |
googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java | AtomContent.forFeed | public static AtomContent forFeed(XmlNamespaceDictionary namespaceDictionary, Object feed) {
"""
Returns a new instance of HTTP content for an Atom feed.
@param namespaceDictionary XML namespace dictionary
@param feed data key/value pair for the Atom feed
@since 1.5
"""
return new AtomContent(namespac... | java | public static AtomContent forFeed(XmlNamespaceDictionary namespaceDictionary, Object feed) {
return new AtomContent(namespaceDictionary, feed, false);
} | [
"public",
"static",
"AtomContent",
"forFeed",
"(",
"XmlNamespaceDictionary",
"namespaceDictionary",
",",
"Object",
"feed",
")",
"{",
"return",
"new",
"AtomContent",
"(",
"namespaceDictionary",
",",
"feed",
",",
"false",
")",
";",
"}"
] | Returns a new instance of HTTP content for an Atom feed.
@param namespaceDictionary XML namespace dictionary
@param feed data key/value pair for the Atom feed
@since 1.5 | [
"Returns",
"a",
"new",
"instance",
"of",
"HTTP",
"content",
"for",
"an",
"Atom",
"feed",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java#L91-L93 |
jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/TimeNode.java | TimeNode.getNearestForwardValue | @VisibleForTesting
NearestValue getNearestForwardValue(final int reference, int shiftsToApply) {
"""
We return same reference value if matches or next one if does not match.
Then we start applying shifts.
This way we ensure same value is returned if no shift is requested.
@param reference - reference ... | java | @VisibleForTesting
NearestValue getNearestForwardValue(final int reference, int shiftsToApply) {
final List<Integer> temporaryValues = new ArrayList<>(this.values);
int index = 0;
boolean foundGreater = false;
final AtomicInteger shift = new AtomicInteger(0);
if (!temporaryVa... | [
"@",
"VisibleForTesting",
"NearestValue",
"getNearestForwardValue",
"(",
"final",
"int",
"reference",
",",
"int",
"shiftsToApply",
")",
"{",
"final",
"List",
"<",
"Integer",
">",
"temporaryValues",
"=",
"new",
"ArrayList",
"<>",
"(",
"this",
".",
"values",
")",
... | We return same reference value if matches or next one if does not match.
Then we start applying shifts.
This way we ensure same value is returned if no shift is requested.
@param reference - reference value
@param shiftsToApply - shifts to apply
@return NearestValue instance, never null. Holds information on neare... | [
"We",
"return",
"same",
"reference",
"value",
"if",
"matches",
"or",
"next",
"one",
"if",
"does",
"not",
"match",
".",
"Then",
"we",
"start",
"applying",
"shifts",
".",
"This",
"way",
"we",
"ensure",
"same",
"value",
"is",
"returned",
"if",
"no",
"shift"... | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/TimeNode.java#L53-L80 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java | IndexImage.getIndexedImage | public static BufferedImage getIndexedImage(BufferedImage pImage, Image pPalette, Color pMatte, int pHints)
throws ImageConversionException {
"""
Converts the input image (must be {@code TYPE_INT_RGB} or
{@code TYPE_INT_ARGB}) to an indexed image. If the palette image
uses an {@code IndexColorModel}... | java | public static BufferedImage getIndexedImage(BufferedImage pImage, Image pPalette, Color pMatte, int pHints)
throws ImageConversionException {
return getIndexedImage(pImage, getIndexColorModel(pPalette, 256, pHints), pMatte, pHints);
} | [
"public",
"static",
"BufferedImage",
"getIndexedImage",
"(",
"BufferedImage",
"pImage",
",",
"Image",
"pPalette",
",",
"Color",
"pMatte",
",",
"int",
"pHints",
")",
"throws",
"ImageConversionException",
"{",
"return",
"getIndexedImage",
"(",
"pImage",
",",
"getIndex... | Converts the input image (must be {@code TYPE_INT_RGB} or
{@code TYPE_INT_ARGB}) to an indexed image. If the palette image
uses an {@code IndexColorModel}, this will be used. Otherwise, generating an
adaptive palette (8 bit) from the given palette image.
Dithering, transparency and color selection is controlled with th... | [
"Converts",
"the",
"input",
"image",
"(",
"must",
"be",
"{",
"@code",
"TYPE_INT_RGB",
"}",
"or",
"{",
"@code",
"TYPE_INT_ARGB",
"}",
")",
"to",
"an",
"indexed",
"image",
".",
"If",
"the",
"palette",
"image",
"uses",
"an",
"{",
"@code",
"IndexColorModel",
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java#L897-L900 |
stripe/stripe-java | src/main/java/com/stripe/model/Invoice.java | Invoice.markUncollectible | public Invoice markUncollectible() throws StripeException {
"""
Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
written off for accounting purposes.
"""
return markUncollectible((Map<String, Object>) null, (RequestOptions) null);
} | java | public Invoice markUncollectible() throws StripeException {
return markUncollectible((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"Invoice",
"markUncollectible",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"markUncollectible",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
written off for accounting purposes. | [
"Marking",
"an",
"invoice",
"as",
"uncollectible",
"is",
"useful",
"for",
"keeping",
"track",
"of",
"bad",
"debts",
"that",
"can",
"be",
"written",
"off",
"for",
"accounting",
"purposes",
"."
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Invoice.java#L1107-L1109 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java | PropsCodeGen.writeHashCode | @Override
void writeHashCode(Definition def, Writer out, int indent) throws IOException {
"""
Output hashCode method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeIndent(out, indent);
out.write("/** \n");
writeIndent... | java | @Override
void writeHashCode(Definition def, Writer out, int indent) throws IOException
{
writeIndent(out, indent);
out.write("/** \n");
writeIndent(out, indent);
out.write(" * Returns a hash code value for the object.\n");
writeIndent(out, indent);
out.write(" * @return A hash... | [
"@",
"Override",
"void",
"writeHashCode",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeIndent",
"(",
"out",
",",
"indent",
")",
";",
"out",
".",
"write",
"(",
"\"/** \\n\"",
")",
";",
"wri... | Output hashCode method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"hashCode",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java#L135-L166 |
Netflix/conductor | es5-persistence/src/main/java/com/netflix/conductor/dao/es5/index/ElasticSearchRestDAOV5.java | ElasticSearchRestDAOV5.indexWithRetry | private void indexWithRetry(final IndexRequest request, final String operationDescription) {
"""
Performs an index operation with a retry.
@param request The index request that we want to perform.
@param operationDescription The type of operation that we are performing.
"""
try {
new Ret... | java | private void indexWithRetry(final IndexRequest request, final String operationDescription) {
try {
new RetryUtil<IndexResponse>().retryOnException(() -> {
try {
return elasticSearchClient.index(request);
} catch (IOException e) {
... | [
"private",
"void",
"indexWithRetry",
"(",
"final",
"IndexRequest",
"request",
",",
"final",
"String",
"operationDescription",
")",
"{",
"try",
"{",
"new",
"RetryUtil",
"<",
"IndexResponse",
">",
"(",
")",
".",
"retryOnException",
"(",
"(",
")",
"->",
"{",
"t... | Performs an index operation with a retry.
@param request The index request that we want to perform.
@param operationDescription The type of operation that we are performing. | [
"Performs",
"an",
"index",
"operation",
"with",
"a",
"retry",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/es5-persistence/src/main/java/com/netflix/conductor/dao/es5/index/ElasticSearchRestDAOV5.java#L661-L675 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addDependency | public void addDependency( final String name, final int comparison, final String version ) {
"""
Adds a dependency to the RPM package. This dependency version will be marked as the exact
requirement, and the package will require the named dependency with exactly this version at
install time.
@param name the n... | java | public void addDependency( final String name, final int comparison, final String version ) {
requires.add(new Dependency(name, version, comparison));
} | [
"public",
"void",
"addDependency",
"(",
"final",
"String",
"name",
",",
"final",
"int",
"comparison",
",",
"final",
"String",
"version",
")",
"{",
"requires",
".",
"add",
"(",
"new",
"Dependency",
"(",
"name",
",",
"version",
",",
"comparison",
")",
")",
... | Adds a dependency to the RPM package. This dependency version will be marked as the exact
requirement, and the package will require the named dependency with exactly this version at
install time.
@param name the name of the dependency.
@param comparison the comparison flag.
@param version the version identifier. | [
"Adds",
"a",
"dependency",
"to",
"the",
"RPM",
"package",
".",
"This",
"dependency",
"version",
"will",
"be",
"marked",
"as",
"the",
"exact",
"requirement",
"and",
"the",
"package",
"will",
"require",
"the",
"named",
"dependency",
"with",
"exactly",
"this",
... | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L169-L171 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java | GrahamScanConvexHull2D.isConvex | private boolean isConvex(double[] a, double[] b, double[] c) {
"""
Simple convexity test.
@param a double[] A
@param b double[] B
@param c double[] C
@return convexity
"""
// We're using factor to improve numerical contrast for small polygons.
double area = (b[0] - a[0]) * factor * (c[1] - a[1]) ... | java | private boolean isConvex(double[] a, double[] b, double[] c) {
// We're using factor to improve numerical contrast for small polygons.
double area = (b[0] - a[0]) * factor * (c[1] - a[1]) - (c[0] - a[0]) * factor * (b[1] - a[1]);
return (-1e-13 < area && area < 1e-13) ? (mdist(b, c) > mdist(a, b) + mdist(a,... | [
"private",
"boolean",
"isConvex",
"(",
"double",
"[",
"]",
"a",
",",
"double",
"[",
"]",
"b",
",",
"double",
"[",
"]",
"c",
")",
"{",
"// We're using factor to improve numerical contrast for small polygons.",
"double",
"area",
"=",
"(",
"b",
"[",
"0",
"]",
"... | Simple convexity test.
@param a double[] A
@param b double[] B
@param c double[] C
@return convexity | [
"Simple",
"convexity",
"test",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java#L223-L227 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setAtomicReferenceConfigs | public Config setAtomicReferenceConfigs(Map<String, AtomicReferenceConfig> atomicReferenceConfigs) {
"""
Sets the map of AtomicReference configurations, mapped by config name.
The config name may be a pattern with which the configuration will be obtained in the future.
@param atomicReferenceConfigs the AtomicR... | java | public Config setAtomicReferenceConfigs(Map<String, AtomicReferenceConfig> atomicReferenceConfigs) {
this.atomicReferenceConfigs.clear();
this.atomicReferenceConfigs.putAll(atomicReferenceConfigs);
for (Entry<String, AtomicReferenceConfig> entry : atomicReferenceConfigs.entrySet()) {
... | [
"public",
"Config",
"setAtomicReferenceConfigs",
"(",
"Map",
"<",
"String",
",",
"AtomicReferenceConfig",
">",
"atomicReferenceConfigs",
")",
"{",
"this",
".",
"atomicReferenceConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"atomicReferenceConfigs",
".",
"putAll... | Sets the map of AtomicReference configurations, mapped by config name.
The config name may be a pattern with which the configuration will be obtained in the future.
@param atomicReferenceConfigs the AtomicReference configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"AtomicReference",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"The",
"config",
"name",
"may",
"be",
"a",
"pattern",
"with",
"which",
"the",
"configuration",
"will",
"be",
"obtained",
"in",
"the",
"future",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L1484-L1491 |
mediathekview/MServer | src/main/java/mServer/crawler/sender/base/UrlUtils.java | UrlUtils.addProtocolIfMissing | public static String addProtocolIfMissing(final String aUrl, final String aProtocol) {
"""
adds the protocol if missing.
@param aUrl the url to check
@param aProtocol the protocol to add
@return the url including the protocol
"""
if (aUrl != null && aUrl.startsWith("//")) {
return aProtocol + ... | java | public static String addProtocolIfMissing(final String aUrl, final String aProtocol) {
if (aUrl != null && aUrl.startsWith("//")) {
return aProtocol + aUrl;
}
return aUrl;
} | [
"public",
"static",
"String",
"addProtocolIfMissing",
"(",
"final",
"String",
"aUrl",
",",
"final",
"String",
"aProtocol",
")",
"{",
"if",
"(",
"aUrl",
"!=",
"null",
"&&",
"aUrl",
".",
"startsWith",
"(",
"\"//\"",
")",
")",
"{",
"return",
"aProtocol",
"+",... | adds the protocol if missing.
@param aUrl the url to check
@param aProtocol the protocol to add
@return the url including the protocol | [
"adds",
"the",
"protocol",
"if",
"missing",
"."
] | train | https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L52-L58 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/model/MultiPartOutputStream.java | MultiPartOutputStream.startPart | public void startPart(String contentType, String[] headers) throws IOException {
"""
Start creation of the next Content.
@param contentType the content type of the part
@param headers the part headers
@throws IOException if unable to write the part
"""
if (inPart)
out.write(__CRLF)... | java | public void startPart(String contentType, String[] headers) throws IOException {
if (inPart)
out.write(__CRLF);
inPart = true;
out.write(__DASHDASH);
out.write(boundaryBytes);
out.write(__CRLF);
if (contentType != null)
out.write(("Content-Type: " ... | [
"public",
"void",
"startPart",
"(",
"String",
"contentType",
",",
"String",
"[",
"]",
"headers",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inPart",
")",
"out",
".",
"write",
"(",
"__CRLF",
")",
";",
"inPart",
"=",
"true",
";",
"out",
".",
"write",... | Start creation of the next Content.
@param contentType the content type of the part
@param headers the part headers
@throws IOException if unable to write the part | [
"Start",
"creation",
"of",
"the",
"next",
"Content",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/MultiPartOutputStream.java#L89-L104 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.orLike | public ZealotKhala orLike(String field, Object value) {
"""
生成带" OR "前缀的like模糊查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例
"""
return this.doLike(ZealotConst.OR_PREFIX, field, value, true, true);
} | java | public ZealotKhala orLike(String field, Object value) {
return this.doLike(ZealotConst.OR_PREFIX, field, value, true, true);
} | [
"public",
"ZealotKhala",
"orLike",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"return",
"this",
".",
"doLike",
"(",
"ZealotConst",
".",
"OR_PREFIX",
",",
"field",
",",
"value",
",",
"true",
",",
"true",
")",
";",
"}"
] | 生成带" OR "前缀的like模糊查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例 | [
"生成带",
"OR",
"前缀的like模糊查询的SQL片段",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L942-L944 |
lionsoul2014/jcseg | jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java | Controller.getRawDataAsString | public String getRawDataAsString() throws IOException {
"""
get the original request raw data as String
@return String
@throws IOException
"""
byte[] buffer = getRawData();
if ( buffer == null ) {
return null;
}
String encoding = request.getCharacterEn... | java | public String getRawDataAsString() throws IOException
{
byte[] buffer = getRawData();
if ( buffer == null ) {
return null;
}
String encoding = request.getCharacterEncoding();
if ( encoding == null ) {
encoding = "utf-8";
}
... | [
"public",
"String",
"getRawDataAsString",
"(",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"getRawData",
"(",
")",
";",
"if",
"(",
"buffer",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"encoding",
"=",
"request",... | get the original request raw data as String
@return String
@throws IOException | [
"get",
"the",
"original",
"request",
"raw",
"data",
"as",
"String"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/Controller.java#L301-L314 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/MathUtils.java | MathUtils.divideRoundDown | public static <T extends Number> long divideRoundDown(final T dividend, final T divisor) {
"""
Returns a long average number by round down with specify dividend and
divisor.<br>
Returns 0 if dividend == null or divisor == null.<br>
Returns 1 if dividend == divisor or divisor == 0.<br>
e.g: average is 3.5, then... | java | public static <T extends Number> long divideRoundDown(final T dividend, final T divisor) {
return (long) divide(dividend, divisor);
} | [
"public",
"static",
"<",
"T",
"extends",
"Number",
">",
"long",
"divideRoundDown",
"(",
"final",
"T",
"dividend",
",",
"final",
"T",
"divisor",
")",
"{",
"return",
"(",
"long",
")",
"divide",
"(",
"dividend",
",",
"divisor",
")",
";",
"}"
] | Returns a long average number by round down with specify dividend and
divisor.<br>
Returns 0 if dividend == null or divisor == null.<br>
Returns 1 if dividend == divisor or divisor == 0.<br>
e.g: average is 3.5, then return 3.
@param dividend
number to be handled.
@param divisor
number to be handled.
@return a long av... | [
"Returns",
"a",
"long",
"average",
"number",
"by",
"round",
"down",
"with",
"specify",
"dividend",
"and",
"divisor",
".",
"<br",
">",
"Returns",
"0",
"if",
"dividend",
"==",
"null",
"or",
"divisor",
"==",
"null",
".",
"<br",
">",
"Returns",
"1",
"if",
... | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/MathUtils.java#L206-L209 |
xwiki/xwiki-rendering | xwiki-rendering-transformations/xwiki-rendering-transformation-macro/src/main/java/org/xwiki/rendering/internal/transformation/macro/MacroTransformation.java | MacroTransformation.wrapInMacroMarker | private Block wrapInMacroMarker(MacroBlock macroBlockToWrap, List<Block> newBlocks) {
"""
Wrap the output of a macro block with a {@link MacroMarkerBlock}.
@param macroBlockToWrap the block that should be replaced
@param newBlocks list of blocks to wrap
@return the wrapper
"""
return new MacroMark... | java | private Block wrapInMacroMarker(MacroBlock macroBlockToWrap, List<Block> newBlocks)
{
return new MacroMarkerBlock(macroBlockToWrap.getId(), macroBlockToWrap.getParameters(),
macroBlockToWrap.getContent(), newBlocks, macroBlockToWrap.isInline());
} | [
"private",
"Block",
"wrapInMacroMarker",
"(",
"MacroBlock",
"macroBlockToWrap",
",",
"List",
"<",
"Block",
">",
"newBlocks",
")",
"{",
"return",
"new",
"MacroMarkerBlock",
"(",
"macroBlockToWrap",
".",
"getId",
"(",
")",
",",
"macroBlockToWrap",
".",
"getParameter... | Wrap the output of a macro block with a {@link MacroMarkerBlock}.
@param macroBlockToWrap the block that should be replaced
@param newBlocks list of blocks to wrap
@return the wrapper | [
"Wrap",
"the",
"output",
"of",
"a",
"macro",
"block",
"with",
"a",
"{",
"@link",
"MacroMarkerBlock",
"}",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-transformations/xwiki-rendering-transformation-macro/src/main/java/org/xwiki/rendering/internal/transformation/macro/MacroTransformation.java#L331-L335 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadPPM | public static BufferedImage loadPPM( String fileName , BufferedImage storage ) throws IOException {
"""
Loads a PPM image from a file.
@param fileName Location of PPM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type Buf... | java | public static BufferedImage loadPPM( String fileName , BufferedImage storage ) throws IOException {
return loadPPM(new FileInputStream(fileName),storage);
} | [
"public",
"static",
"BufferedImage",
"loadPPM",
"(",
"String",
"fileName",
",",
"BufferedImage",
"storage",
")",
"throws",
"IOException",
"{",
"return",
"loadPPM",
"(",
"new",
"FileInputStream",
"(",
"fileName",
")",
",",
"storage",
")",
";",
"}"
] | Loads a PPM image from a file.
@param fileName Location of PPM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_INT_RGB. If null or width/height incorrect a new image
will be declared.
@return The read in ima... | [
"Loads",
"a",
"PPM",
"image",
"from",
"a",
"file",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L203-L205 |
alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/HdfsSpout.java | HdfsSpout.getFileForLockFile | private Path getFileForLockFile(Path lockFile, Path sourceDirPath)
throws IOException {
"""
Returns the corresponding input file in the 'sourceDirPath' for the specified lock file.
If no such file is found then returns null
"""
String lockFileName = lockFile.getName();
Path dataFile = new Pa... | java | private Path getFileForLockFile(Path lockFile, Path sourceDirPath)
throws IOException {
String lockFileName = lockFile.getName();
Path dataFile = new Path(sourceDirPath + Path.SEPARATOR + lockFileName + inprogress_suffix);
if( hdfs.exists(dataFile) ) {
return dataFile;
}
dataFile = n... | [
"private",
"Path",
"getFileForLockFile",
"(",
"Path",
"lockFile",
",",
"Path",
"sourceDirPath",
")",
"throws",
"IOException",
"{",
"String",
"lockFileName",
"=",
"lockFile",
".",
"getName",
"(",
")",
";",
"Path",
"dataFile",
"=",
"new",
"Path",
"(",
"sourceDir... | Returns the corresponding input file in the 'sourceDirPath' for the specified lock file.
If no such file is found then returns null | [
"Returns",
"the",
"corresponding",
"input",
"file",
"in",
"the",
"sourceDirPath",
"for",
"the",
"specified",
"lock",
"file",
".",
"If",
"no",
"such",
"file",
"is",
"found",
"then",
"returns",
"null"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/HdfsSpout.java#L663-L675 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/filters/Filters.java | Filters.noFilterMatches | public static <T> boolean noFilterMatches(final T object, final List<Filter<T>> filters) {
"""
Algorithms for rejecting the supplied object if at least one of the supplied Filters rejects it.
@param object The object to accept (or not).
@param filters The non-null list of Filters to examine the supplied objec... | java | public static <T> boolean noFilterMatches(final T object, final List<Filter<T>> filters) {
// Check sanity
Validate.notNull(filters, "filters");
boolean matchedAtLeastOnce = false;
for (Filter<T> current : filters) {
if (current.accept(object)) {
matchedAtLe... | [
"public",
"static",
"<",
"T",
">",
"boolean",
"noFilterMatches",
"(",
"final",
"T",
"object",
",",
"final",
"List",
"<",
"Filter",
"<",
"T",
">",
">",
"filters",
")",
"{",
"// Check sanity",
"Validate",
".",
"notNull",
"(",
"filters",
",",
"\"filters\"",
... | Algorithms for rejecting the supplied object if at least one of the supplied Filters rejects it.
@param object The object to accept (or not).
@param filters The non-null list of Filters to examine the supplied object.
@param <T> The Filter type.
@return {@code true} if at least one of the filters return false fro... | [
"Algorithms",
"for",
"rejecting",
"the",
"supplied",
"object",
"if",
"at",
"least",
"one",
"of",
"the",
"supplied",
"Filters",
"rejects",
"it",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/filters/Filters.java#L103-L117 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java | ComponentCollision.checkPoint | private void checkPoint(Collidable objectA, Map<Point, Set<Collidable>> acceptedElements, Point point) {
"""
Check others element at specified point.
@param objectA The collidable reference.
@param acceptedElements The current elements to check.
@param point The point to check.
"""
final Set<Colli... | java | private void checkPoint(Collidable objectA, Map<Point, Set<Collidable>> acceptedElements, Point point)
{
final Set<Collidable> others = acceptedElements.get(point);
for (final Collidable objectB : others)
{
if (objectA != objectB)
{
final List<Collisio... | [
"private",
"void",
"checkPoint",
"(",
"Collidable",
"objectA",
",",
"Map",
"<",
"Point",
",",
"Set",
"<",
"Collidable",
">",
">",
"acceptedElements",
",",
"Point",
"point",
")",
"{",
"final",
"Set",
"<",
"Collidable",
">",
"others",
"=",
"acceptedElements",
... | Check others element at specified point.
@param objectA The collidable reference.
@param acceptedElements The current elements to check.
@param point The point to check. | [
"Check",
"others",
"element",
"at",
"specified",
"point",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java#L200-L214 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.bindProperty | protected void bindProperty(PersistentProperty grailsProperty, Property prop, InFlightMetadataCollector mappings) {
"""
Binds a property to Hibernate runtime meta model. Deals with cascade strategy based on the Grails domain model
@param grailsProperty The grails property instance
@param prop The Hib... | java | protected void bindProperty(PersistentProperty grailsProperty, Property prop, InFlightMetadataCollector mappings) {
// set the property name
prop.setName(grailsProperty.getName());
if (isBidirectionalManyToOneWithListMapping(grailsProperty, prop)) {
prop.setInsertable(false);
... | [
"protected",
"void",
"bindProperty",
"(",
"PersistentProperty",
"grailsProperty",
",",
"Property",
"prop",
",",
"InFlightMetadataCollector",
"mappings",
")",
"{",
"// set the property name",
"prop",
".",
"setName",
"(",
"grailsProperty",
".",
"getName",
"(",
")",
")",... | Binds a property to Hibernate runtime meta model. Deals with cascade strategy based on the Grails domain model
@param grailsProperty The grails property instance
@param prop The Hibernate property
@param mappings The Hibernate mappings | [
"Binds",
"a",
"property",
"to",
"Hibernate",
"runtime",
"meta",
"model",
".",
"Deals",
"with",
"cascade",
"strategy",
"based",
"on",
"the",
"Grails",
"domain",
"model"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L2626-L2674 |
apache/incubator-heron | heron/spi/src/java/org/apache/heron/spi/statemgr/SchedulerStateManagerAdaptor.java | SchedulerStateManagerAdaptor.setPackingPlan | public Boolean setPackingPlan(PackingPlans.PackingPlan packingPlan, String topologyName) {
"""
Set the packing plan for the given topology
@param packingPlan the packing plan of the topology
@return Boolean - Success or Failure
"""
return awaitResult(delegate.setPackingPlan(packingPlan, topologyName));... | java | public Boolean setPackingPlan(PackingPlans.PackingPlan packingPlan, String topologyName) {
return awaitResult(delegate.setPackingPlan(packingPlan, topologyName));
} | [
"public",
"Boolean",
"setPackingPlan",
"(",
"PackingPlans",
".",
"PackingPlan",
"packingPlan",
",",
"String",
"topologyName",
")",
"{",
"return",
"awaitResult",
"(",
"delegate",
".",
"setPackingPlan",
"(",
"packingPlan",
",",
"topologyName",
")",
")",
";",
"}"
] | Set the packing plan for the given topology
@param packingPlan the packing plan of the topology
@return Boolean - Success or Failure | [
"Set",
"the",
"packing",
"plan",
"for",
"the",
"given",
"topology"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/statemgr/SchedulerStateManagerAdaptor.java#L153-L155 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java | ArrayIndexOutOfBounds.visitCode | @Override
public void visitCode(Code obj) {
"""
overrides the visitor to collect parameter registers
@param obj
the code block of the currently parsed method
"""
Method m = getMethod();
stack.resetForMethodEntry(this);
initializedRegs.clear();
modifyRegs.clear();
... | java | @Override
public void visitCode(Code obj) {
Method m = getMethod();
stack.resetForMethodEntry(this);
initializedRegs.clear();
modifyRegs.clear();
Type[] argTypes = m.getArgumentTypes();
int arg = m.isStatic() ? 0 : 1;
for (Type argType : argTypes) {
... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
"Code",
"obj",
")",
"{",
"Method",
"m",
"=",
"getMethod",
"(",
")",
";",
"stack",
".",
"resetForMethodEntry",
"(",
"this",
")",
";",
"initializedRegs",
".",
"clear",
"(",
")",
";",
"modifyRegs",
".",
... | overrides the visitor to collect parameter registers
@param obj
the code block of the currently parsed method | [
"overrides",
"the",
"visitor",
"to",
"collect",
"parameter",
"registers"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ArrayIndexOutOfBounds.java#L90-L110 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/rule/builder/PatternBuilder.java | PatternBuilder.createDeclarationObject | protected static Declaration createDeclarationObject(final RuleBuildContext context,
final String identifier,
final Pattern pattern) {
"""
Creates a declaration object for the field identified by the g... | java | protected static Declaration createDeclarationObject(final RuleBuildContext context,
final String identifier,
final Pattern pattern) {
return createDeclarationObject(context, identifier, identifier,... | [
"protected",
"static",
"Declaration",
"createDeclarationObject",
"(",
"final",
"RuleBuildContext",
"context",
",",
"final",
"String",
"identifier",
",",
"final",
"Pattern",
"pattern",
")",
"{",
"return",
"createDeclarationObject",
"(",
"context",
",",
"identifier",
",... | Creates a declaration object for the field identified by the given identifier
on the give pattern object | [
"Creates",
"a",
"declaration",
"object",
"for",
"the",
"field",
"identified",
"by",
"the",
"given",
"identifier",
"on",
"the",
"give",
"pattern",
"object"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/rule/builder/PatternBuilder.java#L1694-L1698 |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/ColorUtils.java | ColorUtils.rotateHue | public static Color rotateHue (Color color, float fraction) {
"""
Rotate a color through HSB space
@param color Starting color
@param fraction Amount to add to the hue. The integer part is discarded to leave a number in [0,1)
@return
"""
float[] af = Color.RGBtoHSB(color.getRed(), color.getGreen(), color... | java | public static Color rotateHue (Color color, float fraction) {
float[] af = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
float hue = af[0];
float saturation = af[1];
float brightness = af[2];
float hueNew = hue + fraction;
Color hsb = Color.getHSBColor(hueNew, saturation, bri... | [
"public",
"static",
"Color",
"rotateHue",
"(",
"Color",
"color",
",",
"float",
"fraction",
")",
"{",
"float",
"[",
"]",
"af",
"=",
"Color",
".",
"RGBtoHSB",
"(",
"color",
".",
"getRed",
"(",
")",
",",
"color",
".",
"getGreen",
"(",
")",
",",
"color",... | Rotate a color through HSB space
@param color Starting color
@param fraction Amount to add to the hue. The integer part is discarded to leave a number in [0,1)
@return | [
"Rotate",
"a",
"color",
"through",
"HSB",
"space"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/ColorUtils.java#L67-L79 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.