repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java | HtmlButtonRendererBase.findNestingForm | protected FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
{
return RendererUtils.findNestingForm(uiComponent, facesContext);
} | java | protected FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
{
return RendererUtils.findNestingForm(uiComponent, facesContext);
} | [
"protected",
"FormInfo",
"findNestingForm",
"(",
"UIComponent",
"uiComponent",
",",
"FacesContext",
"facesContext",
")",
"{",
"return",
"RendererUtils",
".",
"findNestingForm",
"(",
"uiComponent",
",",
"facesContext",
")",
";",
"}"
] | find nesting form<br />
need to be overrideable to deal with dummyForm stuff in tomahawk. | [
"find",
"nesting",
"form<br",
"/",
">",
"need",
"to",
"be",
"overrideable",
"to",
"deal",
"with",
"dummyForm",
"stuff",
"in",
"tomahawk",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java#L644-L647 |
Wikidata/Wikidata-Toolkit | wdtk-storage/src/main/java/org/wikidata/wdtk/storage/datastructures/CountBitsArray.java | CountBitsArray.countBits | public long countBits(boolean bit, long position) {
updateCount();
int blockNumber = (int) (position / this.blockSize);
long mark = ((long) blockNumber) * this.blockSize;
long trueValues = 0;
if (blockNumber > 0) {
trueValues = this.countArray[blockNumber - 1];
}
for (long index = mark; index <= positi... | java | public long countBits(boolean bit, long position) {
updateCount();
int blockNumber = (int) (position / this.blockSize);
long mark = ((long) blockNumber) * this.blockSize;
long trueValues = 0;
if (blockNumber > 0) {
trueValues = this.countArray[blockNumber - 1];
}
for (long index = mark; index <= positi... | [
"public",
"long",
"countBits",
"(",
"boolean",
"bit",
",",
"long",
"position",
")",
"{",
"updateCount",
"(",
")",
";",
"int",
"blockNumber",
"=",
"(",
"int",
")",
"(",
"position",
"/",
"this",
".",
"blockSize",
")",
";",
"long",
"mark",
"=",
"(",
"("... | Returns the number of occurrences of <i>bit</i> up to <i>position</i>.
@return number of occurrences of <i>bit</i> up to <i>position</i> | [
"Returns",
"the",
"number",
"of",
"occurrences",
"of",
"<i",
">",
"bit<",
"/",
"i",
">",
"up",
"to",
"<i",
">",
"position<",
"/",
"i",
">",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-storage/src/main/java/org/wikidata/wdtk/storage/datastructures/CountBitsArray.java#L98-L110 |
hawkular/hawkular-apm | client/collector/src/main/java/org/hawkular/apm/client/collector/internal/FragmentBuilder.java | FragmentBuilder.nodeMatches | protected boolean nodeMatches(Node node, Class<? extends Node> cls, String uri) {
if (node.getClass() == cls) {
return uri == null || NodeUtil.isOriginalURI(node, uri);
}
return false;
} | java | protected boolean nodeMatches(Node node, Class<? extends Node> cls, String uri) {
if (node.getClass() == cls) {
return uri == null || NodeUtil.isOriginalURI(node, uri);
}
return false;
} | [
"protected",
"boolean",
"nodeMatches",
"(",
"Node",
"node",
",",
"Class",
"<",
"?",
"extends",
"Node",
">",
"cls",
",",
"String",
"uri",
")",
"{",
"if",
"(",
"node",
".",
"getClass",
"(",
")",
"==",
"cls",
")",
"{",
"return",
"uri",
"==",
"null",
"... | This method determines whether the supplied node matches the specified class
and optional URI.
@param node The node
@param cls The class
@param uri The optional URI
@return Whether the node is of the correct type and matches the optional URI | [
"This",
"method",
"determines",
"whether",
"the",
"supplied",
"node",
"matches",
"the",
"specified",
"class",
"and",
"optional",
"URI",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/collector/src/main/java/org/hawkular/apm/client/collector/internal/FragmentBuilder.java#L348-L354 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/AttributedString.java | AttributedString.getIterator | public AttributedCharacterIterator getIterator(Attribute[] attributes, int beginIndex, int endIndex) {
return new AttributedStringIterator(attributes, beginIndex, endIndex);
} | java | public AttributedCharacterIterator getIterator(Attribute[] attributes, int beginIndex, int endIndex) {
return new AttributedStringIterator(attributes, beginIndex, endIndex);
} | [
"public",
"AttributedCharacterIterator",
"getIterator",
"(",
"Attribute",
"[",
"]",
"attributes",
",",
"int",
"beginIndex",
",",
"int",
"endIndex",
")",
"{",
"return",
"new",
"AttributedStringIterator",
"(",
"attributes",
",",
"beginIndex",
",",
"endIndex",
")",
"... | Creates an AttributedCharacterIterator instance that provides access to
selected contents of this string.
Information about attributes not listed in attributes that the
implementor may have need not be made accessible through the iterator.
If the list is null, all available attribute information should be made
accessib... | [
"Creates",
"an",
"AttributedCharacterIterator",
"instance",
"that",
"provides",
"access",
"to",
"selected",
"contents",
"of",
"this",
"string",
".",
"Information",
"about",
"attributes",
"not",
"listed",
"in",
"attributes",
"that",
"the",
"implementor",
"may",
"have... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/AttributedString.java#L582-L584 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/query/resultspartitioner/ResultsPartitionsFactory.java | ResultsPartitionsFactory.get | public static ArrayList<ResultsPartition> get(CaptureSearchResults results,
WaybackRequest wbRequest) {
return get(results, wbRequest, null);
} | java | public static ArrayList<ResultsPartition> get(CaptureSearchResults results,
WaybackRequest wbRequest) {
return get(results, wbRequest, null);
} | [
"public",
"static",
"ArrayList",
"<",
"ResultsPartition",
">",
"get",
"(",
"CaptureSearchResults",
"results",
",",
"WaybackRequest",
"wbRequest",
")",
"{",
"return",
"get",
"(",
"results",
",",
"wbRequest",
",",
"null",
")",
";",
"}"
] | Determine the correct ResultsPartitioner to use given the SearchResults
search range, and use that to break the SearchResults into partitions.
@param results
@param wbRequest
@return ArrayList of ResultsPartition objects | [
"Determine",
"the",
"correct",
"ResultsPartitioner",
"to",
"use",
"given",
"the",
"SearchResults",
"search",
"range",
"and",
"use",
"that",
"to",
"break",
"the",
"SearchResults",
"into",
"partitions",
"."
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/query/resultspartitioner/ResultsPartitionsFactory.java#L54-L57 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateSecretAsync | public Observable<SecretBundle> updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map<String, String> tags) {
return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, t... | java | public Observable<SecretBundle> updateSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map<String, String> tags) {
return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, t... | [
"public",
"Observable",
"<",
"SecretBundle",
">",
"updateSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
",",
"String",
"secretVersion",
",",
"String",
"contentType",
",",
"SecretAttributes",
"secretAttributes",
",",
"Map",
"<",
"String",
"... | Updates the attributes associated with a specified secret in a given key vault.
The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set per... | [
"Updates",
"the",
"attributes",
"associated",
"with",
"a",
"specified",
"secret",
"in",
"a",
"given",
"key",
"vault",
".",
"The",
"UPDATE",
"operation",
"changes",
"specified",
"attributes",
"of",
"an",
"existing",
"stored",
"secret",
".",
"Attributes",
"that",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3753-L3760 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java | HttpResponse.withCookie | public HttpResponse withCookie(String name, String value) {
this.cookies.withEntry(name, value);
return this;
} | java | public HttpResponse withCookie(String name, String value) {
this.cookies.withEntry(name, value);
return this;
} | [
"public",
"HttpResponse",
"withCookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"this",
".",
"cookies",
".",
"withEntry",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add cookie to return as Set-Cookie header
@param name the cookies name
@param value the cookies value | [
"Add",
"cookie",
"to",
"return",
"as",
"Set",
"-",
"Cookie",
"header"
] | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpResponse.java#L351-L354 |
jeremiehuchet/nominatim-java-api | src/main/java/fr/dudie/nominatim/client/request/QueryParameterAnnotationHandler.java | QueryParameterAnnotationHandler.getValue | private static Object getValue(final Object o, final Field f) {
try {
f.setAccessible(true);
return f.get(o);
} catch (final IllegalArgumentException e) {
LOGGER.error("failure accessing field value {}", new Object[] { f.getName(), e });
} catch (final Illegal... | java | private static Object getValue(final Object o, final Field f) {
try {
f.setAccessible(true);
return f.get(o);
} catch (final IllegalArgumentException e) {
LOGGER.error("failure accessing field value {}", new Object[] { f.getName(), e });
} catch (final Illegal... | [
"private",
"static",
"Object",
"getValue",
"(",
"final",
"Object",
"o",
",",
"final",
"Field",
"f",
")",
"{",
"try",
"{",
"f",
".",
"setAccessible",
"(",
"true",
")",
";",
"return",
"f",
".",
"get",
"(",
"o",
")",
";",
"}",
"catch",
"(",
"final",
... | Gets a field value regardless of reflection errors.
@param o
the object instance
@param f
the field
@return the field value or null if a reflection error occurred | [
"Gets",
"a",
"field",
"value",
"regardless",
"of",
"reflection",
"errors",
"."
] | train | https://github.com/jeremiehuchet/nominatim-java-api/blob/faf3ff1003a9989eb5cc48f449b3a22c567843bf/src/main/java/fr/dudie/nominatim/client/request/QueryParameterAnnotationHandler.java#L149-L159 |
gturri/aXMLRPC | src/main/java/de/timroes/axmlrpc/XMLRPCClient.java | XMLRPCClient.setCustomHttpHeader | public void setCustomHttpHeader(String headerName, String headerValue) {
if(CONTENT_TYPE.equals(headerName) || HOST.equals(headerName)
|| CONTENT_LENGTH.equals(headerName)) {
throw new XMLRPCRuntimeException("You cannot modify the Host, Content-Type or Content-Length header.");
}
httpParameters.put(headerN... | java | public void setCustomHttpHeader(String headerName, String headerValue) {
if(CONTENT_TYPE.equals(headerName) || HOST.equals(headerName)
|| CONTENT_LENGTH.equals(headerName)) {
throw new XMLRPCRuntimeException("You cannot modify the Host, Content-Type or Content-Length header.");
}
httpParameters.put(headerN... | [
"public",
"void",
"setCustomHttpHeader",
"(",
"String",
"headerName",
",",
"String",
"headerValue",
")",
"{",
"if",
"(",
"CONTENT_TYPE",
".",
"equals",
"(",
"headerName",
")",
"||",
"HOST",
".",
"equals",
"(",
"headerName",
")",
"||",
"CONTENT_LENGTH",
".",
... | Set a HTTP header field to a custom value.
You cannot modify the Host or Content-Type field that way.
If the field already exists, the old value is overwritten.
@param headerName The name of the header field.
@param headerValue The new value of the header field. | [
"Set",
"a",
"HTTP",
"header",
"field",
"to",
"a",
"custom",
"value",
".",
"You",
"cannot",
"modify",
"the",
"Host",
"or",
"Content",
"-",
"Type",
"field",
"that",
"way",
".",
"If",
"the",
"field",
"already",
"exists",
"the",
"old",
"value",
"is",
"over... | train | https://github.com/gturri/aXMLRPC/blob/8ca6f95f7eb3a28efaef3569d53adddeb32b6bda/src/main/java/de/timroes/axmlrpc/XMLRPCClient.java#L344-L350 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/MarkerManager.java | MarkerManager.getMarker | @Deprecated
public static Marker getMarker(final String name, final Marker parent) {
return getMarker(name).addParents(parent);
} | java | @Deprecated
public static Marker getMarker(final String name, final Marker parent) {
return getMarker(name).addParents(parent);
} | [
"@",
"Deprecated",
"public",
"static",
"Marker",
"getMarker",
"(",
"final",
"String",
"name",
",",
"final",
"Marker",
"parent",
")",
"{",
"return",
"getMarker",
"(",
"name",
")",
".",
"addParents",
"(",
"parent",
")",
";",
"}"
] | Retrieves or creates a Marker with the specified parent.
@param name The name of the Marker.
@param parent The parent Marker.
@return The Marker with the specified name.
@throws IllegalArgumentException if any argument is {@code null}
@deprecated Use the Marker add or set methods to add parent Markers. Will be removed... | [
"Retrieves",
"or",
"creates",
"a",
"Marker",
"with",
"the",
"specified",
"parent",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/MarkerManager.java#L98-L101 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.pressText | public static void pressText(Image srcImage, ImageOutputStream destImageStream, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException {
writeJpg(pressText(srcImage, pressText, color, font, x, y, alpha), destImageStream);
} | java | public static void pressText(Image srcImage, ImageOutputStream destImageStream, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException {
writeJpg(pressText(srcImage, pressText, color, font, x, y, alpha), destImageStream);
} | [
"public",
"static",
"void",
"pressText",
"(",
"Image",
"srcImage",
",",
"ImageOutputStream",
"destImageStream",
",",
"String",
"pressText",
",",
"Color",
"color",
",",
"Font",
"font",
",",
"int",
"x",
",",
"int",
"y",
",",
"float",
"alpha",
")",
"throws",
... | 给图片添加文字水印<br>
此方法并不关闭流
@param srcImage 源图像
@param destImageStream 目标图像流
@param pressText 水印文字
@param color 水印的字体颜色
@param font {@link Font} 字体相关信息,如果默认则为{@code null}
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移量相对于中间偏移
@param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字
@throws IORuntimeException IO异常 | [
"给图片添加文字水印<br",
">",
"此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L844-L846 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectCircleCircle | public static boolean intersectCircleCircle(float aX, float aY, float radiusSquaredA, float bX, float bY, float radiusSquaredB, Vector3f intersectionCenterAndHL) {
float dX = bX - aX, dY = bY - aY;
float distSquared = dX * dX + dY * dY;
float h = 0.5f + (radiusSquaredA - radiusSquaredB) / distSq... | java | public static boolean intersectCircleCircle(float aX, float aY, float radiusSquaredA, float bX, float bY, float radiusSquaredB, Vector3f intersectionCenterAndHL) {
float dX = bX - aX, dY = bY - aY;
float distSquared = dX * dX + dY * dY;
float h = 0.5f + (radiusSquaredA - radiusSquaredB) / distSq... | [
"public",
"static",
"boolean",
"intersectCircleCircle",
"(",
"float",
"aX",
",",
"float",
"aY",
",",
"float",
"radiusSquaredA",
",",
"float",
"bX",
",",
"float",
"bY",
",",
"float",
"radiusSquaredB",
",",
"Vector3f",
"intersectionCenterAndHL",
")",
"{",
"float",... | Test whether the one circle with center <code>(aX, aY)</code> and square radius <code>radiusSquaredA</code> intersects the other
circle with center <code>(bX, bY)</code> and square radius <code>radiusSquaredB</code>, and store the center of the line segment of
intersection in the <code>(x, y)</code> components of the s... | [
"Test",
"whether",
"the",
"one",
"circle",
"with",
"center",
"<code",
">",
"(",
"aX",
"aY",
")",
"<",
"/",
"code",
">",
"and",
"square",
"radius",
"<code",
">",
"radiusSquaredA<",
"/",
"code",
">",
"intersects",
"the",
"other",
"circle",
"with",
"center"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3721-L3733 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/CmsImagePreviewHandler.java | CmsImagePreviewHandler.getPreviewScaleParam | public String getPreviewScaleParam(int imageHeight, int imageWidth) {
int maxHeight = m_previewDialog.getPreviewHeight() - 4;
int maxWidth = m_previewDialog.getDialogWidth() - 10;
if (m_croppingParam != null) {
return m_croppingParam.getRestrictedSizeScaleParam(maxHeight, maxWidth);... | java | public String getPreviewScaleParam(int imageHeight, int imageWidth) {
int maxHeight = m_previewDialog.getPreviewHeight() - 4;
int maxWidth = m_previewDialog.getDialogWidth() - 10;
if (m_croppingParam != null) {
return m_croppingParam.getRestrictedSizeScaleParam(maxHeight, maxWidth);... | [
"public",
"String",
"getPreviewScaleParam",
"(",
"int",
"imageHeight",
",",
"int",
"imageWidth",
")",
"{",
"int",
"maxHeight",
"=",
"m_previewDialog",
".",
"getPreviewHeight",
"(",
")",
"-",
"4",
";",
"int",
"maxWidth",
"=",
"m_previewDialog",
".",
"getDialogWid... | Returns the cropping parameter.<p>
@param imageHeight the original image height
@param imageWidth the original image width
@return the cropping parameter | [
"Returns",
"the",
"cropping",
"parameter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsImagePreviewHandler.java#L240-L254 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/IoFilterManager.java | IoFilterManager.queryIoFilterIssues | public IoFilterQueryIssueResult queryIoFilterIssues(String filterId, ComputeResource compRes)
throws RemoteException, RuntimeFault {
return getVimService().queryIoFilterIssues(getMOR(), filterId, compRes.getMOR());
} | java | public IoFilterQueryIssueResult queryIoFilterIssues(String filterId, ComputeResource compRes)
throws RemoteException, RuntimeFault {
return getVimService().queryIoFilterIssues(getMOR(), filterId, compRes.getMOR());
} | [
"public",
"IoFilterQueryIssueResult",
"queryIoFilterIssues",
"(",
"String",
"filterId",
",",
"ComputeResource",
"compRes",
")",
"throws",
"RemoteException",
",",
"RuntimeFault",
"{",
"return",
"getVimService",
"(",
")",
".",
"queryIoFilterIssues",
"(",
"getMOR",
"(",
... | Return the issues that occured during the last installation/uninstallation/upgrade operation of an IO Filter on a
compute resource
@param filterId
- ID of the filter.
@param compRes
- The compute resource. "compRes" must be a cluster.
@return IoFilterQueryIssueResult - Result for QueryIoFilterIssues. Filters that are... | [
"Return",
"the",
"issues",
"that",
"occured",
"during",
"the",
"last",
"installation",
"/",
"uninstallation",
"/",
"upgrade",
"operation",
"of",
"an",
"IO",
"Filter",
"on",
"a",
"compute",
"resource"
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/IoFilterManager.java#L124-L127 |
netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Snappy.java | Snappy.validateChecksum | static void validateChecksum(int expectedChecksum, ByteBuf data, int offset, int length) {
final int actualChecksum = calculateChecksum(data, offset, length);
if (actualChecksum != expectedChecksum) {
throw new DecompressionException(
"mismatching checksum: " + Integer.to... | java | static void validateChecksum(int expectedChecksum, ByteBuf data, int offset, int length) {
final int actualChecksum = calculateChecksum(data, offset, length);
if (actualChecksum != expectedChecksum) {
throw new DecompressionException(
"mismatching checksum: " + Integer.to... | [
"static",
"void",
"validateChecksum",
"(",
"int",
"expectedChecksum",
",",
"ByteBuf",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"final",
"int",
"actualChecksum",
"=",
"calculateChecksum",
"(",
"data",
",",
"offset",
",",
"length",
")",
";... | Computes the CRC32C checksum of the supplied data, performs the "mask" operation
on the computed checksum, and then compares the resulting masked checksum to the
supplied checksum.
@param expectedChecksum The checksum decoded from the stream to compare against
@param data The input data to calculate the CRC32C checksu... | [
"Computes",
"the",
"CRC32C",
"checksum",
"of",
"the",
"supplied",
"data",
"performs",
"the",
"mask",
"operation",
"on",
"the",
"computed",
"checksum",
"and",
"then",
"compares",
"the",
"resulting",
"masked",
"checksum",
"to",
"the",
"supplied",
"checksum",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L638-L645 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqllcase | public static void sqllcase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "lower(", "lcase", parsedArgs);
} | java | public static void sqllcase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "lower(", "lcase", parsedArgs);
} | [
"public",
"static",
"void",
"sqllcase",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"singleArgumentFunctionCall",
"(",
"buf",
",",
"\"lower(\"",
",",
"\"lcase\"",
",",
"par... | lcase to lower translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"lcase",
"to",
"lower",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L183-L185 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/buffer/Buffer.java | Buffer.assignToNew | void assignToNew(String fileName, PageFormatter fmtr) {
internalLock.writeLock().lock();
try {
flush();
fmtr.format(this);
blk = contents.append(fileName);
pins = 0;
isNew = true;
lastLsn = LogSeqNum.DEFAULT_VALUE;
} finally {
internalLock.writeLock().unlock();
}
} | java | void assignToNew(String fileName, PageFormatter fmtr) {
internalLock.writeLock().lock();
try {
flush();
fmtr.format(this);
blk = contents.append(fileName);
pins = 0;
isNew = true;
lastLsn = LogSeqNum.DEFAULT_VALUE;
} finally {
internalLock.writeLock().unlock();
}
} | [
"void",
"assignToNew",
"(",
"String",
"fileName",
",",
"PageFormatter",
"fmtr",
")",
"{",
"internalLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"flush",
"(",
")",
";",
"fmtr",
".",
"format",
"(",
"this",
")",
";",
"blk",... | Initializes the buffer's page according to the specified formatter, and
appends the page to the specified file. If the buffer was dirty, then the
contents of the previous page are first written to disk.
@param filename
the name of the file
@param fmtr
a page formatter, used to initialize the page | [
"Initializes",
"the",
"buffer",
"s",
"page",
"according",
"to",
"the",
"specified",
"formatter",
"and",
"appends",
"the",
"page",
"to",
"the",
"specified",
"file",
".",
"If",
"the",
"buffer",
"was",
"dirty",
"then",
"the",
"contents",
"of",
"the",
"previous"... | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/buffer/Buffer.java#L309-L321 |
fcrepo3/fcrepo | fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/utility/validate/remote/RemoteObjectSource.java | RemoteObjectSource.getContentModelInfo | @Override
public ContentModelInfo getContentModelInfo(String pid)
throws ObjectSourceException, InvalidContentModelException {
try {
ObjectInfo object = getValidationObject(pid);
if (object == null) {
return null;
}
DatastreamInfo ... | java | @Override
public ContentModelInfo getContentModelInfo(String pid)
throws ObjectSourceException, InvalidContentModelException {
try {
ObjectInfo object = getValidationObject(pid);
if (object == null) {
return null;
}
DatastreamInfo ... | [
"@",
"Override",
"public",
"ContentModelInfo",
"getContentModelInfo",
"(",
"String",
"pid",
")",
"throws",
"ObjectSourceException",
",",
"InvalidContentModelException",
"{",
"try",
"{",
"ObjectInfo",
"object",
"=",
"getValidationObject",
"(",
"pid",
")",
";",
"if",
... | A content model must exist as an object. If must have a (@link
DS_COMPOSITE_MODEL} datastream. | [
"A",
"content",
"model",
"must",
"exist",
"as",
"an",
"object",
".",
"If",
"must",
"have",
"a",
"("
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/utility/validate/remote/RemoteObjectSource.java#L108-L149 |
alkacon/opencms-core | src/org/opencms/db/CmsSelectQuery.java | CmsSelectQuery.setOrdering | public void setOrdering(String ordering) {
if (ordering != null) {
m_ordering = new CmsSimpleQueryFragment(ordering, Collections.<Object> emptyList());
} else {
m_ordering = null;
}
} | java | public void setOrdering(String ordering) {
if (ordering != null) {
m_ordering = new CmsSimpleQueryFragment(ordering, Collections.<Object> emptyList());
} else {
m_ordering = null;
}
} | [
"public",
"void",
"setOrdering",
"(",
"String",
"ordering",
")",
"{",
"if",
"(",
"ordering",
"!=",
"null",
")",
"{",
"m_ordering",
"=",
"new",
"CmsSimpleQueryFragment",
"(",
"ordering",
",",
"Collections",
".",
"<",
"Object",
">",
"emptyList",
"(",
")",
")... | Sets the SQL used for the ORDER BY clause.<p>
@param ordering the SQL used for the ORDER BY clause | [
"Sets",
"the",
"SQL",
"used",
"for",
"the",
"ORDER",
"BY",
"clause",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSelectQuery.java#L208-L215 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.onConnectionError | protected void onConnectionError(ChannelHandlerContext ctx, boolean outbound,
Throwable cause, Http2Exception http2Ex) {
if (http2Ex == null) {
http2Ex = new Http2Exception(INTERNAL_ERROR, cause.getMessage(), cause);
}
ChannelPromise promise = ct... | java | protected void onConnectionError(ChannelHandlerContext ctx, boolean outbound,
Throwable cause, Http2Exception http2Ex) {
if (http2Ex == null) {
http2Ex = new Http2Exception(INTERNAL_ERROR, cause.getMessage(), cause);
}
ChannelPromise promise = ct... | [
"protected",
"void",
"onConnectionError",
"(",
"ChannelHandlerContext",
"ctx",
",",
"boolean",
"outbound",
",",
"Throwable",
"cause",
",",
"Http2Exception",
"http2Ex",
")",
"{",
"if",
"(",
"http2Ex",
"==",
"null",
")",
"{",
"http2Ex",
"=",
"new",
"Http2Exception... | Handler for a connection error. Sends a GO_AWAY frame to the remote endpoint. Once all
streams are closed, the connection is shut down.
@param ctx the channel context
@param outbound {@code true} if the error was caused by an outbound operation.
@param cause the exception that was caught
@param http2Ex the {@link Http... | [
"Handler",
"for",
"a",
"connection",
"error",
".",
"Sends",
"a",
"GO_AWAY",
"frame",
"to",
"the",
"remote",
"endpoint",
".",
"Once",
"all",
"streams",
"are",
"closed",
"the",
"connection",
"is",
"shut",
"down",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L657-L670 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.getPointPositionAgainstLine | public static int getPointPositionAgainstLine( Coordinate point, Coordinate lineStart, Coordinate lineEnd ) {
double value = (lineEnd.x - lineStart.x) * (point.y - lineStart.y) - (point.x - lineStart.x) * (lineEnd.y - lineStart.y);
if (value > 0) {
return 1;
} else if (value < 0) {
... | java | public static int getPointPositionAgainstLine( Coordinate point, Coordinate lineStart, Coordinate lineEnd ) {
double value = (lineEnd.x - lineStart.x) * (point.y - lineStart.y) - (point.x - lineStart.x) * (lineEnd.y - lineStart.y);
if (value > 0) {
return 1;
} else if (value < 0) {
... | [
"public",
"static",
"int",
"getPointPositionAgainstLine",
"(",
"Coordinate",
"point",
",",
"Coordinate",
"lineStart",
",",
"Coordinate",
"lineEnd",
")",
"{",
"double",
"value",
"=",
"(",
"lineEnd",
".",
"x",
"-",
"lineStart",
".",
"x",
")",
"*",
"(",
"point"... | Get the position of a point (left, right, on line) for a given line.
@param point the point to check.
@param lineStart the start coordinate of the line.
@param lineEnd the end coordinate of the line.
@return 1 if the point is left of the line, -1 if it is right, 0 if it is on the line. | [
"Get",
"the",
"position",
"of",
"a",
"point",
"(",
"left",
"right",
"on",
"line",
")",
"for",
"a",
"given",
"line",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L944-L953 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java | OdsElements.flushTables | public void flushTables(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
this.contentElement.flushTables(util, writer);
} | java | public void flushTables(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
this.contentElement.flushTables(util, writer);
} | [
"public",
"void",
"flushTables",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"ZipUTF8Writer",
"writer",
")",
"throws",
"IOException",
"{",
"this",
".",
"contentElement",
".",
"flushTables",
"(",
"util",
",",
"writer",
")",
";",
"}"
] | Flush the tables
@param util the util
@param writer the stream to write
@throws IOException when write fails | [
"Flush",
"the",
"tables"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java#L280-L282 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/support/Characters.java | Characters.of | public static Characters of(String chars) {
return StringUtils.isEmpty(chars) ? Characters.NONE : new Characters(false, chars.toCharArray());
} | java | public static Characters of(String chars) {
return StringUtils.isEmpty(chars) ? Characters.NONE : new Characters(false, chars.toCharArray());
} | [
"public",
"static",
"Characters",
"of",
"(",
"String",
"chars",
")",
"{",
"return",
"StringUtils",
".",
"isEmpty",
"(",
"chars",
")",
"?",
"Characters",
".",
"NONE",
":",
"new",
"Characters",
"(",
"false",
",",
"chars",
".",
"toCharArray",
"(",
")",
")",... | Creates a new Characters instance containing only the given chars.
@param chars the chars
@return a new Characters object | [
"Creates",
"a",
"new",
"Characters",
"instance",
"containing",
"only",
"the",
"given",
"chars",
"."
] | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/support/Characters.java#L257-L259 |
litsec/swedish-eid-shibboleth-base | shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/service/impl/AuthnContextServiceImpl.java | AuthnContextServiceImpl.addAuthnContextClassContext | protected void addAuthnContextClassContext(ProfileRequestContext<?, ?> context, AuthnContextClassContext authnContextClassContext)
throws ExternalAutenticationErrorCodeException {
AuthenticationContext authnContext = authenticationContextLookupStrategy.apply(context);
if (authnContext == null) {
log... | java | protected void addAuthnContextClassContext(ProfileRequestContext<?, ?> context, AuthnContextClassContext authnContextClassContext)
throws ExternalAutenticationErrorCodeException {
AuthenticationContext authnContext = authenticationContextLookupStrategy.apply(context);
if (authnContext == null) {
log... | [
"protected",
"void",
"addAuthnContextClassContext",
"(",
"ProfileRequestContext",
"<",
"?",
",",
"?",
">",
"context",
",",
"AuthnContextClassContext",
"authnContextClassContext",
")",
"throws",
"ExternalAutenticationErrorCodeException",
"{",
"AuthenticationContext",
"authnConte... | Adds the supplied {@code AuthnContextClassContext} to the request context
@param context
the request context
@param authnContextClassContext
the context to add
@throws ExternalAutenticationErrorCodeException
if no context exists | [
"Adds",
"the",
"supplied",
"{",
"@code",
"AuthnContextClassContext",
"}",
"to",
"the",
"request",
"context"
] | train | https://github.com/litsec/swedish-eid-shibboleth-base/blob/aaaa467ff61f07d7dfa31627fb36851a37da6804/shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/service/impl/AuthnContextServiceImpl.java#L136-L144 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java | SegmentKeyCache.get | CacheBucketOffset get(UUID keyHash, int generation) {
CacheEntry entry;
synchronized (this) {
// First, check the tail cache.
CacheBucketOffset tailOffset = this.tailOffsets.get(keyHash);
if (tailOffset != null) {
return tailOffset;
}
... | java | CacheBucketOffset get(UUID keyHash, int generation) {
CacheEntry entry;
synchronized (this) {
// First, check the tail cache.
CacheBucketOffset tailOffset = this.tailOffsets.get(keyHash);
if (tailOffset != null) {
return tailOffset;
}
... | [
"CacheBucketOffset",
"get",
"(",
"UUID",
"keyHash",
",",
"int",
"generation",
")",
"{",
"CacheEntry",
"entry",
";",
"synchronized",
"(",
"this",
")",
"{",
"// First, check the tail cache.",
"CacheBucketOffset",
"tailOffset",
"=",
"this",
".",
"tailOffsets",
".",
"... | Looks up a cached offset for the given Key Hash.
@param keyHash A UUID representing the Key Hash to look up.
@return A {@link CacheBucketOffset} representing the sought result. | [
"Looks",
"up",
"a",
"cached",
"offset",
"for",
"the",
"given",
"Key",
"Hash",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java#L211-L232 |
beanshell/beanshell | src/main/java/bsh/BshArray.java | BshArray.setIndex | @SuppressWarnings("unchecked")
public static void setIndex(Object array, int index, Object val)
throws ReflectError, UtilTargetError {
try {
val = Primitive.unwrap(val);
if ( array instanceof List )
((List<Object>) array).set(index, val);
else
... | java | @SuppressWarnings("unchecked")
public static void setIndex(Object array, int index, Object val)
throws ReflectError, UtilTargetError {
try {
val = Primitive.unwrap(val);
if ( array instanceof List )
((List<Object>) array).set(index, val);
else
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"setIndex",
"(",
"Object",
"array",
",",
"int",
"index",
",",
"Object",
"val",
")",
"throws",
"ReflectError",
",",
"UtilTargetError",
"{",
"try",
"{",
"val",
"=",
"Primitive",
".... | Set element value of array or list at index.
Array.set for array or List.set for list.
@param array to set value for.
@param index of the element to set
@param val the value to set
@throws UtilTargetError wrapped target exceptions | [
"Set",
"element",
"value",
"of",
"array",
"or",
"list",
"at",
"index",
".",
"Array",
".",
"set",
"for",
"array",
"or",
"List",
".",
"set",
"for",
"list",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BshArray.java#L58-L79 |
jamesagnew/hapi-fhir | hapi-fhir-validation/src/main/java/org/hl7/fhir/instance/validation/InstanceValidator.java | InstanceValidator.start | private void start(List<ValidationMessage> errors, WrapperElement resource, WrapperElement element, StructureDefinition profile, NodeStack stack) throws FHIRException {
// profile is valid, and matches the resource name
if (rule(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(),... | java | private void start(List<ValidationMessage> errors, WrapperElement resource, WrapperElement element, StructureDefinition profile, NodeStack stack) throws FHIRException {
// profile is valid, and matches the resource name
if (rule(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(),... | [
"private",
"void",
"start",
"(",
"List",
"<",
"ValidationMessage",
">",
"errors",
",",
"WrapperElement",
"resource",
",",
"WrapperElement",
"element",
",",
"StructureDefinition",
"profile",
",",
"NodeStack",
"stack",
")",
"throws",
"FHIRException",
"{",
"// profile ... | the instance validator had no issues against the base resource profile | [
"the",
"instance",
"validator",
"had",
"no",
"issues",
"against",
"the",
"base",
"resource",
"profile"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-validation/src/main/java/org/hl7/fhir/instance/validation/InstanceValidator.java#L1251-L1265 |
jenkinsci/jenkins | core/src/main/java/hudson/security/ACL.java | ACL.hasPermission | public final boolean hasPermission(@Nonnull Permission p) {
Authentication a = Jenkins.getAuthentication();
if (a == SYSTEM) {
return true;
}
return hasPermission(a, p);
} | java | public final boolean hasPermission(@Nonnull Permission p) {
Authentication a = Jenkins.getAuthentication();
if (a == SYSTEM) {
return true;
}
return hasPermission(a, p);
} | [
"public",
"final",
"boolean",
"hasPermission",
"(",
"@",
"Nonnull",
"Permission",
"p",
")",
"{",
"Authentication",
"a",
"=",
"Jenkins",
".",
"getAuthentication",
"(",
")",
";",
"if",
"(",
"a",
"==",
"SYSTEM",
")",
"{",
"return",
"true",
";",
"}",
"return... | Checks if the current security principal has this permission.
@return false
if the user doesn't have the permission. | [
"Checks",
"if",
"the",
"current",
"security",
"principal",
"has",
"this",
"permission",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/ACL.java#L82-L88 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java | CommsUtils.getRuntimeDoubleProperty | public static double getRuntimeDoubleProperty(String property, String defaultValue)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getRuntimeDoubleProperty", new Object[] {property, defaultValue});
// Note that we parse the default value outside of the try / ca... | java | public static double getRuntimeDoubleProperty(String property, String defaultValue)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getRuntimeDoubleProperty", new Object[] {property, defaultValue});
// Note that we parse the default value outside of the try / ca... | [
"public",
"static",
"double",
"getRuntimeDoubleProperty",
"(",
"String",
"property",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"en... | This method will get a runtime property from the sib.properties file and will convert the
value (if set) to an double. If the property in the file was set to something that was not
parseable as an double, then the default value will be returned.
@param property The property key used to look up in the file.
@param defa... | [
"This",
"method",
"will",
"get",
"a",
"runtime",
"property",
"from",
"the",
"sib",
".",
"properties",
"file",
"and",
"will",
"convert",
"the",
"value",
"(",
"if",
"set",
")",
"to",
"an",
"double",
".",
"If",
"the",
"property",
"in",
"the",
"file",
"was... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java#L131-L154 |
alkacon/opencms-core | src-modules/org/opencms/workplace/list/A_CmsListAction.java | A_CmsListAction.defaultConfirmationHtml | public static String defaultConfirmationHtml(String confId, String confText) {
StringBuffer html = new StringBuffer(1024);
html.append("<div class='hide' id='conf");
html.append(confId);
html.append("'>");
html.append(CmsStringUtil.isEmptyOrWhitespaceOnly(confText) ? "null" : co... | java | public static String defaultConfirmationHtml(String confId, String confText) {
StringBuffer html = new StringBuffer(1024);
html.append("<div class='hide' id='conf");
html.append(confId);
html.append("'>");
html.append(CmsStringUtil.isEmptyOrWhitespaceOnly(confText) ? "null" : co... | [
"public",
"static",
"String",
"defaultConfirmationHtml",
"(",
"String",
"confId",
",",
"String",
"confText",
")",
"{",
"StringBuffer",
"html",
"=",
"new",
"StringBuffer",
"(",
"1024",
")",
";",
"html",
".",
"append",
"(",
"\"<div class='hide' id='conf\"",
")",
"... | Generates html for the confirmation message when having one confirmation message
for several actions.<p>
@param confId the id of the confirmation message
@param confText the confirmation message
@return html code | [
"Generates",
"html",
"for",
"the",
"confirmation",
"message",
"when",
"having",
"one",
"confirmation",
"message",
"for",
"several",
"actions",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/A_CmsListAction.java#L74-L83 |
code4everything/util | src/main/java/com/zhazhapan/util/ThreadPool.java | ThreadPool.init | public static void init(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit timeUnit) {
ThreadPool.corePoolSize = corePoolSize;
ThreadPool.maximumPoolSize = maximumPoolSize;
ThreadPool.keepAliveTime = keepAliveTime;
ThreadPool.timeUnit = timeUnit;
init();
} | java | public static void init(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit timeUnit) {
ThreadPool.corePoolSize = corePoolSize;
ThreadPool.maximumPoolSize = maximumPoolSize;
ThreadPool.keepAliveTime = keepAliveTime;
ThreadPool.timeUnit = timeUnit;
init();
} | [
"public",
"static",
"void",
"init",
"(",
"int",
"corePoolSize",
",",
"int",
"maximumPoolSize",
",",
"long",
"keepAliveTime",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"ThreadPool",
".",
"corePoolSize",
"=",
"corePoolSize",
";",
"ThreadPool",
".",
"maximumPoolSize",
... | 初始化线程池
@param corePoolSize 初始Size
@param maximumPoolSize 最大Size
@param keepAliveTime 存活时长
@param timeUnit 时间单位 | [
"初始化线程池"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/ThreadPool.java#L62-L68 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/crf/CRFFeatureExporter.java | CRFFeatureExporter.printFeatures | public void printFeatures(String exportFile, int[][][][] docsData, int[][] labels) {
try {
PrintWriter pw = IOUtils.getPrintWriter(exportFile);
for (int i = 0; i < docsData.length; i++) {
for (int j = 0; j < docsData[i].length; j++) {
StringBuilder sb = new StringBuilder();
... | java | public void printFeatures(String exportFile, int[][][][] docsData, int[][] labels) {
try {
PrintWriter pw = IOUtils.getPrintWriter(exportFile);
for (int i = 0; i < docsData.length; i++) {
for (int j = 0; j < docsData[i].length; j++) {
StringBuilder sb = new StringBuilder();
... | [
"public",
"void",
"printFeatures",
"(",
"String",
"exportFile",
",",
"int",
"[",
"]",
"[",
"]",
"[",
"]",
"[",
"]",
"docsData",
",",
"int",
"[",
"]",
"[",
"]",
"labels",
")",
"{",
"try",
"{",
"PrintWriter",
"pw",
"=",
"IOUtils",
".",
"getPrintWriter"... | Output features that have already been converted into features
(using documentToDataAndLabels) in format suitable for CRFSuite
Format is with one line per token using the following format
label feat1 feat2 ...
(where each space is actually a tab)
Each document is separated by an empty line
@param exportFile file to exp... | [
"Output",
"features",
"that",
"have",
"already",
"been",
"converted",
"into",
"features",
"(",
"using",
"documentToDataAndLabels",
")",
"in",
"format",
"suitable",
"for",
"CRFSuite",
"Format",
"is",
"with",
"one",
"line",
"per",
"token",
"using",
"the",
"followi... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/crf/CRFFeatureExporter.java#L107-L131 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java | ExampleImageStitching.stitch | public static <T extends ImageGray<T>>
void stitch( BufferedImage imageA , BufferedImage imageB , Class<T> imageType )
{
T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType);
T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType);
// Detect using the standard SURF feat... | java | public static <T extends ImageGray<T>>
void stitch( BufferedImage imageA , BufferedImage imageB , Class<T> imageType )
{
T inputA = ConvertBufferedImage.convertFromSingle(imageA, null, imageType);
T inputB = ConvertBufferedImage.convertFromSingle(imageB, null, imageType);
// Detect using the standard SURF feat... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"stitch",
"(",
"BufferedImage",
"imageA",
",",
"BufferedImage",
"imageB",
",",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"T",
"inputA",
"=",
"ConvertBufferedImage",
".",... | Given two input images create and display an image where the two have been overlayed on top of each other. | [
"Given",
"two",
"input",
"images",
"create",
"and",
"display",
"an",
"image",
"where",
"the",
"two",
"have",
"been",
"overlayed",
"on",
"top",
"of",
"each",
"other",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/geometry/ExampleImageStitching.java#L144-L163 |
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java | VariableInterpreter.getVariable | public static Object getVariable(PageContext pc, Collection collection, String var) throws PageException {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) throw new InterpreterException("invalid variable declaration [" + var + "]");
while (list.hasNextNext()) {
collection = Caster.... | java | public static Object getVariable(PageContext pc, Collection collection, String var) throws PageException {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) throw new InterpreterException("invalid variable declaration [" + var + "]");
while (list.hasNextNext()) {
collection = Caster.... | [
"public",
"static",
"Object",
"getVariable",
"(",
"PageContext",
"pc",
",",
"Collection",
"collection",
",",
"String",
"var",
")",
"throws",
"PageException",
"{",
"StringList",
"list",
"=",
"parse",
"(",
"pc",
",",
"new",
"ParserString",
"(",
"var",
")",
","... | reads a subelement from a struct
@param pc
@param collection
@param var
@return matching Object
@throws PageException | [
"reads",
"a",
"subelement",
"from",
"a",
"struct"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java#L58-L66 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ListUtil.java | ListUtil.listFind | public static int listFind(String list, String value, String delimiter) {
Array arr = listToArrayTrim(list, delimiter);
int len = arr.size();
for (int i = 1; i <= len; i++) {
if (arr.get(i, "").equals(value)) return i - 1;
}
return -1;
} | java | public static int listFind(String list, String value, String delimiter) {
Array arr = listToArrayTrim(list, delimiter);
int len = arr.size();
for (int i = 1; i <= len; i++) {
if (arr.get(i, "").equals(value)) return i - 1;
}
return -1;
} | [
"public",
"static",
"int",
"listFind",
"(",
"String",
"list",
",",
"String",
"value",
",",
"String",
"delimiter",
")",
"{",
"Array",
"arr",
"=",
"listToArrayTrim",
"(",
"list",
",",
"delimiter",
")",
";",
"int",
"len",
"=",
"arr",
".",
"size",
"(",
")"... | finds a value inside a list, do not case sensitive
@param list list to search
@param value value to find
@param delimiter delimiter of the list
@return position in list or 0 | [
"finds",
"a",
"value",
"inside",
"a",
"list",
"do",
"not",
"case",
"sensitive"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L729-L737 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLIdentical | public static void assertXMLIdentical(String msg, Diff diff, boolean assertion) {
if (assertion != diff.identical()) {
fail(getFailMessage(msg, diff));
}
} | java | public static void assertXMLIdentical(String msg, Diff diff, boolean assertion) {
if (assertion != diff.identical()) {
fail(getFailMessage(msg, diff));
}
} | [
"public",
"static",
"void",
"assertXMLIdentical",
"(",
"String",
"msg",
",",
"Diff",
"diff",
",",
"boolean",
"assertion",
")",
"{",
"if",
"(",
"assertion",
"!=",
"diff",
".",
"identical",
"(",
")",
")",
"{",
"fail",
"(",
"getFailMessage",
"(",
"msg",
","... | Assert that the result of an XML comparison is or is not identical
@param msg Message to display if assertion fails
@param diff the result of an XML comparison
@param assertion true if asserting that result is identical | [
"Assert",
"that",
"the",
"result",
"of",
"an",
"XML",
"comparison",
"is",
"or",
"is",
"not",
"identical"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L156-L160 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/KubernetesResourceUtil.java | KubernetesResourceUtil.isValidLabelOrAnnotation | public static boolean isValidLabelOrAnnotation(Map<String, String> map) {
for(Map.Entry<String, String> entry : map.entrySet()) {
if(!(isValidName(entry.getKey()) && isValidName(entry.getValue()))) {
return false;
}
}
return true;
} | java | public static boolean isValidLabelOrAnnotation(Map<String, String> map) {
for(Map.Entry<String, String> entry : map.entrySet()) {
if(!(isValidName(entry.getKey()) && isValidName(entry.getValue()))) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isValidLabelOrAnnotation",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"map",
".",
"entrySet",
"(",
")",
")",
"{",
"... | Validates labels/annotations of Kubernetes resources
@param map Label/Annotation of resource
@return returns a boolean value inidicating whether it's valid or not | [
"Validates",
"labels",
"/",
"annotations",
"of",
"Kubernetes",
"resources"
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/KubernetesResourceUtil.java#L270-L277 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.importCertificateAsync | public Observable<CertificateBundle> importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
return importCertificateWithServiceResponseAsyn... | java | public Observable<CertificateBundle> importCertificateAsync(String vaultBaseUrl, String certificateName, String base64EncodedCertificate, String password, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
return importCertificateWithServiceResponseAsyn... | [
"public",
"Observable",
"<",
"CertificateBundle",
">",
"importCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"String",
"base64EncodedCertificate",
",",
"String",
"password",
",",
"CertificatePolicy",
"certificatePolicy",
",",
"Cer... | Imports a certificate into a specified key vault.
Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation r... | [
"Imports",
"a",
"certificate",
"into",
"a",
"specified",
"key",
"vault",
".",
"Imports",
"an",
"existing",
"valid",
"certificate",
"containing",
"a",
"private",
"key",
"into",
"Azure",
"Key",
"Vault",
".",
"The",
"certificate",
"to",
"be",
"imported",
"can",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6823-L6830 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolver.java | RepositoryResolver.reportErrors | private void reportErrors() throws RepositoryResolutionException {
if (resourcesWrongProduct.isEmpty() && missingTopLevelRequirements.isEmpty() && missingRequirements.isEmpty()) {
// Everything went fine!
return;
}
Set<ProductRequirementInformation> missingProductInforma... | java | private void reportErrors() throws RepositoryResolutionException {
if (resourcesWrongProduct.isEmpty() && missingTopLevelRequirements.isEmpty() && missingRequirements.isEmpty()) {
// Everything went fine!
return;
}
Set<ProductRequirementInformation> missingProductInforma... | [
"private",
"void",
"reportErrors",
"(",
")",
"throws",
"RepositoryResolutionException",
"{",
"if",
"(",
"resourcesWrongProduct",
".",
"isEmpty",
"(",
")",
"&&",
"missingTopLevelRequirements",
".",
"isEmpty",
"(",
")",
"&&",
"missingRequirements",
".",
"isEmpty",
"("... | If any errors occurred during resolution, throw a {@link RepositoryResolutionException} | [
"If",
"any",
"errors",
"occurred",
"during",
"resolution",
"throw",
"a",
"{"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolver.java#L774-L793 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.removeEntry | public static void removeEntry(final File zip, final String path) {
operateInPlace(zip, new InPlaceAction() {
public boolean act(File tmpFile) {
removeEntry(zip, path, tmpFile);
return true;
}
});
} | java | public static void removeEntry(final File zip, final String path) {
operateInPlace(zip, new InPlaceAction() {
public boolean act(File tmpFile) {
removeEntry(zip, path, tmpFile);
return true;
}
});
} | [
"public",
"static",
"void",
"removeEntry",
"(",
"final",
"File",
"zip",
",",
"final",
"String",
"path",
")",
"{",
"operateInPlace",
"(",
"zip",
",",
"new",
"InPlaceAction",
"(",
")",
"{",
"public",
"boolean",
"act",
"(",
"File",
"tmpFile",
")",
"{",
"rem... | Changes an existing ZIP file: removes entry with a given path.
@param zip
an existing ZIP file
@param path
path of the entry to remove
@since 1.7 | [
"Changes",
"an",
"existing",
"ZIP",
"file",
":",
"removes",
"entry",
"with",
"a",
"given",
"path",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2283-L2290 |
h2oai/h2o-3 | h2o-core/src/main/java/water/Value.java | Value.read_lock | boolean read_lock() {
while( true ) { // Repeat, in case racing GETs are bumping the counter
int old = _rwlock.get();
if( old == -1 ) return false; // Write-locked; no new replications. Read fails to read *this* value
assert old >= 0; // Not negative
if( RW_CAS(old,old+1,"r... | java | boolean read_lock() {
while( true ) { // Repeat, in case racing GETs are bumping the counter
int old = _rwlock.get();
if( old == -1 ) return false; // Write-locked; no new replications. Read fails to read *this* value
assert old >= 0; // Not negative
if( RW_CAS(old,old+1,"r... | [
"boolean",
"read_lock",
"(",
")",
"{",
"while",
"(",
"true",
")",
"{",
"// Repeat, in case racing GETs are bumping the counter",
"int",
"old",
"=",
"_rwlock",
".",
"get",
"(",
")",
";",
"if",
"(",
"old",
"==",
"-",
"1",
")",
"return",
"false",
";",
"// Wri... | Bump the read lock, once per pending-GET or pending-Invalidate | [
"Bump",
"the",
"read",
"lock",
"once",
"per",
"pending",
"-",
"GET",
"or",
"pending",
"-",
"Invalidate"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Value.java#L468-L475 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.putSource | public static void putSource(Bundle bundle, AccessTokenSource value) {
Validate.notNull(bundle, "bundle");
bundle.putSerializable(TOKEN_SOURCE_KEY, value);
} | java | public static void putSource(Bundle bundle, AccessTokenSource value) {
Validate.notNull(bundle, "bundle");
bundle.putSerializable(TOKEN_SOURCE_KEY, value);
} | [
"public",
"static",
"void",
"putSource",
"(",
"Bundle",
"bundle",
",",
"AccessTokenSource",
"value",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"bundle",
".",
"putSerializable",
"(",
"TOKEN_SOURCE_KEY",
",",
"value",
")",... | Puts the enum indicating the source of the token into a Bundle.
@param bundle
A Bundle in which the enum should be stored.
@param value
enum indicating the source of the token
@throws NullPointerException if the passed in Bundle is null | [
"Puts",
"the",
"enum",
"indicating",
"the",
"source",
"of",
"the",
"token",
"into",
"a",
"Bundle",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L328-L331 |
jboss/jboss-el-api_spec | src/main/java/javax/el/BeanNameELResolver.java | BeanNameELResolver.isReadOnly | @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base == null && property instanceof String) {
if (beanNameResolver.isNameResolved((String) property)) {
... | java | @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base == null && property instanceof String) {
if (beanNameResolver.isNameResolved((String) property)) {
... | [
"@",
"Override",
"public",
"boolean",
"isReadOnly",
"(",
"ELContext",
"context",
",",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"if",
"... | If the base is null and the property is a name resolvable by
the BeanNameResolver, attempts to determine if the bean is writable.
<p>If the name is resolvable by the BeanNameResolver,
the <code>propertyResolved</code> property of the
<code>ELContext</code> object must be set to <code>true</code>
by the resolver, befor... | [
"If",
"the",
"base",
"is",
"null",
"and",
"the",
"property",
"is",
"a",
"name",
"resolvable",
"by",
"the",
"BeanNameResolver",
"attempts",
"to",
"determine",
"if",
"the",
"bean",
"is",
"writable",
"."
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/BeanNameELResolver.java#L219-L232 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java | MetricsRecordImpl.setTag | public void setTag(String tagName, long tagValue) {
tagTable.put(tagName, Long.valueOf(tagValue));
} | java | public void setTag(String tagName, long tagValue) {
tagTable.put(tagName, Long.valueOf(tagValue));
} | [
"public",
"void",
"setTag",
"(",
"String",
"tagName",
",",
"long",
"tagValue",
")",
"{",
"tagTable",
".",
"put",
"(",
"tagName",
",",
"Long",
".",
"valueOf",
"(",
"tagValue",
")",
")",
";",
"}"
] | Sets the named tag to the specified value.
@param tagName name of the tag
@param tagValue new value of the tag
@throws MetricsException if the tagName conflicts with the configuration | [
"Sets",
"the",
"named",
"tag",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java#L90-L92 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.requestLookupHlr | public LookupHlr requestLookupHlr(final BigInteger phoneNumber, final String reference) throws UnauthorizedException, GeneralException {
if (phoneNumber == null) {
throw new IllegalArgumentException("Phonenumber must be specified.");
}
if (reference == null) {
throw new I... | java | public LookupHlr requestLookupHlr(final BigInteger phoneNumber, final String reference) throws UnauthorizedException, GeneralException {
if (phoneNumber == null) {
throw new IllegalArgumentException("Phonenumber must be specified.");
}
if (reference == null) {
throw new I... | [
"public",
"LookupHlr",
"requestLookupHlr",
"(",
"final",
"BigInteger",
"phoneNumber",
",",
"final",
"String",
"reference",
")",
"throws",
"UnauthorizedException",
",",
"GeneralException",
"{",
"if",
"(",
"phoneNumber",
"==",
"null",
")",
"{",
"throw",
"new",
"Ille... | Request a Lookup HLR (lookup)
@param phoneNumber phone number is for request hlr
@param reference reference for request hlr
@return lookupHlr
@throws UnauthorizedException if client is unauthorized
@throws GeneralException general exception | [
"Request",
"a",
"Lookup",
"HLR",
"(",
"lookup",
")"
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L486-L497 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/Jenkins.java | Jenkins.doCheckDisplayName | public FormValidation doCheckDisplayName(@QueryParameter String displayName,
@QueryParameter String jobName) {
displayName = displayName.trim();
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Current job name is " + jobName);
}
if(!isNameUnique(disp... | java | public FormValidation doCheckDisplayName(@QueryParameter String displayName,
@QueryParameter String jobName) {
displayName = displayName.trim();
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Current job name is " + jobName);
}
if(!isNameUnique(disp... | [
"public",
"FormValidation",
"doCheckDisplayName",
"(",
"@",
"QueryParameter",
"String",
"displayName",
",",
"@",
"QueryParameter",
"String",
"jobName",
")",
"{",
"displayName",
"=",
"displayName",
".",
"trim",
"(",
")",
";",
"if",
"(",
"LOGGER",
".",
"isLoggable... | Checks to see if the candidate displayName collides with any
existing display names or project names
@param displayName The display name to test
@param jobName The name of the job the user is configuring | [
"Checks",
"to",
"see",
"if",
"the",
"candidate",
"displayName",
"collides",
"with",
"any",
"existing",
"display",
"names",
"or",
"project",
"names"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4825-L4842 |
TestFX/Monocle | src/main/java/com/sun/glass/ui/monocle/IntSet.java | IntSet.difference | void difference(IntSet dest, IntSet compared) {
int i = 0;
int j = 0;
while (i < size && j < compared.size) {
int a = elements[i];
int b = compared.elements[j];
if (a < b) {
// our set has a value that is not in "compared"
dest.... | java | void difference(IntSet dest, IntSet compared) {
int i = 0;
int j = 0;
while (i < size && j < compared.size) {
int a = elements[i];
int b = compared.elements[j];
if (a < b) {
// our set has a value that is not in "compared"
dest.... | [
"void",
"difference",
"(",
"IntSet",
"dest",
",",
"IntSet",
"compared",
")",
"{",
"int",
"i",
"=",
"0",
";",
"int",
"j",
"=",
"0",
";",
"while",
"(",
"i",
"<",
"size",
"&&",
"j",
"<",
"compared",
".",
"size",
")",
"{",
"int",
"a",
"=",
"element... | Adds to the set "dest" values that in this set but are not in the set
"compared". | [
"Adds",
"to",
"the",
"set",
"dest",
"values",
"that",
"in",
"this",
"set",
"but",
"are",
"not",
"in",
"the",
"set",
"compared",
"."
] | train | https://github.com/TestFX/Monocle/blob/267ccba8889cab244bf8c562dbaa0345a612874c/src/main/java/com/sun/glass/ui/monocle/IntSet.java#L86-L110 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/JarPluginProviderLoader.java | JarPluginProviderLoader.extractDependentLibs | protected Collection<File> extractDependentLibs(final File cachedir) throws IOException {
final Attributes attributes = getMainAttributes();
if (null == attributes) {
debug("no manifest attributes");
return null;
}
final ArrayList<File> files = new ArrayList<File... | java | protected Collection<File> extractDependentLibs(final File cachedir) throws IOException {
final Attributes attributes = getMainAttributes();
if (null == attributes) {
debug("no manifest attributes");
return null;
}
final ArrayList<File> files = new ArrayList<File... | [
"protected",
"Collection",
"<",
"File",
">",
"extractDependentLibs",
"(",
"final",
"File",
"cachedir",
")",
"throws",
"IOException",
"{",
"final",
"Attributes",
"attributes",
"=",
"getMainAttributes",
"(",
")",
";",
"if",
"(",
"null",
"==",
"attributes",
")",
... | Extract the dependent libs and return the extracted jar files
@return the collection of extracted files | [
"Extract",
"the",
"dependent",
"libs",
"and",
"return",
"the",
"extracted",
"jar",
"files"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/JarPluginProviderLoader.java#L492-L519 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/MediaIntents.java | MediaIntents.newPlayMediaIntent | public static Intent newPlayMediaIntent(String url, String type) {
return newPlayMediaIntent(Uri.parse(url), type);
} | java | public static Intent newPlayMediaIntent(String url, String type) {
return newPlayMediaIntent(Uri.parse(url), type);
} | [
"public",
"static",
"Intent",
"newPlayMediaIntent",
"(",
"String",
"url",
",",
"String",
"type",
")",
"{",
"return",
"newPlayMediaIntent",
"(",
"Uri",
".",
"parse",
"(",
"url",
")",
",",
"type",
")",
";",
"}"
] | Open the media player to play the given media
@param url The URL of the media to play.
@param type The mime type
@return the intent | [
"Open",
"the",
"media",
"player",
"to",
"play",
"the",
"given",
"media"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/MediaIntents.java#L149-L151 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/SliderThumbPainter.java | SliderThumbPainter.paintDiscrete | private void paintDiscrete(Graphics2D g, JComponent c, int width, int height) {
boolean useToolBarColors = isInToolBar(c);
Shape s;
if (isFocused) {
s = shapeGenerator.createSliderThumbDiscrete(0, 0, width, height, CornerSize.SLIDER_OUTER_FOCUS);
g.setPaint(get... | java | private void paintDiscrete(Graphics2D g, JComponent c, int width, int height) {
boolean useToolBarColors = isInToolBar(c);
Shape s;
if (isFocused) {
s = shapeGenerator.createSliderThumbDiscrete(0, 0, width, height, CornerSize.SLIDER_OUTER_FOCUS);
g.setPaint(get... | [
"private",
"void",
"paintDiscrete",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"boolean",
"useToolBarColors",
"=",
"isInToolBar",
"(",
"c",
")",
";",
"Shape",
"s",
";",
"if",
"(",
"isFocused",
")"... | DOCUMENT ME!
@param g DOCUMENT ME!
@param c DOCUMENT ME!
@param width DOCUMENT ME!
@param height DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/SliderThumbPainter.java#L164-L189 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Filtering.java | Filtering.takeLast | public static <E> Iterator<E> takeLast(int howMany, Iterable<E> from) {
dbc.precondition(from != null, "cannot call last with a null iterable");
return takeLast(howMany, from.iterator());
} | java | public static <E> Iterator<E> takeLast(int howMany, Iterable<E> from) {
dbc.precondition(from != null, "cannot call last with a null iterable");
return takeLast(howMany, from.iterator());
} | [
"public",
"static",
"<",
"E",
">",
"Iterator",
"<",
"E",
">",
"takeLast",
"(",
"int",
"howMany",
",",
"Iterable",
"<",
"E",
">",
"from",
")",
"{",
"dbc",
".",
"precondition",
"(",
"from",
"!=",
"null",
",",
"\"cannot call last with a null iterable\"",
")",... | Creates an iterator yielding last n elements from the source iterable.
Consuming the resulting iterator yields an IllegalArgumentException if
not enough elements can be fetched. E.g:
<code>takeLast(2, [1, 2, 3]) -> [2, 3]</code>
@param <E> the iterable element type
@param howMany number of elements to be yielded
@para... | [
"Creates",
"an",
"iterator",
"yielding",
"last",
"n",
"elements",
"from",
"the",
"source",
"iterable",
".",
"Consuming",
"the",
"resulting",
"iterator",
"yields",
"an",
"IllegalArgumentException",
"if",
"not",
"enough",
"elements",
"can",
"be",
"fetched",
".",
"... | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Filtering.java#L82-L85 |
marklogic/marklogic-contentpump | mlcp/src/main/java/com/marklogic/contentpump/LocalJobRunner.java | LocalJobRunner.assignThreads | private int assignThreads(int splitIndex, int splitCount) {
if (threadsPerSplit > 0) {
return threadsPerSplit;
}
if (splitCount == 1) {
return threadCount;
}
if (splitCount * minThreads > threadCount) {
return minThreads;
}
if (splitIndex %... | java | private int assignThreads(int splitIndex, int splitCount) {
if (threadsPerSplit > 0) {
return threadsPerSplit;
}
if (splitCount == 1) {
return threadCount;
}
if (splitCount * minThreads > threadCount) {
return minThreads;
}
if (splitIndex %... | [
"private",
"int",
"assignThreads",
"(",
"int",
"splitIndex",
",",
"int",
"splitCount",
")",
"{",
"if",
"(",
"threadsPerSplit",
">",
"0",
")",
"{",
"return",
"threadsPerSplit",
";",
"}",
"if",
"(",
"splitCount",
"==",
"1",
")",
"{",
"return",
"threadCount",... | Assign thread count for a given split
@param splitIndex split index
@param splitCount
@return | [
"Assign",
"thread",
"count",
"for",
"a",
"given",
"split"
] | train | https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mlcp/src/main/java/com/marklogic/contentpump/LocalJobRunner.java#L306-L321 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.saveRewriteAliases | public void saveRewriteAliases(CmsDbContext dbc, String siteRoot, List<CmsRewriteAlias> newAliases)
throws CmsException {
CmsRewriteAliasFilter filter = new CmsRewriteAliasFilter().setSiteRoot(siteRoot);
getVfsDriver(dbc).deleteRewriteAliases(dbc, filter);
getVfsDriver(dbc).insertRewriteAli... | java | public void saveRewriteAliases(CmsDbContext dbc, String siteRoot, List<CmsRewriteAlias> newAliases)
throws CmsException {
CmsRewriteAliasFilter filter = new CmsRewriteAliasFilter().setSiteRoot(siteRoot);
getVfsDriver(dbc).deleteRewriteAliases(dbc, filter);
getVfsDriver(dbc).insertRewriteAli... | [
"public",
"void",
"saveRewriteAliases",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"siteRoot",
",",
"List",
"<",
"CmsRewriteAlias",
">",
"newAliases",
")",
"throws",
"CmsException",
"{",
"CmsRewriteAliasFilter",
"filter",
"=",
"new",
"CmsRewriteAliasFilter",
"(",
")... | Replaces the complete list of rewrite aliases for a given site root.<p>
@param dbc the current database context
@param siteRoot the site root for which the rewrite aliases should be replaced
@param newAliases the new aliases for the given site root
@throws CmsException if something goes wrong | [
"Replaces",
"the",
"complete",
"list",
"of",
"rewrite",
"aliases",
"for",
"a",
"given",
"site",
"root",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L8793-L8799 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java | ExpressRouteCircuitsInner.getPeeringStatsAsync | public Observable<ExpressRouteCircuitStatsInner> getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) {
return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1<ServiceResponse<ExpressRouteCircuitStatsInner>, ExpressRouteCircuitS... | java | public Observable<ExpressRouteCircuitStatsInner> getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) {
return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1<ServiceResponse<ExpressRouteCircuitStatsInner>, ExpressRouteCircuitS... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitStatsInner",
">",
"getPeeringStatsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"peeringName",
")",
"{",
"return",
"getPeeringStatsWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets all stats from an express route circuit in a resource group.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param peeringName The name of the peering.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observab... | [
"Gets",
"all",
"stats",
"from",
"an",
"express",
"route",
"circuit",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java#L1528-L1535 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getSharedFlow | public static SharedFlowController getSharedFlow( String sharedFlowClassName, HttpServletRequest request,
ServletContext servletContext )
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedReques... | java | public static SharedFlowController getSharedFlow( String sharedFlowClassName, HttpServletRequest request,
ServletContext servletContext )
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedReques... | [
"public",
"static",
"SharedFlowController",
"getSharedFlow",
"(",
"String",
"sharedFlowClassName",
",",
"HttpServletRequest",
"request",
",",
"ServletContext",
"servletContext",
")",
"{",
"StorageHandler",
"sh",
"=",
"Handlers",
".",
"get",
"(",
"servletContext",
")",
... | Get the shared flow with the given class name.
@param sharedFlowClassName the class name of the shared flow to retrieve.
@param request the current HttpServletRequest.
@return the {@link SharedFlowController} of the given class name which is stored in the user session. | [
"Get",
"the",
"shared",
"flow",
"with",
"the",
"given",
"class",
"name",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L374-L387 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/io/IOUtils.java | IOUtils.readString | public static String readString(Reader is, String term) throws IOException {
CharArrayWriter baos = new CharArrayWriter();
int ch_int;
char last = term.charAt(term.length() - 1);
while ((ch_int = is.read()) >= 0) {
final char ch = (char) ch_int;
baos.write(ch);
... | java | public static String readString(Reader is, String term) throws IOException {
CharArrayWriter baos = new CharArrayWriter();
int ch_int;
char last = term.charAt(term.length() - 1);
while ((ch_int = is.read()) >= 0) {
final char ch = (char) ch_int;
baos.write(ch);
... | [
"public",
"static",
"String",
"readString",
"(",
"Reader",
"is",
",",
"String",
"term",
")",
"throws",
"IOException",
"{",
"CharArrayWriter",
"baos",
"=",
"new",
"CharArrayWriter",
"(",
")",
";",
"int",
"ch_int",
";",
"char",
"last",
"=",
"term",
".",
"cha... | Read next string from input stream.
@param is The reader to read characters from.
@param term Terminator character.
@return The string up until, but not including the terminator.
@throws IOException when unable to read from stream. | [
"Read",
"next",
"string",
"from",
"input",
"stream",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/io/IOUtils.java#L218-L236 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRanges.java | PluralRanges.isExplicit | @Deprecated
public boolean isExplicit(StandardPlural start, StandardPlural end) {
return matrix.get(start, end) != null;
} | java | @Deprecated
public boolean isExplicit(StandardPlural start, StandardPlural end) {
return matrix.get(start, end) != null;
} | [
"@",
"Deprecated",
"public",
"boolean",
"isExplicit",
"(",
"StandardPlural",
"start",
",",
"StandardPlural",
"end",
")",
"{",
"return",
"matrix",
".",
"get",
"(",
"start",
",",
"end",
")",
"!=",
"null",
";",
"}"
] | Returns whether the appropriate plural category for a range from start to end
is explicitly in the data (vs given an implicit value). See also {@link #get}.
@param start
plural category for the start of the range
@param end
plural category for the end of the range
@return whether the value for (start,end) is explicit ... | [
"Returns",
"whether",
"the",
"appropriate",
"plural",
"category",
"for",
"a",
"range",
"from",
"start",
"to",
"end",
"is",
"explicitly",
"in",
"the",
"data",
"(",
"vs",
"given",
"an",
"implicit",
"value",
")",
".",
"See",
"also",
"{",
"@link",
"#get",
"}... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/PluralRanges.java#L262-L265 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java | CacheHeader.isNotModified | public static boolean isNotModified(@NotNull ModificationDateProvider dateProvider,
@NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response) throws IOException {
boolean isAuthor = WCMMode.fromRequest(request) != WCMMode.DISABLED;
return isNotModified(dateProvider, request, re... | java | public static boolean isNotModified(@NotNull ModificationDateProvider dateProvider,
@NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response) throws IOException {
boolean isAuthor = WCMMode.fromRequest(request) != WCMMode.DISABLED;
return isNotModified(dateProvider, request, re... | [
"public",
"static",
"boolean",
"isNotModified",
"(",
"@",
"NotNull",
"ModificationDateProvider",
"dateProvider",
",",
"@",
"NotNull",
"SlingHttpServletRequest",
"request",
",",
"@",
"NotNull",
"SlingHttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"b... | Compares the "If-Modified-Since header" of the incoming request with the last modification date of an aggregated
resource. If the resource was not modified since the client retrieved the resource, a 304-redirect is send to the
response (and the method returns true). If the resource has changed (or the client didn't) su... | [
"Compares",
"the",
"If",
"-",
"Modified",
"-",
"Since",
"header",
"of",
"the",
"incoming",
"request",
"with",
"the",
"last",
"modification",
"date",
"of",
"an",
"aggregated",
"resource",
".",
"If",
"the",
"resource",
"was",
"not",
"modified",
"since",
"the",... | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java#L139-L143 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java | CacheConfigurationBuilder.withResourcePools | public CacheConfigurationBuilder<K, V> withResourcePools(ResourcePoolsBuilder resourcePoolsBuilder) {
return withResourcePools(requireNonNull(resourcePoolsBuilder, "Null resource pools builder").build());
} | java | public CacheConfigurationBuilder<K, V> withResourcePools(ResourcePoolsBuilder resourcePoolsBuilder) {
return withResourcePools(requireNonNull(resourcePoolsBuilder, "Null resource pools builder").build());
} | [
"public",
"CacheConfigurationBuilder",
"<",
"K",
",",
"V",
">",
"withResourcePools",
"(",
"ResourcePoolsBuilder",
"resourcePoolsBuilder",
")",
"{",
"return",
"withResourcePools",
"(",
"requireNonNull",
"(",
"resourcePoolsBuilder",
",",
"\"Null resource pools builder\"",
")"... | Convenience method to add a {@link ResourcePools} through a {@link ResourcePoolsBuilder} to the returned builder.
@param resourcePoolsBuilder the builder providing the resource pool
@return a new builder with the added resource pools
@see #withResourcePools(ResourcePools) | [
"Convenience",
"method",
"to",
"add",
"a",
"{",
"@link",
"ResourcePools",
"}",
"through",
"a",
"{",
"@link",
"ResourcePoolsBuilder",
"}",
"to",
"the",
"returned",
"builder",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L284-L286 |
mojohaus/webstart | webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/AbstractJnlpMojo.java | AbstractJnlpMojo.prepareExtensions | private void prepareExtensions()
throws MojoExecutionException
{
List<String> includes = new ArrayList<>();
for ( JnlpExtension extension : jnlpExtensions )
{
// Check extensions (mandatory name, title and vendor and at least one include)
checkExtension( ... | java | private void prepareExtensions()
throws MojoExecutionException
{
List<String> includes = new ArrayList<>();
for ( JnlpExtension extension : jnlpExtensions )
{
// Check extensions (mandatory name, title and vendor and at least one include)
checkExtension( ... | [
"private",
"void",
"prepareExtensions",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"List",
"<",
"String",
">",
"includes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"JnlpExtension",
"extension",
":",
"jnlpExtensions",
")",
"{",
"// Chec... | Prepare extensions.
<p>
Copy all includes of all extensions as to be excluded.
@throws MojoExecutionException if could not prepare extensions | [
"Prepare",
"extensions",
".",
"<p",
">",
"Copy",
"all",
"includes",
"of",
"all",
"extensions",
"as",
"to",
"be",
"excluded",
"."
] | train | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/AbstractJnlpMojo.java#L887-L923 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/adjustmentservice/GetAllTrafficAdjustments.java | GetAllTrafficAdjustments.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the AdjustmentService.
AdjustmentServiceInterface adjustmentService =
adManagerServices.get(session, AdjustmentServiceInterface.class);
// Create a statement to get all... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the AdjustmentService.
AdjustmentServiceInterface adjustmentService =
adManagerServices.get(session, AdjustmentServiceInterface.class);
// Create a statement to get all... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the AdjustmentService.",
"AdjustmentServiceInterface",
"adjustmentService",
"=",
"adManagerServices",
".",... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/adjustmentservice/GetAllTrafficAdjustments.java#L51-L87 |
m-m-m/util | nls/src/main/java/net/sf/mmm/util/nls/base/AbstractNlsFormatterManager.java | AbstractNlsFormatterManager.getSubFormatter | protected NlsFormatterPlugin<?> getSubFormatter(String formatType, CharSequenceScanner scanner) {
String formatStyle = scanner.readWhile(NO_EXPRESSION);
return getFormatter(formatType, formatStyle);
} | java | protected NlsFormatterPlugin<?> getSubFormatter(String formatType, CharSequenceScanner scanner) {
String formatStyle = scanner.readWhile(NO_EXPRESSION);
return getFormatter(formatType, formatStyle);
} | [
"protected",
"NlsFormatterPlugin",
"<",
"?",
">",
"getSubFormatter",
"(",
"String",
"formatType",
",",
"CharSequenceScanner",
"scanner",
")",
"{",
"String",
"formatStyle",
"=",
"scanner",
".",
"readWhile",
"(",
"NO_EXPRESSION",
")",
";",
"return",
"getFormatter",
... | This method is like {@link #getFormatter(String, String)} but reads the
{@link AbstractNlsFormatterPlugin#getStyle() style} from the given scanner.
@param formatType is the type to be formatted.
@param scanner is the current {@link CharSequenceScanner} for parsing the style defining details of formatting.
@return the ... | [
"This",
"method",
"is",
"like",
"{",
"@link",
"#getFormatter",
"(",
"String",
"String",
")",
"}",
"but",
"reads",
"the",
"{",
"@link",
"AbstractNlsFormatterPlugin#getStyle",
"()",
"style",
"}",
"from",
"the",
"given",
"scanner",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/nls/src/main/java/net/sf/mmm/util/nls/base/AbstractNlsFormatterManager.java#L130-L134 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.copyObject | public void copyObject(String bucketName, String objectName, String destBucketName)
throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException,
NoResponseException, ErrorResponseException, InternalException, IOException, XmlPullParserException,
InvalidA... | java | public void copyObject(String bucketName, String objectName, String destBucketName)
throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException,
NoResponseException, ErrorResponseException, InternalException, IOException, XmlPullParserException,
InvalidA... | [
"public",
"void",
"copyObject",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
",",
"String",
"destBucketName",
")",
"throws",
"InvalidKeyException",
",",
"InvalidBucketNameException",
",",
"NoSuchAlgorithmException",
",",
"InsufficientDataException",
",",
"NoR... | Copy a source object into a new destination object with same object name.
</p>
<b>Example:</b><br>
<pre>
{@code minioClient.copyObject("my-bucketname", "my-objectname", "my-destbucketname");}
</pre>
@param bucketName
Bucket name where the object to be copied exists.
@param objectName
Object name source to be copied.... | [
"Copy",
"a",
"source",
"object",
"into",
"a",
"new",
"destination",
"object",
"with",
"same",
"object",
"name",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L2008-L2014 |
eclipse/hawkbit | hawkbit-security-core/src/main/java/org/eclipse/hawkbit/util/IpUtil.java | IpUtil.getClientIpFromRequest | public static URI getClientIpFromRequest(final HttpServletRequest request,
final HawkbitSecurityProperties securityProperties) {
return getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader(),
securityProperties.getClients().isTrackRemoteIp());
} | java | public static URI getClientIpFromRequest(final HttpServletRequest request,
final HawkbitSecurityProperties securityProperties) {
return getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader(),
securityProperties.getClients().isTrackRemoteIp());
} | [
"public",
"static",
"URI",
"getClientIpFromRequest",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HawkbitSecurityProperties",
"securityProperties",
")",
"{",
"return",
"getClientIpFromRequest",
"(",
"request",
",",
"securityProperties",
".",
"getClients",
... | Retrieves the string based IP address from a given
{@link HttpServletRequest} by either the
{@link HttpHeaders#X_FORWARDED_FOR} or by the
{@link HttpServletRequest#getRemoteAddr()} methods.
@param request
the {@link HttpServletRequest} to determine the IP address
where this request has been sent from
@param securityPr... | [
"Retrieves",
"the",
"string",
"based",
"IP",
"address",
"from",
"a",
"given",
"{",
"@link",
"HttpServletRequest",
"}",
"by",
"either",
"the",
"{",
"@link",
"HttpHeaders#X_FORWARDED_FOR",
"}",
"or",
"by",
"the",
"{",
"@link",
"HttpServletRequest#getRemoteAddr",
"()... | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/util/IpUtil.java#L56-L61 |
jMetal/jMetal | jmetal-exec/src/main/java/org/uma/jmetal/runner/multiobjective/SMPSORPWithOneReferencePointRunner.java | SMPSORPWithOneReferencePointRunner.main | public static void main(String[] args) throws JMetalException {
DoubleProblem problem;
Algorithm<List<DoubleSolution>> algorithm;
MutationOperator<DoubleSolution> mutation;
String problemName;
if (args.length == 1) {
problemName = args[0];
} else {
problemName = "org.uma.jmetal.prob... | java | public static void main(String[] args) throws JMetalException {
DoubleProblem problem;
Algorithm<List<DoubleSolution>> algorithm;
MutationOperator<DoubleSolution> mutation;
String problemName;
if (args.length == 1) {
problemName = args[0];
} else {
problemName = "org.uma.jmetal.prob... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"JMetalException",
"{",
"DoubleProblem",
"problem",
";",
"Algorithm",
"<",
"List",
"<",
"DoubleSolution",
">",
">",
"algorithm",
";",
"MutationOperator",
"<",
"DoubleSolution",
... | Program to run the SMPSORP algorithm with one reference point. SMPSORP is described in
"Extending the Speed-constrained Multi-Objective PSO (SMPSO) With Reference Point Based Preference
* Articulation. Antonio J. Nebro, Juan J. Durillo, José García-Nieto, Cristóbal Barba-González,
* Javier Del Ser, Carlos A. Coello Coe... | [
"Program",
"to",
"run",
"the",
"SMPSORP",
"algorithm",
"with",
"one",
"reference",
"point",
".",
"SMPSORP",
"is",
"described",
"in",
"Extending",
"the",
"Speed",
"-",
"constrained",
"Multi",
"-",
"Objective",
"PSO",
"(",
"SMPSO",
")",
"With",
"Reference",
"P... | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-exec/src/main/java/org/uma/jmetal/runner/multiobjective/SMPSORPWithOneReferencePointRunner.java#L34-L95 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDate.java | LocalDate.withYear | public LocalDate withYear(int year) {
if (this.year == year) {
return this;
}
YEAR.checkValidValue(year);
return resolvePreviousValid(year, month, day);
} | java | public LocalDate withYear(int year) {
if (this.year == year) {
return this;
}
YEAR.checkValidValue(year);
return resolvePreviousValid(year, month, day);
} | [
"public",
"LocalDate",
"withYear",
"(",
"int",
"year",
")",
"{",
"if",
"(",
"this",
".",
"year",
"==",
"year",
")",
"{",
"return",
"this",
";",
"}",
"YEAR",
".",
"checkValidValue",
"(",
"year",
")",
";",
"return",
"resolvePreviousValid",
"(",
"year",
"... | Returns a copy of this {@code LocalDate} with the year altered.
<p>
If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
<p>
This instance is immutable and unaffected by this method call.
@param year the year to set in the result, from MIN_YEAR to MAX_YEAR
@return a {@co... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDate",
"}",
"with",
"the",
"year",
"altered",
".",
"<p",
">",
"If",
"the",
"day",
"-",
"of",
"-",
"month",
"is",
"invalid",
"for",
"the",
"year",
"it",
"will",
"be",
"changed",
"to",
"the",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDate.java#L1050-L1056 |
gilberto-torrezan/gwt-views | src/main/java/com/github/gilbertotorrezan/gwtviews/client/URLToken.java | URLToken.getParameterAsDouble | public double getParameterAsDouble(String name, double defaultValue){
String value = parameters.get(name);
if (value == null || value.isEmpty()){
return defaultValue;
}
try {
return Double.parseDouble(value);
} catch (Exception e) {
return defaultValue;
}
} | java | public double getParameterAsDouble(String name, double defaultValue){
String value = parameters.get(name);
if (value == null || value.isEmpty()){
return defaultValue;
}
try {
return Double.parseDouble(value);
} catch (Exception e) {
return defaultValue;
}
} | [
"public",
"double",
"getParameterAsDouble",
"(",
"String",
"name",
",",
"double",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"parameters",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"isEmpty",
"(",
")"... | Gets a double parameter extracted from the History token.
For example, if the token is: <pre>{@code tokenId¶m1=0.1 }</pre>the call to <code>getParameterAsBoolean("param1", 0)</code> will return <code>0.1</code>.
@param name The name of the parameter
@param defaultValue The value to be returned when the parameter i... | [
"Gets",
"a",
"double",
"parameter",
"extracted",
"from",
"the",
"History",
"token",
".",
"For",
"example",
"if",
"the",
"token",
"is",
":",
"<pre",
">",
"{",
"@code",
"tokenId¶m1",
"=",
"0",
".",
"1",
"}",
"<",
"/",
"pre",
">",
"the",
"call",
"to... | train | https://github.com/gilberto-torrezan/gwt-views/blob/c6511435d14b5aa93a722b0e861230d0ae2159e5/src/main/java/com/github/gilbertotorrezan/gwtviews/client/URLToken.java#L251-L261 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/V1InstanceCreator.java | V1InstanceCreator.changeSet | public ChangeSet changeSet(String name, String reference) {
return changeSet(name, reference, null);
} | java | public ChangeSet changeSet(String name, String reference) {
return changeSet(name, reference, null);
} | [
"public",
"ChangeSet",
"changeSet",
"(",
"String",
"name",
",",
"String",
"reference",
")",
"{",
"return",
"changeSet",
"(",
"name",
",",
"reference",
",",
"null",
")",
";",
"}"
] | Create a new ChangeSet with a name and reference.
@param name Initial name.
@param reference Reference value.
@return A newly minted ChangeSet that exists in the VersionOne system. | [
"Create",
"a",
"new",
"ChangeSet",
"with",
"a",
"name",
"and",
"reference",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/V1InstanceCreator.java#L929-L931 |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/Crypto.java | Crypto.initCipher | private void initCipher(Cipher cipher, int mode, SecretKey key, byte[] iv) {
// Initialise the cipher:
IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);
try {
cipher.init(mode, key, ivParameterSpec);
} catch (InvalidKeyException e) {
// This is li... | java | private void initCipher(Cipher cipher, int mode, SecretKey key, byte[] iv) {
// Initialise the cipher:
IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);
try {
cipher.init(mode, key, ivParameterSpec);
} catch (InvalidKeyException e) {
// This is li... | [
"private",
"void",
"initCipher",
"(",
"Cipher",
"cipher",
",",
"int",
"mode",
",",
"SecretKey",
"key",
",",
"byte",
"[",
"]",
"iv",
")",
"{",
"// Initialise the cipher:\r",
"IvParameterSpec",
"ivParameterSpec",
"=",
"new",
"IvParameterSpec",
"(",
"iv",
")",
";... | This method returns a {@link Cipher} instance, for
{@value #CIPHER_ALGORITHM} in {@value #CIPHER_MODE} mode, with padding
{@value #CIPHER_PADDING}.
<p>
It then initialises the {@link Cipher} in either
{@link Cipher#ENCRYPT_MODE} or {@link Cipher#DECRYPT_MODE}), as specified
by the mode parameter, with the given {@link ... | [
"This",
"method",
"returns",
"a",
"{",
"@link",
"Cipher",
"}",
"instance",
"for",
"{",
"@value",
"#CIPHER_ALGORITHM",
"}",
"in",
"{",
"@value",
"#CIPHER_MODE",
"}",
"mode",
"with",
"padding",
"{",
"@value",
"#CIPHER_PADDING",
"}",
".",
"<p",
">",
"It",
"th... | train | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/Crypto.java#L626-L651 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java | AllClassesFrameWriter.addContents | protected void addContents(Iterable<? extends Element> classlist, boolean wantFrames,
Content content) {
for (Element element : classlist) {
TypeElement typeElement = (TypeElement)element;
if (!utils.isCoreClass(typeElement)) {
continue;
... | java | protected void addContents(Iterable<? extends Element> classlist, boolean wantFrames,
Content content) {
for (Element element : classlist) {
TypeElement typeElement = (TypeElement)element;
if (!utils.isCoreClass(typeElement)) {
continue;
... | [
"protected",
"void",
"addContents",
"(",
"Iterable",
"<",
"?",
"extends",
"Element",
">",
"classlist",
",",
"boolean",
"wantFrames",
",",
"Content",
"content",
")",
"{",
"for",
"(",
"Element",
"element",
":",
"classlist",
")",
"{",
"TypeElement",
"typeElement"... | Given a list of classes, generate links for each class or interface.
If the class kind is interface, print it in the italics font. Also all
links should target the right-hand frame. If clicked on any class name
in this page, appropriate class page should get opened in the right-hand
frame.
@param classlist Sorted list... | [
"Given",
"a",
"list",
"of",
"classes",
"generate",
"links",
"for",
"each",
"class",
"or",
"interface",
".",
"If",
"the",
"class",
"kind",
"is",
"interface",
"print",
"it",
"in",
"the",
"italics",
"font",
".",
"Also",
"all",
"links",
"should",
"target",
"... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesFrameWriter.java#L154-L172 |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.getEntity | public Referenceable getEntity(String guid) throws AtlasServiceException {
JSONObject jsonResponse = callAPIWithBodyAndParams(API.GET_ENTITY, null, guid);
try {
String entityInstanceDefinition = jsonResponse.getString(AtlasClient.DEFINITION);
return InstanceSerialization.fromJson... | java | public Referenceable getEntity(String guid) throws AtlasServiceException {
JSONObject jsonResponse = callAPIWithBodyAndParams(API.GET_ENTITY, null, guid);
try {
String entityInstanceDefinition = jsonResponse.getString(AtlasClient.DEFINITION);
return InstanceSerialization.fromJson... | [
"public",
"Referenceable",
"getEntity",
"(",
"String",
"guid",
")",
"throws",
"AtlasServiceException",
"{",
"JSONObject",
"jsonResponse",
"=",
"callAPIWithBodyAndParams",
"(",
"API",
".",
"GET_ENTITY",
",",
"null",
",",
"guid",
")",
";",
"try",
"{",
"String",
"e... | Get an entity given the entity id
@param guid entity id
@return result object
@throws AtlasServiceException | [
"Get",
"an",
"entity",
"given",
"the",
"entity",
"id"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L637-L645 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/serialize/SerializerUtils.java | SerializerUtils.addAttributes | public static void addAttributes(SerializationHandler handler, int src)
throws TransformerException
{
TransformerImpl transformer =
(TransformerImpl) handler.getTransformer();
DTM dtm = transformer.getXPathContext().getDTM(src);
for (int node = dtm.getFirstAttribute(src... | java | public static void addAttributes(SerializationHandler handler, int src)
throws TransformerException
{
TransformerImpl transformer =
(TransformerImpl) handler.getTransformer();
DTM dtm = transformer.getXPathContext().getDTM(src);
for (int node = dtm.getFirstAttribute(src... | [
"public",
"static",
"void",
"addAttributes",
"(",
"SerializationHandler",
"handler",
",",
"int",
"src",
")",
"throws",
"TransformerException",
"{",
"TransformerImpl",
"transformer",
"=",
"(",
"TransformerImpl",
")",
"handler",
".",
"getTransformer",
"(",
")",
";",
... | Copy DOM attributes to the result element.
@param src Source node with the attributes
@throws TransformerException | [
"Copy",
"DOM",
"attributes",
"to",
"the",
"result",
"element",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/serialize/SerializerUtils.java#L93-L107 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteSecretAsync | public Observable<DeletedSecretBundle> deleteSecretAsync(String vaultBaseUrl, String secretName) {
return deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1<ServiceResponse<DeletedSecretBundle>, DeletedSecretBundle>() {
@Override
public DeletedSecretBundle call(... | java | public Observable<DeletedSecretBundle> deleteSecretAsync(String vaultBaseUrl, String secretName) {
return deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1<ServiceResponse<DeletedSecretBundle>, DeletedSecretBundle>() {
@Override
public DeletedSecretBundle call(... | [
"public",
"Observable",
"<",
"DeletedSecretBundle",
">",
"deleteSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
")",
"{",
"return",
"deleteSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretName",
")",
".",
"map",
"(",
"new",
... | Deletes a secret from a specified key vault.
The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@para... | [
"Deletes",
"a",
"secret",
"from",
"a",
"specified",
"key",
"vault",
".",
"The",
"DELETE",
"operation",
"applies",
"to",
"any",
"secret",
"stored",
"in",
"Azure",
"Key",
"Vault",
".",
"DELETE",
"cannot",
"be",
"applied",
"to",
"an",
"individual",
"version",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3558-L3565 |
udoprog/ffwd-client-java | src/main/java/eu/toolchain/ffwd/FastForward.java | FastForward.setup | public static FastForward setup(InetAddress addr, int port) throws SocketException {
final DatagramSocket socket = new DatagramSocket();
return new FastForward(addr, port, socket);
} | java | public static FastForward setup(InetAddress addr, int port) throws SocketException {
final DatagramSocket socket = new DatagramSocket();
return new FastForward(addr, port, socket);
} | [
"public",
"static",
"FastForward",
"setup",
"(",
"InetAddress",
"addr",
",",
"int",
"port",
")",
"throws",
"SocketException",
"{",
"final",
"DatagramSocket",
"socket",
"=",
"new",
"DatagramSocket",
"(",
")",
";",
"return",
"new",
"FastForward",
"(",
"addr",
",... | Initialization method for a FastForward client.
@return A new instance of a FastForward client.
@throws SocketException If a datagram socket cannot be created. | [
"Initialization",
"method",
"for",
"a",
"FastForward",
"client",
"."
] | train | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/eu/toolchain/ffwd/FastForward.java#L40-L43 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContent.java | CmsXmlContent.ensureParentValues | private void ensureParentValues(CmsObject cms, String valuePath, Locale locale) {
if (valuePath.contains("/")) {
String parentPath = valuePath.substring(0, valuePath.lastIndexOf("/"));
if (!hasValue(parentPath, locale)) {
ensureParentValues(cms, parentPath, locale);
... | java | private void ensureParentValues(CmsObject cms, String valuePath, Locale locale) {
if (valuePath.contains("/")) {
String parentPath = valuePath.substring(0, valuePath.lastIndexOf("/"));
if (!hasValue(parentPath, locale)) {
ensureParentValues(cms, parentPath, locale);
... | [
"private",
"void",
"ensureParentValues",
"(",
"CmsObject",
"cms",
",",
"String",
"valuePath",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"valuePath",
".",
"contains",
"(",
"\"/\"",
")",
")",
"{",
"String",
"parentPath",
"=",
"valuePath",
".",
"substring",... | Ensures the parent values to the given path are created.<p>
@param cms the cms context
@param valuePath the value path
@param locale the content locale | [
"Ensures",
"the",
"parent",
"values",
"to",
"the",
"given",
"path",
"are",
"created",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContent.java#L1074-L1084 |
phax/ph-oton | ph-oton-security/src/main/java/com/helger/photon/security/login/LoggedInUserManager.java | LoggedInUserManager.loginUser | @Nonnull
public ELoginResult loginUser (@Nullable final String sLoginName,
@Nullable final String sPlainTextPassword,
@Nullable final Iterable <String> aRequiredRoleIDs)
{
// Try to resolve the user
final IUser aUser = PhotonSecurityManager.g... | java | @Nonnull
public ELoginResult loginUser (@Nullable final String sLoginName,
@Nullable final String sPlainTextPassword,
@Nullable final Iterable <String> aRequiredRoleIDs)
{
// Try to resolve the user
final IUser aUser = PhotonSecurityManager.g... | [
"@",
"Nonnull",
"public",
"ELoginResult",
"loginUser",
"(",
"@",
"Nullable",
"final",
"String",
"sLoginName",
",",
"@",
"Nullable",
"final",
"String",
"sPlainTextPassword",
",",
"@",
"Nullable",
"final",
"Iterable",
"<",
"String",
">",
"aRequiredRoleIDs",
")",
"... | Login the passed user and require a set of certain roles, the used needs to
have to login here.
@param sLoginName
Login name of the user to log-in. May be <code>null</code>.
@param sPlainTextPassword
Plain text password to use. May be <code>null</code>.
@param aRequiredRoleIDs
A set of required role IDs, the user need... | [
"Login",
"the",
"passed",
"user",
"and",
"require",
"a",
"set",
"of",
"certain",
"roles",
"the",
"used",
"needs",
"to",
"have",
"to",
"login",
"here",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/login/LoggedInUserManager.java#L335-L348 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/TypeMappings.java | TypeMappings.getInputMapping | @FFDCIgnore(Exception.class)
private String getInputMapping(String inputVirtualRealm, String inputProperty, String inputDefaultProperty) {
String methodName = "getInputMapping";
// initialize the return value
String returnValue = null;
RealmConfig realmConfig = mappingUtils.getCoreC... | java | @FFDCIgnore(Exception.class)
private String getInputMapping(String inputVirtualRealm, String inputProperty, String inputDefaultProperty) {
String methodName = "getInputMapping";
// initialize the return value
String returnValue = null;
RealmConfig realmConfig = mappingUtils.getCoreC... | [
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"private",
"String",
"getInputMapping",
"(",
"String",
"inputVirtualRealm",
",",
"String",
"inputProperty",
",",
"String",
"inputDefaultProperty",
")",
"{",
"String",
"methodName",
"=",
"\"getInputMapping\"",
"... | Get the WIM input property that maps to the UserRegistry input property.
@param inputVirtualRealm Virtual realm to find the mappings.
@param inputProperty String representing the input UserRegistry property.
@return String representing the input WIM property.
@pre inputVirtualRealm != null
@pre inputVirtualRealm != e... | [
"Get",
"the",
"WIM",
"input",
"property",
"that",
"maps",
"to",
"the",
"UserRegistry",
"input",
"property",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/TypeMappings.java#L304-L327 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/Protobuf.java | Protobuf.read | public static <MSG extends Message> MSG read(File file, Parser<MSG> parser) {
InputStream input = null;
try {
input = new BufferedInputStream(new FileInputStream(file));
return parser.parseFrom(input);
} catch (Exception e) {
throw ContextException.of("Unable to read message", e).addContex... | java | public static <MSG extends Message> MSG read(File file, Parser<MSG> parser) {
InputStream input = null;
try {
input = new BufferedInputStream(new FileInputStream(file));
return parser.parseFrom(input);
} catch (Exception e) {
throw ContextException.of("Unable to read message", e).addContex... | [
"public",
"static",
"<",
"MSG",
"extends",
"Message",
">",
"MSG",
"read",
"(",
"File",
"file",
",",
"Parser",
"<",
"MSG",
">",
"parser",
")",
"{",
"InputStream",
"input",
"=",
"null",
";",
"try",
"{",
"input",
"=",
"new",
"BufferedInputStream",
"(",
"n... | Returns the message contained in {@code file}. Throws an unchecked exception
if the file does not exist, is empty or does not contain message with the
expected type. | [
"Returns",
"the",
"message",
"contained",
"in",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/Protobuf.java#L47-L57 |
UrielCh/ovh-java-sdk | ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java | ApiOvhRouter.serviceName_privateLink_peerServiceName_GET | public OvhPrivateLink serviceName_privateLink_peerServiceName_GET(String serviceName, String peerServiceName) throws IOException {
String qPath = "/router/{serviceName}/privateLink/{peerServiceName}";
StringBuilder sb = path(qPath, serviceName, peerServiceName);
String resp = exec(qPath, "GET", sb.toString(), nul... | java | public OvhPrivateLink serviceName_privateLink_peerServiceName_GET(String serviceName, String peerServiceName) throws IOException {
String qPath = "/router/{serviceName}/privateLink/{peerServiceName}";
StringBuilder sb = path(qPath, serviceName, peerServiceName);
String resp = exec(qPath, "GET", sb.toString(), nul... | [
"public",
"OvhPrivateLink",
"serviceName_privateLink_peerServiceName_GET",
"(",
"String",
"serviceName",
",",
"String",
"peerServiceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/router/{serviceName}/privateLink/{peerServiceName}\"",
";",
"StringBuilder",
... | Get this object properties
REST: GET /router/{serviceName}/privateLink/{peerServiceName}
@param serviceName [required] The internal name of your Router offer
@param peerServiceName [required] Service name of the other side of this link | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java#L316-L321 |
alkacon/opencms-core | src/org/opencms/db/CmsUserSettings.java | CmsUserSettings.getStartGallery | public String getStartGallery(String galleryType, CmsObject cms) {
String startGallerySetting = getStartGallery(galleryType);
String pathSetting = null;
// if a custom path to the gallery is selected
if ((startGallerySetting != null) && !startGallerySetting.equals(CmsWorkplace.INPUT_NON... | java | public String getStartGallery(String galleryType, CmsObject cms) {
String startGallerySetting = getStartGallery(galleryType);
String pathSetting = null;
// if a custom path to the gallery is selected
if ((startGallerySetting != null) && !startGallerySetting.equals(CmsWorkplace.INPUT_NON... | [
"public",
"String",
"getStartGallery",
"(",
"String",
"galleryType",
",",
"CmsObject",
"cms",
")",
"{",
"String",
"startGallerySetting",
"=",
"getStartGallery",
"(",
"galleryType",
")",
";",
"String",
"pathSetting",
"=",
"null",
";",
"// if a custom path to the galler... | Returns the root site path to the start gallery of the user or the constant CmsPreferences.INPUT_DEFAULT.<p>
@param galleryType the type of the gallery
@param cms Cms object
@return the root site path to the start gallery or the default key, null if "not set" | [
"Returns",
"the",
"root",
"site",
"path",
"to",
"the",
"start",
"gallery",
"of",
"the",
"user",
"or",
"the",
"constant",
"CmsPreferences",
".",
"INPUT_DEFAULT",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsUserSettings.java#L811-L829 |
haifengl/smile | plot/src/main/java/smile/plot/Graphics.java | Graphics.drawTextBaseRatio | public void drawTextBaseRatio(String label, double horizontalReference, double verticalReference, double[] coord) {
drawTextBaseRatio(label, horizontalReference, verticalReference, 0.0, coord);
} | java | public void drawTextBaseRatio(String label, double horizontalReference, double verticalReference, double[] coord) {
drawTextBaseRatio(label, horizontalReference, verticalReference, 0.0, coord);
} | [
"public",
"void",
"drawTextBaseRatio",
"(",
"String",
"label",
",",
"double",
"horizontalReference",
",",
"double",
"verticalReference",
",",
"double",
"[",
"]",
"coord",
")",
"{",
"drawTextBaseRatio",
"(",
"label",
",",
"horizontalReference",
",",
"verticalReferenc... | Draw a string with given reference point. (0.5, 0.5) is center, (0, 0) is
lower left, (0, 1) is upper left, etc. The logical coordinates are
proportional to the base coordinates. | [
"Draw",
"a",
"string",
"with",
"given",
"reference",
"point",
".",
"(",
"0",
".",
"5",
"0",
".",
"5",
")",
"is",
"center",
"(",
"0",
"0",
")",
"is",
"lower",
"left",
"(",
"0",
"1",
")",
"is",
"upper",
"left",
"etc",
".",
"The",
"logical",
"coor... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/plot/Graphics.java#L264-L266 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeElement.java | TreeElement.updateName | protected void updateName(TreeElement parentNode, int index)
{
setName(getNodeName(parentNode, index));
TreeElement[] children = getChildren();
for (int i = 0; i < children.length; i++) {
children[i].updateName(this, i);
}
} | java | protected void updateName(TreeElement parentNode, int index)
{
setName(getNodeName(parentNode, index));
TreeElement[] children = getChildren();
for (int i = 0; i < children.length; i++) {
children[i].updateName(this, i);
}
} | [
"protected",
"void",
"updateName",
"(",
"TreeElement",
"parentNode",
",",
"int",
"index",
")",
"{",
"setName",
"(",
"getNodeName",
"(",
"parentNode",
",",
"index",
")",
")",
";",
"TreeElement",
"[",
"]",
"children",
"=",
"getChildren",
"(",
")",
";",
"for"... | This method will update the name of this node and all of the children node. The name
of a node reflects it's position in the tree.
@param parentNode The parent node of this node.
@param index the index position of this node within the parent node. | [
"This",
"method",
"will",
"update",
"the",
"name",
"of",
"this",
"node",
"and",
"all",
"of",
"the",
"children",
"node",
".",
"The",
"name",
"of",
"a",
"node",
"reflects",
"it",
"s",
"position",
"in",
"the",
"tree",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeElement.java#L731-L738 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/io/Closeables.java | Closeables.closeableFrom | public static Closeable closeableFrom(@WillNotClose @Nullable final Statement statement) {
return closeableFrom(statement, Statement::close);
} | java | public static Closeable closeableFrom(@WillNotClose @Nullable final Statement statement) {
return closeableFrom(statement, Statement::close);
} | [
"public",
"static",
"Closeable",
"closeableFrom",
"(",
"@",
"WillNotClose",
"@",
"Nullable",
"final",
"Statement",
"statement",
")",
"{",
"return",
"closeableFrom",
"(",
"statement",
",",
"Statement",
"::",
"close",
")",
";",
"}"
] | Provides {@link Closeable} interface for {@link Statement}
@param statement the statement to decorate
@return a closeable decorated statement | [
"Provides",
"{",
"@link",
"Closeable",
"}",
"interface",
"for",
"{",
"@link",
"Statement",
"}"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/io/Closeables.java#L48-L50 |
alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java | ZkClientx.createPersistentSequential | public String createPersistentSequential(String path, Object data) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeException {
return create(pa... | java | public String createPersistentSequential(String path, Object data) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeException {
return create(pa... | [
"public",
"String",
"createPersistentSequential",
"(",
"String",
"path",
",",
"Object",
"data",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"return",
"create",
"(",
"path",
",",
"data",
... | Create a persistent, sequental node.
@param path
@param data
@return create node's path
@throws ZkInterruptedException if operation was interrupted, or a required reconnection got interrupted
@throws IllegalArgumentException if called from anything except the ZooKeeper event thread
@throws ZkException if any ZooKeeper... | [
"Create",
"a",
"persistent",
"sequental",
"node",
"."
] | train | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L364-L368 |
Azure/azure-sdk-for-java | postgresql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/ServerSecurityAlertPoliciesInner.java | ServerSecurityAlertPoliciesInner.beginCreateOrUpdateAsync | public Observable<ServerSecurityAlertPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerSecurityAlertPoli... | java | public Observable<ServerSecurityAlertPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerSecurityAlertPoli... | [
"public",
"Observable",
"<",
"ServerSecurityAlertPolicyInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerSecurityAlertPolicyInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",... | Creates or updates a threat detection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters The server security alert policy.
@throws IllegalArg... | [
"Creates",
"or",
"updates",
"a",
"threat",
"detection",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/postgresql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/ServerSecurityAlertPoliciesInner.java#L274-L281 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/utils/URBridgeEntity.java | URBridgeEntity.getUniqueId | public String getUniqueId(boolean setAttr) throws Exception {
String uniqueName = null;
String uniqueId = null;
if (entity.getIdentifier().isSet(uniqueIdProp)) {
uniqueId = (String) entity.getIdentifier().get(uniqueIdProp);
return uniqueId;
}
uniqueName = ... | java | public String getUniqueId(boolean setAttr) throws Exception {
String uniqueName = null;
String uniqueId = null;
if (entity.getIdentifier().isSet(uniqueIdProp)) {
uniqueId = (String) entity.getIdentifier().get(uniqueIdProp);
return uniqueId;
}
uniqueName = ... | [
"public",
"String",
"getUniqueId",
"(",
"boolean",
"setAttr",
")",
"throws",
"Exception",
"{",
"String",
"uniqueName",
"=",
"null",
";",
"String",
"uniqueId",
"=",
"null",
";",
"if",
"(",
"entity",
".",
"getIdentifier",
"(",
")",
".",
"isSet",
"(",
"unique... | Returns the uniqueId of a user or a group.
@param setAttr a boolean indicating whether to actually set the attribute
in the entity or just perform a lookup.
@return the user or group's uniqueId.
@throws Exception identifier values are missing or the underlying
registry threw an error. | [
"Returns",
"the",
"uniqueId",
"of",
"a",
"user",
"or",
"a",
"group",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/utils/URBridgeEntity.java#L206-L229 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.instantiateConnection | JmsConnectionImpl instantiateConnection(JmsJcaConnection jcaConnection, Map<String, String> _passThruProps) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "instantiateConnection", jcaConnection);
JmsConnectionImpl jmsConnection = ... | java | JmsConnectionImpl instantiateConnection(JmsJcaConnection jcaConnection, Map<String, String> _passThruProps) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "instantiateConnection", jcaConnection);
JmsConnectionImpl jmsConnection = ... | [
"JmsConnectionImpl",
"instantiateConnection",
"(",
"JmsJcaConnection",
"jcaConnection",
",",
"Map",
"<",
"String",
",",
"String",
">",
"_passThruProps",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc"... | This method is used to create a JMS Connection object.<p>
This method is overriden by subclasses so that the appropriate connection
type is returned whenever this method is called
(e.g. from within createConnection()). | [
"This",
"method",
"is",
"used",
"to",
"create",
"a",
"JMS",
"Connection",
"object",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L346-L353 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java | Parameters.getPositiveIntegerList | public List<Integer> getPositiveIntegerList(final String param) {
return getList(param, new StringToInteger(),
new IsPositive<Integer>(), "positive integer");
} | java | public List<Integer> getPositiveIntegerList(final String param) {
return getList(param, new StringToInteger(),
new IsPositive<Integer>(), "positive integer");
} | [
"public",
"List",
"<",
"Integer",
">",
"getPositiveIntegerList",
"(",
"final",
"String",
"param",
")",
"{",
"return",
"getList",
"(",
"param",
",",
"new",
"StringToInteger",
"(",
")",
",",
"new",
"IsPositive",
"<",
"Integer",
">",
"(",
")",
",",
"\"positiv... | Gets a parameter whose value is a (possibly empty) list of positive integers. | [
"Gets",
"a",
"parameter",
"whose",
"value",
"is",
"a",
"(",
"possibly",
"empty",
")",
"list",
"of",
"positive",
"integers",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java#L678-L681 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.setupTablePopup | public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton)
{
String keyAreaName = null;
if (iQueryKeySeq != -1)
... | java | public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton)
{
String keyAreaName = null;
if (iQueryKeySeq != -1)
... | [
"public",
"ScreenComponent",
"setupTablePopup",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Rec",
"record",
",",
"int",
"iQueryKeySeq",
",",
"int",
"iDisplayFieldSeq",
","... | Add a popup for the table tied to this field.
Key must be the first and primary and only key.
@param record Record to display in a popup
@param iQueryKeySeq Order to display the record (-1 = Primary field)
@param iDisplayFieldSeq Description field for the popup (-1 = second field)
@param bIncludeBlankOption Include a b... | [
"Add",
"a",
"popup",
"for",
"the",
"table",
"tied",
"to",
"this",
"field",
".",
"Key",
"must",
"be",
"the",
"first",
"and",
"primary",
"and",
"only",
"key",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1206-L1216 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/GrailsHibernateQueryUtils.java | GrailsHibernateQueryUtils.addOrderPossiblyNested | private static void addOrderPossiblyNested(Criteria c, PersistentEntity entity, String sort, String order, boolean ignoreCase) {
int firstDotPos = sort.indexOf(".");
if (firstDotPos == -1) {
addOrder(c, sort, order, ignoreCase);
} else { // nested property
String sortHead... | java | private static void addOrderPossiblyNested(Criteria c, PersistentEntity entity, String sort, String order, boolean ignoreCase) {
int firstDotPos = sort.indexOf(".");
if (firstDotPos == -1) {
addOrder(c, sort, order, ignoreCase);
} else { // nested property
String sortHead... | [
"private",
"static",
"void",
"addOrderPossiblyNested",
"(",
"Criteria",
"c",
",",
"PersistentEntity",
"entity",
",",
"String",
"sort",
",",
"String",
"order",
",",
"boolean",
"ignoreCase",
")",
"{",
"int",
"firstDotPos",
"=",
"sort",
".",
"indexOf",
"(",
"\".\... | Add order to criteria, creating necessary subCriteria if nested sort property (ie. sort:'nested.property'). | [
"Add",
"order",
"to",
"criteria",
"creating",
"necessary",
"subCriteria",
"if",
"nested",
"sort",
"property",
"(",
"ie",
".",
"sort",
":",
"nested",
".",
"property",
")",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/GrailsHibernateQueryUtils.java#L242-L262 |
alkacon/opencms-core | src/org/opencms/ui/apps/resourcetypes/CmsNewResourceTypeDialog.java | CmsNewResourceTypeDialog.addResourceToModule | private void addResourceToModule(String resourcePath, CmsModule module) {
List<String> currentRessources = Lists.newArrayList(module.getResources());
for (String resource : currentRessources) {
if (resourcePath.startsWith(resource)) {
return;
}
}
... | java | private void addResourceToModule(String resourcePath, CmsModule module) {
List<String> currentRessources = Lists.newArrayList(module.getResources());
for (String resource : currentRessources) {
if (resourcePath.startsWith(resource)) {
return;
}
}
... | [
"private",
"void",
"addResourceToModule",
"(",
"String",
"resourcePath",
",",
"CmsModule",
"module",
")",
"{",
"List",
"<",
"String",
">",
"currentRessources",
"=",
"Lists",
".",
"newArrayList",
"(",
"module",
".",
"getResources",
"(",
")",
")",
";",
"for",
... | Adds the given resource to the module if necessary.<p>
@param resourcePath to be added
@param module module | [
"Adds",
"the",
"given",
"resource",
"to",
"the",
"module",
"if",
"necessary",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/resourcetypes/CmsNewResourceTypeDialog.java#L530-L540 |
jnr/jnr-x86asm | src/main/java/jnr/x86asm/Asm.java | Asm.mmword_ptr | public static final Mem mmword_ptr(Register base, Register index, int shift, long disp) {
return _ptr_build(base, index, shift, disp, SIZE_QWORD);
} | java | public static final Mem mmword_ptr(Register base, Register index, int shift, long disp) {
return _ptr_build(base, index, shift, disp, SIZE_QWORD);
} | [
"public",
"static",
"final",
"Mem",
"mmword_ptr",
"(",
"Register",
"base",
",",
"Register",
"index",
",",
"int",
"shift",
",",
"long",
"disp",
")",
"{",
"return",
"_ptr_build",
"(",
"base",
",",
"index",
",",
"shift",
",",
"disp",
",",
"SIZE_QWORD",
")",... | Create mmword (8 Bytes) pointer operand).
!
! @note This constructor is provided only for convenience for mmx programming. | [
"Create",
"mmword",
"(",
"8",
"Bytes",
")",
"pointer",
"operand",
")",
".",
"!",
"!"
] | train | https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/Asm.java#L587-L589 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/alias/AliasFactory.java | AliasFactory.createAliasForExpr | @SuppressWarnings("unchecked")
public <A> A createAliasForExpr(Class<A> cl, Expression<? extends A> expr) {
try {
return (A) proxyCache.get(Pair.<Class<?>, Expression<?>>of(cl, expr));
} catch (ExecutionException e) {
throw new QueryException(e);
}
} | java | @SuppressWarnings("unchecked")
public <A> A createAliasForExpr(Class<A> cl, Expression<? extends A> expr) {
try {
return (A) proxyCache.get(Pair.<Class<?>, Expression<?>>of(cl, expr));
} catch (ExecutionException e) {
throw new QueryException(e);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
">",
"A",
"createAliasForExpr",
"(",
"Class",
"<",
"A",
">",
"cl",
",",
"Expression",
"<",
"?",
"extends",
"A",
">",
"expr",
")",
"{",
"try",
"{",
"return",
"(",
"A",
")",
"proxy... | Create an alias instance for the given class and Expression
@param <A>
@param cl type for alias
@param expr underlying expression
@return alias instance | [
"Create",
"an",
"alias",
"instance",
"for",
"the",
"given",
"class",
"and",
"Expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/alias/AliasFactory.java#L79-L86 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Img.java | Img.getRemoteBufferedImage | @Override
public BufferedImage getRemoteBufferedImage(){
DirectColorModel cm = new DirectColorModel(32,
0x00ff0000, // Red
0x0000ff00, // Green
0x000000ff, // Blue
0xff000000 // Alpha
);
DataBufferInt buffer = new DataBuff... | java | @Override
public BufferedImage getRemoteBufferedImage(){
DirectColorModel cm = new DirectColorModel(32,
0x00ff0000, // Red
0x0000ff00, // Green
0x000000ff, // Blue
0xff000000 // Alpha
);
DataBufferInt buffer = new DataBuff... | [
"@",
"Override",
"public",
"BufferedImage",
"getRemoteBufferedImage",
"(",
")",
"{",
"DirectColorModel",
"cm",
"=",
"new",
"DirectColorModel",
"(",
"32",
",",
"0x00ff0000",
",",
"// Red",
"0x0000ff00",
",",
"// Green",
"0x000000ff",
",",
"// Blue",
"0xff000000",
"... | Creates a BufferedImage that shares the data of this Img. Changes in
this Img are reflected in the created BufferedImage and vice versa.
The created BufferedImage uses an ARGB DirectColorModel with an
underlying DataBufferInt (similar to {@link BufferedImage#TYPE_INT_ARGB})
@return BufferedImage sharing this Img's data... | [
"Creates",
"a",
"BufferedImage",
"that",
"shares",
"the",
"data",
"of",
"this",
"Img",
".",
"Changes",
"in",
"this",
"Img",
"are",
"reflected",
"in",
"the",
"created",
"BufferedImage",
"and",
"vice",
"versa",
".",
"The",
"created",
"BufferedImage",
"uses",
"... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Img.java#L513-L525 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java | ViewUtils.setText | public static void setText(Activity context, int field, String text) {
View view = context.findViewById(field);
if (view instanceof TextView) {
((TextView) view).setText(text);
} else {
Log.e("Caffeine", "ViewUtils.setText() given a field that is not a TextView");
... | java | public static void setText(Activity context, int field, String text) {
View view = context.findViewById(field);
if (view instanceof TextView) {
((TextView) view).setText(text);
} else {
Log.e("Caffeine", "ViewUtils.setText() given a field that is not a TextView");
... | [
"public",
"static",
"void",
"setText",
"(",
"Activity",
"context",
",",
"int",
"field",
",",
"String",
"text",
")",
"{",
"View",
"view",
"=",
"context",
".",
"findViewById",
"(",
"field",
")",
";",
"if",
"(",
"view",
"instanceof",
"TextView",
")",
"{",
... | Method used to set text for a TextView.
@param context The current Context or Activity that this method is called from.
@param field R.id.xxxx value for the text field.
@param text Text to place in the text field. | [
"Method",
"used",
"to",
"set",
"text",
"for",
"a",
"TextView",
"."
] | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java#L201-L208 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml4 | public static void escapeHtml4(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeHtml(text, offset, len, writer, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PL... | java | public static void escapeHtml4(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeHtml(text, offset, len, writer, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PL... | [
"public",
"static",
"void",
"escapeHtml4",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeHtml",
"(",
"text",
",",
"offset",
"... | <p>
Perform an HTML 4 level 2 (result is ASCII) <strong>escape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The five markup-significant characters: <tt><</tt>, <tt>></tt>, <tt>&</tt>,
<tt>"</tt> and <tt>'</tt></li>
<li>All non A... | [
"<p",
">",
"Perform",
"an",
"HTML",
"4",
"level",
"2",
"(",
"result",
"is",
"ASCII",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L957-L961 |
alkacon/opencms-core | src/org/opencms/ade/galleries/A_CmsTreeTabDataPreloader.java | A_CmsTreeTabDataPreloader.getCommonAncestorPath | private String getCommonAncestorPath(String rootPath1, String rootPath2) {
if (rootPath1 == null) {
return rootPath2;
}
if (rootPath2 == null) {
return rootPath1;
}
rootPath1 = CmsStringUtil.joinPaths("/", rootPath1, "/");
rootPath2 = Cms... | java | private String getCommonAncestorPath(String rootPath1, String rootPath2) {
if (rootPath1 == null) {
return rootPath2;
}
if (rootPath2 == null) {
return rootPath1;
}
rootPath1 = CmsStringUtil.joinPaths("/", rootPath1, "/");
rootPath2 = Cms... | [
"private",
"String",
"getCommonAncestorPath",
"(",
"String",
"rootPath1",
",",
"String",
"rootPath2",
")",
"{",
"if",
"(",
"rootPath1",
"==",
"null",
")",
"{",
"return",
"rootPath2",
";",
"}",
"if",
"(",
"rootPath2",
"==",
"null",
")",
"{",
"return",
"root... | Gets the common ancestor of two paths.<p>
@param rootPath1 the first path
@param rootPath2 the second path
@return the common ancestor path | [
"Gets",
"the",
"common",
"ancestor",
"of",
"two",
"paths",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/A_CmsTreeTabDataPreloader.java#L270-L296 |
codescape/bitvunit | bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlPageUtil.java | HtmlPageUtil.toHtmlPage | public static HtmlPage toHtmlPage(InputStream inputStream) {
try {
return toHtmlPage(IOUtils.toString(inputStream));
} catch (IOException e) {
throw new RuntimeException("Error creating HtmlPage from InputStream.", e);
}
} | java | public static HtmlPage toHtmlPage(InputStream inputStream) {
try {
return toHtmlPage(IOUtils.toString(inputStream));
} catch (IOException e) {
throw new RuntimeException("Error creating HtmlPage from InputStream.", e);
}
} | [
"public",
"static",
"HtmlPage",
"toHtmlPage",
"(",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"return",
"toHtmlPage",
"(",
"IOUtils",
".",
"toString",
"(",
"inputStream",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"ne... | Creates a {@link HtmlPage} from a given {@link InputStream} that reads the HTML code for that page.
@param inputStream {@link InputStream} that reads the HTML code
@return {@link HtmlPage} for this {@link InputStream} | [
"Creates",
"a",
"{",
"@link",
"HtmlPage",
"}",
"from",
"a",
"given",
"{",
"@link",
"InputStream",
"}",
"that",
"reads",
"the",
"HTML",
"code",
"for",
"that",
"page",
"."
] | train | https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlPageUtil.java#L47-L53 |
dodie/scott | scott/src/main/java/hu/advancedweb/scott/instrumentation/transformation/ScottClassTransformer.java | ScottClassTransformer.calculateTransformationParameters | private InstrumentationActions calculateTransformationParameters(byte[] classfileBuffer, Configuration configuration) {
DiscoveryClassVisitor discoveryClassVisitor = new DiscoveryClassVisitor(configuration);
new ClassReader(classfileBuffer).accept(discoveryClassVisitor, 0);
return discoveryClassVisitor.getTransfo... | java | private InstrumentationActions calculateTransformationParameters(byte[] classfileBuffer, Configuration configuration) {
DiscoveryClassVisitor discoveryClassVisitor = new DiscoveryClassVisitor(configuration);
new ClassReader(classfileBuffer).accept(discoveryClassVisitor, 0);
return discoveryClassVisitor.getTransfo... | [
"private",
"InstrumentationActions",
"calculateTransformationParameters",
"(",
"byte",
"[",
"]",
"classfileBuffer",
",",
"Configuration",
"configuration",
")",
"{",
"DiscoveryClassVisitor",
"discoveryClassVisitor",
"=",
"new",
"DiscoveryClassVisitor",
"(",
"configuration",
")... | Based on the structure of the class and the supplied configuration, determine
the concrete instrumentation actions for the class.
@param classfileBuffer class to be analyzed
@param configuration configuration settings
@return instrumentation actions to be applied | [
"Based",
"on",
"the",
"structure",
"of",
"the",
"class",
"and",
"the",
"supplied",
"configuration",
"determine",
"the",
"concrete",
"instrumentation",
"actions",
"for",
"the",
"class",
"."
] | train | https://github.com/dodie/scott/blob/fd6b492584d3ae7e072871ff2b094cce6041fc99/scott/src/main/java/hu/advancedweb/scott/instrumentation/transformation/ScottClassTransformer.java#L40-L44 |
facebook/SoLoader | java/com/facebook/soloader/SysUtil.java | SysUtil.findAbiScore | public static int findAbiScore(String[] supportedAbis, String abi) {
for (int i = 0; i < supportedAbis.length; ++i) {
if (supportedAbis[i] != null && abi.equals(supportedAbis[i])) {
return i;
}
}
return -1;
} | java | public static int findAbiScore(String[] supportedAbis, String abi) {
for (int i = 0; i < supportedAbis.length; ++i) {
if (supportedAbis[i] != null && abi.equals(supportedAbis[i])) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"findAbiScore",
"(",
"String",
"[",
"]",
"supportedAbis",
",",
"String",
"abi",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"supportedAbis",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"supportedAbis"... | Determine how preferred a given ABI is on this system.
@param supportedAbis ABIs on this system
@param abi ABI of a shared library we might want to unpack
@return -1 if not supported or an integer, smaller being more preferred | [
"Determine",
"how",
"preferred",
"a",
"given",
"ABI",
"is",
"on",
"this",
"system",
"."
] | train | https://github.com/facebook/SoLoader/blob/263af31d2960b2c0d0afe79d80197165a543be86/java/com/facebook/soloader/SysUtil.java#L45-L53 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.